storeDetail.vue 57 KB

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