storeDetail.vue 62 KB

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