storeDetail.vue 57 KB

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