zmc
2023-12-21 635e1b3c0d48c2db884794cb8bc26d6ff1591ffa
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<template>
  <FYTable @search="onSearch" ref="tableRef">
    <template #table-column>
      <el-table-column prop="cpName" label="店铺名称" width="90px" />
      <el-table-column prop="cpTime" label="时间" :formatter="timeFormatter" width="145px" />
      <el-table-column prop="cpReason" label="原因" show-overflow-tooltip width="245px" />
      <el-table-column prop="cpAppeal" label="呼吁" show-overflow-tooltip width="345px" />
      <el-table-column prop="cpSource" label="来源" width="100px" />
      <el-table-column prop="cpSceneid" label="cpSceneid" width="150px" />
      <el-table-column
        prop="cpMediateTime"
        label="cpMediateTime"
        :formatter="timeFormatter"
        width="145px"
      />
      <el-table-column prop="cpMediateUnit" label="调解单位" width="140px" />
      <el-table-column prop="cpMediateResult" label="调节结果" width="100px" />
      <el-table-column prop="cpExtension1" label="cpExtension1" width="120px" />
      <el-table-column prop="cpExtension2" label="cpExtension2" width="120px" />
      <el-table-column prop="cpExtension3" label="cpExtension3" width="120px" />
      <el-table-column prop="cpRemark" label="cpRemark" />
 
      <el-table-column fixed="right" align="right" label="操作" width="160">
        <template #header>
          <el-button icon="DocumentAdd" size="default" type="success" @click="add">新增</el-button>
        </template>
        <template #default="scope">
          <el-button type="primary" size="small" @click="look(scope)">查看</el-button>
        </template>
      </el-table-column>
    </template>
  </FYTable>
</template>
 
<script>
import dayjs from 'dayjs';
import { useDrawer } from '@/composables/drawer.js';
export default {
  props: {
    tableData: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  emits: ['newlyAdd', 'look'],
  data() {
    return {};
  },
  setup() {
    const { drawer, openDrawer, closeDrawer } = useDrawer();
    return { drawer, openDrawer, closeDrawer };
  },
  mounted() {
    this.search();
  },
  methods: {
    onSearch(page, func) {
      func({
        data: this.tableData,
        total: this.tableData.length
      });
    },
    search() {
      this.$nextTick(() => {
        this.$refs.tableRef.onSearch();
      });
    },
    timeFormatter(row, column, cellValue) {
      return dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss');
    },
 
    add() {
      this.$emit('newlyAdd');
    },
    look(scope) {
      this.$emit('look', scope.row);
    }
  }
};
</script>
 
<style scoped></style>