storeDetail.vue 61 KB

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