storeDetail.vue 62 KB

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