storeDetail.vue 51 KB

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