dev
lilu 2 years ago
parent 78d4ce46ed
commit 137c46c36e

@ -5,43 +5,52 @@
<div class="sed-order-list"> <div class="sed-order-list">
<div class="sed-order-title"><i class="iconfont icon-liebiao"></i> 分提单列表</div> <div class="sed-order-title"><i class="iconfont icon-liebiao"></i> 分提单列表</div>
<div class="sec-order"> <div class="sec-order">
<div class="sed-order-label active"><i class="iconfont icon-dingdan"></i> 分单1: QE1234567</div> <div class="sed-order-label" v-for="(sedDetail, sindex) in sedOrderList" :key="sindex" :class="{'active': editIndex === sindex}" @click="changeOrder(sindex)">
<div class="sed-order-label"><i class="iconfont icon-dingdan"></i> 分单1: QE1234567</div> <i class="iconfont icon-dingdan"></i>
<div class="sed-order-btn"><i class="iconfont icon-jiahao2fill"></i>添加分单</div> 分单{{ sindex+1 }}: {{ sedDetail.hblno || '请填写分单号' }}
<span class="no-save" v-if="sedDetail.isNoSave && editIndex !== sindex"> </span>
</div>
<div class="sed-order-btn" @click="addSedOrder"><i class="iconfont icon-jiahao2fill"></i>添加分单</div>
</div> </div>
</div> </div>
</a-col> </a-col>
<a-col :span="19"> <a-col :span="19">
<template v-if="!inPageLoading"> <template v-if="editDetails">
<div class="order-title"><i class="iconfont icon-liebiao1"></i> 当前分单号 1234567</div> <div class="order-title"><i class="iconfont icon-liebiao1"></i> 当前分单号 {{ editDetails.hblno }}</div>
<sedOperationArea :details="secOrderetails" @refresh="refreshPage" @save="saveFun"></sedOperationArea> <sedOperationArea :details="editDetails" @save="saveFun" @copy="copyFun"></sedOperationArea>
<a-tabs type="card"> <a-tabs type="card">
<a-tab-pane key="1" tab="基础信息"> <a-tab-pane key="1" tab="基础信息">
<div class="pane-box"> <div class="pane-box">
<!-- 基本信息 --> <!-- 基本信息 -->
<basicInfo :type="type" :details="secOrderetails" @changeDetail="changeDetailFun"></basicInfo> <basicInfo :type="type" :details="editDetails" :ishd="true" @changeDetail="changeDetailFun"></basicInfo>
<!-- 收发通信息 --> <!-- 收发通信息 -->
<mailingInfo :details="secOrderetails" @changeDetail="changeDetailFun"></mailingInfo> <mailingInfo :details="editDetails" @changeDetail="changeDetailFun"></mailingInfo>
<!-- 货物信息 --> <!-- 货物信息 -->
<cargoInfo :details="secOrderetails" @changeDetail="changeDetailFun"></cargoInfo> <cargoInfo :details="editDetails" @changeDetail="changeDetailFun"></cargoInfo>
<!-- 签单信息 --> <!-- 签单信息 -->
<billInfo :details="secOrderetails" @changeDetail="changeDetailFun"></billInfo> <billInfo :details="editDetails" @changeDetail="changeDetailFun"></billInfo>
<!-- 备注信息 --> <!-- 备注信息 -->
<remarksInfo :details="secOrderetails" @changeDetail="changeDetailFun"></remarksInfo> <remarksInfo :details="editDetails" @changeDetail="changeDetailFun"></remarksInfo>
<!-- 箱型 --> <!-- 箱型 -->
<goodsTable :details="secOrderetails" @changeDetail="changeDetailFun"></goodsTable> <goodsTable :details="editDetails" @changeDetail="changeDetailFun"></goodsTable>
</div> </div>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="EDI补充信息"> <a-tab-pane key="2" tab="EDI补充信息">
<ediMore <ediMore
class="pane-box" class="pane-box"
:details="secOrderetails" :details="editDetails"
@changeDetail="changeDetailFun" @changeDetail="changeDetailFun"
v-if="!inPageLoading" v-if="!inPageLoading"
></ediMore> ></ediMore>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</template> </template>
<template v-else>
<div class="sed-no-data">
<i class="iconfont icon-meiyoudingdan"></i>
<div class="no-data-text">暂无分单 <span class="btn" @click="addSedOrder"></span></div>
</div>
</template>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
@ -57,15 +66,26 @@ import goodsTable from '../modules/goodsTable'
import basicItem from './basicItem' import basicItem from './basicItem'
import ediMore from './ediMore' import ediMore from './ediMore'
import { BookingOrderUpdate, BookingOrderAdd } from '@/api/modular/main/BookingLedger'
export default { export default {
name: 'SedOrder', name: 'SedOrder',
props: { props: {
secOrderetails: { sedOrderList: {
type: Object, type: Array,
default: () => { default: () => {
return {} return []
}, },
}, },
isAdd: {
type: Boolean,
default: false
},
details: {
type: Object,
default: () => {
return {}
}
}
}, },
components: { components: {
sedOperationArea, sedOperationArea,
@ -82,27 +102,223 @@ export default {
return { return {
type: this.$route.query.type, type: this.$route.query.type,
id: this.$route.query.id, id: this.$route.query.id,
inPageLoading: false inPageLoading: false,
editDetails: null,
editIndex: 0,
}
},
watch: {
sedOrderList (nval, oval) {
if (nval.length > 0) {
// this.editDetails = nval[this.editIndex]
}
},
editDetails: {
handler (nval, oval) {
if (nval !== oval && oval) {
// this.sedOrderList[this.editIndex].isNoSave = true
// console.log(this.editIndex, this.sedOrderList[this.editIndex].isNoSave)
}
}
} }
}, },
watch: { },
created() { created() {
if (this.sedOrderList.length > 0) {
this.editDetails = JSON.parse(JSON.stringify(this.sedOrderList[0]))
}
}, },
methods: { methods: {
addSedOrder () {
if (this.isAdd) {
this.$message.error('请先保存主单')
return false
}
const data = {
id: 0,
parentId: this.details.id,
isNoSave: true,
//
customername: '',
carrier: '',
carrierid: this.type,
forwarder: '',
pono: '',
mblno: this.details.mblno,
hblno: '',
bookingno: '',
contractno: '',
vessel: '',
voyno: '',
voynoinner: '',
lanecode: '',
etd: '',
atd: '',
lanename: '',
shipagency: '',
sale: '',
op: '',
doc: '',
custservice: '',
//
shipper: '',
consignee: '',
notifyparty: '',
yard: '',
customser: '',
trucker: '',
agentid: '',
eta: '',
closingdate: '',
closedocdate: '',
closevgmdate: '',
portload: '',
portloadid: '',
transport: '',
transportid: '',
portdischarge: '',
portdischargeid: '',
destination: '',
destinationid: '',
placedelivery: '',
placedeliveryid: '',
placereceipt: '',
placereceiptid: '',
pkgs: 0,
kindpkgs: '',
kgs: 0,
cbm: 0,
//
marks: '',
cargoid: '',
hscode: '',
description: '',
totalno: '',
//
issuetype: '',
issuedate: '',
issueplace: '',
issueplaceid: '',
nobill: 'THREE',
copynobilll: 'ONE',
prepardat: '',
payableat: '',
blfrt: '',
thirdpayaddr: '',
service: '',
reeferf: '',
tempset: '',
tempid: '',
tempmin: '',
tempmax: '',
humidity: '',
dclass: '',
dunno: '',
dpage: '',
dlabel: '',
linkman: '',
//
soremark: '',
siremark: '',
//
ctnInputs: [],
// edi (edi)
weituo: '',
freightpayer: '',
scaccode: '',
itncode: '',
iscontainersoc: 0
}
this.editDetails = data
this.editIndex = this.sedOrderList.length
this.sedOrderList.push(data)
},
changeDetailFun (data) { changeDetailFun (data) {
const { detail, type } = data const { detail, type } = data
// this.secOrderetails = detail console.log('主要数据变化', detail)
this.editDetails = detail
this.sedOrderList[this.editDetails] = detail
this.editDetails.isNoSave = true
this.sedOrderList[this.editIndex].isNoSave = true
this.$forceUpdate()
}, },
// //
refreshPage() { refreshPage() {
// this.init() // this.init()
}, },
saveFun () { saveFun () {
// if (this.id) { debugger
// this.bookingOrderUpdate() if (this.editDetails.id !== 0) {
// } else { this.bookingOrderUpdate()
// this.bookingOrderAdd() } else {
this.bookingOrderAdd()
}
},
bookingOrderUpdate () {
console.log('保存', this.editDetails)
if (!this.editDetails.hblno) {
this.$message.error('请输入分提单号')
return false
}
let data = JSON.parse(JSON.stringify(this.editDetails))
delete data.isNoSave
debugger
BookingOrderUpdate(data)
.then((res) => {
if (res.success) {
this.sedOrderList[this.editIndex].isNoSave = false
this.editDetails.isNoSave = false
this.$message.success('保存成功')
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
})
},
bookingOrderAdd () {
console.log('新增', this.editDetails)
if (!this.editDetails.hblno) {
this.$message.error('请输入分提单号')
return false
}
let data = JSON.parse(JSON.stringify(this.editDetails))
delete data.isNoSave
BookingOrderAdd(data)
.then((res) => {
if (res.success) {
this.sedOrderList[this.editIndex].isNoSave = false
this.editDetails.isNoSave = false
this.sedOrderList[this.editIndex].id = res.data
this.$message.success('保存成功')
this.$forceUpdate()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
})
},
changeOrder (index) {
// if (!this.editDetails.isNoSave) {
// this.$message.error(`${this.editDetails.hblno}`)
// } // }
this.editIndex = index
this.editDetails = this.sedOrderList[index]
},
copyFun () {
let _data = this.editDetails
_data.isNoSave = true
_data.hblno = ''
this.editDetails = _data
this.editIndex = this.sedOrderList.length
this.sedOrderList.push(_data)
} }
}, },
} }
@ -217,4 +433,31 @@ export default {
vertical-align: top; vertical-align: top;
} }
} }
.sed-no-data {
margin:220px auto;
text-align: center;
width: 100%;
text-align: center;
i{
display: block;
line-height: 140px;
font-size: 120px;
color: #999;
}
.no-data-text{
font-size: 16px;
color: #666;
line-height: 24px;
.btn {
color: @primary-color;
cursor: pointer;
}
}
}
.no-save{
float: right;
font-size: 12px;
color: #999;
}
</style> </style>

@ -35,7 +35,7 @@
</a-row> </a-row>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="分单信息"> <a-tab-pane key="2" tab="分单信息">
<sedOrder :secOrderetails="bookingDetails"></sedOrder> <sedOrder :details="bookingDetails" :sedOrderList="bookingDetails.hbList" :isAdd="isAdd"></sedOrder>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</div> </div>
@ -80,7 +80,8 @@ export default {
background: '#fff', background: '#fff',
padding: '0 20px' padding: '0 20px'
}, },
excuteRules: [] excuteRules: [],
isAdd: false
} }
}, },
watch: { watch: {
@ -98,10 +99,10 @@ export default {
methods: { methods: {
init() { init() {
this.bookingDetails = {} this.bookingDetails = {}
this.id = this.$route.query.id
if (this.id) { if (this.id) {
this.getDetail() this.getDetail()
} else { } else {
this.isAdd = true
this.bookingDetails = { this.bookingDetails = {
id: 0, id: 0,
parentId: 0, parentId: 0,
@ -254,7 +255,9 @@ export default {
this.$message.error('请输入提单号') this.$message.error('请输入提单号')
return false return false
} }
BookingOrderUpdate(this.bookingDetails) const _data = JSON.parse(JSON.stringify(this.bookingDetails))
delete _data.hbList
BookingOrderUpdate(_data)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.$message.success('保存成功') this.$message.success('保存成功')
@ -275,9 +278,14 @@ export default {
this.$message.error('请输入提单号') this.$message.error('请输入提单号')
return false return false
} }
BookingOrderAdd(this.bookingDetails) const _data = JSON.parse(JSON.stringify(this.bookingDetails))
delete _data.hbList
BookingOrderAdd(_data)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.isAdd = false
debugger
this.id = res.data
this.$message.success('保存成功') this.$message.success('保存成功')
this.init() this.init()
this.$forceUpdate() this.$forceUpdate()

@ -49,7 +49,7 @@
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
<a-form-item class="from-label" label="提单号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item class="from-label" label="提单号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入提单号!" v-model="details.mblno" /> <a-input placeholder="请输入提单号!" v-model="details.mblno" :disabled="ishd" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6"> <a-col :xs="12" :sm="12" :md="12" :lg="8" :xl="6">
@ -348,6 +348,10 @@ export default {
return {} return {}
}, },
}, },
ishd: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
@ -472,7 +476,7 @@ export default {
if (this.customerData) { if (this.customerData) {
const arr = [] const arr = []
this.customerData.map((item, index) => { this.customerData.map((item, index) => {
if (!arr.includes(item.fullName)) { if (!arr.includes(item.fullName) && item.fullName) {
arr.push(item.fullName) arr.push(item.fullName)
} }
}) })
@ -498,8 +502,11 @@ export default {
if (this.vesselData) { if (this.vesselData) {
const arr = [] const arr = []
this.vesselData.map((item, index) => { this.vesselData.map((item, index) => {
if (!arr.includes(item.fullName)) { // if (!arr.includes(item.fullName)) {
arr.push(item.fullName) // arr.push(item.fullName)
// }
if (!arr.includes(item.name)) {
arr.push(item.name)
} }
}) })
return arr return arr
@ -603,16 +610,16 @@ export default {
}, },
methods: { methods: {
init() { init() {
this.getCustomer() // this.getCustomer()
this.getCarrier() // this.getCarrier()
this.getVessel() // this.getVessel()
this.getVoynoinner()
// this.getVoynoinner() // this.getVoynoinner()
// this.getLanename() // // this.getVoynoinner()
this.getUserList('sale') // // this.getLanename()
this.getUserList('op') // this.getUserList('sale')
this.getUserList('doc') // this.getUserList('op')
this.getUserList('custservice') // this.getUserList('doc')
// this.getUserList('custservice')
if (this.details.etd) { if (this.details.etd) {
this.etdWeek = this.getWeek(this.details.etd) this.etdWeek = this.getWeek(this.details.etd)
} }

@ -506,12 +506,12 @@ export default {
}, },
methods: { methods: {
init() { init() {
this.getIssuetypeList('') // this.getIssuetypeList('')
this.getPortloadlist('', 'issueplace') // this.getPortloadlist('', 'issueplace')
this.getPortloadlist('', 'prepardat') // this.getPortloadlist('', 'prepardat')
this.getPortlist('', 'payableat') // this.getPortlist('', 'payableat')
this.getFrt('') // this.getFrt('')
this.getService('') // this.getService('')
}, },
// - start // - start
getIssuetypeList (name = '') { getIssuetypeList (name = '') {

@ -725,17 +725,17 @@ export default {
}, },
methods: { methods: {
init () { init () {
this.getTemplate('', 'shipper') // this.getTemplate('', 'shipper')
this.getTemplate('', 'consignee') // this.getTemplate('', 'consignee')
this.getTemplate('', 'notify') // this.getTemplate('', 'notify')
this.getYardlist() // this.getYardlist()
// this.getPortloadlist('', 'portload') // this.getPortloadlist('', 'portload')
// this.getPortloadlist('', 'placereceipt') // this.getPortloadlist('', 'placereceipt')
// this.getPortlist('', 'transport') // this.getPortlist('', 'transport')
// this.getPortlist('', 'portdischarge') // this.getPortlist('', 'portdischarge')
// this.getPortlist('', 'destination') // this.getPortlist('', 'destination')
// this.getPortlist('', 'placedelivery') // this.getPortlist('', 'placedelivery')
this.getPackage('') // this.getPackage('')
}, },
// - start // - start
getTemplate(name = '', type) { getTemplate(name = '', type) {

@ -2,17 +2,7 @@
<div class="operation-area"> <div class="operation-area">
<a-card :bordered="false" :bodyStyle="{ 'padding': '10px', 'margin-bottom': '10px' }"> <a-card :bordered="false" :bodyStyle="{ 'padding': '10px', 'margin-bottom': '10px' }">
<div class="btn-list more-view"> <div class="btn-list more-view">
<a-popconfirm <button @click="copyFun"><span class="iconfont icon-fuzhi1"></span>复制</button>
placement="bottom"
title="刷新页面将丢失未保存数据,是否继续?"
ok-text="是"
cancel-text="否"
@confirm="refreshPage"
@cancel="cancelRefresh"
>
<button><span class="iconfont icon-shuaxin"></span>刷新</button>
</a-popconfirm>
<button><span class="iconfont icon-fuzhi1"></span>复制</button>
<button @click="saveFun"><span class="iconfont icon-icon_baocun"></span>保存</button> <button @click="saveFun"><span class="iconfont icon-icon_baocun"></span>保存</button>
<button><span class="iconfont icon-printing"></span>打印</button> <button><span class="iconfont icon-printing"></span>打印</button>
</div> </div>
@ -46,6 +36,10 @@ export default {
}, },
saveFun () { saveFun () {
// //
this.$emit('save')
},
copyFun () {
this.$emit('copy')
} }
} }
} }

Loading…
Cancel
Save