jiangping
2025-05-29 2b0a139f88adbbb67bc6feed69dc1ee9ff158cb9
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
    <GlobalWindow
        :title="title"
        width="500px"
        text="提交"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <el-form :model="form" ref="form" :rules="form.status === 0 ? rules : rules1" label-position="top">
            <el-form-item label="" prop="status">
                <el-radio-group v-model="form.status" @change="changeStatus">
                    <el-radio :label="0">同意</el-radio>
                    <el-radio :label="1">拒绝</el-radio>
                    <el-radio :label="2">商议审批</el-radio>
                    <el-radio :label="3">商议不审批</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="说明" prop="describe">
                <el-input
                    type="textarea"
                    :rows="5"
                    placeholder="请输入说明"
                    v-model="form.describe" />
            </el-form-item>
            <el-form-item label="问题类型" prop="problem" v-if="[2,3].includes(form.status)">
                <el-checkbox-group v-model="form.problem" @change="changeProblem">
                    <el-checkbox :label="item" v-for="(item, index) in problemList" :key="index"></el-checkbox>
                </el-checkbox-group>
            </el-form-item>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import { acceptance, getDiscussProblemType } from '@/api/business/settleRisk'
export default {
  name: 'acceptance',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      form: {
        id: null,
        status: 0,
        describe: '',
        syProblemOpts: '',
        problem: []
      },
      problemList: [],
      rules: {
        problem: [
          { required: true, message: '不能为空', trigger: 'blur' }
        ]
      },
      rules1: {
        problem: [
          { required: true, message: '不能为空', trigger: 'blur' }
        ],
        describe: [
          { required: true, message: '不能为空', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    open (title, id) {
      this.title = title
      this.form.id = id
      getDiscussProblemType()
        .then(res => {
          console.log(res)
          this.problemList = res
        })
      this.visible = true
    },
    changeStatus () {
      this.$nextTick(() => {
        this.$refs.form.clearValidate()
      })
    },
    changeProblem (e) {
      if (!e || e.length === 0) {
        this.form.syProblemOpts = ''
      } else {
        this.form.syProblemOpts = e.join(',')
      }
    },
    confirm () {
      this.$refs.form.validate((valid) => {
        if (!valid) {
          return
        }
        this.isWorking = true
        acceptance(this.form)
          .then(() => {
            this.visible = false
            this.$tip.apiSuccess('操作成功')
            this.$emit('success')
          })
          .catch(e => {
            this.$tip.apiFailed(e)
          })
          .finally(() => {
            this.isWorking = false
          })
      })
    }
  }
}
</script>
 
<style lang="scss" scoped>
    .a {
        color: rgba(16,16,16,1);
        font-size: 14px;
    }
    .b {
        color: rgba(154,154,154,1);
        font-size: 14px;
        margin: 10px 0;
    }
    .c {
        color: rgba(16,16,16,1);
        font-size: 14px;
    }
</style>