Commit 193a30d5 authored by dragondean@qq.com's avatar dragondean@qq.com

空运默认千克

parent 98716d07
...@@ -443,7 +443,7 @@ export default { ...@@ -443,7 +443,7 @@ export default {
currencyAndUnit(){ currencyAndUnit(){
let currency = null, unit = null, fields = null let currency = null, unit = null, fields = null
// 如果是阶梯价格则取第一阶梯,否则就取form中的字段 // 如果是阶梯价格则取第一阶梯,否则就取form中的字段
let obj = this.form.stepPrice == 1 ? this.form.priceStepList[0] : this.form let obj = this.form.stepPrice == 1 ? (this.form.priceStepList[0] || {}) : this.form
// 全包价 // 全包价
if(this.form.priceType == 1){ if(this.form.priceType == 1){
currency = obj.allPriceUnit currency = obj.allPriceUnit
...@@ -508,7 +508,7 @@ export default { ...@@ -508,7 +508,7 @@ export default {
this.syncAllUnit() this.syncAllUnit()
}, },
'form.minWeightUnit'(minWeightUnit){ 'form.minWeightUnit'(minWeightUnit){
console.log('最小计量单位', minWeightUnit) console.log('最小计量单位', minWeightUnit)
}, },
'form.transportVolumeUnit'(transportVolumeUnit){ 'form.transportVolumeUnit'(transportVolumeUnit){
// 最小其计量 // 最小其计量
...@@ -629,6 +629,7 @@ export default { ...@@ -629,6 +629,7 @@ export default {
advanceStatus: 0, advanceStatus: 0,
needBook: 0, needBook: 0,
specialList: [], specialList: [],
priceStepList: this.type === 'air' ? [{},{}] : [],
// dayLimit: 10000, // dayLimit: 10000,
validateEndDate: undefined, validateEndDate: undefined,
validateStartDate: undefined, validateStartDate: undefined,
...@@ -639,10 +640,17 @@ export default { ...@@ -639,10 +640,17 @@ export default {
// 是否单询,默认否 // 是否单询,默认否
needOrderInquiry: 0 needOrderInquiry: 0
} }
// 默认体积单位(立方米) this.$nextTick(() => {
this.setDefaultVolumeUnit(7) // 默认体积单位,空运为千克,海运为立方米
// 默认货币单位(美元) this.setDefaultVolumeUnit(this.type === 'air' ? 6 : 7)
this.setDefaultPriceUnit(1) // 默认货币单位(美元)
this.setDefaultPriceUnit(1)
// 空运默认的阶梯重量单位是千克
if(this.type === 'air'){
this.$set(this.form.priceStepList[0], 'weightUnit', 6)
}
})
this.form.validateStartDate = parseTime(Date.now()) this.form.validateStartDate = parseTime(Date.now())
this.form.validateEndDate = parseTime(Date.now() + 86400*365*2*1000) this.form.validateEndDate = parseTime(Date.now() + 86400*365*2*1000)
...@@ -678,21 +686,6 @@ export default { ...@@ -678,21 +686,6 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data) getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data) getUnitList().then(res => this.unitList = res.data)
/* if(!this.form.specialList || !this.form.specialList.length){
console.log('specialList默认给[]')
this.$set(this.form, 'specialList', [])
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
this.form.specialList.push({
"clearancePrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"clearancePriceUnit": null,
"clearanceVolumeUnit": null,
"specialDictType": item.value,
"transportPrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"transportPriceUnit": null,
"transportVolumeUnit": null,
})
})
} */
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => { this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
if(!this.form.specialList.find(special => special.specialDictType == item.value)){ if(!this.form.specialList.find(special => special.specialDictType == item.value)){
this.form.specialList.push({ this.form.specialList.push({
...@@ -705,7 +698,6 @@ export default { ...@@ -705,7 +698,6 @@ export default {
"transportVolumeUnit": null, "transportVolumeUnit": null,
}) })
} }
}) })
}, },
...@@ -733,7 +725,7 @@ export default { ...@@ -733,7 +725,7 @@ export default {
if(this.form.stepPrice == 1){ if(this.form.stepPrice == 1){
fields['weightUnit'] = obj.weightUnit fields['weightUnit'] = obj.weightUnit
} }
console.log('-> 同步特需单位', fields)
this.syncSpecialUnit(fields) this.syncSpecialUnit(fields)
}, },
// 同步特需的货币单位和体积单位 // 同步特需的货币单位和体积单位
...@@ -746,7 +738,7 @@ export default { ...@@ -746,7 +738,7 @@ export default {
}) })
// 如果是阶梯价则需要同步其他阶梯 // 如果是阶梯价则需要同步其他阶梯
if(this.form.stepPrice == 1){ if(this.form.stepPrice == 1 && this.form.priceStepList){
this.form.priceStepList.forEach((item, index) => { this.form.priceStepList.forEach((item, index) => {
this.$set(this.form.priceStepList, index, Object.assign(item, obj)) this.$set(this.form.priceStepList, index, Object.assign(item, obj))
}) })
...@@ -766,11 +758,13 @@ export default { ...@@ -766,11 +758,13 @@ export default {
callback() callback()
}, },
setDefaultVolumeUnit(unit){ setDefaultVolumeUnit(unit){
console.log('设置默认体积单位', unit)
this.$set(this.form, 'transportVolumeUnit', unit) this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit) this.$set(this.form, 'clearanceVolumeUnit', unit)
this.$set(this.form, 'allVolumeUnit', unit) this.$set(this.form, 'allVolumeUnit', unit)
}, },
setDefaultPriceUnit(priceUnit){ setDefaultPriceUnit(priceUnit){
console.log('设置默认价格单位', priceUnit)
this.$set(this.form, 'transportPriceUnit', priceUnit) this.$set(this.form, 'transportPriceUnit', priceUnit)
this.$set(this.form, 'clearancePriceUnit', priceUnit) this.$set(this.form, 'clearancePriceUnit', priceUnit)
this.$set(this.form, 'allPriceUnit', priceUnit) this.$set(this.form, 'allPriceUnit', priceUnit)
......
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