list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <div>
  3. <i-page-header :title="pageTitle"></i-page-header>
  4. <Card :bordered="false" dis-hover class="ivu-mt">
  5. <div class="fx-r" style="padding: 20px 0;">
  6. <Input placeholder="绑定的手机号" style="width:120px" class="mr10" v-model="detial.mobile" />
  7. <Input placeholder="用户昵称" style="width:120px" class="mr10" v-model="detial.nickname" />
  8. <Input placeholder="用户UID" style="width:120px" class="mr10" v-model="detial.uid" />
  9. <Input placeholder="父级用户UID" style="width:120px" class="mr10" v-model="detial.parent_uid" />
  10. <DatePicker style="width: 250px" format="yyyy-MM-dd HH:mm:ss" v-model="detial.time" type="datetimerange"
  11. placement="bottom-start" placeholder="注册时间范围" :options="options"></DatePicker>
  12. <el-button type="primary" style="margin-left: 6px;" @click="tapSeach">查询</el-button>
  13. <div class="fx-g1"></div>
  14. </div>
  15. <div class="muser-tab-continer">
  16. <a class="muser-tab-a" :class="detial.status == '' ? 'active' : ''" @click="statusChange('')">全部</a>
  17. <a class="muser-tab-a" :class="detial.status == '-1' ? 'active' : ''" @click="statusChange('-1')">禁用</a>
  18. <a class="muser-tab-a" :class="detial.status == '1' ? 'active' : ''" @click="statusChange('1')">使用</a>
  19. </div>
  20. <el-table :data="detial.data" v-loading="detial.loading" :stripe="true" :border="true">
  21. <el-table-column prop="uid" label="UID" width="80" align="center">
  22. </el-table-column>
  23. <el-table-column prop="avatar" label="头像" width="80" align="left">
  24. <template slot-scope="scope">
  25. <img v-lazy="scope.row.avatar" :src="scope.row.avatar" v-image-preview
  26. style="width: 60px;cursor: pointer;" />
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="mobile" width="100" label="绑定手机">
  30. </el-table-column>
  31. <!-- <el-table-column
  32. prop="parent_uid"
  33. label="上级用户">
  34. <template slot-scope="scope">
  35. <div v-if="scope.row.parent_uid>0">
  36. <div>昵称:{{scope.row.p_nickname}}</div>
  37. <div>手机号码:{{scope.row.p_mobile}}</div>
  38. </div>
  39. </template>
  40. </el-table-column> -->
  41. <!-- <el-table-column
  42. prop="branchCount"
  43. align="center"
  44. label="推广人数">
  45. <template slot-scope="scope">
  46. {{scope.row.branchCount}}
  47. </template>
  48. </el-table-column> -->
  49. <el-table-column prop="nickname" label="昵称">
  50. </el-table-column>
  51. <el-table-column prop="name" label="姓名">
  52. </el-table-column>
  53. <el-table-column prop="score" label="积分">
  54. </el-table-column>
  55. <el-table-column prop="parent_uid" width="100" label="邀请人">
  56. <template slot-scope="scope">
  57. <div @click="tapUserSeach(scope.row.parent_uid)">
  58. <div style="text-align: center;">{{ scope.row.p_nickname }}</div>
  59. <div style="text-align: center;">{{ scope.row.p_mobile }}</div>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="showTempCount" label="名片模板">
  64. <template slot-scope="scope">
  65. <i-link :to="'/system/user/showTemplateList?uid=' + scope.row.uid + '&title=' + scope.row.nickname + '的模板'">
  66. ({{ scope.row.showTempCount }}) 查看
  67. </i-link>
  68. </template>
  69. </el-table-column>
  70. <el-table-column prop="is_info_audit" label="资料审核" width="80" align="left">
  71. <template slot-scope="scope">
  72. <el-tag type="success" size="mini" v-if="scope.row.is_info_audit == 1">已审核</el-tag>
  73. <el-tag type="danger" size="mini" v-if="scope.row.is_info_audit == 0">未审核</el-tag>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="work_type_id" align="center" label="职业名称" width="100">
  77. <template slot-scope="scope">
  78. <div v-if="scope.row.work_type_id == 0" style="color: #9B9B9B">普通用户</div>
  79. <div v-if="scope.row.work_type_id > 0" style="color: #00ac1c">{{ scope.row.work_type_title }}</div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="is_type_audit" label="平台认证" width="80" align="left">
  83. <template slot-scope="scope">
  84. <el-tag type="success" size="mini" v-if="scope.row.is_type_audit == 1">已认证</el-tag>
  85. <el-tag type="danger" size="mini" v-if="scope.row.is_type_audit == 0">未认证</el-tag>
  86. </template>
  87. </el-table-column>
  88. <el-table-column prop="status" label="是否禁用" width="80" align="left">
  89. <template slot-scope="scope">
  90. <el-tag type="success" size="mini" v-if="scope.row.status == 1">使用</el-tag>
  91. <el-tag type="danger" size="mini" v-if="scope.row.status == -1">禁用</el-tag>
  92. </template>
  93. </el-table-column>
  94. <!-- <el-table-column
  95. prop="ercode"
  96. label="推广码"
  97. width="80"
  98. align="left">
  99. <template slot-scope="scope">
  100. <img v-lazy="scope.row.ercode" :src="scope.row.ercode" v-image-preview style="width: 60px;cursor: pointer;"/>
  101. </template>
  102. </el-table-column> -->
  103. <el-table-column prop="regtime" label="注册时间" width="150">
  104. </el-table-column>
  105. <el-table-column align="center" label="操作" prop="handle" width="200" fixed="right">
  106. <template slot-scope="scope">
  107. <div>
  108. <el-button plain size="mini" @click="tapEdit(scope.row)">编辑</el-button>
  109. <el-button plain size="mini" @click="tapScoreEdit(scope.row)">积分补扣</el-button>
  110. <!-- <Divider type="vertical"/>
  111. <i-link :to="'/system/order/index?uid=' + scope.row.uid + '&title=' +scope.row.nickname+ '的订单列表' ">
  112. <el-button plain size="mini" >订单</el-button>
  113. </i-link> -->
  114. </div>
  115. <div style="margin-top: 10px;">
  116. <!-- <i-link :to="'/system/circle/list?uid=' + scope.row.uid + '&title=' +scope.row.nickname+ '的动态列表' ">
  117. <el-button plain size="mini" >圈子</el-button>
  118. </i-link>
  119. <Divider type="vertical"/> -->
  120. <!-- <i-link :to="'/system/user/moneyDetail?uid=' + scope.row.uid + '&title=' +scope.row.nickname+ '的余额明细' ">
  121. <el-button plain size="mini" >余额</el-button>
  122. </i-link> -->
  123. <!-- <Divider type="vertical"/>
  124. <i-link :to="'/system/user/scoreDetail?uid=' + scope.row.uid + '&title=' +scope.row.nickname+ '的积分明细' ">
  125. <el-button plain size="mini" >积分</el-button>
  126. </i-link> -->
  127. </div>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <div class="acea-row row-right page">
  132. <Page :total="detial.pageCount" show-elevator show-total @on-change="tapPage" :page-size="detial.pageSize" />
  133. </div>
  134. </Card>
  135. <Modal v-model="dialogVisible" :title="title" @on-cancel="editClose">
  136. <el-form ref="form" :model="form" label-width="120px">
  137. <el-divider content-position="left">用户信息</el-divider>
  138. <el-form-item label="用户昵称">
  139. <el-input placeholder="请输用户昵称!" v-model="form.nickname"></el-input>
  140. </el-form-item>
  141. <el-form-item label="用户姓名">
  142. <el-input placeholder="请输入用户姓名!" v-model="form.name"></el-input>
  143. </el-form-item>
  144. <el-form-item label="是否禁用">
  145. <el-radio-group v-model="form.status">
  146. <el-radio :label="1">使用</el-radio>
  147. <el-radio :label="-1">禁用</el-radio>
  148. </el-radio-group>
  149. </el-form-item>
  150. </el-form>
  151. <span slot="footer" class="dialog-footer">
  152. <el-button @click="dialogVisible = false">取 消</el-button>
  153. <el-button type="primary" @click="subAdmin">确 定</el-button>
  154. </span>
  155. </Modal>
  156. <Modal v-model="scoreDialogVisible" title="积分明细补扣" @on-cancel="editClose">
  157. <el-form ref="form" :model="scoreform" label-width="120px">
  158. <el-form-item label="增减积分 ">
  159. <el-radio-group v-model="scoreform.type">
  160. <el-radio :label="1">增加</el-radio>
  161. <el-radio :label="-1">减少</el-radio>
  162. </el-radio-group>
  163. </el-form-item>
  164. <el-form-item label="数量">
  165. <el-input placeholder="请输入积分数量" v-model="scoreform.into"></el-input>
  166. </el-form-item>
  167. </el-form>
  168. <span slot="footer" class="dialog-footer">
  169. <el-button @click="scoreDialogVisible = false">取 消</el-button>
  170. <el-button type="primary" @click="subAdminscore">确 定</el-button>
  171. </span>
  172. </Modal>
  173. </div>
  174. </template>
  175. <script>
  176. import { SystemUserList, SystemUserSave, SystemUserScoreDetailSave } from "../../../api/system/user";
  177. import IPageHeader from "../../../layouts/system/page-header/index";
  178. import UiUpload from "@/ui/upload/index";
  179. import Setting from '@/setting';
  180. export default {
  181. name: "SystemUserList",
  182. components: { UiUpload, IPageHeader },
  183. computed: {},
  184. data() {
  185. return {
  186. scoreDialogVisible: false,
  187. scoreform: {
  188. uid: '',
  189. type: 1,//1:增加 -1:减少
  190. into: '',
  191. },
  192. pageTitle: '用户列表',
  193. upHeaders: {},
  194. upUrl: "",
  195. labelsData: [],
  196. detial: {
  197. data: [],
  198. time: "",
  199. nickname: "",
  200. mobile: "",
  201. status: "",
  202. uid: "",
  203. parent_uid: "",
  204. page: 1,
  205. loading: true,
  206. pageSize: 0,
  207. pageCount: 0,
  208. },
  209. options: {
  210. shortcuts: [
  211. {
  212. text: '今天',
  213. value() {
  214. const end = new Date();
  215. const start = new Date();
  216. start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()));
  217. return [start, end];
  218. }
  219. },
  220. {
  221. text: '昨天',
  222. value() {
  223. const end = new Date();
  224. const start = new Date();
  225. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 1)));
  226. end.setTime(end.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())));
  227. return [start, end];
  228. }
  229. },
  230. {
  231. text: '最近7天',
  232. value() {
  233. const end = new Date();
  234. const start = new Date();
  235. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 6)));
  236. return [start, end];
  237. }
  238. },
  239. {
  240. text: '最近30天',
  241. value() {
  242. const end = new Date();
  243. const start = new Date();
  244. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() - 29)));
  245. return [start, end];
  246. }
  247. },
  248. {
  249. text: '本月',
  250. value() {
  251. const end = new Date();
  252. const start = new Date();
  253. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), 1)));
  254. return [start, end];
  255. }
  256. },
  257. {
  258. text: '本年',
  259. value() {
  260. const end = new Date();
  261. const start = new Date();
  262. start.setTime(start.setTime(new Date(new Date().getFullYear(), 0, 1)));
  263. return [start, end];
  264. }
  265. }
  266. ]
  267. },
  268. dialogVisible: false,
  269. title: "",
  270. form: {
  271. status: 1,
  272. name: "",
  273. nickname: ""
  274. },
  275. }
  276. },
  277. created() {
  278. if (this.$route.query.title) {
  279. this.pageTitle = this.$route.query.title;
  280. }
  281. if (this.$route.query.uid) {
  282. this.detial.uid = parseInt(this.$route.query.uid);
  283. }
  284. if (this.$route.query.parent_uid) {
  285. this.detial.parent_uid = parseInt(this.$route.query.parent_uid);
  286. }
  287. this.initView();
  288. },
  289. methods: {
  290. subAdminscore() {
  291. if (this.scoreform.into == '') {
  292. this.$message.error('请输入积分数量!');
  293. return;
  294. }
  295. SystemUserScoreDetailSave(this.scoreform).then(res => {
  296. if (res.code == 200) {
  297. this.scoreDialogVisible = false;
  298. this.$message.success(res.msg);
  299. this.getData();
  300. } else {
  301. this.$message.error(res.msg);
  302. }
  303. })
  304. },
  305. tapScoreEdit: function (row) {
  306. let rows = JSON.parse(JSON.stringify(row));
  307. this.scoreform = {
  308. uid: rows.uid,
  309. type: 1,//1:增加 -1:减少
  310. into: '',
  311. }
  312. this.scoreDialogVisible = true;
  313. },
  314. /**
  315. * 添加
  316. */
  317. tapAdd: function (sassid) {
  318. this.dialogVisible = true;
  319. this.$refs['form'].resetFields();
  320. this.form = this.$utils.resetFields(this.form, { status: 1 });
  321. },
  322. initView: function () {
  323. var upHeaders = {};
  324. this.upUrl = Setting.apiBaseURL + "/systemv1/upload/index";
  325. const token = this.$utils.util.cookies.get('system_token');
  326. if (token) {
  327. upHeaders['SYSTEM-ACC-TOKEN'] = token;
  328. }
  329. this.upHeaders = upHeaders;
  330. this.getData();
  331. },
  332. statusChange: function (status) {
  333. this.detial.status = status;
  334. this.detial.page = 1
  335. this.getData()
  336. },
  337. /**
  338. * 上传文件
  339. * @param res
  340. */
  341. onUpload: function (res) {
  342. if (res.code == -1) {
  343. Notice.error({ title: "系统提示", content: res.msg });
  344. } else {
  345. this.form.imgs.push(res.data.img);
  346. }
  347. },
  348. tapEdit: function (row) {
  349. this.form = JSON.parse(JSON.stringify(row));
  350. this.dialogVisible = true;
  351. this.title = "编辑";
  352. },
  353. //关闭
  354. editClose: function () {
  355. this.dialogVisible = false;
  356. },
  357. /**
  358. * 修改数据
  359. */
  360. subAdmin: function (e) {
  361. this.$refs['form'].validate((valid) => {
  362. if (valid) {
  363. let loading = this.$loading("提交数据中...");
  364. var data = {};
  365. for (var i in this.form) {
  366. data[i] = this.form[i];
  367. }
  368. SystemUserSave(data)
  369. .then(res => {
  370. loading.close();
  371. if (res.code == 200) {
  372. this.dialogVisible = false;
  373. this.$Message.success("操作成功");
  374. this.getData();
  375. } else {
  376. this.$alert(res.msg, '系统提示');
  377. }
  378. })
  379. .catch(err => {
  380. loading.close();
  381. this.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
  382. });
  383. }
  384. });
  385. },
  386. //搜索栏目
  387. tapSeach: function () {
  388. this.detial.page = 1;
  389. this.getData();
  390. },
  391. tapUserSeach: function (uid) {
  392. this.detial.page = 1;
  393. this.detial.uid = uid;
  394. this.getData();
  395. },
  396. //分页
  397. tapPage: function (page) {
  398. this.detial.page = page;
  399. this.getData();
  400. },
  401. getData: function () {
  402. var data = {};
  403. this.detial.loading = true;
  404. data.page = this.detial.page;
  405. data.status = this.detial.status;
  406. data.uid = this.detial.uid;
  407. data.nickname = this.detial.nickname;
  408. data.time = this.detial.time;
  409. data.mobile = this.detial.mobile;
  410. data.parent_uid = this.detial.parent_uid;
  411. SystemUserList(data)
  412. .then(res => {
  413. this.detial.loading = false;
  414. this.detial.data = res.data.list;
  415. this.detial.pageSize = res.data.pageSize;
  416. this.detial.pageCount = res.data.pageCount;
  417. this.detial.waitCount = res.data.waitCount;
  418. })
  419. .catch(err => {
  420. this.detial.loading = false;
  421. this.$alert('网络繁忙,加载失败,请稍等片刻在尝试!', '系统提示');
  422. });
  423. },
  424. }
  425. }
  426. </script>
  427. <style scoped>
  428. iframe.videoIframe {
  429. border: 0px;
  430. padding: 0px;
  431. }
  432. .el-dialog__body {
  433. padding: 0px;
  434. }
  435. .el-dialog__body iframe body {
  436. padding: 0px;
  437. }
  438. .muser-tab-continer {
  439. border: 1px solid #EEEEEE
  440. }
  441. a.muser-tab-a {
  442. display: inline-block;
  443. padding: 0px 28px;
  444. height: 42px;
  445. line-height: 42px;
  446. border-bottom: 3px solid transparent;
  447. font-size: 17px;
  448. color: #595959;
  449. }
  450. a.muser-tab-a.active {
  451. border-bottom: 3px solid #EA312B;
  452. color: #EA312B
  453. }
  454. .upimg-item {
  455. width: 82px;
  456. height: 82px;
  457. margin-right: 5px;
  458. overflow: hidden;
  459. float: left;
  460. margin-bottom: 5px;
  461. position: relative;
  462. }
  463. .upimg-item img {
  464. width: 82px;
  465. cursor: pointer;
  466. }
  467. .img-remove-btn {
  468. position: absolute;
  469. top: 0px;
  470. right: 0px;
  471. font-size: 24px;
  472. }
  473. </style>