|
|
@@ -44,6 +44,10 @@ interface PlanRow {
|
|
|
startTime: string
|
|
|
endTime: string
|
|
|
showEndTime: boolean
|
|
|
+ planWellTrips?: string
|
|
|
+ planLayers?: string
|
|
|
+ planGasInjection?: string
|
|
|
+ planFootage?: string
|
|
|
}
|
|
|
|
|
|
const message = useMessage()
|
|
|
@@ -107,10 +111,18 @@ const timestampToDateTime = (timestamp: number | string | null | undefined): str
|
|
|
return dayjs(value).format('YYYY-MM-DD HH:mm')
|
|
|
}
|
|
|
|
|
|
+let currentTableCol = ref<any[]>([])
|
|
|
const openPlanDialog = async (row: ProjectTaskRow) => {
|
|
|
currentRow.value = row
|
|
|
planList.value = []
|
|
|
|
|
|
+ try {
|
|
|
+ const res = await IotProjectTaskScheduleApi.getWorkload(row.id)
|
|
|
+ currentTableCol.value = res
|
|
|
+ } catch {
|
|
|
+ message.error('获取部门数据失败')
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
getWorkProgressDictOptions()
|
|
|
const taskSchedules = await IotProjectTaskScheduleApi.getIotProjectTaskSchedules({
|
|
|
@@ -120,12 +132,17 @@ const openPlanDialog = async (row: ProjectTaskRow) => {
|
|
|
if (taskSchedules?.length) {
|
|
|
planList.value = taskSchedules.map((plan: any) => {
|
|
|
const status = plan.status
|
|
|
+
|
|
|
return {
|
|
|
id: plan.id,
|
|
|
status,
|
|
|
startTime: timestampToDateTime(plan.startTime),
|
|
|
endTime: timestampToDateTime(plan.endTime),
|
|
|
- showEndTime: status !== COMPLETED_STATUS
|
|
|
+ showEndTime: status !== COMPLETED_STATUS,
|
|
|
+ planWellTrips: plan.planWellTrips,
|
|
|
+ planLayers: plan.planLayers,
|
|
|
+ planGasInjection: plan.planGasInjection,
|
|
|
+ planFootage: plan.planFootage
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -162,12 +179,42 @@ const removeRow = (index: number) => {
|
|
|
}
|
|
|
|
|
|
const savePlan = async () => {
|
|
|
+ console.log('ssssssssssssssss', currentTableCol.value[0])
|
|
|
try {
|
|
|
saveLoading.value = true
|
|
|
|
|
|
for (let index = 0; index < planList.value.length; index++) {
|
|
|
- if (!planList.value[index].status) {
|
|
|
- message.error(`第${index + 1}行请选择施工状态`)
|
|
|
+ // if (!planList.value[index].status) {
|
|
|
+ // message.error(`第${index + 1}行请选择施工状态`)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (!planList.value[index].startTime) {
|
|
|
+ message.error(`第${index + 1}行请选择开始时间`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (
|
|
|
+ currentTableCol.value[0].identifier === 'planLayers' &&
|
|
|
+ !planList.value[index].planLayers
|
|
|
+ ) {
|
|
|
+ message.error(`第${index + 1}行请选择计划层数`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (
|
|
|
+ currentTableCol.value[0].identifier === 'planWellTrips' &&
|
|
|
+ !planList.value[index].planWellTrips
|
|
|
+ ) {
|
|
|
+ message.error(`第${index + 1}行请选择计划井次`)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (
|
|
|
+ currentTableCol.value[0].identifier === 'planGasInjection' &&
|
|
|
+ !planList.value[index].planGasInjection
|
|
|
+ ) {
|
|
|
+ message.error(`第${index + 1}行请选择计划注气量`)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
@@ -178,14 +225,19 @@ const savePlan = async () => {
|
|
|
status: item.status,
|
|
|
startTime: item.startTime ? new Date(item.startTime).getTime() : null,
|
|
|
endTime:
|
|
|
- item.status !== COMPLETED_STATUS && item.endTime ? new Date(item.endTime).getTime() : null
|
|
|
+ item.status !== COMPLETED_STATUS && item.endTime ? new Date(item.endTime).getTime() : null,
|
|
|
+ planWellTrips: item.planWellTrips,
|
|
|
+ planLayers: item.planLayers,
|
|
|
+ planGasInjection: item.planGasInjection,
|
|
|
+ planFootage: item.planFootage
|
|
|
}))
|
|
|
|
|
|
await IotProjectTaskScheduleApi.saveTaskSchedule(submitData)
|
|
|
message.success('保存成功')
|
|
|
planDialogVisible.value = false
|
|
|
getList()
|
|
|
- } catch {
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
message.error('保存失败')
|
|
|
} finally {
|
|
|
saveLoading.value = false
|
|
|
@@ -292,15 +344,13 @@ onMounted(async () => {
|
|
|
|
|
|
<template>
|
|
|
<div
|
|
|
- class="iot-project-task-page grid grid-rows-[auto_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
|
|
|
- >
|
|
|
+ class="iot-project-task-page grid grid-rows-[auto_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
|
|
|
<el-form
|
|
|
ref="queryFormRef"
|
|
|
:model="queryParams"
|
|
|
size="default"
|
|
|
label-width="72px"
|
|
|
- class="iot-project-task-query bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-6 py-3 min-w-0"
|
|
|
- >
|
|
|
+ class="iot-project-task-query bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-6 py-3 min-w-0">
|
|
|
<div class="query-row">
|
|
|
<el-form-item label="公司" prop="companyId">
|
|
|
<el-select
|
|
|
@@ -308,14 +358,12 @@ onMounted(async () => {
|
|
|
placeholder="请选择公司"
|
|
|
clearable
|
|
|
filterable
|
|
|
- class="w-full"
|
|
|
- >
|
|
|
+ class="w-full">
|
|
|
<el-option
|
|
|
v-for="item in companyDeptList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
+ :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户名称" prop="manufactureName">
|
|
|
@@ -324,8 +372,7 @@ onMounted(async () => {
|
|
|
placeholder="请输入客户名称"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="合同名称" prop="contractName">
|
|
|
<el-input
|
|
|
@@ -333,8 +380,7 @@ onMounted(async () => {
|
|
|
placeholder="请输入合同名称"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="合同编号" prop="contractCode">
|
|
|
<el-input
|
|
|
@@ -342,8 +388,7 @@ onMounted(async () => {
|
|
|
placeholder="请输入合同编号"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="施工队伍" prop="deptName">
|
|
|
<el-input
|
|
|
@@ -351,8 +396,7 @@ onMounted(async () => {
|
|
|
placeholder="请输入施工队伍"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="井号" prop="wellName">
|
|
|
<el-input
|
|
|
@@ -360,8 +404,7 @@ onMounted(async () => {
|
|
|
placeholder="请输入井号"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @keyup.enter="handleQuery"
|
|
|
- />
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="平台井" prop="platformFlag">
|
|
|
<el-select
|
|
|
@@ -369,8 +412,7 @@ onMounted(async () => {
|
|
|
placeholder="请选择平台井"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @change="handleQuery"
|
|
|
- >
|
|
|
+ @change="handleQuery">
|
|
|
<el-option label="全部" value="A" />
|
|
|
<el-option label="是" value="Y" />
|
|
|
<el-option label="否" value="N" />
|
|
|
@@ -384,8 +426,7 @@ onMounted(async () => {
|
|
|
start-placeholder="开始日期"
|
|
|
end-placeholder="结束日期"
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
- class="w-full"
|
|
|
- />
|
|
|
+ class="w-full" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item class="query-actions">
|
|
|
@@ -410,15 +451,13 @@ onMounted(async () => {
|
|
|
:width="width"
|
|
|
:height="height"
|
|
|
:max-height="height"
|
|
|
- show-border
|
|
|
- >
|
|
|
+ show-border>
|
|
|
<ZmTableColumn
|
|
|
type="index"
|
|
|
:label="t('monitor.serial')"
|
|
|
:width="70"
|
|
|
fixed="left"
|
|
|
- hide-in-column-settings
|
|
|
- />
|
|
|
+ hide-in-column-settings />
|
|
|
<ZmTableColumn prop="manufactureName" label="客户名称" min-width="180" fixed="left" />
|
|
|
<ZmTableColumn prop="contractName" label="合同名称" min-width="220" />
|
|
|
<ZmTableColumn prop="contractCode" label="合同编号" min-width="150" />
|
|
|
@@ -437,32 +476,28 @@ onMounted(async () => {
|
|
|
link
|
|
|
type="primary"
|
|
|
@click="openPlanDialog(row)"
|
|
|
- v-hasPermi="['rq:iot-project-task:update']"
|
|
|
- >
|
|
|
+ v-hasPermi="['rq:iot-project-task:update']">
|
|
|
计划
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-if="Number(row.deptId) === REPORT_DEPT_ID"
|
|
|
link
|
|
|
type="primary"
|
|
|
- @click="openGenerateReportDialog(row)"
|
|
|
- >
|
|
|
+ @click="openGenerateReportDialog(row)">
|
|
|
生成日报
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
@click="openForm('update', row.id, row.projectId)"
|
|
|
- v-hasPermi="['rq:iot-project-task:update']"
|
|
|
- >
|
|
|
+ v-hasPermi="['rq:iot-project-task:update']">
|
|
|
编辑
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
link
|
|
|
type="danger"
|
|
|
@click="handleDelete(row.id)"
|
|
|
- v-hasPermi="['rq:iot-project-task:delete']"
|
|
|
- >
|
|
|
+ v-hasPermi="['rq:iot-project-task:delete']">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -483,8 +518,7 @@ onMounted(async () => {
|
|
|
:total="total"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
@size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -492,8 +526,7 @@ onMounted(async () => {
|
|
|
<el-dialog
|
|
|
v-model="planDialogVisible"
|
|
|
:title="`${currentRow?.contractName || ''} - ${currentRow?.wellName || ''} - 任务计划`"
|
|
|
- width="80%"
|
|
|
- >
|
|
|
+ width="80%">
|
|
|
<div class="mb-15px">
|
|
|
<el-button type="primary" @click="addNewRow">
|
|
|
<Icon icon="ep:plus" class="mr-5px" />新增行
|
|
|
@@ -506,24 +539,22 @@ onMounted(async () => {
|
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="施工状态" min-width="200">
|
|
|
+ <!-- <el-table-column label="施工状态" min-width="200">
|
|
|
<template #default="scope">
|
|
|
<el-select
|
|
|
v-model="scope.row.status"
|
|
|
placeholder="请选择施工状态"
|
|
|
clearable
|
|
|
class="w-full"
|
|
|
- @change="onStatusChange(scope.row)"
|
|
|
- >
|
|
|
+ @change="onStatusChange(scope.row)">
|
|
|
<el-option
|
|
|
v-for="dict in workProgressDictOptions"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- />
|
|
|
+ :value="dict.value" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="开始时间" min-width="200">
|
|
|
<template #default="scope">
|
|
|
<el-date-picker
|
|
|
@@ -532,8 +563,7 @@ onMounted(async () => {
|
|
|
placeholder="选择开始时间"
|
|
|
value-format="YYYY-MM-DD HH:mm"
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
- class="w-full"
|
|
|
- />
|
|
|
+ class="w-full" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="结束时间" min-width="200">
|
|
|
@@ -545,10 +575,21 @@ onMounted(async () => {
|
|
|
placeholder="选择结束时间"
|
|
|
value-format="YYYY-MM-DD HH:mm"
|
|
|
format="YYYY-MM-DD HH:mm"
|
|
|
- class="w-full"
|
|
|
- />
|
|
|
+ class="w-full" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ min-width="120"
|
|
|
+ v-for="item in currentTableCol"
|
|
|
+ :key="item.identifier"
|
|
|
+ :label="item.name"
|
|
|
+ :prop="item.identifier">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input type="number" v-model="scope.row[item.identifier]" placeholder="请输入" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column label="操作" width="100" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-button link type="danger" @click="removeRow(scope.$index)">删除</el-button>
|
|
|
@@ -573,8 +614,7 @@ onMounted(async () => {
|
|
|
placeholder="请选择日期"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
format="YYYY-MM-DD"
|
|
|
- class="w-full!"
|
|
|
- />
|
|
|
+ class="w-full!" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -585,8 +625,7 @@ onMounted(async () => {
|
|
|
size="default"
|
|
|
type="primary"
|
|
|
:loading="generateReportLoading"
|
|
|
- @click="submitGenerateReport"
|
|
|
- >
|
|
|
+ @click="submitGenerateReport">
|
|
|
确定
|
|
|
</el-button>
|
|
|
</span>
|
|
|
@@ -603,8 +642,7 @@ onMounted(async () => {
|
|
|
placeholder="请选择日期"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
format="YYYY-MM-DD"
|
|
|
- class="w-full!"
|
|
|
- />
|
|
|
+ class="w-full!" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -615,8 +653,7 @@ onMounted(async () => {
|
|
|
size="default"
|
|
|
type="primary"
|
|
|
@click="submitGenerateReport"
|
|
|
- :loading="generateReportLoading"
|
|
|
- >
|
|
|
+ :loading="generateReportLoading">
|
|
|
确定
|
|
|
</el-button>
|
|
|
</span>
|