LiGuang 3 years ago
parent
commit
75fc0e9339

+ 4 - 4
src/views/system/Shift.vue

@@ -28,10 +28,10 @@
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
+             <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
                 <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
+              </a> -->
             </span>
           </a-col>
 
@@ -42,8 +42,8 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus" v-has="'shift:add'">新增</a-button>
-      <!-- <a-button type="primary" icon="download" @click="handleExportXls('班次档案')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-button type="primary" icon="download" @click="handleExportXls('班次档案')">导出</a-button>
+            <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">

+ 61 - 80
src/views/system/StatutoryLeaveList.vue

@@ -16,31 +16,15 @@
               <a-input placeholder="请输入日薪资倍数" v-model="queryParam.sum"></a-input>
             </a-form-item>
           </a-col>
-         <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="假期开始时间">
-              <a-input placeholder="请输入假期开始时间" v-model="queryParam.startDate"></a-input>
-            </a-form-item>
-          </a-col> -->
-      <!--  <template v-if="toggleSearchStatus">
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="假期结束时间">
-              <a-input placeholder="请输入假期结束时间" v-model="queryParam.endDate"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="日薪资倍数">
-              <a-input placeholder="请输入日薪资倍数" v-model="queryParam.sum"></a-input>
-            </a-form-item>
-          </a-col>
-          </template> -->
+
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
+              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                 {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
+              </a> -->
             </span>
           </a-col>
 
@@ -51,43 +35,42 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus" v-has="'leave:add'">新增</a-button>
-     <!-- <a-button type="primary" icon="download" @click="handleExportXls('法定假期')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-button type="primary" icon="download" @click="handleExportXls('法定假期')">导出</a-button>
+      <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay" v-has="'leave:delete'">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />删除
+          </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
+        <a-button style="margin-left: 8px"> 批量操作
+          <a-icon type="down" />
+        </a-button>
       </a-dropdown>
     </div>
 
     <!-- table区域-begin -->
     <div>
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
+          style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
       </div>
 
-      <a-table
-        ref="table"
-        size="middle"
-        bordered
-        rowKey="id"
-        :columns="columns"
-        :dataSource="dataSource"
-        :pagination="ipagination"
-        :loading="loading"
-        class="j-table-force-nowrap"
-        @change="handleTableChange">
+      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
+        :pagination="ipagination" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
 
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)" v-has="'leave:edit'">编辑</a>
 
           <a-divider type="vertical" />
           <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a class="ant-dropdown-link">更多
+              <a-icon type="down" />
+            </a>
             <a-menu slot="overlay" v-has="'leave:delete'">
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@@ -110,15 +93,17 @@
 <script>
   import '@/assets/less/TableExpand.less'
   import StatutoryLeaveModal from './modules/StatutoryLeaveModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import moment from "moment"
+  import {
+    JeecgListMixin
+  } from '@/mixins/JeecgListMixin'
+  import moment from "moment"
   export default {
     name: "StatutoryLeaveList",
-    mixins:[JeecgListMixin],
+    mixins: [JeecgListMixin],
     components: {
       StatutoryLeaveModal
     },
-    data () {
+    data() {
       return {
         description: '法定假期管理页面',
         // 表头
@@ -133,70 +118,66 @@ import moment from "moment"
           //     return parseInt(index)+1;
           //   }
           //  },
-		   {
+          {
             title: '假期名称',
-            align:"center",
+            align: "center",
             dataIndex: 'name'
-           },
-           {
-                title: '类型',
-                align:"center",
-                dataIndex: 'type',
-                customRender:function(t,r,index){
-                  var name="休";
-                  if(t!=null&&t=="1"){
-                    name="班"
-                  }
-                  return name;
-                }
-               },
-		   {
+          },
+          {
+            title: '类型',
+            align: "center",
+            dataIndex: 'type',
+
+          },
+          {
             title: '假期开始时间',
-            align:"center",
+            align: "center",
             dataIndex: 'startDate',
-            customRender:function(t,r,index){
+            customRender: function(t, r, index) {
               return moment(t).format('YYYY-MM-DD');
             }
-           },
-		   {
+          },
+          {
             title: '假期结束时间',
-            align:"center",
+            align: "center",
             dataIndex: 'endDate',
-            customRender:function(t,r,index){
+            customRender: function(t, r, index) {
               return moment(t).format('YYYY-MM-DD');
             }
-           },
-		   {
+          },
+          {
             title: '日薪资倍数',
-            align:"center",
+            align: "center",
             dataIndex: 'sum'
-           },
+          },
           {
             title: '操作',
             dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+            align: "center",
+            scopedSlots: {
+              customRender: 'action'
+            },
           }
         ],
-		url: {
+        url: {
           list: "/statutoryleave/statutoryLeave/list",
           delete: "/statutoryleave/statutoryLeave/delete",
           deleteBatch: "/statutoryleave/statutoryLeave/deleteBatch",
           exportXlsUrl: "statutoryleave/statutoryLeave/exportXls",
           importExcelUrl: "statutoryleave/statutoryLeave/importExcel",
-       },
-    }
-  },
-  computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    }
-  },
+        },
+      }
+    },
+    computed: {
+      importExcelUrl: function() {
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      }
+    },
     methods: {
-     
+
     }
   }
 </script>
 <style scoped>
   @import '~@assets/less/common.less';
-</style>
+</style>

+ 91 - 4
src/views/system/UserList.vue

@@ -85,10 +85,14 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator" style="border-top: 5px">
       <a-button @click="handleAdd()" type="primary" icon="plus" v-has="'user:add'" >添加员工</a-button>
-      <a-button @click="handleExportXltx()"type="primary" icon="plus"  v-has="'user:mb'" >模板</a-button>
+      <a-button @click="handleExportXltx()"type="primary" icon="plus"  v-has="'user:mb'" >员工模板</a-button>
+      <a-button @click="handleExportXls3('薪资模板')"type="primary" icon="plus"  v-has="'user:mb'" >薪资模板</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('用户信息')" v-has='"user:export"'>导出</a-button>
       <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel" v-has='"user:import"'>
-        <a-button type="primary" icon="import">导入</a-button>
+        <a-button type="primary" icon="import">员工导入</a-button>
+      </a-upload>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrls" @change="handleImportExcels" v-has='"user:import"'>
+        <a-button type="primary" icon="import">薪资导入</a-button>
       </a-upload>
       <a-button type="primary" icon="hdd" @click="recycleBinVisible=true" v-has='"user:recovery"'>回收站</a-button>
      
@@ -204,7 +208,7 @@
   import UserModal from './modules/UserModal'
   import UserDetailModal from './modules/UserDetailModal'
   import PasswordModal from './modules/PasswordModal'
-  import {putAction,getFileAccessHttpUrl,getAction} from '@/api/manage';
+  import {putAction,getFileAccessHttpUrl,getAction,downFile} from '@/api/manage';
   import {frozenBatch} from '@/api/api'
   import {JeecgListMixin} from '@/mixins/JeecgListMixin'
   import JInput from '@/components/jeecg/JInput'
@@ -212,6 +216,11 @@
   import JSuperQuery from '@/components/jeecg/JSuperQuery'
 import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
  import JTreeSelect from '@/components/jeecg/JTreeSelect'
+ import { ACCESS_TOKEN, TENANT_ID } from "@/store/mutation-types"
+ import store from '@/store'
+ import { filterObj } from '@/utils/util';
+ import {Modal} from 'ant-design-vue'
+ import Vue from 'vue'
   export default {
     name: "UserList",
     mixins: [JeecgListMixin],
@@ -375,14 +384,19 @@ import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
           deleteBatch: "/sys/user/deleteBatch",
           exportXlsUrl: "/sys/user/exportXls",
           importExcelUrl: "sys/user/importExcel",
+          importExcelUrls:'sys/user/importExcels',
           pulldata:"/sys/weixin/pullData",
-          editstate:"/sys/user/editState"
+          editstate:"/sys/user/editState",
+          userChangemb:'/userchange/userChage/exportXls'
         },
       }
     },
     computed: {
       importExcelUrl: function(){
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+      importExcelUrls(){
+         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrls}`;
       }
     },
     methods: {
@@ -486,6 +500,79 @@ import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
           }
         });
       },
+      handleExportXls3(fileName){
+        if(!fileName || typeof fileName != "string"){
+          fileName = "导出文件"
+        }
+        downFile(this.url.userChangemb,{}).then((data)=>{
+          if (!data) {
+            this.$message.warning("文件下载失败")
+            return
+          }
+          if (typeof window.navigator.msSaveBlob !== 'undefined') {
+            window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls')
+          }else{
+            let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
+            let link = document.createElement('a')
+            link.style.display = 'none'
+            link.href = url
+            link.setAttribute('download', fileName+'.xls')
+            document.body.appendChild(link)
+            link.click()
+            document.body.removeChild(link); //下载完成移除元素
+            window.URL.revokeObjectURL(url); //释放掉blob对象
+          }
+        })
+      },
+      /* 导入 */
+      handleImportExcels(info){
+        if (info.file.status !== 'uploading') {
+          console.log(info.file, info.fileList);
+        }
+        if (info.file.status === 'done') {
+          if (info.file.response.success) {
+            // this.$message.success(`${info.file.name} 文件上传成功`);
+            if (info.file.response.code === 201) {
+              let { message, result: { msg, fileUrl, fileName } } = info.file.response
+              let href = window._CONFIG['domianURL'] + fileUrl
+              this.$warning({
+                title: message,
+                content: (<div>
+                    <span>{msg}</span><br/>
+                    <span>具体详情请 <a href={href} target="_blank" download={fileName}>点击下载</a> </span>
+                  </div>
+                )
+              })
+            } else {
+              this.$message.success(info.file.response.message || `${info.file.name} 文件上传成功`)
+            }
+            this.loadData()
+          } else {
+            this.$message.error(`${info.file.name} ${info.file.response.message}.`);
+          }
+        } else if (info.file.status === 'error') {
+          if (info.file.response.status === 500) {
+            let data = info.file.response
+            const token = Vue.ls.get(ACCESS_TOKEN)
+            if (token && data.message.includes("Token失效")) {
+              Modal.error({
+                title: '登录已过期',
+                content: '很抱歉,登录已过期,请重新登录',
+                okText: '重新登录',
+                mask: false,
+                onOk: () => {
+                  store.dispatch('Logout').then(() => {
+                    Vue.ls.remove(ACCESS_TOKEN)
+                    window.location.reload();
+                  })
+                }
+              })
+            }
+          } else {
+            this.$message.error(`文件上传失败: ${info.file.msg} `);
+          }
+        }
+      },
       handleChangePassword(username) {
         this.$refs.passwordmodal.show(username);
       },

+ 2 - 2
src/views/system/UserPrizeList.vue

@@ -56,8 +56,8 @@
     <!-- 操作按钮区域 -->
     <div class="table-operator">
       <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <!-- <a-button type="primary" icon="download" @click="handleExportXls('员工奖惩')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+      <a-button type="primary" icon="download" @click="handleExportXls('员工奖惩')">导出</a-button>
+     <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
       </a-upload> -->
       <a-dropdown v-if="selectedRowKeys.length > 0">

+ 1 - 1
src/views/system/modules/AttendanceRuleModal.vue

@@ -93,7 +93,7 @@
                   {{text}}
                 </a-tag>
                 <a-tag color="#FFFFFF" v-else @click="UserType(d,record,index)" style="width: 40px;">.</a-tag>
-                <a-menu slot="overlay">
+                <a-menu slot="overlay" v-if="record.isColse">
                   <a-menu-item key="0">
                     <a @click="shiftOks(0,d,record,index)">休息</a>
                   </a-menu-item>

+ 58 - 32
src/views/system/modules/DepartWindow.vue

@@ -13,17 +13,14 @@
     <template>
       <a-form :form="form">
       <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="部门">
-      <a-directory-tree
-        multiple
-        v-if="departTree.length>0"
-        :defaultExpandAll="true"
-        @expand="onExpand"
-        @select="onCheck"
-        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
-        :treeData="departTree"
-        placeholder="请选择部门"
-        >
-      </a-directory-tree>
+     <a-directory-tree
+         :expanded-keys="expandedKeys"
+         :auto-expand-parent="autoExpandParent"
+         :selected-keys="selectedKeys"
+         :tree-data="departTree"
+         @expand="onExpand"
+         @select="onSelect"
+       />
       </a-form-item>
       </a-form>
     </template>
@@ -42,9 +39,10 @@
     },
     data () {
       return {
-        defaultExpandedKeys:[],
-        checkedKeys:[], // 存储选中的部门id
-        expandedKeysss:[],//展开的节点
+       expandedKeys: ['1'],
+        autoExpandParent: true,
+        checkedKeys: [],
+        selectedKeys: [],
         userId:"", // 存储用户id
         model:{}, // 存储SysUserDepartsVO表
         userDepartModel:{userId:'',departIdList:[]}, // 存储用户id一对多部门信息的对象
@@ -70,8 +68,34 @@
       }
     },
     methods: {
+      onExpand(expandedKeys) {
+            console.log('onExpand', expandedKeys);
+            // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+            // or, you can remove all expanded children keys.
+            this.expandedKeys = expandedKeys;
+            //this.autoExpandParent = false;
+          },
+          onCheck(checkedKeys) {
+            console.log('onCheck', checkedKeys);
+            this.checkedKeys = checkedKeys;
+          },
+          onSelect(selectedKeys, info) {
+            console.log('onSelect', selectedKeys);
+            this.selectedKeys = selectedKeys;
+            this.departList = [];
+            let selectedNodes = info.selectedNodes;
+            for (let i = 0; i < selectedNodes.length; i++) {
+              let de = selectedNodes[i]._props;
+              let depart = {key:"",value:"",title:""};
+              depart.key = de.value;
+              depart.value = de.value;
+              depart.title = de.title;
+              this.departList.push(depart);
+            }
+          },
       add (checkedDepartKeys,userId) {
-        this.checkedKeys = checkedDepartKeys;
+        this.selectedKeys = checkedDepartKeys;
+        console.log(checkedDepartKeys)
         //this.expandedKeysss=checkedDepartKeys;
         this.userId = userId;
         this.edit({});
@@ -140,32 +164,34 @@
           depart.title = de.title;
           this.departList.push(depart);
         }
+
       },
       queryDepartTree(){
         queryIdTree().then((res)=>{
           if(res.success){
             this.departTree = res.result;
-            if(this.checkedKeys&&this.checkedKeys.length >0){
-              let treekey=[];
-              let arr=res.result;
-              if(arr&&arr.length>0){
-                arr.forEach(item => {
-                  treekey.push(item.key);
-             /*     if(item.children&&item.children.length>0){
-                    item.children.forEach(item1 => {
-                      treekey.push(item1.key);
-                    })
-                  }*/
-                })
-                this.expandedKeysss = treekey
-              }
+            if(this.selectedKeys&&this.selectedKeys.length >0){
+             //  let treekey=[];
+             //  let arr=res.result;
+             //  if(arr&&arr.length>0){
+             //    arr.forEach(item => {
+             //      treekey.push(item.key);
+             // /*     if(item.children&&item.children.length>0){
+             //        item.children.forEach(item1 => {
+             //          treekey.push(item1.key);
+             //        })
+             //      }*/
+             //    })
+             //    this.expandedKeys = treekey
+             //  }
+             this.expandedKeys = this.selectedKeys;
             }
           }
         })
       },
-      onExpand(expandedKeys){
-        this.expandedKeysss = expandedKeys;
-      },
+      // onExpand(expandedKeys){
+      //   this.expandedKeysss = expandedKeys;
+      // },
       modalFormOk(){
 
       }

+ 5 - 4
src/views/system/modules/SysPositionModal.vue

@@ -57,6 +57,7 @@ import { queryIdTree } from '@/api/api'
       return {
         departTree:[],
         checkedDepartKeys:[],
+        selectDeptKeys:[],
         visibles:false,
         title: '操作',
         visible: false,
@@ -120,6 +121,7 @@ import { queryIdTree } from '@/api/api'
         this.edit({})
       },
       edit(record) {
+        this.selectDeptKeys=[];
         this.form.resetFields()
         console.log(record)
         this.model = Object.assign({}, record)
@@ -130,6 +132,7 @@ import { queryIdTree } from '@/api/api'
           this.readOnly=false
         }
         this.deptid=record.deptId;
+        this.selectDeptKeys.push(record.deptId);
         this.$nextTick(() => {
           this.form.setFieldsValue(pick(this.model,
             'code',
@@ -184,7 +187,7 @@ import { queryIdTree } from '@/api/api'
       },
 // 搜索用户对应的部门API
       onSearch() {
-        this.$refs.departWindow.add(this.checkedDepartKeys, "");
+        this.$refs.departWindow.add(this.selectDeptKeys, "");
       },
  // 获取用户对应部门弹出框提交给返回的数据
       modalFormOk(formData) {
@@ -192,9 +195,7 @@ import { queryIdTree } from '@/api/api'
           deptName:formData.departIdList[0].title
         })
        this.deptid=formData.departIdList[0].value;
-        
-        console.log(formData.departIdList[0].value)
-        //this.deptid=formData.departIdList[0].value;
+        this.selectDeptKeys.push(formData.departIdList[0].value)
       },
     }
   }

+ 12 - 7
src/views/system/modules/UserModal.vue

@@ -58,7 +58,7 @@
           </a-col>
           <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="身份证" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input :maxLength="20" placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
+              <a-input :maxLength="40" placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -420,7 +420,7 @@
         checkedDepartNames: [], // 保存部门的名称 =>title
         checkedDepartNameString: "", // 保存部门的名称 =>title
         resultDepartOptions: [],
-        wkDate: new Date,
+        wkDate: new Date(),
         wkMoth: 6,
         wkEndDate: null,
         userId: "", //保存用户id
@@ -829,6 +829,7 @@
         date.setMonth(date.getMonth() + 6)
         this.wkEndDate = date;
         this.wkMoth=6;
+        this.wkDate=new Date();
       },
       edit(record) {
         this.realname = record.realname;
@@ -1063,6 +1064,7 @@
             callback("请输入数字!");
           } else {
             this.wkMoth = value - 0;
+            console.log(this.wkDate)
             if (this.wkDate != null && this.wkDate != "") {
               var date = new Date(this.wkDate)
               var num = value - 0;
@@ -1277,15 +1279,17 @@
         this.userDepartModel.userId = formData.userId;
         this.departIds = [];
         this.resultDepartOptions = [];
+        this.selectionRows = [];
+        this.selectedRowKeys = [];
         var depart = [];
+        var depName="";
+        if(formData.departIdList!=null&&formData.departIdList.length>0){
         for (let i = 0; i < formData.departIdList.length; i++) {
           this.selectedDepartKeys.push(formData.departIdList[i].key);
           this.checkedDepartNames.push(formData.departIdList[i].title);
           this.form.setFieldsValue({
-            checkedDepartNameString: this.checkedDepartNames.join(",")
+            checkedDepartNameString:this.checkedDepartNames.join(",")
           })
-          //this.checkedDepartNameString = this.checkedDepartNames.join(",");
-          //新增部门选择,如果上面部门选择后不为空直接付给负责部门
           depart.push({
             key: formData.departIdList[i].key,
             title: formData.departIdList[i].title
@@ -1297,8 +1301,9 @@
         this.checkedDepartKeys = this.selectedDepartKeys //更新当前的选择keys
         this.zwCode = "";
         this.zwName = "";
-        this.selectionRows = [];
-        this.selectedRowKeys = [];
+        }
+       
+        
       },
       // 根据屏幕变化,设置抽屉尺寸
       resetScreenSize() {