yangys
2025-08-16 727971fc438644a9a540e1b0e98834def92799d3
src/views/flowmgr/processQuery.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2025-06-18 09:17:09
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-07-22 22:59:04
 * @LastEditTime: 2025-08-09 20:55:52
 * @FilePath: /mdmweb/src/views/flowmgr/processQuery.vue
-->
<template>
@@ -10,6 +10,12 @@
            @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> -->
@@ -18,6 +24,8 @@
                </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>
@@ -29,6 +37,17 @@
        <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>
@@ -45,6 +64,8 @@
    name: 'MachineReturnFileOp',
    data() {
        return {
            tableData: [],
            viewRow: {},
            page: {
                pageSize: 10,
                currentPage: 1,
@@ -58,13 +79,13 @@
                addBtn: false,
                editBtn: false,
                delBtn: false,
                viewBtn: true,
                viewBtn: false,
                columnBtn: false,
                tip: false,
                // simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                dialogWidth: '60%',
                searchMenuSpan: 7,
                dialogWidth: '70%',
                // tree: true,
                border: true,
                index: true,
@@ -80,7 +101,7 @@
                        search: true,
                        searchType: 'select',
                        hide: true,
                        dicUrl: `/blade-system/dict/dictionary?code=flow`,
                        dicUrl: `/blade-mdm/system/dict/dictionary?code=flow`,
                        props: {
                            label: 'dictValue',
                            value: 'remark',
@@ -102,7 +123,135 @@
                        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: '',
@@ -113,23 +262,19 @@
                                    class: {},
                                    style: {},
                                }, row?.variables?.machineCode)
                        },
                        renderForm: ({ row }) => {
                            return h('span', {
                                attrs: {},
                                class: {},
                                style: {},
                            }, row?.variables?.machineCode || '');
                        }
                    },
                    {
                        label: '创建人',
                        prop: 'startUserName',
                    },
                    {
                        label: '工序名称',
                        prop: '',
                        render: ({ row }) => {
                            return h('p',
                                {
                                    attrs: {},
                                    class: {},
                                    style: {},
                                }, row?.variables?.processName)
                        }
                  width: 80,
                    },
                    {
                        label: '创建时间',
@@ -138,43 +283,209 @@
                    {
                        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: [
            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' }],
                        },
                    ],
                },
                        ],
                        rules: [{ required: true, message: '请输入选择', trigger: 'blur' }],
                    },
                    {
                        label: '备注',
                        span: 24,
                        prop: 'comment',
                        type: 'textarea',
                        rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }],
                    },
                ],
            },
        }
    },
    mounted() {
@@ -183,6 +494,18 @@
        })
    },
    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) {
@@ -228,7 +551,9 @@
                    type: 'warning',
                })
                    .then(() => {
                        deleteRow({ processInstanceId: row.processInstanceId,id:row.processInstanceId })
                        deleteRow({ processInstanceId: row.processInstanceId,id:row.processInstanceId }).then(res => {
                            this.onLoad(this.page, this.query);
                        })
                    })
            } else if (flag === 1) {
                printRow({ processInstanceId: row.processInstanceId })
@@ -378,4 +703,11 @@
};
</script>
<style lang="scss" scoped></style>
<style lang="scss">
.margin0 {
    margin: 0
}
.viewRowForm .el-form-item--default {
    margin-bottom: 0
}
</style>