whh 9 ماه پیش
والد
کامیت
4d14073f5e
3فایلهای تغییر یافته به همراه135 افزوده شده و 38 حذف شده
  1. 21 1
      src/api/daily/index.js
  2. 76 8
      src/views/daily/config.js
  3. 38 29
      src/views/daily/index.vue

+ 21 - 1
src/api/daily/index.js

@@ -7,4 +7,24 @@ export function postDaily(data) {
     method: 'post',
     data: data
   })
-}
+}
+
+// 查询进30天的日期
+export function getRecentMsg() {
+  return request({
+    url: '/business/daily/getRecently30CountInfo',
+    method: 'get'
+  })
+}
+
+// 查询指定日期的日报
+export function getDetailByDay(params) {
+  return request({
+    url: `/business/daily/getDetailByDay`,
+    method: 'get',
+    params
+  })
+}
+
+
+

+ 76 - 8
src/views/daily/config.js

@@ -204,17 +204,17 @@ export const schema = {
     default: {
       list: [
         {
-          key: 'JSL',
+          key: 'jsl',
           label: '进水量',
           unit: '(m³/d)'
         },
         {
-          key: 'CSL',
+          key: 'csl',
           label: '出水量',
           unit: '(m³/d)'
         },
         {
-          key: 'SDCLCXSL',
+          key: 'sdclcxsl',
           label: '深度处理冲洗水量',
           unit: '(m³/d)'
         },
@@ -226,12 +226,12 @@ export const schema = {
     default: {
       list: [
         {
-          key: 'QSB',
+          key: 'qsb',
           label: '气水比',
           unit: '(m³/m³)'
         },
         {
-          key: 'fM',
+          key: 'fm',
           label: 'F/M',
           unit: '(kgBOD/kgMLSS·d)'
         },
@@ -269,16 +269,84 @@ export const schema = {
           unit: '(%)'
         },
         {
-          key: 'SRT',
+          key: 'srt',
           label: '污泥龄',
           unit: '(天)'
         },
         {
-          key: 'CNL',
+          key: 'cnl',
           label: '产泥率',
           unit: '(T/万吨)'
+        },
+        {
+          key: 'chuniliang',
+          label: '出泥量',
+          unit: '(m³)'
+        },
+        {
+          key: 'cnhsl',
+          label: '出泥含水率',
+          unit: '(%)'
+        },
+        {
+          key: 'gwnl',
+          label: '干污泥量',
+          unit: '(m³)'
+        }
+      ]
+    }
+  },
+  
+  cs: {
+    title: '成本指标',
+    default: {
+      list: [
+        {
+          key: 'c',
+          label: '电费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '絮凝剂费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '碳源费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '消毒剂费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '其他药剂费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '采暖费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '自来水费',
+          unit: '元'
+        },
+        {
+          key: 'c',
+          label: '直接成本',
+          unit: '元/天'
+        },
+        {
+          key: 'c',
+          label: '单位成本',
+          unit: '元/千吨'
         }
       ]
     }
-  }
+  },
 }

+ 38 - 29
src/views/daily/index.vue

@@ -1,6 +1,6 @@
 <script setup>
 import { schema } from './config.js';
-import { postDaily } from '@/api/daily';
+import { getRecentMsg, getDetailByDay, postDaily } from '@/api/daily';
 
 const { proxy } = getCurrentInstance();
 
@@ -11,32 +11,21 @@ const formData = ref({});
 
 const holidays = ref([])
 
-onMounted(() => {
-  
-  setTimeout(() => {
-
-    holidays.value = [
-      { testDate: '2024/06/01', exists: false },
-      { testDate: '2024/06/02', exists: false },
-      { testDate: '2024/06/03', exists: false },
-      { testDate: '2024/06/04', exists: false },
-      { testDate: '2024/06/05', exists: false },
-      { testDate: '2024/06/06', exists: true },
-      { testDate: '2024/06/07', exists: true }
-    ]
-
-  }, 2000);
-
-})
-
 const isHoliday = ({ dayjs }) => {
-  return holidays.value.find(({ testDate }) => dayjs.format('YYYY/MM/DD') === testDate)?.exists
+  return holidays.value.find(({ testDate }) => dayjs.format('YYYY/MM/DD') === testDate)?.exists;
 };
 
 const isExistData = computed(() => Object.keys(unref(formData)).length);
 
 
-// 提交数据
+const queryRecent = async () => {
+  
+  const { data } = await getRecentMsg();
+
+  holidays.value = data;
+}
+
+// btn - 提交数据
 const onSubmit = () => {
 
   if (!isExistData.value) {
@@ -44,34 +33,53 @@ const onSubmit = () => {
   }
 
   proxy.$modal.confirm('是否确认提交?').then(async () => {
-15
+
+    const dateTime = holidays.value.find(({ testDate: day }) => day === unref(testDate));
+
+    await postDaily({
+      id: dateTime?.id,
+      testDate: unref(testDate),
+      ...unref(formData)
+    });
+
+    queryRecent();
+    
     proxy.$modal.msgSuccess("提交成功");
 
     isVisible.value = !isVisible.value;
 
-    // await postDaily({testDate: unref(testDate), ...unref(formData)});
-
+    testDate.value = null;
   })
 }
 
-
-// 下一步
+// btn - 下一步
 const handleNextStep = async () => {
   if (!testDate.value) {
     return proxy.$modal.msgError("请先选择需要填写日报日期");
   }
+
+  const { data = {} } = await getDetailByDay({ testDate: unref(testDate) })
+
+  formData.value = data;
+
   isVisible.value = true;
 }
 
-// 上一步
+// btn - 上一步
 const onBackStep = async () => {
   if (isExistData.value) {
     return proxy.$modal.confirm('测到当前日报已填写,是否返回上一步?').then(function () {
       isVisible.value = false
     }).catch(() => {});
   }
+
   isVisible.value = false;
 }
+
+onMounted(async () => {
+  queryRecent();
+})
+
 </script>
 
 <template>
@@ -90,8 +98,9 @@ const onBackStep = async () => {
               <template #default="cell">
                 <div class="cell" :class="{ current: cell.isCurrent }">
                   <span class="text">{{ cell.text }}</span>
-                  <span v-if="isHoliday(cell) === false" class="holiday" />
-                  <span v-if="isHoliday(cell) === true" class="blue"></span>
+                    <el-tooltip :content="isHoliday(cell) ? '已填写' : '未填写'" placement="top" v-if="isHoliday(cell) !== undefined">
+                      <span :class="isHoliday(cell) ? 'blue' : 'holiday'" />
+                    </el-tooltip>
                 </div>
               </template>
             </el-date-picker>