szh_zidingyibiaoti
张同海 2 years ago
commit 181d732b58

@ -839,3 +839,19 @@ export function seaeEdiSave(parameter) {
data: parameter data: parameter
}) })
} }
export function seaeEdiDelete(parameter) {
return axios({
url: '/BookingOrderSeaeEdi/Delete',
method: 'post',
data: parameter
})
}
export function seaeEdiCustEDI(parameter) {
return axios({
url: '/BookingOrderSeaeEdi/CustEDI',
method: 'post',
data: parameter
})
}

@ -36,6 +36,9 @@
<button @click="openModel('trace')"> <button @click="openModel('trace')">
<span class="iconfont icon-yunshu1" style="font-size:18px;"></span>运踪订阅 <span class="iconfont icon-yunshu1" style="font-size:18px;"></span>运踪订阅
</button> </button>
<button @click="openPreOrderFun">
<span class="iconfont icon-yunshu1" style="font-size:18px;"></span>预配舱单
</button>
</div> </div>
<div class="btn-list more-view-2"> <div class="btn-list more-view-2">
<button @click="openModel('initCabin')"> <button @click="openModel('initCabin')">
@ -710,6 +713,7 @@
</template> </template>
</a-modal> </a-modal>
<!-- 运踪弹窗 end --> <!-- 运踪弹窗 end -->
<pre-order ref="preOrder" :details="details"/>
</div> </div>
</template> </template>
<script> <script>
@ -719,7 +723,6 @@ import {
VgmSend, VgmSend,
LetterYard, LetterYard,
SampleBill, SampleBill,
VgmLink,
SendLetterYard, SendLetterYard,
SaveBookingLetteryard, SaveBookingLetteryard,
SaveBookingSampleBill, SaveBookingSampleBill,
@ -727,19 +730,17 @@ import {
TxxpLink, TxxpLink,
ExcuteRulesOceanBooking, ExcuteRulesOceanBooking,
BookingOrderPrintOrder, BookingOrderPrintOrder,
BookingOrderDownloadPrint,
BookingOrderViewPrintPdf,
BookingOrderOcrUpFile, BookingOrderOcrUpFile,
BookingOrderOcrGetImg, BookingOrderOcrGetImg,
BookingOrderOcrGetText, BookingOrderOcrGetText,
BookingOrderPrintTemplateWithHistoryList, BookingOrderPrintTemplateWithHistoryList,
DownloadBookingOrClosingEDI, DownloadBookingOrClosingEDI,
DeleteLetterYard, DeleteLetterYard,
LetterYardPdf,
SendTrace, SendTrace,
GetYardlist GetYardlist
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
import { BookingTruckGetTruckListByBooking } from '@/api/modular/main/SendCar' import { BookingTruckGetTruckListByBooking } from '@/api/modular/main/SendCar'
import preOrder from './preOrder'
export default { export default {
props: { props: {
details: { details: {
@ -753,6 +754,9 @@ export default {
default: false default: false
} }
}, },
components: {
preOrder
},
data() { data() {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
@ -1634,6 +1638,16 @@ export default {
}, },
cancelRemove() { cancelRemove() {
console.log('== 取消删除 ==') console.log('== 取消删除 ==')
},
openPreOrderFun () {
if (!this.id) {
this.$message.error('请先保存主单')
return false
}
this.$refs.preOrder.init()
},
closeOpenPreOrder () {
this.$refs.preOrder.close()
} }
} }
} }

@ -5,7 +5,7 @@
</template> </template>
<div class="pre-order"> <div class="pre-order">
<a-row :gutter="24" class="show-content" style="margin-left: 0"> <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-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"> <div class="order-btn-list">
@ -35,8 +35,8 @@
<div class="order-box" :key="sindex"> <div class="order-box" :key="sindex">
<a-checkbox class="check-btn" @change="checkOrderChange($event, sindex)" /> <a-checkbox class="check-btn" @change="checkOrderChange($event, sindex)" />
<span class="order-label" :class="{'active': sindex == editIndex}" @click.stop="changeOrder(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" color="#00CC00"></a-tag> -->
<!-- <a-tag class="tag">已录入</a-tag> --> <a-tag class="tag" v-if="sedDetail.state">{{ sedDetail.state }}</a-tag>
<template v-if="!sedDetail.isHBL">{{ sedDetail.mblno || '' }}</template> <template v-if="!sedDetail.isHBL">{{ sedDetail.mblno || '' }}</template>
<template v-else>{{ sindex + 1 }}: {{ sedDetail.hblno || '' }}</template> <template v-else>{{ sindex + 1 }}: {{ sedDetail.hblno || '' }}</template>
</span> </span>
@ -45,7 +45,7 @@
</div> </div>
</div> </div>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="19">
<div class="pre-details"> <div class="pre-details">
<a-form-model <a-form-model
style="margin-bottom: 10px" style="margin-bottom: 10px"
@ -58,7 +58,7 @@
<div class="top"> <div class="top">
<a-row class="from-box" :gutter="10"> <a-row class="from-box" :gutter="10">
<template v-if="!orderDetails.isHBL"> <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 <a-form-model-item
class="pre-from-label" class="pre-from-label"
label="主提单号" label="主提单号"
@ -72,7 +72,7 @@
</a-col> </a-col>
</template> </template>
<template v-if="orderDetails.isHBL"> <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 <a-form-model-item
class="pre-from-label" class="pre-from-label"
label="分提单号" label="分提单号"
@ -85,7 +85,9 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</template> </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-col :xs="12" :sm="12" :md="12" :lg="8" :xl="5">
<a-form-model-item <a-form-model-item
class="pre-from-label" class="pre-from-label"
@ -103,8 +105,8 @@
searchApi="getVesselInfoService" searchApi="getVesselInfoService"
:searchQuery="{ :searchQuery="{
KeyWord: '', KeyWord: '',
CarrierID: this.details.carrierid || 'CMA', CarrierID: this.orderDetails.carrierid || 'CMA',
ETD: this.details.etd || '', ETD: this.orderDetails.etd || '',
}" }"
:showLabel="['vessel']" :showLabel="['vessel']"
:openSearch="true" :openSearch="true"
@ -153,6 +155,57 @@
></selectView> ></selectView>
</a-form-model-item> </a-form-model-item>
</a-col> </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> </template>
</a-row> </a-row>
</div> </div>
@ -529,7 +582,7 @@
id="pre-marks-scroll" id="pre-marks-scroll"
:parentVal="orderDetails.marks" :parentVal="orderDetails.marks"
type="marks" type="marks"
:height="254" :height="183"
:openToCDB="true" :openToCDB="true"
@getTextareaChange="getTextareaChange" @getTextareaChange="getTextareaChange"
/> />
@ -557,7 +610,7 @@
id="pre-description-scroll" id="pre-description-scroll"
:parentVal="orderDetails.description" :parentVal="orderDetails.description"
type="description" type="description"
:height="254" :height="183"
:openToCDB="true" :openToCDB="true"
@getTextareaChange="getTextareaChange" @getTextareaChange="getTextareaChange"
/> />
@ -587,7 +640,7 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="12"> <!-- <a-col :span="12">
<a-form-model-item <a-form-model-item
class="pre-from-label" class="pre-from-label"
label="总件数" label="总件数"
@ -600,7 +653,7 @@
<inputView type="pkgs" :parentVal="orderDetails.pkgs" inputType="number" @getInputChange="inputChange"/> <inputView type="pkgs" :parentVal="orderDetails.pkgs" inputType="number" @getInputChange="inputChange"/>
</div> </div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col> -->
<a-col :span="12"> <a-col :span="12">
<a-form-model-item <a-form-model-item
class="pre-from-label" class="pre-from-label"
@ -621,7 +674,7 @@
></selectView> ></selectView>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <!-- <a-col :span="12">
<a-form-model-item <a-form-model-item
class="pre-from-label" class="pre-from-label"
label="总重量" label="总重量"
@ -632,7 +685,6 @@
> >
<div class="line-box"> <div class="line-box">
<inputView type="kgs" :parentVal="orderDetails.kgs" @getInputChange="inputChange"/> <inputView type="kgs" :parentVal="orderDetails.kgs" @getInputChange="inputChange"/>
<!-- <a-input size="small" :allowClear="true" v-model="details.kgs" /> -->
<span class="unit">KGS</span> <span class="unit">KGS</span>
</div> </div>
</a-form-model-item> </a-form-model-item>
@ -648,11 +700,10 @@
> >
<div class="line-box"> <div class="line-box">
<inputView type="cbm" :parentVal="orderDetails.cbm" @getInputChange="inputChange"/> <inputView type="cbm" :parentVal="orderDetails.cbm" @getInputChange="inputChange"/>
<!-- <a-input size="small" :allowClear="true" v-model="details.kgs" /> -->
<span class="unit">CBM</span> <span class="unit">CBM</span>
</div> </div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col> -->
<!-- === 其他字段 === --> <!-- === 其他字段 === -->
<a-col :span="12"> <a-col :span="12">
<a-form-model-item <a-form-model-item
@ -780,7 +831,7 @@
has-feedback has-feedback
prop="remarks" prop="remarks"
> >
<inputView type="remarks" :parentVal="details.remarks" @getInputChange="inputChange" /> <inputView type="remarks" :parentVal="orderDetails.remarks" @getInputChange="inputChange" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12"> <a-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
@ -800,7 +851,7 @@
has-feedback has-feedback
prop="sendremark" prop="sendremark"
> >
<inputView type="sendremark" :parentVal="details.sendremark" @getInputChange="inputChange" /> <inputView type="sendremark" :parentVal="orderDetails.sendremark" @getInputChange="inputChange" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
@ -869,7 +920,7 @@ import selectView from '../components/selectView'
import datePickerView from '../components/datePickerView' import datePickerView from '../components/datePickerView'
import autoView from '../components/autoView' import autoView from '../components/autoView'
import textareaView from '../components/textareaView' 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' import { mapGetters } from 'vuex'
const initData = { const initData = {
@ -927,8 +978,7 @@ const initData = {
{ {
id: 0, id: 0,
pId: 0, pId: 0,
size: '', ctnall: '',
ctn: '',
cntrno: '', cntrno: '',
sealno: '', sealno: '',
pkgs: 0, pkgs: 0,
@ -996,9 +1046,9 @@ export default {
rules: { rules: {
mblno: { required: true, title: '主提单号', message: '请输入主提单号', trigger: 'change' }, mblno: { required: true, title: '主提单号', message: '请输入主提单号', trigger: 'change' },
hblno: { required: true, title: '分提单号', message: '请输入分提单号', trigger: 'change' }, hblno: { required: true, title: '分提单号', message: '请输入分提单号', trigger: 'change' },
vessel: { required: true, title: '船名', message: '请选择船名', trigger: 'change' }, vessel: { required: false, title: '船名', message: '请选择船名', trigger: 'change' },
voyno: { required: true, title: '航次', message: '请选择航次', trigger: 'change' }, voyno: { required: false, title: '航次', message: '请选择航次', trigger: 'change' },
forwarder: { required: true, title: '船代', message: '请选择船代', trigger: 'change' }, forwarder: { required: false, title: '船代', message: '请选择船代', trigger: 'change' },
shippername: { required: true, title: '发货人', message: '请选择发货人', trigger: 'change' }, shippername: { required: true, title: '发货人', message: '请选择发货人', trigger: 'change' },
shipperaddR1: { 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' }, description: { required: true, title: '货物描述', message: '请输入货物描述', trigger: 'change' },
ctnList: { ctnList: {
ctn: { required: true, title: '箱型', message: '请选择箱型', trigger: 'change' }, ctnall: { required: true, title: '箱型', message: '请选择箱型', trigger: 'change' },
cntrno: { required: true, title: '箱号', message: '请选择箱号', trigger: 'change' }, cntrno: { required: true, title: '箱号', message: '请选择箱号', trigger: 'change' },
sealno: { required: true, title: '封号', message: '请选择封号', trigger: 'change' }, sealno: { required: true, title: '封号', message: '请选择封号', trigger: 'change' },
pkgs: { required: true, title: '件数', message: '请选择件数', trigger: 'change' }, pkgs: { required: true, title: '件数', message: '请选择件数', trigger: 'change' },
@ -1062,8 +1112,8 @@ export default {
}, },
// //
{ {
field: 'ctn', field: 'ctnall',
key: 'ctn', key: 'ctnall',
title: '箱型', title: '箱型',
align: 'left', align: 'left',
width: 80, width: 80,
@ -1073,7 +1123,7 @@ export default {
return ( return (
<a-select <a-select
size="small" size="small"
value={row['ctn']} value={row['ctnall']}
showSearch showSearch
ref="ctnallView" ref="ctnallView"
class="ctnallView" class="ctnallView"
@ -1084,13 +1134,13 @@ export default {
// console.log('== change ==') // console.log('== change ==')
if (val !== undefined) { if (val !== undefined) {
const data = this.ctnallList[val] 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 // this.orderDetails.ediCtn[rowIndex].ctncode = data.code
row['ctn'] = data.name row['ctnall'] = data.name
this.$forceUpdate() this.$forceUpdate()
} else { } else {
row['ctn'] = '' row['ctnall'] = ''
this.orderDetails.ediCtn[rowIndex].ctn = '' this.orderDetails.ediCtn[rowIndex].ctnall = ''
// this.orderDetails.ediCtn[rowIndex].ctncode = '' // this.orderDetails.ediCtn[rowIndex].ctncode = ''
} }
}} }}
@ -1110,7 +1160,7 @@ export default {
renderHeaderCell: ({ column }, h) => { renderHeaderCell: ({ column }, h) => {
return ( return (
<span class="text-bold" style="text-align: center;"> <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> </span>
) )
} }
@ -1493,6 +1543,10 @@ export default {
methods: { methods: {
init() { init() {
this.openPreOrderShow = true this.openPreOrderShow = true
this.id = this.$route.query.id
this.selectArr = []
this.editIndex = 0
this.preOrderLoad = false
if (this.id) { if (this.id) {
this.getPageESeaeEdi() this.getPageESeaeEdi()
} else { } else {
@ -1502,13 +1556,17 @@ export default {
close() { close() {
this.openPreOrderShow = false this.openPreOrderShow = false
this.orderList = [] this.orderList = []
this.orderDetails = {} this.selectArr = []
this.editIndex = 0
}, },
getPageESeaeEdi() { getPageESeaeEdi() {
getPageESeaeEdi({ getPageESeaeEdi({
bookingId: this.id 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.map((item, index) => {
res.data[index].isHBL = !!item.hblno res.data[index].isHBL = !!item.hblno
@ -1579,7 +1637,7 @@ export default {
// id: 0, // id: 0,
// pId: 0, // pId: 0,
// size: '', // size: '',
// ctn: '', // ctnall: '',
// cntrno: '', // cntrno: '',
// sealno: '', // sealno: '',
// pkgs: 0, // pkgs: 0,
@ -1593,12 +1651,124 @@ export default {
this.orderDetails = $data this.orderDetails = $data
this.orderList.push($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() {}, cancelRemove() {},
checkOrderChange(e, index) { checkOrderChange(e, index) {
console.log(e.target.checked, 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 }) { inputChange({ type, value }) {
this.orderDetails[type] = value this.orderDetails[type] = value
this.$forceUpdate() this.$forceUpdate()
@ -1624,6 +1794,9 @@ export default {
} 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.code || ''
} else if (type === 'carrierid') {
this.orderDetails.carrier = res.enName || ''
this.orderDetails.carrierid = res.code || ''
} }
console.log('=== 预订舱信息 ===', this.orderDetails) console.log('=== 预订舱信息 ===', this.orderDetails)
}, },
@ -1631,6 +1804,9 @@ export default {
this.orderDetails[type] = value this.orderDetails[type] = value
this.$forceUpdate() this.$forceUpdate()
}, },
dateChangeFun({ type, value }) {
this.orderDetails[type] = value || ''
},
// //
changeSelectedRowKeys(keys) { changeSelectedRowKeys(keys) {
this.selectArr = keys this.selectArr = keys
@ -1645,8 +1821,7 @@ export default {
let $data = { let $data = {
id: 0, id: 0,
pId: 0, pId: 0,
size: '', ctnall: '',
ctn: '',
cntrno: '', cntrno: '',
sealno: '', sealno: '',
pkgs: 0, pkgs: 0,
@ -1658,6 +1833,9 @@ export default {
this.orderDetails.ediCtn.push($data) this.orderDetails.ediCtn.push($data)
}, },
removeCtn() { removeCtn() {
if (this.selectArr.length === 0) {
this.$message.error('请选择箱信息')
}
this.selectArr.map((item, index) => { this.selectArr.map((item, index) => {
this.orderDetails.ediCtn.map((oitem, oindex) => { this.orderDetails.ediCtn.map((oitem, oindex) => {
if (item === oitem.rowKey) { if (item === oitem.rowKey) {
@ -1672,6 +1850,9 @@ export default {
}) })
}, },
copyCtn() { copyCtn() {
if (this.selectArr.length === 0) {
this.$message.error('请选择箱信息')
}
let last = this.orderDetails.ediCtn[this.orderDetails.ediCtn.length - 1].rowKey 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) => { this.orderDetails.ediCtn.map((oitem, oindex) => {
@ -1792,30 +1973,30 @@ export default {
return str return str
}, },
saveOrder() { saveOrder() {
let check = true // let check = true
this.$refs.basicFrom.validate(valid => { // this.$refs.basicFrom.validate(valid => {
check = valid // check = valid
}) // })
if (!check) { // if (!check) {
this.$message.error('保存失败,请选择必填项') // this.$message.error('')
} // return false
if (this.orderDetails.ediCtn.length === 0) { // }
this.$message.error('保存失败,箱信息未填写') // if (this.orderDetails.ediCtn.length === 0) {
return false // this.$message.error('')
} // return false
let tableErrTip = '' // }
this.orderDetails.ediCtn.map((item, index) => { // let tableErrTip = ''
Object.keys(item).map((label, lindex) => { // this.orderDetails.ediCtn.map((item, index) => {
if (this.rules[label] && this.rules[label].required && !item[label]) { // Object.keys(item).map((label, lindex) => {
tableErrTip = `${tableErrTip} 序号${index + 1}${this.rules[label].title}未填写,` // 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) // if (tableErrTip !== '') {
return false // this.$message.error(` ${tableErrTip.substr(0, tableErrTip.length - 1)}`, 3)
} // return false
// }
const $data = JSON.parse(JSON.stringify(this.orderDetails)) const $data = JSON.parse(JSON.stringify(this.orderDetails))
$data.ediCtn.map((item, index) => { $data.ediCtn.map((item, index) => {
delete item.rowKey delete item.rowKey
@ -1823,6 +2004,11 @@ export default {
seaeEdiSave($data).then((res) => { seaeEdiSave($data).then((res) => {
if (res.success) { if (res.success) {
this.$message.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 { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

Loading…
Cancel
Save