Browse Source

Merge remote-tracking branch 'origin/master'

lipenghui 1 month ago
parent
commit
4ecef9fb79

+ 2 - 2
src/router/modules/remaining.ts

@@ -186,7 +186,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
         }
         }
       },
       },
       {
       {
-        path: 'template/detail/:deptId/:orderStatus',
+        path: 'template/detail/:deptId/:orderStatus/:createTime*',
         component: () => import('@/views/pms/iotopeationfill/index.vue'),
         component: () => import('@/views/pms/iotopeationfill/index.vue'),
         name: 'FillOrderInfo1',
         name: 'FillOrderInfo1',
         meta: {
         meta: {
@@ -198,7 +198,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
         }
         }
       },
       },
       {
       {
-        path: 'template/detail/:deptId/:isFill',
+        path: 'template/detail/:deptId/:isFill/:createTime*',
         component: () => import('@/views/pms/iotopeationfill/StatisticsForm.vue' +
         component: () => import('@/views/pms/iotopeationfill/StatisticsForm.vue' +
         ''),
         ''),
         name: 'FillOrderInfo2',
         name: 'FillOrderInfo2',

+ 112 - 89
src/views/pms/iotmainworkorder/DeviceAlarmBomList.vue

@@ -1,89 +1,71 @@
 <template>
 <template>
   <Dialog v-model="dialogVisible"
   <Dialog v-model="dialogVisible"
           :title="t('monitor.details')"
           :title="t('monitor.details')"
-          style="width: 1500px; max-height: 800px" @close="handleClose" >
-    <ContentWrap>
-      <el-table
-        v-loading="loading"
-        :data="list"
-        :stripe="true"
-        :show-overflow-tooltip="true"
-      >
-        <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
-        <el-table-column :label="t('iotDevice.name')" align="center" prop="deviceName" />
-        <el-table-column :label="t('operationFillForm.sumTime')" align="center" prop="totalRunTime" />
-        <el-table-column :label="t('operationFillForm.sumKil')" align="center" prop="totalMileage" />
-        <el-table-column :label="t('mainPlan.MaintItems')" align="center" prop="name" />
-        <!--
-        <el-table-column label="运行里程" align="center" prop="mileageRule" >
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.mileageRule"
-              :active-value="0"
-              :inactive-value="1"
-              :disabled="true"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="运行时间" align="center" prop="runningTimeRule" >
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.runningTimeRule"
-              :active-value="0"
-              :inactive-value="1"
-              :disabled="true"
-            />
-          </template>
-        </el-table-column>
-        <el-table-column label="自然日期" align="center" prop="naturalDateRule" >
-          <template #default="scope">
-            <el-switch
-              v-model="scope.row.naturalDateRule"
-              :active-value="0"
-              :inactive-value="1"
-              :disabled="true"
-            />
-          </template>
-        </el-table-column> -->
+          style="width: 1500px"
+          class="fixed-height-dialog"
+          @close="handleClose" >
+      <ContentWrap>
+        <!-- 添加表格容器并设置滚动 -->
+        <el-table
+          v-loading="loading"
+          :data="paginatedList"
+          :stripe="true"
+          :show-overflow-tooltip="true"
+          style="width: 100%"
+          height="100%"
+          class="scrollable-table"
+        >
+          <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
+          <el-table-column :label="t('iotDevice.name')" align="center" prop="deviceName" />
+          <el-table-column :label="t('operationFillForm.sumTime')" align="center" prop="totalRunTime" >
+            <template #default="{ row }">
+              {{ row.totalRunTime ?? row.tempTotalRunTime }}
+            </template>
+          </el-table-column>
+          <el-table-column :label="t('operationFillForm.sumKil')" align="center" prop="totalMileage" >
+            <template #default="{ row }">
+              {{ row.totalMileage ?? row.tempTotalMileage }}
+            </template>
+          </el-table-column>
+          <el-table-column :label="t('mainPlan.MaintItems')" align="center" prop="name" />
 
 
-        <template v-if="showTimeColumns">
-          <el-table-column :label="t('mainPlan.lastMaintenanceOperationTime')" align="center" prop="lastRunningTime" />
-          <el-table-column :label="t('mainPlan.RunTimeCycle')" align="center" prop="nextRunningTime" />
-          <el-table-column :label="t('mainPlan.nextMaintTime')" align="center" prop="timePeriod" />
-        </template>
+          <template v-if="showTimeColumns">
+            <el-table-column :label="t('mainPlan.lastMaintenanceOperationTime')" align="center" prop="lastRunningTime" />
+            <el-table-column :label="t('mainPlan.RunTimeCycle')" align="center" prop="nextRunningTime" />
+            <el-table-column :label="t('mainPlan.nextMaintTime')" align="center" prop="timePeriod" />
+          </template>
 
 
-        <template v-if="showMileageColumns">
-          <el-table-column :label="t('mainPlan.lastMaintenanceMileage')" align="center" prop="lastRunningKilometers" />
-          <el-table-column :label="t('mainPlan.operatingMileageCycle')" align="center" prop="nextRunningKilometers" />
-          <el-table-column :label="t('mainPlan.nextMaintKil')" align="center" prop="kilometerCycle" />
-        </template>
+          <template v-if="showMileageColumns">
+            <el-table-column :label="t('mainPlan.lastMaintenanceMileage')" align="center" prop="lastRunningKilometers" />
+            <el-table-column :label="t('mainPlan.operatingMileageCycle')" align="center" prop="nextRunningKilometers" />
+            <el-table-column :label="t('mainPlan.nextMaintKil')" align="center" prop="kilometerCycle" />
+          </template>
 
 
-        <template v-if="showNaturalDateColumns">
-          <el-table-column :label="t('mainPlan.lastMaintenanceOperationTime')" align="center" prop="lastNaturalDate"  width="220">
-            <template #default="scope">
-              <el-date-picker
-                v-model="scope.row.lastNaturalDate"
-                type="date"
-                placeholder="选择日期"
-                format="YYYY-MM-DD"
-                value-format="YYYY-MM-DD"
-                style="width: 60%"
-                :disabled="true"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column :label="t('mainPlan.NaturalDailyCycle')" align="center" prop="nextNaturalDate" />
-          <el-table-column :label="t('mainPlan.nextMaintDate')" align="center" prop="naturalDatePeriod" />
-        </template>
-      </el-table>
-      <!-- 分页
-      <Pagination
-        :total="total"
-        v-model:page="queryParams.pageNo"
-        v-model:limit="queryParams.pageSize"
-        @pagination="getList"
-      /> -->
-    </ContentWrap>
+          <template v-if="showNaturalDateColumns">
+            <el-table-column :label="t('mainPlan.lastMaintenanceOperationTime')" align="center" prop="lastNaturalDate"  width="220">
+              <template #default="scope">
+                <el-date-picker
+                  v-model="scope.row.lastNaturalDate"
+                  type="date"
+                  placeholder="选择日期"
+                  format="YYYY-MM-DD"
+                  value-format="YYYY-MM-DD"
+                  style="width: 60%"
+                  :disabled="true"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column :label="t('mainPlan.NaturalDailyCycle')" align="center" prop="nextNaturalDate" />
+            <el-table-column :label="t('mainPlan.nextMaintDate')" align="center" prop="naturalDatePeriod" />
+          </template>
+        </el-table>
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="handlePagination"
+        />
+      </ContentWrap>
   </Dialog>
   </Dialog>
 </template>
 </template>
 
 
@@ -121,6 +103,18 @@ const selectRow = (row) => {
   dialogVisible.value = false
   dialogVisible.value = false
 }
 }
 
 
+// 分页事件处理
+const handlePagination = () => {
+  console.log("分页变化,当前页:", queryParams.pageNo);
+};
+
+// 分页计算属性
+const paginatedList = computed(() => {
+  const start = (queryParams.pageNo - 1) * queryParams.pageSize;
+  const end = start + queryParams.pageSize;
+  return list.value.slice(start, end);
+});
+
 const open = async (id?: number, flag?: string, deviceId?: number) => {
 const open = async (id?: number, flag?: string, deviceId?: number) => {
   await nextTick() // 确保DOM更新完成
   await nextTick() // 确保DOM更新完成
   queryParams.deviceId = deviceId
   queryParams.deviceId = deviceId
@@ -187,7 +181,7 @@ const getPlanList = async () => {
       item.naturalDatePeriod = calculateNextNaturalDate(item)
       item.naturalDatePeriod = calculateNextNaturalDate(item)
     })
     })
     list.value = data
     list.value = data
-    total.value = data.total
+    total.value = data.length
   } finally {
   } finally {
     loading.value = false
     loading.value = false
   }
   }
@@ -241,17 +235,17 @@ const calculateNextNaturalDate = (item: IotMaintenanceBomVO): string => {
 
 
 // 新增计算属性:控制时间相关列的显示
 // 新增计算属性:控制时间相关列的显示
 const showTimeColumns = computed(() => {
 const showTimeColumns = computed(() => {
-  return list.value.some(item => item.runningTimeRule === 0);
+  return paginatedList.value.some(item => item.runningTimeRule === 0);
 });
 });
 
 
 // 新增计算属性:控制里程相关列的显示
 // 新增计算属性:控制里程相关列的显示
 const showMileageColumns = computed(() => {
 const showMileageColumns = computed(() => {
-  return list.value.some(item => item.mileageRule === 0);
+  return paginatedList.value.some(item => item.mileageRule === 0);
 });
 });
 
 
 // 新增计算属性:自然日期相关列的显示
 // 新增计算属性:自然日期相关列的显示
 const showNaturalDateColumns = computed(() => {
 const showNaturalDateColumns = computed(() => {
-  return list.value.some(item => item.naturalDateRule === 0);
+  return paginatedList.value.some(item => item.naturalDateRule === 0);
 });
 });
 
 
 /** 搜索按钮操作 */
 /** 搜索按钮操作 */
@@ -270,11 +264,40 @@ const resetQuery = () => {
 }
 }
 
 
 </script>
 </script>
-<style lang="scss">
-.no-label-radio .el-radio__label {
-  display: none;
+
+<style lang="scss" scoped>
+/* 新版CSS解决方案 */
+.fixed-height-dialog :deep(.el-dialog) {
+  width: 1500px !important; /* 合并原内联样式 */
+  height: 800px !important; /* 关键:固定高度 */
+  display: flex;
+  flex-direction: column;
 }
 }
-.no-label-radio .el-radio__inner {
-  margin-right: 0;
+
+.fixed-height-dialog :deep(.el-dialog__header) {
+  padding: 20px;
+  flex-shrink: 0; /* 防止标题栏压缩 */
+}
+
+.fixed-height-dialog :deep(.el-dialog__body) {
+  flex: 1;
+  overflow: hidden; /* 隐藏外层滚动 */
+  padding: 10px 20px; /* 适当内边距 */
+}
+
+/* 表格滚动核心 */
+.scrollable-table {
+  height: 100% !important;
+
+  :deep(.el-table__body-wrapper) {
+    overflow-y: auto !important;
+    max-height: calc(100% - 40px); /* 扣除表头高度 */
+  }
+
+  :deep(.el-table__header-wrapper) {
+    position: sticky;
+    top: 0;
+    z-index: 10;
+  }
 }
 }
 </style>
 </style>

+ 5 - 1
src/views/pms/iotopeationfill/StatisticsForm.vue

@@ -18,7 +18,7 @@
           <el-form-item label="查询条件" prop="orderName">
           <el-form-item label="查询条件" prop="orderName">
             <el-input
             <el-input
               v-model="queryParams.orderName"
               v-model="queryParams.orderName"
-              placeholder="请输入设备负责人"
+              placeholder="请输入查询条件"
               clearable
               clearable
               @keyup.enter="handleQuery"
               @keyup.enter="handleQuery"
               class="!w-240px"
               class="!w-240px"
@@ -115,6 +115,7 @@ const total = ref(0) // 列表的总页数
 const { params, name } = useRoute() // 查询参数
 const { params, name } = useRoute() // 查询参数
 const deptId = params.deptId;
 const deptId = params.deptId;
 const isFill = params.isFill;
 const isFill = params.isFill;
+const createTime = params.createTime;
 const dialogVisible = ref(false) // 弹窗的是否展示
 const dialogVisible = ref(false) // 弹窗的是否展示
 const dialogTitle = ref('') // 弹窗的标题
 const dialogTitle = ref('') // 弹窗的标题
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
@@ -232,6 +233,9 @@ onMounted(async () => {
       queryParams.isFill = isFill;
       queryParams.isFill = isFill;
     }
     }
   }
   }
+  if(createTime){
+    queryParams.createTime = createTime;
+  }
   getList()
   getList()
   deptList.value = handleTree(await DeptApi.getSimpleDeptList());
   deptList.value = handleTree(await DeptApi.getSimpleDeptList());
 })
 })

+ 4 - 0
src/views/pms/iotopeationfill/index.vue

@@ -170,6 +170,7 @@ const { push } = useRouter()
 const { params, name } = useRoute() // 查询参数
 const { params, name } = useRoute() // 查询参数
 const deptId= params.deptId;
 const deptId= params.deptId;
 const orderStatus = params.orderStatus;
 const orderStatus = params.orderStatus;
+const createTime = params.createTime;
 /** 巡检工单 列表 */
 /** 巡检工单 列表 */
 defineOptions({ name: 'IotOpeationFill' })
 defineOptions({ name: 'IotOpeationFill' })
 
 
@@ -288,6 +289,9 @@ onMounted(() => {
   if(orderStatus != null && orderStatus != 3){
   if(orderStatus != null && orderStatus != 3){
     queryParams.orderStatus = orderStatus;
     queryParams.orderStatus = orderStatus;
   }
   }
+  if(createTime){
+    queryParams.createTime = createTime;
+  }
   getList()
   getList()
 })
 })
 </script>
 </script>

+ 6 - 0
src/views/pms/iotopeationfill/index1.vue

@@ -21,6 +21,11 @@
           <el-form label-width="120px">
           <el-form label-width="120px">
             <div style="margin-left: 24px">
             <div style="margin-left: 24px">
               <el-form class="demo-form-inline" :inline="true">
               <el-form class="demo-form-inline" :inline="true">
+                <el-form-item :label="t('common.createTime')" class="custom-label1">
+                  <span style="text-decoration: underline;">
+                    {{createTime}}
+                  </span>
+                </el-form-item>
                 <el-form-item :label="t('operationFillForm.team')" class="custom-label1">
                 <el-form-item :label="t('operationFillForm.team')" class="custom-label1">
                   <span style="text-decoration: underline;">
                   <span style="text-decoration: underline;">
                     {{item.orgName}}
                     {{item.orgName}}
@@ -116,6 +121,7 @@ const total = ref(0) // 列表的总页数
 const arry1 =ref([]);
 const arry1 =ref([]);
 let totalRunTime1: string = '123'
 let totalRunTime1: string = '123'
 let fillStatus = params.id.split(",")[4];
 let fillStatus = params.id.split(",")[4];
+let createTime = formatTimestamp(JSON.parse(deptId.split(",")[2].substring(0,10)));
 let showStatus = true;
 let showStatus = true;
 const queryParams = reactive({
 const queryParams = reactive({
   pageNo: 1,
   pageNo: 1,

+ 11 - 11
src/views/pms/iotopeationfill/statistics.vue

@@ -67,25 +67,25 @@
           </div>
           </div>
         </template>
         </template>
         <el-row class="h-[220px]">
         <el-row class="h-[220px]">
-          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,3)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,3,queryParams.createTime)">
             <div ref="reportingChartRef" class="h-[160px] w-full"></div>
             <div ref="reportingChartRef" class="h-[160px] w-full"></div>
             <div class="text-center mt-2"  >
             <div class="text-center mt-2"  >
               <span class="text-sm text-gray-600">总数</span>
               <span class="text-sm text-gray-600">总数</span>
             </div>
             </div>
           </el-col>
           </el-col>
-          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,1)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,1,queryParams.createTime)">
             <div ref="dealFinishedChartRef" class="h-[160px] w-full"></div>
             <div ref="dealFinishedChartRef" class="h-[160px] w-full"></div>
             <div class="text-center mt-2">
             <div class="text-center mt-2">
               <span class="text-sm text-gray-600">已填写</span>
               <span class="text-sm text-gray-600">已填写</span>
             </div>
             </div>
           </el-col>
           </el-col>
-          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,0)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,0,queryParams.createTime)">
             <div ref="transOrderChartRef" class="h-[160px] w-full"></div>
             <div ref="transOrderChartRef" class="h-[160px] w-full"></div>
             <div class="text-center mt-2">
             <div class="text-center mt-2">
               <span class="text-sm text-gray-600">未填写</span>
               <span class="text-sm text-gray-600">未填写</span>
             </div>
             </div>
           </el-col>
           </el-col>
-          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,2)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openFill(queryParams.deptId,2,queryParams.createTime)">
             <div ref="writeChartRef" class="h-[160px] w-full"></div>
             <div ref="writeChartRef" class="h-[160px] w-full"></div>
             <div class="text-center mt-2">
             <div class="text-center mt-2">
               <span class="text-sm text-gray-600">填写中</span>
               <span class="text-sm text-gray-600">填写中</span>
@@ -102,19 +102,19 @@
           </div>
           </div>
         </template>
         </template>
         <el-row class="h-[220px]">
         <el-row class="h-[220px]">
-          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,2)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,2,queryParams.createTime)">
             <div ref="reportingChartRef1" class="h-[160px] w-full"></div>
             <div ref="reportingChartRef1" class="h-[160px] w-full"></div>
             <div class="text-center mt-2"  >
             <div class="text-center mt-2"  >
               <span class="text-sm text-gray-600">总数</span>
               <span class="text-sm text-gray-600">总数</span>
             </div>
             </div>
           </el-col>
           </el-col>
-          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,1)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,1,queryParams.createTime)">
             <div ref="dealFinishedChartRef1" class="h-[160px] w-full"></div>
             <div ref="dealFinishedChartRef1" class="h-[160px] w-full"></div>
             <div class="text-center mt-2">
             <div class="text-center mt-2">
               <span class="text-sm text-gray-600">已填写</span>
               <span class="text-sm text-gray-600">已填写</span>
             </div>
             </div>
           </el-col>
           </el-col>
-          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,0)">
+          <el-col :span="6" class="flex flex-col items-center" @click="openForm(queryParams.deptId,0,queryParams.createTime)">
             <div ref="transOrderChartRef1" class="h-[160px] w-full"></div>
             <div ref="transOrderChartRef1" class="h-[160px] w-full"></div>
             <div class="text-center mt-2">
             <div class="text-center mt-2">
               <span class="text-sm text-gray-600">待填写</span>
               <span class="text-sm text-gray-600">待填写</span>
@@ -220,15 +220,15 @@ const handleQuery = () => {
 }
 }
 
 
 const formRef = ref()
 const formRef = ref()
-const openForm = (deptId?:string,isFill?:string) => {
+const openForm = (deptId?:string,isFill?:string,createTime?:[]) => {
   /*const type = '填写设备明细';
   /*const type = '填写设备明细';
   const id = queryParams.deptId
   const id = queryParams.deptId
   formRef.value.open(type,id)*/
   formRef.value.open(type,id)*/
 
 
-  push({ name: 'FillOrderInfo2',params:{deptId,isFill}})
+  push({ name: 'FillOrderInfo2',params:{deptId,isFill,createTime}})
 }
 }
-const openFill = (deptId?:string,orderStatus?:string) => {
-  push({ name: 'FillOrderInfo1',params:{deptId,orderStatus}})
+const openFill = (deptId?:string,orderStatus?:string,createTime?:[]) => {
+  push({ name: 'FillOrderInfo1',params:{deptId,orderStatus,createTime}})
 }
 }