jiangping
2024-01-30 a9ca0823ab8f33ca85abebcf6ec4a8da235adb49
company/src/views/business/company.vue
@@ -19,8 +19,7 @@
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:company:create']">
                <li><el-button type="primary" @click="$refs.operaCompanyWindow.open('新建企业信息表')" v-permissions="['business:company:create']">新建企业</el-button></li>
                <li><el-button type="primary" @click="$refs.OperaCompanyDescWindow.open('详情')" v-permissions="['business:company:create']">详情</el-button></li>
                <li><el-button type="primary" @click="$refs.operaCompanyWindow.open('新建企业')" v-permissions="['business:company:create']">新建企业</el-button></li>
            </ul>
            <el-table
                v-loading="isWorking.search"
@@ -34,12 +33,21 @@
                <el-table-column label="启用状态" min-width="100px">
                    <template slot-scope="{row}">
                        <el-switch
                            @change="changeStatus($event, row)"
                            v-model="row.status"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                            :active-value="0"
                            :inactive-value="1">
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column label="电子签认证状态" min-width="100px">
                    <template slot-scope="{row}">
                      <span v-if="row.signStatus === 0">待认证</span>
                      <span v-if="row.signStatus === 1">认证中</span>
                      <span v-if="row.signStatus === 2">认证失败</span>
                      <span v-if="row.signStatus === 3">认证通过</span>
                    </template>
                </el-table-column>
                <el-table-column
@@ -49,9 +57,11 @@
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.operaCompanyWindow.open('编辑企业信息表', row)" icon="el-icon-edit" v-permissions="['business:company:update']">查看详情</el-button>
                        <el-button type="text" @click="$refs.operaCompanyWindow.open('编辑企业信息表', row)" icon="el-icon-edit" v-permissions="['business:company:update']">修改</el-button>
                        <el-button type="text" @click="$refs.operaCompanyWindow.open('编辑企业信息表', row)" icon="el-icon-edit" v-permissions="['business:company:update']">电子签认证</el-button>
                        <el-button type="text" @click="$refs.OperaCompanyDescWindow.open('企业详情', row)"  v-permissions="['business:company:update']">查看详情</el-button>
                        <el-button type="text" @click="edit(row)" v-permissions="['business:company:update']">修改</el-button>
<!--
                        <el-button type="text" @click="$refs.operaCompanyWindow.open('编辑企业信息表', row)" v-permissions="['business:company:update']">电子签认证</el-button>
-->
                    </template>
                </el-table-column>
            </el-table>
@@ -75,6 +85,7 @@
    import Pagination from '@/components/common/Pagination'
    import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
    import OperaCompanyDescWindow from '@/components/business/OperaCompanyDescWindow'
    import { updateStatus, getById } from '@/api/business/company'
    export default {
        name: 'Company',
        extends: BaseTable,
@@ -96,6 +107,57 @@
                'field.main': 'id'
            })
            this.search()
        },
        methods: {
            edit(row) {
                getById(row.id)
                    .then(res => {
                        let form = res;
                        form.type = 1
                        form.file = {
                            imgurl: '',
                            imgurlfull: ''
                        }
                        form.file1 = {
                            imgurl: '',
                            imgurlfull: ''
                        }
                        form.file2 = {
                            imgurl: '',
                            imgurlfull: ''
                        }
                        form.file3 = {
                            imgurl: '',
                            imgurlfull: ''
                        }
                        form.file.imgurl = res.businessImg.fileurl
                        form.file.imgurlfull = res.businessImg.fileurlFull
                      if( res.idcardImgList ==null){
                        res.idcardImgList = new Array();
                      }
                      if( res.idcardImgList && res.idcardImgList.length>0){
                        form.file1.imgurl = res.idcardImgList[0].fileurl
                        form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
                      }
                      if( res.idcardImgList && res.idcardImgList.length>1){
                        form.file2.imgurl =  res.idcardImgList[1].fileurl
                        form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
                      }
                        form.file3.imgurl = res.signImg.fileurl
                        form.file3.imgurlfull = res.signImg.fileurlFull
                        this.$refs.operaCompanyWindow.open('编辑企业', form)
                    })
            },
            // 修改状态
            changeStatus(status, row) {
                updateStatus({ id: row.id, status })
                    .then(res => {
                        this.search()
                    })
                    .catch(err => {
                        row.status = row.status === 0 ? 1 : 0
                    })
            }
        }
    }
</script>