Kaynağa Gözat

reactor:知识库详情和通知公告详情新增审批按钮;

zhangchong 1 yıl önce
ebeveyn
işleme
9b786d8af6

+ 36 - 5
src/views/auxiliary/notice/detail.vue

@@ -1,9 +1,9 @@
 <template>
 	<div class="auxiliary-notice-detail-container layout-pd">
 		<el-card shadow="never" v-loading="loading">
-			<el-form :model="state.ruleForm" label-width="110px" ref="ruleFormRef">
+			<el-form :model="state.ruleForm" label-width="110px" ref="ruleFormRef" class="show-info-form">
 				<template v-if="noticeType === '通知详情'">
-					<el-row :gutter="10">
+					<el-row :gutter="0">
 						<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 							<el-form-item label="通知类型">
 								{{ state.ruleForm.circularTypeName }}
@@ -94,15 +94,20 @@
 					</el-row>
 				</template>
 			</el-form>
+<!--       v-if="state.ruleForm.isCanHandle" -->
+      <el-button type="primary" @click="onAudit" title="审批通知公告" v-if="state.ruleForm.circularState == 1"> 审批 </el-button>
 		</el-card>
+    <!-- 流程审批 -->
+    <process-audit ref="processAuditRef" @orderProcessSuccess="closePage" />
 	</div>
 </template>
 <script setup lang="ts" name="auxiliaryNoticeDetail">
-import { reactive, onMounted, ref } from 'vue';
-import { useRoute } from 'vue-router';
+import { reactive, onMounted, ref ,defineAsyncComponent} from 'vue';
+import {useRoute, useRouter} from 'vue-router';
 import { formatDate } from '/@/utils/formatTime';
 import { bulletinDetail, circularDetail, circularRead } from '/@/api/auxiliary/notice';
-
+import mittBus from '/@/utils/mitt';
+const ProcessAudit = defineAsyncComponent(() => import('/@/components/ProcessAudit/index.vue')); // 流程审批
 // 定义变量内容
 const state = reactive<any>({
 	dialogVisible: false,
@@ -145,4 +150,30 @@ onMounted(() => {
 	isRead.value = route.params?.isRead ?? '0';
 	getDetail(route.params.id);
 });
+const processAuditRef = ref<RefType>(); // 处理流程
+const onAudit = ()=>{
+  const processType = noticeType.value;
+  const annexName = noticeType.value === '通知详情' ? '通知附件' : '公告附件';
+  const params = {
+    id: state.ruleForm.workflowId,
+    processType,
+    orderDetail: {},
+    extra: {
+      dialogTitle: processType,
+      inputPlaceholder: '办理意见',
+      annexName,
+    },
+  };
+  processAuditRef.value.openDialog(params);
+}
+// 关闭当前页
+const router = useRouter();
+const closePage = ()=>{
+  // 关闭当前 tagsView
+  mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
+  mittBus.emit('clearCache', "knowledgeManage");
+  router.push({
+    path: '/knowledge/index',
+  });
+}
 </script>

+ 2 - 2
src/views/auxiliary/noticeAudit/index.vue

@@ -99,9 +99,9 @@
           </el-table-column>
           <el-table-column prop="creatorOrgName" label="来源单位" show-overflow-tooltip></el-table-column>
         </template>
-        <el-table-column label="操作" width="140" fixed="right" align="center">
+        <el-table-column label="操作" width="100" fixed="right" align="center">
           <template #default="{ row }">
-            <el-button link type="primary" @click="onAudit(row)" v-auth="'auxiliary:noticeAudit:audit'" title="审批通知公告"> 审批 </el-button>
+<!--            <el-button link type="primary" @click="onAudit(row)" v-auth="'auxiliary:noticeAudit:audit'" title="审批通知公告"> 审批 </el-button>-->
             <el-button link type="primary" @click="onDetail(row)"> 查看详情 </el-button>
           </template>
         </el-table-column>

+ 2 - 3
src/views/knowledge/index/index.vue

@@ -185,7 +185,7 @@
 									>
 										上架
 									</el-button>
-									<el-button
+<!--									<el-button
 										link
 										type="primary"
 										@click="onAudit(row)"
@@ -194,7 +194,7 @@
 										v-auth="'business:order:handle'"
 									>
 										审批
-									</el-button>
+									</el-button>-->
 									<el-button
 										link
 										type="primary"
@@ -416,7 +416,6 @@ const processAuditRef = ref<RefType>(); //审核记录ref
 const onAudit = (row: any) => {
 	const params = {
 		id: row.workflowId,
-		commonEnum,
 		processType: '工单办理',
 		orderDetail: {},
 		extra: {

+ 38 - 0
src/views/knowledge/index/preview.vue

@@ -43,11 +43,22 @@
           </el-form-item>
         </el-col>
 			</el-row>
+      <el-button
+        type="primary"
+        @click="onAudit"
+        title="审批"
+        v-if="[1, 2].includes(state.info.status) && state.info.isCanHandle"
+        v-auth="'business:order:handle'"
+      >
+        审批
+      </el-button>
 		</el-card>
 		<!-- 知识纠错 -->
 		<error-add ref="errorAddRef" />
 		<!-- 知识提问 -->
 		<question-add ref="questionRef" />
+    <!-- 流程审批 -->
+    <process-audit ref="processAuditRef" @orderProcessSuccess="closePage" />
 	</div>
 </template>
 
@@ -58,11 +69,13 @@ import { Local } from '/@/utils/storage';
 import { KnowledgeInfo, knowledgeCollect, knowledgeScore } from '/@/api/knowledge';
 import { formatDate } from '/@/utils/formatTime';
 import { ElMessage } from 'element-plus';
+import mittBus from '/@/utils/mitt';
 
 // 引入组件
 const ErrorAdd = defineAsyncComponent(() => import('/@/views/knowledge/error/components/Error-add.vue')); // 知识纠错
 const QuestionAdd = defineAsyncComponent(() => import('/@/views/knowledge/question/components/Question-add.vue')); // 知识提问
 const AnnexList = defineAsyncComponent(() => import('/@/components/AnnexList/index.vue')); // 附件列表
+const ProcessAudit = defineAsyncComponent(() => import('/@/components/ProcessAudit/index.vue')); // 流程审批
 
 // 定义变量内容
 const state = reactive<any>({
@@ -139,6 +152,31 @@ const getInfo = async () => {
     loading.value = false;
   }
 }
+// 审批
+const processAuditRef = ref<RefType>(); //审核记录ref
+const onAudit = () => {
+  const params = {
+    id: state.info.workflowId,
+    processType: '工单办理',
+    orderDetail: {},
+    extra: {
+      dialogTitle: '知识审批',
+      inputPlaceholder: '办理意见',
+      annexName: '知识附件',
+    },
+  };
+  processAuditRef.value.openDialog(params);
+};
+// 关闭当前页
+const closePage = ()=>{
+  // 关闭当前 tagsView
+  mittBus.emit('onCurrentContextmenuClick', Object.assign({}, { contextMenuClickId: 1, ...route }));
+  mittBus.emit('clearCache', "knowledgeManage");
+  router.push({
+    path: '/knowledge/index',
+  });
+}
+
 onMounted(() => {
 	getInfo();
 });