storeEdit.vue 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866
  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. getChainsByDeptCode({
  936. chainName: this.chainName,
  937. cityName: this.fromValue.cityNameOld,
  938. districtName: this.fromValue.districtNameOld,
  939. deptId: this.fromValue.deptId,
  940. ifJzStoreType: this.fromValue.ifJzStoreType,
  941. storeCategory: this.fromValue.storeCategory,
  942. }).then((res) => {
  943. this.ChainsLists = res.data.sfaChains;
  944. this.ChainsLists.push({});
  945. this.ChainsLists.pop();
  946. });
  947. },
  948. //
  949. PickerDept() {
  950. if (this.deptShow) {
  951. this.showPickerDeptList = true;
  952. }
  953. },
  954. handleSelectionChange(val) {
  955. this.fromValue.orderProductStoreList = val;
  956. },
  957. getpotentialCustomerTypeList() {
  958. getpotentialCustomerTypeList().then((res) => {
  959. var potentialCustomerTypeList = [];
  960. for (var t = 0; t < res.data.length; t++) {
  961. potentialCustomerTypeList.push({
  962. text: res.data[t].dictLabel,
  963. dictCode: res.data[t].dictValue,
  964. });
  965. }
  966. this.potentialCustomerTypeList = potentialCustomerTypeList;
  967. });
  968. },
  969. getChainsByDeptCode(deptCode, ifJzStoreType) {
  970. getChainsByDeptCode({
  971. cityName: this.fromValue.cityName,
  972. districtName: this.fromValue.districtName,
  973. deptId: deptCode,
  974. ifJzStoreType: ifJzStoreType,
  975. storeCategory: this.fromValue.storeCategory,
  976. }).then((res) => {
  977. if (res.data.deptList.length == 1) {
  978. this.fromValue.orgId = res.data.deptList[0].deptId;
  979. this.fromValue.orgName = res.data.deptList[0].deptName;
  980. localStorage.setItem('orgName', res.data.deptList[0].deptName);
  981. this.ChainsList = res.data.sfaChains;
  982. this.deptShow = false;
  983. } else {
  984. this.deptShow = true;
  985. this.ChainsList = [];
  986. var deptList = [];
  987. for (var t1 = 0; t1 < res.data.deptList.length; t1++) {
  988. deptList.push({
  989. deptId: res.data.deptList[t1].deptId,
  990. text: res.data.deptList[t1].deptName,
  991. });
  992. }
  993. this.deptList = deptList;
  994. }
  995. var arrlist = [];
  996. if (res.data.sfaOrderProducts != null) {
  997. for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
  998. for (var n2 = 0; n2 < res.data.sfaOrderProducts.length; n2++) {
  999. res.data.sfaOrderProducts[n2].storeProductId =
  1000. res.data.sfaOrderProducts[n2].orderProductId;
  1001. if (
  1002. res.data.sfaOrderProducts[n2].orderProductId ==
  1003. this.fromValue.orderProductStoreList[n1].productId
  1004. ) {
  1005. res.data.sfaOrderProducts[n2].orderNum =
  1006. this.fromValue.orderProductStoreList[n1].orderNum;
  1007. res.data.sfaOrderProducts[n2].storeProductId =
  1008. this.fromValue.orderProductStoreList[n1].storeProductId;
  1009. arrlist.push(res.data.sfaOrderProducts[n2]);
  1010. }
  1011. }
  1012. }
  1013. this.sfaOrderProducts = res.data.sfaOrderProducts;
  1014. }
  1015. });
  1016. },
  1017. getCustomerInfoList() {
  1018. getCustomerInfoList().then((res) => {
  1019. var CustomerInfoList = [];
  1020. for (var t = 0; t < res.data.length; t++) {
  1021. CustomerInfoList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1022. }
  1023. this.CustomerInfoList = CustomerInfoList;
  1024. });
  1025. },
  1026. getCustomerNatureList() {
  1027. getCustomerNatureList().then((res) => {
  1028. var CustomerNatureList = [];
  1029. for (var t = 0; t < res.data.length; t++) {
  1030. CustomerNatureList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1031. }
  1032. this.CustomerNatureList = CustomerNatureList;
  1033. });
  1034. },
  1035. getMainProjectList() {
  1036. getMainProjectList().then((res) => {
  1037. var MainProjectList = [];
  1038. for (var t = 0; t < res.data.length; t++) {
  1039. MainProjectList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1040. }
  1041. this.MainProjectList = MainProjectList;
  1042. });
  1043. },
  1044. getMainRelationList() {
  1045. getMainRelationList().then((res) => {
  1046. var MainRelationList = [];
  1047. for (var t = 0; t < res.data.length; t++) {
  1048. MainRelationList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1049. }
  1050. this.MainRelationList = MainRelationList;
  1051. });
  1052. },
  1053. getManagementModelList() {
  1054. getManagementModelList().then((res) => {
  1055. var ManagementModelList = [];
  1056. for (var t = 0; t < res.data.length; t++) {
  1057. ManagementModelList.push({
  1058. text: res.data[t].dictLabel,
  1059. dictCode: res.data[t].dictValue,
  1060. });
  1061. }
  1062. this.ManagementModelList = ManagementModelList;
  1063. });
  1064. },
  1065. getChainsByDeptId(deptCode, ifJzStoreType) {
  1066. getChainsByDeptCode({
  1067. cityName: this.fromValue.cityName,
  1068. districtName: this.fromValue.districtName,
  1069. deptId: deptCode,
  1070. ifJzStoreType: ifJzStoreType,
  1071. storeCategory: this.fromValue.storeCategory,
  1072. }).then((res) => {
  1073. this.ChainsList = res.data.sfaChains;
  1074. });
  1075. },
  1076. onDeptConfirm(value) {
  1077. this.fromValue.orgName = value.text;
  1078. localStorage.setItem('orgName', value.text);
  1079. this.fromValue.orgId = value.deptId;
  1080. this.fromValue.chainCode = '';
  1081. this.fromValue.chainName = '';
  1082. this.getChainsByDeptId(value.deptId, this.fromValue.ifJzStoreType);
  1083. this.showPickerDeptList = false;
  1084. },
  1085. setStoreNameFn() {
  1086. localStorage.setItem('chainName', this.fromValue.storeName);
  1087. },
  1088. attrChange(val) {
  1089. if (val == '0') {
  1090. this.attrShow = true;
  1091. } else {
  1092. this.attrShow = false;
  1093. this.fromValue.attribute5 = '';
  1094. }
  1095. },
  1096. getStreetQuery(type) {
  1097. var provinceCode = '';
  1098. var cityCode = '';
  1099. var countyCode = '';
  1100. if (type == '1') {
  1101. provinceCode = this.fromValue.province;
  1102. cityCode = '';
  1103. countyCode = '';
  1104. } else if (type == '2') {
  1105. provinceCode = this.fromValue.province;
  1106. cityCode = this.fromValue.city;
  1107. countyCode = '';
  1108. } else if (type == '3') {
  1109. provinceCode = this.fromValue.province;
  1110. cityCode = this.fromValue.city;
  1111. countyCode = this.fromValue.district;
  1112. } else {
  1113. provinceCode = '';
  1114. cityCode = '';
  1115. countyCode = '';
  1116. }
  1117. streetQuery({ provinceCode: provinceCode, cityCode: cityCode, countyCode: countyCode }).then(
  1118. (res) => {
  1119. var provinceList = [];
  1120. var cityList = [];
  1121. var districtList = [];
  1122. var townList = [];
  1123. if (type == '1') {
  1124. for (var z1 = 0; z1 < res.data.length; z1++) {
  1125. cityList.push({ cityCode: res.data[z1].cityCode, text: res.data[z1].cityName });
  1126. }
  1127. this.cityList = cityList;
  1128. } else if (type == '2') {
  1129. for (var z2 = 0; z2 < res.data.length; z2++) {
  1130. districtList.push({
  1131. countyCode: res.data[z2].countyCode,
  1132. text: res.data[z2].countyName,
  1133. countyLevel: res.data[z2].countyLevel,
  1134. });
  1135. }
  1136. this.districtList = districtList;
  1137. } else if (type == '3') {
  1138. for (var z3 = 0; z3 < res.data.length; z3++) {
  1139. townList.push({ townCode: res.data[z3].townCode, text: res.data[z3].townName });
  1140. }
  1141. this.townList = townList;
  1142. } else {
  1143. for (var z = 0; z < res.data.length; z++) {
  1144. provinceList.push({
  1145. provinceCode: res.data[z].provinceCode,
  1146. text: res.data[z].provinceName,
  1147. });
  1148. }
  1149. this.provinceList = provinceList;
  1150. }
  1151. }
  1152. );
  1153. },
  1154. getDetail() {
  1155. // 获取当前定位
  1156. this.getLocation();
  1157. this.phoneNumber = true;
  1158. let loading1 = this.$toast.loading({
  1159. duration: 0,
  1160. message: '加载中...',
  1161. forbidClick: true,
  1162. });
  1163. var postType = localStorage.getItem('postType');
  1164. if (postType == 'GZ') {
  1165. this.typeShow = false;
  1166. } else {
  1167. this.typeShow = true;
  1168. }
  1169. getById({ storeId: this.$route.query.id }).then((res) => {
  1170. loading1.clear();
  1171. this.validFlag = this.$route.query.validFlag;
  1172. if (res.code == 200) {
  1173. this.fromValue = res.data;
  1174. if (this.fromValue.imgSed && this.fromValue.imgSed != '') {
  1175. this.displayImg = this.fromValue.imgSed.split(',');
  1176. } else {
  1177. this.displayImg = [];
  1178. }
  1179. if (this.fromValue.lat != null) {
  1180. } else {
  1181. this.fromValue.lat = '';
  1182. this.fromValue.lon = '';
  1183. }
  1184. localStorage.setItem('locationRemark', res.data.addressLine);
  1185. localStorage.setItem('orgName', res.data.orgName);
  1186. if (
  1187. this.fromValue.potentialCustomerType != null &&
  1188. this.fromValue.potentialCustomerType != undefined
  1189. ) {
  1190. } else {
  1191. this.fromValue.potentialCustomerType = '';
  1192. }
  1193. if (this.fromValue.carShopImgList != null) {
  1194. } else {
  1195. this.fromValue.carShopImgList = [];
  1196. }
  1197. if (this.fromValue.attribute3 != null) {
  1198. } else {
  1199. this.fromValue.attribute3 = '';
  1200. }
  1201. if (this.fromValue.attribute5 != null) {
  1202. } else {
  1203. this.fromValue.attribute5 = '';
  1204. }
  1205. // this.getChainsByDeptCode(res.data.orgId)
  1206. this.getChainsByDeptCode(null, res.data.ifJzStoreType);
  1207. if (this.fromValue.storeCategory == '129081' || this.fromValue.storeCategory == '10131') {
  1208. this.typeABshow = true;
  1209. }
  1210. if (this.fromValue.storeCategory == '129081') {
  1211. this.dictTypeAFormShow = true;
  1212. }
  1213. if (this.fromValue.attribute3 == '0') {
  1214. this.attrShow = true;
  1215. }
  1216. if (this.fromValue.storeCategory == '10131') {
  1217. this.dictTypeFormShow = true;
  1218. }
  1219. if (this.fromValue.storeCategory == 'sjs61') {
  1220. this.dictTypeSJSFormShow = true;
  1221. }
  1222. if (this.fromValue.storeCategory == 'zyjz63') {
  1223. this.dictTypeQGJZFormShow = true;
  1224. } else {
  1225. this.dictTypeQGJZFormShow = false;
  1226. }
  1227. if (this.fromValue.storeCategory == 'C912') {
  1228. this.storeTypePOP = false;
  1229. this.storeName = '铭牌上项目名称';
  1230. this.address = '地址';
  1231. } else if (this.fromValue.storeCategory == 'C917') {
  1232. this.storeTypePOP = false;
  1233. this.storeName = '名称';
  1234. this.address = '地址';
  1235. } else {
  1236. this.storeTypePOP = true;
  1237. this.storeName = '名称';
  1238. this.address = '地址';
  1239. }
  1240. if (this.fromValue.storeCategory == 'C917') {
  1241. this.GZAttributeFormShow = true;
  1242. this.dictTypeSJSFormShow = false;
  1243. this.dictTypeQGJZFormShow = false;
  1244. this.dictTypeFormShow = false;
  1245. this.dictTypeAFormShow = false;
  1246. this.typeABshow = false;
  1247. } else {
  1248. this.GZAttributeFormShow = false;
  1249. }
  1250. localStorage.setItem('chainName', res.data.storeName);
  1251. this.getStreetQuery();
  1252. this.getStreetQuery('1');
  1253. this.getStreetQuery('2');
  1254. this.getStreetQuery('3');
  1255. this.beforeAddFn(res.data.ifJzStoreType);
  1256. } else {
  1257. this.$toast.fail(res.msg);
  1258. }
  1259. });
  1260. },
  1261. newimgarr1(val) {
  1262. if (val.type == '1') {
  1263. this.fromValue.img = val.fileUrl;
  1264. } else if (val.type == '2') {
  1265. // this.fromValue.imgSed = val.fileUrl;
  1266. this.displayImg.push(val.fileUrl);
  1267. } else {
  1268. this.fromValue.carShopImgList.push(val.fileUrl);
  1269. }
  1270. },
  1271. // 关闭无效店铺
  1272. valid() {
  1273. this.$dialog
  1274. .confirm({
  1275. title: '系统提示',
  1276. message: '是否确认无效关店?',
  1277. })
  1278. .then(() => {
  1279. this.toastLoading();
  1280. valid({ storeId: this.$route.query.id }).then((res) => {
  1281. this.toastLoading().clear();
  1282. if (res.code == 200) {
  1283. this.$router.go(-2);
  1284. } else {
  1285. this.Toast({
  1286. message: res.msg,
  1287. duration: 3000,
  1288. });
  1289. }
  1290. });
  1291. });
  1292. },
  1293. beforeAddFn(ifJzStoreType) {
  1294. beforeAdd({
  1295. cityName: this.fromValue.cityName,
  1296. districtName: this.fromValue.districtName,
  1297. ifJzStoreType: ifJzStoreType,
  1298. }).then((res) => {
  1299. this.storeCategoryList = res.data.storeCategoryList;
  1300. });
  1301. },
  1302. getbrands() {
  1303. getbrands({}).then((res) => {
  1304. var brandst = [];
  1305. for (var t = 0; t < res.data.length; t++) {
  1306. brandst.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1307. }
  1308. this.brandst = brandst;
  1309. });
  1310. },
  1311. addVisits2() {
  1312. var that = this;
  1313. var map = new TMap.Map('allmap', {
  1314. zoom: 15,
  1315. center: new TMap.LatLng(39.986785, 116.301012),
  1316. });
  1317. var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
  1318. var markers = new TMap.MultiMarker({
  1319. map: map,
  1320. geometries: [],
  1321. });
  1322. markers.setGeometries([]);
  1323. var latlng = this.gcj02BD(this.fromValue.lat, this.fromValue.lon);
  1324. var location = new TMap.LatLng(latlng.lat, latlng.lon);
  1325. map.setCenter(location);
  1326. markers.updateGeometries([
  1327. {
  1328. id: 'marker',
  1329. position: location,
  1330. },
  1331. ]);
  1332. geocoder.getAddress({ location: location }).then(function (result) {
  1333. var addresses = result.result.formatted_addresses;
  1334. (that.cityName = result.result.ad_info.city),
  1335. (that.districtName = result.result.ad_info.district),
  1336. (that.provinceName = result.result.ad_info.province),
  1337. (that.addressLine = addresses.recommend);
  1338. localStorage.setItem('locationRemark', addresses.recommend);
  1339. localStorage.setItem('address', addresses.recommend);
  1340. that.beforeAddFn();
  1341. });
  1342. },
  1343. getLocation() {
  1344. getPosition()
  1345. .then((res) => {
  1346. let { TXisBD } = res;
  1347. this.location = TXisBD;
  1348. this.fromValue.lat = TXisBD.lat;
  1349. this.fromValue.lon = TXisBD.lon;
  1350. })
  1351. .catch((error) => {
  1352. this.$dialog.alert({
  1353. message: error,
  1354. });
  1355. });
  1356. },
  1357. showPickerChainsListFn() {
  1358. if (this.fromValue.storeCategoryName == '') {
  1359. this.$toast('类型未选择');
  1360. return;
  1361. } else if (this.fromValue.orgName == '') {
  1362. this.$toast('部门未选择');
  1363. return;
  1364. } else {
  1365. this.showPickerChainsList = true;
  1366. }
  1367. },
  1368. getTCFXList() {
  1369. getTCFXList({}).then((res) => {
  1370. var TCFXList = [];
  1371. for (var t = 0; t < res.data.length; t++) {
  1372. TCFXList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1373. }
  1374. this.TCFXList = TCFXList;
  1375. });
  1376. },
  1377. getSJSList() {
  1378. getSJSList({}).then((res) => {
  1379. var SJSList = [];
  1380. for (var t = 0; t < res.data.length; t++) {
  1381. SJSList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1382. }
  1383. this.SJSList = SJSList;
  1384. });
  1385. },
  1386. getQGJZist() {
  1387. getQGJZist({}).then((res) => {
  1388. var QGJZist = [];
  1389. for (var t = 0; t < res.data.length; t++) {
  1390. QGJZist.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
  1391. }
  1392. this.QGJZist = QGJZist;
  1393. });
  1394. },
  1395. onProvinceConfirm(value) {
  1396. this.fromValue.provinceName = value.text;
  1397. this.fromValue.province = value.provinceCode;
  1398. this.fromValue.cityName = '';
  1399. this.fromValue.city = '';
  1400. this.fromValue.districtName = '';
  1401. this.fromValue.district = '';
  1402. this.fromValue.townName = '';
  1403. this.fromValue.townCode = '';
  1404. this.countyCode = '';
  1405. this.cityCode = '';
  1406. this.provinceCode = value.provinceCode;
  1407. this.getStreetQuery('1');
  1408. this.showProvincePicker = false;
  1409. },
  1410. onCityConfirm(value) {
  1411. this.fromValue.cityName = value.text;
  1412. this.fromValue.city = value.cityCode;
  1413. this.fromValue.districtName = '';
  1414. this.fromValue.district = '';
  1415. this.fromValue.townName = '';
  1416. this.fromValue.townCode = '';
  1417. this.countyCode = '';
  1418. this.cityCode = value.cityCode;
  1419. this.getStreetQuery('2');
  1420. this.showCityPicker = false;
  1421. },
  1422. onDistrictConfirm(value) {
  1423. this.fromValue.districtName = value.text;
  1424. this.fromValue.district = value.countyCode;
  1425. this.fromValue.townName = '';
  1426. this.fromValue.townCode = '';
  1427. this.countyCode = value.countyCode;
  1428. this.fromValue.cityLevel = value.countyLevel;
  1429. this.getStreetQuery('3');
  1430. this.showDistrictPicker = false;
  1431. },
  1432. onTownConfirm(value) {
  1433. this.fromValue.townName = value.text;
  1434. this.fromValue.townCode = value.townCode;
  1435. this.showTownPicker = false;
  1436. },
  1437. onTCFXLConfirm(value) {
  1438. this.fromValue.tcfxName = value.text;
  1439. this.fromValue.tcfxCode = value.dictCode;
  1440. this.showTCFXL = false;
  1441. },
  1442. moreTypeShowFn() {
  1443. if (this.fromValue.storeCategoryName == '') {
  1444. this.$toast('类型未选择');
  1445. return;
  1446. } else if (this.fromValue.orgName == '') {
  1447. this.$toast('部门未选择');
  1448. return;
  1449. } else {
  1450. this.moreTypeShow = true;
  1451. }
  1452. },
  1453. onConfirm(value) {
  1454. // || value.dictValue == "129081" ||value.dictValue == "10131"
  1455. this.fromValue.storeCategoryName = value.text;
  1456. this.fromValue.storeCategory = value.dictValue;
  1457. if (value.dictValue == '129081' || value.dictValue == '10131') {
  1458. this.typeABshow = true;
  1459. } else {
  1460. this.typeABshow = false;
  1461. this.fromValue.carShop = '';
  1462. this.fromValue.carShopImgList = [];
  1463. }
  1464. if (value.dictValue == '129081') {
  1465. this.dictTypeAFormShow = true;
  1466. } else {
  1467. this.fromValue.tcfxName = '';
  1468. this.fromValue.tcfxCode = '';
  1469. this.dictTypeAFormShow = false;
  1470. }
  1471. if (value.dictValue == 'C917') {
  1472. this.GZAttributeFormShow = true;
  1473. this.dictTypeSJSFormShow = false;
  1474. this.dictTypeQGJZFormShow = false;
  1475. this.dictTypeFormShow = false;
  1476. this.dictTypeAFormShow = false;
  1477. this.typeABshow = false;
  1478. } else {
  1479. this.fromValue.tcfxName = '';
  1480. this.fromValue.tcfxCode = '';
  1481. this.GZAttributeFormShow = false;
  1482. }
  1483. if (value.dictValue == '10131') {
  1484. this.dictTypeFormShow = true;
  1485. } else {
  1486. this.fromValue.tcfxName = '';
  1487. this.fromValue.tcfxCode = '';
  1488. this.dictTypeFormShow = false;
  1489. }
  1490. if (value.dictValue == 'sjs61') {
  1491. this.dictTypeSJSFormShow = true;
  1492. } else {
  1493. this.fromValue.tcfxName = '';
  1494. this.fromValue.tcfxCode = '';
  1495. this.dictTypeSJSFormShow = false;
  1496. }
  1497. if (value.dictValue == 'zyjz63') {
  1498. this.dictTypeQGJZFormShow = true;
  1499. } else {
  1500. this.fromValue.tcfxName = '';
  1501. this.fromValue.tcfxCode = '';
  1502. this.dictTypeQGJZFormShow = false;
  1503. }
  1504. if (this.fromValue.ifJzStoreType == 1 && value.ifJzStoreType != 1) {
  1505. this.$toast('家装公司不能变为同城店');
  1506. return;
  1507. } else if (this.fromValue.ifJzStoreType != 1 && value.ifJzStoreType == 1) {
  1508. this.$toast('同城店不能变为家装公司');
  1509. return;
  1510. } else {
  1511. this.fromValue.chainName = '';
  1512. this.fromValue.chainCode = '';
  1513. this.fromValue.orgName = '';
  1514. this.fromValue.orgId = '';
  1515. this.fromValue.storeCategoryName = value.dictLabel;
  1516. this.fromValue.storeCategory = value.dictValue;
  1517. this.fromValue.ifJzStoreType = value.ifJzStoreType;
  1518. this.getChainsByDeptCode(null, value.ifJzStoreType);
  1519. this.showPicker = false;
  1520. }
  1521. if (value.dictValue == 'C912') {
  1522. this.storeTypePOP = false;
  1523. this.storeName = '铭牌上项目名称';
  1524. this.address = '地址';
  1525. } else if (value.dictValue == 'C917') {
  1526. this.storeTypePOP = false;
  1527. this.storeName = '名称';
  1528. this.address = '地址';
  1529. } else {
  1530. this.storeTypePOP = true;
  1531. this.storeName = '名称';
  1532. this.address = '地址';
  1533. }
  1534. },
  1535. onConfirmChainsList(value) {
  1536. this.fromValue.chainName = value.chainName;
  1537. this.fromValue.chainCode = value.chainCode;
  1538. this.showPickerChainsList = false;
  1539. this.moreTypeShow = false;
  1540. },
  1541. numberFn() {
  1542. if (Number(this.fromValue.area) < 1) {
  1543. this.fromValue.area = '';
  1544. } else {
  1545. this.fromValue.area = this.fromValue.area.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
  1546. }
  1547. },
  1548. onSubmit() {
  1549. this.fromValue.imgSed = this.displayImg.join(',');
  1550. for (var n1 = 0; n1 < this.fromValue.orderProductStoreList.length; n1++) {
  1551. for (var n2 = 0; n2 < this.sfaOrderProducts.length; n2++) {
  1552. if (
  1553. this.sfaOrderProducts[n2].storeProductId ==
  1554. this.fromValue.orderProductStoreList[n1].storeProductId
  1555. ) {
  1556. this.fromValue.orderProductStoreList[n1].orderNum = this.sfaOrderProducts[n2].orderNum;
  1557. }
  1558. }
  1559. }
  1560. var fromValue = this.fromValue;
  1561. 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}$/;
  1562. if (
  1563. fromValue.chainName == '' &&
  1564. fromValue.ifJzStoreType != 1 &&
  1565. fromValue.storeCategory != 'C912' &&
  1566. fromValue.storeCategory != 'C917'
  1567. ) {
  1568. this.$toast('经销商未选择');
  1569. return;
  1570. } else if (fromValue.orgId == '') {
  1571. this.$toast('部门未选择');
  1572. return;
  1573. } else if (fromValue.storeName == '') {
  1574. if (fromValue.storeCategory == 'C912') {
  1575. this.$toast('铭牌上项目名称未填写');
  1576. } else if (fromValue.storeCategory == 'C917') {
  1577. this.$toast('名称未填写');
  1578. } else {
  1579. this.$toast('名称未填写');
  1580. }
  1581. return;
  1582. } else if (fromValue.addressLine == '') {
  1583. if (fromValue.storeCategory == 'C912') {
  1584. this.$toast('地址未填写');
  1585. } else if (fromValue.storeCategory == 'C917') {
  1586. this.$toast('地址未填写');
  1587. } else {
  1588. this.$toast('地址未填写');
  1589. }
  1590. return;
  1591. } else if (fromValue.storeCategoryName == '') {
  1592. this.$toast('类型未填写');
  1593. return;
  1594. } else if (fromValue.provinceName == '') {
  1595. this.$toast('所在省份未填写');
  1596. return;
  1597. } else if (fromValue.cityName == '') {
  1598. this.$toast('所在城市未填写');
  1599. return;
  1600. } else if (fromValue.districtName == '') {
  1601. this.$toast('所在县区未填写');
  1602. return;
  1603. } else if (fromValue.townName == '') {
  1604. this.$toast('所在街道未填写');
  1605. return;
  1606. } else if (
  1607. fromValue.contactName == '' &&
  1608. fromValue.ifJzStoreType != 1 &&
  1609. fromValue.storeCategory != 'C917'
  1610. ) {
  1611. this.$toast('联系人未填写');
  1612. return;
  1613. } else if (
  1614. fromValue.telephone.trim() == '' &&
  1615. fromValue.ifJzStoreType != 1 &&
  1616. fromValue.storeCategory != 'C917'
  1617. ) {
  1618. this.$toast('联系电话未填写');
  1619. return;
  1620. } else if (
  1621. !telrg.test(fromValue.telephone) &&
  1622. fromValue.ifJzStoreType != 1 &&
  1623. fromValue.storeCategory != 'C917'
  1624. ) {
  1625. this.$toast('手机号格式错误');
  1626. return;
  1627. } else if (
  1628. !this.phoneNumber &&
  1629. fromValue.ifJzStoreType != 1 &&
  1630. fromValue.storeCategory != 'C917'
  1631. ) {
  1632. this.$toast('不能填写业务员手机号');
  1633. return;
  1634. } else if (fromValue.img == '' && fromValue.storeCategory != 'C917') {
  1635. if (this.storeTypePOP) {
  1636. if (fromValue.ifJzStoreType != 1) {
  1637. this.$toast('图片未上传');
  1638. } else {
  1639. this.$toast('家装前台照片未上传');
  1640. }
  1641. } else {
  1642. this.$toast('照片未上传');
  1643. }
  1644. return;
  1645. } else if (
  1646. fromValue.imgSed == '' &&
  1647. fromValue.ifJzStoreType != 1 &&
  1648. this.storeTypePOP &&
  1649. fromValue.storeCategory != 'C917'
  1650. ) {
  1651. this.$toast('图片未上传');
  1652. return;
  1653. } else if (
  1654. (fromValue.storeCategory == '10131' ||
  1655. fromValue.storeCategory == 'sjs61' ||
  1656. fromValue.storeCategory == 'zyjz63') &&
  1657. fromValue.tcfxName == ''
  1658. ) {
  1659. this.$toast('属性未填写');
  1660. return;
  1661. }
  1662. if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
  1663. this.$toast('家装展厅面积未填写');
  1664. return;
  1665. }
  1666. if (fromValue.storeCategory == '129081' && fromValue.attribute3 == '') {
  1667. this.$toast('属性未填写');
  1668. return;
  1669. }
  1670. if (
  1671. fromValue.storeCategory == '129081' &&
  1672. fromValue.attribute3 == '0' &&
  1673. fromValue.attribute5 == ''
  1674. ) {
  1675. this.$toast('属性未填写');
  1676. return;
  1677. }
  1678. if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
  1679. this.$toast('潜在客户类型未填写');
  1680. return;
  1681. }
  1682. let loading1 = this.$toast.loading({
  1683. duration: 0,
  1684. message: '加载中...',
  1685. forbidClick: true,
  1686. });
  1687. // 当前定位复制
  1688. this.fromValue.myLat = this.location.lat;
  1689. this.fromValue.myLon = this.location.lon;
  1690. console.log(this.fromValue);
  1691. updateStore(this.fromValue).then((res) => {
  1692. loading1.clear();
  1693. if (res.code == 200) {
  1694. this.$dialog
  1695. .alert({
  1696. title: '系统提示',
  1697. message: res.msg,
  1698. })
  1699. .then(() => {
  1700. this.$router.go(-1);
  1701. });
  1702. } else {
  1703. this.$dialog.alert({
  1704. message: res.msg,
  1705. messageAlign: 'left',
  1706. });
  1707. }
  1708. });
  1709. },
  1710. onClickLeft() {
  1711. this.$router.go(-1);
  1712. },
  1713. phoneCheck() {
  1714. if (this.fromValue.ifJzStoreType != 1) {
  1715. 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}$/;
  1716. if (this.fromValue.telephone.trim() == '') {
  1717. return;
  1718. } else if (!telrg.test(this.fromValue.telephone)) {
  1719. this.$toast('手机号格式错误');
  1720. return;
  1721. } else {
  1722. phoneCheck({ phoneNumber: this.fromValue.telephone }).then((res) => {
  1723. if (res.code == 200) {
  1724. this.phoneNumber = true;
  1725. } else {
  1726. this.phoneNumber = false;
  1727. }
  1728. });
  1729. }
  1730. }
  1731. },
  1732. // 陈列照 图片删除
  1733. deleteImg(index) {
  1734. this.displayImg.splice(index, 1);
  1735. },
  1736. // 预览
  1737. previewsImg(index) {
  1738. var arrimg = [];
  1739. for (var imgi = 0; imgi < this.displayImg.length; imgi++) {
  1740. arrimg.push(this.displayImg[imgi]);
  1741. }
  1742. ImagePreview({
  1743. images: arrimg,
  1744. startPosition: index,
  1745. });
  1746. },
  1747. },
  1748. };
  1749. </script>
  1750. <style scoped lang="scss">
  1751. .myTab .van-tabs__nav--card {
  1752. margin: 0 !important;
  1753. border-left: 0;
  1754. border-right: 0;
  1755. }
  1756. .myTab .van-tabs__wrap,
  1757. .myTab .van-tabs__nav--card {
  1758. height: 40px;
  1759. }
  1760. .myTab .van-tab {
  1761. line-height: 40px;
  1762. }
  1763. .van-f-red {
  1764. color: red;
  1765. width: 4px;
  1766. display: inline-block;
  1767. }
  1768. .storeEdit {
  1769. .invalid {
  1770. display: flex;
  1771. justify-content: center;
  1772. padding-bottom: 10px;
  1773. .van-button {
  1774. width: 70%;
  1775. }
  1776. }
  1777. }
  1778. .displayImg {
  1779. overflow: hidden;
  1780. .displayImgBox {
  1781. position: relative;
  1782. width: 48%;
  1783. padding: 20px 0;
  1784. height: 210px;
  1785. float: left;
  1786. margin-right: 4%;
  1787. .title {
  1788. text-align: center;
  1789. padding: 5px 0;
  1790. }
  1791. }
  1792. .displayImgBox:nth-child(even) {
  1793. margin-right: 0;
  1794. }
  1795. i {
  1796. position: absolute;
  1797. right: 4px;
  1798. color: white;
  1799. background: red;
  1800. overflow: hidden;
  1801. border-radius: 50%;
  1802. }
  1803. }
  1804. </style>
  1805. <style>
  1806. #allmap {
  1807. width: 100px;
  1808. height: 100px;
  1809. position: fixed;
  1810. left: -2000px;
  1811. }
  1812. .van-dialog__confirm,
  1813. .van-dialog__confirm:active {
  1814. color: #0057ba;
  1815. }
  1816. .navBarTOP {
  1817. position: fixed;
  1818. width: 100%;
  1819. z-index: 2;
  1820. top: 0;
  1821. }
  1822. .typeRadioStore .van-radio {
  1823. margin: 10px;
  1824. }
  1825. .typeRadioStore .van-radio__icon .van-icon {
  1826. border: 0 !important;
  1827. }
  1828. .typeRadioStore .van-radio__icon--checked .van-icon {
  1829. color: #1989fa;
  1830. background-color: transparent;
  1831. border-color: transparent;
  1832. }
  1833. .typeRadioStore .van-cell {
  1834. padding: 0 16px;
  1835. line-height: 40px;
  1836. }
  1837. .container .typeRadioStore .van-cell__title {
  1838. height: 40px;
  1839. }
  1840. .typeRadioStore1 .van-radio__icon .van-icon {
  1841. border-radius: 2px;
  1842. border-color: #ccc !important;
  1843. }
  1844. .typeRadioStore1 .van-radio__icon--checked .van-icon {
  1845. background-color: transparent;
  1846. color: #1989fa;
  1847. border-color: #1989fa !important;
  1848. }
  1849. .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
  1850. color: #1989fa;
  1851. }
  1852. .morelaji .van-cell {
  1853. padding: 10px 0;
  1854. }
  1855. </style>