Эх сурвалжийг харах

pms 瑞鹰日报 列表 统计计算字段

zhangcl 2 долоо хоног өмнө
parent
commit
06b1d711c9

+ 89 - 3
src/views/pms/iotrhdailyreport/index.vue

@@ -61,11 +61,29 @@
     </el-form>
     </el-form>
   </ContentWrap>
   </ContentWrap>
 
 
+  <ContentWrap class="mb-15px">
+    <div class="color-legend">
+      <div class="legend-item">
+        <span class="color-indicator red"></span>
+        <span>运行时效=当日注气量/产能&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;超过120%红色预警</span>
+      </div>
+      <div class="legend-item">
+        <span class="color-indicator orange"></span>
+        <span>当日注气时间+当日注水时间+非生产时间=24H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;否则橙色预警</span>
+      </div>
+    </div>
+  </ContentWrap>
+
   <!-- 列表 -->
   <!-- 列表 -->
   <ContentWrap ref="tableContainerRef">
   <ContentWrap ref="tableContainerRef">
     <div class="table-container">
     <div class="table-container">
       <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
       <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
-                :show-overflow-tooltip="true" style="width: 100%" :cell-style="cellStyle">
+                style="width: 100%" :cell-style="cellStyle">
+        <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+          <template #default="scope">
+            {{ scope.$index + 1 }}
+          </template>
+        </el-table-column>
         <el-table-column
         <el-table-column
           label="日期"
           label="日期"
           align="center"
           align="center"
@@ -111,6 +129,19 @@
           :formatter="dateFormatter"
           :formatter="dateFormatter"
           :width="columnWidths.constructionEndDate"
           :width="columnWidths.constructionEndDate"
         />
         />
+        <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
+          <template #default="scope">
+            <el-tooltip
+              effect="light"
+              :content="scope.row.productionStatus"
+              placement="top"
+              popper-class="design-well-struct-tooltip"
+              :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
+            >
+              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
         <el-table-column label="累计注气量(万方)" align="center" prop="totalGasInjection"
         <el-table-column label="累计注气量(万方)" align="center" prop="totalGasInjection"
                          :width="columnWidths.totalGasInjection" :formatter="gasInjectionFormatter"/>
                          :width="columnWidths.totalGasInjection" :formatter="gasInjectionFormatter"/>
         <el-table-column label="累计注水量(方)" align="center" prop="totalWaterInjection" :width="columnWidths.totalWaterInjection"/>
         <el-table-column label="累计注水量(方)" align="center" prop="totalWaterInjection" :width="columnWidths.totalWaterInjection"/>
@@ -233,6 +264,7 @@ const columnWidths = ref({
   nptReason: '150px',
   nptReason: '150px',
   constructionStartDate: '180px',
   constructionStartDate: '180px',
   constructionEndDate: '180px',
   constructionEndDate: '180px',
+  productionStatus: '200px',
   totalGasInjection: '150px',
   totalGasInjection: '150px',
   totalWaterInjection: '150px',
   totalWaterInjection: '150px',
   cumulativeCompletion: '150px',
   cumulativeCompletion: '150px',
@@ -258,6 +290,13 @@ const getTextWidth = (text: string, fontSize = 14) => {
   return width;
   return width;
 };
 };
 
 
+// 格式化设计井身结构文本
+const formatDesignWellStruct = (text: string | null | undefined) => {
+  if (!text) return '-';
+  // 如果文本长度超过30个字符,显示前30个字符并添加省略号
+  return text.length > 30 ? text.substring(0, 30) + '...' : text;
+};
+
 // 百分比格式化函数
 // 百分比格式化函数
 const percentageFormatter = (row: any, column: any, cellValue: any, index: number) => {
 const percentageFormatter = (row: any, column: any, cellValue: any, index: number) => {
   if (cellValue === null || cellValue === undefined) return '';
   if (cellValue === null || cellValue === undefined) return '';
@@ -269,7 +308,7 @@ const percentageFormatter = (row: any, column: any, cellValue: any, index: numbe
 const FLEXIBLE_COLUMNS = ['deptName', 'contractName', 'taskName', 'constructionStatus', 'relocationDays', 'designInjection',
 const FLEXIBLE_COLUMNS = ['deptName', 'contractName', 'taskName', 'constructionStatus', 'relocationDays', 'designInjection',
   'transitTime', 'dailyGasInjection', 'dailyWaterInjection', 'dailyPowerUsage', 'dailyInjectGasTime',
   'transitTime', 'dailyGasInjection', 'dailyWaterInjection', 'dailyPowerUsage', 'dailyInjectGasTime',
   'dailyInjectWaterTime', 'nonProductionTime', 'nptReason', 'constructionStartDate',
   'dailyInjectWaterTime', 'nonProductionTime', 'nptReason', 'constructionStartDate',
-  'constructionEndDate', 'totalGasInjection', 'totalWaterInjection',
+  'constructionEndDate', 'productionStatus', 'totalGasInjection', 'totalWaterInjection',
   'cumulativeCompletion', 'createTime'];
   'cumulativeCompletion', 'createTime'];
 
 
 /** 查询列表 */
 /** 查询列表 */
@@ -332,7 +371,7 @@ const cellStyle = ({ row, column, rowIndex, columnIndex }: { row: any; column: a
     // 检查三个时间字段之和是否不等于24
     // 检查三个时间字段之和是否不等于24
     if (!checkTimeSumEquals24(row)) {
     if (!checkTimeSumEquals24(row)) {
       return {
       return {
-        color: 'red',
+        color: 'orange',
         fontWeight: 'bold'
         fontWeight: 'bold'
       };
       };
     }
     }
@@ -410,12 +449,17 @@ const calculateColumnWidths = () => {
   calculateColumnMinWidth('nptReason', t('project.nptReason'), (row: any) => row.nptReason);
   calculateColumnMinWidth('nptReason', t('project.nptReason'), (row: any) => row.nptReason);
   calculateColumnMinWidth('constructionStartDate', '施工开始日期', (row: any) => dateFormatter(null, null, row.constructionStartDate));
   calculateColumnMinWidth('constructionStartDate', '施工开始日期', (row: any) => dateFormatter(null, null, row.constructionStartDate));
   calculateColumnMinWidth('constructionEndDate', '施工结束日期', (row: any) => dateFormatter(null, null, row.constructionEndDate));
   calculateColumnMinWidth('constructionEndDate', '施工结束日期', (row: any) => dateFormatter(null, null, row.constructionEndDate));
+  calculateColumnMinWidth('productionStatus', '生产动态', (row: any) => row.productionStatus);
   calculateColumnMinWidth('totalGasInjection', '累计注气量(万方)', (row: any) => row.totalGasInjection);
   calculateColumnMinWidth('totalGasInjection', '累计注气量(万方)', (row: any) => row.totalGasInjection);
   calculateColumnMinWidth('totalWaterInjection', '累计注水量(方)', (row: any) => row.totalWaterInjection);
   calculateColumnMinWidth('totalWaterInjection', '累计注水量(方)', (row: any) => row.totalWaterInjection);
   calculateColumnMinWidth('cumulativeCompletion', '累计完工井次', (row: any) => row.cumulativeCompletion);
   calculateColumnMinWidth('cumulativeCompletion', '累计完工井次', (row: any) => row.cumulativeCompletion);
   calculateColumnMinWidth('capacity', '产能(万方)', (row: any) => row.capacity);
   calculateColumnMinWidth('capacity', '产能(万方)', (row: any) => row.capacity);
   calculateColumnMinWidth('createTime', '创建时间', (row: any) => dateFormatter(null, null, row.createTime));
   calculateColumnMinWidth('createTime', '创建时间', (row: any) => dateFormatter(null, null, row.createTime));
 
 
+  // 生产动态 列使用固定宽度,不参与自动计算
+  minWidths.productionStatus = 200; // 固定宽度200px
+  totalMinWidth += 200;
+
   // 操作列固定宽度
   // 操作列固定宽度
   minWidths.operation = 120;
   minWidths.operation = 120;
   totalMinWidth += 120;
   totalMinWidth += 120;
@@ -579,4 +623,46 @@ watch(list, () => {
   overflow: visible !important;
   overflow: visible !important;
   text-overflow: clip !important;
   text-overflow: clip !important;
 }
 }
+
+/* 颜色说明区域样式 */
+.color-legend {
+  display: flex;
+  flex-direction: column;
+  gap: 8px;
+  padding: 12px 16px;
+  background-color: #f8f9fa;
+  border-radius: 4px;
+  border-left: 4px solid #e6f7ff;
+}
+
+.legend-item {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  font-size: 14px;
+}
+
+.color-indicator {
+  display: inline-block;
+  width: 12px;
+  height: 12px;
+  border-radius: 50%;
+}
+
+.color-indicator.red {
+  background-color: red;
+}
+
+.color-indicator.orange {
+  background-color: orange;
+}
+</style>
+
+<style>
+/* 设计井身结构 tooltip 样式 - 保留换行符 */
+.design-well-struct-tooltip {
+  white-space: pre-line;
+  max-width: 500px;
+  line-height: 1.5;
+}
 </style>
 </style>

+ 27 - 10
src/views/pms/iotrydailyreport/IotRyDailyReportForm.vue

@@ -16,10 +16,15 @@
       <el-form-item label="任务" prop="taskName">
       <el-form-item label="任务" prop="taskName">
         <el-input v-model="displayData.taskName" placeholder="" disabled/>
         <el-input v-model="displayData.taskName" placeholder="" disabled/>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="施工状态" prop="rigStatus">
-        <el-radio-group v-model="formData.rigStatus">
-          <el-radio value="1">请选择字典生成</el-radio>
-        </el-radio-group>
+      <el-form-item :label="t('project.status')" prop="rigStatus">
+        <el-select v-model="formData.rigStatus" placeholder="请选择" clearable>
+          <el-option
+            v-for="dict in getIntDictOptions(DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE)"
+            :key="dict.id"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
       </el-form-item>
       </el-form-item>
       <el-form-item label="上井次完井时间" prop="latestWellDoneTime">
       <el-form-item label="上井次完井时间" prop="latestWellDoneTime">
         <el-date-picker
         <el-date-picker
@@ -31,7 +36,7 @@
         />
         />
       </el-form-item>
       </el-form-item>
       <el-form-item label="设计井深(m)" prop="designWellDepth">
       <el-form-item label="设计井深(m)" prop="designWellDepth">
-        <el-input v-model="formData.designWellDepth" placeholder="" disabled/>
+        <el-input v-model="displayData.designWellDepth" placeholder="" disabled/>
       </el-form-item>
       </el-form-item>
       <el-form-item label="当前井深(m)" prop="currentDepth">
       <el-form-item label="当前井深(m)" prop="currentDepth">
         <el-input v-model="formData.currentDepth" placeholder="请输入当前井深(m)" />
         <el-input v-model="formData.currentDepth" placeholder="请输入当前井深(m)" />
@@ -52,10 +57,10 @@
         <el-input v-model="formData.dailyFuel" placeholder="请输入当日油耗(吨)" />
         <el-input v-model="formData.dailyFuel" placeholder="请输入当日油耗(吨)" />
       </el-form-item>
       </el-form-item>
       <el-form-item label="总施工井数" prop="monthlyFuel">
       <el-form-item label="总施工井数" prop="monthlyFuel">
-        <el-input v-model="formData.totalConstructionWells" placeholder="" disabled/>
+        <el-input v-model="displayData.totalConstructionWells" placeholder="" disabled/>
       </el-form-item>
       </el-form-item>
       <el-form-item label="完工井数" prop="completedWells">
       <el-form-item label="完工井数" prop="completedWells">
-        <el-input v-model="formData.completedWells" placeholder="" disabled/>
+        <el-input v-model="displayData.completedWells" placeholder="" disabled/>
       </el-form-item>
       </el-form-item>
       <el-form-item label="泥浆密度(g/cm³)" prop="mudDensity">
       <el-form-item label="泥浆密度(g/cm³)" prop="mudDensity">
         <el-input v-model="formData.mudDensity" placeholder="请输入泥浆性能-密度(g/cm³)" />
         <el-input v-model="formData.mudDensity" placeholder="请输入泥浆性能-密度(g/cm³)" />
@@ -93,7 +98,7 @@
 </template>
 </template>
 <script setup lang="ts">
 <script setup lang="ts">
 import { IotRyDailyReportApi, IotRyDailyReportVO } from '@/api/pms/iotrydailyreport'
 import { IotRyDailyReportApi, IotRyDailyReportVO } from '@/api/pms/iotrydailyreport'
-import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
+import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
 import { computed, ref, watch, nextTick, reactive } from 'vue'
 import { computed, ref, watch, nextTick, reactive } from 'vue'
 
 
 /** 瑞鹰日报 表单 */
 /** 瑞鹰日报 表单 */
@@ -116,7 +121,10 @@ watch(() => props.rowData, (newVal) => {
     displayData.value.deptName = newVal.deptName || ''
     displayData.value.deptName = newVal.deptName || ''
     displayData.value.contractName = newVal.contractName || ''
     displayData.value.contractName = newVal.contractName || ''
     displayData.value.taskName = newVal.taskName || ''
     displayData.value.taskName = newVal.taskName || ''
+    displayData.value.designWellDepth = newVal.designWellDepth || ''
     displayData.value.designWellStruct = newVal.designWellStruct || ''
     displayData.value.designWellStruct = newVal.designWellStruct || ''
+    displayData.value.totalConstructionWells = newVal.totalConstructionWells || ''
+    displayData.value.completedWells = newVal.completedWells || ''
   }
   }
 }, { immediate: true })
 }, { immediate: true })
 
 
@@ -130,7 +138,10 @@ const displayData = ref({
   deptName: '',
   deptName: '',
   contractName: '',
   contractName: '',
   taskName: '',
   taskName: '',
-  designWellStruct: ''
+  designWellDepth: '',
+  designWellStruct: '',
+  totalConstructionWells: '',
+  completedWells: ''
 })
 })
 
 
 const formData = ref({
 const formData = ref({
@@ -189,7 +200,10 @@ const open = async (type: string, id?: number) => {
     displayData.value.deptName = props.rowData.deptName || ''
     displayData.value.deptName = props.rowData.deptName || ''
     displayData.value.contractName = props.rowData.contractName || ''
     displayData.value.contractName = props.rowData.contractName || ''
     displayData.value.taskName = props.rowData.taskName || ''
     displayData.value.taskName = props.rowData.taskName || ''
+    displayData.value.designWellDepth = props.rowData.designWellDepth || ''
     displayData.value.designWellStruct = props.rowData.designWellStruct || ''
     displayData.value.designWellStruct = props.rowData.designWellStruct || ''
+    displayData.value.totalConstructionWells = props.rowData.totalConstructionWells || ''
+    displayData.value.completedWells = props.rowData.completedWells || ''
   }
   }
 
 
   // 修改时,设置数据
   // 修改时,设置数据
@@ -276,7 +290,10 @@ const resetForm = () => {
     deptName: '',
     deptName: '',
     contractName: '',
     contractName: '',
     taskName: '',
     taskName: '',
-    designWellStruct: ''
+    designWellDepth: '',
+    designWellStruct: '',
+    totalConstructionWells: '',
+    completedWells: ''
   }
   }
 
 
   formRef.value?.resetFields()
   formRef.value?.resetFields()

+ 32 - 6
src/views/pms/iotrydailyreport/index.vue

@@ -66,6 +66,11 @@
     <div class="table-container">
     <div class="table-container">
       <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
       <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
                 style="width: 100%" :cell-style="cellStyle">
                 style="width: 100%" :cell-style="cellStyle">
+        <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+          <template #default="scope">
+            {{ scope.$index + 1 }}
+          </template>
+        </el-table-column>
         <el-table-column
         <el-table-column
           label="日期"
           label="日期"
           align="center"
           align="center"
@@ -82,13 +87,13 @@
             <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
             <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime"/>
-        <el-table-column label="设计井深(m)" align="center" prop="designInjection" :width="columnWidths.designWellDepth"/>
+        <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime" :formatter="dateFormatter2"/>
+        <el-table-column label="设计井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
         <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
         <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
         <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
         <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
         <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
         <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
         <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/>
         <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/>
-        <el-table-column label="总施工井数" align="center" prop="totalCompletedWells" :width="columnWidths.totalConstructionWells"/>
+        <el-table-column label="总施工井数" align="center" prop="totalConstructionWells" :width="columnWidths.totalConstructionWells"/>
         <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
         <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
         <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
         <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
         <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/>
         <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/>
@@ -122,6 +127,19 @@
             </el-tooltip>
             </el-tooltip>
           </template>
           </template>
         </el-table-column>
         </el-table-column>
+        <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
+          <template #default="scope">
+            <el-tooltip
+              effect="light"
+              :content="scope.row.productionStatus"
+              placement="top"
+              popper-class="design-well-struct-tooltip"
+              :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
+            >
+              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
+            </el-tooltip>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
         <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
           <template #default="scope">
           <template #default="scope">
             <el-button
             <el-button
@@ -187,7 +205,7 @@ const queryParams = reactive({
   taskId: undefined,
   taskId: undefined,
   projectClassification: undefined,
   projectClassification: undefined,
   relocationDays: undefined,
   relocationDays: undefined,
-  lastestWellDoneTime: [],
+  latestWellDoneTime: [],
   currentDepth: undefined,
   currentDepth: undefined,
   dailyFootage: undefined,
   dailyFootage: undefined,
   monthlyFootage: undefined,
   monthlyFootage: undefined,
@@ -246,6 +264,7 @@ const columnWidths = ref({
   constructionEndDate: '180px',
   constructionEndDate: '180px',
   lateralLength: '150px',
   lateralLength: '150px',
   wellInclination: '150px',
   wellInclination: '150px',
+  productionStatus: '200px',
   azimuth: '150px',
   azimuth: '150px',
   designWellStruct: '200px',
   designWellStruct: '200px',
   createTime: '180px',
   createTime: '180px',
@@ -369,12 +388,16 @@ const calculateColumnWidths = () => {
   calculateColumnMinWidth('wellInclination', '井斜(°)', (row: any) => row.wellInclination);
   calculateColumnMinWidth('wellInclination', '井斜(°)', (row: any) => row.wellInclination);
   calculateColumnMinWidth('azimuth', '方位(°)', (row: any) => row.azimuth);
   calculateColumnMinWidth('azimuth', '方位(°)', (row: any) => row.azimuth);
   calculateColumnMinWidth('designWellStruct', '设计井身结构', (row: any) => row.designWellStruct);
   calculateColumnMinWidth('designWellStruct', '设计井身结构', (row: any) => row.designWellStruct);
+  calculateColumnMinWidth('productionStatus', '生产动态', (row: any) => row.productionStatus);
   calculateColumnMinWidth('createTime', '创建时间', (row: any) => dateFormatter(null, null, row.createTime));
   calculateColumnMinWidth('createTime', '创建时间', (row: any) => dateFormatter(null, null, row.createTime));
 
 
-  // 设计井身结构列使用固定宽度,不参与自动计算
+  // 设计井身结构 生产动态 列使用固定宽度,不参与自动计算
   minWidths.designWellStruct = 200; // 固定宽度200px
   minWidths.designWellStruct = 200; // 固定宽度200px
   totalMinWidth += 200;
   totalMinWidth += 200;
 
 
+  minWidths.productionStatus = 200; // 固定宽度200px
+  totalMinWidth += 200;
+
   // 操作列固定宽度
   // 操作列固定宽度
   minWidths.operation = 120;
   minWidths.operation = 120;
   totalMinWidth += 120;
   totalMinWidth += 120;
@@ -430,7 +453,10 @@ const openForm = (type: string, id?: number, row?: any) => {
       deptName: row.deptName,
       deptName: row.deptName,
       contractName: row.contractName,
       contractName: row.contractName,
       taskName: row.taskName,
       taskName: row.taskName,
-      designWellStruct: row.designWellStruct
+      designWellDepth: row.designWellDepth,
+      designWellStruct: row.designWellStruct,
+      totalConstructionWells: row.totalConstructionWells,
+      completedWells: row.completedWells
     }
     }
   } else {
   } else {
     selectedRowData.value = null
     selectedRowData.value = null