Browse Source

每月研发人员出勤和每月研发工时打卡增加引用研发人员名单和删除功能

ljb 7 months ago
parent
commit
3dd94c1277

+ 16 - 1
src/api/yfCostManage/basicDataSetting/attenInfo.js

@@ -29,11 +29,26 @@ export const update = (row) => {
   })
 }
 
-
 export const remove = data => {
   return request({
+    url: '/api/kd-scientific/attendance/delete',
+    method: 'delete',
+    data
+  })
+}
+
+export const clearAttendance = data => {
+  return request({
     url: '/api/kd-scientific/attendance/remove',
     method: 'post',
     data
   })
 }
+
+export const feachProjectPersonList = (params) => {
+  return request({
+    url: '/api/kd-scientific/attendance/fetch',
+    method: 'get',
+    params
+  })
+}

+ 18 - 2
src/api/yfCostManage/basicDataSetting/workHoursRecords.js

@@ -32,8 +32,8 @@ export const update = (row) => {
 
 export const remove = (data) => {
   return request({
-    url: '/api/kd-scientific/xm/technician/hours/clear/batch',
-    method: 'post',
+    url: '/api/kd-scientific/xm/technician/hours/delete',
+    method: 'delete',
     data
   })
 }
@@ -55,3 +55,19 @@ export const syncToAccept = (data) => {
     data
   })
 }
+
+export const clearHours = data => {
+  return request({
+    url: '/api/kd-scientific/xm/technician/hours/clear/batch',
+    method: 'post',
+    data
+  })
+}
+
+export const feachProjectPersonList = (params) => {
+  return request({
+    url: '/api/kd-scientific/xm/technician/hours/fetch',
+    method: 'get',
+    params
+  })
+}

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

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

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

@@ -8,7 +8,7 @@ export default {
   index: true,
   selection: true,
   addBtn: false,
-  delBtnText: '清除工时数据',
+  // delBtnText: '清除工时数据',
   searchLabelWidth: 140,
   labelWidth: 100,
   menuWidth: 190,

+ 52 - 2
src/views/yf-cost-manage/basic-data-setting/atten-info.vue

@@ -15,7 +15,7 @@
           size="small"
           icon="el-icon-delete"
           plain
-          @click="handleDelete"
+          @click="handleClearAttendance"
         >
           清除考勤数据
         </el-button>
@@ -37,6 +37,23 @@
         >
           导出
         </el-button>
+        <el-button
+          type="primary"
+          size="small"
+          plain
+          @click="handleImportYfPerson"
+        >
+          引用当月研发人员名单
+        </el-button>
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删除
+        </el-button>
         <print-table-btn @click="printTable" />
         
       </template>
@@ -176,6 +193,22 @@ export default window.$crudCommon({
     }
   },
   methods: {
+    handleImportYfPerson() {
+      this.$confirm("确认引用单月研发人员名单吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.api.feachProjectPersonList({ yearAndMonth: this.params.yearAndMonth}).then(res => {
+          let data = res.data;
+          if (data.success) {
+            this.$message.success('引用成功!');
+            this.page.currentPage = 1;
+            this.getList(this.page);
+          }
+        });
+      });
+    },
     refreshTableCol(yearAndMonth) {
       const loading = this.$loading({
         lock: true,
@@ -281,7 +314,24 @@ export default window.$crudCommon({
       return {
         color
       }
-    }
+    },
+    handleClearAttendance() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确认要清除考勤数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.api.clearAttendance(this.getBatchDelParams()).then((data) => {
+            this.getList();
+            this.$message.success('清除成功');
+          });
+        });
+    },
   },
 }, {
   // 模块路径

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

@@ -232,7 +232,7 @@ export default window.$crudCommon({
         getLastMonthData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
           let data = res.data;
           if (data.success) {
-            this.$message.success('读取成功!');
+            this.$message.success('引用成功!');
             this.page.currentPage = 1;
             this.getList(this.page);
           }

+ 51 - 1
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -16,7 +16,7 @@
           size="small"
           icon="el-icon-delete"
           plain
-          @click="handleDelete"
+          @click="handleClearHours"
         >
           清除工时数据
         </el-button>
@@ -54,6 +54,23 @@
         >
           同步至本系统
         </el-button>
+        <el-button
+          type="primary"
+          size="small"
+          plain
+          @click="handleImportYfPerson"
+        >
+          引用当月研发人员名单
+        </el-button>
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删除
+        </el-button>
         <!-- <print-table-btn @click="printTable" /> -->
         
       </template>
@@ -412,6 +429,39 @@ export default window.$crudCommon({
         });
       });
     },
+    handleImportYfPerson() {
+      this.$confirm("确认引用单月研发人员名单吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.api.feachProjectPersonList({ yearAndMonth: this.params.yearAndMonth}).then(res => {
+          let data = res.data;
+          if (data.success) {
+            this.$message.success('引用成功!');
+            this.page.currentPage = 1;
+            this.getList(this.page);
+          }
+        });
+      });
+    },
+    handleClearHours() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确认要清除工时数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.api.clearHours(this.getBatchDelParams()).then((data) => {
+            this.getList();
+            this.$message.success('清除成功');
+          });
+        });
+    },
   },
 }, {
   // 模块路径