storeDetail.vue 58 KB

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