storeDetail.vue 60 KB

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