storeDetail.vue 58 KB

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