eight
2024-08-13 b10adc8a3fd000901836e2219fa83462694e9866
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
  <el-table :data="formData" :show-overflow-tooltip="true" :stripe="true" height="120">
    <el-table-column label="商机名称" fixed="left" align="center" prop="name" />
    <el-table-column
      label="商机金额"
      align="center"
      prop="totalPrice"
      :formatter="erpPriceTableColumnFormatter"
    />
    <el-table-column label="客户名称" align="center" prop="customerName" />
    <el-table-column label="商机组" align="center" prop="statusTypeName" />
    <el-table-column label="商机阶段" align="center" prop="statusName" />
    <el-table-column align="center" fixed="right" label="操作" width="80">
      <template #default="{ $index }">
        <el-button link type="danger" @click="handleDelete($index)"> 移除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>
 
<script lang="ts" setup>
import { erpPriceTableColumnFormatter } from '@/utils'
 
const props = defineProps<{
  businesses: undefined
}>()
const formData = ref([])
 
/** 初始化商机列表 */
watch(
  () => props.businesses,
  async (val) => {
    formData.value = val
  },
  { immediate: true }
)
 
/** 删除按钮操作 */
const handleDelete = (index: number) => {
  formData.value.splice(index, 1)
}
</script>