storeDetail.vue 61 KB

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