马宇豪
2025-01-10 03f0e2a3220106ec2a9dd8f53d3ef5ab824c3ae7
src/views/enterprise/components/authDetail.vue
@@ -11,6 +11,7 @@
                  border
                  fit
                  highlight-current-row
                  :header-cell-style="turnRed"
                  style="width: 100%;">
            <el-table-column type="index" label="" align="center" width="60"/>
            <el-table-column label="授权码" prop="authcode" align="center">
@@ -35,9 +36,16 @@
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="OCR状态" prop="isocr" align="center">
                <template slot-scope="scope">
                    {{scope.row.isocr == 0?'禁用':scope.row.isocr == 1?'启用':'--'}}
                </template>
            </el-table-column>
            <el-table-column label="创建时间" prop="createdat" align="center">
            </el-table-column>
            <el-table-column label="最后登录时间" prop="lasttime" align="center">
            </el-table-column>
            <el-table-column label="到期时间" prop="expiredat" align="center">
            </el-table-column>
            <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" v-if="userType != 3">
                <template slot-scope="scope">
@@ -58,6 +66,10 @@
                    :label="item.name"
                    :value="item.id">
                </el-option>
            </el-select>
            <el-select v-model="isocr" placeholder="请选择是否启用OCR">
                <el-option class="filter-item" label="启用OCR" :value="1"></el-option>
                <el-option class="filter-item" label="禁用OCR" :value="0"></el-option>
            </el-select>
            <div slot="footer" class="dialog-footer">
                <el-button @click="addAuthDialogVisible = false">取消</el-button>
@@ -91,6 +103,7 @@
                flagList:[{id:0,name:"标配"},{id:1,name:"无身份证阅读器"},{id:2,name:"无扫码枪"},{id:3,name:"全无"}],
                contractCode:"",
                flag:0,
                isocr: 0
            }
        },
        computed: {
@@ -146,13 +159,17 @@
            createAuthHandle() {
                this.addAuthDialogVisible = true;
                this.contractCode = ''
                this.flag = 0
                this.isocr = 0
            },
            createAuth(){
                const param = {
                    userId:this.userId,
                    contractCode:this.contractCode,
                    flag:this.flag
                    flag:this.flag,
                    isocr: this.isocr
                };
                createAuth(param).then(response=>{
                    const res = response.data;
@@ -162,6 +179,11 @@
                        this.addAuthDialogVisible = false;
                    }
                })
            },
            turnRed({row, column, rowIndex, columnIndex}){
                if(rowIndex == 0 && columnIndex==7){
                    return 'color: red'
                }
            }
        }
    }