| | |
| | | /* |
| | | * @Date: 2025-06-12 22:38:05 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-07-20 20:33:26 |
| | | * @LastEditTime: 2025-07-22 22:10:43 |
| | | * @FilePath: /mdmweb/src/api/flowmgr/processQuery.js |
| | | */ |
| | | import request from '@/axios'; |
| | |
| | | }) |
| | | }; |
| | | |
| | | export const deleteRow = (data) => { |
| | | export const deleteRow = (params,data) => { |
| | | return request({ |
| | | url: '/blade-mdm/flow/mgr/delete-instance', |
| | | method: 'post', |
| | | params, |
| | | data: { |
| | | ...data, |
| | | }, |
| | | }) |
| | | }; |
| | | |
| | | export const printRow = (params,data) => { |
| | | return request({ |
| | | url: '/blade-mdm/flow/mgr/export-approve-table', |
| | | method: 'post', |
| | | params, |
| | | data: { |
| | | ...data, |
| | | }, |
| | |
| | | const message = res.data.msg || res.data.error_description || '系统错误'; |
| | | //如果在白名单里则自行catch逻辑处理 |
| | | if (statusWhiteList.includes(status)) return Promise.reject(res); |
| | | |
| | | // 如果是401并且没有重试过,尝试刷新token |
| | | if (status === 401 && !config._retry) { |
| | | config._retry = true; |
| | |
| | | } |
| | | |
| | | // 如果请求为非200则默认统一处理 |
| | | if (status !== 200) { |
| | | if (status !== 200 && status != 2) { |
| | | ElMessage({ |
| | | message: message, |
| | | type: 'error', |
| | |
| | | <!-- |
| | | * @Date: 2025-06-18 09:17:09 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-07-20 20:48:15 |
| | | * @LastEditTime: 2025-07-22 22:54:40 |
| | | * @FilePath: /mdmweb/src/views/flowmgr/processQuery.vue |
| | | --> |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" @selection-change="selectionChange"> |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" |
| | | @selection-change="selectionChange"> |
| | | <template #menu-left> |
| | | <!-- <el-button type="primary" plain @click="exportWebSite">导出回传涉密网</el-button> --> |
| | | <!-- <el-button type="primary" plain @click="reassign">挂载车床程序库</el-button> --> |
| | | <!-- <el-button type="primary" plain @click="exportExcel">导出到EXCEL</el-button> --> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="danger" text size="default" |
| | | @click.stop="handleAction(scope.row, scope.index, 0)">删除 |
| | | <el-button type="primary" plain @click="reassign">重新指派 |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'dispatch'" |
| | | @click.stop="handleAction(scope.row, scope.index, 1)">审批表打印 |
| | | </el-button> |
| | | <el-button type="danger" text size="default" @click.stop="handleAction(scope.row, scope.index, 0)">删除 |
| | | </el-button> |
| | | |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="指派" append-to-body v-model="reassignBox" width="30%"> |
| | | <avue-form ref="reassginform" :option="reassignOption" v-model="reassignForm" |
| | | @submit="toPerson"></avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, deleteRow } from '@/api/flowmgr/processQuery.js'; |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import { getList, deleteRow, printRow } from '@/api/flowmgr/processQuery.js'; |
| | | import { getAssignee, reassgin } from '@/api/flow/todolist'; |
| | | import { exportBlobPost } from '@/api/common'; |
| | | import NProgress from 'nprogress'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import { downloadFile } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | export default { |
| | | name: 'MachineReturnFileOp', |
| | | data() { |
| | |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | |
| | | |
| | | menuWidth: 200, |
| | | // menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: '流程类型', |
| | | prop: '', |
| | | prop: 'processDefinitionKey', |
| | | search: true, |
| | | searchType: 'select', |
| | | hide: true, |
| | | dicUrl: `/blade-system/dict/dictionary?code=flow`, |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | value: 'remark', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: '流程模版', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '机床', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '标题', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode) |
| | | } |
| | | }, |
| | | { |
| | | label: '创建人', |
| | | prop: 'startUserName', |
| | | }, |
| | | { |
| | | label: '编制', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '工序名称', |
| | | prop: '', |
| | | }, |
| | | { |
| | | label: '加工车间', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.processName) |
| | | } |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | |
| | | prop: 'taskName', |
| | | }, |
| | | ], |
| | | selectedList: [], |
| | | } |
| | | |
| | | }, |
| | | selectedList: [], |
| | | reassignBox: false, |
| | | reassignForm: {}, |
| | | reassignOption: { |
| | | submitBtn: true, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: '发送给', |
| | | prop: 'newAssigneeId', |
| | | type: 'select', |
| | | // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | // dicFlag: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | span: 24, |
| | | disabled: false, |
| | | dicData: [ |
| | | |
| | | ], |
| | | rules: [{ required: true, message: '请输入选择', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '备注', |
| | | span: 24, |
| | | prop: 'comment', |
| | | type: 'textarea', |
| | | rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | }, |
| | | ], |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | getAssignee().then(res => { |
| | | this.reassignOption.column[0].dicData = res.data.data; |
| | | }) |
| | | }, |
| | | methods: { |
| | | handleAction (row, index, flag) { |
| | | // 处理接受或拒绝操作 |
| | | let ids = [row.id].toString(); |
| | | this.$confirm('确定将选择数据删除?', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | deleteRow({processInstanceId: row.processInstanceId}) |
| | | }) |
| | | reassign() {// 重新指派 |
| | | console.log(this.selectedList.length) |
| | | if (this.selectedList.length === 0) { |
| | | this.$message.warning('请选择需要重新指派的任务'); |
| | | return; |
| | | } |
| | | if (this.selectedList.length > 1) { |
| | | this.$message.warning('请选择一条'); |
| | | return; |
| | | } |
| | | this.reassignBox = true; |
| | | }, |
| | | selectionChange (list) { |
| | | toPerson(form, done) { |
| | | this.$confirm('请确认是否指派', '', { |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | console.log('toPerson', form); |
| | | reassgin({ |
| | | ...form, |
| | | taskId: this.selectedList[0].taskId, |
| | | processInstanceId: this.selectedList[0].processInstanceId, |
| | | }).then(res => { |
| | | this.$message.success('指派成功'); |
| | | this.reassignBox = false; |
| | | this.$refs?.reassginform?.resetForm(); |
| | | this.onLoad(this.page, this.query); |
| | | |
| | | }).catch(err => { |
| | | console.error(err); |
| | | }) |
| | | }); |
| | | done(); |
| | | }, |
| | | handleAction(row, index, flag) { |
| | | if (flag === 0) { |
| | | // 处理接受或拒绝操作 |
| | | let ids = [row.id].toString(); |
| | | this.$confirm('确定将选择数据删除?', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | deleteRow({ processInstanceId: row.processInstanceId }) |
| | | }) |
| | | } else if (flag === 1) { |
| | | printRow({ processInstanceId: row.processInstanceId }) |
| | | this.$confirm('是否导出?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | console.log(this.selection) |
| | | NProgress.start(); |
| | | exportBlobPost( |
| | | `/blade-mdm/flow/mgr/export-approve-table`, |
| | | { processInstanceId: row.processInstanceId }, |
| | | { processInstanceId: row.processInstanceId }, |
| | | ).then(res => { |
| | | let name = res.headers['content-disposition'].split('filename=')[1] |
| | | console.log(res.headers['content-disposition'].split('filename=')[1]); |
| | | downloadFile(res.data, `审批打印-${name}`); |
| | | NProgress.done(); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | selectionChange(list) { |
| | | console.log('selectionChange', list); |
| | | this.selectedList = list; |
| | | }, |
| | | // exportWebSite() { |
| | |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | createTimeBegin: params.createTimeBegin || undefined, |
| | | createTimeEnd: params.createTimeEnd || undefined, |
| | | keyword: params.keyword || undefined, |
| | | processDefinitionKey: params.processDefinitionKey || undefined |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | |
| | | }, |
| | | searchReset() { |
| | | let data = {} |
| | | this.query = params; |
| | | this.query = data; |
| | | this.page.currentPage = 1; |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '' |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | } |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | |
| | | */ |
| | | onLoad(page, params = {}) { |
| | | console.log('onLoad', page, params); |
| | | const query = { |
| | | const data = { |
| | | ...this.query, |
| | | // category: params.category ? flowCategory(params.category) : null, |
| | | mode: this.mode, |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | }; |
| | | try { |
| | | delete query.confirmTime; // 删除不必要的查询条件 |
| | | } catch (error) { |
| | | console.error('日期格式化错误', error); |
| | | } |
| | | |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => { |
| | | const data = res.data.data; |
| | | getList(page.currentPage, page.pageSize, Object.assign(data, params)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.data = data.records.map(v=> { |
| | | return { |
| | | ...v, |
| | | id: v.processInstanceId, |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | }, () => { |
| | | this.data = []; |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { ElMessage } from 'element-plus'; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | var formData = new FormData(); |
| | | formData.append('file', this.file); |
| | | formData.append('nodeId', this.id); |
| | | if(this.isRepeatUpload) { |
| | | formData.append('cofirm','1'); |
| | | } |
| | | Object.keys(this.uploadmodalForm).forEach(key => { |
| | | formData.append(key, this.uploadmodalForm[key]); |
| | | }); |
| | |
| | | url: '/blade-mdm/program/ncfile/upload', |
| | | method: 'post', |
| | | data: formData, |
| | | }).then( |
| | | res => { |
| | | }).then(res => { |
| | | this.loading = false; |
| | | this.uploadmodalBox = false; |
| | | this.addLocalTreeNode(row.id); //重新加载下一级 |
| | | if(res.data.code == 2) { |
| | | this.$confirm('文件名已存在,确定上传吗?', '提示', { |
| | | distinguishCancelAndClose: true, |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.isRepeatUpload = true; |
| | | this.uploadmodalSubmit(row,done); |
| | | }).catch(action => { |
| | | this.isRepeatUpload = false; |
| | | this.$message({ |
| | | type: 'info', |
| | | message:'取消上传' |
| | | }) |
| | | }); |
| | | }else if(res.data.success) { |
| | | this.isRepeatUpload = false; |
| | | this.uploadmodalBox = false; |
| | | this.$message({type: 'success',message: '操作成功!'}); |
| | | this.addLocalTreeNode(row.id); //重新加载下一级 |
| | | }else { |
| | | this.isRepeatUpload = false; |
| | | alert(1) |
| | | } |
| | | done(); |
| | | } |
| | | ); |
| | |
| | | params: obj, |
| | | }).then( |
| | | res => { |
| | | console.log(res.data,111) |
| | | this.loading = false; |
| | | resolve(res.data.data); |
| | | } |
| | |
| | | this.nodeTypeList = res.data.data; |
| | | } |
| | | ); |
| | | //判断版本 0:涉密网,1:工控网;//工控网5个,涉密网4个 |
| | | //判断版本 0:涉密网,1:工控网;//工控网5个,涉密网4个 ,工控网取消 |
| | | // axios({url: '/blade-mdm/system/param/getValue?paramKey=networkType',method: 'get'}).then(res => { |
| | | // if(res.data.data === "0") { |
| | | // this.isSM = true; |