Browse Source

feature: 系统管理->用户管理界面

autumnal_wind@yeah.net 1 month ago
parent
commit
b3c416bda8

+ 2 - 0
src/api/system/right/user/types.ts

@@ -69,6 +69,8 @@ export interface UserForm {
69
   category?: string;
69
   category?: string;
70
   status: string;
70
   status: string;
71
   remark?: string;
71
   remark?: string;
72
+  cardType: string;
73
+  lifespan: string;
72
   postIds?: string[];
74
   postIds?: string[];
73
   roleIds: string[];
75
   roleIds: string[];
74
 }
76
 }

+ 31 - 1
src/views/system/right/user/UserDetailForm.vue

@@ -96,6 +96,21 @@
96
             </el-form-item>
96
             </el-form-item>
97
           </el-col>
97
           </el-col>
98
         </el-row>
98
         </el-row>
99
+        <el-row>
100
+          <el-col :span="12">
101
+            <el-form-item v-if="formData.userId == undefined && createAccount == '1'" label="卡片类型" prop="cardType">
102
+              <el-select v-model="formData.cardType" placeholder="请选择">
103
+                <el-option v-for="item in cardTypeOptions" :key="item.typeId" :label="item.typeName" :value="item.typeId"></el-option>
104
+              </el-select>
105
+            </el-form-item>
106
+          </el-col>
107
+          <el-col :span="12">
108
+            <el-form-item v-if="formData.userId == undefined && createAccount == '1'" label="有效期" prop="lifespan">
109
+              <el-date-picker v-model="formData.lifespan" clearable type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择账户有效期">
110
+              </el-date-picker>
111
+            </el-form-item>
112
+          </el-col>
113
+        </el-row>
99
         <el-row>
114
         <el-row>
100
           <el-col :span="24">
115
           <el-col :span="24">
101
             <el-form-item label="备注" prop="remark">
116
             <el-form-item label="备注" prop="remark">
@@ -120,7 +135,7 @@ import { DeptVO } from '@/api/system/dept/types';
120
 import { PostVO } from '@/api/system/params/post/types';
135
 import { PostVO } from '@/api/system/params/post/types';
121
 import { RoleVO } from '@/api/system/role/types';
136
 import { RoleVO } from '@/api/system/role/types';
122
 import { treeselect } from '@/api/system/dept';
137
 import { treeselect } from '@/api/system/dept';
123
-import { XfConsumeDetailForm } from '@/api/consumption/XfConsumeDetail/types';
138
+import { listUsePtCardType } from '@/api/basics/basicParameter/ptCardtype';
124
 
139
 
125
 /** 当前组件属性 */
140
 /** 当前组件属性 */
126
 defineOptions({ name: 'RecompenseForm' });
141
 defineOptions({ name: 'RecompenseForm' });
@@ -144,6 +159,8 @@ const formType = ref('');
144
 const command = ref('');
159
 const command = ref('');
145
 // 输入项是否禁用
160
 // 输入项是否禁用
146
 const disabled = ref(true);
161
 const disabled = ref(true);
162
+// 是否自动创建账户
163
+const createAccount = ref('1');
147
 // 部门下拉数据
164
 // 部门下拉数据
148
 const deptOptions = ref<DeptVO[]>([]);
165
 const deptOptions = ref<DeptVO[]>([]);
149
 // 默认初始密码
166
 // 默认初始密码
@@ -152,6 +169,8 @@ const initPassword = ref<string>('');
152
 const postOptions = ref<PostVO[]>([]);
169
 const postOptions = ref<PostVO[]>([]);
153
 // 角色下拉数据
170
 // 角色下拉数据
154
 const roleOptions = ref<RoleVO[]>([]);
171
 const roleOptions = ref<RoleVO[]>([]);
172
+// 卡类下拉数据
173
+const cardTypeOptions = ref<PtCardTypeVO[]>([]);
155
 // 表单引用
174
 // 表单引用
156
 const formRef = ref<ElFormInstance>();
175
 const formRef = ref<ElFormInstance>();
157
 // 表单数据
176
 // 表单数据
@@ -169,6 +188,8 @@ const formData = ref<UserForm>({
169
   email: undefined,
188
   email: undefined,
170
   sex: undefined,
189
   sex: undefined,
171
   status: '0',
190
   status: '0',
191
+  cardType: undefined,
192
+  lifespan: undefined,
172
   remark: '',
193
   remark: '',
173
   roleIds: []
194
   roleIds: []
174
 });
195
 });
@@ -227,6 +248,11 @@ const initTreeData = async () => {
227
     deptOptions.value = data;
248
     deptOptions.value = data;
228
   }
249
   }
229
 };
250
 };
251
+// 初始化卡类数据
252
+const getCardTypeOption = async () => {
253
+  const response = await listUsePtCardType();
254
+  cardTypeOptions.value = response.data;
255
+};
230
 // 重置表单
256
 // 重置表单
231
 const resetForm = () => {
257
 const resetForm = () => {
232
   formData.value = {
258
   formData.value = {
@@ -243,6 +269,8 @@ const resetForm = () => {
243
     email: undefined,
269
     email: undefined,
244
     sex: undefined,
270
     sex: undefined,
245
     status: '0',
271
     status: '0',
272
+    cardType: undefined,
273
+    lifespan: undefined,
246
     remark: '',
274
     remark: '',
247
     postIds: [],
275
     postIds: [],
248
     roleIds: []
276
     roleIds: []
@@ -281,6 +309,8 @@ onMounted(() => {
281
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
309
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
282
     initPassword.value = response.data;
310
     initPassword.value = response.data;
283
   });
311
   });
312
+  // 初始化卡类数据
313
+  getCardTypeOption();
284
 });
314
 });
285
 </script>
315
 </script>
286
 
316