Przeglądaj źródła

月报汇总修改

duy 1 rok temu
rodzic
commit
b072ef61ea
1 zmienionych plików z 51 dodań i 57 usunięć
  1. 51 57
      src/views/tentative/collect/monthly.vue

+ 51 - 57
src/views/tentative/collect/monthly.vue

@@ -42,7 +42,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_collect_monthly_print">
-                        <el-button hc-btn color="#567722">
+                        <el-button hc-btn color="#567722" @click="print">
                             <HcIcon name="printer" />
                             <span>打印</span>
                         </el-button>
@@ -105,7 +105,7 @@ import queryApi from '~api/data-fill/query'
 import { calcDate, getArrValue } from 'js-fast-way'
 import { getDictionary } from '~api/other'
 import samplingApi from '~api/tentative/material/sampling'
-import { getMonthPage } from '~api/tentative/collect/month'
+import { editRemark, getMonthPage } from '~api/tentative/collect/month'
 import { isExactlyOneMonthApart } from '~uti/tools'
 
 const useAppState = useAppStore()
@@ -217,14 +217,13 @@ const betweenTime = ref(null)
 const betweenTimeUpdate = ({ arr, query }) => {
     const date1 = new Date(arr[0])
     const date2 = new Date(arr[1])
-
      // 计算两个日期的月份差
-     const monthDiff = isExactlyOneMonthApart(date1, date2)
-     console.log(monthDiff, 'monthDiff')
-     if (!monthDiff) {
-        window.$message.warning('起始时间必须为1个月')
-        return
-     }
+    //  const monthDiff = isExactlyOneMonthApart(date1, date2)
+    //  console.log(monthDiff, 'monthDiff')
+    //  if (!monthDiff) {
+    //     window.$message.warning('起始时间必须为1个月')
+    //     return
+    //  }
 
     betweenTime.value = arr
     searchForm.value.startTime = arr[0]
@@ -265,69 +264,53 @@ const tableSpanMethod = ({ rowIndex, columnIndex }) => {
 
 //获取数据
 const tableLoading = ref(false)
-const tableData = ref([
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '本月',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '累计',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '本月',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '累计',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '本月',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-    {
-        title: 'No. 189, Grove St, Los Angeles',
-        month: '累计',
-        name: '100',
-        state: '2',
-        zip: 'CA 90036',
-    },
-])
+const tableData = ref([])
 const getTableData = async () => {
     if (!searchForm.value.type) {
         window.$message.warning('请选择检查类别')
         return
-    } else if (!!searchForm.value.startTime || !searchForm.value.endTime) {
+    } else if (!searchForm.value.startTime || !searchForm.value.endTime) {
         window.$message.warning('请选择开始时间和结束时间')
         return
     } else if (searchForm.value.ids) {
         window.$message.warning('请选择试验检测项目名称')
         return
     }
+    tableLoading.value = true
     const { error, code, data } = await getMonthPage({
             ...searchForm.value,
+            ids:'1635200237830144002',
             contractId:contractId.value,
         })
+        tableLoading.value = false
         //判断状态
         if (!error && code === 200) {
             let resdata = getArrValue(data['records'])
-        tableData.value = resdata
+        let arr = []
+        resdata.forEach((ele)=>{
+            let obj1 = {
+                title:ele.trialProjectName,
+                month: '本月',
+                name: ele.currentMonth.qualifiedTotal,
+                state: ele.currentMonth.unQualifiedTotal,
+                zip:  ele.currentMonth.remarks,
+
+            }
+            let obj2 = {
+                title:ele.trialProjectName,
+                month: '累计',
+                name: ele.totalMonth.qualifiedTotal,
+                state: ele.totalMonth.unQualifiedTotal,
+                zip:  ele.totalMonth.remarks,
+
+            }
+            arr.push(obj1)
+            arr.push(obj2)
+             tableData.value = arr
+             searchForm.value.total = data['total']
+        })
+  
+   
 
         } else {
             tableData.value = []
@@ -344,8 +327,19 @@ const editorsNoteModalClick = (row) => {
 
 //保存
 const editorsNoteLoading = ref(false)
-const editorsNoteModalSave = () => {
-    editorsNoteModal.value = true
+const editorsNoteModalSave = async (id) => {
+    // editorsNoteModal.value = true
+    const { error, code, data, msg } = await editRemark({
+        contractId: contractId.value,
+        recordId: id,
+        remarks:editorsNoteVal.value,
+      
+    })
+    //判断状态
+    if (!error && code === 200) {
+     window.$message.success(msg)
+     editorsNoteModal.value = false
+    }
 }
 const editorsNoteModalClose = () => {
     editorsNoteModal.value = false