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

完善提单制作和路线价格,优惠bug

parent 2d4d6113
......@@ -187,8 +187,8 @@ export default {
}
const _left = (595.28-_w)/2;
doc.addImage(canvas, 'PNG', _left, 0, _w,_h, '', 'FAST');
doc.save("a4.pdf");
return Promise.reject()
/* doc.save("a4.pdf");
return Promise.reject() */
let form = new FormData()
form.append('file', new File([doc.output('arraybuffer')], Date.now() + '.pdf', {type: 'application/pdf'}))
return uploadFile(form)
......
......@@ -608,12 +608,12 @@ export default {
this.errTips = {}
let discountDetailedVOs = this.costType == 3 ? this.fee[3] : this.fee[1].concat(this.fee[2]).filter(item => item.netReceiptsAmount || item.fullAmount)
discountDetailedVOs.map(item => {
if(item.combUnit){
// 目前只有满减使用组合单位
if(this.form.type == 2 && item.combUnit){
// 满减需要 先删除单位,防止编辑的时候切换单位导致两个同时存在
if(this.form.type == 2){
delete item.fullCurrencyId
delete item.prodUnit
}
delete item.fullCurrencyId
delete item.prodUnit
let tmp = item.combUnit.split('_')
item[tmp[0]] = tmp[1]
}
......
......@@ -97,17 +97,17 @@
-
<el-input v-model="item.endNum" type="number" placeholder="" class="w-100"></el-input>
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
<el-form-item
......@@ -116,9 +116,9 @@
:prop="`priceStepList.${index}.allPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 ml-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable class="w-100" />
</el-form-item>
</div>
</template>
......@@ -336,6 +336,7 @@ export default {
checkList: [],
selectedRoutes: [], // 勾选的路线渠道
form: {
minWeightUnit: undefined,
priceStepList: [], // 阶梯价格
specialList: []
},
......@@ -428,6 +429,9 @@ export default {
}
this.syncAllUnit()
},
'form.minWeightUnit'(minWeightUnit){
console.log('最小其计量单位', minWeightUnit)
},
'form.transportVolumeUnit'(transportVolumeUnit){
// 最小其计量
this.$set(this.form, 'minWeightUnit', transportVolumeUnit)
......@@ -456,6 +460,14 @@ export default {
},
'form.stepPrice'(stepPrice){
if(stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
/* let def = {
weightUnit: this.unitList[0].id,
allPriceUnit: this.currencyList[0].id,
transportPriceUnit: this.currencyList[0].id,
transportVolumeUnit: this.unitList[0].id,
clearancePriceUnit: this.currencyList[0].id,
clearanceVolumeUnit: this.unitList[0].id,
} */
this.$set(this.form, 'priceStepList', [{},{}])
}
this.syncAllUnit()
......@@ -543,7 +555,8 @@ export default {
validateEndDate: undefined,
validateStartDate: undefined,
clearancePrice: 0,
transportPrice: 0
transportPrice: 0,
minWeightUnit: null
}
// 默认体积单位(立方米)
this.setDefaultVolumeUnit(7)
......
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