From 90246e9abf3600941e3ac5def368a41b1df22369 Mon Sep 17 00:00:00 2001
From: GGJ <357021191@qq.com>
Date: Thu, 20 Jun 2024 18:16:32 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=8A=80=E6=9C=AF?=
=?UTF-8?q?=E7=9B=91=E7=9D=A3=20=E8=8D=89=E7=A8=BF=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/supervision-boot/interfere/index.ts | 10 +-
.../harmonicSurvey/components/planTest.vue | 2 +-
.../normalizationManager/addForm.vue | 73 ++++++++----
.../normalizationManager/programReview.vue | 104 ++++++++++++++++--
4 files changed, 154 insertions(+), 35 deletions(-)
diff --git a/src/api/supervision-boot/interfere/index.ts b/src/api/supervision-boot/interfere/index.ts
index f884b2b4..fbf10c0e 100644
--- a/src/api/supervision-boot/interfere/index.ts
+++ b/src/api/supervision-boot/interfere/index.ts
@@ -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
+ })
+}
diff --git a/src/views/pqs/supervise/harmonicSurvey/components/planTest.vue b/src/views/pqs/supervise/harmonicSurvey/components/planTest.vue
index ff5639e5..ba067d10 100644
--- a/src/views/pqs/supervise/harmonicSurvey/components/planTest.vue
+++ b/src/views/pqs/supervise/harmonicSurvey/components/planTest.vue
@@ -33,7 +33,7 @@
-
+
@@ -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,28 +348,46 @@ const choose = (e: any) => {
}
//提交
-const confirmForm = () => {
- if (goToNetReport.value == null || goToNetReport.value == '') {
- return ElMessage({
- message: props.bussType == 0 ? '请上传入网设计方案审查报告' : '请上传治理工程验收报告',
- type: 'warning'
- })
- }
- let data = {
- type: props.bussType,
- userReportId: props.id,
- reportUrl: goToNetReport.value
- }
- submitGoNet(data).then((res: any) => {
- if (res.code === 'A0000') {
+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: '新建流程成功',
+ message: '保存成功!',
type: 'success'
})
emits('onSubmit')
close()
+ })
+ } else {
+ if (goToNetReport.value == null || goToNetReport.value == '') {
+ return ElMessage({
+ message: props.bussType == 0 ? '请上传入网设计方案审查报告' : '请上传治理工程验收报告',
+ type: 'warning'
+ })
}
- })
+ let data = {
+ type: props.bussType,
+ userReportId: props.id,
+ reportUrl: goToNetReport.value,
+ saveOrCheckflag: '2'
+ }
+ submitGoNet(data).then((res: any) => {
+ if (res.code === 'A0000') {
+ ElMessage({
+ message: '新建流程成功',
+ type: 'success'
+ })
+ emits('onSubmit')
+ close()
+ }
+ })
+ }
}
defineExpose({ open })
diff --git a/src/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue b/src/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue
index 612e5789..4a84e543 100644
--- a/src/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue
+++ b/src/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue
@@ -23,8 +23,10 @@
-->
@@ -34,7 +36,7 @@
ref="addForms"
:id="bussId"
:bussType="bussType"
- :title="titleButton"
+ :title="titleButton1"
openType="detail"
@onSubmit="tableStore.index()"
>
@@ -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)