Blame view

src/components/scm/deleteSupplierCoupon.vue 1.17 KB
e9908e30   wuxw   开发完成admin供应商功能
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
  <template>
    <el-dialog :title="$t('supplierCoupon.deleteTitle')" :visible.sync="visible" width="30%">
      <p>{{ $t('supplierCoupon.deleteConfirm') }}</p>
      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">
          {{ $t('supplierCoupon.cancel') }}
        </el-button>
        <el-button type="primary" @click="confirmDelete">
          {{ $t('supplierCoupon.confirm') }}
        </el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { deleteSupplierCoupon } from '@/api/scm/supplierCouponApi'
  
  export default {
    name: 'DeleteSupplierCoupon',
    data() {
      return {
        visible: false,
        couponId: ''
      }
    },
    methods: {
      open(data) {
        this.couponId = data.couponId
        this.supplierId = data.supplierId
        this.visible = true
      },
  
      async confirmDelete() {
        try {
          await deleteSupplierCoupon({ couponId: this.couponId,supplierId:this.supplierId })
          this.$message.success(this.$t('supplierCoupon.deleteSuccess'))
          this.visible = false
          this.$emit('success')
        } catch (error) {
          this.$message.error(error.message || this.$t('supplierCoupon.deleteFailed'))
        }
      }
    }
  }
  </script>