yangys
2025-09-02 d762a77d9238eef17c66c35b06955fca20160043
src/views/flow/todolist.vue
@@ -6,12 +6,12 @@
            @selection-change="selectionTransferTask">
            <template #menu-left>
                
                <el-button type="primary" v-if="permission.auto_dispatch" plain @click="reassign(2)">自动派工
                <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.auto_dispatch" plain @click="reassign(2)">自动派工
                </el-button>
                <el-button type="primary" v-if="permission.manual_dispatch" plain @click="reassign(1)">手动派工
                <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.manual_dispatch" plain @click="reassign(1)">手动派工
                </el-button>
                <el-button type="primary" plain @click="reassign(0)">重新指派</el-button>
                <el-button type="primary" v-if="permission.batch_approve" plain @click="reassign(3)">批量审批
                <el-button type="primary" :disabled="this.transferTaskSelection.length==0" plain @click="reassign(0)">重新指派</el-button>
                <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.batch_approve" plain @click="reassign(3)">批量审批
                </el-button>
            </template>
            <template #menu="scope">
@@ -47,15 +47,18 @@
            </div>
        </el-drawer>
    </basic-container>
    <div>
        <!--<top-todo ref="topTodoComponent" />-->
    </div>
</template>
<script>
import { getList, approve, getAssignee,reassgin,manualDispatch,autoDispatch,getPrevius,batchApprove } from '@/api/flow/todolist';
import { getList, approve, getAssignee,reassgin,manualDispatch,autoDispatch,todoChangeNotify,batchApprove } from '@/api/flow/todolist';
import { mapGetters } from 'vuex';
import dayjs from 'dayjs';
import TodolistLeft from './components/TodolistLeft.vue';
import TodolistRightTop from './components/TodolistRightTop.vue';
import processTrace from './components/process-trace.vue';
export default {
    components: {
        TodolistLeft,
@@ -321,24 +324,9 @@
        };
    },
    watch: {
        // 'form.category'() {
        //     const category = func.toInt(this.form.category);
        //     this.$refs.crud.option.column.filter(item => {
        //         if (item.prop === 'path') {
        //             item.rules[0].required = category === 1;
        //         }
        //         if (item.prop === 'isOpen') {
        //             item.disabled = category === 2;
        //         }
        //     });
        // },
        'formApprove.approve'(val) {
            this.setAssignee(this.row, val);
            // if(val === 'Y' && ['confirmIsUseableTask'].includes(this.row.taskDefinitionKey) && this.row.variables.isProcessEditionSame=='N') {
            //     // this.optionApprove.column[2].display = true; // 显示工序版次
            // } else {
            //     this.optionApprove.column[2].display = false; // 隐藏工序版次
            // }
            
        },
        'reassignForm.approve'(val) {
@@ -368,10 +356,17 @@
    },
    mounted() {
        //this.setApproveBtn(row)
        getAssignee({
                taskId: 0,
             }).then(res => {
                //if(row.taskDefinitionKey === '')
                this.assigneeData = res.data.data;
                this.reassignOption.column[1].dicData = this.assigneeData;
             });
    },
    methods: {
        // 设置审批结果的状态
        setApproveBtn (row) {
        setApproveBtn (row) { // 设置审批结果的状态
            // 1.审批界面radio文本修改,普通节点的2个radio文本 通过(approve=Y),不通过(现在的驳回)(approve=N)
            
            this.optionApprove.column[0].dicData = [
@@ -506,6 +501,7 @@
            this.transferTaskSelection = list;
        },
        reassign(val) {// 重新指派
            this.reassignType = val;
            if (this.transferTaskSelection.length === 0) {
                this.$message.warning('请选择需要操作的任务');
@@ -531,7 +527,7 @@
                        }
                        this.$message.success('操作成功');
                        this.onLoad(this.page, this.query);
                        todoChangeNotify();
                    }).catch(err => {
                        this.$message.success('操作失败');
                    })
@@ -583,6 +579,8 @@
                        this.reassignBox = false;
                        this.$refs?.reassginform?.resetForm();
                        this.onLoad(this.page, this.query);
                        todoChangeNotify();
                        done()
                    }).catch(err => {
@@ -615,6 +613,8 @@
                        this.reassignBox = false;
                        this.$refs?.reassginform?.resetForm();
                        this.onLoad(this.page, this.query);
                        todoChangeNotify();
                        done()
                    }).catch(err => {
@@ -647,6 +647,8 @@
                        this.reassignBox = false;
                        this.$refs?.reassginform?.resetForm();
                        this.onLoad(this.page, this.query);
                        todoChangeNotify();
                        done()
                    }).catch(err => {
@@ -708,6 +710,8 @@
                this.$message.success('审批成功');
                this.approveBox = false;
                this.onLoad(this.page, this.query);
                todoChangeNotify();//顶部待办数量刷新
                done();
            }).catch(err => {
                done();
@@ -721,12 +725,6 @@
            console.log('searchChange', params);
            params.createTimeBegin = params?.processCreateTime?.[0] || '';
            params.createTimeEnd = params?.processCreateTime?.[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,
                createTimeEnd: params.createTimeEnd,