This commit is contained in:
2023-05-28 14:42:55 +08:00
parent 20135fc031
commit cadfb7e5d3
9 changed files with 105 additions and 61 deletions

View File

@@ -18,9 +18,9 @@
</div>
<div class="wrap-buttons">
<button class="button button--primary" @click="getDatas">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === '' || pkObj.workorder_status === '3'}" :disabled="disabled1" @click="_openStart">开工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled2" @click="showDialog('1')">报工</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled3" @click="showDialog('2')">强制完成</button>
<button class="button button--primary" :class="{'button--defalut': pkId === '' || pkObj.workorder_status === '2'}" :disabled="disabled3" @click="showDialog('2')">强制完成</button>
</div>
</div>
<div class="grid_wraper">
@@ -93,7 +93,7 @@
</template>
<script>
import { deviceList, getTable, openStart, tofinish, saveReport } from '../../../config/getData2.js'
import { deviceList, getOrderList2, openStart, tofinish, saveReport } from '../../../config/getData2.js'
import jxDialog from '@components/dialog.vue'
import {accSubtract} from '@config/utils.js'
export default {
@@ -131,6 +131,7 @@ export default {
},
created () {
this._deviceList()
this.getDatas()
},
methods: {
async _deviceList () {
@@ -140,7 +141,7 @@ export default {
}
},
async getDatas () {
let res = await getTable(this.value)
let res = await getOrderList2(this.value)
res.content.map(el => {
let qty = '0'
if (Number(accSubtract(el.plan_qty, el.real_qty)) > 0) {
@@ -158,6 +159,10 @@ export default {
this.disabled1 = false
return
}
if (this.pkObj.workorder_status === '3') {
this.disabled1 = false
return
}
try {
let res = await openStart(this.pkId, this.value)
this.toast(res.message)
@@ -199,14 +204,18 @@ export default {
this.toast('请选择一行')
return
}
this.$refs.child.active = true
switch (type) {
case '1':
this.reportQty = ''
this.nokQty = ''
this.repareQty = ''
this.$refs.child.active = true
break
case '2':
if (this.pkObj.workorder_status === '2') {
return
}
this.$refs.child.active = true
break
}
},