This commit is contained in:
2023-04-10 11:16:58 +08:00
parent 6d1252502f
commit 8a867e704d
9 changed files with 67 additions and 124 deletions

View File

@@ -18,10 +18,10 @@
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
</div>
<div class="fr mgt10">
<button class="mgr5 button--primary" @click="toSearch">&nbsp;&nbsp;</button>
<button class="button--primary" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button--primary" :disabled="disabled2" @click="addProduce">报工</button>
<button class="button--primary" :disabled="disabled3" @click="addProduce">完工</button>
<button class="mgr5 button--primary" @click="getDatas">&nbsp;&nbsp;</button>
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled2" @click="_saveReport">报工</button>
<button class="button--primary" :class="{'button--defalut': !pkId}" :disabled="disabled3" @click="_tofinish">完工</button>
</div>
</div>
<table class="filter-table">
@@ -32,24 +32,24 @@
<th width="9%">物料名称</th>
<th width="8%">工序</th>
<th width="9%">工单状态</th>
<th width="10%">生产数量</th>
<th width="9%">上报残次数</th>
<th width="9%">本次加工</th>
<th width="10%">计划数量</th>
<th width="9%">实际数量</th>
<th width="9%">报工数量</th>
<th width="13%">开始时间</th>
<th width="13%">结束时间</th>
</tr>
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
<tr v-for="e in dataList" :key="e.workorder_id" @click="toRadio(e)">
<td>
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
<button class="iconfont select_icon" :class="pkId === e.workorder_id ? 'selected_icon' : 'unselect_icon'"></button>
</td>
<td>{{e.produceorder_code}}</td>
<td>{{e.shift_type_scode_name}}</td>
<td>{{e.workorder_code}}</td>
<td>{{e.shift_type_scode}}</td>
<td>{{e.material_name}}</td>
<td>{{e.workprocedure_name}}</td>
<td>{{['未生产','生产中','生产完成','已报工'][Number(e.order_status)]}}</td>
<td>{{e.produce_qty}}</td>
<td>{{e.unqualified_qty}}</td>
<td>{{e.this_qty}}</td>
<td>{{['创建','下发','生产中','暂停', '完成'][Number(e.order_status) - 1]}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.real_qty}}</td>
<td>{{e.report_qty}}</td>
<td>{{e.realproducestart_date}}</td>
<td>{{e.realproduceend_date}}</td>
</tr>
@@ -75,7 +75,7 @@ export default {
value1: [new Date(), new Date()],
deviceCode: this.$route.query.code,
keyValue: '',
datas: [],
dataList: [],
pkId: '',
pkObj: {},
disabled1: false,
@@ -86,9 +86,6 @@ export default {
computed: {
closeIcon1 () {
return this.keyValue !== ''
},
closeIcon2 () {
return this.produceQty !== ''
}
},
created () {
@@ -106,30 +103,12 @@ export default {
}
},
async getDatas () {
let res = await getTable(this.$route.query.code, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '', '0', '', '0')
this.datas = [...res]
},
toSearch () {
this.getDatas()
let res = await getTable(this.$route.query.code, this.keyValue, this.value1 !== null ? dateFtt(this.value1[0]) : '', this.value1 !== null ? dateFtt(this.value1[1]) : '')
this.dataList = [...res.content]
},
toRadio (e) {
this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
this.pkObj = this.pkId === e.pk_id ? e : {}
},
closeModalCall () {
this.mdShow = false
},
comfirmCall () {
this.disabled = true
if (this.produceQty === '' || this.produceQty === null) {
this.toast('请输入追加数量')
this.disabled = false
return
}
this.addProduceData()
},
addProduce () {
this.mdShow = true
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
this.pkObj = this.pkId === e.workorder_id ? e : {}
},
async _openStart () {
this.disabled1 = true
@@ -139,9 +118,11 @@ export default {
return
}
try {
let res = await openStart()
this.toast(res.desc)
let res = await openStart(this.pkId, this.deviceCode)
this.toast(res.message)
this.disabled1 = false
this.pkId = ''
this.pkObj = {}
this.getDatas()
} catch (e) {
this.disabled1 = false
@@ -155,9 +136,11 @@ export default {
return
}
try {
let res = await saveReport()
this.toast(res.desc)
let res = await saveReport(this.pkId, this.pkObj.report_qty)
this.toast(res.message)
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
this.getDatas()
} catch (e) {
this.disabled2 = false
@@ -171,8 +154,8 @@ export default {
return
}
try {
let res = await tofinish()
this.toast(res.desc)
let res = await tofinish(this.pkObj)
this.toast(res.message)
this.disabled3 = false
this.getDatas()
} catch (e) {