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

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

@@ -31,18 +31,28 @@
:close-on-click-modal="false"
draggable
>
<BpmUserReportDetail :id="interId" ref="detailsRef"></BpmUserReportDetail>
<BpmUserReportDetail :id="interId" ref="detailsRef" :update="update"></BpmUserReportDetail>
</el-dialog>
<!-- 查看详情 detail 新增/修改 create-->
<addForm
ref="addForms"
@onSubmit="tableStore.index()"
:update="update"
:normalizedControl="true"
openType="create"
></addForm>
</template>
<script setup lang="ts">
defineOptions({
name: 'supervision/interferenceUserTable'
})
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
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 BpmUserReportDetail from '../../components/undocumented/detail.vue'
import { useAdminInfo } from '@/stores/adminInfo'
@@ -55,6 +65,8 @@ const statusSelect = dictData.statusSelect()
const adminInfo = useAdminInfo()
const jb_pl = ref(false)
const jb_dky = ref(false)
const update = ref(false)
const addForms = ref()
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
@@ -106,6 +118,28 @@ const tableStore = new TableStore({
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',
title: '变电站',
@@ -127,7 +161,10 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
open(row)
update.value = row.status == null ? false : true
setTimeout(() => {
open(row)
}, 100)
}
}
]
@@ -148,6 +185,28 @@ const tableStore = new TableStore({
render: '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',
title: '入网设计方案申请',
@@ -174,6 +233,7 @@ const tableStore = new TableStore({
toFangAn(row, 1)
}
}
// {
// name: 'productSetting',
// title: '/',

View File

@@ -523,11 +523,20 @@ import type { ComponentSize, FormInstance, FormRules } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { queryByAllCode } from '@/api/system-boot/dictTree'
import { uploadFile } from '@/api/system-boot/file'
import { submitFormData, getById, updateFormData } from '@/api/supervision-boot/interfere/index'
defineProps({
import { submitFormData, getById, updateFormData, addEditor } from '@/api/supervision-boot/interfere/index'
import { getUserReportUpdateById } from '@/api/supervision-boot/userReport/form'
const props = defineProps({
openType: {
type: String,
default: 'create'
},
update: {
type: Boolean,
default: false
},
normalizedControl: {
type: Boolean,
default: false
}
})
const emits = defineEmits(['onSubmit'])
@@ -935,28 +944,72 @@ const open = async (row: any) => {
dialogFormVisible.value = true
if (row.row) {
resendId.value = row.row.id
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
})
if (props.update) {
await getUserReportUpdateById(row.row.id).then(res => {
handleResponse(res.userReportMessageJson)
})
} 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 {
resendId.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) => {
let list = [
@@ -1150,15 +1203,27 @@ const confirmForm = (flag: boolean) => {
confirmFormData.saveOrCheckflag = '1'
if (title.value != '用户档案录入') confirmFormData.id = resendId.value
if (!control.value) confirmFormData.dataType = 1
submitFormData(confirmFormData).then(res => {
ElMessage({
message: '保存成功!',
type: 'success'
if (props.normalizedControl) {
addEditor(confirmFormData).then(res => {
ElMessage({
message: '保存成功!',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
})
ruleFormRef.value.resetFields()
resetForm()
close()
})
} else {
submitFormData(confirmFormData).then(res => {
ElMessage({
message: '保存成功!',
type: 'success'
})
ruleFormRef.value.resetFields()
resetForm()
close()
})
}
} else {
ruleFormRef.value.validate((valid: any) => {
if (valid) {

View File

@@ -213,7 +213,6 @@
<a target="_blank" :href="proviteData.feasibilityReport?.url" rel="nofollow">
{{ proviteData.feasibilityReport?.name }}
</a>
</span>
<span
v-if="
@@ -318,7 +317,7 @@ import { onMounted, ref, reactive, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { formatDate } from '@/utils/formatTime'
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 { useDictData } from '@/stores/dictData'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
@@ -329,7 +328,11 @@ defineOptions({ name: 'BpmUserReportDetail' })
const { query } = useRoute() // 查询参数
const props = defineProps({
id: propTypes.string.def(undefined)
id: propTypes.string.def(undefined),
update: {
type: Boolean,
default: false
}
})
const detailLoading = ref(false) // 表单的加载中
const detailData = ref<any>({}) // 详情数据
@@ -406,33 +409,41 @@ const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
const getInfo = async () => {
detailLoading.value = true
try {
await getUserReportById(props.id || queryId).then(res => {
if(props.update){
await getUserReportUpdateById(props.id || queryId).then(res => {
detailData.value = res.data.userReportMessageJson
getProviteData()
})
}else{
await getUserReportById(props.id || queryId).then(res => {
detailData.value = res.data
getProviteData()
})
}
} finally {
detailLoading.value = false
}
}
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) => {
nextTick(() => {
@@ -645,6 +656,6 @@ onMounted(() => {
// }
.elView {
cursor: pointer;
margin-right:10px;
margin-right: 10px;
}
</style>