Browse Source

每月研发工时打卡增加数据同步功能

ljb 7 months ago
parent
commit
621e941c07

+ 16 - 0
src/api/yfCostManage/basicDataSetting/workHoursRecords.js

@@ -37,3 +37,19 @@ export const remove = (data) => {
     data
     data
   })
   })
 }
 }
+
+export const syncBaseData = (data) => {
+  return request({
+    url: '/api/kd-scientific/xm/technician/hours/sync',
+    method: 'post',
+    data
+  })
+}
+
+export const syncWorkingHours = (data) => {
+  return request({
+    url: '/api/kd-scientific/xm/technician/hours/sync/basic-info',
+    method: 'post',
+    data
+  })
+}

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

@@ -38,6 +38,22 @@
         >
         >
           导出
           导出
         </el-button>
         </el-button>
+        <el-button
+          type="primary"
+          size="small"
+          plain
+          @click="handleSyncData(1)"
+        >
+          同步基础数据至工时系统
+        </el-button>
+        <el-button
+          type="primary"
+          size="small"
+          plain
+          @click="handleSyncData(2)"
+        >
+          同步工时数据至工时系统
+        </el-button>
         <!-- <print-table-btn @click="printTable" /> -->
         <!-- <print-table-btn @click="printTable" /> -->
         
         
       </template>
       </template>
@@ -363,7 +379,28 @@ export default window.$crudCommon({
       return {
       return {
         color
         color
       }
       }
-    }
+    },
+    handleSyncData(type) {
+      let obj = {
+        1: {
+          message: '确认要将基础数据同步到工时系统吗?',
+          method: this.api.syncBaseData
+        },
+        2: {
+          message: '确认要将工时数据同步到工时系统吗?',
+          method: this.api.syncWorkingHours
+        }
+      };
+      this.$confirm(obj[type].message, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        obj[type].method({ yearAndMonth: this.params.yearAndMonth }).then(() => {
+          this.$message.success('同步成功!');
+        })
+      });
+    },
   },
   },
 }, {
 }, {
   // 模块路径
   // 模块路径