|
|
@@ -329,7 +329,9 @@
|
|
|
:imgArr="fromValue.img"
|
|
|
@newimgarr="newimgarr1"
|
|
|
:imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
|
|
|
- :type="1"></upload-img>
|
|
|
+ :photoIdentifyType="fromValue.ifJzStoreType != 1 ? '1' : ''"
|
|
|
+ :type="1"
|
|
|
+ ref="uploadImgVStore"></upload-img>
|
|
|
</div>
|
|
|
</van-col>
|
|
|
<!-- 新建同城分销店不显示陈列照 -->
|
|
|
@@ -713,6 +715,7 @@ 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 store from '@/store';
|
|
|
export default {
|
|
|
name: 'storeAdd',
|
|
|
components: { uploadImg, uploadImgView, mapmarker, uploadImgc, deleteImgView },
|
|
|
@@ -864,6 +867,8 @@ export default {
|
|
|
this.dictTypeQGJZFormShow = false;
|
|
|
this.dictTypeSJSFormShow = false;
|
|
|
this.dictTypeFormShow = false;
|
|
|
+ // 拍照次数重置
|
|
|
+ store.dispatch('setShotsNum', 0);
|
|
|
},
|
|
|
watch: {
|
|
|
$route(to, from) {
|
|
|
@@ -931,11 +936,15 @@ export default {
|
|
|
this.getQGJZist();
|
|
|
this.getStreetQuery();
|
|
|
}
|
|
|
+ if (from.path == '/storeAdd') {
|
|
|
+ // 离开当前页面时,关闭弹框
|
|
|
+ if (this.$refs.uploadImgVStore) this.$refs.uploadImgVStore.close();
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
activated() {
|
|
|
this.tabVal = 'insidePlan';
|
|
|
- // this.beforeAddFn();
|
|
|
+ this.beforeAddFn();
|
|
|
// 授权
|
|
|
getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -1260,6 +1269,7 @@ export default {
|
|
|
} else {
|
|
|
this.fromValue.carShopImgList.push(val.fileUrl);
|
|
|
}
|
|
|
+ this.fromValue.businessId = val.businessId ? val.businessId : '';
|
|
|
},
|
|
|
getChainsByDeptId(deptCode, ifJzStoreType) {
|
|
|
getChainsByDeptCode({
|
|
|
@@ -1640,6 +1650,8 @@ export default {
|
|
|
this.fromValue.orgName = '';
|
|
|
this.fromValue.orgId = '';
|
|
|
this.fromValue.ifJzStoreType = value.ifJzStoreType;
|
|
|
+ // 重置拍摄照片
|
|
|
+ this.fromValue.img = '';
|
|
|
this.getChainsByDeptCode(null, value.ifJzStoreType);
|
|
|
// 切换门店类型删除选定经销商
|
|
|
this.treeSelect = [];
|
|
|
@@ -1700,11 +1712,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.fromValue.orderProductStoreList = arrList;
|
|
|
- let loading1 = this.$toast.loading({
|
|
|
- duration: 0,
|
|
|
- message: '加载中...',
|
|
|
- forbidClick: true,
|
|
|
- });
|
|
|
+ this.toastLoading(0, '上传中...', true);
|
|
|
var fromValue = this.fromValue;
|
|
|
var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
|
|
if (fromValue.orgId == '') {
|
|
|
@@ -1829,22 +1837,36 @@ export default {
|
|
|
this.$toast('经销商未填写');
|
|
|
return;
|
|
|
}
|
|
|
- // if (
|
|
|
- // fromValue.imgSed == '' &&
|
|
|
- // fromValue.ifJzStoreType != 1 &&
|
|
|
- // this.storeTypePOP &&
|
|
|
- // fromValue.storeCategory != 'C917'
|
|
|
- // ) {
|
|
|
- // this.$toast('图片未上传');
|
|
|
- // return;
|
|
|
- // }
|
|
|
}
|
|
|
if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
|
|
|
this.$toast('潜在客户类型未填写');
|
|
|
return;
|
|
|
}
|
|
|
+ // 同城分销建店添加去下单提示
|
|
|
+ if (
|
|
|
+ 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();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.addStoreFun();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 添加门店
|
|
|
+ addStoreFun() {
|
|
|
addStore(this.fromValue).then((res) => {
|
|
|
- loading1.clear();
|
|
|
+ this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
|
if (res.data.serverCode) {
|
|
|
this.fromValue.storeCode = res.data.sfaStore.storeCode;
|
|
|
@@ -1855,7 +1877,7 @@ export default {
|
|
|
) {
|
|
|
window.location.replace(res.data.orderUrl);
|
|
|
} else {
|
|
|
- that.$dialog
|
|
|
+ this.$dialog
|
|
|
.confirm({
|
|
|
title: '系统提示',
|
|
|
message: '建店成功,是否立即拜访?',
|
|
|
@@ -1876,42 +1898,42 @@ export default {
|
|
|
'/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
|
|
|
res.data.sfaStore.storeId +
|
|
|
'&lat=' +
|
|
|
- that.fromValue.lat +
|
|
|
+ this.fromValue.lat +
|
|
|
'&lon=' +
|
|
|
- that.fromValue.lon +
|
|
|
+ this.fromValue.lon +
|
|
|
'&addressLine=' +
|
|
|
- that.fromValue.addressLine +
|
|
|
+ this.fromValue.addressLine +
|
|
|
'&storeCategory=' +
|
|
|
res.data.sfaStore.storeCategory +
|
|
|
'&storeName=' +
|
|
|
- that.fromValue.storeName +
|
|
|
+ this.fromValue.storeName +
|
|
|
'&contactName=' +
|
|
|
- that.fromValue.contactName +
|
|
|
+ this.fromValue.contactName +
|
|
|
'&storeCode=' +
|
|
|
res.data.sfaStore.storeCode +
|
|
|
'&latNew=' +
|
|
|
- that.fromValue.lat +
|
|
|
+ this.fromValue.lat +
|
|
|
'&lonNew=' +
|
|
|
- that.fromValue.lon +
|
|
|
+ this.fromValue.lon +
|
|
|
'&marklat=' +
|
|
|
- that.mlan +
|
|
|
+ this.mlan +
|
|
|
'&marklon=' +
|
|
|
- that.mlon
|
|
|
+ this.mlon
|
|
|
);
|
|
|
} else {
|
|
|
- that.$dialog
|
|
|
+ this.$dialog
|
|
|
.alert({
|
|
|
title: '系统提示',
|
|
|
message: response.msg,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- that.$router.go(-1);
|
|
|
+ this.$router.go(-1);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- that.$router.go(-1);
|
|
|
+ this.$router.go(-1);
|
|
|
});
|
|
|
}
|
|
|
} else {
|