chainMaintain.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. <!-- 经销商维护 -->
  2. <template>
  3. <div class="chainMaintain">
  4. <div class="navBarTOP">
  5. <van-nav-bar
  6. class="navBar"
  7. title="客户详情"
  8. left-arrow
  9. @click-left="onClickLeft"
  10. right-text="保存"
  11. @click-right="onSubmit">
  12. </van-nav-bar>
  13. </div>
  14. <div style="margin-top: 44px; padding-bottom: 50px" v-if="pageShow">
  15. <van-dialog title="门店位置">
  16. <mapmarker :info="list"></mapmarker>
  17. </van-dialog>
  18. <van-tabs class="myTab" v-model="tabVal" color="#0057ba" @change="tabChange">
  19. <van-tab title="基础信息" name="insidePlan" ref="dispsps">
  20. <van-field readonly v-model="list.storeCode" label="编号" />
  21. <van-field readonly v-if="DIYshow" v-model="list.attribute1" label="DIY编号" />
  22. <van-field readonly v-model="list.storeName" :label="storeName" />
  23. <van-field readonly v-model="list.storeCategoryName" label="类型" />
  24. <van-field
  25. readonly
  26. v-if="type != 'address'"
  27. rows="1"
  28. autosize
  29. type="textarea"
  30. v-model="list.addressLine"
  31. :label="address" />
  32. <van-field
  33. v-if="type == 'address'"
  34. rows="1"
  35. autosize
  36. type="textarea"
  37. v-model="list.addressLine"
  38. :label="address">
  39. </van-field>
  40. <van-field v-model="list.lat" readonly label="经度" placeholder="经度" />
  41. <van-field readonly v-model="list.lon" label="维度" />
  42. <van-field readonly v-model="list.orgName" label="销售部" />
  43. <van-field readonly v-model="list.provinceName" label="省(州)">
  44. <template #button>
  45. <van-icon name="arrow" v-if="type == 'address'" />
  46. </template>
  47. </van-field>
  48. <van-field readonly v-model="list.cityName" label="城市">
  49. <template #button>
  50. <van-icon name="arrow" v-if="type == 'address'" />
  51. </template>
  52. </van-field>
  53. <van-field readonly v-model="list.districtName" label="区(县)">
  54. <template #button>
  55. <van-icon name="arrow" v-if="type == 'address'" />
  56. </template>
  57. </van-field>
  58. <van-field readonly v-model="list.townName" label="街道">
  59. <template #button>
  60. <van-icon name="arrow" v-if="type == 'address'" />
  61. </template>
  62. </van-field>
  63. <van-field readonly v-model="list.cityLevel" label="城市等级" />
  64. <van-field
  65. readonly
  66. v-if="list.ifJzStoreType != 1 && list.storeCategory != 'C917'"
  67. v-model="list.contactName"
  68. label="联系人" />
  69. <van-field
  70. readonly
  71. v-if="list.ifJzStoreType == 1 && list.storeCategory != 'C917'"
  72. v-model="list.contactName"
  73. label="老板" />
  74. <van-field
  75. readonly
  76. v-model="list.telephone"
  77. label="联系电话"
  78. v-if="list.storeCategory != 'C917'" />
  79. <template v-if="list.storeCategory != 'C917'">
  80. <!-- 分销店 -->
  81. <template
  82. v-if="
  83. verifyStoreType(list.storeCategory) &&
  84. verifyStoreType(list.storeCategory).type == 'fxd'
  85. ">
  86. <van-row style="border-bottom: 1px solid #ebedf0">
  87. <van-col span="24">
  88. <van-field label="经销商名称" @click="getStoreChainsContact" class="TCFXList">
  89. <!-- <template #left-icon>
  90. <span class="van-f-red">*</span>
  91. </template> -->
  92. <template #input>
  93. <template
  94. v-if="sfaStoreChainsContactList && sfaStoreChainsContactList.length">
  95. <div
  96. class="sfaStoreChainsContactList"
  97. v-for="(item, index) in sfaStoreChainsContactList"
  98. :key="index">
  99. {{ item.categoryDescribe }}
  100. {{ item.chainCode }}
  101. {{ item.chainName }}
  102. </div>
  103. </template>
  104. <template v-else>
  105. <span style="color: rgb(150, 151, 153)"> 点击选择经销商名称 </span>
  106. </template>
  107. </template>
  108. </van-field>
  109. </van-col>
  110. </van-row>
  111. </template>
  112. <template v-else>
  113. <van-field readonly v-model="list.chainCode" label="经销商编号" />
  114. <van-field readonly v-model="list.chainName" label="经销商名称" />
  115. </template>
  116. </template>
  117. <van-field readonly v-model="list.salesmanName" label="销售员" />
  118. <div v-if="list.storeCategory != 'C917'">
  119. <van-field
  120. readonly
  121. v-model="list.area"
  122. v-if="list.ifJzStoreType != 1"
  123. label="面积(m²)" />
  124. <van-field
  125. readonly
  126. v-model="list.area"
  127. v-if="list.ifJzStoreType == 1"
  128. label="家装展厅面积(m²)" />
  129. </div>
  130. <van-field
  131. readonly
  132. v-if="GZAttributeFormShow"
  133. label="潜在客户类型"
  134. v-model="list.potentialCustomerType" />
  135. <van-field readonly v-if="list.carShop" label="是否车铺开店">
  136. <template #input>
  137. <span v-if="list.carShop == 1">是</span>
  138. <span v-if="list.carShop == 0">否</span>
  139. </template>
  140. </van-field>
  141. <div v-if="list.carShopImgList != null && list.carShop == 1">
  142. <p style="padding: 0 16px">车铺照片(店招及车铺产品拍在一张照片里)</p>
  143. <viewUploadImg :imgs="list.carShopImgList"></viewUploadImg>
  144. </div>
  145. <template v-if="list.img != null && list.storeCategory != 'C917'">
  146. <div class="displayImg" style="padding: 16px">
  147. <div class="displayImgBox">
  148. <div v-if="storeTypePOP">
  149. <van-image
  150. width="100%"
  151. height="160"
  152. :src="setImgSrc(list.img)"
  153. @click="deleteImgs(list.img)" />
  154. <p style="text-align: center">
  155. {{ list.ifJzStoreType != 1 ? '建店时门店照' : '家装前台照片' }}
  156. </p>
  157. </div>
  158. <div v-else>
  159. <van-image
  160. width="100%"
  161. height="160"
  162. :src="setImgSrc(list.img)"
  163. @click="deleteImgs(list.img)" />
  164. <p style="text-align: center">
  165. {{ list.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片' }}
  166. </p>
  167. </div>
  168. </div>
  169. <template v-if="list.ifJzStoreType != 1"></template>
  170. <template v-else>
  171. <div class="displayImgBox">
  172. <div v-if="storeTypePOP">
  173. <van-image
  174. width="100%"
  175. height="160"
  176. :src="setImgSrc(list.imgSed)"
  177. @click="deleteImgs(list.imgSed)" />
  178. <p style="text-align: center">
  179. {{ '立邦展厅照片' }}
  180. </p>
  181. </div>
  182. </div>
  183. </template>
  184. <template v-if="list.ifJzStoreType != 1 && storeTypePOP && displayImg.length">
  185. <div class="displayImgBox" v-for="(urls, index) in displayImg" :key="index">
  186. <div>
  187. <van-image width="100%" height="160" :src="urls" @click="previewsImg(index)" />
  188. <p style="text-align: center">建店时陈列照</p>
  189. </div>
  190. </div>
  191. </template>
  192. </div>
  193. </template>
  194. <van-row gutter="20" style="padding: 16px">
  195. <van-col span="12" v-if="list.newStoreSignPhoto">
  196. <div v-if="storeTypePOP">
  197. <van-image
  198. width="100%"
  199. height="160"
  200. :src="setImgSrc(list.newStoreSignPhoto)"
  201. @click="deleteImgs(list.newStoreSignPhoto)" />
  202. <p style="text-align: center">最近一次拜访店招</p>
  203. </div>
  204. </van-col>
  205. <van-col span="12" v-if="list.newStoreDisplayPhoto">
  206. <div v-if="storeTypePOP">
  207. <van-image
  208. width="100%"
  209. height="160"
  210. :src="list.newStoreDisplayPhoto"
  211. @click="deleteImgs(list.newStoreDisplayPhoto)" />
  212. <p style="text-align: center">最近一次陈列照</p>
  213. </div>
  214. </van-col>
  215. </van-row>
  216. <van-row gutter="20" style="padding: 16px" v-if="type == 'address'">
  217. <van-col
  218. span="12"
  219. v-if="
  220. list.storeCategory == '35' ||
  221. list.storeCategory == '36' ||
  222. list.storeCategory == '37' ||
  223. list.storeCategory == '38' ||
  224. list.storeCategory == '91'
  225. ">
  226. <upload-img
  227. :uploadid="uploadid2"
  228. :imgArr="img"
  229. @newimgarr="newimgarr1"
  230. imgText="店招照片"
  231. :type="1"></upload-img>
  232. </van-col>
  233. </van-row>
  234. </van-tab>
  235. <van-tab title="属性信息" name="outsidePlan">
  236. <template v-for="(item, index) in TCFXList" v-if="dictTypeFormShow">
  237. <van-field
  238. readonly
  239. label="属性"
  240. v-if="item.dictValue == list.tcfxName"
  241. v-model="item.text" />
  242. </template>
  243. </van-tab>
  244. </van-tabs>
  245. <br />
  246. <br />
  247. <br />
  248. <br />
  249. <br />
  250. <br />
  251. </div>
  252. <!--经销商-->
  253. <van-popup
  254. v-model="showPickerChainsList"
  255. position="bottom"
  256. class="agencyBox"
  257. :close-on-click-overlay="false">
  258. <!-- 分销店 -->
  259. <template
  260. v-if="
  261. verifyStoreType(list.storeCategory) && verifyStoreType(list.storeCategory).type == 'fxd'
  262. ">
  263. <div class="header_btn">
  264. <div class="cancel" @click="showPickerChainsList = false">取消</div>
  265. <div class="confirm" @click="treeSelectConfirm">确定</div>
  266. </div>
  267. <van-tree-select
  268. :items="treeSelect"
  269. :main-active-index.sync="activeIndex"
  270. @click-nav="clickNav">
  271. <template #content>
  272. <div
  273. class="treeSelectchildren"
  274. v-if="activeIndex == index"
  275. v-for="(item, index) in treeSelect"
  276. :key="index">
  277. <div
  278. class="item"
  279. v-for="(val, ind) in item.children"
  280. :key="ind"
  281. @click="treeSelectItemClick(item, index, val, ind)">
  282. <div
  283. :class="{
  284. 'van-radio__icon': true,
  285. 'van-radio__icon--round': true,
  286. 'van-radio__icon--checked': val.Check,
  287. 'van-radio__icon--disabled': val.isCheck,
  288. }">
  289. <i class="van-icon van-icon-success"></i>
  290. </div>
  291. <div class="value">{{ val.chainCode }} {{ val.chainName }}</div>
  292. </div>
  293. </div>
  294. </template>
  295. </van-tree-select>
  296. </template>
  297. </van-popup>
  298. </div>
  299. </template>
  300. <script>
  301. import { ImagePreview } from 'vant';
  302. import {
  303. getById,
  304. getStoreTypeList,
  305. getStoreyslTypeList,
  306. getTCFXList,
  307. getSJSList,
  308. getQGJZist,
  309. getCustomerInfoList,
  310. getCustomerNatureList,
  311. getMainProjectList,
  312. getMainRelationList,
  313. getManagementModelList,
  314. getpotentialCustomerTypeList,
  315. streetQuery,
  316. } from '@/api/index';
  317. import mapmarker from '@/components/mapMarker';
  318. import viewUploadImg from '@/components/viewUploadImg';
  319. import txmapimg1 from '@/assets/txmap1.svg';
  320. import txmapimg2 from '@/assets/txmap2.svg';
  321. import txmapimg3 from '@/assets/marker_blue.png';
  322. import uploadImg from '@/components/viewaddreddUploadImg.vue';
  323. import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
  324. import { listChainsByCategory, addStoreChainContact } from '@/api/store';
  325. export default {
  326. components: { uploadImg, mapmarker, viewUploadImg },
  327. data() {
  328. return {
  329. addresssb: '',
  330. searchSHow: false,
  331. uploadid2: 'uploadid2',
  332. shows: true,
  333. searchValue: '',
  334. tabVal: 'insidePlan',
  335. showDialog: false,
  336. msgList: '',
  337. list: [],
  338. provinceList: [],
  339. txmapimg1: txmapimg1,
  340. txmapimg2: txmapimg2,
  341. txmapimg3: txmapimg3,
  342. cityList: [],
  343. districtList: [],
  344. maplist: [],
  345. townList: [],
  346. storeId: '',
  347. vaue: '',
  348. show: false,
  349. storeTypeList: [],
  350. ManagementModelList: [],
  351. MainRelationList: [],
  352. MainProjectList: [],
  353. CustomerNatureList: [],
  354. CustomerInfoList: [],
  355. potentialCustomerTypeList: [],
  356. typeABshow: false,
  357. dictTypeFormShow: false,
  358. detilId: '',
  359. DIYshow: false,
  360. visitListList: [],
  361. TCFXList: [],
  362. QGJZist: [],
  363. SJSList: [],
  364. storeName: '名称',
  365. address: '地址',
  366. storeTypePOP: false,
  367. GZAttributeFormShow: false,
  368. type: '',
  369. towntShow: false,
  370. districtShow: false,
  371. cityShow: false,
  372. provinceShow: false,
  373. showmap: false,
  374. markers: undefined,
  375. markers1: undefined,
  376. marker: undefined,
  377. pageShow: false,
  378. mapsearchlist: [],
  379. map: '',
  380. img: '',
  381. lat: '',
  382. lon: '',
  383. poiAddress: '',
  384. myLat: '',
  385. poiLat: '',
  386. poiLon: '',
  387. poiId: '',
  388. myLon: '',
  389. pLat: '',
  390. pLot: '',
  391. poiName: '',
  392. activeNames: [],
  393. cityABStore: false, //同城分销A/B店
  394. displayImg: [],
  395. treeSelect: [],
  396. sfaStoreChainsContactList: [], //选中确定的经销商
  397. activatedTCFXList: [], //选中的经销商
  398. showPickerChainsList: false,
  399. activeIndex: 0,
  400. treeSelectItemInd: 0,
  401. };
  402. },
  403. created() {
  404. this.tabVal = 'insidePlan';
  405. this.showmap = false;
  406. this.img = '';
  407. this.detilId = this.$route.query.detilId;
  408. this.type = this.$route.query.type; // type:address 拜访时位置偏差过大,可以修改地址(只能修改地址)
  409. this.getCustomerInfoList();
  410. this.getManagementModelList();
  411. this.getMainRelationList();
  412. this.getMainProjectList();
  413. this.getCustomerNatureList();
  414. this.getTCFXList();
  415. this.getSJSList();
  416. this.getQGJZist();
  417. this.getStoreType();
  418. this.getpotentialCustomerTypeList();
  419. this.visitListList = [];
  420. this.getStreetQuery('');
  421. window.scrollTo(0, 0);
  422. this.poiAddress = '';
  423. this.myLat = '';
  424. this.poiLat = '';
  425. this.poiLon = '';
  426. this.poiId = '';
  427. this.myLon = '';
  428. this.poiName = '';
  429. },
  430. methods: {
  431. newimgarr1(val) {
  432. this.img = val.fileUrl;
  433. },
  434. onSubmit() {
  435. addStoreChainContact({
  436. storeId: this.$route.query.id, //long 门店id
  437. sfaStoreChainsContactList: this.sfaStoreChainsContactList.filter((item) => !item.isCheck), //对象数组 门店选择的品类经销商列表(只传新增的)
  438. }).then((res) => {
  439. if (res.code == 200) {
  440. this.$toast('保存成功');
  441. this.$router.replace({ path: '/My' });
  442. } else {
  443. this.$dialog.alert({
  444. title: '系统提示',
  445. message: res.msg,
  446. messageAlign: 'left',
  447. });
  448. }
  449. });
  450. },
  451. getStreetQuery(type) {
  452. var provinceCode = this.list.province;
  453. var cityCode = this.list.city;
  454. var countyCode = this.list.district;
  455. if (type == '1') {
  456. cityCode = '';
  457. countyCode = '';
  458. } else if (type == '2') {
  459. countyCode = '';
  460. } else if (type == '3') {
  461. } else {
  462. provinceCode = '';
  463. cityCode = '';
  464. countyCode = '';
  465. }
  466. streetQuery({
  467. provinceCode: provinceCode,
  468. cityCode: cityCode,
  469. countyCode: countyCode,
  470. }).then((res) => {
  471. if (res.code == 200) {
  472. var provinceList = [];
  473. var cityList = [];
  474. var districtList = [];
  475. var townList = [];
  476. if (type == '1') {
  477. for (var z1 = 0; z1 < res.data.length; z1++) {
  478. cityList.push({
  479. cityCode: res.data[z1].cityCode,
  480. text: res.data[z1].cityName,
  481. });
  482. }
  483. this.cityList = cityList;
  484. } else if (type == '2') {
  485. for (var z2 = 0; z2 < res.data.length; z2++) {
  486. districtList.push({
  487. countyCode: res.data[z2].countyCode,
  488. text: res.data[z2].countyName,
  489. countyLevel: res.data[z2].countyLevel,
  490. });
  491. }
  492. this.districtList = districtList;
  493. } else if (type == '3') {
  494. for (var z3 = 0; z3 < res.data.length; z3++) {
  495. townList.push({
  496. townCode: res.data[z3].townCode,
  497. text: res.data[z3].townName,
  498. });
  499. }
  500. this.townList = townList;
  501. } else {
  502. for (var z = 0; z < res.data.length; z++) {
  503. provinceList.push({
  504. provinceCode: res.data[z].provinceCode,
  505. text: res.data[z].provinceName,
  506. });
  507. }
  508. this.provinceList = provinceList;
  509. }
  510. } else {
  511. this.$toast.fail('请求超时');
  512. }
  513. });
  514. },
  515. getCustomerInfoList() {
  516. getCustomerInfoList().then((res) => {
  517. var CustomerInfoList = [];
  518. for (var t = 0; t < res.data.length; t++) {
  519. CustomerInfoList.push({
  520. text: res.data[t].dictLabel,
  521. dictCode: res.data[t].dictValue,
  522. });
  523. }
  524. this.CustomerInfoList = CustomerInfoList;
  525. });
  526. },
  527. getCustomerNatureList() {
  528. getCustomerNatureList().then((res) => {
  529. var CustomerNatureList = [];
  530. for (var t = 0; t < res.data.length; t++) {
  531. CustomerNatureList.push({
  532. text: res.data[t].dictLabel,
  533. dictCode: res.data[t].dictValue,
  534. });
  535. }
  536. this.CustomerNatureList = CustomerNatureList;
  537. });
  538. },
  539. getpotentialCustomerTypeList() {
  540. getpotentialCustomerTypeList().then((res) => {
  541. var potentialCustomerTypeList = [];
  542. for (var t = 0; t < res.data.length; t++) {
  543. potentialCustomerTypeList.push({
  544. text: res.data[t].dictLabel,
  545. dictCode: res.data[t].dictValue,
  546. });
  547. }
  548. this.potentialCustomerTypeList = potentialCustomerTypeList;
  549. });
  550. },
  551. getMainProjectList() {
  552. getMainProjectList().then((res) => {
  553. var MainProjectList = [];
  554. for (var t = 0; t < res.data.length; t++) {
  555. MainProjectList.push({
  556. text: res.data[t].dictLabel,
  557. dictCode: res.data[t].dictValue,
  558. });
  559. }
  560. this.MainProjectList = MainProjectList;
  561. });
  562. },
  563. getMainRelationList() {
  564. getMainRelationList().then((res) => {
  565. var MainRelationList = [];
  566. for (var t = 0; t < res.data.length; t++) {
  567. MainRelationList.push({
  568. text: res.data[t].dictLabel,
  569. dictCode: res.data[t].dictValue,
  570. });
  571. }
  572. this.MainRelationList = MainRelationList;
  573. });
  574. },
  575. getManagementModelList() {
  576. getManagementModelList().then((res) => {
  577. var ManagementModelList = [];
  578. for (var t = 0; t < res.data.length; t++) {
  579. ManagementModelList.push({
  580. text: res.data[t].dictLabel,
  581. dictCode: res.data[t].dictValue,
  582. });
  583. }
  584. this.ManagementModelList = ManagementModelList;
  585. });
  586. },
  587. getSJSList() {
  588. getSJSList({}).then((res) => {
  589. var SJSList = [];
  590. for (var t = 0; t < res.data.length; t++) {
  591. SJSList.push({
  592. text: res.data[t].dictLabel,
  593. dictCode: res.data[t].dictValue,
  594. });
  595. }
  596. this.SJSList = SJSList;
  597. });
  598. },
  599. getQGJZist() {
  600. getQGJZist({}).then((res) => {
  601. var QGJZist = [];
  602. for (var t = 0; t < res.data.length; t++) {
  603. QGJZist.push({
  604. text: res.data[t].dictLabel,
  605. dictCode: res.data[t].dictValue,
  606. });
  607. }
  608. this.QGJZist = QGJZist;
  609. });
  610. },
  611. getTCFXList() {
  612. getTCFXList({}).then((res) => {
  613. var TCFXList = [];
  614. for (var t = 0; t < res.data.length; t++) {
  615. TCFXList.push({
  616. text: res.data[t].dictLabel,
  617. dictCode: res.data[t].dictCode,
  618. dictValue: res.data[t].dictValue,
  619. remark: res.data[t].remark,
  620. });
  621. }
  622. this.TCFXList = TCFXList;
  623. });
  624. },
  625. visitsFn(row) {
  626. this.$router.push({
  627. path: '/historicalDetails',
  628. query: {
  629. visitId: row.id,
  630. storeCode: row.storeCode,
  631. storeId: row.storeId,
  632. },
  633. });
  634. },
  635. setImgSrc(imgUrl) {
  636. let imgArr = imgUrl.split(',');
  637. return imgArr[0];
  638. },
  639. deleteImgs(val) {
  640. ImagePreview(val.split(','));
  641. },
  642. getStoreType() {
  643. // 先授权
  644. getTicketFun().then(() => {
  645. if (localStorage.getItem('storeType') == '2') {
  646. this.DIYshow = true;
  647. getStoreyslTypeList({}).then((res) => {
  648. this.storeTypeList = res.data;
  649. this.getDetail();
  650. });
  651. } else {
  652. this.DIYshow = false;
  653. getStoreTypeList({}).then((res) => {
  654. this.storeTypeList = res.data;
  655. this.getDetail();
  656. });
  657. }
  658. });
  659. },
  660. getDetail() {
  661. this.pageShow = false;
  662. this.lat = '';
  663. this.lon = '';
  664. let loading1 = this.$toast.loading({
  665. duration: 0,
  666. message: '加载中...',
  667. forbidClick: true,
  668. });
  669. getById({ storeId: this.$route.query.id }).then((res) => {
  670. loading1.clear();
  671. localStorage.setItem('locationRemark', res.data.addressLine);
  672. localStorage.setItem('orgName', res.data.orgName);
  673. localStorage.setItem('chainName', res.data.storeName);
  674. if (res.code == 200) {
  675. if (res.data.lat != null) {
  676. this.lat = res.data.lat;
  677. this.lon = res.data.lon;
  678. }
  679. this.list = res.data;
  680. this.sfaStoreChainsContactList = this.list.sfaStoreChainsContactList;
  681. if (this.list.imgSed && this.list.imgSed != '') {
  682. this.displayImg = this.list.imgSed.split(',');
  683. } else {
  684. this.displayImg = [];
  685. }
  686. if (
  687. this.verifyStoreType(this.list.storeCategory) &&
  688. this.verifyStoreType(this.list.storeCategory).type == 'fxd'
  689. ) {
  690. this.cityABStore = true;
  691. } else {
  692. this.cityABStore = false;
  693. }
  694. if (
  695. res.data.province != null &&
  696. res.data.province != undefined &&
  697. res.data.province != ''
  698. ) {
  699. this.getStreetQuery('1');
  700. }
  701. if (res.data.city != null && res.data.city != undefined && res.data.city != '') {
  702. this.getStreetQuery('2');
  703. }
  704. if (
  705. res.data.district != null &&
  706. res.data.district != undefined &&
  707. res.data.district != ''
  708. ) {
  709. this.getStreetQuery('3');
  710. }
  711. if (this.list.carShopImgList != null) {
  712. } else {
  713. this.list.carShopImgList = [];
  714. }
  715. if (
  716. this.verifyStoreType(this.list.storeCategory) &&
  717. this.verifyStoreType(this.list.storeCategory).type == 'fxd'
  718. ) {
  719. this.typeABshow = true;
  720. } else {
  721. this.typeABshow = false;
  722. }
  723. if (this.list.storeCategory == 'C917') {
  724. this.GZAttributeFormShow = true;
  725. this.dictTypeSJSFormShow = false;
  726. this.dictTypeQGJZFormShow = false;
  727. this.dictTypeFormShow = false;
  728. this.dictTypeAFormShow = false;
  729. this.typeABshow = false;
  730. for (let k = 0; k < this.potentialCustomerTypeList.length; k++) {
  731. if (this.potentialCustomerTypeList[k].dictCode == this.list.potentialCustomerType) {
  732. this.list.potentialCustomerType = this.potentialCustomerTypeList[k].text;
  733. }
  734. }
  735. } else {
  736. this.GZAttributeFormShow = false;
  737. }
  738. if (
  739. this.verifyStoreType(this.list.storeCategory) &&
  740. this.verifyStoreType(this.list.storeCategory).type == 'fxd'
  741. ) {
  742. this.dictTypeFormShow = true;
  743. for (var k = 0; k < this.TCFXList.length; k++) {
  744. if (this.TCFXList[k].dictCode == this.list.tcfxName) {
  745. this.list.tcfxName = this.TCFXList[k].text;
  746. }
  747. }
  748. }
  749. if (this.list.storeCategory == 'sjs61') {
  750. this.dictTypeFormShow = true;
  751. for (var k = 0; k < this.SJSList.length; k++) {
  752. if (this.SJSList[k].dictCode == this.list.tcfxName) {
  753. this.list.tcfxName = this.SJSList[k].text;
  754. }
  755. }
  756. }
  757. if (this.list.storeCategory == 'zyjz63') {
  758. this.dictTypeFormShow = true;
  759. for (var k = 0; k < this.QGJZist.length; k++) {
  760. if (this.QGJZist[k].dictCode == this.list.tcfxName) {
  761. this.list.tcfxName = this.QGJZist[k].text;
  762. }
  763. }
  764. }
  765. if (this.list.storeCategory == 'C912') {
  766. this.storeTypePOP = false;
  767. this.storeName = '铭牌上项目名称';
  768. this.address = '地址';
  769. } else if (this.list.storeCategory == 'C917') {
  770. this.storeTypePOP = false;
  771. this.storeName = '名称';
  772. this.address = '地址';
  773. } else {
  774. this.storeTypePOP = true;
  775. this.storeName = '名称';
  776. this.address = '地址';
  777. }
  778. // 获取定位
  779. getPosition()
  780. .then((res) => {
  781. let { TXisBD, resData } = res;
  782. this.lat = TXisBD.lat;
  783. this.lon = TXisBD.lon;
  784. this.myLat = TXisBD.lat;
  785. this.myLon = TXisBD.lon;
  786. this.list.lon = TXisBD.lon;
  787. this.list.lat = TXisBD.lat;
  788. })
  789. .catch((err) => {
  790. console.log(err);
  791. });
  792. this.pageShow = true;
  793. } else {
  794. this.$toast.fail(res.msg);
  795. }
  796. });
  797. },
  798. onClickLeft() {
  799. this.$router.go(-1);
  800. },
  801. tabChange(name, title) {
  802. console.log(name, title);
  803. },
  804. // 预览
  805. previewsImg(index) {
  806. var arrimg = [];
  807. for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
  808. arrimg.push(this.displayImg[imgi]);
  809. }
  810. ImagePreview({
  811. images: arrimg,
  812. startPosition: index,
  813. });
  814. },
  815. //获取经销商
  816. async getStoreChainsContact() {
  817. // 打开select,上次选中确认数据赋值给选中待确认,回显使用
  818. this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
  819. if (!this.treeSelect.length) {
  820. this.toastLoading(0, '加载中...', true);
  821. listChainsByCategory({ orgId: this.list.orgId }).then((res) => {
  822. this.toastLoading().clear();
  823. // 初始化数据
  824. res.data.forEach((val) => {
  825. val.dot = false;
  826. });
  827. this.showPickerChainsList = true;
  828. this.treeSelect = res.data;
  829. this.sfaStoreChainsContactList.forEach((val) => {
  830. this.treeSelect.find((item) => {
  831. if (item.code == val.categoryCode) {
  832. item.isCheck = true;
  833. item.children.push({
  834. isCheck: true,
  835. categoryCode: val.categoryCode,
  836. categoryDescribe: val.categoryDescribe,
  837. chainCode: val.chainCode,
  838. chainName: val.chainName,
  839. });
  840. }
  841. });
  842. });
  843. this.setCheckData();
  844. });
  845. } else {
  846. this.showPickerChainsList = true;
  847. this.setCheckData();
  848. }
  849. },
  850. setCheckData() {
  851. for (let x = 0; x < this.treeSelect.length; x++) {
  852. // 设置左侧选中图标
  853. let activate = this.activatedTCFXList.find((item) => {
  854. return item.categoryCode == this.treeSelect[x].code;
  855. });
  856. this.treeSelect[x].dot = activate ? true : false;
  857. // 右侧选中返现
  858. let children = this.treeSelect[x].children;
  859. if (children && this.treeSelect[x].dot) {
  860. for (let y = 0; y < children.length; y++) {
  861. let activate = this.activatedTCFXList.find((item) => {
  862. return (
  863. children[y].categoryCode == item.categoryCode &&
  864. children[y].chainCode == item.chainCode
  865. );
  866. });
  867. if (activate) {
  868. children[y].Check = true;
  869. } else {
  870. children[y].Check = false;
  871. }
  872. }
  873. }
  874. }
  875. this.$forceUpdate();
  876. this.activeIndex = 0;
  877. },
  878. // 左侧数据点击
  879. clickNav(index) {},
  880. // 右侧数据点击
  881. treeSelectItemClick(itemData, index, val, ind) {
  882. if (itemData.isCheck) return;
  883. itemData.children.forEach((item) => {
  884. if (val.chainCode == item.chainCode) {
  885. item.Check = !item.Check;
  886. // 设置左侧选中图标
  887. itemData.dot = item.Check;
  888. } else {
  889. item.Check = false;
  890. }
  891. });
  892. this.$forceUpdate();
  893. },
  894. // 分销店 确认
  895. treeSelectConfirm() {
  896. let treeSelectArr = [];
  897. this.treeSelect.forEach((item) => {
  898. if (item.dot) {
  899. item.children.forEach((val) => {
  900. if (val.Check || val.isCheck) {
  901. treeSelectArr.push(val);
  902. }
  903. });
  904. }
  905. });
  906. if (!treeSelectArr.length) {
  907. this.$toast('请选择至少选择一个经销商');
  908. return false;
  909. }
  910. console.log(treeSelectArr);
  911. this.sfaStoreChainsContactList = treeSelectArr;
  912. this.showPickerChainsList = false;
  913. },
  914. },
  915. };
  916. </script>
  917. <style scoped lang="scss">
  918. .container {
  919. padding-bottom: 50px;
  920. }
  921. .myTab .van-tabs__nav--card {
  922. margin: 0 !important;
  923. border-left: 0;
  924. border-right: 0;
  925. }
  926. .myTab .van-tabs__wrap,
  927. .van-tabs__nav--card {
  928. height: 40px;
  929. }
  930. .myTab .van-tab {
  931. line-height: 40px;
  932. }
  933. .helpPageMask {
  934. width: 100%;
  935. height: 100%;
  936. background: rgba(116, 116, 116, 0.8);
  937. position: fixed;
  938. z-index: 100000;
  939. top: 0;
  940. right: 0;
  941. left: 0;
  942. bottom: 0;
  943. display: flex;
  944. align-items: center;
  945. justify-content: center;
  946. }
  947. .bottomBtn {
  948. position: fixed;
  949. bottom: 0;
  950. height: 50px;
  951. width: 100%;
  952. display: flex;
  953. flex-direction: row;
  954. justify-content: space-around;
  955. .van-button {
  956. /* flex: 1; */
  957. width: 40%;
  958. }
  959. }
  960. .rejectMsg {
  961. position: sticky;
  962. top: 46px;
  963. z-index: 10;
  964. display: flex;
  965. box-sizing: border-box;
  966. width: 100%;
  967. padding: 10px 16px;
  968. overflow: hidden;
  969. color: #323233;
  970. font-size: 14px;
  971. line-height: 24px;
  972. background-color: #f5daac;
  973. font-weight: 600;
  974. .label {
  975. width: 6.2em;
  976. margin-right: 12px;
  977. }
  978. .value {
  979. flex: 1;
  980. overflow: hidden;
  981. text-overflow: ellipsis;
  982. display: -webkit-box;
  983. -webkit-line-clamp: 2;
  984. -webkit-box-orient: vertical;
  985. padding-right: 20px;
  986. }
  987. .examineDetail {
  988. width: 70px;
  989. color: #0057ba;
  990. }
  991. }
  992. .rejectMsgBox {
  993. min-height: 30%;
  994. max-height: 50%;
  995. padding: 10px 20px;
  996. display: flex;
  997. flex-direction: column;
  998. overflow: hidden;
  999. .title {
  1000. padding: 10px 0;
  1001. text-align: center;
  1002. font-size: 16px;
  1003. font-weight: 600px;
  1004. }
  1005. .content {
  1006. flex: 1;
  1007. overflow-y: auto;
  1008. .rejectMsgItem {
  1009. margin-bottom: 20px;
  1010. .item {
  1011. padding: 5px 0;
  1012. span {
  1013. display: inline-block;
  1014. }
  1015. }
  1016. .label {
  1017. width: 80px;
  1018. font-size: 14px;
  1019. font-weight: 600;
  1020. }
  1021. .value {
  1022. font-size: 14px;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. .orderList {
  1028. .orderItem {
  1029. .orderTitle {
  1030. padding: 5px 0;
  1031. font-size: 16px;
  1032. font-weight: 600;
  1033. color: #000;
  1034. display: flex;
  1035. align-items: center;
  1036. &::before {
  1037. content: '';
  1038. width: 8px;
  1039. height: 8px;
  1040. background: red;
  1041. border-radius: 50%;
  1042. display: inline-block;
  1043. margin-right: 5px;
  1044. }
  1045. }
  1046. }
  1047. }
  1048. .displayImg {
  1049. .displayImgBox {
  1050. position: relative;
  1051. width: 48%;
  1052. padding: 20px 0;
  1053. height: 210px;
  1054. float: left;
  1055. margin-right: 4%;
  1056. .title {
  1057. text-align: center;
  1058. padding: 5px 0;
  1059. }
  1060. }
  1061. .displayImgBox:nth-child(even) {
  1062. margin-right: 0;
  1063. }
  1064. i {
  1065. position: absolute;
  1066. right: 4px;
  1067. color: white;
  1068. background: red;
  1069. overflow: hidden;
  1070. border-radius: 50%;
  1071. }
  1072. }
  1073. .approvalBtnBox {
  1074. display: flex;
  1075. .approvalBtn {
  1076. flex: 1;
  1077. margin: 0 3px;
  1078. .van-button--danger {
  1079. background-color: #ee0a24 !important;
  1080. border: 1px solid #ee0a24 !important;
  1081. }
  1082. }
  1083. }
  1084. </style>
  1085. <style lang="scss">
  1086. .searchDiv {
  1087. .van-search {
  1088. /* // background: #fff; */
  1089. }
  1090. .van-search__action {
  1091. font-size: 14px;
  1092. color: #0057ba;
  1093. font-weight: bold;
  1094. background: #f1f1f1;
  1095. border-bottom-right-radius: 60px;
  1096. border-top-right-radius: 60px;
  1097. border: 1px solid #ccc;
  1098. padding: 0 20px;
  1099. }
  1100. .van-search--show-action {
  1101. padding-right: 12px;
  1102. }
  1103. .van-search__content {
  1104. border: 1px solid #ccc;
  1105. border-bottom-left-radius: 60px;
  1106. border-top-left-radius: 60px;
  1107. background: #f1f1f1;
  1108. border-right: 0;
  1109. }
  1110. }
  1111. .helpAlert {
  1112. .van-dialog__cancel {
  1113. .van-button__text {
  1114. &::before {
  1115. content: '?';
  1116. background: #f79200;
  1117. width: 20px;
  1118. display: inline-block;
  1119. border-radius: 50%;
  1120. color: #fff;
  1121. }
  1122. }
  1123. }
  1124. }
  1125. .chainMaintain {
  1126. .agencyBox {
  1127. .header_btn {
  1128. display: flex;
  1129. align-items: center;
  1130. justify-content: space-between;
  1131. padding: 10px;
  1132. font-size: 16px;
  1133. border-bottom: 1px solid #ccc;
  1134. div {
  1135. padding: 3px;
  1136. }
  1137. }
  1138. .van-sidebar {
  1139. width: 100px;
  1140. text-align: center;
  1141. flex: none;
  1142. }
  1143. .treeSelectchildren {
  1144. .item {
  1145. display: flex;
  1146. align-items: center;
  1147. padding: 5px;
  1148. .value {
  1149. margin-left: 15px;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. .TCFXList {
  1155. .van-field__control--custom {
  1156. flex-direction: column;
  1157. align-items: self-start;
  1158. .TCFXListTreeSelec {
  1159. padding: 3px;
  1160. }
  1161. }
  1162. }
  1163. }
  1164. </style>