diff --git a/hw-ui/src/api/board/laserLight.js b/hw-ui/src/api/board/laserLight.js index 61435c24..55c88260 100644 --- a/hw-ui/src/api/board/laserLight.js +++ b/hw-ui/src/api/board/laserLight.js @@ -32,7 +32,7 @@ export function getNewestProductPlanDetail(query) { // 完成 export function completeProductPlanDetail(query) { return request({ - url: '/mes/api/completeProductPlanDetailAttach', + url: '/mes/api/completeProductPlanDetail', method: 'post', data: query }) diff --git a/hw-ui/src/utils/request.js b/hw-ui/src/utils/request.js index ffb0d219..3630d55a 100644 --- a/hw-ui/src/utils/request.js +++ b/hw-ui/src/utils/request.js @@ -58,7 +58,6 @@ service.interceptors.request.use(config => { const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { const message = '数据正在处理,请勿重复提交'; - console.warn(`[${s_url}]: ` + message) return Promise.reject(new Error(message)) } else { cache.session.setJSON('sessionObj', requestObj) diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index 8e38369e..45284164 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -67,12 +67,12 @@ ref="table1" :cell-style="{textAlign:'center'}" :data="tableData" + :expand-row-keys="drawingList" :header-cell-style="{textAlign:'center'}" :max-height="19.13 *vw" highlight-current-row - row-key="planId" - :expand-row-keys="drawingList" lazy + row-key="planId" style="width: 100%" @current-change="getOrderInfo" @expand-change="expandChange" @@ -82,7 +82,6 @@
{{ i.attachName }}
- 开始 @@ -140,7 +139,7 @@ width="80" >
-
当日产量
+
当周产量
@@ -218,7 +217,6 @@ import { getProductPlans, startNextProductPlanDetail, getPlanDrawings, - completeProductPlanDetailAttach } from "@/api/board/laserLight"; const setState = (e) => { @@ -250,13 +248,13 @@ export default { } }, async mounted() { - setInterval(()=>{ + setInterval(() => { this.$notify.info({ title: '通知', message: '通知公告', duration: 0 }); - },60*1000) + }, 60 * 1000) const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => { this.tableData = e.rows this.totalNum1 = Math.ceil(e.total / 5) @@ -459,12 +457,14 @@ export default { async expandChange(e, rows) { this.drawingList = [e.planId] const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId}) - this.$set(this.tableData,this.tableData.indexOf(e),{...e,drawing:data?.data.map((v,i)=>{ - return { - ...v, - planId: e.planId + '-' + i - } - }) || []}) + this.$set(this.tableData, this.tableData.indexOf(e), { + ...e, drawing: data?.data.map((v, i) => { + return { + ...v, + planId: e.planId + '-' + i + } + }) || [] + }) }, // 设置图表信息 @@ -491,7 +491,7 @@ export default { center: ["50%", "50%"], data: [ { - value: (e.attachId || '').split(',').length === 0 ? 0.0001 : (e.attachId || '').split(',').length, + value: (e.attachId || '').split(',').length === 0 ? 0.0001 : (e.attachId || '').split(',').length, label: { normal: { rich: { @@ -786,20 +786,30 @@ export default { ], }) }, - // 开始继续 - async startNextProduction(val,e) { - const data = await startNextProductPlanDetail({planId: val.planId,attachId:e.attachId}) - this.form = data.data - this.form.materialId = val.materialId - this.form.materialName = val.materialName - this.form.planDetailStatus = setState(data.data.planDetailStatus) - const data1 = await getPlanDrawings({planId: val.planId, attachId: val.attachId}) - this.$set(this.tableData,this.tableData.indexOf(val),{...val,drawing:data1?.data.map((v,i)=>{ + // 开始 + async startNextProduction(val, e) { + const dataIndex = this.tableData.indexOf(val) + const lineIndex = this.tableData[dataIndex].drawing.indexOf(e) + this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',false) + await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId}) + .catch(() => { + this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',true) + }) + getNewestProductPlanDetail({planId: val.planId}).then(val => { + this.form = val.data + this.form.materialId = e.materialId + this.form.materialName = e.materialName + this.form.planDetailStatus = setState(val.data.planDetailStatus) + }) + const data = await getPlanDrawings({planId: val.planId, attachId: val.attachId}) + this.$set(this.tableData, this.tableData.indexOf(val), { + ...val, drawing: data?.data.map((v, i) => { return { ...v, planId: val.planId + '-' + i } - }) || []}) + }) || [] + }) }, // 完成 accomplishPlan() { @@ -810,7 +820,6 @@ export default { }).then(() => { completeProductPlanDetail({ planDetailId: this.form.planDetailId, - attachId: this.form.attachId }) .then(() => { this.$message({