联调 技术监督 草稿功能

This commit is contained in:
GGJ
2024-06-19 19:37:39 +08:00
parent c496a13617
commit 38c61ec5d5
19 changed files with 671 additions and 277 deletions

View File

@@ -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
}
// 上传文件

View File

@@ -1,6 +1,16 @@
<template>
<TableHeader area datePicker nextFlag ref="TableHeaderRef">
<template #select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择流程状态">
<el-option
v-for="item in supvTypeOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
@@ -101,12 +111,14 @@ const tableStore = new TableStore({
render: 'tag',
minWidth: 80,
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
@@ -133,11 +145,25 @@ const tableStore = new TableStore({
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
click: row => {}
},
{
name: 'edit',
title: '重新发起',
@@ -175,6 +201,7 @@ const tableStore = new TableStore({
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划
const add = () => {

View File

@@ -2,6 +2,16 @@
<template>
<TableHeader area datePicker nextFlag ref="TableHeaderRef">
<template v-slot:select>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择流程状态">
<el-option
v-for="item in supvTypeOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
@@ -103,6 +113,7 @@ const tableStore = new TableStore({
render: 'tag',
minWidth: 140,
custom: {
0: 'warning',
6: 'primary',
1: 'primary',
2: 'success',
@@ -110,6 +121,7 @@ const tableStore = new TableStore({
4: 'warning'
},
replaceValue: {
0: '待提交审批',
6: '新增',
1: '审批中',
2: '审批通过',
@@ -120,7 +132,7 @@ const tableStore = new TableStore({
{
field: 'createBy',
title: '填报人',
minWidth: 80,
minWidth: 120,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
@@ -151,13 +163,29 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.status == 6 || row.status == 4
return row.status == 6 || !row.processInstanceId
},
click: row => {
// planTestRef.value.open('查看计划', row)
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
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',
title: '重新发起',
@@ -194,6 +222,7 @@ const tableStore = new TableStore({
})
tableStore.table.params.status = ''
tableStore.table.params.supvType = ''
provide('tableStore', tableStore)
// 新增计划