topStore.vue 108 KB

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