Files
admin-sjzx/src/views/pqs/supervise/electricalEnergy/components/filling.vue

188 lines
5.7 KiB
Vue
Raw Normal View History

2024-03-18 19:43:55 +08:00
<template>
2024-04-03 16:24:14 +08:00
<el-divider content-position="left" style="font-size: 18px; font-weight: bolder">问题基本信息</el-divider>
<el-form :inline="true" label-width="auto">
<el-form-item label="所属单位:">
<el-input v-model="addData.orgName" clearable placeholder="请填写" disabled></el-input>
</el-form-item>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<el-form-item label="问题来源:">
<el-select disabled v-model="addData.problemSources" placeholder="请选择">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<el-form-item label="问题名称:">
<el-input v-model="addData.problemName" clearable placeholder="请填写" disabled></el-input>
</el-form-item>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<el-form-item label="问题编号:">
<el-input v-model="addData.powerQualityProblemNo" disabled clearable placeholder="请填写"></el-input>
</el-form-item>
</el-form>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<el-divider content-position="left" style="font-size: 18px; font-weight: bolder">填报流程</el-divider>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<el-steps :active="active" finish-status="success" class="mb10" simple>
<el-step v-for="(item, i) in stepTitle">
<template #title>
<span @click="step(i)">{{ item }}</span>
</template>
</el-step>
</el-steps>
2024-03-18 19:43:55 +08:00
2024-04-03 16:24:14 +08:00
<!-- 原因分析 0 -->
2024-04-07 16:40:16 +08:00
<process1
v-if="control == 0"
:addData="addData"
:List="List"
:disabled="disabled"
ref="process0Ref"
@handleClose="handleClose"
/>
2024-04-03 16:24:14 +08:00
<!-- 计划整改措施 1-->
2024-04-07 16:40:16 +08:00
<process2
v-if="control == 1"
:addData="addData"
:List="List"
:disabled="disabled"
ref="process1Ref"
@handleClose="handleClose"
/>
2024-04-03 16:24:14 +08:00
<!-- 实际采取措施 2 -->
2024-04-07 16:40:16 +08:00
<process3
v-if="control == 2"
:addData="addData"
:List="List"
:disabled="disabled"
ref="process2Ref"
@handleClose="handleClose"
/>
2024-04-03 16:24:14 +08:00
<!-- 成效分析 3 -->
2024-04-07 16:40:16 +08:00
<process4
v-if="control == 3"
:addData="addData"
:List="List"
:disabled="disabled"
ref="process3Ref"
@handleClose="handleClose"
/>
2024-03-18 19:43:55 +08:00
2024-04-07 16:40:16 +08:00
<div style="display: flex; justify-content: center; margin-top: 10px" v-show="!disabled">
2024-04-03 16:24:14 +08:00
<el-button type="primary" @click="Submit">提交审核</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
2024-03-18 19:43:55 +08:00
</template>
<script setup lang="ts">
2024-04-07 16:40:16 +08:00
import { ref, onMounted } from 'vue'
2024-03-18 19:43:55 +08:00
import { useDictData } from '@/stores/dictData'
2024-04-02 16:43:18 +08:00
import process1 from './process1.vue'
import process2 from './process2.vue'
import process3 from './process3.vue'
import process4 from './process4.vue'
2024-04-09 16:52:11 +08:00
import {
getAbnormalDetail,
getComplaintDetail,
getGeneralSurveyDetail,
getExcessiveDetail
} from '@/api/process-boot/electricitymanagement'
2024-04-03 16:24:14 +08:00
const emit = defineEmits(['beforeClose'])
2024-03-18 19:43:55 +08:00
const dictData = useDictData()
const addData: any = ref({})
2024-04-07 16:40:16 +08:00
const List: any = ref({})
2024-04-02 16:43:18 +08:00
const active = ref(4)
2024-03-18 19:43:55 +08:00
const control = ref()
2024-04-02 16:43:18 +08:00
const stepTitle = ['原因分析', '计划整改措施', '实际采取措施', '成效分析']
const process0Ref = ref()
2024-04-03 16:24:14 +08:00
const process1Ref = ref()
const process2Ref = ref()
const process3Ref = ref()
2024-04-07 16:40:16 +08:00
const disabled = ref(false)
const prop = defineProps({
isDisabled: {
type: Boolean,
default: false
}
})
2024-03-18 19:43:55 +08:00
const problemData = dictData.getBasicData('Problem_Sources')
2024-04-09 16:52:11 +08:00
const open = async (row: any) => {
2024-03-18 19:43:55 +08:00
addData.value = row
2024-04-09 16:52:11 +08:00
let res: any = {}
if (row.problemSources == '设备异常') {
res = await getAbnormalDetail(row.powerQualityProblemNo)
} else if (row.problemSources == '在线监测告警') {
res = await getExcessiveDetail(row.powerQualityProblemNo)
} else if (row.problemSources == '用户投诉') {
res = await getComplaintDetail(row.powerQualityProblemNo)
} else if (row.problemSources == '普测超标') {
res = await getGeneralSurveyDetail(row.powerQualityProblemNo)
}
2024-04-03 16:24:14 +08:00
2024-04-09 16:52:11 +08:00
setTimeout(() => {
2024-04-07 16:40:16 +08:00
List.value = res.data
2024-04-09 16:52:11 +08:00
2024-04-02 16:43:18 +08:00
if (res.data.filePathYyfx == null) {
active.value = 0
} else if (res.data.filePathJhzg == null) {
active.value = 1
2024-04-03 16:24:14 +08:00
if (row.reportProcessStatus == 'Fail') {
active.value = 0
}
2024-04-02 16:43:18 +08:00
} else if (res.data.filePathSjcq == null) {
active.value = 2
2024-04-03 16:24:14 +08:00
if (row.reportProcessStatus == 'Fail') {
active.value = 1
}
2024-04-02 16:43:18 +08:00
} else if (res.data.filePathZlxg == null) {
active.value = 3
2024-04-03 16:24:14 +08:00
if (row.reportProcessStatus == 'Fail') {
active.value = 2
}
2024-04-02 16:43:18 +08:00
}
2024-04-07 16:40:16 +08:00
control.value = active.value == 4 ? 3 : active.value
2024-04-09 16:52:11 +08:00
}, 0)
2024-03-18 19:43:55 +08:00
}
2024-04-02 16:43:18 +08:00
2024-03-18 19:43:55 +08:00
const step = (e: number) => {
if (active.value >= e) {
control.value = e
2024-04-07 16:40:16 +08:00
if (active.value == e && !prop.isDisabled) {
disabled.value = false
} else {
disabled.value = true
}
2024-03-18 19:43:55 +08:00
}
}
2024-04-07 16:40:16 +08:00
onMounted(() => {
if (prop.isDisabled) {
disabled.value = prop.isDisabled
}
})
2024-03-18 19:43:55 +08:00
// 提交
2024-04-02 16:43:18 +08:00
const Submit = () => {
if (control.value == 0) {
2024-04-09 16:52:11 +08:00
process0Ref.value.submit(0)
2024-04-02 16:43:18 +08:00
} else if (control.value == 1) {
2024-04-09 16:52:11 +08:00
process1Ref.value.submit(1)
2024-04-02 16:43:18 +08:00
} else if (control.value == 2) {
2024-04-09 16:52:11 +08:00
process2Ref.value.submit(2)
2024-04-02 16:43:18 +08:00
} else if (control.value == 3) {
2024-04-09 16:52:11 +08:00
process3Ref.value.submit(3)
2024-04-02 16:43:18 +08:00
}
}
2024-03-18 19:43:55 +08:00
// 取消
const handleClose = () => {
2024-04-03 16:24:14 +08:00
emit('beforeClose')
2024-03-18 19:43:55 +08:00
}
defineExpose({ open })
</script>
2024-04-02 16:43:18 +08:00
<style lang="scss" scoped>
:deep(.el-upload-list__item) {
width: 400px;
}
</style>