| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-export-dialog');
- ComponentHelper::loadComponentView('com-image');
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div class="all_flex" style="margin-bottom: 30px;align-items: flex-end;">
- <div class="top_title">会员管理</div>
- <div style="font-size:12px;color: #919191;flex:1;"></div>
- <div>
- <el-button class="all_button" type="primary" size="small" @click="addUser">添加会员</el-button>
- <!-- <el-button class="all_button" type="primary" size="small" @click="$navigate({r:'mall/user/relation-tree'})" style=" margin-left: 0px;" >关系树状图</el-button>-->
- <el-button class="all_button" type="primary" size="small" @click="importUser" style=" margin-left: 0px;" >批量导入</el-button>
- </div>
-
- <com-export-dialog
- style="float: right;margin-top: -5px"
- :field_list='exportList'
- :action_url='export_url'
- :params="searchInfo">
- </com-export-dialog>
- </div>
- <!--全部会员,新增会员,活跃会员,购买未支付,流水会员筛选-->
- <!-- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type" :class="{se_module: searchInfo.user_type == index}" @click="seUserType(index)">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</div>
- <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
- <el-image style="width: 16px; height: 16px" src="resources/img/stat/where.png"></el-image>
- </el-tooltip>
- </div>
- </div>
- </div> -->
- <el-form ref="form" style="margin-bottom: 10px;" :model="searchInfo" label-width="96px" size="mini">
- <el-row :gutter="24">
- <el-col :span="5" style="padding-left: 0;" class="top_form">
- <el-form-item label="会员ID">
- <el-input v-model="searchInfo.user_id" placeholder="请输入会员ID" clearable></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关键字">
- <el-input v-model="searchInfo.nickname_or_mobile" placeholder="会员昵称/手机号" clearable></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="浏览路径ID">
- <el-input v-model="searchInfo.parent_id" placeholder="请输入浏览路径ID" clearable></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6" style="padding-right: 0;">
- <el-form-item label="来源渠道">
- <el-select v-model="searchInfo.source" placeholder="请选择来源渠道">
- <!-- <el-option label="全部" value=""></el-option> -->
- <el-option v-for="(item,index) in channelArr" :label="item" :value="index" :key="index"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <!-- <el-col :span="5" style="padding-left: 0;" class="top_form">-->
- <!-- <el-form-item label="智能标签">-->
- <!-- <el-select v-model="searchInfo.tag_id" placeholder="请选择智能标签">-->
- <!-- <el-option label="全部" value=""></el-option>-->
- <!-- <el-option v-for="item in userTagList" :label="item.name" :value="item.tag_id" :key="item.tag_id"></el-option>-->
- <!-- </el-select>-->
- <!-- </el-form-item>-->
- <!-- </el-col>-->
- <el-col :span="5" style="padding-left: 0;" class="top_form">
- <el-form-item label="注册时间">
- <el-date-picker
- v-model="addTime"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd HH:mm:ss"
- @change="addTimeChange"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="6">
- <el-form-item label="上次消费时间">
- <el-date-picker
- v-model="lastSpendTime"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- value-format="yyyy-MM-dd HH:mm:ss"
- @change="lastSpendTimeChange"
- :default-time="['00:00:00', '23:59:59']"
- >
- </el-date-picker>
- </el-form-item>
- </el-col> -->
- <el-col :span="6" style="padding-right: 0;">
- <el-form-item label="余额" class="value_input">
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.balance_start">
- <template slot="append">元</template>
- </el-input>
- <span style="margin: 0 5px;">-</span>
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.balance_end">
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6" style="padding-right: 0;">
- <el-form-item label="销售利润" class="value_input">
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.commission_start">
- <template slot="append">元</template>
- </el-input>
- <span style="margin: 0 5px;">-</span>
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.commission_end">
- <template slot="append">元</template>
- </el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6" style="padding-right: 0;" >
- <el-form-item label="积分" class="value_input">
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.score_start">
- <template slot="append">分</template>
- </el-input>
- <span style="margin: 0 5px;">-</span>
- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.score_end">
- <template slot="append">分</template>
- </el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="6" style="padding-left: 0;" class="top_form">
- <el-form-item label="智能标签">
- <el-select
- v-model="searchInfo.lableValue"
- filterable
- default-first-option
- placeholder="请选择智能标签"
- >
- <el-option
- v-for="item in userTagList"
- :key="item.tag_id"
- :label="item.name"
- :value="item.tag_id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="padding-left: 0;" class="top_form">
- <el-form-item label="会员标签">
- <el-select
- v-model="searchInfo.memberLabelIds"
- multiple
- filterable
- default-first-option
- placeholder="请选择会员标签"
- >
- <el-option
- v-for="item in memberLabelList"
- :label="item.name"
- :value="item.cate_id +'_' + item.id">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8" style="padding-right: 0;">
- <el-form-item label="会员等级">
- <el-select v-model="searchInfo.level" placeholder="请选择会员等级" clearable>
- <!-- <el-option label="全部" value=""></el-option> -->
- <el-option v-for="(item,index) in levels" :label="item" :value="index" :key="index"></el-option>
- </el-select>
- <span style="margin-left: 10px">会员数量: {{user_count}}</span>
- </el-form-item>
- </el-col>
- <el-col :span="6" style="padding-right: 0;">
- <el-form-item label="黑名单">
- <el-select v-model="searchInfo.black" placeholder="是否黑名单" clearable>
- <el-option label="是" value="1"></el-option>
- <el-option label="否" value="2"></el-option>
- </el-select>
- <!-- <span style="margin-left: 10px">会员数量: {{user_count}}</span> -->
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="5" style="padding-left: 0;">
- <el-form-item label="浏览路径手机号">
- <el-input v-model="searchInfo.p_mobile" placeholder="浏览路径手机号" clearable></el-input>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="5" style="padding-left: 0;" class="top_form">-->
- <!-- <el-form-item label="积分" class="value_input">-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.score_start">-->
- <!-- <template slot="append">分</template>-->
- <!-- </el-input>-->
- <!-- <span style="margin: 0 5px;">-</span>-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.score_end">-->
- <!-- <template slot="append">分</template>-->
- <!-- </el-input>-->
- <!-- </el-form-item>-->
- <!-- </el-col>-->
- <!-- <el-col :span="6">-->
- <!-- <el-form-item label="累计消费金额" class="value_input">-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.price_total_start">-->
- <!-- <template slot="append">元</template>-->
- <!-- </el-input>-->
- <!-- <span style="margin: 0 5px;">-</span>-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.price_total_end">-->
- <!-- <template slot="append">元</template>-->
- <!-- </el-input>-->
- <!-- </el-form-item>-->
- <!-- </el-col>-->
- <!-- <el-col :span="6">-->
- <!-- <el-form-item label="购买次数" class="value_input">-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.order_total_start">-->
- <!-- <template slot="append">次</template>-->
- <!-- </el-input>-->
- <!-- <span style="margin: 0 5px;">-</span>-->
- <!-- <el-input @focus="focusInputClass" @blur="blurInputClass" v-model="searchInfo.order_total_end">-->
- <!-- <template slot="append">次</template>-->
- <!-- </el-input>-->
- <!-- </el-form-item>-->
- <!-- </el-col>-->
- </el-row>
- <div>
- <el-button @click="search" class="search_button all_button" size="small" type="primary">搜索</el-button>
- <el-button type="danger" size="small" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </div>
- </el-form>
- <el-table class="table-info" ref="multipleTable" @selection-change="scFormTab" @sort-change="sortChang" stripe :data="form" highlight-current-row style="width: 100%" v-loading="listLoading">
- <el-table-column type="selection" width="50"></el-table-column>
- <el-table-column prop="user_id" label="会员ID" width="100" ></el-table-column>
- <el-table-column label="会员" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="no_user" style="width: 50px; bottom:20px;" v-if="scope.row.status == 0">黑名单</div>
- <div class="table-info-text">
- <div style="color:#000;">{{scope.row.nickname}}</div>
- <div style="font-size: 12px;">渠道:{{scope.row.platform}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="mobile" label="手机号" width="120" align="center"></el-table-column>
- <el-table-column prop="level_name" label="会员等级" width="120" align="center"></el-table-column>
- <el-table-column label="浏览路径" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text" v-if="scope.row.parent">
- <el-image class="table-info-img circle" :src="scope.row.parent.avatar_url">
- <div slot="error" class="image-slot">
- <el-image class="table-info-img" src="/resources/img/common/default-avatar.png"></el-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div>{{scope.row.parent.nickname}}</div>
- <div v-if="scope.row.parent.id > 0">ID:{{scope.row.parent.id}}</div>
- <div v-else>--</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="pay_order_price_total" sortable="custom" label="累计消费金额" width="150" align="center"></el-table-column>-->
- <!-- <el-table-column prop="average_price" label="平均客单价" width="130" align="center"></el-table-column>-->
- <el-table-column prop="last_pay_at" label="上次消费时间" width="160px" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.last_pay_at}}</div>
- </template>
- </el-table-column>
- <el-table-column label="余额/销售利润" width="180px" >
- <template slot-scope="scope">
- <div class="title_bu" @click="typeGoTo(1,scope.row.user_id)">余额:{{scope.row.balance ? scope.row.balance : 0}}</div>
- <div class="title_bu" @click="typeGoTo(2,scope.row.user_id)">销售利润:{{scope.row.income ? scope.row.income : 0}}</div>
- </template>
- </el-table-column>
- <el-table-column label="积分" width="80px" align="center">
- <template slot-scope="scope">
- <div class="title_bu" @click="typeGoTo(3,scope.row.user_id)">{{scope.row.score}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="score" label="注册时间" width="180px" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at}}
- </template>
- </el-table-column>
- <el-table-column prop="score" label="推广资格" width="80px" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.is_inviter==1">有</span>
- <span v-if="scope.row.is_inviter==0">无</span>
- </template>
- </el-table-column>
- <el-table-column prop="score" label="会员到期时间" width="150px" align="center">
- <template slot-scope="scope">
- {{ scope.row.expired_at_text }}
- </template>
- </el-table-column>
- <template v-if="isFreezeCommission">
- <el-table-column prop="freeze_scale" label="冻结比例" min-width="150px" align="center">
- <template slot-scope="scope">
- <div style="width:100%">
- <div v-if="editRowId == scope.row.id && editColumnId == scope.column.id">
- <el-input size="small" style="width:65%;" type="number" min="0" v-model="scope.row.userFreezeCommission.freeze_scale" placeholder="请输入冻结上限"></el-input>
- <el-button class="change-quit" type="text" style="color: #F56C6C;padding: 0 2px;margin:0;" icon="el-icon-error" circle @click="handleCancelEdit()"></el-button>
- <el-button class="change-success" type="text" style="margin-left: 0;color: #67C23A;padding: 0 2px;margin:0;" icon="el-icon-success" circle @click="submitRowChange(scope.row)">
-
- </div>
- <div v-else>
- <span>{{scope.row.userFreezeCommission.freeze_scale}}%</span>
- <el-button class="edit-sort" type="text" @click="handleEditRow(scope.row, scope)">
- <img src="resources/img/mall/order/edit.png" alt="">
- </el-button>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="freeze_cap" label="冻结上限" min-width="150px" align="center">
- <template slot-scope="scope">
- <div style="width:100%">
- <div v-if="editRowId == scope.row.id && editColumnId == scope.column.id">
- <el-input size="small" style="width:65%;" type="number" min="0" v-model="scope.row.userFreezeCommission.freeze_cap" placeholder="请输入冻结上限"></el-input>
- <el-button class="change-quit" type="text" style="color: #F56C6C;padding: 0 2px;margin:0;" icon="el-icon-error" circle @click="handleCancelEdit()"></el-button>
- <el-button class="change-success" type="text" style="margin-left: 0;color: #67C23A;padding: 0 2px;margin:0;" icon="el-icon-success" circle @click="submitRowChange(scope.row)">
- </div>
- <div v-else>
- <span>{{scope.row.userFreezeCommission.freeze_cap}}</span>
- <el-button class="edit-sort" type="text" @click="handleEditRow(scope.row, scope)">
- <img src="resources/img/mall/order/edit.png" alt="">
- </el-button>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="score" label="冻结详情" min-width="160px" align="center">
- <template slot-scope="scope">
- <div style="display:flex;justify-content:center;">
- <div style="min-width:100%;">
- <div class="order-status-container">
- <span style="display:inline-block;min-width:60px;">已冻结:</span>
- <span style="display:inline-block;min-width:100px;">
- <span>{{scope.row.userFreezeCommission.freeze_amount}}</span>
- </span>
- </div>
- <div class="order-status-container">
- <span style="display:inline-block;min-width:60px;">未冻结:</span>
- <span style="display:inline-block;min-width:100px;">
- <span>{{scope.row.userFreezeCommission.not_freeze_amount}}</span>
- </span>
- </div>
- </div>
- </div>
- </template>
- </el-table-column>
- </template>
- <el-table-column label="操作" min-width="170px" align="center" fixed="right">
- <template slot-scope="scope">
- <el-button type="text" @click="navUserDetail(scope.row.user_id)" class="all_text">查看</el-button>
- <el-popover width="80" trigger="click">
- <el-button v-if="install_addons.indexOf('TeamData') != -1" class="all_text" type="text" @click="navUserInfo(scope.row.user_id)">我的客户</el-button>
- <el-button class="all_text" type="text" @click="handleIntegral(scope.row)">积分充值</el-button>
- <el-button class="all_text" type="text" @click="handleBalance(scope.row)">余额充值</el-button>
- <el-button class="all_text" type="text" @click="handleCommission(scope.row)">销售利润充值</el-button>
- <el-button v-if="redpack_is_install" class="all_text" type="text" @click="handleRedpack(scope.row)">红包充值</el-button>
- <!-- <el-button class="all_text" type="text" @click="handleCurrency(scope.row)">货币充值</el-button>-->
- <el-button class="all_text" type="text" @click="handlePassword(scope.row)">修改密码</el-button>
- <el-button class="all_text" type="text" @click="handleLable(scope.row)">加标签</el-button>
- <el-button class="all_text" type="text" @click="handleListOfNames(scope.row)">{{scope.row.status == 0?'加入白名单':'加入黑名单'}}</el-button>
- <template v-if="isFreezeCommission">
- <el-button class="all_text" type="text" @click="handleClearFreezeCommission(scope.row)">一键释放</el-button>
- </template>
- <el-button class="all_text" slot="reference" type="text" @click="addMore(scope.row.user_id)">更多</el-button>
- </el-popover>
- </template>
- </el-table-column>
- </el-table>
- <!-- 底部按钮操作 -->
- <div style="margin: 10px 20px 0;">
- <el-checkbox class="up_checkbox_color" style="margin-right: 10px;" v-model="checkedAll" @change="tabAll"><div :class="{all_text:checkedAll}">全选当前页</div></el-checkbox>
- <el-button class="bottom_but" plain @click="addLables" :disabled="selFormArr.length <= 0">加标签</el-button>
- <el-dropdown class="bottom_but" plain @command="addIntegral" :disabled="selFormArr.length <= 0">
- <span class="el-dropdown-link">
- 充值积分<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="normal" :disabled="selFormArr.length <= 0">对选中的人充值积分</el-dropdown-item>
- <el-dropdown-item command="cel" :disabled="selFormArr.length <= 0">对选中的人清空积分</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown class="bottom_but" plain @command="addBalance" :disabled="selFormArr.length <= 0">
- <span class="el-dropdown-link">
- 充值余额<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="normal" :disabled="selFormArr.length <= 0">对选中的人充值余额</el-dropdown-item>
- <el-dropdown-item command="cel" :disabled="selFormArr.length <= 0">对选中的人清空余额</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-dropdown class="bottom_but" plain @command="addCommission" :disabled="selFormArr.length <= 0">
- <span class="el-dropdown-link">
- 充值销售利润<i class="el-icon-arrow-down el-icon--right"></i>
- </span>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item command="normal" :disabled="selFormArr.length <= 0">对选中的人充值销售利润</el-dropdown-item>
- <el-dropdown-item command="cel" :disabled="selFormArr.length <= 0">对选中的人清空销售利润</el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <el-button class="bottom_but" plain @click="blacklistList" :disabled="selFormArr.length <= 0">加入黑名单</el-button>
- <el-button class="bottom_but" plain @click="whitelistList" :disabled="selFormArr.length <= 0">加入白名单</el-button>
- <el-button class="bottom_but" plain @click="batchAddLevel" :disabled="selFormArr.length <= 0">批量修改等级</el-button>
- <div id="bottom_t" style="text-align: right;">
- <el-input v-model="page" placeholder="" size="small" @keyup.enter.native="pageSearch" style="width:50px; float: right; text-align: center; margin: 0;padding: 0;"></el-input>
- <el-pagination @current-change="pagination" background layout="prev, pager, next"
- :page-count="pageCount" :current-page="currentPage"></el-pagination>
- </div>
- </div>
- </div>
- <!-- 充值积分 -->
- <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值积分'" :visible.sync="dialogIntegral" width="30%" @close="closePop">
- <div v-if="hintBoo">
- 选择清空积分,是否还要继续
- </div>
- <el-form v-else :model="integralForm" label-width="80px" :rules="integralFormRules" ref="integralForm">
- <el-form-item label="积分数量" prop="num" size="small">
- <el-input type="number" v-model="integralForm.num" placeholder="请输入要加/减的积分值(-1代表减1积分)"></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="remark" size="small">
- <el-input v-model="integralForm.remark" placeholder="备注原因"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogIntegral = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="integralSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 充值余额 -->
- <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值余额'" :visible.sync="dialogBalance" width="30%" @close="closePop">
- <div v-if="hintBoo">
- 选择清空余额,是否还要继续
- </div>
- <el-form v-else :model="balanceForm" label-width="80px" :rules="balanceFormRules" ref="integralForm">
- <el-form-item label="余额数量" prop="price" size="small">
- <el-input type="number" v-model="balanceForm.price" placeholder="请输入要加/减的余额(-1代表减1余额)"></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="remark" size="small">
- <el-input v-model="balanceForm.remark"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogBalance = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="balanceSubmit">确定</el-button>
- </div>
- </el-dialog>
- <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值销售利润'" :visible.sync="dialogCommission" width="30%" @close="closePop">
- <div v-if="hintBoo">
- 选择清空销售利润,是否还要继续
- </div>
- <el-form v-else :model="commissionForm" label-width="80px" :rules="commissionFormRules" ref="commissionForm">
- <el-form-item label="销售利润数量" prop="price" size="small">
- <el-input type="number" v-model="commissionForm.price" placeholder="请输入要加/减的余额(-1代表减1余额)"></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="remark" size="small">
- <el-input v-model="commissionForm.remark"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogCommission = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="commissionSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 红包充值 -->
- <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'红包充值'" :visible.sync="dialogRedpack" width="30%" @close="closePop">
- <div v-if="hintBoo">
- 选择清空余额,是否还要继续
- </div>
- <el-form v-else :model="redpackForm" label-width="80px" :rules="redpackFormRules" ref="integralForm">
- <el-form-item label="红包金额" prop="redpack_money" size="small">
- <el-input onInput="value = toNumber(value, 2, true)" v-model="redpackForm.redpack_money" placeholder="请输入要加/减的余额(-1代表减1余额)"></el-input>
- </el-form-item>
- <el-form-item label="红包类型" prop="redpack_type" size="small">
- <el-radio-group v-model="redpackForm.redpack_type">
- <el-radio label="frozen_redpack">冻结红包</el-radio>
- <el-radio label="redpack">激活红包</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="备注" prop="remark" size="small">
- <el-input v-model="redpackForm.remark"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogBalance = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="redpackSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 货币充值 -->
- <el-dialog :close-on-click-modal="false" title="货币充值" :visible.sync="currencyBoo" width="30%">
- <el-form :model="currencyForm" label-width="80px" :rules="currencyFormRules" ref="integralForm">
- <el-form-item label="货币类型" prop="code" size="small">
- <el-select v-model="currencyForm.code" placeholder="请选择货币类型">
- <!-- <el-option label="全部" value=""></el-option> -->
- <el-option v-for="(item,index) in currencyList" :label="item.name" :value="item.code" :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="货币数量" prop="money" size="small">
- <el-input type="number" v-model="currencyForm.money" placeholder="请输入要加/减的货币值(-1代表减1货币)"></el-input>
- </el-form-item>
- <el-form-item label="备注" prop="desc" size="small">
- <el-input v-model="currencyForm.desc"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="currencyBoo = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="currencySubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 加标签 -->
- <el-dialog :close-on-click-modal="false" title="加标签" :visible.sync="labelBoo" width="30%" @close="labelClose">
- <el-select
- v-model="lableValue"
- multiple
- filterable
- allow-create
- default-first-option
- placeholder="请选择智能标签"
- >
- <el-option
- v-for="item in userTagList"
- :key="item.tag_id"
- :label="item.name"
- :value="item.tag_id">
- </el-option>
- </el-select>
- <div slot="footer" class="dialog-footer">
- <el-button @click="labelBoo = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="labelSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 加入黑白名单 -->
- <el-dialog :close-on-click-modal="false" title="提示" :visible.sync="listOfNamesBoo" width="30%">
- <div>
- {{this.balanceForm.status == 1?'您确认加入黑名单吗':'您确认加入白名单吗'}}
- </div>
- <div style="line-height: 30px;color: #FA6565;" v-if="this.balanceForm.is_blacklist == 0">
- 拉黑后,该账号将无法访问商城
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="listOfNamesBoo = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="listOfNamesBooSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 修改密码 -->
- <el-dialog :close-on-click-modal="false" title="修改登录密码" :visible.sync="passwordBoo" width="30%" @close="closePop">
- <el-form :model="passwordForm" label-width="80px" :rules="passwordFormRules" ref="integralForm" @submit.native.prevent>
- <el-form-item label="新密码" prop="price" size="small">
- <el-input type="password" v-model="passwordForm.password" placeholder="请输入新密码" @keyup.enter.native="passwordSubmit"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="passwordBoo = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="passwordSubmit">确定</el-button>
- </div>
- </el-dialog>
- <!-- 批量修改等级 -->
- <el-dialog :close-on-click-modal="false" title="批量修改等级" :visible.sync="batchAddLevelBoo" width="30%" @close="batchAddLevelClose">
- <el-select
- v-model="batchAddLevelValue"
- placeholder="请选择用户等级"
- >
- <el-option
- v-for="(item,index) in levels"
- :key="index"
- :label="item"
- :value="index">
- </el-option>
- </el-select>
- <div slot="footer" class="dialog-footer">
- <el-button @click="batchAddLevelBoo = false">取消</el-button>
- <el-button :loading="btnLoading" type="primary" @click="batchAddLevelSubmit">确定</el-button>
- </div>
- </el-dialog>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- props: {
- edit_user_url: {
- type: String,
- default: 'mall/user/edit'
- },
- import_user_url: {
- type: String,
- default: 'mall/user/import-users'
- },
- },
- data() {
- return {
- searchData: {
- keyword: '',
- keyword_user_id: '',
- lableValue:271,
- },
- label_id:'',
- platform: '0',
- member_level: '0',
- mall_members: [],
- keyword: '',
- keyword_user_id: '',
- form: [],
- member: [],
- pageCount: 0,
- page: 1,
- member_page: 1,
- currentPage: null,
- listLoading: false,
- btnLoading: false,
- user_count: 0,
- // 导出
- exportList: {},
- export_url: 'mall/user/index',
- //积分
- dialogIntegral: false,
- integralForm: {
- type: '1',
- num: '',
- pic_url: '',
- remark: '',
- },
- integralFormRules: {
- num: [
- {required: true, message: '积分数量不能为空', trigger: 'blur'},
- ],
- },
- //余额
- dialogBalance: false,
- balanceForm: {
- type: '1',
- price: '',
- pic_url: '',
- remark: '',
- },
- balanceFormRules: {
- price: [
- {required: true, message: '金额不能为空', trigger: 'blur'},
- ],
- },
- dialogCommission: false,
- commissionForm: {
- type: '1',
- price: '',
- pic_url: '',
- remark: '',
- },
- commissionFormRules: {
- price: [
- {required: true, message: '销售利润不能为空', trigger: 'blur'},
- ],
- },
- //红包
- dialogRedpack: false,
- redpackForm: {
- redpack_type: "frozen_redpack",
- redpack_money: '',
- user_id:'',
- remark: '',
- },
- redpackFormRules: {
- redpack_money: [
- {required: true, message: '红包金额不能为空', trigger: 'blur'},
- ],
- },
- redpack_type:[],//红包类型
- // 货币
- currencyBoo: false,
- currencyFormRules: {
- money: [
- {required: true, message: '货币数量不能为空', trigger: 'blur'},
- ],
- desc: [
- {required: true, message: '备注不能为空', trigger: 'blur'},
- ],
- code: [
- {required: true, message: '货币类型不能为空', trigger: 'blur'},
- ]
- },
- currencyForm: {
- type: '1',
- code:'',
- money: '',
- desc: '',
- },
- // 标签
- labelBoo: false,
- lableValue: [],
- //批量修改等级
- batchAddLevelBoo:false,
- batchAddLevelValue:[],
- // 黑白名单
- listOfNamesBoo: false,
- orderTotalArr: [
- {
- type: 'user_total',
- name: '全部会员',
- value: "0",
- prompt: '',
- },{
- type: 'new_user_total',
- name: '新增会员',
- value: '0',
- prompt: '近七天新增会员数量',
- },{
- type: 'active_user_total',
- name: '活跃会员',
- value: '0',
- prompt: '近7天有访问过商城的会员',
- },{
- type: 'no_pay_user_total',
- name: '购买未支付',
- value: "0",
- prompt: '近7天有购买行为,但没有成功付款的客户',
- },{
- type: 'loss_user_total',
- name: '流失会员',
- value: '0',
- prompt: '近30天无访问无购买的会员',
- },
- // {
- // type: 'o2o_user_total',
- // name: '线下会员',
- // value: '0',
- // prompt: '通过O2O门店进入的会员',
- // }
- ],
- // 提示
- hintBoo: false,
- passwordBoo: false,//修改密码
- passwordForm: {
- password: '',
- },
- passwordFormRules: {
- password: [
- {required: true, message: '密码不能为空', trigger: 'blur'},
- ],
- },
- updateTime: '',
- searchInfo: {
- user_id: '',
- nickname_or_mobile: '', //会员昵称/手机号
- parent_id: '', //浏览路径ID
- source: '',//用户来源
- tag_id: '',//标签筛选
- user_type: 0,//会员类型
- register_start: '',//注册开始时间
- register_end: '',//注册结束时间
- pay_start: '',//上次消费开始时间
- pay_end: '',// 上次消费结束时间
- balance_start: '',//余额开始
- balance_end: '',//余额结束
- commission_start:'',//开始销售利润
- commission_end:'',//结束销售利润
- score_start: '',//积分开始
- score_end: '',//积分结束
- price_total_start: '',//累计消费金额开始
- price_total_end: '',//累计消费金额结束
- order_total_start: '',//购买次数开始
- order_total_end: '',//购买次数结束
- r: 'mall/user/index',//购买次数结束
- lableValue:'',//智能标签
- memberLabelIds:[],//会员标签
- black: '', // 是否黑名单
- p_mobile: '', // 浏览路径的手机号
- },
- addTime: '',//注册时间
- lastSpendTime: '',//上次消费时间
- visibleUserId: 0,
- userTagList: [],//智能标签列表
- memberLabelList: [],//会员标签列表
- channelArr: [],//渠道
- levels:[],//等级
- checkedAll: false,
- selFormArr: [],//表格选中的元素
- labelSubmitBoo: false,//加标签是否能多个用户添加
- batchAddLevelSubmitBoo:false,//批量修改等级是否能多个用户添加
- integralOrBalanceType: 1, //积分或余额充值状态,1:加或减 2:标识清零
- blacklistType: 1,//批量黑名单状态: 1:单个 2:批量
- currencyList: [],//币种列表
- sortFo: '', //排序方向:asc升序 desc降序 ''不排序
- sortPorp: '',//排序的元素属性名
- dataRenewBoo: false,
- redpack_is_install:false,//如果是true红包拓客的插件是已经安装了
- userUrl: 'mall/user/index',
- install_addons: [],
- isFreezeCommission: 0,
- editRowId: 0,
- editColumnId: -1,
- };
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.searchInfo.user_id) || !isEmpty(this.searchInfo.nickname_or_mobile) ||
- !isEmpty(this.searchInfo.parent_id)
- ||!isEmpty(this.searchInfo.source)
- || !isEmpty(this.searchInfo.tag_id)
- ||!isEmpty(this.searchInfo.register_start)
- ||!isEmpty(this.searchInfo.register_end)
- ||!isEmpty(this.searchInfo.pay_start)
- ||!isEmpty(this.searchInfo.pay_end)
- ||!isEmpty(this.searchInfo.user_type)
- ||!isEmpty(this.searchInfo.balance_start)
- ||!isEmpty(this.searchInfo.balance_end)
- ||!isEmpty(this.searchInfo.score_start)
- ||!isEmpty(this.searchInfo.score_end)
- ||!isEmpty(this.searchInfo.price_total_start)
- ||!isEmpty(this.searchInfo.price_total_end)
- ||!isEmpty(this.searchInfo.order_total_start)
- ||!isEmpty(this.searchInfo.order_total_end)
- ||!isEmpty(this.searchInfo.level)
- ||!isEmpty(this.label_id)
- ||!isEmpty(this.searchInfo.lableValue)
- ||!isEmpty(this.searchInfo.p_mobile);
- }
- },
- methods: {
- labelClose() {// 关闭标签框
- this.lableValue = [];
- },
- openId(index) {
- let item = this.form;
- item[index].is_open_id = !item[index].is_open_id;
- this.form = JSON.parse(JSON.stringify(this.form));
- },
- exportConfirm() {
- this.searchData.keyword = this.keyword;
- this.searchData.keyword_user_id = this.keyword_user_id;
- },
- //积分
- integralPicUrl(e) {
- if (e.length) {
- this.integralForm.pic_url = e[0].url;
- }
- },
- handleIntegral(row) {
- // console.log(row);
- this.integralForm = Object.assign(this.integralForm, {user_id: row.user_id});
- this.integralForm.num = "";
- this.integralForm.remark = "";
- this.dialogIntegral = true;
- },
- // 积分充值验证
- integralSubmit() {
- if(this.integralOrBalanceType == 2){
- this.integralRequest();
- return;
- }
- this.$refs.integralForm.validate((valid) => {
- if (valid) {
- this.integralRequest();
- }
- });
- },
- // 请求积分充值接口
- integralRequest(){
- let num = Number(this.integralForm.num);
- num >= 0 ?this.integralForm.type = 1:this.integralForm.type = 2;
- if(this.selFormArr.length > 0){
- let userArr = []
- this.selFormArr.forEach(v => {
- userArr.push(v.user_id);
- })
- // this.integralForm.user_id = JSON.stringify(userArr);
- this.integralForm.user_id = userArr.join();
- if(this.integralOrBalanceType == 2) {
- this.integralForm.type = 3;
- this.integralForm.num = 0;
- }
- }
- let para = Object.assign({}, this.integralForm);
- this.btnLoading = true;
- request({
- params: {
- r: 'mall/user/score',
- },
- method: 'post',
- data: para,
- }).then(e => {
- if (e.data.code === 0) {
- // location.reload();
- this.integralForm.num = "";
- this.getList();
- } else {
- this.$message.error(e.data.msg);
- }
- this.dialogIntegral = false;
- this.btnLoading = false;
- this.hintBoo = false;
- }).catch(e => {
- this.dialogIntegral = false;
- this.btnLoading = false;
- this.hintBoo = false;
- });
- },
- //余额
- balancePicUrl(e) {
- if (e.length) {
- this.balanceForm.pic_url = e[0].url;
- }
- },
- handleBalance(row) {
- this.balanceForm = Object.assign(this.balanceForm, {user_id: row.user_id});
- this.balanceForm.price = "";
- this.balanceForm.remark = "";
- this.dialogBalance = true;
- },
- handleCommission(row) {
- this.commissionForm = Object.assign(this.commissionForm, {user_id: row.user_id});
- this.commissionForm.price = "";
- this.commissionForm.remark = "";
- this.dialogCommission = true;
- },
- handleRedpack(row){
- this.redpackForm.redpack_money = "";
- this.redpackForm.remark = "";
- this.dialogRedpack = true;
- this.redpackForm.user_id = row.id;
- },
- // 币种
- handleCurrency(row){
- this.currencyForm = {
- type: '1',
- code:'',
- money: '',
- desc: '',
- }
- this.currencyForm = Object.assign(this.currencyForm, {user_id: row.user_id});
- this.currencyBoo = true;
- },
- // 密码
- handlePassword(row){
- this.passwordForm = Object.assign(this.passwordForm, {user_id: row.user_id});
- this.passwordBoo = true;
- },
- // 标签
- handleLable(row){
- this.balanceForm = Object.assign(this.balanceForm, {user_id: row.user_id});
- let key = [];
- row.userLabel.forEach(v => {
- key.push(v.id);
- })
- this.lableValue = key;
- this.labelBoo = true;
- },
- // 黑白名单
- handleListOfNames(row){
- console.info(row)
- if(row.status==0){
- this.balanceForm.is_blacklist = 1;
- }else{
- this.balanceForm.is_blacklist = 0;
- }
- this.balanceForm = Object.assign(this.balanceForm, {
- user_id: row.user_id,
- status: row.status,
- });
- this.blacklistType = 1;
- this.listOfNamesBoo = true;
- },
- // 批量加入黑名单
- blacklistList(){
- this.blacklistType = 2;
- this.balanceForm.is_blacklist = 0;
- this.balanceForm.status = 1;
- this.listOfNamesBoo = true;
- },
- whitelistList(){
- this.blacklistType = 2;
- this.balanceForm.is_blacklist = 1;
- this.balanceForm.status = 0;
- this.listOfNamesBoo = true;
- },
- // 余额验证
- balanceSubmit() {
- // 批量清零
- if(this.integralOrBalanceType == 2){
- this.balanceRequest();
- return;
- }
- // 表单验证
- this.$refs.integralForm.validate((valid) => {
- if (valid) {
- this.balanceRequest();
- }
- });
- },
- commissionSubmit() {
- // 批量清零
- if(this.integralOrBalanceType == 2){
- this.commissionRequest();
- return;
- }
- // 表单验证
- this.$refs.commissionForm.validate((valid) => {
- if (valid) {
- this.commissionRequest();
- }
- });
- },
- // 余额验证
- redpackSubmit() {
- this.btnLoading = true;
- request({
- params: {
- r: 'mall/user/redpack',
- },
- method: 'post',
- data: {
- user_id:this.redpackForm.user_id,
- type:this.redpackForm.redpack_type,
- money:this.redpackForm.redpack_money,
- desc:this.redpackForm.remark},
- }).then(e => {
- if (e.data.code === 0) {
- this.dialogRedpack = false;
- // location.reload();
- this.getList();
- } else {
- this.$message.error(e.data.msg);
- }
- this.dialogBalance = false;
- this.btnLoading = false;
- }).catch(e => {
- this.dialogBalance = false;
- this.btnLoading = false;
- });
- },
- //余额充值请求接口
- balanceRequest(){
- let num = Number(this.balanceForm.price);
- num >= 0 ?this.balanceForm.type = 1:this.balanceForm.type = 2;
- if(this.selFormArr.length > 0){
- let userArr = []
- this.selFormArr.forEach(v => {
- userArr.push(v.user_id);
- })
- this.balanceForm.user_id = userArr.join();
- if(this.integralOrBalanceType == 2) {
- this.balanceForm.type = 3;
- this.balanceForm.price = 0;
- }
- }
- let para = Object.assign({}, this.balanceForm);
- this.btnLoading = true;
- request({
- params: {
- r: 'mall/user/balance',
- },
- method: 'post',
- data: para,
- }).then(e => {
- if (e.data.code === 0) {
- // location.reload();
- this.getList();
- } else {
- this.$message.error(e.data.msg);
- }
- this.dialogBalance = false;
- this.btnLoading = false;
- }).catch(e => {
- this.dialogBalance = false;
- this.btnLoading = false;
- });
- },
- commissionRequest(){
- let num = Number(this.balanceForm.price);
- num >= 0 ?this.commissionForm.type = 1:this.commissionForm.type = 2;
- if(this.selFormArr.length > 0){
- let userArr = []
- this.selFormArr.forEach(v => {
- userArr.push(v.user_id);
- })
- this.commissionForm.user_id = userArr.join();
- if(this.integralOrBalanceType == 2) {
- this.commissionForm.type = 3;
- this.commissionForm.price = 0;
- }
- }
- let para = Object.assign({}, this.commissionForm);
- this.btnLoading = true;
- request({
- params: {
- r: 'mall/user/commission',
- },
- method: 'post',
- data: para,
- }).then(e => {
- if (e.data.code === 0) {
- // location.reload();
- this.getList();
- } else {
- this.$message.error(e.data.msg);
- }
- this.dialogCommission = false;
- this.btnLoading = false;
- }).catch(e => {
- this.dialogCommission = false;
- this.btnLoading = false;
- });
- },
- // 货币充值
- currencySubmit(){
- // 表单验证
- this.$refs.integralForm.validate((valid) => {
- if (valid) {
- let para = Object.assign({}, this.currencyForm);
- this.btnLoading = true;
- request({
- params: {
- r: 'mall/user/add-currency',
- },
- method: 'post',
- data: para,
- }).then(res => {
- // console.info(res);
- if(res.data.code == 0){
- this.getList();
- }else {
- this.$message.error(e.data.msg);
- }
- this.currencyBoo = false;
- this.btnLoading = false;
- }).catch(err => {
- this.currencyBoo = false;
- this.btnLoading = false;
- })
- }
- })
- },
- // 修改密码
- passwordSubmit(){
- this.$refs.integralForm.validate((valid) => {
- let para = Object.assign({}, this.passwordForm);
- this.btnLoading = true;
- if(this.passwordForm.password.length<6) {
- this.$message.error('密码长度至少6位');
- this.btnLoading = false;
- return false;
- }
- if (valid) {
- request({
- params: {
- r: 'mall/user/update-password',
- },
- method: 'post',
- data: para,
- }).then(res => {
- if(res.data.code == 0){
- this.getList();
- this.passwordForm.password = '';
- }else {
- this.$message.error(res.data.msg);
- }
- this.passwordBoo = false;
- this.btnLoading = false;
- }).catch(err => {
- this.passwordBoo = false;
- this.btnLoading = false;
- })
- }
- })
- },
- search() {
- // console.info(this.searchInfo);
- this.page = 1;
- this.getList();
- },
- pageSearch(){
- this.page_count = 1;
- this.getList();
- },
- pagination(currentPage) {
- this.checkedAll = false;
- this.selFormArr = [];
- this.page = currentPage;
- this.getList();
- },
- getList() {
- this.listLoading = true;
- let sort = '';
- let data = {
- page: this.page,
- search: JSON.stringify(this.searchInfo),
- }
- if(this.sortFo){
- sort = this.sortPorp + ' ' + this.sortFo;
- data.sort = sort;
- }
- let params = {
- r: 'mall/user/index',
- };
- params = Object.assign(params, data);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- //console.info(e);
- if (e.data.code === 0) {
- //console.log(e.data.data.user_list.list);
- this.form = e.data.data.user_list.list;
- this.redpack_is_install = e.data.data.redpack_is_install;
- this.exportList = e.data.data.export_list;
- this.install_addons = e.data.data.install_addons;
- console.log(this.install_addons.indexOf('TeamData'));
- this.pageCount = e.data.data.user_list.page_count;
- this.currentPage = e.data.data.user_list.page;
- this.user_count = e.data.data.user_list.row_count
- if(this.page_count !=1) this.pageCount = e.data.data.user_list.page_count;
- this.currentPage = parseInt(this.page);
- this.isFreezeCommission = e.data.data.is_freeze_commission
- //console.info(this.checkedAll);
- if(this.checkedAll){
- this.$nextTick(rrr => {
- this.form.forEach(v => {
- this.$refs.multipleTable.toggleRowSelection(v);
- })
- })
- }
- if(this.currentPage == 1){
- this.updateTime = e.data.data.mall_data.updated_at;
- this.userTagList = e.data.data.tag_list;
- this.memberLabelList = e.data.data.member_label_List;
- this.channelArr = e.data.data.channel;
- this.levels = e.data.data.levels;
- this.currencyList = e.data.data.currency_list;
- for (const key in e.data.data.mall_data) {
- let info = this.orderTotalArr.filter(v => v.type == key); //订单概况
- if(info.length){
- let index = this.orderTotalArr.findIndex(v => v.type==info[0].type);
- this.orderTotalArr[index].value = e.data.data.mall_data[key];
- }
- }
- }
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- },
- addUser() {
- navigateTo({
- r: 'mall/user/add',
- page: this.page
- });
- },
- importUser() {
- navigateTo({
- r: this.import_user_url,
- page: this.page
- });
- },
- addMore(id){
- this.visibleUserId = id;
- },
- seUserType(index){
- if(this.searchInfo.user_type == index) return;
- this.searchInfo.user_type = index;
- this.search();
- },
- addTimeChange(v){
- this.searchInfo.register_start = v?v[0]:'';
- this.searchInfo.register_end = v?v[1]:'';
- },
- lastSpendTimeChange(v){
- this.searchInfo.pay_start = v?v[0]:'';
- this.searchInfo.pay_end = v?v[1]:'';
- },
- labelSubmit(boo){
- let that = this;
- let url = 'mall/user/add-user-label'
- let user_label_arr = {};
- let userId = this.balanceForm.user_id;
- let is_batch = 0;
- if(this.labelSubmitBoo == true){
- this.selFormArr.forEach(v => {
- user_label_arr = Object.assign(user_label_arr, {[v.user_id]: JSON.stringify(this.lableValue)});
- })
- is_batch = 1;
- } else {
- user_label_arr = {[this.balanceForm.user_id]: JSON.stringify(this.lableValue)};
- }
- let data = {
- user_label_arr: user_label_arr,
- is_batch: is_batch,
- }
- console.info(data);
- request({
- params: {
- r: url
- },
- method: 'post',
- data: data
- }).then(res => {
- that.labelSubmitBoo = false;
- if(res.data.code == 0){
- that.lableValue = [];
- that.checkedAll = false;
- that.getList();
- }
- that.labelBoo = false;
- }).catch(e => {
- that.labelSubmitBoo = false;
- that.labelBoo = false;
- console.log(e);
- });
- },
- batchAddLevelSubmit(boo){
- let that = this;
- let url = 'mall/user/batch-edit-user-level'
- // let user_level_arr = {};
- let level = 0;
- let userArr = [];
- let userId = this.balanceForm.user_id;
- // let is_batch = 0;
- if(this.batchAddLevelSubmitBoo == true){
- // this.selFormArr.forEach(v => {
- // user_label_arr = Object.assign(user_level_arr, {[v.user_id]: JSON.stringify(this.batchAddLevelValue)});
- // })
- this.selFormArr.forEach(v => {
- userArr.push(v.user_id);
- })
- level = this.batchAddLevelValue;
- // is_batch = 1;
- } else {
- user_level_arr = {[this.balanceForm.user_id]: JSON.stringify(this.batchAddLevelValue)};
- }
- let data = {
- level: level,
- user_id : userArr.join(),
- // is_batch: is_batch,
- }
- console.info(data);
- request({
- params: {
- r: url
- },
- method: 'post',
- data: data
- }).then(res => {
- that.batchAddLevelSubmitBoo = false;
- if(res.data.code == 0){
- that.batchAddLevelValue = [];
- that.checkedAll = false;
- that.getList();
- }
- that.batchAddLevelBoo = false;
- }).catch(e => {
- that.batchAddLevelSubmitBoo = false;
- that.batchAddLevelBoo = false;
- console.log(e);
- });
- },
- listOfNamesBooSubmit(){
- let that = this;
- let data = "";
- let status = this.balanceForm.status;
- if(this.balanceForm.status == 0){
- status = 1;
- this.balanceForm.is_blacklist = 1;
- }else if(this.balanceForm.status == 1){
- status = 0;
- this.balanceForm.is_blacklist = 0;
- }
- if(this.blacklistType == 2){
- let userArr = []
- this.selFormArr.forEach(v => {
- userArr.push(v.user_id);
- })
- data = {
- user_id: userArr.join(),
- status: status
- }
- } else {
- data = {
- user_id: this.balanceForm.user_id,
- status: status
- }
- }
- // debugger;
- request({
- params: {
- r: 'mall/user/add-blacklist'
- },
- method: 'post',
- data: data
- }).then(res => {
- if(res.data.code == 0){
- that.getList();
- that.listOfNamesBoo = false;
- }else{
- this.$message.error(res.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- },
- resetSearch(){
- this.searchInfo = {
- user_id: '',
- nickname_or_mobile: '', //会员昵称/手机号
- parent_id: '', //浏览路径ID
- source: '',//用户来源
- tag_id: '',//标签筛选
- user_type: 0,//会员类型
- register_start: '',//注册开始时间
- register_end: '',//注册结束时间
- pay_start: '',//上次消费开始时间
- pay_end: '',// 上次消费结束时间
- balance_start: '',//余额开始
- balance_end: '',//余额结束
- score_start: '',//积分开始
- score_end: '',//积分结束
- price_total_start: '',//累计消费金额开始
- price_total_end: '',//累计消费金额结束
- order_total_start: '',//购买次数开始
- order_total_end: '',//购买次数结束
- p_mobile: '',//浏览路径手机号
- }
- this.addTime = '';//注册时间
- this.lastSpendTime = '';//上次消费时间
- },
- tabAll(){
- // console.info(this.checkedAll);
- // console.info(this.$refs.multipleTable);
- this.form.forEach(v => {
- this.$refs.multipleTable.toggleRowSelection(v);
- })
- // this.$refs.multipleTable.clearSelection();
- },
- scFormTab(sel){
- // console.info(sel);
- if(sel.length == this.form.length){
- this.checkedAll = true;
- }else {
- this.checkedAll = false;
- }
- this.selFormArr = sel;
- },
- addLables(){
- // this.balanceForm = Object.assign(this.balanceForm, {user_id: row.user_id});
- // console.info( this.balanceForm);
- /* let key = [];
- row.tag_name.forEach(v => {
- key.push(v.tag_id);
- })
- this.lableValue = key; */
- this.labelSubmitBoo = true;
- this.labelBoo = true;
- },
- batchAddLevel(){
- this.batchAddLevelBoo = true;
- this.batchAddLevelSubmitBoo = true;
- },
- //批量积分操作
- addIntegral(command){
- // console.info(command);
- this.integralForm.num = "";
- if(command == 'cel'){
- this.integralOrBalanceType = 2;
- this.hintBoo = true;
- }else {
- this.integralOrBalanceType = 1;
- }
- this.dialogIntegral = true;
- },
- //批量余额操作
- addBalance(command){
- this.balanceForm.price = "";
- if(command == 'cel'){
- this.integralOrBalanceType = 2;
- this.hintBoo = true;
- }else {
- this.integralOrBalanceType = 1;
- }
- this.dialogBalance = true;
- },
- addCommission(command){
- this.commissionForm.price = "";
- if(command == 'cel'){
- this.integralOrBalanceType = 2;
- this.hintBoo = true;
- }else {
- this.integralOrBalanceType = 1;
- }
- this.dialogCommission = true;
- },
- // 关闭积分余额窗口
- closePop(){
- this.hintBoo = false;
- this.integralOrBalanceType = 1;
- },
- navUserInfo(id){
- this.$navigate({
- r: 'team-data/default/my-customer',
- user_id: id
- })
- },
- navUserDetail(id) {
- navigateTo({
- r: 'mall/user/user-detail',
- id: id
- }, true);
- },
- // 排序
- sortChang(column){
- // console.info(column);
- if(column.order == 'ascending'){
- this.sortFo = 'asc';
- } else if(column.order == 'descending'){
- this.sortFo = 'desc';
- } else {
- this.sortFo = '';
- }
- this.sortPorp = column.prop;
- this.page = 1;
- this.getList();
- },
- // 跳转明细
- typeGoTo(type,id){
- let url = "";
- if(type == 1){
- url = "mall/finance/balance-log";
- }else if(type == 2){
- url = "mall/finance/commission-log";
- }else if(type == 3){
- url = "mall/finance/score-log";
- }else if(type == 4){
- // url = "plugin/red_packet/admin/red-packet/wallet-log";
- url = "mall/currency/wallet-log";
- // red_packet
- this.$navigate({
- r: url,
- user_id: id,
- currency_code: 'red_packet'
- })
- return;
- }
- if(!url){
- return;
- }
- this.$navigate({
- r: url,
- user_id: id
- })
- },
- manualUpdate() {
- this.dataRenewBoo = true;
- request({
- params: {
- r: 'mall/user/manual-execute',
- },
- method: 'post',
- }).then(e => {
- if (e.data.code == 0) {
- this.page = 1;
- this.getList();
- }
- this.dataRenewBoo = false;
- }).catch(e => {
- this.dataRenewBoo = false;
- console.log(e);
- });
- },
- // input表单获取焦点
- focusInputClass(event){
- // console.info(event)
- event.target.parentNode.classList.add("sel_input");
- },
- // input表单失去焦点
- blurInputClass(event){
- // console.info(event)
- event.target.parentNode.classList.remove("sel_input");
- },
- // 修改表格表头样式
- tableStyle({row, column, rowIndex, columnIndex}){
- if(rowIndex === 0){
- // #FAFAFA #F0F7FF
- return "background: #F0F7FF;"
- }
- },
- rowStyle({row, rowIndex}){
- console.info(rowIndex);
- if((rowIndex+1) %2 == 0){
- return "background: #F5F7FB;"
- }
- },
- handleEditRow(row, scope){
- console.log('scope',scope);
- this.editRowId = row.id
- this.editColumnId = scope.column.id
- },
- submitRowChange(row){
- request({
- params: {
- r: 'mall/user/handle-freeze-commission',
- },
- method: 'post',
- data: row.userFreezeCommission
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success(e.data.msg)
- this.page = 1
- this.getList()
- this.handleCancelEdit()
- }else{
- this.$message.error(e.data.msg)
- }
- }).catch(e => {
- console.log(e);
- });
- },
- handleCancelEdit(){
- this.editRowId = 0
- this.editColumnId = -1
- },
- handleClearFreezeCommission(row) {
- let _this = this
- _this.listLoading = true
- _this.$confirm('此操作将永久清除冻结佣金且不可逆, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request({
- params: {
- r: 'mall/user/handle-clear-freeze-commission',
- },
- method: 'post',
- data: {
- id: row.id
- },
- }).then(e => {
- if (e.data.code == 0) {
- _this.$message.success(e.data.msg)
- _this.page = 1
- _this.getList()
- } else {
- _this.$message.error(e.data.msg)
- }
- _this.listLoading = false
- }).catch(e => {
- console.log(e);
- _this.listLoading = false
- });
- }).catch(() => {
- _this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- }
- },
- mounted: function () {
- getQuery('memberLabelIds')? this.searchInfo.memberLabelIds.push( getQuery('memberLabelIds') ):0;
- this.page = getQuery('page') ? getQuery('page') : 1;
- this.label_id = getQuery('label_id');
- if(this.label_id){
- this.$set(this.searchInfo,'lableValue',parseInt(this.label_id));
- }
- this.getList();
- },
- });
- </script>
- <style>
- @media screen and (max-width: 1500px) {
- #app {
- min-width: 1270px;
- }
- }
- .top_title{
- font-weight: 600;
- font-size: 18px;
- margin-right: 12px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-info .el-button {
- /* padding: 0; */
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 0 20px;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .select {
- float: left;
- width: 100px;
- margin-right: 10px;
- }
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- /* .el-table__footer-wrapper, .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- } */
- .stat_details{
- padding: 5px 0 20px;
- display: flex;
- }
- .order_module{
- flex: 1;
- background: #F5F7FA;;
- margin: 0 5px;
- padding: 20px 25px;
- border-radius: 3px;
- text-align: center;
- border: 1px solid #F5F7FA;
- }
- .se_module{
- background: #E8F3FE;
- border: 1px solid #2E8FF4;
- color: #2E8FF4;
- }
- .order_module:last-child{
- margin-right: 0;
- }
- .order_module:first-child{
- margin-left: 0;
- }
- .price{
- font-size: 22px;
- font-weight: bold;
- }
- .oirder_modul_title{
- font-size: 12px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .oirder_modul_title .text{
- margin-right: 4px;
- }
- .stat_icon{
- font-size: 19px;
- color: #BFBFBF;
- }
- .el-col {
- padding: 0;
- }
- .all_flex{
- display: flex;
- }
- .value_input .el-form-item__content{
- display: flex;
- }
- .value_input .el-input-group input{
- width: 58px;
- border-right: 0;
- }
- .value_input .el-input-group{
- display: flex;
- width: 100px;
- }
- .value_input .el-input-group__append{
- display: flex;
- align-items: center;
- justify-content: center;
- background: #FFF;
- }
- .sel_input .el-input-group__append{
- border: 1px solid #03C5FF;
- border-left: 0;
- }
- .search_button{
- /* margin-left: 108px; */
- margin-right: 10px;
- width: 80px;
- }
- .el-table_1_column_3 .cell{
- display: flex;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .no_user{
- position: absolute;
- bottom: 0;
- width: 100%;
- text-align: center;
- white-space: nowrap;
- line-height: normal;
- background: #0000006b;
- color: #FFF;
- border-radius: 30px;
- }
- .el-popover{
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- /* min-width: 80px; */
- }
- .el-button+.el-button{
- margin-left: 0;
- }
- .el-popover .el-button--text{
- color: #2E8FF4;
- }
- .bottom_but{
- margin-right: 20px;
- border: 1px solid #DCDFE6;
- padding: 12px 20px;
- border-radius: 4px;
- line-height: 14px;
- }
- .bottom_but:hover{
- cursor:pointer
- }
- .title_bu:hover{
- cursor:pointer;
- }
- .el-form-item .el-form-item__label{
- font-size: 12px;
- }
- .top_form .el-form-item__label{
- width: 64px !important;
- }
- .top_form .el-form-item__content{
- margin-left: 64px !important;
- }
- .el-form-item__content .el-range-editor{
- width: 100%;
- }
- .el-form-item__content .el-range-editor .el-icon-time{
- display: none;
- }
- .el-form-item__content .el-range-editor .el-range-separator{
- padding: 0;
- width: 8%;
- }
- .el-form-item__content .el-range-editor input{
- width: 49%;
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .order-status-container {
- display: flex;
- justify-content: flex-start;
- text-align: left;
- }
- </style>
|