修改 草稿 功能 bug

This commit is contained in:
GGJ
2024-06-21 10:15:25 +08:00
parent 90246e9abf
commit b2a2c1ecf6
4 changed files with 32 additions and 50 deletions

View File

@@ -172,8 +172,6 @@ const title = ref('')
const planAddition = ref(false) const planAddition = ref(false)
const key: any = ref(0) const key: any = ref(0)
const dynamicProp = computed(() => { const dynamicProp = computed(() => {
console.log(123);
return supvTypeOptionList.filter(item => item.id === form.value.supvType)[0]?.code == 'Technical_Super' return supvTypeOptionList.filter(item => item.id === form.value.supvType)[0]?.code == 'Technical_Super'
? '' ? ''
: 'substation' : 'substation'
@@ -234,7 +232,7 @@ const rules = ref({
const changeSubstationFlag = () => { const changeSubstationFlag = () => {
console.log(form.value.customSubstationFlag) console.log(form.value.customSubstationFlag)
//处理所属变电站手都输入1/下拉数据0 //处理所属变电站手都输入1/下拉数据0
key.value++ key.value += 1
if (form.value.customSubstationFlag == 0) { if (form.value.customSubstationFlag == 0) {
rules.value.substation[0].message = '请选择关联电站' rules.value.substation[0].message = '请选择关联电站'
form.value.substation = [] form.value.substation = []
@@ -262,7 +260,10 @@ const loadData = () => {
const detailById = (id: any) => { const detailById = (id: any) => {
getById(id).then(res => { getById(id).then(res => {
form.value = res.data form.value = res.data
form.value.substation = res.data.substation.split(',')
form.value.substation =
res.data.customSubstationFlag == 0 ? res.data.substation.split(',') : res.data.substation
key.value += 1
}) })
} }
// 提交 // 提交
@@ -277,6 +278,7 @@ const submitFn = (flag: boolean) => {
addSurveyPlan(addForm).then(res => { addSurveyPlan(addForm).then(res => {
cancelFn() cancelFn()
ElMessage.success('保存成功!')
emit('onsubmit') emit('onsubmit')
}) })
} else { } else {
@@ -291,11 +293,13 @@ const submitFn = (flag: boolean) => {
if (title.value == '计划新增') { if (title.value == '计划新增') {
addSurveyPlan(addForm).then(res => { addSurveyPlan(addForm).then(res => {
cancelFn() cancelFn()
ElMessage.success('计划新增成功!')
emit('onsubmit') emit('onsubmit')
}) })
} else { } else {
updateSurveyPlan(addForm).then(res => { updateSurveyPlan(addForm).then(res => {
cancelFn() cancelFn()
ElMessage.success('重新发起成功!')
emit('onsubmit') emit('onsubmit')
}) })
} }
@@ -341,7 +345,7 @@ const open = (text: string, id: any) => {
title.value = text title.value = text
planAddition.value = true planAddition.value = true
setTimeout(() => { setTimeout(() => {
key.value++ key.value += 1
}, 10) }, 10)
if (id) { if (id) {
detailById(id) detailById(id)

View File

@@ -46,10 +46,9 @@
</el-form-item> </el-form-item>
<el-form-item for="-" label="用户性质:" prop="userType"> <el-form-item for="-" label="用户性质:" prop="userType">
<el-select <el-select
:disabled="resendId != ''" :disabled="resendId != '' && title != '编辑'"
v-model="form.userType" v-model="form.userType"
placeholder="请选择用户性质" placeholder="请选择用户性质"
@change="changeUserType()"
> >
<el-option <el-option
v-for="(item, index) in userTypeList" v-for="(item, index) in userTypeList"
@@ -620,7 +619,7 @@ const resetForm = () => {
reportDate: new Date(), //填报日期 1 reportDate: new Date(), //填报日期 1
orgId: '', //填报部门 1 orgId: '', //填报部门 1
expectedProductionDate: '', //工程预期投产日期 1 expectedProductionDate: '', //工程预期投产日期 1
userType: 0, //用户性质 1 userType: 1, //用户性质 1
city: areaOptionList[0].name, //所在地市 1 city: areaOptionList[0].name, //所在地市 1
responsibleDepartment: '', //归口管理部门 1 responsibleDepartment: '', //归口管理部门 1
userStatus: userStateList[0].value, //用户状态 1 userStatus: userStateList[0].value, //用户状态 1
@@ -711,7 +710,7 @@ const subForm: any = ref({
responsibleDepartment: '', //归口管理部门 responsibleDepartment: '', //归口管理部门
substation: '', ////变电站 substation: '', ////变电站
userStatus: '0', //用户状态 userStatus: '0', //用户状态
userType: 0, //用户性质 userType: 1, //用户性质
voltageLevel: '', voltageLevel: '',
//userType=='0' '1' //userType=='0' '1'
userReportProjectPO: { userReportProjectPO: {
@@ -949,6 +948,7 @@ const open = async (row: any) => {
}) })
} else { } else {
resendId.value = '' resendId.value = ''
form.value.userType = 0
} }
} }
// 处理上传文件回显 // 处理上传文件回显
@@ -996,7 +996,6 @@ onMounted(() => {
console.log() console.log()
}) })
const changeUserType = value => {}
// 上传报告 // 上传报告
const uploadRef = ref() const uploadRef = ref()
const handleExceed: UploadProps['onExceed'] = files => { const handleExceed: UploadProps['onExceed'] = files => {
@@ -1138,7 +1137,7 @@ const confirmForm = (flag: boolean) => {
} }
} }
confirmFormData.saveOrCheckflag = '1' confirmFormData.saveOrCheckflag = '1'
if (title.value != '用户档案录入') confirmFormData.id = resendId.value if (title.value != '用户档案录入') confirmFormData.id = resendId.value
submitFormData(confirmFormData).then(res => { submitFormData(confirmFormData).then(res => {
ElMessage({ ElMessage({
@@ -1150,8 +1149,6 @@ const confirmForm = (flag: boolean) => {
close() close()
}) })
} else { } else {
ruleFormRef.value.validate((valid: any) => { ruleFormRef.value.validate((valid: any) => {
if (valid) { if (valid) {
//整理上传文件的数据 //整理上传文件的数据
@@ -1315,30 +1312,26 @@ const confirmForm = (flag: boolean) => {
confirmFormData.saveOrCheckflag = '2' confirmFormData.saveOrCheckflag = '2'
if (title.value == '用户档案录入') { if (title.value == '用户档案录入') {
submitFormData(confirmFormData).then(res => { submitFormData(confirmFormData).then(res => {
ElMessage({
ElMessage({ message: '新增成功',
message: '新增成功', type: 'success'
type: 'success' })
}) ruleFormRef.value.resetFields()
ruleFormRef.value.resetFields() resetForm()
resetForm() close()
close()
}) })
} else { } else {
console.log(confirmFormData) console.log(confirmFormData)
confirmFormData.id = resendId.value confirmFormData.id = resendId.value
updateFormData(confirmFormData).then(res => { updateFormData(confirmFormData).then(res => {
ElMessage({
ElMessage({ message: '重新发起成功',
message: '重新发起成功', type: 'success'
type: 'success' })
}) ruleFormRef.value.resetFields()
ruleFormRef.value.resetFields() resetForm()
resetForm() close()
close()
}) })
} }
} else { } else {

View File

@@ -191,7 +191,7 @@ const submit = (flag: boolean) => {
//此时该告警单处于待反馈状态 //此时该告警单处于待反馈状态
addFeedback(subForm).then(res => { addFeedback(subForm).then(res => {
//查询进线数据避免一直处于loading状态 //查询进线数据避免一直处于loading状态
ElMessage.success('申请成功') ElMessage.success('保存成功')
tableStore.index() tableStore.index()
dialogVisible.value = false dialogVisible.value = false
}) })

View File

@@ -113,22 +113,7 @@ const tableStore = new TableStore({
return !row.processInstanceId return !row.processInstanceId
} }
}, },
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{ {
name: 'edit', name: 'edit',
title: '报告上传', title: '报告上传',
@@ -139,7 +124,7 @@ const tableStore = new TableStore({
return row.status != null return row.status != null
}, },
click: row => { click: row => {
FormRef.value.open('报告上', row) FormRef.value.open('报告上', row)
} }
}, },