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

修复复制模板缺少特需价格的时候无法设置

parent 324cd867
......@@ -299,12 +299,12 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data)
this.$nextTick(async () => {
await this.$nextTick()
// 如果是空运,阶梯价格默认为1
if(this.type == 'air'){
this.$set(this.form, 'stepPrice', 1)
}
await this.$nextTick()
// 默认单位,空运千克,海运立方米
this.setDefaultVolumeUnit(this.type == 'air' ? 6 : 7)
......@@ -312,21 +312,23 @@ export default {
if(this.$route.query.templateId){
await this.getTemplateDetail(this.$route.query.templateId)
}
})
// 从价格中获取特需的默认单位
const obj = (this.form.stepPrice ? this.form.priceStepList[0] : this.form) || {}
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
// 没有的才push,已有的可能是从复制模板携带过来的数据
if(!this.form.specialList.find(special => special.specialDictType == item.value)) {
console.log('特需push', item.value)
this.form.specialList.push({
"clearancePrice": null,
"clearancePriceUnit": null,
"clearanceVolumeUnit": null,
"clearancePriceUnit": obj.clearancePriceUnit,
"clearanceVolumeUnit": obj.clearanceVolumeUnit,
"specialDictType": item.value,
"transportPrice": null,
"transportPriceUnit": null,
"transportVolumeUnit": null,
"transportPriceUnit": obj.transportPriceUnit,
"transportVolumeUnit": obj.transportVolumeUnit,
})
}
}else console.log('已存在特需', item.value)
})
......@@ -334,7 +336,7 @@ export default {
methods: {
// 获取模板数据(复制的源路线价格信息)
async getTemplateDetail(id){
await getProductPrice(id).then(res => {
const res = await getProductPrice(id)
// 填充商品、线路、价格信息、出货渠道(空运)
// this.form.productIdList = [res.data.productId]
this.selectedRoutes = [{
......@@ -396,7 +398,6 @@ export default {
getProduct(res.data.productId).then(res => {
this.$refs.productSelector.choose(res.data)
})
})
},
// 同步全部单位
syncAllUnit(){
......
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