|
@@ -1,8 +1,8 @@
|
|
|
// 发布商品
|
|
|
const freightDefault = () =>{
|
|
|
return {
|
|
|
- id:'', // 运费模板Id
|
|
|
- freightId:'', // 运费规则的Id
|
|
|
+ id:'', // 运费规则的Id
|
|
|
+ freightId:'', // 运费模板Id
|
|
|
areaTax:'', // 运费规则地区名
|
|
|
ruleTax:'', // 运费规则文案
|
|
|
freightAreaList:[], // 运费规则地区id集合
|
|
@@ -78,7 +78,14 @@ const freightMixins = function () {
|
|
|
},
|
|
|
// 新增运费规则
|
|
|
handleAddRole(){
|
|
|
- this.freightRuleList.push(freightDefault())
|
|
|
+ this.rulesChecked = false
|
|
|
+ if(this.templateType === 'edit'){
|
|
|
+ let roul = {freightId:this.freightTemp.id}
|
|
|
+ let freight = { ...freightDefault(), ...roul }
|
|
|
+ this.freightRuleList.push(freight)
|
|
|
+ }else{
|
|
|
+ this.freightRuleList.push(freightDefault())
|
|
|
+ }
|
|
|
},
|
|
|
// 删除运费规则
|
|
|
handleDelRole(index){
|
|
@@ -150,6 +157,9 @@ const freightMixins = function () {
|
|
|
this.freightAreasType = type
|
|
|
this.areaRulesForm = freight
|
|
|
this.areaRulesIndex = index+1
|
|
|
+ if(this.templateType === 'edit'){
|
|
|
+ this.getFreightArea(freight.freightId,freight.id)
|
|
|
+ }
|
|
|
this.areasFormVisible = true
|
|
|
},
|
|
|
// 取消选择省市
|
|
@@ -370,8 +380,10 @@ const freightMixins = function () {
|
|
|
SupplierApi.saveFreightTemplate(params,function(response){
|
|
|
if(response.code === 0){
|
|
|
_this.$message({ message: '保存运费模板成功',type: 'success'});
|
|
|
- _this.getList()
|
|
|
_this.handleCanleFreights()
|
|
|
+ if(_this.pageType === 'list'){
|
|
|
+ _this.getList()
|
|
|
+ }
|
|
|
}else{
|
|
|
_this.$message({ message: `${response.msg}`,type: 'warning'});
|
|
|
}
|
|
@@ -410,6 +422,10 @@ const freightMixins = function () {
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
+ },
|
|
|
+ handleInput(e) {
|
|
|
+ // 通过正则过滤小数点后两位
|
|
|
+ e.target.value = (e.target.value.match(/^\d*(\.?\d{0,1})/g)[0]) || null
|
|
|
}
|
|
|
}
|
|
|
}
|