叶松
2023-11-21 6eaaba4f97028d581df3e019a7705d60b398c26e
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
<template>
    <view class="incom_detail">
        <u-form
            ref="form"
            :model="formRegister"
            labelWidth="auto"
            labelPosition="left">
            <u-form-item
                label="头像"
                prop="photoUrl"
                borderBottom>
                    <u-avatar 
                        slot="right"
                        :src="formRegister.photoUrl" 
                        shape="square">
                    </u-avatar>
            </u-form-item>
            <u-form-item
                    label="姓名"
                    prop="realName"
                    borderBottom>
                <u-input
                    v-model="formRegister.realName"
                    placeholder="请输入姓名"
                    border="none"
                    disabled
                    disabledColor="#FFFFFF">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="性别"
                    prop="sexValue"
                    borderBottom>
                <u-input
                    v-model="formRegister.sex"
                    placeholder="请选择性别"
                    disabled
                    disabledColor="#FFFFFF"
                    border="none">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="手机号"
                    prop="phone"
                    borderBottom>
                <u-input
                    v-model="formRegister.phone"
                    placeholder="请输入手机号"
                    border="none"
                    disabled
                    disabledColor="#FFFFFF">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="身份证号"
                    prop="idNo"
                    borderBottom>
                <u-input
                    v-model="formRegister.idNo"
                    placeholder="请输入身份证号"
                    border="none"
                    disabled
                    disabledColor="#FFFFFF">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="分公司"
                    prop="companyIdValue"
                    borderBottom>
                <u-input
                    v-model="formRegister.companyName"
                    placeholder="请选择分公司"
                    disabled
                    disabledColor="#FFFFFF"
                    border="none">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="岗位"
                    prop="posIdValue"
                    borderBottom>
                <u-input
                    v-model="formRegister.posName"
                    placeholder="请选择岗位"
                    disabled
                    disabledColor="#FFFFFF"
                    border="none">
                </u-input>
            </u-form-item>
            <u-form-item
                    label="备注"
                    borderBottom>
                <u-input
                    v-model="formRegister.remark"
                    placeholder="请输入备注"
                    border="none"
                    disabled
                    disabledColor="#FFFFFF">
                </u-input>
            </u-form-item>
        </u-form>
        <view class="flow_content">
            <view class="flow_content_title">
                <u-icon 
                    name="clock" 
                    color="#1976FF" 
                    size="22"
                    space="6"
                    label="流程记录"
                    labelColor="#333333"
                    labelSize="18px">
                </u-icon>
            </view>
            <view 
                v-for="(item, index) in applyRecord"
                :key="index"
                class="flow_content_info">
                <view class="info_item">
                    <text>{{item.realName}}</text>
                    <text>{{item.createTime}}</text>
                </view>
                <view class="info_item">
                    <u-text
                        suffixIcon="arrow-right" 
                        iconStyle="font-size: 18px"
                        size="18px"
                        color="#1976FF"
                        :text="item.processName">
                    </u-text>
                </view>
            </view>
        </view>
        <view class="flow_textarea" v-if="![1, 2, null].includes(formRegister.applyFlag)">
            <u-textarea 
                v-model="applyDesc" 
                placeholder="请输入" 
                count
                maxlength="200">
            </u-textarea>
            <view style="margin: 10px 0;" @click="propDepart()">
                <u-input
                    v-model="departName"
                    placeholder="请选择部门"
                    disabled
                    disabledColor="#FFFFFF">
                </u-input>
            </view>
        </view>
        <view class="flow_button" v-if="![1, 2, null].includes(formRegister.applyFlag)">
            <u-button type="primary" :plain="true" text="不通过" @click="submitCheck(2)"></u-button>
            <u-button type="primary" color="#1976FF" text="通过" @click="submitCheck(1)"></u-button>
        </view>
        <view class="flow_buttons" v-else>
            <u-button type="primary" color="#1976FF" text="返回" @click="navigetBack()"></u-button>
        </view>
        <u-picker 
            :show="showDepart" 
            :columns="departData" 
            keyName="departName"
            @cancel="showDepart = false"
            @confirm="changeDepartment">
        </u-picker>
    </view>
</template>
 
<script>
import { throttle } from '../../plugins/public';
    export default {
        data() {
            return {
                formRegister: {
                    photoUrl: ''
                },
                applyRecord: [],
                applyDesc: '',
                departId: '',
                departName: '',
                departData: [],
                showDepart: false,
            }
        },
        onLoad(option) {
            this.getAllDepartmentData();
            console.log(option,'--');
            this.$api.reboSystem.getPlatUserapplyDetail({
                userId: option.userId
            }).then((res) => {
                if(res.success) {
                    this.applyRecord = res.data.applyRecord;
                    this.formRegister = res.data.reginfo;
                    this.$set(this.formRegister, 'photoUrl', res.data.reginfo.photoUrl ? 
                    `https://szpipe.thhy-tj.com/${res.data.reginfo.photoUrl}` : '');
                    this.$set(this.formRegister, 'sex', res.data.reginfo.sex == 0 ? '男' : '女');
                }
            })
        },
        methods: {
            // 获取部门信息
            async getAllDepartmentData() {
                const { data } = await this.$api.system.getAllDepartmentData();
                this.departData = [data];
            },
            // 打开选择部门
            propDepart() {
                this.showDepart = true;
                this.departId = '';
                this.departName = '';
            },
            // 选择部门信息
            changeDepartment({ value }) {
                this.departId = value[0].departId;
                this.departName = value[0].departName;
                this.showDepart = false;
            },
            // 审核入厂信息
            submitCheck: throttle(function(number) {
                this.$api.reboSystem.checkPlatUserInfo({
                    userId: this.formRegister.userId,
                    applyResult: number,
                    departId: this.departId,
                    applyDesc: this.applyDesc
                }).then((res) => {
                    if(res.success) {
                        uni.$u.toast('审核完成');
                        setTimeout(() => {
                            uni.navigateBack();
                        }, 1000)
                    } else {
                        uni.$u.toast(res.statusMsg);
                    }
                })
            }, 3000),
            // 返回
             navigetBack() {
                 uni.navigateBack();
             }
        }
    }
</script>
 
<style scoped lang="scss">
    .incom_detail {
        position: relative;
        padding: 0 10px;
        
        .flow_content {
            margin-top: 20px;
            background: #E8F1FF;
            border-radius: 4px;
            
            .flow_content_title {
                padding: 15px 10px 10px;
                border-bottom: 1px solid #DBDDDF;
            }
            
            .flow_content_info {
                display: flex;
                padding: 15px 10px;
                
                .info_item {
                    display: flex;
                    
                    &:first-child {
                        flex: 2;
                        flex-direction: column;
                        
                        &>text {
                            margin: 2px 0;
                        }
                    }
                    
                    &:last-child {
                        justify-content: center;
                    }
                }
            }
        }
        
        .flow_textarea {
            margin: 10px 0;
            
            /deep/ .u-input__content__field-wrapper__field {
                text-align: left !important;
            }
        }
        
        .flow_button {
            display: flex;
            justify-content: space-between;
            padding-bottom: 24px;
            
            /deep/ .u-button--plain {
                width: 48%;
            }
            
            /deep/ .u-button--square {
                width: 48%;
            }
        }
        
        .flow_buttons {
            padding-bottom: 24px;
            margin-top: 10px;
        }
    }
    
    ::v-deep .u-input__content__field-wrapper__field {
        text-align: right !important;
    }
</style>