联调 常态化干扰源用户管理 保存功能
This commit is contained in:
@@ -14,6 +14,16 @@ export const submitFormData = (data: any) => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 提交表单数据
|
||||
*/
|
||||
export const addEditor = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/supervision-boot/userReportRenewal/addEditor',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发起表单数据(编辑)
|
||||
|
||||
@@ -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',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载敏感及重要用户模板
|
||||
*/
|
||||
|
||||
@@ -93,7 +93,7 @@ const onTableCurrentChange = (val: number) => {
|
||||
}
|
||||
|
||||
const pageSizes = computed(() => {
|
||||
let defaultSizes = [10, 20, 50, 100]
|
||||
let defaultSizes = [10, 20, 50, 100,200]
|
||||
if (tableStore.table.params!.pageSize) {
|
||||
if (!defaultSizes.includes(tableStore.table.params!.pageSize)) {
|
||||
defaultSizes.push(tableStore.table.params!.pageSize)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
v-model="form.complaintText"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="稳态指标:" prop="steadyIndicator">
|
||||
<el-form-item for="-" label="稳态指标:">
|
||||
<el-checkbox-group v-model="form.steadyIndicator">
|
||||
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
|
||||
<el-checkbox
|
||||
@@ -100,13 +100,14 @@
|
||||
v-for="(item, ind) in steadyStateList"
|
||||
:key="ind"
|
||||
:label="item.name"
|
||||
@change="changeSteadyState"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="暂态指标:" prop="transientIndicators">
|
||||
<el-form-item for="-" label="暂态指标:">
|
||||
<el-checkbox-group v-model="form.transientIndicators">
|
||||
<div style="width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-start">
|
||||
<el-checkbox
|
||||
@@ -114,6 +115,7 @@
|
||||
v-for="(item, ind) in transientIndicatorsList"
|
||||
:key="ind"
|
||||
:label="item.name"
|
||||
@change="changeTransientIndicators"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-checkbox>
|
||||
@@ -169,7 +171,7 @@ const resetForm = () => {
|
||||
}
|
||||
//字典获取所在地市
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
resetForm()
|
||||
|
||||
const rules = {
|
||||
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
|
||||
userNumber: [{ required: true, message: '请输入用户编号', trigger: 'blur' }],
|
||||
@@ -214,6 +216,7 @@ const submit = () => {
|
||||
}
|
||||
|
||||
const open = (row: any) => {
|
||||
resetForm()
|
||||
dialogVisible.value = true
|
||||
title.value = row.text
|
||||
}
|
||||
@@ -222,6 +225,12 @@ const handleClose = () => {
|
||||
formRef.value && formRef.value.resetFields()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const changeSteadyState = () => {
|
||||
form.value.transientIndicators = []
|
||||
}
|
||||
const changeTransientIndicators = () => {
|
||||
form.value.steadyIndicator = []
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -89,6 +89,7 @@ const tableRef = ref()
|
||||
const industry = dictData.getBasicData('Business_Type')
|
||||
const TableHeaderRef = ref()
|
||||
const alarmListRef = ref()
|
||||
const flagTime = ref(false)
|
||||
const detailRef = ref()
|
||||
const list: any = ref({
|
||||
deptId: '',
|
||||
@@ -98,7 +99,7 @@ const list: any = ref({
|
||||
alarmThreshold: ''
|
||||
})
|
||||
const level: any = ref(dictData.state.area[0]?.level)
|
||||
const flag = ref('')
|
||||
const flag:any = ref('')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/onlineMonitor/list',
|
||||
publicHeight: 65,
|
||||
@@ -136,6 +137,7 @@ const tableStore = new TableStore({
|
||||
return exceeded.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'overLimitDay',
|
||||
title: '累计超标天数',
|
||||
@@ -143,7 +145,11 @@ const tableStore = new TableStore({
|
||||
return row.cellValue != null ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'updateTime',
|
||||
visible:flagTime,
|
||||
title: '最新数据时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
@@ -157,7 +163,9 @@ const tableStore = new TableStore({
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
|
||||
disabled: row => {
|
||||
return row.targetType == 0
|
||||
},
|
||||
click: row => {
|
||||
detailRef.value.open({
|
||||
text: '详情',
|
||||
@@ -272,6 +280,8 @@ const tableStore = new TableStore({
|
||||
list.value.alertThreshold = tableStore.table.params.alertThreshold
|
||||
list.value.alarmThreshold = tableStore.table.params.alarmThreshold
|
||||
flag.value = level.value
|
||||
flagTime.value=tableStore.table.params.dataType==0?true:false
|
||||
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data = [
|
||||
|
||||
@@ -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 => {
|
||||
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: '/',
|
||||
|
||||
@@ -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,6 +1203,17 @@ const confirmForm = (flag: boolean) => {
|
||||
confirmFormData.saveOrCheckflag = '1'
|
||||
if (title.value != '用户档案录入') confirmFormData.id = resendId.value
|
||||
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 => {
|
||||
ElMessage({
|
||||
message: '保存成功!',
|
||||
@@ -1159,6 +1223,7 @@ const confirmForm = (flag: boolean) => {
|
||||
resetForm()
|
||||
close()
|
||||
})
|
||||
}
|
||||
} else {
|
||||
ruleFormRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
|
||||
@@ -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,10 +409,18 @@ const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
|
||||
const getInfo = async () => {
|
||||
detailLoading.value = true
|
||||
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 => {
|
||||
detailData.value = res.data
|
||||
getProviteData()
|
||||
})
|
||||
}
|
||||
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user