mylist.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <template>
  2. <div class="app-container">
  3. <!-- Search Form -->
  4. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
  5. <el-form-item label="项目" prop="projectId">
  6. <el-select v-model="queryParams.projectId" placeholder="请选择项目" clearable size="small" >
  7. <el-option
  8. v-for="item in projectOptions"
  9. :key="item.dictValue"
  10. :label="item.dictLabel"
  11. :value="item.dictValue"
  12. />
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="昵称" prop="nickname">
  16. <el-input
  17. style="width: 200px"
  18. v-model="queryParams.nickname"
  19. placeholder="请输入昵称"
  20. clearable
  21. size="small"
  22. @keyup.enter.native="handleQuery"
  23. />
  24. </el-form-item>
  25. <el-form-item label="手机号码" prop="phone">
  26. <el-input
  27. style="width: 200px"
  28. v-model="queryParams.phone"
  29. placeholder="请输入手机号码"
  30. clearable
  31. size="small"
  32. @keyup.enter.native="handleQuery"
  33. />
  34. </el-form-item>
  35. <!-- <el-form-item label="状态" prop="status">-->
  36. <!-- <el-select style="width: 200px" v-model="queryParams.status" placeholder="请选择状态" clearable size="small">-->
  37. <!-- <el-option-->
  38. <!-- v-for="item in statusOptions"-->
  39. <!-- :key="item.dictValue"-->
  40. <!-- :label="item.dictLabel"-->
  41. <!-- :value="item.dictValue"-->
  42. <!-- />-->
  43. <!-- </el-select>-->
  44. <!-- </el-form-item>-->
  45. <!-- <el-form-item label="看课状态" prop="watchCourseType">-->
  46. <!-- <el-select style="width: 200px" v-model="queryParams.watchCourseType" placeholder="请选择看课状态" clearable size="small">-->
  47. <!-- <el-option label="全部" value="0" />-->
  48. <!-- <el-option label="未看过课" value="1" />-->
  49. <!-- <el-option label="正常看课" value="2" />-->
  50. <!-- <el-option label="停止看课" value="3" />-->
  51. <!-- </el-select>-->
  52. <!-- </el-form-item>-->
  53. <!-- <el-form-item label="缺课状态" prop="missCourseStatus">-->
  54. <!-- <el-select style="width: 200px" v-model="queryParams.missCourseStatus" placeholder="请选择缺课状态" clearable size="small">-->
  55. <!-- <el-option label="全部" value="0" />-->
  56. <!-- <el-option label="已缺课" value="1" />-->
  57. <!-- <el-option label="未缺课" value="2" />-->
  58. <!-- </el-select>-->
  59. <!-- </el-form-item>-->
  60. <!-- <el-form-item label="标签" prop="tagIds">-->
  61. <!-- <el-select style="width: 200px" v-model="queryParams.tagIds" placeholder="请选择标签" clearable size="small" multiple>-->
  62. <!-- <el-option-->
  63. <!-- v-for="item in tagOptions"-->
  64. <!-- :key="item.tagId"-->
  65. <!-- :label="item.tagName"-->
  66. <!-- :value="item.tagId"-->
  67. <!-- />-->
  68. <!-- </el-select>-->
  69. <!-- </el-form-item>-->
  70. <el-form-item label="注册时间">
  71. <el-date-picker
  72. v-model="dateRange"
  73. size="small"
  74. style="width: 240px"
  75. type="daterange"
  76. range-separator="-"
  77. start-placeholder="开始日期"
  78. end-placeholder="结束日期"
  79. value-format="yyyy-MM-dd"
  80. ></el-date-picker>
  81. </el-form-item>
  82. <el-form-item>
  83. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  84. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  85. </el-form-item>
  86. </el-form>
  87. <!-- Tab Selection -->
  88. <!-- <el-tabs v-model="queryParams.tabValue" @tab-click="handleTabChange">-->
  89. <!-- <el-tab-pane label="全部" name="0"></el-tab-pane>-->
  90. <!-- <el-tab-pane label="今日新增" name="1"></el-tab-pane>-->
  91. <!-- <el-tab-pane label="今日完播" name="2"></el-tab-pane>-->
  92. <!-- <el-tab-pane label="未看过课" name="3"></el-tab-pane>-->
  93. <!-- </el-tabs>-->
  94. <!-- Toolbar -->
  95. <el-row :gutter="10" class="mb8">
  96. <!-- <el-col :span="1.5">-->
  97. <!-- <el-button-->
  98. <!-- type="primary"-->
  99. <!-- plain-->
  100. <!-- icon="el-icon-plus"-->
  101. <!-- size="mini"-->
  102. <!-- @click="handleAdd"-->
  103. <!-- v-hasPermi="['user:fsUser:add']"-->
  104. <!-- >新增</el-button>-->
  105. <!-- </el-col>-->
  106. <!-- <el-col :span="1.5">-->
  107. <!-- <el-button-->
  108. <!-- type="success"-->
  109. <!-- plain-->
  110. <!-- icon="el-icon-edit"-->
  111. <!-- size="mini"-->
  112. <!-- :disabled="single"-->
  113. <!-- @click="handleUpdate"-->
  114. <!-- v-hasPermi="['user:fsUser:edit']"-->
  115. <!-- >编辑</el-button>-->
  116. <!-- </el-col>-->
  117. <!-- <el-col :span="1.5">-->
  118. <!-- <el-button-->
  119. <!-- type="danger"-->
  120. <!-- plain-->
  121. <!-- icon="el-icon-delete"-->
  122. <!-- size="mini"-->
  123. <!-- :disabled="multiple"-->
  124. <!-- @click="handleDelete"-->
  125. <!-- v-hasPermi="['user:fsUser:remove']"-->
  126. <!-- >删除</el-button>-->
  127. <!-- </el-col>-->
  128. <!-- <el-col :span="1.5">-->
  129. <!-- <el-button-->
  130. <!-- type="warning"-->
  131. <!-- plain-->
  132. <!-- icon="el-icon-download"-->
  133. <!-- size="mini"-->
  134. <!-- @click="handleExport"-->
  135. <!-- v-hasPermi="['user:fsUser:export']"-->
  136. <!-- >导出</el-button>-->
  137. <!-- </el-col>-->
  138. <el-col :span="1.5">
  139. <el-button
  140. type="success"
  141. plain
  142. icon="el-icon-edit"
  143. size="mini"
  144. :disabled="multiple"
  145. @click="batchSend"
  146. >批量IM发送</el-button>
  147. </el-col>
  148. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  149. </el-row>
  150. <!-- User Table -->
  151. <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" border>
  152. <el-table-column type="selection" width="55" align="center" />
  153. <el-table-column label="ID" align="center" prop="userId" />
  154. <el-table-column label="项目" align="center" prop="projectId">
  155. <template slot-scope="scope">
  156. <el-tag v-if="scope.row.projectId !== null">{{ getProjectLabel(scope.row.projectId) }}</el-tag>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="昵称" align="center" prop="nickname" />
  160. <el-table-column label="头像" align="center" width="80">
  161. <template slot-scope="scope">
  162. <el-popover
  163. placement="right"
  164. title=""
  165. trigger="hover"
  166. >
  167. <img slot="reference" :src="scope.row.avatar" width="50">
  168. <img :src="scope.row.avatar" style="max-width: 120px;">
  169. </el-popover>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="手机号码" align="center" prop="phone" />
  173. <el-table-column label="积分" align="center" prop="integral" v-if="false" />
  174. <el-table-column label="看课数量" align="center" prop="watchCourseCount" />
  175. <el-table-column label="缺课数量" align="center" prop="missCourseCount" />
  176. <el-table-column label="参与营期数量" align="center" prop="partCourseCount" />
  177. <el-table-column label="状态" align="center">
  178. <template slot-scope="scope">
  179. <el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">
  180. {{ scope.row.status === 1 ? '正常' : '禁止' }}
  181. </el-tag>
  182. </template>
  183. </el-table-column>
  184. <el-table-column label="看课状态" align="center">
  185. <template slot-scope="scope">
  186. <el-tag :type="getCourseStatusType(scope.row.courseCountStatus)">
  187. {{ getCourseStatusText(scope.row.courseCountStatus) }}
  188. </el-tag>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="标签" align="center" prop="tag" show-overflow-tooltip />
  192. <el-table-column label="最后看课时间" align="center" prop="lastWatchDate" width="160" />
  193. <el-table-column label="停课天数" align="center" prop="stopWatchDays" />
  194. <el-table-column label="注册时间" align="center" prop="createTime" width="160" />
  195. <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
  196. <el-table-column label="所属员工" align="center" prop="companyUserNickName" />
  197. <el-table-column label="会员积分" align="center" prop="integral" />
  198. <el-table-column label="是否购买" align="center" prop="isBuy">
  199. <template slot-scope="scope">
  200. <span>{{ scope.row.isBuy === 1 ? '是' : '否' }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
  204. <template slot-scope="scope">
  205. <el-button
  206. size="mini"
  207. type="text"
  208. icon="el-icon-check"
  209. @click="handleAudit(scope.row)"
  210. v-if="scope.row.isCurrentCompanyUser === 1 && scope.row.status === 0"
  211. >审核会员</el-button>
  212. <el-button
  213. size="mini"
  214. type="text"
  215. icon="el-icon-edit"
  216. @click="handleUpdate(scope.row)"
  217. v-hasPermi="['user:fsUser:edit']"
  218. >修改</el-button>
  219. <el-button
  220. size="mini"
  221. type="text"
  222. @click="handledetails(scope.row)"
  223. >详情</el-button>
  224. </template>
  225. </el-table-column>
  226. </el-table>
  227. <pagination
  228. v-show="total>0"
  229. :total="total"
  230. :page.sync="queryParams.pageNum"
  231. :limit.sync="queryParams.pageSize"
  232. @pagination="getList"
  233. />
  234. <!-- Edit User Dialog -->
  235. <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
  236. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  237. <el-form-item label="用户头像" prop="avatar">
  238. <el-popover
  239. placement="right"
  240. title=""
  241. trigger="hover"
  242. >
  243. <img slot="reference" :src="form.avatar" width="80">
  244. <img :src="form.avatar" style="max-width: 120px;">
  245. </el-popover>
  246. </el-form-item>
  247. <el-form-item label="昵称" prop="nickname">
  248. <el-input v-model="form.nickname" :disabled="true" placeholder="请输入昵称" />
  249. </el-form-item>
  250. <el-form-item label="手机号码" prop="phone">
  251. <el-input v-model="form.phone" disabled placeholder="请输入手机号码" />
  252. </el-form-item>
  253. <el-form-item label="最后登录IP" prop="lastIp" v-if="form.lastIp">
  254. <el-input v-model="form.lastIp" disabled placeholder="最后一次登录IP" />
  255. </el-form-item>
  256. <el-form-item label="看课数量" prop="watchCourseCount" v-if="form.watchCourseCount">
  257. <el-input v-model="form.watchCourseCount" disabled placeholder="看课数量" />
  258. </el-form-item>
  259. <el-form-item label="缺课数量" prop="missCourseCount" v-if="form.missCourseCount">
  260. <el-input v-model="form.missCourseCount" disabled placeholder="缺课数量" />
  261. </el-form-item>
  262. <!-- <el-form-item label="标签" prop="tagIds">
  263. <el-select v-model="form.tagIds" disabled placeholder="请选择标签" clearable multiple>
  264. <el-option
  265. v-for="item in tagOptions"
  266. :key="item.tagId"
  267. :label="item.tagName"
  268. :value="item.tagId"
  269. />
  270. </el-select>
  271. </el-form-item> -->
  272. <el-form-item label="标签" prop="tag">
  273. <el-input v-model="form.tag" disabled clearable >
  274. </el-input>
  275. </el-form-item>
  276. <el-form-item label="所属员工" prop="companyUserId">
  277. <el-select v-model="form.companyUserId" disabled placeholder="请选择所属员工" clearable>
  278. <el-option
  279. v-for="item in companyUserList"
  280. :key="item.userId"
  281. :label="item.nickName"
  282. :value="item.userId"
  283. />
  284. </el-select>
  285. </el-form-item>
  286. <el-form-item label="用户备注" prop="remark">
  287. <el-input v-model="form.remark" type="textarea" placeholder="请输入用户备注" />
  288. </el-form-item>
  289. <el-form-item label="状态">
  290. <el-radio-group v-model="form.status">
  291. <el-radio :label="1">正常</el-radio>
  292. <el-radio :label="0">禁止</el-radio>
  293. </el-radio-group>
  294. </el-form-item>
  295. </el-form>
  296. <div slot="footer" class="dialog-footer">
  297. <el-button type="primary" @click="submitForm">确 定</el-button>
  298. <el-button @click="cancel">取 消</el-button>
  299. </div>
  300. </el-dialog>
  301. <el-drawer
  302. :with-header="false"
  303. size="75%"
  304. :title="show.title" :visible.sync="show.open">
  305. <userDetails ref="userDetails" />
  306. </el-drawer>
  307. <el-dialog
  308. title="营期"
  309. :visible.sync="dialogVisible"
  310. width="80%"
  311. :before-close="handleClose">
  312. <userCoursePeriod :userIds="ids" :companyId="companyId" :companyUserId="companyUserId"/>
  313. </el-dialog>
  314. </div>
  315. </template>
  316. <script>
  317. import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser,myListUser } from "@/api/user/fsUser";
  318. import {transferUser} from "@/api/users/user";
  319. import {getUserList} from "@/api/company/companyUser";
  320. import userDetails from '@/views/store/components/userDetails.vue';
  321. import userCoursePeriod from '../../components/course/userCoursePeriod.vue'
  322. export default {
  323. name: "FsUser",
  324. components: {userDetails,userCoursePeriod},
  325. data() {
  326. return {
  327. show:{
  328. title:"会员详情",
  329. open:false,
  330. },
  331. cusTransfer: {
  332. targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
  333. content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
  334. },
  335. dialogVisible:false,
  336. companyUserList: [],
  337. openTransferDialog: false,
  338. transferForm: {
  339. targetUserId: null,
  340. content: null
  341. },
  342. // 遮罩层
  343. loading: true,
  344. // 选中数组
  345. ids: [],
  346. companyUserId:null,
  347. companyId:null,
  348. // 非单个禁用
  349. single: true,
  350. // 非多个禁用
  351. multiple: true,
  352. // 显示搜索条件
  353. showSearch: true,
  354. // 总条数
  355. total: 0,
  356. // 用户表格数据
  357. userList: [],
  358. // 弹出层标题
  359. title: "",
  360. // 是否显示弹出层
  361. open: false,
  362. // 日期范围
  363. dateRange: [],
  364. // 状态数据字典
  365. statusOptions: [],
  366. // 标签选项
  367. tagOptions: [],
  368. // 销售员工选项
  369. salesOptions: [],
  370. // 查询参数
  371. queryParams: {
  372. pageNum: 1,
  373. pageSize: 10,
  374. nickname: null,
  375. phone: null,
  376. // status: null,
  377. tagIds: [],
  378. tabValue: "0",
  379. watchCourseType: "0",
  380. missCourseStatus: "0",
  381. continueMissCourseSort: "0",
  382. registerStartTime: null,
  383. registerEndTime: null,
  384. projectId: null,
  385. },
  386. // 表单参数
  387. form: {},
  388. // 表单校验
  389. rules: {
  390. // nickname: [
  391. // { required: true, message: "昵称不能为空", trigger: "blur" }
  392. // ],
  393. // phone: [
  394. // { required: true, message: "手机号码不能为空", trigger: "blur" },
  395. // { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
  396. // ],
  397. status: [
  398. { required: true, message: "状态不能为空", trigger: "change" }
  399. ]
  400. },
  401. projectOptions: []
  402. };
  403. },
  404. created() {
  405. getUserList().then(res=>{
  406. if(res.code === 200) {
  407. this.companyUserList = res.data
  408. }
  409. });
  410. this.getList();
  411. this.getDicts("user_status").then(response => {
  412. this.statusOptions = response.data;
  413. });
  414. this.getDicts("sys_course_project").then(response => {
  415. this.projectOptions = response.data;
  416. });
  417. this.getTagOptions();
  418. this.getSalesOptions();
  419. },
  420. methods: {
  421. handledetails(row){
  422. this.show.open=true;
  423. setTimeout(() => {
  424. this.$refs.userDetails.getDetails(row.userId);
  425. }, 1);
  426. },
  427. /** 提交转移按钮 (如果使用对话框) */
  428. submitTransfer() {
  429. this.$refs["transferForm"].validate(valid => {
  430. if (valid) {
  431. transferUser({
  432. userIds: this.ids,
  433. targetCompanyUserId: this.transferForm.targetUserId,
  434. content: this.transferForm.content
  435. }).then(response => {
  436. if (response.code === 200) {
  437. this.msgSuccess(response.msg);
  438. this.openTransferDialog = false;
  439. this.getList();
  440. } else {
  441. this.msgError(response.msg || "转移失败");
  442. }
  443. }).catch(() => {
  444. this.msgError("转移请求失败");
  445. });
  446. }
  447. });
  448. },
  449. /** 转移按钮操作 */
  450. handleTransfer(row) {
  451. const userIds = row.userId ? [row.userId] : this.ids;
  452. if (userIds.length === 0) {
  453. this.$message.warning("请至少选择一个客户进行转移");
  454. return;
  455. }
  456. this.resetTransferForm();
  457. this.openTransferDialog = true;
  458. },
  459. // 重置表单
  460. resetForm() {
  461. this.linkForm={
  462. days:null,
  463. courseId:null,
  464. videoId:null
  465. }
  466. },
  467. resetTransferForm() {
  468. this.transferForm = {
  469. targetUserId: null,
  470. content: null
  471. };
  472. this.resetForm("transferForm"); // 假设 transferForm 是 el-form 的 ref
  473. },
  474. cancelTransfer() {
  475. this.openTransferDialog = false;
  476. this.resetTransferForm();
  477. },
  478. /** 查询用户列表 */
  479. getList() {
  480. this.loading = true;
  481. // 处理日期范围
  482. if (this.dateRange && this.dateRange.length > 0) {
  483. this.queryParams.registerStartTime = this.dateRange[0];
  484. this.queryParams.registerEndTime = this.dateRange[1];
  485. } else {
  486. this.queryParams.registerStartTime = null;
  487. this.queryParams.registerEndTime = null;
  488. }
  489. myListUser(this.queryParams).then(response => {
  490. this.userList = response.rows;
  491. this.total = response.total;
  492. this.loading = false;
  493. });
  494. },
  495. /** 获取标签选项 */
  496. getTagOptions() {
  497. this.tagOptions = [
  498. { tagId: "1", tagName: "VIP会员" },
  499. { tagId: "2", tagName: "普通会员" },
  500. { tagId: "3", tagName: "新用户" },
  501. { tagId: "4", tagName: "高频用户" }
  502. ];
  503. },
  504. /** 获取销售员工选项 */
  505. getSalesOptions() {
  506. this.salesOptions = [
  507. { userId: 1, nickName: "销售A" },
  508. { userId: 2, nickName: "销售B" },
  509. { userId: 3, nickName: "销售C" }
  510. ];
  511. },
  512. /** 获取看课状态类型 */
  513. getCourseStatusType(status) {
  514. if (status === 1) return "success";
  515. if (status === 2) return "danger";
  516. if (status === 3) return "info";
  517. return "";
  518. },
  519. /** 获取看课状态文本 */
  520. getCourseStatusText(status) {
  521. if (status === 1) return "正常看课";
  522. if (status === 2) return "停止看课";
  523. if (status === 3) return "未看过课";
  524. return "未知状态";
  525. },
  526. // 取消按钮
  527. cancel() {
  528. this.open = false;
  529. this.reset();
  530. },
  531. // 表单重置
  532. reset() {
  533. this.form = {
  534. userId: null,
  535. nickname: null,
  536. avatar: null,
  537. phone: null,
  538. status: 1,
  539. tagIds: [],
  540. companyUserId: null,
  541. remark: null
  542. };
  543. this.resetForm("form");
  544. },
  545. /** 搜索按钮操作 */
  546. handleQuery() {
  547. this.queryParams.pageNum = 1;
  548. this.getList();
  549. },
  550. /** 重置按钮操作 */
  551. resetQuery() {
  552. this.dateRange = [];
  553. this.resetForm("queryForm");
  554. this.handleQuery();
  555. },
  556. /** Tab切换操作 */
  557. handleTabChange() {
  558. this.queryParams.pageNum = 1;
  559. this.getList();
  560. },
  561. // 多选框选中数据
  562. handleSelectionChange(selection) {
  563. this.ids = selection.map(item => item.userId);
  564. this.single = selection.length !== 1;
  565. this.multiple = !selection.length;
  566. this.companyId = selection[0].companyId;
  567. this.companyUserId = selection[0].companyUserId;
  568. },
  569. /** 新增按钮操作 */
  570. handleAdd() {
  571. this.reset();
  572. this.open = true;
  573. this.title = "添加用户";
  574. },
  575. /** 修改按钮操作 */
  576. handleUpdate(row) {
  577. this.reset();
  578. const userId = row.userId || this.ids[0];
  579. getUser(userId).then(response => {
  580. this.form = response.data;
  581. // 处理标签数据,将字符串转为数组
  582. if (this.form.tagIds && typeof this.form.tagIds === 'string') {
  583. this.form.tagIds = this.form.tagIds.split(',');
  584. }
  585. this.open = true;
  586. this.title = "修改用户";
  587. });
  588. },
  589. /** 提交按钮 */
  590. submitForm() {
  591. this.$refs["form"].validate(valid => {
  592. if (valid) {
  593. // 处理标签数据,将数组转为字符串
  594. if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
  595. this.form.tagIds = this.form.tagIds.join(',');
  596. }
  597. if (this.form.userId != null) {
  598. updateUser(this.form).then(response => {
  599. if (response.code === 200) {
  600. this.$message.success("修改成功");
  601. this.open = false;
  602. this.getList();
  603. }
  604. });
  605. } else {
  606. addUser(this.form).then(response => {
  607. if (response.code === 200) {
  608. this.$message.success("新增成功");
  609. this.open = false;
  610. this.getList();
  611. }
  612. });
  613. }
  614. }
  615. });
  616. },
  617. /** 删除按钮操作 */
  618. handleDelete(row) {
  619. const userIds = row.userId || this.ids;
  620. this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {
  621. confirmButtonText: "确定",
  622. cancelButtonText: "取消",
  623. type: "warning"
  624. }).then(() => {
  625. return delUser(userIds);
  626. }).then(() => {
  627. this.getList();
  628. this.$message.success("删除成功");
  629. }).catch(() => {});
  630. },
  631. /** 导出按钮操作 */
  632. handleExport() {
  633. const queryParams = this.queryParams;
  634. this.$confirm('是否确认导出所有用户数据项?', "警告", {
  635. confirmButtonText: "确定",
  636. cancelButtonText: "取消",
  637. type: "warning"
  638. }).then(() => {
  639. return exportUser(queryParams);
  640. }).then(response => {
  641. this.download(response.msg);
  642. }).catch(() => {});
  643. },
  644. /** 审核会员操作 */
  645. handleAudit(row) {
  646. this.$confirm('是否确认将其移除小黑屋?', "提示", {
  647. confirmButtonText: "确定",
  648. cancelButtonText: "取消",
  649. type: "warning"
  650. }).then(() => {
  651. auditUser([row.userId]).then(response => {
  652. if (response.code === 200) {
  653. this.msgSuccess("审核成功");
  654. this.getList();
  655. }
  656. });
  657. }).catch(() => {});
  658. },
  659. /** 获取项目对应名称 */
  660. getProjectLabel(projectId) {
  661. return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
  662. },
  663. batchSend(){
  664. this.dialogVisible = true;
  665. },
  666. handleClose(){
  667. this.dialogVisible = false;
  668. }
  669. }
  670. };
  671. </script>
  672. <style scoped>
  673. .el-tag + .el-tag {
  674. margin-left: 5px;
  675. }
  676. .mb8 {
  677. margin-bottom: 8px;
  678. }
  679. </style>