storeEdit.vue 60 KB

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