模具报工

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,7 +24,8 @@
<div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" : "未发料") }}</div> <div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" : "未发料") }}</div>
</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> <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> <a-button @click="pageSend(item, true)" v-else-if="!item.is_complete">撤销发料</a-button>
<a-button style="margin-left: 3px;" type="primary" @click="pageReport(item)" <a-button style="margin-left: 3px;" type="primary" @click="pageReport(item)"
@ -32,11 +33,15 @@
<a-button style="margin-left: 3px;" @click="pageReport(item, true)" <a-button style="margin-left: 3px;" @click="pageReport(item, true)"
v-if="item.is_complete == 1">撤销报工</a-button> 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>
</div> </div>
<div class="card-item-progress"> <div class="card-item-progress">
<img v-if="item.component_detail && item.component_detail.image" <img v-if="item.component_detail && item.component_detail.image"
style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" /> style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" />
<span v-else></span> <span v-else></span>
@ -109,6 +114,7 @@
<script> <script>
import BASE_URL from '@/services/mes/api.js'; import BASE_URL from '@/services/mes/api.js';
import XEUtils from 'xe-utils' // xe-utils
import JSONbig from 'json-bigint' import JSONbig from 'json-bigint'
export default { export default {
@ -218,7 +224,7 @@ export default {
params: { params: {
dataType: "object", dataType: "object",
valueField: "id", valueField: "id",
textField: "code" textField: "name"
} }
} }
} }
@ -231,7 +237,7 @@ export default {
params: { params: {
dataType: "object", dataType: "object",
valueField: "id", valueField: "id",
textField: "code" textField: "name"
} }
} }
} }
@ -432,6 +438,7 @@ export default {
}, 20); }, 20);
this.searchName = '';
input.value = ''; input.value = '';
this.scanEntry = ''; this.scanEntry = '';
return; return;
@ -441,6 +448,7 @@ export default {
input.value = ''; input.value = '';
this.searchName = '';
this.scanEntry = ''; this.scanEntry = '';
}, 10); }, 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 }) { loadDepartment({ id, code }) {
let ds = []; let ds = [];
@ -532,7 +559,7 @@ export default {
}, },
loadProductionOrder({ id }) { loadProductionOrder({ id, resetProcesses }) {
this.currentId = id; this.currentId = id;
this.loading = true this.loading = true
@ -557,10 +584,14 @@ export default {
this.formOptions2.data = data2 this.formOptions2.data = data2
this.formOptions3.data = data3 this.formOptions3.data = data3
this.current_mold_production_order_component_processes = row.mold_production_order_component_processes; this.current_mold_production_order_component_processes = row.mold_production_order_component_processes;
this.detailsData = [];
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 => { }).then(a => {
let row = a.data.mold_production_order_component_processes; 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) { if (a.code == 200) {
this.$mk.success("操作成功"); this.$mk.success("操作成功");
this.loadProductionOrder({ id: this.currentId }); this.loadProductionOrder({ id: this.currentId, resetProcesses: true });
} else { } else {