cloudroam
2024-12-31 2eeea7a6431f0b5fb25b338e2512c48deab8652e
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
  <el-bus-crud ref="crud" v-bind="tableConfig" />
</template>
 
<script>
import { dateRangeOptions } from '@/utils/options'
import CustomDateRange from '@/components/custom-date-range.vue'
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/api/feedback/page',
        hasNew: false,
        hasEdit: false,
        hasDelete: false,
        columns: [
          { label: '反馈人', prop: 'customerName', minWidth: 120 },
          { label: '反馈人电话', prop: 'customerTel', minWidth: 150 },
          {
            label: '反馈内容',
            prop: 'feedBack',
            minWidth: 250,
            showOverflowTooltip: true,
          },
          { label: '反馈类型', prop: 'typeStr', minWidth: 120 },
          { label: '反馈时间', prop: 'createTime', minWidth: 180 },
          {
            label: '回复内容',
            prop: 'reply',
            minWidth: 250,
            showOverflowTooltip: true,
          },
          { label: '回复时间', prop: 'replyTime', minWidth: 180 },
        ],
        operationAttrs: {
          width: 120,
          fixed: 'right',
        },
        searchFormAttrs: {
          labelWidth: 'auto',
        },
        searchForm: [
          {
            type: 'row',
            items: [
              {
                label: '处理状态:',
                id: 'handled',
                type: 'bus-radio',
                el: {
                  hasAll: true,
                  childType: 'el-radio-button',
                  fromDict: false,
                  options: [
                    { label: '已处理', value: true },
                    { label: '待处理', value: false },
                  ],
                },
                default: '',
                span: 24,
                searchImmediately: true,
              },
              {
                label: '反馈日期:',
                id: 'dateType',
                component: CustomDateRange,
                el: {
                  options: dateRangeOptions,
                },
                searchImmediately: true,
                commonFormat: true,
                commonFormatProps: [
                  'dateType',
                  'createDateBeginStr',
                  'createDateEndStr',
                ],
                span: 24,
              },
              { label: '反馈人:', id: 'name', type: 'input' },
              { label: '反馈人电话:', id: 'tel', type: 'input' },
            ],
          },
        ],
        form: [
          { label: '反馈人:', id: 'customerName', type: 'input' },
          { label: '反馈人电话:', id: 'customerTel', type: 'input' },
          {
            label: '反馈内容:',
            id: 'feedBack',
            type: 'input',
            el: { type: 'textarea' },
          },
          { label: '反馈类型:', id: 'typeStr', type: 'input' },
          {
            label: '图片:',
            id: 'pictures',
            type: 'bus-upload',
            forceDisabled: true,
            el: {
              listType: 'picture-card',
            },
            inputFormat: (row) => {
              if ('pictures' in row) {
                try {
                  return row.pictures
                    ? JSON.parse(row.pictures).map((i) => ({ url: i }))
                    : []
                } catch (e) {}
              }
            },
          },
          { label: '反馈时间:', id: 'createTime', type: 'input' },
          {
            label: '回复内容:',
            id: 'reply',
            type: 'input',
            el: { type: 'textarea' },
          },
          { label: '回复时间:', id: 'replyTime', type: 'input' },
        ],
        extraButtons: [
          {
            text: '回复',
            show: (row) => !row.handled,
            atClick: (row) => {
              this.$refs.crud.$refs.extraDialog[0].show(row)
            },
          },
        ],
        extraDialogs: [
          {
            title: '回复',
            hiddenReverseItems: [],
            form: [
              {
                label: '回复内容:',
                id: 'reply',
                type: 'input',
                el: {
                  rows: 6,
                  type: 'textarea',
                },
                rules: {
                  required: true,
                  message: '请输入回复内容',
                  trigger: 'blur',
                },
              },
            ],
            atConfirm: async (val) => {
              const { code } = await this.$elBusHttp.request(
                'flower/api/feedback/page/reply',
                {
                  method: 'post',
                  data: val,
                }
              )
              if (code === 0) {
                this.$message.success('回复成功')
              }
            },
          },
        ],
      },
    }
  },
  head() {
    return {
      title: '投诉反馈',
    }
  },
}
</script>
 
<style lang="scss" scoped></style>