联调 技术监督 草稿功能
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
for="-"
|
||||
label="关联电站:"
|
||||
v-if="form.customSubstationFlag == 0"
|
||||
prop="substation"
|
||||
:prop="dynamicProp"
|
||||
style="display: flex; align-items: center"
|
||||
>
|
||||
<el-cascader
|
||||
@@ -95,7 +95,8 @@
|
||||
:render-after-expand="false"
|
||||
/> -->
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="关联电站:" v-if="form.customSubstationFlag == 1" prop="substation">
|
||||
|
||||
<el-form-item for="-" label="关联电站:" v-if="form.customSubstationFlag == 1" :prop="dynamicProp">
|
||||
<el-input v-model="form.substation" placeholder="请输入关联电站"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form :model="form" label-width="auto"> -->
|
||||
@@ -135,13 +136,15 @@
|
||||
<template #footer v-if="title != '查看计划'">
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelFn">取消</el-button>
|
||||
<el-button type="primary" @click="submitFn">确定</el-button>
|
||||
|
||||
<el-button type="primary" @click="submitFn(true)">保存</el-button>
|
||||
<el-button type="primary" @click="submitFn(false)">提交审批</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, nextTick } from 'vue'
|
||||
import { ref, computed, nextTick } from 'vue'
|
||||
import {
|
||||
addSurvey,
|
||||
auditSurvey,
|
||||
@@ -161,6 +164,13 @@ const dictData = useDictData()
|
||||
const supvTypeOptionList = dictData.getBasicData('supv_type')
|
||||
const title = ref('')
|
||||
const planAddition = ref(false)
|
||||
|
||||
const dynamicProp = computed(() => {
|
||||
return supvTypeOptionList.filter(item => item.id === form.value.supvType)[0]?.code == 'Technical_Super'
|
||||
? ''
|
||||
: 'substation'
|
||||
})
|
||||
|
||||
const defaultProps = ref({
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
@@ -247,13 +257,43 @@ const detailById = (id: any) => {
|
||||
})
|
||||
}
|
||||
// 提交
|
||||
const submitFn = () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
let filePath = ''
|
||||
audit(filePath)
|
||||
const submitFn = (flag: boolean) => {
|
||||
if (flag) {
|
||||
const addForm = JSON.parse(JSON.stringify(form.value))
|
||||
|
||||
if (form.value.customSubstationFlag == 0) {
|
||||
addForm.substation = addForm.substation.length==0?'': addForm.substation.join(',')
|
||||
}
|
||||
})
|
||||
addForm.saveOrCheckflag = '1'
|
||||
if (title.value == '计划新增') {
|
||||
addSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
}
|
||||
} else {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
//选择系统变电站
|
||||
const addForm = JSON.parse(JSON.stringify(form.value))
|
||||
if (form.value.customSubstationFlag == 0) {
|
||||
addForm.substation = addForm.substation.length==0?'': addForm.substation.join(',')
|
||||
}
|
||||
addForm.saveOrCheckflag = '2'
|
||||
if (title.value == '计划新增') {
|
||||
addSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
} else {
|
||||
updateSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 修改关联电站
|
||||
const changeArea = () => {
|
||||
@@ -268,23 +308,6 @@ const changeArea = () => {
|
||||
treeData.value = list
|
||||
}
|
||||
const audit = (filePath: any) => {
|
||||
//选择系统变电站
|
||||
const addForm = JSON.parse(JSON.stringify(form.value))
|
||||
if (form.value.customSubstationFlag == 0) {
|
||||
addForm.substation = addForm.substation.join(',')
|
||||
}
|
||||
if (title.value == '计划新增') {
|
||||
addSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
} else {
|
||||
updateSurveyPlan(addForm).then(res => {
|
||||
cancelFn()
|
||||
emit('onsubmit')
|
||||
})
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
// 上传文件
|
||||
|
||||
Reference in New Issue
Block a user