storeDetail.vue 59 KB

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