接口修改 交互功能修改
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.workorder_code}}</td>
|
||||
<td>{{['创建','下发','生产中','暂停', '完成', '强制完成'][Number(e.workorder_status) - 1]}}</td>
|
||||
<td>{{e.workorder_status_name}}</td>
|
||||
<td>{{e.device_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
@@ -71,21 +71,21 @@
|
||||
<input type="number" class="form_item__input" v-model="reportQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_item">
|
||||
<!-- <div class="form_item">
|
||||
<div class="form_item__label">报废数量</div>
|
||||
<div class="form_item__content">
|
||||
<input type="number" class="form_item__input" v-model="nokQty">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="form">
|
||||
<!-- <div class="form">
|
||||
<div class="form_item">
|
||||
<div class="form_item__label">报修数量</div>
|
||||
<div class="form_item__content">
|
||||
<input type="number" class="form_item__input" v-model="repareQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div v-if="type === '2'" class="form_wraper">当前操作为强制确认,确定继续操作吗?</div>
|
||||
</jxDialog>
|
||||
@@ -93,7 +93,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { deviceList, getOrderList2, openStart, tofinish, saveReport } from '../../../config/getData2.js'
|
||||
import { deviceList, getOrderList2, openStart, tofinish, saveReport, orderStatus } from '../../../config/getData2.js'
|
||||
import jxDialog from '@components/dialog.vue'
|
||||
import {accSubtract} from '@config/utils.js'
|
||||
export default {
|
||||
@@ -113,8 +113,9 @@ export default {
|
||||
title: '',
|
||||
type: '',
|
||||
reportQty: '',
|
||||
nokQty: '',
|
||||
repareQty: ''
|
||||
// nokQty: '',
|
||||
// repareQty: '',
|
||||
status: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -131,7 +132,7 @@ export default {
|
||||
},
|
||||
created () {
|
||||
this._deviceList()
|
||||
this.getDatas()
|
||||
this._orderStatus()
|
||||
},
|
||||
methods: {
|
||||
async _deviceList () {
|
||||
@@ -140,16 +141,28 @@ export default {
|
||||
this.options = [...res.content]
|
||||
}
|
||||
},
|
||||
async _orderStatus () {
|
||||
let res = await orderStatus()
|
||||
this.status = [...res]
|
||||
this.getDatas()
|
||||
},
|
||||
async getDatas () {
|
||||
let res = await getOrderList2(this.value)
|
||||
res.content.map(el => {
|
||||
let qty = '0'
|
||||
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
|
||||
qty = accSubtract(el.plan_qty, el.real_qty)
|
||||
}
|
||||
this.$set(el, 'report_qty', qty)
|
||||
})
|
||||
this.dataList = [...res.content]
|
||||
if (res.code === 200) {
|
||||
res.content.map(el => {
|
||||
let qty = '0'
|
||||
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
|
||||
qty = accSubtract(el.plan_qty, el.real_qty)
|
||||
}
|
||||
this.$set(el, 'report_qty', qty)
|
||||
this.status.map(e => {
|
||||
if (e.value === Number(el.workorder_status)) {
|
||||
this.$set(el, 'workorder_status_name', e.label)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.dataList = [...res.content]
|
||||
}
|
||||
},
|
||||
// 开工
|
||||
async _openStart () {
|
||||
@@ -184,7 +197,7 @@ export default {
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await saveReport(this.pkId, this.reportQty, this.nokQty, this.repareQty)
|
||||
let res = await saveReport(this.pkId, this.reportQty)
|
||||
this.toast(res.message)
|
||||
this.disabled2 = false
|
||||
this.pkId = ''
|
||||
@@ -207,8 +220,8 @@ export default {
|
||||
switch (type) {
|
||||
case '1':
|
||||
this.reportQty = ''
|
||||
this.nokQty = ''
|
||||
this.repareQty = ''
|
||||
// this.nokQty = ''
|
||||
// this.repareQty = ''
|
||||
this.$refs.child.active = true
|
||||
break
|
||||
case '2':
|
||||
|
||||
Reference in New Issue
Block a user