Browse Source

修复系统管理bug

Shannon_mu 3 năm trước cách đây
mục cha
commit
57f39c5706

+ 6 - 2
userCenter/src/assets/css/main.scss

@@ -29,6 +29,10 @@ body {
     -moz-osx-font-smoothing: grayscale;
     margin: 0;
 }
+textarea::-webkit-input-placeholder {
+    font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", Microsoft YaHei, "Helvetica Neue", Helvetica,
+        "Hiragino Sans GB", Arial, sans-serif;
+}
 .dmp-app {
     height: 100%;
     width: 100%;
@@ -685,7 +689,7 @@ a {
 }
 
 @mixin searchTextBotton {
-    color: $mainTextColor; 
+    color: $mainTextColor;
     font-size: 30px;
 }
 // table 操作字体颜色
@@ -697,7 +701,7 @@ a {
     }
 }
 .search .search-icon i.iconfont {
-    @include searchTextBotton
+    @include searchTextBotton;
 }
 .handle-box,
 .search,

+ 114 - 106
userCenter/src/components/common/Header.vue

@@ -7,7 +7,7 @@
  * @FilePath: \UMIS\src\components\others\Header.vue
 -->
 <template>
-    <div class="header" :class="[collapse? 'collapse':'expand']">
+    <div class="header" :class="[collapse ? 'collapse' : 'expand']">
         <div class="el-fl-left"><v-tags></v-tags></div>
         <div class="header-right">
             <div class="header-user-con">
@@ -15,7 +15,7 @@
                 <!-- 用户头像 -->
                 <div class="user-avator" @click="editUserInfo">
                     <i class="iconfont" v-show="!cruUserInfo.photo" v-bottom-txt-tip data-txt="编辑用户信息">&#xe6e8;</i>
-                    
+
                     <div
                         class="imgs"
                         v-show="cruUserInfo.photo"
@@ -27,17 +27,17 @@
                 <div class="message">
                     <span class="main" @click="goMessage('unread')">
                         <!-- <i class="iconfont btn">&#xe6ea;</i> -->
-                        <img :src='"@assets/img/btn_news.png"' alt="">
+                        <img :src="'@assets/img/btn_news.png'" alt="" />
                         <span class="iconfont point" v-if="messageNumber"></span>
                     </span>
-                    <div class="msg-content" v-if="messageList&&messageList.length">
+                    <div class="msg-content" v-if="messageList && messageList.length">
                         <p>消息通知</p>
                         <ul>
-                            <li v-for="(items, index) in messageList" :key="index" @click="toUrl(items.typeId)"  style="cursor: pointer;">
-                                <img :src='"@/assets/img/icon_msg"+(items.typeId)+".png"' style="width: 30px; height: 30px" />
+                            <li v-for="(items, index) in messageList" :key="index" @click="toUrl(items.typeId)" style="cursor: pointer">
+                                <img :src="'@/assets/img/icon_msg' + items.typeId + '.png'" style="width: 30px; height: 30px" />
                                 <div>
-                                    <span class="cont">【{{items.shortName}}】{{items.messageContent}}</span>
-                                    <span class="time">{{items.dateCreate}}</span>
+                                    <span class="cont">【{{ items.shortName }}】{{ items.messageContent }}</span>
+                                    <span class="time">{{ items.dateCreate }}</span>
                                 </div>
                             </li>
                         </ul>
@@ -46,18 +46,16 @@
                     <div class="msg-content" v-else>
                         <p>消息通知</p>
                         <ul>
-                            <li style="text-align: center;display: block;padding: 0 20px;line-height: 60px;">
-                                暂无消息
-                            </li>
+                            <li style="text-align: center; display: block; padding: 0 20px; line-height: 60px">暂无消息</li>
                         </ul>
-                       <el-button type="text" class="more" disabled>查看更多</el-button>
+                        <el-button type="text" class="more" disabled>查看更多</el-button>
                     </div>
                 </div>
                 <!-- <span style="width: 1px; height: 16px; background: #FFFFFF; opacity: 0.5"></span> -->
                 <span class="border"></span>
-                <div class="logout" @click="logOut">      
-                    <el-tooltip placement="bottom" content="退出">      
-                      <img src="@/assets/img/btn_quit.png" class="tab_head-right" @click="logOut" />
+                <div class="logout">
+                    <el-tooltip placement="bottom" content="退出">
+                        <img src="@/assets/img/btn_quit.png" class="tab_head-right" @click="logOut" />
                     </el-tooltip>
                     <!-- <i class="iconfont" v-bottom-txt-tip data-txt="退出">&#xe6e9;</i> -->
                 </div>
@@ -75,16 +73,16 @@ export default {
         return {
             name: '',
             envConfig: envConfig,
-            imgList:[
-                require("@/assets/img/icon_msg1.png"),
-                require("@/assets/img/icon_msg2.png"),
-                require("@/assets/img/icon_msg3.png"),
-                require("@/assets/img/icon_msg4.png"),
-                require("@/assets/img/icon_msg5.png"),
-                require("@/assets/img/icon_msg6.png"),
-                require("@/assets/img/icon_msg7.png"),
-                require("@/assets/img/icon_msg8.png"),
-                require("@/assets/img/icon_msg9.png")
+            imgList: [
+                require('@/assets/img/icon_msg1.png'),
+                require('@/assets/img/icon_msg2.png'),
+                require('@/assets/img/icon_msg3.png'),
+                require('@/assets/img/icon_msg4.png'),
+                require('@/assets/img/icon_msg5.png'),
+                require('@/assets/img/icon_msg6.png'),
+                require('@/assets/img/icon_msg7.png'),
+                require('@/assets/img/icon_msg8.png'),
+                require('@/assets/img/icon_msg9.png')
             ]
         };
     },
@@ -102,35 +100,37 @@ export default {
         ...mapState(['messageList'])
     },
     methods: {
-        toUrl(type){
-            let url,appId;
-            if(type==1||type==2){
-                url=this.envConfig.warnDetailUrl;
-                appId="1002";
-            }else if(type==4){
-                url=this.envConfig.taskManagementUrl;
-                appId="1003";
-            }else if(type==3||type==7){
-                url=this.envConfig.eventHiddenDangerUrl;
-                appId="1003";
-            }else if(type==9){
+        toUrl(type) {
+            let url, appId;
+            if (type == 1 || type == 2) {
+                url = this.envConfig.warnDetailUrl;
+                appId = '1002';
+            } else if (type == 4) {
+                url = this.envConfig.taskManagementUrl;
+                appId = '1003';
+            } else if (type == 3 || type == 7) {
+                url = this.envConfig.eventHiddenDangerUrl;
+                appId = '1003';
+            } else if (type == 9) {
                 // url=this.envConfig.eventHiddenDangerUrl;
-                appId="1012";
+                appId = '1012';
                 this.$router.push({
-                path: '/msg',
-             });
-             return;
+                    path: '/msg'
+                });
+                return;
             }
-            this.$http.postForm('/sc-message/message/judgingTheMessageJumpPermission',{
-                url:url.split('/')[url.split('/').length - 1],
-                appId:appId
-            }).then(({ status, data, msg })=>{
-                if(status==0&&data==0){
-                    window.open(url);
-                }else{
-                    this.$message.error("您没有该系统权限")
-                }
-            })
+            this.$http
+                .postForm('/sc-message/message/judgingTheMessageJumpPermission', {
+                    url: url.split('/')[url.split('/').length - 1],
+                    appId: appId
+                })
+                .then(({ status, data, msg }) => {
+                    if (status == 0 && data == 0) {
+                        window.open(url);
+                    } else {
+                        this.$message.error('您没有该系统权限');
+                    }
+                });
         },
         // 退出登录
         logOut() {
@@ -143,8 +143,8 @@ export default {
                     });
                     localStorage.removeItem('SC_token');
                     this.$store.commit('setloginInfo', '');
-                    this.$store.dispatch("tags", []);
-                    sessionStorage.removeItem("tabs");
+                    this.$store.dispatch('tags', []);
+                    sessionStorage.removeItem('tabs');
                     location.href = this.envConfig.loginUrl;
                 } else {
                     this.$message.error(msg);
@@ -178,32 +178,32 @@ export default {
             });
         },
         goMessage(msg) {
-            let messageStatus = 2;//全部
+            let messageStatus = 2; //全部
             if (msg == 'unread') {
-                messageStatus = 0;//未读
+                messageStatus = 0; //未读
             }
-            this.$store.commit('setmessageStatus',messageStatus);
+            this.$store.commit('setmessageStatus', messageStatus);
             this.$router.push({
-                path: '/msg',
+                path: '/msg'
             });
         },
         //获取最新消息列表
-        getMessageList(){
-            this.$http.postForm('/sc-message/message/queryLastMessage',{num:'5'}).then(({ status, data, msg }) => {
+        getMessageList() {
+            this.$http.postForm('/sc-message/message/queryLastMessage', { num: '5' }).then(({ status, data, msg }) => {
                 if (status === 0) {
                     this.$store.commit('setmessageList', data);
                 }
             });
         },
         //查询未读消息数量
-        getUnreadNumber(){
+        getUnreadNumber() {
             this.$http.postForm('/sc-message/message/queryUnreadMessageStatic').then(({ status, data, msg }) => {
                 if (status === 0) {
-                    data.map((item,index)=>{
-                       if(item.cn){
-                           this.$store.commit('setmessageNumber', true);
+                    data.map((item, index) => {
+                        if (item.cn) {
+                            this.$store.commit('setmessageNumber', true);
                         }
-                    })
+                    });
                 }
             });
         },
@@ -212,7 +212,7 @@ export default {
             if ('WebSocket' in window) {
                 var serviceIp = this.envConfig.websoketUrl;
                 this.websocket = new WebSocket('ws://' + serviceIp + '/sc-message/webSocket/' + id);
-            }else {
+            } else {
                 console.log('当前浏览器 Not support websocket');
             }
             let that = this;
@@ -236,16 +236,24 @@ export default {
 
             //接收到消息的回调方法
             this.websocket.onmessage = function (event) {
-                let msg=JSON.parse(event.data);
-                let i=msg.typeId-1;
-                if(msg.userId){
+                let msg = JSON.parse(event.data);
+                let i = msg.typeId - 1;
+                if (msg.userId) {
                     that.$notify({
                         dangerouslyUseHTMLString: true,
                         showClose: true,
-                        customClass:'notice_icon',
+                        customClass: 'notice_icon',
                         offset: 60,
-                        duration:3000,
-                        message: "<div class='notice'><img src="+that.imgList[i]+" class='img'/><div class='notice-content'><span class='title'>新消息通知</span><span class='nowrap'>"+"【"+msg.type+"】"+msg.content+"</span></div></div>"
+                        duration: 3000,
+                        message:
+                            "<div class='notice'><img src=" +
+                            that.imgList[i] +
+                            " class='img'/><div class='notice-content'><span class='title'>新消息通知</span><span class='nowrap'>" +
+                            '【' +
+                            msg.type +
+                            '】' +
+                            msg.content +
+                            '</span></div></div>'
                     });
                     that.getMessageList();
                     that.getUnreadNumber();
@@ -296,11 +304,11 @@ export default {
 };
 </script>
 <style lang='scss' scoped>
-.border{
-     width:1px;
-     height: 10px;
-     background: #FFFFFF;
-     opacity: 0.3
+.border {
+    width: 1px;
+    height: 10px;
+    background: #ffffff;
+    opacity: 0.3;
 }
 .header {
     height: 46px;
@@ -310,33 +318,33 @@ export default {
     display: flex;
     align-items: center;
     justify-content: space-between;
-    &.expand::before{
-        content: "";
+    &.expand::before {
+        content: '';
         display: inline-block;
-        width:230px;
-        height:46px;
+        width: 230px;
+        height: 46px;
         background: #2c354a;
         position: absolute;
-        left:0;
+        left: 0;
     }
-    &.collapse::before{
-        content: "";
+    &.collapse::before {
+        content: '';
         display: inline-block;
-        width:95px;
-        height:46px;
+        width: 95px;
+        height: 46px;
         background: #2c354a;
         position: absolute;
-        left:0;
+        left: 0;
     }
 }
-.header-right {   
+.header-right {
     padding-right: 20px;
-    color:rgba(255, 255, 255, 0.6);
-    .name-txt{
+    color: rgba(255, 255, 255, 0.6);
+    .name-txt {
         font-size: 12px;
         font-family: PingFangSC-Regular, PingFang SC;
         font-weight: 400;
-        color: #FFFFFF;
+        color: #ffffff;
     }
 }
 .header-user-con {
@@ -346,16 +354,16 @@ export default {
 }
 .logout {
     margin-left: 20px;
-    img{
-        width:20px;
+    img {
+        width: 20px;
         height: 20px;
     }
 }
-.iconfont{
+.iconfont {
     font-size: 20px;
-    color:rgba(255, 255, 255, 0.6);
-    &:hover{
-        color:rgba(255, 255, 255, 1);;
+    color: rgba(255, 255, 255, 0.6);
+    &:hover {
+        color: rgba(255, 255, 255, 1);
     }
 }
 .user-avator {
@@ -376,18 +384,18 @@ export default {
     &:hover {
         .msg-content {
             display: block;
-            background: #FFFFFF;
+            background: #ffffff;
             box-shadow: 0px 5px 20px 0px rgba(144, 144, 144, 0.4);
             border-radius: 6px;
-            z-index:200;
+            z-index: 200;
         }
     }
     .main {
         height: 60px;
         line-height: 60px;
         position: relative;
-        img{
-            width:20px;
+        img {
+            width: 20px;
             height: 20px;
         }
         .point {
@@ -396,7 +404,7 @@ export default {
             right: -1px;
             width: 4px;
             height: 4px;
-            background: #FE7271;
+            background: #fe7271;
             border-radius: 50%;
             display: block;
         }
@@ -404,7 +412,7 @@ export default {
 
     .msg-content {
         position: absolute;
-        width: 380px;     
+        width: 380px;
         background: #ffffff;
         z-index: 20;
         right: 20px;
@@ -422,7 +430,7 @@ export default {
             align-items: center;
             height: 60px;
             padding-left: 20px;
-            border-top: 1px solid #F6F6F6;
+            border-top: 1px solid #f6f6f6;
             font-size: 12px;
             cursor: auto;
             span {
@@ -436,14 +444,14 @@ export default {
             }
             .cont {
                 color: #424656;
-                text-indent: -0.4em
+                text-indent: -0.4em;
             }
             .time {
-                color: #7D7F87;
+                color: #7d7f87;
             }
         }
         .more {
-            width:100%;
+            width: 100%;
         }
     }
 }

+ 60 - 51
userCenter/src/views/system/dictionarys/popups/AddOrEdit.vue

@@ -18,12 +18,13 @@
         </template>
         <template v-if="tabView == 'keyValue'">
             <div class="main">
-                <div class="search" style="padding:0;height:30px;">
+                <div class="search" style="padding: 0; height: 30px">
                     <el-input placeholder="请输入键值或标签" class="search-input" v-model="mixins_query.keyWords"></el-input>
-                    <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search">查询
+                    <el-button type="primary" @click="mixins_search" class="search-btn" icon="el-icon-search"
+                        >查询
                         <!-- <i class="iconfont">&#xe6fc;</i>查询 -->
                     </el-button>
-                     <div class="search-icon">
+                    <div class="search-icon">
                         <!-- 删除 新增 -->
                         <i class="iconfont" @click="deleteRow" v-txt-tip data-txt="删除">&#xe63b;</i>
                         <i class="iconfont" @click="addOrEdit('add')" v-txt-tip data-txt="新增">&#xe641;</i>
@@ -40,14 +41,18 @@
                         @selection-change="selectionChange"
                     >
                         <template slot-scope="scope" slot="opt">
-                            <i @click="addOrEdit('edit', scope.row)" class="iconfont" style="margin-right:30px" v-txt-tip data-txt="编辑">&#xe645;</i>
-                            <i @click="deleteOne(scope.row.id)"  class="iconfont" style="color:#FF7272" v-txt-tip data-txt="删除">&#xe63a;</i>
+                            <i @click="addOrEdit('edit', scope.row)" class="iconfont" style="margin-right: 30px" v-txt-tip data-txt="编辑"
+                                >&#xe645;</i
+                            >
+                            <i @click="deleteOne(scope.row.id)" class="iconfont" style="color: #ff7272" v-txt-tip data-txt="删除"
+                                >&#xe63a;</i
+                            >
                         </template>
                     </zz-table>
                 </div>
             </div>
         </template>
-        <el-dialog :title="addkeytitle" :visible.sync="dialogFormVisible" :append-to-body="true" width="450px">
+        <el-dialog :title="addkeytitle" :visible.sync="dialogFormVisible" append-to-body width="450px" :close-on-click-modal="false">
             <zz-form
                 :cols="formaddkeyCols"
                 :data="formaddkeyData"
@@ -83,7 +88,7 @@ export default {
                 dictCode: '', //资料代码
                 dictName: '', //资料名称
                 remark: '', //备注,
-                id: '',
+                id: ''
                 // disabled:
             },
             formCols: [
@@ -91,7 +96,7 @@ export default {
                     {
                         label: '资料代码',
                         prop: 'dictCode',
-                        input: this.params.todo==='edit'?false:true
+                        input: this.params.todo === 'edit' ? false : true
                     },
                     {
                         label: '资料名称',
@@ -106,15 +111,21 @@ export default {
                 ]
             ],
             formRules: {
-                dictCode: [this.$valid.inputRequired('资料代码'), this.$valid.pattern(/^[A-Za-z0-9_]{1,30}$/,"限30位,英文字母、数字或下划线")],
-                dictName: [this.$valid.inputRequired('资料名称'), this.$valid.pattern(/^[\u4e00-\u9fa5A-Za-z0-9_]{1,20}$/,"限20位,中文、字母、数字或下划线")],
-                remark: [this.$valid.lengthRange(0,50,false)]
+                dictCode: [
+                    this.$valid.inputRequired('资料代码'),
+                    this.$valid.pattern(/^[A-Za-z0-9_]{1,30}$/, '限30位,英文字母、数字或下划线')
+                ],
+                dictName: [
+                    this.$valid.inputRequired('资料名称'),
+                    this.$valid.pattern(/^[\u4e00-\u9fa5A-Za-z0-9_]{1,20}$/, '限20位,中文、字母、数字或下划线')
+                ],
+                remark: [this.$valid.lengthRange(0, 50, false)]
             },
             formErrors: {},
             cols: [
                 {
                     label: '键值',
-                    prop: 'dictCode',
+                    prop: 'dictCode'
                 },
                 {
                     label: '内容',
@@ -138,8 +149,7 @@ export default {
                 delivery: false,
                 type: [],
                 resource: '',
-                desc: '',
-
+                desc: ''
             },
             formLabelWidth: '120px',
             formaddkeyData: {
@@ -175,7 +185,7 @@ export default {
     methods: {
         tabChange(tab, index) {
             if (!this.formaddkeyData.parentDictId) {
-                this.$message.error("请先保存基本信息");
+                this.$message.error('请先保存基本信息');
                 return;
             }
             this.iscur = index;
@@ -183,7 +193,7 @@ export default {
             if (this.tabView == 'keyValue' && this.formaddkeyData.parentDictId) {
                 this.mixins_query.parentDictId = this.formaddkeyData.parentDictId;
                 this.mixins_search();
-            }else{
+            } else {
                 this.formData.id = this.formaddkeyData.parentDictId;
             }
         },
@@ -198,44 +208,44 @@ export default {
                 this.formaddkeyData.parentDictId = this.params.data.id;
                 this.formaddkeyData.dictCode = '';
                 this.formaddkeyData.dictValue = '';
-                this.formaddkeyCols= [
-                [
-                    {
-                        label: '键值输入',
-                        prop: 'dictCode',
-                        input: true,
-                        maxlength: 20
-                    },
-                    {
-                        label: '内容输入',
-                        prop: 'dictValue',
-                        input: true,
-                        placeholder: '请简单描述'
-                    }
-                ]
-            ]
+                this.formaddkeyCols = [
+                    [
+                        {
+                            label: '键值输入',
+                            prop: 'dictCode',
+                            input: true,
+                            maxlength: 20
+                        },
+                        {
+                            label: '内容输入',
+                            prop: 'dictValue',
+                            input: true,
+                            placeholder: '请简单描述'
+                        }
+                    ]
+                ];
             } else {
                 this.addkeytitle = '编辑键值';
                 this.formaddkeyData.id = index.id;
                 this.formaddkeyData.parentDictId = index.parentDictId;
                 this.formaddkeyData.dictCode = index.dictCode;
                 this.formaddkeyData.dictValue = index.dictValue;
-                this.formaddkeyCols= [
-                [
-                    {
-                        label: '键值输入',
-                        prop: 'dictCode',
-                        input: false,
-                        maxlength: 20
-                    },
-                    {
-                        label: '内容输入',
-                        prop: 'dictValue',
-                        input: true,
-                        placeholder: '请简单描述'
-                    }
-                ]
-            ]
+                this.formaddkeyCols = [
+                    [
+                        {
+                            label: '键值输入',
+                            prop: 'dictCode',
+                            input: false,
+                            maxlength: 20
+                        },
+                        {
+                            label: '内容输入',
+                            prop: 'dictValue',
+                            input: true,
+                            placeholder: '请简单描述'
+                        }
+                    ]
+                ];
             }
         },
         // 新增/编辑键值保存
@@ -273,7 +283,7 @@ export default {
             this.selectRow.forEach((v) => {
                 ids.push(v.id);
             });
-           this.$msgBox(`刪除字典`, '删除后将无法恢复,请问是否继续?')
+            this.$msgBox(`刪除字典`, '删除后将无法恢复,请问是否继续?')
                 .then(() => {
                     this.$http.post('/dict/delete', ids).then(({ status, data, msg }) => {
                         if (0 === status) {
@@ -332,8 +342,7 @@ export default {
                             this.$message.error(msg);
                         }
                     })
-                    .catch((err) => {
-                    });
+                    .catch((err) => {});
             });
             if (this.tabView == 'keyValue') {
                 this.$emit('close');

+ 1 - 0
userCenter/src/views/system/organs/index.vue

@@ -211,6 +211,7 @@ export default {
                 .catch(() => {});
         },
         fun(params) {
+            this.$refs['form'].$children[0].resetFields();
             const {
                 id = '',
                 orgType = '', //机构类型

+ 17 - 20
userCenter/src/views/system/organs/popups/EditForm.vue

@@ -20,26 +20,27 @@
                 >
                     <el-option v-for="item in organTypeList" :key="item.value" :value="item.value" :label="item.label"></el-option>
                 </el-select>
-                <select-tree
-                    v-if="organList.length"
+
+                <el-input
+                    v-if="isEdit !== 'edit' && isEdit !== 'add' && formData.parentOrgId == ''"
                     slot="parentOrgId"
-                    class="new-select-tree"
-                    selectTreeTitle="所属机构"
-                    :disabled="isEdit == 'edit'"
-                    :options="organList"
-                    :props="defaultProps"
-                    v-model="formData.parentOrgId"
-                />
+                    type="text"
+                    placeholder="请选择上级机构"
+                >
+                </el-input>
+
                 <select-tree
-                    v-if="!organList.length && this.formData.todo == 'add'"
+                    v-else
                     slot="parentOrgId"
                     class="new-select-tree"
-                    :disabled="isEdit == 'edit'"
+                    empty-text="请选择上级机构"
+                    placeholder="请选择上级机构"
+                    :disabled="isEdit !== 'edit' && isEdit !== 'add'"
                     :options="organList"
-                    selectTreeTitle="所属机构"
                     :props="defaultProps"
                     v-model="formData.parentOrgId"
                 />
+
                 <el-cascader
                     slot="orgAreaId"
                     v-model="formData.orgAreaId"
@@ -60,7 +61,7 @@
                     <span style="position: absolute; bottom: 0; right: 10px" v-if="formData.remark">{{ formData.remark.length }}/50</span>
                 </div>
             </zz-form>
-            <zz-form :cols="formTwoCols" :data="formData" :errors="formErrors" labelWidth="100" ref="form" :disabled="!isEdit">
+            <zz-form :cols="formTwoCols" :data="formData" :errors="formErrors" ref="form1" labelWidth="100" :disabled="!isEdit">
                 <el-select slot="orgLeaderSex" v-model="formData.orgLeaderSex" placeholder="请选择性别">
                     <el-option value="0" label="女"></el-option>
                     <el-option value="1" label="男"></el-option>
@@ -201,9 +202,9 @@ export default {
                 ]
             ],
             formRules: {
-                orgType: [this.$valid.selectRequired('机构类型')],
-                parentOrgId: [this.$valid.selectRequired('上级机构')],
-                orgAreaId: [this.$valid.inputRequired('所属区域')],
+                orgType: [this.$valid.selectRequired('请选择机构类型')],
+                parentOrgId: [this.$valid.selectRequired('请选择上级机构')],
+                orgAreaId: [this.$valid.inputRequired('请选择所属区域')],
                 orgName: [this.$valid.inputRequired('机构名称'), this.$valid.pattern(/^[\u4e00-\u9fa5A-Za-z0-9_]{1,20}$/)],
                 orgState: [this.$valid.inputRequired('状态')],
                 orgLeaderName: [this.$valid.pattern(/^[\u4e00-\u9fa5A-Za-z0-9_]{0,20}$/)],
@@ -288,10 +289,6 @@ export default {
             new Promise((resolve) => {
                 this.$refs.form.validate(resolve);
             }).then(() => {
-                // if (this.formData.parentOrgId == '') {
-                //     this.formData.parentOrgId = 0;
-                // }
-                debugger;
                 let data = JSON.parse(JSON.stringify(newData)),
                     method = 'post',
                     url = '/org/insert';

+ 12 - 5
userCenter/src/views/system/users/popups/AddOrEditUserInfo.vue

@@ -318,16 +318,18 @@ export default {
             }).then(() => {
                 var loading = this.$loading();
                 var posturl = '';
+                let frData = JSON.parse(JSON.stringify(this.formData));
                 if (this.params.todo === 'edit') {
                     posturl = '/user/updateUserById';
-                    // if (this.formData.deptOrgId == '') {
-                    //     this.formData.deptOrgName = '';
-                    // }
+                    if (frData.password === '**********' || frData.passwordOK === '**********') {
+                        delete frData.password;
+                        delete frData.passwordOK;
+                    }
                 } else {
                     posturl = '/user/addUser';
                 }
                 this.$http
-                    .post(posturl, this.formData)
+                    .post(posturl, frData)
                     .then(({ status, data, msg }) => {
                         loading.close();
                         if (0 == status) {
@@ -368,8 +370,13 @@ export default {
     },
     created() {
         this.getselectAll();
-        // this.getcompanyTree();
         this.formData = JSON.stringify(this.params.data) !== '{}' ? this.params.data : this.formData;
+
+        if (this.params.todo === 'edit') {
+            this.$set(this.formData, 'password', '**********');
+            this.$set(this.formData, 'passwordOK', '**********');
+        }
+
         this.organList = this.params.organList ? this.params.organList : this.organList;
         this.organListCompany = this.params.organListCompany ? this.params.organListCompany : this.organListCompany;
         this.organListdepartment = this.params.organListdepartment ? this.params.organListdepartment : this.organListdepartment;

+ 15 - 12
userCenter/src/views/system/users/popups/edituser.vue

@@ -9,8 +9,8 @@
 <template>
     <div class="alert-body__main_content">
         <zz-form :cols="formCols" :data="formData" :rules="formRules" :errors="formErrors" labelWidth="110" ref="form">
-            <el-input slot="password" type="password" v-model="formData.password"></el-input>
-            <el-input slot="passwordOK" type="password" v-model="formData.passwordOK"></el-input>
+            <el-input slot="password" type="password" clearable v-model="formData.password"></el-input>
+            <el-input slot="passwordOK" type="password" clearable v-model="formData.passwordOK"></el-input>
             <el-select slot="status" v-model="formData.enableState">
                 <el-option v-for="(item, index) in allStatus" :key="index" :label="item.label" :value="item.id">{{ item.label }}</el-option>
             </el-select>
@@ -49,7 +49,7 @@
             />
             <div class="imgdis-div" slot="companylogo" v-show="formData.photo">
                 <i class="el-icon-delete" @click="delformphoto"></i>
-                <img :src="envConfig.baseImgApi + formData.photo" alt="" width="60" height="60" />
+                <img :src="envConfig.baseImgApi + formData.photo" alt="" width="60" height="60" style="object-fit: cover" />
                 <!-- <div class="tips"><img  style="width:12px;height:12px;vertical-align: middle;" src="@assets/img/icon-warning.png"/><span>支持jpg,jpeg,gif,png,bmp格式的图片</span></div> -->
             </div>
             <el-upload
@@ -69,12 +69,6 @@
                 <div slot="file" slot-scope="{ file }">
                     <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
                     <span class="el-upload-list__item-actions">
-                        <!-- <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
-                            <i class="el-icon-zoom-in"></i>
-                        </span> -->
-                        <!-- <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleDownload(file)">
-                            <i class="el-icon-download"></i>
-                        </span> -->
                         <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
                             <i class="el-icon-delete"></i>
                         </span>
@@ -167,7 +161,9 @@ export default {
                 userGroupId: '',
                 userTags: '',
                 userType: '',
-                username: ''
+                username: '',
+                password: '**********',
+                passwordOK: '**********'
             },
             dialogImageUrl: '',
             dialogVisible: false,
@@ -247,12 +243,18 @@ export default {
             }).then(() => {
                 var loading = this.$loading();
                 var posturl = '/sc-user-center/user/updateUserById';
+                if (this.formData.password === '**********' || this.formData.passwordOK === '**********') {
+                    delete this.formData.password;
+                    delete this.formData.passwordOK;
+                }
                 this.$http
                     .post(posturl, this.formData)
                     .then(({ status, data, msg }) => {
+                        debugger;
                         loading.close();
                         if (0 == status) {
                             this.$message.success(msg);
+
                             if (this.phoneNumber !== this.formData.phone) {
                                 this.$alert('你的手机号已变更,需重新登录', '提示', {
                                     confirmButtonText: '确定',
@@ -290,9 +292,10 @@ export default {
     },
     created() {
         this.getselectAll();
-        // this.getcompanyTree();
         this.phoneNumber = this.params.data.phone;
-        this.formData = this.params.data ? this.params.data : this.formData;
+        let val = Object.assign(this.formData, this.params.data);
+        this.formData = val;
+        this.$set(this.formData, 'password', '**********');
         this.organList = this.params.organList ? this.params.organList : this.organList;
         this.organListCompany = this.params.organListCompany ? this.params.organListCompany : this.organListCompany;
         this.organListdepartment = this.params.organListdepartment ? this.params.organListdepartment : this.organListdepartment;