Blame view

src/components/scm/deleteReserveDining.vue 1.56 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
9d4e862a   wuxw   开发完成预约功能
2
    <el-dialog
980b2549   wuxw   优化预约相关功能
3
      :title="$t('common.delete')"
9d4e862a   wuxw   开发完成预约功能
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
      :visible.sync="visible"
      width="30%"
      @close="closeDialog"
    >
      <div class="text-center">
        <p>{{ $t('deleteReserveDining.confirmDelete') }}</p>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="closeDialog">{{ $t('common.cancel') }}</el-button>
        <el-button type="primary" @click="confirmDelete">{{ $t('common.confirmDelete') }}</el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { deleteReserveGoods } from '@/api/scm/doDiningApi'
  
  export default {
    name: 'DeleteReserveDining',
    data() {
      return {
        visible: false,
        form: {
          goodsId: '',
          communityId: ''
        }
      }
    },
    methods: {
      open(params) {
        this.form = Object.assign({}, params)
        this.form.communityId = getCommunityId()
        this.visible = true
      },
      closeDialog() {
        this.visible = false
        this.form = {
          goodsId: '',
          communityId: ''
        }
      },
      confirmDelete() {
        deleteReserveGoods(this.form)
          .then(response => {
            if (response.code === 0) {
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
50
              this.$message.success(this.$t('common.operationSuccess'))
9d4e862a   wuxw   开发完成预约功能
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
              this.closeDialog()
              this.$emit('success')
            } else {
              this.$message.error(response.msg)
            }
          })
          .catch(error => {
            console.error('请求失败:', error)
          })
      }
    }
  }
  </script>
  
  <style scoped>
  .text-center {
    text-align: center;
  }
  </style>