| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019 |
- <template>
- <div>
- <div class="navBarTOP">
- <!-- 顶部条-->
- <van-nav-bar
- class="navBar"
- title="新增信息"
- left-arrow
- @click-left="onClickLeft"
- :right-text="
- fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131'
- ? '去下单'
- : '保存'
- "
- @click-right="onSubmit" />
- </div>
- <!-- 主体内容-->
- <div style="margin-top: 44px">
- <van-dialog v-model="show" title="位置">
- <mapmarker :info="fromValue"></mapmarker>
- </van-dialog>
- <van-form ref="tabstoreVal" @submit="onSubmit">
- <van-tabs class="myTab" v-model="tabVal" color="#1989fa" @change="tabChange">
- <van-tab title="基础信息" name="insidePlan">
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.storeCategoryName"
- label="类型"
- placeholder="点击选择类型"
- @click="showPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.orgName"
- label="部门名称"
- placeholder="点击选择部门名称"
- @click="PickerDept">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <div style="background-color: white; padding: 0 14px" class="morelaji">
- <van-row
- v-if="fromValue.storeCategory != 'C917'"
- style="border-bottom: 1px solid #ebedf0">
- <van-col span="20">
- <van-field
- rows="1"
- autosize
- type="textarea"
- readonly
- clickable
- name="picker"
- :value="fromValue.chainName"
- label="经销商名称"
- placeholder="点击选择经销商名称"
- @click="showPickerChainsListFn">
- <template #left-icon>
- <span
- v-if="
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C912' &&
- fromValue.storeCategory != 'C917'
- "
- class="van-f-red"
- >*</span
- >
- </template>
- </van-field>
- </van-col>
- <van-col span="4"
- ><van-button
- size="small"
- type="info"
- style="margin-top: 6px"
- native-type="button"
- @click="moreTypeShowfn"
- ><van-icon name="list-switching" />更多</van-button
- ></van-col
- >
- </van-row>
- </div>
- <van-field
- v-model="fromValue.storeName"
- @blur="setStoreNameFn"
- :label="storeName"
- placeholder="请输入">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.provinceName"
- label="省(州)"
- placeholder="点击选择省(州)"
- @click="showProvincePicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.cityName"
- label="城市"
- placeholder="点击选择城市"
- @click="showCityPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.districtName"
- label="区(县)"
- placeholder="点击选择区(县)"
- @click="showDistrictPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.townName"
- label="街道"
- placeholder="点击选择街道"
- @click="showTownPicker = true">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- v-model="fromValue.addressLine"
- label="地址"
- placeholder="地址"
- rows="1"
- autosize
- type="textarea"
- @blur="addressFn">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- <template #button>
- <van-button size="small" native-type="button" type="info" @click="fns"
- ><van-icon name="location-o" />地图</van-button
- >
- </template>
- </van-field>
- <van-field
- readonly
- clickable
- name="picker"
- :value="fromValue.cityLevel"
- label="城市等级"
- placeholder="点击选择城市等级"
- ><template #left-icon><span class="van-f-red"> </span></template>
- </van-field>
- <div v-if="fromValue.storeCategory != 'C917'">
- <van-field
- v-if="fromValue.ifJzStoreType != 1"
- v-model="fromValue.area"
- @input="numberFn"
- type="number"
- label="面积(m²)"
- placeholder="面积"
- ><template #left-icon><span class="van-f-red"> </span></template
- ></van-field>
- <van-field
- v-if="fromValue.ifJzStoreType == 1"
- v-model="fromValue.area"
- @input="numberFn"
- type="number"
- label="家装展厅面积(m²)"
- placeholder="面积">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- </div>
- <van-field
- v-if="fromValue.ifJzStoreType != 1 && fromValue.storeCategory != 'C917'"
- v-model="fromValue.contactName"
- label="联系人"
- placeholder="联系人">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field
- v-if="fromValue.ifJzStoreType == 1 && fromValue.storeCategory != 'C917'"
- v-model="fromValue.contactName"
- label="老板"
- placeholder="老板"
- ><template #left-icon><span class="van-f-red"> </span></template
- ></van-field>
- <van-field
- v-if="fromValue.storeCategory != 'C917'"
- type="tel"
- v-model="fromValue.telephone"
- label="联系电话"
- placeholder="联系电话"
- @blur="phoneCheck">
- <template #left-icon>
- <span class="van-f-red" v-if="fromValue.ifJzStoreType != 1">*</span>
- </template>
- </van-field>
- <van-field readonly v-model="fromValue.salesmanName" label="销售员" placeholder="销售员"
- ><template #left-icon><span class="van-f-red"> </span></template
- ></van-field>
- <div v-if="GZAttributeFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>潜在客户类型</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.potentialCustomerType" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in potentialCustomerTypeList"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <van-field label="是否车铺开店" v-if="typeABshow">
- <template #input>
- <van-radio-group v-model="fromValue.carShop" direction="horizontal">
- <van-radio name="1">是</van-radio>
- <van-radio name="0">否</van-radio>
- </van-radio-group>
- </template>
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <van-field label="车铺照片" v-if="fromValue.carShop == 1 && typeABshow">
- <template #input>
- <upload-imgc
- :uploadid="uploadid2"
- :imgArr="fromValue.carShopImgList"
- @newimgarr="newimgarr1"
- imgText=""
- :type="3"></upload-imgc>
- </template>
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- <div v-if="fromValue.carShop == 1 && typeABshow">
- <p
- style="
- color: #666;
- font-size: 14px;
- margin: 0;
- background-color: #fff;
- padding: 6px 18px;
- ">
- 注:店招及车铺产品拍在一张照片里
- </p>
- <deleteImgView :imgs="fromValue.carShopImgList"></deleteImgView>
- </div>
- <div v-if="fromValue.storeCategory != 'C917'">
- <div style="padding: 20px; height: 228px; background-color: #f1f1f1" v-if="imgShow">
- <van-row gutter="20">
- <van-col span="12">
- <div v-if="!storeTypePOP">
- <upload-img
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片'"
- :type="1"></upload-img>
- </div>
- <div v-else>
- <upload-img
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
- :type="1"></upload-img>
- </div>
- </van-col>
- <!-- 新建同城A、B店不显示陈列照 -->
- <template
- v-if="
- fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
- ">
- <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
- <div v-if="storeTypePOP">
- <upload-img
- :uploadid="uploadid2"
- :imgArr="fromValue.imgSed"
- @newimgarr="newimgarr1"
- :type="2"
- :imgText="
- fromValue.ifJzStoreType != 1 ? '陈列照' : '立邦展厅照片'
- "></upload-img>
- </div>
- </van-col>
- </template>
- </van-row>
- </div>
- <div style="padding: 20px; height: 228px; background-color: #f1f1f1" v-if="!imgShow">
- <van-row gutter="20">
- <van-col span="12">
- <div v-if="!storeTypePOP">
- <uploadImgView
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.storeCategory == 'C912' ? '工地铭牌照片' : '公司照片'"
- :type="1"></uploadImgView>
- </div>
- <div v-else>
- <uploadImgView
- :uploadid="uploadid2"
- :imgArr="fromValue.img"
- @newimgarr="newimgarr1"
- :imgText="fromValue.ifJzStoreType != 1 ? '门店照' : '家装前台照片'"
- :type="1"></uploadImgView>
- </div>
- </van-col>
- <!-- 新建同城A、B店不显示陈列照 -->
- <template
- v-if="
- fromValue.storeCategory !== '129081' && fromValue.storeCategory !== '10131'
- ">
- <van-col span="12" v-if="fromValue.ifJzStoreType != 1">
- <div v-if="storeTypePOP">
- <uploadImgView
- :uploadid="uploadid2"
- :imgArr="fromValue.imgSed"
- @newimgarr="newimgarr1"
- :type="2"
- :imgText="
- fromValue.ifJzStoreType != 1 ? '陈列照' : '立邦展厅照片'
- "></uploadImgView>
- </div>
- </van-col>
- </template>
- </van-row>
- </div>
- </div>
- </van-tab>
- <van-tab title="属性信息" name="Planpic">
- <div v-if="dictTypeFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in TCFXList"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <div v-if="dictTypeAFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group
- v-model="fromValue.attribute3"
- class="typeRadioStore1"
- @change="attrChange">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in brandst"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- <van-field
- v-if="attrShow"
- v-model="fromValue.attribute5"
- label="其他品牌"
- placeholder="其他品牌">
- <template #left-icon>
- <span class="van-f-red">*</span>
- </template>
- </van-field>
- </div>
- <div v-if="dictTypeSJSFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in SJSList"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- <div v-if="dictTypeQGJZFormShow" style="background-color: #ffffff; padding: 10px">
- <p style="color: #666"><span class="van-f-red">*</span>属性</p>
- <div style="padding: 4px">
- <van-radio-group v-model="fromValue.tcfxName" class="typeRadioStore1">
- <van-row gutter="20">
- <van-col
- span="12"
- v-for="(item, index) in QGJZist"
- :key="index"
- style="margin-bottom: 10px">
- <van-radio shape="square" :name="item.dictCode">{{ item.text }}</van-radio>
- </van-col>
- </van-row>
- </van-radio-group>
- </div>
- </div>
- </van-tab>
- </van-tabs>
- </van-form>
- </div>
- <!--类型-->
- <van-popup v-model="showPicker" position="bottom">
- <van-picker
- show-toolbar
- :columns="storeCategoryList"
- @confirm="onConfirm"
- @cancel="showPicker = false" />
- </van-popup>
- <!--经销商-->
- <van-popup v-model="showPickerChainsList" position="bottom">
- <van-picker
- show-toolbar
- :columns="ChainsList"
- value-key="chainName"
- @confirm="onConfirmChainsList"
- @cancel="showPickerChainsList = false" />
- </van-popup>
- <van-popup v-model="moreTypeShow" position="bottom" style="height: 80%; font-size: 14px">
- <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="chainName"
- label=""
- placeholder="请输入关键词"
- clearable />
- </van-col>
- <van-col
- span="4"
- style="text-align: center; line-height: 48px"
- @click="getChainsByDeptCodesearch">
- <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" />
- </van-popup>
- <!--同城类型-->
- <van-popup v-model="showTCFXL" position="bottom">
- <van-picker
- show-toolbar
- :columns="TCFXList"
- @confirm="onTCFXLConfirm"
- @cancel="showTCFXL = false" />
- </van-popup>
- <!--省、市、区、街道-->
- <van-popup v-model="showProvincePicker" position="bottom">
- <van-picker
- show-toolbar
- title="省(州)"
- :columns="provinceList"
- @confirm="onProvinceConfirm"
- @cancel="showProvincePicker = false" />
- </van-popup>
- <van-popup v-model="showCityPicker" position="bottom">
- <van-picker
- show-toolbar
- title="城市"
- :columns="cityList"
- @confirm="onCityConfirm"
- @cancel="showCityPicker = false" />
- </van-popup>
- <van-popup v-model="showDistrictPicker" position="bottom">
- <van-picker
- show-toolbar
- title="县区"
- :columns="districtList"
- @confirm="onDistrictConfirm"
- @cancel="showDistrictPicker = false" />
- </van-popup>
- <van-popup v-model="showTownPicker" position="bottom">
- <van-picker
- show-toolbar
- title="街道"
- :columns="townList"
- @confirm="onTownConfirm"
- @cancel="showTownPicker = false" />
- </van-popup>
- <!-- 部门数据 -->
- <van-popup v-model="showPickerDept" position="bottom">
- <van-picker
- show-toolbar
- title="部门名称"
- :columns="deptList"
- @confirm="onDeptConfirm"
- @cancel="showPickerDept = false" />
- </van-popup>
- <van-dialog
- v-model="showDialog"
- title="系统提示"
- show-cancel-button
- :show-confirm-button="false">
- <p v-if="!Array.isArray(msgList)" style="padding: 10px 14px; margin: 0">{{ msgList }}</p>
- <div style="max-height: 400px; overflow-y: auto" v-if="Array.isArray(msgList)">
- <p
- style="border-bottom: 1px solid #f5f5f5; padding: 10px 14px; margin: 0"
- v-for="(item, index) in msgList"
- :key="index">
- {{ item }}
- </p>
- </div>
- </van-dialog>
- <div id="allmap"></div>
- <div style="position: fixed; top: 0; height: 100%; z-index: 3000; width: 100%" v-if="showmap">
- <div id="allmap1" style="height: 100%; width: 100%"></div>
- <div style="position: fixed; z-index: 99999; top: 0; width: 100%; background-color: white">
- <van-search
- v-model="search"
- shape="round"
- background="#0057ba"
- @input="searchFn"
- placeholder="请输入搜索关键词" />
- <div style="height: 200px; overflow: hidden" v-if="searchSHow">
- <div style="height: 100px; min-height: 200px; overflow-y: scroll; padding: 12px">
- <div
- v-for="(itme, index) in mapsearchlist"
- style="border-bottom: 1px solid #eee"
- @click="addressFns(itme)">
- <p>{{ itme.title }}</p>
- <p>{{ itme.address }}</p>
- </div>
- </div>
- </div>
- </div>
- <div class="mapaddress">
- <div class="title">
- <span @click="showmap = false" style="float: left"
- ><van-icon name="cross" size="16"
- /></span>
- <p class="titleText">附近地址信息</p>
- <span style="float: right" @click="confirmMap">确定</span>
- </div>
- <div class="listBox">
- <van-radio-group v-model="addresssb" @change="mapselect">
- <van-radio :name="index" v-for="(item, index) in maplist" :key="index">
- <p style="margin: 4px 0; font-weight: bold">{{ item.title }}</p>
- <p style="margin: 4px 0">{{ item.address }}</p>
- </van-radio>
- </van-radio-group>
- <br />
- <br />
- <br />
- <br />
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- getStoreTypeList,
- addStore,
- beforeAdd,
- streetQuery,
- getTCFXList,
- phoneCheck,
- getChainsByDeptCode,
- getSJSList,
- getQGJZist,
- checkVisit,
- getbrands,
- getCustomerInfoList,
- getManagementModelList,
- getMainRelationList,
- getMainProjectList,
- getCustomerNatureList,
- getpotentialCustomerTypeList,
- } from '@/api/index';
- import uploadImg from '@/components/uploadImgVStore';
- import uploadImgc from '@/components/uploadImgVStorec';
- import uploadImgView from '@/components/ImgView';
- import deleteImgView from '@/components/deleteUploadImg3';
- import axios from 'axios';
- import mapmarker from '@/components/mapMarker';
- import { jsonp } from 'vue-jsonp';
- import txmapimg1 from '@/assets/txmap1.svg';
- import txmapimg2 from '@/assets/txmap2.svg';
- import txmapimg3 from '@/assets/marker_blue.png';
- import { getPosition, getTicketFun } from '@/utils/TXApiFun';
- export default {
- name: 'storeAdd',
- components: { uploadImg, uploadImgView, mapmarker, uploadImgc, deleteImgView },
- data() {
- return {
- mapsearchlist: [],
- searchSHow: false,
- search: '',
- showImgs: true,
- typeABshow: false,
- showDialog: false,
- txmapimg1: txmapimg1,
- txmapimg2: txmapimg2,
- txmapimg3: txmapimg3,
- msgList: '',
- deptList: [],
- tabVal: 'insidePlan',
- show: false,
- showPickerChainsList: false,
- showDistribute: false,
- showProvincePicker: false,
- showCityPicker: false,
- showDistrictPicker: false,
- showTownPicker: false,
- dictTypeFormShow: false,
- dictTypeAFormShow: false,
- showPickerDept: false,
- provinceList: [],
- showTCFXL: false,
- cityList: [],
- districtList: [],
- townList: [],
- imgShow: false,
- uploadid2: 'uploadid2',
- dictTypeQGJZFormShow: false,
- attrShow: false,
- moreTypeShow: false,
- chainName: '',
- address: '地址',
- storeName: '名称',
- fromValue: {
- addressLine: '',
- chainCode: '',
- chainName: '',
- telephone: '',
- storeCategoryName: '',
- provinceName: '',
- salesmanName: '',
- orgName: '',
- potentialCustomerType: '',
- lat: '',
- ifJzStoreType: 0,
- lon: '',
- districtName: '',
- contactName: '',
- cityNameOld: '',
- districtNameOld: '',
- cityName: '',
- cityLevel: '',
- storeName: '',
- storeCategory: '',
- area: '',
- img: '',
- imgSed: '',
- townName: '',
- tcfxName: '',
- tcfxCode: '',
- orgId: '',
- carShop: '',
- carShopImgList: [],
- orderProductStoreList: [],
- showroom: '',
- attribute3: '',
- attribute5: '',
- customerInfoFrom: '',
- customerNature: '',
- managementModel: '',
- mainProjectType: '',
- mainRelationFrom: '',
- },
- location: {
- lat: '34.6174',
- lon: '112.44039',
- lat1: '34.6174',
- lon1: '112.44039',
- },
- checkboxGroup: [],
- ManagementModelList: [],
- MainRelationList: [],
- MainProjectList: [],
- CustomerNatureList: [],
- CustomerInfoList: [],
- potentialCustomerTypeList: [],
- radio: '',
- showPicker: false,
- cityLeveList: [],
- storeTypeList: [],
- storeCategoryList: [],
- ChainsList: [],
- TCFXList: [],
- imgs: '',
- provinceCode: '',
- cityCode: '',
- countyCode: '',
- phoneNumber: true,
- multipleSelection: [],
- sfaOrderProducts: [],
- chainsData: [],
- type: '1',
- deptShow: false,
- dictTypeSJSFormShow: false,
- QGJZist: [],
- SJSList: [],
- mlon: '',
- mlan: '',
- brandst: [],
- storeTypePOP: false,
- GZAttributeFormShow: false,
- addresssb: -1,
- markers: undefined,
- maplist: [],
- showmap: false,
- markers1: undefined,
- marker: undefined,
- pageShow: false,
- map: '',
- };
- },
- created() {
- this.getTCFXList();
- this.getSJSList();
- this.getQGJZist();
- this.getbrands();
- this.getpotentialCustomerTypeList();
- setTimeout(() => {
- // this.getLocation()
- this.getStreetQuery();
- });
- this.chainName = '';
- this.chainsData = [];
- this.imgShow = false;
- this.fromValue.salesmanName = localStorage.getItem('nickName');
- localStorage.removeItem('chainName');
- this.dictTypeQGJZFormShow = false;
- this.dictTypeSJSFormShow = false;
- this.dictTypeFormShow = false;
- },
- watch: {
- $route(to, from) {
- if (
- to.path == '/storeAdd' &&
- (from.path == '/storemanagement/index' || from.path == '/My/index')
- ) {
- this.showmap = false;
- localStorage.removeItem('chainName');
- this.imgShow = false;
- this.typeABshow = false;
- this.chainName = '';
- this.chainsData = [];
- this.dictTypeQGJZFormShow = false;
- this.dictTypeSJSFormShow = false;
- this.dictTypeFormShow = false;
- this.fromValue = {
- addressLine: '',
- chainCode: '',
- chainName: '',
- telephone: '',
- storeCategoryName: '',
- ifJzStoreType: 0,
- provinceName: '',
- salesmanName: '',
- cityNameOld: '',
- districtNameOld: '',
- orgName: '',
- potentialCustomerType: '',
- lat: '',
- lon: '',
- cont: 0,
- districtName: '',
- contactName: '',
- cityName: '',
- cityLevel: '',
- storeName: '',
- storeCategory: '',
- area: '',
- img: '',
- imgSed: '',
- townName: '',
- tcfxName: '',
- tcfxCode: '',
- orgId: '',
- carShop: '',
- carShopImgList: [],
- orderProductStoreList: [],
- showroom: '',
- attribute3: '',
- attribute5: '',
- customerInfoFrom: '',
- customerNature: '',
- managementModel: '',
- mainProjectType: '',
- mainRelationFrom: '',
- };
- setTimeout(() => {
- // this.getLocation()
- });
- this.fromValue.salesmanName = localStorage.getItem('nickName');
- this.getTCFXList();
- this.getpotentialCustomerTypeList();
- this.getSJSList();
- this.getQGJZist();
- this.getbrands();
- this.getStreetQuery();
- }
- },
- },
- activated() {
- // 授权
- getTicketFun(['getLocation', 'chooseImage', 'uploadImage']).then(() => {
- this.$nextTick(() => {
- this.getLocation();
- });
- });
- },
- methods: {
- addressFns(val) {
- var that = this;
- setTimeout(() => {
- that.searchSHow = false;
- that.map.setCenter(new TMap.LatLng(val.location.lat, val.location.lng));
- that.markers1.updateGeometries([
- {
- id: 'marker',
- styleId: 'marker',
- position: new TMap.LatLng(val.location.lat, val.location.lng),
- },
- ]);
- that.maplist = [];
- jsonp(
- 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
- val.location.lat +
- ',' +
- val.location.lng +
- ',1000,0)&page_size=20&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
- ).then((res) => {
- that.maplist = res.data;
- that.marker.setGeometries([]);
- setTimeout(() => {
- for (let p = 0; p < res.data.length; p++) {
- that.marker.updateGeometries([
- {
- id: res.data[p].id,
- position: new TMap.LatLng(res.data[p].location.lat, res.data[p].location.lng),
- },
- ]);
- }
- });
- });
- that.addresssb = -1;
- });
- },
- searchFn(val) {
- this.searchSHow = false;
- var that = this;
- jsonp(
- 'https://apis.map.qq.com/ws/place/v1/suggestion?keyword=' +
- val +
- '&location=' +
- this.location.lat1 +
- ',' +
- this.location.lon1 +
- '&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6&page_size=20®ion_fix=1'
- ).then((res) => {
- this.searchSHow = true;
- that.mapsearchlist = res.data;
- });
- },
- mapselect(val) {
- if (val > -1) {
- this.markers.updateGeometries([
- {
- id: 'markers1',
- styleId: 'abc',
- position: new TMap.LatLng(
- this.maplist[val].location.lat,
- this.maplist[val].location.lng
- ),
- },
- ]);
- }
- },
- confirmMap() {
- if (this.addresssb > -1) {
- this.fromValue.addressLine = this.maplist[this.addresssb].address;
- }
- this.showmap = false;
- },
- fns() {
- this.search = '';
- this.showmap = true;
- jsonp(
- 'https://apis.map.qq.com/ws/place/v1/search?boundary=nearby(' +
- this.location.lat1 +
- ',' +
- this.location.lon1 +
- ',1000,0)&page_size=10&page_index=1&orderby=_distance&output=jsonp&key=WLCBZ-HRM6L-YOMPV-ME62B-AQOG6-JUBW6'
- ).then((res) => {
- this.maplist = res.data;
- setTimeout(() => {
- this.addVisits1();
- });
- });
- this.addresssb = -1;
- },
- addVisits1() {
- var that = this;
- var map = new TMap.Map('allmap1', {
- zoom: 15,
- center: new TMap.LatLng(that.location.lat1, that.location.lon1),
- });
- var markers = new TMap.MultiMarker({
- id: 'markers',
- map: map,
- geometries: [],
- styles: {
- marker: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: { x: 16, y: 32 },
- src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker-pink.png',
- }),
- },
- });
- markers.setGeometries([]);
- var location = new TMap.LatLng(that.location.lat1, that.location.lon1);
- map.setCenter(location);
- markers.updateGeometries([
- {
- id: 'marker',
- styleId: 'marker',
- position: location,
- },
- ]);
- var marker = new TMap.MultiMarker({
- map: map,
- styles: {
- default: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: {
- x: 17,
- y: 21,
- },
- src: 'https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/marker_blue.png',
- }),
- },
- geometries: [],
- });
- for (let p = 0; p < this.maplist.length; p++) {
- marker.updateGeometries([
- {
- id: this.maplist[p].id,
- position: new TMap.LatLng(this.maplist[p].location.lat, this.maplist[p].location.lng),
- },
- ]);
- }
- var markers1 = new TMap.MultiMarker({
- map: map,
- mapgeometries: [
- {
- id: 'markers1',
- position: new TMap.LatLng(0, 0),
- },
- ],
- styles: {
- abc: new TMap.MarkerStyle({
- width: 32,
- height: 40,
- anchor: { x: 16, y: 32 },
- src: txmapimg3,
- }),
- },
- });
- markers1.setGeometries([]);
- this.markers = markers1;
- this.map = map;
- this.markers1 = markers;
- this.marker = marker;
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.SCALE);
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ROTATION);
- map.removeControl(TMap.constants.DEFAULT_CONTROL_ID.ZOOM);
- },
- addressFn() {
- localStorage.setItem('locationRemark', this.fromValue.addressLine);
- },
- PickerDept() {
- if (this.deptShow) {
- this.showPickerDept = true;
- }
- },
- formatter(value) {
- if (value < 1) {
- return '';
- } else {
- return value;
- }
- },
- handleSelectionChange(val) {
- this.fromValue.orderProductStoreList = val;
- },
- getChainsByDeptCode(deptId, ifJzStoreType, type) {
- getChainsByDeptCode({
- cityName: this.fromValue.cityNameOld,
- districtName: this.fromValue.districtNameOld,
- deptId: deptId,
- ifJzStoreType: ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- if (this.ChainsList.length == 1) {
- this.fromValue.chainName = this.ChainsList[0].chainName;
- this.fromValue.chainCode = this.ChainsList[0].chainCode;
- }
- if (res.data.sfaOrderProducts != null) {
- res.data.sfaOrderProducts.forEach((item) => {
- item.orderNum = '';
- item.storeProductId = item.orderProductId;
- });
- this.sfaOrderProducts = res.data.sfaOrderProducts;
- }
- var deptList = [];
- for (var t1 = 0; t1 < res.data.deptList.length; t1++) {
- deptList.push({
- deptId: res.data.deptList[t1].deptId,
- text: res.data.deptList[t1].deptName,
- });
- }
- this.deptList = deptList;
- if (deptList.length == 1) {
- this.fromValue.orgId = deptList[0].deptId;
- this.fromValue.orgName = deptList[0].text;
- localStorage.setItem('orgName', deptList[0].text);
- this.deptShow = false;
- this.ChainsList = res.data.sfaChains;
- } else {
- this.ChainsList = [];
- this.deptShow = true;
- }
- });
- },
- onDeptConfirm(value) {
- this.fromValue.orgName = value.text;
- localStorage.setItem('orgName', value.text);
- this.fromValue.orgId = value.deptId;
- this.fromValue.chainCode = '';
- this.fromValue.chainName = '';
- this.getChainsByDeptId(value.deptId, this.fromValue.ifJzStoreType);
- this.showPickerDept = false;
- },
- setStoreNameFn() {
- if (this.fromValue.storeName.trim() == '') {
- localStorage.removeItem('chainName');
- this.imgShow = false;
- } else {
- localStorage.setItem('chainName', this.fromValue.storeName);
- this.imgShow = true;
- }
- },
- attrChange(val) {
- if (val == '0') {
- this.attrShow = true;
- } else {
- this.attrShow = false;
- this.fromValue.attribute5 = '';
- }
- },
- getStreetQuery(type) {
- var provinceCode = this.fromValue.province;
- var cityCode = this.fromValue.city;
- var countyCode = this.fromValue.district;
- if (type == '1') {
- cityCode = '';
- countyCode = '';
- } else if (type == '2') {
- countyCode = '';
- } else if (type == '3') {
- console.log('ok');
- } else {
- provinceCode = '';
- cityCode = '';
- countyCode = '';
- }
- streetQuery({ provinceCode: provinceCode, cityCode: cityCode, countyCode: countyCode }).then(
- (res) => {
- if (res.code == 200) {
- var provinceList = [];
- var cityList = [];
- var districtList = [];
- var townList = [];
- if (type == '1') {
- for (var z1 = 0; z1 < res.data.length; z1++) {
- cityList.push({ cityCode: res.data[z1].cityCode, text: res.data[z1].cityName });
- }
- this.cityList = cityList;
- } else if (type == '2') {
- for (var z2 = 0; z2 < res.data.length; z2++) {
- districtList.push({
- countyCode: res.data[z2].countyCode,
- text: res.data[z2].countyName,
- countyLevel: res.data[z2].countyLevel,
- });
- }
- this.districtList = districtList;
- } else if (type == '3') {
- for (var z3 = 0; z3 < res.data.length; z3++) {
- townList.push({ townCode: res.data[z3].townCode, text: res.data[z3].townName });
- }
- this.townList = townList;
- } else {
- for (var z = 0; z < res.data.length; z++) {
- provinceList.push({
- provinceCode: res.data[z].provinceCode,
- text: res.data[z].provinceName,
- });
- }
- this.provinceList = provinceList;
- }
- } else {
- this.$toast.fail('请求超时');
- }
- }
- );
- },
- newimgarr1(val) {
- if (val.type == '1') {
- this.fromValue.img = val.fileUrl;
- } else if (val.type == '2') {
- this.fromValue.imgSed = val.fileUrl;
- } else {
- this.fromValue.carShopImgList.push(val.fileUrl);
- }
- },
- getChainsByDeptId(deptCode, ifJzStoreType) {
- getChainsByDeptCode({
- cityName: this.fromValue.cityName,
- districtName: this.fromValue.districtName,
- deptId: deptCode,
- ifJzStoreType: ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- if (res.data.sfaOrderProducts != null) {
- res.data.sfaOrderProducts.forEach((item) => {
- item.orderNum = '';
- item.storeProductId = item.orderProductId;
- });
- this.sfaOrderProducts = res.data.sfaOrderProducts;
- }
- this.ChainsList = res.data.sfaChains;
- });
- },
- beforeAddFn() {
- this.phoneNumber = true;
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- beforeAdd({
- cityName: this.fromValue.cityNameOld,
- districtName: this.fromValue.districtNameOld,
- }).then((res) => {
- if (res.code == 200) {
- loading1.clear();
- var storeCategory = [];
- var deptList = [];
- for (var j = 0; j < res.data.storeCategoryList.length; j++) {
- storeCategory.push({
- dictValue: res.data.storeCategoryList[j].dictValue,
- ifJzStoreType: res.data.storeCategoryList[j].ifJzStoreType,
- text: res.data.storeCategoryList[j].dictLabel,
- });
- }
- for (var t1 = 0; t1 < res.data.deptList.length; t1++) {
- deptList.push({
- deptId: res.data.deptList[t1].deptId,
- text: res.data.deptList[t1].deptName,
- });
- }
- if (res.data.StreetInfoList != null) {
- for (var j2 = 0; j2 < res.data.StreetInfoList.length; j2++) {
- if (res.data.StreetInfoList[j2].cityName.indexOf(this.fromValue.cityNameOld) != -1) {
- this.fromValue.province = res.data.StreetInfoList[j2].provinceCode;
- this.fromValue.provinceName = res.data.StreetInfoList[j2].provinceName;
- this.fromValue.city = res.data.StreetInfoList[j2].cityCode;
- this.fromValue.cityName = res.data.StreetInfoList[j2].cityName;
- this.cityCode = res.data.StreetInfoList[j2].cityCode;
- this.provinceCode = res.data.StreetInfoList[j2].provinceCode;
- this.fromValue.cityLevel = res.data.StreetInfoList[j2].countyLevel;
- }
- if (
- res.data.StreetInfoList[j2].countyName.indexOf(
- this.fromValue.districtNameOld + ''
- ) != -1
- ) {
- this.fromValue.district = res.data.StreetInfoList[j2].countyCode;
- this.countyCode = res.data.StreetInfoList[j2].countyCode;
- this.fromValue.districtName = res.data.StreetInfoList[j2].countyName;
- }
- }
- } else {
- this.fromValue.cityName = '';
- this.fromValue.districtName = '';
- this.countyCode = '';
- this.fromValue.district = '';
- this.fromValue.cityLevel = '';
- this.fromValue.province = '';
- this.cityCode = '';
- this.provinceCode = '';
- this.fromValue.provinceName = '';
- this.fromValue.city = '';
- }
- this.storeCategoryList = storeCategory;
- } else {
- loading1.clear();
- this.$toast.fail('请求超时');
- }
- this.getStreetQuery();
- this.getStreetQuery('1');
- this.getStreetQuery('2');
- this.getStreetQuery('3');
- });
- },
- getChainsByDeptCodesearch(chainName) {
- this.chainsData = [];
- getChainsByDeptCode({
- chainName: this.chainName,
- cityName: this.fromValue.cityNameOld,
- districtName: this.fromValue.districtNameOld,
- deptId: this.fromValue.orgId,
- ifJzStoreType: this.fromValue.ifJzStoreType,
- storeCategory: this.fromValue.storeCategory,
- }).then((res) => {
- this.chainsData = res.data.sfaChains;
- this.chainsData.push({});
- this.chainsData.pop();
- });
- },
- addVisits() {
- var that = this;
- var map = new TMap.Map('allmap', {
- zoom: 15,
- center: new TMap.LatLng(39.986785, 116.301012),
- });
- var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
- var markers = new TMap.MultiMarker({
- map: map,
- geometries: [],
- });
- markers.setGeometries([]);
- var location = new TMap.LatLng(that.location.lat1, that.location.lon1);
- map.setCenter(location);
- markers.updateGeometries([{ id: 'marker', position: location }]);
- geocoder.getAddress({ location: location }).then(function (result) {
- var addresses = result.result.formatted_addresses;
- that.fromValue.cityNameOld = result.result.ad_info.city;
- that.fromValue.districtNameOld = result.result.ad_info.district;
- that.fromValue.addressLine = addresses.recommend;
- localStorage.setItem('locationRemark', addresses.recommend);
- that.beforeAddFn();
- });
- },
- getLocation() {
- if (localStorage.getItem('loginType') == 'cs') {
- this.fromValue.lat = '31.2517820000';
- this.fromValue.lon = '120.5593090000';
- this.addVisits();
- } else {
- getPosition()
- .then((res) => {
- let { TXisBD, resData } = res;
- this.mlon = resData.longitude;
- this.mlan = resData.latitude;
- this.location = TXisBD;
- this.fromValue.lat = TXisBD.lat;
- this.fromValue.lon = TXisBD.lon;
- this.location.lat1 = resData.latitude;
- this.location.lon1 = resData.longitude;
- this.addVisits();
- })
- .catch((error) => {
- this.beforeAddFn();
- this.$dialog.alert({
- message: error,
- });
- });
- // let loading1 = this.$toast.loading({
- // duration: 0,
- // message: '定位中...',
- // forbidClick: true,
- // });
- // let url = window.location.href;
- // this.list = [];
- // let 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(() => {
- // this.$router.go(-1);
- // });
- // } else {
- // clearInterval(times);
- // }
- // }
- // }, 1000);
- // qiyeData = response.data.data;
- // that.wx.config({
- // beta: true,
- // debug: false,
- // appId: qiyeData.appId,
- // timestamp: qiyeData.timestamp,
- // nonceStr: qiyeData.nonceStr,
- // signature: qiyeData.signature,
- // jsApiList: ['ready', 'getLocation'],
- // });
- // that.wx.ready(function () {
- // that.wx.getLocation({
- // type: 'gcj02',
- // success: function (res) {
- // flat = false;
- // loading1.clear();
- // that.mlon = res.longitude;
- // that.mlan = res.latitude;
- // var location = that.CJ02BD(res.latitude, res.longitude);
- // that.location = location;
- // that.fromValue.lat = that.location.lat;
- // that.fromValue.lon = that.location.lon;
- // that.location.lat1 = res.latitude;
- // that.location.lon1 = res.longitude;
- // that.addVisits();
- // },
- // fail: function () {
- // loading1.clear();
- // that.$dialog
- // .confirm({
- // confirmButtonText: '返回上一页',
- // cancelButtonText: '重新定位',
- // title: '系统提示',
- // message: 'GPS未开启',
- // })
- // .then(() => {
- // that.$router.go(-1);
- // })
- // .catch(() => {
- // that.getLocation();
- // });
- // },
- // });
- // });
- // that.wx.error(function (res) {
- // this.$toast.fail('定位失败');
- // });
- // } else {
- // this.$toast.fail('接口异常');
- // }
- // });
- }
- },
- getpotentialCustomerTypeList() {
- getpotentialCustomerTypeList().then((res) => {
- var potentialCustomerTypeList = [];
- for (var t = 0; t < res.data.length; t++) {
- potentialCustomerTypeList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.potentialCustomerTypeList = potentialCustomerTypeList;
- });
- },
- getCustomerInfoList() {
- getCustomerInfoList().then((res) => {
- var CustomerInfoList = [];
- for (var t = 0; t < res.data.length; t++) {
- CustomerInfoList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.CustomerInfoList = CustomerInfoList;
- });
- },
- getCustomerNatureList() {
- getCustomerNatureList().then((res) => {
- var CustomerNatureList = [];
- for (var t = 0; t < res.data.length; t++) {
- CustomerNatureList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.CustomerNatureList = CustomerNatureList;
- });
- },
- getMainProjectList() {
- getMainProjectList().then((res) => {
- var MainProjectList = [];
- for (var t = 0; t < res.data.length; t++) {
- MainProjectList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.MainProjectList = MainProjectList;
- });
- },
- getMainRelationList() {
- getMainRelationList().then((res) => {
- var MainRelationList = [];
- for (var t = 0; t < res.data.length; t++) {
- MainRelationList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.MainRelationList = MainRelationList;
- });
- },
- getManagementModelList() {
- getManagementModelList().then((res) => {
- var ManagementModelList = [];
- for (var t = 0; t < res.data.length; t++) {
- ManagementModelList.push({
- text: res.data[t].dictLabel,
- dictCode: res.data[t].dictValue,
- });
- }
- this.ManagementModelList = ManagementModelList;
- });
- },
- getTCFXList() {
- getTCFXList({}).then((res) => {
- var TCFXList = [];
- for (var t = 0; t < res.data.length; t++) {
- TCFXList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.TCFXList = TCFXList;
- });
- },
- getSJSList() {
- getSJSList({}).then((res) => {
- var SJSList = [];
- for (var t = 0; t < res.data.length; t++) {
- SJSList.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.SJSList = SJSList;
- });
- },
- getQGJZist() {
- getQGJZist({}).then((res) => {
- var QGJZist = [];
- for (var t = 0; t < res.data.length; t++) {
- QGJZist.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.QGJZist = QGJZist;
- });
- },
- getbrands() {
- getbrands({}).then((res) => {
- var brandst = [];
- for (var t = 0; t < res.data.length; t++) {
- brandst.push({ text: res.data[t].dictLabel, dictCode: res.data[t].dictValue });
- }
- this.brandst = brandst;
- });
- },
- getStoreTypeList() {
- getStoreTypeList({}).then((res) => {
- this.storeTypeList = res.data;
- });
- },
- zSelectVal(value) {
- this.fromValue[value.type] = value.value;
- },
- afterRead(file) {
- console.log(file);
- },
- onProvinceConfirm(value) {
- this.fromValue.provinceName = value.text;
- this.fromValue.province = value.provinceCode;
- this.fromValue.cityName = '';
- this.fromValue.city = '';
- this.fromValue.districtName = '';
- this.fromValue.countyCode = '';
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = '';
- this.cityCode = '';
- this.provinceCode = value.provinceCode;
- this.getStreetQuery('1');
- this.showProvincePicker = false;
- },
- onCityConfirm(value) {
- this.fromValue.cityName = value.text;
- this.fromValue.city = value.cityCode;
- this.fromValue.districtName = '';
- this.fromValue.district = '';
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = '';
- this.cityCode = value.cityCode;
- this.getStreetQuery('2');
- this.showCityPicker = false;
- },
- onDistrictConfirm(value) {
- this.fromValue.districtName = value.text;
- this.fromValue.district = value.countyCode;
- this.fromValue.townName = '';
- this.fromValue.townCode = '';
- this.countyCode = value.countyCode;
- this.fromValue.cityLevel = value.countyLevel;
- this.getStreetQuery('3');
- this.showDistrictPicker = false;
- },
- onTownConfirm(value) {
- this.fromValue.townName = value.text;
- this.fromValue.townCode = value.townCode;
- this.showTownPicker = false;
- },
- onTCFXLConfirm(value) {
- this.fromValue.tcfxName = value.text;
- this.fromValue.tcfxCode = value.dictCode;
- this.showTCFXL = false;
- },
- onConfirm(value) {
- this.fromValue.storeCategoryName = value.text;
- this.fromValue.storeCategory = value.dictValue;
- if (value.dictValue == '129081' || value.dictValue == '10131') {
- this.typeABshow = true;
- } else {
- this.typeABshow = false;
- this.fromValue.carShop = '';
- this.fromValue.carShopImgList = [];
- }
- if (value.dictValue == '129081') {
- this.dictTypeAFormShow = true;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.dictTypeAFormShow = false;
- }
- if (value.dictValue == 'C917') {
- this.GZAttributeFormShow = true;
- this.dictTypeSJSFormShow = false;
- this.dictTypeQGJZFormShow = false;
- this.dictTypeFormShow = false;
- this.dictTypeAFormShow = false;
- this.typeABshow = false;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.GZAttributeFormShow = false;
- }
- if (value.dictValue == '10131') {
- this.dictTypeFormShow = true;
- } else {
- this.fromValue.tcfxName = '';
- this.fromValue.tcfxCode = '';
- this.dictTypeFormShow = false;
- }
- if (value.dictValue == 'sjs61') {
- this.dictTypeSJSFormShow = true;
- } else {
- this.dictTypeSJSFormShow = false;
- }
- if (value.dictValue == 'zyjz63') {
- this.dictTypeQGJZFormShow = true;
- } else {
- this.dictTypeQGJZFormShow = false;
- }
- if (value.dictValue == 'C912') {
- this.storeTypePOP = false;
- this.storeName = '铭牌上项目名称';
- this.address = '地址';
- } else if (value.dictValue == 'C917') {
- this.storeTypePOP = false;
- this.storeName = '名称';
- this.address = '地址';
- } else {
- this.storeTypePOP = true;
- this.storeName = '名称';
- this.address = '地址';
- }
- this.fromValue.chainName = '';
- this.fromValue.chainCode = '';
- this.fromValue.orgName = '';
- this.fromValue.orgId = '';
- this.fromValue.ifJzStoreType = value.ifJzStoreType;
- this.getChainsByDeptCode(null, value.ifJzStoreType);
- this.showPicker = false;
- },
- numberFn() {
- if (Number(this.fromValue.area) < 0) {
- this.fromValue.area = '';
- } else {
- this.fromValue.area = this.fromValue.area.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1');
- }
- },
- showPickerChainsListFn() {
- if (this.fromValue.storeCategoryName == '') {
- this.$toast('类型未选择');
- return;
- } else if (this.fromValue.orgName == '') {
- this.$toast('部门未选择');
- return;
- } else {
- this.showPickerChainsList = true;
- }
- },
- moreTypeShowfn() {
- if (this.fromValue.storeCategoryName == '') {
- this.$toast('类型未选择');
- return;
- } else if (this.fromValue.orgName == '') {
- this.$toast('部门未选择');
- return;
- } else {
- this.moreTypeShow = true;
- }
- },
- onConfirmChainsList(value) {
- this.fromValue.chainName = value.chainName;
- this.fromValue.chainCode = value.chainCode;
- this.showPickerChainsList = false;
- this.moreTypeShow = false;
- },
- onSubmit() {
- var that = this;
- var arrList = [];
- for (var n2 = 0; n2 < this.sfaOrderProducts.length; n2++) {
- if (this.sfaOrderProducts[n2].orderNum != '') {
- arrList.push(this.sfaOrderProducts[n2]);
- }
- }
- this.fromValue.orderProductStoreList = arrList;
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- });
- var fromValue = this.fromValue;
- var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- if (
- fromValue.chainName == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C912' &&
- fromValue.storeCategory != 'C917'
- ) {
- // fromValue.storeCategory!='C912'
- this.$toast('经销商未填写');
- return;
- } else if (fromValue.orgId == '') {
- this.$toast('部门未选择');
- return;
- } else if (fromValue.storeName == '') {
- if (fromValue.storeCategory == 'C912') {
- this.$toast('铭牌上项目名称未填写');
- } else if (fromValue.storeCategory == 'C917') {
- this.$toast('名称未填写');
- } else {
- this.$toast('名称未填写');
- }
- return;
- } else if (fromValue.addressLine == '') {
- if (fromValue.storeCategory == 'C912') {
- this.$toast('地址未填写');
- } else if (fromValue.storeCategory == 'C917') {
- this.$toast('地址未填写');
- } else {
- this.$toast('地址未填写');
- }
- return;
- } else if (fromValue.storeCategoryName == '') {
- this.$toast('类型未填写');
- return;
- } else if (fromValue.provinceName == '') {
- this.$toast('所在省份未填写');
- return;
- } else if (fromValue.cityName == '') {
- this.$toast('所在城市未填写');
- return;
- } else if (fromValue.districtName == '') {
- this.$toast('所在县区未填写');
- return;
- } else if (fromValue.townName == '') {
- this.$toast('所在街道未填写');
- return;
- } else if (
- fromValue.contactName == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('联系人未填写');
- return;
- } else if (
- fromValue.telephone.trim() == '' &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('联系电话未填写');
- return;
- } else if (
- !telrg.test(fromValue.telephone) &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('手机号格式错误');
- return;
- } else if (
- !this.phoneNumber &&
- fromValue.ifJzStoreType != 1 &&
- fromValue.storeCategory != 'C917'
- ) {
- this.$toast('不能填写业务员手机号');
- return;
- } else if (fromValue.img == '' && fromValue.storeCategory != 'C917') {
- if (this.storeTypePOP) {
- if (fromValue.ifJzStoreType != 1) {
- this.$toast('图片未上传');
- } else {
- this.$toast('家装前台照片未上传');
- }
- } else {
- this.$toast('照片未上传');
- }
- return;
- } else if (
- fromValue.imgSed == '' &&
- fromValue.ifJzStoreType != 1 &&
- this.storeTypePOP &&
- fromValue.storeCategory != 'C917' &&
- fromValue.storeCategory !== '129081' &&
- fromValue.storeCategory !== '10131'
- ) {
- this.$toast('图片未上传');
- return;
- } else if (fromValue.lon == '') {
- this.$toast('请获取定位坐标');
- return;
- } else if (
- (fromValue.storeCategory == '10131' ||
- fromValue.storeCategory == 'sjs61' ||
- fromValue.storeCategory == 'zyjz63') &&
- fromValue.tcfxName == ''
- ) {
- this.$toast('属性未填写');
- return;
- } else if (
- (fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131') &&
- fromValue.carShop == ''
- ) {
- this.$toast('请选择是否车铺开店');
- return;
- } else if (
- (fromValue.storeCategory == '129081' || fromValue.storeCategory == '10131') &&
- fromValue.carShop == '1' &&
- fromValue.carShopImgList.length < 1
- ) {
- this.$toast('请上传车铺开店照片');
- return;
- }
- if (fromValue.area.trim() == '' && fromValue.ifJzStoreType == 1) {
- this.$toast('家装展厅面积未填写');
- return;
- }
- if (fromValue.storeCategory == '129081' && fromValue.attribute3 == '') {
- this.$toast('属性未填写');
- return;
- }
- if (
- fromValue.storeCategory == '129081' &&
- fromValue.attribute3 == '0' &&
- fromValue.attribute5 == ''
- ) {
- this.$toast('属性未填写');
- return;
- }
- if (this.GZAttributeFormShow && fromValue.potentialCustomerType == '') {
- this.$toast('潜在客户类型未填写');
- return;
- }
- addStore(this.fromValue).then((res) => {
- loading1.clear();
- if (res.code == 200) {
- if (res.data.serverCode) {
- this.fromValue.storeCode = res.data.sfaStore.storeCode;
- this.fromValue.storeId = res.data.sfaStore.storeId;
- if (
- res.data.orderUrl != null &&
- (res.data.orderUrl != '') & (res.data.orderUrl != undefined)
- ) {
- window.location.replace(res.data.orderUrl);
- } else {
- that.$dialog
- .confirm({
- title: '系统提示',
- message: '建店成功,是否立即拜访?',
- confirmButtonText: '立即拜访',
- cancelButtonText: '返回上一页',
- })
- .then(() => {
- checkVisit({ storeId: res.data.sfaStore.storeId }).then((response) => {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', this.fromValue.deptName);
- localStorage.setItem('chainNameR', this.fromValue.storeName);
- if (response.code == 200) {
- localStorage.setItem('startTime', new Date());
- localStorage.setItem('ORGName', res.data.sfaStore.deptName);
- localStorage.setItem('chainNameR', res.data.sfaStore.storeName);
- window.location.replace(
- window.location.origin +
- '/mobile/suishenbangOutstoreVisit?PointSum=0&visitModel=1&tabVal=1&hisTime=null&pageType=out&visitId=null&rdId=null&storeId=' +
- res.data.sfaStore.storeId +
- '&lat=' +
- that.fromValue.lat +
- '&lon=' +
- that.fromValue.lon +
- '&addressLine=' +
- that.fromValue.addressLine +
- '&storeCategory=' +
- res.data.sfaStore.storeCategory +
- '&storeName=' +
- that.fromValue.storeName +
- '&contactName=' +
- that.fromValue.contactName +
- '&storeCode=' +
- res.data.sfaStore.storeCode +
- '&latNew=' +
- that.fromValue.lat +
- '&lonNew=' +
- that.fromValue.lon +
- '&marklat=' +
- that.mlan +
- '&marklon=' +
- that.mlon
- );
- } else {
- that.$dialog
- .alert({
- title: '系统提示',
- message: response.msg,
- })
- .then((res) => {
- that.$router.go(-1);
- });
- }
- });
- })
- .catch(() => {
- that.$router.go(-1);
- });
- }
- } else {
- this.fromValue.storeCode = res.data.sfaStore.storeCode;
- this.fromValue.storeId = res.data.sfaStore.storeId;
- this.$dialog.alert({
- title: '系统提示',
- message: res.data.serverMsg,
- });
- }
- } else {
- this.$dialog.alert({
- title: '系统提示',
- message: res.msg,
- messageAlign: 'left',
- });
- }
- });
- },
- onClickLeft() {
- this.$router.go(-1);
- },
- tabChange(name, title) {
- console.log(name, title);
- },
- phoneCheck() {
- if (this.fromValue.ifJzStoreType != 1) {
- var telrg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- if (this.fromValue.telephone.trim() == '') {
- return;
- } else if (!telrg.test(this.fromValue.telephone)) {
- this.$toast('手机号格式错误');
- return;
- } else {
- phoneCheck({ phoneNumber: this.fromValue.telephone }).then((res) => {
- if (res.code == 200) {
- this.phoneNumber = true;
- } else {
- this.phoneNumber = false;
- }
- });
- }
- }
- },
- },
- };
- </script>
- <style scoped>
- .myTab .van-tabs__nav--card {
- margin: 0 !important;
- border-left: 0;
- border-right: 0;
- }
- .myTab .van-tabs__wrap,
- .myTab .van-tabs__nav--card {
- height: 40px;
- }
- .myTab .van-tab {
- line-height: 40px;
- }
- .van-f-red {
- color: red;
- width: 4px;
- display: inline-block;
- }
- </style>
- <style>
- .van-dialog__confirm,
- .van-dialog__confirm:active {
- color: #0057ba;
- }
- .navBarTOP {
- position: fixed;
- width: 100%;
- z-index: 2;
- top: 0;
- }
- #allmap {
- width: 100px;
- height: 100px;
- position: fixed;
- left: -2000px;
- }
- .typeRadioStore .van-radio {
- margin: 10px;
- }
- .typeRadioStore .van-radio__icon .van-icon {
- border: 0 !important;
- }
- .typeRadioStore .van-radio__icon--checked .van-icon {
- color: #1989fa;
- background-color: transparent;
- border-color: transparent;
- }
- .typeRadioStore .van-cell {
- padding: 0 16px;
- line-height: 40px;
- }
- .container .typeRadioStore .van-cell__title {
- height: 40px;
- }
- .typeRadioStore1 .van-radio__icon .van-icon {
- border-radius: 2px;
- border-color: #ccc !important;
- }
- .typeRadioStore1 .van-radio__icon--checked .van-icon {
- background-color: transparent;
- color: #1989fa;
- border-color: #1989fa !important;
- }
- .typeRadioStore1 .van-radio[aria-checked='true'] .van-radio__label {
- color: #1989fa;
- }
- .morelaji .van-cell {
- padding: 10px 0;
- }
- </style>
|