Commit 1fa8a603 authored by dragondean@qq.com's avatar dragondean@qq.com

修改线路的时候提示商品和线路数量

parent be1c7349
<template>
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<products-selector v-model="form.productIdList" show-all @setall="isAllProduct=$event" class="mb-20" />
<products-selector ref="productSelector" v-model="form.productIdList" show-all @setall="isAllProduct=$event" class="mb-20" />
<routers-selector v-model="selectedRoutes" />
......@@ -377,7 +377,10 @@ export default {
if(data.lineChannelList.length < 1){
return this.$message.error(this.$t('请选择需要修改的路线'))
}
await this.$confirm(this.$t('已选择{n}条路线,确认提交修改?', {n: data.lineChannelList.length}))
await this.$confirm(this.$t('已选择{route}条路线,{product}个商品;确认提交修改?', {
route: data.lineChannelList.length,
product: this.isAllProduct ? this.$refs.productSelector.allTotal : this.form.productIdList.length
}))
this.loading = true
batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("修改成功"));
......
......@@ -702,7 +702,7 @@ export default {
},
// force 为是否强制提交,在价格过期的时候需要确认后强制提交
submitForm(force = false) {
this.$refs["form"].validate(valid => {
this.$refs["form"].validate(async (valid) => {
if (!valid) {
return;
}
......@@ -768,6 +768,8 @@ export default {
}
}
// 修改单条路线
if (this.$route.query.action == 'update') {
this.loading = true
......@@ -806,6 +808,7 @@ export default {
if(data.lineChannelList.length < 1){
return this.$message.error(this.$t('请选择需要修改的路线'))
}
await this.$confirm(this.t("已选择{route}条路线,确认提交?", {route: data.lineChannelList.length}))
data.productIdList = [this.form.productId]
this.loading = true
batchUpdateProductPrice(data).then(response => {
......@@ -815,9 +818,12 @@ export default {
return;
}
// 添加的提交
if(!this.product){
return this.$message.error(this.$t('请选择商品'))
}
data.productId = this.product.id;
data.lineChannelList = this.lineList.length ? this.lineList : this.selectedRoutes
await this.$confirm(this.$t("已选择{route}条路线,确认提交?", {route: data.lineChannelList.length}))
this.loading = true
createProductPrice(data).then(response => {
this.$modal.msgSuccess(this.$t("请求成功"));
......
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