| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700 |
- <template>
- <div class="bgcolor deviceOutside">
- <div class="navBarTOP">
- <!-- 顶部条-->
- <van-nav-bar class="navBar" title="计划外">
- <template #right>
- <span @click="searchFn">筛选<van-icon name="arrow-down" /></span>
- </template>
- </van-nav-bar>
- <div class="searchDiv">
- <van-search
- v-model="storeName"
- left-icon="search"
- show-action
- placeholder="搜索名称/编号/地址"
- @clear="clearFn">
- <template #action>
- <div @click="onSearchm">搜索</div>
- </template>
- </van-search>
- </div>
- <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
- <van-tab title="销售部" name="0" :disabled="disabled"></van-tab>
- <van-tab title="我的" name="1" :disabled="disabled"></van-tab>
- </van-tabs>
- </div>
- <!-- 主体内容-->
- <div class="container" style="margin-top: 144px">
- <van-list
- class="myList"
- v-model="loading"
- :finished="finished"
- finished-text="--已经到底了--"
- @load="onLoad">
- <div class="cellcontent" v-for="(item, index) in list" :key="index">
- <van-cell>
- <div class="card">
- <div class="title titlero">
- <span
- @click="goOtherSystem(item)"
- style="color: #0057ba; text-decoration: underline">
- <span>{{ item.storeName }}</span>
- (<span>{{ item.storeCode }}</span
- >)
- </span>
- <span class="btn" :data-clipboard-text="item.storeCode">
- <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 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"
- 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 zpover5"
- 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="调色机5天未联网">
- <div
- v-if="item.storeLabels.ccmOffline"
- 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="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="金牌店近30天未下单">
- <div
- v-if="item.storeLabels.noOrder"
- class="visitStoreIco"
- style="background-color: #fff"
- slot="reference">
- <van-icon :name="order" 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"
- :disabled="!item.userVisitTimesMap"
- trigger="click">
- <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>
- <van-icon :name="ordernum" size="26" />
- </div>
- <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">
- 类型:{{ item.storeCategory }}
- <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" v-if="item.telephone" @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 }}
- <img
- v-if="item.storeLonExist"
- style="width: 36px"
- :src="sbpmdh"
- @click="linkapp(item)" />
- </div>
- <!-- 分销店 -->
- <template v-if="item.sfaStoreType && item.sfaStoreType.type == 'fxd'">
- <div class="info" v-if="typeShow">
- 经销商:
- <template
- v-if="item.sfaStoreChainsContactList"
- v-for="(item, index) in item.sfaStoreChainsContactList">
- <el-popover
- popper-class="zpover zpover6"
- placement="bottom-start"
- trigger="click">
- <div>
- {{ item.chainName }}
- </div>
- <span class="TCFXListItem" :key="index">{{ item.categoryDescribe }}</span>
- </el-popover>
- </template>
- </div>
- </template>
- <template v-else>
- <div class="info" v-if="typeShow">经销商:{{ item.chainName }}</div>
- </template>
- <!-- storeLonExist 门店是否存在经纬度 字段false=不显示导航和距离,true=显示 -->
- <div class="info" v-if="item.storeLonExist">
- 距离:{{ Micrometer(item.distance) }}m
- </div>
- </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-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; height: 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; width: 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="tabVal == 1" @click="storeJoinVisit(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-empty v-if="list.length == 0" />
- </van-list>
- <br />
- <br />
- <br />
- <br />
- <br />
- </div>
- <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>
- <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-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">
- <van-checkbox :name="item.dictValue">{{ item.dictLabel }}</van-checkbox>
- </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>
- <tab-bar tabBarActive="outsidelist"></tab-bar>
- <div class="positionContent" @click="rangeStoreFn()" v-if="mapShows">
- <van-icon class="img" :name="mpimg" size="50" />
- </div>
- </div>
- </template>
- <script>
- import tabBar from '@/components/tabBar';
- import {
- getUserOutPlaList,
- getUserOrgStoreList,
- stopVisit,
- checkVisit,
- addVisitsPosition,
- mobileReposition,
- getStoreyslTypeList,
- getStoreTypeListlp,
- joinInPlan,
- getStoreLabels,
- getCustomerList,
- buryingPoint,
- ProductItemImge,
- } 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 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 ordernum from '@/assets/ordernum.png';
- import sbpmdh from '@/assets/sbpmdh.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 } from '@/api/inventory';
- import { checkStoreAddressByStoreCode } from '@/api/visitstore';
- import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
- export default {
- name: 'outsidelist',
- components: { tabBar, mapmarker },
- data() {
- return {
- yichang: yichang,
- xmgj: xmgj,
- bfxx: bfxx,
- xiadan: xiadan,
- kehuxinxi: kehuxinxi,
- jiarujihua: jiarujihua,
- call: call,
- times: times,
- searchShows: false,
- paste: paste,
- visitTimess: visitTimes,
- sbpmdh: sbpmdh,
- ordernum: ordernum,
- typeShow: false,
- mpimg: mpimg,
- order: order,
- ord: ord,
- mapShow: false,
- otherShow: false,
- Network: Network,
- order60: order60,
- targetOne: targetOne,
- chainName: '',
- chainCode: '',
- mapShows: false,
- activeNames: '1',
- showPopover: false,
- moreTypeShow: false,
- showPopoverVNUM: [],
- showPopoverC: [],
- showPopoverZ: [],
- zyssl: [],
- chtczj: [],
- noVisit: [],
- noOrder: [],
- fxNoOrder: [],
- storeLabelTypes: [],
- // showPopover:false,
- location: location,
- timeico: timeico,
- disabled: false,
- timer: null,
- flag: true,
- show: false,
- tabVal: '1',
- list: [],
- cont: 0,
- loading: false,
- showPicker: false,
- finished: false,
- otherbqShow: true,
- otherkkdShow: true,
- otherfxdShow: true,
- otherfxdShow2: true,
- otherfxdShow1: true,
- typeName: '搜索',
- visitEndId: '',
- pageSize: 12,
- pageNum: 1,
- listActive: null,
- query: '',
- storeName: '',
- genDate: '',
- storeType: '',
- endShow: false,
- storeCategory: '',
- fromValue: {},
- storeTypeList: [],
- storeTypeLists: [],
- chainsData: [],
- serachstype: '',
- addShow1: false,
- storeCategoryList: '',
- result: [],
- StoreLabels: [],
- CustomerName: '',
- lat: '',
- lon: '',
- timeData: '',
- customerVisits: true,
- };
- },
- watch: {
- $route(to, from) {
- this.storeName = localStorage.getItem('outvstoreName');
- this.chainName = localStorage.getItem('outvchainName');
- if (localStorage.getItem('lat') != null) {
- this.lat = localStorage.getItem('lat');
- this.lon = localStorage.getItem('lon');
- } else {
- this.lat = '';
- this.lon = '';
- }
- 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.storeLabelTypes = [];
- this.storeCategoryList = this.result.join(',');
- } else {
- this.result = [];
- this.storeCategoryList = this.result.join(',');
- }
- this.chainCode = localStorage.getItem('outvchainCode');
- this.storeName = localStorage.getItem('outvstoreName');
- if (
- (from.path == '/My/index' && to.path == '/outsidelist/index') ||
- (from.path == '/home' && to.path == '/outsidelist/index') ||
- (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
- (from.path == '/storemanagement/index' && to.path == '/outsidelist/index')
- ) {
- this.tabVal = '1';
- } else {
- if (localStorage.getItem('tabVal') != null) {
- this.tabVal = localStorage.getItem('tabVal');
- }
- }
- if (
- (from.path == '/storeDetail' && to.path == '/outsidelist/index') ||
- (from.path == '/storeGroup' && to.path == '/outsidelist/index') ||
- (from.path == '/suishenbangOutstoreVisit' && to.path == '/outsidelist/index') ||
- (from.path == '/outabnormalVisit' && to.path == '/outsidelist/index') ||
- (from.path == '/home' && to.path == '/outsidelist/index') ||
- (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
- (from.path == '/storemanagement/index' && to.path == '/outsidelist/index') ||
- (from.path == '/My/index' && to.path == '/outsidelist/index')
- ) {
- this.onSearch();
- }
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.addShow1 = false;
- this.otherShow = true;
- } else {
- this.addShow1 = true;
- this.otherShow = false;
- }
- if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
- this.mapShows = false;
- } else {
- this.mapShows = true;
- }
- this.getMonth();
- },
- },
- created() {
- 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');
- if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
- if (this.$route.query.info != undefined) {
- if (this.$route.query.info.indexOf('y') != -1) {
- this.tabVal = localStorage.getItem('tabVal');
- } else {
- this.tabVal = '1';
- }
- } else {
- this.tabVal = '1';
- }
- } else {
- this.tabVal = localStorage.getItem('tabVal');
- }
- if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
- this.mapShows = false;
- } else {
- this.mapShows = true;
- }
- this.query = this.$route.query;
- localStorage.removeItem('visitId');
- this.getStoreTypeList();
- this.getStoreLabels();
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.addShow1 = false;
- this.otherShow = true;
- } else {
- this.addShow1 = true;
- this.otherShow = false;
- }
- this.getMonth();
- },
- methods: {
- clearFn() {
- this.storeName = '';
- localStorage.setItem('outvstoreName', '');
- },
- 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.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", "invoke"]
- // });
- // wx.ready(function() {
- // wx.checkJsApi({
- // jsApiList: ["agentConfig", "launchMiniprogram"], // 需要检测的JS接口列表
- // success: function(res) {}})})
- 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('版本过低请升级');
- }
- },
- });
- }
- });
- },
- orderFn(val) {
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.storeName + '(' + val.storeCode + ')',
- buryingPointName: '去下单',
- buryingPointPosition: this.tabVal == 1 ? '我的' : '销售部',
- });
- getOrderUrlByStoreId({
- storeId: val.storeId,
- from: 'outPlan',
- }).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.storeCode, detilId: 'a' },
- });
- },
- 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);
- }
- } else {
- this.$toast(res.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;
- }
- },
- 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;
- });
- },
- buryingPointFn(val) {
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.telephone,
- buryingPointName: '点击电话',
- buryingPointPosition: val.storeName + '(' + val.storeCode + ')',
- });
- },
- // 范围
- rangeStoreFn() {
- localStorage.setItem('tabVal', this.tabVal);
- getPosition()
- .then((res) => {
- let { TXisBD } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- let name = this.tabVal != 1 ? '销售部' : '我的';
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 3,
- buryingPointValue: name,
- buryingPointName: '计划外',
- buryingPointPosition: '进入地图',
- });
- this.$router.push({
- path: '/rangeStore',
- query: {
- lat: '',
- lon: '',
- tabVal: this.tabVal,
- },
- });
- })
- .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 = 5;
- // var flat = true;
- // var times = setInterval(() => {
- // this.cont--;
- // if (this.cont == '0') {
- // if (flat) {
- // loading1.clear();
- // clearInterval(times);
- // that.$dialog.alert({
- // message: '定位失败,请开启企微定位权限',
- // });
- // } 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 name = '我的';
- // if (that.tabVal != 1) {
- // name = '销售部';
- // }
- // that.buryingPoint({
- // systemModel: '计划外',
- // buryingPointType: 3,
- // buryingPointValue: name,
- // buryingPointName: '计划外',
- // buryingPointPosition: '进入地图',
- // });
- // that.$router.push({
- // path: '/rangeStore',
- // query: {
- // lat: '',
- // lon: '',
- // tabVal: that.tabVal,
- // },
- // });
- // },
- // fail: function () {
- // loading1.clear();
- // that.$dialog.alert({
- // message: 'GPS未开启',
- // });
- // },
- // });
- // });
- // wx.error(function (res) {
- // loading1.clear();
- // that.$dialog.alert({
- // message: '定位失败,请开启企微定位权限',
- // });
- // });
- // }
- // });
- },
- //取消搜索
- 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();
- },
- getUserOrgStoreList() {
- this.storeType = localStorage.getItem('storeType');
- this.endShow = false;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- var that = this;
- this.disabled = true;
- let loading2 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- getUserOrgStoreList({
- lat: that.lat,
- lon: that.lon,
- chainCode: this.chainCode ? this.chainCode : '',
- storeLabelTypes: this.storeLabelTypes.join(','),
- pageNum: this.pageNum,
- storeCategoryList: this.storeCategoryList,
- pageSize: this.pageSize,
- storeName: this.storeName.trim(),
- genDate: this.genDate,
- }).then((res) => {
- this.disabled = false;
- if (res.code == 200) {
- loading2.clear();
- this.loading = false;
- if (this.pageNum == '1') {
- this.list = [];
- }
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- this.list.forEach((item) => {
- if (item.stateString.indexOf('拜访中') != -1) {
- this.endShow = true;
- this.visitEndId = item.visitId;
- return;
- }
- });
- res.rows.forEach((item) => {
- this.showPopoverVNUM.push({ showPopover: false });
- this.showPopoverC.push({ showPopover: false });
- this.showPopoverZ.push({ showPopover: false });
- });
- } else {
- this.$toast(res.msg);
- }
- });
- },
- positionFn(val) {
- getPosition(true)
- .then((res) => {
- let { TXisBD } = res;
- this.lat = TXisBD.lat;
- this.lon = TXisBD.lon;
- if (val == 1) {
- if (this.tabVal == 1) {
- this.getUserOutPlaListFun();
- } else {
- this.getUserOrgStoreList();
- }
- } else {
- this.getUserOutPlaListFun();
- }
- })
- .catch((error) => {
- this.$dialog.alert({
- message: error,
- });
- });
- // // 本地开发 test 环境时 时跳过获取定位功能
- // if (process.env.NODE_ENV === 'test') {
- // this.lat = 34.62188103091605;
- // this.lon = 112.45364302095416;
- // localStorage.setItem('lat', this.lat);
- // localStorage.setItem('lon', this.lon);
- // if (this.tabVal == 1) {
- // this.getUserOutPlaListFun();
- // } else {
- // this.getUserOrgStoreList();
- // }
- // return;
- // }
- // var that = this;
- // let url = window.location.href;
- // let wx = this.wx;
- // let loadingmap = this.$toast.loading({
- // duration: 0,
- // message: '定位中...',
- // forbidClick: true,
- // });
- // 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) => {
- // console.log('url=' + url);
- // loadingmap.clear();
- // if (response.status == 200) {
- // this.cont = 5;
- // var flat = true;
- // var times = setInterval(() => {
- // this.cont--;
- // if (this.cont == '0') {
- // if (flat) {
- // clearInterval(times);
- // if (val == 1) {
- // that.$dialog.alert({
- // message: '定位失败,请开启企微定位权限',
- // });
- // }
- // loadingmap.clear();
- // } 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;
- // loadingmap.clear();
- // console.log('处理前');
- // console.log(res.latitude, res.longitude);
- // var location = that.CJ02BD(res.latitude, res.longitude);
- // console.log('处理后');
- // console.log(location);
- // that.lat = location.lat;
- // that.lon = location.lon;
- // localStorage.setItem('lat', location.lat);
- // localStorage.setItem('lon', location.lon);
- // if (val == 1) {
- // if (that.tabVal == 1) {
- // that.getUserOutPlaListFun();
- // } else {
- // that.getUserOrgStoreList();
- // }
- // } else {
- // that.getUserOutPlaListFun();
- // }
- // },
- // fail: function () {
- // loadingmap.clear();
- // if (val == 1) {
- // that.$dialog.alert({
- // message: 'GPS未开启',
- // });
- // }
- // },
- // });
- // });
- // wx.error(function (res) {
- // loadingmap.clear();
- // if (val == 1) {
- // that.$dialog.alert({
- // message: '定位失败,请开启企微定位权限',
- // });
- // }
- // });
- // }
- // });
- },
- getUserOutPlaListFun() {
- this.storeType = localStorage.getItem('storeType');
- var that = this;
- this.disabled = true;
- let loading3 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- this.endShow = false;
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- getUserOutPlaList({
- lat: that.lat,
- lon: that.lon,
- chainCode: this.chainCode ? this.chainCode : '',
- storeLabelTypes: this.storeLabelTypes.join(','),
- pageNum: this.pageNum,
- storeCategoryList: this.storeCategoryList,
- pageSize: this.pageSize,
- storeName: this.storeName.trim(),
- genDate: this.genDate,
- }).then((res) => {
- this.disabled = false;
- if (res.code == 200) {
- loading3.clear();
- this.loading = false;
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- this.list.forEach((item) => {
- if (item.stateString.indexOf('拜访中') != -1) {
- this.endShow = true;
- this.visitEndId = item.visitId;
- return;
- }
- });
- res.rows.forEach(() => {
- this.showPopoverVNUM.push({ showPopover: false });
- this.showPopoverC.push({ showPopover: false });
- this.showPopoverZ.push({ showPopover: false });
- });
- } else {
- this.$toast(res.msg);
- }
- });
- },
- // 获取当前定位数据
- getLocationFun() {
- return new Promise((resolve, reject) => {
- let url = window.location.href;
- // let url = "https://ssbsfatest.nipponpaint.com.cn/mobile"
- 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) {
- clearInterval(times);
- this.$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;
- var location = this.CJ02BD(res.latitude, res.longitude);
- resolve({ location, res });
- },
- fail: () => {
- this.$dialog.alert({
- message: 'GPS未开启',
- });
- reject('GPS未开启');
- },
- });
- });
- wx.error(() => {
- this.$dialog
- .alert({
- message: '定位失败,请开启企微定位权限',
- })
- .then(() => {});
- reject('定位失败,请开启企微定位权限');
- });
- }
- });
- });
- },
- storeVisit(val) {
- localStorage.setItem('tabVal', this.tabVal);
- localStorage.removeItem('visitId');
- checkVisit({ storeId: val.storeId }).then((res) => {
- if (this.tabVal == 1) {
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: val.storeName + '(' + val.storeCode + ')',
- buryingPointName: '进店拜访',
- buryingPointPosition: '我的',
- });
- } else {
- 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: '/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,
- from: 'outPlan',
- },
- });
- 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,
- from: 'outPlan',
- },
- });
- } 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,
- });
- });
- }
- }
- }
- } else {
- this.$dialog.alert({
- 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: 'outPlan',
- },
- });
- },
- 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: this.tabVal == 1 ? '我的' : '销售部',
- });
- 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,
- },
- });
- 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,
- },
- });
- 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,
- },
- });
- 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: this.tabVal == 1 ? '我的' : '销售部',
- });
- 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,
- },
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- onSearch() {
- window.scrollTo(0, 0);
- this.pageNum = 1;
- this.list = [];
- this.finished = true;
- var postType = localStorage.getItem('postType');
- this.customerVisits = localStorage.getItem('customerVisits');
- if (postType == 'GZ') {
- this.typeShow = false;
- } else {
- this.typeShow = true;
- }
- this.onLoad();
- },
- 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.tabVal == 1) {
- if (this.storeLabelTypes.length > 0) {
- this.buryingPoint({
- systemModel: '计划外',
- buryingPointType: 1,
- buryingPointValue: StoreLabelsArr.join(','),
- buryingPointName: '标签',
- buryingPointPosition: '我的筛选',
- });
- }
- if (this.storeCategoryList.length > 0) {
- 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: '我的筛选',
- });
- }
- } else {
- 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: '销售部的门店筛选',
- });
- }
- }
- 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);
- this.onSearch();
- },
- tabChange(name) {
- window.scrollTo(0, 0);
- this.finished = true;
- this.pageNum = 1;
- this.list = [];
- this.tabVal = name;
- localStorage.setItem('tabVal', name);
- this.onLoad();
- },
- // 滚动条与底部距离小于 offset 时触发 初始化会触发
- onLoad() {
- // 授权
- getTicketFun().then(() => {
- var postType = localStorage.getItem('postType');
- if (postType == 'GZ') {
- this.typeShow = false;
- } else {
- this.typeShow = true;
- }
- if (this.lon == '' && this.tabVal != 1) {
- this.positionFn(1);
- } else {
- if (this.tabVal == 1) {
- this.positionFn();
- // this.getUserOutPlaListFun();
- } else {
- this.getUserOrgStoreList();
- }
- }
- });
- },
- // 跳转好帮手门店详情
- goOtherSystem(item) {
- if (item.storeCode) {
- window.location.href =
- process.env.VUE_APP_SSB_LINK + '/order/storeDetail/index?shopCode=' + item.storeCode;
- } else {
- this.$dialog.alert({
- message: '缺少门店code',
- });
- }
- },
- },
- };
- </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;
- }
- }
- }
- </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;
- .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>
- .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;
- }
- .searchchecktitle1 {
- width: 100%;
- margin: 20px 0;
- font-size: 16px;
- line-height: 18px;
- }
- .textsize {
- font-size: 14px;
- }
- .deviceOutside {
- .TCFXListItem {
- display: inline-block;
- border: 1px solid #ccc;
- padding: 3px 5px;
- margin: 0 5px;
- }
- }
- </style>
|