yangys
2025-09-13 b2cdc1af33e73ea1fdf6303d6548712634b28aa4
src/views/flow/components/TodolistLeft.vue
@@ -7,14 +7,21 @@
<template>
    <basic-container>
        <!--'cureProgramTask', 固化编制不能添加文件-->
        <div class="tool" v-show="['programmingTask', 'repalceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)">
            <el-button type="primary" plain @click="addApp">添加文件
        <div class="tool" v-show="['programmingTask', 'replaceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)">
            <!--无固化的情况才显示该开关-->
            <el-switch v-if="row.variables.hasCuredProgram!=='Y'" v-model="programOnMachine" active-text="现场编制" inactive-text="工艺员编制" />
            &nbsp;
            <el-button type="primary" :disabled="programOnMachine" plain @click="addApp">添加文件
            </el-button>
        </div>
         <el-text type="danger" v-if="row.variables.curedLocked === 'Y'">固化程序已锁定,请谨慎使用。锁定原因:{{ remark }}</el-text>
         <el-text type="danger" v-if="row.processDefinitionKey === 'program-unlock'">程序已锁定,锁定原因:{{ remark }}</el-text>
         <el-text type="danger" v-if="row.variables.curedLocked === 'Y'">固化程序已锁定,请谨慎使用。锁定原因:{{ remark }}<br/></el-text>
         <el-text type="danger" v-if="row.processDefinitionKey === 'program-unlock'">程序已锁定,锁定原因:{{ remark }}<br/></el-text>
         <el-text type="primary" v-if="row.processDefinitionKey === 'program-unlock'"><br/>解锁原因:</el-text>
         <el-text type="warning">{{row.variables.unlockReason}}</el-text>
         <el-text type="danger" v-if="row.variables.hasCuredProgram==='Y' && row.variables.isProcessEditionSame=='N' && row.variables.cureProgramUseable==undefined">已固化程序工序版次不一致,派工版次:{{row.variables.processEdition}},已固化版次:{{row.variables.curedProcessEdition}}</el-text>
        <el-table :data="tableData" border @row-click="showContent" max-height="200" highlight-current-row>
         <el-text type="danger" v-if="row.variables.programOnMachine=='Y'">现场编制</el-text>
        <el-table :data="tableData" border @row-click="showContent" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" max-height="240" highlight-current-row>
            <!-- <el-table-column prop="machineCode" label="加工机床">
            </el-table-column> -->
           
@@ -24,9 +31,17 @@
                    <div style="display: flex;align-items: center;">
                        <span style="margin-right: 8px;">{{ row.name }}</span>
                        <el-icon v-if="row.fileType === 'other'">
                            <el-tooltip class="box-item" effect="light" content="其他文件"  placement="right">
                            <FolderOpened />
                            </el-tooltip>
                        </el-icon>
                        <img v-else src="./app.jpg" alt="" width="16" height="16">
                        <el-icon v-if="row.fileType === 'program'">
                            <el-tooltip class="box-item" effect="light" content="程序文件"  placement="right">
                                <Tickets/>
                            </el-tooltip>
                        </el-icon>
                        <!--<img v-else src="./app.jpg" alt="" width="16" height="16">-->
                    </div>
                </template>
            </el-table-column>
@@ -34,7 +49,7 @@
                <template #default="scope">
                    <!--'cureProgramTask', 固化编制,不能删除和上传-->
                    <a style="color: blue;margin-right: 4px;cursor: pointer;font-size: 12px;"
                        v-show="['programmingTask', 'repalceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)"
                        v-show="['programmingTask', 'replaceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)"
                        type="text" size="small" @click.stop="del(scope.$index, scope.row)">删除</a>
                    <a style="color: blue;cursor: pointer;font-size: 12px;margin-right: 4px;" type="text" size="small"
                        @click.stop="downloadFile(scope.$index, scope.row)">下载</a>
@@ -109,8 +124,9 @@
            content1: '',
            content2: '',
            codeDiffFileName1: '回传版本',
            codeDiffFileName2: '试切版本',
            codeDiffFileName2: '下发版本',
            showContentId: '',
            programOnMachine:false,//是否现场编制
            attForm: {
                att: '',
                fileType: 'program'
@@ -217,13 +233,15 @@
            if(!nodeId){
                nodeId = this.row.variables.curedNodeId;
            }
            queryLockRemark(nodeId).then(res => {
                if (res.data.code == 200) {
                    this.remark = res.data.data || '';
                } else {
                    this.remark = '';
                }
            })
            if(nodeId){
                queryLockRemark(nodeId).then(res => {
                    if (res.data.code == 200) {
                        this.remark = res.data.data || '';
                    } else {
                        this.remark = '';
                    }
                });
            }
        },
        diffFile(index, row) {
            console.log(row)
@@ -264,11 +282,22 @@
                    this.$message.error('获取已选程序失败');
                    return;
                } else {
                    this.tableData = res.data.data || [];
                    this.tableData = this.sortTable(res.data.data || []);
                }
                // this.$emit('selection-change',this.tableData)
            })
        },
        sortTable(data) {
           data.sort(function(a,b){
                if(a.program === b.program){//如果program相同,按照name的降序
                    //return a.name - b.name
                    return a.name.localeCompare(b.name)
                }else{
                    return b.program - a.program
                }
            });
            return data;
        },
        addApp() {
            this.appDialog = true;
        },