联调 常态化干扰源用户管理 保存功能

This commit is contained in:
GGJ
2024-06-27 14:45:58 +08:00
parent 531ed72641
commit fac38dd9cc
8 changed files with 228 additions and 52 deletions

View File

@@ -14,6 +14,16 @@ export const submitFormData = (data: any) => {
data: data data: data
}) })
} }
/**
* 提交表单数据
*/
export const addEditor = (data: any) => {
return createAxios({
url: '/supervision-boot/userReportRenewal/addEditor',
method: 'POST',
data: data
})
}
/** /**
* 重新发起表单数据(编辑) * 重新发起表单数据(编辑)

View File

@@ -26,6 +26,17 @@ export const getUserReportById = (id: any) => {
}) })
} }
/**
* 根据id获取用户档案录入的详细数据
*/
export const getUserReportUpdateById = (id: any) => {
return createAxios({
url: '/supervision-boot/userReportRenewal/getUserReportUpdateById?businessId='+id,
method: 'POST',
})
}
/** /**
* 下载敏感及重要用户模板 * 下载敏感及重要用户模板
*/ */

View File

@@ -93,7 +93,7 @@ const onTableCurrentChange = (val: number) => {
} }
const pageSizes = computed(() => { const pageSizes = computed(() => {
let defaultSizes = [10, 20, 50, 100] let defaultSizes = [10, 20, 50, 100,200]
if (tableStore.table.params!.pageSize) { if (tableStore.table.params!.pageSize) {
if (!defaultSizes.includes(tableStore.table.params!.pageSize)) { if (!defaultSizes.includes(tableStore.table.params!.pageSize)) {
defaultSizes.push(tableStore.table.params!.pageSize) defaultSizes.push(tableStore.table.params!.pageSize)

View File

@@ -92,7 +92,7 @@
v-model="form.complaintText" v-model="form.complaintText"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item for="-" label="稳态指标:" prop="steadyIndicator"> <el-form-item for="-" label="稳态指标:">
<el-checkbox-group v-model="form.steadyIndicator"> <el-checkbox-group v-model="form.steadyIndicator">
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start"> <div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
<el-checkbox <el-checkbox
@@ -100,13 +100,14 @@
v-for="(item, ind) in steadyStateList" v-for="(item, ind) in steadyStateList"
:key="ind" :key="ind"
:label="item.name" :label="item.name"
@change="changeSteadyState"
> >
{{ item.name }} {{ item.name }}
</el-checkbox> </el-checkbox>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item for="-" label="暂态指标:" prop="transientIndicators"> <el-form-item for="-" label="暂态指标:">
<el-checkbox-group v-model="form.transientIndicators"> <el-checkbox-group v-model="form.transientIndicators">
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start"> <div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
<el-checkbox <el-checkbox
@@ -114,6 +115,7 @@
v-for="(item, ind) in transientIndicatorsList" v-for="(item, ind) in transientIndicatorsList"
:key="ind" :key="ind"
:label="item.name" :label="item.name"
@change="changeTransientIndicators"
> >
{{ item.name }} {{ item.name }}
</el-checkbox> </el-checkbox>
@@ -169,7 +171,7 @@ const resetForm = () => {
} }
//字典获取所在地市 //字典获取所在地市
const areaOptionList = dictData.getBasicData('jibei_area') const areaOptionList = dictData.getBasicData('jibei_area')
resetForm()
const rules = { const rules = {
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }], userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
userNumber: [{ required: true, message: '请输入用户编号', trigger: 'blur' }], userNumber: [{ required: true, message: '请输入用户编号', trigger: 'blur' }],
@@ -214,6 +216,7 @@ const submit = () => {
} }
const open = (row: any) => { const open = (row: any) => {
resetForm()
dialogVisible.value = true dialogVisible.value = true
title.value = row.text title.value = row.text
} }
@@ -222,6 +225,12 @@ const handleClose = () => {
formRef.value && formRef.value.resetFields() formRef.value && formRef.value.resetFields()
dialogVisible.value = false dialogVisible.value = false
} }
const changeSteadyState = () => {
form.value.transientIndicators = []
}
const changeTransientIndicators = () => {
form.value.steadyIndicator = []
}
defineExpose({ open }) defineExpose({ open })
</script> </script>

View File

@@ -28,7 +28,7 @@
inactive-text="无数据" inactive-text="无数据"
/> />
</el-form-item> </el-form-item>
<el-form-item label="预警阈值"> <el-form-item label="预警阈值" >
<!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> --> <!-- <el-input v-model="tableStore.table.params.alertThreshold" placeholder="请输入预警阈值" clearable></el-input> -->
<el-input-number <el-input-number
v-model="tableStore.table.params.alertThreshold" v-model="tableStore.table.params.alertThreshold"
@@ -38,7 +38,7 @@
@change="changeAlert" @change="changeAlert"
/> />
</el-form-item> </el-form-item>
<el-form-item label="告警阈值"> <el-form-item label="告警阈值" >
<el-input-number <el-input-number
v-model="tableStore.table.params.alarmThreshold" v-model="tableStore.table.params.alarmThreshold"
:min="0" :min="0"
@@ -89,6 +89,7 @@ const tableRef = ref()
const industry = dictData.getBasicData('Business_Type') const industry = dictData.getBasicData('Business_Type')
const TableHeaderRef = ref() const TableHeaderRef = ref()
const alarmListRef = ref() const alarmListRef = ref()
const flagTime = ref(false)
const detailRef = ref() const detailRef = ref()
const list: any = ref({ const list: any = ref({
deptId: '', deptId: '',
@@ -98,7 +99,7 @@ const list: any = ref({
alarmThreshold: '' alarmThreshold: ''
}) })
const level: any = ref(dictData.state.area[0]?.level) const level: any = ref(dictData.state.area[0]?.level)
const flag = ref('') const flag:any = ref('')
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/supervision-boot/onlineMonitor/list', url: '/supervision-boot/onlineMonitor/list',
publicHeight: 65, publicHeight: 65,
@@ -136,6 +137,7 @@ const tableStore = new TableStore({
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/' return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
} }
}, },
{ {
field: 'overLimitDay', field: 'overLimitDay',
title: '累计超标天数', title: '累计超标天数',
@@ -143,7 +145,11 @@ const tableStore = new TableStore({
return row.cellValue != null ? row.cellValue : '/' return row.cellValue != null ? row.cellValue : '/'
} }
}, },
{
field: 'updateTime',
visible:flagTime,
title: '最新数据时间'
},
{ {
title: '操作', title: '操作',
width: '180', width: '180',
@@ -157,7 +163,9 @@ const tableStore = new TableStore({
type: 'primary', type: 'primary',
icon: 'el-icon-EditPen', icon: 'el-icon-EditPen',
render: 'basicButton', render: 'basicButton',
disabled: row => {
return row.targetType == 0
},
click: row => { click: row => {
detailRef.value.open({ detailRef.value.open({
text: '详情', text: '详情',
@@ -272,6 +280,8 @@ const tableStore = new TableStore({
list.value.alertThreshold = tableStore.table.params.alertThreshold list.value.alertThreshold = tableStore.table.params.alertThreshold
list.value.alarmThreshold = tableStore.table.params.alarmThreshold list.value.alarmThreshold = tableStore.table.params.alarmThreshold
flag.value = level.value flag.value = level.value
flagTime.value=tableStore.table.params.dataType==0?true:false
}, },
loadCallback: () => { loadCallback: () => {
// tableStore.table.data = [ // tableStore.table.data = [

View File

@@ -31,18 +31,28 @@
:close-on-click-modal="false" :close-on-click-modal="false"
draggable draggable
> >
<BpmUserReportDetail :id="interId" ref="detailsRef"></BpmUserReportDetail> <BpmUserReportDetail :id="interId" ref="detailsRef" :update="update"></BpmUserReportDetail>
</el-dialog> </el-dialog>
<!-- 查看详情 detail 新增/修改 create-->
<addForm
ref="addForms"
@onSubmit="tableStore.index()"
:update="update"
:normalizedControl="true"
openType="create"
></addForm>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
defineOptions({ defineOptions({
name: 'supervision/interferenceUserTable' name: 'supervision/interferenceUserTable'
}) })
import { ref, onMounted, provide, nextTick } from 'vue' import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { getUserReportById } from '@/api/supervision-boot/userReport/form' import { getUserReportById } from '@/api/supervision-boot/userReport/form'
import BpmUserReportDetail from '../../components/undocumented/detail.vue' import BpmUserReportDetail from '../../components/undocumented/detail.vue'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
@@ -55,6 +65,8 @@ const statusSelect = dictData.statusSelect()
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const jb_pl = ref(false) const jb_pl = ref(false)
const jb_dky = ref(false) const jb_dky = ref(false)
const update = ref(false)
const addForms = ref()
jb_pl.value = jb_pl.value =
adminInfo.$state.roleCode.filter(item => { adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl' return item == 'jb_pl'
@@ -106,6 +118,28 @@ const tableStore = new TableStore({
3: '退运' 3: '退运'
} }
}, },
{
field: 'status',
title: '信息更新状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
null: '/'
}
},
{ {
field: 'substation', field: 'substation',
title: '变电站', title: '变电站',
@@ -127,7 +161,10 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen', icon: 'el-icon-EditPen',
render: 'basicButton', render: 'basicButton',
click: row => { click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
open(row) open(row)
}, 100)
} }
} }
] ]
@@ -148,6 +185,28 @@ const tableStore = new TableStore({
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
// showDisabled: row => {
// return row.createBy != adminInfo.$state.id || !(row.status == 0)
// },
// disabled: row => {
// return !(row.status == 0)
// },
click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
addForms.value.open({
title: '编辑',
row: row
})
}, 100)
}
},
{ {
name: 'productSetting', name: 'productSetting',
title: '入网设计方案申请', title: '入网设计方案申请',
@@ -174,6 +233,7 @@ const tableStore = new TableStore({
toFangAn(row, 1) toFangAn(row, 1)
} }
} }
// { // {
// name: 'productSetting', // name: 'productSetting',
// title: '/', // title: '/',

View File

@@ -523,11 +523,20 @@ import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import { queryByAllCode } from '@/api/system-boot/dictTree' import { queryByAllCode } from '@/api/system-boot/dictTree'
import { uploadFile } from '@/api/system-boot/file' import { uploadFile } from '@/api/system-boot/file'
import { submitFormData, getById, updateFormData } from '@/api/supervision-boot/interfere/index' import { submitFormData, getById, updateFormData, addEditor } from '@/api/supervision-boot/interfere/index'
defineProps({ import { getUserReportUpdateById } from '@/api/supervision-boot/userReport/form'
const props = defineProps({
openType: { openType: {
type: String, type: String,
default: 'create' default: 'create'
},
update: {
type: Boolean,
default: false
},
normalizedControl: {
type: Boolean,
default: false
} }
}) })
const emits = defineEmits(['onSubmit']) const emits = defineEmits(['onSubmit'])
@@ -935,28 +944,72 @@ const open = async (row: any) => {
dialogFormVisible.value = true dialogFormVisible.value = true
if (row.row) { if (row.row) {
resendId.value = row.row.id resendId.value = row.row.id
await getById({ id: row.row.id }).then(res => { if (props.update) {
// form.value.userType = res.data.userType await getUserReportUpdateById(row.row.id).then(res => {
if (res.data.userReportProjectPO != null) { handleResponse(res.userReportMessageJson)
// userType 0 1
form.value = { ...res.data, ...res.data.userReportProjectPO }
fileRaw(res.data, 'userReportProjectPO')
} else if (res.data.userReportSubstationPO != null) {
// userType 2 3 4 5
form.value = { ...res.data, ...res.data.userReportSubstationPO }
fileRaw(res.data, 'userReportSubstationPO')
} else if (res.data.userReportSensitivePO != null) {
// userType6
form.value = { ...res.data, ...res.data.userReportSensitivePO }
fileRaw(res.data, 'userReportSensitivePO')
}
form.value.orgId = adminInfo.$state.deptName
}) })
} else {
await getById({ id: row.row.id }).then(res => {
handleResponse(res)
})
}
// if (props.update) {
// await getUserReportUpdateById({ id: row.row.id }).then(res => {
// // form.value.userType = res.data.userType
// if (res.data.userReportProjectPO != null) {
// // userType 0 1
// form.value = { ...res.data, ...res.data.userReportProjectPO }
// fileRaw(res.data, 'userReportProjectPO')
// } else if (res.data.userReportSubstationPO != null) {
// // userType 2 3 4 5
// form.value = { ...res.data, ...res.data.userReportSubstationPO }
// fileRaw(res.data, 'userReportSubstationPO')
// } else if (res.data.userReportSensitivePO != null) {
// // userType6
// form.value = { ...res.data, ...res.data.userReportSensitivePO }
// fileRaw(res.data, 'userReportSensitivePO')
// }
// form.value.orgId = adminInfo.$state.deptName
// })
// } else {
// await getById({ id: row.row.id }).then(res => {
// // form.value.userType = res.data.userType
// if (res.data.userReportProjectPO != null) {
// // userType 0 1
// form.value = { ...res.data, ...res.data.userReportProjectPO }
// fileRaw(res.data, 'userReportProjectPO')
// } else if (res.data.userReportSubstationPO != null) {
// // userType 2 3 4 5
// form.value = { ...res.data, ...res.data.userReportSubstationPO }
// fileRaw(res.data, 'userReportSubstationPO')
// } else if (res.data.userReportSensitivePO != null) {
// // userType6
// form.value = { ...res.data, ...res.data.userReportSensitivePO }
// fileRaw(res.data, 'userReportSensitivePO')
// }
// form.value.orgId = adminInfo.$state.deptName
// })
// }
} else { } else {
resendId.value = '' resendId.value = ''
form.value.userType = userTypeList.value[0].value form.value.userType = userTypeList.value[0].value
} }
} }
async function handleResponse(response) {
// userType logic is commented out; if needed, implement accordingly
if (response.data.userReportProjectPO) {
form.value = { ...response.data, ...response.data.userReportProjectPO }
fileRaw(response.data, 'userReportProjectPO')
} else if (response.data.userReportSubstationPO) {
form.value = { ...response.data, ...response.data.userReportSubstationPO }
fileRaw(response.data, 'userReportSubstationPO')
} else if (response.data.userReportSensitivePO) {
form.value = { ...response.data, ...response.data.userReportSensitivePO }
fileRaw(response.data, 'userReportSensitivePO')
}
form.value.orgId = adminInfo.$state.deptName
}
// 处理上传文件回显 // 处理上传文件回显
const fileRaw = (row: any, key: string) => { const fileRaw = (row: any, key: string) => {
let list = [ let list = [
@@ -1150,6 +1203,17 @@ const confirmForm = (flag: boolean) => {
confirmFormData.saveOrCheckflag = '1' confirmFormData.saveOrCheckflag = '1'
if (title.value != '用户档案录入') confirmFormData.id = resendId.value if (title.value != '用户档案录入') confirmFormData.id = resendId.value
if (!control.value) confirmFormData.dataType = 1 if (!control.value) confirmFormData.dataType = 1
if (props.normalizedControl) {
addEditor(confirmFormData).then(res => {
ElMessage({
message: '保存成功!',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
})
} else {
submitFormData(confirmFormData).then(res => { submitFormData(confirmFormData).then(res => {
ElMessage({ ElMessage({
message: '保存成功!', message: '保存成功!',
@@ -1159,6 +1223,7 @@ const confirmForm = (flag: boolean) => {
resetForm() resetForm()
close() close()
}) })
}
} else { } else {
ruleFormRef.value.validate((valid: any) => { ruleFormRef.value.validate((valid: any) => {
if (valid) { if (valid) {

View File

@@ -213,7 +213,6 @@
<a target="_blank" :href="proviteData.feasibilityReport?.url" rel="nofollow"> <a target="_blank" :href="proviteData.feasibilityReport?.url" rel="nofollow">
{{ proviteData.feasibilityReport?.name }} {{ proviteData.feasibilityReport?.name }}
</a> </a>
</span> </span>
<span <span
v-if=" v-if="
@@ -318,7 +317,7 @@ import { onMounted, ref, reactive, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { getUserReportById } from '@/api/supervision-boot/userReport/form' import { getUserReportById, getUserReportUpdateById } from '@/api/supervision-boot/userReport/form'
import { getDictTreeById } from '@/api/system-boot/dictTree' import { getDictTreeById } from '@/api/system-boot/dictTree'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { getFileNameAndFilePath } from '@/api/system-boot/file' import { getFileNameAndFilePath } from '@/api/system-boot/file'
@@ -329,7 +328,11 @@ defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数 const { query } = useRoute() // 查询参数
const props = defineProps({ const props = defineProps({
id: propTypes.string.def(undefined) id: propTypes.string.def(undefined),
update: {
type: Boolean,
default: false
}
}) })
const detailLoading = ref(false) // 表单的加载中 const detailLoading = ref(false) // 表单的加载中
const detailData = ref<any>({}) // 详情数据 const detailData = ref<any>({}) // 详情数据
@@ -406,33 +409,41 @@ const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
const getInfo = async () => { const getInfo = async () => {
detailLoading.value = true detailLoading.value = true
try { try {
if(props.update){
await getUserReportUpdateById(props.id || queryId).then(res => {
detailData.value = res.data.userReportMessageJson
getProviteData()
})
}else{
await getUserReportById(props.id || queryId).then(res => { await getUserReportById(props.id || queryId).then(res => {
detailData.value = res.data detailData.value = res.data
getProviteData() getProviteData()
}) })
}
} finally { } finally {
detailLoading.value = false detailLoading.value = false
} }
} }
const proviteData = ref() const proviteData = ref()
//可研报告 //可研报告
const feasibilityReportRef:any = ref(null) const feasibilityReportRef: any = ref(null)
//项目初步设计说明书 //项目初步设计说明书
const preliminaryDesignDescriptionRef:any = ref(null) const preliminaryDesignDescriptionRef: any = ref(null)
//预测评估报告 //预测评估报告
const predictionEvaluationReportRef:any = ref(null) const predictionEvaluationReportRef: any = ref(null)
//预测评估评审意见报告 //预测评估评审意见报告
const predictionEvaluationReviewOpinionsRef:any = ref(null) const predictionEvaluationReviewOpinionsRef: any = ref(null)
//用户接入变电站主接线示意图 //用户接入变电站主接线示意图
const substationMainWiringDiagramRef:any= ref(null) const substationMainWiringDiagramRef: any = ref(null)
//主要敏感终端清单 //主要敏感终端清单
const sensitiveDevicesRef:any = ref(null) const sensitiveDevicesRef: any = ref(null)
//抗扰度测试报告 //抗扰度测试报告
const antiInterferenceReportRef:any = ref(null) const antiInterferenceReportRef: any = ref(null)
//背景电能质量测试报告 //背景电能质量测试报告
const powerQualityReportRef:any = ref(null) const powerQualityReportRef: any = ref(null)
//其他附件 //其他附件
const additionalAttachmentsRef:any = ref(null) const additionalAttachmentsRef: any = ref(null)
//预览 //预览
const preview = (val: any, url: any) => { const preview = (val: any, url: any) => {
nextTick(() => { nextTick(() => {
@@ -645,6 +656,6 @@ onMounted(() => {
// } // }
.elView { .elView {
cursor: pointer; cursor: pointer;
margin-right:10px; margin-right: 10px;
} }
</style> </style>