storeEdit.vue 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221
  1. <template>
  2. <div class="storeEdit">
  3. <!-- 顶部条-->
  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. </div>
  13. <!-- 主体内容-->
  14. <div style="margin-top: 44px">
  15. <van-dialog v-model="show" title="门店位置">
  16. <mapmarker :info="fromValue"></mapmarker>
  17. </van-dialog>
  18. <van-form ref="tabstoreVal">
  19. <van-tabs class="myTab" v-model="tabVal" color="#1989fa">
  20. <van-tab title="基础信息" name="insidePlan">
  21. <van-field readonly v-model="fromValue.storeCode" label="编号">
  22. <template #left-icon>
  23. <span class="van-f-red"> </span>
  24. </template>
  25. </van-field>
  26. <van-field
  27. readonly
  28. clickable
  29. name="picker"
  30. :value="fromValue.storeCategoryName"
  31. label="类型"
  32. placeholder="点击选择类型"
  33. @click="showPicker = true">
  34. <template #left-icon>
  35. <span class="van-f-red">*</span>
  36. </template>
  37. </van-field>
  38. <van-field
  39. readonly
  40. clickable
  41. name="picker"
  42. :value="fromValue.orgName"
  43. label="部门名称"
  44. placeholder="点击选择部门名称"
  45. @click="PickerDept">
  46. <template #left-icon>
  47. <span class="van-f-red">*</span>
  48. </template>
  49. </van-field>
  50. <div
  51. style="background-color: white; padding: 0 14px"
  52. class="morelaji"
  53. v-if="fromValue.storeCategory != 'C917'">
  54. <!-- 分销店 -->
  55. <template
  56. v-if="
  57. verifyStoreType(fromValue.storeCategory) &&
  58. verifyStoreType(fromValue.storeCategory).type == 'fxd'
  59. ">
  60. <van-row style="border-bottom: 1px solid #ebedf0">
  61. <van-col span="24">
  62. <van-field label="经销商名称" @click="showPickerChainsListFn" class="TCFXList">
  63. <template #left-icon>
  64. <span class="van-f-red">*</span>
  65. </template>
  66. <template #input>
  67. <template
  68. v-if="sfaStoreChainsContactList && sfaStoreChainsContactList.length">
  69. <div
  70. class="sfaStoreChainsContactList"
  71. v-for="(item, index) in sfaStoreChainsContactList"
  72. :key="index">
  73. {{ item.categoryDescribe }}
  74. {{ item.chainCode }}
  75. {{ item.chainName }}
  76. </div>
  77. </template>
  78. <template v-else>
  79. <span style="color: rgb(150, 151, 153)"> 点击选择经销商名称 </span>
  80. </template>
  81. </template>
  82. </van-field>
  83. </van-col>
  84. </van-row>
  85. </template>
  86. <template v-else>
  87. <van-row style="border-bottom: 1px solid #ebedf0">
  88. <van-col span="20">
  89. <van-field
  90. rows="1"
  91. autosize
  92. type="textarea"
  93. readonly
  94. clickable
  95. name="picker"
  96. :value="fromValue.chainName"
  97. label="经销商名称"
  98. placeholder="点击选择经销商名称"
  99. @click="showPickerChainsListFn">
  100. <template #left-icon>
  101. <span
  102. v-if="
  103. fromValue.ifJzStoreType != 1 &&
  104. fromValue.storeCategory != 'C912' &&
  105. fromValue.storeCategory != 'C917'
  106. "
  107. class="van-f-red"
  108. >*</span
  109. >
  110. </template>
  111. </van-field>
  112. </van-col>
  113. <van-col span="4"
  114. ><van-button
  115. size="small"
  116. type="info"
  117. style="margin-top: 6px"
  118. native-type="button"
  119. @click="moreTypeShowFn"
  120. ><van-icon name="list-switching" />更多</van-button
  121. ></van-col
  122. >
  123. </van-row>
  124. </template>
  125. </div>
  126. <van-field
  127. v-model="fromValue.storeName"
  128. @blur="setStoreNameFn"
  129. :label="storeName"
  130. placeholder="请输入">
  131. <template #left-icon>
  132. <span class="van-f-red">*</span>
  133. </template>
  134. </van-field>
  135. <van-field
  136. readonly
  137. clickable
  138. name="picker"
  139. :value="fromValue.provinceName"
  140. label="省(州)"
  141. placeholder="点击选择省(州)"
  142. @click="showProvincePicker = true">
  143. <template #left-icon>
  144. <span class="van-f-red">*</span>
  145. </template>
  146. </van-field>
  147. <van-field
  148. readonly
  149. clickable
  150. name="picker"
  151. :value="fromValue.cityName"
  152. label="城市"
  153. placeholder="点击选择城市"
  154. @click="showCityPicker = true">
  155. <template #left-icon>
  156. <span class="van-f-red">*</span>
  157. </template>
  158. </van-field>
  159. <van-field
  160. readonly
  161. clickable
  162. name="picker"
  163. :value="fromValue.districtName"
  164. label="区(县)"
  165. placeholder="点击选择区(县)"
  166. @click="showDistrictPicker = true">
  167. <template #left-icon>
  168. <span class="van-f-red">*</span>
  169. </template>
  170. </van-field>
  171. <van-field
  172. readonly
  173. clickable
  174. name="picker"
  175. :value="fromValue.townName"
  176. label="街道"
  177. placeholder="点击选择街道"
  178. @click="showTownPicker = true">
  179. <template #left-icon>
  180. <span class="van-f-red">*</span>
  181. </template>
  182. </van-field>
  183. <van-field
  184. v-model="fromValue.addressLine"
  185. rows="1"
  186. autosize
  187. type="textarea"
  188. :label="address"
  189. placeholder="地址"
  190. @blur="addressFn">
  191. <template #left-icon>
  192. <span class="van-f-red">*</span>
  193. </template>
  194. <template #button>
  195. <van-button size="small" type="info" native-type="button" @click="fns"
  196. ><van-icon name="location-o" />地图</van-button
  197. >
  198. </template>
  199. </van-field>
  200. <van-field v-model="fromValue.lat" readonly label="经度" placeholder="经度">
  201. <template #left-icon>
  202. <span class="van-f-red"> </span>
  203. </template>
  204. </van-field>
  205. <van-field v-model="fromValue.lon" readonly label="维度" placeholder="维度">
  206. <template #left-icon>
  207. <span class="van-f-red"> </span>
  208. </template>
  209. </van-field>
  210. <van-field
  211. readonly
  212. clickable
  213. name="picker"
  214. :value="fromValue.cityLevel"
  215. label="城市等级"
  216. placeholder="点击选择城市等级">
  217. <template #left-icon>
  218. <span class="van-f-red"></span>
  219. </template>
  220. </van-field>
  221. <div v-if="fromValue.storeCategory != 'C917'">
  222. <van-field
  223. v-if="fromValue.ifJzStoreType != 1"
  224. v-model="fromValue.area"
  225. @input="numberFn"
  226. type="number"
  227. label="面积(m²)"
  228. placeholder="面积">
  229. <template #left-icon>
  230. <span class="van-f-red"> </span>
  231. </template>
  232. </van-field>
  233. <van-field
  234. v-if="fromValue.ifJzStoreType == 1"
  235. v-model="fromValue.area"
  236. @input="numberFn"
  237. type="number"
  238. label="家装展厅面积(m²)"
  239. placeholder="面积">
  240. <template #left-icon>
  241. <span class="van-f-red">*</span>
  242. </template>
  243. </van-field>
  244. </div>
  245. <van-field
  246. v-model="fromValue.contactName"
  247. v-if="fromValue.ifJzStoreType != 1 && fromValue.storeCategory != 'C917'"
  248. label="联系人"
  249. placeholder="联系人">
  250. <template #left-icon>
  251. <span class="van-f-red">*</span>
  252. </template>
  253. </van-field>
  254. <van-field
  255. v-model="fromValue.contactName"
  256. v-if="fromValue.ifJzStoreType == 1 && fromValue.storeCategory != 'C917'"
  257. label="老板"
  258. placeholder="老板">
  259. <template #left-icon>
  260. <span class="van-f-red"> </span>
  261. </template>
  262. </van-field>
  263. <van-field
  264. v-if="fromValue.storeCategory != 'C917'"
  265. type="tel"
  266. v-model="fromValue.telephone"
  267. label="联系电话"
  268. placeholder="联系电话"
  269. @blur="phoneCheck">
  270. <template #left-icon>
  271. <span class="van-f-red" v-if="fromValue.ifJzStoreType != 1">*</span>
  272. </template>
  273. </van-field>
  274. <van-field
  275. readonly
  276. v-model="fromValue.salesmanName"
  277. label="销售员"
  278. placeholder="销售员">
  279. <template #left-icon>
  280. <span class="van-f-red"> </span>
  281. </template>
  282. </van-field>
  283. <div v-if="GZAttributeFormShow" style="background-color: #ffffff; padding: 10px">
  284. <p style="color: #666"><span class="van-f-red">*</span>潜在客户类型</p>
  285. <div style="padding: 4px">
  286. <van-radio-group v-model="fromValue.potentialCustomerType" class="typeRadioStore1">
  287. <van-row gutter="20">
  288. <van-col
  289. span="12"
  290. v-for="(item, index) in potentialCustomerTypeList"
  291. :key="index"
  292. style="margin-bottom: 10px">
  293. <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
  294. </van-col>
  295. </van-row>
  296. </van-radio-group>
  297. </div>
  298. </div>
  299. <van-field label="是否车铺开店" v-if="typeABshow">
  300. <template #input>
  301. <span v-if="fromValue.carShop == 1">是</span>
  302. <span v-if="fromValue.carShop == 0">否</span>
  303. </template>
  304. <template #left-icon>
  305. <span class="van-f-red">*</span>
  306. </template>
  307. </van-field>
  308. <van-field label="车铺照片" v-if="fromValue.carShop == 1 && typeABshow">
  309. <template #left-icon>
  310. <span class="van-f-red">*</span>
  311. </template>
  312. </van-field>
  313. <div v-if="fromValue.carShop == 1 && typeABshow">
  314. <p
  315. style="
  316. color: #666;
  317. font-size: 14px;
  318. margin: 0;
  319. background-color: #fff;
  320. padding: 6px 18px;
  321. ">
  322. 注:店招及车铺产品拍在一张照片里
  323. </p>
  324. <viewUploadImg :imgs="fromValue.carShopImgList"></viewUploadImg>
  325. </div>
  326. <!-- 同城分销店提示 同城店铺 未结案时 -->
  327. <div
  328. v-if="fromValue.approvalStatus == 0"
  329. style="font-size: 16px; font-weight: 600; padding: 10px 16px 0 16px">
  330. 该店首批铺货要求<span style="color: red">1000元</span>,请上传陈列照片
  331. </div>
  332. <div v-if="fromValue.storeCategory != 'C917'">
  333. <div style="padding: 0 20px 20px 20px; height: 228px; background-color: #f1f1f1">
  334. <div class="displayImg">
  335. <div class="displayImgBox">
  336. <div v-if="storeTypePOP">
  337. <upload-img
  338. :uploadid="uploadid2"
  339. :imgArr="fromValue.img"
  340. @newimgarr="newimgarr1"
  341. :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
  342. :disabled="true"
  343. :type="1"></upload-img>
  344. </div>
  345. <div v-else>
  346. <upload-img
  347. :uploadid="uploadid2"
  348. :imgArr="fromValue.img"
  349. @newimgarr="newimgarr1"
  350. :imgText="fromValue.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片'"
  351. :type="1"></upload-img>
  352. </div>
  353. </div>
  354. <template
  355. v-if="fromValue.ifJzStoreType != 1 && storeTypePOP && displayImg.length">
  356. <div class="displayImgBox" v-for="(urls, index) in displayImg" :key="index">
  357. <van-icon name="close" size="16" @click="deleteImg(index)" />
  358. <img :src="urls" width="99%" height="99%" @click="previewsImg(index)" />
  359. <div class="title">陈列照</div>
  360. </div>
  361. </template>
  362. <div class="displayImgBox" v-if="fromValue.ifJzStoreType != 1">
  363. <div v-if="storeTypePOP">
  364. <upload-img
  365. v-if="fromValue.ifJzStoreType != 1"
  366. :uploadid="uploadid2"
  367. imgArr=""
  368. @newimgarr="newimgarr1"
  369. imgText="陈列照(至少一张)"
  370. :type="2"
  371. :count="1"></upload-img>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <!-- 无效店铺,关闭店铺 -->
  378. <!-- <div class="invalid">
  379. <van-button type="warning" round @click="valid">无效关店</van-button>
  380. </div> -->
  381. </van-tab>
  382. <van-tab title="属性信息" name="Planpic">
  383. <!-- 同城分销店-属性信息 -->
  384. <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
  385. <p style="color: #666; font-size: 14px"><span class="van-f-red">*</span>属性</p>
  386. <div style="padding: 4px">
  387. <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
  388. <van-row gutter="20">
  389. <van-col
  390. span="12"
  391. v-for="(item, index) in TCFXList"
  392. :key="index"
  393. style="margin-bottom: 10px"
  394. v-if="item.remark == fromValue.storeCategory">
  395. <van-radio shape="square" :name="item.dictCode + ''">{{
  396. item.text
  397. }}</van-radio>
  398. </van-col>
  399. </van-row>
  400. </van-radio-group>
  401. </div>
  402. <!-- 主营竞品品牌 -->
  403. <p style="color: #666; font-size: 14px">
  404. <span class="van-f-red">*</span>主营竞品品牌
  405. </p>
  406. <div style="padding: 4px">
  407. <van-checkbox-group
  408. v-model="fromValue.storeCompetitorList"
  409. direction="horizontal"
  410. class="typeRadioStore1">
  411. <van-row gutter="24">
  412. <van-col
  413. span="12"
  414. v-for="(item, index) in storeCompetitorlist"
  415. style="margin-bottom: 10px">
  416. <van-checkbox
  417. v-if="item.dictLabel != '其他'"
  418. :name="item.dictValue"
  419. shape="square"
  420. :key="index">
  421. {{ item.dictValue }}
  422. </van-checkbox>
  423. </van-col>
  424. </van-row>
  425. </van-checkbox-group>
  426. <van-field
  427. name="otherCompetitor"
  428. class="otherCompetitor"
  429. v-model="fromValue.otherCompetitor"
  430. autosize
  431. type="textarea"
  432. label="其他"
  433. maxlength="20"
  434. placeholder="请输入" />
  435. </div>
  436. </div>
  437. <div v-if="dictTypeSJSFormShow" style="background-color: #ffffff; padding: 10px">
  438. <p style="color: #666"><span class="van-f-red">*</span>属性</p>
  439. <div style="padding: 4px">
  440. <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
  441. <van-row gutter="20">
  442. <van-col
  443. span="12"
  444. v-for="(item, index) in SJSList"
  445. :key="index"
  446. style="margin-bottom: 10px">
  447. <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
  448. </van-col>
  449. </van-row>
  450. </van-radio-group>
  451. </div>
  452. </div>
  453. <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
  454. <p style="color: #666"><span class="van-f-red">*</span>属性</p>
  455. <div style="padding: 4px">
  456. <van-radio-group
  457. v-model="fromValue.attribute3"
  458. class="typeRadioStore1"
  459. @change="attrChange">
  460. <van-row gutter="20">
  461. <van-col
  462. span="12"
  463. v-for="(item, index) in brandst"
  464. :key="index"
  465. style="margin-bottom: 10px">
  466. <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
  467. </van-col>
  468. </van-row>
  469. </van-radio-group>
  470. </div>
  471. <van-field
  472. v-if="attrShow"
  473. v-model="fromValue.attribute5"
  474. label="其他品牌"
  475. placeholder="其他品牌">
  476. <template #left-icon>
  477. <span class="van-f-red">*</span>
  478. </template>
  479. </van-field>
  480. </div>
  481. <div v-if="dictTypeQGJZFormShow" style="background-color: #ffffff; padding: 10px">
  482. <p style="color: #666"><span class="van-f-red">*</span>属性</p>
  483. <div style="padding: 4px">
  484. <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
  485. <van-row gutter="20">
  486. <van-col
  487. span="12"
  488. v-for="(item, index) in QGJZist"
  489. :key="index"
  490. style="margin-bottom: 10px">
  491. <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
  492. </van-col>
  493. </van-row>
  494. </van-radio-group>
  495. </div>
  496. </div>
  497. </van-tab>
  498. </van-tabs>
  499. </van-form>
  500. </div>
  501. <!--类型-->
  502. <van-popup v-model="showPicker" position="bottom">
  503. <van-picker
  504. show-toolbar
  505. :columns="storeCategoryList"
  506. value-key="dictLabel"
  507. @confirm="onConfirm"
  508. @cancel="showPicker = false" />
  509. </van-popup>
  510. <!--经销商-->
  511. <van-popup
  512. v-model="showPickerChainsList"
  513. position="bottom"
  514. class="agencyBox"
  515. :close-on-click-overlay="false">
  516. <!-- 分销店 -->
  517. <template
  518. v-if="
  519. verifyStoreType(fromValue.storeCategory) &&
  520. verifyStoreType(fromValue.storeCategory).type == 'fxd'
  521. ">
  522. <div class="header_btn">
  523. <div class="cancel" @click="showPickerChainsList = false">取消</div>
  524. <div class="confirm" @click="treeSelectConfirm">确定</div>
  525. </div>
  526. <van-tree-select
  527. :items="treeSelect"
  528. :main-active-index.sync="activeIndex"
  529. @click-nav="clickNav">
  530. <template #content>
  531. <div
  532. class="treeSelectchildren"
  533. v-if="activeIndex == index"
  534. v-for="(item, index) in treeSelect"
  535. :key="index">
  536. <div
  537. class="item"
  538. v-for="(val, ind) in item.children"
  539. :key="ind"
  540. @click="treeSelectItemClick(item, index, val, ind)">
  541. <div
  542. :class="{
  543. 'van-radio__icon': true,
  544. 'van-radio__icon--round': true,
  545. 'van-radio__icon--checked': val.Check,
  546. }">
  547. <i class="van-icon van-icon-success"></i>
  548. </div>
  549. <div class="value">{{ val.chainCode }} {{ val.chainName }}</div>
  550. </div>
  551. </div>
  552. </template>
  553. </van-tree-select>
  554. </template>
  555. <template v-else>
  556. <van-picker
  557. show-toolbar
  558. :columns="ChainsList"
  559. value-key="chainName"
  560. @confirm="onConfirmChainsList"
  561. @cancel="showPickerChainsList = false" />
  562. </template>
  563. </van-popup>
  564. <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%; font-size: 14px">
  565. <van-row style="background-color: #f5f5f5">
  566. <van-col span="20">
  567. <van-field
  568. left-icon="search"
  569. style="margin-top: 2px; border-radius: 6px; overflow: hidden"
  570. v-model="chainName"
  571. label=""
  572. placeholder="请输入关键词"
  573. clearable />
  574. </van-col>
  575. <van-col
  576. span="4"
  577. style="text-align: center; line-height: 48px"
  578. @click="getChainsByDeptCodesearch">
  579. <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
  580. >
  581. </van-row>
  582. <van-picker
  583. show-toolbar
  584. :columns="ChainsLists"
  585. value-key="chainName"
  586. @confirm="onConfirmChainsList"
  587. @cancel="moreTypeShow = false" />
  588. </van-popup>
  589. <van-popup v-model="showPickerDeptList" position="bottom">
  590. <van-picker
  591. show-toolbar
  592. :columns="deptList"
  593. @confirm="onDeptConfirm"
  594. @cancel="showPickerDeptList = false" />
  595. </van-popup>
  596. <!--同城类型-->
  597. <van-popup v-model="showTCFXL" position="bottom">
  598. <van-picker
  599. show-toolbar
  600. :columns="TCFXList"
  601. @confirm="onTCFXLConfirm"
  602. @cancel="showTCFXL = false" />
  603. </van-popup>
  604. <!--省、市、区、街道-->
  605. <van-popup v-model="showProvincePicker" position="bottom">
  606. <van-picker
  607. show-toolbar
  608. title="省(州)"
  609. :columns="provinceList"
  610. @confirm="onProvinceConfirm"
  611. @cancel="showProvincePicker = false" />
  612. </van-popup>
  613. <van-popup v-model="showCityPicker" position="bottom">
  614. <van-picker
  615. show-toolbar
  616. title="城市"
  617. :columns="cityList"
  618. @confirm="onCityConfirm"
  619. @cancel="showCityPicker = false" />
  620. </van-popup>
  621. <van-popup v-model="showDistrictPicker" position="bottom">
  622. <van-picker
  623. show-toolbar
  624. title="县区"
  625. :columns="districtList"
  626. @confirm="onDistrictConfirm"
  627. @cancel="showDistrictPicker = false" />
  628. </van-popup>
  629. <van-popup v-model="showTownPicker" position="bottom">
  630. <van-picker
  631. show-toolbar
  632. title="街道"
  633. :columns="townList"
  634. @confirm="onTownConfirm"
  635. @cancel="showTownPicker = false" />
  636. </van-popup>
  637. <!-- 部门数据 -->
  638. <div id="allmap"></div>
  639. <div style="position: fixed; top: 0; height: 100%; z-index: 3000; width: 100%" v-if="showmap">
  640. <div id="allmap1" style="height: 100%; width: 100%"></div>
  641. <div style="position: fixed; z-index: 99999; top: 0; width: 100%; background-color: white">
  642. <van-search
  643. v-model="search"
  644. shape="round"
  645. background="#0057ba"
  646. @input="searchFn"
  647. placeholder="请输入搜索关键词" />
  648. <div style="height: 200px; overflow: hidden" v-if="searchSHow">
  649. <div style="height: 100px; min-height: 200px; overflow-y: scroll; padding: 12px">
  650. <div
  651. v-for="(itme, index) in mapsearchlist"
  652. style="border-bottom: 1px solid #eee"
  653. @click="addressFns(itme)">
  654. <p>{{ itme.title }}</p>
  655. <p>{{ itme.address }}</p>
  656. </div>
  657. </div>
  658. </div>
  659. </div>
  660. <div class="mapaddress">
  661. <div class="title">
  662. <span @click="showmap = false" style="float: left"
  663. ><van-icon name="cross" size="16"
  664. /></span>
  665. <p class="titleText">附近地址信息</p>
  666. <span style="float: right" @click="confirmMap">确定</span>
  667. </div>
  668. <div class="listBox">
  669. <van-radio-group v-model="addresssb" @change="mapselect">
  670. <van-radio :name="index" v-for="(item, index) in maplist" :key="index">
  671. <p style="margin: 4px 0; font-weight: bold">{{ item.title }}</p>
  672. <p style="margin: 4px 0">{{ item.address }}</p>
  673. </van-radio>
  674. </van-radio-group>
  675. <br />
  676. <br />
  677. <br />
  678. <br />
  679. </div>
  680. </div>
  681. </div>
  682. </div>
  683. </template>
  684. <script>
  685. import {
  686. updateStore,
  687. beforeAdd,
  688. streetQuery,
  689. getTCFXList,
  690. getById,
  691. phoneCheck,
  692. getChainsByDeptCode,
  693. addStore,
  694. checkVisit,
  695. getSJSList,
  696. getQGJZist,
  697. getbrands,
  698. getCustomerInfoList,
  699. getCustomerNatureList,
  700. getMainProjectList,
  701. getMainRelationList,
  702. getManagementModelList,
  703. getpotentialCustomerTypeList,
  704. getDictOption,
  705. } from '@/api/index';
  706. import uploadImg from '@/components/uploadImgVStore';
  707. import uploadImgc from '@/components/uploadImgVStorec';
  708. import viewUploadImg from '@/components/viewUploadImg';
  709. import mapmarker from '@/components/mapMarker';
  710. import { jsonp } from 'vue-jsonp';
  711. import txmapimg1 from '@/assets/txmap1.svg';
  712. import txmapimg2 from '@/assets/txmap2.svg';
  713. import txmapimg3 from '@/assets/marker_blue.png';
  714. import { valid } from '@/api/visitstore';
  715. import { ImagePreview } from 'vant';
  716. import { getPosition, getTicketFun, getMapPoi, getkeywordPoi } from '@/utils/TXApiFun';
  717. import { listChainsByCategory } from '@/api/store';
  718. export default {
  719. name: 'storeAdd',
  720. components: { uploadImg, mapmarker, uploadImgc, viewUploadImg },
  721. data() {
  722. return {
  723. searchSHow: false,
  724. mapsearchlist: [],
  725. search: '',
  726. showmap: false,
  727. showDialog: false,
  728. msgList: '',
  729. tabVal: 'insidePlan',
  730. typeABshow: false,
  731. showPickerChainsList: false,
  732. showDistribute: false,
  733. showProvincePicker: false,
  734. showCityPicker: false,
  735. showDistrictPicker: false,
  736. showTownPicker: false,
  737. showPickerDeptList: false,
  738. dictTypeFormShow: false,
  739. moreTypeShow: false,
  740. typeShow: false,
  741. dictTypeSJSFormShow: false,
  742. dictTypeAFormShow: false,
  743. dictTypeQGJZFormShow: false,
  744. attrShow: false,
  745. provinceList: [],
  746. showTCFXL: false,
  747. show: false,
  748. cityList: [],
  749. deptList: [],
  750. districtList: [],
  751. cont: 0,
  752. townList: [],
  753. uploadid2: 'uploadid2',
  754. storeTypePOP: false,
  755. storeName: '名称',
  756. fromValue: {
  757. addressLine: '',
  758. chainCode: '',
  759. telephone: '',
  760. storeCategoryName: '',
  761. provinceName: '',
  762. salesmanName: '',
  763. orgName: '',
  764. lat: '',
  765. lon: '',
  766. districtName: '',
  767. contactName: '',
  768. cityName: '',
  769. cityLevel: '',
  770. potentialCustomerType: '',
  771. storeName: '',
  772. storeCategory: '',
  773. area: '',
  774. img: '',
  775. imgSed: '',
  776. townName: '',
  777. tcfxName: '',
  778. tcfxCode: '',
  779. orgId: '',
  780. carShop: '',
  781. carShopImgList: [],
  782. showroom: '',
  783. attribute3: '',
  784. attribute5: '',
  785. customerInfoFrom: '',
  786. customerNature: '',
  787. managementModel: '',
  788. mainProjectType: '',
  789. mainRelationFrom: '',
  790. storeCompetitorList: [],
  791. otherCompetitor: '',
  792. },
  793. img: 'https://svs-test.oss-cn-shanghai.aliyuncs.com/1647398239620微信截图_20220315112921.png',
  794. location: {
  795. lat: '34.616712',
  796. lon: '112.440816',
  797. },
  798. checkboxGroup: [],
  799. radio: '',
  800. Radiocolumns: [
  801. { name: '1', text: '选项01' },
  802. { name: '2', text: '选项02' },
  803. ],
  804. showPicker: false,
  805. cityLeveList: [],
  806. storeTypeList: [],
  807. storeCategoryList: [],
  808. ChainsList: [],
  809. TCFXList: [],
  810. imgs: [],
  811. provinceCode: '',
  812. cityCode: '',
  813. countyCode: '',
  814. districtName: '',
  815. contactName: '',
  816. cityName: '',
  817. cityLevel: '',
  818. storeCategory: '',
  819. phoneNumber: true,
  820. sfaOrderProducts: [],
  821. deptShow: false,
  822. validFlag: '',
  823. QGJZist: [],
  824. SJSList: [],
  825. chainName: '',
  826. ChainsLists: [],
  827. address: '地址',
  828. brandst: [],
  829. maplist: [],
  830. ManagementModelList: [],
  831. MainRelationList: [],
  832. MainProjectList: [],
  833. CustomerNatureList: [],
  834. CustomerInfoList: [],
  835. potentialCustomerTypeList: [],
  836. GZAttributeFormShow: false,
  837. addresssb: -1,
  838. markers: undefined,
  839. markers1: undefined,
  840. marker: undefined,
  841. pageShow: false,
  842. map: '',
  843. pLat: '',
  844. pLot: '',
  845. displayImg: [],
  846. activeIndex: 0,
  847. treeSelectItemInd: 0,
  848. treeSelect: [],
  849. sfaStoreChainsContactList: [], //选中确定的经销商
  850. activatedTCFXList: [], //选中的经销商
  851. chainUser: false, //是否经销商用户 true
  852. storeCompetitorlist: [], //主营竞品品牌
  853. otherCompetitor: '', //主营竞品品牌-其他
  854. activatedStoreCompetitor: [],
  855. };
  856. },
  857. activated() {
  858. this.chainUser = localStorage.getItem('chainUser'); //经销商人员(包含分销、先锋)
  859. this.tabVal = 'insidePlan';
  860. this.treeSelect = [];
  861. // 授权
  862. getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
  863. this.getTCFXList();
  864. this.getTCompetitiveProduct();
  865. this.getSJSList();
  866. this.getQGJZist();
  867. this.getDetail();
  868. this.getbrands();
  869. this.getStreetQuery();
  870. this.getCustomerInfoList();
  871. this.getManagementModelList();
  872. this.getMainRelationList();
  873. this.getMainProjectList();
  874. this.getCustomerNatureList();
  875. this.getpotentialCustomerTypeList();
  876. this.showmap = false;
  877. });
  878. },
  879. methods: {
  880. addressFns(val) {
  881. var that = this;
  882. setTimeout(() => {
  883. that.searchSHow = false;
  884. that.map.setCenter(new TMap.LatLng(val.location.lat, val.location.lng));
  885. that.markers1.updateGeometries([
  886. {
  887. id: 'marker',
  888. styleId: 'marker',
  889. position: new TMap.LatLng(val.location.lat, val.location.lng),
  890. },
  891. ]);
  892. that.maplist = [];
  893. // 地点搜索 获取500米范围poi点
  894. getMapPoi({ latitude: val.location.lat, longitude: val.location.lng }).then((res) => {
  895. console.log(res);
  896. that.maplist = res.data;
  897. that.marker.setGeometries([]);
  898. setTimeout(() => {
  899. for (let p = 0; p < res.data.length; p++) {
  900. that.marker.updateGeometries([
  901. {
  902. id: res.data[p].id,
  903. position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
  904. },
  905. ]);
  906. }
  907. });
  908. });
  909. that.addresssb = -1;
  910. });
  911. },
  912. searchFn(val) {
  913. this.searchSHow = false;
  914. getkeywordPoi({ latitude: this.pLat, longitude: this.pLot }, val).then((res) => {
  915. // 不显示下拉选择
  916. if (!res.data.length && !val) {
  917. this.searchSHow = false;
  918. } else {
  919. this.searchSHow = true;
  920. }
  921. // 联想下拉选
  922. this.mapsearchlist = res.data;
  923. });
  924. },
  925. mapselect(val) {
  926. this.searchSHow = false;
  927. if (val > -1) {
  928. this.markers.updateGeometries([
  929. {
  930. id: 'markers1',
  931. styleId: 'abc',
  932. position: new TMap.LatLng(
  933. this.maplist[val].location.lat,
  934. this.maplist[val].location.lng,
  935. ),
  936. },
  937. ]);
  938. }
  939. },
  940. confirmMap() {
  941. if (this.addresssb > -1) {
  942. let checkedPoint = this.maplist[this.addresssb];
  943. // 坐标转换
  944. let TXisBD = this.CJ02BD(checkedPoint.location.lat, checkedPoint.location.lng);
  945. this.fromValue.addressLine = checkedPoint.address;
  946. var location = this.CJ02BD(this.pLat, this.pLot);
  947. this.fromValue.lat = location.lat;
  948. this.fromValue.lon = location.lon;
  949. this.fromValue.poiAddress = checkedPoint.address;
  950. this.fromValue.poiLat = TXisBD.lat;
  951. this.fromValue.poiLon = TXisBD.lon;
  952. this.fromValue.poiId = checkedPoint.id;
  953. this.fromValue.poiName = checkedPoint.title;
  954. }
  955. this.showmap = false;
  956. },
  957. fns() {
  958. this.search = '';
  959. getPosition()
  960. .then((res) => {
  961. let { TXisBD, resData } = res;
  962. this.pLat = resData.latitude;
  963. this.pLot = resData.longitude;
  964. if (this.fromValue.lon == '') {
  965. this.fromValue.lon = TXisBD.lon;
  966. this.fromValue.lat = TXisBD.lat;
  967. }
  968. this.showmap = true;
  969. // 地点搜索 获取500米范围poi点
  970. getMapPoi({ latitude: this.pLat, longitude: this.pLot }).then((res) => {
  971. console.log(res);
  972. this.maplist = res.data;
  973. setTimeout(() => {
  974. this.addVisits1('1');
  975. });
  976. });
  977. })
  978. .catch((error) => {
  979. this.$dialog.alert({
  980. message: error,
  981. });
  982. });
  983. this.addresssb = -1;
  984. },
  985. addVisits1(val) {
  986. var that = this;
  987. var latlng = {
  988. lat: this.pLat,
  989. lon: this.pLot,
  990. };
  991. var map = new TMap.Map('allmap1', {
  992. zoom: 15,
  993. center: new TMap.LatLng(latlng.lat, latlng.lon),
  994. });
  995. var markers = new TMap.MultiMarker({
  996. id: 'markers',
  997. map: map,
  998. geometries: [],
  999. styles: {
  1000. marker: new TMap.MarkerStyle({
  1001. width: 32,
  1002. height: 40,
  1003. anchor: { x: 16, y: 32 },
  1004. src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker-pink.png',
  1005. }),
  1006. },
  1007. });
  1008. markers.setGeometries([]);
  1009. var location = new TMap.LatLng(latlng.lat, latlng.lon);
  1010. map.setCenter(location);
  1011. markers.updateGeometries([
  1012. {
  1013. id: 'marker',
  1014. styleId: 'marker',
  1015. position: location,
  1016. },
  1017. ]);
  1018. var marker = new TMap.MultiMarker({
  1019. map: map,
  1020. styles: {
  1021. default: new TMap.MarkerStyle({
  1022. width: 32,
  1023. height: 40,
  1024. anchor: {
  1025. x: 17,
  1026. y: 21,
  1027. },
  1028. src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker_blue.png',
  1029. }),
  1030. },
  1031. geometries: [],
  1032. });
  1033. marker.setGeometries([]);
  1034. setTimeout(() => {
  1035. for (let p = 0; p < this.maplist.length; p++) {
  1036. marker.updateGeometries([
  1037. {
  1038. id: this.maplist[p].id,
  1039. position: new TMap.LatLng(this.maplist[p].location.lat, this.maplist[p].location.lng),
  1040. },
  1041. ]);
  1042. }
  1043. });
  1044. var markers1 = new TMap.MultiMarker({
  1045. map: map,
  1046. mapgeometries: [
  1047. {
  1048. id: 'markers1',
  1049. position: new TMap.LatLng(0, 0),
  1050. },
  1051. ],
  1052. styles: {
  1053. abc: new TMap.MarkerStyle({
  1054. width: 32,
  1055. height: 40,
  1056. anchor: { x: 16, y: 32 },
  1057. src: txmapimg3,
  1058. }),
  1059. },
  1060. });
  1061. markers1.setGeometries([]);
  1062. this.map = map;
  1063. this.markers = markers1;
  1064. this.markers1 = markers;
  1065. this.marker = marker;
  1066. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.SCALE);
  1067. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ROTATION);
  1068. map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ZOOM);
  1069. },
  1070. addressFn() {
  1071. localStorage.setItem('locationRemark', this.fromValue.addressLine);
  1072. },
  1073. getChainsByDeptCodesearch(chainName) {
  1074. this.ChainsLists = [];
  1075. getChainsByDeptCode({
  1076. chainName: this.chainName,
  1077. cityName: this.fromValue.cityNameOld,
  1078. districtName: this.fromValue.districtNameOld,
  1079. deptId: this.fromValue.deptId,
  1080. ifJzStoreType: this.fromValue.ifJzStoreType,
  1081. storeCategory: this.fromValue.storeCategory,
  1082. }).then((res) => {
  1083. this.ChainsLists = res.data.sfaChains;
  1084. this.ChainsLists.push({});
  1085. this.ChainsLists.pop();
  1086. });
  1087. },
  1088. //
  1089. PickerDept() {
  1090. if (this.deptShow) {
  1091. this.showPickerDeptList = true;
  1092. }
  1093. },
  1094. handleSelectionChange(val) {
  1095. this.fromValue.orderProductStoreList = val;
  1096. },
  1097. getpotentialCustomerTypeList() {
  1098. getpotentialCustomerTypeList().then((res) => {
  1099. var potentialCustomerTypeList = [];
  1100. for (var t = 0; t < res.data.length; t++) {
  1101. potentialCustomerTypeList.push({
  1102. text: res.data[t].dictLabel,
  1103. dictCode: res.data[t].dictValue,
  1104. });
  1105. }
  1106. this.potentialCustomerTypeList = potentialCustomerTypeList;
  1107. });
  1108. },
  1109. getChainsByDeptCode(deptCode, ifJzStoreType) {
  1110. getChainsByDeptCode({
  1111. cityName: this.fromValue.cityName,
  1112. districtName: this.fromValue.districtName,
  1113. deptId: deptCode,
  1114. ifJzStoreType: ifJzStoreType,
  1115. storeCategory: this.fromValue.storeCategory,
  1116. }).then((res) => {
  1117. if (res.data.deptList.length == 1) {
  1118. this.fromValue.orgId = res.data.deptList[0].deptId;
  1119. this.fromValue.orgName = res.data.deptList[0].deptName;
  1120. localStorage.setItem('orgName', res.data.deptList[0].deptName);
  1121. this.ChainsList = res.data.sfaChains;
  1122. this.deptShow = false;
  1123. } else {
  1124. this.deptShow = true;
  1125. this.ChainsList = [];
  1126. var deptList = [];
  1127. for (var t1 = 0; t1 < res.data.deptList.length; t1++) {
  1128. deptList.push({
  1129. deptId: res.data.deptList[t1].deptId,
  1130. text: res.data.deptList[t1].deptName,
  1131. });
  1132. }
  1133. this.deptList = deptList;
  1134. }
  1135. var arrlist = [];
  1136. if (res.data.sfaOrderProducts != null) {
  1137. for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
  1138. for (var n2 = 0; n2 < res.data.sfaOrderProducts.length; n2++) {
  1139. res.data.sfaOrderProducts[n2].storeProductId =
  1140. res.data.sfaOrderProducts[n2].orderProductId;
  1141. if (
  1142. res.data.sfaOrderProducts[n2].orderProductId ==
  1143. this.fromValue.orderProductStoreList[n1].productId
  1144. ) {
  1145. res.data.sfaOrderProducts[n2].orderNum =
  1146. this.fromValue.orderProductStoreList[n1].orderNum;
  1147. res.data.sfaOrderProducts[n2].storeProductId =
  1148. this.fromValue.orderProductStoreList[n1].storeProductId;
  1149. arrlist.push(res.data.sfaOrderProducts[n2]);
  1150. }
  1151. }
  1152. }
  1153. this.sfaOrderProducts = res.data.sfaOrderProducts;
  1154. }
  1155. });
  1156. },
  1157. getCustomerInfoList() {
  1158. getCustomerInfoList().then((res) => {
  1159. var CustomerInfoList = [];
  1160. for (var t = 0; t < res.data.length; t++) {
  1161. CustomerInfoList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1162. }
  1163. this.CustomerInfoList = CustomerInfoList;
  1164. });
  1165. },
  1166. getCustomerNatureList() {
  1167. getCustomerNatureList().then((res) => {
  1168. var CustomerNatureList = [];
  1169. for (var t = 0; t < res.data.length; t++) {
  1170. CustomerNatureList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1171. }
  1172. this.CustomerNatureList = CustomerNatureList;
  1173. });
  1174. },
  1175. getMainProjectList() {
  1176. getMainProjectList().then((res) => {
  1177. var MainProjectList = [];
  1178. for (var t = 0; t < res.data.length; t++) {
  1179. MainProjectList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1180. }
  1181. this.MainProjectList = MainProjectList;
  1182. });
  1183. },
  1184. getMainRelationList() {
  1185. getMainRelationList().then((res) => {
  1186. var MainRelationList = [];
  1187. for (var t = 0; t < res.data.length; t++) {
  1188. MainRelationList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1189. }
  1190. this.MainRelationList = MainRelationList;
  1191. });
  1192. },
  1193. getManagementModelList() {
  1194. getManagementModelList().then((res) => {
  1195. var ManagementModelList = [];
  1196. for (var t = 0; t < res.data.length; t++) {
  1197. ManagementModelList.push({
  1198. text: res.data[t].dictLabel,
  1199. dictCode: res.data[t].dictValue,
  1200. });
  1201. }
  1202. this.ManagementModelList = ManagementModelList;
  1203. });
  1204. },
  1205. getChainsByDeptId(deptCode, ifJzStoreType) {
  1206. getChainsByDeptCode({
  1207. cityName: this.fromValue.cityName,
  1208. districtName: this.fromValue.districtName,
  1209. deptId: deptCode,
  1210. ifJzStoreType: ifJzStoreType,
  1211. storeCategory: this.fromValue.storeCategory,
  1212. }).then((res) => {
  1213. this.ChainsList = res.data.sfaChains;
  1214. });
  1215. },
  1216. onDeptConfirm(value) {
  1217. this.fromValue.orgName = value.text;
  1218. localStorage.setItem('orgName', value.text);
  1219. this.fromValue.orgId = value.deptId;
  1220. this.fromValue.chainCode = '';
  1221. this.fromValue.chainName = '';
  1222. this.getChainsByDeptId(value.deptId, this.fromValue.ifJzStoreType);
  1223. this.showPickerDeptList = false;
  1224. },
  1225. setStoreNameFn() {
  1226. localStorage.setItem('chainName', this.fromValue.storeName);
  1227. },
  1228. attrChange(val) {
  1229. if (val == '0') {
  1230. this.attrShow = true;
  1231. } else {
  1232. this.attrShow = false;
  1233. this.fromValue.attribute5 = '';
  1234. }
  1235. },
  1236. getStreetQuery(type) {
  1237. var provinceCode = '';
  1238. var cityCode = '';
  1239. var countyCode = '';
  1240. if (type == '1') {
  1241. provinceCode = this.fromValue.province;
  1242. cityCode = '';
  1243. countyCode = '';
  1244. } else if (type == '2') {
  1245. provinceCode = this.fromValue.province;
  1246. cityCode = this.fromValue.city;
  1247. countyCode = '';
  1248. } else if (type == '3') {
  1249. provinceCode = this.fromValue.province;
  1250. cityCode = this.fromValue.city;
  1251. countyCode = this.fromValue.district;
  1252. } else {
  1253. provinceCode = '';
  1254. cityCode = '';
  1255. countyCode = '';
  1256. }
  1257. streetQuery({ provinceCode: provinceCode, cityCode: cityCode, countyCode: countyCode }).then(
  1258. (res) => {
  1259. var provinceList = [];
  1260. var cityList = [];
  1261. var districtList = [];
  1262. var townList = [];
  1263. if (type == '1') {
  1264. for (var z1 = 0; z1 < res.data.length; z1++) {
  1265. cityList.push({ cityCode: res.data[z1].cityCode, text: res.data[z1].cityName });
  1266. }
  1267. this.cityList = cityList;
  1268. } else if (type == '2') {
  1269. for (var z2 = 0; z2 < res.data.length; z2++) {
  1270. districtList.push({
  1271. countyCode: res.data[z2].countyCode,
  1272. text: res.data[z2].countyName,
  1273. countyLevel: res.data[z2].countyLevel,
  1274. });
  1275. }
  1276. this.districtList = districtList;
  1277. } else if (type == '3') {
  1278. for (var z3 = 0; z3 < res.data.length; z3++) {
  1279. townList.push({ townCode: res.data[z3].townCode, text: res.data[z3].townName });
  1280. }
  1281. this.townList = townList;
  1282. } else {
  1283. for (var z = 0; z < res.data.length; z++) {
  1284. provinceList.push({
  1285. provinceCode: res.data[z].provinceCode,
  1286. text: res.data[z].provinceName,
  1287. });
  1288. }
  1289. this.provinceList = provinceList;
  1290. }
  1291. },
  1292. );
  1293. },
  1294. getDetail() {
  1295. // 获取当前定位
  1296. this.getLocation();
  1297. this.phoneNumber = true;
  1298. let loading1 = this.$toast.loading({
  1299. duration: 0,
  1300. message: '加载中...',
  1301. forbidClick: true,
  1302. });
  1303. var postType = localStorage.getItem('postType');
  1304. if (postType == 'GZ') {
  1305. this.typeShow = false;
  1306. } else {
  1307. this.typeShow = true;
  1308. }
  1309. getById({ storeId: this.$route.query.id }).then((res) => {
  1310. loading1.clear();
  1311. this.validFlag = this.$route.query.validFlag;
  1312. if (res.code == 200) {
  1313. this.fromValue = res.data;
  1314. this.fromValue.storeCompetitorList = this.fromValue.storeCompetitorList || [];
  1315. this.sfaStoreChainsContactList = this.fromValue.sfaStoreChainsContactList;
  1316. if (this.fromValue.imgSed && this.fromValue.imgSed != '') {
  1317. this.displayImg = this.fromValue.imgSed.split(',');
  1318. } else {
  1319. this.displayImg = [];
  1320. }
  1321. if (this.fromValue.lat != null) {
  1322. } else {
  1323. this.fromValue.lat = '';
  1324. this.fromValue.lon = '';
  1325. }
  1326. localStorage.setItem('locationRemark', res.data.addressLine);
  1327. localStorage.setItem('orgName', res.data.orgName);
  1328. if (
  1329. this.fromValue.potentialCustomerType != null &&
  1330. this.fromValue.potentialCustomerType != undefined
  1331. ) {
  1332. } else {
  1333. this.fromValue.potentialCustomerType = '';
  1334. }
  1335. if (this.fromValue.carShopImgList != null) {
  1336. } else {
  1337. this.fromValue.carShopImgList = [];
  1338. }
  1339. if (this.fromValue.attribute3 != null) {
  1340. } else {
  1341. this.fromValue.attribute3 = '';
  1342. }
  1343. if (this.fromValue.attribute5 != null) {
  1344. } else {
  1345. this.fromValue.attribute5 = '';
  1346. }
  1347. // this.getChainsByDeptCode(res.data.orgId)
  1348. this.getChainsByDeptCode(null, res.data.ifJzStoreType);
  1349. if (
  1350. this.verifyStoreType(this.fromValue.storeCategory) &&
  1351. this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
  1352. ) {
  1353. this.typeABshow = true;
  1354. this.dictTypeFormShow = true;
  1355. }
  1356. // if (this.fromValue.storeCategory == '129081') {
  1357. // this.dictTypeAFormShow = true;
  1358. // }
  1359. // if (this.fromValue.storeCategory == '10131') {
  1360. // this.dictTypeFormShow = true;
  1361. // }
  1362. if (this.fromValue.attribute3 == '0') {
  1363. this.attrShow = true;
  1364. }
  1365. if (this.fromValue.storeCategory == 'sjs61') {
  1366. this.dictTypeSJSFormShow = true;
  1367. }
  1368. if (this.fromValue.storeCategory == 'zyjz63') {
  1369. this.dictTypeQGJZFormShow = true;
  1370. } else {
  1371. this.dictTypeQGJZFormShow = false;
  1372. }
  1373. if (this.fromValue.storeCategory == 'C912') {
  1374. this.storeTypePOP = false;
  1375. this.storeName = '铭牌上项目名称';
  1376. this.address = '地址';
  1377. } else if (this.fromValue.storeCategory == 'C917') {
  1378. this.storeTypePOP = false;
  1379. this.storeName = '名称';
  1380. this.address = '地址';
  1381. } else {
  1382. this.storeTypePOP = true;
  1383. this.storeName = '名称';
  1384. this.address = '地址';
  1385. }
  1386. if (this.fromValue.storeCategory == 'C917') {
  1387. this.GZAttributeFormShow = true;
  1388. this.dictTypeSJSFormShow = false;
  1389. this.dictTypeQGJZFormShow = false;
  1390. this.dictTypeFormShow = false;
  1391. this.dictTypeAFormShow = false;
  1392. this.typeABshow = false;
  1393. } else {
  1394. this.GZAttributeFormShow = false;
  1395. }
  1396. localStorage.setItem('chainName', res.data.storeName);
  1397. this.getStreetQuery();
  1398. this.getStreetQuery('1');
  1399. this.getStreetQuery('2');
  1400. this.getStreetQuery('3');
  1401. this.beforeAddFn(res.data.ifJzStoreType);
  1402. } else {
  1403. this.$toast.fail(res.msg);
  1404. }
  1405. });
  1406. },
  1407. newimgarr1(val) {
  1408. if (val.type == '1') {
  1409. this.fromValue.img = val.fileUrl;
  1410. } else if (val.type == '2') {
  1411. // this.fromValue.imgSed = val.fileUrl;
  1412. this.displayImg.push(val.fileUrl);
  1413. } else {
  1414. this.fromValue.carShopImgList.push(val.fileUrl);
  1415. }
  1416. },
  1417. // 关闭无效店铺
  1418. valid() {
  1419. this.$dialog
  1420. .confirm({
  1421. title: '系统提示',
  1422. message: '是否确认无效关店?',
  1423. })
  1424. .then(() => {
  1425. this.toastLoading();
  1426. valid({ storeId: this.$route.query.id }).then((res) => {
  1427. this.toastLoading().clear();
  1428. if (res.code == 200) {
  1429. this.$router.go(-2);
  1430. } else {
  1431. this.Toast({
  1432. message: res.msg,
  1433. duration: 3000,
  1434. });
  1435. }
  1436. });
  1437. });
  1438. },
  1439. beforeAddFn(ifJzStoreType) {
  1440. beforeAdd({
  1441. cityName: this.fromValue.cityName,
  1442. districtName: this.fromValue.districtName,
  1443. ifJzStoreType: ifJzStoreType,
  1444. storeId: this.$route.query.id,
  1445. }).then((res) => {
  1446. this.storeCategoryList = res.data.storeCategoryList;
  1447. });
  1448. },
  1449. getbrands() {
  1450. getbrands({}).then((res) => {
  1451. var brandst = [];
  1452. for (var t = 0; t < res.data.length; t++) {
  1453. brandst.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1454. }
  1455. this.brandst = brandst;
  1456. });
  1457. },
  1458. addVisits2() {
  1459. var that = this;
  1460. var map = new TMap.Map('allmap', {
  1461. zoom: 15,
  1462. center: new TMap.LatLng(39.986785, 116.301012),
  1463. });
  1464. var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
  1465. var markers = new TMap.MultiMarker({
  1466. map: map,
  1467. geometries: [],
  1468. });
  1469. markers.setGeometries([]);
  1470. var latlng = this.gcj02BD(this.fromValue.lat, this.fromValue.lon);
  1471. var location = new TMap.LatLng(latlng.lat, latlng.lon);
  1472. map.setCenter(location);
  1473. markers.updateGeometries([
  1474. {
  1475. id: 'marker',
  1476. position: location,
  1477. },
  1478. ]);
  1479. geocoder.getAddress({ location: location }).then(function (result) {
  1480. var addresses = result.result.formatted_addresses;
  1481. (that.cityName = result.result.ad_info.city),
  1482. (that.districtName = result.result.ad_info.district),
  1483. (that.provinceName = result.result.ad_info.province),
  1484. (that.addressLine = addresses.recommend);
  1485. localStorage.setItem('locationRemark', addresses.recommend);
  1486. localStorage.setItem('address', addresses.recommend);
  1487. that.beforeAddFn();
  1488. });
  1489. },
  1490. getLocation() {
  1491. getPosition()
  1492. .then((res) => {
  1493. let { TXisBD } = res;
  1494. this.location = TXisBD;
  1495. this.fromValue.lat = TXisBD.lat;
  1496. this.fromValue.lon = TXisBD.lon;
  1497. })
  1498. .catch((error) => {
  1499. this.$dialog.alert({
  1500. message: error,
  1501. });
  1502. });
  1503. },
  1504. showPickerChainsListFn() {
  1505. if (this.chainUser == 'true') return;
  1506. if (this.fromValue.storeCategoryName == '') {
  1507. this.$toast('类型未选择');
  1508. return;
  1509. } else if (this.fromValue.orgName == '') {
  1510. this.$toast('部门未选择');
  1511. return;
  1512. } else {
  1513. // 分销店
  1514. if (
  1515. this.verifyStoreType(this.fromValue.storeCategory) &&
  1516. this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
  1517. ) {
  1518. this.getStoreChainsContact();
  1519. } else {
  1520. this.showPickerChainsList = true;
  1521. }
  1522. }
  1523. },
  1524. // 同城分销-属性信息
  1525. getTCFXList() {
  1526. getTCFXList({}).then((res) => {
  1527. var TCFXList = [];
  1528. for (var t = 0; t < res.data.length; t++) {
  1529. TCFXList.push({
  1530. text: res.data[t].dictLabel,
  1531. dictCode: res.data[t].dictValue,
  1532. remark: res.data[t].remark,
  1533. });
  1534. }
  1535. this.TCFXList = TCFXList;
  1536. });
  1537. },
  1538. // 竞品品牌
  1539. getTCompetitiveProduct() {
  1540. getDictOption({}, 'main_competitor_brands').then((res) => {
  1541. this.storeCompetitorlist = res.data;
  1542. });
  1543. },
  1544. getSJSList() {
  1545. getSJSList({}).then((res) => {
  1546. var SJSList = [];
  1547. for (var t = 0; t < res.data.length; t++) {
  1548. SJSList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1549. }
  1550. this.SJSList = SJSList;
  1551. });
  1552. },
  1553. getQGJZist() {
  1554. getQGJZist({}).then((res) => {
  1555. var QGJZist = [];
  1556. for (var t = 0; t < res.data.length; t++) {
  1557. QGJZist.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1558. }
  1559. this.QGJZist = QGJZist;
  1560. });
  1561. },
  1562. onProvinceConfirm(value) {
  1563. this.fromValue.provinceName = value.text;
  1564. this.fromValue.province = value.provinceCode;
  1565. this.fromValue.cityName = '';
  1566. this.fromValue.city = '';
  1567. this.fromValue.districtName = '';
  1568. this.fromValue.district = '';
  1569. this.fromValue.townName = '';
  1570. this.fromValue.townCode = '';
  1571. this.countyCode = '';
  1572. this.cityCode = '';
  1573. this.provinceCode = value.provinceCode;
  1574. this.getStreetQuery('1');
  1575. this.showProvincePicker = false;
  1576. },
  1577. onCityConfirm(value) {
  1578. this.fromValue.cityName = value.text;
  1579. this.fromValue.city = value.cityCode;
  1580. this.fromValue.districtName = '';
  1581. this.fromValue.district = '';
  1582. this.fromValue.townName = '';
  1583. this.fromValue.townCode = '';
  1584. this.countyCode = '';
  1585. this.cityCode = value.cityCode;
  1586. this.getStreetQuery('2');
  1587. this.showCityPicker = false;
  1588. },
  1589. onDistrictConfirm(value) {
  1590. this.fromValue.districtName = value.text;
  1591. this.fromValue.district = value.countyCode;
  1592. this.fromValue.townName = '';
  1593. this.fromValue.townCode = '';
  1594. this.countyCode = value.countyCode;
  1595. this.fromValue.cityLevel = value.countyLevel;
  1596. this.getStreetQuery('3');
  1597. this.showDistrictPicker = false;
  1598. },
  1599. onTownConfirm(value) {
  1600. this.fromValue.townName = value.text;
  1601. this.fromValue.townCode = value.townCode;
  1602. this.showTownPicker = false;
  1603. },
  1604. onTCFXLConfirm(value) {
  1605. this.fromValue.tcfxName = value.text;
  1606. this.fromValue.tcfxCode = value.dictCode;
  1607. this.showTCFXL = false;
  1608. },
  1609. moreTypeShowFn() {
  1610. if (this.fromValue.storeCategoryName == '') {
  1611. this.$toast('类型未选择');
  1612. return;
  1613. } else if (this.fromValue.orgName == '') {
  1614. this.$toast('部门未选择');
  1615. return;
  1616. } else {
  1617. this.ChainsLists = [];
  1618. this.moreTypeShow = true;
  1619. }
  1620. },
  1621. onConfirm(value) {
  1622. // || value.dictValue == "129081" ||value.dictValue == "10131"
  1623. this.fromValue.storeCategoryName = value.text;
  1624. this.fromValue.storeCategory = value.dictValue;
  1625. if (
  1626. this.verifyStoreType(this.fromValue.storeCategory) &&
  1627. this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
  1628. ) {
  1629. this.typeABshow = true;
  1630. this.dictTypeFormShow = true;
  1631. } else {
  1632. this.typeABshow = false;
  1633. this.fromValue.carShop = '';
  1634. this.fromValue.carShopImgList = [];
  1635. this.fromValue.tcfxName = '';
  1636. this.fromValue.tcfxCode = '';
  1637. this.dictTypeFormShow = false;
  1638. }
  1639. // if (value.dictValue == '129081') {
  1640. // this.dictTypeAFormShow = true;
  1641. // } else {
  1642. // this.fromValue.tcfxName = '';
  1643. // this.fromValue.tcfxCode = '';
  1644. // this.dictTypeAFormShow = false;
  1645. // }
  1646. if (value.dictValue == 'C917') {
  1647. this.GZAttributeFormShow = true;
  1648. this.dictTypeSJSFormShow = false;
  1649. this.dictTypeQGJZFormShow = false;
  1650. this.dictTypeFormShow = false;
  1651. this.dictTypeAFormShow = false;
  1652. this.typeABshow = false;
  1653. } else {
  1654. this.fromValue.tcfxName = '';
  1655. this.fromValue.tcfxCode = '';
  1656. this.GZAttributeFormShow = false;
  1657. }
  1658. // if (value.dictValue == '10131') {
  1659. // this.dictTypeFormShow = true;
  1660. // } else {
  1661. // this.fromValue.tcfxName = '';
  1662. // this.fromValue.tcfxCode = '';
  1663. // this.dictTypeFormShow = false;
  1664. // }
  1665. if (value.dictValue == 'sjs61') {
  1666. this.dictTypeSJSFormShow = true;
  1667. } else {
  1668. this.fromValue.tcfxName = '';
  1669. this.fromValue.tcfxCode = '';
  1670. this.dictTypeSJSFormShow = false;
  1671. }
  1672. if (value.dictValue == 'zyjz63') {
  1673. this.dictTypeQGJZFormShow = true;
  1674. } else {
  1675. this.fromValue.tcfxName = '';
  1676. this.fromValue.tcfxCode = '';
  1677. this.dictTypeQGJZFormShow = false;
  1678. }
  1679. if (this.fromValue.ifJzStoreType == 1 && value.ifJzStoreType != 1) {
  1680. this.$toast('家装公司不能变为同城店');
  1681. return;
  1682. } else if (this.fromValue.ifJzStoreType != 1 && value.ifJzStoreType == 1) {
  1683. this.$toast('同城店不能变为家装公司');
  1684. return;
  1685. } else {
  1686. this.fromValue.chainName = '';
  1687. this.fromValue.chainCode = '';
  1688. this.fromValue.orgName = '';
  1689. this.fromValue.orgId = '';
  1690. this.fromValue.storeCategoryName = value.dictLabel;
  1691. this.fromValue.storeCategory = value.dictValue;
  1692. this.fromValue.ifJzStoreType = value.ifJzStoreType;
  1693. this.getChainsByDeptCode(null, value.ifJzStoreType);
  1694. // 切换门店类型删除选定经销商
  1695. // 同城分销人员禁止切换经销商
  1696. if (this.chainUser == 'false') {
  1697. this.treeSelect = [];
  1698. this.sfaStoreChainsContactList = []; //选中确定的经销商
  1699. this.activatedTCFXList = []; //选中的经销商
  1700. }
  1701. this.showPicker = false;
  1702. }
  1703. if (value.dictValue == 'C912') {
  1704. this.storeTypePOP = false;
  1705. this.storeName = '铭牌上项目名称';
  1706. this.address = '地址';
  1707. } else if (value.dictValue == 'C917') {
  1708. this.storeTypePOP = false;
  1709. this.storeName = '名称';
  1710. this.address = '地址';
  1711. } else {
  1712. this.storeTypePOP = true;
  1713. this.storeName = '名称';
  1714. this.address = '地址';
  1715. }
  1716. },
  1717. onConfirmChainsList(value) {
  1718. this.fromValue.chainName = value.chainName;
  1719. this.fromValue.chainCode = value.chainCode;
  1720. this.showPickerChainsList = false;
  1721. this.moreTypeShow = false;
  1722. },
  1723. numberFn() {
  1724. if (Number(this.fromValue.area) < 1) {
  1725. this.fromValue.area = '';
  1726. } else {
  1727. this.fromValue.area = this.fromValue.area.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
  1728. }
  1729. },
  1730. onSubmit() {
  1731. this.fromValue.imgSed = this.displayImg.join(',');
  1732. for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
  1733. for (var n2 = 0; n2 < this.sfaOrderProducts.length; n2++) {
  1734. if (
  1735. this.sfaOrderProducts[n2].storeProductId ==
  1736. this.fromValue.orderProductStoreList[n1].storeProductId
  1737. ) {
  1738. this.fromValue.orderProductStoreList[n1].orderNum = this.sfaOrderProducts[n2].orderNum;
  1739. }
  1740. }
  1741. }
  1742. var fromValue = JSON.parse(JSON.stringify(this.fromValue));
  1743. if (fromValue.storeCompetitorList == null || fromValue.storeCompetitorList == undefined) {
  1744. fromValue.storeCompetitorList = [];
  1745. }
  1746. this.activatedStoreCompetitor = [];
  1747. var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  1748. if (fromValue.orgId == '') {
  1749. this.$toast('部门未选择');
  1750. return;
  1751. } else if (fromValue.storeName == '') {
  1752. if (fromValue.storeCategory == 'C912') {
  1753. this.$toast('铭牌上项目名称未填写');
  1754. } else if (fromValue.storeCategory == 'C917') {
  1755. this.$toast('名称未填写');
  1756. } else {
  1757. this.$toast('名称未填写');
  1758. }
  1759. return;
  1760. } else if (fromValue.addressLine == '') {
  1761. if (fromValue.storeCategory == 'C912') {
  1762. this.$toast('地址未填写');
  1763. } else if (fromValue.storeCategory == 'C917') {
  1764. this.$toast('地址未填写');
  1765. } else {
  1766. this.$toast('地址未填写');
  1767. }
  1768. return;
  1769. } else if (fromValue.storeCategoryName == '') {
  1770. this.$toast('类型未填写');
  1771. return;
  1772. } else if (fromValue.provinceName == '') {
  1773. this.$toast('所在省份未填写');
  1774. return;
  1775. } else if (fromValue.cityName == '') {
  1776. this.$toast('所在城市未填写');
  1777. return;
  1778. } else if (fromValue.districtName == '') {
  1779. this.$toast('所在县区未填写');
  1780. return;
  1781. } else if (fromValue.townName == '') {
  1782. this.$toast('所在街道未填写');
  1783. return;
  1784. } else if (
  1785. fromValue.contactName == '' &&
  1786. fromValue.ifJzStoreType != 1 &&
  1787. fromValue.storeCategory != 'C917'
  1788. ) {
  1789. this.$toast('联系人未填写');
  1790. return;
  1791. } else if (
  1792. fromValue.telephone.trim() == '' &&
  1793. fromValue.ifJzStoreType != 1 &&
  1794. fromValue.storeCategory != 'C917'
  1795. ) {
  1796. this.$toast('联系电话未填写');
  1797. return;
  1798. } else if (
  1799. !telrg.test(fromValue.telephone) &&
  1800. fromValue.ifJzStoreType != 1 &&
  1801. fromValue.storeCategory != 'C917'
  1802. ) {
  1803. this.$toast('手机号格式错误');
  1804. return;
  1805. } else if (
  1806. !this.phoneNumber &&
  1807. fromValue.ifJzStoreType != 1 &&
  1808. fromValue.storeCategory != 'C917'
  1809. ) {
  1810. this.$toast('不能填写业务员手机号');
  1811. return;
  1812. } else if (fromValue.img == '' && fromValue.storeCategory != 'C917') {
  1813. if (this.storeTypePOP) {
  1814. if (fromValue.ifJzStoreType != 1) {
  1815. this.$toast('图片未上传');
  1816. } else {
  1817. this.$toast('家装前台照片未上传');
  1818. }
  1819. } else {
  1820. this.$toast('照片未上传');
  1821. }
  1822. return;
  1823. } else if (
  1824. (fromValue.storeCategory == 'sjs61' || fromValue.storeCategory == 'zyjz63') &&
  1825. fromValue.tcfxName == ''
  1826. ) {
  1827. this.$toast('属性未填写');
  1828. return;
  1829. }
  1830. if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
  1831. this.$toast('家装展厅面积未填写');
  1832. return;
  1833. }
  1834. if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
  1835. this.$toast('潜在客户类型未填写');
  1836. return;
  1837. }
  1838. // 同城分销类型门店
  1839. if (
  1840. this.verifyStoreType(this.fromValue.storeCategory) &&
  1841. this.verifyStoreType(this.fromValue.storeCategory).type == 'fxd'
  1842. ) {
  1843. // 同城分销多经销商
  1844. fromValue.sfaStoreChainsContactList = this.sfaStoreChainsContactList;
  1845. if (!this.sfaStoreChainsContactList || !this.sfaStoreChainsContactList.length) {
  1846. this.$toast('经销商未填写');
  1847. return;
  1848. }
  1849. if (fromValue.tcfxName == '') {
  1850. this.$toast('属性未填写');
  1851. return;
  1852. }
  1853. if (fromValue.imgSed == '') {
  1854. this.$toast('图片未上传');
  1855. return;
  1856. }
  1857. if (!fromValue.storeCompetitorList.length && !fromValue.otherCompetitor) {
  1858. this.$toast('主营竞品品牌未填写');
  1859. return;
  1860. }
  1861. this.activatedStoreCompetitor = JSON.parse(
  1862. JSON.stringify(this.fromValue.storeCompetitorList),
  1863. );
  1864. if (this.fromValue.otherCompetitor) {
  1865. if (this.fromValue.otherCompetitor.length < 2) {
  1866. this.$toast('主营竞品品牌其他文本信息最少2个字');
  1867. return;
  1868. } else {
  1869. this.activatedStoreCompetitor.push(this.fromValue.otherCompetitor);
  1870. }
  1871. }
  1872. fromValue.storeCompetitorList = JSON.parse(JSON.stringify(this.activatedStoreCompetitor));
  1873. } else {
  1874. // 非同城分销店 经销商必填校验
  1875. if (
  1876. fromValue.chainName == '' &&
  1877. fromValue.ifJzStoreType != 1 &&
  1878. fromValue.storeCategory != 'C912' &&
  1879. fromValue.storeCategory != 'C917'
  1880. ) {
  1881. this.$toast('经销商未选择');
  1882. return;
  1883. }
  1884. }
  1885. let loading1 = this.$toast.loading({
  1886. duration: 0,
  1887. message: '加载中...',
  1888. forbidClick: true,
  1889. });
  1890. // 当前定位复制
  1891. fromValue.myLat = this.location.lat;
  1892. fromValue.myLon = this.location.lon;
  1893. console.log(fromValue);
  1894. updateStore(fromValue).then((res) => {
  1895. loading1.clear();
  1896. if (res.code == 200) {
  1897. this.$dialog
  1898. .alert({
  1899. title: '系统提示',
  1900. message: res.msg,
  1901. })
  1902. .then(() => {
  1903. this.$router.go(-1);
  1904. });
  1905. } else {
  1906. this.$dialog.alert({
  1907. message: res.msg,
  1908. messageAlign: 'left',
  1909. });
  1910. }
  1911. });
  1912. },
  1913. onClickLeft() {
  1914. this.$router.go(-1);
  1915. },
  1916. phoneCheck() {
  1917. if (this.fromValue.ifJzStoreType != 1) {
  1918. var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  1919. if (this.fromValue.telephone.trim() == '') {
  1920. return;
  1921. } else if (!telrg.test(this.fromValue.telephone)) {
  1922. this.$toast('手机号格式错误');
  1923. return;
  1924. } else {
  1925. phoneCheck({ phoneNumber: this.fromValue.telephone }).then((res) => {
  1926. if (res.code == 200) {
  1927. this.phoneNumber = true;
  1928. } else {
  1929. this.phoneNumber = false;
  1930. }
  1931. });
  1932. }
  1933. }
  1934. },
  1935. // 陈列照 图片删除
  1936. deleteImg(index) {
  1937. this.displayImg.splice(index, 1);
  1938. },
  1939. // 预览
  1940. previewsImg(index) {
  1941. var arrimg = [];
  1942. for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
  1943. arrimg.push(this.displayImg[imgi]);
  1944. }
  1945. ImagePreview({
  1946. images: arrimg,
  1947. startPosition: index,
  1948. });
  1949. },
  1950. //获取经销商
  1951. async getStoreChainsContact() {
  1952. // 打开select,上次选中确认数据赋值给选中待确认,回显使用
  1953. this.activatedTCFXList = JSON.parse(JSON.stringify(this.sfaStoreChainsContactList));
  1954. if (!this.treeSelect.length) {
  1955. this.toastLoading(0, '加载中...', true);
  1956. listChainsByCategory({ orgId: this.fromValue.orgId }).then((res) => {
  1957. this.toastLoading().clear();
  1958. // 初始化数据
  1959. res.data.forEach((val) => {
  1960. val.dot = false;
  1961. });
  1962. this.showPickerChainsList = true;
  1963. this.treeSelect = res.data;
  1964. this.setCheckData();
  1965. });
  1966. } else {
  1967. this.showPickerChainsList = true;
  1968. this.setCheckData();
  1969. }
  1970. },
  1971. setCheckData() {
  1972. for (let x = 0; x < this.treeSelect.length; x++) {
  1973. // 设置左侧选中图标
  1974. let activate = this.activatedTCFXList.find((item) => {
  1975. return item.categoryCode == this.treeSelect[x].code;
  1976. });
  1977. this.treeSelect[x].dot = activate ? true : false;
  1978. // 右侧选中返现
  1979. let children = this.treeSelect[x].children;
  1980. if (children && this.treeSelect[x].dot) {
  1981. for (let y = 0; y < children.length; y++) {
  1982. let activate = this.activatedTCFXList.find((item) => {
  1983. return (
  1984. children[y].categoryCode == item.categoryCode &&
  1985. children[y].chainCode == item.chainCode
  1986. );
  1987. });
  1988. if (activate) {
  1989. children[y].Check = true;
  1990. } else {
  1991. children[y].Check = false;
  1992. }
  1993. }
  1994. }
  1995. }
  1996. this.$forceUpdate();
  1997. this.activeIndex = 0;
  1998. },
  1999. // 左侧数据点击
  2000. clickNav(index) {
  2001. // this.treeSelect[index].children.forEach((val) => {
  2002. // // 回显右侧选中
  2003. // let activate = this.activatedTCFXList.find((item) => item.code == val.code);
  2004. // val.Check = activate ? true : false;
  2005. // });
  2006. },
  2007. // 右侧数据点击
  2008. treeSelectItemClick(itemData, index, val, ind) {
  2009. itemData.children.forEach((item) => {
  2010. if (val.chainCode == item.chainCode) {
  2011. item.Check = !item.Check;
  2012. // 设置左侧选中图标
  2013. itemData.dot = item.Check;
  2014. } else {
  2015. item.Check = false;
  2016. }
  2017. });
  2018. this.$forceUpdate();
  2019. },
  2020. // 分销店 确认
  2021. treeSelectConfirm() {
  2022. let treeSelectArr = [];
  2023. this.treeSelect.forEach((item) => {
  2024. if (item.dot) {
  2025. let childrenData = item.children.find((val) => val.Check);
  2026. treeSelectArr.push(childrenData);
  2027. }
  2028. });
  2029. if (!treeSelectArr.length) {
  2030. this.$toast('请选择至少选择一个经销商');
  2031. return false;
  2032. }
  2033. console.log(treeSelectArr);
  2034. this.sfaStoreChainsContactList = treeSelectArr;
  2035. this.showPickerChainsList = false;
  2036. },
  2037. },
  2038. };
  2039. </script>
  2040. <style scoped lang="scss">
  2041. .myTab .van-tabs__nav--card {
  2042. margin: 0 !important;
  2043. border-left: 0;
  2044. border-right: 0;
  2045. }
  2046. .myTab .van-tabs__wrap,
  2047. .myTab .van-tabs__nav--card {
  2048. height: 40px;
  2049. }
  2050. .myTab .van-tab {
  2051. line-height: 40px;
  2052. }
  2053. .van-f-red {
  2054. color: red;
  2055. width: 4px;
  2056. display: inline-block;
  2057. }
  2058. .storeEdit {
  2059. .invalid {
  2060. display: flex;
  2061. justify-content: center;
  2062. padding-bottom: 10px;
  2063. .van-button {
  2064. width: 70%;
  2065. }
  2066. }
  2067. }
  2068. .displayImg {
  2069. overflow: hidden;
  2070. .displayImgBox {
  2071. position: relative;
  2072. width: 48%;
  2073. padding: 20px 0;
  2074. height: 210px;
  2075. float: left;
  2076. margin-right: 4%;
  2077. .title {
  2078. text-align: center;
  2079. padding: 5px 0;
  2080. }
  2081. }
  2082. .displayImgBox:nth-child(even) {
  2083. margin-right: 0;
  2084. }
  2085. i {
  2086. position: absolute;
  2087. right: 4px;
  2088. color: white;
  2089. background: red;
  2090. overflow: hidden;
  2091. border-radius: 50%;
  2092. }
  2093. }
  2094. </style>
  2095. <style lang="scss">
  2096. #allmap {
  2097. width: 100px;
  2098. height: 100px;
  2099. position: fixed;
  2100. left: -2000px;
  2101. }
  2102. .van-dialog__confirm,
  2103. .van-dialog__confirm:active {
  2104. color: #0057ba;
  2105. }
  2106. .navBarTOP {
  2107. position: fixed;
  2108. width: 100%;
  2109. z-index: 2;
  2110. top: 0;
  2111. }
  2112. .typeRadioStore .van-radio {
  2113. margin: 10px;
  2114. }
  2115. .typeRadioStore .van-radio__icon .van-icon {
  2116. border: 0 !important;
  2117. }
  2118. .typeRadioStore .van-radio__icon--checked .van-icon {
  2119. color: #1989fa;
  2120. background-color: transparent;
  2121. border-color: transparent;
  2122. }
  2123. .typeRadioStore .van-cell {
  2124. padding: 0 16px;
  2125. line-height: 40px;
  2126. }
  2127. .container .typeRadioStore .van-cell__title {
  2128. height: 40px;
  2129. }
  2130. .typeRadioStore1 .van-radio__icon .van-icon {
  2131. border-radius: 2px;
  2132. border-color: #ccc !important;
  2133. }
  2134. .typeRadioStore1 .van-radio__icon--checked .van-icon {
  2135. background-color: transparent;
  2136. color: #1989fa;
  2137. border-color: #1989fa !important;
  2138. }
  2139. .typeRadioStore1 .van-radio .van-radio__label {
  2140. font-size: 14px;
  2141. }
  2142. .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
  2143. color: #1989fa;
  2144. }
  2145. .typeRadioStore1 .van-checkbox__icon .van-icon {
  2146. border-color: #ccc !important;
  2147. }
  2148. .typeRadioStore1 .van-checkbox__icon--checked .van-icon {
  2149. background-color: transparent;
  2150. color: #1989fa;
  2151. border-color: #1989fa !important;
  2152. }
  2153. .typeRadioStore1 .van-checkbox .van-checkbox__label {
  2154. font-size: 14px;
  2155. }
  2156. .typeRadioStore1 .van-checkbox[aria-checked='true'] .van-checkbox__label {
  2157. color: #1989fa;
  2158. }
  2159. .morelaji .van-cell {
  2160. padding: 10px 0;
  2161. }
  2162. .storeEdit {
  2163. .agencyBox {
  2164. .header_btn {
  2165. display: flex;
  2166. align-items: center;
  2167. justify-content: space-between;
  2168. padding: 10px;
  2169. font-size: 16px;
  2170. border-bottom: 1px solid #ccc;
  2171. div {
  2172. padding: 3px;
  2173. }
  2174. }
  2175. .van-sidebar {
  2176. width: 100px;
  2177. text-align: center;
  2178. flex: none;
  2179. }
  2180. .treeSelectchildren {
  2181. .item {
  2182. display: flex;
  2183. align-items: center;
  2184. padding: 5px;
  2185. .value {
  2186. margin-left: 15px;
  2187. }
  2188. }
  2189. }
  2190. }
  2191. .TCFXList {
  2192. .van-field__control--custom {
  2193. flex-direction: column;
  2194. align-items: self-start;
  2195. .sfaStoreChainsContactList {
  2196. padding: 3px;
  2197. }
  2198. }
  2199. }
  2200. .otherCompetitor {
  2201. padding: 10px 0px;
  2202. border-bottom: 1px solid #b6b6b6;
  2203. .van-cell__title {
  2204. width: 50px;
  2205. }
  2206. }
  2207. }
  2208. </style>