فهرست منبع

feat: 报表相关逻辑调整

sunxiao 6 ماه پیش
والد
کامیت
01315e4940

+ 4 - 2
src/views/report/detection-month/index.vue

@@ -112,6 +112,7 @@ const handlerQuery = () => {
 const handlerReset = () => {
   datePickerValue.value = new Date();
   queryParams.value.activeRadioName = 'week';
+  queryParams.value.deviceNo = ''
   initPageData();
 }
 
@@ -119,11 +120,12 @@ const handleExport = () => {
   const dateResult = getStartTimeAndEndTime();
   proxy.getDownload("/business/exportContinuousAssayCountByDates", {
     ...dateResult,
+    deviceNo: queryParams.value.deviceNo
   }, `${new Date().getTime()}.xlsx`);
 }
 
 onMounted(async() => {
-  getDeviceList().then(({ data }) => {
+  getDeviceList({ type: 2 }).then(({ data }) => {
     // const [ item ] = data;
     // queryParams.value.deviceNo = item?.deviceNo;
     options.value = data
@@ -145,7 +147,7 @@ onMounted(async() => {
       <el-row class="pt-[5px]" justify="space-between" :gutter="20">
         <el-col :span="6">
           <el-form-item label="设备编号">
-            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable>
+            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable clearable>
               <el-option v-for="item in options" :key="item.deviceNo" :label="item.deviceName" :value="item.deviceNo" />
             </el-select>
           </el-form-item>

+ 13 - 10
src/views/report/laboratory-month/index.vue

@@ -5,7 +5,8 @@ import { getMonthTable, getDeviceList } from '@/api/report/lab';
 const { proxy } = getCurrentInstance();
 
 const queryParams = ref({
-  activeRadioName: 'week'
+  activeRadioName: 'week',
+  deviceNo: ''
 });
 
 const tableLoading = ref(false);
@@ -68,17 +69,17 @@ const columns = [
   {
     label: '亚硝酸盐',
     children: [
-      { label: "标称值", prop: 'name', width: 100 },
-      { label: "化验值", prop: 'name', width: 100 },
-      { label: "偏差度", prop: 'name', width: 100 }
+      { label: "标称值", prop: 'yxsyArrayCounts', width: 100 },
+      { label: "化验值", prop: 'yxsyPassedCounts', width: 100 },
+      { label: "偏差度", prop: 'yxsyDeviationRate', width: 100 }
     ]
   },
   {
     label: '正磷酸盐',
     children: [
-      { label: "质控次数", prop: 'yxsyArrayCounts', width: 100 },
-      { label: "质控合格数", prop: 'yxsyPassedCounts', width: 100 },
-      { label: "质控合格率", prop: 'yxsyDeviationRate', width: 100 }
+      { label: "质控次数", prop: 'zlsyArrayCounts', width: 100 },
+      { label: "质控合格数", prop: 'zlsyPassedCounts', width: 100 },
+      { label: "质控合格率", prop: 'zlsyDeviationRate', width: 100 }
     ]
   },
 ]
@@ -129,7 +130,8 @@ const handlerQuery = () => {
 
 const handlerReset = () => {
   datePickerValue.value = new Date();
-  queryParams.value.activeRadioName = 'week'
+  queryParams.value.activeRadioName = 'week';
+  queryParams.value.deviceNo = ''
 }
 
 const handleExport = () => {
@@ -138,11 +140,12 @@ const handleExport = () => {
 
   proxy.getDownload("/business/exportAssayCountListByDates", {
     ...dateResult,
+    deviceNo: queryParams.value.deviceNo
   }, `${new Date().getTime()}.xlsx`);
 }
 
 onMounted(() => {
-  getDeviceList().then(({ data }) => {
+  getDeviceList({type: 1}).then(({ data }) => {
     options.value = data
   });
   initPageData();
@@ -161,7 +164,7 @@ onMounted(() => {
       <el-row class="pt-[5px]" justify="space-between" :gutter="20">
         <el-col :span="6">
           <el-form-item label="设备编号">
-            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable>
+            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable clearable>
               <el-option v-for="item in options" :key="item.deviceNo" :label="item.deviceName" :value="item.deviceNo" />
             </el-select>
           </el-form-item>

+ 12 - 8
src/views/report/record/index.vue

@@ -12,6 +12,8 @@ const queryParams = ref({
 
 const datePieckerValue = ref([dayjs(new Date()).format('YYYY-MM-DD'), dayjs(new Date()).format('YYYY-MM-DD')]);
 
+let firstDeviceNo = '';
+
 const total = ref(0);
 const tableData = ref([]);
 const loading = ref(false);
@@ -113,10 +115,11 @@ const handleQuery = async() => {
 
 // 重置
 const handleReset = () => {
-  datePieckerValue.value = [];
-  queryParams.deviceNo.timeBegin = '';
-  queryParams.deviceNo.timeEnd = '';
-  queryParams.deviceNo.deviceNo = '';
+  datePieckerValue.value = [dayjs(new Date()).format('YYYY-MM-DD'), dayjs(new Date()).format('YYYY-MM-DD')];
+  queryParams.value.pageNum = 1;
+  queryParams.value.pageSize = 10;
+  queryParams.value.deviceNo = firstDeviceNo;
+  initPageData();
 }
 
 // 导出
@@ -129,13 +132,13 @@ const handleExport = () => {
 }
 
 onMounted(async () => {
-  await getDeviceList().then(({ data }) => {
+  await getDeviceList({tpye: 1}).then(({ data }) => {
     const [ item ] = data;
     queryParams.value.deviceNo = item?.deviceNo;
+    firstDeviceNo = item?.deviceNo;
     options.value = data
   });
-  
-  getDrawerData();
+  await initPageData();
 })
 </script>
 
@@ -150,7 +153,7 @@ onMounted(async () => {
       <el-row class="pt-[5px]" justify="space-between" :gutter="20">
         <el-col :span="6">
           <el-form-item label="设备编号">
-            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable>
+            <el-select v-model="queryParams.deviceNo" placeholder="请选择" filterable clearable>
               <el-option v-for="item in options" :key="item.deviceNo" :label="item.deviceName" :value="item.deviceNo" />
             </el-select>
           </el-form-item>
@@ -161,6 +164,7 @@ onMounted(async () => {
               <span class="font-bold">化验日期</span>
             </template>
             <el-date-picker
+              :clearable="false"
               v-model="datePieckerValue"
               type="daterange"
               range-separator="-"

+ 16 - 12
src/views/report/report-daily/index.vue

@@ -1,6 +1,6 @@
 <script setup>
 import { RecordDrawer } from '@/views/report/components';
-import { getHomeCounts, getWaterFactory, getDailyTable } from '@/api/report/lab';
+import { getHomeCounts, getWaterFactory, getDailyTable, getDeviceList } from '@/api/report/lab';
 import { dayjs } from 'element-plus';
 
 const route = useRoute();
@@ -33,7 +33,8 @@ const queryParams = ref({
   assayStatus: '',
   assayDate: dayjs().format("YYYY-MM-DD"),
   // assayDate: '2024-08-13',
-  worksId: null,
+  // worksId: null,
+  deviceNo: '',
   type: 1,
   pageNum: 1,
   pageSize: 10
@@ -85,20 +86,23 @@ const handleTableBtnClick = async (row) => {
 onMounted( async () => {
   const { type } = route.query;
 
-  initPageData();
+  queryParams.value.type = type;
 
+  initPageData();
+  
   const { data } = await getHomeCounts(type);
-  const { data: waterFactoryData } = await getWaterFactory();
+  const { data: deviceData } = await getDeviceList({ type });
 
   pageCountNums.value = {
     ...data,
     passAssayRates: Number(data.passAssayRates.slice(0, -1))
   };
-  selectOptions.value = waterFactoryData;
-  queryParams.value.type = type;
+  
+  selectOptions.value = deviceData;
+  
 
   currentDateTime.value = dayjs(new Date()).format('YYYY-MM-DD hh:mm:ss');
-  
+
 })
 
 </script>
@@ -215,18 +219,18 @@ onMounted( async () => {
               @change="handleDatePickerChange"
             />
             <el-select
-              placeholder="选择水厂"
+              placeholder="选择设备"
               style="width: 220px"
               clearable
               filterable
-              v-model="queryParams.worksId"
+              v-model="queryParams.deviceNo"
               @change="handleSelectChange"
             >
               <el-option
                 v-for="item in selectOptions"
-                :key="item.worksId"
-                :label="item.worksName"
-                :value="item.worksId"
+                :key="item.deviceNo"
+                :label="item.deviceName"
+                :value="item.deviceNo"
               />
             </el-select>
           </div>