Blame view

src/components/oa/deleteComplaintType.vue 1.41 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
0a06b2d1   wuxw   开发完成投诉建议
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
    <el-dialog
      :title="$t('deleteComplaintType.confirmTitle')"
      :visible.sync="visible"
      width="30%"
      @close="handleClose"
    >
      <div style="text-align: center;">
        <p>{{ $t('deleteComplaintType.confirmText') }}</p>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose">{{ $t('deleteComplaintType.cancel') }}</el-button>
        <el-button type="primary" @click="deleteComplaintType">{{ $t('deleteComplaintType.confirm') }}</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  import { deleteComplaintType } from '@/api/oa/complaintTypeApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'DeleteComplaintType',
    data() {
      return {
        visible: false,
        currentComplaintType: null
      }
    },
    methods: {
      open(complaintType) {
        this.currentComplaintType = complaintType
        this.visible = true
      },
      async deleteComplaintType() {
        try {
          const params = {
            ...this.currentComplaintType,
            communityId: getCommunityId()
          }
          await deleteComplaintType(params)
          this.$emit('success')
          this.visible = false
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
44
          this.$message.success(this.$t('common.operationSuccess'))
0a06b2d1   wuxw   开发完成投诉建议
45
46
47
48
49
50
51
52
53
54
        } catch (error) {
          this.$message.error(this.$t('deleteComplaintType.error'))
        }
      },
      handleClose() {
        this.visible = false
      }
    }
  }
  </script>