Blame view

src/components/fee/wirteInvoiceEvent.vue 2.32 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
9b01bbd3   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
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
    <el-dialog
      :title="$t('wirteInvoiceEvent.title')"
      :visible.sync="visible"
      width="50%"
      @close="closeDialog"
    >
      <el-form label-width="120px">
        <el-form-item :label="$t('wirteInvoiceEvent.type')">
          <el-select
            v-model="form.eventType"
            :placeholder="$t('wirteInvoiceEvent.typeRequired')"
            style="width: 100%"
          >
            <el-option
              :label="$t('wirteInvoiceEvent.receive')"
              value="4004"
            />
            <el-option
              :label="$t('wirteInvoiceEvent.register')"
              value="5005"
            />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('wirteInvoiceEvent.remark')">
          <el-input
            v-model="form.remark"
            type="textarea"
            :rows="3"
            :placeholder="$t('wirteInvoiceEvent.remarkRequired')"
          />
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="closeDialog">{{ $t('common.cancel') }}</el-button>
        <el-button
          type="primary"
          @click="saveEvent"
        >{{ $t('common.save') }}</el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { writeInvoiceEvent } from '@/api/fee/invoiceApplyApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'WirteInvoiceEvent',
    data() {
      return {
        visible: false,
        form: {
          applyId: '',
          eventType: '',
          remark: ''
        }
      }
    },
    methods: {
      open(row) {
        this.form = {
          applyId: row.applyId,
          eventType: '',
          remark: ''
        }
        this.visible = true
      },
      closeDialog() {
        this.visible = false
      },
      async saveEvent() {
        if (!this.form.eventType) {
          this.$message.warning(this.$t('wirteInvoiceEvent.typeRequired'))
          return
        }
        if (!this.form.remark) {
          this.$message.warning(this.$t('wirteInvoiceEvent.remarkRequired'))
          return
        }
        
        try {
          const params = {
            ...this.form,
            communityId: getCommunityId()
          }
          await writeInvoiceEvent(params)
          this.$emit('success')
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
89
          this.$message.success(this.$t('common.operationSuccess'))
9b01bbd3   wuxw   开发完成发票相关功能
90
91
92
93
94
95
96
97
          this.closeDialog()
        } catch (error) {
          this.$message.error(error.message)
        }
      }
    }
  }
  </script>