Blame view

src/components/work/visitOwnerRepair.vue 2.55 KB
4927ce37   wuxw   开发完成报修功能
1
  <template>
72de60dc   wuxw   优化报修完成
2
3
4
5
6
7
8
    <el-dialog :title="$t('repairReturnVisit.visitTitle')" :visible.sync="visible" width="600px" @close="resetForm">
      <el-form ref="visitForm" :model="formData" :rules="rules" label-width="100px" label-position="right">
        <el-form-item :label="$t('repairReturnVisit.satisfaction')" prop="visitType">
          <el-select v-model="formData.visitType" :placeholder="$t('repairReturnVisit.satisfaction')"
            style="width:100%">
            <el-option :label="$t('repairReturnVisit.satisfied')" value="1001" />
            <el-option :label="$t('repairReturnVisit.unsatisfied')" value="2002" />
4927ce37   wuxw   开发完成报修功能
9
10
          </el-select>
        </el-form-item>
72de60dc   wuxw   优化报修完成
11
12
13
14
  
        <el-form-item :label="$t('repairReturnVisit.visitContent')" prop="context">
          <el-input v-model="formData.context" type="textarea" :rows="4"
            :placeholder="$t('repairReturnVisit.visitContent')" />
4927ce37   wuxw   开发完成报修功能
15
16
        </el-form-item>
      </el-form>
72de60dc   wuxw   优化报修完成
17
  
4927ce37   wuxw   开发完成报修功能
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
      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">
          {{ $t('common.cancel') }}
        </el-button>
        <el-button type="primary" @click="submitVisit">
          {{ $t('common.submit') }}
        </el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { saveRepairReturnVisit } from '@/api/work/repairReturnVisitApi'
  
  export default {
    name: 'VisitOwnerRepair',
    data() {
      return {
        visible: false,
        formData: {
          repairId: '',
          visitType: '',
          context: ''
        },
        rules: {
          visitType: [
            { required: true, message: this.$t('repairReturnVisit.satisfactionRequired'), trigger: 'change' }
          ],
          context: [
            { required: true, message: this.$t('repairReturnVisit.visitContentRequired'), trigger: 'blur' },
            { max: 1000, message: this.$t('repairReturnVisit.visitContentMaxLength'), trigger: 'blur' }
          ]
        }
      }
    },
    methods: {
      open(repairPool) {
        this.formData = {
          repairId: repairPool.repairId,
          visitType: '',
          context: '',
fc7cb950   wuxw   开发完成采购功能
59
          communityId: this.getCommunityId()
4927ce37   wuxw   开发完成报修功能
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
        }
        this.visible = true
      },
      resetForm() {
        this.$refs.visitForm.resetFields()
      },
      submitVisit() {
        this.$refs.visitForm.validate(async valid => {
          if (valid) {
            try {
              await saveRepairReturnVisit(this.formData)
              this.$message.success(this.$t('common.submitSuccess'))
              this.visible = false
              this.$emit('success')
            } catch (error) {
              console.error('保存回访记录失败:', error)
            }
          }
        })
      }
    }
  }
  </script>