szh_zidingyibiaoti
张同海 2 years ago
parent c1afe94d23
commit c2816f2e0a

@ -17,16 +17,27 @@
@blur="getSelectBlur"
>
<template slot="dataSource">
<a-select-option v-for="(item, index) in dataSourceList" :key="index" :value="index + '-' + item[showLabel[0]]" :label="type.includes('countryName') ? item[showLabel[1]] : item[showLabel[0]]">
<a-select-option
v-for="(item, index) in dataSourceList"
:key="index"
:value="index + '-' + item[showLabel[0]]"
:label="type.includes('countryName') ? item[showLabel[1]] : item[showLabel[0]]"
>
<div class="contractno-label" v-if="type === 'contractno'">
<div class="title"> {{ item.contractNo }} / {{ item.contractName || '--' }} </div>
<div class="note"><span>{{ item.contractNote || '--' }}</span></div>
<div class="title">{{ item.contractNo }} / {{ item.contractName || '--' }}</div>
<div class="note">
<span>{{ item.contractNote || '--' }}</span>
</div>
</div>
<template v-else-if="type === 'vessel'">
<div class="vessel-label">
<div class="title"> {{ item.vessel }} </div>
<div class="voyno">航次 <span>{{ item.voyno || '--' }}</span></div>
<div class="etd">ETD: <span>{{ item.etd || '--' }}</span></div>
<div class="title">{{ item.vessel }}</div>
<div class="voyno">
航次 <span>{{ item.voyno || '--' }}</span>
</div>
<div class="etd">
ETD: <span>{{ item.etd || '--' }}</span>
</div>
</div>
</template>
<div class="title" v-else>
@ -42,13 +53,13 @@
</template>
<script>
import {
getContractno,
getVesselInfoService,
GetForwarderlist,
BookingTemplate,
CodeCountryList,
GetPortloadlist,
GetPortlist
getContractno,
getVesselInfoService,
GetForwarderlist,
BookingTemplate,
CodeCountryList,
GetPortloadlist,
GetPortlist
} from '@/api/modular/main/BookingLedger'
import { AutoComplete } from 'ant-design-vue'
import { mapGetters } from 'vuex'
@ -98,12 +109,14 @@ export default {
inLoading: false
}
},
computed: {
computed: {
...mapGetters(['bookingInitData'])
},
watch: {
defaultVal(nval, oval) {
if (this.inEdit) { return false }
if (this.inEdit) {
return false
}
this.value = nval
console.log('== 修改内容auto ==', nval)
}
@ -120,16 +133,16 @@ export default {
},
getFromSelectData(func, ...args) {
return new Promise((resolve, reject) => {
func(...args).then((res) => {
func(...args).then(res => {
if (res.code === 200) {
resolve(res.data);
resolve(res.data)
} else {
reject(res)
}
})
});
})
},
emnuCompleteApi (type) {
emnuCompleteApi(type) {
switch (type) {
case 'getContractno':
return getContractno
@ -147,7 +160,7 @@ export default {
return GetPortlist
}
},
handleSelect (e) {
handleSelect(e) {
const num = Number(e.split('-')[0])
const data = this.dataSourceList[num]
this.value = this.type.includes('countryName') ? data[this.showLabel[1]] : data[this.showLabel[0]]
@ -160,7 +173,7 @@ export default {
this.handleChange(this.value)
}, 600)
},
handleChange (e) {
handleChange(e) {
this.inEdit = true
setTimeout(() => {
this.inEdit = false
@ -172,19 +185,19 @@ export default {
})
if (e) {
Object.keys(this.searchQuery).map((item, index) => {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem', 'Name'].includes(item)) {
this.searchQuery[item] = e
}
})
} else {
Object.keys(this.searchQuery).map((item, index) => {
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem'].includes(item)) {
this.searchQuery[item] = ''
if (['Title', 'KeyWord', 'SearchValue', 'name', 'keyword', 'queryItem', 'Name'].includes(item)) {
this.searchQuery[item] = ''
}
})
}
this.inLoading = true
this.getFromSelectData(this.emnuCompleteApi(this.searchApi), this.searchQuery).then((data) => {
this.getFromSelectData(this.emnuCompleteApi(this.searchApi), this.searchQuery).then(data => {
this.inLoading = false
if (data.rows) {
this.dataSourceList = data.rows
@ -194,44 +207,49 @@ export default {
console.log(this.dataSourceList)
})
},
handleChangeFirst (e) {
handleChangeFirst(e) {
if (this.value && this.dataSourceList.length !== 0) {
return false
}
if (!['vessel', 'lineName', 'notifypartycountryName', 'consigneecountryName', 'shippercountryName'].includes(this.type) && this.bookingInitData[`${this.type}InitList`].length > 0) {
if (
!['vessel', 'lineName', 'notifypartycountryName', 'consigneecountryName', 'shippercountryName'].includes(
this.type
) &&
this.bookingInitData[`${this.type}InitList`].length > 0
) {
this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
this.inLoading = false
return false
}
// if (this.bookingInitData[`${this.type}InitList`].length > 0) {
// this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
// return false
// }
// if (this.bookingInitData[`${this.type}InitList`].length > 0) {
// this.dataSourceList = this.bookingInitData[`${this.type}InitList`]
// return false
// }
this.handleChange(e)
},
getSelectBlur (e) {
if (this.type === 'contractno') {
this.$emit('select', {
type: this.type,
res: {
contractNo: this.value
}
})
}
}
getSelectBlur(e) {
if (this.type === 'contractno') {
this.$emit('select', {
type: this.type,
res: {
contractNo: this.value
}
})
}
}
}
}
</script>
<style lang="less">
.contractno-label{
.title{
.contractno-label {
.title {
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
font-weight: 600;
color: #666;
}
.note{
.note {
height: 22px;
line-height: 22px;
font-size: 12px;
@ -239,17 +257,18 @@ export default {
}
}
.vessel-label{
.title{
.vessel-label {
.title {
height: 28px;
line-height: 28px;
font-size: 14px;
font-weight:600;
font-weight: 600;
color: #666;
border-bottom:1px dashed #ddd;
border-bottom: 1px dashed #ddd;
margin-bottom: 4px;
}
.voyno, .etd {
.voyno,
.etd {
height: 22px;
line-height: 22px;
font-size: 12px;

@ -7,7 +7,9 @@
<a-row :gutter="24" class="show-content" style="margin-left: 0">
<a-col :span="5">
<div class="sed-order-list">
<div class="sed-order-title"><i class="iconfont icon-liebiao"></i><span class="tit">预配舱单列表</span></div>
<div class="sed-order-title">
<i class="iconfont icon-liebiao"></i><span class="tit">预配舱单列表</span>
</div>
<div class="order-btn-list">
<a-button class="order-btn" size="small" type="primary" @click="addOrder"></a-button>
<a-button class="order-btn" size="small" type="primary" @click="saveOrder"></a-button>
@ -34,8 +36,10 @@
<template v-for="(sedDetail, sindex) in orderList">
<div class="order-box" :key="sindex">
<a-checkbox class="check-btn" @change="checkOrderChange($event, sindex)" />
<span class="order-label" :class="{'active': sindex == editIndex}" @click.stop="changeOrder(sindex)">
<a-tag class="tag" v-if="sedDetail.state" :color="sedDetail.state==='已直发' ? '#00CC00' : ''">{{ sedDetail.state }}</a-tag>
<span class="order-label" :class="{ active: sindex == editIndex }" @click.stop="changeOrder(sindex)">
<a-tag class="tag" v-if="sedDetail.state" :color="sedDetail.state === '已直发' ? '#00CC00' : ''">{{
sedDetail.state
}}</a-tag>
<!-- <a-tag class="tag" v-if="sedDetail.state">{{ sedDetail.state }}</a-tag> -->
<template v-if="!sedDetail.isHBL">{{ sedDetail.mblno || '' }}</template>
<template v-else>{{ sindex + 1 }}: {{ sedDetail.hblno || '' }}</template>
@ -105,7 +109,7 @@
:searchQuery="{
KeyWord: '',
CarrierID: this.orderDetails.carrierid || 'CMA',
ETD: this.orderDetails.etd || '',
ETD: this.orderDetails.etd || ''
}"
:showLabel="['vessel']"
@select="getAutoViewRes"
@ -260,7 +264,11 @@
:wrapperCol="wrapperCol"
has-feedback
>
<inputView type="shipperaddR1" :parentVal="orderDetails.shipperaddR1" @getInputChange="inputChange" />
<inputView
type="shipperaddR1"
:parentVal="orderDetails.shipperaddR1"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -276,7 +284,7 @@
type="shippercountryName"
:defaultVal="orderDetails.shippercountryName"
searchApi="CodeCountryList"
:searchQuery="{ KeyWord: '' }"
:searchQuery="{ Name: '' }"
:showLabel="['code', 'cnName']"
@select="getAutoViewRes"
@selectInput="getAutoViewResInput"
@ -301,7 +309,11 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<inputView type="shippertel" :parentVal="orderDetails.shippertel" @getInputChange="inputChange" />
<inputView
type="shippertel"
:parentVal="orderDetails.shippertel"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
</a-row>
@ -310,7 +322,12 @@
</a-col>
<a-col :span="8">
<div class="mail-box">
<div class="title">通知人信息</div>
<div class="title">
<span>收货人信息</span>
<a-button class="order-btn" size="small" type="primary" @click="CopyConsignee">
复制通知人
</a-button>
</div>
<div class="mail-bottom">
<a-row>
<a-col :span="24">
@ -353,7 +370,11 @@
:wrapperCol="wrapperCol"
has-feedback
>
<inputView type="consigneeaddR1" :parentVal="orderDetails.consigneeaddR1" @getInputChange="inputChange" />
<inputView
type="consigneeaddR1"
:parentVal="orderDetails.consigneeaddR1"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -394,7 +415,11 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<inputView type="consigneetel" :parentVal="orderDetails.consigneetel" @getInputChange="inputChange" />
<inputView
type="consigneetel"
:parentVal="orderDetails.consigneetel"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
</a-row>
@ -403,7 +428,12 @@
</a-col>
<a-col :span="8">
<div class="mail-box">
<div class="title">通知人信息</div>
<div class="title">
<span>通知人信息</span>
<a-button class="order-btn" size="small" type="primary" @click="CopyNotifyparty">
复制收货人
</a-button>
</div>
<div class="mail-bottom">
<a-row>
<a-col :span="24">
@ -446,7 +476,11 @@
:wrapperCol="wrapperCol"
has-feedback
>
<inputView type="notifypartyaddR1" :parentVal="orderDetails.notifypartyaddR1" @getInputChange="inputChange" />
<inputView
type="notifypartyaddR1"
:parentVal="orderDetails.notifypartyaddR1"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
@ -487,7 +521,11 @@
:wrapperCol="wrapperCol2"
has-feedback
>
<inputView type="notifypartytel" :parentVal="orderDetails.notifypartytel" @getInputChange="inputChange" />
<inputView
type="notifypartytel"
:parentVal="orderDetails.notifypartytel"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
</a-row>
@ -657,12 +695,12 @@
:labelCol="{
xs: { span: 24 },
sm: { span: 24 },
md: { span: 24 },
md: { span: 24 }
}"
:wrapperCol="{
xs: { span: 24 },
sm: { span: 24 },
md: { span: 24 },
md: { span: 24 }
}"
has-feedback
>
@ -685,12 +723,12 @@
:labelCol="{
xs: { span: 24 },
sm: { span: 24 },
md: { span: 24 },
md: { span: 24 }
}"
:wrapperCol="{
xs: { span: 24 },
sm: { span: 24 },
md: { span: 24 },
md: { span: 24 }
}"
has-feedback
>
@ -804,7 +842,13 @@
prop="tempset"
>
<div class="line-box">
<inputView type="tempset" :ishd="orderDetails.cargoid !== 'R'" size="small" :parentVal="orderDetails.tempset" @getInputChange="inputChange"/>
<inputView
type="tempset"
:ishd="orderDetails.cargoid !== 'R'"
size="small"
:parentVal="orderDetails.tempset"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -817,7 +861,12 @@
has-feedback
prop="tempid"
>
<a-select size="small" :disabled="orderDetails.cargoid !== 'R'" :default-value="orderDetails.tempid || 'C'" v-model="orderDetails.tempid">
<a-select
size="small"
:disabled="orderDetails.cargoid !== 'R'"
:default-value="orderDetails.tempid || 'C摄氏'"
v-model="orderDetails.tempid"
>
<a-select-option value="C"> C摄氏 </a-select-option>
<a-select-option value="F"> F华氏 </a-select-option>
</a-select>
@ -833,7 +882,13 @@
prop="reeferf"
>
<div class="line-box">
<inputView type="reeferf" size="small" :ishd="orderDetails.cargoid !== 'R'" :parentVal="orderDetails.reeferf" @getInputChange="inputChange"/>
<inputView
type="reeferf"
size="small"
:ishd="orderDetails.cargoid !== 'R'"
:parentVal="orderDetails.reeferf"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -847,7 +902,13 @@
prop="dclass"
>
<div class="line-box">
<inputView type="dclass" :ishd="orderDetails.cargoid !== 'D'" size="small" :parentVal="orderDetails.dclass" @getInputChange="inputChange"/>
<inputView
type="dclass"
:ishd="orderDetails.cargoid !== 'D'"
size="small"
:parentVal="orderDetails.dclass"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -861,7 +922,13 @@
prop="dunno"
>
<div class="line-box">
<inputView type="dunno" size="small" :ishd="orderDetails.cargoid !== 'D'" :parentVal="orderDetails.dunno" @getInputChange="inputChange"/>
<inputView
type="dunno"
size="small"
:ishd="orderDetails.cargoid !== 'D'"
:parentVal="orderDetails.dunno"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -875,7 +942,13 @@
prop="dattn"
>
<div class="line-box">
<inputView type="dattn" size="small" :ishd="orderDetails.cargoid !== 'D'" :parentVal="orderDetails.dattn" @getInputChange="inputChange"/>
<inputView
type="dattn"
size="small"
:ishd="orderDetails.cargoid !== 'D'"
:parentVal="orderDetails.dattn"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -889,7 +962,13 @@
prop="dtel"
>
<div class="line-box">
<inputView type="dtel" :ishd="orderDetails.cargoid !== 'D'" size="small" :parentVal="orderDetails.dtel" @getInputChange="inputChange"/>
<inputView
type="dtel"
:ishd="orderDetails.cargoid !== 'D'"
size="small"
:parentVal="orderDetails.dtel"
@getInputChange="inputChange"
/>
</div>
</a-form-model-item>
</a-col>
@ -910,17 +989,21 @@
:labelCol="{
xs: { span: 24 },
sm: { span: 8 },
md: { span: 1 },
md: { span: 1 }
}"
:wrapperCol="{
xs: { span: 24 },
sm: { span: 15 },
md: { span: 23 },
md: { span: 23 }
}"
has-feedback
prop="remarks"
>
<inputView type="remarks" :parentVal="orderDetails.remarks" @getInputChange="inputChange" />
<inputView
type="remarks"
:parentVal="orderDetails.remarks"
@getInputChange="inputChange"
/>
</a-form-model-item>
</a-col>
</a-row>
@ -931,9 +1014,15 @@
<div class="mail-box">
<div class="title">集装箱信息</div>
<div class="ctn-btn">
<div class="btn" @click="addCtn"><i class="iconfont icon-icon_tianjia"></i><span>新建</span></div>
<div class="btn" @click="copyCtn"><i class="iconfont icon-fuzhi2"></i><span>复制新建</span></div>
<div class="btn" @click="removeCtn"><i class="iconfont icon-shanchu1"></i><span>删除</span></div>
<div class="btn" @click="addCtn">
<i class="iconfont icon-icon_tianjia"></i><span>新建</span>
</div>
<div class="btn" @click="copyCtn">
<i class="iconfont icon-fuzhi2"></i><span>复制新建</span>
</div>
<div class="btn" @click="removeCtn">
<i class="iconfont icon-shanchu1"></i><span>删除</span>
</div>
<div class="import">
<a-form-model-item
class="pre-from-label"
@ -1093,9 +1182,9 @@ const initData = {
pkgs: 0,
kindpkgs: '',
kgs: 0,
cbm: 0,
},
],
cbm: 0
}
]
}
export default {
name: '',
@ -1108,13 +1197,13 @@ export default {
textareaView
},
props: {
details: {
type: Object,
details: {
type: Object,
default: () => {
return {}
}
}
},
}
},
computed: {
...mapGetters(['packageList', 'ctnallList'])
},
@ -1351,12 +1440,18 @@ export default {
this.orderDetails.ediCtn.map((item, index) => {
item.kindpkgs = this.packageList[val].name || ''
if (
document.getElementsByClassName('pre-kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0]
document
.getElementsByClassName('pre-kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0]
) {
document.getElementsByClassName('pre-kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = this.packageList[val].name || ''
} else {
document.getElementsByClassName('pre-kindpkgsView')[index].getElementsByTagName('input')[0].val =
document
.getElementsByClassName('pre-kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML =
this.packageList[val].name || ''
} else {
document
.getElementsByClassName('pre-kindpkgsView')
[index].getElementsByTagName('input')[0].val = this.packageList[val].name || ''
}
})
}, 300)
@ -1367,7 +1462,9 @@ export default {
this.orderDetails.ediCtn.map((item, index) => {
if (index !== rowIndex) {
item.kindpkgs = ''
document.getElementsByClassName('pre-kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = ''
document
.getElementsByClassName('pre-kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = ''
}
})
}
@ -1655,13 +1752,25 @@ export default {
immediate: true,
handler(nD, oD) {
this.id = this.$route.query.id
},
},
}
}
},
created() {
// this.init()
},
methods: {
CopyConsignee() {
this.orderDetails.consigneename = this.orderDetails.notifypartyname
this.orderDetails.consigneeaddR1 = this.orderDetails.notifypartyaddR1
this.orderDetails.consigneecountryName = this.orderDetails.notifypartycountryName
this.orderDetails.consigneetel = this.orderDetails.notifypartytel
},
CopyNotifyparty() {
this.orderDetails.notifypartyname = this.orderDetails.consigneename
this.orderDetails.notifypartyaddR1 = this.orderDetails.consigneeaddR1
this.orderDetails.notifypartycountryName = this.orderDetails.consigneecountryName
this.orderDetails.notifypartytel = this.orderDetails.consigneetel
},
init() {
this.openPreOrderShow = true
this.id = this.$route.query.id
@ -1675,15 +1784,14 @@ export default {
}
},
close() {
this.openPreOrderShow = false
let obj = {
data1: this.orderList,
data2: this.orderDetails.ediCtn
}
data1: this.orderList,
data2: this.orderDetails.ediCtn
}
this.$emit('frompre', obj)
this.orderList = []
this.selectArr = []
this.editIndex = 0
@ -1692,11 +1800,11 @@ export default {
getPageESeaeEdi({
bookingId: this.id
})
.then((res) => {
.then(res => {
if (!res.success) {
this.$message.error(res.message)
}
if (res.data.length > 0) {
if (res.data.length > 0) {
res.data.map((item, index) => {
res.data[index].isHBL = !!item.hblno
res.data[index].ediCtn.map((item, index) => {
@ -1704,19 +1812,19 @@ export default {
})
})
this.orderList = res.data
this.orderDetails = this.orderList[this.editIndex]
this.orderDetails = this.orderList[this.editIndex]
console.log('orderList==>>', this.orderList)
} else {
this.getNoDataInit()
}
} else {
this.getNoDataInit()
}
this.preOrderLoad = true
})
.catch((err) => {
.catch(err => {
console.log(err)
})
},
getNoDataInit(isHBL = false) {
const $details = JSON.parse(JSON.stringify(this.details))
let $details = JSON.parse(JSON.stringify(this.details))
const $data = {
bookingId: $details.id,
id: 0,
@ -1781,7 +1889,13 @@ export default {
// cbm: 0,
// rowKey: 0
// },
],
]
}
if (isHBL) {
$data.portload = 'CNTAO'
$data.portloadid = 'CNTAO'
$data.placedelivery = 'CNTAO'
$data.placedeliveryid = 'CNTAO'
}
this.orderDetails = $data
this.orderList.push($data)
@ -1824,16 +1938,18 @@ export default {
return false
}
const query = this.$qs.stringify({ Ids: removeArr.toString() }, { arrayFormat: 'repeat' })
seaeEdiDelete(query).then((res) => {
if (res.success) {
this.removeFun()
} else {
this.$message.error(res.message)
this.removeFun(tempArr)
}
}).catch((err) => {
console.log(err)
})
seaeEdiDelete(query)
.then(res => {
if (res.success) {
this.removeFun()
} else {
this.$message.error(res.message)
this.removeFun(tempArr)
}
})
.catch(err => {
console.log(err)
})
},
removeFun(selectArr = this.selectArr) {
const arr = this.orderList.filter((sitem, sindex) => {
@ -1908,18 +2024,20 @@ export default {
this.sendArr = sendArr
console.log('== 即将发送单号 ==', sendArr)
const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' })
seaeEdiCustEDI(query).then((res) => {
if (res.success) {
this.$message.success('发送成功')
this.selectArr.map((item, index) => {
this.orderList[item].state = '已发送'
})
} else {
this.$message.error(res.message)
}
}).catch((err) => {
console.log(err)
})
seaeEdiCustEDI(query)
.then(res => {
if (res.success) {
this.$message.success('发送成功')
this.selectArr.map((item, index) => {
this.orderList[item].state = '已发送'
})
} else {
this.$message.error(res.message)
}
})
.catch(err => {
console.log(err)
})
},
inputChange({ type, value }) {
this.orderDetails[type] = value
@ -1954,7 +2072,7 @@ export default {
}
console.log('=== 预订舱信息 ===', this.orderDetails)
},
getAutoViewRes ({ type, res }) {
getAutoViewRes({ type, res }) {
if (type === 'vessel') {
this.orderDetails.vessel = res.vessel || ''
} else if (['shippername', 'notifypartyname', 'consigneename'].includes(type)) {
@ -1969,7 +2087,7 @@ export default {
}
console.log('== 模糊搜索后的预定舱 ==', this.orderDetails)
},
getAutoViewResInput ({ type, res }) {
getAutoViewResInput({ type, res }) {
this.orderDetails[type] = res || ''
console.log('== 模糊搜索后的预定舱 ==', this.orderDetails)
},
@ -2001,7 +2119,10 @@ export default {
kindpkgs: '',
kgs: 0,
cbm: 0,
rowKey: this.orderDetails.ediCtn.length > 0 ? Number(this.orderDetails.ediCtn[this.orderDetails.ediCtn.length - 1].rowKey) + 1 : 0
rowKey:
this.orderDetails.ediCtn.length > 0
? Number(this.orderDetails.ediCtn[this.orderDetails.ediCtn.length - 1].rowKey) + 1
: 0
}
this.orderDetails.ediCtn.push($data)
},
@ -2027,7 +2148,7 @@ export default {
this.$message.error('请选择箱信息')
}
let last = this.orderDetails.ediCtn[this.orderDetails.ediCtn.length - 1].rowKey
this.selectArr.map((item, index) => {
this.selectArr.map((item, index) => {
this.orderDetails.ediCtn.map((oitem, oindex) => {
if (item === oitem.rowKey) {
last++
@ -2171,6 +2292,7 @@ export default {
// return false
// }
const $data = JSON.parse(JSON.stringify(this.orderDetails))
console.log($data)
if ($data.isHBL && !$data.hblno) {
this.$message.error('请填写分提单号')
return false
@ -2181,23 +2303,24 @@ export default {
$data.ediCtn.map((item, index) => {
delete item.rowKey
})
seaeEdiSave($data).then((res) => {
if (res.success) {
this.$message.success('保存成功')
res.data[0].ediCtn.map((item, index) => {
item.rowKey = index
})
res.data[0].isHBL = !!res.data[0].hblno
this.orderList[this.editIndex] = res.data[0]
this.orderDetails = res.data[0]
} else {
this.$message.error(res.message)
this.selectArr = []
}
})
.catch((err) => {
console.log(err)
})
seaeEdiSave($data)
.then(res => {
if (res.success) {
this.$message.success('保存成功')
res.data[0].ediCtn.map((item, index) => {
item.rowKey = index
})
res.data[0].isHBL = !!res.data[0].hblno
this.orderList[this.editIndex] = res.data[0]
this.orderDetails = res.data[0]
} else {
this.$message.error(res.message)
this.selectArr = []
}
})
.catch(err => {
console.log(err)
})
},
changeOrder(index) {
this.editIndex = index
@ -2207,7 +2330,7 @@ export default {
this.getNoDataInit(true)
this.editIndex = this.orderList.length - 1
},
sendOrderFun () {
sendOrderFun() {
console.log(this.selectArr)
if (this.selectArr.length === 0) {
this.$message.error('请选择发送单号')
@ -2219,7 +2342,7 @@ export default {
this.selectArr.map((item, index) => {
if (this.orderList[item].id !== 0) {
// if (this.orderList[item].state === '') {
sendArr.push(this.orderList[item].id)
sendArr.push(this.orderList[item].id)
// } else {
// if (this.orderList[item].isHBL) {
// tempstr1 += `${this.orderList[item].hblno ? this.orderList[item].hblno : item}`
@ -2251,7 +2374,7 @@ export default {
this.sendArr = sendArr
this.showSendModel = true
},
sendSubmit () {
sendSubmit() {
console.log('== 发送 ==', this.sendArr, this.sendType, this.sendRemarkVal)
console.log('== 即将发送单号 ==', this.sendArr)
if (!this.sendType) {
@ -2263,48 +2386,53 @@ export default {
return false
}
this.sendLoading = true
const query = this.$qs.stringify({
Ids: this.sendArr.toString(),
type: this.sendType,
SENDREMARK: this.sendRemarkVal
}, { arrayFormat: 'repeat' })
seaeEdiCustEDI(query).then((res) => {
this.sendLoading = false
if (res.success) {
let tip = ''
if (this.sendType == '0') {
tip = '新增发送成功'
} else if (this.sendType == '1') {
tip = '修改发送成功'
} else if (this.sendType == '2') {
tip = '删除发送成功'
}
this.$message.success(tip)
this.selectArr.map((item, index) => {
const query = this.$qs.stringify(
{
Ids: this.sendArr.toString(),
type: this.sendType,
SENDREMARK: this.sendRemarkVal
},
{ arrayFormat: 'repeat' }
)
seaeEdiCustEDI(query)
.then(res => {
this.sendLoading = false
if (res.success) {
let tip = ''
if (this.sendType == '0') {
this.orderList[item].state = '已直发'
tip = '新增发送成功'
} else if (this.sendType == '1') {
this.orderList[item].state = '已直发'
tip = '修改发送成功'
} else if (this.sendType == '2') {
this.orderList[item].state = '已删除'
tip = '删除发送成功'
}
})
this.sendClose()
} else {
this.$message.error(res.message)
}
}).catch((err) => {
this.sendLoading = false
console.log(err)
})
this.$message.success(tip)
this.selectArr.map((item, index) => {
if (this.sendType == '0') {
this.orderList[item].state = '已直发'
} else if (this.sendType == '1') {
this.orderList[item].state = '已直发'
} else if (this.sendType == '2') {
this.orderList[item].state = '已删除'
}
})
this.sendClose()
} else {
this.$message.error(res.message)
}
})
.catch(err => {
this.sendLoading = false
console.log(err)
})
},
sendClose () {
sendClose() {
this.showSendModel = false
this.sendType = ''
this.sendRemarkVal = ''
console.log('== 关闭 ==')
}
},
}
}
</script>
<style lang="less" scoped>
@ -2334,7 +2462,7 @@ export default {
border-radius: 4px;
}
}
.top{
.top {
margin-top: 10px;
margin-bottom: 10px;
}
@ -2449,7 +2577,7 @@ export default {
margin: 6px 0;
overflow: hidden;
width: 360px;
.check-btn{
.check-btn {
display: inline-block;
vertical-align: top;
margin-right: 10px;
@ -2466,7 +2594,7 @@ export default {
cursor: pointer;
display: flex;
padding-left: 10px;
height:28px;
height: 28px;
line-height: 28px;
display: inline-block;
vertical-align: top;
@ -2540,7 +2668,7 @@ export default {
}
.sed-order-label {
}
.mail-box{
.mail-box {
border: 1px solid #eee;
border-radius: 4px;
background: #fff;
@ -2548,47 +2676,52 @@ export default {
padding: 0 15px 10px;
margin: 0 4px;
margin-top: 10px;
.title{
.title {
border-bottom: 1px solid #eee;
height: 36px;
line-height: 36px;
font-size: 14px;
font-weight: 600;
margin-bottom: 8px;
display: flex;
align-items: center;
span {
flex: 1;
}
}
}
.cargo-info-bottm{
.cargo-info-bottm {
display: flex;
.marks{
.marks {
flex: 1;
padding-right: 10px;
/deep/ .ant-form-item-label{
/deep/ .ant-form-item-label {
text-align: left;
height: 30px;
line-height: 30px;
}
}
.description{
.description {
flex: 1;
padding-right: 10px;
/deep/ .ant-form-item-label{
/deep/ .ant-form-item-label {
text-align: left;
height: 30px;
line-height: 30px;
}
}
.right{
width:450px;
.right {
width: 450px;
padding-left: 13px;
margin-top: 15px;
}
}
.pre-from-label{
.pre-from-label {
margin-bottom: 0;
}
.ctn-btn{
.ctn-btn {
vertical-align: top;
.btn{
.btn {
display: inline-block;
height: 40px;
line-height: 40px;
@ -2597,26 +2730,25 @@ export default {
min-width: 60px;
text-align: center;
cursor: pointer;
i{
i {
margin-right: 4px;
height: 40px;
line-height: 40px;
}
&:nth-of-type(1) {
color: #FF9933;
color: #ff9933;
}
&:nth-of-type(2) {
color: #00CCCC;
&:nth-of-type(2) {
color: #00cccc;
}
&:nth-of-type(3) {
&:nth-of-type(3) {
color: #f6826b;
}
&:nth-of-type(4) {
&:nth-of-type(4) {
color: #009966;
}
}
.import{
.import {
display: inline-block;
width: 254px;
vertical-align: top;

Loading…
Cancel
Save