yangys
2025-09-22 b14bf62abb3480d95beee8314fcb08c0d893813b
src/views/flowmgr/exceptiontask.vue
@@ -16,7 +16,7 @@
            </template>
            <template #menu="scope">
                <el-button type="primary" text size="default"
                    @click.stop="handleStart(scope.row, scope.index)">启动
                    @click.stop="showStartBox(scope.row, scope.index)">启动
                </el-button>
                <el-button type="primary" text size="default" icon="el-icon-delete" @click.stop="handleDel(scope.row, scope.index)">删除</el-button>
            </template>
@@ -27,11 +27,14 @@
               </avue-text-ellipsis>
            </template>
        </avue-crud>
        <el-dialog title="启动任务" append-to-body v-model="startBox">
            <avue-form :option="startOption" v-model="startForm" @submit="handleStart" @reset-change="startCancel"/>
        </el-dialog>
    </basic-container>
</template>
<script>
import { getList } from '@/api/flowmgr/exceptiontask.js';
import { getList,queryProgrammer } from '@/api/flowmgr/exceptiontask.js';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import NProgress from 'nprogress';
@@ -89,6 +92,10 @@
                        prop: 'drawingNoEdition'
                    },
                    {
                        label: '设备编号',
                        prop: 'equipmentCode',
                    },
                    {
                        label: '机床编码',
                        prop: 'machineCode',
                    },
@@ -102,7 +109,7 @@
                        prop: 'craftEdition'
                    },
                    {
                        label: '偏离单号',
                        label: '临时更改单号',
                        prop: 'deviation'
                    },
                     {
@@ -154,14 +161,112 @@
            },
            selection: [],
            startForm:{},
            startBox:false,
            startOption:{
                submitText: "确认启动",
                emptyText: "取消",
                menuPosition: "right",
                column: [
                     {
                        label: '零组件号',
                        prop: 'drawingNo',
                        type: 'input',
                        disabled:true,
                        span: 12,
                        dataType: 'string',
                    },
                     {
                        label: '工序号',
                        prop: 'processNo',
                        type: 'input',
                        disabled:true,
                        span: 12,
                        dataType: 'string',
                    },
                     {
                        label: '工序版次',
                        prop: 'processEdition',
                        type: 'input',
                        disabled:true,
                        span: 12,
                        dataType: 'string',
                    },
                    {
                        label: '机床编码',
                        prop: 'machineCode',
                        type: 'input',
                        disabled:true,
                        span: 12,
                        dataType: 'string',
                    },
                    {
                        label: '默认工艺',
                        prop: 'programmerName',
                        type: 'input',
                        disabled:true,
                        placeholder:'无匹配主管工艺',
                        span: 10,
                        dataType: 'string',
                    },
                    {
                        label: '主管工艺',
                        prop: 'producePlanId',
                        type: 'select',
                        clearable:true,
                        remote: true,
                        placeholder:'',
                        span: 14,
                        //value:"1951087994928762880",
                        dicUrl: `/blade-mdm/producedivision/select-programmer?programmer={{key}}`,
                        dicFormatter:(res)=>{
                        return res.data.map(obj => {
                            let item = new Object();
                            item.value = obj.id;
                            item.label = obj.programmerName;
                            item.desc = `专业组长:${obj.teamLeaderName},校对:${obj.checkerName},审核:${obj.seniorName}`
                            return item;
                        }); ;
                        },
                        dataType: 'string',
                    }
                ]
            },
        }
    },
    methods: {
        selectionChange (list) {
            this.selection = list;
        },
        handleStart(row,index) {
        showStartBox(row){
            this.startForm = row;
            queryProgrammer(row.drawingNo).then(res=>{
                if(res.data.data.code == 200){
                    this.startForm.producePlanId =res.data.data.id;
                    this.startForm.programmerName = res.data.data.programmer;
                }else{
                    this.$message.warning('无法匹配主管工艺,请选择。')
                }
            }).catch(error =>{
                console.log(error);
            });
            this.startBox = true;
        },
        startCancel(){
            this.startBox = false;
        },
        handleStart(row,done) {
            if(!this.startForm.producePlanId){
                this.$message.error('无法匹配主管工艺,请选择。');
                done();
                return;
            }
            this.$confirm('确定要启动派工吗?', '', {
                    confirmButtonText: this.$t('submitText'),
                    cancelButtonText: this.$t('cancelText'),
@@ -171,7 +276,7 @@
                    axios({
                        url: '/blade-mdm/flow/task/force-start',
                        method: 'post',
                        params: {id: row.id},
                        params: {id: row.id,producePlanId:this.startForm.producePlanId},
                    }).then(res => {
                        this.loading = false;
                        if(res.data.code == 200){
@@ -179,6 +284,7 @@
                                type: 'success',
                                message: '操作成功!',
                            });
                           this.startBox = false;
                            this.onLoad(this.page,this.query);
                        }else{
                            this.$message({
@@ -187,13 +293,15 @@
                            });
                        }
                        //done();
                        done();
                    },
                    error => {
                        this.loading = false;
                        done();
                    }
                    );
                }).catch(() => {
                    done();
                    // this.$message.info('已取消操作');
                });
        },