yangys
2025-09-13 b2cdc1af33e73ea1fdf6303d6548712634b28aa4
src/views/flow/components/TodolistLeft.vue
@@ -8,12 +8,19 @@
    <basic-container>
        <!--'cureProgramTask', 固化编制不能添加文件-->
        <div class="tool" v-show="['programmingTask', 'replaceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)">
            <el-button type="primary" plain @click="addApp">添加文件
            <!--无固化的情况才显示该开关-->
            <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-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>
@@ -111,6 +126,7 @@
            codeDiffFileName1: '回传版本',
            codeDiffFileName2: '下发版本',
            showContentId: '',
            programOnMachine:false,//是否现场编制
            attForm: {
                att: '',
                fileType: 'program'
@@ -266,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;
        },