2023-05-22 18:09:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="order-wraper">
|
|
|
|
|
|
<div class="wrap-filter-buttons">
|
|
|
|
|
|
<div class="wrap-filters">
|
|
|
|
|
|
<div class="filter_item">
|
|
|
|
|
|
<div class="filter_label">设备</div>
|
|
|
|
|
|
<div class="filter-input-wrap">
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<el-select v-model="value" filterable clearable placeholder="请选择">
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in options"
|
|
|
|
|
|
:key="item.device_code"
|
|
|
|
|
|
:label="item.device_name"
|
|
|
|
|
|
:value="item.device_code">
|
|
|
|
|
|
</el-option>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="wrap-buttons">
|
|
|
|
|
|
<button class="button button--primary" @click="getDatas">查询</button>
|
2023-05-28 14:42:55 +08:00
|
|
|
|
<button class="button button--primary" :class="{'button--defalut': pkId === '' || pkObj.workorder_status === '3'}" :disabled="disabled1" @click="_openStart">开工</button>
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" :disabled="disabled2" @click="showDialog('1')">报工</button>
|
2023-05-28 14:42:55 +08:00
|
|
|
|
<button class="button button--primary" :class="{'button--defalut': pkId === '' || pkObj.workorder_status === '2'}" :disabled="disabled3" @click="showDialog('2')">强制完成</button>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="grid_wraper">
|
|
|
|
|
|
<table class="filter-table">
|
|
|
|
|
|
<tr>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<!-- <th width="4%"></th> -->
|
|
|
|
|
|
<th width="13%">工单日期</th>
|
|
|
|
|
|
<th width="10%">工单号</th>
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<th width="7%">状态</th>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<th width="10%">设备</th>
|
|
|
|
|
|
<!-- <th width="8%">物料名称</th> -->
|
|
|
|
|
|
<th width="9%">物料规格</th>
|
|
|
|
|
|
<!-- <th width="10%">工序</th> -->
|
|
|
|
|
|
<th width="8%">计划生产</th>
|
|
|
|
|
|
<th width="10%">电气数量</th>
|
|
|
|
|
|
<th width="10%">待生产</th>
|
|
|
|
|
|
<th width="10%">已生产</th>
|
|
|
|
|
|
<th width="13%">开工时间</th>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
</tr>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<tr v-for="e in dataList" :key="e.workorder_id" :class="{'selected_icon': pkId === e.workorder_id}" @click="toRadio(e)">
|
|
|
|
|
|
<!-- <td>
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<button class="iconfont select_icon" :class="{'selected_icon': pkId === e.workorder_id}" @click="toRadio(e)"></button>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
</td> -->
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<td>{{e.create_time}}</td>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
<td>{{e.workorder_code}}</td>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
<td>{{e.workorder_status_name}}</td>
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<td>{{e.device_code}}</td>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<!-- <td>{{e.material_name}}</td> -->
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<td>{{e.material_spec}}</td>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<!-- <td>{{e.workprocedure_name}}</td> -->
|
2023-05-22 18:09:19 +08:00
|
|
|
|
<td>{{e.plan_qty}}</td>
|
2023-06-08 14:55:52 +08:00
|
|
|
|
<td>{{ e.dq_real_qty }}</td>
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<td>{{ e.report_qty }}</td>
|
|
|
|
|
|
<td>{{ e.real_qty }}</td>
|
|
|
|
|
|
<td>{{ e.realproducestart_date }}</td>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
2023-05-25 13:41:11 +08:00
|
|
|
|
<jxDialog
|
|
|
|
|
|
ref="child"
|
2023-05-26 19:12:08 +08:00
|
|
|
|
:title="title"
|
|
|
|
|
|
:type="type"
|
2023-05-25 13:41:11 +08:00
|
|
|
|
@toSure="toSureDialog"
|
|
|
|
|
|
>
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<div v-if="type === '1'" class="form_wraper">
|
|
|
|
|
|
<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="reportQty">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
<!-- <div class="form_item">
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<div class="form_item__label">报废数量</div>
|
|
|
|
|
|
<div class="form_item__content">
|
|
|
|
|
|
<input type="number" class="form_item__input" v-model="nokQty">
|
|
|
|
|
|
</div>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
</div> -->
|
2023-05-26 19:12:08 +08:00
|
|
|
|
</div>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
<!-- <div class="form">
|
2023-05-26 19:12:08 +08:00
|
|
|
|
<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>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
</div> -->
|
2023-05-26 19:12:08 +08:00
|
|
|
|
</div>
|
2023-06-12 16:47:41 +08:00
|
|
|
|
<div v-if="type === '2'" class="form_wraper">当前操作将强制完成工单,结束生产,确定继续操作吗?</div>
|
2023-05-25 13:41:11 +08:00
|
|
|
|
</jxDialog>
|
2023-05-22 18:09:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-06-05 13:17:08 +08:00
|
|
|
|
import { deviceList, getOrderList2, openStart, tofinish, saveReport, orderStatus } from '../../../config/getData2.js'
|
2023-05-25 13:41:11 +08:00
|
|
|
|
import jxDialog from '@components/dialog.vue'
|
|
|
|
|
|
import {accSubtract} from '@config/utils.js'
|
2023-05-22 18:09:19 +08:00
|
|
|
|
export default {
|
2023-05-25 13:41:11 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
jxDialog
|
|
|
|
|
|
},
|
2023-05-22 18:09:19 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
2023-05-25 13:41:11 +08:00
|
|
|
|
options: [],
|
2023-05-22 18:09:19 +08:00
|
|
|
|
value: '',
|
|
|
|
|
|
disabled1: false,
|
|
|
|
|
|
disabled2: false,
|
|
|
|
|
|
disabled3: false,
|
2023-05-25 13:41:11 +08:00
|
|
|
|
dataList: [],
|
2023-05-22 18:09:19 +08:00
|
|
|
|
pkId: '',
|
2023-05-26 19:12:08 +08:00
|
|
|
|
pkObj: {},
|
|
|
|
|
|
title: '',
|
|
|
|
|
|
type: '',
|
|
|
|
|
|
reportQty: '',
|
2023-06-05 13:17:08 +08:00
|
|
|
|
// nokQty: '',
|
|
|
|
|
|
// repareQty: '',
|
|
|
|
|
|
status: []
|
2023-05-26 19:12:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
type (val) {
|
|
|
|
|
|
switch (val) {
|
|
|
|
|
|
case '1':
|
|
|
|
|
|
this.title = '请输入数量'
|
|
|
|
|
|
break
|
|
|
|
|
|
case '2':
|
|
|
|
|
|
this.title = '提示'
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
2023-05-22 18:09:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-05-25 13:41:11 +08:00
|
|
|
|
created () {
|
|
|
|
|
|
this._deviceList()
|
2023-06-05 13:17:08 +08:00
|
|
|
|
this._orderStatus()
|
2023-05-25 13:41:11 +08:00
|
|
|
|
},
|
2023-05-22 18:09:19 +08:00
|
|
|
|
methods: {
|
2023-05-25 13:41:11 +08:00
|
|
|
|
async _deviceList () {
|
|
|
|
|
|
let res = await deviceList()
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
|
this.options = [...res.content]
|
|
|
|
|
|
}
|
2023-05-22 18:09:19 +08:00
|
|
|
|
},
|
2023-06-05 13:17:08 +08:00
|
|
|
|
async _orderStatus () {
|
|
|
|
|
|
let res = await orderStatus()
|
|
|
|
|
|
this.status = [...res]
|
|
|
|
|
|
this.getDatas()
|
|
|
|
|
|
},
|
2023-05-25 13:41:11 +08:00
|
|
|
|
async getDatas () {
|
2023-05-28 14:42:55 +08:00
|
|
|
|
let res = await getOrderList2(this.value)
|
2023-06-05 13:17:08 +08:00
|
|
|
|
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]
|
|
|
|
|
|
}
|
2023-05-22 18:09:19 +08:00
|
|
|
|
},
|
2023-05-25 13:41:11 +08:00
|
|
|
|
// 开工
|
|
|
|
|
|
async _openStart () {
|
|
|
|
|
|
this.disabled1 = true
|
|
|
|
|
|
if (!this.pkId) {
|
|
|
|
|
|
this.toast('请选择一行')
|
|
|
|
|
|
this.disabled1 = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2023-05-28 14:42:55 +08:00
|
|
|
|
if (this.pkObj.workorder_status === '3') {
|
|
|
|
|
|
this.disabled1 = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2023-05-25 13:41:11 +08:00
|
|
|
|
try {
|
|
|
|
|
|
let res = await openStart(this.pkId, this.value)
|
2023-07-23 12:56:58 +08:00
|
|
|
|
this.toast(res.msg)
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.disabled1 = false
|
|
|
|
|
|
this.pkId = ''
|
|
|
|
|
|
this.pkObj = {}
|
|
|
|
|
|
this.getDatas()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
this.disabled1 = false
|
|
|
|
|
|
}
|
2023-05-22 18:09:19 +08:00
|
|
|
|
},
|
2023-05-25 13:41:11 +08:00
|
|
|
|
// 报工
|
|
|
|
|
|
async _saveReport () {
|
2023-05-26 19:12:08 +08:00
|
|
|
|
this.$refs.child.disabled = true
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.disabled2 = true
|
|
|
|
|
|
if (!this.pkId) {
|
|
|
|
|
|
this.toast('请选择一行')
|
|
|
|
|
|
this.disabled2 = false
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
try {
|
2023-06-05 13:17:08 +08:00
|
|
|
|
let res = await saveReport(this.pkId, this.reportQty)
|
2023-07-23 12:56:58 +08:00
|
|
|
|
this.toast(res.msg)
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.disabled2 = false
|
|
|
|
|
|
this.pkId = ''
|
|
|
|
|
|
this.pkObj = {}
|
2023-05-26 19:12:08 +08:00
|
|
|
|
this.$refs.child.active = false
|
|
|
|
|
|
this.$refs.child.disabled = false
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.getDatas()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
this.disabled2 = false
|
2023-05-26 19:12:08 +08:00
|
|
|
|
this.$refs.child.active = false
|
|
|
|
|
|
this.$refs.child.disabled = false
|
2023-05-25 13:41:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-05-26 19:12:08 +08:00
|
|
|
|
showDialog (type) {
|
|
|
|
|
|
this.type = type
|
2023-05-25 13:41:11 +08:00
|
|
|
|
if (!this.pkId) {
|
|
|
|
|
|
this.toast('请选择一行')
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2023-05-26 19:12:08 +08:00
|
|
|
|
switch (type) {
|
|
|
|
|
|
case '1':
|
|
|
|
|
|
this.reportQty = ''
|
2023-06-05 13:17:08 +08:00
|
|
|
|
// this.nokQty = ''
|
|
|
|
|
|
// this.repareQty = ''
|
2023-05-28 14:42:55 +08:00
|
|
|
|
this.$refs.child.active = true
|
2023-05-26 19:12:08 +08:00
|
|
|
|
break
|
|
|
|
|
|
case '2':
|
2023-05-28 14:42:55 +08:00
|
|
|
|
if (this.pkObj.workorder_status === '2') {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$refs.child.active = true
|
2023-05-26 19:12:08 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
2023-05-25 13:41:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 完工
|
|
|
|
|
|
async _tofinish () {
|
|
|
|
|
|
this.$refs.child.disabled = true
|
|
|
|
|
|
this.disabled3 = true
|
|
|
|
|
|
try {
|
|
|
|
|
|
let res = await tofinish(this.pkObj)
|
2023-07-23 12:56:58 +08:00
|
|
|
|
this.toast(res.msg)
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.disabled3 = false
|
2023-05-26 19:12:08 +08:00
|
|
|
|
this.pkId = ''
|
|
|
|
|
|
this.pkObj = {}
|
2023-05-25 13:41:11 +08:00
|
|
|
|
this.$refs.child.active = false
|
|
|
|
|
|
this.$refs.child.disabled = false
|
|
|
|
|
|
this.getDatas()
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
this.disabled3 = false
|
|
|
|
|
|
this.$refs.child.active = false
|
|
|
|
|
|
this.$refs.child.disabled = false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-05-26 19:12:08 +08:00
|
|
|
|
toSureDialog (type) {
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case '1':
|
|
|
|
|
|
this._saveReport()
|
|
|
|
|
|
break
|
|
|
|
|
|
case '2':
|
|
|
|
|
|
this._tofinish()
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
2023-05-22 18:09:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
toRadio (e) {
|
|
|
|
|
|
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
|
|
|
|
|
|
this.pkObj = this.pkId === e.workorder_id ? e : {}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
|
|
.filter_label
|
|
|
|
|
|
width 32px
|
|
|
|
|
|
.filter-input-wrap
|
|
|
|
|
|
width calc(100% - 32px)
|
|
|
|
|
|
</style>
|