scorpio 2 years ago
parent
commit
7ad796bad8
2 changed files with 22 additions and 4 deletions
  1. 20 2
      src/views/user/manage.vue
  2. 2 2
      vite.config.js

+ 20 - 2
src/views/user/manage.vue

@@ -39,6 +39,7 @@
       center
       title="用户信息设置"
       width="50%"
+      @close="closeCode"
     >
       <div>
         <el-form
@@ -487,6 +488,14 @@ export default {
       this.checkAll = count === this.deptList.length
     },
     roleSave() {
+      if (this.deptList.filter(e => e.checked).length === 0) {
+        this.$message.error('请选择管理股室')
+        return
+      }
+      if (this.userInfoForm.roleIds.length === 0) {
+        this.$message.error('请选择职务')
+        return
+      }
       const data = this.userInfoForm
       if (data.deptIds.length > 0) {
         data.deptIds = data.deptIds.join(',')
@@ -509,7 +518,7 @@ export default {
         this.$api.role.roleSave(data).then(res => {
           if (res.code === 200) {
             this.showEdit = false
-            this.$message.success(res.msg)
+            this.this.$message.success(res.msg)
             this.onLoad()
           } else {
             this.$message.error(res.msg)
@@ -548,8 +557,17 @@ export default {
       })
     },
     closeCode() {
+      this.userInfoForm = {
+        name: '',
+        realName: '',
+        phone: '',
+        password: '',
+        roleIds: '',
+        deptIds: [],
+        deptId: ''
+      }
+      this.deptList.map(e => (e.checked = false))
       this.qrCodeText = ''
-      this.userInfoForm.deptId = ''
     }
   }
 }

+ 2 - 2
vite.config.js

@@ -57,8 +57,8 @@ export default defineConfig({
     proxy: {
       '/api': {
         // 正式环境地址
-        target: 'https://dev.wutongresearch.club/api',
-        // target: 'https://prod.wutongshucloud.com/api',
+        // target: 'https://dev.wutongresearch.club/api',
+        target: 'https://prod.wutongshucloud.com/api',
         // target: 'http://192.168.31.181:8110',
         changeOrigin: true,
         rewrite: path => path.replace(/^\/api/, '')