模具报工

This commit is contained in:
xielue 2023-10-06 18:59:29 +08:00
parent 5ea71c5dd5
commit 738e7a172e
1 changed files with 40 additions and 9 deletions

View File

@ -24,6 +24,7 @@
<div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" : "未发料") }}</div>
</div>
<div class="gx-item-col">
<div>
<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>
@ -32,6 +33,10 @@
<a-button style="margin-left: 3px;" @click="pageReport(item, true)"
v-if="item.is_complete == 1">撤销报工</a-button>
</div>
<div style="margin-top: 10px;;" v-if="item.complete_time">
{{ getDateValueString(item.complete_time) }}
</div>
</div>
</div>
@ -109,6 +114,7 @@
<script>
import BASE_URL from '@/services/mes/api.js';
import XEUtils from 'xe-utils' // xe-utils
import JSONbig from 'json-bigint'
export default {
@ -218,7 +224,7 @@ export default {
params: {
dataType: "object",
valueField: "id",
textField: "code"
textField: "name"
}
}
}
@ -231,7 +237,7 @@ export default {
params: {
dataType: "object",
valueField: "id",
textField: "code"
textField: "name"
}
}
}
@ -432,6 +438,7 @@ export default {
}, 20);
this.searchName = '';
input.value = '';
this.scanEntry = '';
return;
@ -441,6 +448,7 @@ export default {
input.value = '';
this.searchName = '';
this.scanEntry = '';
}, 10);
@ -495,6 +503,25 @@ export default {
}
},
getDateValueString(v) {
if (!v) return '';
return XEUtils.toDateString(new Date(v * 1000), 'yyyy-MM-dd');
},
resetProcesses() {
let ds = JSON.parse(JSON.stringify(this.detailsData || []))
let newDs = [];
this.current_mold_production_order_component_processes.forEach(item => {
ds.forEach(o => {
if (item.id.toString() == o.id.toString()) {
newDs.push(item);
}
})
})
this.detailsData = newDs;
},
loadDepartment({ id, code }) {
let ds = [];
@ -532,7 +559,7 @@ export default {
},
loadProductionOrder({ id }) {
loadProductionOrder({ id, resetProcesses }) {
this.currentId = id;
this.loading = true
@ -557,11 +584,15 @@ export default {
this.formOptions2.data = data2
this.formOptions3.data = data3
this.current_mold_production_order_component_processes = row.mold_production_order_component_processes;
if (resetProcesses === true) {
this.resetProcesses();
}else{
this.detailsData = [];
}
//this.detailsData = JSON.parse(JSON.stringify(row.mold_production_order_component_processes || []));
});
},
@ -573,7 +604,7 @@ export default {
}).then(a => {
let row = a.data.mold_production_order_component_processes;
this.loadProductionOrder(row.production_id);
this.loadProductionOrder({id:row.production_id});
});
},
@ -676,7 +707,7 @@ export default {
if (a.code == 200) {
this.$mk.success("操作成功");
this.loadProductionOrder({ id: this.currentId });
this.loadProductionOrder({ id: this.currentId, resetProcesses: true });
} else {