Blame view

src/components/inspection/deleteInspectionPlan.vue 1.28 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
1d73dc48   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
    <el-dialog
      :title="$t('inspectionPlan.confirmDeleteTitle')"
      :visible.sync="visible"
      width="30%"
    >
      <div class="text-center">
        <p>{{ $t('inspectionPlan.confirmDeleteContent') }}</p>
      </div>
      <div slot="footer">
        <el-button @click="visible = false">{{ $t('inspectionPlan.cancel') }}</el-button>
        <el-button type="danger" @click="confirmDelete">{{ $t('inspectionPlan.confirm') }}</el-button>
      </div>
    </el-dialog>
  </template>
  
  <script>
  import { deleteInspectionPlan } from '@/api/inspection/inspectionPlanApi'
  
  export default {
    name: 'DeleteInspectionPlan',
    data() {
      return {
        visible: false,
        currentPlanId: null
      }
    },
    methods: {
      open(plan) {
        this.currentPlanId = plan.inspectionPlanId
        this.visible = true
      },
      
      async confirmDelete() {
        try {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
36
37
38
39
40
         const {code,msg} = await deleteInspectionPlan({ inspectionPlanId: this.currentPlanId })
         if(code != 0){
          this.$message.error(msg)
          return 
         }
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
41
          this.$message.success(this.$t('common.operationSuccess'))
1d73dc48   wuxw   继续晚上巡检功能
42
43
44
          this.visible = false
          this.$emit('success')
        } catch (error) {
cbeb361b   wuxw   v1.9 巡检功能修复一些显示的bug
45
          this.$message.error(error)
1d73dc48   wuxw   继续晚上巡检功能
46
47
48
49
50
51
52
53
54
55
56
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .text-center {
    text-align: center;
  }
  </style>