预配舱单

szh_zidingyibiaoti
lilu 2 years ago
parent a2032197cc
commit e8028542a5

@ -235,6 +235,7 @@ export default {
return ( return (
<a-tab-pane <a-tab-pane
style={{ height: 0 }} style={{ height: 0 }}
disabled={!!this.inBookingDetailsSave}
tab={this.renderTabPane(page.meta.customTitle || page.meta.title, page.fullPath)} tab={this.renderTabPane(page.meta.customTitle || page.meta.title, page.fullPath)}
key={page.fullPath} key={page.fullPath}
closable={pages.length > 1 && page.meta.title != '首页'} closable={pages.length > 1 && page.meta.title != '首页'}
@ -248,6 +249,7 @@ export default {
<a-tabs <a-tabs
hideAdd hideAdd
type={'editable-card'} type={'editable-card'}
disabled={!!this.inBookingDetailsSave}
v-model={this.activeKey} v-model={this.activeKey}
tabBarStyle={{ background: '#FFF', margin: 0, paddingLeft: '16px', paddingTop: '1px' }} tabBarStyle={{ background: '#FFF', margin: 0, paddingLeft: '16px', paddingTop: '1px' }}
{...{ on: { edit: onEdit } }} {...{ on: { edit: onEdit } }}

@ -445,10 +445,6 @@ export default {
) )
}, },
beforeRouteUpdate(to, from, next) { beforeRouteUpdate(to, from, next) {
// if (this.inBookingDetailsSave) {
// this.$message.error('')
// return false
// }
if (this.inAddSave) { if (this.inAddSave) {
next() next()
return false return false
@ -511,10 +507,6 @@ export default {
}, 800) }, 800)
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
// if (this.inBookingDetailsSave) {
// this.$message.error('')
// return false
// }
this.inChildLoading = true this.inChildLoading = true
if (this.isCopy) { if (this.isCopy) {
const hisData = { const hisData = {
@ -1205,7 +1197,7 @@ export default {
delete item.id delete item.id
}) })
} }
this.$message.loading({ content: '保存中...' }) this.$message.loading({ content: '保存中, 请勿切换页面...' })
console.log('== vuex 开始保存==', this.inBookingDetailsSave) console.log('== vuex 开始保存==', this.inBookingDetailsSave)
BookingOrderSave(_data) BookingOrderSave(_data)
.then(res => { .then(res => {

@ -24,7 +24,7 @@
title="是否发送当前选中预配舱单?" title="是否发送当前选中预配舱单?"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@confirm="sendOrder()" @confirm="sendOrderFun()"
@cancel="cancelRemove" @cancel="cancelRemove"
> >
<a-button class="order-btn" size="small">发送</a-button> <a-button class="order-btn" size="small">发送</a-button>
@ -970,7 +970,7 @@
</a-col> </a-col>
</a-row> </a-row>
<!-- <a-modal width="50vw" :maskClosable="false" v-model="false" title="发送预配舱单"> <a-modal width="50vw" :maskClosable="false" v-model="showSendModel" title="发送预配舱单" @cancel="sendClose">
<div class="trace-box"> <div class="trace-box">
<a-form> <a-form>
<a-row :gutter="16"> <a-row :gutter="16">
@ -981,15 +981,30 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback has-feedback
> >
<a-radio-group :options="sendOption" v-model="sendType" />
</a-form-item>
<a-form-item
label="备注"
:labelCol="{ xs: { span: 24 }, sm: { span: 6 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
<a-textarea
v-model="sendRemarkVal"
placeholder="请输入备注"
:auto-size="{ minRows: 3, maxRows: 5 }"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<template slot="footer"> <template slot="footer">
<a-button type="primary" @click="traceSend"></a-button> <a-button type="primary" @click="sendSubmit"></a-button>
<a-button type="primary" @click="sendClose"></a-button>
</template> </template>
</a-modal> --> </a-modal>
</div> </div>
</a-modal> </a-modal>
</template> </template>
@ -1610,7 +1625,18 @@ export default {
this.log({ data, selectionRangeIndexes, selectionRangeKeys }) 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: { watch: {
@ -1855,11 +1881,11 @@ export default {
this.$message.error(`${tempstr1}已发送,无需重复发送`) this.$message.error(`${tempstr1}已发送,无需重复发送`)
return false return false
} }
debugger
if (sendArr.length === 0) { if (sendArr.length === 0) {
this.$message.error('暂无可发送舱单') this.$message.error('暂无可发送舱单')
return false return false
} }
this.sendArr = sendArr
console.log('== 即将发送单号 ==', sendArr) console.log('== 即将发送单号 ==', sendArr)
const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' }) const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' })
seaeEdiCustEDI(query).then((res) => { seaeEdiCustEDI(query).then((res) => {
@ -1900,7 +1926,7 @@ export default {
this.orderDetails[type] = res['name'] || '' this.orderDetails[type] = res['name'] || ''
} else if (type === 'yard') { } else if (type === 'yard') {
this.orderDetails[type] = res.name || '' this.orderDetails[type] = res.name || ''
this.orderDetails[`${type}id`] = res.code || '' this.orderDetails[`${type}id`] = res.showCode || ''
} else if (type === 'carrier') { } else if (type === 'carrier') {
this.orderDetails.carrier = res.ediCode || '' this.orderDetails.carrier = res.ediCode || ''
this.orderDetails.carrierid = res.code || '' this.orderDetails.carrierid = res.code || ''
@ -2142,6 +2168,7 @@ export default {
this.orderDetails = res.data[0] this.orderDetails = res.data[0]
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
this.selectArr = []
} }
}) })
.catch((err) => { .catch((err) => {
@ -2156,7 +2183,90 @@ export default {
this.getNoDataInit(true) this.getNoDataInit(true)
this.editIndex = this.orderList.length - 1 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('== 关闭 ==')
}
}, },
} }
</script> </script>

Loading…
Cancel
Save