diff --git a/src/views/produce/order/base/orderManage/components/addWorkOrder.vue b/src/views/produce/order/base/orderManage/components/addWorkOrder.vue
index 83289a8f..de5a6be7 100644
--- a/src/views/produce/order/base/orderManage/components/addWorkOrder.vue
+++ b/src/views/produce/order/base/orderManage/components/addWorkOrder.vue
@@ -5,13 +5,10 @@
-
-
-
+
+
+
@@ -23,11 +20,8 @@
-
-
+
{{ item.name }}
{{ item.specifications }}
@@ -37,13 +31,8 @@
-
+
@@ -51,34 +40,27 @@
-
+
-
+
-
+
-
+
@@ -96,10 +78,7 @@
-
@@ -108,11 +87,7 @@
-
+
@@ -120,11 +95,7 @@
-
+
@@ -136,9 +107,18 @@
+
+
+
+
+
+
+
+
-
+
+
@@ -148,6 +128,7 @@
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine'
+import { listDept } from '@/api/system/dept';
import moment from 'moment'
export default {
name: 'AddWorkOrder',
@@ -162,6 +143,7 @@ export default {
planStartTime: '',
planFinishTime: '',
planAssignQuantity: 0,
+ deptId:undefined,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
@@ -171,6 +153,7 @@ export default {
workers: '',
planAssignmentQuantity: ''
},
+ deptList:[],
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
planProductId: [{ required: true, message: "产品名称不能为空", trigger: "change" }],
@@ -209,6 +192,9 @@ export default {
}
},
getList() {
+ listDept().then(res => {
+ this.deptList = res.data || []
+ })
// 产品
getProductAll().then(res => {
this.productList = res.data || []
diff --git a/src/views/produce/workOrder/addWorkOrder.vue b/src/views/produce/workOrder/addWorkOrder.vue
index d8314256..7ebf55c5 100644
--- a/src/views/produce/workOrder/addWorkOrder.vue
+++ b/src/views/produce/workOrder/addWorkOrder.vue
@@ -13,12 +13,9 @@
-
-
+
+
@@ -32,23 +29,15 @@
-
-
+
@@ -56,22 +45,21 @@
-
+
-
+
-
-
+
+
@@ -84,7 +72,8 @@
产品基础BOM
工艺扩展BOM
-->
-
+
@@ -93,10 +82,7 @@
-
@@ -105,11 +91,7 @@
-
+
@@ -119,11 +101,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -149,7 +135,7 @@ import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add';
-
+import { listDept } from '@/api/system/dept';
export default {
name: 'AddWorkOrder',
mixins: [basicAdd],
@@ -167,6 +153,7 @@ export default {
workOrderId: '',
name: '',
code: '',
+ deptId:undefined,
planProductId: '',
specifications: '',
planStartTime: '',
@@ -192,6 +179,7 @@ export default {
productList: [],
processFlowList: [],
productLineList: [],
+ deptList:[],
workOrderTypeList: [
{id: 1,name:'普通'},
{id: 2, name:'特殊'}
@@ -236,7 +224,7 @@ export default {
if (this.dataForm.priority !== undefined) {
this.dataForm.priority = String(this.dataForm.priority)
}
- this.dataForm.priority
+ this.dataForm.priority
});
} else {
if (this.urlOptions.isGetCode) {
@@ -275,7 +263,7 @@ export default {
name: this.dataForm.name
});
}).catch(() => {
- this.$emit("refreshDataList");
+ this.$emit("refreshDataList");
});
});
});
@@ -296,6 +284,9 @@ export default {
getLineAll().then(res => {
this.productLineList = res.data || []
})
+ listDept().then(res => {
+ this.deptList = res.data || []
+ })
// 工艺
getProcessFlowList().then(res => {
this.processFlowList = res.data || []
@@ -321,4 +312,4 @@ export default {
}
}
}
-
\ No newline at end of file
+
diff --git a/src/views/produce/workOrder/index.vue b/src/views/produce/workOrder/index.vue
index a8e242c3..d4669390 100644
--- a/src/views/produce/workOrder/index.vue
+++ b/src/views/produce/workOrder/index.vue
@@ -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()
},