|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
<div class="pre-order">
|
|
|
|
|
<a-row :gutter="24" class="show-content" style="margin-left: 0">
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<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="order-btn-list">
|
|
|
|
@ -35,8 +35,8 @@
|
|
|
|
|
<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" color="#00CC00">已发送</a-tag> -->
|
|
|
|
|
<!-- <a-tag class="tag">已录入</a-tag> -->
|
|
|
|
|
<!-- <a-tag class="tag" color="#00CC00"></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>
|
|
|
|
|
</span>
|
|
|
|
@ -45,7 +45,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-col :span="19">
|
|
|
|
|
<div class="pre-details">
|
|
|
|
|
<a-form-model
|
|
|
|
|
style="margin-bottom: 10px"
|
|
|
|
@ -58,7 +58,7 @@
|
|
|
|
|
<div class="top">
|
|
|
|
|
<a-row class="from-box" :gutter="10">
|
|
|
|
|
<template v-if="!orderDetails.isHBL">
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="主提单号"
|
|
|
|
@ -72,7 +72,7 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="orderDetails.isHBL">
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="分提单号"
|
|
|
|
@ -85,7 +85,9 @@
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row class="from-box" :gutter="10" style="padding-left: 17px;">
|
|
|
|
|
<template v-if="!orderDetails.isHBL">
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
@ -103,8 +105,8 @@
|
|
|
|
|
searchApi="getVesselInfoService"
|
|
|
|
|
:searchQuery="{
|
|
|
|
|
KeyWord: '',
|
|
|
|
|
CarrierID: this.details.carrierid || 'CMA',
|
|
|
|
|
ETD: this.details.etd || '',
|
|
|
|
|
CarrierID: this.orderDetails.carrierid || 'CMA',
|
|
|
|
|
ETD: this.orderDetails.etd || '',
|
|
|
|
|
}"
|
|
|
|
|
:showLabel="['vessel']"
|
|
|
|
|
:openSearch="true"
|
|
|
|
@ -153,6 +155,57 @@
|
|
|
|
|
></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="船公司"
|
|
|
|
|
prop="carrierid"
|
|
|
|
|
:labelCol="labelCol2"
|
|
|
|
|
:wrapperCol="wrapperCol2"
|
|
|
|
|
has-feedback
|
|
|
|
|
>
|
|
|
|
|
<selectView
|
|
|
|
|
type="carrierid"
|
|
|
|
|
:defaultVal="orderDetails.carrierid"
|
|
|
|
|
searchApi="GetCarrierlist"
|
|
|
|
|
:searchQuery="{ keyword: '', type: 'consignor' }"
|
|
|
|
|
:showLabel="['cnName', 'code']"
|
|
|
|
|
:openSearch="false"
|
|
|
|
|
@change="getSelectViewRes"
|
|
|
|
|
style="flex: 1; margin-top: -4px;"
|
|
|
|
|
></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="开船日期"
|
|
|
|
|
prop="etd"
|
|
|
|
|
:labelCol="labelCol2"
|
|
|
|
|
:wrapperCol="wrapperCol2"
|
|
|
|
|
has-feedback
|
|
|
|
|
>
|
|
|
|
|
<div class="date-box">
|
|
|
|
|
<datePickerView
|
|
|
|
|
class="date-picker"
|
|
|
|
|
:parentVal="orderDetails.etd"
|
|
|
|
|
type="etd"
|
|
|
|
|
format="YYYY-MM-DD"
|
|
|
|
|
@dateChange="dateChangeFun"
|
|
|
|
|
></datePickerView>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <selectView
|
|
|
|
|
type="carrierid"
|
|
|
|
|
:defaultVal="orderDetails.carrierid"
|
|
|
|
|
searchApi="GetCarrierlist"
|
|
|
|
|
:searchQuery="{ keyword: '', type: 'consignor' }"
|
|
|
|
|
:showLabel="['cnName', 'code']"
|
|
|
|
|
:openSearch="false"
|
|
|
|
|
@change="getSelectViewRes"
|
|
|
|
|
style="flex: 1; margin-top: -4px;"
|
|
|
|
|
></selectView> -->
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</template>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
@ -529,7 +582,7 @@
|
|
|
|
|
id="pre-marks-scroll"
|
|
|
|
|
:parentVal="orderDetails.marks"
|
|
|
|
|
type="marks"
|
|
|
|
|
:height="254"
|
|
|
|
|
:height="183"
|
|
|
|
|
:openToCDB="true"
|
|
|
|
|
@getTextareaChange="getTextareaChange"
|
|
|
|
|
/>
|
|
|
|
@ -557,7 +610,7 @@
|
|
|
|
|
id="pre-description-scroll"
|
|
|
|
|
:parentVal="orderDetails.description"
|
|
|
|
|
type="description"
|
|
|
|
|
:height="254"
|
|
|
|
|
:height="183"
|
|
|
|
|
:openToCDB="true"
|
|
|
|
|
@getTextareaChange="getTextareaChange"
|
|
|
|
|
/>
|
|
|
|
@ -587,7 +640,7 @@
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<!-- <a-col :span="12">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="总件数"
|
|
|
|
@ -600,7 +653,7 @@
|
|
|
|
|
<inputView type="pkgs" :parentVal="orderDetails.pkgs" inputType="number" @getInputChange="inputChange"/>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-col> -->
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
@ -621,7 +674,7 @@
|
|
|
|
|
></selectView>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<!-- <a-col :span="12">
|
|
|
|
|
<a-form-model-item
|
|
|
|
|
class="pre-from-label"
|
|
|
|
|
label="总重量"
|
|
|
|
@ -632,7 +685,6 @@
|
|
|
|
|
>
|
|
|
|
|
<div class="line-box">
|
|
|
|
|
<inputView type="kgs" :parentVal="orderDetails.kgs" @getInputChange="inputChange"/>
|
|
|
|
|
<!-- <a-input size="small" :allowClear="true" v-model="details.kgs" /> -->
|
|
|
|
|
<span class="unit">KGS</span>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
@ -648,11 +700,10 @@
|
|
|
|
|
>
|
|
|
|
|
<div class="line-box">
|
|
|
|
|
<inputView type="cbm" :parentVal="orderDetails.cbm" @getInputChange="inputChange"/>
|
|
|
|
|
<!-- <a-input size="small" :allowClear="true" v-model="details.kgs" /> -->
|
|
|
|
|
<span class="unit">CBM</span>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-col> -->
|
|
|
|
|
<!-- === 其他字段 === -->
|
|
|
|
|
<a-col :span="12">
|
|
|
|
|
<a-form-model-item
|
|
|
|
@ -780,7 +831,7 @@
|
|
|
|
|
has-feedback
|
|
|
|
|
prop="remarks"
|
|
|
|
|
>
|
|
|
|
|
<inputView type="remarks" :parentVal="details.remarks" @getInputChange="inputChange" />
|
|
|
|
|
<inputView type="remarks" :parentVal="orderDetails.remarks" @getInputChange="inputChange" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
|
|
|
|
@ -800,7 +851,7 @@
|
|
|
|
|
has-feedback
|
|
|
|
|
prop="sendremark"
|
|
|
|
|
>
|
|
|
|
|
<inputView type="sendremark" :parentVal="details.sendremark" @getInputChange="inputChange" />
|
|
|
|
|
<inputView type="sendremark" :parentVal="orderDetails.sendremark" @getInputChange="inputChange" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -869,7 +920,7 @@ import selectView from '../components/selectView'
|
|
|
|
|
import datePickerView from '../components/datePickerView'
|
|
|
|
|
import autoView from '../components/autoView'
|
|
|
|
|
import textareaView from '../components/textareaView'
|
|
|
|
|
import { getPageESeaeEdi, seaeEdiSave } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { getPageESeaeEdi, seaeEdiSave, seaeEdiDelete, seaeEdiCustEDI } from '@/api/modular/main/BookingLedger'
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
|
|
const initData = {
|
|
|
|
@ -927,8 +978,7 @@ const initData = {
|
|
|
|
|
{
|
|
|
|
|
id: 0,
|
|
|
|
|
pId: 0,
|
|
|
|
|
size: '',
|
|
|
|
|
ctn: '',
|
|
|
|
|
ctnall: '',
|
|
|
|
|
cntrno: '',
|
|
|
|
|
sealno: '',
|
|
|
|
|
pkgs: 0,
|
|
|
|
@ -996,9 +1046,9 @@ export default {
|
|
|
|
|
rules: {
|
|
|
|
|
mblno: { required: true, title: '主提单号', message: '请输入主提单号', trigger: 'change' },
|
|
|
|
|
hblno: { required: true, title: '分提单号', message: '请输入分提单号', trigger: 'change' },
|
|
|
|
|
vessel: { required: true, title: '船名', message: '请选择船名', trigger: 'change' },
|
|
|
|
|
voyno: { required: true, title: '航次', message: '请选择航次', trigger: 'change' },
|
|
|
|
|
forwarder: { required: true, title: '船代', message: '请选择船代', trigger: 'change' },
|
|
|
|
|
vessel: { required: false, title: '船名', message: '请选择船名', trigger: 'change' },
|
|
|
|
|
voyno: { required: false, title: '航次', message: '请选择航次', trigger: 'change' },
|
|
|
|
|
forwarder: { required: false, title: '船代', message: '请选择船代', trigger: 'change' },
|
|
|
|
|
|
|
|
|
|
shippername: { required: true, title: '发货人', message: '请选择发货人', trigger: 'change' },
|
|
|
|
|
shipperaddR1: { required: true, title: '地址', message: '请输入发货地址', trigger: 'change' },
|
|
|
|
@ -1026,7 +1076,7 @@ export default {
|
|
|
|
|
description: { required: true, title: '货物描述', message: '请输入货物描述', trigger: 'change' },
|
|
|
|
|
|
|
|
|
|
ctnList: {
|
|
|
|
|
ctn: { required: true, title: '箱型', message: '请选择箱型', trigger: 'change' },
|
|
|
|
|
ctnall: { required: true, title: '箱型', message: '请选择箱型', trigger: 'change' },
|
|
|
|
|
cntrno: { required: true, title: '箱号', message: '请选择箱号', trigger: 'change' },
|
|
|
|
|
sealno: { required: true, title: '封号', message: '请选择封号', trigger: 'change' },
|
|
|
|
|
pkgs: { required: true, title: '件数', message: '请选择件数', trigger: 'change' },
|
|
|
|
@ -1062,8 +1112,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 箱型
|
|
|
|
|
{
|
|
|
|
|
field: 'ctn',
|
|
|
|
|
key: 'ctn',
|
|
|
|
|
field: 'ctnall',
|
|
|
|
|
key: 'ctnall',
|
|
|
|
|
title: '箱型',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 80,
|
|
|
|
@ -1073,7 +1123,7 @@ export default {
|
|
|
|
|
return (
|
|
|
|
|
<a-select
|
|
|
|
|
size="small"
|
|
|
|
|
value={row['ctn']}
|
|
|
|
|
value={row['ctnall']}
|
|
|
|
|
showSearch
|
|
|
|
|
ref="ctnallView"
|
|
|
|
|
class="ctnallView"
|
|
|
|
@ -1084,13 +1134,13 @@ export default {
|
|
|
|
|
// console.log('== 箱型内部监听change ==')
|
|
|
|
|
if (val !== undefined) {
|
|
|
|
|
const data = this.ctnallList[val]
|
|
|
|
|
this.orderDetails.ediCtn[rowIndex].ctn = data.name
|
|
|
|
|
this.orderDetails.ediCtn[rowIndex].ctnall = data.name
|
|
|
|
|
// this.orderDetails.ediCtn[rowIndex].ctncode = data.code
|
|
|
|
|
row['ctn'] = data.name
|
|
|
|
|
row['ctnall'] = data.name
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
} else {
|
|
|
|
|
row['ctn'] = ''
|
|
|
|
|
this.orderDetails.ediCtn[rowIndex].ctn = ''
|
|
|
|
|
row['ctnall'] = ''
|
|
|
|
|
this.orderDetails.ediCtn[rowIndex].ctnall = ''
|
|
|
|
|
// this.orderDetails.ediCtn[rowIndex].ctncode = ''
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
@ -1110,7 +1160,7 @@ export default {
|
|
|
|
|
renderHeaderCell: ({ column }, h) => {
|
|
|
|
|
return (
|
|
|
|
|
<span class="text-bold" style="text-align: center;">
|
|
|
|
|
{this.rules.ctnList.ctn.required ? <i style="color: #f00">*</i> : ''} {column.title}
|
|
|
|
|
{this.rules.ctnList.ctnall.required ? <i style="color: #f00">*</i> : ''} {column.title}
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -1493,6 +1543,10 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
init() {
|
|
|
|
|
this.openPreOrderShow = true
|
|
|
|
|
this.id = this.$route.query.id
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
this.editIndex = 0
|
|
|
|
|
this.preOrderLoad = false
|
|
|
|
|
if (this.id) {
|
|
|
|
|
this.getPageESeaeEdi()
|
|
|
|
|
} else {
|
|
|
|
@ -1502,13 +1556,17 @@ export default {
|
|
|
|
|
close() {
|
|
|
|
|
this.openPreOrderShow = false
|
|
|
|
|
this.orderList = []
|
|
|
|
|
this.orderDetails = {}
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
this.editIndex = 0
|
|
|
|
|
},
|
|
|
|
|
getPageESeaeEdi() {
|
|
|
|
|
getPageESeaeEdi({
|
|
|
|
|
bookingId: this.id
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (!res.success) {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
res.data.map((item, index) => {
|
|
|
|
|
res.data[index].isHBL = !!item.hblno
|
|
|
|
@ -1579,7 +1637,7 @@ export default {
|
|
|
|
|
// id: 0,
|
|
|
|
|
// pId: 0,
|
|
|
|
|
// size: '',
|
|
|
|
|
// ctn: '',
|
|
|
|
|
// ctnall: '',
|
|
|
|
|
// cntrno: '',
|
|
|
|
|
// sealno: '',
|
|
|
|
|
// pkgs: 0,
|
|
|
|
@ -1593,12 +1651,124 @@ export default {
|
|
|
|
|
this.orderDetails = $data
|
|
|
|
|
this.orderList.push($data)
|
|
|
|
|
},
|
|
|
|
|
removeOrder() {},
|
|
|
|
|
removeOrder() {
|
|
|
|
|
console.log(this.selectArr)
|
|
|
|
|
if (this.selectArr.length === 0) {
|
|
|
|
|
this.$message.error('请选择删除单号')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (this.selectArr.includes(0)) {
|
|
|
|
|
this.$message.error('主单不允许删除')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const removeArr = []
|
|
|
|
|
const tempArr = []
|
|
|
|
|
this.selectArr.map((item, index) => {
|
|
|
|
|
if (this.orderList[item].id !== 0) {
|
|
|
|
|
removeArr.push(this.orderList[item].id)
|
|
|
|
|
} else {
|
|
|
|
|
tempArr.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log('删除:', removeArr)
|
|
|
|
|
if (removeArr.length === 0) {
|
|
|
|
|
this.removeFun(tempArr)
|
|
|
|
|
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)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
removeFun(selectArr = this.selectArr) {
|
|
|
|
|
const arr = this.orderList.filter((sitem, sindex) => {
|
|
|
|
|
return !selectArr.includes(sindex)
|
|
|
|
|
})
|
|
|
|
|
console.log(arr)
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
this.editIndex = this.selectArr.includes(this.editIndex) ? 0 : this.editIndex
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
this.orderList = arr
|
|
|
|
|
this.orderDetails = this.orderList[this.editIndex]
|
|
|
|
|
} else {
|
|
|
|
|
this.editIndex = 0
|
|
|
|
|
this.orderList = []
|
|
|
|
|
this.selectArr = []
|
|
|
|
|
this.$message.success('预配舱单列表已全部删除,请重新编辑主单')
|
|
|
|
|
this.getNoDataInit()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
cancelRemove() {},
|
|
|
|
|
checkOrderChange(e, index) {
|
|
|
|
|
console.log(e.target.checked, index)
|
|
|
|
|
if (e.target.checked && !this.selectArr.includes(index)) {
|
|
|
|
|
this.selectArr.push(index)
|
|
|
|
|
} else if (!e.target.checked && this.selectArr.includes(index)) {
|
|
|
|
|
this.selectArr.splice(this.selectArr.indexOf(index), 1)
|
|
|
|
|
}
|
|
|
|
|
console.log('== 已选 ==', this.selectArr)
|
|
|
|
|
},
|
|
|
|
|
sendOrder() {
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
console.log('== 即将发送单号 ==', sendArr)
|
|
|
|
|
const query = this.$qs.stringify({ Ids: sendArr.toString() }, { arrayFormat: 'repeat' })
|
|
|
|
|
seaeEdiCustEDI(query).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('发送成功')
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
sendOrder() {},
|
|
|
|
|
inputChange({ type, value }) {
|
|
|
|
|
this.orderDetails[type] = value
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
@ -1624,6 +1794,9 @@ export default {
|
|
|
|
|
} else if (type === 'yard') {
|
|
|
|
|
this.orderDetails[type] = res.name || ''
|
|
|
|
|
this.orderDetails[`${type}id`] = res.code || ''
|
|
|
|
|
} else if (type === 'carrierid') {
|
|
|
|
|
this.orderDetails.carrier = res.enName || ''
|
|
|
|
|
this.orderDetails.carrierid = res.code || ''
|
|
|
|
|
}
|
|
|
|
|
console.log('=== 预订舱信息 ===', this.orderDetails)
|
|
|
|
|
},
|
|
|
|
@ -1631,6 +1804,9 @@ export default {
|
|
|
|
|
this.orderDetails[type] = value
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
dateChangeFun({ type, value }) {
|
|
|
|
|
this.orderDetails[type] = value || ''
|
|
|
|
|
},
|
|
|
|
|
// 给可控属性重新赋值
|
|
|
|
|
changeSelectedRowKeys(keys) {
|
|
|
|
|
this.selectArr = keys
|
|
|
|
@ -1645,8 +1821,7 @@ export default {
|
|
|
|
|
let $data = {
|
|
|
|
|
id: 0,
|
|
|
|
|
pId: 0,
|
|
|
|
|
size: '',
|
|
|
|
|
ctn: '',
|
|
|
|
|
ctnall: '',
|
|
|
|
|
cntrno: '',
|
|
|
|
|
sealno: '',
|
|
|
|
|
pkgs: 0,
|
|
|
|
@ -1658,6 +1833,9 @@ export default {
|
|
|
|
|
this.orderDetails.ediCtn.push($data)
|
|
|
|
|
},
|
|
|
|
|
removeCtn() {
|
|
|
|
|
if (this.selectArr.length === 0) {
|
|
|
|
|
this.$message.error('请选择箱信息')
|
|
|
|
|
}
|
|
|
|
|
this.selectArr.map((item, index) => {
|
|
|
|
|
this.orderDetails.ediCtn.map((oitem, oindex) => {
|
|
|
|
|
if (item === oitem.rowKey) {
|
|
|
|
@ -1672,6 +1850,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
copyCtn() {
|
|
|
|
|
if (this.selectArr.length === 0) {
|
|
|
|
|
this.$message.error('请选择箱信息')
|
|
|
|
|
}
|
|
|
|
|
let last = this.orderDetails.ediCtn[this.orderDetails.ediCtn.length - 1].rowKey
|
|
|
|
|
this.selectArr.map((item, index) => {
|
|
|
|
|
this.orderDetails.ediCtn.map((oitem, oindex) => {
|
|
|
|
@ -1792,30 +1973,30 @@ export default {
|
|
|
|
|
return str
|
|
|
|
|
},
|
|
|
|
|
saveOrder() {
|
|
|
|
|
let check = true
|
|
|
|
|
this.$refs.basicFrom.validate(valid => {
|
|
|
|
|
check = valid
|
|
|
|
|
})
|
|
|
|
|
if (!check) {
|
|
|
|
|
this.$message.error('保存失败,请选择必填项')
|
|
|
|
|
}
|
|
|
|
|
if (this.orderDetails.ediCtn.length === 0) {
|
|
|
|
|
this.$message.error('保存失败,箱信息未填写')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
let tableErrTip = ''
|
|
|
|
|
this.orderDetails.ediCtn.map((item, index) => {
|
|
|
|
|
Object.keys(item).map((label, lindex) => {
|
|
|
|
|
if (this.rules[label] && this.rules[label].required && !item[label]) {
|
|
|
|
|
tableErrTip = `${tableErrTip} 序号${index + 1}中${this.rules[label].title}未填写,`
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
if (tableErrTip !== '') {
|
|
|
|
|
this.$message.error(`保存失败, 箱信息错误: ${tableErrTip.substr(0, tableErrTip.length - 1)}`, 3)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// let check = true
|
|
|
|
|
// this.$refs.basicFrom.validate(valid => {
|
|
|
|
|
// check = valid
|
|
|
|
|
// })
|
|
|
|
|
// if (!check) {
|
|
|
|
|
// this.$message.error('保存失败,请选择必填项')
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
// if (this.orderDetails.ediCtn.length === 0) {
|
|
|
|
|
// this.$message.error('保存失败,箱信息未填写')
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
// let tableErrTip = ''
|
|
|
|
|
// this.orderDetails.ediCtn.map((item, index) => {
|
|
|
|
|
// Object.keys(item).map((label, lindex) => {
|
|
|
|
|
// if (this.rules.ctnList[label] && this.rules.ctnList[label].required && !item[label]) {
|
|
|
|
|
// tableErrTip = `${tableErrTip} 序号${index + 1}中${this.rules.ctnList[label].title}未填写,`
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// if (tableErrTip !== '') {
|
|
|
|
|
// this.$message.error(`保存失败, 箱信息错误: ${tableErrTip.substr(0, tableErrTip.length - 1)}`, 3)
|
|
|
|
|
// return false
|
|
|
|
|
// }
|
|
|
|
|
const $data = JSON.parse(JSON.stringify(this.orderDetails))
|
|
|
|
|
$data.ediCtn.map((item, index) => {
|
|
|
|
|
delete item.rowKey
|
|
|
|
@ -1823,6 +2004,11 @@ export default {
|
|
|
|
|
seaeEdiSave($data).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
res.data[0].ediCtn.map((item, index) => {
|
|
|
|
|
item.rowKey = index
|
|
|
|
|
})
|
|
|
|
|
this.orderList[this.editIndex] = res.data[0]
|
|
|
|
|
this.orderDetails = res.data[0]
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|