storeDetail.vue 52 KB

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