index.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707
  1. <template>
  2. <!-- 用户-用户列表 -->
  3. <div>
  4. <Card :bordered="false" dis-hover class="ivu-mt" :padding="0">
  5. <div class="padding-add">
  6. <!-- 筛选条件 -->
  7. <Form ref="userFrom" :model="userFrom" :label-width="labelWidth" :label-position="labelPosition"
  8. @submit.native.prevent>
  9. <Row :gutter="24">
  10. <Col span="18">
  11. <Row>
  12. <Col span="24">
  13. <Row>
  14. <Col>
  15. <FormItem label="用户搜索:" label-for="nickname">
  16. <Input v-model="userFrom.nickname" placeholder="请输入" element-id="nickname" clearable
  17. class="input-add">
  18. <Select v-model="field_key" slot="prepend" style="width: 80px">
  19. <Option value="all">全部</Option>
  20. <Option value="uid">UID</Option>
  21. <Option value="phone">手机号</Option>
  22. <Option value="nickname">用户昵称</Option>
  23. </Select>
  24. </Input>
  25. </FormItem>
  26. </Col>
  27. </Row>
  28. </Col>
  29. </Row>
  30. </Col>
  31. <template v-if="collapse">
  32. <Col span="18">
  33. <Row>
  34. <Col>
  35. <FormItem label="用户分组:" label-for="group_id">
  36. <Select v-model="userFrom.group_id" placeholder="请选择" element-id="group_id"
  37. clearable class="input-add">
  38. <!-- <Option value="">全部</Option>-->
  39. <Option :value="item.id" v-for="(item, index) in groupList" :key="index">
  40. {{ item.group_name }}</Option>
  41. </Select>
  42. </FormItem>
  43. </Col>
  44. <Col>
  45. <FormItem label="用户标签:" label-for="label_id">
  46. <div class="labelInput acea-row row-between-wrapper input-add"
  47. @click="openLabelList">
  48. <div>
  49. <div v-if="dataLabel.length">
  50. <Tag closable v-for="(item, index) in dataLabel" :key="index"
  51. @on-close="closeLabel(item)">{{ item.label_name }}</Tag>
  52. </div>
  53. <span class="span" v-else>请选择</span>
  54. </div>
  55. <div class="iconfont iconxiayi"></div>
  56. </div>
  57. </FormItem>
  58. </Col>
  59. <Col>
  60. <FormItem label="性别:" label-for="sex">
  61. <Select v-model="userFrom.sex" placeholder="请选择" clearable class="input-add">
  62. <!-- <Option value="">全部</Option>-->
  63. <Option value="1">男</Option>
  64. <Option value="2">女</Option>
  65. <Option value="0">未知</Option>
  66. </Select>
  67. </FormItem>
  68. </Col>
  69. </Row>
  70. </Col>
  71. <Col span="18">
  72. <Row>
  73. <Col>
  74. <FormItem label="会员等级:" label-for="level">
  75. <Select v-model="userFrom.level" placeholder="请选择" element-id="level" clearable
  76. class="input-add">
  77. <!-- <Option value="">全部</Option>-->
  78. <Option :value="item.id" v-for="(item, index) in levelList" :key="index">
  79. {{ item.name }}</Option>
  80. </Select>
  81. </FormItem>
  82. </Col>
  83. <Col>
  84. <FormItem label="付费会员:" label-for="isMember">
  85. <Select v-model="userFrom.isMember" placeholder="请选择" clearable class="input-add">
  86. <!-- <Option value="">全部</Option>-->
  87. <Option value="1">是</Option>
  88. <Option value="0">否</Option>
  89. </Select>
  90. </FormItem>
  91. </Col>
  92. <Col>
  93. <FormItem label="身份:">
  94. <Select v-model="userFrom.is_promoter" placeholder="请选择" clearable
  95. class="input-add">
  96. <!-- <Option value="">全部</Option>-->
  97. <Option value="1">推广员</Option>
  98. <Option value="0">普通用户</Option>
  99. </Select>
  100. </FormItem>
  101. </Col>
  102. </Row>
  103. </Col>
  104. <Col span="18">
  105. <Row>
  106. <Col class="dateMedia">
  107. <FormItem label="访问时间:" label-for="user_time">
  108. <DatePicker :editable="false" @on-change="onchangeTime" :value="timeVal"
  109. format="yyyy/MM/dd" type="daterange" placement="bottom-start"
  110. placeholder="自定义时间" :options="options" class="input-add"></DatePicker>
  111. </FormItem>
  112. </Col>
  113. <Col>
  114. <FormItem label="访问情况:" label-for="user_time_type">
  115. <Select v-model="userFrom.user_time_type" placeholder="请选择"
  116. element-id="user_time_type" clearable class="input-add">
  117. <!-- <Option value="all">全部</Option>-->
  118. <Option value="visitno">时间段未访问</Option>
  119. <Option value="visit">时间段访问过</Option>
  120. <Option value="add_time">首次访问</Option>
  121. </Select>
  122. </FormItem>
  123. </Col>
  124. <Col>
  125. <FormItem label="下单次数:" label-for="pay_count">
  126. <Select v-model="userFrom.pay_count" placeholder="请选择" element-id="pay_count"
  127. clearable class="input-add">
  128. <!-- <Option value="">全部</Option>-->
  129. <Option value="-1">0次</Option>
  130. <Option value="0">1次以上</Option>
  131. <Option value="1">2次以上</Option>
  132. <Option value="2">3次以上</Option>
  133. <Option value="3">4次以上</Option>
  134. <Option value="4">5次以上</Option>
  135. </Select>
  136. </FormItem>
  137. </Col>
  138. </Row>
  139. </Col>
  140. <Col span="18">
  141. <Row>
  142. <Col>
  143. <FormItem label="国家:" label-for="country">
  144. <Select v-model="userFrom.country" placeholder="请选择" element-id="country" clearable
  145. @on-change="changeCountry" class="input-add">
  146. <!-- <Option value="">全部</Option>-->
  147. <Option value="domestic">中国</Option>
  148. <Option value="abroad">其他</Option>
  149. </Select>
  150. </FormItem>
  151. </Col>
  152. <Col v-if="userFrom.country === 'domestic'">
  153. <FormItem label="省份:">
  154. <Cascader :data="addresData" change-on-select :value="address" v-model="address"
  155. @on-change="handleChange" class="input-add"></Cascader>
  156. </FormItem>
  157. </Col>
  158. </Row>
  159. </Col>
  160. </template>
  161. <Col span="6" class="ivu-text-right userFrom">
  162. <FormItem>
  163. <Button type="primary" label="default" class="mr15" @click="userSearchs">搜索</Button>
  164. <Button class="ResetSearch" @click="reset('userFrom')">重置</Button>
  165. <a v-font="14" class="ivu-ml-8" @click="collapse = !collapse">
  166. <template v-if="!collapse">
  167. 展开
  168. <Icon type="ios-arrow-down" />
  169. </template>
  170. <template v-else>
  171. 收起
  172. <Icon type="ios-arrow-up" />
  173. </template>
  174. </a>
  175. </FormItem>
  176. </Col>
  177. </Row>
  178. </Form>
  179. </div>
  180. </Card>
  181. <Card :bordered="false" dis-hover class="ivu-mt listbox">
  182. <div class="new_tab">
  183. <!-- Tab栏切换 -->
  184. <Tabs v-model="headeType" @on-click="onClickTab">
  185. <TabPane :label="item.name" :name="item.type" v-for="(item, index) in headeNum" :key="index" />
  186. </Tabs>
  187. </div>
  188. <Row type="flex" justify="space-between">
  189. <!-- 相关操作 -->
  190. <Col span="24">
  191. <Button v-auth="['admin-user-save']" type="primary" class="mr20" @click="save">添加用户</Button>
  192. <Tooltip content="本页至少选中一项" :disabled="!!checkUidList.length && isAll==0">
  193. <Button v-auth="['admin-user-coupon']" type="primary" class="mr20"
  194. :disabled="!checkUidList.length && isAll==0" @click="onSend">发送优惠券</Button>
  195. </Tooltip>
  196. <Tooltip content="本页至少选中一项" :disabled="!!checkUidList.length && isAll==0">
  197. <Button v-auth="['admin-wechat-news']" class="greens mr20" size="default"
  198. :disabled="!checkUidList.length && isAll==0" @click="onSendPic"
  199. v-if="userFrom.user_type === 'wechat'">
  200. <Icon type="md-list"></Icon>
  201. 发送图文消息
  202. </Button>
  203. </Tooltip>
  204. <Tooltip content="本页至少选中一项" :disabled="!!checkUidList.length && isAll==0">
  205. <Button v-auth="['admin-user-set_label']" class="mr20" :disabled="!checkUidList.length && isAll==0"
  206. @click="setBatch">批量设置</Button>
  207. </Tooltip>
  208. </Col>
  209. </Row>
  210. <!-- 用户列表表格 -->
  211. <vxe-table ref="xTable" class="mt25" :loading="loading" row-id="uid" :expand-config="{accordion: true}"
  212. :checkbox-config="{reserve: true}" @checkbox-all="checkboxAll" @checkbox-change="checkboxItem"
  213. :data="userLists">
  214. <vxe-column type="" width="0"></vxe-column>
  215. <vxe-column type="expand" width="35">
  216. <template #content="{ row }">
  217. <div class="tdinfo">
  218. <Row class="expand-row">
  219. <Col span="6">
  220. <span class="expand-key">首次访问:</span>
  221. <span class="expand-value"> {{row.add_time | formatDate}}</span>
  222. </Col>
  223. <Col span="6">
  224. <span class="expand-key">近次访问:</span>
  225. <span class="expand-value">{{row.last_time | formatDate}}</span>
  226. </Col>
  227. <Col span="6">
  228. <span class="expand-key">身份证号:</span>
  229. <span class="expand-value">{{row.card_id}}</span>
  230. </Col>
  231. <Col span="6">
  232. <span class="expand-key">真实姓名:</span>
  233. <span class="expand-value">{{row.real_name}}</span>
  234. </Col>
  235. <!-- <Col span="6">
  236. <span class="expand-key">手机号:</span>
  237. <span class="expand-value">{{row.phone}}</span>
  238. </Col> -->
  239. </Row>
  240. <Row class="expand-row">
  241. <!-- <Col span="6">
  242. <span class="expand-key">真实姓名:</span>
  243. <span class="expand-value">{{row.real_name}}</span>
  244. </Col> -->
  245. <Col span="6">
  246. <span class="expand-key">标签:</span>
  247. <span class="expand-value">{{row.labels}}</span>
  248. </Col>
  249. <Col span="6">
  250. <span class="expand-key">生日:</span>
  251. <span class="expand-value">{{row.birthday}}</span>
  252. </Col>
  253. <Col span="6">
  254. <span class="expand-key">地址:</span>
  255. <span class="expand-value">{{row.addres}}</span>
  256. </Col>
  257. </Row>
  258. <Row class="expand-row">
  259. <Col span="6">
  260. <span class="expand-key">备注:</span>
  261. <span class="expand-value">{{row.mark}}</span>
  262. </Col>
  263. </Row>
  264. </div>
  265. </template>
  266. </vxe-column>
  267. <vxe-column type="checkbox" width="100">
  268. <template #header>
  269. <div>
  270. <Dropdown transfer @on-click="allPages">
  271. <a href="javascript:void(0)" class="acea-row row-middle">
  272. <span>全选({{isAll==1?(total-checkUidList.length):checkUidList.length}})</span>
  273. <Icon type="ios-arrow-down"></Icon>
  274. </a>
  275. <template #list>
  276. <DropdownMenu>
  277. <DropdownItem name="0">当前页</DropdownItem>
  278. <DropdownItem name="1">所有页</DropdownItem>
  279. </DropdownMenu>
  280. </template>
  281. </Dropdown>
  282. </div>
  283. </template>
  284. </vxe-column>
  285. <vxe-column field="uid" title="UID" width="60"></vxe-column>
  286. <vxe-column field="avatars" title="头像" width="50">
  287. <template v-slot="{ row }">
  288. <viewer>
  289. <div class="tabBox_img">
  290. <img v-lazy="row.avatar" />
  291. </div>
  292. </viewer>
  293. </template>
  294. </vxe-column>
  295. <vxe-column field="nickname" title="昵称" min-width="150">
  296. <template v-slot="{ row }">
  297. <div class="acea-row">
  298. <Icon type="md-male" v-show="row.sex === '男'" color="#2db7f5" size="15" class="mr5" />
  299. <Icon type="md-female" v-show="row.sex === '女'" color="#ed4014" size="15" class="mr5" />
  300. <div v-if="row.delete_time != null" style="color:#ed4014;">{{row.nickname}} (已注销)</div>
  301. <div v-else v-text="row.nickname"></div>
  302. </div>
  303. </template>
  304. </vxe-column>
  305. <vxe-column field="isMember" title="付费会员" min-width="90">
  306. <template v-slot="{ row }">
  307. <div>{{ row.isMember ? "是" : "否" }}</div>
  308. </template>
  309. </vxe-column>
  310. <vxe-column field="level" title="用户等级" min-width="90"></vxe-column>
  311. <vxe-column field="group_id" title="分组" min-width="100"></vxe-column>
  312. <vxe-column field="phone" title="手机号" min-width="110"></vxe-column>
  313. <vxe-column field="user_type" title="用户类型" min-width="100"></vxe-column>
  314. <vxe-column field="spread_uid_nickname" title="推荐人" min-width="100"></vxe-column>
  315. <vxe-column field="now_money" title="余额" min-width="100"></vxe-column>
  316. <vxe-column field="action" title="操作" align="center" width="180" fixed="right">
  317. <template v-slot="{ row }">
  318. <a @click="lookJl(row)">奖励股权明细</a>
  319. <Divider type="vertical" />
  320. <span v-if="row.delete_time != null" style="color: #c5c8ce;">编辑</span>
  321. <a v-else @click="edit(row)">编辑</a>
  322. <Divider type="vertical" v-if="row.is_extend_info" />
  323. <a @click="extendInfo(row)" v-if="row.is_extend_info">信息补充</a>
  324. <Divider type="vertical" />
  325. <a @click="changeMenu(row, '1')">详情</a>
  326. </template>
  327. </vxe-column>
  328. </vxe-table>
  329. <vxe-pager class="mt20" border size="medium" :page-size="userFrom.limit" :current-page="userFrom.page"
  330. :total="total" :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Total']"
  331. @page-change="pageChange">
  332. </vxe-pager>
  333. </Card>
  334. <!-- 用户标签 -->
  335. <Modal v-model="labelListShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true"
  336. :mask-closable="false">
  337. <labelList ref="labelList" @activeData="activeData" @close="labelListClose"></labelList>
  338. </Modal>
  339. <!-- 编辑表单 积分余额-->
  340. <edit-from ref="edits" :FromData="FromData" :userEdit="1" @submitFail="submitFail"></edit-from>
  341. <!-- 发送优惠券-->
  342. <send-from ref="sends" :is-all="isAll" :where="userFrom" :userIds="checkUidList.join(',')"></send-from>
  343. <!-- 会员详情-->
  344. <user-details ref="userDetails" :group-list="groupList"></user-details>
  345. <!--发送图文消息 -->
  346. <Modal v-model="modal13" scrollable title="发送消息" width="1200" height="800" footer-hide class="modelBox">
  347. <news-category v-if="modal13" :isShowSend="isShowSend" :is-all="isAll" :where="userFrom"
  348. :userIds="checkUidList.join(',')" :scrollerHeight="scrollerHeight" :contentTop="contentTop"
  349. :contentWidth="contentWidth" :maxCols="maxCols"></news-category>
  350. </Modal>
  351. <!--修改推广人-->
  352. <Modal v-model="promoterShow" scrollable title="修改推广人" class="order_box" :closable="false">
  353. <Form ref="formInline" :model="formInline" :label-width="100" @submit.native.prevent>
  354. <FormItem label="用户头像:" prop="image">
  355. <div class="picBox" @click="customer">
  356. <div class="pictrue" v-if="formInline.image">
  357. <img v-lazy="formInline.image" />
  358. </div>
  359. <div class="upLoad acea-row row-center-wrapper" v-else>
  360. <Icon type="ios-camera-outline" size="26" />
  361. </div>
  362. </div>
  363. </FormItem>
  364. </Form>
  365. <div slot="footer">
  366. <Button type="primary" @click="putSend('formInline')">提交</Button>
  367. <Button @click="cancel('formInline')">取消</Button>
  368. </div>
  369. </Modal>
  370. <Modal v-model="customerShow" scrollable title="请选择商城用户" :closable="false" width="900">
  371. <customerInfo v-if="customerShow" @imageObject="imageObject"></customerInfo>
  372. </Modal>
  373. <Modal v-model="labelShow" scrollable title="选择用户标签" :closable="true" width="540" :footer-hide="true">
  374. <userLabel :uid="labelActive.uid" @close="labelClose"></userLabel>
  375. </Modal>
  376. <!-- 批量设置 -->
  377. <Modal v-model="batchModal" title="批量设置" width="750" class-name="batch-modal"
  378. @on-visible-change="batchVisibleChange">
  379. <Alert show-icon>每次只能修改一项,如需修改多项,请多次操作。</Alert>
  380. <Row type="flex" align="middle">
  381. <Col span="4">
  382. <Menu :active-name="menuActive" width="auto" @on-select="menuSelect">
  383. <MenuItem :name="1">用户分组</MenuItem>
  384. <MenuItem :name="2">用户标签</MenuItem>
  385. <MenuItem :name="3">用户等级</MenuItem>
  386. <MenuItem :name="4">积分余额</MenuItem>
  387. <MenuItem :name="5">赠送会员</MenuItem>
  388. <MenuItem :name="6">上级推广人</MenuItem>
  389. </Menu>
  390. </Col>
  391. <Col span="20">
  392. <Form :model="batchData" :label-width="122">
  393. <FormItem v-if="menuActive === 1" label="用户分组:">
  394. <Select v-model="batchData.group_id">
  395. <Option v-for="item in groupList" :key="item.id" :value="item.id">{{ item.group_name }}
  396. </Option>
  397. </Select>
  398. </FormItem>
  399. <FormItem v-if="menuActive === 2" label="用户标签:">
  400. <div class="select-tag" @click="openLabelList">
  401. <div v-if="batchLabel.length">
  402. <Tag v-for="item in batchLabel" :key="item.id" closable @on-close="tagClose(item.id)">
  403. {{ item.label_name }}</Tag>
  404. </div>
  405. <span v-else class="placeholder">请选择</span>
  406. <Icon type="ios-arrow-down" />
  407. </div>
  408. </FormItem>
  409. <FormItem v-if="menuActive === 3" label="用户等级:">
  410. <Select v-model="batchData.level_id">
  411. <Option v-for="item in levelList" :key="item.id" :value="item.id">{{ item.name }}</Option>
  412. </Select>
  413. </FormItem>
  414. <FormItem v-if="menuActive === 4" label="修改余额:">
  415. <RadioGroup v-model="batchData.money_status">
  416. <Radio :label="1">增加</Radio>
  417. <Radio :label="2">减少</Radio>
  418. </RadioGroup>
  419. </FormItem>
  420. <FormItem v-if="menuActive === 4" label="余额:">
  421. <InputNumber v-model="batchData.money" :min="0" :max="999999"></InputNumber>
  422. </FormItem>
  423. <FormItem v-if="menuActive === 4" label="修改积分:">
  424. <RadioGroup v-model="batchData.integration_status">
  425. <Radio :label="1">增加</Radio>
  426. <Radio :label="2">减少</Radio>
  427. </RadioGroup>
  428. </FormItem>
  429. <FormItem v-if="menuActive === 4" label="积分:">
  430. <InputNumber v-model="batchData.integration" :min="0" :max="999999"></InputNumber>
  431. </FormItem>
  432. <FormItem v-if="menuActive === 5" label="修改时长:">
  433. <RadioGroup v-model="batchData.days_status">
  434. <Radio :label="1">增加</Radio>
  435. <Radio :label="2">减少</Radio>
  436. </RadioGroup>
  437. </FormItem>
  438. <FormItem v-if="menuActive === 5" label="修改时长(天):">
  439. <InputNumber v-model="batchData.day" :min="0" :max="999999"></InputNumber>
  440. </FormItem>
  441. <FormItem v-if="menuActive === 6" label="上级推广员:">
  442. <Input :value="spread_name" placeholder="请选择" icon="ios-arrow-down" @on-click="customer"
  443. @on-focus="customer"></Input>
  444. </FormItem>
  445. </Form>
  446. </Col>
  447. </Row>
  448. <div slot="footer">
  449. <Button @click="cancelBatch">取消</Button>
  450. <Button type="primary" @click="saveBatch">保存</Button>
  451. </div>
  452. </Modal>
  453. <user-jl ref="userJlList"></user-jl> >
  454. </div>
  455. </template>
  456. <script>
  457. import {
  458. formatDate
  459. } from '@/utils/validate';
  460. import userLabel from "../../../components/userLabel";
  461. import labelList from "@/components/labelList";
  462. import {
  463. mapState
  464. } from "vuex";
  465. import expandRow from "./tableExpand.vue";
  466. import {
  467. userList,
  468. getUserData,
  469. isShowApi,
  470. editOtherApi,
  471. giveLevelApi,
  472. userSetGroup,
  473. userGroupApi,
  474. levelListApi,
  475. userSetLabelApi,
  476. userLabelApi,
  477. userSynchro,
  478. getUserSaveForm,
  479. giveLevelTimeApi,
  480. extendInfo,
  481. batchProcess
  482. } from "@/api/user";
  483. import {
  484. agentSpreadApi
  485. } from "@/api/agent";
  486. import editFrom from "../../../components/from/from";
  487. import sendFrom from "@/components/sendCoupons/index";
  488. import userDetails from "./handle/userDetails";
  489. import newsCategory from "@/components/newsCategory/index";
  490. import city from "@/utils/city";
  491. import customerInfo from "@/components/customerInfo";
  492. import userJl from "./handle/userJl.vue";
  493. export default {
  494. name: "user_list",
  495. filters: {
  496. formatDate(time) {
  497. if (time !== 0) {
  498. let date = new Date(time * 1000);
  499. return formatDate(date, 'yyyy-MM-dd hh:mm');
  500. }
  501. }
  502. },
  503. components: {
  504. userJl,
  505. expandRow,
  506. editFrom,
  507. sendFrom,
  508. userDetails,
  509. newsCategory,
  510. customerInfo,
  511. userLabel,
  512. labelList,
  513. },
  514. data() {
  515. return {
  516. dataLabel: [],
  517. labelListShow: false,
  518. labelShow: false,
  519. customerShow: false,
  520. promoterShow: false,
  521. labelActive: {
  522. uid: 0,
  523. },
  524. formInline: {
  525. uid: 0,
  526. spread_uid: 0,
  527. image: "",
  528. },
  529. options: {
  530. shortcuts: [{
  531. text: "今天",
  532. value() {
  533. const end = new Date();
  534. const start = new Date();
  535. start.setTime(
  536. new Date(
  537. new Date().getFullYear(),
  538. new Date().getMonth(),
  539. new Date().getDate()
  540. )
  541. );
  542. return [start, end];
  543. },
  544. },
  545. {
  546. text: "昨天",
  547. value() {
  548. const end = new Date();
  549. const start = new Date();
  550. start.setTime(
  551. start.setTime(
  552. new Date(
  553. new Date().getFullYear(),
  554. new Date().getMonth(),
  555. new Date().getDate() - 1
  556. )
  557. )
  558. );
  559. end.setTime(
  560. end.setTime(
  561. new Date(
  562. new Date().getFullYear(),
  563. new Date().getMonth(),
  564. new Date().getDate() - 1
  565. )
  566. )
  567. );
  568. return [start, end];
  569. },
  570. },
  571. {
  572. text: "最近7天",
  573. value() {
  574. const end = new Date();
  575. const start = new Date();
  576. start.setTime(
  577. start.setTime(
  578. new Date(
  579. new Date().getFullYear(),
  580. new Date().getMonth(),
  581. new Date().getDate() - 6
  582. )
  583. )
  584. );
  585. return [start, end];
  586. },
  587. },
  588. {
  589. text: "最近30天",
  590. value() {
  591. const end = new Date();
  592. const start = new Date();
  593. start.setTime(
  594. start.setTime(
  595. new Date(
  596. new Date().getFullYear(),
  597. new Date().getMonth(),
  598. new Date().getDate() - 29
  599. )
  600. )
  601. );
  602. return [start, end];
  603. },
  604. },
  605. {
  606. text: "上月",
  607. value() {
  608. const end = new Date();
  609. const start = new Date();
  610. const day = new Date(start.getFullYear(), start.getMonth(), 0).getDate();
  611. start.setTime(
  612. start.setTime(
  613. new Date(new Date().getFullYear(), new Date().getMonth() - 1, 1)
  614. )
  615. );
  616. end.setTime(
  617. end.setTime(
  618. new Date(new Date().getFullYear(), new Date().getMonth() - 1, day)
  619. )
  620. );
  621. return [start, end];
  622. },
  623. },
  624. {
  625. text: "本月",
  626. value() {
  627. const end = new Date();
  628. const start = new Date();
  629. start.setTime(
  630. start.setTime(
  631. new Date(new Date().getFullYear(), new Date().getMonth(), 1)
  632. )
  633. );
  634. return [start, end];
  635. },
  636. },
  637. {
  638. text: "本年",
  639. value() {
  640. const end = new Date();
  641. const start = new Date();
  642. start.setTime(
  643. start.setTime(new Date(new Date().getFullYear(), 0, 1))
  644. );
  645. return [start, end];
  646. },
  647. },
  648. ],
  649. },
  650. collapse: false,
  651. headeType: "-1",
  652. headeNum: [{
  653. type: "-1",
  654. name: "全部"
  655. },
  656. {
  657. type: "wechat",
  658. name: "微信公众号"
  659. },
  660. {
  661. type: "routine",
  662. name: "微信小程序"
  663. },
  664. {
  665. type: "h5",
  666. name: "H5"
  667. },
  668. {
  669. type: "pc",
  670. name: "PC"
  671. },
  672. {
  673. type: "app",
  674. name: "APP"
  675. },
  676. ],
  677. address: [],
  678. addresData: city,
  679. isShowSend: true,
  680. modal13: false,
  681. maxCols: 4,
  682. scrollerHeight: "600",
  683. contentTop: "130",
  684. contentWidth: "98%",
  685. // grid: {
  686. // xl: 8,
  687. // lg: 8,
  688. // md: 12,
  689. // sm: 24,
  690. // xs: 24,
  691. // },
  692. grid2: {
  693. xl: 18,
  694. lg: 16,
  695. md: 12,
  696. sm: 24,
  697. xs: 24,
  698. },
  699. loading: false,
  700. total: 0,
  701. userFrom: {
  702. label_id: "",
  703. user_type: "",
  704. status: "",
  705. sex: "",
  706. is_promoter: "",
  707. country: "",
  708. isMember: "",
  709. pay_count: "",
  710. user_time_type: "",
  711. user_time: "",
  712. nickname: "",
  713. province: "",
  714. city: "",
  715. page: 1,
  716. limit: 15,
  717. level: "",
  718. group_id: "",
  719. field_key: "",
  720. },
  721. field_key: "",
  722. level: "",
  723. group_id: "",
  724. label_id: "",
  725. user_time_type: "",
  726. pay_count: "",
  727. userLists: [],
  728. FromData: null,
  729. selectionList: [],
  730. user_ids: "",
  731. selectedData: [],
  732. timeVal: [],
  733. array_ids: [],
  734. groupList: [],
  735. levelList: [],
  736. labelFrom: {
  737. page: 1,
  738. limit: "",
  739. },
  740. labelLists: [],
  741. display: "none",
  742. checkBox: false,
  743. selectionCopy: [],
  744. isCheckBox: false,
  745. isAll: 0,
  746. userId: 0,
  747. checkUidList: [],
  748. batchModal: false,
  749. menuActive: 1,
  750. batchLabel: [],
  751. batchData: {
  752. group_id: 0,
  753. label_id: [],
  754. level_id: 0,
  755. money_status: 0,
  756. money: 0,
  757. integration_status: 0,
  758. integration: 0,
  759. days_status: 1,
  760. day: 0,
  761. spread_uid: '',
  762. },
  763. spread_name: ''
  764. };
  765. },
  766. watch: {
  767. selectionList(value) {
  768. let arr = value.map((item) => item.uid);
  769. this.array_ids = arr;
  770. this.user_ids = arr.join();
  771. },
  772. userLists: {
  773. deep: true,
  774. handler(value) {
  775. value.forEach((item) => {
  776. this.selectionList.forEach((itm) => {
  777. if (itm.uid === item.uid) {
  778. item.checkBox = true;
  779. }
  780. });
  781. });
  782. const arr = this.userLists.filter((item) => item.checkBox);
  783. if (this.userLists.length) {
  784. this.checkBox = this.userLists.length === arr.length;
  785. } else {
  786. this.checkBox = false;
  787. }
  788. },
  789. },
  790. },
  791. computed: {
  792. ...mapState("admin/layout", ["isMobile"]),
  793. labelWidth() {
  794. return this.isMobile ? undefined : 100;
  795. },
  796. labelPosition() {
  797. return this.isMobile ? "top" : "right";
  798. },
  799. },
  800. created() {
  801. this.getList();
  802. },
  803. mounted() {
  804. this.userGroup();
  805. this.levelLists();
  806. this.groupLists();
  807. },
  808. methods: {
  809. lookJl(row) {
  810. this.$refs.userJlList.modals = true;
  811. this.$refs.userJlList.getList(row);
  812. },
  813. checkboxItem(e) {
  814. let uid = parseInt(e.rowid);
  815. let index = this.checkUidList.indexOf(uid);
  816. if (index !== -1) {
  817. this.checkUidList = this.checkUidList.filter((item) => item !== uid);
  818. } else {
  819. this.checkUidList.push(uid);
  820. }
  821. },
  822. checkboxAll() {
  823. // 获取选中当前值
  824. let obj2 = this.$refs.xTable.getCheckboxRecords(true);
  825. // 获取之前选中值
  826. let obj = this.$refs.xTable.getCheckboxReserveRecords(true);
  827. if (this.isAll == 0 && this.checkUidList.length <= obj.length && !this.isCheckBox) {
  828. obj = [];
  829. }
  830. obj = obj.concat(obj2);
  831. let uids = [];
  832. obj.forEach((item) => {
  833. uids.push(parseInt(item.uid))
  834. })
  835. this.checkUidList = uids;
  836. if (!obj2.length) {
  837. this.isCheckBox = false;
  838. }
  839. },
  840. allPages(e) {
  841. this.isAll = e;
  842. if (e == 0) {
  843. this.$refs.xTable.toggleAllCheckboxRow();
  844. // this.checkboxAll();
  845. } else {
  846. if (!this.isCheckBox) {
  847. this.$refs.xTable.setAllCheckboxRow(true);
  848. this.isCheckBox = true;
  849. this.isAll = 1;
  850. } else {
  851. this.$refs.xTable.setAllCheckboxRow(false);
  852. this.isCheckBox = false;
  853. this.isAll = 0;
  854. }
  855. this.checkUidList = []
  856. }
  857. },
  858. closeLabel(label) {
  859. let index = this.dataLabel.indexOf(
  860. this.dataLabel.filter((d) => d.id == label.id)[0]
  861. );
  862. this.dataLabel.splice(index, 1);
  863. },
  864. activeData(dataLabel) {
  865. this.labelListShow = false;
  866. if (this.batchModal && this.menuActive === 2) {
  867. this.batchLabel = dataLabel;
  868. this.batchData.label_id = dataLabel.map(item => item.id);
  869. } else {
  870. this.dataLabel = dataLabel;
  871. }
  872. },
  873. openLabelList(row) {
  874. this.labelListShow = true;
  875. let data = JSON.parse(JSON.stringify(this.dataLabel));
  876. if (this.batchModal && this.menuActive === 2) {
  877. data = JSON.parse(JSON.stringify(this.batchLabel));
  878. }
  879. this.$refs.labelList.userLabel(data);
  880. },
  881. // 标签弹窗关闭
  882. labelListClose() {
  883. this.labelListShow = false;
  884. },
  885. // 标签弹窗关闭
  886. labelClose(e) {
  887. if (!e) {
  888. this.getList();
  889. }
  890. this.labelShow = false;
  891. this.labelActive.uid = 0;
  892. },
  893. // 提交
  894. putSend(name) {
  895. this.$refs[name].validate((valid) => {
  896. if (valid) {
  897. if (!this.formInline.spread_uid) {
  898. return this.$Message.error("请上传用户");
  899. }
  900. agentSpreadApi(this.formInline)
  901. .then((res) => {
  902. this.promoterShow = false;
  903. this.$Message.success(res.msg);
  904. this.getList();
  905. this.$refs[name].resetFields();
  906. })
  907. .catch((res) => {
  908. this.$Message.error(res.msg);
  909. });
  910. }
  911. });
  912. },
  913. save() {
  914. this.$modalForm(getUserSaveForm()).then(() => this.getList());
  915. // getUserSaveForm().then(async (res) => {
  916. // if(res.data.status === false){
  917. // return this.$authLapse(res.data);
  918. // }
  919. // this.FromData = res.data;
  920. // this.$refs.edits.modals = true;
  921. // }).catch(err=>{
  922. // this.$Message.error(err.msg);
  923. // })
  924. },
  925. synchro() {
  926. userSynchro()
  927. .then((res) => {
  928. this.$Message.success(res.msg);
  929. })
  930. .catch((err) => {
  931. this.$Message.error(err.msg);
  932. });
  933. },
  934. // 分组列表
  935. groupLists() {
  936. this.loading = true;
  937. userLabelApi(this.labelFrom)
  938. .then(async (res) => {
  939. let data = res.data;
  940. this.labelLists = data.list;
  941. })
  942. .catch((res) => {
  943. this.loading = false;
  944. this.$Message.error(res.msg);
  945. });
  946. },
  947. onClickTab(type) {
  948. this.isAll = 0;
  949. this.isCheckBox = false;
  950. this.$refs.xTable.setAllCheckboxRow(false);
  951. this.checkUidList = [];
  952. this.userFrom.page = 1;
  953. this.userFrom.user_type = type == -1 ? '' : type;
  954. this.getList();
  955. },
  956. userGroup() {
  957. let data = {
  958. page: 1,
  959. limit: "",
  960. };
  961. userGroupApi(data).then((res) => {
  962. this.groupList = res.data.list;
  963. });
  964. },
  965. levelLists() {
  966. let data = {
  967. page: 1,
  968. limit: "",
  969. title: "",
  970. is_show: 1,
  971. };
  972. levelListApi(data).then((res) => {
  973. this.levelList = res.data.list;
  974. });
  975. },
  976. // 批量设置分组;
  977. setGroup() {
  978. if (this.selectionList.length === 0) {
  979. this.$Message.warning("请选择要设置分组的用户");
  980. } else {
  981. let uids = {
  982. all: this.isAll,
  983. uids: this.array_ids
  984. };
  985. if (this.isAll == 1) {
  986. uids.where = this.userFrom;
  987. uids.where = {
  988. city: this.userFrom.city,
  989. country: this.userFrom.country,
  990. field_key: this.userFrom.field_key,
  991. group_id: this.userFrom.group_id,
  992. isMember: this.userFrom.isMember,
  993. is_promoter: this.userFrom.is_promoter,
  994. label_id: this.userFrom.label_id,
  995. level: this.userFrom.level,
  996. nickname: this.userFrom.nickname,
  997. pay_count: this.userFrom.pay_count,
  998. province: this.userFrom.province,
  999. sex: this.userFrom.sex,
  1000. status: this.userFrom.status,
  1001. user_time: this.userFrom.user_time,
  1002. user_time_type: this.userFrom.user_time_type,
  1003. user_type: this.userFrom.user_type,
  1004. };
  1005. }
  1006. this.$modalForm(userSetGroup(uids)).then(() => this.getList());
  1007. }
  1008. },
  1009. // 批量设置标签;
  1010. setLabel() {
  1011. if (this.selectionList.length === 0) {
  1012. this.$Message.warning("请选择要设置标签的用户");
  1013. } else {
  1014. let uids = {
  1015. all: this.isAll,
  1016. uids: this.array_ids
  1017. };
  1018. if (this.isAll == 1) {
  1019. uids.where = {
  1020. city: this.userFrom.city,
  1021. country: this.userFrom.country,
  1022. field_key: this.userFrom.field_key,
  1023. group_id: this.userFrom.group_id,
  1024. isMember: this.userFrom.isMember,
  1025. is_promoter: this.userFrom.is_promoter,
  1026. label_id: this.userFrom.label_id,
  1027. level: this.userFrom.level,
  1028. nickname: this.userFrom.nickname,
  1029. pay_count: this.userFrom.pay_count,
  1030. province: this.userFrom.province,
  1031. sex: this.userFrom.sex,
  1032. status: this.userFrom.status,
  1033. user_time: this.userFrom.user_time,
  1034. user_time_type: this.userFrom.user_time_type,
  1035. user_type: this.userFrom.user_type,
  1036. };
  1037. }
  1038. this.labelShow = true;
  1039. this.labelActive.uid = uids;
  1040. // this.$modalForm(userSetLabelApi(uids)).then(() => this.getList());
  1041. }
  1042. },
  1043. // 是否为付费会员;
  1044. changeMember() {
  1045. this.userFrom.page = 1;
  1046. this.getList();
  1047. },
  1048. // 选择国家
  1049. changeCountry() {
  1050. if (this.userFrom.country === "abroad" || !this.userFrom.country) {
  1051. this.selectedData = [];
  1052. this.userFrom.province = "";
  1053. this.userFrom.city = "";
  1054. this.address = [];
  1055. }
  1056. },
  1057. // 选择地址
  1058. handleChange(value, selectedData) {
  1059. this.selectedData = selectedData.map((o) => o.label);
  1060. this.userFrom.province = this.selectedData[0];
  1061. this.userFrom.city = this.selectedData[1];
  1062. },
  1063. // 具体日期
  1064. onchangeTime(e) {
  1065. this.timeVal = e;
  1066. this.userFrom.user_time = this.timeVal[0] ? this.timeVal.join("-") : "";
  1067. },
  1068. // 操作
  1069. changeMenu(row, name, index) {
  1070. this.userId = row.uid;
  1071. let uid = [];
  1072. uid.push(row.uid);
  1073. let uids = {
  1074. uids: uid
  1075. };
  1076. switch (name) {
  1077. case "1":
  1078. this.$refs.userDetails.modals = true;
  1079. this.$refs.userDetails.activeName = "info";
  1080. this.$refs.userDetails.getDetails(row.uid);
  1081. break;
  1082. case "2":
  1083. this.getOtherFrom(row.uid);
  1084. break;
  1085. case "3":
  1086. // this.giveLevel(row.uid);
  1087. this.giveLevelTime(row.uid);
  1088. break;
  1089. case "4":
  1090. this.del(
  1091. row,
  1092. "清除 【 " + row.nickname + " 】的会员等级",
  1093. index,
  1094. "user"
  1095. );
  1096. break;
  1097. case "5":
  1098. this.$modalForm(userSetGroup(uids)).then(() =>
  1099. this.$refs.sends.getList()
  1100. );
  1101. break;
  1102. case "6":
  1103. this.openLabel(row);
  1104. // this.$modalForm(userSetLabelApi(uids)).then(() => this.$refs.sends.getList());
  1105. break;
  1106. case "7":
  1107. this.editS(row);
  1108. break;
  1109. default:
  1110. this.del(
  1111. row,
  1112. "解除【 " + row.nickname + " 】的上级推广人",
  1113. index,
  1114. "tuiguang"
  1115. );
  1116. break;
  1117. // this.del(row, '清除 【 ' + row.nickname + ' 】的会员等级', index)
  1118. }
  1119. },
  1120. openLabel(row) {
  1121. this.labelShow = true;
  1122. this.labelActive.uid = row.uid;
  1123. },
  1124. editS(row) {
  1125. this.promoterShow = true;
  1126. this.formInline.uid = row.uid;
  1127. },
  1128. customer() {
  1129. this.customerShow = true;
  1130. },
  1131. imageObject(e) {
  1132. this.customerShow = false;
  1133. if (this.batchModal && this.menuActive === 6) {
  1134. this.batchData.spread_uid = e.uid;
  1135. this.spread_name = e.name;
  1136. } else {
  1137. this.formInline.spread_uid = e.uid;
  1138. this.formInline.image = e.image;
  1139. }
  1140. },
  1141. cancel(name) {
  1142. this.promoterShow = false;
  1143. this.$refs[name].resetFields();
  1144. },
  1145. // 赠送会员等级
  1146. giveLevel(id) {
  1147. giveLevelApi(id)
  1148. .then(async (res) => {
  1149. if (res.data.status === false) {
  1150. return this.$authLapse(res.data);
  1151. }
  1152. this.FromData = res.data;
  1153. this.$refs.edits.modals = true;
  1154. })
  1155. .catch((res) => {
  1156. this.$Message.error(res.msg);
  1157. });
  1158. },
  1159. // 赠送会员等级
  1160. giveLevelTime(id) {
  1161. giveLevelTimeApi(id)
  1162. .then(async (res) => {
  1163. if (res.data.status === false) {
  1164. return this.$authLapse(res.data);
  1165. }
  1166. this.FromData = res.data;
  1167. this.$refs.edits.modals = true;
  1168. })
  1169. .catch((res) => {
  1170. this.$Message.error(res.msg);
  1171. });
  1172. },
  1173. // 删除
  1174. del(row, tit, num, name) {
  1175. let delfromData = {
  1176. title: tit,
  1177. num: num,
  1178. url: name === "user" ?
  1179. `user/del_level/${row.uid}` :
  1180. `agent/stair/delete_spread/${row.uid}`,
  1181. method: name === "user" ? "DELETE" : "PUT",
  1182. // url: `user/del_level/${row.uid}`,
  1183. // method: 'DELETE',
  1184. ids: "",
  1185. };
  1186. this.$modalSure(delfromData)
  1187. .then((res) => {
  1188. this.$Message.success(res.msg);
  1189. this.getList();
  1190. })
  1191. .catch((res) => {
  1192. this.$Message.error(res.msg);
  1193. });
  1194. },
  1195. // 清除会员删除成功
  1196. submitModel() {
  1197. this.getList();
  1198. },
  1199. // 会员列表
  1200. getList() {
  1201. this.loading = true;
  1202. let activeIds = [];
  1203. this.dataLabel.forEach((item) => {
  1204. activeIds.push(item.id);
  1205. });
  1206. this.userFrom.label_id = activeIds.join(",") || "";
  1207. this.userFrom.user_type = this.userFrom.user_type || "";
  1208. this.userFrom.status = this.userFrom.status || "";
  1209. this.userFrom.sex = this.userFrom.sex || "";
  1210. this.userFrom.is_promoter = this.userFrom.is_promoter || "";
  1211. this.userFrom.country = this.userFrom.country || "";
  1212. this.userFrom.user_time_type = this.userFrom.user_time_type || "";
  1213. this.userFrom.pay_count = this.userFrom.pay_count || "";
  1214. // this.userFrom.label_id = this.userFrom.label_id || "";
  1215. this.userFrom.field_key = this.field_key === "all" ? "" : this.field_key;
  1216. this.userFrom.level =
  1217. this.userFrom.level === "all" ? "" : this.userFrom.level;
  1218. this.userFrom.group_id =
  1219. this.userFrom.group_id === "all" ? "" : this.userFrom.group_id;
  1220. userList(this.userFrom)
  1221. .then(async (res) => {
  1222. let data = res.data;
  1223. data.list.forEach((item) => {
  1224. item.checkBox = false;
  1225. });
  1226. this.userLists = data.list;
  1227. this.total = data.count;
  1228. this.loading = false;
  1229. this.$nextTick(function() {
  1230. if (this.isAll == 1) {
  1231. this.selectionList = this.userLists;
  1232. if (this.isCheckBox) {
  1233. this.$refs.xTable.setAllCheckboxRow(true);
  1234. } else {
  1235. this.$refs.xTable.setAllCheckboxRow(false);
  1236. }
  1237. } else {
  1238. let obj = this.$refs.xTable.getCheckboxReserveRecords(true);
  1239. if (!this.checkUidList.length || this.checkUidList.length <= obj.length) {
  1240. this.$refs.xTable.setAllCheckboxRow(false);
  1241. }
  1242. }
  1243. })
  1244. })
  1245. .catch((res) => {
  1246. this.loading = false;
  1247. this.$Message.error(res.msg);
  1248. });
  1249. },
  1250. pageChange({
  1251. currentPage,
  1252. pageSize
  1253. }) {
  1254. this.userFrom.page = currentPage;
  1255. this.userFrom.limit = pageSize;
  1256. this.getList();
  1257. },
  1258. // pageChange(index) {
  1259. // this.userFrom.page = index;
  1260. // this.getList();
  1261. // },
  1262. // 搜索
  1263. userSearchs() {
  1264. if (this.userFrom.user_time_type && !this.timeVal.length) {
  1265. return this.$Message.error("请选择访问时间");
  1266. }
  1267. if (this.timeVal.length && !this.userFrom.user_time_type) {
  1268. return this.$Message.error("请选择访问情况");
  1269. }
  1270. this.isAll = 0;
  1271. this.$refs.xTable.setAllCheckboxRow(false);
  1272. this.checkUidList = [];
  1273. this.userFrom.page = 1;
  1274. this.selectionList = [];
  1275. this.getList();
  1276. },
  1277. // 重置
  1278. reset(name) {
  1279. this.$refs.xTable.setAllCheckboxRow(false);
  1280. this.checkUidList = []
  1281. this.headeType = "-1";
  1282. this.userFrom = {
  1283. user_type: "",
  1284. status: "",
  1285. sex: "",
  1286. is_promoter: "",
  1287. country: "",
  1288. pay_count: "",
  1289. user_time_type: "",
  1290. user_time: "",
  1291. nickname: "",
  1292. field_key: "",
  1293. level: "",
  1294. group_id: "",
  1295. label_id: "",
  1296. page: 1, // 当前页
  1297. limit: 20, // 每页显示条数
  1298. };
  1299. this.field_key = "";
  1300. this.level = "";
  1301. this.group_id = "";
  1302. this.label_id = "";
  1303. this.user_time_type = "";
  1304. this.pay_count = "";
  1305. this.timeVal = [];
  1306. this.selectionList = [];
  1307. this.dataLabel = [];
  1308. this.getList();
  1309. },
  1310. // 获取编辑表单数据
  1311. getUserFrom(id) {
  1312. this.$modalForm(getUserData(id)).then(() => this.getList());
  1313. // getUserData(id)
  1314. // .then(async (res) => {
  1315. // if (res.data.status === false) {
  1316. // return this.$authLapse(res.data);
  1317. // }
  1318. // this.FromData = res.data;
  1319. // this.$refs.edits.modals = true;
  1320. // })
  1321. // .catch((res) => {
  1322. // this.$Message.error(res.msg);
  1323. // });
  1324. },
  1325. // 获取积分余额表单
  1326. getOtherFrom(id) {
  1327. editOtherApi(id)
  1328. .then(async (res) => {
  1329. if (res.data.status === false) {
  1330. return this.$authLapse(res.data);
  1331. }
  1332. res.data.rules[1].props.max = 999999;
  1333. this.FromData = res.data;
  1334. this.$refs.edits.modals = true;
  1335. })
  1336. .catch((res) => {
  1337. this.$Message.error(res.msg);
  1338. });
  1339. },
  1340. // 修改状态
  1341. onchangeIsShow(row) {
  1342. let data = {
  1343. id: row.uid,
  1344. status: row.status,
  1345. };
  1346. isShowApi(data)
  1347. .then(async (res) => {
  1348. this.$Message.success(res.msg);
  1349. })
  1350. .catch((res) => {
  1351. this.$Message.error(res.msg);
  1352. });
  1353. },
  1354. // 点击发送优惠券
  1355. onSend() {
  1356. if (this.checkUidList.length === 0 && this.isAll == 0) {
  1357. return this.$Message.warning("请选择要发送优惠券的用户");
  1358. }
  1359. this.$refs.sends.modals = true;
  1360. this.$refs.sends.getList();
  1361. },
  1362. // 发送图文消息
  1363. onSendPic() {
  1364. if (this.checkUidList.length === 0 && this.isAll == 0) {
  1365. this.$Message.warning("请选择要发送图文消息的用户");
  1366. } else {
  1367. this.modal13 = true;
  1368. }
  1369. },
  1370. // 编辑
  1371. edit(row) {
  1372. this.getUserFrom(row.uid);
  1373. // this.$modalForm(getUserSaveForm(row.uid)).then(() => this.getList());
  1374. },
  1375. //信息补充
  1376. extendInfo(row) {
  1377. // this.$modalForm(extendInfo(row.uid)).then(() => this.getList());
  1378. extendInfo(row.uid).then(async (res) => {
  1379. if (res.data.status === false) {
  1380. return this.$authLapse(res.data);
  1381. }
  1382. this.FromData = res.data;
  1383. this.$refs.edits.modals = true;
  1384. // this.getList()
  1385. }).catch(err => {
  1386. this.$Message.error(err.msg);
  1387. })
  1388. },
  1389. // 修改成功
  1390. submitFail(p) {
  1391. // this.getList();
  1392. if (this.$refs.userDetails.modals) {
  1393. this.$refs.userDetails.getDetails(this.userId);
  1394. }
  1395. },
  1396. // 排序
  1397. // sortChanged(e) {
  1398. // this.userFrom[e.key] = e.order;
  1399. // this.getList();
  1400. // },
  1401. // onSelectCancel(selection, row) {},
  1402. menuSelect(name) {
  1403. this.menuActive = name;
  1404. },
  1405. setBatch() {
  1406. this.batchModal = true;
  1407. },
  1408. tagClose(id) {
  1409. let index = this.batchLabel.findIndex(item => item.id === id);
  1410. this.batchLabel.splice(index, 1);
  1411. },
  1412. cancelBatch() {
  1413. this.batchModal = false;
  1414. },
  1415. // 保存批量操作
  1416. saveBatch() {
  1417. batchProcess({
  1418. type: this.menuActive,
  1419. uids: this.checkUidList,
  1420. all: this.isAll,
  1421. where: this.userFrom,
  1422. data: this.batchData
  1423. }).then(res => {
  1424. this.$Message.success(res.msg);
  1425. this.batchModal = false;
  1426. }).catch(res => {
  1427. this.$Message.error(res.msg);
  1428. });
  1429. },
  1430. batchVisibleChange() {
  1431. this.batchData = {
  1432. group_id: 0,
  1433. label_id: [],
  1434. level_id: 0,
  1435. money_status: 0,
  1436. money: 0,
  1437. integration_status: 0,
  1438. integration: 0,
  1439. days_status: 1,
  1440. day: 0,
  1441. spread_uid: '',
  1442. };
  1443. this.batchLabel = [];
  1444. this.spread_name = '';
  1445. this.menuActive = 1;
  1446. }
  1447. },
  1448. };
  1449. </script>
  1450. <style scoped lang="stylus">
  1451. /deep/.ivu-dropdown-item {
  1452. font-size: 12px !important;
  1453. }
  1454. /deep/.vxe-table--render-default .vxe-cell {
  1455. font-size: 12px;
  1456. }
  1457. .expand-row {
  1458. margin-bottom: 16px;
  1459. font-size: 12px;
  1460. }
  1461. .tdinfo {
  1462. margin-left: 88px;
  1463. margin-top: 15px;
  1464. }
  1465. .padding-add {
  1466. padding: 20px 20px 0;
  1467. }
  1468. .input-add {
  1469. max-width: 250px;
  1470. }
  1471. .labelInput {
  1472. max-width: 250px;
  1473. border: 1px solid #dcdee2;
  1474. padding: 0 5px;
  1475. border-radius: 5px;
  1476. min-height: 30px;
  1477. cursor: pointer;
  1478. .span {
  1479. color: #c5c8ce;
  1480. }
  1481. .iconxiayi {
  1482. font-size: 12px;
  1483. }
  1484. }
  1485. .picBox {
  1486. display: inline-block;
  1487. cursor: pointer;
  1488. .upLoad {
  1489. width: 58px;
  1490. height: 58px;
  1491. line-height: 58px;
  1492. border: 1px dotted rgba(0, 0, 0, 0.1);
  1493. border-radius: 4px;
  1494. background: rgba(0, 0, 0, 0.02);
  1495. }
  1496. .pictrue {
  1497. width: 60px;
  1498. height: 60px;
  1499. border: 1px dotted rgba(0, 0, 0, 0.1);
  1500. margin-right: 10px;
  1501. img {
  1502. width: 100%;
  1503. height: 100%;
  1504. }
  1505. }
  1506. }
  1507. .userFrom {
  1508. >>>.ivu-form-item-content {
  1509. margin-left: 0px !important;
  1510. }
  1511. }
  1512. .userAlert {
  1513. margin-top: 20px;
  1514. }
  1515. .userI {
  1516. color: #1890FF;
  1517. font-style: normal;
  1518. }
  1519. img {
  1520. height: 36px;
  1521. display: block;
  1522. }
  1523. .tabBox_img {
  1524. width: 36px;
  1525. height: 36px;
  1526. border-radius: 4px;
  1527. cursor: pointer;
  1528. img {
  1529. width: 100%;
  1530. height: 100%;
  1531. }
  1532. }
  1533. .tabBox_tit {
  1534. width: 60%;
  1535. font-size: 12px !important;
  1536. margin: 0 2px 0 10px;
  1537. letter-spacing: 1px;
  1538. padding: 5px 0;
  1539. box-sizing: border-box;
  1540. }
  1541. .modelBox {
  1542. >>>.ivu-modal-body {
  1543. padding: 0 16px 16px 16px !important;
  1544. }
  1545. }
  1546. .vipName {
  1547. color: #dab176;
  1548. }
  1549. .listbox {
  1550. >>>.ivu-divider-horizontal {
  1551. margin: 0 !important;
  1552. }
  1553. }
  1554. /deep/.ivu-table-header {
  1555. // overflow visible
  1556. }
  1557. /deep/.ivu-table th {
  1558. overflow: visible;
  1559. }
  1560. /deep/.select-item:hover {
  1561. background-color: #f3f3f3;
  1562. }
  1563. /deep/.select-on {
  1564. display: block;
  1565. }
  1566. /deep/.select-item.on {
  1567. /* background: #f3f3f3; */
  1568. }
  1569. .pane_pd {
  1570. padding: 4px 16px 20px !important;
  1571. font-weight: 500;
  1572. }
  1573. .new_tab {
  1574. >>>.ivu-tabs-nav .ivu-tabs-tab {
  1575. padding: 4px 16px 20px !important;
  1576. font-weight: 500;
  1577. }
  1578. }
  1579. .dateMedia {
  1580. /deep/.ivu-form-item-content {
  1581. max-width 250px;
  1582. /deep/.ivu-date-picker {
  1583. width 100%;
  1584. }
  1585. }
  1586. }
  1587. .select-tag {
  1588. position: relative;
  1589. min-height: 32px;
  1590. padding: 0 24px 0 4px;
  1591. border: 1px solid #dcdee2;
  1592. border-radius: 4px;
  1593. line-height: normal;
  1594. user-select: none;
  1595. cursor: pointer;
  1596. &:hover {
  1597. border-color: #57a3f3;
  1598. }
  1599. .ivu-icon {
  1600. position: absolute;
  1601. top: 50%;
  1602. right: 8px;
  1603. line-height: 1;
  1604. transform: translateY(-50%);
  1605. font-size: 14px;
  1606. color: #808695;
  1607. transition: all .2s ease-in-out;
  1608. }
  1609. .ivu-tag {
  1610. position: relative;
  1611. max-width: 99%;
  1612. height: 24px;
  1613. margin: 3px 4px 3px 0;
  1614. line-height: 22px;
  1615. }
  1616. .placeholder {
  1617. display: block;
  1618. height: 30px;
  1619. line-height: 30px;
  1620. color: #c5c8ce;
  1621. font-size: 12px;
  1622. overflow: hidden;
  1623. text-overflow: ellipsis;
  1624. white-space: nowrap;
  1625. padding-left: 4px;
  1626. padding-right: 22px;
  1627. }
  1628. }
  1629. >>>.batch-modal {
  1630. .ivu-modal-body {
  1631. padding: 0;
  1632. }
  1633. .ivu-alert {
  1634. margin: 12px 24px;
  1635. }
  1636. .ivu-col-span-4 {
  1637. flex: none;
  1638. width: 130px;
  1639. }
  1640. .ivu-col-span-20 {
  1641. padding-right: 37px;
  1642. }
  1643. .ivu-input-number {
  1644. width: 100%;
  1645. }
  1646. .ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu) {
  1647. z-index: auto;
  1648. }
  1649. .ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu):after {
  1650. right: auto;
  1651. left: 0;
  1652. }
  1653. .ivu-menu-item {
  1654. padding-right: 0;
  1655. }
  1656. }
  1657. </style>