topStore.vue 109 KB

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