diff --git a/src/assets/v-download.png b/src/assets/v-download.png new file mode 100644 index 0000000..c938826 Binary files /dev/null and b/src/assets/v-download.png differ diff --git a/src/assets/v-show.png b/src/assets/v-show.png new file mode 100644 index 0000000..53d139d Binary files /dev/null and b/src/assets/v-show.png differ diff --git a/src/comps/bpm/edit.vue b/src/comps/bpm/edit.vue index 6c7ef44..ad81ccd 100644 --- a/src/comps/bpm/edit.vue +++ b/src/comps/bpm/edit.vue @@ -18,9 +18,13 @@ - - 上 传 - + + 上传附件 +
流程图 @@ -40,6 +44,8 @@ import {useRoute} from 'vue-router'; import request from "/@/utils/request"; import Modeler2 from '/@/comps/Activiti/modeler2/index'; import {BpmnStore} from "/@/bpmn/store"; +import { Session } from '/@/utils/storage'; +import { ElMessage, ElMessageBox, UploadProps } from 'element-plus'; const route = useRoute(); @@ -53,6 +59,7 @@ const state = reactive({ toExmen: '', tarno:'', xml: null as any, + uploadUrl: '', headers: {} as any, }); const { @@ -61,6 +68,8 @@ const { onMounted(async () => { + state.uploadUrl = `${import.meta.env.VITE_API_URL}gen/oss/upload`; + state.headers = { 'Authorization': Session.get('token') }; state.params = route; if (params.value.query?.id) { @@ -70,7 +79,18 @@ onMounted(async () => { const getOperateInfo = () => { - return toRaw(form.value); + const formInfo=toRaw(form.value); + let atids=""; + if(formInfo.atts){ + for (const att of formInfo.atts) { + atids+=att.id+","; + } + if(atids){ + atids=atids.substring(0,atids.length-1); + } + } + formInfo.atids=atids; + return formInfo; }; @@ -134,6 +154,54 @@ const toggleFlowChart = async () => { } }; +//region -----附件逻辑----- +const handleRemove: UploadProps['onRemove'] = (file, uploadFiles) => { + console.log(file, uploadFiles); +}; + +const handlePreview: UploadProps['onPreview'] = (uploadFile) => { + console.log(uploadFile); + ElMessageBox.confirm('请选择对应的附件操作', '附件操作', + { + confirmButtonText: '下载', + cancelButtonText: '预览', + type: 'info', + }, + ).then(async () => { + await request({ + url: '/gen/oss/download', + method: 'get', + // params: { name: uploadFile.name, path: uploadFile.addre + '/' + uploadFile.id + '.' + uploadFile.sname }, + params: { table: 'bpm_audit_att', id: uploadFile.id }, + responseType: 'blob', + }); + }).catch(() => { + + }); +}; + +const handleSuccess = (a: any, b: any, c: any) => { + // c[c.length - 1] = { ...a }; + c[c.length - 1].id = a.id; + // c[c.length - 1].name = a.name+" ["+a.size+"]"; + c[c.length - 1].name = a.name; + c[c.length - 1].filid = a.filid; + c[c.length - 1].filna = a.filna; + c[c.length - 1].path = a.path; + c[c.length - 1].ornum = c.length; + if (form.value.id) { + c[c.length - 1].audid = form.value.id; + } +}; + +const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { + ElMessage.warning( + `The limit is 3, you selected ${files.length} files this time, add up to ${ + files.length + uploadFiles.length + } totally`, + ); +}; +//endregion // const fileList = ref([ // { diff --git a/src/comps/bpm/tmpl/edit.vue b/src/comps/bpm/tmpl/edit.vue index 28d9c59..68bac66 100644 --- a/src/comps/bpm/tmpl/edit.vue +++ b/src/comps/bpm/tmpl/edit.vue @@ -159,6 +159,7 @@ const addEventBusListener = () => { // } console.log('双击了shape'); + console.log(shape); nodeModalRef.value.open(shape); currNode = shape; diff --git a/src/comps/bpm/view.vue b/src/comps/bpm/view.vue index d15428d..9de93b4 100644 --- a/src/comps/bpm/view.vue +++ b/src/comps/bpm/view.vue @@ -14,7 +14,28 @@ - + + +
@@ -49,6 +70,11 @@ 是否隐藏意见 + + + {{item.name}} + + {{ state.toExmen }} @@ -65,8 +91,12 @@
- - 上 传 + + 上传附件 @@ -97,11 +127,13 @@ import request from '/@/utils/request'; // const route = useRoute(); import Modeler2 from '/@/comps/Activiti/modeler2/index'; import { BpmnStore } from '/@/bpmn/store'; -import { ElMessage } from 'element-plus'; +import { ElMessage, ElMessageBox, UploadProps } from 'element-plus'; // import Viewer from 'bpmn-js/lib/NavigatedViewer'; // import Viewer from 'bpmn-js/lib/Modeler'; // import Viewer from 'bpmn-js/lib/Viewer'; import OrgModal from '/@/comps/sys/OrgModal.vue'; +import vdownload from '/@/assets/v-download.png'; +import { Session } from '/@/utils/storage'; const state = reactive({ @@ -109,7 +141,7 @@ const state = reactive({ items: [], retag: true, tutag: false, - cotag: false, + cotag: false } as any, params: { path: '', @@ -125,9 +157,12 @@ const state = reactive({ hiHamen: '', cuExmen: '', toExmen: '', + // ccmen:[{id:'11',name:'张三'},{id:'22',name:'李四'}], + ccmen:[], nodeList: [], lineList: [], toNode:'', + uploadUrl: '', headers: {} as any, }); const { @@ -148,6 +183,8 @@ const props = defineProps({ onMounted(async () => { + state.uploadUrl = `${import.meta.env.VITE_API_URL}gen/oss/upload`; + state.headers = { 'Authorization': Session.get('token') }; await bpmInit(); await toggleFlowChart(); // state.params = route; @@ -199,13 +236,17 @@ const bpmInit = async () => { { id: 'communicate', name: '沟通' }, { id: 'abandon', name: '废弃' }, ]; + }else if(result.zbpm.tasty === 'to_communicate'){ + state.opways = [ + { id: 'communicate', name: '沟通' }, + { id: 'cacommunicate', name: '取消沟通' }, + ]; }else if(result.zbpm.tasty === 'communicate'){ state.opways = [ { id: 'bacommunicate', name: '回复沟通' }, ]; form.value.opkey = 'bacommunicate'; } - } @@ -225,7 +266,16 @@ const bpmInit = async () => { const emit = defineEmits(['submit']); const bpmSubmit = async () => { - + let atids=""; + if(form.value.atts){ + for (const att of form.value.atts) { + atids+=att.id+","; + } + if(atids){ + atids=atids.substring(0,atids.length-1); + } + } + form.value.atids=atids; if (form.value.opkey == 'pass') { emit('submit', form.value); // await request({ @@ -274,6 +324,15 @@ const bpmSubmit = async () => { }else{ ElMessage.warning('请填写回复沟通的处理意见'); } + }else if (form.value.opkey == 'cacommunicate') { + const info = toRaw(form.value); + if (cdata.ccarr&&cdata.ccarr.length>0) { + console.log(cdata.ccarr); + info.ccids=cdata.ccarr.toString(); + emit('submit', form.value); + } else { + ElMessage.warning('请选择要取消的人员'); + } } }; @@ -370,7 +429,7 @@ const opChange = async (key: any) => { params: { proid: props.proid, facno: form.value.facno }, }); state.form.refno = state.refNodes[0].id; - refChange(state.form.refno); + refChange(state.form.refno); // 驳回时要不要上色 // const elementRegistry = BpmnStore.getModeler().get('elementRegistry'); @@ -390,9 +449,13 @@ const opChange = async (key: any) => { // { id: 'N6', name: 'xxx', exman: 'w5' }, // ]; } - // else if(){ - // - // } + else if(key == 'cacommunicate'){ + state.ccmen = await request({ + url: '/bpm/proc/main/ccmen', + method: 'get', + params: { proid: props.proid, facno: form.value.facno }, + }); + } }; @@ -459,6 +522,65 @@ cdata.comen = computed(() => { }); //endregion +//region -----附件逻辑----- +const handleRemove: UploadProps['onRemove'] = (file, uploadFiles) => { + console.log(file, uploadFiles); +}; + +const handlePreview: UploadProps['onPreview'] = (uploadFile) => { + console.log(uploadFile); + ElMessageBox.confirm('请选择对应的附件操作', '附件操作', + { + confirmButtonText: '下载', + cancelButtonText: '预览', + type: 'info', + }, + ).then(async () => { + await request({ + url: '/gen/oss/download', + method: 'get', + // params: { name: uploadFile.name, path: uploadFile.addre + '/' + uploadFile.id + '.' + uploadFile.sname }, + params: { table: 'bpm_audit_att', id: uploadFile.id }, + responseType: 'blob', + }); + }).catch(() => { + + }); +}; + +const handleSuccess = (a: any, b: any, c: any) => { + // c[c.length - 1] = { ...a }; + c[c.length - 1].id = a.id; + // c[c.length - 1].name = a.name+" ["+a.size+"]"; + c[c.length - 1].name = a.name; + c[c.length - 1].filid = a.filid; + c[c.length - 1].filna = a.filna; + c[c.length - 1].path = a.path; + c[c.length - 1].ornum = c.length; + if (form.value.id) { + c[c.length - 1].audid = form.value.id; + } +}; + +const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { + ElMessage.warning( + `The limit is 3, you selected ${files.length} files this time, add up to ${ + files.length + uploadFiles.length + } totally`, + ); +}; + +const downloadAtt=async (id:string)=>{ + await request({ + url: '/gen/oss/download', + method: 'get', + // params: { name: uploadFile.name, path: uploadFile.addre + '/' + uploadFile.id + '.' + uploadFile.sname }, + params: { table: 'bpm_audit_att', id: id}, + responseType: 'blob', + }); +} +//endregion +