Explorar o código

pms 瑞都 日报 查看已经填报的日报详情

zhangcl hai 3 días
pai
achega
e98c960049

+ 124 - 0
src/views/pms/iotrddailyreport/FillDailyReportForm.vue

@@ -444,6 +444,44 @@
       </el-form>
     </ContentWrap>
 
+    <!-- 平台井工作量区域 - 只在平台井的详情或审批模式下显示 -->
+    <ContentWrap class="platform-workload-section" v-if="(isDetailMode || isApprovalMode) && dailyReportData?.platformWell === 1">
+      <h2 class="text-lg font-semibold mb-4">平台井工作量</h2>
+
+      <div class="platform-workload-table" v-if="dailyReportData?.platforms && dailyReportData.platforms.length > 0">
+        <el-table :data="dailyReportData.platforms" border style="width: 100%" class="platform-workload-el-table" table-layout="fixed">
+          <!-- 固定列 -->
+          <el-table-column prop="wellName" label="井号" align="center" :show-overflow-tooltip="true"/>
+          <el-table-column label="施工状态" align="center" :show-overflow-tooltip="true">
+            <template #default="scope">
+              {{ scope.row.rdStatusLabel || '' }}
+            </template>
+          </el-table-column>
+          <el-table-column label="施工工艺" align="center" :show-overflow-tooltip="true">
+            <template #default="scope">
+              {{ scope.row.techniqueNames || '' }}
+            </template>
+          </el-table-column>
+
+          <!-- 动态工作量列 -->
+          <el-table-column
+            v-for="workloadColumn in getWorkloadColumns()"
+            :key="workloadColumn.key"
+            :label="workloadColumn.label"
+            align="center"
+            :show-overflow-tooltip="true" >
+            <template #default="scope">
+              {{ getWorkloadValue(scope.row, workloadColumn.identifier) }}
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div v-else class="text-center text-gray-500 py-4">
+        暂无平台井工作量数据
+      </div>
+    </ContentWrap>
+
     <!-- 第四部分:审批意见 - 只在审批模式下显示 -->
     <ContentWrap class="section-padding" v-if="isApprovalMode">
       <el-form
@@ -1120,6 +1158,12 @@ const submitForm = async () => {
       platformData.techniqueIds = pair.techniqueIds || []
       platformData.extProperty = pair.extProperty || []
 
+      // 处理附件:复制并修改 bizId 为当前 pair 的 reportId
+      platformData.attachments = (baseData.attachments || []).map(attachment => ({
+        ...attachment, // 深拷贝单个附件
+        bizId: pair.reportId // 替换 bizId 为当前平台井的 reportId
+      }))
+
       // 重新构建 dynamicFields(如果需要)
       const dynamicFields = {}
       if (platformData.extProperty && platformData.extProperty.length > 0) {
@@ -1539,6 +1583,38 @@ onMounted(async () => {
   }
 })
 
+// 详细 审批 平台井 获取工作量列配置
+const getWorkloadColumns = () => {
+  if (!dailyReportData.value.platforms) return [];
+
+  const columns = [];
+  const addedIdentifiers = new Set();
+
+  dailyReportData.value.platforms.forEach(platform => {
+    if (platform.extProperty && Array.isArray(platform.extProperty)) {
+      platform.extProperty.forEach(extProp => {
+        if (!addedIdentifiers.has(extProp.identifier)) {
+          columns.push({
+            key: extProp.identifier,
+            identifier: extProp.identifier,
+            label: `${extProp.name}(${extProp.unit})`
+          });
+          addedIdentifiers.add(extProp.identifier);
+        }
+      });
+    }
+  });
+
+  return columns;
+};
+
+// 详情 审批 平台井 获取工作量值
+const getWorkloadValue = (platform, identifier) => {
+  if (!platform.extProperty) return '';
+  const prop = platform.extProperty.find(item => item.identifier === identifier);
+  return prop ? prop.actualValue || '' : '';
+};
+
 /** 审批操作 */
 const handleApprove = async (action: 'pass' | 'reject') => {
   // 只有在审批模式下才执行审批操作
@@ -1955,4 +2031,52 @@ const handleApprove = async (action: 'pass' | 'reject') => {
   cursor: not-allowed;
   resize: none;
 }
+
+/* 平台井工作量区域专用样式 */
+.platform-workload-section {
+  padding-left: 0px;
+  padding-right: 0px; /* 去掉右侧间距 */
+}
+
+/* 表格样式优化 */
+.platform-workload-el-table {
+  width: 100%;
+}
+
+/* 表头不换行 */
+:deep(.platform-workload-el-table .el-table__header-wrapper th) {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
+
+/* 单元格内容不换行 */
+:deep(.platform-workload-el-table .el-table__body-wrapper td) {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
+
+/* 强制设置表头宽度为100% */
+:deep(.platform-workload-el-table .el-table__header) {
+  width: 100% !important;
+  min-width: 100% !important;
+}
+
+/* 强制设置表格主体宽度为100% */
+:deep(.platform-workload-el-table .el-table__body) {
+  width: 100% !important;
+  min-width: 100% !important;
+}
+
+/* 确保表格填满容器 */
+:deep(.platform-workload-el-table .el-table) {
+  width: 100% !important;
+}
+
+/* 表格容器填满父容器 */
+.platform-workload-table {
+  width: 100%;
+}
+
 </style>

+ 21 - 6
src/views/pms/iotrddailyreport/index.vue

@@ -117,15 +117,14 @@
       />
       <el-table-column label="操作" align="center" min-width="120px" fixed="right">
         <template #default="scope">
-          <!--
           <el-button
             link
-            type="primary"
-            @click="openForm('update', scope.row.id)"
-            v-hasPermi="['pms:iot-rd-daily-report:update']"
+            type="success"
+            @click="handleDetail(scope.row.id)"
+            v-hasPermi="['pms:iot-rd-daily-report:query']"
           >
-            编辑
-          </el-button> -->
+            查看
+          </el-button>
           <el-button
             link
             type="warning"
@@ -370,6 +369,22 @@ const openForm = (type: string, id?: number) => {
   formRef.value.open(type, id)
 }
 
+/** 查看日报详情 */
+const handleDetail = async (id: number) => {
+  try {
+    // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
+    push({
+      name: 'FillDailyReportForm',
+      params: {
+        id: id.toString(),
+        mode: 'detail'  // 添加详情模式标识
+      }
+    })
+  } catch (error) {
+    console.error('跳转详情页面失败:', error)
+  }
+}
+
 /** 审批按钮操作 */
 const handleApprove = async (id: number) => {
   try {