diff --git a/src/api/plan/order.js b/src/api/plan/order.js index 3a639ea..04fedd3 100644 --- a/src/api/plan/order.js +++ b/src/api/plan/order.js @@ -33,6 +33,15 @@ export function getProRoutes(prodCode) { }) } +// 通过物料code获取工艺信息 +export function getCanProductLine(data) { + return request({ + url: '/plan/order/getCanProductLine', + method: 'post', + data: data + }) +} + // 获取当天的递增工单执行顺序 export function getProSortNo(productDate) { const data = { @@ -62,6 +71,14 @@ export function getWorkOrderList(id) { }) } +//排产预览 +export function getWorkOrderListCG(id) { + return request({ + url: '/plan/order/getWorkOrderListCG/' + id, + method: 'get' + }) +} + // 通过母订单id查询最新订单列表 export function getOrderList(id) { return request({ @@ -165,4 +182,31 @@ export function deleteOrder(orderIds) { url: '/plan/order/deleteOrder/' + orderIds, method: 'post' }); -} \ No newline at end of file +} + +//辅助排产 +export function autoSplitOrder(data) { + return request({ + url: '/plan/order/autoSplitOrder', + method: 'post', + data: data + }); +} + +//关闭窗口 +export function autoSplitOrderCancel(data) { + return request({ + url: '/plan/order/autoSplitOrderCancel', + method: 'post', + data: data + }); +} + +//确认排产 +export function autoSplitOrderOk(data) { + return request({ + url: '/plan/order/autoSplitOrderOk', + method: 'post', + data: data + }); +} diff --git a/src/api/plan/workorder.js b/src/api/plan/workorder.js index 6be3492..7d5a83e 100644 --- a/src/api/plan/workorder.js +++ b/src/api/plan/workorder.js @@ -174,3 +174,10 @@ export function removeWorkOrderBatch(batchCode,workorderCode) { }); } +export function getProdLineList() { + return request({ + url: '/plan/pro/workorder/getProdLineList', + method: 'get', + params: {} + }); +} \ No newline at end of file diff --git a/src/views/mes/dailyReportNew/index.vue b/src/views/mes/dailyReportNew/index.vue index c76183a..bcc1ea9 100644 --- a/src/views/mes/dailyReportNew/index.vue +++ b/src/views/mes/dailyReportNew/index.vue @@ -86,15 +86,8 @@ - - - + + 0){ + if(this.queryParams.timeArray.length>0){ this.queryParams.productDateStart = moment(this.queryParams.timeArray[0]).format('YYYY-MM-DD'); this.queryParams.productDateEnd = moment(this.queryParams.timeArray[1]).format('YYYY-MM-DD'); } @@ -199,7 +207,7 @@ export default { }); }, getWorkcenterList(){ - getWorkcenterList().then(data => { + getWorkcenterList().then(data => { this.options = data; }); this.queryParams.workCenter = this.options[0].factoryCode; @@ -212,11 +220,10 @@ export default { // 表单重置 reset() { this.form = { - }; this.resetForm("form"); }, - productCodeFormate(row, column, cellValue){ + productCodeFormate(row, column, cellValue){ if(cellValue != null){ return cellValue.slice(7,18); //返回值 } diff --git a/src/views/plan/order/index.vue b/src/views/plan/order/index.vue index b03de2e..a81502b 100644 --- a/src/views/plan/order/index.vue +++ b/src/views/plan/order/index.vue @@ -115,12 +115,15 @@ >导出 - + @@ -499,32 +502,67 @@ 取 消 - + - - - - - - - - - - {{ parseTime(scope.row.planProDate, '{y}-{m}-{d}') }} - - - - - - - - - 自动拆分 - 拆分结果 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.lineName }} + + + + + + + + - - - - - - - - - - - + - + + + @@ -565,13 +597,14 @@ import { getProEquipment, getProRoutes,getProSortNo, getProShifts, - getWorkOrderList, + getWorkOrderList,getWorkOrderListCG, subSplitOrder,checkRepeatBatchCodes, listOrder, addOrder, updateOrder, syncSAP, selectMaterielList,getAutoSplitList, - deleteOrder + deleteOrder,getCanProductLine, + autoSplitOrder,autoSplitOrderCancel,autoSplitOrderOk } from '@/api/plan/order' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -689,11 +722,18 @@ export default { /**********************************/ eRouteProps: {multiple: true}, eRouteOptions: [], - titleAutoSplit:"订单排产", + titleAutoSplit:"订单辅助排产", openAutoSplit:false, orderCodes:[], autoSplitList:[], - autoSplitLoading: true + openAutoSplit: false, + activeSplit: 0, + autoSplitform1:{ + productDate:null, + sortNo:null + }, + autoSplitform2: {lineCodes:[]}, + lineCodes:[] } }, created() { @@ -1335,6 +1375,9 @@ export default { this.dialogVisible = false; this.splitOpen = false; this.reset(); + this.openAutoSplit = false; + this.activeSplit = 0; + autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {}); }, // 判空、空串 checkNull(entity) { @@ -1444,7 +1487,7 @@ export default { } ) }, - /**自动排产**/ + /**辅助排产**/ // 多选框选中数据 handleAutoSplitSelection(selection) { this.single = selection.length !== 1 @@ -1453,11 +1496,33 @@ export default { }, //排产优先级 handleAutoSplit(row) { - debugger - this.autoSplitLoading = true; + this.openAutoSplit = true; this.autoSplitList = this.orderCodes; + + if(this.autoSplitList[0] == 'o2'){ + this.$modal.msgError("已经拆分结束!"); + } + + this.autoSplitform1.productDate = this.autoSplitList[0].planProDate; + // 获取工艺信息(工艺选最新的) + getProRoutes(this.autoSplitList[0].prodCode).then(response => { + this.routes = response.data; + this.autoSplitform1.routeCode = response.data[0].routeCode; + + }) + //var ymd = moment(this.autoSplitform1.productDate).format('YYYY-MM-DD') + // 获取工单生产顺序 + getProSortNo(this.autoSplitform1.productDate).then(response => { + this.autoSplitform1.sortNo = response + }) + // 获取生产线体列表 + getCanProductLine(this.autoSplitList[0]).then(response => { + this.lineCodes = response.lineList; + this.autoSplitform2.lineCodes = response.recommendLineList;//['XL01','XL02']; + }) + + this.openAutoSplit = true; - this.autoSplitLoading = false; }, //判断勾选 selectable(row, index) { @@ -1494,7 +1559,44 @@ export default { } }); - } + }, + next() { + if (this.activeSplit++ > 2) this.activeSplit = 0; + //选完线体后的下一步,会进行模拟拆分 + if(this.activeSplit == 2){ + autoSplitOrder(Object.assign({},this.autoSplitList[0],this.autoSplitform1,this.autoSplitform2)).then(response => { + this.workerLoading = true // 设置加载状态为true,表示正在加载 + // 获取历史拆分工单信息 + getWorkOrderListCG(this.autoSplitList[0].id).then(response => { + var data = response.data + this.splitData = data + + this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格 + this.$nextTick(() => { + // 使用$nextTick来等待DOM更新完成 + this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格 + this.workerLoading = false // 设置加载状态为false,表示加载完成 + }) + }) + }); + } + }, + prev(){ + if (this.activeSplit-- > 2) this.activeSplit = 2; + //会进行模拟拆分的取消 + if(this.activeSplit == 1){ + autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => { + }); + } + }, + autoSplitCommit(){ + autoSplitOrderOk(Object.assign({},this.autoSplitList[0])).then(response => { + this.$modal.msgSuccess('提交成功') + this.getList(); + this.openAutoSplit = false; + this.activeSplit = 0; + }); + } } } diff --git a/src/views/plan/workorder/index.vue b/src/views/plan/workorder/index.vue index b4771ac..b9a86d4 100644 --- a/src/views/plan/workorder/index.vue +++ b/src/views/plan/workorder/index.vue @@ -49,12 +49,14 @@ /> - + + + { this.workShift = response.data }) + getProdLineList().then(response => { + this.prodLineList = response + }) }, methods: { //产品编码格式化 diff --git a/src/views/quality/aql/codeContent.vue b/src/views/quality/aql/codeContent.vue index 188209f..5440332 100644 --- a/src/views/quality/aql/codeContent.vue +++ b/src/views/quality/aql/codeContent.vue @@ -242,8 +242,7 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const id = - row.id || this.ids + const id = row.id || this.ids getCode(id).then(response => { this.form = response.data; this.open = true; diff --git a/src/views/quality/checkTypeProject/MaterialGroupAdd.vue b/src/views/quality/checkTypeProject/MaterialGroupAdd.vue index 248d757..c89a76a 100644 --- a/src/views/quality/checkTypeProject/MaterialGroupAdd.vue +++ b/src/views/quality/checkTypeProject/MaterialGroupAdd.vue @@ -106,7 +106,7 @@ import { } from "@/api/quality/materialGroupDetail"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import ItemSelectMaterial from "../qcIncome/selectMaterial.vue"; +import ItemSelectMaterial from "./selectMaterial.vue"; export default { name: "MaterialGroupAdd", @@ -201,7 +201,7 @@ export default { //this.loading = false; }); }, - /** 查询部门下拉树结构 */ + /** 查询下拉树结构 */ getMaterialTree() { materialTreeSelect().then((response) => { this.materialOptions = response.data; @@ -304,6 +304,7 @@ export default { this.reset(); this.form.groupId = data.id; this.$refs.itemSelectMaterial.showFlag = true; + //this.$refs.itemSelectMaterial.headerToken = }, /**删除树节点 */ remove(node, data) { @@ -337,21 +338,27 @@ export default { }, //物料选择确认 onSelectMaterial(obj) { - this.form.materialCode = obj.code; - this.form.materialName = obj.name; - console.log(this.form.groupId); - if(this.form.materialCode != null) { - addMaterialGroupDetail(this.form).then((response) => { - let message = response.code - if(message == 200) { - this.$modal.msgSuccess("新增成功"); - }else { - this.$modal.msgError("新增失败"); - } - this.open = false; - this.getMaterialTree(); - }); - } + debugger + if(obj.length == 0){ + this.getMaterialTree(); + }else{ + this.form.materialCode = obj.code; + this.form.materialName = obj.name; + console.log(this.form.groupId); + if(this.form.materialCode != null) { + addMaterialGroupDetail(this.form).then((response) => { + let message = response.code + if(message == 200) { + this.$modal.msgSuccess("新增成功"); + }else { + this.$modal.msgError("新增失败"); + } + this.open = false; + this.getMaterialTree(); + }); + } + } + } }, }; diff --git a/src/views/quality/checkTypeProject/selectMaterial.vue b/src/views/quality/checkTypeProject/selectMaterial.vue new file mode 100644 index 0000000..7895919 --- /dev/null +++ b/src/views/quality/checkTypeProject/selectMaterial.vue @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + + + + + + + 将文件拖到此处,或点击上传 + + 仅允许导入xls、xlsx格式文件。 + 下载模板 + + + + + + + + + + diff --git a/src/views/quality/qcTableDL/index.vue b/src/views/quality/qcTableDL/index.vue index eb7093f..d352c43 100644 --- a/src/views/quality/qcTableDL/index.vue +++ b/src/views/quality/qcTableDL/index.vue @@ -137,10 +137,31 @@ plain icon="el-icon-s-data" size="mini" - @click="handleAnalysis" - >图标分析柱状图表分析 + + 折线图表分析 + +