From 1c20c8231980a8d4b91688ff8641a06d3b2f68ab Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 14 十月 2025 16:34:22 +0800
Subject: [PATCH] 改bug

---
 admin/src/views/statistics/platformRecord.vue |  205 ++++++++++++++++++++++++++++++++------------------
 1 files changed, 131 insertions(+), 74 deletions(-)

diff --git a/admin/src/views/statistics/platformRecord.vue b/admin/src/views/statistics/platformRecord.vue
index 4053fb3..3901acd 100644
--- a/admin/src/views/statistics/platformRecord.vue
+++ b/admin/src/views/statistics/platformRecord.vue
@@ -1,130 +1,187 @@
 <template>
   <div class="main_app">
-    <QueryForm
-      v-model="filters"
-      :query-form-config="queryFormConfig"
-      @handleQuery="getList(1)"
-      @clear="clear"
-    />
-    <el-table v-loading="loading" :data="list" stripe>
-      <el-table-column
-        prop="name"
-        label="鏈堝彴鍚嶇О"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="鏈堝彴缁�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="杞﹀墠鐗岀収鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="杞﹀悗鐗岀収鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟寮�濮�"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟缁撴潫"
-        min-width="100"
-        show-overflow-tooltip
-      />
-      <el-table-column
-        prop="name"
-        label="浣滀笟鏃堕暱"
-        min-width="100"
-        show-overflow-tooltip
-      /><el-table-column
-        prop="name"
-        label="杩愯緭鍗曞彿/鍚堝悓鍙�"
-        min-width="100"
-        show-overflow-tooltip
-      />
+    <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear">
+      <template #selDate>
+        <div>
+          <el-date-picker v-model="filters.beginWorkDateStart"  type="date" value-format="yyyy-MM-dd" class="w200"
+            @change="getList(1)" />
+          <el-date-picker v-model="filters.beginWorkDateEnd" type="date" value-format="yyyy-MM-dd" class="w200"
+            @change="getList(1)" />
+        </div>
+      </template>
+      <template #fastdate>
+        <el-radio-group v-model="filters.fastdate" size="small" @input="changeRadio">
+          <el-radio-button label="0">褰撳ぉ</el-radio-button>
+          <el-radio-button label="6">杩�7澶�</el-radio-button>
+          <el-radio-button label="29">杩�30澶�</el-radio-button>
+        </el-radio-group>
+      </template>
+    </QueryForm>
+    <el-table :height="tableHeightNew" v-loading="loading" :data="list" stripe>
+      <el-table-column prop="platformName" label="鏈堝彴鍚嶇О" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="platformGroupName" label="鏈堝彴缁�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="carCodeFront" label="杞﹀墠鐗岀収鍙�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="carCodeBack" label="杞﹀悗鐗岀収鍙�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="param1" label="浣滀笟寮�濮�" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="param2" label="浣滀笟缁撴潫" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="workTime" label="浣滀笟鏃堕暱" min-width="100" show-overflow-tooltip />
+      <el-table-column prop="name" label="杩愯緭鍗曞彿/鍚堝悓鍙�" min-width="100" show-overflow-tooltip>
+        <template v-slot="scope">
+          <span>{{ scope.row.billCode || scope.row.contractNum }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column prop="totalNum" label="鎬讳綔涓氶噺(涓囨敮)" min-width="100" show-overflow-tooltip />
     </el-table>
-    <pagination
-      @size-change="handleSizeChange"
-      @current-change="getList"
-      :pagination="pagination"
-    />
+    <div class="mt20">
+      <Pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" />
+    </div>
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/common/Pagination'
 import QueryForm from '@/components/common/QueryForm'
+import dayjs from 'dayjs'
+import duration from 'dayjs/plugin/duration'
+import { platformLogPage, getPlatformGroupList } from '@/api'
+import BaseComputHeight from '@/components/base/BaseComputHeight'
+dayjs.extend(duration)
 export default {
+  extends: BaseComputHeight,
   components: {
     Pagination,
     QueryForm
   },
-  data () {
+  data() {
     return {
       loading: false,
       pagination: {
-        capacity: 10,
-        page: 1
+        pageSize: 10,
+        page: 1,
+        total: 0
       },
-      filters: {},
+      filters: {
+        fastdate: 0,
+        beginWorkDateStart: '',
+        beginWorkDateEnd: ''
+      },
       list: [],
       total: 0,
       queryFormConfig: {
         formItems: [
           {
-            filed: 'aaaa',
+            filed: 'platformName',
             type: 'input',
             label: '鏈堝彴鍚嶇О'
           },
           {
-            filed: 'bbb',
+            filed: 'platformGroupId',
             type: 'select',
             label: '鏈堝彴缁�',
+            placeholder: '鍏ㄩ儴鏈堝彴缁�',
             options: []
           },
           {
-            filed: 'aaaa',
+            filed: 'carCodeFront',
             type: 'input',
             label: '杞︾墝鍙�'
           },
           {
+            type: 'slot',
             filed: 'selDate',
-            type: 'daterange',
             label: '鏃ユ湡'
-          }
+          },
+          {
+            type: 'slot',
+            filed: 'fastdate',
+            label: ''
+          },
         ],
         online: true
       }
     }
   },
+  created() {
+    // this.getList()
+    this.getGroupList()
+    this.changeRadio('0')
+  },
   methods: {
-    handleSub () {
+    changeRadio(day) {
+      const arr = [dayjs().subtract(day, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
+      this.filters.beginWorkDateStart = arr[0]
+      this.filters.beginWorkDateEnd = arr[1]
+      this.filters.fastdate = day
+      this.getList()
+    },
+    handleSub() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           alert('submit!')
         }
       })
     },
-    getList (page) { },
-    clear () { },
-    handleSizeChange (capacity) {
-      this.pagination.capacity = capacity
+    getGroupList() {
+      getPlatformGroupList({ queryData: 0, queryType: 0 }).then(res => {
+        this.queryFormConfig.formItems[1].options = res.map(i => {
+          return {
+            value: i.id,
+            label: i.name
+          }
+        })
+        // this.queryFormConfig.formItems[1].options.unshift({ value: '', label: '鍏ㄩ儴鏈堝彴缁�' })
+      })
+    },
+    getList(page) {
+      const { pagination, filters } = this
+      this.loading = true
+
+      platformLogPage({
+        model: {
+          ...filters,
+          queryStatus: '6,7,8',
+          // beginWorkDateStart: filters.selDate && filters.selDate.length > 0 ? filters.selDate[0] : null,
+          // beginWorkDateEnd: filters.selDate && filters.selDate.length > 0 ? filters.selDate[1] : null,
+        },
+        sorts: [{ direction: 'DESC', property: 'param1' }],
+        capacity: pagination.pageSize,
+        page: page || pagination.page,
+      }).then(res => {
+        this.loading = false
+        this.list = res.records || []
+        this.list.forEach(item => {
+          item.inTypeTemp = item.inType == 0 ? '鏁存墭鐩�' : '浠剁儫'
+          item.taskOrigin = 'WMS鑾峰彇'
+          // item.workTime = dayjs.duration(item.param3, 'seconds').format('H鏃秏鍒唖绉�')
+          if (item.param3 > 3600) {
+            item.workTime = Math.ceil(item.param3 / 3600) + '鏃�' + Math.ceil(Math.ceil(item.param3 % 3600) / 60) + '鍒�' + item.param3 % 60 + '绉�'
+          } else if (item.param3 > 60) {
+            item.workTime = Math.ceil(item.param3 / 60) + '鍒�' + item.param3 % 60 + '绉�'
+          } else {
+            item.workTime = item.param3 + '绉�'
+          }
+        })
+        this.pagination.total = res.total || 0
+      }, () => {
+        this.loading = false
+      })
+    },
+    clear() {
+      this.filters = {}
+      this.pagination.pageSize = 10
+      this.pagination.page = 1
+      this.getList()
+    },
+    handleSizeChange(capacity) {
+      this.pagination.pageSize = capacity
+      this.getList(1)
     }
   }
 }
 </script>
 
-<style>
+<style scoped>
+::v-deep .el-table {
+  margin-bottom: 60px;
+}
 </style>

--
Gitblit v1.9.3