Browse Source

每月工资明细调整

ljb 10 months ago
parent
commit
afeb618912

+ 1 - 1
src/api/yfCostManage/basicDataSetting/monthSalaryList.js

@@ -40,7 +40,7 @@ export const remove = (data) => {
 
 export const getLastMonthData = params => {
   return request({
-    url: '/api/kd-scientific/salary/fetchLastYearData',
+    url: '/api/kd-scientific/salary/fetchTechnicianByYearAndMonth',
     method: 'get',
     params: {
       ...params,

+ 60 - 13
src/option/yfCostManage/basicDataSetting/monthSalaryList.js

@@ -6,10 +6,12 @@ export default {
   searchMenuSpan: 6,
   border: true,
   index: true,
+  addBtn: false,
+  delBtnText: '清除工资数据',
   selection: true,
   searchLabelWidth: 140,
   labelWidth: 200,
-  menuWidth: 140,
+  menuWidth: 180,
   dialogClickModal: false,
   dialogWidth: 500,
   dialogType: "drawer",
@@ -198,41 +200,46 @@ export default {
     },
     {
       label: '奖金(元)',
-      prop: 'total',
+      prop: 'bonus',
+      type: 'number',
+      min: 0,
+      precision: 2,
+      span: 24,
+      minWidth: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '福利费(元)',
+      prop: 'benefit',
       type: 'number',
       min: 0,
       precision: 2,
       span: 24,
       minWidth: 100,
       align: 'center',
-      addDisplay: false,
-      editDisplay: false,
       showOverflowTooltip: true,
     },
     {
       label: '补充养老保险(元)',
-      prop: 'total',
+      prop: 'pensionInsuranceBc',
       type: 'number',
       min: 0,
       precision: 2,
       span: 24,
       minWidth: 100,
       align: 'center',
-      addDisplay: false,
-      editDisplay: false,
       showOverflowTooltip: true,
     },
     {
       label: '补充医疗保险(元)',
-      prop: 'total',
+      prop: 'medicalInsuranceBc',
       type: 'number',
       min: 0,
       precision: 2,
       span: 24,
       minWidth: 100,
       align: 'center',
-      addDisplay: false,
-      editDisplay: false,
       showOverflowTooltip: true,
     },
   ],
@@ -240,11 +247,51 @@ export default {
   showSummary: true,
   sumColumnList: [
     {
-      label:'合计',
-      name: 'yearAndMonth',
+      name: 'averageMonthlySalary',
+      type: 'sum'
     },
     {
-      name: 'averageMonthlySalary',
+      name: 'pensionInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'medicalInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'unemploymentInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'injuryInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'maternityInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'socialInsurance',
+      type: 'sum'
+    },
+    {
+      name: 'providentFund',
+      type: 'sum'
+    },
+    {
+      name: 'bonus',
+      type: 'sum'
+    },
+    {
+      name: 'benefit',
+      type: 'sum'
+    },
+    {
+      name: 'pensionInsuranceBc',
+      type: 'sum'
+    },
+    {
+      name: 'medicalInsuranceBc',
       type: 'sum'
     },
   ],

+ 22 - 8
src/views/yf-cost-manage/basic-data-setting/month-salary-list.vue

@@ -17,7 +17,7 @@
           plain
           @click="handleDelete"
         >
-          删除
+          清除工资数据
         </el-button>
         <el-button
           type="success"
@@ -41,6 +41,7 @@
           type="primary"
           size="small"
           plain
+          @click="handleReadyLastMonData"
         >
           引用当月研发人员名单
         </el-button>
@@ -99,7 +100,19 @@ export default window.$crudCommon({
       },
 
       operateType: '',
-      watchUpdateKey: ["averageMonthlySalary", "pensionInsurance", "medicalInsurance", "unemploymentInsurance", "injuryInsurance", "maternityInsurance", "providentFund"],
+      watchUpdateKey: [
+        "averageMonthlySalary",
+        "pensionInsurance",
+        "medicalInsurance",
+        "unemploymentInsurance",
+        "injuryInsurance",
+        "maternityInsurance",
+        "providentFund",
+        "bonus",
+        "benefit",
+        "pensionInsuranceBc",
+        "medicalInsuranceBc"
+      ],
       beforeUpdatedData: {},
       updatedFormData: {},
 
@@ -188,11 +201,11 @@ export default window.$crudCommon({
     },
     handleExport() {
       exportBloByPost(`/api/kd-scientific/salary/export-salary?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `技术人员${this.params.yearAndMonth}年度平均工资.xlsx`);
+        downloadXls(res.data, `${this.params.yearAndMonth}工资明细.xlsx`);
       });
     },
     handleReadyLastMonData() {
-      this.$confirm("确认读取上年度工资明细吗?", "提示", {
+      this.$confirm("确认引用单月研发人员名单吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
@@ -209,7 +222,7 @@ export default window.$crudCommon({
     },
     printTable(isLandscape) {
       this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `技术人员${this.params.yearAndMonth}年度平均工资`;
+      this.printTitle = `${this.params.yearAndMonth}工资明细`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
       });
@@ -229,6 +242,10 @@ export default window.$crudCommon({
       item.injuryInsurance =  Number(item.injuryInsurance || 0).toFixed(2);
       item.maternityInsurance = Number(item.maternityInsurance || 0).toFixed(2);
       item.providentFund =  Number(item.providentFund || 0).toFixed(2);
+      item.bonus = Number(item.bonus || 0).toFixed(2);
+      item.benefit = Number(item.benefit || 0).toFixed(2);
+      item.pensionInsuranceBc = Number(item.pensionInsuranceBc || 0).toFixed(2);
+      item.medicalInsuranceBc = Number(item.medicalInsuranceBc || 0).toFixed(2);
 
       let pensionInsurance = new Decimal(item.pensionInsurance);
       let medicalInsurance = new Decimal(item.medicalInsurance);
@@ -239,11 +256,8 @@ export default window.$crudCommon({
 
       // 社保合计
       let socialInsurance = pensionInsurance.add(medicalInsurance).add(unemploymentInsurance).add(injuryInsurance).add(maternityInsurance);
-      // 总计
-      let total = socialInsurance.add(providentFund);
 
       item.socialInsurance = socialInsurance.toFixed(2);
-      item.total = total.toFixed(2);
       return item;
     });
     return data;