Quellcode durchsuchen

质量月报 - 历史报告查看

wangggziwen vor 1 Jahr
Ursprung
Commit
447451a70b

+ 6 - 0
master/src/main/java/com/ruoyi/project/production/controller/TMonthlyQualityReportController.java

@@ -116,6 +116,12 @@ public class TMonthlyQualityReportController extends BaseController
     @Autowired
     private ITMonthlyQualityCommentService tMonthlyQualityCommentService;
 
+    @GetMapping("/yearMonth")
+    public AjaxResult yearMonth() {
+        String[] strings = tMonthlyQualityReportS0501Service.selectTMonthlyQualityReportYearMonth();
+        return AjaxResult.success(strings);
+    }
+
     /**
      * 批量删除
      */

+ 2 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TMonthlyQualityReportS0501Mapper.java

@@ -65,4 +65,6 @@ public interface TMonthlyQualityReportS0501Mapper
     public int deleteTMonthlyQualityReportS0501ByIds(Long[] ids);
 
     public void deleteTMonthlyQualityReportBranch(MonthlyQualityRemoveVO vo);
+
+    public String[] selectTMonthlyQualityReportYearMonth();
 }

+ 2 - 0
master/src/main/java/com/ruoyi/project/production/service/ITMonthlyQualityReportS0501Service.java

@@ -64,4 +64,6 @@ public interface ITMonthlyQualityReportS0501Service
     public int deleteTMonthlyQualityReportS0501ById(Long id);
 
     public void deleteTMonthlyQualityReportBranch(MonthlyQualityRemoveVO vo);
+
+    public String[] selectTMonthlyQualityReportYearMonth();
 }

+ 4 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TMonthlyQualityReportS0501ServiceImpl.java

@@ -21,6 +21,10 @@ public class TMonthlyQualityReportS0501ServiceImpl implements ITMonthlyQualityRe
     @Autowired
     private TMonthlyQualityReportS0501Mapper tMonthlyQualityReportS0501Mapper;
 
+    public String[] selectTMonthlyQualityReportYearMonth() {
+        return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportYearMonth();
+    }
+
     @Override
     public TMonthlyQualityReportS0501 selectTMonthlyQualityReportS0501ListMonth(TMonthlyQualityReportS0501 tMonthlyQualityReportS0501) {
         return tMonthlyQualityReportS0501Mapper.selectTMonthlyQualityReportS0501ListMonth(tMonthlyQualityReportS0501);

+ 6 - 1
master/src/main/resources/mybatis/production/TMonthlyQualityReportS0501Mapper.xml

@@ -238,5 +238,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="samplePoint == 23">update t_monthly_quality_report_s6301 set del_flag = 2 where sample_date &gt;= #{startDate} and sample_date &lt;= #{endDate}</if>
         <if test="samplePoint == 24">update t_monthly_quality_report_z404 set del_flag = 2 where sample_date &gt;= #{startDate} and sample_date &lt;= #{endDate}</if>
     </update>
-    
+
+    <select id="selectTMonthlyQualityReportYearMonth" resultType="String">
+        select distinct extract(year from t.SAMPLE_DATE)||'-'||extract(month from t.SAMPLE_DATE)
+        from T_MONTHLY_QUALITY_REPORT_S0501 t
+        where t.DEL_FLAG = 0
+    </select>
 </mapper>

+ 7 - 0
ui/src/api/production/quality.js

@@ -1,5 +1,12 @@
 import request from '@/utils/request'
 
+export function yearMonth() {
+  return request({
+    url: '/production/quality/yearMonth',
+    method: 'get'
+  })
+}
+
 // 批量删除
 export function removeQuality(query) {
   return request({

+ 6 - 0
ui/src/router/index.js

@@ -243,6 +243,12 @@ export const constantRoutes = [
         name: 'report',
         meta: { title: '生成报告' }
       },
+      {
+        path: 'quality/history',
+        component: (resolve) => require(['@/views/production/quality/history'], resolve),
+        name: 'history',
+        meta: { title: '历史报告查看' }
+      },
       {
         path: 'matrix',
         component: (resolve) => require(['@/views/production/matrix'], resolve),

+ 53 - 0
ui/src/views/production/quality/history.vue

@@ -0,0 +1,53 @@
+<template>
+  <div class="app-container">
+    <span v-for="(value, index) in dateList">
+      <el-link @click="handleReport(value)">{{value}}</el-link><br/>
+    </span>
+  </div>
+</template>
+
+<script>
+  import axios from 'axios';
+  import { treeselect } from "@/api/system/dept";
+  import { getToken } from "@/utils/auth";
+  import Treeselect from "@riophae/vue-treeselect";
+  import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+  import { yearMonth } from "@/api/production/quality";
+
+
+  export default {
+    name: "history.vue",
+    data(){
+      return {
+        dateList: [],
+        sampleDate: [
+          '2023-11-01',
+          '2023-11-30'
+        ],
+      }
+    },
+    created() {
+      yearMonth().then(response => {
+        this.dateList = response.data;
+      });
+    },
+    methods: {
+      handleReport(value) {
+        let array = value.split('-');
+        var date = new Date();
+        date.setFullYear(array[0]);
+        date.setMonth(array[1])
+        var firstDay = new Date(date.getFullYear(), date.getMonth() - 1, 1);
+        var lastDay = new Date(date.getFullYear(), date.getMonth(), 0);
+        let sampleDate = [
+          firstDay.getFullYear() + '-' + Number(firstDay.getMonth() + 1) + '-' + firstDay.getDate(),
+          lastDay.getFullYear() + '-' + Number(lastDay.getMonth() + 1) + '-' + lastDay.getDate()
+        ];
+        this.$router.push({
+          name: "report",
+          params: sampleDate
+        });
+      }
+    }
+  }
+</script>

+ 7 - 0
ui/src/views/production/quality/index.vue

@@ -49,6 +49,7 @@
           icon="el-icon-time"
           size="mini"
           v-hasPermi="['production:quality:list']"
+          @click="handleHistory"
         >历史报告查看</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -5568,6 +5569,12 @@ export default {
       this.analysisValue = "1";
       this.handleAnalysisQuery();
     },
+    /** 历史报告查看 */
+    handleHistory() {
+      this.$router.push({
+        name: "history",
+      });
+    },
     /** 生成报告 */
     handleReport(){
       this.$router.push({