模具 发料完工增加确认框

This commit is contained in:
xielue 2023-09-16 10:23:17 +08:00
parent 637d61250b
commit 9e49b56978
2 changed files with 151 additions and 100 deletions

View File

@ -90,7 +90,7 @@
<div v-if="row.is_send"> <div v-if="row.is_send">
{{ $mk.getDateString(row.send_time) }} {{ $mk.getDateString(row.send_time) }}
<a-button @click.stop="pageSend(row,true)" >撤销</a-button> <a-button v-if="!row.is_complete" @click.stop="pageSend(row, true)">撤销</a-button>
</div> </div>
</div> </div>
</template> </template>
@ -102,7 +102,7 @@
<a-button v-if="!row.is_complete" @click.stop="pageDone(row)" type="primary">完成</a-button> <a-button v-if="!row.is_complete" @click.stop="pageDone(row)" type="primary">完成</a-button>
<div v-if="row.is_complete"> <div v-if="row.is_complete">
{{ $mk.getDateString(row.complete_time) }} {{ $mk.getDateString(row.complete_time) }}
<a-button @click.stop="pageDone(row,true)" >撤销</a-button> <a-button @click.stop="pageDone(row, true)">撤销</a-button>
</div> </div>
</div> </div>
</template> </template>
@ -408,9 +408,9 @@ export default {
} }
} }
setTimeout(()=>{ setTimeout(() => {
this.detailsData2 = JSON.parse(JSON.stringify(this.detailsData2)); this.detailsData2 = JSON.parse(JSON.stringify(this.detailsData2));
},500); }, 500);
}, },
@ -457,10 +457,13 @@ export default {
return this.$mk.toBigInt(dataId); return this.$mk.toBigInt(dataId);
}, },
pageComplete(row) { pageComplete(row) {
this.$mk.confirm('您确定完成吗?').then(type => {
if (type == 'confirm') {
this.$mk.post({ this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/reporting`, url: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/reporting`,
data: { data: {
id:this.$mk.toBigInt( row.id) id: this.$mk.toBigInt(row.id)
}, },
useBigInt: true, useBigInt: true,
}).then(a => { }).then(a => {
@ -469,15 +472,23 @@ export default {
this.$emit("reloadData"); this.$emit("reloadData");
} }
}); });
}
});
}, },
pageDone(row,isUndo) { pageDone(row, isUndo) {
this.$mk.confirm(!isUndo ? '您确定要报工吗?' : '您确定撤销吗?').then(type => {
if (type == 'confirm') {
this.$mk.post({ this.$mk.post({
url: isUndo ? url: isUndo ?
`${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/CancelReporting`: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/CancelReporting` :
`${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/Reporting`, `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/Reporting`,
data: { data: {
id: this.$mk.toBigInt( row.id) id: this.$mk.toBigInt(row.id)
}, },
useBigInt: true, useBigInt: true,
}).then(a => { }).then(a => {
@ -486,15 +497,22 @@ export default {
this.$emit("reloadData"); this.$emit("reloadData");
} }
}); });
}
});
}, },
pageSend(row,isUndo) { pageSend(row, isUndo) {
this.$mk.confirm(!isUndo ? '您确定要发料吗?' : '您确定撤销吗?').then(type => {
if (type == 'confirm') {
this.$mk.post({ this.$mk.post({
url: isUndo ? url: isUndo ?
`${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/CancelSendMaterial`: `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/CancelSendMaterial` :
`${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/SendMaterial`, `${BASE_URL.BASE_URL}/MoldProductionOrder/v1/mold/production/order/component/processes/SendMaterial`,
data: { data: {
id:this.$mk.toBigInt( row.id) id: this.$mk.toBigInt(row.id)
}, },
useBigInt: true, useBigInt: true,
}).then(a => { }).then(a => {
@ -503,6 +521,10 @@ export default {
this.$emit("reloadData"); this.$emit("reloadData");
} }
}); });
}
});
}, },
pageAdd(row) { pageAdd(row) {

View File

@ -37,9 +37,14 @@
</div> </div>
<div class="gx-item-col"> <div class="gx-item-col">
<a-button type="primary" @click="pageSend(item)" v-if="item.is_send !== 1">发料</a-button> <a-button type="primary" @click="pageSend(item)" v-if="item.is_send !== 1">发料</a-button>
<a-button @click="pageSend(item, true)" v-else-if="!item.is_complete">撤销发料</a-button>
<a-button type="primary" @click="pageReport(item)" <a-button style="margin-left: 3px;" type="primary" @click="pageReport(item)"
v-if="item.is_send && item.is_complete !== 1">报工</a-button> v-if="item.is_send && item.is_complete !== 1">报工</a-button>
<a-button style="margin-left: 3px;" @click="pageReport(item,true)"
v-if="item.is_complete == 1">撤销报工</a-button>
</div> </div>
</div> </div>
<div class="card-item-progress"> <div class="card-item-progress">
@ -122,7 +127,7 @@ export default {
currentId: 0, currentId: 0,
detailsData: [], detailsData: [],
detailsData3: [], detailsData3: [],
current_mold_production_order_component_processes:[], current_mold_production_order_component_processes: [],
formOptions2: { formOptions2: {
data: { data: {
}, },
@ -346,6 +351,8 @@ export default {
this.tableDataOrders = JSON.parse(JSON.stringify(a.data.mold_production_order || [])); this.tableDataOrders = JSON.parse(JSON.stringify(a.data.mold_production_order || []));
this.allDetailsData = JSON.parse(JSON.stringify(a.data.mold_production_order_component_processes || [])); this.allDetailsData = JSON.parse(JSON.stringify(a.data.mold_production_order_component_processes || []));
}).catch((a) => { }).catch((a) => {
this.loading = false this.loading = false
this.$mk.error(a.data.msg); this.$mk.error(a.data.msg);
@ -439,13 +446,13 @@ export default {
}, },
loadProcesses({ id }) { loadProcesses({ id }) {
let ds = this.detailsData || []; let ds = this.detailsData || [];
if(ds.filter(a=>a.process_id.toString() == id.toString()).length){ if (ds.filter(a => a.process_id.toString() == id.toString()).length) {
return; return;
} }
this.current_mold_production_order_component_processes.forEach(item=>{ this.current_mold_production_order_component_processes.forEach(item => {
if(item.process_id.toString() == id.toString()){ if (item.process_id.toString() == id.toString()) {
ds.push(item); ds.push(item);
} }
}) })
@ -477,6 +484,8 @@ export default {
this.detailsData = []; this.detailsData = [];
//this.detailsData = JSON.parse(JSON.stringify(row.mold_production_order_component_processes || []));
}); });
}, },
@ -547,12 +556,18 @@ export default {
}, },
pageReport(item) { pageReport(item, isUndo) {
this.$mk.confirm(!isUndo ? '您确定要报工吗?' : '您确定撤销吗?').then(type => {
if (type == 'confirm') {
this.$mk.post({ this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/create`, url:
loading: "报工中...", isUndo ?
`${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/cancel` :
`${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/create`,
loading: "操作中...",
data: { data: {
"ptyid": parseInt(process.env.VUE_APP_PTYID), "ptyid": parseInt(process.env.VUE_APP_PTYID),
"project_token": process.env.VUE_APP_APPTOKEN, "project_token": process.env.VUE_APP_APPTOKEN,
@ -566,7 +581,7 @@ export default {
}).then(a => { }).then(a => {
console.log(a) console.log(a)
if (a.code == 200) { if (a.code == 200) {
this.$mk.success("报工成功"); this.$mk.success("操作成功");
this.loadProductionOrder({ id: this.currentId }); this.loadProductionOrder({ id: this.currentId });
@ -576,13 +591,23 @@ export default {
} }
}); });
}
});
}, },
pageSend(item) { pageSend(item, isUndo) {
console.log(item) console.log(item)
this.$mk.confirm(!isUndo ? '您确定要发料吗?' : '您确定撤销吗?').then(type => {
if (type == 'confirm') {
this.$mk.post({ this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/sendMaterial`, url: isUndo ?
loading: "发料中...", `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/cancelSendMaterial` :
`${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/sendMaterial`,
loading: "操作中...",
data: { data: {
"ptyid": parseInt(process.env.VUE_APP_PTYID), "ptyid": parseInt(process.env.VUE_APP_PTYID),
"project_token": process.env.VUE_APP_APPTOKEN, "project_token": process.env.VUE_APP_APPTOKEN,
@ -596,7 +621,7 @@ export default {
}).then(a => { }).then(a => {
console.log(a) console.log(a)
if (a.code == 200) { if (a.code == 200) {
this.$mk.success("发料成功"); this.$mk.success("操作成功");
this.loadProductionOrder({ id: this.currentId }); this.loadProductionOrder({ id: this.currentId });
@ -606,6 +631,10 @@ export default {
} }
}); });
}
});
}, },