This commit is contained in:
2023-07-04 11:30:19 +08:00
parent 698d282aee
commit 72ca8adefb
3 changed files with 34 additions and 11 deletions

View File

@@ -116,7 +116,7 @@ export default {
date: [new Date((new Date().getTime() - 6 * 24 * 60 * 60 * 1000)), new Date((new Date().getTime()))],
options2: [],
value2: '',
dataList: [{bill_code: '030301010031'}],
dataList: [],
pkId: '',
pkObj: {},
disabled1: false

View File

@@ -48,7 +48,7 @@
</div>
</div>
<div class="search-item_2 flexend">
<button class="button button--primary" @click="toInConfirm">确认入库</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': this.value1 === '' || this.value2 === '' || this.value3 === '' || this.remark === '' || this.dataList === []}" @click="toSure">确认入库</button>
<button class="button button--primary" @click="toSearch">作业查询</button>
<button class="button button--primary" @click="toAddBillMater">添加单据物料</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="delRow">删除一行</button>
@@ -102,7 +102,7 @@ export default {
dataList: [],
pkId: '',
pkObj: {},
disabled1: false
disabled2: false
}
},
beforeRouteLeave (to, from, next) {
@@ -141,14 +141,32 @@ export default {
let res = await getPoint()
this.options3 = [...res.data]
},
toInConfirm () {
this._confirmIn()
},
async _confirmIn () {
// 确认入库
async toSure () {
this.disabled2 = true
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.remark === '' || this.dataList === []) {
this.disabled2 = false
return
}
try {
let res = await confirmIn(this.value1, this.value2, this.value3, this.remark, this.dataList)
let from = {
stor_id: this.value1,
bill_type: this.value2,
point_code: this.value3,
remark: this.remark,
rows: this.dataList
}
let res = await confirmIn(from)
this.toast(res.message)
this.value1 = ''
this.value2 = ''
this.value3 = ''
this.remark = ''
this.dataList = []
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
} catch (e) {
this.disabled2 = false
}
},
toAddBillMater () {

View File

@@ -84,7 +84,7 @@ export default {
val1: '',
val2: '',
date: [new Date((new Date().getTime() - 6 * 24 * 60 * 60 * 1000)), new Date((new Date().getTime()))],
dataList: [{sale_code: '030301010037', checked: false}, {sale_code: '030301010038', checked: false}],
dataList: [],
checkArr: []
}
},
@@ -130,8 +130,13 @@ export default {
if (this.checkArr.length === 0) {
return
}
this.$store.dispatch('setMaterArr', this.checkArr)
this.colseUp()
// 添加的物料订单号必须一样
if (this.checkArr.every(e => e.sale_code === this.checkArr[0].sale_code)) {
this.$store.dispatch('setMaterArr', this.checkArr)
this.colseUp()
} else {
this.toast('添加的物料订单号必须一样')
}
},
clearUp () {
this.checkArr = []