Browse Source

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

autumnal_wind@yeah.net 1 month ago
parent
commit
b3c416bda8
2 changed files with 33 additions and 1 deletions
  1. 2 0
      src/api/system/right/user/types.ts
  2. 31 1
      src/views/system/right/user/UserDetailForm.vue

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

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

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

@@ -96,6 +96,21 @@
96 96
             </el-form-item>
97 97
           </el-col>
98 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 114
         <el-row>
100 115
           <el-col :span="24">
101 116
             <el-form-item label="备注" prop="remark">
@@ -120,7 +135,7 @@ import { DeptVO } from '@/api/system/dept/types';
120 135
 import { PostVO } from '@/api/system/params/post/types';
121 136
 import { RoleVO } from '@/api/system/role/types';
122 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 141
 defineOptions({ name: 'RecompenseForm' });
@@ -144,6 +159,8 @@ const formType = ref('');
144 159
 const command = ref('');
145 160
 // 输入项是否禁用
146 161
 const disabled = ref(true);
162
+// 是否自动创建账户
163
+const createAccount = ref('1');
147 164
 // 部门下拉数据
148 165
 const deptOptions = ref<DeptVO[]>([]);
149 166
 // 默认初始密码
@@ -152,6 +169,8 @@ const initPassword = ref<string>('');
152 169
 const postOptions = ref<PostVO[]>([]);
153 170
 // 角色下拉数据
154 171
 const roleOptions = ref<RoleVO[]>([]);
172
+// 卡类下拉数据
173
+const cardTypeOptions = ref<PtCardTypeVO[]>([]);
155 174
 // 表单引用
156 175
 const formRef = ref<ElFormInstance>();
157 176
 // 表单数据
@@ -169,6 +188,8 @@ const formData = ref<UserForm>({
169 188
   email: undefined,
170 189
   sex: undefined,
171 190
   status: '0',
191
+  cardType: undefined,
192
+  lifespan: undefined,
172 193
   remark: '',
173 194
   roleIds: []
174 195
 });
@@ -227,6 +248,11 @@ const initTreeData = async () => {
227 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 257
 const resetForm = () => {
232 258
   formData.value = {
@@ -243,6 +269,8 @@ const resetForm = () => {
243 269
     email: undefined,
244 270
     sex: undefined,
245 271
     status: '0',
272
+    cardType: undefined,
273
+    lifespan: undefined,
246 274
     remark: '',
247 275
     postIds: [],
248 276
     roleIds: []
@@ -281,6 +309,8 @@ onMounted(() => {
281 309
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
282 310
     initPassword.value = response.data;
283 311
   });
312
+  // 初始化卡类数据
313
+  getCardTypeOption();
284 314
 });
285 315
 </script>
286 316