index.vue 89 KB

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