diff --git a/src/views/plan/plan/index.vue b/src/views/plan/plan/index.vue index a363f95..1ebe50a 100644 --- a/src/views/plan/plan/index.vue +++ b/src/views/plan/plan/index.vue @@ -1136,6 +1136,7 @@ export default { handleSelectionChange(selection) { // 初始化 this.checkSelect = true + /** // 如果选择中班次冲突 for (let i = 0; i < selection.length; i++) { if (selection[0].shiftId != selection[i].shiftId) { @@ -1146,6 +1147,7 @@ export default { this.checkSelect = false } } + **/ this.ids = selection.map(item => item.id) this.single = selection.length !== 1 this.multiple = !selection.length diff --git a/src/views/plan/whiteOrder/index.vue b/src/views/plan/whiteOrder/index.vue index f5f3813..24a58e3 100644 --- a/src/views/plan/whiteOrder/index.vue +++ b/src/views/plan/whiteOrder/index.vue @@ -394,27 +394,17 @@ - - - - - + - - - - + + @@ -424,6 +414,18 @@ + + + + + + + + + + + + @@ -437,6 +439,20 @@ + + + + + + + + + @@ -522,6 +538,56 @@ 取 消 + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + 确定 + + @@ -573,7 +639,9 @@ export default { shiftId: null, routeCode: null, formFields: [], - carNum: null + carNum: null, + materialCode: null, + materialName: null }, // 拆分-拆分订单列表加载 refreshProTable: true, @@ -672,7 +740,17 @@ export default { headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()}, // 上传的地址 url: process.env.VUE_APP_BASE_API + "/plan/order/importData" - } + }, + //组成白坯物料弹窗 + innerBPVisible: false, + materielParams: { + mtart: 'material_type1', + productCode: null, + productDescZh: null, + pageNum: 1, + pageSize: 10, + }, + materielBP: [], }; }, created() { @@ -795,7 +873,9 @@ export default { productDate: null, shiftId: null, routeCode: null, - formFields: [] + formFields: [], + materialCode: null, + materialName: null } this.splitData = [] this.productData = [] @@ -871,7 +951,14 @@ export default { } if (this.splitForm.productDate == null) { this.$message({ - message: '请选择工单日期!!', + message: '请选择工单日期!', + type: 'warning' + }) + return + } + if (this.splitForm.materialCode == null) { + this.$message({ + message: '请选择组成白坯的物料!', type: 'warning' }) return @@ -908,7 +995,9 @@ export default { splitNum: this.splitForm.splitNum, product: this.productData[0], routeCode: this.splitForm.routeCode, - carNum: this.splitForm.carNum + carNum: this.splitForm.carNum, + materialCode: this.splitForm.materialCode, + materialName: this.splitForm.materialName } subSplitOrder(data).then(response => { @@ -930,7 +1019,9 @@ export default { splitNum: null, productDate: null, shiftId: null, - formFields: [] + formFields: [], + materialCode:null, + materialName:null } this.formFields = [{ batchCode: '', @@ -1016,7 +1107,9 @@ export default { productDate: null, shiftId: null, routeCode: null, - formFields: [] + formFields: [], + materialCode:null, + materialName:null }; this.splitData = []; @@ -1379,7 +1472,51 @@ export default { // 导入-下载模板 importTemplate() { this.download('/plan/whiteOrder/importTemplate', {}, `order_example_template_${new Date().getTime()}.xlsx`) - } + }, + //新增-打开组成白坯选择物料窗口 + selectBPMateriel() { + // 清除搜索缓存 + this.materielParams.productCode = null; + this.materielParams.productDescZh = null; + this.innerBPVisible = true; + this.getBPMaterielList(); + }, + //新增-打开组成白坯选择物料窗口 + getBPMaterielList() { + this.loading = true; + selectMaterielList(this.materielParams).then(response => { + this.materielList = response.rows; + this.total = response.total; + this.loading = false; + } + ); + }, + // 新增-打开组成白坯选择物料窗口-选中物料信息 + selectionChange(e) { + this.materielBP = e; + }, + // 新增-打开组成白坯选择物料窗口-确认选择物料 + subMaterielBP() { + if (this.materielBP.length == 0) { + this.$message({ + message: '请选择物料!', + type: 'warning' + }) + return + } + if (this.materielBP.length > 1) { + this.$message({ + message: '物料只能选择一个!', + type: 'warning' + }) + return + } + + this.splitForm.materialCode = this.materielBP[0].productCode; + this.splitForm.materialName = this.materielBP[0].productDescZh; + + this.innerBPVisible = false; + }, } }; diff --git a/src/views/plan/workorder/index.vue b/src/views/plan/workorder/index.vue index 2a2ba62..9b8663d 100644 --- a/src/views/plan/workorder/index.vue +++ b/src/views/plan/workorder/index.vue @@ -68,12 +68,9 @@ - + @@ -188,10 +185,7 @@ {{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }} - - - - + @@ -275,10 +269,7 @@ prop="prodLineCode" label="产线设备"> - - - - + @@ -354,15 +345,6 @@ - - - - - @@ -370,28 +352,44 @@ > - - - - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -399,6 +397,19 @@ + + + + + + + + + @@ -446,7 +457,7 @@ - + @@ -456,7 +467,56 @@ 取 消 + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + 确定 + + @@ -472,12 +532,12 @@ import { checkWorkOrder } from '@/api/plan/workorder' import moment from 'moment'; -import { getProEquipment, getProRoutes, getProShifts} from '@/api/plan/order' +import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order' import {prototype} from "clipboard"; export default { name: "Workorder", - dicts: ['product_type', 'workorder_type', 'shift_type'], + dicts: ['product_type', 'workorder_type'], data() { return { // 拆分车数换算值 @@ -539,6 +599,9 @@ export default { shiftId: null, routeCode: null, carNum: 0, + prodType:null, + materialCode:null, + materialName:null }, // 遮罩层 loading: true, @@ -617,12 +680,28 @@ export default { }, /**********************************/ eRouteProps: {multiple: true}, - eRouteOptions: [] + eRouteOptions: [], + // 班次 + workShift: [], + //组成白坯物料弹窗 + innerBPVisible: false, + materielParams: { + mtart: 'material_type1', + productCode: null, + productDescZh: null, + pageNum: 1, + pageSize: 10, + }, + materielBP: [], }; }, created() { this.getList(); + // 获取班次信息 + getProShifts().then(response => { + this.workShift = response.data + }) }, methods: { // 变更-车数数量校验 @@ -701,13 +780,14 @@ export default { productDate: null, shiftId: null, routeCode: null, - carNum: null + carNum: null, + prodType:null, + materialCode:null, + materialName:null } this.formFields = [] this.converCarNum = null; - //初始化日期为默认今天 - this.splitForm.productDate = new Date() // 获取班次信息 getProShifts().then(response => { this.workShift = response.data @@ -741,8 +821,14 @@ export default { getOrderAndWork(this.selectWork).then(response => { this.splitData.push(response.data.workOrder) this.productData.push(response.data.order) + + //订单产品类型 + this.splitForm.prodType = this.splitData[0].prodType + if(this.productData[0].prodType == 'white') { this.checkType = true + this.splitForm.materialName = this.splitData[0].materialName + this.splitForm.materialCode = this.splitData[0].materialCode }else { this.checkType = false } @@ -771,6 +857,13 @@ export default { // 设置工艺 this.splitForm.routeCode = this.splitData[0].routeCode + //初始化日期为默认今天 + if(this.splitData[0].productDate != null){ + this.splitForm.productDate = this.splitData[0].productDate; + }else{ + this.splitForm.productDate = new Date(); + } + // 订单为白坯 if (this.productData[0].prodType == 'white'){ @@ -1050,6 +1143,8 @@ export default { routeCode: this.workForm.routeCode, proOrderWorkorder: this.selectWork, carNum: this.workForm.carNum, + materialCode: this.splitForm.materialCode, + materialName: this.splitForm.materialName } subChangeWorkOrder(data).then(response => { @@ -1070,7 +1165,9 @@ export default { productDate: null, shiftId: null, formFields: [], - carNum: null + carNum: null, + materialCode: null, + materialName: null } this.formFields = [{ batchCode: '', @@ -1228,6 +1325,60 @@ export default { //this.reset(); //this.open = true; //this.title = "添加生产工单"; + }, + shiftFormat(row,column){ + let array = this.workShift; + let value = '其他'; + array.forEach((item) => { + if (item.shiftId == row.shiftId) { + value = item.shiftDesc + } + }) + return value; + }, + //新增-打开组成白坯选择物料窗口 + selectBPMateriel() { + // 清除搜索缓存 + this.materielParams.productCode = null; + this.materielParams.productDescZh = null; + this.innerBPVisible = true; + this.getBPMaterielList(); + }, + //新增-打开组成白坯选择物料窗口 + getBPMaterielList() { + this.loading = true; + selectMaterielList(this.materielParams).then(response => { + this.materielList = response.rows; + this.total = response.total; + this.loading = false; + } + ); + }, + // 新增-打开组成白坯选择物料窗口-选中物料信息 + selectionChange(e) { + this.materielBP = e; + }, + // 新增-打开组成白坯选择物料窗口-确认选择物料 + subMaterielBP() { + if (this.materielBP.length == 0) { + this.$message({ + message: '请选择物料!', + type: 'warning' + }) + return + } + if (this.materielBP.length > 1) { + this.$message({ + message: '物料只能选择一个!', + type: 'warning' + }) + return + } + + this.splitForm.materialCode = this.materielBP[0].productCode; + this.splitForm.materialName = this.materielBP[0].productDescZh; + + this.innerBPVisible = false; } } };