diff --git a/src/pages/xinrui/storage/settings/SoftWasteBarrelPrintNobag.vue b/src/pages/xinrui/storage/settings/SoftWasteBarrelPrintNobag.vue index 783f49a..c339eb0 100644 --- a/src/pages/xinrui/storage/settings/SoftWasteBarrelPrintNobag.vue +++ b/src/pages/xinrui/storage/settings/SoftWasteBarrelPrintNobag.vue @@ -45,8 +45,7 @@ + :open="open1"> @@ -129,11 +128,13 @@ export default { this.val4 = arr[3] this.val5 = arr[4] this.active = arr[5] + '' - this.option1.map((el, i) => { - if (el.value === arr[5]) { - this.active1 = i + '' - } - }) + if (this.option1.length) { + this.option1.map((el, i) => { + if (el.value === arr[5]) { + this.active1 = i + '' + } + }) + } }, toAdd () { this.printWeight = !this.printWeight @@ -161,7 +162,9 @@ export default { try { let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : '' let user = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).user_name : '' - let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': this.option[this.active].value, 'ivt_level': this.option1[this.active1].value} + let active = this.active !== '' ? this.option[this.active].value : '' + let active1 = this.active1 !== '' ? this.option1[this.active1].value : '' + let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': active, 'ivt_level': active1} let res = await confirmGroupBucketNo(newObj) if (res.code === '1') { this.toast(res.desc) @@ -188,7 +191,9 @@ export default { try { let accountId = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).account_id : '' let user = this.$store.getters.userInfo !== '' ? JSON.parse(this.$store.getters.userInfo).user_name : '' - let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': this.option[this.active].value, 'ivt_level': this.option1[this.active1].value} + let active = this.active !== '' ? this.option[this.active].value : '' + let active1 = this.active1 !== '' ? this.option1[this.active1].value : '' + let newObj = {'accountId': accountId, 'user': user, 'bucketunique': this.val1, 'material_code': this.val2, 'pcsn': this.val3, 'storage_qty': this.val4, 'date': this.val5, 'is_active': active, 'ivt_level': active1} let res = await confirmGroupBucketNo(newObj) if (res.code === '1') { this.toast(res.desc)