修改生产界面

master
夜笙歌 11 months ago
parent aeb62e758a
commit ffae6718f8

@ -32,7 +32,7 @@ export function getNewestProductPlanDetail(query) {
// 完成 // 完成
export function completeProductPlanDetail(query) { export function completeProductPlanDetail(query) {
return request({ return request({
url: '/mes/api/completeProductPlanDetailAttach', url: '/mes/api/completeProductPlanDetail',
method: 'post', method: 'post',
data: query data: query
}) })

@ -58,7 +58,6 @@ service.interceptors.request.use(config => {
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交'; const message = '数据正在处理,请勿重复提交';
console.warn(`[${s_url}]: ` + message)
return Promise.reject(new Error(message)) return Promise.reject(new Error(message))
} else { } else {
cache.session.setJSON('sessionObj', requestObj) cache.session.setJSON('sessionObj', requestObj)

@ -67,12 +67,12 @@
ref="table1" ref="table1"
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData" :data="tableData"
:expand-row-keys="drawingList"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
:max-height="19.13 *vw" :max-height="19.13 *vw"
highlight-current-row highlight-current-row
row-key="planId"
:expand-row-keys="drawingList"
lazy lazy
row-key="planId"
style="width: 100%" style="width: 100%"
@current-change="getOrderInfo" @current-change="getOrderInfo"
@expand-change="expandChange" @expand-change="expandChange"
@ -82,7 +82,6 @@
<div v-for="i in props.row.drawing"> <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;color:#000">{{ i.attachName }}</div>
<div style="display: inline-block;width: 50%;text-align: center"> <div style="display: inline-block;width: 50%;text-align: center">
<!-- v-if="i.completeAmount === 0"-->
<el-popconfirm <el-popconfirm
cancel-button-text='否' cancel-button-text='否'
confirm-button-text='是' confirm-button-text='是'
@ -92,8 +91,8 @@
@confirm="startNextProduction(props.row,i)" @confirm="startNextProduction(props.row,i)"
> >
<el-button <el-button
:disabled="i.dispatchFlag"
slot="reference" slot="reference"
:disabled="i.dispatchFlag"
size="small" size="small"
type="text">开始 type="text">开始
</el-button> </el-button>
@ -177,7 +176,7 @@
</div> </div>
<div class="chartBox chartBox4"> <div class="chartBox chartBox4">
<div class="title">产量</div> <div class="title">产量</div>
<div class="chart"> <div class="chart">
<Chart ref="chart4"></Chart> <Chart ref="chart4"></Chart>
</div> </div>
@ -218,7 +217,6 @@ import {
getProductPlans, getProductPlans,
startNextProductPlanDetail, startNextProductPlanDetail,
getPlanDrawings, getPlanDrawings,
completeProductPlanDetailAttach
} from "@/api/board/laserLight"; } from "@/api/board/laserLight";
const setState = (e) => { const setState = (e) => {
@ -250,13 +248,13 @@ export default {
} }
}, },
async mounted() { async mounted() {
setInterval(()=>{ setInterval(() => {
this.$notify.info({ this.$notify.info({
title: '通知', title: '通知',
message: '通知公告', message: '通知公告',
duration: 0 duration: 0
}); });
},60*1000) }, 60 * 1000)
const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => { const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
@ -459,12 +457,14 @@ export default {
async expandChange(e, rows) { async expandChange(e, rows) {
this.drawingList = [e.planId] this.drawingList = [e.planId]
const data = await getPlanDrawings({planId: e.planId, attachId: e.attachId}) 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)=>{ this.$set(this.tableData, this.tableData.indexOf(e), {
...e, drawing: data?.data.map((v, i) => {
return { return {
...v, ...v,
planId: e.planId + '-' + i planId: e.planId + '-' + i
} }
}) || []}) }) || []
})
}, },
// //
@ -786,20 +786,30 @@ export default {
], ],
}) })
}, },
// //
async startNextProduction(val,e) { async startNextProduction(val, e) {
const data = await startNextProductPlanDetail({planId: val.planId,attachId:e.attachId}) const dataIndex = this.tableData.indexOf(val)
this.form = data.data const lineIndex = this.tableData[dataIndex].drawing.indexOf(e)
this.form.materialId = val.materialId this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',false)
this.form.materialName = val.materialName await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId})
this.form.planDetailStatus = setState(data.data.planDetailStatus) .catch(() => {
const data1 = await getPlanDrawings({planId: val.planId, attachId: val.attachId}) this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',true)
this.$set(this.tableData,this.tableData.indexOf(val),{...val,drawing:data1?.data.map((v,i)=>{ })
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 { return {
...v, ...v,
planId: val.planId + '-' + i planId: val.planId + '-' + i
} }
}) || []}) }) || []
})
}, },
// //
accomplishPlan() { accomplishPlan() {
@ -810,7 +820,6 @@ export default {
}).then(() => { }).then(() => {
completeProductPlanDetail({ completeProductPlanDetail({
planDetailId: this.form.planDetailId, planDetailId: this.form.planDetailId,
attachId: this.form.attachId
}) })
.then(() => { .then(() => {
this.$message({ this.$message({

Loading…
Cancel
Save