|
|
@@ -714,7 +714,7 @@ import txmapimg1 from '@/assets/txmap1.svg';
|
|
|
import txmapimg2 from '@/assets/txmap2.svg';
|
|
|
import txmapimg3 from '@/assets/marker_blue.png';
|
|
|
import { getPosition, getTicketFun } from '@/utils/TXApiFun';
|
|
|
-import { listChainsByCategory } from '@/api/store';
|
|
|
+import { listChainsByCategory, checkStoreBeforeAdd } from '@/api/store';
|
|
|
import store from '@/store';
|
|
|
export default {
|
|
|
name: 'storeAdd',
|
|
|
@@ -1847,18 +1847,40 @@ export default {
|
|
|
this.verifyStoreType(this.fromValue.storeCategory) &&
|
|
|
this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
|
|
|
) {
|
|
|
- this.toastLoading().clear();
|
|
|
- this.$dialog
|
|
|
- .confirm({
|
|
|
- title: '系统提示',
|
|
|
- message: `该门店类型为<span style="color:red">同城分销店</span>,<br/>首笔订单最低金额:<span style="color:red">1000元</span>`,
|
|
|
- confirmButtonText: '去下单',
|
|
|
- cancelButtonText: '修改门店信息',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.toastLoading(0, '上传中...', true);
|
|
|
- this.addStoreFun();
|
|
|
- });
|
|
|
+ // 门店重复判断
|
|
|
+ checkStoreBeforeAdd(this.fromValue).then((res) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ // type 1=不重复;2=重复不让修改;3=重复可扩展
|
|
|
+ // store type=3时有值
|
|
|
+ if (res.data.type == 3) {
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '门店已存在',
|
|
|
+ message: res.data.message,
|
|
|
+ confirmButtonText: '维护',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // 重复门店增加经销商
|
|
|
+ this.$router.push({
|
|
|
+ path: '/chainMaintain',
|
|
|
+ query: { id: res.data.store.id },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else if (res.data.type == 2 || res.data.type == 1) {
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '系统提示',
|
|
|
+ message: `该门店类型为<span style="color:red">同城分销店</span>,<br/>首笔订单最低金额:<span style="color:red">1000元</span>`,
|
|
|
+ confirmButtonText: '去下单',
|
|
|
+ cancelButtonText: '修改门店信息',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.toastLoading(0, '上传中...', true);
|
|
|
+ this.addStoreFun();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
this.addStoreFun();
|
|
|
}
|
|
|
@@ -1945,26 +1967,11 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- // 门店重复判断
|
|
|
- this.$dialog
|
|
|
- .confirm({
|
|
|
- title: '门店已存在',
|
|
|
- message: `res.message`,
|
|
|
- confirmButtonText: '维护',
|
|
|
- cancelButtonText: '取消',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // 重复门店增加经销商
|
|
|
- this.$router.push({
|
|
|
- path: '/chainMaintain',
|
|
|
- query: { id: 'res.id' },
|
|
|
- });
|
|
|
- });
|
|
|
- // this.$dialog.alert({
|
|
|
- // title: '系统提示',
|
|
|
- // message: res.msg,
|
|
|
- // messageAlign: 'left',
|
|
|
- // });
|
|
|
+ this.$dialog.alert({
|
|
|
+ title: '系统提示',
|
|
|
+ message: res.msg,
|
|
|
+ messageAlign: 'left',
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|