Blame view

src/components/mall/ShopWithdraw.vue 1.53 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
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
  <template>
    <el-dialog :title="$t('shopWithdraw.title')" :visible.sync="visible" width="500px" @close="handleClose">
      <el-form label-width="100px">
        <el-form-item :label="$t('shopWithdraw.remark')">
          <el-input v-model="form.remark" type="textarea" :rows="3" :placeholder="$t('shopWithdraw.remarkPlaceholder')" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">
          {{ $t('common.cancel') }}
        </el-button>
        <el-button type="primary" @click="handleSubmit">
          {{ $t('shopWithdraw.submit') }}
        </el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { auditShop } from '@/api/mall/shopManageApi'
  
  export default {
    name: 'ShopWithdraw',
    data() {
      return {
        visible: false,
        form: {
          remark: '',
          state: '001'
        }
      }
    },
    methods: {
      open(shop) {
        this.form = {
          ...shop,
          remark: '',
          state: '001'
        }
        this.visible = true
      },
      handleClose() {
        this.form = {
          remark: '',
          state: '001'
        }
      },
      async handleSubmit() {
        if (!this.form.remark) {
          this.$message.warning(this.$t('shopWithdraw.remarkRequired'))
          return
        }
  
        try {
          await auditShop(this.form)
          this.$message.success(this.$t('shopWithdraw.success'))
          this.visible = false
          this.$emit('success')
        } catch (error) {
          this.$message.error(this.$t('shopWithdraw.error'))
        }
      }
    }
  }
  </script>