Commit 93ff3820 authored by zhoutong's avatar zhoutong
parents 3d24664d 3870e773
...@@ -975,7 +975,7 @@ export default { ...@@ -975,7 +975,7 @@ export default {
'form.consignorPhone'(){ 'form.consignorPhone'(){
if(this.form.lineId) this.getOfferData() if(this.form.lineId) this.getOfferData()
}, },
'form.lineId'(lineId){ async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId) let router = this.routerList.find(item => item.id == lineId)
if(!router){ if(!router){
return return
...@@ -983,7 +983,7 @@ export default { ...@@ -983,7 +983,7 @@ export default {
this.$set(this.form, 'departureId', router.startCityId) this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId) this.$set(this.form, 'objectiveId', router.destCityId)
this.$set(this.form, 'transportId', router.transportType) this.$set(this.form, 'transportId', router.transportType)
await this.getChannelList()
this.calculationPrice() this.calculationPrice()
this.$nextTick(() => { this.$nextTick(() => {
// 如果开启了默认送货上门,则默认选择送货上门,2是送货上门,10是默认送货上门 // 如果开启了默认送货上门,则默认选择送货上门,2是送货上门,10是默认送货上门
...@@ -1142,7 +1142,8 @@ export default { ...@@ -1142,7 +1142,8 @@ export default {
}, },
async getChannelList(){ async getChannelList(){
let query = { let query = {
cityId: this.form.objectiveId cityId: this.form.objectiveId,
lineId: this.form.lineId
} }
this.channelList = (await getChannelList(query)).data this.channelList = (await getChannelList(query)).data
}, },
......
...@@ -93,16 +93,46 @@ ...@@ -93,16 +93,46 @@
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<template v-else> <template v-else-if="form.priceType === 1">
<sea-price <sea-price
ref="seaPrice" ref="seaPrice"
:price-type="form.priceType" :currency-list="currencyList"
:currency-list="currencyList" :unit-list="unitList"
:unit-list="unitList" :value="form"
:value="form" field-prefix="all"
@changeUnit="handleFormUnitChange($event)" :price-name="$t('全包价')"
></sea-price> packaging-field="fullPricePackagingList"
</template> @changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else>
<el-row :gutter="20">
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="transport"
:price-name="$t('运费')"
packaging-field="freightPricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
<el-col :span="12">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="clearance"
:price-name="$t('清关费')"
packaging-field="clearancePricePackagingList"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</el-col>
</el-row>
</template>
</el-card> </el-card>
...@@ -450,17 +480,37 @@ export default { ...@@ -450,17 +480,37 @@ export default {
}, },
// 非阶梯价格更新单位 // 非阶梯价格更新单位
handleFormUnitChange(data){ handleFormUnitChange(data){
console.log("handleFormUnitChange", {...data}) console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位 // 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){ if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value this.form.minWeightUnit = data.value
} }
if(this.form.specialList?.length){ if(this.form.specialList?.length){
this.form.specialList.forEach(p => { this.form.specialList.forEach(p => {
p[data.field] = data.value p[data.field] = data.value
}) })
}
// 同步包装的单位
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field]
if(!this.form[packingField]?.length){
return false
}
this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){
item['packagingPriceUnit'] = data.value
}
if(data.field.indexOf("VolumeUnit") > -1){
item['packagingVolumeUnit'] = data.value
} }
})
}, },
initStepPrice(){ initStepPrice(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){ if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
......
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
<!--特性加价--> <!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList"> <template v-for="(special, specialIndex) in value.specialList">
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName + $t('加价')"
:key="specialIndex + 'transport'" :key="specialIndex + 'transport'"
> >
<el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
...@@ -224,9 +224,9 @@ export default { ...@@ -224,9 +224,9 @@ export default {
<!--包装类型价格--> <!--包装类型价格-->
<template v-for="(item, i) in value.packagingList"> <template v-for="(item, i) in value.packagingList">
<el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i"> <el-form-item :label="$t('包装类型加价') + (i+1)" :key="i">
<template #label> <template #label>
<div class="el-form-item__label" style="width: 150px;">{{$t('包装类型') + priceName + (i+1)}}</div> <div class="el-form-item__label" style="width: 150px;">{{$t('包装类型{name}加价', {name: priceName}) + (i+1)}}</div>
<div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div> <div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div>
</template> </template>
<el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block"> <el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block">
......
...@@ -25,9 +25,7 @@ export default { ...@@ -25,9 +25,7 @@ export default {
value:{ value:{
type: Object, type: Object,
default: () => { default: () => {
return { return {}
}
} }
} }
}, },
...@@ -175,7 +173,7 @@ export default { ...@@ -175,7 +173,7 @@ export default {
<template v-for="(special, specialIndex) in value.specialList"> <template v-for="(special, specialIndex) in value.specialList">
<div :key="specialIndex + 'transport'"> <div :key="specialIndex + 'transport'">
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + priceName + $t('加价')"
> >
<el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <el-input-number v-model.number="special[`${fieldPrefix}Price`]" :controls="false" :min="0" :disabled="readonly" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<selector disabled v-model="special[`${fieldPrefix}PriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100 mr-10" /> <selector disabled v-model="special[`${fieldPrefix}PriceUnit`]" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" class="w-100 mr-10" />
...@@ -189,7 +187,7 @@ export default { ...@@ -189,7 +187,7 @@ export default {
<template v-for="(item, i) in value[packagingField]"> <template v-for="(item, i) in value[packagingField]">
<el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i"> <el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i">
<template #label> <template #label>
<div class="el-form-item__label" style="width: 150px;">{{$t('包装类型') + priceName + (i+1)}}</div> <div class="el-form-item__label" style="width: 150px;">{{$t('包装类型{name}加价', {name: priceName}) + (i+1)}}</div>
<div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div> <div v-if="!item.packagingTypes || !item.packagingTypes.length" class="tips">{{$t('未选择包装类型将被忽略')}}</div>
</template> </template>
<el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block"> <el-select v-model="item.packagingTypes" multiple placeholder="请选择" style="width: 100%; max-width: 450px; margin-bottom: 5px; display: block">
......
...@@ -451,6 +451,27 @@ export default { ...@@ -451,6 +451,27 @@ export default {
} }
this.lineList = [res.data] this.lineList = [res.data]
// 如果不是阶梯价,需要初始化包装类型
if(this.form.stepPrice != 1){
if(this.form.freightPricePackagingList?.length){
this.form.freightPricePackagingList.forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
}else this.form.freightPricePackagingList = [{}]
if(this.form.clearancePricePackagingList?.length){
this.form.clearancePricePackagingList.forEach(item => {
if(!item.packagingTypes){
this.$set(item, 'packagingTypes', [])
}else if(typeof item.packagingTypes == 'string'){
item.packagingTypes = item.packagingTypes.split(',')
}
})
}else this.form.clearancePricePackagingList = [{}]
}
} }
// action=batchUpdate且ids不为空 // action=batchUpdate且ids不为空
...@@ -666,17 +687,19 @@ export default { ...@@ -666,17 +687,19 @@ export default {
let packingField = { let packingField = {
transportVolumeUnit: 'freightPricePackagingList', transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList', clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList' allVolumeUnit: 'fullPricePackagingList',
transportPriceUnit: 'freightPricePackagingList',
clearancePriceUnit: 'clearancePricePackagingList'
}[data.field] }[data.field]
if(!this.form[packingField]?.length){ if(!this.form[packingField]?.length){
return false return false
} }
this.form[packingField].forEach(item => { this.form[packingField].forEach(item => {
if(data.field.indexOf("PriceUnit") > -1){ if(data.field.indexOf("PriceUnit") > -1){
p['packagingPriceUnit'] = data.value item['packagingPriceUnit'] = data.value
} }
if(data.field.indexOf("VolumeUnit") > -1){ if(data.field.indexOf("VolumeUnit") > -1){
p['packagingVolumeUnit'] = data.value item['packagingVolumeUnit'] = data.value
} }
}) })
}, },
......
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