jiangping
2025-06-17 78a173f85f8a4666d83cf8d900f04dd9f8e3e127
company/src/views/business/insurance.vue
@@ -7,15 +7,14 @@
            </el-form-item>
            <section>
                <el-button type="primary" @click="search">搜索</el-button>
                <el-button type="primary" :loading="isWorking.export" v-permissions="['business:insurance:exportExcel']" @click="exportExcel">导出</el-button>
<!--                <el-button type="primary" :loading="isWorking.export" v-permissions="['business:insurance:exportExcel']" @click="exportExcel">导出</el-button>-->
                <el-button @click="reset">重置</el-button>
                <el-button @click="$refs.OperaInsuranceDescWindow.open('保险公司详情')">详情</el-button>
            </section>
        </el-form>
        <!-- 表格和分页 -->
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:insurance:create']">
                <li><el-button type="primary" @click="$refs.operaInsuranceWindow.open('新增保险公司')" icon="el-icon-plus" v-permissions="['business:insurance:create']">新建</el-button></li>
                <li><el-button type="primary" @click="$refs.operaInsuranceWindow.open('新增保险公司')" v-permissions="['business:insurance:create']">新增保险公司</el-button></li>
            </ul>
            <el-table
                v-loading="isWorking.search"
@@ -28,9 +27,29 @@
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="保险公司" min-width="100px"></el-table-column>
                <el-table-column prop="logo" label="LOGO" min-width="100px">
                    <template slot-scope="{row}">
                        <el-image
                            v-if="row.logoFullUrl"
                            style="width: 100px; height: 100px"
                            :src="row.logoFullUrl"
                            :preview-src-list="[row.logoFullUrl]">
                        </el-image>
                    </template>
                </el-table-column>
                <el-table-column prop="englishName" label="英文名称" min-width="100px"></el-table-column>
                <el-table-column prop="linkName" label="联系人" min-width="100px"></el-table-column>
                <el-table-column prop="linkPhone" label="联系电话" min-width="100px"></el-table-column>
                <el-table-column label="是否维护" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.lpFileStatus === 1">已维护</span>
                        <span v-else>未维护</span>
                    </template>
                </el-table-column>
                <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"
@@ -42,12 +61,13 @@
                <el-table-column
                    v-if="containPermissions(['business:insurance:update', 'business:insurance:delete'])"
                    label="操作"
                    min-width="120"
                    min-width="150"
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.operaInsuranceWindow.open('编辑保险公司信息表', row)" icon="el-icon-edit" v-permissions="['business:insurance:update']">查看详情</el-button>
                        <el-button type="text" @click="$refs.operaInsuranceWindow.open('编辑保险公司信息表', row)" icon="el-icon-edit" v-permissions="['business:insurance:update']">修改</el-button>
                        <el-button type="text" @click="$refs.OperaInsuranceDescWindow.open('保险公司详情', row)" icon="el-icon-edit" v-permissions="['business:insurance:update']">查看详情</el-button>
                        <el-button type="text" @click="$refs.operaInsuranceWindow.open('修改保险公司', row)" icon="el-icon-edit" v-permissions="['business:insurance:update']">修改</el-button>
                        <el-button type="text" @click="$refs.setCompany.open('理赔材料配置', row.id)" icon="el-icon-edit">设置</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -62,35 +82,51 @@
        <OperaInsuranceWindow ref="operaInsuranceWindow" @success="handlePageChange"/>
        <!-- 详情 -->
        <OperaInsuranceDescWindow ref="OperaInsuranceDescWindow" @success="handlePageChange"/>
        <!-- 设置 -->
        <SetCompany ref="setCompany" @success="handlePageChange"/>
    </TableLayout>
</template>
<script>
    import BaseTable from '@/components/base/BaseTable'
    import TableLayout from '@/layouts/TableLayout'
    import Pagination from '@/components/common/Pagination'
    import OperaInsuranceWindow from '@/components/business/OperaInsuranceWindow'
    import OperaInsuranceDescWindow from '@/components/business/OperaInsuranceDescWindow'
    export default {
        name: 'Insurance',
        extends: BaseTable,
        components: { TableLayout, Pagination, OperaInsuranceWindow, OperaInsuranceDescWindow },
        data () {
            return {
                // 搜索
                searchForm: {
                    name: ''
                }
            }
        },
        created () {
            this.config({
                module: '保险公司信息表',
                api: '/business/insurance',
                'field.id': 'id',
                'field.main': 'id'
            })
            this.search()
        }
import BaseTable from '@/components/base/BaseTable'
import TableLayout from '@/layouts/TableLayout'
import Pagination from '@/components/common/Pagination'
import OperaInsuranceWindow from '@/components/business/OperaInsuranceWindow'
import OperaInsuranceDescWindow from '@/components/business/OperaInsuranceDescWindow'
import SetCompany from '@/components/business/setCompany'
import { updateStatus } from '@/api/business/insurance'
export default {
  name: 'Insurance',
  extends: BaseTable,
  components: { TableLayout, Pagination, OperaInsuranceWindow, OperaInsuranceDescWindow, SetCompany },
  data () {
    return {
      // 搜索
      searchForm: {
        name: ''
      }
    }
  },
  created () {
    this.config({
      module: '保险公司信息表',
      api: '/business/insurance',
      'field.id': 'id',
      'field.main': 'id'
    })
    this.search()
  },
  methods: {
    // 修改状态
    changeStatus (status, row) {
      updateStatus({ id: row.id, status })
        .then(res => {
          this.search()
        })
        .catch(err => {
          row.status = row.status === 0 ? 1 : 0
        })
    }
  }
}
</script>