| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951 |
- <template>
- <div class="bgcolor topStore">
- <div class="navBarTOP">
- <!-- 顶部条-->
- <van-nav-bar class="navBar" title="高销额门店推荐" left-arrow @click-left="onClickLeft">
- <template #right>
- <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
- </template>
- </van-nav-bar>
- <div class="searchDiv searchDivcs">
- <van-row v-if="showAll && showKM">
- <van-col span="16">
- <van-search
- v-model="storeName"
- left-icon="search"
- show-action
- placeholder="搜索名称/编号/地址"
- @clear="clearFn">
- <template #action>
- <div @click="onSearchm">搜索</div>
- </template>
- </van-search>
- </van-col>
- <van-col span="8">
- <div
- style="
- line-height: 36px;
- margin: 8px;
- margin-right: 0;
- text-align: center;
- border-radius: 6px;
- color: #0057ba;
- background-color: #fff;
- font-size: 14px;
- border: 1px solid #0057ba;
- "
- @click="jionAll">
- 加入计划内
- </div>
- </van-col>
- </van-row>
- <van-row v-if="!showAll || !showKM">
- <van-col span="24">
- <van-search
- v-model="storeName"
- left-icon="search"
- show-action
- placeholder="搜索名称/编号/地址"
- @clear="clearFn">
- <template #action>
- <div @click="onSearchm">搜索</div>
- </template>
- </van-search>
- </van-col>
- </van-row>
- </div>
- <van-dropdown-menu active-color="#0057ba">
- <van-dropdown-item v-model="value1" :options="option1" @change="v1Fn" />
- <van-dropdown-item v-model="value2" :options="option2" @change="v2Fn" />
- <van-dropdown-item v-model="value3" :options="option3" @change="v3Fn" />
- </van-dropdown-menu>
- </div>
- <!-- 主体内容-->
- <div style="height: 154px"></div>
- <van-notice-bar v-if="!showKM" color="#444" background="#f5f5f5" left-icon="info-o">
- 附近20KM内门店。
- </van-notice-bar>
- <div class="container">
- <van-list
- class="myList"
- v-model="loading"
- :finished="finished"
- @load="onLoad"
- finished-text="--已经到底了--">
- <van-checkbox-group v-model="radio">
- <div class="cellcontent" v-for="(item, index) in list" :key="index">
- <van-cell>
- <div class="card">
- <div class="title titlero">
- <template v-if="item.storeLabels">
- <!-- 金牌店ABC -->
- <img
- class="JPABC"
- :src="require('@/assets/Icon/storeA.png')"
- v-if="item.storeLabels.storeA" />
- <img
- class="JPABC"
- :src="require('@/assets/Icon/storeB.png')"
- v-if="item.storeLabels.storeB" />
- <img
- class="JPABC"
- :src="require('@/assets/Icon/storeC.png')"
- v-if="item.storeLabels.storeC" />
- <img
- class="JPABC"
- :src="require('@/assets/Icon/storeD.png')"
- v-if="item.storeLabels.storeD" />
- <img
- class="JPABC"
- :src="require('@/assets/Icon/storeE.png')"
- v-if="item.storeLabels.storeE" />
- </template>
- <span class="btn" :data-clipboard-text="item.storeCode">
- <span>{{ item.storeName }}</span>
- (<span style="color: #0057ba">{{ item.storeCode }}</span
- >)
- <van-icon
- :name="paste"
- color="#ee0a24"
- size="20"
- style="top: 6px; margin-left: 4px" />
- </span>
- <!-- "approvalStatus": 1:已结案;0:未结案, -->
- <!-- "processApprovalStatus": 审批状态(0=未提交,1=已提交待审核,2=审批通过,3=审批拒绝) -->
- <template v-if="item.approvalStatus == 0">
- <span class="statusIcon submit" v-if="item.processApprovalStatus == 1"
- >已提交</span
- >
- <span class="statusIcon noSubmit" v-if="item.processApprovalStatus == 0"
- >未提交</span
- >
- </template>
- </div>
- <div class="info" style="position: relative">
- 联系人:{{ item.contactName }}
- <div style="position: absolute; bottom: 0px; right: 0px">
- <el-popover
- popper-class="zpover"
- placement="bottom"
- width="120"
- trigger="click"
- content="该客户为凤凰客户">
- <div
- v-if="item.storeLabels.fhCustomer"
- class="visitStoreIco"
- style="background-color: #fff"
- slot="reference">
- <van-icon :name="require('@/assets/Icon/fenghuangjihua.png')" size="26" />
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover zpover6"
- placement="bottom-start"
- trigger="click">
- <div>
- <p>
- 本店{{ timeData }}下单SKU数:<a
- @click="linkList(item)"
- style="text-decoration: underline"
- >点击查看</a
- >
- </p>
- </div>
- <div
- class="visitStoreIco"
- v-if="item.storeLabels.zysslNums !== false"
- style="background-color: #fff; position: relative"
- slot="reference">
- <p
- style="
- width: 100%;
- position: absolute;
- z-index: 1;
- top: 0.2px;
- width: 22px;
- margin: 0;
- margin-left: 3.6px;
- text-align: center;
- font-size: 12px;
- ">
- {{ item.storeLabels.zysslNums }}
- </p>
- <van-icon :name="ord" size="26" />
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover"
- placement="bottom"
- width="200"
- trigger="click">
- <div v-if="item.storeLabels">
- <p>已参加:</p>
- <p v-for="tt in (item.storeLabels.targetOne + '').split(';')">
- {{ tt }}
- </p>
- </div>
- <div
- class="visitStoreIco"
- v-if="item.storeLabels.targetOne"
- style="background-color: #fff"
- slot="reference">
- <van-icon :name="targetOne" size="26" />
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover"
- placement="bottom"
- width="120"
- trigger="click"
- content="调色机7天未调色">
- <div
- v-if="item.storeLabels.stopColorMixerSeven"
- class="visitStoreIco"
- style="background-color: #fff"
- slot="reference">
- <van-icon :name="Network" size="26" />
- </div>
- </el-popover>
- <el-popover popper-class="zpover" placement="bottom" width="120" trigger="click"
- content="调色机当月未调色">
- <div v-if="item.storeLabels.stopColorMixerMonth" class="visitStoreIco"
- style="background-color: #fff" slot="reference">
- <van-icon :name="WiFi" size="26" />
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover"
- placement="bottom"
- width="200"
- trigger="click"
- content="同城店近60天未下单">
- <div
- v-if="item.storeLabels.fxNoOrder"
- class="visitStoreIco"
- style="background-color: #fff"
- slot="reference">
- <van-icon :name="order60" size="26" />
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover"
- placement="bottom"
- width="200"
- trigger="click"
- content="本店本月进过专业时时丽">
- <div
- class="visitStoreIco"
- v-if="item.storeLabels.zyssl"
- style="background-color: #ed5c68"
- slot="reference">
- 专
- </div>
- </el-popover>
- <el-popover
- popper-class="zpover zpover1"
- placement="bottom"
- width="200"
- trigger="click"
- content="本店本月进过超好贴">
- <div
- v-if="item.storeLabels.chtczj"
- class="visitStoreIco"
- style="background-color: #0057ba"
- slot="reference">
- 超
- </div>
- </el-popover>
- <el-popover
- placement="bottom"
- popper-class="zpover zpover1 zpover1sb"
- trigger="click"
- :disabled="!item.userVisitTimesMap"
- :content="'本店本月已拜访过' + item.storeLabels.visitTimes + '次'">
- <div
- v-if="item.storeLabels.visitTimes && item.storeLabels.visitTimes > 0"
- class="visitStoreIco"
- slot="reference"
- style="background-color: #fff; position: relative">
- <p
- style="
- width: 100%;
- position: absolute;
- z-index: 10;
- top: -2px;
- margin: 0;
- text-align: center;
- font-size: 12px;
- ">
- {{ item.storeLabels.visitTimes }}
- </p>
- <!-- A级金牌店拜访次数少于2 -->
- <van-icon
- :name="require('@/assets/ordernumRed.png')"
- size="26"
- v-if="
- item.storeLabels.storeA &&
- item.needVisitNum &&
- item.storeLabels.visitTimes < item.needVisitNum
- " />
- <van-icon :name="require('@/assets/ordernum.png')" size="26" v-else />
- </div>
- <p style="text-align: center; background: #fff; color: #000; padding: 5px 0">
- 本店本月已拜访过{{ item.storeLabels.visitTimes }}次
- </p>
- <p
- v-if="item.storeLabels.storeA && item.needVisitNum"
- style="text-align: center; background: #fff; color: red; padding: 5px 0">
- A级金牌店拜访标准:1月{{ item.needVisitNum }}次
- </p>
- <el-table :data="item.userVisitTimesMap" border max-height="180px">
- <el-table-column label="业务员" prop="userName" />
- <el-table-column label="拜访次数" prop="visitTimes" width="110px" />
- </el-table>
- </el-popover>
- </div>
- </div>
- <div class="info" style="position: relative">
- 类型:<span v-if="cstype != 1">{{ item.storeCategory }}</span
- ><span v-if="cstype == 1">金牌店</span>
- <el-popover
- popper-class="zpover zpover6"
- placement="bottom-start"
- trigger="click">
- <div>
- <p>
- 本店经营品项指导:
- <a @click="linkimg(item)" style="text-decoration: underline">点击查看</a>
- </p>
- </div>
- <van-icon name="question-o" size="18" slot="reference" />
- </el-popover>
- </div>
- <div class="info" @click="buryingPointFn(item)">
- 联系电话:<a
- style="color: #0057ba; font-weight: bold; text-decoration: underline"
- :href="'tel:' + item.telephone"
- >{{ item.telephone }}<van-icon name="phone"
- /></a>
- </div>
- <div class="info">地址:{{ item.addressLine }}</div>
- <!-- 分销店 -->
- <template
- v-if="
- item.sfaStoreType &&
- item.sfaStoreType.type == 'fxd' &&
- item.sfaStoreChainsContactList
- ">
- <div class="info" v-if="typeShow">
- 经销商:
- <div
- class="TCFXListItem"
- v-for="(item, index) in item.sfaStoreChainsContactList">
- <el-popover
- popper-class="zpover zpoverStoreztype"
- placement="bottom-start"
- trigger="click">
- <div>
- <div>{{ item.chainCode }}</div>
- <div>{{ item.chainName }}</div>
- </div>
- <div slot="reference" :key="index">
- {{ item.categoryDescribe }}
- </div>
- </el-popover>
- </div>
- </div>
- </template>
- <template v-else>
- <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
- </template>
- <div class="info" style="color: #444">
- 门店销额(近三个月):¥{{ Micrometer(item.rolling3monthAMT) }}元
- <span
- v-if="cstype == 1 && index == 0 && value1 == 'b'"
- style="float: right; font-weight: bold; color: red">
- <img
- src="../../assets/Icon/top1.png"
- v-if="index == 0"
- style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
- >
- <span
- v-if="cstype == 1 && index == 1 && value1 == 'b'"
- style="float: right; font-weight: bold; color: #f4ea2a">
- <img
- src="../../assets/Icon/top2.png"
- v-if="index == 1"
- style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
- >
- <span
- v-if="cstype == 1 && index == 2 && value1 == 'b'"
- style="float: right; font-weight: bold; color: #1afa29">
- <img
- src="../../assets/Icon/top3.png"
- v-if="index == 2"
- style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
- >
- <span
- v-if="cstype == 1 && index > 2 && value1 == 'b'"
- style="float: right; font-weight: bold">
- <img
- src="../../assets/Icon/top4.png"
- v-if="index > 2"
- style="width: 18px; float: left; margin-top: 2px" />TOP{{ index + 1 }}</span
- >
- </div>
- <div class="info" style="color: #444">
- 最近拜访时间:{{ parseTime(item.hisTime) }}
- </div>
- <div class="info" style="color: #444">
- 最新下单时间:{{ parseTime(item.deliveryDate) }}
- </div>
- </div>
- <div
- class="statstext"
- v-if="item.joinInPaln && showKM"
- style="background-color: #fff; bottom: 70px; right: 14px; top: auto">
- <van-checkbox
- :name="item.storeId"
- shape="square"
- style="float: right"></van-checkbox>
- </div>
- <div
- class="statstext"
- v-if="item.stateString == '未拜访'"
- style="background-color: #ed5c68">
- 未拜访
- </div>
- <div
- class="statstext"
- v-if="item.stateString == '拜访中'"
- style="background-color: white">
- <van-icon :name="times" color="#ee0a24" size="32" />
- </div>
- <div class="statstext" v-if="item.stateString == '已拜访'">已拜访</div>
- <div class="btnbox">
- <van-row>
- <van-col
- span="5"
- v-if="item.stateString != '已拜访' && customerVisits"
- @click="storeVisit(item)">
- <img :src="call" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; font-size: 12px">进入拜访</p>
- </van-col>
- <van-col
- span="5"
- v-if="item.storeCategory == '公装经销商'"
- @click="projectOutVisit(item)">
- <img :src="xmgj" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; font-size: 12px">项目跟进</p>
- <!-- <van-button type="info" size="small" plain class="centerBtn" @click="signAdd(item)">大客户签约</van-button>-->
- </van-col>
- <van-col
- span="5"
- v-if="
- item.stateString != '已拜访' &&
- item.storeCategory != '公装经销商' &&
- customerVisits
- "
- @click="abnormalVisit(item)">
- <img :src="yichang" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 异常拜访
- </p>
- </van-col>
- <van-col span="4" v-if="item.showOrderButton" @click="orderFn(item)">
- <img :src="xiadan" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 去下单
- </p>
- </van-col>
- <van-col span="5" v-if="item.stateString == '已拜访'" @click="Visit(item)">
- <img :src="bfxx" style="margin: 0 auto; width: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 拜访信息
- </p>
- </van-col>
- <van-col span="5" @click="visitFn(item)">
- <img :src="kehuxinxi" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; margin-top: 1px; font-size: 12px">
- 客户信息
- </p>
- </van-col>
- <van-col span="5" v-if="item.joinInPaln && showKM" @click="storeJoinVisitv(item)">
- <img :src="jiarujihua" style="margin: 0 auto; height: 18px; display: block" />
- <p style="text-align: center; margin: 0; font-size: 12px">加入计划内</p>
- </van-col>
- </van-row>
- </div>
- </van-cell>
- <div class="lineGrey"></div>
- </div>
- </van-checkbox-group>
- <van-empty v-if="list.length == 0" />
- </van-list>
- <br />
- <br />
- <br />
- <br />
- <br />
- </div>
- <van-action-sheet
- v-model="showOutPopover"
- :actions="actions"
- @select="onSelect"
- cancel-text="取消"
- @cancel="showOutPopover = false" />
- <van-popup v-model="showPicker" position="bottom" class="textsize">
- <van-row
- style="
- position: fixed;
- top: 0;
- width: 100%;
- z-index: 998;
- background-color: #fff;
- border-bottom: 1px solid #ccc;
- ">
- <van-col span="3" style="text-align: center; margin: 14px 0" @click="showPicker = false">
- <van-icon name="cross" size="20" color="#909399" />
- </van-col>
- <van-col span="13"> </van-col>
- <van-col span="4" style="text-align: center; line-height: 36px" @click="onConfirm">
- <div style="color: #0057ba">
- <van-button type="info" size="small" color="#0057ba">筛选</van-button>
- </div></van-col
- >
- <van-col span="4" style="text-align: center; line-height: 36px" @click="onsets">
- <van-button type="default" size="small" style="height: 28px">重置</van-button>
- </van-col>
- </van-row>
- <div style="height: 48px; width: 100%"></div>
- <!-- <van-picker show-toolbar :columns="storeTypeLists" value-key="dictLabel" @confirm="onConfirm" @cancel="showPicker = false"/> -->
- <div class="searchcheck">
- <p class="searchchecktitle"> 经销商</p>
- <van-row>
- <van-col span="24">
- <div @click="moreTypeShowFn">
- <van-field
- style="
- margin-top: -6px;
- border-radius: 6px;
- border: 1px solid #ccc;
- overflow: hidden;
- "
- readonly
- v-model="chainName"
- label=""
- placeholder="请选择经销商" />
- </div>
- </van-col>
- <!-- <van-col span="4"><van-button type="default" native-type="button" @click="moreTypeShowclearableFn">清空</van-button></van-col>-->
- </van-row>
- <p class="searchchecktitle" @click="otherbqShow = !otherbqShow">
- 门店标签<van-icon name="arrow-down" style="float: right" />
- </p>
- <van-checkbox-group v-model="storeLabelTypes" direction="horizontal">
- <div v-if="otherbqShow" style="width: 100%">
- <div class="checkbox" v-for="(item, index) in StoreLabels" :key="index">
- <div>
- <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- </div>
- </van-checkbox-group>
- <van-checkbox-group v-model="result" direction="horizontal">
- <p class="searchchecktitle" @click="otherkkdShow = !otherkkdShow">
- 可控店<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherkkdShow">
- <div v-for="(item, index) in storeTypeLists" :key="index" class="checkbox1">
- <div v-if="item.groupType == 'kkd'" class="child">
- <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
- </div>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- <p class="searchchecktitle" @click="otherfxdShow = !otherfxdShow">
- 分销店<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow" style="margin: 0 14px; width: 100%">
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- <p class="searchchecktitle1" @click="otherfxdShow1 = !otherfxdShow1">
- 金牌店<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow1">
- <div v-for="(item1, index1) in storeTypeLists" :key="200 + index1" class="checkbox1">
- <div v-if="item1.groupType == 'fxd' && item1.remark == 'jp'" class="child">
- <van-checkbox :name="item1.dictValue">{{ item1.dictLabel }}</van-checkbox>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- </div>
- <p class="searchchecktitle1" @click="otherfxdShow2 = !otherfxdShow2">
- 同城分销店<van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherfxdShow2">
- <div
- v-for="(itemlj, indexlj) in storeTypeLists"
- :key="400 + indexlj"
- class="checkbox1">
- <div v-if="itemlj.groupType == 'fxd' && itemlj.remark == 'tcfx'" class="child">
- <van-checkbox :name="itemlj.dictValue">{{ itemlj.dictLabel }}</van-checkbox>
- </div>
- </div>
- <div style="clear: both"></div>
- </div>
- </div>
- <div style="height: 2px; background-color: #f5f5f5; width: 100%; clear: both"></div>
- <p class="searchchecktitle" @click="otherShow = !otherShow">
- 其他 <van-icon name="arrow-down" style="float: right" />
- </p>
- <div v-if="otherShow">
- <div v-for="(item2, index2) in storeTypeLists" :key="100 + index2" class="checkbox1">
- <div v-if="item2.groupType == 'other'" class="child">
- <van-checkbox :name="item2.dictValue">{{ item2.dictLabel }}</van-checkbox>
- </div>
- </div>
- </div>
- </van-checkbox-group>
- </div>
- </van-popup>
- <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%">
- <van-row style="background-color: #f5f5f5">
- <van-col span="20">
- <van-field
- left-icon="search"
- style="margin-top: 2px; border-radius: 6px; overflow: hidden"
- v-model="CustomerName"
- label=""
- placeholder="请输入关键词"
- clearable />
- </van-col>
- <van-col span="4" style="text-align: center; line-height: 48px" @click="getCustomer">
- <div style="background-color: #0057ba; color: #fff">搜索</div></van-col
- >
- </van-row>
- <van-picker
- show-toolbar
- :columns="chainsData"
- value-key="chainName"
- @confirm="onConfirmChainsList"
- @cancel="moreTypeShow = false"
- visible-item-count="10" />
- </van-popup>
- <div class="positionContent" @click="rangeStoreFn()">
- <van-icon class="img" :name="mpimg" size="50" />
- </div>
- </div>
- </template>
- <script>
- import {
- stopVisit,
- checkVisit,
- addVisitsPosition,
- mobileReposition,
- getStoreyslTypeList,
- getStoreTypeListlp,
- joinInPlan,
- getStoreLabels,
- getCustomerList,
- buryingPoint,
- ProductItemImge,
- getStoreGroupCategory,
- } from '@/api/index';
- import times from '@/assets/Icon/times.png';
- import order60 from '@/assets/order60.png';
- import targetOne from '@/assets/targetOne.png';
- import Network from '@/assets/Network.png';
- import WiFi from '@/assets/WiFi.png';
- import ord from '@/assets/ord.png';
- import timeico from '@/assets/Icon/datatims.png';
- import location from '@/assets/location.png';
- import paste from '@/assets/paste.png';
- import visitTimes from '@/assets/visitTimes.png';
- import mpimg from '@/assets/mpimg.png';
- import axios from 'axios';
- import mapmarker from '@/components/mapMarkerDouble';
- import order from '@/assets/order.png';
- import nocj from '@/assets/nocj.png';
- import request from '@/utils/request';
- import call from '@/assets/call.png';
- import jiarujihua from '@/assets/jiarujihua.png';
- import kehuxinxi from '@/assets/kehuxinxi-2.png';
- import xiadan from '@/assets/xiadan.png';
- import yichang from '@/assets/yichang.png';
- import bfxx from '@/assets/bfxx.png';
- import xmgj from '@/assets/xmgj.png';
- import { getOrderUrlByStoreId, topjoinInPlan, topStore } from '@/api/inventory';
- import { parseTime } from '@/utils';
- import { checkStoreAddressByStoreCode } from '@/api/visitstore';
- import sbpmdh from '@/assets/sbpmdh.png';
- import { getPosition, getTicketFun } from '@/utils/TXApiFun';
- export default {
- name: 'outsidelist',
- components: { mapmarker },
- data() {
- return {
- xmgj: xmgj,
- bfxx: bfxx,
- times: times,
- searchShows: false,
- paste: paste,
- visitTimess: visitTimes,
- typeShow: false,
- mpimg: mpimg,
- order: order,
- mapShow: false,
- yichang: yichang,
- xiadan: xiadan,
- kehuxinxi: kehuxinxi,
- jiarujihua: jiarujihua,
- call: call,
- otherShow: false,
- Network: Network,
- WiFi: WiFi,
- order60: order60,
- targetOne: targetOne,
- chainName: '',
- chainCode: '',
- activeNames: '1',
- showPopover: false,
- moreTypeShow: false,
- showPopoverVNUM: [],
- showPopoverC: [],
- showPopoverZ: [],
- zyssl: [],
- chtczj: [],
- noVisit: [],
- noOrder: [],
- fxNoOrder: [],
- storeLabelTypes: [],
- // showPopover:false,
- location: location,
- timeico: timeico,
- nocj: nocj,
- disabled: false,
- timer: null,
- flag: true,
- show: false,
- tabVal: '0',
- list: [],
- cont: 0,
- loading: false,
- showPicker: false,
- finished: false,
- otherbqShow: true,
- otherkkdShow: true,
- otherfxdShow: true,
- typeName: '搜索',
- visitEndId: '',
- pageSize: 12,
- pageNum: 1,
- listActive: null,
- query: '',
- storeName: '',
- genDate: '',
- storeType: '',
- endShow: false,
- storeCategory: '',
- fromValue: {},
- storeTypeList: [],
- storeTypeLists: [],
- chainsData: [],
- serachstype: '',
- timeData: '',
- addShow1: false,
- storeCategoryList: '',
- result: [],
- StoreLabels: [],
- CustomerName: '',
- lat: '',
- lon: '',
- cstype: 0,
- title: '计划外',
- value1: 'b',
- value2: '',
- showKM: true,
- value3: '',
- showOutPopover: false,
- actions: [
- { name: '周一', id: 1 },
- { name: '周二', id: 2 },
- { name: '周三', id: 3 },
- { name: '周四', id: 4 },
- { name: '周五', id: 5 },
- { name: '周六', id: 6 },
- { name: '周日', id: 7 },
- ],
- option1: [
- { text: '门店销量', value: 'a' },
- { text: '门店销量倒序', value: 'b' },
- { text: '门店销量正序', value: 'c' },
- ],
- option2: [
- { text: '拜访时间', value: '' },
- { text: '拜访时间倒序', value: 'b' },
- { text: '拜访时间正序', value: 'c' },
- ],
- option3: [
- { text: '下单时间', value: '' },
- { text: '下单时间倒序', value: 'b' },
- { text: '下单时间正序', value: 'c' },
- ],
- radio: [],
- sortParam: 'sales',
- sortType: 'desc',
- storeIds: '',
- Jointype: 1,
- showAll: false,
- ord: ord,
- customerVisits: true,
- otherfxdShow1: true,
- otherfxdShow2: true,
- };
- },
- watch: {
- $route(to, from) {
- if (
- (from.path == '/storeDetail' && to.path == '/topStore') ||
- (from.path == '/storeGroup' && to.path == '/topStore') ||
- (from.path == '/suishenbangOutstoreVisit' && to.path == '/topStore') ||
- (from.path == '/outabnormalVisit' && to.path == '/topStore') ||
- (from.path == '/home' && to.path == '/topStore') ||
- (from.path == '/deviceWithin/index' && to.path == '/topStore') ||
- (from.path == '/AI/index' && to.path == '/topStore') ||
- (from.path == '/storemanagement/index' && to.path == '/topStore') ||
- (from.path == '/My/index' && to.path == '/topStore')
- ) {
- this.lat = '';
- this.onSearch();
- var week = new Date().getDay();
- if (week > 0 && week < 6) {
- this.actions[week - 1].name = '今天';
- }
- this.radio = [];
- // setTimeout(()=>{
- // this.onSearch()
- // },1000)
- }
- this.value1 = 'b';
- this.value2 = '';
- this.value3 = '';
- this.storeName = localStorage.getItem('outvstoreName');
- this.chainName = localStorage.getItem('outvchainName');
- if (localStorage.getItem('outvstoreLabelTypes') != null) {
- this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
- } else {
- this.storeLabelTypes = [];
- }
- if (localStorage.getItem('outvstoreCategoryList') != null) {
- this.result = localStorage.getItem('outvstoreCategoryList').split(',');
- this.storeCategoryList = this.result.join(',');
- } else {
- this.result = [];
- this.storeCategoryList = this.result.join(',');
- }
- this.chainCode = localStorage.getItem('outvchainCode');
- this.storeName = localStorage.getItem('outvstoreName');
- this.sortType = localStorage.getItem('outvstoreName');
- this.sortParam = localStorage.getItem('outvstoreName');
- if (this.sortParam != '') {
- if (this.sortParam == 'sales') {
- if (this.sortType == 'desc') {
- this.value1 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value1 = 'c';
- }
- }
- if (this.sortParam == 'visitTime') {
- this.value1 = '';
- if (this.sortType == 'desc') {
- this.value2 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value2 = 'c';
- }
- }
- if (this.sortParam == 'orderTime') {
- this.value1 = '';
- if (this.sortType == 'desc') {
- this.value3 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value3 = 'c';
- }
- }
- }
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.addShow1 = false;
- this.otherShow = true;
- } else {
- this.addShow1 = true;
- this.otherShow = false;
- }
- },
- },
- created() {
- this.value1 = 'b';
- this.value2 = '';
- this.value3 = '';
- this.storeName = localStorage.getItem('outvstoreName');
- this.chainName = localStorage.getItem('outvchainName');
- if (localStorage.getItem('outvstoreLabelTypes') != null) {
- this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
- } else {
- this.storeLabelTypes = [];
- }
- if (localStorage.getItem('outvstoreCategoryList') != null) {
- this.result = localStorage.getItem('outvstoreCategoryList').split(',');
- this.storeCategoryList = this.result.join(',');
- } else {
- this.result = [];
- this.storeCategoryList = this.result.join(',');
- }
- this.chainCode = localStorage.getItem('outvchainCode');
- this.storeName = localStorage.getItem('outvstoreName');
- this.sortType = localStorage.getItem('outvstoreName');
- this.sortParam = localStorage.getItem('outvstoreName');
- if (this.sortParam != '') {
- if (this.sortParam == 'sales') {
- if (this.sortType == 'desc') {
- this.value1 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value1 = 'c';
- }
- }
- if (this.sortParam == 'visitTime') {
- this.value1 = '';
- if (this.sortType == 'desc') {
- this.value2 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value2 = 'c';
- }
- }
- if (this.sortParam == 'orderTime') {
- this.value1 = '';
- if (this.sortType == 'desc') {
- this.value3 = 'b';
- }
- if (this.sortType == 'asc') {
- this.value3 = 'c';
- }
- }
- }
- if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
- this.tabVal = '0';
- } else {
- this.tabVal = localStorage.getItem('tabVal');
- }
- this.cstype = this.$route.query.type;
- this.query = this.$route.query;
- localStorage.removeItem('visitId');
- this.getStoreTypeList();
- this.getStoreLabels();
- this.lat = '';
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.addShow1 = false;
- this.otherShow = true;
- } else {
- this.addShow1 = true;
- this.otherShow = false;
- }
- var week = new Date().getDay();
- if (week > 0 && week < 6) {
- this.actions[week - 1].name = '今天';
- }
- this.radio = [];
- this.onSearch();
- this.getMonth();
- },
- methods: {
- linkapp(val) {
- var poind = this.gcj02BD(val.lat, val.lon);
- let url = window.location.href;
- let that = this;
- let wx = this.wx;
- let qiyeData;
- const instance = axios.create();
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- instance
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- params: {
- url: url,
- agent: 1,
- },
- })
- .then((response) => {
- if (response.status == 200) {
- qiyeData = response.data.data;
- wx.agentConfig({
- corpid: qiyeData.appId, // 必填,企业微信的corpid,必须与当前登录的企业一致
- agentid: qiyeData.agentId, // 必填,企业微信的应用id (e.g. 1000247)
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- signature: qiyeData.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
- jsApiList: ['launchMiniprogram'], //必填,传入需要使用的接口名称
- success: function (res) {
- wx.invoke(
- 'launchMiniprogram',
- {
- appid: 'wx238bbb5f6d958414',
- path:
- 'pages/relayStation/relayStation?latitude=' +
- poind.lat +
- '&longitude=' +
- poind.lon +
- '&name=' +
- val.addressLine,
- },
- function (res) {
- if (res.err_msg == 'launchMiniprogram:ok') {
- } else {
- }
- }
- );
- },
- fail: function (res) {
- if (res.errMsg.indexOf('function not exist') > -1) {
- alert('版本过低请升级');
- }
- },
- });
- }
- });
- },
- clearFn() {
- this.storeName = '';
- localStorage.setItem('outvstoreName', '');
- },
- orderFn(val) {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: val.storeName + '(' + val.storeCode + ')',
- buryingPointName: '去下单',
- buryingPointPosition: '高销额门店推荐',
- });
- getOrderUrlByStoreId({
- storeId: val.storeId,
- from: 'topStore',
- }).then((res) => {
- if (res.code == 200 && res.data) {
- window.location.href = res.data;
- } else {
- this.Toast({
- message: res.msg,
- duration: 5000,
- });
- }
- });
- },
- linkList(val) {
- this.$router.push({
- path: '/pItem',
- query: {
- id: val.storeId,
- detilId: 'a',
- from: 'topStore',
- storeCode: val.storeCode,
- showOrderButton: val.showOrderButton,
- },
- });
- },
- linkimg(val) {
- ProductItemImge({ storeId: val.storeId }).then((response) => {
- if (response.code == 200) {
- if (response.data != undefined) {
- window.open(response.data);
- } else {
- this.$toast(response.msg);
- }
- }
- });
- },
- getMonth() {
- // 获取当前日期
- var currentDate = new Date();
- // 获取当前月份
- var currentMonth = currentDate.getMonth();
- // 获取当前年份
- // var currentYear = currentDate.getFullYear();
- var previousMonthDate1 = new Date();
- if (currentDate.getDate() == 1) {
- previousMonthDate1.setMonth(currentMonth - 1);
- } else {
- }
- var previousMonth1 = previousMonthDate1.getMonth();
- var previousYear1 = previousMonthDate1.getFullYear();
- // 计算前三个月的年份和月份
- var previousMonthDate = new Date();
- if (currentDate.getDate() == 1) {
- previousMonthDate.setMonth(currentMonth - 3);
- } else {
- previousMonthDate.setMonth(currentMonth - 2);
- }
- 1;
- var previousMonth = previousMonthDate.getMonth();
- var previousYear = previousMonthDate.getFullYear();
- //前三个月
- if (previousYear1 == previousYear) {
- var formattedPreviousMonth1 = previousYear1 + '-' + (previousMonth1 + 1);
- // 格式化年份和月份
- var formattedPreviousMonth = previousYear + '-' + (previousMonth + 1);
- this.timeData =
- formattedPreviousMonth.split('-')[1] + '-' + formattedPreviousMonth1.split('-')[1] + '月';
- } else {
- var formattedPreviousMonth1 = previousYear1 + '年' + (previousMonth1 + 1) + '月';
- // .toString().padStart(2, '0');
- // 格式化年份和月份
- var formattedPreviousMonth = previousYear + '年' + (previousMonth + 1) + '月';
- this.timeData = formattedPreviousMonth + '-' + formattedPreviousMonth1;
- }
- },
- jionAll() {
- this.Jointype = 2;
- this.showOutPopover = true;
- },
- storeJoinVisitv(val) {
- this.storeIds = val.storeId;
- this.Jointype = 1;
- this.showOutPopover = true;
- },
- onClickLeft() {
- this.$router.replace({ path: '/deviceWithin' });
- },
- onSelect(val) {
- this.showOutPopover = false;
- var storeIds = '';
- if (this.Jointype == 1) {
- storeIds = this.storeIds;
- } else {
- if (this.radio.length > 0) {
- storeIds = this.radio.join(',');
- } else {
- var storeIdsss = [];
- for (var i = 0; i < this.list.length; i++) {
- if (this.list[i].joinInPaln) {
- storeIdsss.push(this.list[i].storeId);
- }
- }
- storeIds = storeIdsss.join(',');
- }
- }
- topjoinInPlan({ storeIds: storeIds, date: val.id }).then((request) => {
- if (request.code == 200) {
- this.$toast.success('加入成功');
- this.onSearch();
- } else {
- this.$toast(res.msg);
- }
- });
- },
- v1Fn(val) {
- this.value3 = '';
- this.value2 = '';
- this.sortParam = 'sales';
- if (val == 'b') {
- this.sortType = 'desc';
- } else {
- this.sortType = 'asc';
- }
- this.onSearchm();
- },
- v2Fn(val) {
- this.value1 = 'a';
- this.value3 = '';
- this.sortParam = 'visitTime';
- if (val == 'b') {
- this.sortType = 'desc';
- } else {
- this.sortType = 'asc';
- }
- this.onSearchm();
- },
- v3Fn(val) {
- this.value1 = 'a';
- this.value2 = '';
- this.sortParam = 'orderTime';
- if (val == 'b') {
- this.sortType = 'desc';
- } else {
- this.sortType = 'asc';
- }
- this.onSearchm();
- },
- // value1
- moreTypeShowFn() {
- this.moreTypeShow = true;
- // this.CustomerName=""
- // this.chainsData=[]
- this.getCustomer();
- },
- buryingPoint(val) {
- buryingPoint(val);
- },
- getCustomer() {
- var name = '';
- if (this.tabVal != 1) {
- name = 'org';
- } else {
- name = 'my';
- }
- getCustomerList({ name: this.CustomerName, from: name }).then((request) => {
- this.chainsData = request.data;
- this.chainsData.push({});
- this.chainsData.pop();
- });
- },
- onConfirmChainsList(value) {
- if (value.chainName != undefined) {
- this.chainName = value.chainName;
- this.chainCode = value.chainCode;
- }
- this.showPickerChainsList = false;
- this.moreTypeShow = false;
- },
- getStoreLabels() {
- getStoreLabels().then((res) => {
- this.StoreLabels = res.data;
- });
- },
- searchType(val) {
- this.storeTypeLists = [];
- if (val != '') {
- let filterArr = this.storeTypeList.filter((item) => {
- return item.dictLabel.toLowerCase().includes(val.toLowerCase());
- });
- this.storeTypeLists = filterArr;
- } else {
- this.storeTypeLists = this.storeTypeList;
- }
- },
- onConfirm(value) {
- this.storeCategoryList = this.result.join(',');
- // this.typeName=value.dictLabel
- this.showPicker = false;
- this.onSearchm();
- },
- moreTypeShowclearableFn() {
- this.chainName = '';
- this.chainCode = '';
- this.chainsData = [];
- },
- onsets() {
- this.result = [];
- this.zyssl = [];
- this.chtczj = [];
- this.noVisit = [];
- this.noOrder = [];
- this.fxNoOrder = [];
- this.storeLabelTypes = [];
- this.storeCategoryList = this.result.join(',');
- this.chainName = '';
- this.chainCode = '';
- // this.typeName=value.dictLabel
- this.onSearch();
- },
- getStoreTypeList() {
- getStoreTypeListlp({}).then((res) => {
- this.storeTypeLists = res.data;
- this.storeTypeList = res.data;
- });
- },
- // 范围
- rangeStoreFn() {
- getPosition()
- .then((res) => {
- let { TXisBD } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 3,
- buryingPointValue: '进入地图',
- buryingPointName: '高销额门店推荐',
- buryingPointPosition: '进入地图',
- });
- this.$router.push({
- path: '/rangeStore',
- query: {
- lat: '',
- lon: '',
- tabVal: 6,
- },
- });
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- // let loading1 = this.$toast.loading({
- // duration: 0,
- // message: '加载中...',
- // forbidClick: true,
- // });
- // let url = window.location.href;
- // let wx = this.wx;
- // var that = this;
- // let qiyeData;
- // const instance = axios.create();
- // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- // instance
- // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- // params: {
- // url: url,
- // },
- // })
- // .then((response) => {
- // if (response.status == 200) {
- // this.cont = 3;
- // var flat = true;
- // var times = setInterval(() => {
- // this.cont--;
- // if (this.cont == '0') {
- // if (flat) {
- // loading1.clear();
- // clearInterval(times);
- // that.$dialog
- // .alert({
- // message: '定位失败,请开启企微定位权限',
- // })
- // .then(() => {});
- // } else {
- // clearInterval(times);
- // }
- // }
- // }, 1000);
- // qiyeData = response.data.data;
- // wx.config({
- // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
- // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- // appId: qiyeData.appId, // 必填,企业微信的corpID
- // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
- // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
- // });
- // wx.ready(function () {
- // wx.getLocation({
- // type: 'gcj02',
- // success: function (res) {
- // flat = false;
- // loading1.clear();
- // that.buryingPoint({
- // systemModel: '高销额门店推荐',
- // buryingPointType: 3,
- // buryingPointValue: '进入地图',
- // buryingPointName: '高销额门店推荐',
- // buryingPointPosition: '进入地图',
- // });
- // that.$router.push({
- // path: '/rangeStore',
- // query: {
- // lat: '',
- // lon: '',
- // tabVal: 6,
- // },
- // });
- // },
- // fail: function () {
- // loading1.clear();
- // that.$dialog.alert({
- // message: 'GPS未开启',
- // });
- // },
- // });
- // });
- // wx.error(function (res) {
- // loading1.clear();
- // that.$dialog
- // .alert({
- // message: '定位失败,请开启企微定位权限',
- // })
- // .then(() => {});
- // });
- // }
- // });
- },
- //取消搜索
- cancelSearch() {
- this.$refs.item.toggle();
- },
- storeJoinVisit(val) {
- joinInPlan({ storeId: val.storeId }).then((res) => {
- if (res.code == 200) {
- this.onSearch();
- } else {
- this.$dialog.alert({
- title: '系统提示',
- message: res.msg,
- });
- }
- });
- },
- searchFn() {
- this.showPicker = true;
- this.CustomerName = '';
- },
- moreSearch() {
- this.onSearch();
- this.$refs.item.toggle();
- },
- getUserOutPlaList() {
- this.storeType = localStorage.getItem('storeType');
- this.customerVisits = localStorage.getItem('customerVisits');
- var that = this;
- let loading3 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- this.endShow = false;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- topStore({
- sortParam: this.sortParam,
- sortType: this.sortType,
- lat: that.lat || '',
- lon: that.lon || '',
- chainCode: this.chainCode,
- storeLabelTypes: this.storeLabelTypes.join(','),
- storeCategoryList: this.storeCategoryList,
- storeName: this.storeName.trim(),
- genDate: this.genDate,
- }).then((res) => {
- this.disabled = false;
- if (res.code == 200) {
- loading3.clear();
- this.loading = false;
- if (res.data.storeList != undefined) {
- this.list = res.data.storeList;
- this.showKM = res.data.coverUser;
- this.list.forEach((item) => {
- if (item.stateString.indexOf('拜访中') != -1) {
- this.endShow = true;
- this.visitEndId = item.visitId;
- return;
- }
- });
- res.data.storeList.forEach((item) => {
- this.showPopoverVNUM.push({ showPopover: false });
- this.showPopoverC.push({ showPopover: false });
- this.showPopoverZ.push({ showPopover: false });
- if (item.joinInPaln) {
- this.showAll = true;
- }
- });
- } else {
- this.list = [];
- }
- } else {
- loading3.clear();
- this.$dialog.alert({
- title: '系统提示',
- message: res.msg,
- });
- }
- });
- },
- storeVisit(val) {
- if (val.visitSource && val.visitSource == 2) {
- this.$toast('请先取消异常拜访后再进入正常拜访!');
- return;
- }
- localStorage.setItem('tabVal', this.tabVal);
- localStorage.removeItem('visitId');
- checkVisit({ storeId: val.storeId }).then((res) => {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: '进店拜访',
- buryingPointName: '进店拜访',
- buryingPointPosition: '高销额门店推荐',
- });
- if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
- if (localStorage.getItem('loginType') == 'cs') {
- var lat = '';
- var lon = '';
- if (val.lat == '' || val.lat == null) {
- lat = '31.2517820000';
- lon = '120.5593090000';
- } else {
- lat = val.lat;
- lon = val.lon;
- }
- this.$router.push({
- path: '/suishenbangOutstoreVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: lat,
- lon: lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: this.tabVal,
- visitModel: '1',
- latNew: '31.2517820000',
- lonNew: '120.5593090000',
- PointSum: 0,
- marklat: lat,
- marklon: lon,
- linkType: 6,
- from: 'topStore',
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- } else {
- if (this.flag) {
- this.flag = false;
- this.timer = null;
- let that = this;
- this.timer = setTimeout(() => {
- this.flag = true;
- }, 2000);
- if (val.stateString.indexOf('拜访中') != -1) {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- that.$router.push({
- path: '/suishenbangOutstoreVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: val.lat,
- lon: val.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- visitModel: '1',
- latNew: val.lat,
- lonNew: val.lon,
- PointSum: '0',
- marklat: val.lat,
- marklon: val.lon,
- linkType: 6,
- from: 'topStore',
- },
- });
- } else {
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- localStorage.setItem('lat', this.lat);
- localStorage.setItem('lon', this.lon);
- // var location = this.CJ02BD(res.latitude, res.longitude);
- this.checkStoreAddressByStoreCodeFun(val, TXisBD, resData);
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- // let loading1 = this.$toast.loading({
- // duration: 0,
- // message: '加载中...',
- // forbidClick: true,
- // });
- // let url = window.location.href;
- // let wx = this.wx;
- // let qiyeData;
- // const instance = axios.create();
- // instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- // instance
- // .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- // params: {
- // url: url,
- // },
- // })
- // .then((response) => {
- // if (response.status == 200) {
- // this.cont = 5;
- // var flat = true;
- // var times = setInterval(() => {
- // this.cont--;
- // if (this.cont == '0') {
- // if (flat) {
- // loading1.clear();
- // clearInterval(times);
- // that.$dialog
- // .alert({
- // message: '定位失败,请开启企微定位权限',
- // })
- // .then(() => {});
- // } else {
- // clearInterval(times);
- // }
- // }
- // }, 1000);
- // qiyeData = response.data.data;
- // wx.config({
- // beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
- // debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- // appId: qiyeData.appId, // 必填,企业微信的corpID
- // timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- // nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- // signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
- // jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
- // });
- // wx.ready(() => {
- // wx.getLocation({
- // type: 'gcj02',
- // success: (res) => {
- // flat = false;
- // // loading1.clear();
- // var location = that.CJ02BD(res.latitude, res.longitude);
- // checkStoreAddressByStoreCode({
- // storeCode: val.storeCode,
- // lon: location.lon,
- // lat: location.lat,
- // }).then((response) => {
- // loading1.clear();
- // if (val.lat == '' || val.lat == null) {
- // this.lat = location.lat;
- // this.lon = location.lon;
- // } else {
- // this.lat = val.lat;
- // this.lon = val.lon;
- // }
- // let PointSum = this.twoPointSum(
- // this.lat,
- // this.lon,
- // location.lat,
- // location.lon
- // ).toFixed(2);
- // let PointSumval = this.twoPointSum(
- // location.lat,
- // location.lon,
- // location.lat,
- // location.lon
- // ).toFixed(2);
- // // GZ:工装店铺 直接进入拜访
- // if (localStorage.getItem('postType') == 'GZ') {
- // localStorage.setItem('startTime', new Date());
- // localStorage.setItem('ORGName', val.deptName);
- // localStorage.setItem('chainNameR', val.storeName);
- // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- // return;
- // }
- // // 门店编码校验门店地址不通过
- // if (response.code != 200) {
- // // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- // if (response.data.updateAddress == 0) {
- // // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- // this.$dialog
- // .confirm({
- // confirmButtonText: '确定拜访',
- // cancelButtonText: '取消拜访',
- // title: '系统提示',
- // message:
- // '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
- // closeOnClickOverlay: true,
- // })
- // .then(() => {
- // this.toSuishenbangOutstoreVisit(
- // res,
- // val,
- // location,
- // PointSumval
- // );
- // });
- // } else if (response.data.updateAddress == 1) {
- // // 同城AB+金牌,去修改地址
- // // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
- // if (!response.data.addressUpdateTimesOver) {
- // this.$dialog
- // .confirm({
- // title: '系统提示',
- // message: response.msg + '请立即修改后再拜访',
- // messageAlign: 'left',
- // confirmButtonText: '立即修改',
- // cancelButtonText: '取消',
- // })
- // .then(() => {
- // this.$router.push({
- // path: '/storeDetail',
- // query: {
- // id: val.storeId,
- // type: 'address',
- // storeAddressId: val.storeAddressId,
- // },
- // });
- // });
- // } else {
- // this.$dialog.confirm({
- // title: '系统提示',
- // message: '已经达到最大修改次数',
- // messageAlign: 'left',
- // confirmButtonText: '确定',
- // });
- // }
- // } else if (response.data.updateAddress == 2) {
- // // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
- // this.resetCoord(res, val, location, PointSumval);
- // return;
- // }
- // } else {
- // // 门店编码校验门店地址通过 进入拜访
- // this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- // }
- // });
- // },
- // fail: function () {
- // loading1.clear();
- // that.$dialog.alert({
- // message: 'GPS未开启',
- // });
- // },
- // });
- // });
- // wx.error(function (error) {
- // loading1.clear();
- // that.$dialog
- // .alert({
- // message: '定位失败,请开启企微定位权限',
- // })
- // .then(() => {});
- // });
- // }
- // });
- }
- }
- }
- } else {
- this.$dialog.alert({
- title: '系统提示',
- message: res.msg,
- });
- }
- });
- },
- checkStoreAddressByStoreCodeFun(val, location, res) {
- checkStoreAddressByStoreCode({
- storeCode: val.storeCode,
- lon: location.lon,
- lat: location.lat,
- }).then((response) => {
- // loading1.clear();
- if (val.lat == '' || val.lat == null) {
- this.lat = location.lat;
- this.lon = location.lon;
- } else {
- this.lat = val.lat;
- this.lon = val.lon;
- }
- // let PointSum = this.twoPointSum(this.lat, this.lon, location.lat, location.lon).toFixed(2);
- let PointSumval = this.twoPointSum(
- location.lat,
- location.lon,
- location.lat,
- location.lon
- ).toFixed(2);
- // GZ:工装店铺 直接进入拜访
- if (localStorage.getItem('postType') == 'GZ') {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- return;
- }
- // 门店校验 地址不通过
- if (response.code != 200) {
- // updateAddress : ,1:同城AB+金牌,去修改地址;2:非金牌店铺,非同城店铺偏差过大不允许拜访,可以重置定位;0非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- if (response.data.updateAddress == 0) {
- // 非金牌店铺,非同城店铺 位置信息不存在 可以继续拜访
- this.$dialog
- .confirm({
- confirmButtonText: '确定拜访',
- cancelButtonText: '取消拜访',
- title: '系统提示',
- message:
- '该客户没有经纬度,此次拜访会保存定位点作为客户经纬度,下次拜访时判断是否偏差过大。',
- closeOnClickOverlay: true,
- })
- .then(() => {
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- });
- } else if (response.data.updateAddress == 1) {
- // 同城AB+金牌,去修改地址
- // addressUpdateTimesOver: true=已经达到最大次数,不让修改; false=没有达到可以修改
- if (!response.data.addressUpdateTimesOver) {
- this.$dialog
- .confirm({
- title: '系统提示',
- message: response.msg + '请立即修改后再拜访',
- messageAlign: 'left',
- confirmButtonText: '立即修改',
- cancelButtonText: '取消',
- })
- .then(() => {
- this.$router.push({
- path: '/storeDetail',
- query: {
- id: val.storeId,
- type: 'address',
- storeAddressId: val.storeAddressId,
- },
- });
- });
- } else {
- this.$dialog.confirm({
- title: '系统提示',
- message: '已经达到最大修改次数',
- messageAlign: 'left',
- confirmButtonText: '确定',
- });
- }
- } else if (response.data.updateAddress == 2) {
- // 1.非金牌店铺,非同城店铺 位置偏差过大 重置经纬度
- this.resetCoord(res, val, location, PointSumval);
- return;
- }
- } else {
- // 门店编码校验门店地址通过 进入拜访
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- }
- });
- },
- // 重置经纬度
- resetCoord(res, val, location, PointSumval) {
- this.$dialog
- .confirm({
- confirmButtonText: '初始化定位',
- cancelButtonText: '取消拜访',
- title: '系统提示',
- message: '偏差过大,不允许拜访。可修改本店定位.',
- closeOnClickOverlay: true,
- })
- .then(() => {
- mobileReposition({
- storeId: val.storeId,
- lat: location.lat,
- lon: location.lon,
- }).then((response) => {
- if (response.code == 200) {
- this.$dialog
- .alert({
- title: '系统提示',
- message: '本信息定位已更新成功!',
- })
- .then(() => {
- this.toSuishenbangOutstoreVisit(res, val, location, PointSumval);
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- } else {
- this.$toast(response.msg);
- }
- });
- });
- },
- // 进入拜访 router.push
- toSuishenbangOutstoreVisit(res, val, location, PointSumval) {
- addVisitsPosition({
- storeId: val.storeId,
- visitsId: '',
- lon: res.longitude,
- lat: res.latitude,
- sourceLon: location.lon,
- sourceLat: location.lat,
- positionDesc: '',
- accuracy: res.accuracy,
- });
- this.$router.push({
- path: '/suishenbangOutstoreVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: location.lat,
- lon: location.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: this.tabVal,
- visitModel: '1',
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSumval,
- marklat: res.latitude,
- marklon: res.longitude,
- from: 'topStore',
- },
- });
- },
- projectOutVisit(val) {
- localStorage.setItem('tabVal', this.tabVal);
- localStorage.removeItem('visitId');
- // checkVisit({storeId:val.storeId}).then(res=>{
- // if(res.code==200||val.stateString.indexOf("拜访中")!=-1){
- if (localStorage.getItem('loginType') == 'cs') {
- var lat = '';
- var lon = '';
- if (val.lat == '' || val.lat == null) {
- lat = '31.2517820000';
- lon = '120.5593090000';
- } else {
- lat = val.lat;
- lon = val.lon;
- }
- this.$router.push({
- path: '/storeGroup',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: lat,
- lon: lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: this.tabVal,
- visitModel: '1',
- latNew: '31.2517820000',
- lonNew: '120.5593090000',
- PointSum: 0,
- marklat: lat,
- marklon: lon,
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- } else {
- if (this.flag) {
- this.flag = false;
- this.timer = null;
- let that = this;
- this.timer = setTimeout(() => {
- this.flag = true;
- }, 2000);
- if (val.stateString.indexOf('拜访中') != -1) {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- that.$router.push({
- path: '/storeGroup',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: val.lat,
- lon: val.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- visitModel: '1',
- latNew: val.lat,
- lonNew: val.lon,
- PointSum: '0',
- marklat: val.lat,
- marklon: val.lon,
- },
- });
- } else {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- let url = window.location.href;
- let wx = this.wx;
- let qiyeData;
- const instance = axios.create();
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- instance
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- params: {
- url: url,
- },
- })
- .then((response) => {
- if (response.status == 200) {
- this.cont = 3;
- var flat = true;
- var times = setInterval(() => {
- this.cont--;
- if (this.cont == '0') {
- if (flat) {
- loading1.clear();
- clearInterval(times);
- that.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {});
- } else {
- clearInterval(times);
- }
- }
- }, 1000);
- qiyeData = response.data.data;
- wx.config({
- beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- appId: qiyeData.appId, // 必填,企业微信的corpID
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
- jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
- });
- wx.ready(function () {
- wx.getLocation({
- type: 'gcj02',
- success: function (res) {
- flat = false;
- loading1.clear();
- var location = that.CJ02BD(res.latitude, res.longitude);
- if (val.lat == '' || val.lat == null) {
- that.lat = location.lat;
- that.lon = location.lon;
- } else {
- that.lat = val.lat;
- that.lon = val.lon;
- }
- let PointSum = that
- .twoPointSum(that.lat, that.lon, location.lat, location.lon)
- .toFixed(2);
- if (val.lat == '' || val.lat == null) {
- if (localStorage.getItem('postType') != 'GZ') {
- that.$dialog
- .confirm({
- confirmButtonText: '确定拜访',
- cancelButtonText: '取消拜访',
- title: '系统提示',
- message:
- '该信息没有经纬度,此次拜访会保存定位点作为信息经纬度,下次拜访时判断是否偏差过大。',
- closeOnClickOverlay: true,
- })
- .then(() => {
- that.$router.push({
- path: '/storeGroup',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: that.lat,
- lon: that.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- contactName: val.contactName,
- hisTime: val.hisTime,
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- visitModel: '1',
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSum,
- marklat: res.latitude,
- marklon: res.longitude,
- },
- });
- });
- } else {
- that.$router.push({
- path: '/storeGroup',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: that.lat,
- lon: that.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- contactName: val.contactName,
- hisTime: val.hisTime,
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- visitModel: '1',
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSum,
- marklat: res.latitude,
- marklon: res.longitude,
- },
- });
- }
- } else {
- that.$router.push({
- path: '/storeGroup',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: that.lat,
- lon: that.lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- contactName: val.contactName,
- hisTime: val.hisTime,
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- visitModel: '1',
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSum,
- marklat: res.latitude,
- marklon: res.longitude,
- },
- });
- }
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- addVisitsPosition({
- storeId: val.storeId,
- visitsId: '',
- lon: res.longitude,
- lat: res.latitude,
- sourceLon: location.lon,
- sourceLat: location.lat,
- positionDesc: '',
- accuracy: res.accuracy,
- });
- },
- fail: function () {
- loading1.clear();
- that.$dialog.alert({
- message: 'GPS未开启',
- });
- },
- });
- });
- wx.error(function (res) {
- loading1.clear();
- that.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {});
- });
- }
- });
- }
- }
- }
- // }
- // })
- },
- abnormalVisit(val) {
- localStorage.removeItem('visitId');
- localStorage.setItem('tabVal', this.tabVal);
- checkVisit({ storeId: val.storeId }).then((res) => {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: val.storeName + '(' + val.storeCode + ')',
- buryingPointName: '异常拜访',
- buryingPointPosition: '高销额门店推荐',
- });
- if (res.code == 200 || val.stateString.indexOf('拜访中') != -1) {
- if (localStorage.getItem('loginType') == 'cs') {
- var lat = '';
- var lon = '';
- if (val.lat == '' || val.lat == null) {
- lat = '31.2517820000';
- lon = '120.5593090000';
- } else {
- lat = val.lat;
- lon = val.lon;
- }
- this.$router.push({
- path: '/outabnormalVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: lat,
- lon: lon,
- visitId: val.visitId,
- pageType: 'out',
- addressLine: val.addressLine,
- storeCategory: val.storeCategory,
- storeName: val.storeName,
- hisTime: val.hisTime,
- contactName: val.contactName,
- storeCode: val.storeCode,
- tabVal: this.tabVal,
- visitModel: '3',
- latNew: '31.2517820000',
- lonNew: '120.5593090000',
- PointSum: 0,
- marklat: lat,
- marklon: lon,
- linkType: 6,
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- } else {
- if (this.flag) {
- this.flag = false;
- this.timer = null;
- this.timer = setTimeout(() => {
- this.flag = true;
- }, 2000);
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- let url = window.location.href;
- let that = this;
- let wx = this.wx;
- let qiyeData;
- const instance = axios.create();
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- instance
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- params: {
- url: url,
- },
- })
- .then((response) => {
- if (response.status == 200) {
- this.cont = 3;
- var flat = true;
- var times = setInterval(() => {
- this.cont--;
- if (this.cont == '0') {
- if (flat) {
- loading1.clear();
- clearInterval(times);
- that.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {
- this.$router.go(-1);
- });
- } else {
- clearInterval(times);
- }
- }
- }, 1000);
- qiyeData = response.data.data;
- wx.config({
- beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- appId: qiyeData.appId, // 必填,企业微信的corpID
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
- jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
- });
- wx.ready(function () {
- wx.getLocation({
- type: 'gcj02',
- success: function (res) {
- flat = false;
- loading1.clear();
- var location = that.CJ02BD(res.latitude, res.longitude);
- if (val.lat == '' || val.lat == null) {
- that.lat = location.lat;
- that.lon = location.lon;
- } else {
- that.lat = val.lat;
- that.lon = val.lon;
- }
- let PointSum = that
- .twoPointSum(that.lat, that.lon, location.lat, location.lon)
- .toFixed(2);
- if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
- that.$dialog
- .confirm({
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- title: '系统提示',
- message: '定位距离偏差大',
- closeOnClickOverlay: true,
- })
- .then(() => {
- that.$router.push({
- path: '/outabnormalVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: that.lat,
- lon: that.lon,
- visitId: val.visitId,
- pageType: 'out',
- visitModel: '5',
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSum,
- marklat: res.latitude,
- marklon: res.longitude,
- linkType: 6,
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- })
- .catch(() => {
- // that.abnormalVisit(val)
- });
- } else {
- that.$router.push({
- path: '/outabnormalVisit',
- query: {
- storeId: val.storeId,
- rdId: val.rdId,
- lat: that.lat,
- lon: that.lon,
- visitId: val.visitId,
- pageType: 'out',
- visitModel: '3',
- storeCode: val.storeCode,
- tabVal: that.tabVal,
- latNew: location.lat,
- lonNew: location.lon,
- PointSum: PointSum,
- marklat: res.latitude,
- marklon: res.longitude,
- linkType: 6,
- },
- });
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- }
- addVisitsPosition({
- storeId: val.storeId,
- visitsId: '',
- lon: res.longitude,
- lat: res.latitude,
- sourceLon: location.lon,
- sourceLat: location.lat,
- positionDesc: '',
- accuracy: res.accuracy,
- });
- },
- fail: function () {
- loading1.clear();
- that.$dialog
- .alert({
- message: 'GPS未开启',
- })
- .then(() => {
- // that.abnormalVisit(val)
- });
- },
- });
- });
- wx.error(function (res) {
- loading1.clear();
- that.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {});
- });
- } else {
- loading1.clear();
- this.$toast.fail(dataList.msg);
- }
- });
- // this.$router.push({path: "/outabnormalVisit", query: {
- // storeId:"179792",
- // rdId:"null",
- // lat:"31.1882020000",
- // lon:"120.6801770000",
- // visitId:"null",
- // visitModel:"5",
- // storeCode:"0190141901",
- // tabVal:"0",
- // latNew:34.621855582632264,
- // lonNew:112.45382530736684,
- // PointSum:857246.44
- // }})
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', val.deptName);
- localStorage.setItem('chainNameR', val.storeName);
- }
- }
- } else {
- this.$dialog.alert({
- title: '系统提示',
- message: res.msg,
- });
- }
- });
- },
- visitFn(val) {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: val.storeName + '(' + val.storeCode + ')',
- buryingPointName: '客户信息',
- buryingPointPosition: '高销额门店推荐',
- });
- // designerStore 是否为设计师招募门店,true-是,false-否
- if (val.designerStore) {
- this.$router.push({
- path: '/addDesignerDetail',
- query: { id: val.storeId },
- });
- return;
- } else {
- this.$router.push({
- path: '/storeDetail',
- query: { id: val.storeId, detilId: 'a' },
- });
- }
- },
- // 大客户签约
- signAdd(val) {
- this.$router.push({
- path: '/sign',
- query: { id: val.storeId, detilId: 'a' },
- });
- },
- Visit(val) {
- this.$router.push({
- path: '/historicalDetails',
- query: {
- visitId: val.visitId,
- storeId: val.storeId,
- storeCode: val.storeCode,
- },
- });
- },
- onSearch() {
- window.scrollTo(0, 0);
- this.list = [];
- this.finished = true;
- this.cstype = this.$route.query.type;
- this.getPositionFn();
- if (this.lat != '') {
- this.onLoad();
- } else {
- let loading3 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- setTimeout(() => {
- loading3.clear();
- this.onLoad();
- }, 1000);
- }
- },
- getPositionFn() {
- var that = this;
- let url = window.location.href;
- let wx = this.wx;
- let qiyeData;
- const instance = axios.create();
- instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
- instance
- .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
- params: {
- url: url,
- },
- })
- .then((response) => {
- if (response.status == 200) {
- this.cont = 3;
- var flat = true;
- var times = setInterval(() => {
- this.cont--;
- if (this.cont == '0') {
- if (flat) {
- clearInterval(times);
- } else {
- clearInterval(times);
- }
- }
- }, 1000);
- qiyeData = response.data.data;
- wx.config({
- beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
- debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
- appId: qiyeData.appId, // 必填,企业微信的corpID
- timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
- nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
- signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
- jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
- });
- wx.ready(function () {
- wx.getLocation({
- type: 'gcj02',
- success: function (res) {
- flat = false;
- var location = that.CJ02BD(res.latitude, res.longitude);
- that.lat = location.lat;
- that.lon = location.lon;
- },
- });
- });
- }
- });
- },
- buryingPointFn(val) {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: val.telephone,
- buryingPointName: '点击电话',
- buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
- });
- },
- onSearchm() {
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.typeShow = false;
- } else {
- this.typeShow = true;
- }
- var StoreLabelsArr = [];
- for (var k = 0; k < this.storeLabelTypes.length; k++) {
- for (var k1 = 0; k1 < this.StoreLabels.length; k1++) {
- if (this.StoreLabels[k1].dictValue == this.storeLabelTypes[k]) {
- StoreLabelsArr.push(this.StoreLabels[k1].dictLabel);
- }
- }
- }
- var storeCategoryList = [];
- for (var q = 0; q < this.result.length; q++) {
- for (var q1 = 0; q1 < this.storeTypeLists.length; q1++) {
- if (this.storeTypeLists[q1].dictValue == this.result[q]) {
- storeCategoryList.push(this.storeTypeLists[q1].dictLabel);
- }
- }
- }
- if (this.storeLabelTypes.length > 0) {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: StoreLabelsArr.join(','),
- buryingPointName: '标签',
- buryingPointPosition: '客户信息筛选',
- });
- }
- if (this.storeCategoryList != '') {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: storeCategoryList.join(','),
- buryingPointName: '类型',
- buryingPointPosition: '客户信息筛选',
- });
- }
- if (this.chainName != '') {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: this.chainName,
- buryingPointName: '经销商筛选',
- buryingPointPosition: '客户信息筛选',
- });
- }
- if (this.storeName != '') {
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: this.storeName,
- buryingPointName: '搜索名称/编号/地址',
- buryingPointPosition: '客户信息筛选',
- });
- }
- var sortParam = '';
- if (this.sortParam == 'sales') {
- sortParam = '销量';
- } else if (this.sortParam == 'visitTime') {
- sortParam = '拜访时间';
- } else {
- sortParam = '下单时间';
- }
- var sortType = '';
- if (this.sortType == 'desc') {
- sortType = '正序';
- } else {
- sortType = '倒叙';
- }
- this.buryingPoint({
- systemModel: '高销额门店推荐',
- buryingPointType: 1,
- buryingPointValue: sortType,
- buryingPointName: sortParam,
- buryingPointPosition: '客户信息筛选',
- });
- localStorage.setItem('outvstoreName', this.storeName);
- localStorage.setItem('outvchainName', this.chainName);
- localStorage.setItem('outvstoreLabelTypes', this.storeLabelTypes);
- localStorage.setItem('outvstoreCategoryList', this.result);
- localStorage.setItem('outvchainCode', this.chainCode);
- localStorage.setItem('outvchainCode', this.chainCode);
- localStorage.setItem('outvsortType', this.sortType);
- localStorage.setItem('outsortParam', this.sortParam);
- this.onSearch();
- },
- tabChange(name) {
- window.scrollTo(0, 0);
- this.finished = true;
- this.disabled = true;
- this.list = [];
- this.tabVal = name;
- this.onLoad();
- },
- onLoad() {
- // 授权
- getTicketFun().then(() => {
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.typeShow = false;
- } else {
- this.typeShow = true;
- }
- this.getUserOutPlaList();
- });
- },
- onLoadlong() {
- this.list = [];
- this.getUserOutPlaList();
- },
- },
- };
- </script>
- <style lang="scss">
- .van-dialog__confirm,
- .van-dialog__confirm:active {
- color: #0057ba;
- }
- .searchDiv {
- .van-search {
- background: #fff;
- }
- .van-search__action {
- font-size: 14px;
- color: #0057ba;
- font-weight: bold;
- background: #f1f1f1;
- border-bottom-right-radius: 60px;
- border-top-right-radius: 60px;
- border: 1px solid #ccc;
- padding: 0 20px;
- }
- .van-search--show-action {
- padding-right: 12px;
- }
- .van-search__content {
- border: 1px solid #ccc;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- background: #f1f1f1;
- border-right: 0;
- }
- }
- .myTab {
- .van-tabs__nav--card {
- margin: 0 !important;
- border-left: 0;
- border-right: 0;
- }
- .van-tabs__wrap,
- .van-tabs__nav--card {
- height: 39px;
- }
- .van-tab {
- line-height: 40px;
- }
- }
- .myList {
- .van-cell {
- padding: 0;
- &:after {
- border-bottom: none;
- }
- }
- }
- .searchDivcs .van-search__content {
- border-bottom-left-radius: 6px;
- border-top-left-radius: 6px;
- }
- .searchDivcs .van-search__action {
- border-bottom-right-radius: 6px;
- border-top-right-radius: 6px;
- }
- </style>
- <style lang="scss" scoped>
- .bgcolor {
- background-color: #f5f5f5;
- }
- .container {
- padding-bottom: 50px;
- }
- .card {
- padding: 10px 16px;
- box-sizing: border-box;
- }
- .card .title {
- font-size: 15px;
- font-weight: bold;
- color: #333;
- line-height: 22px;
- padding-right: 52px;
- .JPABC {
- width: 20px;
- position: relative;
- top: 4px;
- margin-right: 3px;
- }
- .statusIcon {
- padding: 3px;
- font-size: 12px;
- margin: 0 3px;
- color: #fff;
- display: inline-block;
- height: 20px;
- line-height: 16px;
- vertical-align: -1px;
- }
- .submit {
- background: #ffba13;
- }
- .noSubmit {
- background: #f11818;
- }
- }
- .card .info {
- font-size: 14px;
- color: #909090;
- line-height: 26px;
- }
- .btnbox {
- padding-top: 14px;
- border-top: 1px solid #eee;
- margin: 0 10px;
- }
- .navBarTOP {
- position: fixed;
- width: 100%;
- z-index: 2;
- top: 0;
- }
- .cellcontent .centerBtn {
- margin: 0 auto 10px;
- display: block;
- width: 92%;
- color: #0057ba;
- border-radius: 5px;
- padding: 0 2px;
- }
- .cellcontent .centerBtn1 {
- background-color: #0057ba;
- color: #fff;
- border-color: #0057ba;
- }
- .cellcontent .centerBtn2 {
- margin: 0 auto 10px;
- display: block;
- width: 92%;
- color: #0057ba;
- border-radius: 5px;
- padding: 0;
- }
- .statstext {
- background-color: #0057ba;
- position: absolute;
- right: 0;
- top: 6px;
- padding: 2px 6px 2px 12px;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- color: #fff;
- }
- .cellcontent .van-cell {
- padding: 10px 0;
- }
- .statstext .van-icon__image {
- height: 0.7em;
- }
- .tipsTitle {
- padding: 5px 0;
- text-align: center;
- font-size: 16px;
- font-weight: 600;
- }
- </style>
- <style lang="scss">
- .zpover99 {
- background-color: #00afff !important;
- }
- .van-tabs__nav--card .van-tab.van-tab--active {
- background-color: #0057ba !important;
- }
- .visitSearch {
- width: 68px;
- color: #0057ba;
- font-size: 14px;
- }
- .visitSearch .van-dropdown-menu__bar {
- box-shadow: 0 0 0 #fff;
- height: 52px;
- }
- .visitSearch .van-dropdown-menu__item {
- justify-content: normal;
- }
- .visitSearch .van-dropdown-menu__title {
- border-left: 1px solid #ccc;
- }
- .visitSearch .van-cell {
- border: 1px solid #ccc;
- border-radius: 5px;
- padding: 6px;
- }
- .positionContent {
- position: fixed;
- color: #666;
- display: inline-block;
- box-shadow: 0px 2px 7px -5px #000;
- border-radius: 100px;
- overflow: hidden;
- right: 14px;
- cursor: pointer;
- bottom: 96px;
- background-color: white;
- }
- .positionContent .img {
- border-radius: 100px;
- float: left;
- }
- .positionContent .img .van-icon__image {
- border-radius: 100px;
- }
- .zDialog .van-dialog__header {
- padding: 10px;
- border-bottom: 1px solid #f5f5f5;
- }
- .zDialog .infoText {
- margin: 10px;
- font-size: 14px;
- color: #909090;
- width: 98%;
- }
- .visitStoreIco {
- float: left;
- float: left;
- width: 26px;
- text-align: center;
- background-color: #ffba13;
- color: #fff;
- border-radius: 100%;
- margin-left: 14px;
- line-height: 26px;
- height: 26px;
- }
- .searchcheck {
- padding: 0 10px 10px;
- }
- .searchcheck .van-checkbox {
- /*width: 44%;*/
- padding-bottom: 10px;
- }
- .searchcheck .checkbox {
- font-size: 14px;
- display: inline-block;
- width: 50%;
- line-height: 28px;
- }
- .searchcheck .checkbox .van-checkbox {
- margin-bottom: 2px;
- }
- .searchcheck .checkbox1 {
- font-size: 14px;
- float: left;
- line-height: 28px;
- width: 50%;
- }
- .searchcheck .checkbox1 .child {
- width: 100%;
- }
- .searchcheck {
- height: 93vh;
- overflow-y: auto;
- }
- .searchchecktitle {
- width: 100%;
- margin: 20px 0;
- font-size: 16px;
- border-left: 3px solid #0057ba;
- line-height: 18px;
- }
- .textsize {
- font-size: 14px;
- }
- .visitStoreIcos {
- /*background: url("./../../assets/order1.png") center;*/
- }
- .topStore {
- .JPVisitNum {
- position: relative;
- top: -26px;
- font-size: 10px;
- }
- .TCFXListItem {
- display: inline-block;
- border: 1px solid #ccc;
- padding: 3px 5px;
- margin: 0 5px;
- border-radius: 6px;
- }
- }
- </style>
|