storeDetail.vue 57 KB

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