This commit is contained in:
‘937886381’
2024-09-11 14:26:39 +08:00
parent c847ba1595
commit 9581d91c52
3 changed files with 177 additions and 183 deletions

View File

@@ -60,68 +60,9 @@ import {
getConOrderList,
getCoreWOList
} from '@/api/base/coreWorkOrder';
import { listDept } from '@/api/system/dept';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'name',
label: '工单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'workers',
label: '负责人',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'planQuantity',
label: '计划生产数量',
minWidth: 120,
},
{
prop: 'actualQuantity',
label: '实际生产数量',
minWidth: 120,
}
];
export default {
mixins: [basicPage],
components: {
@@ -134,37 +75,38 @@ export default {
urlOptions: {
getDataListURL: getCoreWOPage,
deleteURL: deleteCoreWO
},
detailVisible: false,
},
departments:[],
detailVisible: false,
departmentsLoaded: false,
materialVisible: false,
allocationVisible: false,
tableProps,
tableBtn: [
this.$auth.hasPermi(`base:core-work-order:material`)
? {
type: 'material',
btnName: '原料信息',
}
: undefined,
{
type: 'active',
btnName: '激活',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
},
{
name: 'status',
type: 'equal',
value: 3
}
]
}
},
// this.$auth.hasPermi(`base:core-work-order:material`)
// ? {
// type: 'material',
// btnName: '原料信息',
// }
// : undefined,
// {
// type: 'active',
// btnName: '激活',
// showParam: {
// type: '|',
// data: [
// {
// name: 'status',
// type: 'equal',
// value: 1
// },
// {
// name: 'status',
// type: 'equal',
// value: 3
// }
// ]
// }
// },
{
type: 'pause',
btnName: '暂停',
@@ -323,13 +265,88 @@ export default {
},
],
};
},
mounted() {
},
computed: {
tableProps() {
return [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'name',
label: '工单名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '工单编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'deptId',
label: '负责部门',
minWidth: 100,
showOverflowtooltip: true,
filter: (val) => {
if (this.departmentsLoaded) {
const department = this.departments.find((dept) => dept.id === val);
return department ? department.name : '';
} else {
return '';
}
},
},
{
prop: 'priority',
label: '优先级',
filter: (val) => ['', '低', '正常', '高'][val]
},
{
prop: 'triggerOrigin',
label: '来源',
filter: (val) => ['', 'MES-手动', 'MES-订单下发', 'ERP'][val]
},
{
prop: 'status',
label: '工单状态',
filter: (val) => ['', '等待', '激活', '暂停', '完成', '', '', '', '', '作废'][val]
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'planQuantity',
label: '计划生产数量',
minWidth: 120,
},
{
prop: 'actualQuantity',
label: '实际生产数量',
minWidth: 120,
}
];
}
},
mounted() {
console.log(this.$route.query.workOrderName)
if (this.$route.query.workOrderName) {
this.listQuery.name = this.$route.query.workOrderName;
this.formConfig[0].defaultSelect = this.$route.query.workOrderName;
}
}
listDept().then(res => {
this.departments = res.data || []
this.departmentsLoaded = true;
})
// this.getWorkOrder()
this.getDataList()
},