|
@@ -39,6 +39,7 @@ const _ = require('lodash');
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: userleader } = createNamespacedHelpers('userleader');
|
|
|
const { mapActions: dictData } = createNamespacedHelpers('dictData'); // 字典
|
|
|
+const { mapActions: users } = createNamespacedHelpers('users');
|
|
|
|
|
|
export default {
|
|
|
name: 'index',
|
|
@@ -69,7 +70,7 @@ export default {
|
|
|
],
|
|
|
opera: [
|
|
|
{ label: '查看', method: 'view' },
|
|
|
- { label: '审核', method: 'exam', type: 'warning', display: (i) => i.status == '0' },
|
|
|
+ { label: '审核', method: 'exam', type: 'warning' },
|
|
|
],
|
|
|
searchFields: [
|
|
|
{ label: '姓名', model: 'name' },
|
|
@@ -105,7 +106,7 @@ export default {
|
|
|
methods: {
|
|
|
...dictData({ dictQuery: 'query' }),
|
|
|
...userleader(['query', 'delete', 'fetch', 'update', 'create']),
|
|
|
-
|
|
|
+ ...users({ userUpdate: 'update', userFetch: 'fetch' }),
|
|
|
// 查询
|
|
|
async search({ skip = 0, limit = this.$limit, ...others } = {}) {
|
|
|
let query = { skip, limit, ...others };
|
|
@@ -133,7 +134,11 @@ export default {
|
|
|
async toSave({ data }) {
|
|
|
let res = await this.update(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$message({ type: `success`, message: `审核成功` });
|
|
|
+ if (res.data.status == '1') {
|
|
|
+ let obj = { _id: res.data.user_id, is_leader: '0' };
|
|
|
+ let arr = await this.userUpdate(obj);
|
|
|
+ if (this.$checkRes(arr)) this.$message({ type: `success`, message: `已设为团长` });
|
|
|
+ } else this.$message({ type: `success`, message: `审核成功` });
|
|
|
this.toClose();
|
|
|
}
|
|
|
},
|