storeDetail.vue 55 KB

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