MrShi
2024-11-11 0da56b9186b6c63a587c36c2f3a1b30329281d28
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
    <GlobalWindow
        :title="title"
        width="100%"
        :visible.sync="visible"
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="info" v-if="info">
            <div class="info_list">
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">申请授权账号:</div>
                    <div class="info_list_item_val">{{info.userName}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">授权管理企业:</div>
                    <div class="info_list_item_val">{{info.companyNames}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">申请说明:</div>
                    <div class="info_list_item_val">{{info.content}}</div>
                </div>
                <div class="info_list_item" style="width: 100%;">
                    <div class="info_list_item_label">申请附件:</div>
                    <div class="info_list_item_val">
                        <div class="info_list_item_val_cul">
                            <u v-for="(item, index) in info.multifileList" :key="index" @click="openFile(item.fileurlFull)">{{item.name}}</u>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <el-form :model="form" ref="form" :rules="rules">
            <el-form-item label="是否通过" prop="status">
                <el-radio-group v-model="form.status">
                    <el-radio :label="1">审核通过</el-radio>
                    <el-radio :label="2">审核不通过</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="驳回理由" prop="checkInfo" :rules="form.status === 2 ? { required: true, message: '驳回理由不能为空', trigger: 'blur' } : { required: false } ">
                <el-input
                    type="textarea"
                    placeholder="请输入驳回理由"
                    v-model="form.checkInfo"
                    maxlength="300"
                    show-word-limit />
            </el-form-item>
        </el-form>
    </GlobalWindow>
</template>
 
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import UploadFile from '@/components/common/UploadFile'
  import { audit, getById } from '@/api/business/companyUserApply'
  export default {
    name: 'OperaCompanyUserApplyCarefulWindow',
    extends: BaseOpera,
    components: { GlobalWindow, UploadFile },
    data () {
      return {
        // 表单数据
        form: {
          id: null,
          status: 1,
          checkInfo: ''
        },
        info: null,
        // 验证规则
        rules: {}
      }
    },
    methods: {
      open (title, id) {
        this.title = title
        this.form.checkInfo = ''
        this.form.status = 1
        this.form.id = id
        getById(id)
          .then(res => {
            this.info = res
            this.visible = true
          })
      },
      openFile(url) {
        window.open(url)
      },
      confirm() {
        this.$refs.form.validate((valid) => {
          if (!valid) {
            return
          }
          // 调用新建接口
          this.isWorking = true
          audit(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>
    .info {
        width: 100%;
        .info_label {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            span {
                font-size: 18px;
                font-weight: 600;
                color: #000000;
            }
        }
        .info_list {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            .info_list_item {
                width: 50%;
                display: flex;
                align-items: start;
                margin-bottom: 20px;
                .info_list_item_label {
                    font-size: 15px;
                    flex-shrink: 0;
                }
                .info_list_item_val {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    font-size: 15px;
                    .info_list_item_val_cul {
                        display: flex;
                        flex-direction: column;
                        u {
                            font-size: 15px;
                            color: #2E68EC;
                            cursor: pointer;
                            margin-top: 5px;
                            &:first-child {
                                margin: 0;
                            }
                        }
                    }
                    .image {
                        width: 100px;
                        height: 100px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        overflow: hidden;
                        img {
                            width: 100%;
                        }
                    }
                }
            }
        }
    }
</style>