LiGuang 3 年之前
父節點
當前提交
37d7a5b2cc

+ 1 - 1
src/components/page/GlobalHeader.vue

@@ -18,7 +18,7 @@
         @click="toggle"/>
 
       <span v-if="device === 'desktop'">欢迎进入 格克员工管理平台</span>
-      <span v-else>Jeecg-Boot</span>
+      <span v-else>格克员工管理平台</span>
 
       <user-menu :theme="theme"/>
     </div>

+ 9 - 2
src/components/tools/UserMenu.vue

@@ -184,9 +184,16 @@
           onOk() {
             return that.Logout({}).then(() => {
               // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
-              that.$router.push({ path: '/user/login' });
+              var type=Vue.ls.get('TYPE');
+              if(type==2||type=="2"){
+                that.$router.push({ path: '/user/login' });
+              }else{
+                  window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+              }
+              //that.$router.push({ path: '/user/login' });
               // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
-              //window.location.reload()
+              //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+            //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=geke.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000004&state=STATE#wechat_redirect";
             }).catch(err => {
               that.$message.error({
                 title: '错误',

+ 49 - 4
src/utils/request.js

@@ -54,10 +54,29 @@ const err = (error) => {
                   let path = window.document.location.pathname
                   console.log("location pathname -> "+path)
                   if(path!="/" && path.indexOf('/user/login')==-1){
-                    window.location.reload()
+                    //window.location.reload()
+                    // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                    //that.$router.push({ path: '/user/login' });
+                    // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                   // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                   //that.$router.push({ path: '/user/login' });
+                   // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                  var type= Vue.ls.get('TYPE');
+                   if(type==2||type=="2"){
+                     that.$router.push({ path: '/user/login' });
+                   }else{
+                  window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+                 }
+                 //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=geke.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000004&state=STATE#wechat_redirect";
                   }
                 }catch (e) {
-                  window.location.reload()
+                  var type= Vue.ls.get('TYPE');
+                    if(type==2||type=="2"){
+                      that.$router.push({ path: '/user/login' });
+                    }else{
+                   window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+                  }
+                //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=geke.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000004&state=STATE#wechat_redirect";
                 }
               })
             }
@@ -76,7 +95,20 @@ const err = (error) => {
         if (token) {
           store.dispatch('Logout').then(() => {
             setTimeout(() => {
-              window.location.reload()
+              //window.location.reload()
+              // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+              //that.$router.push({ path: '/user/login' });
+              // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+            // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+            //that.$router.push({ path: '/user/login' });
+            // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+           var type= Vue.ls.get('TYPE');
+             if(type==2||type=="2"){
+               that.$router.push({ path: '/user/login' });
+             }else{
+            window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+           }
+           //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=geke.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000004&state=STATE#wechat_redirect";
             }, 1500)
           })
         }
@@ -152,7 +184,20 @@ function blobToJson(data) {
             onOk: () => {
               store.dispatch('Logout').then(() => {
                 Vue.ls.remove(ACCESS_TOKEN)
-                window.location.reload()
+                //window.location.reload()
+                // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                //that.$router.push({ path: '/user/login' });
+                // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                //that.$router.push({ path: '/user/login' });
+                // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
+                  var type= Vue.ls.get('TYPE');
+                    if(type==2||type=="2"){
+                      that.$router.push({ path: '/user/login' });
+                    }else{
+                   window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7c43b4b5f33945ad&redirect_uri=http://hr.gksports.net.cn&response_type=code&scope=snsapi_userinfo&agentid=1000009&state=STATE#wechat_redirect"
+                  }
+             //window.location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wwd372e7740b9b586f&redirect_uri=geke.g.dr1997.com&response_type=code&scope=snsapi_userinfo&agentid=1000004&state=STATE#wechat_redirect";
               })
             }
           })

+ 3 - 3
src/views/jeecg/SelectDemo.vue

@@ -498,10 +498,10 @@
         userIds: 'admin',
         multiUser: 'admin,jeecg',
         jcheckbox: {
-          values: 'spring,jeecgboot',
+          values: 'spring,格克员工管理平台',
           options: [
-            { label: 'Jeecg', value: 'jeecg' },
-            { label: 'Jeecg-Boot', value: 'jeecgboot' },
+            { label: 'Jeecg', value: '格克员工管理平台' },
+            { label: 'Jeecg-Boot', value: '格克员工管理平台' },
             { label: 'Spring', value: 'spring', disabled: true },
             { label: 'MyBaits', value: 'mybatis' }
           ]

+ 15 - 6
src/views/system/SysPositionList.vue

@@ -17,12 +17,16 @@
             </a-form-item>
           </a-col>
           <template v-if="toggleSearchStatus">
-            <a-col :md="6" :sm="8">
+            <!-- <a-col :md="6" :sm="8">
               <a-form-item label="职级">
                 <j-dict-select-tag v-model="queryParam.postRank" placeholder="请选择职级" dictCode="position_rank"/>
               </a-form-item>
-            </a-col>
-
+            </a-col> -->
+            <a-col :md="6" :sm="8">
+            <a-form-item label="部门名称">
+              <a-input placeholder="请输入部门名称" v-model="queryParam.deptName"></a-input>
+            </a-form-item>
+          </a-col>
           </template>
           <a-col :md="6" :sm="8">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
@@ -140,10 +144,15 @@
             align: 'center',
             dataIndex: 'name'
           },
+          // {
+          //   title: '职级',
+          //   align: 'center',
+          //   dataIndex: 'postRank_dictText'
+          // },
           {
-            title: '职级',
+            title: '部门',
             align: 'center',
-            dataIndex: 'postRank_dictText'
+            dataIndex: 'deptName'
           },
           // {
           //   title: '公司id',
@@ -158,7 +167,7 @@
           }
         ],
         url: {
-          list: '/sys/position/list',
+          list: '/sys/position/lists',
           delete: '/sys/position/delete',
           deleteBatch: '/sys/position/deleteBatch',
           exportXlsUrl: '/sys/position/exportXls',

+ 7 - 0
src/views/system/UserList.vue

@@ -224,6 +224,13 @@
             width: 100,
             dataIndex: 'realname',
           },
+          // {
+          //   title: '头像',
+          //   align: "center",
+          //   width: 100,
+          //   dataIndex: 'avatar',
+          //   scopedSlots: {customRender: "avatarslot"}
+          // },
           {
             title: '性别',
             align: "center",

+ 35 - 6
src/views/system/modules/SysPositionModal.vue

@@ -24,7 +24,17 @@
           label="职务名称">
           <a-input placeholder="请输入职务名称" v-decorator="['name', validatorRules.name]"/>
         </a-form-item>
-        <a-form-item
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol"  label="*部门" hasFeedback>
+        <a-tree-select
+          style="width:100%"
+          :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
+          :treeData="departTree"
+          v-model="model.deptId"
+          placeholder="请选择部门"
+          >
+        </a-tree-select>
+        </a-form-item>
+        <!-- <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="职级"
@@ -33,9 +43,9 @@
             placeholder="请选择职级"
             :triggerChange="true"
             dictCode="position_rank"
-            v-decorator="['postRank', validatorRules.postRank]"
+            v-decorator="['postRank',{}]"
           />
-        </a-form-item>
+        </a-form-item> -->
         <!--<a-form-item-->
         <!--  :labelCol="labelCol"-->
         <!--  :wrapperCol="wrapperCol"-->
@@ -53,7 +63,7 @@
   import { httpAction } from '@/api/manage'
   import { duplicateCheck } from '@/api/api'
   import JDictSelectTag from '@/components/dict/JDictSelectTag'
-
+import { queryIdTree } from '@/api/api'
   let validatorCodeTimer = null
 
   export default {
@@ -61,6 +71,7 @@
     components: { JDictSelectTag },
     data() {
       return {
+        departTree:[],
         title: '操作',
         visible: false,
         model: {},
@@ -104,7 +115,7 @@
             ]
           },
           name: { rules: [{ required: true, message: '请输入职务名称' }] },
-          postRank: { rules: [{ required: true, message: '请选择职级' }] },
+          
         },
         url: {
           add: '/sys/position/add',
@@ -114,8 +125,22 @@
       }
     },
     created() {
+      this.loadTreeData()
     },
     methods: {
+      loadTreeData(){
+        var that = this;
+        queryIdTree().then((res)=>{
+          if(res.success){
+            that.departTree = [];
+            for (let i = 0; i < res.result.length; i++) {
+              let temp = res.result[i];
+              that.departTree.push(temp);
+            }
+          }
+
+        })
+      },
       add() {
         this.edit({})
       },
@@ -133,7 +158,7 @@
             'code',
             'name',
             'postRank',
-            // 'companyId'
+            'deptId'
           ))
         })
       },
@@ -144,6 +169,10 @@
       handleOk() {
         const that = this
         // 触发表单验证
+        if(this.model.deptId==null||this.model.deptId==""){
+          that.$message.warning("请选择部门!");
+          return;
+        }
         this.form.validateFields((err, values) => {
           if (!err) {
             that.confirmLoading = true

+ 307 - 148
src/views/system/modules/UserModal.vue

@@ -1,5 +1,5 @@
 <template>
-  <a-modal :width="1000" title="员工信息" :visible="visible" @ok="handleSubmit()" @cancel="handleCancel" cancelText="关闭">
+  <a-modal :width="1000" :dialogStyle="dialogStyle" title="员工信息" :visible="visible" @ok="handleSubmit()" @cancel="handleCancel" cancelText="关闭">
 
     <template slot="title">
       <div style="width: 100%;">
@@ -11,224 +11,235 @@
     </template>
 
     <a-spin :spinning="confirmLoading">
-      <a-form :form="form">
+      <a-form :form="form" style="overflow-y: auto;height: 650px;">
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="员工姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入员工姓名" v-decorator="[ 'realname', validatorRules.realname]" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
+          <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="英文名" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入英文名" v-decorator="[ 'egName', validatorRules.egName]" />
             </a-form-item>
           </a-col>
-        </a-row>
-
-        <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
+          
+          <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入邮箱" v-decorator="[ 'email', validatorRules.email]" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="身份证号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input maxLength="18" placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
-            </a-form-item>
-          </a-col>
         </a-row>
 
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="[ 'sex',validatorRules.sex]" placeholder="请选择性别"
-                :getPopupContainer="(target) => target.parentNode">
-                <a-select-option :value="1">男</a-select-option>
-                <a-select-option :value="2">女</a-select-option>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="证件类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-select v-model="sfzType" placeholder="请选择证件类型">
+                <a-select-option value="0">中国身份证</a-select-option>
+                <a-select-option value="1">其他</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-date-picker style="width: 100%" placeholder="请选择生日"
-                v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"
-                :getCalendarContainer="node => node.parentNode" />
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="身份证" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input  placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
             </a-form-item>
-          </a-col>
+            </a-col>
+            <a-col :md="6" :sm="8" :lg="8">
+              <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                <a-select v-decorator="[ 'sex',validatorRules.sex]" placeholder="请选择性别"
+                  :getPopupContainer="(target) => target.parentNode">
+                  <a-select-option :value="1">男</a-select-option>
+                  <a-select-option :value="2">女</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
         </a-row>
 
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入手机号码" v-decorator="[ 'phone', validatorRules.phone]" />
-            </a-form-item>
-
-          </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="公积金账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input-number placeholder="请输入公积金账号" style="width: 320px;" v-decorator="['syFund', {}]" />
-            </a-form-item>
+          <a-col :md="6" :sm="8" :lg="8">
+          <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-date-picker style="width: 100%" placeholder="请选择生日"
+              v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"
+              :getCalendarContainer="node => node.parentNode" />
+          </a-form-item>
           </a-col>
+            <a-col :md="6" :sm="8" :lg="8">
+                <a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input placeholder="请输入手机号码" v-decorator="[ 'phone', validatorRules.phone]" />
+                </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="8" :lg="8">
+              <a-form-item label="公积金" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                  <a-input  placeholder="请输入公积金账号"  v-decorator="['syFund',validatorRules.syFund]" />
+                </a-form-item>
+              </a-col>
+            </a-col>
         </a-row>
 
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="银行账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input-number placeholder="请输入银行账号" style="width: 320px;" v-decorator="['bankCard', validatorRules.bankCard]" />
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="银行" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input placeholder="请输入银行卡号"  v-decorator="['bankCard', validatorRules.bankCard]" />
             </a-form-item>
-
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
+          <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="开户行" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入开户行" v-decorator="['bankAddr', {}]" />
             </a-form-item>
           </a-col>
-        </a-row>
-
-        <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="入职日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-date-picker style="width: 100%" placeholder="请选择入职日期"
-                v-decorator="['entryDate', {initialValue:!model.entryDate?moment(new Date(),dateFormat):moment(model.entryDate,dateFormat)}]"
-                :getCalendarContainer="node => node.parentNode" />
-            </a-form-item>
-
-          </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="*部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="*部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
               <a-input-search placeholder="点击选择部门" v-model="checkedDepartNameString" readOnly @search="onSearch">
                 <a-button slot="enterButton" icon="search">选择</a-button>
               </a-input-search>
             </a-form-item>
           </a-col>
         </a-row>
+
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="基本工资一" :labelCol="labelCol" :wrapperCol="wrapperCol" >
-              <a-input-number id="inputNumber" placeholder="请输入基本工资" style="width: 320px;" v-decorator="['wagesOne', {}]" />
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="工资一" :labelCol="labelCol" :wrapperCol="wrapperCol" >
+              <a-input-number id="inputNumber" placeholder="请输入基本工资" style="width: 210px;" v-decorator="['wagesOne',validatorRules.wagesOne]" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="基本工资二" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input-number placeholder="请输入基本工资" style="width: 320px;" v-decorator="['wagesTwo', {}]" />
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="工资二" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input-number placeholder="请输入基本工资" style="width: 210px;" v-decorator="['wagesTwo', {}]" />
             </a-form-item>
           </a-col>
-        </a-row>
-        <a-row>
-          <!-- <a-col :md="6" :sm="8" :lg="12">
+          <!-- <a-col :md="6" :sm="8" :lg="8">
             <a-form-item label="社保基数" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input-number placeholder="请输入社保基数" style="width: 320px;" v-decorator="['security', {}]" />
+              <a-input-number placeholder="请输入社保基数" style="width: 210px;" v-decorator="['security', {}]" />
             </a-form-item>
           </a-col> -->
-
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="缴交基数" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input-number controls="false" placeholder="请输入缴交基数" style="width: 320px;" v-decorator="['wagesBase', {}]" />
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input-search placeholder="点击选择职位" v-model="zwName" readOnly @search="zw()">
+                <a-button slot="enterButton" icon="search">选择</a-button>
+              </a-input-search>
             </a-form-item>
-
           </a-col>
         </a-row>
+
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="证件类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-model="sfzType" placeholder="请选择证件类型">
-                <a-select-option value="0">中国身份证</a-select-option>
-                <a-select-option value="1">其他身份证</a-select-option>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="人员类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-select v-decorator="[ 'category', {initialValue:101}]" placeholder="请选择人员类别"
+                :getPopupContainer="(target) => target.parentNode" @change="handleChangeStatus">
+                <a-select-option :value="101">正式工</a-select-option>
+                <a-select-option :value="103">实习生</a-select-option>
+                <a-select-option :value="104">劳务工</a-select-option>
+                <a-select-option :value="105">劳务外包5+2</a-select-option>
+                <a-select-option :value="106">劳务外包6+1</a-select-option>
+                <a-select-option :value="102">顾问</a-select-option>
               </a-select>
             </a-form-item>
-
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="身份类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-radio-group v-model="identity" @change="identityChange">
-                <a-radio value="1">普通员工</a-radio>
-                <a-radio value="2">上级</a-radio>
-              </a-radio-group>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="缴交基数" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input-number :disabled="personType" controls="false" style="width: 210px;" placeholder="请输入缴交基数" v-decorator="['wagesBase', {}]" />
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="入职日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-date-picker style="width: 100%" placeholder="请选择入职日期"
+                v-decorator="['entryDate', {initialValue:!model.entryDate?moment(new Date(),dateFormat):moment(model.entryDate,dateFormat)}]"
+                :getCalendarContainer="node => node.parentNode" />
+            </a-form-item>
+          </a-col>
+          
         </a-row>
-
-
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="紧急联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入紧急联系人" v-decorator="[ 'urgentName',{}]" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="联系人电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-input placeholder="请输入紧急联系人电话" v-decorator="[ 'urgentPhone', {}]" />
             </a-form-item>
           </a-col>
-        </a-row>
-
-        <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="人员类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="[ 'category', {initialValue:101}]" placeholder="请选择人员类别"
-                :getPopupContainer="(target) => target.parentNode">
-                <a-select-option :value="101">正式工</a-select-option>
-                <a-select-option :value="103">实习生</a-select-option>
-                <a-select-option :value="104">劳务工</a-select-option>
-                <a-select-option :value="105">劳务外包5+2</a-select-option>
-                <a-select-option :value="106">劳务外包6+1</a-select-option>
-                <a-select-option :value="102">顾问</a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="雇佣状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select v-decorator="[ 'employmentStatus', {initialValue:10}]" placeholder="请选择雇佣状态"
-                :getPopupContainer="(target) => target.parentNode">
-                <a-select-option :value="10">在职</a-select-option>
-                <a-select-option :value="20">离退</a-select-option>
-                <a-select-option :value="30">离职</a-select-option>
-              </a-select>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="身份类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-radio-group v-model="identity" @change="identityChange">
+                <a-radio value="1">普通员工</a-radio>
+                <a-radio value="2">上级</a-radio>
+              </a-radio-group>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="是否免打卡" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="家庭住址" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-input placeholder="请输入家庭住址" v-decorator="[ 'addr', {}]" />
+            </a-form-item>
+          </a-col>
+         <a-col :md="6" :sm="8" :lg="8">
+           <a-form-item label="雇佣状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
+             <a-select v-decorator="[ 'employmentStatus', {initialValue:10}]" placeholder="请选择雇佣状态"
+               :getPopupContainer="(target) => target.parentNode" >
+               <a-select-option :value="10">在职</a-select-option>
+               <a-select-option :value="20">离退</a-select-option>
+               <a-select-option :value="30">离职</a-select-option>
+             </a-select>
+           </a-form-item>
+         </a-col>
+            <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="是否打卡" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <a-select v-decorator="[ 'isAttendance', {initialValue:'0'}]" placeholder="请选择"
                 :getPopupContainer="(target) => target.parentNode">
-                <a-select-option value="0">否</a-select-option>
-                <a-select-option value="1">是</a-select-option>
+                <a-select-option value="0"></a-select-option>
+                <a-select-option value="1"></a-select-option>
               </a-select>
             </a-form-item>
             
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]" />
+          
+        </a-row>
+        <a-row>
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-textarea placeholder="请输备注" v-decorator="[ 'remarks', {}]" />
             </a-form-item>
-            
           </a-col>
+         <a-col :md="6" :sm="8" :lg="8">
+          <a-form-item label="附件上传" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-button icon="search" @click="uploads()" style="width: 210px;">选择</a-button>
+          </a-form-item>
+         </a-col>
+        <a-col :lg="8">
+          <a-form-item label="同步信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <j-dict-select-tag v-decorator="['infoSy', {initialValue:3}]" placeholder="请选择同步" :type="'radio'"
+              :triggerChange="true" dictCode="info_sy" />
+          </a-form-item>
+        </a-col>
         </a-row>
-        <a-row>
-          <a-col :lg="12">
+           
+        <!-- <a-row>
+          <a-col :lg="8">
             <a-form-item label="同步信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <j-dict-select-tag v-decorator="['infoSy', {initialValue:3}]" placeholder="请选择同步" :type="'radio'"
                 :triggerChange="true" dictCode="info_sy" />
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="8" :lg="12">
-           <a-form-item label="附件上传" :labelCol="labelCol" :wrapperCol="wrapperCol">
-             <a-button icon="search" @click="uploads()">选择</a-button>
-           </a-form-item>
-          </a-col>
           
-        </a-row>
+        </a-row> -->
         <a-row>
-         
-          
+          <a-col :md="6" :sm="8" :lg="8">
+            <a-form-model-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">
+               <j-image-upload  class="avatar-uploader" text="上传" v-model="model.avatar" ></j-image-upload>
+             </a-form-model-item>
+          </a-col>
         </a-row>
+
       </a-form>
     </a-spin>
     <depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
 
     <a-modal title="附件" :visible="visiblet" @ok="saveUpload()" @cancel="handleCancelts()" footer="">
-      <a-upload action="http://58.34.141.138:8085/jeecg-boot/sys/common/upload" list-type="picture" :file-list="fileList"
+      <a-upload action="http://58.34.141.138:8085/jeecg-boot/sys/common/upload" list-type="picture" :file-list="fileLists"
         @change="t" method="post" @download="handleDownload" :showUploadList="{
               showRemoveIcon: true,
               showDownloadIcon: true
@@ -241,7 +252,16 @@
         </a-button>
       </a-upload>
     </a-modal>
+    <a-modal v-model="visibles" title="职务" @ok="zwOk()">
+     <a-table rowKey="id" bordered :data-source="dataSources" :columns="columnst"  :pagination="ipaginations" @change="handleTableChanges"
+     :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChanges,type: 'radio'}"
+     >
+       
+     </a-table>
+    </a-modal>
   </a-modal>
+  
+  
 </template>
 
 <script>
@@ -282,11 +302,16 @@
     },
     data() {
       return {
+        selectedRowKeys:[],
+        selectionRows:[],
         departDisabled: false, //是否是我的部门调用该页面
         roleDisabled: false, //是否是角色维护调用该页面
         modalWidth: 800,
         drawerWidth: 700,
         titles: "新增员工",
+        visibles:false,
+        personType:false,
+        dataSources:[],
         modaltoggleFlag: true,
         sfzCode: "",
         bankCard: "",
@@ -297,8 +322,21 @@
         isSalary: "0",
         email: "",
         isAttendance: "0",
+        zwName:"",
+        zwCode:"",
         sfzType: "0",
-        fileList: [],
+        ipaginations:{
+          current: 1,
+          pageSize: 10,
+          pageSizeOptions: ['10', '20', '30'],
+          showTotal: (total, range) => {
+            return range[0] + "-" + range[1] + " 共" + total + "条"
+          },
+          showQuickJumper: true,
+          showSizeChanger: true,
+          total: 0
+        },
+        fileLists: [],
         confirmDirty: false,
         files: [],
         selectedDepartKeys: [], //保存用户选择部门id
@@ -364,13 +402,45 @@
             rules: [{
               required: true,
               message: '请输入银行账号'
-            }]
+            },
+            {validator: this.validatebankCard}
+            ]
           },
+          syFund: {
+            rules: [{
+              required: true,
+              message: '请输入公积金账号'
+            },
+            {validator: this.validatesyFund}
+            ]
+          },
+          wagesOne: {
+            rules: [{
+              required: true,
+              message: '请输入基本工资'
+            }
+           
+            ]
+          }
+        },
+        columnst:[{
+          title: '职位编码',
+          dataIndex: 'code',
+        },{
+          title: '职位名称',
+          dataIndex: 'name',
+        },{
+          title: '部门',
+          dataIndex: 'deptName',
         },
+        ],
         departIdShow: false,
         departIds: [], //负责部门id
         title: "操作",
         visible: false,
+        dialogStyle:{
+          top:"15px"
+        },
         model: {},
         roleList: [],
         selectedRole: [],
@@ -405,7 +475,8 @@
           queryTenantList: '/sys/tenant/queryList',
           xzupload: '/sys/common/static',
           sysFile: '/sysFile/sysFile/queryByUserId',
-          delSysFile:'/sysFile/sysFile/deleteById'
+          delSysFile:'/sysFile/sysFile/deleteById',
+          post:'/sys/position/listByDept'
         },
         identity: "1",
         fileList: [],
@@ -428,6 +499,53 @@
       }
     },
     methods: {
+      zwOk(){
+        if(this.selectionRows!=null&&this.selectionRows.length>0){
+        this.zwName=this.selectionRows[0].name;
+        this.zwCode=this.selectionRows[0].code;
+        }
+        this.visibles=false;
+      },
+      onSelectChanges(selectedRowKeys, selectionRows) {
+        this.selectedRowKeys = selectedRowKeys;
+        this.selectionRows=selectionRows;
+      },
+     handleTableChanges(pagination, filters, sorter) {
+       //分页、排序、筛选变化时触发
+       //TODO 筛选
+       if (Object.keys(sorter).length > 0) {
+         this.isorter.column = sorter.field;
+         this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
+       }
+       this.ipaginations = pagination;
+       this.queryzw();
+     },
+      zw(){
+        if(this.userDepartModel.departIdList==null||this.userDepartModel.departIdList.length<1){
+          this.$message.warning('请先选择部门!');
+          return;
+        }
+        this.visibles=true;
+       this.queryzw();
+      },
+      queryzw(){
+        getAction(this.url.post, {
+          pageNo:this.ipaginations.current,
+          pageSize: this.ipaginations.pageSize,
+          deptId:this.userDepartModel.departIdList.join(",")
+        }).then((res) => {
+          if (res.success) {
+           this.dataSources = res.result.records||res.result;
+           if(res.result.total)
+           {
+             this.ipaginations.total = res.result.total+1;
+           }else{
+             this.ipaginationstotal = 0+1;
+           }
+          } 
+        }).finally(() => {
+        });
+      },
       handleRemove(file){
         if(this.userId!=null&&this.userId!=""){
         deleteAction(this.url.delSysFile, {userid:this.userId,name:file.name}).then((res) => {
@@ -443,7 +561,6 @@
       },
       // 文件下载
       handleDownload(file) {
-        console.log(file.response.message)
         window.location.href = "http://58.34.141.138:8085/jeecg-boot/sys/common/static/" + file.response.message;
       },
       t(info) {
@@ -459,12 +576,11 @@
         //     this.files.push(list[i].response.message);
         //   }
         // }
-        this.fileList = info.fileList //重点
+        this.fileLists = info.fileList //重点
         //console.log(info)
       },
       saveUpload() {
         this.visiblet = false;
-        console.log(this.defaultFileList)
       },
       uploads() {
         this.visiblet = true;
@@ -501,6 +617,16 @@
 
 
 
+      },
+      handleChangeStatus(e){
+        if(e==101){
+          this.personType=false;
+        }else{
+          this.personType=true;
+          this.form.setFieldsValue({
+            wagesBase: null
+          })
+        }
       },
       queryFiles(e) {
         getAction(this.url.sysFile, {
@@ -508,7 +634,7 @@
         }).then(res => {
           if (res.success) {
             if (res.result.length > 0) {
-              this.fileList = [];
+              this.fileLists = [];
               for (var i = 0; i < res.result.length; i++) {
                 const rs = {
                   message: res.result[i].txtName
@@ -520,7 +646,7 @@
                   response: rs,
                   url: "http://58.34.141.138:8085/jeecg-boot/" + res.result[i].txtName,
                 };
-                this.fileList.push(fileInfo)
+                this.fileLists.push(fileInfo)
               }
             }
           }
@@ -582,6 +708,10 @@
         this.bankCard = "";
         this.phone = "";
         this.email = "";
+        this.zwCode="";
+        this.zwName="";
+        this.selectedRowKeys=[];
+        this.selectionRows=[];
       },
       add() {
         this.picUrl = "";
@@ -611,9 +741,11 @@
         }
         that.visible = true;
         that.model = Object.assign({}, record);
+        this.zwCode=record.post;
+        this.zwName=record.post_dictText;
         that.$nextTick(() => {
-          that.form.setFieldsValue(pick(this.model, 'sex', 'email', 'phone', 'post', 'urgentName', 'urgentPhone',
-            'bankAddr', 'bankCard', 'realname', 'egName', 'sfzCode','isAttendance',
+          that.form.setFieldsValue(pick(this.model, 'sex', 'email', 'phone', 'urgentName', 'urgentPhone',
+            'bankAddr', 'bankCard', 'realname', 'egName', 'sfzCode','isAttendance','remarks','addr',
             'infoSy', 'syFund', 'category', 'employmentStatus', 'wagesOne', 'wagesTwo', 'security','wagesBase'))
         });
         //身份为上级显示负责部门,否则不显示
@@ -698,7 +830,7 @@
         this.resultDepartOptions = [];
         this.departIds = [];
         this.departIdShow = false;
-        this.fileList=[];
+        this.fileLists=[];
         this.identity = "1";
         this.bankAddr = "";
         this.bankCard = "";
@@ -727,15 +859,16 @@
             //   formData.avatar = null;
             // }
             formData.sfzType = this.sfzType;
-            var a = this.fileList;
+            var a = this.fileLists;
             var txt = [];
-            if (this.fileList != null && this.fileList.length > 0) {
-              for (var i = 0; i < this.fileList.length; i++) {
-                txt.push(this.fileList[i].response.message)
+            console.log(this.fileLists)
+            if (this.fileLists != null && this.fileLists.length > 0) {
+              for (var i = 0; i < this.fileLists.length; i++) {
+                txt.push(this.fileLists[i].response.message)
               }
               formData.txt = txt.join(",");
             }
-
+            formData.post=this.zwCode;
             //formData.selectedroles = this.selectedRole.length>0?this.selectedRole.join(","):'';
             formData.selecteddeparts = this.userDepartModel.departIdList.length > 0 ? this.userDepartModel
               .departIdList.join(",") : '';
@@ -801,7 +934,14 @@
           callback()
         } else {
           if (this.sfzType == "0") {
-            this.getBirth(value)
+            if (value.length==15&&RegExp(/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/).test(value)) {
+              this.getBirth(value)
+            }else if(value.length==18&&RegExp(/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/).test(value)){
+              this.getBirth(value)
+            }else{
+              callback("请输入正确格式的身份证号码!");
+            }
+            
           }
           callback()
         }
@@ -821,7 +961,16 @@
           callback()
         }
       },
-
+      validatesyFund(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          if(value.length!=9&&value.length!=12){
+           callback('请输入正确格式的公积金账号');
+          }
+          callback()
+        }
+      },
       validatePhone(rule, value, callback) {
         if (!value) {
           callback()
@@ -847,6 +996,16 @@
           }
         }
       },
+      validatebankCard(rule, value, callback) {
+        if (!value) {
+          callback()
+        } else {
+          if(value.length!=19&&value.length!=17&&value.length!=16){
+           callback('请输入正确格式的银行卡账号');
+          }
+          callback()
+        }
+      },
       validateEmail(rule, value, callback) {
         if (!value) {
           callback()

+ 53 - 30
src/views/user/Login.vue

@@ -5,18 +5,18 @@
         :activeKey="customActiveKey"
         :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
         @change="handleTabClick">
-        <a-tab-pane key="tab1" tab="账号密码登录">
-          <a-form-item>
+        <a-tab-pane key="tab1" :tab="text">
+          <a-form-item v-if="log">
             <a-input
               size="large"
               v-decorator="['username',validatorRules.username,{ validator: this.handleUsernameOrEmail }]"
               type="text"
-              placeholder="请输入帐户名">
+              placeholder="请输入邮箱号">
               <a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }"/>
             </a-input>
           </a-form-item>
 
-          <a-form-item>
+        <a-form-item v-if="log">
             <a-input
               v-decorator="['password',validatorRules.password]"
               size="large"
@@ -101,11 +101,10 @@
           class="login-button"
           :loading="loginBtn"
           @click.stop.prevent="handleSubmit"
-          :disabled="loginBtn">登录
+          :disabled="loginBtn">{{btntext}}
         </a-button>
       </a-form-item>
     </a-form>
-
     <two-step-captcha
       v-if="requiredTwoStepCaptcha"
       :visible="stepCaptchaVisible"
@@ -116,13 +115,15 @@
   </div>
 </template>
 
-<script>
+  
+<script >
   //import md5 from "md5"
   import api from '@/api'
   import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
   import { mapActions } from "vuex"
   import { timeFix } from "@/utils/util"
   import Vue from 'vue'
+  import wx from "weixin-js-sdk";
   import { ACCESS_TOKEN ,ENCRYPTED_STRING} from "@/store/mutation-types"
   import { putAction,postAction,getAction } from '@/api/manage'
   import { encryption , getEncryptedString } from '@/utils/encryption/aesEncrypt'
@@ -145,6 +146,10 @@
         requiredTwoStepCaptcha: false,
         stepCaptchaVisible: false,
         form: this.$form.createForm(this),
+        text:"企业微信授权登录",
+        btntext:"授权",
+        log:false,
+        type:"1",
         encryptedString:{
           key:"",
           iv:"",
@@ -154,7 +159,7 @@
           smsSendBtn: false,
         },
         validatorRules:{
-          username:{rules: [{ required: true, message: '请输入用户名!'},{validator: this.handleUsernameOrEmail}]},
+          username:{rules: [{ required: true, message: '请输入邮箱号!'},{validator: this.handleUsernameOrEmail}]},
           password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]},
           mobile:{rules: [{validator:this.validateMobile}]},
           captcha:{rule: [{ required: true, message: '请输入验证码!'}]},
@@ -171,26 +176,41 @@
       }
     },
     created () {
-      this.currdatetime = new Date().getTime();
-      Vue.ls.remove(ACCESS_TOKEN)
-      this.getRouterData();
-      this.handleChangeCheckCode();
-      // const token = Vue.ls.get(ACCESS_TOKEN)
-      // if(token!=null&&token!=""){
-      
-      // }else{
-      //   var urls = location.search;
-      //   console.log(urls)
-      //   var ts=urls.split("?");
-      //   var tts=ts[1].split("&");
-      //   var sct=tts[0].split("=");
-      //   this.code=sct[1];
-      // }
+      console.log(wx);
+      //this.wxlogin();
+      var urls = location.search;
+      if(urls!=null&&urls!=""){
+        var ts=urls.split("?");
+        var tts=ts[1].split("&");
+        var sct=tts[0].split("=");
+        this.code=sct[1];
+      }else{
+        this.currdatetime = new Date().getTime();
+        Vue.ls.remove(ACCESS_TOKEN)
+        this.getRouterData();
+        this.handleChangeCheckCode();
+        this.type="2";
+        this.log=true;
+        this.text="邮箱密码登录";
+        this.btntext="登录";
+      }
+      Vue.ls.set('TYPE',this.type);
       // update-begin- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
       //this.getEncrypte();
       // update-end- --- author:scott ------ date:20190805 ---- for:密码加密逻辑暂时注释掉,有点问题
     },
     methods: {
+      // wxlogin(){
+      //   var wwLogin = new wx({
+      //   		"id": "ts",  
+      //   		"appid": "wwd372e7740b9b586f",
+      //   		"agentid": "1000004",
+      //   		"redirect_uri": "geke.g.dr1997.com",
+      //   		"state": "",
+      //   		"href": "",
+      //   		"lang": "zh",
+      //   });
+      // },
       ...mapActions(['Login', 'Logout', 'PhoneLogin']),
       // handler
       handleUsernameOrEmail (rule, value, callback) {
@@ -211,7 +231,8 @@
         let loginParams = {};
         that.loginBtn = true;
         // 使用账户密码登录
-        if (that.customActiveKey === 'tab1') {
+         if (that.customActiveKey === 'tab1') {
+          if(this.type=="2"||this.type==2){
           that.form.validateFields([ 'username', 'password','inputCode', 'rememberMe' ], { force: true }, (err, values) => {
             if (!err) {
               loginParams.username = values.username
@@ -235,12 +256,14 @@
               that.loginBtn = false;
             }
           })
-          // loginParams.username = this.code;
-          // that.Login(loginParams).then((res) => {
-          //   this.$refs.loginSelect.show(res.result)
-          // }).catch((err) => {
-          //   that.requestFailed(err);
-          // });
+          }else{
+          loginParams.username = this.code;
+          that.Login(loginParams).then((res) => {
+            this.$refs.loginSelect.show(res.result)
+          }).catch((err) => {
+            that.requestFailed(err);
+          });
+          }
           // 使用手机号登录
         } else {
           that.form.validateFields([ 'mobile', 'captcha', 'rememberMe' ], { force: true }, (err, values) => {