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

优化路线价格编辑

parent e52f3d9c
......@@ -13,7 +13,7 @@
<el-checkbox label="" @change="form.stepPrice=$event ? 1 : 0">{{$t('阶梯订单')}}</el-checkbox>
</span>
</div>
<el-form-item :label="$t('预付')" prop="needPay" v-if="$route.query.action == 'batchUpdate'" >
<el-form-item :label="$t('预付')" prop="needPay" >
<el-radio-group v-model="form.needPay">
<el-radio :label="1">预付</el-radio>
<el-radio :label="0">均可</el-radio>
......@@ -193,7 +193,7 @@
</el-form>
<div style="margin: 20px 0">
<el-button @click="submitForm" type="primary">{{$t('确认提交')}}</el-button>
<el-button @click="submitForm" type="primary" :loading="loading">{{$t('确认提交')}}</el-button>
<el-button type="default" @click="$router.back()">{{$t('返回上一页')}}</el-button>
</div>
</div>
......@@ -244,7 +244,8 @@ export default {
unitList: [],
productTypeList: [],
productDisabled: true,
lineList: [] //路线数组
lineList: [], //路线数组
loading: false
}
},
computed: {
......@@ -384,10 +385,12 @@ export default {
if(data.lineChannelList.length < 1){
return this.$message.error(this.$t('请选择需要修改的路线'))
}
this.loading = true
batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.replace('/lineProject/product-price?' + (new URLSearchParams(this.$route.query)).toString())
})
.finally(res => this.loading = false)
});
},
}
......
......@@ -200,7 +200,7 @@
</el-form>
<div style="margin: 20px 0">
<el-button @click="submitForm" type="primary" v-if="!readonly">{{$t('确认提交')}}</el-button>
<el-button @click="submitForm" type="primary" v-if="!readonly" :loading="loading">{{$t('确认提交')}}</el-button>
<el-button type="default" @click="$router.back()">{{$t('返回上一页')}}</el-button>
</div>
</div>
......@@ -247,7 +247,8 @@ export default {
productTypeList: [],
productDisabled: true,
readonly: false,
lineList: [] //路线数组
lineList: [], //路线数组
loading: false
}
},
computed: {
......@@ -461,10 +462,11 @@ export default {
// 修改单条路线
if (this.$route.query.action == 'update') {
this.loading = true
return updateProductPrice(data).then(res => {
this.$modal.msgSuccess(this.$t("请求成功"));
this.$router.back()
})
}).finally(res => this.loading = false)
}
// 批量修改(单个商品的单个路线,多个路线,或者全部路线)的提交
......@@ -497,10 +499,11 @@ export default {
return this.$message.error(this.$t('请选择需要修改的路线'))
}
data.productIdList = [this.form.productId]
this.loading = true
batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("修改成功"));
this.$router.replace('/product/product-price?' + (new URLSearchParams(this.$route.query)).toString())
})
}).finally(res => this.loading = false)
return;
}
// 添加的提交
......@@ -510,10 +513,11 @@ export default {
if((this.form.priceType == 0 && !this.form.transportPrice) || (this.form.priceType == 1 && !this.form.allPrice)){
return this.$message.error(this.$t('运费/全包价不能为0'))
}
this.loading = true
createProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("请求成功"));
this.$router.replace('/product/product-price?' + (new URLSearchParams(this.$route.query)).toString())
});
}).finally(res => this.loading = false);
});
},
}
......
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