gaoshp
2025-06-17 89baf9379ed70db9b77b12c1a9951c1bc6ac98a2
src/views/flow/todolist.vue
@@ -26,17 +26,18 @@
</template>
<script>
import { getList, approve } from '@/api/flow/todolist';
import { getList, approve,getAssignee } from '@/api/flow/todolist';
import { mapGetters } from 'vuex';
export default {
    data() {
        return {
            assigneeData: [],
            row: {},
            approveBox: false,
            formApprove: {
                comment: '',
                approve: 'Y', // 默认同意
                approve: '', // 默认同意
            },
            optionApprove: {
                labelWidth: 100,
@@ -57,12 +58,14 @@
                        label: '下一审批用户',
                        prop: 'assignee',
                        type: 'select',
                        dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
                        // dicFlag: true,
                        props: {
                            label: 'name',
                            value: 'id',
                        },
                        span: 24,
                        disabled: false,
                        dicData: [
                            
                        ],
@@ -105,21 +108,10 @@
                index: true,
                // selection: true,
                // viewBtn: true,
                menuWidth: 320,
                menuWidth: 100,
                dialogClickModal: false,
                column: [
                    {
                        label: '创建时间',
                        prop: 'createTime',
                        type: 'datetime',
                        format: 'YYYY-MM-DD',
                        valueFormat: 'YYYY-MM-DD',
                        search: true,
                        searchRange: true,
                        searchSpan: 8,
                        hide: true,
                    },
                    {
                        label: '关键字',
                        prop: 'keyword',
@@ -160,17 +152,24 @@
                    {
                        label: '创建人',
                        width: 100,
                        prop: '',
                        prop: 'startUserName',
                    },
                    {
                        label: '创建时间',
                        width: 200,
                        prop: 'createTime',
                        prop: 'processCreateTime',
                        type: 'datetime',
                        format: 'YYYY-MM-DD',
                        valueFormat: 'YYYY-MM-DD',
                        search: true,
                        searchRange: true,
                        searchSpan: 8,
                        // hide: true,
                    },
                    {
                        label: '到达时间',
                        width: 100,
                        prop: '',
                        width: 200,
                        prop: 'createTime',
                    },
                    {
                        label: '到达描述',
@@ -179,12 +178,11 @@
                    },
                    {
                        label: '文件',
                        width: 100,
                        width: 200,
                        prop: '',
                    },
                    {
                        label: '到达时间',
                        width: 100,
                        label: '当前节点',
                        prop: '',
                    },
@@ -205,6 +203,14 @@
        //         }
        //     });
        // },
        'formApprove.approve'(val) {
            if (val === 'Y' && this.row.taskDefinitionKey === 'approveTask') {
                this.optionApprove.column[1].disabled = true;
                this.formApprove.assignee = ''; // 如果是通过,则默认指派给自己
            } else {
                this.optionApprove.column[1].disabled = false;
            }
        },
    },
    computed: {
        ...mapGetters(['userInfo', 'permission']),
@@ -217,10 +223,31 @@
        //     };
        // },
    },
    mounted() {
        getAssignee().then(res=> {
            this.assigneeData = res.data.data;
            this.optionApprove.column[1].dicData = this.assigneeData;
        })
    },
    methods: {
        handleAction(row, index) {
            this.formApprove = {
                comment: '',
                approve: '', // 默认同
            }
            this.approveBox = true;
            this.row = row
            if(row.taskDefinitionKey=="check") {
                this.formApprove.assignee = row.variables.senior;
            } else if(row.taskDefinitionKey=="programmingTask") {
                this.formApprove.assignee = row.variables.checker;
            } else if(row.taskDefinitionKey=="teamLeaderTask") {
                this.formApprove.assignee = row.variables.programmer
            } else if(row.taskDefinitionKey=="confirmIsUseableTask") {
                this.formApprove.assignee = row.variables.checker
            } else if(row.taskDefinitionKey=="approveTask") {
            }
            console.log('handleAction', row, index);
        },
        handleSubmit(form, done) {