storeDetail.vue 54 KB

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