Browse Source

每月人员工资增加删除功能

ljb 7 months ago
parent
commit
b6df75851a

+ 11 - 2
src/api/yfCostManage/basicDataSetting/monthSalaryList.js

@@ -30,14 +30,23 @@ export const update = (row) => {
 }
 
 
-export const remove = (data) => {
+export const clearSalary = (data) => {
   return request({
-    url: '/api/kd-scientific/salary/remove',
+    url: '/api/kd-scientific/salary/clear',
     method: 'post',
     data
   })
 }
 
+export const remove = (data) => {
+  return request({
+    url: '/api/kd-scientific/salary/delete',
+    method: 'delete',
+    data
+  })
+}
+
+
 export const getLastMonthData = params => {
   return request({
     url: '/api/kd-scientific/salary/fetchTechnicianByYearAndMonth',

+ 1 - 1
src/mixins/crud.js

@@ -171,7 +171,7 @@ export default (app, option = {}) => {
           this.$message.warning("请选择至少一条数据");
           return;
         }
-        this.$confirm("确定将选择数据删除?", {
+        this.$confirm("确定将选择数据删除?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"

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

@@ -7,7 +7,7 @@ export default {
   border: true,
   index: true,
   addBtn: false,
-  delBtnText: '清除工资数据',
+  // delBtnText: '清除工资数据',
   selection: true,
   searchLabelWidth: 140,
   labelWidth: 200,

+ 1 - 1
src/views/basic-resource/comp-basic-info/technician-roster.vue

@@ -283,7 +283,7 @@ export default window.$crudCommon({
     data.records = data.records.map(item => {
       item.gender = item.gender ? String(item.gender) : '';
       item.birthday = item.birthday ? moment(item.birthday).format('yyyy-MM-DD') : '';
-      item.hireDate = item.birthday ? moment(item.hireDate).format('yyyy-MM-DD') : '';
+      item.hireDate = item.hireDate ? moment(item.hireDate).format('yyyy-MM-DD') : '';
       return item;
     });
     return data;

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

@@ -16,7 +16,7 @@
           size="small"
           icon="el-icon-delete"
           plain
-          @click="handleDelete"
+          @click="handleClearSalary"
         >
           清除工资数据
         </el-button>
@@ -46,6 +46,15 @@
         >
           引用当月研发人员名单
         </el-button>
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删除
+        </el-button>
         <print-table-btn @click="printTable" />
       </template>
 
@@ -240,6 +249,23 @@ export default window.$crudCommon({
         this.$refs.printWideTable.printTable(isLandscape);
       });
     },
+    handleClearSalary() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定要清除工资数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.api.clearSalary(this.getBatchDelParams()).then((data) => {
+            this.getList();
+            this.$message.success('清除成功');
+          });
+        });
+    },
   },
 }, {
   // 模块路径

+ 2 - 6
src/views/yf-cost-manage/yf-cost-statistics/person-cost-statistics/yf-work-hours-allocation-list.vue

@@ -48,8 +48,8 @@
 
       <template slot="hoursRate" slot-scope="{ row }">
         <div class="custom-cell">
-          <div class="custom-cell-line">{{ row.workHoursRate }}</div>
-          <div class="custom-cell-line">{{ row.unworkHoursRate }}</div>
+          <div class="custom-cell-line">{{ row.workHoursRate }}%</div>
+          <div class="custom-cell-line">{{ row.unworkHoursRate }}%</div>
         </div>
       </template>
 
@@ -143,21 +143,18 @@ export default window.$crudCommon({
           span: 24,
           width: 90,
           align: 'center',
-          showOverflowTooltip: true,
         },
         {
           prop: "hoursTotal",
           label: "合计",
           width: 50,
           align: 'center',
-          showOverflowTooltip: true,
           display: false,
         }, {
           prop: "hoursRate",
           label: "工时分配率",
           width: 60,
           align: 'center',
-          showOverflowTooltip: true,
           display: false,
         }
       ],
@@ -218,7 +215,6 @@ export default window.$crudCommon({
             width: 50,
             align: 'center',
             isWorkDay: ChineseHoliday.isWorkday(item.dateString),
-            showOverflowTooltip: true,
           };
           this.allMonthCols.push(moment(item.dateString).format('yyyyMMDD'),);
         }