index.vue 4.0 KB
<template>
  <div class="app-container">
    <!-- 表格数据 -->
    <el-table
      v-loading="loading"
      :data="policyList"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column
        label="序号"
        prop="policyId"
        width="120"
        align="center"
      />
      <el-table-column
        label="登记时间"
        prop="createTime"
        width="150"
        align="center"
      />
      <el-table-column
        label="车牌号"
        prop="carNum"
        width="150"
        align="center"
      />
      <el-table-column label="车架号" prop="frameNum" align="center" />
      <el-table-column
        label="车主姓名"
        prop="name"
        width="100"
        align="center"
      />
      <el-table-column
        label="联系电话"
        prop="phone"
        width="180"
        align="center"
      />
      <el-table-column
        label="上年承保公司"
        prop="company"
        width="150"
        align="center"
      />
      <el-table-column label="操作" align="center" width="360" fixed="right">
        <template #default="scope">
          <el-popconfirm
            title="是否通过该保单?"
            confirm-button-text="确定"
            cancel-button-text="取消"
            @confirm="handleSuccess(scope.row)"
          >
            <template #reference>
              <el-button type="success">通过</el-button>
            </template>
          </el-popconfirm>

          <el-button
            @click="handleFallback(scope.row)"
            v-hasPermi="['system:role:remove']"
            >退回</el-button
          >
          <el-button
            type="danger"
            @click="handleVoid(scope.row)"
            v-hasPermi="['system:role:edit']"
            >作废</el-button
          >
          <el-button
            type="primary"
            @click="handleAuthCompany(scope.row)"
            v-hasPermi="['system:role:edit']"
            >分配承保公司</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script setup>
const loading = ref(false);
const total = ref(5);
const queryParams = reactive({
  pageNum: 1,
  pageSize: 10,
});
const policyList = ref([
  {
    policyId: 1,
    createTime: "2024-01-01",
    carNum: "桂A 1234",
    frameNum: "123456789012345678",
    name: "张三",
    phone: "12345678901",
    company: "中国平安",
  },
  {
    policyId: 2,
    createTime: "2024-01-02",
    carNum: "粤B 1234",
    frameNum: "123456789012345678",
    name: "李四",
    phone: "12345678902",
    company: "中国平安",
  },
  {
    policyId: 3,
    createTime: "2024-01-03",
    carNum: "粤C 1234",
    frameNum: "123456789012345678",
    name: "王五",
    phone: "12345678903",
    company: "中国平安",
  },
  {
    policyId: 4,
    createTime: "2024-01-04",
    carNum: "粤D 1234",
    frameNum: "123456789012345678",
    name: "赵六",
    phone: "12345678904",
    company: "中国平安",
  },
  {
    policyId: 5,
    createTime: "2024-01-05",
    carNum: "粤E 1234",
    frameNum: "123456789012345678",
    name: "孙七",
    phone: "12345678905",
    company: "中国平安",
  },
]);

/** 多选框选中数据 */
function handleSelectionChange(selection) {
  // ids.value = selection.map(item => item.roleId);
  // single.value = selection.length != 1;
  // multiple.value = !selection.length;
  console.log(selection);
}

const getList = () => {
  loading.value = false;
};
const handleSuccess = () => {
  console.log("通过");
};
const handleFallback = () => {
  console.log("退回");
};
const handleVoid = () => {
  console.log("作废");
};
const handleAuthCompany = () => {
  console.log("分配承保公司");
};
</script>

<style></style>