Commit 3faff0ea authored by dragondean@qq.com's avatar dragondean@qq.com

未报价异常添加路线的时候锁定路线不可修改

parent be7d42e1
......@@ -35,12 +35,12 @@
</div>
<!--table需要给一个key,否则全选的时候不会自动更新渲染-->
<el-table v-if="!hideMap[item.value]" :data="item.routerList" :span-method="SpanMethod" border :key="selectedRoutes.length + item.value">
<el-table-column :label="$t('始发')" prop="startTitleZh">
<el-table-column :label="$t('始发')" prop="startTitleZh">
<template slot-scope="{row}">
{{$l(row, 'startTitle')}}
</template>
</el-table-column>
<el-table-column :label="$t('目的')" prop="destTitleZh" >
<el-table-column :label="$t('目的')" prop="destTitleZh" >
<template slot-scope="{row}">
{{$l(row, 'destTitle')}}
</template>
......@@ -73,7 +73,8 @@ export default {
props:{
value: {
type: Array
}
},
option: Object
},
data(){
return {
......@@ -93,7 +94,6 @@ export default {
}
},
computed:{
importCityList(){
return this.tradeCityList.filter(item => item.type == 1 || item.type == 3)
},
......@@ -183,6 +183,12 @@ export default {
})
})
}
},
option(option){
if(option){
this.changeOption()
}
}
},
created(){
......@@ -198,9 +204,20 @@ export default {
if(this.value && this.value.length){
this.selectedRoutes = this.value
}
if(this.option){
this.changeOption()
}
},
methods:{
changeOption(){
if(!this.option) return
this.importCity = +this.option.importCity
this.exportCity = +this.option.exportCity
this.transportType = this.option.transportId
this.channelId = +this.option.channelId
},
// 全选、全不选 某个运输方式所有线路
toggleGroupChecker(index, selected){
let routerList = this.filteredRouterList[index].routerList
......
......@@ -194,7 +194,22 @@ export default {
var productData = this.orderData.orderItemVOList.find(item=>item.orderItemId==row.orderItemId)
if(productData){
getProduct(productData.prodId).then(res=>{
let url = '../../lineProject/product-price/edit?product_id='+productData.prodId+'&product_type='+res.data.typeId+'&transportId='+this.orderData.transportId+'&exportCity='+this.orderData.logisticsInfoDto.startCityId+'&importCity='+this.orderData.logisticsInfoDto.destCityId
let params = {
product_id: productData.prodId,
product_type: res.data.typeId,
transportId: this.orderData.transportId,
exportCity: this.orderData.logisticsInfoDto.startCityId,
importCity: this.orderData.logisticsInfoDto.destCityId,
startWarehouseId: this.orderData.logisticsInfoDto.startWarehouseId,
destWarehouseId: this.orderData.logisticsInfoDto.destWarehouseId,
lineId: this.orderData.logisticsInfoDto.lineId,
channelId: this.orderData.logisticsInfoDto.channelId
}
let url = '../../lineProject/product-price/edit?' + (new URLSearchParams(params)).toString()
/* +productData.prodId
+'&product_type='+res.data.typeId
+'&transportId='+this.orderData.transportId
+'&exportCity='+this.orderData.logisticsInfoDto.startCityId+'&importCity='+this.orderData.logisticsInfoDto.destCityId */
return this.$router.push(url)
})
}
......
......@@ -4,7 +4,12 @@
<el-form-item :label="$t('商品类型')" prop="productType">
<el-select v-model="form.productType" :disabled="!!$route.query.ids">
<el-option v-for="type in productTypeList" :key="type.id" :label="type.titleZh" :value="type.id" />
<el-option
v-for="type in productTypeList"
:key="type.id"
:label="type.titleZh"
:value="type.id"
></el-option>
</el-select>
</el-form-item>
......@@ -28,8 +33,8 @@
<el-form-item :label="$t('路线')" prop="lineChannelList" v-if="lineList.length">
<template v-if="lineList.length == 1">
<el-input
v-for="item in lineList"
:key="item.id"
v-for="(item, index) in lineList"
:key="index"
:value="!item.warehouseLineDO ? $t('数据异常,缺少warehouseLineDO字段') : $t('【{transport}】从【{from}】发往【{to}】', {
transport: getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType),
from: $l(item.warehouseLineDO, 'startTitle'),
......@@ -57,7 +62,7 @@
</el-form-item>
<!--有路线则不显示路线选择器-->
<routers-selector v-else v-model="selectedRoutes" />
<routers-selector v-else v-model="selectedRoutes" :option="routerOption" />
<el-card style="margin-bottom: 10px">
<div slot="header" style="font-size:20px;">
......@@ -230,6 +235,7 @@ import { arrryToKeyedObjectBy } from '@/utils/index'
import Selector from '@/components/Selector'
import Inputor from '@/components/Inputor'
import {parseTime} from '@/utils/ruoyi'
import {openedRouterList} from '@/api/ecw/warehouse'
export default {
components: { RoutersSelector, ProductSelector, Selector, Inputor },
data() {
......@@ -262,7 +268,9 @@ export default {
}
},
computed: {
routerOption(){
return this.$route.query
}
},
watch: {
checkList() { //选择路线
......@@ -431,6 +439,26 @@ export default {
this.form.validateStartDate = parseTime(Date.now())
this.form.validateEndDate = parseTime(Date.now() + 86400*365*2*1000)
// 如果指定了始发,目的仓和运输方式,渠道,则是从未报价异常跳转过来的,固定一个路线
if(this.$route.query.startWarehouseId){
openedRouterList({
destCityId: this.$route.query.importCity,
lineId: this.$route.query.lineId,
startCityId: this.$route.query.exportCity,
transportType: this.$route.query.transportId
}).then(res => {
console.log("open ---> ", res)
this.lineList = [
Object.assign({
// id: res.data[0].id,
lineId:this.$route.query.lineId,
shippingChannelId: this.$route.query.channelId,
warehouseLineDO: {... res.data[0]}
})]
})
}
}
if (this.$route.query.product_type) {
......@@ -550,7 +578,7 @@ export default {
}
// 添加的提交
data.productId = this.product.id;
data.lineChannelList = this.selectedRoutes
data.lineChannelList = this.lineList.length ? this.lineList : this.selectedRoutes
if((this.form.priceType == 0 && !this.form.transportPrice) || (this.form.priceType == 1 && !this.form.allPrice)){
return this.$message.error(this.$t('运费/全包价不能为0'))
......
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