Commit 352f4694 authored by dragondean@qq.com's avatar dragondean@qq.com

默认空运千克海运立方米

parent 5227a5fc
......@@ -24,6 +24,13 @@
<el-form-item :label="$t('单价模式')" prop="priceType">
<dict-selector :type="DICT_TYPE.ECW_PRICE_TYPE" v-model="form.priceType" form-type="radio" formatter='number' />
</el-form-item>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<!--阶梯订单-->
<template v-if="form.stepPrice==1" >
......@@ -63,13 +70,6 @@
</template>
<!--非阶梯订单-->
<template v-else>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
......@@ -304,6 +304,10 @@ export default {
if(this.type == 'air'){
this.$set(this.form, 'stepPrice', 1)
}
await this.$nextTick()
// 默认单位,空运千克,海运立方米
this.setDefaultVolumeUnit(this.type == 'air' ? 6 : 7)
// 如果是复制,则获取数据并填充,先复制,然后填充特需,避免数据的特需不全导致部分不显示
if(this.$route.query.templateId){
await this.getTemplateDetail(this.$route.query.templateId)
......@@ -454,6 +458,17 @@ export default {
this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit)
this.$set(this.form, 'allVolumeUnit', unit)
this.$set(this.form, 'minWeightUnit', unit)
console.log(this.form.priceStepList, this.form.stepPrice)
// 阶梯价
if(this.form.stepPrice == 1 && this.form.priceStepList?.length){
this.form.priceStepList.forEach(item => {
this.$set(item, 'transportVolumeUnit', unit)
this.$set(item, 'clearanceVolumeUnit', unit)
this.$set(item, 'allVolumeUnit', unit)
this.$set(item, 'weightUnit', unit)
})
}
},
submitForm() {
this.$refs["form"].validate(async (valid) => {
......
......@@ -167,6 +167,10 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.$nextTick(async() => {
this.setDefaultVolumeUnit(this.type == 'air' ? 6 : 7)
})
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
// 没有的才push,已有的可能是从复制模板携带过来的数据
if(!this.form.specialList.find(special => special.specialDictType == item.value)) {
......@@ -243,6 +247,17 @@ export default {
this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit)
this.$set(this.form, 'allVolumeUnit', unit)
this.$set(this.form, 'minWeightUnit', unit)
console.log(this.form.priceStepList, this.form.stepPrice)
// 阶梯价
if(this.form.stepPrice == 1 && this.form.priceStepList?.length){
this.form.priceStepList.forEach(item => {
this.$set(item, 'transportVolumeUnit', unit)
this.$set(item, 'clearanceVolumeUnit', unit)
this.$set(item, 'allVolumeUnit', unit)
this.$set(item, 'weightUnit', unit)
})
}
},
submitForm() {
this.$refs["form"].validate(async (valid) => {
......
......@@ -88,6 +88,13 @@
<el-form-item :label="$t('单价模式')" prop="priceType">
<dict-selector :type="DICT_TYPE.ECW_PRICE_TYPE" v-model="form.priceType" form-type="radio" formatter="number" defaultable2 />
</el-form-item>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<!--阶梯定价-->
<template v-if="form.stepPrice==1" >
<div v-for="(item, index) in form.priceStepList" :key="index">
......@@ -130,14 +137,6 @@
</div>
</template>
<template v-else>
<el-form-item
:label="$t('最小起计量')"
:prop="`minWeight`"
>
<inputor default2="0" v-model.number="form.minWeight" type="number" class="w-100" :rules="{validator: priceValidator, trigger: 'blur', message: '数量错误'}"/>
/ <selector v-model="form.minWeightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" disabled />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" prop="allPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10 aaa" />
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr10" />
......@@ -543,6 +542,7 @@ export default {
this.$set(this.form, 'priceStepList', [{},{}])
}
this.syncAllUnit()
this.stepPrice = !!stepPrice
},
needPay(val){
this.$set(this.form, 'needPay', val ? 1 : 0)
......@@ -701,6 +701,13 @@ export default {
}
})
// 空命则阶梯订单
this.$nextTick(() => {
if(this.type == 'air'){
this.stepPrice = true
}
})
},
methods: {
// 同步全部单位
......
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