storeDetail.vue 61 KB

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