diff --git a/src/components/MultiTab/MultiTab.vue b/src/components/MultiTab/MultiTab.vue index beab9ff..774bf2e 100644 --- a/src/components/MultiTab/MultiTab.vue +++ b/src/components/MultiTab/MultiTab.vue @@ -235,6 +235,7 @@ export default { return ( 1 && page.meta.title != '首页'} @@ -248,6 +249,7 @@ export default { { diff --git a/src/views/main/BookingLedger/detail/modules/preOrder.vue b/src/views/main/BookingLedger/detail/modules/preOrder.vue index c9410ed..5b6e889 100644 --- a/src/views/main/BookingLedger/detail/modules/preOrder.vue +++ b/src/views/main/BookingLedger/detail/modules/preOrder.vue @@ -24,7 +24,7 @@ title="是否发送当前选中预配舱单?" ok-text="是" cancel-text="否" - @confirm="sendOrder()" + @confirm="sendOrderFun()" @cancel="cancelRemove" > 发送 @@ -970,7 +970,7 @@ - + @@ -1610,7 +1625,18 @@ export default { this.log({ data, selectionRangeIndexes, selectionRangeKeys }) } }, - selectArr: [] + selectArr: [], + showSendModel: false, + sendType: '', + sendOption: [ + { label: '新增', value: '0' }, + { label: '修改', value: '1' }, + { label: '删除', value: '2' }, + { label: '保存', value: '3' }, + { label: '作废', value: '4' } + ], + sendRemarkVal: '', + sendArr: [] } }, watch: { @@ -1855,11 +1881,11 @@ export default { this.$message.error(`${tempstr1}已发送,无需重复发送`) return false } - debugger if (sendArr.length === 0) { this.$message.error('暂无可发送舱单') return false } + this.sendArr = sendArr console.log('== 即将发送单号 ==', sendArr) const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' }) seaeEdiCustEDI(query).then((res) => { @@ -1900,7 +1926,7 @@ export default { this.orderDetails[type] = res['name'] || '' } else if (type === 'yard') { this.orderDetails[type] = res.name || '' - this.orderDetails[`${type}id`] = res.code || '' + this.orderDetails[`${type}id`] = res.showCode || '' } else if (type === 'carrier') { this.orderDetails.carrier = res.ediCode || '' this.orderDetails.carrierid = res.code || '' @@ -2142,6 +2168,7 @@ export default { this.orderDetails = res.data[0] } else { this.$message.error(res.message) + this.selectArr = [] } }) .catch((err) => { @@ -2156,7 +2183,90 @@ export default { this.getNoDataInit(true) this.editIndex = this.orderList.length - 1 }, - + sendOrderFun () { + console.log(this.selectArr) + if (this.selectArr.length === 0) { + this.$message.error('请选择发送单号') + return false + } + const sendArr = [] + let tempstr = '' + let tempstr1 = '' + this.selectArr.map((item, index) => { + if (this.orderList[item].id !== 0) { + if (this.orderList[item].state === '已录入') { + sendArr.push(this.orderList[item].id) + } else { + if (this.orderList[item].isHBL) { + tempstr1 += `分提单${this.orderList[item].hblno ? this.orderList[item].hblno : item},` + } else { + tempstr1 += `主提单${this.orderList[item].mblno ? this.orderList[item].mblno : item},` + } + } + } else { + if (this.orderList[item].isHBL) { + tempstr += `分提单${this.orderList[item].hblno ? this.orderList[item].hblno : item},` + } else { + tempstr += `主提单${this.orderList[item].mblno ? this.orderList[item].mblno : item},` + } + } + }) + console.log(tempstr) + if (tempstr) { + this.$message.error(`${tempstr}需要先保存再进行发送`) + return false + } + if (tempstr1) { + this.$message.error(`${tempstr1}已发送,无需重复发送`) + return false + } + if (sendArr.length === 0) { + this.$message.error('暂无可发送舱单') + return false + } + this.sendArr = sendArr + this.showSendModel = true + }, + // sendChange (e) { + // this.sendType = e.target.value + // console.log('radio1 checked', e.target.value); + // }, + sendSubmit () { + console.log('== 发送 ==', this.sendArr, this.sendType, this.sendRemarkVal) + console.log('== 即将发送单号 ==', this.sendArr) + if (!this.sendType) { + this.$message.error('请选择操作类型') + return false + } + if (!this.sendRemarkVal) { + this.$message.error('请输入备注') + return false + } + const query = this.$qs.stringify({ + Ids: this.sendArr.toString(), + type: this.sendType, + SENDREMARK: this.sendRemarkVal + }, { arrayFormat: 'repeat' }) + seaeEdiCustEDI(query).then((res) => { + if (res.success) { + this.$message.success('发送成功') + this.selectArr.map((item, index) => { + this.orderList[item].state = '已发送' + }) + this.sendClose() + } else { + this.$message.error(res.message) + } + }).catch((err) => { + console.log(err) + }) + }, + sendClose () { + this.showSendModel = false + this.sendType = '' + this.sendRemarkVal = '' + console.log('== 关闭 ==') + } }, }