完成 电能质量问题管理页面 修改 谐波普测管理页面

This commit is contained in:
GGJ
2024-04-10 20:33:20 +08:00
parent 926112d2a7
commit 071ee4d2b5
23 changed files with 1242 additions and 524 deletions

View File

@@ -72,10 +72,37 @@
@handleClose="handleClose"
/>
<!-- 填报 -->
<div style="display: flex; justify-content: center; margin-top: 10px" v-show="!disabled">
<el-button type="primary" @click="Submit">提交审核</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
<!-- 审核 -->
<el-form
label-width="100px"
:model="form"
ref="ruleFormRef"
:rules="rules"
v-if="disabled && audit && flag && control == active"
>
<el-form-item prop="checkComment" label="审核意见:">
<el-input
type="textarea"
style="width: 400px"
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="请输入内容"
v-model="form.checkComment"
></el-input>
</el-form-item>
</el-form>
<div
style="display: flex; justify-content: center; margin-top: 10px"
v-if="disabled && audit && flag && control == active"
>
<el-button type="primary" @click="adopt(1)">通过</el-button>
<el-button type="primary" @click="adopt(0)">不通过</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
@@ -84,11 +111,13 @@ import process1 from './process1.vue'
import process2 from './process2.vue'
import process3 from './process3.vue'
import process4 from './process4.vue'
import { ElMessage } from 'element-plus'
import {
getAbnormalDetail,
getComplaintDetail,
getGeneralSurveyDetail,
getExcessiveDetail
getExcessiveDetail,
checkPowerQuality
} from '@/api/process-boot/electricitymanagement'
const emit = defineEmits(['beforeClose'])
const dictData = useDictData()
@@ -96,18 +125,31 @@ const addData: any = ref({})
const List: any = ref({})
const active = ref(4)
const control = ref()
const ruleFormRef = ref()
const stepTitle = ['原因分析', '计划整改措施', '实际采取措施', '成效分析']
const process0Ref = ref()
const process1Ref = ref()
const process2Ref = ref()
const process3Ref = ref()
const form = ref({
checkComment: ''
})
const disabled = ref(false)
const prop = defineProps({
isDisabled: {
type: Boolean,
default: false
},
audit: {
type: Boolean,
default: false
},
flag: {
type: Boolean,
default: false
}
})
const problemData = dictData.getBasicData('Problem_Sources')
const open = async (row: any) => {
addData.value = row
@@ -124,7 +166,6 @@ const open = async (row: any) => {
setTimeout(() => {
List.value = res.data
if (res.data.filePathYyfx == null) {
active.value = 0
} else if (res.data.filePathJhzg == null) {
@@ -143,9 +184,18 @@ const open = async (row: any) => {
active.value = 2
}
}
// 审核判断
if (prop.audit) {
active.value == 0 ? 0 : (active.value = active.value - 1)
}
control.value = active.value == 4 ? 3 : active.value
}, 0)
}
const rules = {
checkComment: [{ required: true, message: '请输入审核意见', trigger: 'blur' }]
}
const step = (e: number) => {
if (active.value >= e) {
@@ -176,8 +226,31 @@ const Submit = () => {
}
// 取消
const handleClose = () => {
form.value.checkComment = ''
emit('beforeClose')
}
// 审核
const adopt = (type: number) => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
const adminInfo = window.localStorage.getItem('adminInfo')
const adminName = adminInfo ? JSON.parse(adminInfo).name : ''
checkPowerQuality({
checkComment: form.value.checkComment,
checkPerson: adminName,
checkResult: type,
powerQualityProblemNo: addData.value.powerQualityProblemNo,
reportProcess: addData.value.reportProcess
}).then((res: any) => {
ElMessage.success(res.message)
handleClose()
})
}
})
}
defineExpose({ open })
</script>
<style lang="scss" scoped>