storeAdd.vue 68 KB

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