zhengnaiwen_citu 4 kuukautta sitten
vanhempi
commit
9d000cf006

+ 3 - 3
src/api/bonus.js

@@ -16,9 +16,9 @@ export function getAllocationEmployeeCategory (data) {
 }
 
 // 业绩分配 检查审核状态
-export function checkAllocationSubmitStatus (data) {
-  return http.post('/employee/performance/confirmation/check/submit', data)
-}
+// export function checkAllocationSubmitStatus (data) {
+//   return http.post('/employee/performance/confirmation/check/submit', data)
+// }
 
 // 业绩分配 绩效分配统计
 export function getAllocationStatistics (data) {

+ 9 - 33
src/views/bonus/allocation/index.vue

@@ -5,14 +5,8 @@
       <template #card-tools="{ items }">
         <div class="content">
           <div>
-            <template v-if="auditStatusList[auditStatus]">
-              审核状态:
-              <el-tag :type="auditStatusList[auditStatus]?.type ?? 'info'" class="mr-3">
-                {{ auditStatusList[auditStatus]?.label ?? '未知状态' }}
-              </el-tag>
-            </template>
-            可发放绩效:<el-tag>{{ totalAllocationPerformanceSalary }}</el-tag>
-            总绩效: <el-tag>{{ totalGrantPerformanceSalary }}</el-tag>
+            <!-- 绩效合计:<el-tag>{{ totalAllocationPerformanceSalary }}</el-tag> -->
+            可发放绩效: <el-tag>{{ totalGrantPerformanceSalary }}</el-tag>
             <m-button
               class="ml-3"
               type="orange"
@@ -27,6 +21,9 @@
       <template #actions="{ row, items }">
         <el-input v-show="auditStatus !== 0 && auditStatus !== 1 && items.length" v-model="values[row.employeePerformanceId]" placeholder="请输入绩效" size="small"></el-input>
       </template>
+      <template #actions-header>
+        合计:<el-tag>{{ totalAllocationPerformanceSalary }}</el-tag>
+      </template>
     </BonusTable>
   </div>
 </template>
@@ -40,11 +37,10 @@ import {
   saveAllocationGrant,
   // getAllocationEmployeeCategory,
   getAllocationOrganizationCategory,
-  checkAllocationSubmitStatus,
+  // checkAllocationSubmitStatus,
   getAllocationStatistics,
   saveAllocation
 } from '@/api/bonus'
-import { STATUS_LIST } from '../utils'
 import { mapGetters } from 'vuex'
 export default {
   name: 'bonusAllocation',
@@ -53,9 +49,8 @@ export default {
   },
   data () {
     return {
-      auditStatusList: STATUS_LIST,
       auditStatus: null,
-      auditStatusLoading: true,
+      auditStatusLoading: false,
       values: {},
       searchValues: {
         month: dateFormat('YYYY-mm', new Date()),
@@ -118,7 +113,7 @@ export default {
   methods: {
     async onInit (pageInfo) {
       this.loading = true
-      await this.onCheckStatus()
+      // await this.onCheckStatus()
       await this.onStatistics()
       if (!this.$refs.bonusTableRefs) {
         this.loading = false
@@ -168,16 +163,6 @@ export default {
         h('p', undefined, `提交月份:${this.query.month}`)
       ]
       try {
-        if (this.totalGrantPerformanceSalary !== this.totalAllocationPerformanceSalary) {
-          const el = h('div', [
-            h('p', undefined, '当前非完全配额,是否强制提交?'),
-            ..._el
-          ])
-          this.$confirm(el, '提示').then(() => {
-            this.onSaveAll(true)
-          }).catch(_ => {})
-          return
-        }
         const el = h('div', [
           h('p', undefined, '确定提交所有数据?'),
           ..._el
@@ -201,6 +186,7 @@ export default {
         this.$message.error('请先分配金额')
         return
       }
+      this.auditStatusLoading = true
       try {
         await saveAllocationGrant({
           ...this.query,
@@ -214,16 +200,6 @@ export default {
         this.onInit()
       } catch (error) {
         this.$message.error(error)
-      }
-    },
-    // 查询提交状态
-    async onCheckStatus () {
-      this.auditStatusLoading = true
-      try {
-        const { data } = await checkAllocationSubmitStatus(this.query)
-        this.auditStatus = data?.status ?? null
-      } catch (error) {
-        this.$message.error(error)
       } finally {
         this.auditStatusLoading = false
       }

+ 5 - 4
src/views/bonus/allocationConfig/AllocationConfigEdit.vue

@@ -103,11 +103,12 @@ export default {
     }
   },
   methods: {
-    open (item) {
+    async open (item) {
       this.loading = true
-      // 默认获取一次
-      this.remoteMethod()
+      this.$refs.dialog.open()
       if (!item) {
+        // 默认获取一次
+        await this.remoteMethod()
         this.itemData = {}
         this.formValues = {
           employeeCode: null,
@@ -116,6 +117,7 @@ export default {
           organizationName: null
         }
       } else {
+        await this.remoteMethod(item.employeeName)
         this.itemData = item
         this.formValues = {
           employeeCode: item.employeeCode,
@@ -124,7 +126,6 @@ export default {
           employeeName: item.employeeName
         }
       }
-      this.$refs.dialog.open()
       this.$nextTick(() => {
         this.$refs.form.clearValidate()
         this.loading = false

+ 0 - 152
src/views/bonus/approve/approveDetails.vue

@@ -1,152 +0,0 @@
-<template>
-  <m-dialog ref="dialog" title="审核详情" v-bind="$attrs" hideFooter>
-    <el-form label-width="120px">
-      <el-form-item label="审核状态">
-        <div :class="{ 'd-flex': item.status === 0 }" class="justify-between align-center fullHeight">
-          <el-tag :type="statusList[item.status]?.type ?? 'info'">{{ statusList[item.status]?.label ?? '未知状态' }}</el-tag>
-          <div v-if="item.status === 0">
-            <m-button type="success" size="small" icon="el-icon-check" class="mr-3" @click="onResolve">通过</m-button>
-            <el-popover
-              placement="bottom"
-              v-model="visible"
-              width="300"
-              trigger="click"
-            >
-              <el-input v-model="rejectText" type="textarea" :rows="3" placeholder="请输入拒绝原因"></el-input>
-              <div class="pt-3 text-right">
-                <m-button size="mini" @click="visible = false">取消</m-button>
-                <m-button size="mini" type="orange" @click="onReject">提交</m-button>
-              </div>
-              <template #reference>
-                <m-button type="danger" size="small" icon="el-icon-close">拒绝</m-button>
-              </template>
-            </el-popover>
-          </div>
-        </div>
-      </el-form-item>
-      <el-form-item label="拒绝理由" v-if="item.status === 2">
-        {{ item.authMsg }}
-      </el-form-item>
-      <el-form-item label="基本信息">
-        <el-descriptions class="margin-top" :column="3" direction="vertical" border>
-          <el-descriptions-item label="月份">
-            <el-tag class="mr-3">{{ item.month || '无' }}</el-tag>
-          </el-descriptions-item>
-          <el-descriptions-item label="发起机构">
-            <el-tag class="mr-3">{{ item.opOrganizationName || '无' }}</el-tag>
-          </el-descriptions-item>
-          <el-descriptions-item label="员工类型">
-            <el-tag class="mr-3">{{ item.employeeCategory || '无' }}</el-tag>
-          </el-descriptions-item>
-        </el-descriptions>
-      </el-form-item>
-      <el-form-item label="分配明细">
-        <BonusTable ref="bonusTableRefs" clearHeader :filter-header="filterHeader" :show-summary="true" shadow="never"></BonusTable>
-      </el-form-item>
-    </el-form>
-      <!-- <div>
-        <template v-if="item.status !== 0">
-          <el-tag :type="statusList[item.status]?.type ?? 'info'">{{ statusList[item.status]?.label ?? '未知状态' }}</el-tag>
-        </template>
-        <template v-else>
-          <m-button type="success" size="small" icon="el-icon-check" class="mr-3" @click="onResolve">通过</m-button>
-          <el-popover
-            placement="bottom"
-            v-model="visible"
-            width="300"
-            trigger="click"
-          >
-            <el-input v-model="rejectText" type="textarea" :rows="3" placeholder="请输入拒绝原因"></el-input>
-            <div class="pt-3 text-right">
-              <m-button size="mini" @click="visible = false">取消</m-button>
-              <m-button size="mini" type="orange" @click="onReject">提交</m-button>
-            </div>
-            <template #reference>
-              <m-button type="danger" size="small" icon="el-icon-close">拒绝</m-button>
-            </template>
-          </el-popover>
-        </template>
-
-      </div> -->
-    <!-- </div> -->
-    <!-- <BonusTable ref="bonusTableRefs" clearHeader :filter-header="filterHeader" :show-summary="true" shadow="never"></BonusTable> -->
-  </m-dialog>
-</template>
-
-<script>
-import BonusTable from '../components/bonusTable.vue'
-import { STATUS_LIST } from '../utils'
-import {
-  saveBonusApproveConfirmation
-} from '@/api/bonus'
-export default {
-  name: 'approveDetails',
-  components: {
-    BonusTable
-  },
-  data () {
-    return {
-      statusList: STATUS_LIST,
-      visible: false,
-      rejectText: null,
-      item: {},
-      filterHeader: ['month', 'organizationName', 'employeeCategory', 'status', 'actions', 'assignablePerformanceSalary', 'version', 'dataType', 'createDate']
-    }
-  },
-  methods: {
-    open (item) {
-      this.item = item
-      this.$refs.dialog.open()
-      this.$nextTick(() => {
-        this.$refs.bonusTableRefs.onInit({
-          month: item.month,
-          organizationNo: item.opOrganizationNo,
-          employeeCategory: item.employeeCategory,
-          employeePerformanceIds: item.employeePerformanceIds
-        })
-      })
-    },
-    onResolve () {
-      this.$confirm('是否确定通过?', '提示').then(async () => {
-        try {
-          await saveBonusApproveConfirmation({
-            employeePerformanceConfirmationId: this.item.employeePerformanceConfirmationId,
-            status: 1
-          })
-          this.$message.success('审核通过')
-          this.$refs.dialog.close()
-          this.$emit('onRefresh')
-        } catch (error) {
-          this.$message.error(error)
-        }
-      }).catch(_ => {})
-    },
-    onReject () {
-      if (!this.rejectText) {
-        this.$message.error('请输入拒绝原因')
-        return
-      }
-      this.$confirm('是否确定拒绝?', '提示').then(async () => {
-        try {
-          await saveBonusApproveConfirmation({
-            employeePerformanceConfirmationId: this.item.employeePerformanceConfirmationId,
-            status: 2,
-            authMsg: this.rejectText
-          })
-          this.$message.success('已成功拒绝')
-          this.$refs.dialog.close()
-          this.$emit('onRefresh')
-        } catch (error) {
-          this.$message.error(error)
-        }
-      }).catch(_ => {})
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.fullHeight {
-  height: 100%;
-}
-</style>

+ 0 - 156
src/views/bonus/approve/index.vue

@@ -1,156 +0,0 @@
-<template>
-  <div class="white pa-3">
-    <m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch"></m-search>
-    <m-table
-      :items="items"
-      :headers="headers"
-      v-loading="loading"
-      :total="total"
-      :page-size="pageInfo.size"
-      :page-current="pageInfo.current"
-      @page-change="onPageChange"
-    >
-      <template #status="{ row }">
-        <el-tag :type="statusList[row.status]?.type ?? 'info'">{{ statusList[row.status]?.label ?? '未知状态' }}</el-tag>
-      </template>
-      <template #actions="{ row }">
-        <m-button text type="primary" @click="onShowDetails(row)">查看明细</m-button>
-      </template>
-    </m-table>
-    <ApproveDetails ref="approveDetailsRefs" @onRefresh="onInit"></ApproveDetails>
-  </div>
-</template>
-
-<script>
-import {
-  getBonusApprovePage,
-  getAllocationEmployeeCategory
-} from '@/api/bonus'
-import ApproveDetails from './approveDetails.vue'
-import { STATUS_LIST } from '../utils'
-
-export default {
-  name: 'bonusAllocationApprove',
-  components: {
-    ApproveDetails
-  },
-  data () {
-    return {
-      statusList: STATUS_LIST,
-      loading: false,
-      items: [],
-      headers: [
-        { label: '月份', prop: 'month' },
-        { label: '发起机构', prop: 'opOrganizationName' },
-        // { label: '分配员工', prop: 'opNickname', align: 'center' },
-        { label: '员工类型', prop: 'employeeCategory', align: 'center' },
-        { label: '状态', prop: 'status', align: 'center' },
-        { label: '数据版本', prop: 'version', align: 'center' },
-        { label: '审核信息', prop: 'authMsg' },
-        { label: '操作', prop: 'actions' }
-      ],
-      total: 0,
-      pageInfo: {
-        current: 1,
-        size: 10
-      },
-      searchValues: {},
-      employeeCategoryItems: []
-    }
-  },
-  computed: {
-    searchItems () {
-      return [
-        {
-          label: '月份',
-          prop: 'month',
-          type: 'datePicker',
-          options: {
-            placeholder: '请选择月份',
-            clearable: false,
-            type: 'month',
-            valueFormat: 'yyyy-MM',
-            format: 'yyyy 年 MM 月'
-          },
-          handles: {
-            change: this.getEmployeeCategoryItems
-          }
-        },
-        // {
-        //   label: '发起机构',
-        //   prop: 'organizationName',
-        //   type: 'input',
-        //   options: {
-        //     placeholder: '请输入发起机构'
-        //   }
-        // },
-        {
-          label: '员工类型',
-          prop: 'employeeCategory',
-          type: 'select',
-          options: {
-            placeholder: '请输入员工类型',
-            items: this.employeeCategoryItems
-          }
-        }
-      ]
-    }
-  },
-  created () {
-    this.onInit()
-  },
-  methods: {
-    async onInit () {
-      try {
-        const { data } = await getBonusApprovePage({
-          page: {
-            ...this.pageInfo
-          },
-          entity: {}
-        })
-        this.items = data.records
-        this.total = data.total
-      } catch (error) {
-        this.$message.error(error)
-      }
-    },
-    onPageChange (page) {
-      this.pageInfo.current = page
-      this.onInit()
-    },
-    async getEmployeeCategoryItems () {
-      try {
-        const { data } = await getAllocationEmployeeCategory({
-          month: this.searchValues.month
-        })
-        this.employeeCategoryItems = data.map(e => {
-          return {
-            label: e,
-            value: e
-          }
-        })
-        if (!data.length) {
-          this.searchValues.employeeCategory = null
-          return
-        }
-        this.searchValues.employeeCategory = this.employeeCategoryItems[0].value
-        return data
-      } catch (error) {
-        this.employeeCategoryItems = []
-        this.$message.error(error)
-      }
-    },
-    onSearch () {
-      this.pageInfo.current = 1
-      this.onInit()
-    },
-    onShowDetails (row) {
-      this.$refs.approveDetailsRefs.open(row)
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 8 - 3
src/views/bonus/components/bonusTable.vue

@@ -25,6 +25,9 @@
     <template #actions="{ row }">
       <slot name="actions" :row="row" :items="items"></slot>
     </template>
+    <template #actions-header="{ row }">
+      <slot name="actions-header" :row="row" :items="items"></slot>
+    </template>
   </m-table>
 </template>
 
@@ -73,7 +76,7 @@ export default {
         { label: '机构名称', prop: 'organizationName', width: 150 },
         { label: '员工姓名', prop: 'employeeName', width: 80, align: 'center' },
         { label: '分配状态', prop: 'status', align: 'center', width: 100 },
-        { label: '员工类型', prop: 'employeeCategory', align: 'center' },
+        { label: '员工岗位', prop: 'employeeCategory', align: 'center' },
         { label: '可分配绩效薪资', prop: 'assignablePerformanceSalary', align: 'center', width: 150 },
         { label: '领导分配绩效薪资', prop: 'allocationPerformanceSalary', align: 'center', width: 150 },
         { label: '基础绩效薪资', prop: 'basicPerformanceSalary', align: 'center', width: 120 },
@@ -94,6 +97,7 @@ export default {
         Object.assign(this.pageInfo, pageInfo)
       }
       this.loading = true
+      const { organizationCategory, ...query } = searchValues
       try {
         const { data } = await getAllocationPage({
           page: {
@@ -101,8 +105,9 @@ export default {
             orders: this.orders
           },
           entity: {
-            ...searchValues
-          }
+            ...query
+          },
+          organizationCategory
         })
         this.items = data.records
         this.total = data.total

+ 0 - 6
src/views/bonus/utils/index.js

@@ -1,6 +0,0 @@
-
-export const STATUS_LIST = {
-  0: { label: '未审核', type: 'warning' },
-  1: { label: '审核通过', type: 'success' },
-  2: { label: '审核拒绝', type: 'danger' }
-}