denny преди 2 години
родител
ревизия
2a46c1132e

+ 23 - 0
VinnoManagementSystem/src/api/wing/user.js

@@ -85,4 +85,27 @@ export default {
             });
         }
 	},
+    modifyUserInfo: {
+		method: 'ModifyUser',
+		name: "修改用户(只支持机构和平台角色)",
+		post: async function (req) {    
+            var roleCodes = []
+            if (req.role !== null && req.role !== undefined) {
+                roleCodes.push(req.role)
+            }        
+            var data = {
+                'UserCode': req.userCode, 
+                'OrganizationCode': req.organization, 
+                'RoleCodes': roleCodes, 
+                'RootOrganizationCode': req.rootOrganizationCode,
+                'HeadImageUrl': req.imgUrl
+            }
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+	},
 }

+ 17 - 0
VinnoManagementSystem/src/api/wing/userRole.js

@@ -0,0 +1,17 @@
+import http from "@/utils/request"
+import common from "@/utils/common"
+
+export default {
+    roleSelectList: {
+		method: 'GetRoleSelectList',
+		name: "角色下拉列表",
+		post: async function (data = {}) {  
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+	},
+}

+ 2 - 2
VinnoManagementSystem/src/components/scSelect/index.vue

@@ -36,7 +36,7 @@
 				loading: false,
 				options: [],
 				props: config.props,
-				initloading: false
+				initloading: false,
 			}
 		},
 		created() {
@@ -87,7 +87,7 @@
 				this.options = [];
 				Object.assign(this.params, param || {})
 				this.getRemoteData()
-			},
+			}
 		}
 	}
 </script>

+ 51 - 36
VinnoManagementSystem/src/views/userManage/saveUser.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-dialog :title="titleMap" v-model="visible" :width="700" destroy-on-close @closed="$emit('closed')">
-		<el-form :model="form" :rules="rules" :disabled="mode=='show'"  ref="dialogForm" label-width="100px" label-position="left">
+		<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px" label-position="left">
 			<el-row :gutter="15">
 				<el-col :span="12">
 					<el-form-item :label="$t('user.userName')" prop="userName">
@@ -40,12 +40,14 @@
 			<el-row :gutter="15">
 				<el-col :span="12">
 					<el-form-item :label="$t('user.hospitalName')" prop="organization">
-                        <sc-select v-model="form.organization" :apiObj="$API.organization.organizationSelectList" style="width:100%" disabled clearable filterable></sc-select>
+                        <sc-select v-model="form.organization" :apiObj="$API.organization.organizationSelectList" style="width:100%" clearable filterable @change="orgChange(form.organization)"></sc-select>
                     </el-form-item>
 				</el-col>
 				<el-col :span="12">
 					<el-form-item :label="$t('menu.roleList')" prop="role">
-                        <sc-select v-model="form.role" :apiObj="$API.organization.organizationSelectList" style="width:100%" disabled clearable filterable></sc-select>
+                        <el-select v-model="form.role" style="width:100%" clearable filterable>
+							<el-option v-for="item in platRules" :key="item.Key" :label="item.Value" :value="item.Key" />
+						</el-select>
                     </el-form-item>
 				</el-col>
 			</el-row>
@@ -80,16 +82,12 @@
 					phone: '',
 					email: '',
 					rank: '',
-					organization: '',
+					organization: '-1',
 					rootOrganizationCode: '',
 					role: '',
 					imgUrl: ''
 				},
-				//审核列表
-				radioList:[
-					{ label: this.$t('yes'), value: 1 },
-					{ label: this.$t('no'), value: 2 }
-				],
+      			platRules: [],
 			}
 		},
 		methods: {
@@ -105,41 +103,58 @@
 				var res = await this.$API.user.userDetailInfo.post(code);
 				this.isSaveing = false;
 				if (res){
+					this.form.userCode = res.UserCode;
+					this.form.userName = res.UserName;
+					this.form.nickName = res.NickName;
 					this.form.fullName = res.FullName;
 					this.form.phone = res.Phone
 					this.form.email = res.Email
-					this.form.hospital = res.HospitalName
-					this.form.department = res.DepartmentName
-					this.form.applyRoleName = res.IdentityApplyRoleName
-					this.form.identityApplyCode = res.IdentityApplyCode
-					if (res.IdentityCard != null && res.IdentityCard.length > 0) {
-						this.form.cardFront = res.IdentityCard[0]
-						if (res.IdentityCard.length > 1) {
-							this.form.cardreverse = res.IdentityCard[1]
-						}
-					}
-					if (res.LicenseCard != null && res.LicenseCard.length > 0) {
-						this.form.doctorLicense = res.LicenseCard[0]
+					this.form.role = res.RoleCodes[0]
+					this.form.rank = res.RankName
+					this.form.organization = res.RootOrganizationCode
+					this.form.rootOrganizationCode = res.RootOrganizationCode
+					this.form.imgUrl = res.HeadImageUrl
+					if (res.RootOrganizationCode !== '' && res.RootOrganizationCode !== undefined) {
+						this.bindPlatRuleSelectList()
 					}
 				}
 			},
+			//根据机构code级联平台角色
+			orgChange(orgCode) {
+				if (orgCode === '') {
+					this.form.role = ''
+					this.platRules = []
+				} else {
+					this.bindPlatRuleSelectList()
+				}
+			},
+			//绑定角色
+			async bindPlatRuleSelectList()
+			{
+				var result = await this.$API.userRole.roleSelectList.post();
+				if (result)
+				{
+					this.platRules = result
+				}
+				else
+				{
+					this.platRules = []
+				}
+			},
 			//表单提交方法
 			async submit(){
-				alert(this.form.imgUrl);
-				return false;
-				//通过
-				// if (this.form.radio === 1) {
-				// 	this.isSaveing = true;
-				// 	var res = await this.$API.user.AuditPass.post(this.form.identityApplyCode);
-				// 	this.isSaveing = false;
-				// 	if(res){	
-				// 		this.$emit('success');
-				// 		this.visible = false;
-				// 		this.$message.success(this.$t('response.operateSuccess'))
-				// 	}else{
-				// 		this.$alert(res.message, this.$t('dialogBox.confirmWarningTitle'), {type: 'error'})
-				// 	}
-				// }
+				this.isSaveing = true;
+				var res = false;
+				res = await this.$API.user.modifyUserInfo.post(this.form);
+				this.isSaveing = false;
+				if(res){
+					this.$emit('success');
+					this.visible = false;
+					this.$message.success(this.$t("response.operateSuccess"))
+				}
+				else{
+					this.$alert(res.message, this.$t("dialogBox.confirmWarningTitle"), {type: 'error'})
+				}					
 			}
 		}
 	}

+ 1 - 1
VinnoManagementSystem/src/views/userManage/userList.vue

@@ -105,7 +105,7 @@
 			table_edit(row){
 				this.dialog.save = true
 				this.$nextTick(() => {
-					this.$refs.saveDialog.open('edit').setData(row)
+					this.$refs.saveDialog.open(row.UserCode);
 				})
 			},
 			//审核页面

+ 1 - 1
VinnoManagementSystem/vue.config.js

@@ -21,7 +21,7 @@ module.exports = {
 				}
 			},
 			'/api': {
-				target: 'http://192.168.6.117/IManagementService',
+				target: 'http://192.168.6.69/IManagementService',
 				ws: true,
 				changeOrigin: true,
 				pathRewrite: {