|
|
@@ -1,544 +1,373 @@
|
|
|
-<template>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="4" :xs="24">
|
|
|
- <ContentWrap class="h-1/1">
|
|
|
- <DeptTree2 :deptId="rootDeptId" @node-click="handleDeptNodeClick" />
|
|
|
- </ContentWrap>
|
|
|
- </el-col>
|
|
|
- <el-col :span="20" :xs="24">
|
|
|
- <ContentWrap>
|
|
|
- <!-- 搜索工作栏 -->
|
|
|
- <el-form
|
|
|
- class="-mb-15px"
|
|
|
- :model="queryParams"
|
|
|
- ref="queryFormRef"
|
|
|
- :inline="true"
|
|
|
- label-width="68px"
|
|
|
- >
|
|
|
- <el-form-item label="项目" prop="contractName">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.contractName"
|
|
|
- placeholder="请输入项目"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="!w-240px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="任务" prop="taskName">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.taskName"
|
|
|
- placeholder="请输入任务"
|
|
|
- clearable
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- class="!w-240px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="创建时间" prop="createTime">
|
|
|
- <el-date-picker
|
|
|
- v-model="queryParams.createTime"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- type="daterange"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
- class="!w-220px"
|
|
|
- :shortcuts="rangeShortcuts"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="handleQuery"
|
|
|
- ><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
|
|
|
- >
|
|
|
- <el-button @click="resetQuery"
|
|
|
- ><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- @click="openForm('create')"
|
|
|
- v-hasPermi="['pms:iot-rd-daily-report:create']"
|
|
|
- >
|
|
|
- <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
- </el-button>
|
|
|
- <!-- <el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
- <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
- </el-button> -->
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </ContentWrap>
|
|
|
-
|
|
|
- <!-- 列表 -->
|
|
|
- <ContentWrap>
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="list"
|
|
|
- :stripe="true"
|
|
|
- :style="{ width: '100%' }"
|
|
|
- max-height="600"
|
|
|
- show-overflow-tooltip
|
|
|
- border
|
|
|
- >
|
|
|
- <el-table-column label="操作" align="center" min-width="120px">
|
|
|
- <template #default="scope">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="openForm('fill', scope.row.id)"
|
|
|
- v-hasPermi="['pms:iot-rd-daily-report:update']"
|
|
|
- v-if="scope.row.status === 0"
|
|
|
- >
|
|
|
- 填报
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="success"
|
|
|
- @click="handleDetail(scope.row.id)"
|
|
|
- v-hasPermi="['pms:iot-rd-daily-report:query']"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- :type="
|
|
|
- scope.row.nonProductFlag || scope.row.processInstanceId === '2'
|
|
|
- ? 'success'
|
|
|
- : 'warning'
|
|
|
- "
|
|
|
- @click="openForm('fill', scope.row.id, 'true')"
|
|
|
- v-hasPermi="['pms:iot-rd-daily-report:non-productive']"
|
|
|
- v-if="scope.row.auditStatus === 20"
|
|
|
- >
|
|
|
- 时效
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="创建时间"
|
|
|
- align="center"
|
|
|
- prop="createTime"
|
|
|
- :formatter="dateFormatter2"
|
|
|
- width="180px"
|
|
|
- />
|
|
|
- <el-table-column label="日报状态" align="center" prop="status">
|
|
|
- <template #default="scope">
|
|
|
- <dict-tag :type="DICT_TYPE.OPERATION_FILL_ORDER_STATUS" :value="scope.row.status" />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="审批状态" align="center" prop="auditStatus" :min-width="84">
|
|
|
- <template #default="scope">
|
|
|
- <el-tag v-if="scope.row.auditStatus === 0" type="info">
|
|
|
- {{ '待提交' }}
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.auditStatus === 10">
|
|
|
- {{ '待审批' }}
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.auditStatus === 20" type="success">
|
|
|
- {{ '审批通过' }}
|
|
|
- </el-tag>
|
|
|
- <el-tag v-else-if="scope.row.auditStatus === 30" type="danger">
|
|
|
- {{ '审批拒绝' }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="施工队伍" align="center" prop="deptName" />
|
|
|
- <el-table-column label="项目" align="center" prop="contractName" />
|
|
|
- <el-table-column label="任务" align="center" prop="taskName" />
|
|
|
- <el-table-column label="非生产时间" align="center">
|
|
|
- <el-table-column
|
|
|
- label="工程质量"
|
|
|
- align="center"
|
|
|
- prop="accidentTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="设备故障"
|
|
|
- align="center"
|
|
|
- prop="repairTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="设备保养"
|
|
|
- align="center"
|
|
|
- prop="selfStopTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="技术受限"
|
|
|
- align="center"
|
|
|
- prop="complexityTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="生产配合"
|
|
|
- align="center"
|
|
|
- prop="relocationTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="生产组织"
|
|
|
- align="center"
|
|
|
- prop="rectificationTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="不可抗力"
|
|
|
- align="center"
|
|
|
- prop="waitingStopTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="待命"
|
|
|
- align="center"
|
|
|
- prop="winterBreakTime"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="甲方设计"
|
|
|
- align="center"
|
|
|
- prop="partyaDesign"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="甲方准备"
|
|
|
- align="center"
|
|
|
- prop="partyaPrepare"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="甲方资源"
|
|
|
- align="center"
|
|
|
- prop="partyaResource"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="其它非生产时间"
|
|
|
- align="center"
|
|
|
- prop="otherNptTime"
|
|
|
- :min-width="110"
|
|
|
- resizable
|
|
|
- />
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="其他非生产时间原因"
|
|
|
- align="center"
|
|
|
- prop="otherNptReason"
|
|
|
- :min-width="140"
|
|
|
- resizable
|
|
|
- />
|
|
|
- <!-- <el-table-column
|
|
|
- label="非生产时间填写"
|
|
|
- align="center"
|
|
|
- prop="nonProductFlag"
|
|
|
- :min-width="110"
|
|
|
- >
|
|
|
- <template #default="scope">
|
|
|
- <el-tag
|
|
|
- :type="
|
|
|
- scope.row.nonProductFlag || scope.row.processInstanceId === '2'
|
|
|
- ? 'success'
|
|
|
- : 'danger'
|
|
|
- "
|
|
|
- >
|
|
|
- {{
|
|
|
- scope.row.nonProductFlag || scope.row.processInstanceId === '2'
|
|
|
- ? '已填写'
|
|
|
- : '未填写'
|
|
|
- }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column
|
|
|
- label="非生产时效"
|
|
|
- align="center"
|
|
|
- prop="nonProductionRate"
|
|
|
- :min-width="80"
|
|
|
- resizable
|
|
|
- :formatter="(row) => (Number(row.nonProductionRate ?? 0) * 100).toFixed(2) + '%'"
|
|
|
- />
|
|
|
- <el-table-column label="带班干部" align="center" prop="responsiblePersonNames" />
|
|
|
- <el-table-column label="填报人" align="center" prop="submitterNames" />
|
|
|
- <!--
|
|
|
- <el-table-column label="项目类别(钻井 修井 注氮 酸化压裂... )" align="center" prop="projectClassification" /> -->
|
|
|
- <!--
|
|
|
- <el-table-column label="时间节点-结束" align="center" prop="endTime" />
|
|
|
- <el-table-column
|
|
|
- label="施工开始日期"
|
|
|
- align="center"
|
|
|
- prop="constructionStartDate"
|
|
|
- :formatter="dateFormatter"
|
|
|
- width="180px"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- label="施工结束日期"
|
|
|
- align="center"
|
|
|
- prop="constructionEndDate"
|
|
|
- :formatter="dateFormatter"
|
|
|
- width="180px"
|
|
|
- /> -->
|
|
|
- </el-table>
|
|
|
- <!-- 分页 -->
|
|
|
- <Pagination
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
- </ContentWrap>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- 表单弹窗:添加/修改
|
|
|
- <IotRdDailyReportForm ref="formRef" @success="getList" /> -->
|
|
|
-</template>
|
|
|
+<script lang="ts" setup>
|
|
|
+import { IotRdDailyReportApi } from '@/api/pms/iotrddailyreport'
|
|
|
+import { useTableComponents } from '@/components/ZmTable/useTableComponents'
|
|
|
+import { useUserStore } from '@/store/modules/user'
|
|
|
+import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
|
|
+import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
+import { useDebounceFn } from '@vueuse/core'
|
|
|
+import IotRdDailyReportForm from './IotRdDailyReportForm.vue'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+// import download from '@/utils/download'
|
|
|
|
|
|
-<script setup lang="ts">
|
|
|
-import { dateFormatter2 } from '@/utils/formatTime'
|
|
|
-import { IotRdDailyReportApi, IotRdDailyReportVO } from '@/api/pms/iotrddailyreport'
|
|
|
-import { DICT_TYPE } from '@/utils/dict'
|
|
|
-import DeptTree2 from '@/views/pms/iotrhdailyreport/DeptTree2.vue'
|
|
|
+defineOptions({ name: 'FillDailyReport' })
|
|
|
|
|
|
-import dayjs from 'dayjs'
|
|
|
-import quarterOfYear from 'dayjs/plugin/quarterOfYear'
|
|
|
+// const { t } = useI18n()
|
|
|
|
|
|
-dayjs.extend(quarterOfYear)
|
|
|
+const router = useRouter()
|
|
|
+const route = useRoute()
|
|
|
|
|
|
-const rangeShortcuts = [
|
|
|
- {
|
|
|
- text: '今天',
|
|
|
- value: () => {
|
|
|
- const today = dayjs()
|
|
|
- return [today.startOf('day').toDate(), today.endOf('day').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '昨天',
|
|
|
- value: () => {
|
|
|
- const yesterday = dayjs().subtract(1, 'day')
|
|
|
- return [yesterday.startOf('day').toDate(), yesterday.endOf('day').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '本周',
|
|
|
- value: () => {
|
|
|
- return [dayjs().startOf('week').toDate(), dayjs().endOf('week').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '上周',
|
|
|
- value: () => {
|
|
|
- const lastWeek = dayjs().subtract(1, 'week')
|
|
|
- return [lastWeek.startOf('week').toDate(), lastWeek.endOf('week').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '本月',
|
|
|
- value: () => {
|
|
|
- return [dayjs().startOf('month').toDate(), dayjs().endOf('month').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '上月',
|
|
|
- value: () => {
|
|
|
- const lastMonth = dayjs().subtract(1, 'month')
|
|
|
- return [lastMonth.startOf('month').toDate(), lastMonth.endOf('month').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '本季度',
|
|
|
- value: () => {
|
|
|
- return [dayjs().startOf('quarter').toDate(), dayjs().endOf('quarter').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '上季度',
|
|
|
- value: () => {
|
|
|
- const lastQuarter = dayjs().subtract(1, 'quarter')
|
|
|
- return [lastQuarter.startOf('quarter').toDate(), lastQuarter.endOf('quarter').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '今年',
|
|
|
- value: () => {
|
|
|
- return [dayjs().startOf('year').toDate(), dayjs().endOf('year').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '去年',
|
|
|
- value: () => {
|
|
|
- const lastYear = dayjs().subtract(1, 'year')
|
|
|
- return [lastYear.startOf('year').toDate(), lastYear.endOf('year').toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '最近7天',
|
|
|
- value: () => {
|
|
|
- return [dayjs().subtract(6, 'day').toDate(), dayjs().toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '最近30天',
|
|
|
- value: () => {
|
|
|
- return [dayjs().subtract(29, 'day').toDate(), dayjs().toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '最近90天',
|
|
|
- value: () => {
|
|
|
- return [dayjs().subtract(89, 'day').toDate(), dayjs().toDate()]
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- text: '最近一年',
|
|
|
- value: () => {
|
|
|
- return [dayjs().subtract(1, 'year').toDate(), dayjs().toDate()]
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
+// const message = useMessage()
|
|
|
|
|
|
-/** 瑞都日报 填报 列表 */
|
|
|
-defineOptions({ name: 'FillDailyReport' })
|
|
|
+const id = useUserStore().getUser.deptId
|
|
|
|
|
|
-const message = useMessage() // 消息弹窗
|
|
|
-const { t } = useI18n() // 国际化
|
|
|
-const { push } = useRouter() // 路由跳转
|
|
|
-const loading = ref(true) // 列表的加载中
|
|
|
-const list = ref<IotRdDailyReportVO[]>([]) // 列表的数据
|
|
|
-const total = ref(0) // 列表的总页数
|
|
|
+const deptId = id
|
|
|
|
|
|
-const rootDeptId = ref(163)
|
|
|
+interface Query {
|
|
|
+ deptId?: number
|
|
|
+ contractName?: string
|
|
|
+ taskName?: string
|
|
|
+ createTime?: string[]
|
|
|
+ wellName?: string
|
|
|
+ taskId?: number
|
|
|
+ pageNo: number
|
|
|
+ pageSize: number
|
|
|
+}
|
|
|
|
|
|
-const queryParams = reactive({
|
|
|
+const initQuery: Query = {
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
- deptId: undefined,
|
|
|
- projectId: undefined,
|
|
|
- contractName: undefined,
|
|
|
- taskId: undefined,
|
|
|
- taskName: undefined,
|
|
|
- projectClassification: undefined,
|
|
|
- techniqueIds: undefined,
|
|
|
- deviceIds: undefined,
|
|
|
- startTime: [],
|
|
|
- endTime: [],
|
|
|
- cumulativeWorkingWell: undefined,
|
|
|
- cumulativeWorkingLayers: undefined,
|
|
|
- dailyPumpTrips: undefined,
|
|
|
- dailyToolsSand: undefined,
|
|
|
- runCount: undefined,
|
|
|
- bridgePlug: undefined,
|
|
|
- waterVolume: undefined,
|
|
|
- hourCount: undefined,
|
|
|
- dailyFuel: undefined,
|
|
|
- dailyPowerUsage: undefined,
|
|
|
- productionTime: [],
|
|
|
- nonProductionTime: [],
|
|
|
- rdNptReason: undefined,
|
|
|
- constructionStartDate: [],
|
|
|
- constructionEndDate: [],
|
|
|
- productionStatus: undefined,
|
|
|
- externalRental: undefined,
|
|
|
- nextPlan: undefined,
|
|
|
- rdStatus: undefined,
|
|
|
- malfunction: undefined,
|
|
|
- faultDowntime: [],
|
|
|
- personnel: undefined,
|
|
|
- totalStaffNum: undefined,
|
|
|
- leaveStaffNum: undefined,
|
|
|
- extProperty: undefined,
|
|
|
- sort: undefined,
|
|
|
- remark: undefined,
|
|
|
- status: undefined,
|
|
|
- processInstanceId: undefined,
|
|
|
- auditStatus: undefined,
|
|
|
- createTime: []
|
|
|
-})
|
|
|
-const queryFormRef = ref() // 搜索的表单
|
|
|
+ deptId: route.query.deptId ? Number(route.query.deptId) : id,
|
|
|
+ createTime: route.query.createTime ? (route.query.createTime as string[]) : undefined,
|
|
|
+ wellName: route.query.wellName ? (route.query.wellName as string) : undefined,
|
|
|
+ taskId: route.query.taskId ? Number(route.query.taskId) : undefined
|
|
|
+}
|
|
|
+
|
|
|
+const query = ref<Query>({ ...initQuery })
|
|
|
+
|
|
|
+interface ListItem {
|
|
|
+ createTime: string
|
|
|
+ status: string
|
|
|
+ auditStatus: number
|
|
|
+ deptName: string
|
|
|
+ contractName: string
|
|
|
+ taskName: string
|
|
|
+ nonProductionRate: number
|
|
|
+ accidentTime: number
|
|
|
+ repairTime: number
|
|
|
+ selfStopTime: number
|
|
|
+ complexityTime: number
|
|
|
+ relocationTime: number
|
|
|
+ rectificationTime: number
|
|
|
+ waitingStopTime: number
|
|
|
+ winterBreakTime: number
|
|
|
+ partyaDesign: number
|
|
|
+ partyaPrepare: number
|
|
|
+ partyaResource: number
|
|
|
+ otherNptTime: number
|
|
|
+ otherNptReason: string
|
|
|
+ responsiblePersonNames: string
|
|
|
+ submitterNames: string
|
|
|
+ nonProductFlag: boolean
|
|
|
+}
|
|
|
+
|
|
|
+const list = ref<ListItem[]>([])
|
|
|
+const total = ref(0)
|
|
|
+
|
|
|
+const loading = ref(false)
|
|
|
|
|
|
-/** 查询列表 */
|
|
|
-const getList = async () => {
|
|
|
+const loadList = useDebounceFn(async function () {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
- const data = await IotRdDailyReportApi.getIotRdDailyReportPage(queryParams)
|
|
|
+ const data = await IotRdDailyReportApi.getIotRdDailyReportPage(query.value)
|
|
|
list.value = data.list
|
|
|
total.value = data.total
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
}
|
|
|
+})
|
|
|
+
|
|
|
+function handleSizeChange(val: number) {
|
|
|
+ query.value.pageSize = val
|
|
|
+ handleQuery()
|
|
|
}
|
|
|
|
|
|
-// 响应式变量存储选中的部门
|
|
|
-const selectedDept = ref<{ id: number; name: string }>()
|
|
|
-/** 处理部门被点击 */
|
|
|
-const handleDeptNodeClick = async (row) => {
|
|
|
- // 记录选中的部门信息
|
|
|
- selectedDept.value = { id: row.id, name: row.name }
|
|
|
- queryParams.deptId = row.id
|
|
|
- await getList()
|
|
|
+function handleCurrentChange(val: number) {
|
|
|
+ query.value.pageNo = val
|
|
|
+ loadList()
|
|
|
}
|
|
|
|
|
|
-/** 搜索按钮操作 */
|
|
|
-const handleQuery = () => {
|
|
|
- queryParams.pageNo = 1
|
|
|
- getList()
|
|
|
+function handleQuery(setPage = true) {
|
|
|
+ if (setPage) {
|
|
|
+ query.value.pageNo = 1
|
|
|
+ }
|
|
|
+ loadList()
|
|
|
}
|
|
|
|
|
|
-/** 重置按钮操作 */
|
|
|
-const resetQuery = () => {
|
|
|
- queryFormRef.value.resetFields()
|
|
|
+function resetQuery() {
|
|
|
+ query.value = { ...initQuery }
|
|
|
+
|
|
|
handleQuery()
|
|
|
}
|
|
|
|
|
|
-/** 添加/修改操作 */
|
|
|
-const formRef = ref()
|
|
|
-const openForm = (type: string, id?: number, istime: string = 'false') => {
|
|
|
- push({ name: 'FillDailyReportForm', params: { id: id, mode: 'fill' }, query: { istime: istime } })
|
|
|
+watch(
|
|
|
+ [
|
|
|
+ () => query.value.deptId,
|
|
|
+ () => query.value.contractName,
|
|
|
+ () => query.value.taskName,
|
|
|
+ () => query.value.createTime
|
|
|
+ ],
|
|
|
+ () => {
|
|
|
+ handleQuery()
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+)
|
|
|
+
|
|
|
+const openForm = (_type: string, id?: number, istime: string = 'false') => {
|
|
|
+ router.push({
|
|
|
+ name: 'FillDailyReportForm',
|
|
|
+ params: { id: id, mode: 'fill' },
|
|
|
+ query: { istime: istime }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
-/** 删除按钮操作 */
|
|
|
-const handleDelete = async (id: number) => {
|
|
|
- try {
|
|
|
- // 删除的二次确认
|
|
|
- await message.delConfirm()
|
|
|
- // 发起删除
|
|
|
- await IotRdDailyReportApi.deleteIotRdDailyReport(id)
|
|
|
- message.success(t('common.delSuccess'))
|
|
|
- // 刷新列表
|
|
|
- await getList()
|
|
|
- } catch {}
|
|
|
+// const exportLoading = ref(false)
|
|
|
+
|
|
|
+// async function handleExport() {
|
|
|
+// try {
|
|
|
+// await message.exportConfirm()
|
|
|
+
|
|
|
+// exportLoading.value = true
|
|
|
+// const res = await IotRdDailyReportApi.exportIotRdDailyReportDetails(query.value)
|
|
|
+
|
|
|
+// download.excel(res, '瑞都日报明细.xlsx')
|
|
|
+// } finally {
|
|
|
+// exportLoading.value = false
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+const { ZmTable, ZmTableColumn } = useTableComponents<ListItem>()
|
|
|
+
|
|
|
+function formCreateTime(row: ListItem) {
|
|
|
+ return dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss')
|
|
|
+}
|
|
|
+
|
|
|
+function realValue(type: any, value: string) {
|
|
|
+ const option = getDictOptions(type).find((item) => item.value === value)
|
|
|
+ return option?.label || value
|
|
|
}
|
|
|
|
|
|
-/** 查看日报详情 */
|
|
|
-const handleDetail = async (id: number) => {
|
|
|
+function handleDetail(id: number) {
|
|
|
try {
|
|
|
- // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
|
|
|
- push({
|
|
|
+ router.push({
|
|
|
name: 'FillDailyReportForm',
|
|
|
params: {
|
|
|
id: id.toString(),
|
|
|
- mode: 'detail' // 添加详情模式标识
|
|
|
+ mode: 'detail'
|
|
|
}
|
|
|
})
|
|
|
} catch (error) {
|
|
|
console.error('跳转详情页面失败:', error)
|
|
|
}
|
|
|
}
|
|
|
+</script>
|
|
|
|
|
|
-const exportLoading = ref(false)
|
|
|
-const handleExport = async () => {}
|
|
|
+<template>
|
|
|
+ <div
|
|
|
+ class="grid grid-cols-[15%_1fr] grid-rows-[62px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
|
|
|
+ >
|
|
|
+ <div class="p-4 bg-white dark:bg-[#1d1e1f] shadow rounded-lg row-span-2">
|
|
|
+ <DeptTreeSelect :top-id="163" :deptId="deptId" v-model="query.deptId" :show-title="false" />
|
|
|
+ </div>
|
|
|
+ <el-form
|
|
|
+ size="default"
|
|
|
+ class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
|
|
|
+ >
|
|
|
+ <div class="flex items-center gap-8">
|
|
|
+ <el-form-item label="项目">
|
|
|
+ <el-input
|
|
|
+ v-model="query.contractName"
|
|
|
+ placeholder="请输入项目"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery()"
|
|
|
+ class="!w-240px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="任务">
|
|
|
+ <el-input
|
|
|
+ v-model="query.taskName"
|
|
|
+ placeholder="请输入任务"
|
|
|
+ clearable
|
|
|
+ @keyup.enter="handleQuery()"
|
|
|
+ class="!w-240px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建时间" prop="createTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="query.createTime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
+ class="!w-220px"
|
|
|
+ :shortcuts="rangeShortcuts"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleQuery()">
|
|
|
+ <Icon icon="ep:search" class="mr-5px" /> 搜索
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ @click="openForm('create')"
|
|
|
+ v-hasPermi="['pms:iot-rd-daily-report:create']"
|
|
|
+ >
|
|
|
+ <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
+ </el-button>
|
|
|
+ <!-- <el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
+ </el-button> -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="bg-white dark:bg-[#1d1e1f] shadow rounded-lg flex flex-col p-4">
|
|
|
+ <div class="flex-1 relative">
|
|
|
+ <el-auto-resizer class="absolute">
|
|
|
+ <template #default="{ width, height }">
|
|
|
+ <zm-table
|
|
|
+ :data="list"
|
|
|
+ :loading="loading"
|
|
|
+ :width="width"
|
|
|
+ :max-height="height"
|
|
|
+ :height="height"
|
|
|
+ show-border
|
|
|
+ >
|
|
|
+ <zm-table-column label="操作" width="120" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ @click="openForm('fill', scope.row.id)"
|
|
|
+ v-hasPermi="['pms:iot-rd-daily-report:update']"
|
|
|
+ v-if="scope.row.status === 0"
|
|
|
+ >
|
|
|
+ 填报
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="success"
|
|
|
+ @click="handleDetail(scope.row.id)"
|
|
|
+ v-hasPermi="['pms:iot-rd-daily-report:query']"
|
|
|
+ >
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ :type="
|
|
|
+ scope.row.nonProductFlag || scope.row.processInstanceId === '2'
|
|
|
+ ? 'success'
|
|
|
+ : 'warning'
|
|
|
+ "
|
|
|
+ @click="openForm('fill', scope.row.id, 'true')"
|
|
|
+ v-hasPermi="['pms:iot-rd-daily-report:non-productive']"
|
|
|
+ v-if="scope.row.auditStatus === 20"
|
|
|
+ >
|
|
|
+ 时效
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </zm-table-column>
|
|
|
+ <zm-table-column
|
|
|
+ prop="createTime"
|
|
|
+ label="创建时间"
|
|
|
+ cover-formatter
|
|
|
+ :real-value="formCreateTime"
|
|
|
+ />
|
|
|
+ <zm-table-column
|
|
|
+ prop="status"
|
|
|
+ label="日报状态"
|
|
|
+ cover-formatter
|
|
|
+ :real-value="
|
|
|
+ (row: ListItem) =>
|
|
|
+ realValue(DICT_TYPE.OPERATION_FILL_ORDER_STATUS, row.status ?? '')
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <dict-tag
|
|
|
+ :type="DICT_TYPE.OPERATION_FILL_ORDER_STATUS"
|
|
|
+ :value="scope.row.status"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </zm-table-column>
|
|
|
+ <zm-table-column prop="auditStatus" label="审批状态">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tag v-if="scope.row.auditStatus === 0" type="info">
|
|
|
+ {{ '待提交' }}
|
|
|
+ </el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.auditStatus === 10">
|
|
|
+ {{ '待审批' }}
|
|
|
+ </el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.auditStatus === 20" type="success">
|
|
|
+ {{ '审批通过' }}
|
|
|
+ </el-tag>
|
|
|
+ <el-tag v-else-if="scope.row.auditStatus === 30" type="danger">
|
|
|
+ {{ '审批拒绝' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </zm-table-column>
|
|
|
+ <zm-table-column prop="deptName" label="施工队伍" />
|
|
|
+ <zm-table-column prop="contractName" label="项目" />
|
|
|
+ <zm-table-column prop="taskName" label="任务" />
|
|
|
+ <zm-table-column
|
|
|
+ prop="nonProductionRate"
|
|
|
+ label="非生产时效"
|
|
|
+ cover-formatter
|
|
|
+ :real-value="(row) => (Number(row.nonProductionRate ?? 0) * 100).toFixed(2) + '%'"
|
|
|
+ />
|
|
|
+ <zm-table-column label="非生产时间">
|
|
|
+ <zm-table-column prop="accidentTime" label="工程质量" />
|
|
|
+ <zm-table-column prop="repairTime" label="设备故障" />
|
|
|
+ <zm-table-column prop="selfStopTime" label="设备保养" />
|
|
|
+ <zm-table-column prop="complexityTime" label="技术受限" />
|
|
|
+ <zm-table-column prop="relocationTime" label="生产配合" />
|
|
|
+ <zm-table-column prop="rectificationTime" label="生产组织" />
|
|
|
+ <zm-table-column prop="waitingStopTime" label="不可抗力" />
|
|
|
+ <zm-table-column prop="winterBreakTime" label="待命" />
|
|
|
+ <zm-table-column prop="partyaDesign" label="甲方设计" />
|
|
|
+ <zm-table-column prop="partyaPrepare" label="甲方准备" />
|
|
|
+ <zm-table-column prop="partyaResource" label="甲方资源" />
|
|
|
+ <zm-table-column prop="otherNptTime" label="其它非生产时间" />
|
|
|
+ </zm-table-column>
|
|
|
+ <zm-table-column prop="otherNptReason" label="其他非生产时间原因" />
|
|
|
+ <zm-table-column prop="responsiblePersonNames" label="带班干部" />
|
|
|
+ <zm-table-column prop="submitterNames" label="填报人" />
|
|
|
+ </zm-table>
|
|
|
+ </template>
|
|
|
+ </el-auto-resizer>
|
|
|
+ </div>
|
|
|
+ <div class="h-10 mt-4 flex items-center justify-end">
|
|
|
+ <el-pagination
|
|
|
+ size="default"
|
|
|
+ v-show="total > 0"
|
|
|
+ v-model:current-page="query.pageNo"
|
|
|
+ v-model:page-size="query.pageSize"
|
|
|
+ :background="true"
|
|
|
+ :page-sizes="[12, 20, 30, 50, 100]"
|
|
|
+ :total="total"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
-/** 初始化 **/
|
|
|
-onMounted(() => {
|
|
|
- getList()
|
|
|
-})
|
|
|
-</script>
|
|
|
+ <IotRdDailyReportForm ref="formRef" @success="loadList" />
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+:deep(.el-form-item) {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+</style>
|