修改 技术监督 草稿功能

This commit is contained in:
GGJ
2024-06-20 18:16:32 +08:00
parent 3a49fbf6a8
commit 90246e9abf
4 changed files with 154 additions and 35 deletions

View File

@@ -26,7 +26,6 @@ export const updateFormData = (data: any) => {
})
}
//取消干扰源审批
export const cancelFormData = (data: any) => {
return createAxios({
@@ -36,7 +35,6 @@ export const cancelFormData = (data: any) => {
})
}
export const submitGoNet = (data: any) => {
return createAxios({
url: '/supervision-boot/userReportNormal/addUserReportNormal',
@@ -60,3 +58,11 @@ export const getById = (data: any) => {
params: data
})
}
// 根据id获取用户档案录入的详细数据
export const cancel = (data: any) => {
return createAxios({
url: '/supervision-boot/userReportNormal/cancel',
method: 'post',
data
})
}

View File

@@ -33,7 +33,7 @@
<el-form-item for="-" label="测试负责人:" prop="completeBy">
<el-input v-model="form.completeBy" placeholder="请输入测试负责人"></el-input>
</el-form-item>
<el-form-item for="-" class="uploadFile" label="计划测试报告:" prop="testReport">
<el-form-item for="-" class="uploadFile" label="测试报告:" prop="testReport">
<el-upload
ref="uploadRef"
v-model:file-list="form.testReport"

View File

@@ -164,7 +164,9 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="close()">取消</el-button>
<el-button type="primary" @click="confirmForm()">确定</el-button>
<!-- <el-button type="primary" @click="confirmForm()">确定</el-button> -->
<el-button type="primary" @click="confirmForm(true)">保存</el-button>
<el-button type="primary" @click="confirmForm(false)">提交审批</el-button>
</div>
</template>
</el-dialog>
@@ -283,7 +285,8 @@ const resetForm = () => {
resetForm()
const detailLoading = ref(false) // 表单的加载中
const getInfo = async () => {
const getInfo = async (row?: any) => {
console.log('🚀 ~ getInfo ~ row:', row)
detailLoading.value = true
try {
await getUserReportById(props.id).then(res => {
@@ -291,16 +294,28 @@ const getInfo = async () => {
form.value.reporter = adminInfo.$state.name
form.value.orgId = adminInfo.$state.deptName
form.value.reportDate = new Date()
if (row) {
goToNetReport.value = row.otherReport
form.value.goToNetReport =
row.otherReport == null
? []
: [
{
name: row.otherReport.split('/')[2]
}
]
}
})
} finally {
detailLoading.value = false
}
}
const open = () => {
const open = (row?: any) => {
dialogFormVisible.value = true
resetForm()
getInfo()
getInfo(row)
}
const close = () => {
//重置表单内容
@@ -333,7 +348,23 @@ const choose = (e: any) => {
}
//提交
const confirmForm = () => {
const confirmForm = (flag: boolean) => {
if (flag) {
let data = {
type: props.bussType,
userReportId: props.id,
reportUrl: goToNetReport.value,
saveOrCheckflag: '1'
}
submitGoNet(data).then((res: any) => {
ElMessage({
message: '保存成功!',
type: 'success'
})
emits('onSubmit')
close()
})
} else {
if (goToNetReport.value == null || goToNetReport.value == '') {
return ElMessage({
message: props.bussType == 0 ? '请上传入网设计方案审查报告' : '请上传治理工程验收报告',
@@ -343,7 +374,8 @@ const confirmForm = () => {
let data = {
type: props.bussType,
userReportId: props.id,
reportUrl: goToNetReport.value
reportUrl: goToNetReport.value,
saveOrCheckflag: '2'
}
submitGoNet(data).then((res: any) => {
if (res.code === 'A0000') {
@@ -356,5 +388,6 @@ const confirmForm = () => {
}
})
}
}
defineExpose({ open })
</script>

View File

@@ -24,7 +24,9 @@
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0" icon="" type="primary" @click="toGoNet()">{{ titleButton }}</el-button>
<el-button v-if="bussType==1&&needGovernance!='0'" icon="" type="primary" @click="toGoNet()">{{ titleButton }}</el-button>
<el-button v-if="bussType == 1 && needGovernance != '0'" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef" />
@@ -34,7 +36,7 @@
ref="addForms"
:id="bussId"
:bussType="bussType"
:title="titleButton"
:title="titleButton1"
openType="detail"
@onSubmit="tableStore.index()"
></addForm>
@@ -49,17 +51,20 @@ defineOptions({
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 { cancel } from '@/api/supervision-boot/interfere/index'
import { useDictData } from '@/stores/dictData'
import addForm from './addForm.vue'
import { useRouter, useRoute } from 'vue-router'
import { Back } from '@element-plus/icons-vue'
import { useAdminInfo } from '@/stores/adminInfo'
const { go, currentRoute, push } = useRouter()
const { query } = useRoute() // 查询参数
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
const needGovernance = query.needGovernance as unknown as string // 从 URL 传递过来的 是否需要治理
const dictData = useDictData()
const areaOptionList = dictData.getBasicData('jibei_area')
const TableHeaderRef = ref()
const adminInfo = useAdminInfo()
const tableStore = new TableStore({
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
@@ -103,12 +108,14 @@ const tableStore = new TableStore({
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
@@ -142,6 +149,54 @@ const tableStore = new TableStore({
click: row => {
handleAudit(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 => {
dialogVisible.value = true
titleButton1.value = '编辑'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
}
@@ -165,17 +220,33 @@ const bussType = ref()
bussType.value = Number(currentRoute.value.query.type)
const titleButton = ref()
if (bussType.value === 0) {
titleButton.value = '入网设计方案申请'
} else {
titleButton.value = '治理工程申请'
}
const titleButton1 = ref()
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
@@ -185,10 +256,19 @@ const handleAudit = (instanceId: any) => {
}
})
}
if (bussType.value === 0) {
titleButton.value = '入网设计方案申请'
} else {
titleButton.value = '治理工程申请'
}
const addForms = ref()
const toGoNet = () => {
dialogVisible.value = true
if (bussType.value === 0) {
titleButton1.value = '入网设计方案申请'
} else {
titleButton1.value = '治理工程申请'
}
setTimeout(() => {
addForms.value.open()
}, 0)