storeDetail.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663
  1. <template>
  2. <div>
  3. <div class="navBarTOP">
  4. <!-- 顶部条 -->
  5. <van-nav-bar class="navBar" title="客户详情" left-arrow @click-left="onClickLeft">
  6. <template #right>
  7. <span
  8. style="color: #0057ba"
  9. v-if="list.updatable && list.validFlag == 2"
  10. @click="placeOrderFn"
  11. >去下单</span
  12. >
  13. <span
  14. style="color: #0057ba"
  15. v-if="list.updatable && list.validFlag != 2 && type != 'address'"
  16. @click="editorFn"
  17. >编辑</span
  18. >
  19. </template>
  20. </van-nav-bar>
  21. </div>
  22. <!--主体内容-->
  23. <div style="margin-top: 44px" v-if="pageShow">
  24. <van-dialog title="门店位置">
  25. <mapmarker :info="list"></mapmarker>
  26. </van-dialog>
  27. <van-tabs class="myTab" v-model="tabVal" color="#0057ba" @change="tabChange">
  28. <van-tab title="基础信息" name="insidePlan" ref="dispsps">
  29. <van-field readonly v-model="list.storeCode" label="编号" />
  30. <van-field readonly v-if="DIYshow" v-model="list.attribute1" label="DIY编号" />
  31. <van-field readonly v-model="list.storeName" :label="storeName" />
  32. <van-field readonly v-model="list.storeCategoryName" label="类型" />
  33. <van-field
  34. readonly
  35. v-if="type != 'address'"
  36. rows="1"
  37. autosize
  38. type="textarea"
  39. v-model="list.addressLine"
  40. :label="address" />
  41. <van-field
  42. v-if="type == 'address'"
  43. rows="1"
  44. autosize
  45. type="textarea"
  46. v-model="list.addressLine"
  47. :label="address">
  48. <template #button>
  49. <van-button size="small" type="info" @click="fns"
  50. ><van-icon name="location-o" />地图</van-button
  51. >
  52. </template>
  53. </van-field>
  54. <van-field v-model="list.lat" readonly label="经度" placeholder="经度" />
  55. <van-field readonly v-model="list.lon" label="维度" />
  56. <van-field readonly v-model="list.orgName" label="销售部" />
  57. <van-field readonly v-model="list.provinceName" label="省(州)" @click="provinceFN">
  58. <template #button>
  59. <van-icon name="arrow" v-if="type == 'address'" />
  60. </template>
  61. </van-field>
  62. <van-field readonly v-model="list.cityName" label="城市" @click="cityFN">
  63. <template #button>
  64. <van-icon name="arrow" v-if="type == 'address'" />
  65. </template>
  66. </van-field>
  67. <van-field readonly v-model="list.districtName" label="区(县)" @click="districtFN">
  68. <template #button>
  69. <van-icon name="arrow" v-if="type == 'address'" />
  70. </template>
  71. </van-field>
  72. <van-field readonly v-model="list.townName" label="街道" @click="towntFN">
  73. <template #button>
  74. <van-icon name="arrow" v-if="type == 'address'" />
  75. </template>
  76. </van-field>
  77. <van-field readonly v-model="list.cityLevel" label="城市等级" />
  78. <van-field
  79. readonly
  80. v-if="list.ifJzStoreType != 1 && list.storeCategory != 'C917'"
  81. v-model="list.contactName"
  82. label="联系人" />
  83. <van-field
  84. readonly
  85. v-if="list.ifJzStoreType == 1 && list.storeCategory != 'C917'"
  86. v-model="list.contactName"
  87. label="老板" />
  88. <van-field
  89. readonly
  90. v-model="list.telephone"
  91. label="联系电话"
  92. v-if="list.storeCategory != 'C917'" />
  93. <van-field
  94. readonly
  95. v-model="list.chainCode"
  96. label="经销商编号"
  97. v-if="list.storeCategory != 'C917'" />
  98. <van-field
  99. readonly
  100. v-model="list.chainName"
  101. label="经销商名称"
  102. v-if="list.storeCategory != 'C917'" />
  103. <van-field readonly v-model="list.salesmanName" label="销售员" />
  104. <div v-if="list.storeCategory != 'C917'">
  105. <van-field
  106. readonly
  107. v-model="list.area"
  108. v-if="list.ifJzStoreType != 1"
  109. label="面积(m²)" />
  110. <van-field
  111. readonly
  112. v-model="list.area"
  113. v-if="list.ifJzStoreType == 1"
  114. label="家装展厅面积(m²)" />
  115. </div>
  116. <van-field
  117. readonly
  118. v-if="GZAttributeFormShow"
  119. label="潜在客户类型"
  120. v-model="list.potentialCustomerType" />
  121. <van-field readonly v-if="list.carShop" label="是否车铺开店">
  122. <template #input>
  123. <span v-if="list.carShop == 1">是</span>
  124. <span v-if="list.carShop == 0">否</span>
  125. </template>
  126. </van-field>
  127. <div v-if="list.carShopImgList != null && list.carShop == 1">
  128. <p style="padding: 0 16px">车铺照片(店招及车铺产品拍在一张照片里)</p>
  129. <viewUploadImg :imgs="list.carShopImgList"></viewUploadImg>
  130. </div>
  131. <van-row
  132. gutter="20"
  133. style="padding: 16px"
  134. v-if="list.img != null && list.storeCategory != 'C917'">
  135. <van-col span="12">
  136. <div v-if="storeTypePOP">
  137. <van-image
  138. width="100%"
  139. height="160"
  140. :src="list.img"
  141. @click="deleteImgs(list.img)" />
  142. <p style="text-align: center">
  143. {{ list.ifJzStoreType != 1 ? "门店照" : "家装前台照片" }}
  144. </p>
  145. </div>
  146. <div v-else>
  147. <van-image
  148. width="100%"
  149. height="160"
  150. :src="list.img"
  151. @click="deleteImgs(list.img)" />
  152. <p style="text-align: center">
  153. {{ list.storeCategory == "C912" ? "工地铭牌照片" : "公司照片" }}
  154. </p>
  155. </div>
  156. </van-col>
  157. <van-col span="12" v-if="list.ifJzStoreType != 1">
  158. <div v-if="storeTypePOP">
  159. <van-image
  160. width="100%"
  161. height="160"
  162. :src="list.imgSed"
  163. @click="deleteImgs(list.imgSed)" />
  164. <p style="text-align: center">
  165. {{ list.ifJzStoreType != 1 ? "陈列照" : "立邦展厅照片" }}
  166. </p>
  167. </div>
  168. </van-col>
  169. </van-row>
  170. <van-row gutter="20" style="padding: 16px" v-if="type == 'address'">
  171. <van-col
  172. span="12"
  173. v-if="
  174. list.storeCategory == '35' ||
  175. list.storeCategory == '36' ||
  176. list.storeCategory == '37' ||
  177. list.storeCategory == '38' ||
  178. list.storeCategory == '91'
  179. ">
  180. <upload-img
  181. :uploadid="uploadid2"
  182. :imgArr="img"
  183. @newimgarr="newimgarr1"
  184. imgText="店招照片"
  185. :type="1"></upload-img>
  186. </van-col>
  187. </van-row>
  188. </van-tab>
  189. <van-tab title="属性信息" name="outsidePlan">
  190. <van-field readonly label="属性" v-if="dictTypeFormShow" v-model="list.tcfxName" />
  191. </van-tab>
  192. </van-tabs>
  193. <!--省、市、区、街道-->
  194. <van-popup v-model="provinceShow" position="bottom">
  195. <van-picker
  196. show-toolbar
  197. title="省(州)"
  198. :columns="provinceList"
  199. @confirm="onProvinceConfirm"
  200. @cancel="provinceShow = false" />
  201. </van-popup>
  202. <van-popup v-model="cityShow" position="bottom">
  203. <van-picker
  204. show-toolbar
  205. title="城市"
  206. :columns="cityList"
  207. @confirm="onCityConfirm"
  208. @cancel="cityShow = false" />
  209. </van-popup>
  210. <van-popup v-model="districtShow" position="bottom">
  211. <van-picker
  212. show-toolbar
  213. title="县区"
  214. :columns="districtList"
  215. @confirm="onDistrictConfirm"
  216. @cancel="districtShow = false" />
  217. </van-popup>
  218. <van-popup v-model="towntShow" position="bottom">
  219. <van-picker
  220. show-toolbar
  221. title="街道"
  222. :columns="townList"
  223. @confirm="onTownConfirm"
  224. @cancel="towntShow = false" />
  225. </van-popup>
  226. <br />
  227. <br />
  228. <br />
  229. <br />
  230. <br />
  231. <br />
  232. <div
  233. style="
  234. position: fixed;
  235. bottom: 0;
  236. width: 100%;
  237. padding: 14px;
  238. background-color: white;
  239. border-top: 1px solid #eee;
  240. "
  241. v-if="type">
  242. <van-row gutter="20">
  243. <van-col
  244. span="12"
  245. v-if="
  246. list.storeCategory != '35' &&
  247. list.storeCategory != '36' &&
  248. list.storeCategory != '37' &&
  249. list.storeCategory != '38' &&
  250. list.storeCategory != '91'
  251. "
  252. ><van-button round type="default" style="width: 100%" @click="valid"
  253. >无效关店</van-button
  254. ></van-col
  255. >
  256. <van-col
  257. span="12"
  258. v-if="
  259. list.storeCategory != '35' &&
  260. list.storeCategory != '36' &&
  261. list.storeCategory != '37' &&
  262. list.storeCategory != '38' &&
  263. list.storeCategory != '91'
  264. "
  265. ><van-button
  266. round
  267. type="info"
  268. style="width: 100%; background-color: #0057ba"
  269. @click="updateStoreAddress"
  270. >提交</van-button
  271. ></van-col
  272. >
  273. <van-col
  274. span="24"
  275. v-if="
  276. list.storeCategory == '35' ||
  277. list.storeCategory == '36' ||
  278. list.storeCategory == '37' ||
  279. list.storeCategory == '38' ||
  280. list.storeCategory == '91'
  281. "
  282. ><van-button
  283. round
  284. type="info"
  285. style="width: 100%; background-color: #0057ba"
  286. @click="updateStoreAddress"
  287. >提交</van-button
  288. ></van-col
  289. >
  290. </van-row>
  291. </div>
  292. <van-dialog
  293. v-model="showDialog"
  294. title="系统提示"
  295. show-cancel-button
  296. :show-confirm-button="false">
  297. <p v-if="!Array.isArray(msgList)" style="padding: 10px 14px; margin: 0">
  298. {{ msgList }}
  299. </p>
  300. <div style="max-height: 400px; overflow-y: auto" v-if="Array.isArray(msgList)">
  301. <p
  302. style="border-bottom: 1px solid #f5f5f5; padding: 10px 14px; margin: 0"
  303. v-for="(item, index) in msgList"
  304. :key="index">
  305. {{ item }}
  306. </p>
  307. </div>
  308. </van-dialog>
  309. <div style="position: fixed; top: 0; height: 100%; z-index: 3000; width: 100%" v-if="showmap">
  310. <div id="allmap1" style="height: 100%; width: 100%"></div>
  311. <div
  312. style="position: fixed; z-index: 99999; top: 0; width: 100%; background-color: white"
  313. v-if="showmap">
  314. <form action="/">
  315. <van-search
  316. v-model="searchValue"
  317. left-icon="search"
  318. @input="searchFn"
  319. placeholder="请输入搜索关键词">
  320. <!-- <template #action>
  321. <div @click="searchFn">搜索</div>
  322. </template> -->
  323. </van-search>
  324. </form>
  325. <div style="height: 200px; overflow: hidden" v-if="searchSHow">
  326. <div style="height: 100px; min-height: 200px; overflow-y: scroll; padding: 12px">
  327. <div
  328. v-for="(itme, index) in mapsearchlist"
  329. style="border-bottom: 1px solid #eee"
  330. @click="addressFn(itme)">
  331. <p>{{ itme.title }}</p>
  332. <p>{{ itme.address }}</p>
  333. <p>距离:{{ itme._distance }}米</p>
  334. </div>
  335. </div>
  336. </div>
  337. </div>
  338. <div class="mapaddress" v-if="showmap">
  339. <div class="title">
  340. <span @click="showmap = false" style="float: left"
  341. ><van-icon name="cross" size="16"
  342. /></span>
  343. <p class="titleText">附近地址信息</p>
  344. <span style="float: right" @click="confirmMap">确定</span>
  345. </div>
  346. <div class="listBox">
  347. <van-radio-group v-model="addresssb" @change="mapselect" v-if="shows">
  348. <van-radio :name="index" v-for="(item, index) in maplist" :key="index"
  349. ><p style="margin: 4px 0; font-weight: bold">
  350. {{ item.title }}
  351. </p>
  352. <p style="margin: 4px 0">{{ item.address }}</p>
  353. <p style="margin: 4px 0">距离:{{ item._distance }}米</p>
  354. </van-radio>
  355. </van-radio-group>
  356. <br />
  357. <br />
  358. <br />
  359. <br />
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. <div class="helpPageMask" v-if="helpPageFlag">
  365. <helpPage @btnClick="btnClick"></helpPage>
  366. </div>
  367. </div>
  368. </template>
  369. <script>
  370. import { ImagePreview } from "vant";
  371. import {
  372. getById,
  373. getStoreTypeList,
  374. updateStore,
  375. getStoreyslTypeList,
  376. getTCFXList,
  377. addStore,
  378. checkVisit,
  379. getSJSList,
  380. getQGJZist,
  381. getCustomerInfoList,
  382. getCustomerNatureList,
  383. getMainProjectList,
  384. getMainRelationList,
  385. getManagementModelList,
  386. getpotentialCustomerTypeList,
  387. streetQuery,
  388. } from "@/api/index";
  389. import mapmarker from "@/components/mapMarker";
  390. import viewUploadImg from "@/components/viewUploadImg";
  391. import txmapimg1 from "@/assets/txmap1.svg";
  392. import txmapimg2 from "@/assets/txmap2.svg";
  393. import txmapimg3 from "@/assets/marker_blue.png";
  394. import axios from "axios";
  395. import { updateStoreAddress, valid } from "@/api/visitstore";
  396. import uploadImg from "@/components/viewaddreddUploadImg.vue";
  397. import helpPage from "./helpPage.vue";
  398. import { getPosition, getMapPoi, getkeywordPoi } from "@/utils/getPosition";
  399. export default {
  400. components: { uploadImg, mapmarker, viewUploadImg, helpPage },
  401. data() {
  402. return {
  403. addresssb: "",
  404. searchSHow: false,
  405. uploadid2: "uploadid2",
  406. shows: true,
  407. searchValue: "",
  408. tabVal: "insidePlan",
  409. showDialog: false,
  410. msgList: "",
  411. list: [],
  412. provinceList: [],
  413. txmapimg1: txmapimg1,
  414. txmapimg2: txmapimg2,
  415. txmapimg3: txmapimg3,
  416. cityList: [],
  417. districtList: [],
  418. maplist: [],
  419. townList: [],
  420. storeId: "",
  421. vaue: "",
  422. show: false,
  423. storeTypeList: [],
  424. ManagementModelList: [],
  425. MainRelationList: [],
  426. MainProjectList: [],
  427. CustomerNatureList: [],
  428. CustomerInfoList: [],
  429. potentialCustomerTypeList: [],
  430. typeABshow: false,
  431. dictTypeFormShow: false,
  432. detilId: "",
  433. DIYshow: false,
  434. visitListList: [],
  435. TCFXList: [],
  436. QGJZist: [],
  437. SJSList: [],
  438. storeName: "名称",
  439. address: "地址",
  440. storeTypePOP: false,
  441. GZAttributeFormShow: false,
  442. type: "",
  443. towntShow: false,
  444. districtShow: false,
  445. cityShow: false,
  446. provinceShow: false,
  447. showmap: false,
  448. markers: undefined,
  449. markers1: undefined,
  450. marker: undefined,
  451. pageShow: false,
  452. mapsearchlist: [],
  453. map: "",
  454. img: "",
  455. lat: "",
  456. lon: "",
  457. poiAddress: "",
  458. myLat: "",
  459. poiLat: "",
  460. poiLon: "",
  461. poiId: "",
  462. myLon: "",
  463. pLat: "",
  464. pLot: "",
  465. poiName: "",
  466. helpPageFlag: false, //提交修改 不通过 点击帮助弹出框
  467. };
  468. },
  469. created() {
  470. this.detilId = this.$route.query.detilId;
  471. this.type = this.$route.query.type;
  472. this.getTCFXList();
  473. this.getSJSList();
  474. this.getQGJZist();
  475. this.getCustomerInfoList();
  476. this.getManagementModelList();
  477. this.getMainRelationList();
  478. this.getMainProjectList();
  479. this.getCustomerNatureList();
  480. this.getpotentialCustomerTypeList();
  481. },
  482. activated() {
  483. this.showmap = false;
  484. this.img = "";
  485. this.detilId = this.$route.query.detilId;
  486. this.type = this.$route.query.type;
  487. this.getCustomerInfoList();
  488. this.getManagementModelList();
  489. this.getMainRelationList();
  490. this.getMainProjectList();
  491. this.getCustomerNatureList();
  492. this.getTCFXList();
  493. this.getSJSList();
  494. this.getQGJZist();
  495. this.getStoreTypeList();
  496. this.getpotentialCustomerTypeList();
  497. this.visitListList = [];
  498. this.getStreetQuery("");
  499. window.scrollTo(0, 0);
  500. this.poiAddress = "";
  501. this.myLat = "";
  502. this.poiLat = "";
  503. this.poiLon = "";
  504. this.poiId = "";
  505. this.myLon = "";
  506. this.poiName = "";
  507. },
  508. methods: {
  509. newimgarr1(val) {
  510. this.img = val.fileUrl;
  511. },
  512. addressFn(val) {
  513. var that = this;
  514. setTimeout(() => {
  515. that.searchSHow = false;
  516. that.map.setCenter(new TMap.LatLng(val.location.lat, val.location.lng));
  517. that.markers1.updateGeometries([
  518. {
  519. id: "marker",
  520. styleId: "marker",
  521. position: new TMap.LatLng(val.location.lat, val.location.lng),
  522. },
  523. ]);
  524. that.maplist = [];
  525. // 地点搜索 获取500米范围poi点
  526. getMapPoi({ latitude: this.pLat, longitude: this.pLot }).then((res) => {
  527. console.log(res);
  528. that.maplist = res.data;
  529. that.marker.setGeometries([]);
  530. setTimeout(() => {
  531. for (let p = 0; p < res.data.length; p++) {
  532. that.marker.updateGeometries([
  533. {
  534. id: res.data[p].id,
  535. position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
  536. },
  537. ]);
  538. }
  539. });
  540. });
  541. // 清楚选中状态
  542. that.addresssb = -1;
  543. // jsonp(
  544. // "https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(" +
  545. // val.location.lat +
  546. // "," +
  547. // val.location.lng +
  548. // ",500,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6"
  549. // ).then((res) => {
  550. // console.log(res);
  551. // that.maplist = res.data;
  552. // that.marker.setGeometries([]);
  553. // setTimeout(() => {
  554. // for (let p = 0; p < res.data.length; p++) {
  555. // that.marker.updateGeometries([
  556. // {
  557. // id: res.data[p].id,
  558. // position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
  559. // },
  560. // ]);
  561. // }
  562. // });
  563. // });
  564. });
  565. },
  566. searchFn() {
  567. this.searchSHow = false;
  568. console.log(this.searchValue);
  569. getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, this.searchValue).then((res) => {
  570. // 不显示下拉选择
  571. if (!res.data.length && !this.searchValue) {
  572. this.searchSHow = false;
  573. } else {
  574. this.searchSHow = true;
  575. }
  576. // 联想下拉选
  577. this.mapsearchlist = res.data;
  578. // // 赋值底部列表数据
  579. // this.maplist = res.data;
  580. });
  581. },
  582. mapselect(val) {
  583. this.searchSHow = false;
  584. if (val > -1) {
  585. this.markers.updateGeometries([
  586. {
  587. id: "markers1",
  588. styleId: "abc",
  589. position: new TMap.LatLng(
  590. this.maplist[val].location.lat,
  591. this.maplist[val].location.lng
  592. ),
  593. },
  594. ]);
  595. }
  596. },
  597. confirmMap() {
  598. console.log(this.maplist);
  599. console.log(this.addresssb);
  600. if (this.addresssb > -1) {
  601. this.list.addressLine = this.maplist[this.addresssb].address;
  602. this.lon = this.myLat;
  603. this.lat = this.myLon;
  604. this.poiAddress = this.maplist[this.addresssb].address;
  605. this.poiLat = this.maplist[this.addresssb].location.lat;
  606. this.poiLon = this.maplist[this.addresssb].location.lng;
  607. this.poiId = this.maplist[this.addresssb].id;
  608. this.poiName = this.maplist[this.addresssb].title;
  609. this.showmap = false;
  610. }
  611. },
  612. fns() {
  613. this.searchValue = "";
  614. getPosition()
  615. .then((res) => {
  616. let { TXisBD, resData } = res;
  617. this.lat = TXisBD.lat;
  618. this.lon = TXisBD.lon;
  619. if (this.list.lon == "") {
  620. this.list.lon = TXisBD.lon;
  621. this.list.lat = resData.latitude;
  622. }
  623. this.pLat = resData.latitude;
  624. this.pLot = resData.longitude;
  625. this.myLat = TXisBD.lat;
  626. this.myLon = TXisBD.lon;
  627. this.showmap = true;
  628. // 地点搜索 获取500米范围poi点
  629. getMapPoi(resData).then((resPoi) => {
  630. this.maplist = resPoi.data;
  631. setTimeout(() => {
  632. this.addVisits1("1");
  633. });
  634. });
  635. })
  636. .catch((err) => {
  637. console.log(err);
  638. });
  639. // let loading1 = this.$toast.loading({
  640. // duration: 0,
  641. // message: "定位中...",
  642. // forbidClick: true,
  643. // });
  644. // let url = window.location.href;
  645. // // let url = encodeURIComponent("https://ssbsfatest.nipponpaint.com.cn/mobile" + window.location.href.split("/mobile")[1]).replaceAll("%3A", ":")
  646. // let that = this;
  647. // let qiyeData;
  648. // const instance = axios.create();
  649. // instance.defaults.headers.common["userId"] = localStorage.getItem("loginName");
  650. // instance
  651. // .get(process.env.VUE_APP_BASE_API + "mobile/wx/ticket", {
  652. // params: {
  653. // url: url,
  654. // },
  655. // })
  656. // .then((response) => {
  657. // if (response.status == 200) {
  658. // this.cont = 6;
  659. // var flat = true;
  660. // var times = setInterval(() => {
  661. // this.cont--;
  662. // if (this.cont == "0") {
  663. // if (flat) {
  664. // loading1.clear();
  665. // clearInterval(times);
  666. // that.$dialog.alert({
  667. // message: "定位失败,请开启企微定位权限",
  668. // });
  669. // } else {
  670. // clearInterval(times);
  671. // }
  672. // }
  673. // }, 1000);
  674. // qiyeData = response.data.data;
  675. // that.wx.config({
  676. // beta: true,
  677. // debug: false,
  678. // appId: qiyeData.appId,
  679. // timestamp: qiyeData.timestamp,
  680. // nonceStr: qiyeData.nonceStr,
  681. // signature: qiyeData.signature,
  682. // jsApiList: ["ready", "getLocation"],
  683. // });
  684. // that.wx.ready(function () {
  685. // that.wx.getLocation({
  686. // type: "gcj02",
  687. // success: function (res) {
  688. // flat = false;
  689. // loading1.clear();
  690. // var location = that.CJ02BD(res.latitude, res.longitude);
  691. // that.lat = location.lat;
  692. // that.lon = location.lon;
  693. // if (that.list.lon == "") {
  694. // that.list.lon = location.lon;
  695. // that.list.lat = res.latitude;
  696. // }
  697. // that.pLat = res.latitude;
  698. // that.pLot = res.longitude;
  699. // that.myLat = location.lat;
  700. // that.myLon = location.lon;
  701. // that.showmap = true;
  702. // jsonp(
  703. // "https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(" +
  704. // res.latitude +
  705. // "," +
  706. // res.longitude +
  707. // ",500,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6"
  708. // ).then((res) => {
  709. // console.log(res);
  710. // that.maplist = res.data;
  711. // setTimeout(() => {
  712. // that.addVisits1("1");
  713. // });
  714. // });
  715. // },
  716. // fail: function () {
  717. // loading1.clear();
  718. // that.$dialog.alert({
  719. // title: "系统提示",
  720. // message: "GPS未开启",
  721. // });
  722. // },
  723. // });
  724. // });
  725. // that.wx.error(function (res) {
  726. // this.$toast.fail("定位失败");
  727. // });
  728. // } else {
  729. // this.$toast.fail("接口异常");
  730. // }
  731. // });
  732. },
  733. addVisits1(val) {
  734. var that = this;
  735. var latlng = {
  736. lat: this.pLat,
  737. lon: this.pLot,
  738. };
  739. var map = new TMap.Map("allmap1", {
  740. zoom: 15,
  741. center: new TMap.LatLng(latlng.lat, latlng.lon),
  742. });
  743. var markers = new TMap.MultiMarker({
  744. id: "markers",
  745. map: map,
  746. geometries: [],
  747. styles: {
  748. marker: new TMap.MarkerStyle({
  749. width: 32,
  750. height: 40,
  751. anchor: { x: 16, y: 32 },
  752. src: "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker-pink.png",
  753. }),
  754. },
  755. });
  756. markers.setGeometries([]);
  757. var location = new TMap.LatLng(latlng.lat, latlng.lon);
  758. map.setCenter(location);
  759. markers.updateGeometries([
  760. {
  761. id: "marker",
  762. styleId: "marker",
  763. position: location,
  764. },
  765. ]);
  766. var marker = new TMap.MultiMarker({
  767. map: map,
  768. styles: {
  769. default: new TMap.MarkerStyle({
  770. width: 32,
  771. height: 40,
  772. anchor: {
  773. x: 17,
  774. y: 21,
  775. },
  776. src: "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker_blue.png",
  777. }),
  778. },
  779. geometries: [],
  780. });
  781. for (let p = 0; p < this.maplist.length; p++) {
  782. marker.updateGeometries([
  783. {
  784. id: this.maplist[p].id,
  785. position: new TMap.LatLng(this.maplist[p].location.lat, this.maplist[p].location.lng),
  786. },
  787. ]);
  788. }
  789. var markers1 = new TMap.MultiMarker({
  790. map: map,
  791. mapgeometries: [{ id: "markers1", position: new TMap.LatLng(0, 0) }],
  792. styles: {
  793. abc: new TMap.MarkerStyle({
  794. width: 32,
  795. height: 40,
  796. anchor: { x: 16, y: 32 },
  797. src: txmapimg3,
  798. }),
  799. },
  800. });
  801. markers1.setGeometries([]);
  802. this.map = map;
  803. this.markers = markers1;
  804. this.markers1 = markers;
  805. this.marker = marker;
  806. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.SCALE); //移除比例尺控件
  807. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ROTATION); //移除旋转控件
  808. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ZOOM); //移除控件缩放
  809. },
  810. initMap(map) {
  811. // 监听地图平移开始
  812. map.on("pan", () => {
  813. console.log("监听地图平移开始");
  814. });
  815. // 监听地图平移结束
  816. map.on("panend", () => {
  817. console.log("监听地图平移结束");
  818. });
  819. },
  820. updateStoreAddress() {
  821. if (this.list.province == "") {
  822. this.$toast("省(州)不能为空");
  823. return;
  824. }
  825. if (this.list.city == "") {
  826. this.$toast("城市不能为空");
  827. return;
  828. }
  829. if (this.list.district == "") {
  830. this.$toast("县区不能为空");
  831. return;
  832. }
  833. if (this.list.townName == "") {
  834. this.$toast("街道不能为空");
  835. return;
  836. }
  837. if (this.list.addressLine == "") {
  838. this.$toast("地址不能为空");
  839. return;
  840. }
  841. if (
  842. this.lat == "" &&
  843. (this.list.storeCategory == "35" ||
  844. this.list.storeCategory == "36" ||
  845. this.list.storeCategory == "37" ||
  846. this.list.storeCategory == "38" ||
  847. this.list.storeCategory == "91")
  848. ) {
  849. this.$toast("未定位,请重新定位或地图选择地点");
  850. return;
  851. }
  852. if (
  853. this.img == "" &&
  854. (this.list.storeCategory == "35" ||
  855. this.list.storeCategory == "36" ||
  856. this.list.storeCategory == "37" ||
  857. this.list.storeCategory == "38" ||
  858. this.list.storeCategory == "91")
  859. ) {
  860. this.$toast("店招照片不能为空");
  861. return;
  862. }
  863. let loading1 = this.$toast.loading({
  864. duration: 0,
  865. message: "加载中...",
  866. forbidClick: true,
  867. });
  868. let params = {
  869. storeAddressId: this.$route.query.storeAddressId,
  870. storeCode: this.list.storeCode,
  871. storeName: this.list.storeName,
  872. addressLine: this.list.addressLine,
  873. storeId: this.list.storeId,
  874. province: this.list.province,
  875. lon: this.lon,
  876. lat: this.lat,
  877. myLon: this.myLon,
  878. myLat: this.myLat,
  879. poiId: this.poiId,
  880. poiLon: this.poiLon,
  881. poiLat: this.poiLat,
  882. poiAddress: this.poiAddress,
  883. city: this.list.city,
  884. district: this.list.district,
  885. townName: this.list.townName,
  886. shopSignUrl: this.img,
  887. poiName: this.poiName, //地图选择POI名称
  888. };
  889. console.log(JSON.stringify(params));
  890. console.log(params);
  891. updateStoreAddress(params).then((res) => {
  892. loading1.clear();
  893. if (res.code == 200) {
  894. this.$dialog
  895. .alert({
  896. message: res.msg,
  897. messageAlign: "left",
  898. })
  899. .then(() => {
  900. this.$router.go(-1);
  901. });
  902. } else {
  903. this.$dialog
  904. .alert({
  905. className: "helpAlert",
  906. confirmButtonColor: "#0057ba",
  907. message: res.msg,
  908. messageAlign: "left",
  909. showCancelButton: true,
  910. cancelButtonText: "帮助",
  911. cancelButtonColor: "#f79200",
  912. })
  913. .then(() => {})
  914. .catch(() => {
  915. // 帮助 弹出框
  916. this.helpPageFlag = true;
  917. });
  918. }
  919. });
  920. },
  921. towntFN() {
  922. if (this.type == "address") {
  923. this.towntShow = true;
  924. }
  925. },
  926. districtFN() {
  927. if (this.type == "address") {
  928. this.districtShow = true;
  929. }
  930. },
  931. cityFN() {
  932. if (this.type == "address") {
  933. this.cityShow = true;
  934. }
  935. },
  936. provinceFN() {
  937. if (this.type == "address") {
  938. this.provinceShow = true;
  939. }
  940. },
  941. onProvinceConfirm(value) {
  942. this.list.provinceName = value.text;
  943. this.list.province = value.provinceCode;
  944. this.list.cityName = "";
  945. this.list.city = "";
  946. this.list.districtName = "";
  947. this.list.countyCode = "";
  948. this.list.townName = "";
  949. this.list.townCode = "";
  950. this.getStreetQuery("1");
  951. this.provinceShow = false;
  952. },
  953. onCityConfirm(value) {
  954. this.list.cityName = value.text;
  955. this.list.city = value.cityCode;
  956. this.list.districtName = "";
  957. this.list.district = "";
  958. this.list.townName = "";
  959. this.list.townCode = "";
  960. this.cityCode = value.cityCode;
  961. this.getStreetQuery("2");
  962. this.cityShow = false;
  963. },
  964. onDistrictConfirm(value) {
  965. this.list.districtName = value.text;
  966. this.list.district = value.countyCode;
  967. this.list.townName = "";
  968. this.list.townCode = "";
  969. this.list.cityLevel = value.countyLevel;
  970. this.getStreetQuery("3");
  971. this.districtShow = false;
  972. },
  973. onTownConfirm(value) {
  974. this.list.townName = value.text;
  975. this.list.townCode = value.townCode;
  976. this.towntShow = false;
  977. },
  978. getStreetQuery(type) {
  979. var provinceCode = this.list.province;
  980. var cityCode = this.list.city;
  981. var countyCode = this.list.district;
  982. if (type == "1") {
  983. cityCode = "";
  984. countyCode = "";
  985. } else if (type == "2") {
  986. countyCode = "";
  987. } else if (type == "3") {
  988. } else {
  989. provinceCode = "";
  990. cityCode = "";
  991. countyCode = "";
  992. }
  993. streetQuery({
  994. provinceCode: provinceCode,
  995. cityCode: cityCode,
  996. countyCode: countyCode,
  997. }).then((res) => {
  998. if (res.code == 200) {
  999. var provinceList = [];
  1000. var cityList = [];
  1001. var districtList = [];
  1002. var townList = [];
  1003. if (type == "1") {
  1004. for (var z1 = 0; z1 < res.data.length; z1++) {
  1005. cityList.push({
  1006. cityCode: res.data[z1].cityCode,
  1007. text: res.data[z1].cityName,
  1008. });
  1009. }
  1010. this.cityList = cityList;
  1011. } else if (type == "2") {
  1012. for (var z2 = 0; z2 < res.data.length; z2++) {
  1013. districtList.push({
  1014. countyCode: res.data[z2].countyCode,
  1015. text: res.data[z2].countyName,
  1016. countyLevel: res.data[z2].countyLevel,
  1017. });
  1018. }
  1019. this.districtList = districtList;
  1020. } else if (type == "3") {
  1021. for (var z3 = 0; z3 < res.data.length; z3++) {
  1022. townList.push({
  1023. townCode: res.data[z3].townCode,
  1024. text: res.data[z3].townName,
  1025. });
  1026. }
  1027. this.townList = townList;
  1028. } else {
  1029. for (var z = 0; z < res.data.length; z++) {
  1030. provinceList.push({
  1031. provinceCode: res.data[z].provinceCode,
  1032. text: res.data[z].provinceName,
  1033. });
  1034. }
  1035. this.provinceList = provinceList;
  1036. }
  1037. } else {
  1038. this.$toast.fail("请求超时");
  1039. }
  1040. });
  1041. },
  1042. getCustomerInfoList() {
  1043. getCustomerInfoList().then((res) => {
  1044. var CustomerInfoList = [];
  1045. for (var t = 0; t < res.data.length; t++) {
  1046. CustomerInfoList.push({
  1047. text: res.data[t].dictLabel,
  1048. dictCode: res.data[t].dictValue,
  1049. });
  1050. }
  1051. this.CustomerInfoList = CustomerInfoList;
  1052. });
  1053. },
  1054. getCustomerNatureList() {
  1055. getCustomerNatureList().then((res) => {
  1056. var CustomerNatureList = [];
  1057. for (var t = 0; t < res.data.length; t++) {
  1058. CustomerNatureList.push({
  1059. text: res.data[t].dictLabel,
  1060. dictCode: res.data[t].dictValue,
  1061. });
  1062. }
  1063. this.CustomerNatureList = CustomerNatureList;
  1064. });
  1065. },
  1066. getpotentialCustomerTypeList() {
  1067. getpotentialCustomerTypeList().then((res) => {
  1068. var potentialCustomerTypeList = [];
  1069. for (var t = 0; t < res.data.length; t++) {
  1070. potentialCustomerTypeList.push({
  1071. text: res.data[t].dictLabel,
  1072. dictCode: res.data[t].dictValue,
  1073. });
  1074. }
  1075. this.potentialCustomerTypeList = potentialCustomerTypeList;
  1076. });
  1077. },
  1078. getMainProjectList() {
  1079. getMainProjectList().then((res) => {
  1080. var MainProjectList = [];
  1081. for (var t = 0; t < res.data.length; t++) {
  1082. MainProjectList.push({
  1083. text: res.data[t].dictLabel,
  1084. dictCode: res.data[t].dictValue,
  1085. });
  1086. }
  1087. this.MainProjectList = MainProjectList;
  1088. });
  1089. },
  1090. getMainRelationList() {
  1091. getMainRelationList().then((res) => {
  1092. var MainRelationList = [];
  1093. for (var t = 0; t < res.data.length; t++) {
  1094. MainRelationList.push({
  1095. text: res.data[t].dictLabel,
  1096. dictCode: res.data[t].dictValue,
  1097. });
  1098. }
  1099. this.MainRelationList = MainRelationList;
  1100. });
  1101. },
  1102. getManagementModelList() {
  1103. getManagementModelList().then((res) => {
  1104. var ManagementModelList = [];
  1105. for (var t = 0; t < res.data.length; t++) {
  1106. ManagementModelList.push({
  1107. text: res.data[t].dictLabel,
  1108. dictCode: res.data[t].dictValue,
  1109. });
  1110. }
  1111. this.ManagementModelList = ManagementModelList;
  1112. });
  1113. },
  1114. getSJSList() {
  1115. getSJSList({}).then((res) => {
  1116. var SJSList = [];
  1117. for (var t = 0; t < res.data.length; t++) {
  1118. SJSList.push({
  1119. text: res.data[t].dictLabel,
  1120. dictCode: res.data[t].dictValue,
  1121. });
  1122. }
  1123. this.SJSList = SJSList;
  1124. });
  1125. },
  1126. getQGJZist() {
  1127. getQGJZist({}).then((res) => {
  1128. var QGJZist = [];
  1129. for (var t = 0; t < res.data.length; t++) {
  1130. QGJZist.push({
  1131. text: res.data[t].dictLabel,
  1132. dictCode: res.data[t].dictValue,
  1133. });
  1134. }
  1135. this.QGJZist = QGJZist;
  1136. });
  1137. },
  1138. getTCFXList() {
  1139. getTCFXList({}).then((res) => {
  1140. var TCFXList = [];
  1141. for (var t = 0; t < res.data.length; t++) {
  1142. TCFXList.push({
  1143. text: res.data[t].dictLabel,
  1144. dictCode: res.data[t].dictCode,
  1145. });
  1146. }
  1147. this.TCFXList = TCFXList;
  1148. });
  1149. },
  1150. visitsFn(row) {
  1151. this.$router.push({
  1152. path: "/historicalDetails",
  1153. query: {
  1154. visitId: row.id,
  1155. storeCode: row.storeCode,
  1156. storeId: row.storeId,
  1157. },
  1158. });
  1159. },
  1160. valid() {
  1161. var that = this;
  1162. this.$dialog
  1163. .confirm({
  1164. title: "系统提示",
  1165. message: "是否确认无效关店?",
  1166. })
  1167. .then(() => {
  1168. let loading1 = this.$toast.loading({
  1169. duration: 0,
  1170. message: "加载中...",
  1171. forbidClick: true,
  1172. });
  1173. valid({ storeId: that.list.storeId }).then((res) => {
  1174. loading1.clear();
  1175. if (res.code == 200) {
  1176. window.location.replace(window.location.origin + "/mobile/storeAddress");
  1177. }
  1178. });
  1179. });
  1180. },
  1181. deleteImgs(val) {
  1182. ImagePreview([val]);
  1183. },
  1184. getStoreTypeList() {
  1185. if (localStorage.getItem("storeType") == "2") {
  1186. this.DIYshow = true;
  1187. getStoreyslTypeList({}).then((res) => {
  1188. this.storeTypeList = res.data;
  1189. this.getDetail();
  1190. });
  1191. } else {
  1192. this.DIYshow = false;
  1193. getStoreTypeList({}).then((res) => {
  1194. this.storeTypeList = res.data;
  1195. this.getDetail();
  1196. });
  1197. }
  1198. },
  1199. getDetail() {
  1200. this.pageShow = false;
  1201. this.lat = "";
  1202. this.lon = "";
  1203. let loading1 = this.$toast.loading({
  1204. duration: 0,
  1205. message: "加载中...",
  1206. forbidClick: true,
  1207. });
  1208. getById({ storeId: this.$route.query.id }).then((res) => {
  1209. loading1.clear();
  1210. this.pageShow = true;
  1211. localStorage.setItem("locationRemark", res.data.addressLine);
  1212. localStorage.setItem("orgName", res.data.orgName);
  1213. localStorage.setItem("chainName", res.data.storeName);
  1214. if (res.code == 200) {
  1215. if (res.data.lat != null) {
  1216. this.lat = res.data.lat;
  1217. this.lon = res.data.lon;
  1218. }
  1219. this.list = res.data;
  1220. if (
  1221. res.data.province != null &&
  1222. res.data.province != undefined &&
  1223. res.data.province != ""
  1224. ) {
  1225. this.getStreetQuery("1");
  1226. }
  1227. if (res.data.city != null && res.data.city != undefined && res.data.city != "") {
  1228. this.getStreetQuery("2");
  1229. }
  1230. if (
  1231. res.data.district != null &&
  1232. res.data.district != undefined &&
  1233. res.data.district != ""
  1234. ) {
  1235. this.getStreetQuery("3");
  1236. }
  1237. if (this.list.carShopImgList != null) {
  1238. } else {
  1239. this.list.carShopImgList = [];
  1240. }
  1241. if (this.list.storeCategory == "10131" || this.list.storeCategory == "129081") {
  1242. this.typeABshow = true;
  1243. } else {
  1244. this.typeABshow = false;
  1245. }
  1246. if (this.list.storeCategory == "C917") {
  1247. this.GZAttributeFormShow = true;
  1248. this.dictTypeSJSFormShow = false;
  1249. this.dictTypeQGJZFormShow = false;
  1250. this.dictTypeFormShow = false;
  1251. this.dictTypeAFormShow = false;
  1252. this.typeABshow = false;
  1253. for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
  1254. if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
  1255. this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
  1256. }
  1257. }
  1258. } else {
  1259. this.GZAttributeFormShow = false;
  1260. }
  1261. if (this.list.storeCategory == "129081") {
  1262. this.dictTypeFormShow = true;
  1263. if (this.list.attribute3 != "0" && this.list.attribute3 != null) {
  1264. this.list.tcfxName = this.list.attribute3;
  1265. } else {
  1266. this.list.tcfxName = this.list.attribute5;
  1267. }
  1268. }
  1269. if (this.list.storeCategory == "10131") {
  1270. this.dictTypeFormShow = true;
  1271. for (var k = 0; k < this.TCFXList.length; k++) {
  1272. if (this.TCFXList[k].dictCode == this.list.tcfxName) {
  1273. this.list.tcfxName = this.TCFXList[k].text;
  1274. }
  1275. }
  1276. }
  1277. if (this.list.storeCategory == "sjs61") {
  1278. this.dictTypeFormShow = true;
  1279. for (var k = 0; k < this.SJSList.length; k++) {
  1280. if (this.SJSList[k].dictCode == this.list.tcfxName) {
  1281. this.list.tcfxName = this.SJSList[k].text;
  1282. }
  1283. }
  1284. }
  1285. if (this.list.storeCategory == "zyjz63") {
  1286. this.dictTypeFormShow = true;
  1287. for (var k = 0; k < this.QGJZist.length; k++) {
  1288. if (this.QGJZist[k].dictCode == this.list.tcfxName) {
  1289. this.list.tcfxName = this.QGJZist[k].text;
  1290. }
  1291. }
  1292. }
  1293. if (this.list.storeCategory == "C912") {
  1294. this.storeTypePOP = false;
  1295. this.storeName = "铭牌上项目名称";
  1296. this.address = "地址";
  1297. } else if (this.list.storeCategory == "C917") {
  1298. this.storeTypePOP = false;
  1299. this.storeName = "名称";
  1300. this.address = "地址";
  1301. } else {
  1302. this.storeTypePOP = true;
  1303. this.storeName = "名称";
  1304. this.address = "地址";
  1305. }
  1306. getPosition()
  1307. .then((res) => {
  1308. let { TXisBD, resData } = res;
  1309. this.lat = TXisBD.lat;
  1310. this.lon = TXisBD.lon;
  1311. this.myLat = TXisBD.lat;
  1312. this.myLon = TXisBD.lon;
  1313. this.list.lon = TXisBD.lon;
  1314. this.list.lat = TXisBD.lat;
  1315. })
  1316. .catch((err) => {
  1317. console.log(err);
  1318. });
  1319. // let loading1 = this.$toast.loading({
  1320. // duration: 0,
  1321. // message: "定位中...",
  1322. // forbidClick: true,
  1323. // });
  1324. // let url = window.location.href;
  1325. // // let url = "https://ssbsfatest.nipponpaint.com.cn/mobile" + window.location.href.split("/mobile")[1]
  1326. // let that = this;
  1327. // let qiyeData;
  1328. // const instance = axios.create();
  1329. // instance.defaults.headers.common["userId"] = localStorage.getItem("loginName");
  1330. // instance
  1331. // .get(process.env.VUE_APP_BASE_API + "mobile/wx/ticket", {
  1332. // params: {
  1333. // url: url,
  1334. // },
  1335. // })
  1336. // .then((response) => {
  1337. // if (response.status == 200) {
  1338. // this.cont = 6;
  1339. // var flat = true;
  1340. // var times = setInterval(() => {
  1341. // this.cont--;
  1342. // if (this.cont == "0") {
  1343. // if (flat) {
  1344. // loading1.clear();
  1345. // clearInterval(times);
  1346. // that.$dialog
  1347. // .alert({
  1348. // message: "定位失败,请开启企微定位权限",
  1349. // })
  1350. // .then(() => {
  1351. // this.$router.go(-1);
  1352. // });
  1353. // } else {
  1354. // clearInterval(times);
  1355. // }
  1356. // }
  1357. // }, 1000);
  1358. // qiyeData = response.data.data;
  1359. // that.wx.config({
  1360. // beta: true,
  1361. // debug: false,
  1362. // appId: qiyeData.appId,
  1363. // timestamp: qiyeData.timestamp,
  1364. // nonceStr: qiyeData.nonceStr,
  1365. // signature: qiyeData.signature,
  1366. // jsApiList: ["ready", "getLocation"],
  1367. // });
  1368. // that.wx.ready(function () {
  1369. // that.wx.getLocation({
  1370. // type: "gcj02",
  1371. // success: function (res) {
  1372. // flat = false;
  1373. // loading1.clear();
  1374. // var location = that.CJ02BD(res.latitude, res.longitude);
  1375. // that.lat = location.lat;
  1376. // that.lon = location.lon;
  1377. // that.myLat = location.lat;
  1378. // that.myLon = location.lon;
  1379. // that.list.lon = location.lon;
  1380. // that.list.lat = location.lat;
  1381. // },
  1382. // fail: function () {
  1383. // loading1.clear();
  1384. // that.$dialog.alert({
  1385. // title: "系统提示",
  1386. // message: "GPS未开启",
  1387. // });
  1388. // },
  1389. // });
  1390. // });
  1391. // that.wx.error(function (res) {
  1392. // this.$toast.fail("定位失败");
  1393. // });
  1394. // } else {
  1395. // this.$toast.fail("接口异常");
  1396. // }
  1397. // });
  1398. } else {
  1399. this.$toast.fail(res.msg);
  1400. }
  1401. });
  1402. },
  1403. positionFn() {
  1404. let loading1 = this.$toast.loading({
  1405. duration: 0,
  1406. message: "定位中...",
  1407. forbidClick: true,
  1408. });
  1409. let url = window.location.href;
  1410. let that = this;
  1411. let qiyeData;
  1412. const instance = axios.create();
  1413. instance.defaults.headers.common["userId"] = localStorage.getItem("loginName");
  1414. instance
  1415. .get(process.env.VUE_APP_BASE_API + "mobile/wx/ticket", {
  1416. params: {
  1417. url: url,
  1418. },
  1419. })
  1420. .then((response) => {
  1421. if (response.status == 200) {
  1422. this.cont = 6;
  1423. var flat = true;
  1424. var times = setInterval(() => {
  1425. this.cont--;
  1426. if (this.cont == "0") {
  1427. if (flat) {
  1428. loading1.clear();
  1429. clearInterval(times);
  1430. that.$dialog
  1431. .alert({
  1432. message: "定位失败,请开启企微定位权限",
  1433. })
  1434. .then(() => {
  1435. this.$router.go(-1);
  1436. });
  1437. } else {
  1438. clearInterval(times);
  1439. }
  1440. }
  1441. }, 1000);
  1442. qiyeData = response.data.data;
  1443. that.wx.config({
  1444. beta: true,
  1445. debug: false,
  1446. appId: qiyeData.appId,
  1447. timestamp: qiyeData.timestamp,
  1448. nonceStr: qiyeData.nonceStr,
  1449. signature: qiyeData.signature,
  1450. jsApiList: ["ready", "getLocation"],
  1451. });
  1452. that.wx.ready(function () {
  1453. that.wx.getLocation({
  1454. type: "gcj02",
  1455. success: function (res) {
  1456. flat = false;
  1457. loading1.clear();
  1458. var location = that.CJ02BD(res.latitude, res.longitude);
  1459. that.lat = location.lat;
  1460. that.lon = location.lon;
  1461. that.myLat = location.lat;
  1462. that.myLon = location.lon;
  1463. that.list.lon = location.lon;
  1464. that.list.lat = location.lon;
  1465. },
  1466. fail: function () {
  1467. loading1.clear();
  1468. that.$dialog.alert({
  1469. title: "系统提示",
  1470. message: "GPS未开启",
  1471. });
  1472. },
  1473. });
  1474. });
  1475. that.wx.error(function (res) {
  1476. this.$toast.fail("定位失败");
  1477. });
  1478. } else {
  1479. this.$toast.fail("接口异常");
  1480. }
  1481. });
  1482. },
  1483. editorFn() {
  1484. this.$router.push({
  1485. path: "/storeEdit",
  1486. query: { id: this.$route.query.id, validFlag: this.list.validFlag },
  1487. });
  1488. },
  1489. formLink() {
  1490. this.$router.push("/storeVisit/questions");
  1491. },
  1492. onClickLeft() {
  1493. this.$router.go(-1);
  1494. },
  1495. tabChange(name, title) {
  1496. console.log(name, title);
  1497. },
  1498. placeOrderFn() {
  1499. var that = this;
  1500. let loading1 = this.$toast.loading({
  1501. duration: 0,
  1502. message: "加载中...",
  1503. forbidClick: true,
  1504. });
  1505. addStore(this.list).then((res) => {
  1506. loading1.clear();
  1507. if (res.code == 200) {
  1508. if (res.data.serverCode) {
  1509. if (
  1510. res.data.orderUrl != null &&
  1511. (res.data.orderUrl != "") & (res.data.orderUrl != undefined)
  1512. ) {
  1513. window.location.replace(res.data.orderUrl);
  1514. } else {
  1515. checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
  1516. localStorage.setItem("startTime", new Date());
  1517. localStorage.setItem("ORGName", this.list.deptName);
  1518. localStorage.setItem("chainNameR", this.list.storeName);
  1519. if (response.code == 200) {
  1520. that.$dialog
  1521. .confirm({
  1522. title: "系统提示",
  1523. message: "建店成功,是否立即拜访?",
  1524. confirmButtonText: "立即拜访",
  1525. cancelButtonText: "返回上一页",
  1526. })
  1527. .then(() => {
  1528. localStorage.setItem("startTime", new Date());
  1529. localStorage.setItem("ORGName", res.data.sfaStore.deptName);
  1530. localStorage.setItem("chainNameR", res.data.sfaStore.storeName);
  1531. window.location.replace(
  1532. window.location.origin +
  1533. "/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=" +
  1534. res.data.sfaStore.storeId +
  1535. "&lat=" +
  1536. that.list.lat +
  1537. "&lon=" +
  1538. that.list.lon +
  1539. "&addressLine=" +
  1540. that.list.addressLine +
  1541. "&storeCategory=" +
  1542. res.data.sfaStore.storeCategory +
  1543. "&storeName=" +
  1544. that.list.storeName +
  1545. "&contactName=" +
  1546. that.list.contactName +
  1547. "&storeCode=" +
  1548. res.data.sfaStore.storeCode +
  1549. "&latNew=" +
  1550. that.list.lat +
  1551. "&lonNew=" +
  1552. that.list.lon
  1553. );
  1554. })
  1555. .catch(() => {
  1556. that.$router.go(-2);
  1557. });
  1558. } else {
  1559. that.$dialog
  1560. .alert({
  1561. title: "系统提示",
  1562. message: response.msg,
  1563. })
  1564. .then((res) => {});
  1565. }
  1566. });
  1567. }
  1568. } else {
  1569. this.list.storeCode = res.data.sfaStore.storeCode;
  1570. this.list.storeId = res.data.sfaStore.storeId;
  1571. this.$dialog.alert({
  1572. title: "系统提示",
  1573. message: res.data.serverMsg,
  1574. });
  1575. }
  1576. } else {
  1577. this.msgList = res.msg;
  1578. this.showDialog = true;
  1579. }
  1580. });
  1581. },
  1582. btnClick() {
  1583. this.helpPageFlag = false;
  1584. },
  1585. },
  1586. };
  1587. </script>
  1588. <style scoped lang="scss">
  1589. .container {
  1590. padding-bottom: 50px;
  1591. }
  1592. .myTab .van-tabs__nav--card {
  1593. margin: 0 !important;
  1594. border-left: 0;
  1595. border-right: 0;
  1596. }
  1597. .myTab .van-tabs__wrap,
  1598. .van-tabs__nav--card {
  1599. height: 40px;
  1600. }
  1601. .myTab .van-tab {
  1602. line-height: 40px;
  1603. }
  1604. .helpPageMask {
  1605. width: 100%;
  1606. height: 100%;
  1607. background: rgba($color: #747474, $alpha: 0.8);
  1608. position: fixed;
  1609. z-index: 100000;
  1610. top: 0;
  1611. right: 0;
  1612. left: 0;
  1613. bottom: 0;
  1614. display: flex;
  1615. align-items: center;
  1616. justify-content: center;
  1617. }
  1618. </style>
  1619. <style lang="scss">
  1620. .searchDiv {
  1621. .van-search {
  1622. // background: #fff;
  1623. }
  1624. .van-search__action {
  1625. font-size: 14px;
  1626. color: #0057ba;
  1627. font-weight: bold;
  1628. background: #f1f1f1;
  1629. border-bottom-right-radius: 60px;
  1630. border-top-right-radius: 60px;
  1631. border: 1px solid #ccc;
  1632. padding: 0 20px;
  1633. }
  1634. .van-search--show-action {
  1635. padding-right: 12px;
  1636. }
  1637. .van-search__content {
  1638. border: 1px solid #ccc;
  1639. border-bottom-left-radius: 60px;
  1640. border-top-left-radius: 60px;
  1641. background: #f1f1f1;
  1642. border-right: 0;
  1643. }
  1644. }
  1645. .helpAlert {
  1646. .van-dialog__cancel {
  1647. .van-button__text {
  1648. &::before {
  1649. content: "?";
  1650. background: #f79200;
  1651. width: 20px;
  1652. display: inline-block;
  1653. border-radius: 50%;
  1654. color: #fff;
  1655. }
  1656. }
  1657. }
  1658. }
  1659. </style>