Browse Source

优化界面样式,技术花名册增加读取上个月功能

ljb 11 months ago
parent
commit
e48452dc55

+ 10 - 1
src/api/technicianRoster.js

@@ -12,7 +12,6 @@ export const getList = (current, size, params) => {
   })
   })
 }
 }
 
 
-
 export const add = (row) => {
 export const add = (row) => {
   return request({
   return request({
     url: '/api/kd-scientific/technician/save',
     url: '/api/kd-scientific/technician/save',
@@ -40,3 +39,13 @@ export const remove = (ids) => {
     }
     }
   })
   })
 }
 }
+
+export const getLastMonthData = params => {
+  return request({
+    url: '/api/kd-scientific/technician/page',
+    method: 'get',
+    params: {
+      ...params,
+    }
+  })
+}

+ 2 - 2
src/components/year-month-select/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="year-month-select">
   <div class="year-month-select">
-    <div class="year-warp" style="width: 120px">
+    <div class="year-warp" style="width: 95px">
       <el-date-picker
       <el-date-picker
         v-model="year"
         v-model="year"
         type="year"
         type="year"
@@ -97,7 +97,7 @@ export default {
   display: flex;
   display: flex;
   margin-left: 12px;
   margin-left: 12px;
   &-item {
   &-item {
-    width: 60px;
+    width: 40px;
     height: 30px;
     height: 30px;
     line-height: 30px;
     line-height: 30px;
     text-align: center;
     text-align: center;

+ 11 - 3
src/styles/element-ui.scss

@@ -70,15 +70,23 @@
   margin: 12px 0 !important;
   margin: 12px 0 !important;
 }
 }
 
 
-.el-table--small .el-table__cell {
+.el-table .el-table__header .el-table__cell {
   padding: 4px 0;
   padding: 4px 0;
 }
 }
 
 
+.el-table .el-table__body .el-table__cell {
+  padding: 0 0;
+}
+
 .el-table .cell .el-tag {
 .el-table .cell .el-tag {
-  height: 24px !important;
-  line-height: 22px !important;
+  height: 22px !important;
+  line-height: 20px !important;
 }
 }
 
 
 .avue-crud__search .avue-form, .avue-form__group .el-col {
 .avue-crud__search .avue-form, .avue-form__group .el-col {
   margin-bottom: 0;
   margin-bottom: 0;
+}
+
+.avue-crud__search .el-form-item--mini.el-form-item, .avue-crud__search .el-form-item--small.el-form-item {
+  margin-bottom: 9px;
 }
 }

+ 22 - 2
src/views/technician-roster/index.vue

@@ -66,6 +66,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+import { getLastMonthData } from "@/api/technicianRoster";
 import {exportBlob} from "@/api/common";
 import {exportBlob} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import YearMonthSelect from "@/components/year-month-select";
 import moment from "moment";
 import moment from "moment";
@@ -169,7 +170,7 @@ export default window.$crudCommon({
     uploadAfter(res, done, loading, column) {
     uploadAfter(res, done, loading, column) {
       this.excelBox = false;
       this.excelBox = false;
       this.page.currentPage = 1;
       this.page.currentPage = 1;
-      this.onLoad(this.page);
+      this.getList(this.page);
       done();
       done();
     },
     },
     handleExport() {
     handleExport() {
@@ -192,7 +193,26 @@ export default window.$crudCommon({
       // });
       // });
     },
     },
     handleReadyLastMonData() {
     handleReadyLastMonData() {
-      this.$message.warning("功能建设中...");
+      if (this.isSelAnnual) {
+        this.$message.warning("请选择月份");
+        return;
+      }
+      
+      this.$confirm("确认要读取上个月的数据吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        let lastMonth = moment(this.yearAndMonth).subtract(1, 'months').format("YYYY-MM");
+        getLastMonthData({ yearAndMonth: lastMonth}).then(res => {
+          let data = res.data;
+          if (data.success) {
+            this.$message.success('读取成功!');
+            this.page.currentPage = 1;
+            this.getList(this.page);
+          }
+        });
+      });
     },
     },
   },
   },
 }, {
 }, {