diff --git a/src/api/mes/reportWork.js b/src/api/mes/reportWork.js index 0e5ee37f..952d28b4 100644 --- a/src/api/mes/reportWork.js +++ b/src/api/mes/reportWork.js @@ -352,3 +352,15 @@ export function deleteReportNow(reportCode) { method: 'delete' }); } + +//预报工 +export function preReportRow(reportCode) { + const data = { + reportCode + } + return request({ + url: '/mes/reportWork/preReportRow', + method: 'post', + data: data + }); +} diff --git a/src/api/plan/workorder.js b/src/api/plan/workorder.js index 0fc34ad6..6be34925 100644 --- a/src/api/plan/workorder.js +++ b/src/api/plan/workorder.js @@ -135,4 +135,42 @@ export function getUnReadComment(data){ method:'post', data:data }) - } \ No newline at end of file +} + +export function getWorkOrderBatch(workOrderId) { + return request({ + url: '/plan/pro/workorder/getWorkOrderBatch/' + workOrderId, + method: 'get' + }); +} + +export function getWorkOrderBatchInfo(query) { + return request({ + url: '/plan/pro/workorder/getWorkOrderBatchInfo', + method: 'get', + params: query + }); +} + +export function insertWorkOrderBatch(data){ + return request({ + url:'/plan/pro/workorder/insertWorkOrderBatch', + method:'post', + data:data + }) +} + export function updateWorkOrderBatch(data){ + return request({ + url:'/plan/pro/workorder/updateWorkOrderBatch', + method:'put', + data:data + }) + } + +export function removeWorkOrderBatch(batchCode,workorderCode) { + return request({ + url: '/plan/pro/workorder/removeWorkOrderBatch/' +batchCode+ '/' +workorderCode, + method: 'delete', + }); +} + diff --git a/src/views/device/faultReport/index.vue b/src/views/device/faultReport/index.vue index 9acbc8b0..2479eeb6 100644 --- a/src/views/device/faultReport/index.vue +++ b/src/views/device/faultReport/index.vue @@ -196,13 +196,13 @@ > - - {{ - form.workDownMachine ? "是" : "否" + form.workDownMachine ? "否" : "是" }} {{ form.workPlanDownTime @@ -832,7 +832,7 @@ form.workPlanTime }} {{ - form.workDownMachine ? "是" : "否" + form.workDownMachine ? "否" : "是" }} {{ form.workPlanDownTime @@ -922,7 +922,7 @@ v-model="form.orderBreakdownTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" - placeholder="报修时间" + placeholder="故障时间" style="width: 200px" > @@ -956,10 +956,10 @@ - + + + + - - - { @@ -2137,6 +2140,9 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map((item) => item.orderId); + this.orderCodes = selection.map((item) => item.orderCode); + console.log('this.ids',this.ids); + console.log('this.orderCodes',this.orderCodes); this.single = selection.length !== 1; this.multiple = !selection.length; }, diff --git a/src/views/mes/reportWork/index.vue b/src/views/mes/reportWork/index.vue index c223fb6c..523c2e73 100644 --- a/src/views/mes/reportWork/index.vue +++ b/src/views/mes/reportWork/index.vue @@ -362,30 +362,42 @@ :show-overflow-tooltip="true"> - +
@@ -398,7 +410,7 @@ @@ -645,7 +657,7 @@ import { submitReportPS, submitReportPSSAP, getCKList, - getPutInOrderList, + getPutInOrderList,preReportRow } from "@/api/mes/reportWork"; import { getConsumeList, @@ -1227,7 +1239,7 @@ export default { this.pReportRows = allRows.reduce((acc, cur) => { const hasDuplicate = acc.some( (item) => - item.batch === cur.batch && item.workorderCode === cur.workorderCode + item.batch === cur.batch && item.workorderCode === cur.workorderCode && item.reportCode === cur.reportCode ); if (!hasDuplicate) { acc.push(cur); @@ -1257,7 +1269,7 @@ export default { this.pReportRows = allRows.reduce((acc, cur) => { const hasDuplicate = acc.some( (item) => - item.batch === cur.batch && item.workorderCode === cur.workorderCode + item.batch === cur.batch && item.workorderCode === cur.workorderCode && item.reportCode === cur.reportCode ); if (!hasDuplicate) { acc.push(cur); @@ -1545,12 +1557,37 @@ export default { }).catch(() => {}); }, + //报工详情表格--预报工 + preReportRow(index, rows) { + let _this = this; + this.$modal.confirm('是否确认预报工?').then(function() { + _this.loading = true; + return preReportRow(rows[index].reportCode); + }).then(() => { + this.$modal.msgSuccess("预报工成功"); + debugger + var sr = rows[index]; + this.queryParams.workorderCode = sr.workorderCode; + this.queryParams.machineCode = sr.machineCode; + //查询工单报工记录列表 + getAllLevelReportList(this.queryParams).then((response) => { + this.queryParams.workorderCode = ""; + this.queryParams.machineCode = ""; + this.openReport = true; + this.titleReport = "工单报工详情"; + this.libTabs = response; + }); + _this.loading = false; + }).catch(() => {}); + }, + //物料损耗表格--删除 deleteBomRow(index, rows) { this.$modal .confirm("是否确认删除?确认后,不需要点击下方确定,立马删除!") .then(function () { if (rows[index].recordId != null) { + this.loading = true; return deleteBomRowNow(rows[index].recordId); } }) @@ -1567,6 +1604,7 @@ export default { this.pConsumeRows = newPConsumeRows; rows.splice(index, 1); this.$modal.msgSuccess("删除成功"); + this.loading = false; }) .catch(() => {}); }, diff --git a/src/views/plan/workorder/index.vue b/src/views/plan/workorder/index.vue index 0d365bed..4ea8f9ff 100644 --- a/src/views/plan/workorder/index.vue +++ b/src/views/plan/workorder/index.vue @@ -173,6 +173,18 @@ >切线调拨 + + 批次编辑 + + @@ -622,6 +634,84 @@ 取 消
+ + + + + 新增 + + + + 修改 + + + + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -634,7 +724,12 @@ import { getOrderAndWork,getProSortNo, getWorkBatchList, subChangeWorkOrderPro,subChangeWorkOrderM, - checkWorkOrder + checkWorkOrder, + getWorkOrderBatch, + getWorkOrderBatchInfo, + insertWorkOrderBatch, + updateWorkOrderBatch, + removeWorkOrderBatch } from '@/api/plan/workorder' import moment from 'moment'; import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order' @@ -714,13 +809,18 @@ export default { }, // 遮罩层 loading: true, + batchLoading: true, // 选中数组 ids: [], cods: [], + // 批次编辑列表 + batchData: [], // 非单个禁用 single: true, + batchSingle: true, // 非多个禁用 multiple: true, + batchMultiple: true, // 下达禁用 statuses: [], // 显示搜索条件 @@ -732,9 +832,15 @@ export default { // 弹出层标题 title: "", titleM:"", + batchTitle: "", + bEditTitle: "", // 是否显示弹出层 open: false, openM:false, + batchOpen: false, + bEditOpen: false, + // 是否禁止修改批次 + editBatchFlag: false, // 查询参数 queryParams: { productDateArray: [new Date(), new Date()], @@ -768,6 +874,7 @@ export default { }, // 表单参数 form: {}, + batchForm: {}, // 表单校验 rules: { workorderCode: [ @@ -789,6 +896,17 @@ export default { {required: true, message: "单位不能为空", trigger: "blur"} ], }, + batchRules: { + workorderCode: [ + {required: true, message: "工单编码不能为空", trigger: "blur"} + ], + batchCode: [ + {required: true, message: "当前批次编码不能为空", trigger: "blur"} + ], + batchQuantity: [ + {required: true, message: "当前批次数量不能为空", trigger: "blur"} + ] + }, /**********************************/ eRouteProps: {multiple: true}, eRouteOptions: [], @@ -1626,6 +1744,17 @@ export default { }; this.resetForm("form"); }, + resetBatchForm() { + this.batchForm = { + workorderCode: null, + batchCode: null, + batchQuantity: null, + newBatchCode: null, + newBatchQuantity: null, + attr1: null, + } + this.resetForm("batchForm"); + }, // 首-搜索按钮操作 handleQuery() { this.queryParams.pageNum = 1; @@ -1647,6 +1776,13 @@ export default { this.multiple = !selection.length this.statuses = selection.map(item => item.status) }, + batchSelectionChange(selection) { + this.batchids = selection.map(item => item.workorderId) + this.bWorkCodes = selection.map(item => item.workorderCode) + this.batchCodes = selection.map(item => item.batchCode) + this.batchSingle = selection.length !== 1 + this.batchMultiple = !selection.length + }, // 首-新增按钮操作 handleAdd() { alert("待建设") @@ -1664,6 +1800,91 @@ export default { }) return value; }, + editBatch() { + this.batchLoading = true; + const workOrdercode = this.codes[0]; + getWorkOrderBatch(workOrdercode).then(response => { + if(response.code == 200) { + this.batchData = response.rows; + this.batchOpen = true; + this.batchLoading = false; + this.batchTitle = "批次编辑"; + } + + }) + }, + hangleCloseEditBatch() { + this.batchOpen = false; + this.getList(); + }, + + // 批次编辑新增 + handleAddBatch() { + this.resetBatchForm(); + this.batchForm.workorderCode = this.codes[0]; + this.bEditOpen = true; + this.bEditTitle = "批次新增"; + this.editBatchFlag = false; + }, + // 批次编辑修改 + handleUpdateBatch() { + this.editBatchFlag = true; + this.resetBatchForm(); + const params = { + workorderCode: this.bWorkCodes[0], + batchCode: this.batchCodes[0] + } + getWorkOrderBatchInfo(params).then(response => { + this.batchForm = response.data; + this.bEditOpen = true; + this.bEditTitle = "批次修改"; + }); + }, + // 批次编辑取消 + batchCancel() { + this.bEditOpen = false; + this.editBatch(); + }, + // 批次编辑提交 + batchSubmitForm() { + this.$refs["batchForm"].validate(valid => { + if (valid) { + if (this.batchForm.batchCode != null) { + updateWorkOrderBatch(this.batchForm).then(response => { + if(response.code === 200) { + this.$modal.msgSuccess("修改成功"); + }else{ + this.$modal.msgError(response.msg); + } + this.bEditOpen = false; + this.editBatch(); + }); + } else { + insertWorkOrderBatch(this.batchForm).then(response => { + if(response.code === 200) { + this.$modal.msgSuccess("新增成功"); + }else{ + this.$modal.msgError(response.msg); + } + this.bEditOpen = false; + this.editBatch(); + }); + } + } + }); + }, + // 删除批次 + handleRemoveBatch() { + const workorderCode = this.bWorkCodes[0]; + const batchCode = this.batchCodes[0]; + this.$modal.confirm('是否确认删除批次编号为"' + batchCode + '"的数据项?').then(function() { + return removeWorkOrderBatch(batchCode,workorderCode); + }).then(() => { + this.editBatch(); + this.$modal.msgSuccess("删除成功"); + }).catch(() => {}); + }, + //新增-打开组成白坯选择物料窗口 selectBPMateriel() { // 清除搜索缓存 diff --git a/src/views/quality/checkTypeProject/selectProject.vue b/src/views/quality/checkTypeProject/selectProject.vue index 19636b4f..2dfe97e9 100644 --- a/src/views/quality/checkTypeProject/selectProject.vue +++ b/src/views/quality/checkTypeProject/selectProject.vue @@ -17,13 +17,15 @@ @keyup.enter.native="handleQuery" /> - - + + + + + @@ -32,17 +34,7 @@ - - - {{ item.projectTypeName }} - - - + diff --git a/src/views/quality/qcIncome/index.vue b/src/views/quality/qcIncome/index.vue index 581fcc47..1841ecb5 100644 --- a/src/views/quality/qcIncome/index.vue +++ b/src/views/quality/qcIncome/index.vue @@ -113,18 +113,17 @@ v-hasPermi="['quality:qcIncome:edit']" >修改 - + 修改 - + 修改 - + { this.batchList = response; }); diff --git a/src/views/quality/qcProduce/selectWorkOrder.vue b/src/views/quality/qcProduce/selectWorkOrder.vue index 783ed5d4..da86777e 100644 --- a/src/views/quality/qcProduce/selectWorkOrder.vue +++ b/src/views/quality/qcProduce/selectWorkOrder.vue @@ -32,6 +32,7 @@ + @@ -321,6 +326,7 @@ + + + + + + + - + + + + + @@ -370,11 +387,16 @@ ref="itemSelectMaterial" @onSelected="onSelectMaterial" > - + + + { this.batchList = response; }); @@ -691,6 +716,16 @@ export default { this.form.materialName = obj.name; }, + /**工作中心选择弹出框**/ + handleSelectWorkCenter() { + this.$refs.itemSelectWorkCenter.showFlag = true; + }, + //工作中心选择确认 + onSelectWorkCenter(obj) { + this.form.supplierCode = obj.code; + this.form.supplierName = obj.name; + }, + /**仓库选择弹出框**/ handleSelectLoc() { this.$refs.itemSelectLoc.showFlag = true;