Commit 93ff3820 authored by zhoutong's avatar zhoutong
parents 3d24664d 3870e773
......@@ -975,7 +975,7 @@ export default {
'form.consignorPhone'(){
if(this.form.lineId) this.getOfferData()
},
'form.lineId'(lineId){
async 'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
if(!router){
return
......@@ -983,7 +983,7 @@ export default {
this.$set(this.form, 'departureId', router.startCityId)
this.$set(this.form, 'objectiveId', router.destCityId)
this.$set(this.form, 'transportId', router.transportType)
await this.getChannelList()
this.calculationPrice()
this.$nextTick(() => {
// 如果开启了默认送货上门,则默认选择送货上门,2是送货上门,10是默认送货上门
......@@ -1142,7 +1142,8 @@ export default {
},
async getChannelList(){
let query = {
cityId: this.form.objectiveId
cityId: this.form.objectiveId,
lineId: this.form.lineId
}
this.channelList = (await getChannelList(query)).data
},
......
......@@ -93,16 +93,46 @@
</el-col>
</el-row>
</template>
<template v-else>
<sea-price
ref="seaPrice"
:price-type="form.priceType"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
@changeUnit="handleFormUnitChange($event)"
></sea-price>
</template>
<template v-else-if="form.priceType === 1">
<sea-price
ref="seaPrice"
:currency-list="currencyList"
:unit-list="unitList"
:value="form"
field-prefix="all"
:price-name="$t('全包价')"
packaging-field="fullPricePackagingList"
@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>
......@@ -450,17 +480,37 @@ export default {
},
// 非阶梯价格更新单位
handleFormUnitChange(data){
console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
console.log("handleFormUnitChange", {...data})
// 海运非阶梯价没有重量单位,所以按照体积单位同步最小起计量单位
if(data.field === 'transportVolumeUnit' || data.field == 'allVolumeUnit'){
this.form.minWeightUnit = data.value
}
if(this.form.specialList?.length){
this.form.specialList.forEach(p => {
p[data.field] = data.value
})
if(this.form.specialList?.length){
this.form.specialList.forEach(p => {
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(){
if(this.form.priceType == 1 && !this.form.fullPriceStepList?.length){
......
......@@ -212,7 +212,7 @@ export default {
<!--特性加价-->
<template v-for="(special, specialIndex) in value.specialList">
<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'"
>
<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 {
<!--包装类型价格-->
<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>
<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>
</template>
<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 {
value:{
type: Object,
default: () => {
return {
}
return {}
}
}
},
......@@ -175,7 +173,7 @@ export default {
<template v-for="(special, specialIndex) in value.specialList">
<div :key="specialIndex + 'transport'">
<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" />
<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 {
<template v-for="(item, i) in value[packagingField]">
<el-form-item :label="$t('包装类型') + priceName + (i+1)" :key="i">
<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>
</template>
<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 {
}
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不为空
......@@ -666,17 +687,19 @@ export default {
let packingField = {
transportVolumeUnit: 'freightPricePackagingList',
clearanceVolumeUnit: 'clearancePricePackagingList',
allVolumeUnit: 'fullPricePackagingList'
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){
p['packagingPriceUnit'] = data.value
item['packagingPriceUnit'] = data.value
}
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