修改生产界面

master
夜笙歌 11 months ago
parent aeb62e758a
commit ffae6718f8

@ -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
})

@ -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)

@ -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 @@
<div v-for="i in props.row.drawing">
<div style="display: inline-block;width: 50%;text-align: center;color:#000">{{ i.attachName }}</div>
<div style="display: inline-block;width: 50%;text-align: center">
<!-- v-if="i.completeAmount === 0"-->
<el-popconfirm
cancel-button-text='否'
confirm-button-text='是'
@ -92,8 +91,8 @@
@confirm="startNextProduction(props.row,i)"
>
<el-button
:disabled="i.dispatchFlag"
slot="reference"
:disabled="i.dispatchFlag"
size="small"
type="text">开始
</el-button>
@ -140,7 +139,7 @@
width="80"
>
<template slot-scope="scope">
{{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
{{ (scope.row.attachId || '').split(',').length - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
@ -177,7 +176,7 @@
</div>
<div class="chartBox chartBox4">
<div class="title">产量</div>
<div class="title">产量</div>
<div class="chart">
<Chart ref="chart4"></Chart>
</div>
@ -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({

Loading…
Cancel
Save