Browse Source

Merge branch 'master' of http://139.196.39.194:9021/chenc/cd-work-flow-web

jingbb 9 months ago
parent
commit
b4c07ea50b

+ 7 - 0
src/api/login.js

@@ -63,4 +63,11 @@ export function logout(logoutToken) {
       'X-Access-Token':  logoutToken
     }
   })
+}
+export function oaLogin(parameter) {
+  return axios({
+    url: '/sys/oaLogin',
+    method: 'post',
+    data: parameter
+  })
 }

+ 15 - 12
src/cas/sso.js

@@ -5,23 +5,26 @@ import store from '@/store'
  * 单点登录
  */
 const init = (callback) => {
-  console.log("-------单点登录开始-------");
-  let token = Vue.ls.get(ACCESS_TOKEN);
-  let st = getUrlParam("ticket");
-  var sevice = "http://"+window.location.host+"/";
-  // console.log("-------单点登1录开始-------",st);
-  // console.log("-------单点登2录开始-------",sevice);
-  if(token){
+  if (window.location.href.indexOf("/activiti/check/")>-1){
     loginSuccess(callback);
   }else{
-    if(st){
-      validateSt(st,sevice,callback);
+    let token = Vue.ls.get(ACCESS_TOKEN);
+    let st = getUrlParam("ticket");
+    var sevice = "http://"+window.location.host+"/";
+    // console.log("-------单点登1录开始-------",st);
+    // console.log("-------单点登2录开始-------",sevice);
+    if(token){
+      loginSuccess(callback);
     }else{
-      var serviceUrl = encodeURIComponent(sevice);
-      window.location.href = window._CONFIG['casPrefixUrl']+"/login?service="+serviceUrl;
+      if(st){
+        validateSt(st,sevice,callback);
+      }else{
+        var serviceUrl = encodeURIComponent(sevice);
+        window.location.href = window._CONFIG['casPrefixUrl']+"/login?service="+serviceUrl;
+      }
     }
+    console.log("-------单点登录结束-------");
   }
-  console.log("-------单点登录结束-------");
 };
 const SSO = {
   init: init

+ 4 - 0
src/config/router.config.js

@@ -394,5 +394,9 @@ export const constantRouterMap = [
     path: '/IncidentTicketModalDetail',
     component: () => import(/* webpackChunkName: "fail" */ '../views/oa/modules/IncidentTicketModalDetail.vue')
   },
+   {//////////////外部审批路径
+    path: '/activiti/check/:id',
+    component: () => import(/* webpackChunkName: "fail" */ '../views/activiti/taskCheck.vue')
+  },
 
 ]

+ 9 - 5
src/permission.js

@@ -58,12 +58,16 @@ router.beforeEach((to, from, next) => {
       }
     }
   } else {
-    if (whiteList.indexOf(to.path) !== -1) {
-      // 在免登录白名单,直接进入
+    if (window.location.href.indexOf("/activiti/check/")>-1){
       next()
-    } else {
-      next({ path: '/user/login', query: { redirect: to.fullPath } })
-      NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
+    }else{
+      if (whiteList.indexOf(to.path) !== -1) {
+        // 在免登录白名单,直接进入
+        next()
+      } else {
+        next({ path: '/user/login', query: { redirect: to.fullPath } })
+        NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
+      }
     }
   }
 })

+ 1 - 0
src/router/index.js

@@ -18,6 +18,7 @@ export default new Router({
   // mode: 'history',
   base: process.env.BASE_URL,
   scrollBehavior: () => ({ y: 0 }),
+  mode: 'history',
   routes: constantRouterMap
 })
 

+ 24 - 1
src/store/modules/user.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import { automaticLogin,login, logout, phoneLogin } from "@/api/login"
+import { automaticLogin,login, logout, phoneLogin, oaLogin } from "@/api/login"
 import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH } from "@/store/mutation-types"
 import { welcome } from "@/utils/util"
 import { queryPermissionsByUser } from '@/api/api'
@@ -240,6 +240,29 @@ const user = {
         })
       })
     },
+    // 设置登录信息
+    OaLogin({ commit }, userInfo) {
+      return new Promise((resolve, reject) => {
+        oaLogin(userInfo).then(response => {
+          if(response.code =='200'){
+            const result = response.result
+            const userInfo = result.userInfo
+            Vue.ls.set(ACCESS_TOKEN, result.token, 7 * 24 * 60 * 60 * 1000)
+            Vue.ls.set(USER_NAME, userInfo.username, 7 * 24 * 60 * 60 * 1000)
+            Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
+            commit('SET_TOKEN', result.token)
+            commit('SET_INFO', userInfo)
+            commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() })
+            commit('SET_AVATAR', userInfo.avatar)
+            resolve(response)
+          }else{
+            reject(response)
+          }
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
   }
 }
 

+ 2 - 1
src/utils/request.js

@@ -15,7 +15,8 @@ console.log("baseProject= ",baseProject)
 const service = axios.create({
   //baseURL: '/jeecg-boot',
   baseURL: baseProject, // api base_url
-  timeout: 9000 // 请求超时时间
+  // timeout: 119000 // 请求超时时间
+  timeout: 60000 // 请求超时时间
 })
 
 const err = (error) => {

+ 295 - 0
src/views/activiti/taskCheck.vue

@@ -0,0 +1,295 @@
+<template>
+  <div>
+    <!--流程表单-->
+    <a-modal :title="lcModa.title" v-model="lcModa.visible" :footer="null" :maskClosable="false" width="100%" :closable="false">
+      <component
+        :disabled="lcModa.disabled"
+        v-if="lcModa.visible"
+        :is="lcModa.formComponent"
+        :processData="lcModa.processData"
+        :isNew="lcModa.isNew"
+        @close=";(lcModa.visible = false), (lcModa.disabled = false)"
+        @getDataList="getDataList"
+      ></component>
+    </a-modal>
+
+    <!-- 审批操作 -->
+    <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" width="100%">
+      <div v-if="modalTaskVisible">
+        <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
+          <a-form-item label="审批意见" prop="reason">
+            <a-input type="textarea" v-model="form.comment" :rows="4" />
+          </a-form-item>
+          <a-form-item label="下一审批人" prop="assignees" v-show="showAssign" :error="error">
+            <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
+              <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
+                item.realname
+              }}</a-select-option>
+            </a-select>
+          </a-form-item>
+          <a-form-item label="下一审批人" v-show="isGateway">
+            <span>分支网关处暂不支持自定义选择下一审批人,将发送给下一节点所有人</span>
+          </a-form-item>
+          <div v-show="form.type == 1">
+            <a-form-item label="驳回至">
+              <a-select v-model="form.backTaskKey" :loading="backLoading" @change="changeBackTask">
+                <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{item.name}}
+              </a-select-option>
+              </a-select>
+            </a-form-item>
+            <a-form-item label="指定原节点审批人" prop="assignees" v-show="form.backTaskKey != -1" :error="error">
+              <a-select v-model="form.assignees" placeholder="请选择" allowClear mode="multiple" :loading="userLoading">
+                <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{item.realname}}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </div>
+          <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type == 2">
+            <JSelectUserByDep v-model="form.userId" :multi="false"></JSelectUserByDep>
+          </a-form-item>
+          <a-form-item label="消息通知">
+            <a-checkbox v-model="form.sendMessage">站内消息通知</a-checkbox>
+            <!-- <a-checkbox v-model="form.sendSms" disabled>短信通知</a-checkbox>
+            <a-checkbox v-model="form.sendEmail" disabled>邮件通知</a-checkbox> -->
+          </a-form-item>
+        </a-form>
+      </div>
+      <div slot="footer">
+        <a-button type="text" @click="modalTaskVisible = false">取消</a-button>
+        <a-button type="primary" :loading="submitLoading" @click="handelSubmit">提交</a-button>
+      </div>
+    </a-modal>
+    <outerForm-check ref="outerFormCheck" @refreshData="handleSearch" ></outerForm-check>
+  </div>
+</template>
+
+<script>
+  import { getAction,postAction } from '@/api/manage'
+  import { mapActions } from 'vuex'
+  import store from '@/store/'
+  import outerFormCheck from '../../share/modal/OuterFormCheck'
+  import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
+
+  export default {
+    name: "taskCheck",
+    components: { JSelectUserByDep, outerFormCheck },
+    data() {
+      return {
+        key : "",
+        taskInfo:{},
+
+        modalTaskVisible: false,
+        backList: [
+          {
+            key: '-1',
+            name: '发起人'
+          }
+        ],
+        error: '',
+        showAssign: false,
+        searchForm: {
+          // 搜索框对应data对象
+          name: ''
+        },
+        modalTaskTitle: '',
+        modalTitle: '', // 添加或编辑标题
+        form: {
+          id: '',
+          userId: '',
+          procInstId: '',
+          comment: '',
+          type: 0,
+          assignees: [],
+          backTaskKey: '-1',
+          sendMessage: true,
+          sendSms: false,
+          sendEmail: false
+        },
+        formValidate: {
+          // 表单验证规则
+        },
+        submitLoading: false, // 添加或编辑提交状态
+        data: [], // 表单数据
+        total: 0, // 表单数据总数
+        dictPriority: [],
+        isGateway: false,
+        lcModa: {
+          title: '',
+          disabled: false,
+          visible: false,
+          formComponent: null,
+          isNew: false
+        },
+
+        url:{
+          taskInfoUrl:"/actTask/getSelfTaskById",
+          outformViewUrl:"/actBusiness/external/getViewUrl",
+        }
+      }
+    },
+    created () {
+      this.key = this.$route.params.id;   
+      this.login(this.key);   
+    },
+    methods: {
+      ...mapActions(['OaLogin']),
+      login(key){
+        this.OaLogin({key,key})
+          .then(res => {
+
+            this.getTaskInfo(key);
+          })
+      },
+      // 根据taskid获取待办任务的某一条
+      getTaskInfo(key){
+        getAction(this.url.taskInfoUrl,{key:key}).then(res => {
+          if (res.success) {
+            if (res.result.length == 0){
+              this.$message.info("待办任务不存在");
+              return;
+            }
+            this.taskInfo = res.result[0];
+            this.showTask(this.taskInfo);
+          }else{
+            this.$message.error(res.message);
+          }
+        })
+
+      },
+      // 显示任务信息
+      showTask(r){
+        if (!r.routeName) {
+          this.$message.warning('该流程信息未配置表单,请联系开发人员!')
+          return
+        }
+        r.operationType = '1' //代办
+        if (r.routeName.indexOf('外部表单') != -1||r.tableName.indexOf('外部表单') != -1) {
+          //其他项目的表单流程
+          var id = r.tableId //项目管理合同数据id
+          this.showOuterFormViewDlg(r.tableId, '业务流程审批:' + r.processName, r);
+        } else if (r.routeName.indexOf('自定义') != -1) {
+          //自定义的表单流程
+          this.lcModa.disabled = true
+          this.lcModa.title = '查看流程业务信息:' + r.processName
+          let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
+          this.lcModa.formComponent = com.component
+          this.lcModa.isNew = false
+          this.lcModa.processData = r
+          this.lcModa.visible = true
+        } else {
+          //固定的表单流程
+          this.lcModa.disabled = true
+          this.lcModa.title = '查看流程业务信息:' + r.processName
+          this.lcModa.formComponent = this.getFormComponent(r.routeName).component
+          this.lcModa.processData = r
+          this.lcModa.isNew = false
+          this.lcModa.visible = true
+        }
+      },
+      // 显示外部表单
+      showOuterFormViewDlg(tableId, title, processData){
+        getAction(this.url.outformViewUrl,{tableId:tableId}).then(res=>{
+            if (res.success){
+              var url = res.result.url;
+              var param = res.result.param;
+              url = url+"?"+this.jsonToUrlParam(param);
+
+              this.$refs.outerFormCheck.openDialog(url, title, processData);
+            }else{
+                this.$message.error(res.message);
+            }        
+        });
+      },
+      // 封装跳转地址
+      jsonToUrlParam(query){
+        var tmpArr = [];
+        for (var i in query){
+          var key = encodeURIComponent(i);
+          var value = encodeURIComponent(query[i]);
+          tmpArr.push(key+"="+value);
+        }
+        return tmpArr.join("&");
+      },
+      // 提交表单
+      handelSubmit() {
+        console.log('提交')
+        this.submitLoading = true
+        var formData = Object.assign({}, this.form)
+        formData.assignees = formData.assignees.join(',')
+        if (formData.type == 0) {
+          // 通过
+          if (this.showAssign && formData.assignees.length < 1) {
+            this.$message.error('请至少选择一个审批人')
+            this.submitLoading = false
+            return
+          } else {
+            this.error = ''
+          }
+          this.postFormAction(this.url.pass, formData).then(res => {
+            this.submitLoading = false
+            if (res.success) {
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
+            }
+          })
+        } else if (formData.type == 1) {
+          // 驳回
+          if (formData.backTaskKey == '-1') {
+            // 驳回至发起人
+            this.postFormAction(this.url.back, formData).then(res => {
+              this.submitLoading = false
+              if (res.success) {
+                this.$message.success('操作成功')
+                this.modalTaskVisible = false
+                this.getDataList()
+              }
+            })
+          } else {
+            // 自定义驳回
+            if (formData.backTaskKey != '-1' && formData.assignees.length < 1) {
+              this.$message.error('请至少选择一个审批人')
+              this.submitLoading = false
+              return
+            } else {
+              this.error = ''
+            }
+            this.postFormAction(this.url.backToTask, formData).then(res => {
+              this.submitLoading = false
+              if (res.success) {
+                this.$message.success('操作成功')
+                this.modalTaskVisible = false
+                this.getDataList()
+              }
+            })
+          }
+        } else if (formData.type == 2) {
+          // 委托
+          if (!formData.userId) {
+            this.$message.error('请选择一委托人')
+            this.submitLoading = false
+            return
+          } else {
+            this.error = ''
+          }
+          this.postFormAction(this.url.delegate, formData).then(res => {
+            this.submitLoading = false
+            if (res.success) {
+              this.$message.success('操作成功')
+              this.modalTaskVisible = false
+              this.getDataList()
+            }
+          })
+        }
+      },
+      handleSearch(){
+
+      }
+
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/dashboard/MyoaTabs.vue

@@ -89,7 +89,7 @@ export default {
                         columnWidth: [150, 190,190, 190, 120, 300],
                         align: ['center'],
                         rowNum: 5,
-                        waitTime: 9000,
+                        waitTime: 30000,
                         data: scrollData // 双向绑定(轮播表数据 绑定到配置的 data数据中)
                     }
                 }

+ 13 - 1
src/views/oa/salary_management/Attendance/attendanceManagement.vue

@@ -67,7 +67,7 @@
   </template>
   
   <script>
-  
+    import JEllipsis from '@/components/jeecg/JEllipsis'
     import { JeecgListMixin } from '@/mixins/JeecgListMixin'
     import { getAction,downFile} from '@/api/manage'
     import moment from 'moment'
@@ -79,12 +79,14 @@
       name: "attendanceManagement",
       mixins: [JeecgListMixin],
       components: {
+        JEllipsis,
         AttendancelDetail,
         AnnualLeave,
         OvertimeDetail,
         uploadModal
       },
       data () {
+        let ellipsis = (v, l) => <j-ellipsis value={v} length={l} />
         return {
           description: '考勤管理',
           DateTime:[],
@@ -122,6 +124,13 @@
               align:"center",
               dataIndex: 'createTime'
             },
+            {
+              title: '备注',
+              align:"center",
+              width: 350,
+              customRender: (t) => ellipsis(t,22),
+              dataIndex: 'remarks'
+            },
             {
               title: '版本',
               align:"center",
@@ -150,6 +159,7 @@
           this.getTableList()
         },
         searchReset(){
+          
           this.queryParam={}
           this.DateTime = []
           this.getTableList()
@@ -208,6 +218,7 @@
             this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]];
         },
         handleDownload(record){
+           this.$message.info('下载中,请稍后...')
           downFile('/salary/salaryAttendance/exportXls',{id:record.id,type:record.type}).then(data => {
             if (!data) {
               this.$message.warning('文件下载失败')
@@ -226,6 +237,7 @@
               document.body.removeChild(link) // 下载完成移除元素
               window.URL.revokeObjectURL(url) // 释放掉blob对象
             }
+             this.$message.success('下载完成,请查看')
           })
 
         },

+ 6 - 6
src/views/oa/salary_management/Attendance/modules/AttendancelDetail.vue

@@ -221,35 +221,35 @@
                     width:'3%'
                 },
                 {
-                    title: '事假时间',
+                    title: '事假时间(分)',
                     align: "center",
                     dataIndex: 'personalLeave',
                     customRender: (t) => ellipsis(t,4),
                     width:'3%'
                 },
                 {
-                    title: '病假时间',
+                    title: '病假时间(分)',
                     align: "center",
                     dataIndex: 'sickLeave',
                     customRender: (t) => ellipsis(t,4),
                     width:'3%'
                 },
                 {
-                    title: '婚假时间',
+                    title: '婚假时间(分)',
                     align: "center",
                     dataIndex: 'marriageLeave',
                     customRender: (t) => ellipsis(t,4),
                     width:'3%'
                 },
                 {
-                    title: '丧假时间',
+                    title: '丧假时间(分)',
                     align: "center",
                     dataIndex: 'funeralLeave',
                     customRender: (t) => ellipsis(t,4),
                     width:'3%'
                 },
                 {
-                    title: '年假时间',
+                    title: '年假时间(天)',
                     align: "center",
                     dataIndex: 'yearLeave',
                     customRender: (t) => ellipsis(t,5),
@@ -261,7 +261,7 @@
                     dataIndex: 'workOvertime',
                     customRender: (t) => ellipsis(t,3),
                     width:'3%'
-                },
+                }
              ]
           }
         },

+ 33 - 1
src/views/oa/salary_management/Attendance/modules/uploadModal.vue

@@ -15,12 +15,21 @@
             <div class="table-page-search-wrapper">
                 <a-form-model layout="inline" ref="form" :model="formState" >
                     <a-row :gutter="24">
-                        <a-col :md="24" >
+                        <a-col :md="24" v-if="formState.type =='考勤表'">
                             <a-form-model-item label="年月"  prop="yearMonth ">
                                 <a-month-picker placeholder="请选择" :allowClear="false" v-model="formState.yearWithMonth" @change="onChange" style="width:100% !important"/>
                             </a-form-model-item>
                         </a-col>
                         
+                        <a-col :md="24" v-if="formState.type =='年休表'">
+                            <a-form-model-item label="年度"  prop="yearMonth2 ">
+                              
+                              <a-date-picker placeholder="请选择" :allowClear="true" :open="isopen" mode="year" format="YYYY" v-model="yearWith"
+                               @openChange="changeopen2" @panelChange="handlePanelChange2" @change="onChange2" style="width:100% !important"/>
+                              
+                            </a-form-model-item>
+                        </a-col>
+                        
                         <a-col :md="24">
                             <a-form-model-item label="类型"  prop="totalNum">
                                 <a-select  v-model="formState.type">
@@ -62,6 +71,8 @@
         },
         data() {
           return {
+              yearWith:moment().subtract(0, 'year'),
+              isopen:false,
               checked: ref(false),
               formState:{
                 type:'考勤表',
@@ -84,6 +95,7 @@
         methods: {
             handleCancel(){
                 this.visible = false
+                this.yearWith = moment().subtract(0, 'year')
                 this.formState={
                     type:'考勤表',
                     yearWithMonth:moment().subtract(1, 'months')
@@ -95,19 +107,39 @@
             onChange(data){
             },
             beforeUpload(){
+              if(this.formState.type=='年休表'){
+                this.formState.yearWithMonth=moment(this.yearWith).format('YYYY')
+              }else{
                 this.formState.yearWithMonth=moment(this.formState.yearWithMonth).format('YYYY-MM')
+              }
             },
             handleUploadChange({ file, fileList }){
                 if (file.status === 'done'&&file.response.success) {
                     this.showUploadList = true
                     this.$message.success(file.response.message)
+                    this.checked = false
                     this.$emit('ok')
                     this.handleCancel()
                 }else if(file.status === 'done'&&!file.response.success){
                     this.showUploadList = false
                     this.$message.error(file.response.message)
+                    this.checked = false
                 }
                 
+            },
+            handlePanelChange2(value){
+                this.isopen = false
+                this.yearWith = value
+                this.queryParam.yearWithMonth = this.yearWith?moment(this.yearWith).format('YYYY'):''
+            },
+            changeopen2(status){
+                if(status){
+                    this.isopen =  true
+                }
+            },
+            onChange2(data){
+              this.yearWith = data
+              this.queryParam.yearWithMonth = this.yearWith?moment(this.yearWith).format('YYYY'):''
             }
         }
     }

+ 10 - 10
src/views/oa/salary_management/personnelSalary/BasicSalary.vue

@@ -28,7 +28,7 @@
                     <a-select-option value="在职">在职</a-select-option>
                     <a-select-option value="离职">离职</a-select-option>
                     <a-select-option value="退休返聘">退休返聘</a-select-option>
-                    <a-select-option value="运维">运维</a-select-option>
+                    <a-select-option value="系统运维">系统运维</a-select-option>
                   </a-select>
               </a-form-item>
             </a-col>
@@ -102,8 +102,8 @@
           DateTime:[],
           loading:false,
           isorter: {
-            column: 'updateTime',
-            order: 'desc'
+            column: 'orgName',
+            order: 'asc'
           },
           // 表头
           columns: [
@@ -116,11 +116,11 @@
                     return parseInt(index)+1;
               }
             },
-            {
-              title: '编号',
-              align:"center",
-              dataIndex: 'code'
-            },
+            // {
+            //   title: '编号',
+            //   align:"center",
+            //   dataIndex: 'code'
+            // },
             {
               title: '部门',
               align:"center",
@@ -159,7 +159,7 @@
             },
           ],
           queryParam:{
-            syHireType:['在职','退休聘']
+            syHireType:['在职','退休聘']
           },
           dataSource:[{}],
           ipagination:{},
@@ -208,7 +208,7 @@
         },
         searchReset(){
           this.queryParam={
-            syHireType:['在职','退休聘']
+            syHireType:['在职','退休聘']
           }
           this.getTableList()
         },

+ 70 - 4
src/views/oa/salary_management/personnelSalary/Payroll.vue

@@ -1,6 +1,6 @@
 <template>
     <a-card :bordered="false">
-  
+    <a-spin  :spinning="spinning" tip="执行中,请稍后...">
       <!-- 查询区域 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -65,6 +65,7 @@
       <div class="table-operator">
         <a-button @click="createPayroll" type="primary" icon="plus">生成工资单</a-button>
         <a-button @click="addPayroll" type="primary" icon="plus">导入</a-button>
+        <!-- <a-button @click="daochu" type="primary" icon="plus">导出明细</a-button> -->
       </div>
 
   
@@ -97,6 +98,7 @@
       <uploadModal ref="uploadModal" @ok="searchQuery"></uploadModal>
       <uploadPayroll ref="uploadPayroll" @ok="searchQuery"></uploadPayroll>
       <YearEndBonusPayroll ref="YearEndBonusPayroll" @ok="searchQuery"></YearEndBonusPayroll>
+      </a-spin>
     </a-card>
   </template>
   
@@ -131,6 +133,7 @@
           yearWith:'',
           mode2: ['month', 'month'],
           DateTime:[],
+          spinning:false,
           open:false,
           isopen:false,
           // 表头
@@ -147,7 +150,14 @@
             {
               title: '月份',
               align:"center",
-              dataIndex: 'yearWithMonth'
+              dataIndex: 'yearWithMonth',
+              // customRender:function (t, r, index) {
+              //     if(r.type == '年休工资单'){
+              //       return t + "-12";
+              //     }else{
+              //       return t;
+              //     }
+              // }
             },
             {
               title: '类型',
@@ -254,8 +264,54 @@
           }
           
         },
+        alertMsg(st){
+          this.spinning = false
+          this.$message.warning('执行失败,请联系系统管理员'+st)
+        },
+        // tempChange(){
+        //   // console.log("=====================执行开始-五月考勤 - 森语");
+          
+        //   // let par = {"excelName":"五月考勤 - 马菲羊","month":"2024-05"}
+        //   // let par = {"excelName":"五月考勤 - 正织","month":"2024-05"}
+        //   // let par = {"excelName":"五月考勤 - 森语","month":"2024-05"}
+          
+        //   // getAction('/salary/salaryManagement/tempChange',par).then(res=>{
+        //   //   console.log("=====================执行结束");
+        //   // })
+          
+          
+        // },
+        daochu(){
+          this.spinning = true
+          downFile('/salary/salaryManagement/exportXls99',{}).then(data => {
+             this.spinning = false
+            if (!data) {
+              this.$message.warning('文件下载失败')
+              return
+            }
+            if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }),  record.type + '.xlsx')
+            } 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', '明细.xlsx')
+              document.body.appendChild(link)
+              link.click()
+              document.body.removeChild(link) // 下载完成移除元素
+              window.URL.revokeObjectURL(url) // 释放掉blob对象
+            }
+          }).catch(
+             error => {
+                  this.alertMsg(error.toString());
+             }
+          )
+        },
         handleDownload(record){
+          this.spinning = true
           downFile('/salary/salaryManagement/exportXls',{id:record.id,type:record.type}).then(data => {
+             this.spinning = false
             if (!data) {
               this.$message.warning('文件下载失败')
               return
@@ -273,10 +329,16 @@
               document.body.removeChild(link) // 下载完成移除元素
               window.URL.revokeObjectURL(url) // 释放掉blob对象
             }
-          })
+          }).catch(
+             error => {
+                  this.alertMsg(error.toString());
+             }
+          )
         },
         handleExport(record){
+          this.spinning = true
           downFile('/salary/salaryManagement/exportXls2',{id:record.id,type:record.type}).then(data => {
+             this.spinning = false
             if (!data) {
               this.$message.warning('文件下载失败')
               return
@@ -294,7 +356,11 @@
               document.body.removeChild(link) // 下载完成移除元素
               window.URL.revokeObjectURL(url) // 释放掉blob对象
             }
-          })
+          }).catch(
+             error => {
+                  this.alertMsg(error.toString());
+             }
+          )
         },
         handleTableChange(pagination, filters, sorter) {
             this.queryParam.pageNo = pagination.current

+ 26 - 10
src/views/oa/salary_management/personnelSalary/SalarysStatistics.vue

@@ -1,6 +1,6 @@
 <template>
     <a-card :bordered="false">
-  
+  <a-spin  :spinning="spinning" tip="执行中,请稍后...">
       <!-- 查询区域 -->
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -51,7 +51,7 @@
                           <a-select-option value="在职">在职</a-select-option>
                           <a-select-option value="离职">离职</a-select-option>
                           <a-select-option value="退休返聘">退休返聘</a-select-option>
-                          <a-select-option value="运维">运维</a-select-option>
+                          <a-select-option value="系统运维">系统运维</a-select-option>
                       </a-select>
                   </a-form-item>
               </a-col>
@@ -75,7 +75,7 @@
         <div class="table-operator">
           <a-button type="primary" @click="exportList" icon="plus">导出</a-button>
         </div>
-  
+
         <a-table
           ref="tableRef"
           size="middle"
@@ -87,11 +87,11 @@
           :scroll="{x: 2000}"
           :loading="loading"
           :footer="showTotal"
-          @change="handleTableChange">
+          @change="handleTableChange"> 
         </a-table>
       </div>
       <!-- table区域-end -->
-  
+</a-spin>
       <!-- 表单区域 -->
     </a-card>
   </template>
@@ -115,6 +115,7 @@
           DateTime:[moment().subtract(1, 'months'),moment().subtract(1, 'months'),],
           mode2: ['month', 'month'],
           open:false,
+          spinning:false,
           // 表头
           columns: [
             {
@@ -250,7 +251,7 @@
           queryParam:{
             beginDate:moment().subtract(1, 'months').format('YYYY-MM'),
             endDate:moment().subtract(1, 'months').format('YYYY-MM'),
-            syHireType:['在职','退休聘']
+            syHireType:['在职','退休聘']
           },
           dataSource:[{}],
           totalDataSource:[]
@@ -279,13 +280,15 @@
         computed: {
         },
       created () {
-        this.getTableList()
+        // this.getTableList()
       },
       methods: {
         getTableList(){
+          this.spinning = true
           var param = Object.assign({}, this.queryParam)
           param.syHireType = (param.syHireType).toString()
           getAction('/salary/salaryManagement/querySalaryTotalList',param).then(res=>{
+            this.spinning = false
             if(res.success){
                 this.dataSource =res.result.records
                 this.totalDataSourceList(res.data)
@@ -331,7 +334,8 @@
             this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]];
         },
         searchQuery(){
-          this.toggleSearchStatus = false
+          // this.spinning = true
+          // this.toggleSearchStatus = false
           this.queryParam.pageNo = 1
           this.getTableList()
         },
@@ -339,8 +343,9 @@
           this.queryParam={
             beginDate:moment().subtract(1, 'months').format('YYYY-MM'),
             endDate:moment().subtract(1, 'months').format('YYYY-MM'),
-            syHireType:['在职','退休聘']
+            syHireType:['在职','退休聘']
           }
+          // this.spinning = true
           this.getTableList()
         },
         handleTableChange(pagination, filters, sorter) {
@@ -349,9 +354,12 @@
             this.getTableList()
         },
         exportList(){
+          this.spinning = true
           var param1 = Object.assign({}, this.queryParam)
           param1.syHireType = (param1.syHireType).toString()
           downFile('/salary/salaryManagement/exportXls3',param1).then(data => {
+            console.log("================"+data)
+            this.spinning = false
             if (!data) {
               this.$message.warning('文件下载失败')
               return
@@ -369,7 +377,15 @@
               document.body.removeChild(link) // 下载完成移除元素
               window.URL.revokeObjectURL(url) // 释放掉blob对象
             }
-          })
+          }).catch(
+             error => {
+                  this.alertMsg(error.toString());
+             }
+          )
+        },
+        alertMsg(st){
+          this.spinning = false
+          this.$message.warning('文件导出失败,请联系系统管理员'+st)
         },
         showTotal(data) {
                 return (

+ 18 - 2
src/views/oa/salary_management/personnelSalary/modules/ChangeBasicSalary.vue

@@ -40,12 +40,12 @@
                         </a-col>
                         <a-col :md="24">
                             <a-form-model-item label="加薪" :labelCol="{offset: 1}" prop="salaryIncrease">
-                                <a-input placeholder="请输入" v-model="formState.salaryIncrease"  @change="changeSalaryIncrease" :disabled="formState.salaryReduction!==''&&formState.salaryReduction"/>
+                                <a-input-number style="width: 70%;" placeholder="请输入" v-model="formState.salaryIncrease"  @change="changeSalaryIncrease" :disabled="formState.salaryReduction!==''&&formState.salaryReduction"/>
                             </a-form-model-item>
                         </a-col>
                         <a-col :md="24">
                             <a-form-model-item label="减薪" :labelCol="{offset: 1}" prop="salaryReduction">
-                                <a-input placeholder="请输入" v-model="formState.salaryReduction" @change="changeSalaryReduction" :disabled="formState.salaryIncrease!==''&&formState.salaryIncrease"/>
+                                <a-input-number style="width: 70%;" placeholder="请输入" v-model="formState.salaryReduction" @change="changeSalaryReduction" :disabled="formState.salaryIncrease!==''&&formState.salaryIncrease"/>
                             </a-form-model-item>
                         </a-col>
                         <a-col :md="24">
@@ -134,6 +134,15 @@
                 }
             },
             changeSalaryIncrease(data){
+            
+            
+              let num = Number(this.formState.beforeAdjustment)+Number(this.formState.salaryIncrease)
+             console.log(num);
+              if(num < 0){
+                this.$message.error('调整后薪资不能为负数!');
+                this.formState.salaryIncrease = 0;
+              }
+            
                 this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)+Number(this.formState.salaryIncrease)
                 if(!this.formState.salaryIncrease||this.formState.salaryIncrease==''){
                     this.validatorRules.salaryReduction[0].required = true
@@ -144,6 +153,13 @@
                 this.$refs.form.clearValidate();
             },
             changeSalaryReduction(){
+              
+              let num = Number(this.formState.beforeAdjustment)-Number(this.formState.salaryReduction);
+              if(num < 0){
+                this.$message.error('调整后薪资不能为负数!');
+                this.formState.salaryReduction = 0;
+              }
+              
                 this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)-Number(this.formState.salaryReduction)
                 if(!this.formState.salaryReduction||this.formState.salaryReduction==''){
                     this.validatorRules.salaryIncrease[0].required = true

+ 3 - 3
src/views/oa/salary_management/personnelSalary/modules/ChangeSalaryBase.vue

@@ -19,13 +19,13 @@
                 <a-form-model layout="inline" ref="form" :model="formState"  :rules="validatorRules">
                     <a-row :gutter="24">
                         <a-col :md="24">
-                            <a-form-model-item label="工资基数"  prop="totalNum"  :labelCol="{offset: 2}">
+                            <a-form-model-item label="当前工资基数"  prop="totalNum"  :labelCol="{offset: 0}">
                                 <a-input placeholder="请输入" v-model="formState.oldSalaryBase" disabled/>
                             </a-form-model-item>
                         </a-col>
                         <a-col :md="24" >
-                            <a-form-model-item label="新工资基数"  prop="basicSalary" >
-                                <a-input placeholder="请输入" v-model="formState.basicSalary" />
+                            <a-form-model-item label="新工资基数"  prop="basicSalary" >
+                                <a-input-number style="width: 100%;" placeholder="请输入" v-model="formState.basicSalary" />
                             </a-form-model-item>
                         </a-col>
                     </a-row>

+ 15 - 8
src/views/oa/salary_management/personnelSalary/modules/YearEndBonusPayroll.vue

@@ -77,6 +77,13 @@
                     align:"center",
                     width:'5%',
                     dataIndex: 'index',
+                   customRender:function (t, record, index) {
+                       if(record.name=='合计'){
+                           return ''
+                       }else{
+                           return parseInt(index)+1;
+                       } 
+                   },
                 },
                 {
                     title: '姓名',
@@ -86,7 +93,7 @@
                     width:'10%',
                 },
                 {
-                    title: '税前金额',
+                    title: '金额',
                     align: "center",
                     dataIndex: 'beforeTaxAmount',
                     ellipsis: true,
@@ -99,13 +106,13 @@
                     ellipsis: true,
                     width:'10%',
                 },
-                {
-                    title: '税后金额',
-                    align: "center",
-                    dataIndex: 'afterTaxAmount',
-                    ellipsis: true,
-                    width:'10%',
-                },
+                // {
+                //     title: '税后金额',
+                //     align: "center",
+                //     dataIndex: 'afterTaxAmount',
+                //     ellipsis: true,
+                //     width:'10%',
+                // },
              ]
           }
         },

+ 31 - 7
src/views/oa/salary_management/personnelSalary/modules/uploadModal.vue

@@ -1,4 +1,5 @@
 <template>
+
     <div class="reply" ref = "replyModal">
       <a-modal
         title="生成工资单"
@@ -65,6 +66,11 @@
         @cancel="handleCancelPayroll"
         :getContainer ='()=>$refs.replyModal'
         >
+        <template #footer>
+            <a-button  @click="handleCancelPayroll" :loading = "loading1">取消</a-button>
+            <a-button  @click="handleOkPayroll" type="primary" style="margin-left: 8px;" :loading = "loading1">确认</a-button>
+        </template>
+        
             <p>{{ ModalText }}</p>
     </a-modal>
     </div>
@@ -96,6 +102,7 @@
               visibleOk:false,
               ModalText:'',
               loading:false,    
+              loading1:false,    
               validatorRules: {
                 type: [{required: true, message: '请选择!' }],
                 yearWithMonth: [{required: true, message: '请选择!' }],
@@ -139,6 +146,7 @@
                 }
             },
             handleOk(){
+            
                 this.$refs.form.validate((valid,err) => {
                     if (valid) {
                         if(this.formState.type=='加班工资单'){
@@ -163,6 +171,8 @@
                             }
                         }).finally(() => {
                             this.loading = false
+                            this.formState.DateTime = [];
+                            this.formState.yearWith = '';
                         }) 
                     }
                 })
@@ -171,6 +181,7 @@
             handleOkPayroll(){
                 this.ModalText = ''
                 this.visibleOk = false
+                this.loading1 = true;
                 this.generatePayroll(this.formState)
             },
             handleCancelPayroll(){
@@ -183,13 +194,13 @@
                 postAction('/salary/salaryManagement/generatePayroll',data).then((res) => {
                     if (res.success) {
                         if(res.data&&res.data.ZZ){
-                             that.handleDownload(res.data.ZZ,that.formState.type,"正织");
+                             that.handleDownload(res.data.ZZ,that.formState.type,"正织",data);
                         }
                         if(res.data&&res.data.MFY){
-                             that.handleDownload(res.data.MFY,that.formState.type,"马菲羊");
+                             that.handleDownload(res.data.MFY,that.formState.type,"马菲羊",data);
                         }
                         if(res.data&&res.data.NBSY){
-                            that.handleDownload(res.data.NBSY,that.formState.type,"宁波森语");
+                            that.handleDownload(res.data.NBSY,that.formState.type,"宁波森语",data);
                         } 
                         this.$message.success(res.message);
                         this.handleCancel()
@@ -198,10 +209,13 @@
                         this.$message.error(res.message);
                     }
                 }).finally(() => {
+                    this.loading1 = false;
                     this.loading = false
+                    this.formState.DateTime = [];
+                    this.formState.yearWith = '';
                 })
             },
-            handleDownload(id,type,name){
+            handleDownload(id,type,name,datas){
               downFile('/salary/salaryManagement/exportXls2',{id:id,type:type}).then(data => {
                 
                 this.$message.success(name+type+"数据导出中,请稍等");
@@ -213,9 +227,11 @@
                 
                 let datePar = "";
                 if(type == '年休工资单'){
-                  datePar = moment(this.formState.yearWith).format('YYYY');
+                  datePar = datas.yearWith;
+                  // datePar = moment(data.yearWith).format('YYYY');
                 }else{
-                  datePar = moment(this.formState.yearWithMonth).format('YYYY-MM');
+                  datePar = datas.yearWithMonth;
+                  // datePar = moment(data.yearWithMonth).format('YYYY-MM');
                 }
                 
                 if (typeof window.navigator.msSaveBlob !== 'undefined') {
@@ -231,7 +247,15 @@
                   document.body.removeChild(link) // 下载完成移除元素
                   window.URL.revokeObjectURL(url) // 释放掉blob对象
                 }
-              })
+              }).catch(
+                 error => {
+                      this.alertMsg(error.toString());
+                 }
+              )
+            },
+            alertMsg(st){
+              this.spinning = false
+              this.$message.warning('文件自动下载失败,请联系系统管理员'+st)
             },
             changeData(value){
                 this.formState.DateTime = value

+ 2 - 0
src/views/oa/salary_management/personnelSalary/modules/uploadPayroll.vue

@@ -97,9 +97,11 @@
                     this.showUploadList = true
                     this.$message.success(file.response.message)
                     this.$emit('ok')
+                    this.checked = false
                     this.handleCancel()
                 }else if(file.status === 'done'&&!file.response.success){
                     this.showUploadList = false
+                    this.checked = false
                     this.$message.error(file.response.message)
                 }