|
|
@@ -1867,89 +1867,107 @@ export default {
|
|
|
addStoreFun() {
|
|
|
addStore(this.fromValue).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
|
- if (res.code == 200) {
|
|
|
- if (res.data.serverCode) {
|
|
|
- this.fromValue.storeCode = res.data.sfaStore.storeCode;
|
|
|
- this.fromValue.storeId = res.data.sfaStore.storeId;
|
|
|
- if (
|
|
|
- res.data.orderUrl != null &&
|
|
|
- (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
|
|
|
- ) {
|
|
|
- window.location.replace(res.data.orderUrl);
|
|
|
- } else {
|
|
|
- this.$dialog
|
|
|
- .confirm({
|
|
|
- title: '系统提示',
|
|
|
- message: '建店成功,是否立即拜访?',
|
|
|
- confirmButtonText: '立即拜访',
|
|
|
- cancelButtonText: '返回上一页',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
|
|
|
- localStorage.setItem('startTime', new Date());
|
|
|
- localStorage.setItem('ORGName', this.fromValue.deptName);
|
|
|
- localStorage.setItem('chainNameR', this.fromValue.storeName);
|
|
|
- if (response.code == 200) {
|
|
|
+ // 门店重复判断
|
|
|
+ if (true) {
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '门店已存在',
|
|
|
+ message: `res.message`,
|
|
|
+ confirmButtonText: '维护',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // 重复门店增加经销商
|
|
|
+ this.$router.push({
|
|
|
+ path: '/chainMaintain',
|
|
|
+ query: { id: 'res.id' },
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ if (res.code == 200) {
|
|
|
+ if (res.data.serverCode) {
|
|
|
+ this.fromValue.storeCode = res.data.sfaStore.storeCode;
|
|
|
+ this.fromValue.storeId = res.data.sfaStore.storeId;
|
|
|
+ if (
|
|
|
+ res.data.orderUrl != null &&
|
|
|
+ (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
|
|
|
+ ) {
|
|
|
+ window.location.replace(res.data.orderUrl);
|
|
|
+ } else {
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '系统提示',
|
|
|
+ message: '建店成功,是否立即拜访?',
|
|
|
+ confirmButtonText: '立即拜访',
|
|
|
+ cancelButtonText: '返回上一页',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
|
|
|
localStorage.setItem('startTime', new Date());
|
|
|
- localStorage.setItem('ORGName', res.data.sfaStore.deptName);
|
|
|
- localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
|
|
|
- window.location.replace(
|
|
|
- window.location.origin +
|
|
|
- '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
|
|
|
- res.data.sfaStore.storeId +
|
|
|
- '&lat=' +
|
|
|
- this.fromValue.lat +
|
|
|
- '&lon=' +
|
|
|
- this.fromValue.lon +
|
|
|
- '&addressLine=' +
|
|
|
- this.fromValue.addressLine +
|
|
|
- '&storeCategory=' +
|
|
|
- res.data.sfaStore.storeCategory +
|
|
|
- '&storeName=' +
|
|
|
- this.fromValue.storeName +
|
|
|
- '&contactName=' +
|
|
|
- this.fromValue.contactName +
|
|
|
- '&storeCode=' +
|
|
|
- res.data.sfaStore.storeCode +
|
|
|
- '&latNew=' +
|
|
|
- this.fromValue.lat +
|
|
|
- '&lonNew=' +
|
|
|
- this.fromValue.lon +
|
|
|
- '&marklat=' +
|
|
|
- this.mlan +
|
|
|
- '&marklon=' +
|
|
|
- this.mlon
|
|
|
- );
|
|
|
- } else {
|
|
|
- this.$dialog
|
|
|
- .alert({
|
|
|
- title: '系统提示',
|
|
|
- message: response.msg,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- this.$router.go(-1);
|
|
|
- });
|
|
|
- }
|
|
|
+ localStorage.setItem('ORGName', this.fromValue.deptName);
|
|
|
+ localStorage.setItem('chainNameR', this.fromValue.storeName);
|
|
|
+ if (response.code == 200) {
|
|
|
+ localStorage.setItem('startTime', new Date());
|
|
|
+ localStorage.setItem('ORGName', res.data.sfaStore.deptName);
|
|
|
+ localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
|
|
|
+ window.location.replace(
|
|
|
+ window.location.origin +
|
|
|
+ '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
|
|
|
+ res.data.sfaStore.storeId +
|
|
|
+ '&lat=' +
|
|
|
+ this.fromValue.lat +
|
|
|
+ '&lon=' +
|
|
|
+ this.fromValue.lon +
|
|
|
+ '&addressLine=' +
|
|
|
+ this.fromValue.addressLine +
|
|
|
+ '&storeCategory=' +
|
|
|
+ res.data.sfaStore.storeCategory +
|
|
|
+ '&storeName=' +
|
|
|
+ this.fromValue.storeName +
|
|
|
+ '&contactName=' +
|
|
|
+ this.fromValue.contactName +
|
|
|
+ '&storeCode=' +
|
|
|
+ res.data.sfaStore.storeCode +
|
|
|
+ '&latNew=' +
|
|
|
+ this.fromValue.lat +
|
|
|
+ '&lonNew=' +
|
|
|
+ this.fromValue.lon +
|
|
|
+ '&marklat=' +
|
|
|
+ this.mlan +
|
|
|
+ '&marklon=' +
|
|
|
+ this.mlon
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$dialog
|
|
|
+ .alert({
|
|
|
+ title: '系统提示',
|
|
|
+ message: response.msg,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$router.go(-1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$router.go(-1);
|
|
|
});
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$router.go(-1);
|
|
|
- });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.fromValue.storeCode = res.data.sfaStore.storeCode;
|
|
|
+ this.fromValue.storeId = res.data.sfaStore.storeId;
|
|
|
+ this.$dialog.alert({
|
|
|
+ title: '系统提示',
|
|
|
+ message: res.data.serverMsg,
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
- this.fromValue.storeCode = res.data.sfaStore.storeCode;
|
|
|
- this.fromValue.storeId = res.data.sfaStore.storeId;
|
|
|
this.$dialog.alert({
|
|
|
title: '系统提示',
|
|
|
- message: res.data.serverMsg,
|
|
|
+ message: res.msg,
|
|
|
+ messageAlign: 'left',
|
|
|
});
|
|
|
}
|
|
|
- } else {
|
|
|
- this.$dialog.alert({
|
|
|
- title: '系统提示',
|
|
|
- message: res.msg,
|
|
|
- messageAlign: 'left',
|
|
|
- });
|
|
|
}
|
|
|
});
|
|
|
},
|