Blame view

src/components/fee/auditShareReading.vue 2.5 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
a0f584aa   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
    <el-dialog
      :title="$t('shareReading.audit.title')"
      :visible.sync="dialogVisible"
      width="40%"
      @close="handleClose"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-form-item :label="$t('shareReading.audit.status')" prop="state">
          <el-select 
            v-model="form.state" 
            :placeholder="$t('shareReading.audit.selectStatus')"
            style="width:100%"
          >
            <el-option 
              :label="$t('shareReading.status.passed')" 
              value="C"
            />
            <el-option 
              :label="$t('shareReading.status.rejected')" 
              value="F"
            />
          </el-select>
        </el-form-item>
        <el-form-item :label="$t('shareReading.audit.remark')">
          <el-input
            v-model="form.auditRemark"
            type="textarea"
            :placeholder="$t('shareReading.audit.inputRemark')"
            :rows="3"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
        <el-button type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import { auditFloorShareReading } from '@/api/fee/shareReadingApi'
  
  export default {
    name: 'AuditShareReading',
    data() {
      return {
        dialogVisible: false,
        form: {
          readingId: '',
          state: '',
          auditRemark: '',
          communityId: ''
        },
        rules: {
          state: [
            { required: true, message: this.$t('shareReading.validate.selectStatus'), trigger: 'change' }
          ]
        }
      }
    },
    methods: {
      open(data) {
        this.dialogVisible = true
        this.form.readingId = data.readingId
        this.form.communityId = getCommunityId()
      },
      handleSubmit() {
        this.$refs.form.validate(async valid => {
          if (valid) {
            try {
              await auditFloorShareReading(this.form)
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
74
              this.$message.success(this.$t('common.operationSuccess'))
a0f584aa   wuxw   费用公摊开发完成
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
              this.dialogVisible = false
              this.$emit('success')
            } catch (error) {
              console.error('审核公摊抄表失败:', error)
            }
          }
        })
      },
      handleClose() {
        this.$refs.form.resetFields()
        this.form = {
          readingId: '',
          state: '',
          auditRemark: '',
          communityId: ''
        }
      }
    }
  }
  </script>