index.vue 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388
  1. <template>
  2. <div class="bgcolor">
  3. <div class="navBarTOP">
  4. <!-- 顶部条-->
  5. <van-nav-bar class="navBar" title="计划外">
  6. <template #right>
  7. <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
  8. </template>
  9. </van-nav-bar>
  10. <div class="searchDiv">
  11. <van-search
  12. v-model="storeName"
  13. left-icon="search"
  14. show-action
  15. placeholder="搜索名称/编号/地址"
  16. @clear="clearFn">
  17. <template #action>
  18. <div @click="onSearchm">搜索</div>
  19. </template>
  20. </van-search>
  21. </div>
  22. <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
  23. <van-tab title="销售部" name="0" :disabled="disabled"></van-tab>
  24. <van-tab title="我的" name="1" :disabled="disabled"></van-tab>
  25. </van-tabs>
  26. </div>
  27. <!-- 主体内容-->
  28. <div class="container" style="margin-top: 144px">
  29. <van-list
  30. class="myList"
  31. v-model="loading"
  32. :finished="finished"
  33. finished-text="--已经到底了--"
  34. @load="onLoad">
  35. <div class="cellcontent" v-for="(item, index) in list" :key="index">
  36. <van-cell>
  37. <div class="card">
  38. <div class="title titlero">
  39. <span @click="goOtherSystem(item)" :style="setStroeNameStyle(item)">
  40. <span>{{ item.storeName }}</span>
  41. (<span>{{ item.storeCode }}</span
  42. >)
  43. </span>
  44. <span class="btn" :data-clipboard-text="item.storeCode">
  45. <van-icon
  46. :name="paste"
  47. color="#ee0a24"
  48. size="20"
  49. style="top: 6px; margin-left: 4px" />
  50. </span>
  51. <!-- "approvalStatus": 1:已结案;0:未结案, -->
  52. <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
  53. <template v-if="item.approvalStatus == 0">
  54. <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
  55. >已提交</span
  56. >
  57. <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
  58. >未提交</span
  59. >
  60. </template>
  61. </div>
  62. <div class="info" style="position: relative">
  63. 联系人:{{ item.contactName }}
  64. <div style="position: absolute; bottom: 0px; right: 0px">
  65. <el-popover
  66. popper-class="zpover zpover6"
  67. placement="bottom-start"
  68. trigger="click">
  69. <div>
  70. <p>
  71. 本店{{ timeData }}下单SKU数:<a
  72. @click="linkList(item)"
  73. style="text-decoration: underline"
  74. >点击查看详情</a
  75. >
  76. </p>
  77. </div>
  78. <div
  79. class="visitStoreIco"
  80. v-if="item.storeLabels.zysslNums"
  81. style="background-color: #fff; position: relative"
  82. slot="reference">
  83. <p
  84. style="
  85. width: 100%;
  86. position: absolute;
  87. z-index: 1;
  88. top: 0.2px;
  89. width: 22px;
  90. margin: 0;
  91. margin-left: 3.6px;
  92. text-align: center;
  93. font-size: 12px;
  94. ">
  95. {{ item.storeLabels.zysslNums }}
  96. </p>
  97. <van-icon :name="ord" size="26" />
  98. </div>
  99. </el-popover>
  100. <el-popover
  101. popper-class="zpover zpover5"
  102. placement="bottom"
  103. width="200"
  104. trigger="click">
  105. <div v-if="item.storeLabels">
  106. <p>已参加:</p>
  107. <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
  108. {{ tt }}
  109. </p>
  110. </div>
  111. <div
  112. class="visitStoreIco"
  113. v-if="item.storeLabels.targetOne"
  114. style="background-color: #fff"
  115. slot="reference">
  116. <van-icon :name="targetOne" size="26" />
  117. </div>
  118. </el-popover>
  119. <el-popover
  120. popper-class="zpover"
  121. placement="bottom"
  122. width="120"
  123. trigger="click"
  124. content="调色机5天未联网">
  125. <div
  126. v-if="item.storeLabels.ccmOffline"
  127. class="visitStoreIco"
  128. style="background-color: #fff"
  129. slot="reference">
  130. <van-icon :name="Network" size="26" />
  131. </div>
  132. </el-popover>
  133. <el-popover
  134. popper-class="zpover"
  135. placement="bottom"
  136. width="200"
  137. trigger="click"
  138. content="同城店近60天未下单">
  139. <div
  140. v-if="item.storeLabels.fxNoOrder"
  141. class="visitStoreIco"
  142. style="background-color: #fff"
  143. slot="reference">
  144. <van-icon :name="order60" size="26" />
  145. </div>
  146. </el-popover>
  147. <el-popover
  148. popper-class="zpover"
  149. placement="bottom"
  150. width="200"
  151. trigger="click"
  152. content="金牌店近30天未下单">
  153. <div
  154. v-if="item.storeLabels.noOrder"
  155. class="visitStoreIco"
  156. style="background-color: #fff"
  157. slot="reference">
  158. <van-icon :name="order" size="26" />
  159. </div>
  160. </el-popover>
  161. <el-popover
  162. popper-class="zpover"
  163. placement="bottom"
  164. width="200"
  165. trigger="click"
  166. content="本店本月进过专业时时丽">
  167. <div
  168. class="visitStoreIco"
  169. v-if="item.storeLabels.zyssl"
  170. style="background-color: #ed5c68"
  171. slot="reference">
  172. </div>
  173. </el-popover>
  174. <el-popover
  175. popper-class="zpover zpover1"
  176. placement="bottom"
  177. width="200"
  178. trigger="click"
  179. content="本店本月进过超好贴">
  180. <div
  181. v-if="item.storeLabels.chtczj"
  182. class="visitStoreIco"
  183. style="background-color: #0057ba"
  184. slot="reference">
  185. </div>
  186. </el-popover>
  187. <el-popover
  188. placement="bottom"
  189. popper-class="zpover zpover1 zpover1sb"
  190. :disabled="!item.userVisitTimesMap"
  191. trigger="click">
  192. <div
  193. v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
  194. class="visitStoreIco"
  195. slot="reference"
  196. style="background-color: #fff; position: relative">
  197. <p
  198. style="
  199. width: 100%;
  200. position: absolute;
  201. z-index: 10;
  202. top: -2px;
  203. margin: 0;
  204. text-align: center;
  205. font-size: 12px;
  206. ">
  207. {{ item.storeLabels.visitTimes }}
  208. </p>
  209. <van-icon :name="ordernum" size="26" />
  210. </div>
  211. <el-table :data="item.userVisitTimesMap" border max-height="180px">
  212. <el-table-column label="业务员" prop="userName" />
  213. <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
  214. </el-table>
  215. </el-popover>
  216. </div>
  217. </div>
  218. <div class="info">
  219. 类型:{{ item.storeCategory }}&nbsp;
  220. <el-popover popper-class="zpover zpover6" placement="bottom-start" trigger="click">
  221. <div>
  222. <p>
  223. 本店经营品项指导:
  224. <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
  225. </p>
  226. </div>
  227. <van-icon name="question-o" size="18" slot="reference" />
  228. </el-popover>
  229. </div>
  230. <div class="info" v-if="item.telephone" @click="buryingPointFn(item)">
  231. 联系电话:<a
  232. style="color: #0057ba; font-weight: bold; text-decoration: underline"
  233. :href="'tel:' + item.telephone"
  234. >{{ item.telephone }}<van-icon name="phone"
  235. /></a>
  236. </div>
  237. <div class="info">
  238. 地址:{{ item.addressLine }}
  239. <img
  240. v-if="item.storeLonExist"
  241. style="width: 36px"
  242. :src="sbpmdh"
  243. @click="linkapp(item)" />
  244. </div>
  245. <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
  246. <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
  247. <div class="info" v-if="item.storeLonExist">
  248. 距离:{{ Micrometer(item.distance) }}m
  249. </div>
  250. </div>
  251. <div
  252. class="statstext"
  253. v-if="item.stateString == '未拜访'"
  254. style="background-color: #ed5c68">
  255. 未拜访
  256. </div>
  257. <div
  258. class="statstext"
  259. v-if="item.stateString == '拜访中'"
  260. style="background-color: white">
  261. <van-icon :name="times" color="#ee0a24" size="32" />
  262. </div>
  263. <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
  264. <div class="btnbox">
  265. <van-row>
  266. <van-col
  267. span="5"
  268. v-if="item.stateString != '已拜访' && customerVisits"
  269. @click="storeVisit(item)">
  270. <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
  271. <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
  272. </van-col>
  273. <van-col
  274. span="5"
  275. v-if="item.storeCategory == '公装经销商'"
  276. @click="projectOutVisit(item)">
  277. <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
  278. <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
  279. </van-col>
  280. <van-col
  281. span="5"
  282. v-if="
  283. item.stateString != '已拜访' &&
  284. item.storeCategory != '公装经销商' &&
  285. customerVisits
  286. "
  287. @click="abnormalVisit(item)">
  288. <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
  289. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  290. 异常拜访
  291. </p>
  292. </van-col>
  293. <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
  294. <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
  295. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  296. 去下单
  297. </p>
  298. </van-col>
  299. <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
  300. <img :src="bfxx" style="margin: 0 auto; height: 18px; display: block" />
  301. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  302. 拜访信息
  303. </p>
  304. </van-col>
  305. <van-col span="5" @click="visitFn(item)">
  306. <img :src="kehuxinxi" style="margin: 0 auto; width: 18px; display: block" />
  307. <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
  308. 客户信息
  309. </p>
  310. </van-col>
  311. <van-col span="5" v-if="tabVal == 1" @click="storeJoinVisit(item)">
  312. <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
  313. <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
  314. </van-col>
  315. </van-row>
  316. </div>
  317. </van-cell>
  318. <div class="lineGrey"></div>
  319. </div>
  320. <van-empty v-if="list.length == 0" />
  321. </van-list>
  322. <br />
  323. <br />
  324. <br />
  325. <br />
  326. <br />
  327. </div>
  328. <van-popup v-model="showPicker" position="bottom" class="textsize">
  329. <van-row
  330. style="
  331. position: fixed;
  332. top: 0;
  333. width: 100%;
  334. z-index: 998;
  335. background-color: #fff;
  336. border-bottom: 1px solid #ccc;
  337. ">
  338. <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
  339. <van-icon name="cross" size="20" color="#909399" />
  340. </van-col>
  341. <van-col span="13"> </van-col>
  342. <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
  343. <div style="color: #0057ba">
  344. <van-button type="info" size="small" color="#0057ba">筛选</van-button>
  345. </div></van-col
  346. >
  347. <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
  348. <van-button type="default" size="small" style="height: 28px">重置</van-button>
  349. </van-col>
  350. </van-row>
  351. <div style="height: 48px; width: 100%"></div>
  352. <div class="searchcheck">
  353. <p class="searchchecktitle">&nbsp;经销商</p>
  354. <van-row>
  355. <van-col span="24">
  356. <div @click="moreTypeShowFn">
  357. <van-field
  358. style="
  359. margin-top: -6px;
  360. border-radius: 6px;
  361. border: 1px solid #ccc;
  362. overflow: hidden;
  363. "
  364. readonly
  365. v-model="chainName"
  366. label=""
  367. placeholder="请选择经销商" />
  368. </div>
  369. </van-col>
  370. </van-row>
  371. <p class="searchchecktitle" @click="otherbqShow = !otherbqShow">
  372. &nbsp;门店标签<van-icon name="arrow-down" style="float: right" />
  373. </p>
  374. <van-checkbox-group v-model="storeLabelTypes" direction="horizontal">
  375. <div v-if="otherbqShow" style="width: 100%">
  376. <div class="checkbox" v-for="(item, index) in StoreLabels" :key="index">
  377. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  378. </div>
  379. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  380. </div>
  381. </van-checkbox-group>
  382. <van-checkbox-group v-model="result" direction="horizontal">
  383. <p class="searchchecktitle" @click="otherkkdShow = !otherkkdShow">
  384. &nbsp;可控店<van-icon name="arrow-down" style="float: right" />
  385. </p>
  386. <div v-if="otherkkdShow">
  387. <div v-for="(item, index) in storeTypeLists" :key="index" class="checkbox1">
  388. <div v-if="item.groupType == 'kkd'" class="child">
  389. <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
  390. </div>
  391. </div>
  392. </div>
  393. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  394. <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
  395. &nbsp;分销店<van-icon name="arrow-down" style="float: right" />
  396. </p>
  397. <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
  398. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  399. <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
  400. 金牌店<van-icon name="arrow-down" style="float: right" />
  401. </p>
  402. <div v-if="otherfxdShow1">
  403. <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
  404. <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
  405. <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
  406. </div>
  407. </div>
  408. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  409. </div>
  410. <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
  411. 同城分销店<van-icon name="arrow-down" style="float: right" />
  412. </p>
  413. <div v-if="otherfxdShow2">
  414. <div
  415. v-for="(itemlj, indexlj) in storeTypeLists"
  416. :key="400 + indexlj"
  417. class="checkbox1">
  418. <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
  419. <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
  420. </div>
  421. </div>
  422. <div style="clear: both"></div>
  423. </div>
  424. </div>
  425. <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
  426. <p class="searchchecktitle" @click="otherShow = !otherShow">
  427. &nbsp;其他 <van-icon name="arrow-down" style="float: right" />
  428. </p>
  429. <div v-if="otherShow">
  430. <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
  431. <div v-if="item2.groupType == 'other'" class="child">
  432. <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
  433. </div>
  434. </div>
  435. </div>
  436. </van-checkbox-group>
  437. </div>
  438. </van-popup>
  439. <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
  440. <van-row style="background-color: #f5f5f5">
  441. <van-col span="20">
  442. <van-field
  443. left-icon="search"
  444. style="margin-top: 2px; border-radius: 6px; overflow: hidden"
  445. v-model="CustomerName"
  446. label=""
  447. placeholder="请输入关键词"
  448. clearable />
  449. </van-col>
  450. <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
  451. <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
  452. >
  453. </van-row>
  454. <van-picker
  455. show-toolbar
  456. :columns="chainsData"
  457. value-key="chainName"
  458. @confirm="onConfirmChainsList"
  459. @cancel="moreTypeShow = false"
  460. visible-item-count="10" />
  461. </van-popup>
  462. <tab-bar tabBarActive="outsidelist"></tab-bar>
  463. <div class="positionContent" @click="rangeStoreFn()" v-if="mapShows">
  464. <van-icon class="img" :name="mpimg" size="50" />
  465. </div>
  466. </div>
  467. </template>
  468. <script>
  469. import tabBar from '@/components/tabBar';
  470. import {
  471. getUserOutPlaList,
  472. getUserOrgStoreList,
  473. stopVisit,
  474. checkVisit,
  475. addVisitsPosition,
  476. mobileReposition,
  477. getStoreyslTypeList,
  478. getStoreTypeListlp,
  479. joinInPlan,
  480. getStoreLabels,
  481. getCustomerList,
  482. buryingPoint,
  483. ProductItemImge,
  484. } from '@/api/index';
  485. import times from '@/assets/Icon/times.png';
  486. import order60 from '@/assets/order60.png';
  487. import targetOne from '@/assets/targetOne.png';
  488. import Network from '@/assets/Network.png';
  489. import ord from '@/assets/ord.png';
  490. import timeico from '@/assets/Icon/datatims.png';
  491. import location from '@/assets/location.png';
  492. import paste from '@/assets/paste.png';
  493. import visitTimes from '@/assets/visitTimes.png';
  494. import mpimg from '@/assets/mpimg.png';
  495. import axios from 'axios';
  496. import mapmarker from '@/components/mapMarkerDouble';
  497. import order from '@/assets/order.png';
  498. import ordernum from '@/assets/ordernum.png';
  499. import sbpmdh from '@/assets/sbpmdh.png';
  500. import request from '@/utils/request';
  501. import call from '@/assets/call.png';
  502. import jiarujihua from '@/assets/jiarujihua.png';
  503. import kehuxinxi from '@/assets/kehuxinxi-2.png';
  504. import xiadan from '@/assets/xiadan.png';
  505. import yichang from '@/assets/yichang.png';
  506. import bfxx from '@/assets/bfxx.png';
  507. import xmgj from '@/assets/xmgj.png';
  508. import { getOrderUrlByStoreId } from '@/api/inventory';
  509. import { checkStoreAddressByStoreCode } from '@/api/visitstore';
  510. import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
  511. export default {
  512. name: 'outsidelist',
  513. components: { tabBar, mapmarker },
  514. data() {
  515. return {
  516. yichang: yichang,
  517. xmgj: xmgj,
  518. bfxx: bfxx,
  519. xiadan: xiadan,
  520. kehuxinxi: kehuxinxi,
  521. jiarujihua: jiarujihua,
  522. call: call,
  523. times: times,
  524. searchShows: false,
  525. paste: paste,
  526. visitTimess: visitTimes,
  527. sbpmdh: sbpmdh,
  528. ordernum: ordernum,
  529. typeShow: false,
  530. mpimg: mpimg,
  531. order: order,
  532. ord: ord,
  533. mapShow: false,
  534. otherShow: false,
  535. Network: Network,
  536. order60: order60,
  537. targetOne: targetOne,
  538. chainName: '',
  539. chainCode: '',
  540. mapShows: false,
  541. activeNames: '1',
  542. showPopover: false,
  543. moreTypeShow: false,
  544. showPopoverVNUM: [],
  545. showPopoverC: [],
  546. showPopoverZ: [],
  547. zyssl: [],
  548. chtczj: [],
  549. noVisit: [],
  550. noOrder: [],
  551. fxNoOrder: [],
  552. storeLabelTypes: [],
  553. // showPopover:false,
  554. location: location,
  555. timeico: timeico,
  556. disabled: false,
  557. timer: null,
  558. flag: true,
  559. show: false,
  560. tabVal: '1',
  561. list: [],
  562. cont: 0,
  563. loading: false,
  564. showPicker: false,
  565. finished: false,
  566. otherbqShow: true,
  567. otherkkdShow: true,
  568. otherfxdShow: true,
  569. otherfxdShow2: true,
  570. otherfxdShow1: true,
  571. typeName: '搜索',
  572. visitEndId: '',
  573. pageSize: 12,
  574. pageNum: 1,
  575. listActive: null,
  576. query: '',
  577. storeName: '',
  578. genDate: '',
  579. storeType: '',
  580. endShow: false,
  581. storeCategory: '',
  582. fromValue: {},
  583. storeTypeList: [],
  584. storeTypeLists: [],
  585. chainsData: [],
  586. serachstype: '',
  587. addShow1: false,
  588. storeCategoryList: '',
  589. result: [],
  590. StoreLabels: [],
  591. CustomerName: '',
  592. lat: '',
  593. lon: '',
  594. timeData: '',
  595. customerVisits: true,
  596. };
  597. },
  598. watch: {
  599. $route(to, from) {
  600. this.storeName = localStorage.getItem('outvstoreName');
  601. this.chainName = localStorage.getItem('outvchainName');
  602. if (localStorage.getItem('lat') != null) {
  603. this.lat = localStorage.getItem('lat');
  604. this.lon = localStorage.getItem('lon');
  605. } else {
  606. this.lat = '';
  607. this.lon = '';
  608. }
  609. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  610. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  611. } else {
  612. this.storeLabelTypes = [];
  613. }
  614. if (localStorage.getItem('outvstoreCategoryList') != null) {
  615. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  616. this.storeLabelTypes = [];
  617. this.storeCategoryList = this.result.join(',');
  618. } else {
  619. this.result = [];
  620. this.storeCategoryList = this.result.join(',');
  621. }
  622. this.chainCode = localStorage.getItem('outvchainCode');
  623. this.storeName = localStorage.getItem('outvstoreName');
  624. if (
  625. (from.path == '/My/index' && to.path == '/outsidelist/index') ||
  626. (from.path == '/home' && to.path == '/outsidelist/index') ||
  627. (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
  628. (from.path == '/storemanagement/index' && to.path == '/outsidelist/index')
  629. ) {
  630. this.tabVal = '1';
  631. } else {
  632. if (localStorage.getItem('tabVal') != null) {
  633. this.tabVal = localStorage.getItem('tabVal');
  634. }
  635. }
  636. if (
  637. (from.path == '/storeDetail' && to.path == '/outsidelist/index') ||
  638. (from.path == '/storeGroup' && to.path == '/outsidelist/index') ||
  639. (from.path == '/suishenbangOutstoreVisit' && to.path == '/outsidelist/index') ||
  640. (from.path == '/outabnormalVisit' && to.path == '/outsidelist/index') ||
  641. (from.path == '/home' && to.path == '/outsidelist/index') ||
  642. (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
  643. (from.path == '/storemanagement/index' && to.path == '/outsidelist/index') ||
  644. (from.path == '/My/index' && to.path == '/outsidelist/index')
  645. ) {
  646. this.onSearch();
  647. }
  648. var postType = localStorage.getItem('postType');
  649. if (postType == 'GZ') {
  650. this.addShow1 = false;
  651. this.otherShow = true;
  652. } else {
  653. this.addShow1 = true;
  654. this.otherShow = false;
  655. }
  656. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  657. this.mapShows = false;
  658. } else {
  659. this.mapShows = true;
  660. }
  661. this.getMonth();
  662. },
  663. },
  664. created() {
  665. this.storeName = localStorage.getItem('outvstoreName');
  666. this.chainName = localStorage.getItem('outvchainName');
  667. if (localStorage.getItem('outvstoreLabelTypes') != null) {
  668. this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
  669. } else {
  670. this.storeLabelTypes = [];
  671. }
  672. if (localStorage.getItem('outvstoreCategoryList') != null) {
  673. this.result = localStorage.getItem('outvstoreCategoryList').split(',');
  674. this.storeCategoryList = this.result.join(',');
  675. } else {
  676. this.result = [];
  677. this.storeCategoryList = this.result.join(',');
  678. }
  679. this.chainCode = localStorage.getItem('outvchainCode');
  680. this.storeName = localStorage.getItem('outvstoreName');
  681. if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
  682. if (this.$route.query.info != undefined) {
  683. if (this.$route.query.info.indexOf('y') != -1) {
  684. this.tabVal = localStorage.getItem('tabVal');
  685. } else {
  686. this.tabVal = '1';
  687. }
  688. } else {
  689. this.tabVal = localStorage.getItem('tabVal');
  690. }
  691. } else {
  692. this.tabVal = localStorage.getItem('tabVal');
  693. }
  694. if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
  695. this.mapShows = false;
  696. } else {
  697. this.mapShows = true;
  698. }
  699. this.query = this.$route.query;
  700. localStorage.removeItem('visitId');
  701. this.getStoreTypeList();
  702. this.getStoreLabels();
  703. var postType = localStorage.getItem('postType');
  704. if (postType == 'GZ') {
  705. this.addShow1 = false;
  706. this.otherShow = true;
  707. } else {
  708. this.addShow1 = true;
  709. this.otherShow = false;
  710. }
  711. this.getMonth();
  712. },
  713. methods: {
  714. setStroeNameStyle(item) {
  715. // 是否为 家装或工装
  716. if (item.sfaStoreType.jz || item.sfaStoreType.gz) {
  717. return {};
  718. } else {
  719. return { color: '#0057ba', 'text-decoration': 'underline' };
  720. }
  721. },
  722. clearFn() {
  723. this.storeName = '';
  724. localStorage.setItem('outvstoreName', '');
  725. },
  726. linkapp(val) {
  727. var poind = this.gcj02BD(val.lat, val.lon);
  728. let url = window.location.href;
  729. let that = this;
  730. let wx = this.wx;
  731. let qiyeData;
  732. const instance = axios.create();
  733. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  734. instance
  735. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  736. params: {
  737. url: url,
  738. agent: 1,
  739. },
  740. })
  741. .then((response) => {
  742. if (response.status == 200) {
  743. qiyeData = response.data.data;
  744. wx.agentConfig({
  745. corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
  746. agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
  747. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  748. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  749. signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
  750. jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
  751. success: function (res) {
  752. wx.invoke(
  753. 'launchMiniprogram',
  754. {
  755. appid: 'wx238bbb5f6d958414',
  756. path:
  757. 'pages/relayStation/relayStation?latitude=' +
  758. poind.lat +
  759. '&longitude=' +
  760. poind.lon +
  761. '&name=' +
  762. val.addressLine,
  763. },
  764. function (res) {
  765. if (res.err_msg == 'launchMiniprogram:ok') {
  766. } else {
  767. }
  768. }
  769. );
  770. },
  771. fail: function (res) {
  772. if (res.errMsg.indexOf('function not exist') > -1) {
  773. alert('版本过低请升级');
  774. }
  775. },
  776. });
  777. }
  778. });
  779. },
  780. orderFn(val) {
  781. this.buryingPoint({
  782. systemModel: '计划外',
  783. buryingPointType: 1,
  784. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  785. buryingPointName: '去下单',
  786. buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
  787. });
  788. getOrderUrlByStoreId({
  789. storeId: val.storeId,
  790. from: 'outPlan',
  791. }).then((res) => {
  792. if (res.code == 200 && res.data) {
  793. window.location.href = res.data;
  794. } else {
  795. this.Toast({
  796. message: res.msg,
  797. duration: 5000,
  798. });
  799. }
  800. });
  801. },
  802. linkList(val) {
  803. this.$router.push({
  804. path: '/pItem',
  805. query: { id: val.storeCode, detilId: 'a' },
  806. });
  807. },
  808. linkimg(val) {
  809. ProductItemImge({ storeId: val.storeId }).then((response) => {
  810. if (response.code == 200) {
  811. if (response.data != undefined) {
  812. window.open(response.data);
  813. } else {
  814. this.$toast(response.msg);
  815. }
  816. } else {
  817. this.$toast(res.msg);
  818. }
  819. });
  820. },
  821. getMonth() {
  822. // 获取当前日期
  823. var currentDate = new Date();
  824. // 获取当前月份
  825. var currentMonth = currentDate.getMonth();
  826. // 获取当前年份
  827. // var currentYear = currentDate.getFullYear();
  828. var previousMonthDate1 = new Date();
  829. if (currentDate.getDate() == 1) {
  830. previousMonthDate1.setMonth(currentMonth - 1);
  831. } else {
  832. }
  833. var previousMonth1 = previousMonthDate1.getMonth();
  834. var previousYear1 = previousMonthDate1.getFullYear();
  835. // 计算前三个月的年份和月份
  836. var previousMonthDate = new Date();
  837. if (currentDate.getDate() == 1) {
  838. previousMonthDate.setMonth(currentMonth - 3);
  839. } else {
  840. previousMonthDate.setMonth(currentMonth - 2);
  841. }
  842. 1;
  843. var previousMonth = previousMonthDate.getMonth();
  844. var previousYear = previousMonthDate.getFullYear();
  845. //前三个月
  846. if (previousYear1 == previousYear) {
  847. var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
  848. // 格式化年份和月份
  849. var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
  850. this.timeData =
  851. formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
  852. } else {
  853. var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
  854. // .toString().padStart(2, '0');
  855. // 格式化年份和月份
  856. var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
  857. this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
  858. }
  859. },
  860. moreTypeShowFn() {
  861. this.moreTypeShow = true;
  862. // this.CustomerName=""
  863. // this.chainsData=[]
  864. this.getCustomer();
  865. },
  866. buryingPoint(val) {
  867. buryingPoint(val);
  868. },
  869. getCustomer() {
  870. var name = '';
  871. if (this.tabVal != 1) {
  872. name = 'org';
  873. } else {
  874. name = 'my';
  875. }
  876. getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
  877. this.chainsData = request.data;
  878. this.chainsData.push({});
  879. this.chainsData.pop();
  880. });
  881. },
  882. onConfirmChainsList(value) {
  883. if (value.chainName != undefined) {
  884. this.chainName = value.chainName;
  885. this.chainCode = value.chainCode;
  886. }
  887. this.showPickerChainsList = false;
  888. this.moreTypeShow = false;
  889. },
  890. getStoreLabels() {
  891. getStoreLabels().then((res) => {
  892. this.StoreLabels = res.data;
  893. });
  894. },
  895. searchType(val) {
  896. this.storeTypeLists = [];
  897. if (val != '') {
  898. let filterArr = this.storeTypeList.filter((item) => {
  899. return item.dictLabel.toLowerCase().includes(val.toLowerCase());
  900. });
  901. this.storeTypeLists = filterArr;
  902. } else {
  903. this.storeTypeLists = this.storeTypeList;
  904. }
  905. },
  906. onConfirm(value) {
  907. this.storeCategoryList = this.result.join(',');
  908. // this.typeName=value.dictLabel
  909. this.showPicker = false;
  910. this.onSearchm();
  911. },
  912. moreTypeShowclearableFn() {
  913. this.chainName = '';
  914. this.chainCode = '';
  915. this.chainsData = [];
  916. },
  917. onsets() {
  918. this.result = [];
  919. this.zyssl = [];
  920. this.chtczj = [];
  921. this.noVisit = [];
  922. this.noOrder = [];
  923. this.fxNoOrder = [];
  924. this.storeLabelTypes = [];
  925. this.storeCategoryList = this.result.join(',');
  926. this.chainName = '';
  927. this.chainCode = '';
  928. // this.typeName=value.dictLabel
  929. this.onSearch();
  930. },
  931. getStoreTypeList() {
  932. getStoreTypeListlp({}).then((res) => {
  933. this.storeTypeLists = res.data;
  934. this.storeTypeList = res.data;
  935. });
  936. },
  937. buryingPointFn(val) {
  938. this.buryingPoint({
  939. systemModel: '计划外',
  940. buryingPointType: 1,
  941. buryingPointValue: val.telephone,
  942. buryingPointName: '点击电话',
  943. buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
  944. });
  945. },
  946. // 范围
  947. rangeStoreFn() {
  948. localStorage.setItem('tabVal', this.tabVal);
  949. getPosition()
  950. .then((res) => {
  951. let { TXisBD } = res;
  952. this.lat = TXisBD.lat;
  953. this.lon = TXisBD.lon;
  954. let name = this.tabVal != 1 ? '销售部' : '我的';
  955. this.buryingPoint({
  956. systemModel: '计划外',
  957. buryingPointType: 3,
  958. buryingPointValue: name,
  959. buryingPointName: '计划外',
  960. buryingPointPosition: '进入地图',
  961. });
  962. this.$router.push({
  963. path: '/rangeStore',
  964. query: {
  965. lat: '',
  966. lon: '',
  967. tabVal: this.tabVal,
  968. },
  969. });
  970. })
  971. .catch((error) => {
  972. this.$dialog.alert({
  973. message: error,
  974. });
  975. });
  976. },
  977. //取消搜索
  978. cancelSearch() {
  979. this.$refs.item.toggle();
  980. },
  981. storeJoinVisit(val) {
  982. joinInPlan({ storeId: val.storeId }).then((res) => {
  983. if (res.code == 200) {
  984. this.onSearch();
  985. } else {
  986. this.$dialog.alert({
  987. title: '系统提示',
  988. message: res.msg,
  989. });
  990. }
  991. });
  992. },
  993. searchFn() {
  994. this.showPicker = true;
  995. this.CustomerName = '';
  996. },
  997. moreSearch() {
  998. this.onSearch();
  999. this.$refs.item.toggle();
  1000. },
  1001. getUserOrgStoreList() {
  1002. this.storeType = localStorage.getItem('storeType');
  1003. this.endShow = false;
  1004. if (this.refreshing) {
  1005. this.list = [];
  1006. this.refreshing = false;
  1007. }
  1008. var that = this;
  1009. this.disabled = true;
  1010. let loading2 = this.$toast.loading({
  1011. duration: 0,
  1012. message: '加载中...',
  1013. forbidClick: true,
  1014. });
  1015. getUserOrgStoreList({
  1016. lat: that.lat,
  1017. lon: that.lon,
  1018. chainCode: this.chainCode ? this.chainCode : '',
  1019. storeLabelTypes: this.storeLabelTypes.join(','),
  1020. pageNum: this.pageNum,
  1021. storeCategoryList: this.storeCategoryList,
  1022. pageSize: this.pageSize,
  1023. storeName: this.storeName.trim(),
  1024. genDate: this.genDate,
  1025. }).then((res) => {
  1026. this.disabled = false;
  1027. if (res.code == 200) {
  1028. loading2.clear();
  1029. this.loading = false;
  1030. if (this.pageNum == '1') {
  1031. this.list = [];
  1032. }
  1033. this.list = this.list.concat(res.rows);
  1034. if (this.list.length >= res.total) {
  1035. this.finished = true;
  1036. } else {
  1037. this.finished = false;
  1038. }
  1039. this.pageNum = this.pageNum + 1;
  1040. this.list.forEach((item) => {
  1041. if (item.stateString.indexOf('拜访中') != -1) {
  1042. this.endShow = true;
  1043. this.visitEndId = item.visitId;
  1044. return;
  1045. }
  1046. });
  1047. res.rows.forEach((item) => {
  1048. this.showPopoverVNUM.push({ showPopover: false });
  1049. this.showPopoverC.push({ showPopover: false });
  1050. this.showPopoverZ.push({ showPopover: false });
  1051. });
  1052. } else {
  1053. this.$toast(res.msg);
  1054. }
  1055. });
  1056. },
  1057. positionFn(val) {
  1058. getPosition(true)
  1059. .then((res) => {
  1060. let { TXisBD } = res;
  1061. this.lat = TXisBD.lat;
  1062. this.lon = TXisBD.lon;
  1063. if (val == 1) {
  1064. if (this.tabVal == 1) {
  1065. this.getUserOutPlaListFun();
  1066. } else {
  1067. this.getUserOrgStoreList();
  1068. }
  1069. } else {
  1070. this.getUserOutPlaListFun();
  1071. }
  1072. })
  1073. .catch((error) => {
  1074. this.$dialog.alert({
  1075. message: error,
  1076. });
  1077. });
  1078. },
  1079. getUserOutPlaListFun() {
  1080. this.storeType = localStorage.getItem('storeType');
  1081. var that = this;
  1082. this.disabled = true;
  1083. let loading3 = this.$toast.loading({
  1084. duration: 0,
  1085. message: '加载中...',
  1086. forbidClick: true,
  1087. });
  1088. this.endShow = false;
  1089. if (this.refreshing) {
  1090. this.list = [];
  1091. this.refreshing = false;
  1092. }
  1093. getUserOutPlaList({
  1094. lat: that.lat,
  1095. lon: that.lon,
  1096. chainCode: this.chainCode ? this.chainCode : '',
  1097. storeLabelTypes: this.storeLabelTypes.join(','),
  1098. pageNum: this.pageNum,
  1099. storeCategoryList: this.storeCategoryList,
  1100. pageSize: this.pageSize,
  1101. storeName: this.storeName.trim(),
  1102. genDate: this.genDate,
  1103. }).then((res) => {
  1104. this.disabled = false;
  1105. if (res.code == 200) {
  1106. loading3.clear();
  1107. this.loading = false;
  1108. this.list = this.list.concat(res.rows);
  1109. if (this.list.length >= res.total) {
  1110. this.finished = true;
  1111. } else {
  1112. this.finished = false;
  1113. }
  1114. this.pageNum = this.pageNum + 1;
  1115. this.list.forEach((item) => {
  1116. if (item.stateString.indexOf('拜访中') != -1) {
  1117. this.endShow = true;
  1118. this.visitEndId = item.visitId;
  1119. return;
  1120. }
  1121. });
  1122. res.rows.forEach(() => {
  1123. this.showPopoverVNUM.push({ showPopover: false });
  1124. this.showPopoverC.push({ showPopover: false });
  1125. this.showPopoverZ.push({ showPopover: false });
  1126. });
  1127. } else {
  1128. this.$toast(res.msg);
  1129. }
  1130. });
  1131. },
  1132. storeVisit(val) {
  1133. localStorage.setItem('tabVal', this.tabVal);
  1134. localStorage.removeItem('visitId');
  1135. checkVisit({ storeId: val.storeId }).then((res) => {
  1136. if (this.tabVal == 1) {
  1137. this.buryingPoint({
  1138. systemModel: '计划外',
  1139. buryingPointType: 1,
  1140. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1141. buryingPointName: '进店拜访',
  1142. buryingPointPosition: '我的',
  1143. });
  1144. } else {
  1145. this.buryingPoint({
  1146. systemModel: '计划外',
  1147. buryingPointType: 1,
  1148. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1149. buryingPointName: '进店拜访',
  1150. buryingPointPosition: '销售部',
  1151. });
  1152. }
  1153. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1154. if (localStorage.getItem('loginType') == 'cs') {
  1155. var lat = '';
  1156. var lon = '';
  1157. if (val.lat == '' || val.lat == null) {
  1158. lat = '31.2517820000';
  1159. lon = '120.5593090000';
  1160. } else {
  1161. lat = val.lat;
  1162. lon = val.lon;
  1163. }
  1164. this.$router.push({
  1165. path: '/suishenbangOutstoreVisit',
  1166. query: {
  1167. storeId: val.storeId,
  1168. rdId: val.rdId,
  1169. lat: lat,
  1170. lon: lon,
  1171. visitId: val.visitId,
  1172. pageType: 'out',
  1173. addressLine: val.addressLine,
  1174. storeCategory: val.storeCategory,
  1175. storeName: val.storeName,
  1176. hisTime: val.hisTime,
  1177. contactName: val.contactName,
  1178. storeCode: val.storeCode,
  1179. tabVal: this.tabVal,
  1180. visitModel: '1',
  1181. latNew: '31.2517820000',
  1182. lonNew: '120.5593090000',
  1183. PointSum: 0,
  1184. marklat: lat,
  1185. marklon: lon,
  1186. from: 'outPlan',
  1187. },
  1188. });
  1189. localStorage.setItem('startTime', new Date());
  1190. localStorage.setItem('ORGName', val.deptName);
  1191. localStorage.setItem('chainNameR', val.storeName);
  1192. } else {
  1193. if (this.flag) {
  1194. this.flag = false;
  1195. this.timer = null;
  1196. let that = this;
  1197. this.timer = setTimeout(() => {
  1198. this.flag = true;
  1199. }, 2000);
  1200. if (val.stateString.indexOf('拜访中') != -1) {
  1201. localStorage.setItem('startTime', new Date());
  1202. localStorage.setItem('ORGName', val.deptName);
  1203. localStorage.setItem('chainNameR', val.storeName);
  1204. that.$router.push({
  1205. path: '/suishenbangOutstoreVisit',
  1206. query: {
  1207. storeId: val.storeId,
  1208. rdId: val.rdId,
  1209. lat: val.lat,
  1210. lon: val.lon,
  1211. visitId: val.visitId,
  1212. pageType: 'out',
  1213. addressLine: val.addressLine,
  1214. storeCategory: val.storeCategory,
  1215. storeName: val.storeName,
  1216. hisTime: val.hisTime,
  1217. contactName: val.contactName,
  1218. storeCode: val.storeCode,
  1219. tabVal: that.tabVal,
  1220. visitModel: '1',
  1221. latNew: val.lat,
  1222. lonNew: val.lon,
  1223. PointSum: '0',
  1224. marklat: val.lat,
  1225. marklon: val.lon,
  1226. from: 'outPlan',
  1227. },
  1228. });
  1229. } else {
  1230. getPosition()
  1231. .then((res) => {
  1232. let { TXisBD, resData } = res;
  1233. this.lat = TXisBD.lat;
  1234. this.lon = TXisBD.lon;
  1235. localStorage.setItem('lat', this.lat);
  1236. localStorage.setItem('lon', this.lon);
  1237. // var location = this.CJ02BD(res.latitude, res.longitude);
  1238. this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
  1239. })
  1240. .catch((error) => {
  1241. this.$dialog.alert({
  1242. message: error,
  1243. });
  1244. });
  1245. }
  1246. }
  1247. }
  1248. } else {
  1249. this.$dialog.alert({
  1250. message: res.msg,
  1251. });
  1252. }
  1253. });
  1254. },
  1255. checkStoreAddressByStoreCodeFun(val, location, res) {
  1256. checkStoreAddressByStoreCode({
  1257. storeCode: val.storeCode,
  1258. lon: location.lon,
  1259. lat: location.lat,
  1260. }).then((response) => {
  1261. // loading1.clear();
  1262. if (val.lat == '' || val.lat == null) {
  1263. this.lat = location.lat;
  1264. this.lon = location.lon;
  1265. } else {
  1266. this.lat = val.lat;
  1267. this.lon = val.lon;
  1268. }
  1269. // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
  1270. let PointSumval = this.twoPointSum(
  1271. location.lat,
  1272. location.lon,
  1273. location.lat,
  1274. location.lon
  1275. ).toFixed(2);
  1276. // GZ:工装店铺 直接进入拜访
  1277. if (localStorage.getItem('postType') == 'GZ') {
  1278. localStorage.setItem('startTime', new Date());
  1279. localStorage.setItem('ORGName', val.deptName);
  1280. localStorage.setItem('chainNameR', val.storeName);
  1281. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1282. return;
  1283. }
  1284. // 门店校验 地址不通过
  1285. if (response.code != 200) {
  1286. // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1287. if (response.data.updateAddress == 0) {
  1288. // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
  1289. this.$dialog
  1290. .confirm({
  1291. confirmButtonText: '确定拜访',
  1292. cancelButtonText: '取消拜访',
  1293. title: '系统提示',
  1294. message:
  1295. '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
  1296. closeOnClickOverlay: true,
  1297. })
  1298. .then(() => {
  1299. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1300. });
  1301. } else if (response.data.updateAddress == 1) {
  1302. // 同城AB+金牌,去修改地址
  1303. // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
  1304. if (!response.data.addressUpdateTimesOver) {
  1305. this.$dialog
  1306. .confirm({
  1307. title: '系统提示',
  1308. message: response.msg + '请立即修改后再拜访',
  1309. messageAlign: 'left',
  1310. confirmButtonText: '立即修改',
  1311. cancelButtonText: '取消',
  1312. })
  1313. .then(() => {
  1314. this.$router.push({
  1315. path: '/storeDetail',
  1316. query: {
  1317. id: val.storeId,
  1318. type: 'address',
  1319. storeAddressId: val.storeAddressId,
  1320. },
  1321. });
  1322. });
  1323. } else {
  1324. this.$dialog.confirm({
  1325. title: '系统提示',
  1326. message: '已经达到最大修改次数',
  1327. messageAlign: 'left',
  1328. confirmButtonText: '确定',
  1329. });
  1330. }
  1331. } else if (response.data.updateAddress == 2) {
  1332. // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
  1333. this.resetCoord(res, val, location, PointSumval);
  1334. return;
  1335. }
  1336. } else {
  1337. // 门店编码校验门店地址通过 进入拜访
  1338. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1339. }
  1340. });
  1341. },
  1342. // 重置经纬度
  1343. resetCoord(res, val, location, PointSumval) {
  1344. this.$dialog
  1345. .confirm({
  1346. confirmButtonText: '初始化定位',
  1347. cancelButtonText: '取消拜访',
  1348. title: '系统提示',
  1349. message: '偏差过大,不允许拜访。可修改本店定位.',
  1350. closeOnClickOverlay: true,
  1351. })
  1352. .then(() => {
  1353. mobileReposition({
  1354. storeId: val.storeId,
  1355. lat: location.lat,
  1356. lon: location.lon,
  1357. }).then((response) => {
  1358. if (response.code == 200) {
  1359. this.$dialog
  1360. .alert({
  1361. title: '系统提示',
  1362. message: '本信息定位已更新成功!',
  1363. })
  1364. .then(() => {
  1365. this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
  1366. });
  1367. localStorage.setItem('startTime', new Date());
  1368. localStorage.setItem('ORGName', val.deptName);
  1369. localStorage.setItem('chainNameR', val.storeName);
  1370. } else {
  1371. this.$toast(response.msg);
  1372. }
  1373. });
  1374. });
  1375. },
  1376. // 进入拜访 router.push
  1377. toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
  1378. addVisitsPosition({
  1379. storeId: val.storeId,
  1380. visitsId: '',
  1381. lon: res.longitude,
  1382. lat: res.latitude,
  1383. sourceLon: location.lon,
  1384. sourceLat: location.lat,
  1385. positionDesc: '',
  1386. accuracy: res.accuracy,
  1387. });
  1388. this.$router.push({
  1389. path: '/suishenbangOutstoreVisit',
  1390. query: {
  1391. storeId: val.storeId,
  1392. rdId: val.rdId,
  1393. lat: location.lat,
  1394. lon: location.lon,
  1395. visitId: val.visitId,
  1396. pageType: 'out',
  1397. addressLine: val.addressLine,
  1398. storeCategory: val.storeCategory,
  1399. storeName: val.storeName,
  1400. hisTime: val.hisTime,
  1401. contactName: val.contactName,
  1402. storeCode: val.storeCode,
  1403. tabVal: this.tabVal,
  1404. visitModel: '1',
  1405. latNew: location.lat,
  1406. lonNew: location.lon,
  1407. PointSum: PointSumval,
  1408. marklat: res.latitude,
  1409. marklon: res.longitude,
  1410. from: 'outPlan',
  1411. },
  1412. });
  1413. },
  1414. projectOutVisit(val) {
  1415. localStorage.setItem('tabVal', this.tabVal);
  1416. localStorage.removeItem('visitId');
  1417. // checkVisit({storeId:val.storeId}).then(res=>{
  1418. // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
  1419. if (localStorage.getItem('loginType') == 'cs') {
  1420. var lat = '';
  1421. var lon = '';
  1422. if (val.lat == '' || val.lat == null) {
  1423. lat = '31.2517820000';
  1424. lon = '120.5593090000';
  1425. } else {
  1426. lat = val.lat;
  1427. lon = val.lon;
  1428. }
  1429. this.$router.push({
  1430. path: '/storeGroup',
  1431. query: {
  1432. storeId: val.storeId,
  1433. rdId: val.rdId,
  1434. lat: lat,
  1435. lon: lon,
  1436. visitId: val.visitId,
  1437. pageType: 'out',
  1438. addressLine: val.addressLine,
  1439. storeCategory: val.storeCategory,
  1440. storeName: val.storeName,
  1441. hisTime: val.hisTime,
  1442. contactName: val.contactName,
  1443. storeCode: val.storeCode,
  1444. tabVal: this.tabVal,
  1445. visitModel: '1',
  1446. latNew: '31.2517820000',
  1447. lonNew: '120.5593090000',
  1448. PointSum: 0,
  1449. marklat: lat,
  1450. marklon: lon,
  1451. },
  1452. });
  1453. localStorage.setItem('startTime', new Date());
  1454. localStorage.setItem('ORGName', val.deptName);
  1455. localStorage.setItem('chainNameR', val.storeName);
  1456. } else {
  1457. if (this.flag) {
  1458. this.flag = false;
  1459. this.timer = null;
  1460. let that = this;
  1461. this.timer = setTimeout(() => {
  1462. this.flag = true;
  1463. }, 2000);
  1464. if (val.stateString.indexOf('拜访中') != -1) {
  1465. localStorage.setItem('startTime', new Date());
  1466. localStorage.setItem('ORGName', val.deptName);
  1467. localStorage.setItem('chainNameR', val.storeName);
  1468. that.$router.push({
  1469. path: '/storeGroup',
  1470. query: {
  1471. storeId: val.storeId,
  1472. rdId: val.rdId,
  1473. lat: val.lat,
  1474. lon: val.lon,
  1475. visitId: val.visitId,
  1476. pageType: 'out',
  1477. addressLine: val.addressLine,
  1478. storeCategory: val.storeCategory,
  1479. storeName: val.storeName,
  1480. hisTime: val.hisTime,
  1481. contactName: val.contactName,
  1482. storeCode: val.storeCode,
  1483. tabVal: that.tabVal,
  1484. visitModel: '1',
  1485. latNew: val.lat,
  1486. lonNew: val.lon,
  1487. PointSum: '0',
  1488. marklat: val.lat,
  1489. marklon: val.lon,
  1490. },
  1491. });
  1492. } else {
  1493. let loading1 = this.$toast.loading({
  1494. duration: 0,
  1495. message: '加载中...',
  1496. forbidClick: true,
  1497. });
  1498. let url = window.location.href;
  1499. let wx = this.wx;
  1500. let qiyeData;
  1501. const instance = axios.create();
  1502. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1503. instance
  1504. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1505. params: {
  1506. url: url,
  1507. },
  1508. })
  1509. .then((response) => {
  1510. if (response.status == 200) {
  1511. this.cont = 3;
  1512. var flat = true;
  1513. var times = setInterval(() => {
  1514. this.cont--;
  1515. if (this.cont == '0') {
  1516. if (flat) {
  1517. loading1.clear();
  1518. clearInterval(times);
  1519. that.$dialog
  1520. .alert({
  1521. message: '定位失败,请开启企微定位权限',
  1522. })
  1523. .then(() => {});
  1524. } else {
  1525. clearInterval(times);
  1526. }
  1527. }
  1528. }, 1000);
  1529. qiyeData = response.data.data;
  1530. wx.config({
  1531. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1532. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1533. appId: qiyeData.appId, // 必填,企业微信的corpID
  1534. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1535. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1536. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1537. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1538. });
  1539. wx.ready(function () {
  1540. wx.getLocation({
  1541. type: 'gcj02',
  1542. success: function (res) {
  1543. flat = false;
  1544. loading1.clear();
  1545. var location = that.CJ02BD(res.latitude, res.longitude);
  1546. if (val.lat == '' || val.lat == null) {
  1547. that.lat = location.lat;
  1548. that.lon = location.lon;
  1549. } else {
  1550. that.lat = val.lat;
  1551. that.lon = val.lon;
  1552. }
  1553. let PointSum = that
  1554. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1555. .toFixed(2);
  1556. if (val.lat == '' || val.lat == null) {
  1557. if (localStorage.getItem('postType') != 'GZ') {
  1558. that.$dialog
  1559. .confirm({
  1560. confirmButtonText: '确定拜访',
  1561. cancelButtonText: '取消拜访',
  1562. title: '系统提示',
  1563. message:
  1564. '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
  1565. closeOnClickOverlay: true,
  1566. })
  1567. .then(() => {
  1568. that.$router.push({
  1569. path: '/storeGroup',
  1570. query: {
  1571. storeId: val.storeId,
  1572. rdId: val.rdId,
  1573. lat: that.lat,
  1574. lon: that.lon,
  1575. visitId: val.visitId,
  1576. pageType: 'out',
  1577. addressLine: val.addressLine,
  1578. storeCategory: val.storeCategory,
  1579. storeName: val.storeName,
  1580. contactName: val.contactName,
  1581. hisTime: val.hisTime,
  1582. storeCode: val.storeCode,
  1583. tabVal: that.tabVal,
  1584. visitModel: '1',
  1585. latNew: location.lat,
  1586. lonNew: location.lon,
  1587. PointSum: PointSum,
  1588. marklat: res.latitude,
  1589. marklon: res.longitude,
  1590. },
  1591. });
  1592. });
  1593. } else {
  1594. that.$router.push({
  1595. path: '/storeGroup',
  1596. query: {
  1597. storeId: val.storeId,
  1598. rdId: val.rdId,
  1599. lat: that.lat,
  1600. lon: that.lon,
  1601. visitId: val.visitId,
  1602. pageType: 'out',
  1603. addressLine: val.addressLine,
  1604. storeCategory: val.storeCategory,
  1605. storeName: val.storeName,
  1606. contactName: val.contactName,
  1607. hisTime: val.hisTime,
  1608. storeCode: val.storeCode,
  1609. tabVal: that.tabVal,
  1610. visitModel: '1',
  1611. latNew: location.lat,
  1612. lonNew: location.lon,
  1613. PointSum: PointSum,
  1614. marklat: res.latitude,
  1615. marklon: res.longitude,
  1616. },
  1617. });
  1618. }
  1619. } else {
  1620. that.$router.push({
  1621. path: '/storeGroup',
  1622. query: {
  1623. storeId: val.storeId,
  1624. rdId: val.rdId,
  1625. lat: that.lat,
  1626. lon: that.lon,
  1627. visitId: val.visitId,
  1628. pageType: 'out',
  1629. addressLine: val.addressLine,
  1630. storeCategory: val.storeCategory,
  1631. storeName: val.storeName,
  1632. contactName: val.contactName,
  1633. hisTime: val.hisTime,
  1634. storeCode: val.storeCode,
  1635. tabVal: that.tabVal,
  1636. visitModel: '1',
  1637. latNew: location.lat,
  1638. lonNew: location.lon,
  1639. PointSum: PointSum,
  1640. marklat: res.latitude,
  1641. marklon: res.longitude,
  1642. },
  1643. });
  1644. }
  1645. localStorage.setItem('startTime', new Date());
  1646. localStorage.setItem('ORGName', val.deptName);
  1647. localStorage.setItem('chainNameR', val.storeName);
  1648. addVisitsPosition({
  1649. storeId: val.storeId,
  1650. visitsId: '',
  1651. lon: res.longitude,
  1652. lat: res.latitude,
  1653. sourceLon: location.lon,
  1654. sourceLat: location.lat,
  1655. positionDesc: '',
  1656. accuracy: res.accuracy,
  1657. });
  1658. },
  1659. fail: function () {
  1660. loading1.clear();
  1661. that.$dialog.alert({
  1662. message: 'GPS未开启',
  1663. });
  1664. },
  1665. });
  1666. });
  1667. wx.error(function (res) {
  1668. loading1.clear();
  1669. that.$dialog
  1670. .alert({
  1671. message: '定位失败,请开启企微定位权限',
  1672. })
  1673. .then(() => {});
  1674. });
  1675. }
  1676. });
  1677. }
  1678. }
  1679. }
  1680. // }
  1681. // })
  1682. },
  1683. abnormalVisit(val) {
  1684. localStorage.removeItem('visitId');
  1685. localStorage.setItem('tabVal', this.tabVal);
  1686. checkVisit({ storeId: val.storeId }).then((res) => {
  1687. this.buryingPoint({
  1688. systemModel: '计划外',
  1689. buryingPointType: 1,
  1690. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1691. buryingPointName: '异常拜访',
  1692. buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
  1693. });
  1694. if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
  1695. if (localStorage.getItem('loginType') == 'cs') {
  1696. var lat = '';
  1697. var lon = '';
  1698. if (val.lat == '' || val.lat == null) {
  1699. lat = '31.2517820000';
  1700. lon = '120.5593090000';
  1701. } else {
  1702. lat = val.lat;
  1703. lon = val.lon;
  1704. }
  1705. this.$router.push({
  1706. path: '/outabnormalVisit',
  1707. query: {
  1708. storeId: val.storeId,
  1709. rdId: val.rdId,
  1710. lat: lat,
  1711. lon: lon,
  1712. visitId: val.visitId,
  1713. pageType: 'out',
  1714. addressLine: val.addressLine,
  1715. storeCategory: val.storeCategory,
  1716. storeName: val.storeName,
  1717. hisTime: val.hisTime,
  1718. contactName: val.contactName,
  1719. storeCode: val.storeCode,
  1720. tabVal: this.tabVal,
  1721. visitModel: '3',
  1722. latNew: '31.2517820000',
  1723. lonNew: '120.5593090000',
  1724. PointSum: 0,
  1725. marklat: lat,
  1726. marklon: lon,
  1727. },
  1728. });
  1729. localStorage.setItem('startTime', new Date());
  1730. localStorage.setItem('ORGName', val.deptName);
  1731. localStorage.setItem('chainNameR', val.storeName);
  1732. } else {
  1733. if (this.flag) {
  1734. this.flag = false;
  1735. this.timer = null;
  1736. this.timer = setTimeout(() => {
  1737. this.flag = true;
  1738. }, 2000);
  1739. let loading1 = this.$toast.loading({
  1740. duration: 0,
  1741. message: '加载中...',
  1742. forbidClick: true,
  1743. });
  1744. let url = window.location.href;
  1745. let that = this;
  1746. let wx = this.wx;
  1747. let qiyeData;
  1748. const instance = axios.create();
  1749. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  1750. instance
  1751. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  1752. params: {
  1753. url: url,
  1754. },
  1755. })
  1756. .then((response) => {
  1757. if (response.status == 200) {
  1758. this.cont = 3;
  1759. var flat = true;
  1760. var times = setInterval(() => {
  1761. this.cont--;
  1762. if (this.cont == '0') {
  1763. if (flat) {
  1764. loading1.clear();
  1765. clearInterval(times);
  1766. that.$dialog
  1767. .alert({
  1768. message: '定位失败,请开启企微定位权限',
  1769. })
  1770. .then(() => {
  1771. this.$router.go(-1);
  1772. });
  1773. } else {
  1774. clearInterval(times);
  1775. }
  1776. }
  1777. }, 1000);
  1778. qiyeData = response.data.data;
  1779. wx.config({
  1780. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  1781. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  1782. appId: qiyeData.appId, // 必填,企业微信的corpID
  1783. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  1784. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  1785. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  1786. jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  1787. });
  1788. wx.ready(function () {
  1789. wx.getLocation({
  1790. type: 'gcj02',
  1791. success: function (res) {
  1792. flat = false;
  1793. loading1.clear();
  1794. var location = that.CJ02BD(res.latitude, res.longitude);
  1795. if (val.lat == '' || val.lat == null) {
  1796. that.lat = location.lat;
  1797. that.lon = location.lon;
  1798. } else {
  1799. that.lat = val.lat;
  1800. that.lon = val.lon;
  1801. }
  1802. let PointSum = that
  1803. .twoPointSum(that.lat, that.lon, location.lat, location.lon)
  1804. .toFixed(2);
  1805. if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
  1806. that.$dialog
  1807. .confirm({
  1808. confirmButtonText: '确定',
  1809. cancelButtonText: '取消',
  1810. title: '系统提示',
  1811. message: '定位距离偏差大',
  1812. closeOnClickOverlay: true,
  1813. })
  1814. .then(() => {
  1815. that.$router.push({
  1816. path: '/outabnormalVisit',
  1817. query: {
  1818. storeId: val.storeId,
  1819. rdId: val.rdId,
  1820. lat: that.lat,
  1821. lon: that.lon,
  1822. visitId: val.visitId,
  1823. pageType: 'out',
  1824. visitModel: '5',
  1825. storeCode: val.storeCode,
  1826. tabVal: that.tabVal,
  1827. latNew: location.lat,
  1828. lonNew: location.lon,
  1829. PointSum: PointSum,
  1830. marklat: res.latitude,
  1831. marklon: res.longitude,
  1832. },
  1833. });
  1834. localStorage.setItem('startTime', new Date());
  1835. localStorage.setItem('ORGName', val.deptName);
  1836. localStorage.setItem('chainNameR', val.storeName);
  1837. })
  1838. .catch(() => {
  1839. // that.abnormalVisit(val)
  1840. });
  1841. } else {
  1842. that.$router.push({
  1843. path: '/outabnormalVisit',
  1844. query: {
  1845. storeId: val.storeId,
  1846. rdId: val.rdId,
  1847. lat: that.lat,
  1848. lon: that.lon,
  1849. visitId: val.visitId,
  1850. pageType: 'out',
  1851. visitModel: '3',
  1852. storeCode: val.storeCode,
  1853. tabVal: that.tabVal,
  1854. latNew: location.lat,
  1855. lonNew: location.lon,
  1856. PointSum: PointSum,
  1857. marklat: res.latitude,
  1858. marklon: res.longitude,
  1859. },
  1860. });
  1861. localStorage.setItem('startTime', new Date());
  1862. localStorage.setItem('ORGName', val.deptName);
  1863. localStorage.setItem('chainNameR', val.storeName);
  1864. }
  1865. addVisitsPosition({
  1866. storeId: val.storeId,
  1867. visitsId: '',
  1868. lon: res.longitude,
  1869. lat: res.latitude,
  1870. sourceLon: location.lon,
  1871. sourceLat: location.lat,
  1872. positionDesc: '',
  1873. accuracy: res.accuracy,
  1874. });
  1875. },
  1876. fail: function () {
  1877. loading1.clear();
  1878. that.$dialog
  1879. .alert({
  1880. message: 'GPS未开启',
  1881. })
  1882. .then(() => {
  1883. // that.abnormalVisit(val)
  1884. });
  1885. },
  1886. });
  1887. });
  1888. wx.error(function (res) {
  1889. loading1.clear();
  1890. that.$dialog
  1891. .alert({
  1892. message: '定位失败,请开启企微定位权限',
  1893. })
  1894. .then(() => {});
  1895. });
  1896. } else {
  1897. loading1.clear();
  1898. this.$toast.fail(dataList.msg);
  1899. }
  1900. });
  1901. localStorage.setItem('startTime', new Date());
  1902. localStorage.setItem('ORGName', val.deptName);
  1903. localStorage.setItem('chainNameR', val.storeName);
  1904. }
  1905. }
  1906. } else {
  1907. this.$dialog.alert({
  1908. title: '系统提示',
  1909. message: res.msg,
  1910. });
  1911. }
  1912. });
  1913. },
  1914. visitFn(val) {
  1915. this.buryingPoint({
  1916. systemModel: '计划外',
  1917. buryingPointType: 1,
  1918. buryingPointValue: val.storeName + '(' + val.storeCode + ')',
  1919. buryingPointName: '客户信息',
  1920. buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
  1921. });
  1922. this.$router.push({
  1923. path: '/storeDetail',
  1924. query: { id: val.storeId, detilId: 'a' },
  1925. });
  1926. },
  1927. // 大客户签约
  1928. signAdd(val) {
  1929. this.$router.push({
  1930. path: '/sign',
  1931. query: { id: val.storeId, detilId: 'a' },
  1932. });
  1933. },
  1934. Visit(val) {
  1935. this.$router.push({
  1936. path: '/historicalDetails',
  1937. query: {
  1938. visitId: val.visitId,
  1939. storeId: val.storeId,
  1940. storeCode: val.storeCode,
  1941. },
  1942. });
  1943. },
  1944. onClickLeft() {
  1945. this.$router.go(-1);
  1946. },
  1947. onSearch() {
  1948. window.scrollTo(0, 0);
  1949. this.pageNum = 1;
  1950. this.list = [];
  1951. this.finished = true;
  1952. var postType = localStorage.getItem('postType');
  1953. this.customerVisits = localStorage.getItem('customerVisits');
  1954. if (postType == 'GZ') {
  1955. this.typeShow = false;
  1956. } else {
  1957. this.typeShow = true;
  1958. }
  1959. this.onLoad();
  1960. },
  1961. onSearchm() {
  1962. var postType = localStorage.getItem('postType');
  1963. if (postType == 'GZ') {
  1964. this.typeShow = false;
  1965. } else {
  1966. this.typeShow = true;
  1967. }
  1968. var StoreLabelsArr = [];
  1969. for (var k = 0; k < this.storeLabelTypes.length; k++) {
  1970. for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
  1971. if (this.StoreLabels[k1].dictValue == this.storeLabelTypes[k]) {
  1972. StoreLabelsArr.push(this.StoreLabels[k1].dictLabel);
  1973. }
  1974. }
  1975. }
  1976. var storeCategoryList = [];
  1977. for (var q = 0; q < this.result.length; q++) {
  1978. for (var q1 = 0; q1 < this.storeTypeLists.length; q1++) {
  1979. if (this.storeTypeLists[q1].dictValue == this.result[q]) {
  1980. storeCategoryList.push(this.storeTypeLists[q1].dictLabel);
  1981. }
  1982. }
  1983. }
  1984. if (this.tabVal == 1) {
  1985. if (this.storeLabelTypes.length > 0) {
  1986. this.buryingPoint({
  1987. systemModel: '计划外',
  1988. buryingPointType: 1,
  1989. buryingPointValue: StoreLabelsArr.join(','),
  1990. buryingPointName: '标签',
  1991. buryingPointPosition: '我的筛选',
  1992. });
  1993. }
  1994. if (this.storeCategoryList.length > 0) {
  1995. this.buryingPoint({
  1996. systemModel: '计划外',
  1997. buryingPointType: 1,
  1998. buryingPointValue: storeCategoryList.join(','),
  1999. buryingPointName: '类型',
  2000. buryingPointPosition: '我的筛选',
  2001. });
  2002. }
  2003. if (this.chainName != '') {
  2004. this.buryingPoint({
  2005. systemModel: '计划外',
  2006. buryingPointType: 1,
  2007. buryingPointValue: this.chainName,
  2008. buryingPointName: '经销商筛选',
  2009. buryingPointPosition: '我的筛选',
  2010. });
  2011. }
  2012. if (this.storeName != '') {
  2013. this.buryingPoint({
  2014. systemModel: '计划外',
  2015. buryingPointType: 1,
  2016. buryingPointValue: this.storeName,
  2017. buryingPointName: '搜索名称/编号/地址',
  2018. buryingPointPosition: '我的筛选',
  2019. });
  2020. }
  2021. } else {
  2022. if (this.storeLabelTypes.length > 0) {
  2023. this.buryingPoint({
  2024. systemModel: '计划外',
  2025. buryingPointType: 1,
  2026. buryingPointValue: StoreLabelsArr.join(','),
  2027. buryingPointName: '标签',
  2028. buryingPointPosition: '销售部的门店筛选',
  2029. });
  2030. }
  2031. if (this.storeCategoryList != '') {
  2032. this.buryingPoint({
  2033. systemModel: '计划外',
  2034. buryingPointType: 1,
  2035. buryingPointValue: storeCategoryList.join(','),
  2036. buryingPointName: '类型',
  2037. buryingPointPosition: '销售部的门店筛选',
  2038. });
  2039. }
  2040. if (this.chainName != '') {
  2041. this.buryingPoint({
  2042. systemModel: '计划外',
  2043. buryingPointType: 1,
  2044. buryingPointValue: this.chainName,
  2045. buryingPointName: '经销商筛选',
  2046. buryingPointPosition: '销售部的门店筛选',
  2047. });
  2048. }
  2049. if (this.storeName != '') {
  2050. this.buryingPoint({
  2051. systemModel: '计划外',
  2052. buryingPointType: 1,
  2053. buryingPointValue: this.storeName,
  2054. buryingPointName: '搜索名称/编号/地址',
  2055. buryingPointPosition: '销售部的门店筛选',
  2056. });
  2057. }
  2058. }
  2059. localStorage.setItem('outvstoreName', this.storeName);
  2060. localStorage.setItem('outvchainName', this.chainName);
  2061. localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
  2062. localStorage.setItem('outvstoreCategoryList', this.result);
  2063. localStorage.setItem('outvchainCode', this.chainCode);
  2064. this.onSearch();
  2065. },
  2066. tabChange(name) {
  2067. window.scrollTo(0, 0);
  2068. this.finished = true;
  2069. this.pageNum = 1;
  2070. this.list = [];
  2071. this.tabVal = name;
  2072. localStorage.setItem('tabVal', name);
  2073. this.onLoad();
  2074. },
  2075. // 滚动条与底部距离小于 offset 时触发 初始化会触发
  2076. onLoad() {
  2077. // 授权
  2078. getTicketFun().then(() => {
  2079. var postType = localStorage.getItem('postType');
  2080. if (postType == 'GZ') {
  2081. this.typeShow = false;
  2082. } else {
  2083. this.typeShow = true;
  2084. }
  2085. if (this.lon == '' && this.tabVal != 1) {
  2086. this.positionFn(1);
  2087. } else {
  2088. if (this.tabVal == 1) {
  2089. this.positionFn();
  2090. // this.getUserOutPlaListFun();
  2091. } else {
  2092. this.getUserOrgStoreList();
  2093. }
  2094. }
  2095. });
  2096. },
  2097. // 跳转好帮手门店详情
  2098. goOtherSystem(item) {
  2099. // 是否为 家装或工装
  2100. if (item.sfaStoreType.jz || item.sfaStoreType.gz) {
  2101. return false;
  2102. }
  2103. if (item.storeCode) {
  2104. window.location.href =
  2105. process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
  2106. } else {
  2107. this.$dialog.alert({
  2108. message: '缺少门店code',
  2109. });
  2110. }
  2111. },
  2112. },
  2113. };
  2114. </script>
  2115. <style lang="scss">
  2116. .van-dialog__confirm,
  2117. .van-dialog__confirm:active {
  2118. color: #0057ba;
  2119. }
  2120. .searchDiv {
  2121. .van-search {
  2122. background: #fff;
  2123. }
  2124. .van-search__action {
  2125. font-size: 14px;
  2126. color: #0057ba;
  2127. font-weight: bold;
  2128. background: #f1f1f1;
  2129. border-bottom-right-radius: 60px;
  2130. border-top-right-radius: 60px;
  2131. border: 1px solid #ccc;
  2132. padding: 0 20px;
  2133. }
  2134. .van-search--show-action {
  2135. padding-right: 12px;
  2136. }
  2137. .van-search__content {
  2138. border: 1px solid #ccc;
  2139. border-bottom-left-radius: 60px;
  2140. border-top-left-radius: 60px;
  2141. background: #f1f1f1;
  2142. border-right: 0;
  2143. }
  2144. }
  2145. .myTab {
  2146. .van-tabs__nav--card {
  2147. margin: 0 !important;
  2148. border-left: 0;
  2149. border-right: 0;
  2150. }
  2151. .van-tabs__wrap,
  2152. .van-tabs__nav--card {
  2153. height: 39px;
  2154. }
  2155. .van-tab {
  2156. line-height: 40px;
  2157. }
  2158. }
  2159. .myList {
  2160. .van-cell {
  2161. padding: 0;
  2162. &:after {
  2163. border-bottom: none;
  2164. }
  2165. }
  2166. }
  2167. </style>
  2168. <style lang="scss" scoped>
  2169. .bgcolor {
  2170. background-color: #f5f5f5;
  2171. }
  2172. .container {
  2173. padding-bottom: 50px;
  2174. }
  2175. .card {
  2176. padding: 10px 16px;
  2177. box-sizing: border-box;
  2178. }
  2179. .card .title {
  2180. font-size: 15px;
  2181. font-weight: bold;
  2182. color: #333;
  2183. line-height: 22px;
  2184. padding-right: 52px;
  2185. .statusIcon {
  2186. padding: 3px;
  2187. font-size: 12px;
  2188. margin: 0 3px;
  2189. color: #fff;
  2190. display: inline-block;
  2191. height: 20px;
  2192. line-height: 16px;
  2193. vertical-align: -1px;
  2194. }
  2195. .submit {
  2196. background: #ffba13;
  2197. }
  2198. .noSubmit {
  2199. background: #f11818;
  2200. }
  2201. }
  2202. .card .info {
  2203. font-size: 14px;
  2204. color: #909090;
  2205. line-height: 26px;
  2206. }
  2207. .btnbox {
  2208. padding-top: 14px;
  2209. border-top: 1px solid #eee;
  2210. margin: 0 10px;
  2211. }
  2212. .navBarTOP {
  2213. position: fixed;
  2214. width: 100%;
  2215. z-index: 2;
  2216. top: 0;
  2217. }
  2218. .cellcontent .centerBtn {
  2219. margin: 0 auto 10px;
  2220. display: block;
  2221. width: 92%;
  2222. color: #0057ba;
  2223. border-radius: 5px;
  2224. padding: 0 2px;
  2225. }
  2226. .cellcontent .centerBtn1 {
  2227. background-color: #0057ba;
  2228. color: #fff;
  2229. border-color: #0057ba;
  2230. }
  2231. .cellcontent .centerBtn2 {
  2232. margin: 0 auto 10px;
  2233. display: block;
  2234. width: 92%;
  2235. color: #0057ba;
  2236. border-radius: 5px;
  2237. padding: 0;
  2238. }
  2239. .statstext {
  2240. background-color: #0057ba;
  2241. position: absolute;
  2242. right: 0;
  2243. top: 6px;
  2244. padding: 2px 6px 2px 12px;
  2245. border-bottom-left-radius: 60px;
  2246. border-top-left-radius: 60px;
  2247. color: #fff;
  2248. }
  2249. .cellcontent .van-cell {
  2250. padding: 10px 0;
  2251. }
  2252. .statstext .van-icon__image {
  2253. height: 0.7em;
  2254. }
  2255. .tipsTitle {
  2256. padding: 5px 0;
  2257. text-align: center;
  2258. font-size: 16px;
  2259. font-weight: 600;
  2260. }
  2261. </style>
  2262. <style>
  2263. .van-tabs__nav--card .van-tab.van-tab--active {
  2264. background-color: #0057ba !important;
  2265. }
  2266. .visitSearch {
  2267. width: 68px;
  2268. color: #0057ba;
  2269. font-size: 14px;
  2270. }
  2271. .visitSearch .van-dropdown-menu__bar {
  2272. box-shadow: 0 0 0 #fff;
  2273. height: 52px;
  2274. }
  2275. .visitSearch .van-dropdown-menu__item {
  2276. justify-content: normal;
  2277. }
  2278. .visitSearch .van-dropdown-menu__title {
  2279. border-left: 1px solid #ccc;
  2280. }
  2281. .visitSearch .van-cell {
  2282. border: 1px solid #ccc;
  2283. border-radius: 5px;
  2284. padding: 6px;
  2285. }
  2286. .positionContent {
  2287. position: fixed;
  2288. color: #666;
  2289. display: inline-block;
  2290. box-shadow: 0px 2px 7px -5px #000;
  2291. border-radius: 100px;
  2292. overflow: hidden;
  2293. right: 14px;
  2294. cursor: pointer;
  2295. bottom: 96px;
  2296. background-color: white;
  2297. }
  2298. .positionContent .img {
  2299. border-radius: 100px;
  2300. float: left;
  2301. }
  2302. .positionContent .img .van-icon__image {
  2303. border-radius: 100px;
  2304. }
  2305. .zDialog .van-dialog__header {
  2306. padding: 10px;
  2307. border-bottom: 1px solid #f5f5f5;
  2308. }
  2309. .zDialog .infoText {
  2310. margin: 10px;
  2311. font-size: 14px;
  2312. color: #909090;
  2313. width: 98%;
  2314. }
  2315. .visitStoreIco {
  2316. float: left;
  2317. float: left;
  2318. width: 26px;
  2319. text-align: center;
  2320. background-color: #ffba13;
  2321. color: #fff;
  2322. border-radius: 100%;
  2323. margin-left: 14px;
  2324. line-height: 26px;
  2325. height: 26px;
  2326. }
  2327. .searchcheck {
  2328. padding: 0 10px 10px;
  2329. }
  2330. .searchcheck .van-checkbox {
  2331. /*width: 44%;*/
  2332. padding-bottom: 10px;
  2333. }
  2334. .searchcheck .checkbox {
  2335. font-size: 14px;
  2336. display: inline-block;
  2337. width: 50%;
  2338. line-height: 28px;
  2339. }
  2340. .searchcheck .checkbox .van-checkbox {
  2341. margin-bottom: 2px;
  2342. }
  2343. .searchcheck .checkbox1 {
  2344. font-size: 14px;
  2345. float: left;
  2346. line-height: 28px;
  2347. width: 50%;
  2348. }
  2349. .searchcheck .checkbox1 .child {
  2350. width: 100%;
  2351. }
  2352. .searchcheck {
  2353. height: 93vh;
  2354. overflow-y: auto;
  2355. }
  2356. .searchchecktitle {
  2357. width: 100%;
  2358. margin: 20px 0;
  2359. font-size: 16px;
  2360. border-left: 3px solid #0057ba;
  2361. line-height: 18px;
  2362. }
  2363. .searchchecktitle1 {
  2364. width: 100%;
  2365. margin: 20px 0;
  2366. font-size: 16px;
  2367. line-height: 18px;
  2368. }
  2369. .textsize {
  2370. font-size: 14px;
  2371. }
  2372. </style>