zhengnaiwen_citu 3 mesi fa
parent
commit
9f0b05bd2f

+ 6 - 1
src/api/salary.js

@@ -228,5 +228,10 @@ export function getSalaryStatistics (data) {
 
 // 机构产品趋势
 export function getSalaryProductStatistics (data) {
-  return http.post('/customer/performance/claim/product/statistics ', data)
+  return http.post('/customer/performance/claim/product/statistics', data)
+}
+
+// 发布测算结构
+export function sendSalaryRelease (data) {
+  return http.post('/performance/solution/send/release', data)
 }

+ 11 - 1
src/components/AutoComponents/ECharts/eCharts.js

@@ -53,10 +53,20 @@ class EChartsComponent {
       get: function (target, prop) {
         if (prop === 'setOption') {
           return function (option, ...args) {
+            // 填充图例数据
+            const { legend, ...options } = option
+            if (legend) {
+              Object.assign(legend, {
+                data: options.series.map((item, index) => {
+                  return item.name || `系列${index + 1}`
+                })
+              })
+            }
             // 合并颜色配置
             const mergedOption = {
+              legend,
               color: defaultColors,
-              ...option
+              ...options
             }
             // 调用原始的 setOption 方法
             return target[prop](mergedOption, ...args)

+ 4 - 4
src/components/StatisticsList/index.vue

@@ -90,10 +90,10 @@ export default {
   display: flex;
   flex-direction: column;
   height: 100%; /* 确保容器有明确的高度 */
-  &-header {
-    // display: table-row;
-    // height: 1px; /* 最小高度 */
-  }
+  // &-header {
+  //   display: table-row;
+  //   height: 1px; /* 最小高度 */
+  // }
   &-main {
     flex-grow: 1;
   min-height: 0; /* 关键:允许内容压缩 */

+ 1 - 1
src/components/TabsTemplate/index.vue

@@ -6,7 +6,7 @@
       :label="item.label"
       :name="item.name"
     >
-      <component :is="item.component" :ref="item.name" :label="item.label" @hook:mounted="onComponentMounted" v-on="$listeners"></component>
+      <component :is="item.component" :ref="item.name" :label="item.label" v-bind="$attrs" @hook:mounted="onComponentMounted" v-on="$listeners"></component>
     </el-tab-pane>
   </el-tabs>
 </template>

+ 15 - 12
src/views/bonus/allocation/index.vue

@@ -109,22 +109,23 @@ export default {
           }
         },
         {
-          label: '分配机构',
+          label: '机构',
           prop: 'organizationNo',
-          type: 'select',
+          type: 'cascader',
           options: {
-            clearable: false,
+            placeholder: '请选择机构',
             filterable: true,
-            placeholder: '请选择机构类型',
-            items: this.organizationCategoryItems,
-            labelValue: 'organizationNo',
-            labelText: 'organizationName'
+            clearable: true,
+            options: this.organizationTree,
+            showAllLevels: false,
+            props: {
+              emitPath: false,
+              checkStrictly: true,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
           }
-          // handles: {
-          //   change: (v) => {
-          //     this.checkBranch = this.organizationCategoryItems.find(e => e.organizationNo === v).checkBranch
-          //   }
-          // }
         }
       ]
     },
@@ -192,6 +193,8 @@ export default {
         this.checkBranch = this.organizationCategoryItems.find(e => e.organizationNo === organizationNo).checkBranch
         return data
       } catch (error) {
+        this.items = []
+        this.total = 0
         this.$message.error(error)
       } finally {
         this.loading = false

+ 0 - 0
src/views/bonus/process/subBranch/components/detail.vue → src/views/bonus/process/components/detail.vue


+ 89 - 6
src/views/bonus/process/index.vue

@@ -1,22 +1,105 @@
 <template>
   <div class="pa-3 white">
-    <TabTemplate :import-context="(path) => import(`./${path}`)"></TabTemplate>
+    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
+    <m-table
+      v-loading="loading"
+      :items="items"
+      :headers="headers"
+    >
+      <template #parentOrganizationName="{ row }">
+        {{ row.organization?.parentOrganizationName }}
+      </template>
+      <template #organizationName="{ row }">
+        {{ row.organization?.organizationName }}
+      </template>
+      <template #organizationCategory="{ row }">
+        {{ row.organization?.organizationCategory }}
+      </template>
+      <template #status="{ row }">
+        {{ row.status !== 'null' && row.status !=='undefined' ? (row.status ? '已发放' : '发放中') : '' }}
+      </template>
+      <template #performanceSalaryManageEmployees="{ row }">
+        {{ row.performanceSalaryManageEmployees && row.performanceSalaryManageEmployees?.length ? row.performanceSalaryManageEmployees.map(e => e.employeeName).join(',') : '' }}
+      </template>
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="onDetail(row)">详情</m-button>
+      </template>
+    </m-table>
+
+    <SubBranchDetail ref="SubBranchDetail" />
   </div>
 </template>
 
 <script>
-import TabTemplate from '@/components/TabsTemplate'
+import { dateFormat } from '@/utils/date'
+import { getPerformanceAllocationProgress } from '@/api/process'
+import SubBranchDetail from './components/detail.vue'
 export default {
   name: 'ProcessIndex',
   components: {
-    TabTemplate
+    SubBranchDetail
+  },
+  data () {
+    return {
+      searchItems: [
+        {
+          label: '月份',
+          prop: 'month',
+          type: 'datePicker',
+          options: {
+            clearable: false,
+            type: 'month',
+            format: 'yyyy-MM',
+            valueFormat: 'yyyy-MM',
+            placeholder: '选择查询月份'
+          }
+        }
+      ],
+      searchValues: {
+        month: dateFormat('YYYY-mm', new Date())
+      },
+      headers: [
+        { label: '月份', prop: 'month' },
+        { label: '上级机构', prop: 'parentOrganizationName' },
+        { label: '机构名称', prop: 'organizationName' },
+        { label: '机构类型', prop: 'organizationCategory' },
+        { label: '负责人', prop: 'performanceSalaryManageEmployees' },
+        { label: '绩效奖金处理状态', prop: 'status' },
+        { label: '操作', prop: 'actions', fixed: 'right' }
+      ],
+      items: [],
+      loading: false
+    }
+  },
+  created () {
+    this.onInit()
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getPerformanceAllocationProgress(this.searchValues)
+        this.items = data || []
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onDetail (item) {
+      if (!item.organization?.organizationNo) return this.$message.warning('获取数据失败,请稍后重试!')
+      this.$refs.SubBranchDetail.open({
+        month: item.month,
+        parentOrganizationNo: item.organization?.organizationNo
+      })
+    },
+    onSearch () {
+      this.onInit()
+    }
   }
 }
 </script>
 
 <style lang="scss" scoped>
   /* 自定义样式 */
-  ::v-deep .el-tabs__content {
-    overflow: visible !important;
-  }
 </style>

+ 0 - 120
src/views/bonus/process/network/index.vue

@@ -1,120 +0,0 @@
-<template>
-  <div>
-    <m-search class="mb-3" :items="searchItems" :showResetBtn="false" v-model="searchValues" @search="onSearch"></m-search>
-    <m-table
-      v-loading="loading"
-      :items="items"
-      :headers="headers"
-    >
-      <template #parentOrganizationName="{ row }">
-        {{ row.organization?.parentOrganizationName }}
-      </template>
-      <template #organizationName="{ row }">
-        {{ row.organization?.organizationName }}
-      </template>
-      <template #organizationCategory="{ row }">
-        {{ row.organization?.organizationCategory }}
-      </template>
-      <template #status="{ row }">
-        {{ row.status !== 'null' && row.status !=='undefined' ? (row.status ? '已发放' : '发放中') : '' }}
-      </template>
-      <template #performanceSalaryManageEmployees="{ row }">
-        {{ row.performanceSalaryManageEmployees && row.performanceSalaryManageEmployees?.length ? row.performanceSalaryManageEmployees.map(e => e.employeeName).join(',') : '' }}
-      </template>
-    </m-table>
-  </div>
-</template>
-
-<script>
-import { dateFormat } from '@/utils/date'
-import { mapGetters } from 'vuex'
-import { getPerformanceAllocationProgress } from '@/api/process'
-export default {
-  name: 'ProcessNetwork',
-  data () {
-    return {
-      searchValues: {
-        month: dateFormat('YYYY-mm', new Date()),
-        parentOrganizationNo: null
-      },
-      headers: [
-        { label: '月份', prop: 'month' },
-        { label: '上级机构', prop: 'parentOrganizationName' },
-        { label: '机构名称', prop: 'organizationName' },
-        { label: '机构类型', prop: 'organizationCategory' },
-        { label: '负责人', prop: 'performanceSalaryManageEmployees' },
-        { label: '绩效奖金处理状态', prop: 'status' }
-      ],
-      items: [],
-      loading: false,
-      defaultOrganization: null
-    }
-  },
-  computed: {
-    ...mapGetters(['organizationTree']),
-    organizationItems () {
-      if (this.organizationTree.length > 0) {
-        return this.organizationTree[0].child
-      }
-      return []
-    },
-    searchItems () {
-      return [
-        {
-          label: '月份',
-          prop: 'month',
-          type: 'datePicker',
-          options: {
-            clearable: false,
-            type: 'month',
-            format: 'yyyy-MM',
-            valueFormat: 'yyyy-MM',
-            placeholder: '选择查询月份'
-          }
-        },
-        {
-          label: '上级机构',
-          prop: 'parentOrganizationNo',
-          type: 'select',
-          options: {
-            placeholder: '请选择上级机构',
-            items: this.organizationItems,
-            labelValue: 'organizationNo',
-            clearable: false,
-            labelText: 'organizationName'
-          }
-        }
-      ]
-    }
-  },
-  mounted () {
-    if (this.organizationTree.length > 0) {
-      this.searchValues.parentOrganizationNo = this.organizationItems[0].organizationNo
-      this.defaultOrganization = this.organizationItems[0].organizationNo
-    }
-  },
-  methods: {
-    async onInit () {
-      this.loading = true
-      try {
-        const { data } = await getPerformanceAllocationProgress(this.searchValues)
-        this.items = data || []
-      } catch (error) {
-        this.$message.error(error)
-      } finally {
-        this.loading = false
-      }
-    },
-    onSearch () {
-      if (!this.searchValues.parentOrganizationNo) {
-        this.searchValues.parentOrganizationNo = this.defaultOrganization
-      }
-      this.onInit()
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-  /* 自定义样式 */
-</style>

+ 0 - 102
src/views/bonus/process/subBranch/index.vue

@@ -1,102 +0,0 @@
-<template>
-  <div>
-    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
-    <m-table
-      v-loading="loading"
-      :items="items"
-      :headers="headers"
-    >
-      <template #parentOrganizationName="{ row }">
-        {{ row.organization?.parentOrganizationName }}
-      </template>
-      <template #organizationName="{ row }">
-        {{ row.organization?.organizationName }}
-      </template>
-      <template #organizationCategory="{ row }">
-        {{ row.organization?.organizationCategory }}
-      </template>
-      <template #status="{ row }">
-        {{ row.status !== 'null' && row.status !=='undefined' ? (row.status ? '已发放' : '发放中') : '' }}
-      </template>
-      <template #performanceSalaryManageEmployees="{ row }">
-        {{ row.performanceSalaryManageEmployees && row.performanceSalaryManageEmployees?.length ? row.performanceSalaryManageEmployees.map(e => e.employeeName).join(',') : '' }}
-      </template>
-      <template #actions="{ row }">
-        <m-button type="primary" text @click="onDetail(row)">详情</m-button>
-      </template>
-    </m-table>
-
-    <SubBranchDetail ref="SubBranchDetail" />
-  </div>
-</template>
-
-<script>
-import { dateFormat } from '@/utils/date'
-import { getPerformanceAllocationProgress } from '@/api/process'
-import SubBranchDetail from './components/detail.vue'
-export default {
-  name: 'ProcessSubBranch',
-  components: {
-    SubBranchDetail
-  },
-  data () {
-    return {
-      searchItems: [
-        {
-          label: '月份',
-          prop: 'month',
-          type: 'datePicker',
-          options: {
-            clearable: false,
-            type: 'month',
-            format: 'yyyy-MM',
-            valueFormat: 'yyyy-MM',
-            placeholder: '选择查询月份'
-          }
-        }
-      ],
-      searchValues: {
-        month: dateFormat('YYYY-mm', new Date())
-      },
-      headers: [
-        { label: '月份', prop: 'month' },
-        { label: '上级机构', prop: 'parentOrganizationName' },
-        { label: '机构名称', prop: 'organizationName' },
-        { label: '机构类型', prop: 'organizationCategory' },
-        { label: '负责人', prop: 'performanceSalaryManageEmployees' },
-        { label: '绩效奖金处理状态', prop: 'status' },
-        { label: '操作', prop: 'actions', fixed: 'right' }
-      ],
-      items: [],
-      loading: false
-    }
-  },
-  methods: {
-    async onInit () {
-      this.loading = true
-      try {
-        const { data } = await getPerformanceAllocationProgress(this.searchValues)
-        this.items = data || []
-      } catch (error) {
-        this.$message.error(error)
-      } finally {
-        this.loading = false
-      }
-    },
-    onDetail (item) {
-      if (!item.organization?.organizationNo) return this.$message.warning('获取数据失败,请稍后重试!')
-      this.$refs.SubBranchDetail.open({
-        month: item.month,
-        parentOrganizationNo: item.organization?.organizationNo
-      })
-    },
-    onSearch () {
-      this.onInit()
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-  /* 自定义样式 */
-</style>

+ 22 - 1
src/views/payroll/staffWage/index.vue

@@ -33,6 +33,7 @@ import { downloadFile } from '@/utils'
 import {
   PAYROLL_HEADER
 } from '@/utils/panorama'
+import { mapGetters } from 'vuex'
 // import { drilling } from '@/api/system'
 export default {
   name: 'StaffWage',
@@ -58,6 +59,7 @@ export default {
     }
   },
   computed: {
+    ...mapGetters(['organizationTree']),
     searchItems () {
       return [
         {
@@ -71,7 +73,26 @@ export default {
             format: 'yyyy 年 MM 月'
           }
         },
-        { label: '部门', prop: 'organizationName', type: 'input', options: { placeholder: '请输入部门' }, hidden: this.$attrs.panorama },
+        {
+          label: '部门',
+          prop: 'organizationNo',
+          type: 'cascader',
+          hidden: this.$attrs.panorama,
+          options: {
+            placeholder: '请选择部门',
+            filterable: true,
+            clearable: true,
+            options: this.organizationTree,
+            showAllLevels: false,
+            props: {
+              emitPath: false,
+              value: 'organizationNo',
+              label: 'organizationName',
+              children: 'child'
+            }
+          }
+        },
+        // { label: '部门', prop: 'organizationName', type: 'input', options: { placeholder: '请输入部门' }, hidden: this.$attrs.panorama },
         { label: '姓名', prop: 'employeeName', type: 'input', options: { placeholder: '请输入姓名' }, hidden: this.$attrs.panorama }
       ]
     }

+ 1 - 1
src/views/salary/sandbox/index.vue

@@ -2,7 +2,7 @@
   <div class="pa-3 white">
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="核算规则" name="Solution">
-        <Solution label="核算规则" ref="Solution" @history="onHistory"></Solution>
+        <Solution label="核算规则" ref="Solution" :permission="['add', 'edit', 'delete', 'view', 'rules', 'release', 'send']" @history="onHistory"></Solution>
       </el-tab-pane>
       <el-tab-pane label="系数导向" name="Coefficient">
         <Coefficient label="系数导向" ref="Coefficient"></Coefficient>

+ 1 - 1
src/views/salary/solution/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="white pa-3">
-    <TabTemplate :import-context="(path) => import(`./${path}`)" @history="onHistory"></TabTemplate>
+    <TabTemplate :permission="['view']" :import-context="(path) => import(`./${path}`)" @history="onHistory"></TabTemplate>
     <el-drawer
       :title="itemData.title"
       :visible.sync="show"

+ 33 - 8
src/views/salary/solution/salarySolution/index.vue

@@ -1,15 +1,16 @@
 <template>
   <div>
-    <ListTemplate ref="listTemplateRefs" :card-title="$attrs.label">
+    <ListTemplate ref="listTemplateRefs" :card-title="$attrs.label" v-loading="loading">
       <template #tool>
-        <m-button type="orange" size="small" icon="el-icon-plus" @click="onOpen('salarySolutionEditRefs')">新增</m-button>
+        <m-button type="orange" v-if="permission.includes('add')" size="small" icon="el-icon-plus" @click="onOpen('salarySolutionEditRefs')" >新增</m-button>
       </template>
       <template #actions="{ row }">
-        <m-button text type="primary" size="small" @click="onOpen('salarySolutionDetailsRefs', row)">查看</m-button>
-        <m-button text type="primary" size="small" @click="onOpen('salarySolutionEditRefs', row)">编辑</m-button>
-        <m-button text type="primary" size="small" @click="onOpen('salarySolutionRulesRefs', row)">规则配置</m-button>
-        <m-button text type="primary" size="small" @click="onOpen('salarySolutionHistory', row)">版本记录</m-button>
-        <m-button text type="danger" size="small" @click="onDelete(row)">删除</m-button>
+        <m-button v-if="permission.includes('view')" text type="primary" size="small" @click="onOpen('salarySolutionDetailsRefs', row)">查看</m-button>
+        <m-button v-if="permission.includes('edit')" text type="primary" size="small" @click="onOpen('salarySolutionEditRefs', row)">编辑</m-button>
+        <m-button v-if="permission.includes('rules')" text type="primary" size="small" @click="onOpen('salarySolutionRulesRefs', row)">规则配置</m-button>
+        <m-button v-if="permission.includes('release')" text type="primary" size="small" @click="onOpen('salarySolutionHistory', row)">版本记录</m-button>
+        <m-button v-if="permission.includes('send')" text type="success" size="small" @click="onSend(row)">发布</m-button>
+        <m-button v-if="permission.includes('delete')" text type="danger" size="small" @click="onDelete(row)">删除</m-button>
       </template>
     </ListTemplate>
     <SalarySolutionDetails ref="salarySolutionDetailsRefs"></SalarySolutionDetails>
@@ -25,7 +26,8 @@
 
 <script>
 import {
-  deleteSolution
+  deleteSolution,
+  sendSalaryRelease
 } from '@/api/salary'
 import ListTemplate from '../components/ListTemplate.vue'
 import SalarySolutionEdit from './salarySolutionEdit.vue'
@@ -34,6 +36,12 @@ import SalarySolutionHistory from './salarySolutionHistory.vue'
 import SalarySolutionDetails from './salarySolutionDetails.vue'
 export default {
   name: 'salary-solution-list',
+  props: {
+    permission: {
+      type: Array,
+      default: () => []
+    }
+  },
   components: {
     ListTemplate,
     SalarySolutionEdit,
@@ -41,6 +49,11 @@ export default {
     SalarySolutionHistory,
     SalarySolutionDetails
   },
+  data () {
+    return {
+      loading: false
+    }
+  },
   mounted () {
     this.$emit('mounted')
   },
@@ -48,6 +61,18 @@ export default {
     onInit () {
       this.$refs.listTemplateRefs.onInit()
     },
+    async onSend (row) {
+      this.loading = true
+      try {
+        await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
+        this.$message.success('发布成功')
+        this.$refs.listTemplateRefs.onInit()
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
     onOpen (ref, item) {
       this.$refs[ref]?.open && this.$refs[ref].open(item)
     },