storeEdit.vue 69 KB

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