init
This commit is contained in:
202
src/pages/assignment/OperSearch.vue
Normal file
202
src/pages/assignment/OperSearch.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" activeIndex="4">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fl mgt10">
|
||||
工单日期
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="fl mgt10 keyValue">
|
||||
关键字
|
||||
<input type="text" class="input" v-model="keyValue" placeholder="请输入工单号、物料编码">
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr5 button--primary" @click="toSearch">查 询</button>
|
||||
<button class="button--primary" @click="addProduce">追加生产</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%"></th>
|
||||
<th width="8%">工单号</th>
|
||||
<th width="8%">班次</th>
|
||||
<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="13%">开始时间</th>
|
||||
<th width="13%">结束时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</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>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<modal
|
||||
:mdShow='mdShow'
|
||||
message="请输入追加生产数量"
|
||||
:disabled='disabled'
|
||||
@closeModalCallback="closeModalCall"
|
||||
@comfirmCallback="comfirmCall">
|
||||
追加数量
|
||||
<div class="input-cus-wrap">
|
||||
<input type="number" class="input input-cus" v-model.trim.number="produceQty">
|
||||
<i v-show="closeIcon2" class="iconfont close_icon" @click="clearData(2)"></i>
|
||||
</div>
|
||||
</modal>
|
||||
<Back></Back>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
import {dateFtt} from '@config/utils.js'
|
||||
import Modal from '@components/Modal.vue'
|
||||
import Back from '@components/Back.vue'
|
||||
export default {
|
||||
name: 'Operation',
|
||||
components: {
|
||||
SecHeader,
|
||||
Modal,
|
||||
Back
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
value1: [new Date(), new Date()],
|
||||
deviceCode: this.$store.getters.deviceCode,
|
||||
keyValue: '',
|
||||
datas: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
mdShow: false,
|
||||
produceQty: '',
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
closeIcon1 () {
|
||||
return this.keyValue !== ''
|
||||
},
|
||||
closeIcon2 () {
|
||||
return this.produceQty !== ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getDatas()
|
||||
},
|
||||
methods: {
|
||||
clearData (e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
this.keyValue = ''
|
||||
break
|
||||
case 2:
|
||||
this.produceQty = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
getDatas () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryProduceOrderReprot',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
device_uuid: this.$store.getters.deviceUuid,
|
||||
key_value: this.keyValue,
|
||||
order_date1: this.value1 !== null ? dateFtt(this.value1[0]) : '',
|
||||
order_date2: this.value1 !== null ? dateFtt(this.value1[1]) : '',
|
||||
is_finished: '',
|
||||
is_producted: '',
|
||||
is_qc: '1'
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.datas = res.allrows
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
},
|
||||
toSearch () {
|
||||
this.getDatas()
|
||||
},
|
||||
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
|
||||
},
|
||||
addProduceData () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'addNewProduceOrder',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
produceorder_uuid: this.pkObj.produceorder_uuid,
|
||||
produce_qty: this.produceQty
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.datas = []
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.mdShow = false
|
||||
this.produceQty = ''
|
||||
this.toast(res.desc)
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.mdShow = false
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.disabled = false
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
363
src/pages/assignment/Operation.vue
Normal file
363
src/pages/assignment/Operation.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" activeIndex="1">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('01')">开 始</button>
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('03')">报 工</button>
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('02', '1')">强制结束</button>
|
||||
<button class="button--primary" :disabled="disabled" @click="toHandle('02', '2')">更换设备</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%">
|
||||
<button v-if="isMultiple === '1'" class="iconfont select_icon select_square_icon" :class="allChoice === true ? 'selected_icon' : 'unselect_icon'" @click="allChecked"></button>
|
||||
</th>
|
||||
<th width="11%">工单号</th>
|
||||
<th width="13%">班次</th>
|
||||
<th width="13%">物料名称</th>
|
||||
<th width="10%">工序</th>
|
||||
<th width="13%">生产数量</th>
|
||||
<th width="10%">期初数量</th>
|
||||
<th width="13%">本次加工</th>
|
||||
<th width="13%">开始时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button v-if="isMultiple === '1'" class="iconfont select_icon select_square_icon" :class="e.checked === true ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
<button v-else class="iconfont select_icon" :class="e.checked === true ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{e.produce_qty}}</td>
|
||||
<td>{{e.initial_qty}}</td>
|
||||
<td>{{e.this_qty}}</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<modal
|
||||
:mdShow='mdShow2'
|
||||
message="提示"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall2"
|
||||
@comfirmCallback="comfirmCall2">
|
||||
工单更换设备后不可恢复,确定继续?
|
||||
</modal>
|
||||
<modal
|
||||
:mdShow='mdShow1'
|
||||
message="提示"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall1"
|
||||
@comfirmCallback="comfirmCall1">
|
||||
当前操作为强制确认,确定继续操作吗?
|
||||
</modal>
|
||||
<!-- <modal
|
||||
:mdShow='mdShow1'
|
||||
message="请选择结束时间"
|
||||
:disabled = "disabled"
|
||||
@closeModalCallback="closeModalCall1"
|
||||
@comfirmCallback="comfirmCall1">
|
||||
结束时间
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</modal> -->
|
||||
<!-- <modal
|
||||
:mdShow='mdShow3'
|
||||
message="请选择结束类型"
|
||||
@closeModalCallback="closeModalCall3"
|
||||
@comfirmCallback="comfirmCall3">
|
||||
结转类型
|
||||
<button class="radio_icon" :class="orderScodeType == '03' ? 'radio_selected_icon' : 'radio_unselect_icon'" @click="radioType"></button>
|
||||
<span class="modal-radio mgr5">工单遗留</span>
|
||||
<button class="radio_icon" :class="orderScodeType == '04' ? 'radio_selected_icon' : 'radio_unselect_icon'" @click="radioType"></button>
|
||||
<span class="modal-radio">工单异常</span>
|
||||
</modal> -->
|
||||
</div>
|
||||
<Back></Back>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {dateTimeFtt} from '@config/utils.js'
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
import Modal from '@components/Modal.vue'
|
||||
import Back from '@components/Back.vue'
|
||||
export default {
|
||||
name: 'Operation',
|
||||
components: {
|
||||
SecHeader,
|
||||
Modal,
|
||||
Back
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceCode: this.$store.getters.deviceCode,
|
||||
datas: [],
|
||||
type: '',
|
||||
force: '',
|
||||
mdShow1: false,
|
||||
// value1: '',
|
||||
mdShow2: false,
|
||||
disabled: false,
|
||||
isProductonplan: this.$store.getters.isProductonplan,
|
||||
isMultiple: ''
|
||||
// mdShow3: false,
|
||||
// orderScodeType: '03'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
allChoice () {
|
||||
let arr = this.datas.filter(el => {
|
||||
return el.checked === true
|
||||
})
|
||||
return arr.length === this.datas.length
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getDatas()
|
||||
},
|
||||
methods: {
|
||||
closeModalCall1 () {
|
||||
this.mdShow1 = false
|
||||
},
|
||||
comfirmCall1 () {
|
||||
this.disabled = true
|
||||
// if (this.value1 === '' || this.value1 === null) {
|
||||
// this.toast('请选择日期时间')
|
||||
// this.disabled = false
|
||||
// return
|
||||
// }
|
||||
// let dateTime = dateTimeFtt(this.value1)
|
||||
// this.toReport(dateTime)
|
||||
this.toReport()
|
||||
},
|
||||
closeModalCall2 () {
|
||||
this.mdShow2 = false
|
||||
},
|
||||
comfirmCall2 () {
|
||||
this.disabled = true
|
||||
this.toReport()
|
||||
},
|
||||
getDatas () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryProduceOrderReprot',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
device_uuid: this.$store.getters.deviceUuid,
|
||||
key_value: '',
|
||||
order_date1: '',
|
||||
order_date2: '',
|
||||
is_finished: '0',
|
||||
is_producted: '',
|
||||
is_qc: '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1' && res.allrows.length > 0) {
|
||||
this.datas = []
|
||||
this.isMultiple = res.result.is_multiple
|
||||
res.allrows.map(el => {
|
||||
this.datas.push(Object.assign({}, el, {'checked': false}))
|
||||
})
|
||||
if (this.isProductonplan === '0') { // 0 否:工单操作页面工单默认第一条,可人工选择
|
||||
if (this.isMultiple === '0' || this.isMultiple === '2') { // 0 单选:工单操作页面默认第一条;2 单选:工单操作页面默认第一条;但不受“按计划生产“参数影响,可人工选择
|
||||
this.datas[0].checked = true
|
||||
} else if (this.isMultiple === '1') { // 1 可多选:工单操作页面默认全选
|
||||
this.datas.map(el => { el.checked = true })
|
||||
}
|
||||
} else if (this.isProductonplan === '1') { // 1 是:工单操作页面工单只能第一条,不可人工选择
|
||||
if (this.isMultiple === '0' || this.isMultiple === '2') {
|
||||
this.datas[0].checked = true
|
||||
} else if (this.isMultiple === '1') {
|
||||
this.datas.map(el => { el.checked = true })
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
},
|
||||
toRadio (e) {
|
||||
if (this.isProductonplan === '0') { // 0 可人工选择
|
||||
if (this.isMultiple === '0' || this.isMultiple === '2') { // 0 2 单选
|
||||
this.datas.map(el => {
|
||||
if (el.pk_id === e.pk_id) {
|
||||
e.checked = !e.checked
|
||||
} else {
|
||||
el.checked = false
|
||||
}
|
||||
})
|
||||
} else if (this.isMultiple === '1') { // 1 多选
|
||||
e.checked = !e.checked
|
||||
}
|
||||
} else if (this.isProductonplan === '1') { // 1 不可人工选择
|
||||
if (this.isMultiple === '1') {
|
||||
e.checked = !e.checked
|
||||
}
|
||||
if (this.isMultiple === '2') {
|
||||
this.datas.map(el => {
|
||||
if (el.pk_id === e.pk_id) {
|
||||
e.checked = !e.checked
|
||||
} else {
|
||||
el.checked = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
allChecked () {
|
||||
if (this.allChoice) {
|
||||
this.datas.map(el => { el.checked = false })
|
||||
} else {
|
||||
this.datas.map(el => { el.checked = true })
|
||||
}
|
||||
},
|
||||
toReport (dateTime) {
|
||||
let arr = this.datas.filter(el => { return el.checked === true })
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'reportProduceOrder',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
operate_type: this.type,
|
||||
realproduceend_date: this.type === '02' && this.force === '1' ? dateTime : '',
|
||||
is_force: this.type === '02' ? this.force : ''
|
||||
|
||||
},
|
||||
allrows: arr
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.type = ''
|
||||
this.force = ''
|
||||
this.mdShow1 = false
|
||||
this.mdShow2 = false
|
||||
this.disabled = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.disabled = false
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
toHandle (type, force) {
|
||||
this.disabled = true
|
||||
let arr = this.datas.filter(el => { return el.checked === true })
|
||||
if (arr.length === 0) {
|
||||
this.toast('请选择工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
if (type === '01') {
|
||||
let flag = false
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].realproducestart_date !== '') {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
this.toast('选择未开始工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '01'
|
||||
this.toReport()
|
||||
} else if (type === '02' && force === '2') {
|
||||
this.type = '02'
|
||||
this.force = '2'
|
||||
this.disabled = false
|
||||
this.mdShow2 = true
|
||||
} else if (type === '02' && force === '1') {
|
||||
this.type = '02'
|
||||
this.force = '1'
|
||||
this.disabled = false
|
||||
this.mdShow1 = true
|
||||
} else if (type === '03') {
|
||||
let flag = false
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i].realproducestart_date === '') {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
this.toast('选择已开始工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '03'
|
||||
this.toReport()
|
||||
}
|
||||
// else if (type === '04') {
|
||||
// if (this.pkObj.realproducestart_date === '') {
|
||||
// this.toast('请选择已开始工单!')
|
||||
// this.disabled = false
|
||||
// return
|
||||
// }
|
||||
// this.disabled = false
|
||||
// this.mdShow3 = true
|
||||
// }
|
||||
}
|
||||
// orderTurn () {
|
||||
// let data = {
|
||||
// '_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
// '_SRVMETHOD': 'carryProduceOrder',
|
||||
// '_DATA': JSON.stringify({
|
||||
// accountId: this.$store.getters.accountId,
|
||||
// form: {
|
||||
// produceorder_uuid: this.pkObj.produceorder_uuid,
|
||||
// order_type_scode: this.orderScodeType
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// this.$post(data)
|
||||
// .then(res => {
|
||||
// if (res.code === '1') {
|
||||
// this.mdShow3 = false
|
||||
// this.toast(res.desc)
|
||||
// this.orderScodeType = ''
|
||||
// this.getDatas()
|
||||
// } else {
|
||||
// this.Dialog(res.desc)
|
||||
// }
|
||||
// this.disabled = false
|
||||
// })
|
||||
// .catch(error => {
|
||||
// this.disabled = false
|
||||
// console.log(error)
|
||||
// })
|
||||
// },
|
||||
// closeModalCall3 () {
|
||||
// this.mdShow3 = false
|
||||
// },
|
||||
// comfirmCall3 () {
|
||||
// this.disabled = true
|
||||
// this.orderTurn()
|
||||
// },
|
||||
// radioType () {
|
||||
// this.orderScodeType = this.orderScodeType === '03' ? '04' : '03'
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
</style>
|
||||
349
src/pages/assignment/Operation2.vue
Normal file
349
src/pages/assignment/Operation2.vue
Normal file
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" activeIndex="1">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('01')">开 始</button>
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('03')">暂 停</button>
|
||||
<button class="mgr54 button--primary" :disabled="disabled" @click="toHandle('02', '2')">报工结束</button>
|
||||
<!-- <button class="mgr5 button--primary" :disabled="disabled" @click="toHandle('04')">工单结转</button> -->
|
||||
<button class="button--primary" :disabled="disabled" @click="toHandle('02', '1')">强制结束</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%">
|
||||
<button v-if="choice === '1'" class="iconfont select_icon select_square_icon" :class="allChoice === true ? 'selected_icon' : 'unselect_icon'" @click="allChecked"></button>
|
||||
</th>
|
||||
<th width="11%">工单号</th>
|
||||
<th width="13%">班次</th>
|
||||
<th width="13%">物料名称</th>
|
||||
<th width="10%">工序</th>
|
||||
<th width="13%">生产数量</th>
|
||||
<th width="10%">期初数量</th>
|
||||
<th width="13%">本次加工</th>
|
||||
<th width="13%">开始时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button v-if="choice === '1'" class="iconfont select_icon select_square_icon" :class="e.checked === true ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
<button v-else class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{e.produce_qty}}</td>
|
||||
<td>{{e.initial_qty}}</td>
|
||||
<td>{{e.this_qty}}</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<modal
|
||||
:mdShow='mdShow2'
|
||||
message="提示"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall2"
|
||||
@comfirmCallback="comfirmCall2">
|
||||
工单报工结束后不可重新开始,确定要进行报工操作吗?
|
||||
</modal>
|
||||
<modal
|
||||
:mdShow='mdShow1'
|
||||
message="提示"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall1"
|
||||
@comfirmCallback="comfirmCall1">
|
||||
当前操作为强制确认,确定继续操作吗?
|
||||
</modal>
|
||||
<!-- <modal
|
||||
:mdShow='mdShow1'
|
||||
message="请选择结束时间"
|
||||
:disabled = "disabled"
|
||||
@closeModalCallback="closeModalCall1"
|
||||
@comfirmCallback="comfirmCall1">
|
||||
结束时间
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</modal> -->
|
||||
<!-- <modal
|
||||
:mdShow='mdShow3'
|
||||
message="请选择结束类型"
|
||||
@closeModalCallback="closeModalCall3"
|
||||
@comfirmCallback="comfirmCall3">
|
||||
结转类型
|
||||
<button class="radio_icon" :class="orderScodeType == '03' ? 'radio_selected_icon' : 'radio_unselect_icon'" @click="radioType"></button>
|
||||
<span class="modal-radio mgr5">工单遗留</span>
|
||||
<button class="radio_icon" :class="orderScodeType == '04' ? 'radio_selected_icon' : 'radio_unselect_icon'" @click="radioType"></button>
|
||||
<span class="modal-radio">工单异常</span>
|
||||
</modal> -->
|
||||
</div>
|
||||
<Back></Back>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import {dateTimeFtt} from '@config/utils.js'
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
import Modal from '@components/Modal.vue'
|
||||
import Back from '@components/Back.vue'
|
||||
export default {
|
||||
name: 'Operation',
|
||||
components: {
|
||||
SecHeader,
|
||||
Modal,
|
||||
Back
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceCode: this.$store.getters.deviceCode,
|
||||
datas: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
type: '',
|
||||
force: '',
|
||||
mdShow1: false,
|
||||
value1: '',
|
||||
mdShow2: false,
|
||||
disabled: false,
|
||||
isProplan: this.$store.getters.isProplan,
|
||||
choice: ''
|
||||
// mdShow3: false,
|
||||
// orderScodeType: '03'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
allChoice () {
|
||||
let arr = this.datas.filter(el => {
|
||||
return el.checked === true
|
||||
})
|
||||
return arr.length === this.datas.length
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getDatas()
|
||||
},
|
||||
methods: {
|
||||
closeModalCall1 () {
|
||||
this.mdShow1 = false
|
||||
},
|
||||
comfirmCall1 () {
|
||||
this.disabled = true
|
||||
// if (this.value1 === '' || this.value1 === null) {
|
||||
// this.toast('请选择日期时间')
|
||||
// this.disabled = false
|
||||
// return
|
||||
// }
|
||||
// let dateTime = dateTimeFtt(this.value1)
|
||||
// this.toReport(dateTime)
|
||||
this.toReport()
|
||||
},
|
||||
closeModalCall2 () {
|
||||
this.mdShow2 = false
|
||||
},
|
||||
comfirmCall2 () {
|
||||
this.disabled = true
|
||||
this.toReport()
|
||||
},
|
||||
getDatas () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryProduceOrderReprot',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
device_uuid: this.$store.getters.deviceUuid,
|
||||
key_value: '',
|
||||
order_date1: '',
|
||||
order_date2: '',
|
||||
is_finished: '0',
|
||||
is_producted: '',
|
||||
is_qc: '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.datas = []
|
||||
this.choice = res.is_multiple
|
||||
if (this.choice === '1') {
|
||||
res.allrows.map(el => {
|
||||
this.datas.push(Object.assign({}, el, {'checked': true}))
|
||||
})
|
||||
} else {
|
||||
this.datas = res.allrows
|
||||
if (this.datas.length) {
|
||||
this.pkId = this.datas[0].pk_id
|
||||
this.pkObj = this.datas[0]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
},
|
||||
toRadio (e) {
|
||||
if (this.isProplan === '1') {
|
||||
return
|
||||
}
|
||||
if (this.choice === '1') {
|
||||
e.checked = !e.checked
|
||||
} else {
|
||||
this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
|
||||
this.pkObj = this.pkId === e.pk_id ? e : {}
|
||||
}
|
||||
},
|
||||
allChecked () {
|
||||
if (this.allChoice) {
|
||||
this.datas.map(el => { el.checked = false })
|
||||
} else {
|
||||
this.datas.map(el => { el.checked = true })
|
||||
}
|
||||
},
|
||||
toReport (dateTime) {
|
||||
let arr = this.datas.filter(el => { return el.checked === true })
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'reportProduceOrder',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
operate_type: this.type,
|
||||
realproduceend_date: this.type === '02' && this.force === '1' ? dateTime : '',
|
||||
is_force: this.type === '02' ? this.force : ''
|
||||
|
||||
},
|
||||
allrows: this.choice === '0' ? [{produceorder_uuid: this.pkObj.produceorder_uuid}] : arr
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.toast(res.desc)
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.type = ''
|
||||
this.force = ''
|
||||
this.mdShow1 = false
|
||||
this.mdShow2 = false
|
||||
this.disabled = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.disabled = false
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
toHandle (type, force) {
|
||||
this.disabled = true
|
||||
let arr1 = this.datas.filter(el => { return el.checked === true })
|
||||
if ((this.choice === '0' && this.pkId === '') || (this.choice === '1' && arr1.length === 0)) {
|
||||
this.toast('请选择工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
if (this.choice === '0' && type === '01') {
|
||||
if (this.pkObj.realproducestart_date !== '') {
|
||||
this.toast('工单已开始!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '01'
|
||||
this.toReport()
|
||||
} else if (this.choice === '1' && type === '01') {
|
||||
let arr2 = arr1.filter(el => { return el.realproducestart_date === '' })
|
||||
if (arr2.length < arr1.length) {
|
||||
this.toast('选择未开始工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '01'
|
||||
this.toReport()
|
||||
} else if (type === '02' && force === '2') {
|
||||
this.type = '02'
|
||||
this.force = '2'
|
||||
this.disabled = false
|
||||
this.mdShow2 = true
|
||||
} else if (type === '02' && force === '1') {
|
||||
this.type = '02'
|
||||
this.force = '1'
|
||||
this.value1 = new Date()
|
||||
this.disabled = false
|
||||
this.mdShow1 = true
|
||||
} else if (this.choice === '0' && type === '03') {
|
||||
if (this.pkObj.realproducestart_date === '') {
|
||||
this.toast('请选择已开始工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '03'
|
||||
this.toReport()
|
||||
} else if (this.choice === '1' && type === '03') {
|
||||
let arr3 = arr1.filter(el => { return el.realproducestart_date !== '' })
|
||||
if (arr3.length < arr1.length) {
|
||||
this.toast('请选择已开始工单!')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.type = '03'
|
||||
this.toReport()
|
||||
}
|
||||
// else if (type === '04') {
|
||||
// if (this.pkObj.realproducestart_date === '') {
|
||||
// this.toast('请选择已开始工单!')
|
||||
// this.disabled = false
|
||||
// return
|
||||
// }
|
||||
// this.disabled = false
|
||||
// this.mdShow3 = true
|
||||
// }
|
||||
}
|
||||
// orderTurn () {
|
||||
// let data = {
|
||||
// '_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
// '_SRVMETHOD': 'carryProduceOrder',
|
||||
// '_DATA': JSON.stringify({
|
||||
// accountId: this.$store.getters.accountId,
|
||||
// form: {
|
||||
// produceorder_uuid: this.pkObj.produceorder_uuid,
|
||||
// order_type_scode: this.orderScodeType
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// this.$post(data)
|
||||
// .then(res => {
|
||||
// if (res.code === '1') {
|
||||
// this.mdShow3 = false
|
||||
// this.toast(res.desc)
|
||||
// this.orderScodeType = ''
|
||||
// this.getDatas()
|
||||
// } else {
|
||||
// this.Dialog(res.desc)
|
||||
// }
|
||||
// this.disabled = false
|
||||
// })
|
||||
// .catch(error => {
|
||||
// this.disabled = false
|
||||
// console.log(error)
|
||||
// })
|
||||
// },
|
||||
// closeModalCall3 () {
|
||||
// this.mdShow3 = false
|
||||
// },
|
||||
// comfirmCall3 () {
|
||||
// this.disabled = true
|
||||
// this.orderTurn()
|
||||
// },
|
||||
// radioType () {
|
||||
// this.orderScodeType = this.orderScodeType === '03' ? '04' : '03'
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
</style>
|
||||
26
src/pages/assignment/StateSet.vue
Normal file
26
src/pages/assignment/StateSet.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" activeIndex="3">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fr mgt10">
|
||||
<button class="button--primary">设 置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
export default {
|
||||
name: 'StateSet',
|
||||
components: {
|
||||
SecHeader
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
deviceCode: this.$store.getters.deviceCode
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
213
src/pages/assignment/UngradeRecord.vue
Normal file
213
src/pages/assignment/UngradeRecord.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" :tabShow="false" :inner="true" @goIn="goIn">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr5 button--primary" @click="toHandle('02')">修 改</button>
|
||||
<button class="button--primary" @click="toHandle('03')">删 除</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%"></th>
|
||||
<th width="18%">上报时间</th>
|
||||
<th width="13%">工单号</th>
|
||||
<th width="13%">班次</th>
|
||||
<th width="13%">物料名称</th>
|
||||
<th width="13%">工序</th>
|
||||
<th width="13%">生产数量</th>
|
||||
<th width="13%">上报残次数</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{e.produce_qty}}</td>
|
||||
<td>{{e.unqualified_qty}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<modal
|
||||
:mdShow='mdShow'
|
||||
message="请输入残次品数量"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall"
|
||||
@comfirmCallback="comfirmCall">
|
||||
残次品数量
|
||||
<div class="input-cus-wrap">
|
||||
<input type="number" class="input input-cus" v-model.trim.number="unQty">
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
</modal>
|
||||
<modal
|
||||
:mdShow='mdShow2'
|
||||
message="提示"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall2"
|
||||
@comfirmCallback="comfirmCall2">
|
||||
当前为删除操作,是否继续?
|
||||
</modal>
|
||||
<Back></Back>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
import Modal from '@components/Modal.vue'
|
||||
import Back from '@components/Back.vue'
|
||||
export default {
|
||||
name: 'UngradeRecord',
|
||||
components: {
|
||||
SecHeader,
|
||||
Modal,
|
||||
Back
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
datas: [],
|
||||
deviceCode: this.$store.getters.deviceCode,
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
unQty: '',
|
||||
uunQty: '',
|
||||
mdShow: false,
|
||||
type: '',
|
||||
mdShow2: false,
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
closeIcon1 () {
|
||||
return this.unQty !== ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
unQty (e) {
|
||||
if (Number(e) < 0) {
|
||||
this.unQty = this.pkObj.unqualified_qty
|
||||
}
|
||||
if (Number(e) > this.pkObj.produce_qty) {
|
||||
this.unQty = this.pkObj.produce_qty
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getDatas()
|
||||
},
|
||||
methods: {
|
||||
goIn () {
|
||||
this.$router.push('/ungraded')
|
||||
},
|
||||
clearData (e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
this.unQty = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
getDatas () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryQCRecord',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
device_uuid: this.$store.getters.deviceUuid,
|
||||
// key_value: this.$route.query.keyValue,
|
||||
key_value: '',
|
||||
report_date1: new Date(new Date().getTime() - 24 * 60 * 60 * 1000),
|
||||
report_date2: new Date()
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.datas = res.allrows
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
|
||||
this.pkObj = this.pkId === e.pk_id ? e : {}
|
||||
},
|
||||
reportInterface () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'reportQCRecord',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
operate_type: this.type,
|
||||
producereport_uuid: this.pkObj.producereport_uuid,
|
||||
produceorder_uuid: '',
|
||||
unqualified_qty: this.type === '02' ? this.unQty : ''
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.mdShow = false
|
||||
this.mdShow2 = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.unQty = ''
|
||||
this.type = ''
|
||||
this.toast(res.desc)
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.mdShow = false
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.disabled = false
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
closeModalCall () {
|
||||
this.mdShow = false
|
||||
},
|
||||
comfirmCall () {
|
||||
this.disabled = true
|
||||
if (this.unQty === '' || this.unQty === null) {
|
||||
this.toast('请残次品数量')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.reportInterface()
|
||||
},
|
||||
toHandle (type) {
|
||||
if (this.pkId === '') {
|
||||
this.toast('请选择工单!')
|
||||
return
|
||||
}
|
||||
if (type === '02') {
|
||||
this.type = '02'
|
||||
this.unQty = this.pkObj.unqualified_qty
|
||||
this.mdShow = true
|
||||
}
|
||||
if (type === '03') {
|
||||
this.type = '03'
|
||||
this.mdShow2 = true
|
||||
}
|
||||
},
|
||||
closeModalCall2 () {
|
||||
this.mdShow2 = false
|
||||
},
|
||||
comfirmCall2 () {
|
||||
this.disabled = true
|
||||
this.reportInterface()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
235
src/pages/assignment/Ungraded.vue
Normal file
235
src/pages/assignment/Ungraded.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<sec-header :deviceCode="deviceCode" activeIndex="2">
|
||||
<div class="wrap">
|
||||
<div class="wrap-filter">
|
||||
<div class="fl mgt10">
|
||||
工单日期
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="fl mgt10 keyValue">
|
||||
关键字
|
||||
<input type="text" class="input" v-model="keyValue" placeholder="请输入工单号、物料编码">
|
||||
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
|
||||
</div>
|
||||
<div class="fr mgt10">
|
||||
<button class="mgr5 button--primary" @click="onSearch">查 询</button>
|
||||
<button class="mgr5 button--primary" @click="onReport">上 报</button>
|
||||
<button class="button--primary" @click="reportPage">上报记录</button>
|
||||
</div>
|
||||
</div>
|
||||
<table class="filter-table">
|
||||
<tr>
|
||||
<th width="4%"></th>
|
||||
<th width="13%">工单号</th>
|
||||
<th width="13%">班次</th>
|
||||
<th width="13%">物料名称</th>
|
||||
<th width="8%">工序</th>
|
||||
<th width="10%">生产数量</th>
|
||||
<th width="9%">上报残次数</th>
|
||||
<th width="10%">本次加工</th>
|
||||
<th width="10%">开始时间</th>
|
||||
<th width="10%">结束时间</th>
|
||||
</tr>
|
||||
<tr v-for="e in datas" :key="e.pk_id" @click="toRadio(e)">
|
||||
<td>
|
||||
<button class="iconfont select_icon" :class="pkId === e.pk_id ? 'selected_icon' : 'unselect_icon'"></button>
|
||||
</td>
|
||||
<td>{{e.produceorder_code}}</td>
|
||||
<td>{{e.shift_type_scode_name}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.workprocedure_name}}</td>
|
||||
<td>{{e.produce_qty}}</td>
|
||||
<td>{{e.unqualified_qty}}</td>
|
||||
<td>{{e.this_qty}}</td>
|
||||
<td>{{e.realproducestart_date}}</td>
|
||||
<td>{{e.realproduceend_date}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<modal
|
||||
:mdShow='mdShow'
|
||||
message="请输入残次品数量"
|
||||
:disabled="disabled"
|
||||
@closeModalCallback="closeModalCall"
|
||||
@comfirmCallback="comfirmCall">
|
||||
残次品数量
|
||||
<div class="input-cus-wrap">
|
||||
<input type="number" class="input input-cus" v-model.trim.number="unQty">
|
||||
<i v-show="closeIcon2" class="iconfont close_icon" @click="clearData(2)"></i>
|
||||
</div>
|
||||
</modal>
|
||||
</div>
|
||||
<Back></Back>
|
||||
</sec-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SecHeader from '@components/SecHeader.vue'
|
||||
import Modal from '@components/Modal.vue'
|
||||
import {dateFtt} from '@config/utils.js'
|
||||
import Back from '@components/Back.vue'
|
||||
export default {
|
||||
name: 'Ungraded',
|
||||
components: {
|
||||
SecHeader,
|
||||
Modal,
|
||||
Back
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
value1: [new Date(), new Date()],
|
||||
deviceCode: this.$store.getters.deviceCode,
|
||||
datas: [],
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
keyValue: '',
|
||||
mdShow: false,
|
||||
type: '',
|
||||
unQty: '',
|
||||
thisQty: '',
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
closeIcon1 () {
|
||||
return this.keyValue !== ''
|
||||
},
|
||||
closeIcon2 () {
|
||||
return this.unQty !== ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
unQty (e) {
|
||||
if (Number(e) <= 0) {
|
||||
this.unQty = ''
|
||||
}
|
||||
if (Number(e) > this.thisQty) {
|
||||
this.unQty = this.thisQty
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getDatas()
|
||||
},
|
||||
methods: {
|
||||
clearData (e) {
|
||||
switch (e) {
|
||||
case 1:
|
||||
this.keyValue = ''
|
||||
break
|
||||
case 2:
|
||||
this.unQty = ''
|
||||
break
|
||||
}
|
||||
},
|
||||
getDatas () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'queryProduceOrderReprot',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
device_uuid: this.$store.getters.deviceUuid,
|
||||
key_value: this.keyValue,
|
||||
order_date1: this.value1 !== null ? dateFtt(this.value1[0]) : '',
|
||||
order_date2: this.value1 !== null ? dateFtt(this.value1[1]) : '',
|
||||
is_finished: '',
|
||||
is_producted: '1',
|
||||
is_qc: '1'
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.datas = res.allrows
|
||||
} else {
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
})
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.pk_id ? '' : e.pk_id
|
||||
this.pkObj = this.pkId === e.pk_id ? e : {}
|
||||
},
|
||||
onSearch () {
|
||||
this.getDatas()
|
||||
},
|
||||
onReport () {
|
||||
if (this.pkId === '') {
|
||||
this.toast('请选择工单!')
|
||||
return
|
||||
}
|
||||
if (Number(this.pkObj.this_qty) === 0) {
|
||||
this.toast('本次加工数为0,不能上报')
|
||||
return
|
||||
}
|
||||
this.type = '01'
|
||||
this.thisQty = this.pkObj.this_qty
|
||||
this.mdShow = true
|
||||
},
|
||||
reportInterface () {
|
||||
let data = {
|
||||
'_SRVNAME': 'service.mps.AIOProduceReport20',
|
||||
'_SRVMETHOD': 'reportQCRecord',
|
||||
'_DATA': JSON.stringify({
|
||||
accountId: this.$store.getters.accountId,
|
||||
form: {
|
||||
operate_type: this.type,
|
||||
producereport_uuid: '',
|
||||
produceorder_uuid: this.pkObj.produceorder_uuid,
|
||||
unqualified_qty: this.unQty
|
||||
}
|
||||
})
|
||||
}
|
||||
this.$post(data)
|
||||
.then(res => {
|
||||
if (res.code === '1') {
|
||||
this.mdShow = false
|
||||
this.pkId = ''
|
||||
this.pkObj = {}
|
||||
this.unQty = ''
|
||||
this.thisQty = ''
|
||||
this.type = ''
|
||||
this.toast(res.desc)
|
||||
this.getDatas()
|
||||
} else {
|
||||
this.mdShow = false
|
||||
this.Dialog(res.desc)
|
||||
}
|
||||
this.disabled = false
|
||||
})
|
||||
.catch(error => {
|
||||
this.disabled = false
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
closeModalCall () {
|
||||
this.mdShow = false
|
||||
},
|
||||
comfirmCall () {
|
||||
this.disabled = true
|
||||
if (this.unQty === '' || this.unQty === null) {
|
||||
this.toast('请输入残次品数量')
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
this.reportInterface()
|
||||
},
|
||||
reportPage () {
|
||||
this.$router.push({
|
||||
path: '/ungraderecord',
|
||||
query: {
|
||||
// keyValue: this.keyValue,
|
||||
device_uuid: this.$route.query.device_uuid
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user