Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
| | |
| | | /* |
| | | * @Date: 2025-06-12 22:38:05 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-07-22 22:10:43 |
| | | * @LastEditTime: 2025-08-17 08:46:26 |
| | | * @FilePath: /mdmweb/src/api/flowmgr/processQuery.js |
| | | */ |
| | | import request from '@/axios'; |
| | |
| | | }, |
| | | }) |
| | | }; |
| | | |
| | | export const getList2 = (current, size, params) => { |
| | | return request({ |
| | | url: '/blade-mdm/flow/mgr/finished-list', |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | current, |
| | | size, |
| | | }, |
| | | }) |
| | | }; |
| | | export const deleteRow = (params,data) => { |
| | | return request({ |
| | | url: '/blade-mdm/flow/mgr/delete-instance', |
| | |
| | | <!-- |
| | | * @Date: 2025-06-18 09:17:09 |
| | | * @Date: 2025-08-10 14:14:58 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-08-09 20:55:52 |
| | | * @LastEditTime: 2025-08-17 08:40:49 |
| | | * @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"> |
| | | <template slot="view" slot-scope="{ row }"> |
| | | <div class="custom-view-footer"> |
| | | <p>è¿æ¯èªå®ä¹çåºé¨å
容</p> |
| | | <p>å½åè¡æ°æ®ï¼{{ row }}</p> |
| | | </div> |
| | | </template> |
| | | <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> --> |
| | | <el-button type="primary" plain @click="reassign">éæ°ææ´¾ |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">æ¥ç |
| | | </el-button> |
| | | <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> |
| | | |
| | | <el-dialog title="æ¥ç详æ
" v-model="dialogVisible" width="60%"> |
| | | <avue-form v-model="viewRow" :option="viewFormOption" readonly class="viewRowForm"></avue-form> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column prop="assigneeName" label="æ§è¡äºº" /> |
| | | <el-table-column prop="taskName" label="ä»»å¡åç§°" /> |
| | | <el-table-column prop="comment" label="æ¹æ³¨" /> |
| | | <el-table-column prop="createTime" label="å¼å§æ¶é´" /> |
| | | <el-table-column prop="endTime" label="宿æ¶é´" /> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-tabs |
| | | v-model="activeName" |
| | | type="card" |
| | | class="demo-tabs" |
| | | > |
| | | <el-tab-pane label="å¾
å" name="todo"> |
| | | <processQuery1 v-if="activeName==='todo'"></processQuery1> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="å·²å" name="done"> |
| | | <processQuery2 v-if="activeName==='done'"> </processQuery2> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | 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 { downloadFile } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | import processQuery1 from './processQuery1.vue'; |
| | | import processQuery2 from './processQuery2.vue'; |
| | | export default { |
| | | name: 'MachineReturnFileOp', |
| | | components: { |
| | | processQuery2, |
| | | processQuery1 |
| | | }, |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | viewRow: {}, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | data: [], |
| | | option: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | viewBtn: false, |
| | | columnBtn: false, |
| | | tip: false, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 7, |
| | | dialogWidth: '70%', |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | |
| | | menuWidth: 200, |
| | | // menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | search: true, |
| | | searchType: 'select', |
| | | hide: true, |
| | | dicUrl: `/blade-mdm/system/dict/dictionary?code=flow`, |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'remark', |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | search: true, |
| | | searchRange: true, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: 'å
³é®å', |
| | | prop: 'keyword', |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | viewDisplay: false, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | width: 150, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel || ''); |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: 'æºåº', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | width: 90 |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | width: 180, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | viewFormOption: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | menuBtn: false, |
| | | labelWidth: 100, |
| | | span: 8, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processDefinitionKey) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.createTime) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.title) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.empty || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo) |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: 'productModel', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.productModel) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æºåº', |
| | | prop: 'machineCode', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.machineCode) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.startUserName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processCreateTime) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.taskName) |
| | | } |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å离åå·', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.deviation || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | selectedList: [], |
| | | dialogVisible: false, |
| | | 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; |
| | | }) |
| | | activeName: 'todo', |
| | | }; |
| | | }, |
| | | methods: { |
| | | customView(row) { |
| | | this.viewRow = {...row}; |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/process-trace', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then( |
| | | res => { |
| | | this.tableData = res.data.data; |
| | | }); |
| | | this.dialogVisible = true; |
| | | handleTabClick(tab, event) { |
| | | console.log(tab, event); |
| | | }, |
| | | 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; |
| | | }, |
| | | 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,id:row.processInstanceId }).then(res => { |
| | | this.onLoad(this.page, this.query); |
| | | }) |
| | | }) |
| | | } 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() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-to-inner`, |
| | | // { |
| | | // ids: this.selectedList.map(item => item.id).join(','), |
| | | // } |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `导åºåä¼ æ¶å¯ç½${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | // exportExcel() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-excel?${this.website.tokenHeader}=${getToken()}` |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `å¯¼åºæºåºåä¼ ç¨åº${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | searchChange(params, done) { |
| | | let data = {} |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | console.log('searchChange', params); |
| | | params.createTimeBegin = params?.createTime?.[0] || ''; |
| | | params.createTimeEnd = params?.createTime?.[1] || ''; |
| | | console.log(params); |
| | | // data = { |
| | | // createTimeBegin: dayjs(params.createTimeBegin).isValid() ? dayjs(params.createTimeBegin).format('YYYY-MM-DD') : '', |
| | | // createTimeEnd: dayjs(params.createTimeEnd).isValid() ? dayjs(params.createTimeEnd).format('YYYY-MM-DD') : '', |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin || undefined, |
| | | createTimeEnd: params.createTimeEnd || undefined, |
| | | keyword: params.keyword || undefined, |
| | | processDefinitionKey: params.processDefinitionKey || undefined |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | let data = {} |
| | | this.query = data; |
| | | this.page.currentPage = 1; |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | } |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | // this.onLoad(); |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | /** * 页é¢å è½½æ¶è·åæ°æ® |
| | | */ |
| | | onLoad(page, params = {}) { |
| | | console.log('onLoad', page, params); |
| | | const data = { |
| | | ...this.query, |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | }; |
| | | this.loading = true; |
| | | 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.map(v=> { |
| | | return { |
| | | ...v, |
| | | id: v.processInstanceId, |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | }, () => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }).catch(err => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .margin0 { |
| | | margin: 0 |
| | | }, |
| | | } |
| | | .viewRowForm .el-form-item--default { |
| | | margin-bottom: 0 |
| | | } |
| | | </style> |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2025-06-18 09:17:09 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-08-09 20:55:52 |
| | | * @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"> |
| | | <template slot="view" slot-scope="{ row }"> |
| | | <div class="custom-view-footer"> |
| | | <p>è¿æ¯èªå®ä¹çåºé¨å
容</p> |
| | | <p>å½åè¡æ°æ®ï¼{{ row }}</p> |
| | | </div> |
| | | </template> |
| | | <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> --> |
| | | <el-button type="primary" plain @click="reassign">éæ°ææ´¾ |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">æ¥ç |
| | | </el-button> |
| | | <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> |
| | | |
| | | <el-dialog title="æ¥ç详æ
" v-model="dialogVisible" width="60%"> |
| | | <avue-form v-model="viewRow" :option="viewFormOption" readonly class="viewRowForm"></avue-form> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column prop="assigneeName" label="æ§è¡äºº" /> |
| | | <el-table-column prop="taskName" label="ä»»å¡åç§°" /> |
| | | <el-table-column prop="comment" label="æ¹æ³¨" /> |
| | | <el-table-column prop="createTime" label="å¼å§æ¶é´" /> |
| | | <el-table-column prop="endTime" label="宿æ¶é´" /> |
| | | </el-table> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | 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 { downloadFile } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | export default { |
| | | name: 'MachineReturnFileOp', |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | viewRow: {}, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | data: [], |
| | | option: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | viewBtn: false, |
| | | columnBtn: false, |
| | | tip: false, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 7, |
| | | dialogWidth: '70%', |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | |
| | | menuWidth: 200, |
| | | // menu: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | search: true, |
| | | searchType: 'select', |
| | | hide: true, |
| | | dicUrl: `/blade-mdm/system/dict/dictionary?code=flow`, |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'remark', |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | search: true, |
| | | searchRange: true, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: 'å
³é®å', |
| | | prop: 'keyword', |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | viewDisplay: false, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | width: 150, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel || ''); |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: 'æºåº', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | width: 90 |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | width: 180, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | viewFormOption: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | menuBtn: false, |
| | | labelWidth: 100, |
| | | span: 8, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processDefinitionKey) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.createTime) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.title) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.empty || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo) |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: 'productModel', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.productModel) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æºåº', |
| | | prop: 'machineCode', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.machineCode) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.startUserName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processCreateTime) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.taskName) |
| | | } |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å离åå·', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.deviation || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | selectedList: [], |
| | | dialogVisible: false, |
| | | 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: { |
| | | customView(row) { |
| | | this.viewRow = {...row}; |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/process-trace', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then( |
| | | res => { |
| | | this.tableData = res.data.data; |
| | | }); |
| | | this.dialogVisible = true; |
| | | }, |
| | | 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; |
| | | }, |
| | | 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,id:row.processInstanceId }).then(res => { |
| | | this.onLoad(this.page, this.query); |
| | | }) |
| | | }) |
| | | } 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() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-to-inner`, |
| | | // { |
| | | // ids: this.selectedList.map(item => item.id).join(','), |
| | | // } |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `导åºåä¼ æ¶å¯ç½${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | // exportExcel() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-excel?${this.website.tokenHeader}=${getToken()}` |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `å¯¼åºæºåºåä¼ ç¨åº${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | searchChange(params, done) { |
| | | let data = {} |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | console.log('searchChange', params); |
| | | params.createTimeBegin = params?.createTime?.[0] || ''; |
| | | params.createTimeEnd = params?.createTime?.[1] || ''; |
| | | console.log(params); |
| | | // data = { |
| | | // createTimeBegin: dayjs(params.createTimeBegin).isValid() ? dayjs(params.createTimeBegin).format('YYYY-MM-DD') : '', |
| | | // createTimeEnd: dayjs(params.createTimeEnd).isValid() ? dayjs(params.createTimeEnd).format('YYYY-MM-DD') : '', |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin || undefined, |
| | | createTimeEnd: params.createTimeEnd || undefined, |
| | | keyword: params.keyword || undefined, |
| | | processDefinitionKey: params.processDefinitionKey || undefined |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | let data = {} |
| | | this.query = data; |
| | | this.page.currentPage = 1; |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | } |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | // this.onLoad(); |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | /** * 页é¢å è½½æ¶è·åæ°æ® |
| | | */ |
| | | onLoad(page, params = {}) { |
| | | console.log('onLoad', page, params); |
| | | const data = { |
| | | ...this.query, |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | }; |
| | | this.loading = true; |
| | | 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.map(v=> { |
| | | return { |
| | | ...v, |
| | | id: v.processInstanceId, |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | }, () => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }).catch(err => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .margin0 { |
| | | margin: 0 |
| | | } |
| | | .viewRowForm .el-form-item--default { |
| | | margin-bottom: 0 |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2025-06-18 09:17:09 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-08-17 08:46:49 |
| | | * @FilePath: /mdmweb/src/views/flowmgr/processQuery2.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"> |
| | | <!-- <template slot="view" slot-scope="{ row }"> |
| | | <div class="custom-view-footer"> |
| | | <p>è¿æ¯èªå®ä¹çåºé¨å
容</p> |
| | | <p>å½åè¡æ°æ®ï¼{{ row }}</p> |
| | | </div> |
| | | </template> --> |
| | | <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> --> |
| | | <!-- <el-button type="primary" plain @click="reassign">éæ°ææ´¾ |
| | | </el-button> --> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">æ¥ç |
| | | </el-button> |
| | | <!-- <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> |
| | | |
| | | <el-dialog title="æ¥ç详æ
" v-model="dialogVisible" width="60%"> |
| | | <avue-form v-model="viewRow" :option="viewFormOption" readonly class="viewRowForm"></avue-form> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column prop="assigneeName" label="æ§è¡äºº" /> |
| | | <el-table-column prop="taskName" label="ä»»å¡åç§°" /> |
| | | <el-table-column prop="comment" label="æ¹æ³¨" /> |
| | | <el-table-column prop="createTime" label="å¼å§æ¶é´" /> |
| | | <el-table-column prop="endTime" label="宿æ¶é´" /> |
| | | </el-table> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList2, deleteRow, printRow } from '@/api/flowmgr/processQuery.js'; |
| | | import { getAssignee, reassgin } from '@/api/flow/todolist'; |
| | | import { exportBlobPost } from '@/api/common'; |
| | | import NProgress from 'nprogress'; |
| | | import { downloadFile } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | |
| | | export default { |
| | | name: 'MachineReturnFileOp', |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | viewRow: {}, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | data: [], |
| | | option: { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | viewBtn: false, |
| | | columnBtn: false, |
| | | tip: false, |
| | | // simplePage: true, |
| | | searchShow: true, |
| | | searchMenuSpan: 7, |
| | | dialogWidth: '70%', |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | selection: true, |
| | | |
| | | menuWidth: 200, |
| | | // menu: false, |
| | | labelWidth: 90, |
| | | menuSpan: 6, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | search: true, |
| | | searchType: 'select', |
| | | hide: true, |
| | | dicUrl: `/blade-mdm/system/dict/dictionary?code=flow`, |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'remark', |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | search: true, |
| | | searchRange: true, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: 'å
³é®å', |
| | | prop: 'keyword', |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | viewDisplay: false, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | width: 150, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.title || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.productModel || ''); |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: 'æºåº', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode) |
| | | }, |
| | | renderForm: ({ row }) => { |
| | | return h('span', { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.machineCode || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | width: 80, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | width: 90 |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | width: 180, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | width: 80, |
| | | render: ({ row }) => { |
| | | return h('span', {}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | viewFormOption: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | menuBtn: false, |
| | | labelWidth: 100, |
| | | span: 8, |
| | | column: [ |
| | | { |
| | | label: 'æµç¨ç±»å', |
| | | prop: 'processDefinitionKey', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processDefinitionKey) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.createTime) |
| | | }, |
| | | }, |
| | | { |
| | | label: 'æ é¢', |
| | | prop: 'variables.title', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.title) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æµç¨åç§°', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables.myProcessName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥èºç次', |
| | | prop: 'variables.craftEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºå·', |
| | | prop: 'processNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºåç§°', |
| | | prop: 'processName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å·¥åºç次', |
| | | prop: 'processEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'é¶ç»ä»¶å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ä»»å¡è½¦é´', |
| | | prop: 'workshop', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'è¿ç¨å¡å·', |
| | | prop: 'empty', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.empty || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å¾å·', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo) |
| | | } |
| | | }, |
| | | { |
| | | label: '产ååå·', |
| | | prop: 'productModel', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.productModel) |
| | | } |
| | | }, |
| | | { |
| | | label: 'æºåº', |
| | | prop: 'machineCode', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.machineCode) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | | prop: 'startUserName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.startUserName) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | | prop: 'processCreateTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processCreateTime) |
| | | } |
| | | }, |
| | | { |
| | | label: 'å½åèç¹', |
| | | prop: 'taskName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.taskName) |
| | | } |
| | | }, |
| | | { |
| | | label: '计åå å·¥æ¶é´', |
| | | prop: 'planStartTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'ç¨åºå
å', |
| | | prop: 'programPackageName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: 'å离åå·', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.deviation || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | selectedList: [], |
| | | dialogVisible: false, |
| | | 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: { |
| | | customView(row) { |
| | | this.viewRow = {...row}; |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/process-trace', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then( |
| | | res => { |
| | | this.tableData = res.data.data; |
| | | }); |
| | | this.dialogVisible = true; |
| | | }, |
| | | 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; |
| | | }, |
| | | 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,id:row.processInstanceId }).then(res => { |
| | | this.onLoad(this.page, this.query); |
| | | }) |
| | | }) |
| | | } 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() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-to-inner`, |
| | | // { |
| | | // ids: this.selectedList.map(item => item.id).join(','), |
| | | // } |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `导åºåä¼ æ¶å¯ç½${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | // exportExcel() { |
| | | // if (this.selectedList.length === 0) { |
| | | // this.$message.warning('请å
éæ©éè¦å¯¼åºçæ°æ®'); |
| | | // return; |
| | | // } |
| | | // this.$confirm('æ¯å¦å¯¼åº?', 'æç¤º', { |
| | | // confirmButtonText: 'ç¡®å®', |
| | | // cancelButtonText: 'åæ¶', |
| | | // type: 'warning', |
| | | // }).then(() => { |
| | | // NProgress.start(); |
| | | // exportBlob( |
| | | // `/blade-mdm/machineback/filehandle/export-excel?${this.website.tokenHeader}=${getToken()}` |
| | | // ).then(res => { |
| | | // downloadXls(res.data, `å¯¼åºæºåºåä¼ ç¨åº${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); |
| | | // NProgress.done(); |
| | | // }); |
| | | // }); |
| | | // }, |
| | | searchChange(params, done) { |
| | | let data = {} |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | console.log('searchChange', params); |
| | | params.createTimeBegin = params?.createTime?.[0] || ''; |
| | | params.createTimeEnd = params?.createTime?.[1] || ''; |
| | | console.log(params); |
| | | // data = { |
| | | // createTimeBegin: dayjs(params.createTimeBegin).isValid() ? dayjs(params.createTimeBegin).format('YYYY-MM-DD') : '', |
| | | // createTimeEnd: dayjs(params.createTimeEnd).isValid() ? dayjs(params.createTimeEnd).format('YYYY-MM-DD') : '', |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin || undefined, |
| | | createTimeEnd: params.createTimeEnd || undefined, |
| | | keyword: params.keyword || undefined, |
| | | processDefinitionKey: params.processDefinitionKey || undefined |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | let data = {} |
| | | this.query = data; |
| | | this.page.currentPage = 1; |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | } |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | // this.onLoad(); |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | /** * 页é¢å è½½æ¶è·åæ°æ® |
| | | */ |
| | | onLoad(page, params = {}) { |
| | | console.log('onLoad', page, params); |
| | | const data = { |
| | | ...this.query, |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '', |
| | | processDefinitionKey: params.processDefinitionKey || '' |
| | | }; |
| | | this.loading = true; |
| | | getList2(page.currentPage, page.pageSize, Object.assign(data, params)).then(res => { |
| | | const data = res.data.data |
| | | this.page.total = data.total; |
| | | this.data = data.records.map(v=> { |
| | | return { |
| | | ...v, |
| | | id: v.processInstanceId, |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | }, () => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }).catch(err => { |
| | | this.data = []; |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .margin0 { |
| | | margin: 0 |
| | | } |
| | | .viewRowForm .el-form-item--default { |
| | | margin-bottom: 0 |
| | | } |
| | | </style> |