storeDetail.vue 57 KB

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