Commit 7fe0e0a8 authored by 沈翠玲's avatar 沈翠玲

生产报表

parent a95b14d9
<template>
<el-dialog :title="$t('人员选择')"
v-if="showFlag"
:visible.sync="showFlag"
:modal= showModal
width="80%"
center
>
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
v-model="deptName"
:placeholder="$t('role.please_detname')"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" @submit.native.prevent ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('role.username')" prop="userName">
<el-input
v-model="queryParams.userName"
:placeholder="$t('role.please_username')"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="$t('role.usernick')" prop="nickName">
<el-input
v-model="queryParams.nickName"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="userList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column width="55" align="center" >
<template v-slot="scope">
<el-radio v-model="selectedId" :label="scope.row.userId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
</template>
</el-table-column>
<el-table-column :label="$t('role.username')" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column :label="$t('role.usernick')" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">{{ $t('common.confirm') }}</el-button>
<el-button @click="showFlag=false">{{ $t('common.cancel') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "UserSingleSelect",
dicts: ['sys_normal_disable', 'sys_user_sex'],
props: {
showModal: {
default: false
}
},
components: { Treeselect },
data() {
return {
showFlag:false,
// 遮罩层
loading: true,
// 选中数组
selectedId: null,
selectedRow: null,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
deptName: undefined,
// 日期范围
dateRange: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label"
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
nickName: undefined,
status: undefined,
deptId: undefined
},
// 列信息
columns: [
{ key: 0, label: this.$t('用户编号'), visible: true },
{ key: 1, label: this.$t('用户名称'), visible: true },
{ key: 2, label: this.$t('用户昵称'), visible: true },
{ key: 3, label: this.$t('部门'), visible: true },
{ key: 4, label: this.$t('手机号码'), visible: true },
{ key: 5, label: this.$t('状态'), visible: true },
{ key: 6, label: this.$t('创建时间'), visible: true }
],
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
}
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then(response => {
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
handleCurrent(row){
if(row){
this.selectedRow = row;
}
},
//行双击选中
handleRowDbClick(row){
if(row){
this.selectedRow = row;
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
}
},
// 单选选中数据
handleRowChange(row) {
debugger;
if(row){
this.selectedRow = row;
}
},
//确定选中
confirmSelect(){
if(this.selectedId == null || this.selectedId == 0){
this.$notify({
title:this.$t('提示'),
type:'warning',
message: this.$t('请至少选择一条数据!')
});
return;
}
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
}
}
};
</script>
......@@ -3054,5 +3054,6 @@
"九月": "กันยายน",
"十月": "ตุลาคม",
"十一月": "พฤศจิกายน",
"十二月": "ธันวาคม"
"十二月": "ธันวาคม",
"排产次数": "จำนวนการปลดปล่อย"
}
......@@ -3054,5 +3054,6 @@
"九月": "九月",
"十月": "十月",
"十一月": "十一月",
"十二月": "十二月"
"十二月": "十二月",
"排产次数": "排产次数"
}
......@@ -54,8 +54,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('统计')">
<el-row align="center" style="line-height: 40px;">
<el-col :span="1">{{$t('统计方式')}}</el-col>
<el-col :span="4">
<el-col :span="7">{{$t('统计方式')}}
<el-select v-model="statisisType" clearable :placeholder="$t('请选择统计方式')">
<el-option v-for="item in statisisList"
:key="item"
......@@ -68,8 +67,8 @@
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tbodys" :max-height="tableHeight">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders" :key="index">
<el-table v-loading="loading" :data="tbodys1" :max-height="tableHeight">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders1" :key="index">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" />
<div v-else>{{ scope.row[item.value] }}</div>
......@@ -98,6 +97,7 @@ import i18n from '../../../../i18n/index'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByDefect, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly";
import ItemSelect from "@/components/itemSelect/single.vue";
import reasonSelect from "@/components/reasonSelect/single.vue"
import dayjs from 'dayjs'
export default {
name: "ScheduleSetupRule",
......@@ -126,6 +126,8 @@ export default {
total: 0,
// 排产换型对照信息表格数据
tbodys: [],
tbodys1: [],
theaders1: [],
theaders: [],
// 弹出层标题
title: "",
......@@ -134,7 +136,7 @@ export default {
// 是否显示弹出层
open: false,
tableHeight: 0,
daterangePurchaseDate: [],
daterangePurchaseDate: [dayjs().startOf('month').format('YYYY-MM-DD'), dayjs().endOf('month').format('YYYY-MM-DD')],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -173,7 +175,12 @@ export default {
this._resizeHandler()
})
this._resizeHandler = () => {
this.tableHeight = window.innerHeight - 350
const arr = document.getElementsByClassName('el-form')
const height = arr[0].offsetHeight
const arr1 = document.getElementsByClassName('app-main')
const height1 = arr1[0].offsetHeight
console.log('this.tabIndex', this.tabIndex)
this.tableHeight = height1 - height - (this.tabIndex ? 200 : 170)
}
window.addEventListener('resize', this._resizeHandler)
},
......@@ -190,13 +197,13 @@ export default {
{label: i18n.t('订单号'), value: 'orderCode', width: '80px'},
{label: i18n.t('生产工单'), value: 'workorderCode', width: '140px'},
{label: i18n.t('产品编码'), value: 'productCode', width: '120px'},
{label: i18n.t('产品名称'), value: 'productName', width: '120px'},
{label: i18n.t('产品名称'), value: 'productName', width: '240px'},
{label: i18n.t('工序任务'), value: 'taskCode', width: '120px'},
{label: i18n.t('工序名称'), value: 'processName', width: '80px'},
{label: i18n.t('工作中心编码'), value: 'workstationCode', width: '100px'},
{label: i18n.t('工作中心名称'), value: 'workstationName', width: '140px'},
{label: i18n.t('工作单元编码'), value: 'workunitCode', width: '100px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '140px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '280px'},
{label: i18n.t('报工人员编码'), value: 'userName', width: '140px'},
{label: i18n.t('报工人员名称'), value: 'nickName', width: '140px'},
{label: i18n.t('派工数量'), value: 'quantity', width: '80px'},
......@@ -207,10 +214,6 @@ export default {
{label: i18n.t('不合格时间'), value: 'feedbackTime', width: '100px'}
]
this.handleQuery()
} else {
this.statisisType = null
this.theaders = []
this.total = 0
}
},
immediate: true
......@@ -238,8 +241,10 @@ export default {
}
},
tabClick(val){
console.log('this.tabIndex', this.tabIndex, val)
this.tabIndex = val.index
this.$nextTick(() => {
this._resizeHandler()
})
},
onItemSelect(row) {
if (row != undefined) {
......@@ -253,12 +258,15 @@ export default {
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}
} else {
this.queryParams['startDate'] = null
this.queryParams['endDate'] = null
}
let api = getList
if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){
api = getListByWorkOrder
this.theaders = [
this.theaders1 = [
{label: i18n.t('工单编码'), value: 'workorderCode'},
{label: i18n.t('工单名称'), value: 'workorderName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -269,7 +277,7 @@ export default {
} else if(this.statisisType === i18n.t('不合格原因')){
api = getListByDefect
this.theaders = [
this.theaders1 = [
{label: i18n.t('不合格原因'), value: 'abnormalReason'},
{label: i18n.t('不合格备注'), value: 'abnormalRemark'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -278,7 +286,7 @@ export default {
{label: i18n.t('合格率'), value: 'qualificationRate'}
]
} else if(this.statisisType === i18n.t('车间')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('车间编号'), value: 'workshopCode'},
{label: i18n.t('车间名称'), value: 'workshopName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -288,7 +296,7 @@ export default {
]
api = getListByWorkshop
} else if(this.statisisType === i18n.t('工作中心')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工作中心编号'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -298,7 +306,7 @@ export default {
]
api = getListByWorkstation
} else if(this.statisisType === i18n.t('工作单元')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -308,7 +316,7 @@ export default {
]
api = getListByWorkunit
} else if(this.statisisType === i18n.t('工序')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工序编码'), value: 'processCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -318,7 +326,7 @@ export default {
]
api = getListByProcess
} else if(this.statisisType === i18n.t('人员')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -330,7 +338,12 @@ export default {
}
}
api(this.queryParams).then(response => {
this.tbodys = response.rows;
if (Number(this.tabIndex) === 1) {
this.tbodys1 = response.rows
}
else {
this.tbodys = response.rows
}
this.total = response.total;
this.loading = false;
});
......
......@@ -98,6 +98,7 @@ import i18n from '../../../../i18n/index'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByDefect, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly";
import ItemSelect from "@/components/itemSelect/single.vue";
import reasonSelect from "@/components/reasonSelect/single.vue"
import dayjs from 'dayjs'
export default {
name: "ScheduleSetupRule",
......@@ -134,7 +135,7 @@ export default {
// 是否显示弹出层
open: false,
tableHeight: 0,
daterangePurchaseDate: [],
daterangePurchaseDate: [dayjs().startOf('month').format('YYYY-MM-DD'), dayjs().endOf('month').format('YYYY-MM-DD')],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -191,12 +192,12 @@ export default {
{label: i18n.t('生产工单'), value: 'workorderCode', width: '140px'},
{label: i18n.t('产品编码'), value: 'productCode', width: '120px'},
{label: i18n.t('产品名称'), value: 'productName', width: '120px'},
{label: i18n.t('工序任务'), value: 'taskCode', width: '120px'},
{label: i18n.t('工序任务'), value: 'taskCode', width: '240px'},
{label: i18n.t('工序名称'), value: 'processName', width: '80px'},
{label: i18n.t('工作中心编码'), value: 'workstationCode', width: '100px'},
{label: i18n.t('工作中心名称'), value: 'workstationName', width: '140px'},
{label: i18n.t('工作单元编码'), value: 'workunitCode', width: '100px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '140px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '280px'},
{label: i18n.t('报工人员编码'), value: 'userName', width: '140px'},
{label: i18n.t('报工人员名称'), value: 'nickName', width: '140px'},
{label: i18n.t('派工数量'), value: 'quantity', width: '80px'},
......@@ -253,7 +254,10 @@ export default {
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
}
} else {
this.queryParams['startDate'] = null
this.queryParams['endDate'] = null
}
let api = getList
if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){
......
......@@ -124,7 +124,7 @@ import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
import UserSingleSelect from "@/components/userSelect/single1.vue"
import dayjs from 'dayjs'
export default {
name: "ScheduleSetupRule",
......
......@@ -121,7 +121,7 @@ import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
import UserSingleSelect from "@/components/userSelect/single1.vue"
import dayjs from 'dayjs'
export default {
name: "ScheduleSetupRule",
......
......@@ -23,7 +23,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tbodys" @row-click="mainTableClick" :max-height="tableHeight">
<el-table v-loading="loading" :data="tbodys" @row-click="mainTableClick" :height="tableHeight" :row-class-name="tableRowClassName">
<el-table-column :label="$t('项目号')" align="center" prop="customerProjectNo"></el-table-column>
<el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column>
<el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"></el-table-column>
......@@ -51,7 +51,7 @@
@pagination="getList"
/>
<div class="second-box" v-if="isShowSecond">
<el-table v-loading="loadingLeft" :data="tbodysLeft" border @row-click="secondTableClick" :max-height="tableHeightSecond">
<el-table v-loading="loadingLeft" :data="tbodysLeft" border @row-click="secondTableClick" :max-height="tableHeightSecond" :row-class-name="tableRowClassName1">
<el-table-column :label="$t('状态')" align="center" prop="status"></el-table-column>
<el-table-column :label="$t('工序名称')" align="center" prop="processName"></el-table-column>
<el-table-column :label="$t('派工数量')" align="center" prop="quantity"></el-table-column>
......@@ -59,7 +59,11 @@
</el-table-column>
<el-table-column :label="$t('合格数量')" align="center" prop="quantityQualify"></el-table-column>
<el-table-column :label="$t('不合格数量')" align="center" prop="quantityUnqualify"></el-table-column>
<el-table-column :label="$t('合格率')" align="center" prop="passRate"></el-table-column>
<el-table-column :label="$t('合格率')" align="center" prop="passRate">
<template slot-scope="scope">
{{scope.row.passRate ? `${scope.row.passRate}%` : ''}}
</template>
</el-table-column>
</el-table>
<el-table v-loading="loadingRight" :data="tbodysRight" border :max-height="tableHeightSecond" style="margin-left: 15px">
<el-table-column :label="$t('报工人员')" align="center" prop="nickName"></el-table-column>
......@@ -98,6 +102,8 @@ export default {
loadingLeft: true,
loadingRight: true,
isShowSecond: false,
highlightRow: null, // 当前高亮的行
highlightRow1: null, // 当前高亮的行
tbodysLeft:[],
tbodysRight:[],
tableHeightSecond: 0,
......@@ -177,7 +183,8 @@ export default {
methods: {
mainTableClick(row){
this.loadingLeft = true;
getProcessList({workorderCode: row.workorderCode}).then(response => {
this.highlightRow = row;
getProcessList({workorderCode: row.workorderCode, taskWorkunitId: row.taskWorkunitId}).then(response => {
response.rows.forEach(element => {
element['workorderCode'] = row.workorderCode
});
......@@ -189,7 +196,8 @@ export default {
},
secondTableClick(row) {
this.loadingRight = true;
getFeedbackList({workorderCode: row.workorderCode, taskId: row.taskId}).then(response => {
this.highlightRow1 = row;
getFeedbackList({workorderCode: row.workorderCode, taskId: row.taskId, taskWorkunitId: row.taskWorkunitId}).then(response => {
this.tbodysRight = response.rows;
this.loadingRight = false;
});
......@@ -199,10 +207,30 @@ export default {
this.queryParams.productName = row.itemName;
}
},
tableRowClassName({ row, rowIndex }) {
if(!row.workorderId || !this.highlightRow) return ''
// 如果当前行是高亮行,则添加特定的类名
if (row.workorderId === this.highlightRow.workorderId) {
return 'highlight-row';
}
return '';
},
tableRowClassName1({ row, rowIndex }) {
// 如果当前行是高亮行,则添加特定的类名
if (row === this.highlightRow1) {
return 'highlight-row';
} if (row.status === '已完工') {
return 'green';
} if (row.status === '故障停工' || row.status === '暂停') {
return 'red';
} if (row.status === '加工中') {
return 'blue';
}
return '';
},
/** 查询排产换型对照信息列表 */
getList() {
this.loading = true;
this.isShowSecond = false
this.queryParams['defectStatus'] = true
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
......@@ -261,5 +289,30 @@ export default {
.pagination-container {
padding: 0px 20px !important;
}
::v-deep .highlight-row {
background-color: #e5eeff !important;
td {
background-color: #e5eeff !important;
}
}
::v-deep .green {
background-color: #aaf8aa !important;
td {
background-color: #aaf8aa !important;
}
}
::v-deep .blue {
background-color: #82ccf4 !important;
td {
background-color: #82ccf4 !important;
}
}
::v-deep .red {
background-color: #f48d82 !important;
td {
background-color: #f48d82 !important;
}
}
}
</style>
......@@ -100,8 +100,7 @@
</el-tab-pane>
<el-tab-pane :label="$t('统计')">
<el-row align="center" style="line-height: 40px;">
<el-col :span="1">{{$t('统计方式')}}</el-col>
<el-col :span="4">
<el-col :span="7">{{$t('统计方式')}}
<el-select v-model="statisisType" clearable :placeholder="$t('请选择统计方式')">
<el-option v-for="item in statisisList"
:key="item"
......@@ -114,8 +113,8 @@
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders" :key="index">
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders1" :key="index">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_workorder_type" :value="scope.row.workorderType" v-if="item.value==='workorderType'" />
<div v-else>{{ item.value === 'machineTime' ? scope.row[item.value] ? Number(scope.row[item.value]).toFixed(2) : scope.row[item.value] : scope.row[item.value] }}</div>
......@@ -156,6 +155,7 @@
<script>
import i18n from '../../../../i18n/index'
import dayjs from 'dayjs'
import { getList, getListByProcess, getListByUser, getListByWorkshop, getListByWorkOrder, getListByWorkstation, getListByWorkunit } from "@/api/mes/proTable/statistAnaly";
import ProcessSelect from "@/components/process/taskSelectSingle.vue";
......@@ -163,7 +163,7 @@ import i18n from '../../../../i18n/index'
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
import UserSingleSelect from "@/components/userSelect/single1.vue"
export default {
name: "ScheduleSetupRule",
......@@ -193,6 +193,8 @@ import i18n from '../../../../i18n/index'
// 排产换型对照信息表格数据
tbodys: [],
theaders: [],
tbodys1: [],
theaders1: [],
// 弹出层标题
title: "",
statisisType: null,
......@@ -200,7 +202,7 @@ import i18n from '../../../../i18n/index'
// 是否显示弹出层
open: false,
tableHeight: 0,
daterangePurchaseDate: [],
daterangePurchaseDate: [dayjs().startOf('month').format('YYYY-MM-DD'), dayjs().endOf('month').format('YYYY-MM-DD')],
// 查询参数
queryParams: {
pageNum: 1,
......@@ -236,7 +238,12 @@ import i18n from '../../../../i18n/index'
this._resizeHandler()
})
this._resizeHandler = () => {
this.tableHeight = window.innerHeight - 400
const arr = document.getElementsByClassName('el-form')
const height = arr[0].offsetHeight
const arr1 = document.getElementsByClassName('app-main')
const height1 = arr1[0].offsetHeight
console.log('this.tabIndex', this.tabIndex)
this.tableHeight = height1 - height - (this.tabIndex ? 200 : 170)
}
window.addEventListener('resize', this._resizeHandler)
},
......@@ -256,13 +263,13 @@ import i18n from '../../../../i18n/index'
{label: i18n.t('订单号'), value: 'orderCode', width: '80px'},
{label: i18n.t('生产工单'), value: 'workorderCode', width: '140px'},
{label: i18n.t('产品编码'), value: 'productCode', width: '120px'},
{label: i18n.t('产品名称'), value: 'productName', width: '120px'},
{label: i18n.t('产品名称'), value: 'productName', width: '240px'},
{label: i18n.t('工序任务'), value: 'taskCode', width: '120px'},
{label: i18n.t('工序名称'), value: 'processName', width: '80px'},
{label: i18n.t('工作中心编码'), value: 'workstationCode', width: '100px'},
{label: i18n.t('工作中心名称'), value: 'workstationName', width: '140px'},
{label: i18n.t('工作单元编码'), value: 'workunitCode', width: '100px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '140px'},
{label: i18n.t('工作单元名称'), value: 'workunitName', width: '280px'},
{label: i18n.t('报工人员编码'), value: 'userName', width: '140px'},
{label: i18n.t('报工人员名称'), value: 'nickName', width: '140px'},
{label: i18n.t('派工数量'), value: 'quantity', width: '80px'},
......@@ -276,10 +283,6 @@ import i18n from '../../../../i18n/index'
{label: i18n.t('报工时间'), value: 'feedbackTime', width: '100px'}
]
this.handleQuery()
} else {
this.statisisType = null
this.theaders = []
this.total = 0
}
},
immediate: true
......@@ -310,6 +313,9 @@ import i18n from '../../../../i18n/index'
tabClick(val){
console.log('this.tabIndex', this.tabIndex, val)
this.tabIndex = val.index
this.$nextTick(() => {
this._resizeHandler()
})
},
onItemSelect(row) {
if (row != undefined) {
......@@ -322,12 +328,15 @@ import i18n from '../../../../i18n/index'
if (this.daterangePurchaseDate && this.daterangePurchaseDate.length > 0) {
this.queryParams['startDate'] = this.daterangePurchaseDate[0]
this.queryParams['endDate'] = this.daterangePurchaseDate[1]
} else {
this.queryParams['startDate'] = null
this.queryParams['endDate'] = null
}
let api = getList
if (Number(this.tabIndex) === 1) {
if(this.statisisType === i18n.t('工单')){
api = getListByWorkOrder
this.theaders = [
this.theaders1 = [
{label: i18n.t('工单编码'), value: 'workorderCode'},
{label: i18n.t('工单名称'), value: 'workorderName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -337,7 +346,7 @@ import i18n from '../../../../i18n/index'
]
} else if(this.statisisType === i18n.t('车间')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('车间编号'), value: 'workshopCode'},
{label: i18n.t('车间名称'), value: 'workshopName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -347,7 +356,7 @@ import i18n from '../../../../i18n/index'
]
api = getListByWorkshop
} else if(this.statisisType === i18n.t('工作中心')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工作中心编号'), value: 'workstationCode'},
{label: i18n.t('工作中心名称'), value: 'workstationName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -357,7 +366,7 @@ import i18n from '../../../../i18n/index'
]
api = getListByWorkstation
} else if(this.statisisType === i18n.t('工作单元')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工作单元编码'), value: 'workunitCode'},
{label: i18n.t('工作单元名称'), value: 'workunitName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -367,7 +376,7 @@ import i18n from '../../../../i18n/index'
]
api = getListByWorkunit
} else if(this.statisisType === i18n.t('工序')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('工序编码'), value: 'processCode'},
{label: i18n.t('工序名称'), value: 'processName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -377,7 +386,7 @@ import i18n from '../../../../i18n/index'
]
api = getListByProcess
} else if(this.statisisType === i18n.t('人员')){
this.theaders = [
this.theaders1 = [
{label: i18n.t('报工人员编码'), value: 'userName'},
{label: i18n.t('报工人员名称'), value: 'nickName'},
{label: i18n.t('报工数量'), value: 'quantityFeedback'},
......@@ -389,7 +398,12 @@ import i18n from '../../../../i18n/index'
}
}
api(this.queryParams).then(response => {
this.tbodys = response.rows;
if (Number(this.tabIndex) === 1) {
this.tbodys1 = response.rows
}
else {
this.tbodys = response.rows
}
this.total = response.total;
this.loading = false;
});
......
......@@ -121,7 +121,7 @@ import ProcessSelect from "@/components/process/taskSelectSingle.vue";
import workshopSelect from "@/components/workshopSelect/single.vue";
import WorkuintSelect from "@/components/workunitSelect/single.vue";
import WorkstationSelect from "@/components/workstationSelect/simpletableSingle.vue"
import UserSingleSelect from "@/components/userSelect/single.vue"
import UserSingleSelect from "@/components/userSelect/single1.vue"
import dayjs from 'dayjs'
export default {
name: "ScheduleSetupRule",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment