Commit c71f8719 authored by dragondean@qq.com's avatar dragondean@qq.com

订单编辑优化

parent e3659190
...@@ -1003,6 +1003,7 @@ export default { ...@@ -1003,6 +1003,7 @@ export default {
}, },
activated(){ activated(){
if(this.$route.query.id != this.form.id){ if(this.$route.query.id != this.form.id){
console.log("activated 加载订单数据")
this.getOrder() this.getOrder()
} }
let transportType = undefined let transportType = undefined
...@@ -1017,7 +1018,6 @@ export default { ...@@ -1017,7 +1018,6 @@ export default {
this.updateChannel = this.$route.query.updateChannel == 1 this.updateChannel = this.$route.query.updateChannel == 1
}, },
async created() { async created() {
this.productAttrList = (await getProductAttrList()).data this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data this.channelList = (await getChannelList()).data
this.tradeCityList = (await getTradeCityList()).data this.tradeCityList = (await getTradeCityList()).data
...@@ -1039,6 +1039,7 @@ export default { ...@@ -1039,6 +1039,7 @@ export default {
this.updateChannel = true this.updateChannel = true
} }
if(this.$route.query.id){ if(this.$route.query.id){
console.log('created 加载订单数据')
this.getOrder() this.getOrder()
}else{ }else{
this.addProduct() this.addProduct()
...@@ -1053,6 +1054,10 @@ export default { ...@@ -1053,6 +1054,10 @@ export default {
// console.warn('onTableMounted', e) // console.warn('onTableMounted', e)
}, },
getOrder(){ getOrder(){
if(this.form.orderId == this.$route.query.id){
console.log('加载中或者已加载此订单数据,不重复加载', this.initing, this.form.orderId, this.$route.query.id)
return
}
this.initing = true this.initing = true
getUpdateInfo(this.$route.query.id).then(res => { getUpdateInfo(this.$route.query.id).then(res => {
this.form = Object.assign({}, {...res.data}, {orderItemVOList: []}) this.form = Object.assign({}, {...res.data}, {orderItemVOList: []})
...@@ -1113,6 +1118,7 @@ export default { ...@@ -1113,6 +1118,7 @@ export default {
this.form.orderItemVOList.push({...item}) this.form.orderItemVOList.push({...item})
}) })
// 已入仓后,必填字段修改则需要显示审批流
if(this.inWarehouse){ if(this.inWarehouse){
Object.keys(this.rules).forEach(field => { Object.keys(this.rules).forEach(field => {
console.log("watch", field) console.log("watch", field)
...@@ -1129,6 +1135,9 @@ export default { ...@@ -1129,6 +1135,9 @@ export default {
if(res.data.portDestCustomsClear){ if(res.data.portDestCustomsClear){
this.$set(this.form, 'portDestCustomsClear', res.data.portDestCustomsClear) this.$set(this.form, 'portDestCustomsClear', res.data.portDestCustomsClear)
} }
if(res.data.deliveryWay){
this.$set(this.form, 'deliveryWay', res.data.deliveryWay)
}
}, 100) }, 100)
this.initing = false this.initing = false
}) })
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
disabled/> disabled/>
</el-form-item>--> </el-form-item>-->
<!--多条路线批量修改--> <!--多条路线批量修改-->
<el-form-item :label="$t('路线')" prop="lineChannelList" v-if="lineList.length"> <template v-if="lineList.length">
<el-form-item :label="$t('路线')" prop="lineChannelList">
<template v-if="lineList.length == 1"> <template v-if="lineList.length == 1">
<el-input <el-input
v-for="(item, index) in lineList" v-for="(item, index) in lineList"
...@@ -63,7 +64,7 @@ ...@@ -63,7 +64,7 @@
<el-form-item v-if="channel" :label="$t('出货渠道')"> <el-form-item v-if="channel" :label="$t('出货渠道')">
{{$l(channel, 'name')}} {{$l(channel, 'name')}}
</el-form-item> </el-form-item>
</template>
<!--有路线则不显示路线选择器--> <!--有路线则不显示路线选择器-->
<routers-selector v-else v-model="selectedRoutes" :option="routerOption" :type="type" /> <routers-selector v-else v-model="selectedRoutes" :option="routerOption" :type="type" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment