|
@@ -129,6 +129,20 @@
|
|
|
<annex-list name="甄别附件" classify="甄别上传" v-model:format="handleFiles" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col>
|
|
|
+ <el-form-item
|
|
|
+ label="省甄别附件"
|
|
|
+ :rules="[{ required: false, message: '请上传省甄别附件', trigger: 'change' }]"
|
|
|
+ v-if="isPickFile && state.ruleForm.isPass"
|
|
|
+ >
|
|
|
+ <vxe-grid v-bind="gridOptions" class="w100" ref="gridRef" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-button type="primary" link @click="onDownload(row)">下载</el-button>
|
|
|
+ <el-button type="primary" link @click="onPreview(row)">预览</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-grid>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -147,15 +161,16 @@
|
|
|
<script setup lang="ts" name="discernDetail">
|
|
|
import { computed, defineAsyncComponent, reactive, ref } from 'vue';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
-import { discernApproveParams, screenDetail } from '@/api/business/discern';
|
|
|
+import { discernApprove, discernApproveParams, screenDetail, screenFiles } from '@/api/business/discern';
|
|
|
import { transformFile } from '@/utils/tools';
|
|
|
-import { ElMessage, FormInstance } from 'element-plus';
|
|
|
-import { workflowNext, workflowReject, workflowTraces } from '@/api/system/workflow';
|
|
|
+import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
|
|
+import { workflowReject, workflowTraces } from '@/api/system/workflow';
|
|
|
import { commonEnum } from '@/utils/constants';
|
|
|
import { useAppConfig } from '@/stores/appConfig';
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import other from '@/utils/other';
|
|
|
import { useThemeConfig } from '@/stores/themeConfig';
|
|
|
+import { fileDownloadByUrl } from '@/api/public/file';
|
|
|
|
|
|
const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
|
|
|
const CommonAdvice = defineAsyncComponent(() => import('@/components/CommonAdvice/index.vue')); // 常用意见
|
|
@@ -214,9 +229,11 @@ state.tabPaneList = filteredTabPaneList.value;
|
|
|
* @description 打开弹窗
|
|
|
* */
|
|
|
const orderId = ref('');
|
|
|
+const discernId = ref(''); // 甄别ID
|
|
|
const openDialog = async (row: any) => {
|
|
|
state.dialogVisible = true;
|
|
|
state.loading = true;
|
|
|
+ discernId.value = row.id;
|
|
|
try {
|
|
|
const { result } = await screenDetail(row.id);
|
|
|
state.infoForm = result ?? {};
|
|
@@ -225,7 +242,7 @@ const openDialog = async (row: any) => {
|
|
|
state.order = result.order ?? {};
|
|
|
orderId.value = result.orderId;
|
|
|
await getWorkflow(result.workflowId);
|
|
|
- await selectNextStepOptions(result.workflowId);
|
|
|
+ await selectNextStepOptions(result.workflowId, row.id);
|
|
|
state.loading = false;
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
@@ -274,15 +291,85 @@ const getWorkflow = async (workflowId: string) => {
|
|
|
console.log(e);
|
|
|
}
|
|
|
};
|
|
|
+const gridOptions = reactive<any>({
|
|
|
+ border: true,
|
|
|
+ maxHeight: 500,
|
|
|
+ rowConfig: {
|
|
|
+ isHover: true,
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ { type: 'checkbox', width: 50 },
|
|
|
+ { field: 'fileName', title: '文件名' },
|
|
|
+ { field: 'orgName', title: '上传部门' },
|
|
|
+ { field: 'userName', title: '上传人' },
|
|
|
+ { title: '操作', width: 120, fixed: 'right', align: 'center', slots: { default: 'action' } },
|
|
|
+ ],
|
|
|
+ data: [],
|
|
|
+});
|
|
|
+const gridRef = ref<RefType>();
|
|
|
+const provinceFiles = ref<EmptyArrayType>([]); // 省甄别附件
|
|
|
+const selectAllChangeEvent = ({ checked }) => {
|
|
|
+ if (gridRef.value) {
|
|
|
+ const records = gridRef.value.getCheckboxRecords();
|
|
|
+ provinceFiles.value = records;
|
|
|
+ console.log(checked ? '所有勾选事件' : '所有取消事件', records);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const selectChangeEvent = ({ checked }) => {
|
|
|
+ if (gridRef.value) {
|
|
|
+ const records = gridRef.value.getCheckboxRecords();
|
|
|
+ provinceFiles.value = records;
|
|
|
+ console.log(checked ? '勾选事件' : '取消事件', records);
|
|
|
+ }
|
|
|
+};
|
|
|
+// 下载附件
|
|
|
+const onDownload = (row: any) => {
|
|
|
+ // 确定是否下载
|
|
|
+ ElMessageBox.confirm(`确定要下载附件 ${row.fileName} 吗?`, '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ fileDownloadByUrl({
|
|
|
+ Source: 'hotline',
|
|
|
+ Id: row.additions,
|
|
|
+ }).then((res: any) => {
|
|
|
+ let blob: Blob = new Blob([res.data], { type: res.data.type }); // 创建blob 设置blob文件类型 data 设置为后端返回的文件(例如mp3,jpeg) type:这里设置后端返回的类型 为 mp3
|
|
|
+ let down: HTMLAnchorElement = document.createElement('a'); // 创建A标签
|
|
|
+ let href: string = window.URL.createObjectURL(blob); // 创建下载的链接
|
|
|
+ down.href = href; // 下载地址
|
|
|
+ down.download = row.fileName; // 下载文件名
|
|
|
+ document.body.appendChild(down);
|
|
|
+ down.click(); // 模拟点击A标签
|
|
|
+ document.body.removeChild(down); // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(href); // 释放blob对象
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+};
|
|
|
+// 预览附件
|
|
|
+const onPreview = (row: any) => {
|
|
|
+ const url = import.meta.env.VITE_API_UPLOAD_URL + row.path;
|
|
|
+ window.open(url, '_blank');
|
|
|
+};
|
|
|
const nextHandlersRequired = ref<Boolean>(false); // 办理对象是否必填
|
|
|
const canStartCountersign = ref<Boolean>(false); // 是否可以会签
|
|
|
const selectNext = ref<any>({});
|
|
|
+const isPickFile = ref<Boolean>(false); // 是否要展示选择的附件列表选择
|
|
|
// 查询流程办理节点
|
|
|
-const selectNextStepOptions = async (workflowId: string) => {
|
|
|
+const selectNextStepOptions = async (workflowId: string, discernId: string) => {
|
|
|
try {
|
|
|
const { result } = await discernApproveParams(workflowId); //获取甄别审批流程参数
|
|
|
state.nextStepOptions = result.steps; //办理对象选择内容
|
|
|
canStartCountersign.value = result.canStartCountersign ?? false; // 是否可以发起会签
|
|
|
+ isPickFile.value = result.isPickFile ?? false;
|
|
|
+ if (result.isPickFile) {
|
|
|
+ getAllFiles(discernId);
|
|
|
+ }
|
|
|
if (state.nextStepOptions.length === 1) {
|
|
|
// 下一节点是否只有一个 默认选中第一个
|
|
|
setTimeout(() => {
|
|
@@ -301,6 +388,16 @@ const selectNextStepOptions = async (workflowId: string) => {
|
|
|
console.log(e);
|
|
|
}
|
|
|
};
|
|
|
+// 获取甄别的文件
|
|
|
+const getAllFiles = (id: string) => {
|
|
|
+ screenFiles(id)
|
|
|
+ .then((res: any) => {
|
|
|
+ gridOptions.data = res.result ?? [];
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err, '2222');
|
|
|
+ });
|
|
|
+};
|
|
|
const selectNextStep = (val: any) => {
|
|
|
ruleFormRef.value?.resetFields('nextHandlers');
|
|
|
const next = state.nextStepOptions.find((item: any) => item.key === val);
|
|
@@ -359,6 +456,9 @@ const close = () => {
|
|
|
ruleFormRef.value?.resetFields();
|
|
|
ruleFormRef.value?.resetFields();
|
|
|
state.activeName = '0';
|
|
|
+ provinceFiles.value = [];
|
|
|
+ discernId.value = '';
|
|
|
+ orderId.value = '';
|
|
|
};
|
|
|
// 提交
|
|
|
const afterSubmit = (emitType?: 'updateList', showMessage?: boolean, message?: string) => {
|
|
@@ -378,7 +478,7 @@ const onSubmit = (formEl: FormInstance | undefined) => {
|
|
|
let submitObj = other.deepClone(state.ruleForm);
|
|
|
if (state.ruleForm.isPass) {
|
|
|
// 审批通过 下一步
|
|
|
- workflowNext({ ...submitObj, reviewResult: 1, files: handleFiles.value })
|
|
|
+ discernApprove({ ...submitObj, reviewResult: 1, files: handleFiles.value, provinceFiles: provinceFiles.value, screenId: discernId.value })
|
|
|
.then(() => {
|
|
|
afterSubmit('updateList', true);
|
|
|
})
|