|
|
|
@ -5,16 +5,16 @@
|
|
|
|
|
<a-col :span="showSecNav ? 5 : 0" v-if="showSecNav">
|
|
|
|
|
<div class="sed-order-list">
|
|
|
|
|
<div class="sed-order-title">
|
|
|
|
|
<i class="iconfont icon-liebiao"></i><span class="tit">分提单列表</span
|
|
|
|
|
><span class="right" @click="openNav">收起</span>
|
|
|
|
|
<i class="iconfont icon-liebiao"></i><span class="tit">分提单列表</span><span
|
|
|
|
|
class="right"
|
|
|
|
|
@click="openNav">收起</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sec-order">
|
|
|
|
|
<div
|
|
|
|
|
class="sed-order-label"
|
|
|
|
|
v-for="(sedDetail, sindex) in sedOrderList"
|
|
|
|
|
:key="sindex"
|
|
|
|
|
:class="{ active: editIndex === sindex }"
|
|
|
|
|
>
|
|
|
|
|
:class="{ active: editIndex === sindex }">
|
|
|
|
|
<div class="left" @click.stop="changeOrder(sindex)">
|
|
|
|
|
<i class="iconfont icon-dingdan"></i>分单{{ sindex + 1 }}: {{ sedDetail.hblno || '请填写分单号' }}
|
|
|
|
|
</div>
|
|
|
|
@ -24,8 +24,7 @@
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm.stop="removeSedOrderFun(sedDetail, sindex)"
|
|
|
|
|
@cancel="cancelRemove"
|
|
|
|
|
>
|
|
|
|
|
@cancel="cancelRemove">
|
|
|
|
|
<span class="remove-btn iconfont icon-shanchu1"></span>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</div>
|
|
|
|
@ -44,8 +43,8 @@
|
|
|
|
|
:class="scrollTop < 100 ? 'normal-nav' : 'fixed-nav'"
|
|
|
|
|
@save="saveFun"
|
|
|
|
|
@copy="copyFun"
|
|
|
|
|
@remove="removeFun"
|
|
|
|
|
></sedOperationArea>
|
|
|
|
|
@remove="removeFun">
|
|
|
|
|
</sedOperationArea>
|
|
|
|
|
<ul class="sec-parent-tabs-box">
|
|
|
|
|
<div class="parents-tabs-top">
|
|
|
|
|
<li @click="changeParentTabs('1')" :class="{ active: mainOrderActiveKey === '1' }">
|
|
|
|
@ -69,8 +68,7 @@
|
|
|
|
|
:ishd="true"
|
|
|
|
|
:inSave="inSave"
|
|
|
|
|
isParent="child"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></basicInfo>
|
|
|
|
|
@changeDetail="changeDetailFun"></basicInfo>
|
|
|
|
|
<!-- 收发通信息 -->
|
|
|
|
|
<mailingInfo
|
|
|
|
|
ref="mailingInfo"
|
|
|
|
@ -79,8 +77,7 @@
|
|
|
|
|
:inSave="inSave"
|
|
|
|
|
:ishd="true"
|
|
|
|
|
isParent="child"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></mailingInfo>
|
|
|
|
|
@changeDetail="changeDetailFun"></mailingInfo>
|
|
|
|
|
<!-- 货物信息 -->
|
|
|
|
|
<cargoInfo
|
|
|
|
|
ref="cargoInfo"
|
|
|
|
@ -89,8 +86,7 @@
|
|
|
|
|
:inSave="inSave"
|
|
|
|
|
isParent="child"
|
|
|
|
|
@pkgsEnCapital="pkgsEnCapitalFun"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
></cargoInfo>
|
|
|
|
|
@changeDetail="changeDetailFun"></cargoInfo>
|
|
|
|
|
<!-- 箱型 -->
|
|
|
|
|
<goodsTable
|
|
|
|
|
ref="goodsTable"
|
|
|
|
@ -113,8 +109,7 @@
|
|
|
|
|
:inSave="inSave"
|
|
|
|
|
isParent="child"
|
|
|
|
|
@changeDetail="changeDetailFun"
|
|
|
|
|
v-if="!inPageLoading"
|
|
|
|
|
></ediMore>
|
|
|
|
|
v-if="!inPageLoading"></ediMore>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</ul>
|
|
|
|
@ -379,6 +374,7 @@ export default {
|
|
|
|
|
editDetails: null,
|
|
|
|
|
editIndex: 0,
|
|
|
|
|
showSecNav: true,
|
|
|
|
|
oldBookingDetails: {},
|
|
|
|
|
inSecLoad: false,
|
|
|
|
|
mainOrderActiveKey: '1',
|
|
|
|
|
basicRules: rules.basicRules,
|
|
|
|
@ -396,11 +392,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
parSedOrderList: {
|
|
|
|
|
handler(nval, oval) {},
|
|
|
|
|
handler(nval, oval) { },
|
|
|
|
|
deep: true
|
|
|
|
|
},
|
|
|
|
|
editDetails: {
|
|
|
|
|
handler(nval, oval) {},
|
|
|
|
|
handler(nval, oval) { },
|
|
|
|
|
deep: true
|
|
|
|
|
},
|
|
|
|
|
'$route.query': {
|
|
|
|
@ -424,7 +420,7 @@ export default {
|
|
|
|
|
this.checkFromInit()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
created() { },
|
|
|
|
|
mounted() {
|
|
|
|
|
this.checkFromInit()
|
|
|
|
|
},
|
|
|
|
@ -446,6 +442,7 @@ export default {
|
|
|
|
|
$data.bookingEDIExt = bookingEDIExt
|
|
|
|
|
}
|
|
|
|
|
this.editDetails = $data
|
|
|
|
|
this.oldBookingDetails = JSON.parse(JSON.stringify($data))
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$refs.goodsTable.init()
|
|
|
|
|
}, 1000)
|
|
|
|
@ -454,6 +451,7 @@ export default {
|
|
|
|
|
}, 2000)
|
|
|
|
|
} else {
|
|
|
|
|
this.editDetails = JSON.parse(JSON.stringify(sedDetail))
|
|
|
|
|
this.oldBookingDetails = JSON.parse(JSON.stringify(sedDetail))
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.inSecLoad = false
|
|
|
|
|
}, 2000)
|
|
|
|
@ -465,6 +463,52 @@ export default {
|
|
|
|
|
pkgsEnCapitalFun(data) {
|
|
|
|
|
this.bookingDetails.totalno = data
|
|
|
|
|
},
|
|
|
|
|
diffObj(obj1, obj2) {
|
|
|
|
|
function getTypeByObj(obj) {
|
|
|
|
|
return Object.prototype.toString.call(obj).match(/^\[object ([a-zA-Z]*)\]$/)[1];
|
|
|
|
|
}
|
|
|
|
|
function isEmptyObject(obj) {
|
|
|
|
|
for (const key in obj) {
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (!obj1 || isEmptyObject(obj1) || !obj2 || isEmptyObject(obj2)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
const diffRes = {
|
|
|
|
|
old_val: {},
|
|
|
|
|
new_val: {}
|
|
|
|
|
};
|
|
|
|
|
for (const k in obj2) {
|
|
|
|
|
// 判断数据类型是否一致
|
|
|
|
|
if (getTypeByObj(obj2[k]) === getTypeByObj(obj1[k])) {
|
|
|
|
|
// 比较 “Array”和“Object”类型
|
|
|
|
|
if (getTypeByObj(obj2[k]) === 'Array' || getTypeByObj(obj2[k]) === 'Object') {
|
|
|
|
|
const diffData = this.diffObj(obj1[k], obj2[k]);
|
|
|
|
|
if (!isEmptyObject(diffData)) {
|
|
|
|
|
diffRes.old_val[k] = diffData.old_val;
|
|
|
|
|
diffRes.new_val[k] = diffData.new_val;
|
|
|
|
|
}
|
|
|
|
|
} else if (obj1[k] !== obj2[k]) { // 比较其他类型数据
|
|
|
|
|
diffRes.old_val[k] = obj1[k];
|
|
|
|
|
diffRes.new_val[k] = obj2[k];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ([undefined, null, ''].includes(obj1[k]) && [undefined, null, ''].includes(obj2[k])) {
|
|
|
|
|
// 这三类数据可视为相等,不做处理
|
|
|
|
|
} else {
|
|
|
|
|
diffRes.old_val[k] = obj1[k];
|
|
|
|
|
diffRes.new_val[k] = obj2[k];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 若没有变化,返回null
|
|
|
|
|
if (isEmptyObject(diffRes.old_val) || isEmptyObject(diffRes.new_val)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return diffRes;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
checkFromInit() {
|
|
|
|
|
Object.keys(this.basicRules).map((item, index) => {
|
|
|
|
@ -696,6 +740,22 @@ export default {
|
|
|
|
|
item.id = 0
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const changedFields = this.diffObj(this.oldBookingDetails, data)
|
|
|
|
|
if (changedFields) {
|
|
|
|
|
if (changedFields.new_val.bookingEDIExt) {
|
|
|
|
|
delete changedFields.new_val.bookingEDIExt
|
|
|
|
|
}
|
|
|
|
|
if (changedFields.new_val.ctnInputs) {
|
|
|
|
|
delete changedFields.new_val.ctnInputs
|
|
|
|
|
}
|
|
|
|
|
if (changedFields.new_val.extendState) {
|
|
|
|
|
delete changedFields.new_val.extendState
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (changedFields) {
|
|
|
|
|
data.changedFields = Object.keys(changedFields.new_val)
|
|
|
|
|
}
|
|
|
|
|
console.log(changedFields, this.oldBookingDetails, 'changedFields')
|
|
|
|
|
BookingOrderSave(data)
|
|
|
|
|
.then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|