-
zhangwei
2025-11-11 ec90cbd7680a6f927cb1cea43f33ab7df6d0864c
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
<template>
    <view class="full-page ">
        <view class="list">
            <up-form labelPosition="left" :model="state.publicJob" ref="formRef" labelWidth='140rpx'>
                <view class="c-p-b-134">
                    <view class="content c-p-l-24 c-p-b-24">
                        <up-form-item label="日期" prop="planStartTime" :borderBottom='false' ref="item1">
                            <up-input v-model="state.publicJob.deliverTime" border="none" placeholder="请点击选择部门"
                                readonly></up-input>
                        </up-form-item>
                        <up-form-item label="反馈人" prop="name" :borderBottom='false' ref="item1">
                            <up-input v-model="state.publicJob.feedbackName" border="none" placeholder="请填写姓名"
                                readonly></up-input>
                        </up-form-item>
                        <up-form-item label="责任人" prop="lianxiren" :borderBottom='false' ref="item1">
                            <up-input v-model="state.publicJob.responsibleName" border="none" readonly></up-input>
                        </up-form-item>
                        <up-form-item label="追责罚款" prop="fakuan" :borderBottom='false' ref="item1">
                            <up-input v-model="state.publicJob.fakuan" border="none" readonly></up-input>
                        </up-form-item>
                        <up-form-item label="客户名称" prop="companyName" :borderBottom='false' ref="item1">
                            <up-input v-model="state.publicJob.companyName" border="none" readonly></up-input>
                        </up-form-item>
                        <up-form-item label="是否完结" prop="dizhi" :borderBottom='false' ref="item1">
                            <u-text size='14' :text="state.publicJob.wanjiestatus=='UnFinish'?'未完结':'完结'"
                                :type="state.publicJob.wanjiestatus=='UnFinish'?'error':'success'" lines="1">
                            </u-text>
                        </up-form-item>
                        <up-form-item label="问题描述" prop="wentifankui" :borderBottom='false' ref="item1">
                            <up-textarea v-model="state.publicJob.wentifankui" border="none" autoHeight></up-textarea>
                        </up-form-item>
                    </view>
                </view>
            </up-form>
        </view>
        <u-picker :show="zhanghuPicker" :columns="zhanghuList" keyName="accountName" @cancel='openzhanghuPicker'
            :defaultIndex='defaultIndexAccount' @confirm='confirmzhanghuPicker'></u-picker>
 
        <u-picker :show="zhanghuPickerType" :columns="state.zhanghuListType" @cancel='openzhanghuPickerType'
            @confirm='confirmzhanghuPickerType'></u-picker>
 
        <u-picker :show="kemuPicker" :columns="kemuList" keyName="subjectName" @cancel='openKemuPicker'
            :defaultIndex='defaultIndex' @confirm='confirmKemuPicker'></u-picker>
 
 
    </view>
</template>
 
<script setup>
    import {
        apiBaseUrl
    } from '@/common/setting/constVarsHelper.js';
    import {
        ref,
        reactive,
        getCurrentInstance,
        onMounted,
        computed
    } from 'vue';
    import {
        onLoad,
        onShow,
        onReady,
        onHide
    } from "@dcloudio/uni-app";
    const {
        $upload,
        $api,
        $util,
        $db
    } = getCurrentInstance().appContext.config.globalProperties
    let role = ref()
    let keyid = ref()
    let leibie = '费用报销'
    let zhanghuPicker = ref(false)
    let zhanghuList = ref()
    let allZhanghuList = ref()
    let zhanghuPickerType = ref(false)
    let kemuList = ref()
    let kemuPicker = ref(false)
    let defaultIndex = ref([0])
    let defaultIndexAccount = ref([0])
    let state = reactive({
        publicJob: {
            departmentId: '', //部门Id
            departmentName: '',
            depart: {},
            name: '', //姓名
            rewardResult: '', //科目id
            rewardContent: '', //科目名称
            planMoney: '', //金额
            planContent: '', //摘要
            houbufapiaoStatus: 'You', //有无发票
            workPlanAttachments: [], //附件&发票
            firmAccountId: '',
            accountType: ''
        },
        invoice: [],
        file: [],
        zhanghuListType: []
    })
    let rules = {
        accountType: {
            required: true,
            message: '账户类型不能为空',
            trigger: ['blur', 'change']
        },
        firmAccountId: {
            required: true,
            message: '账户不能为空',
            trigger: ['blur', 'change']
        },
        planContent: {
            required: true,
            message: '摘要不能为空',
            trigger: ['blur', 'change']
        },
        rewardContent: {
            required: true,
            message: '科目不能为空',
            trigger: ['blur', 'change']
        }
    }
    onLoad((options) => {
        keyid.value = options.KeyId
        GetProblemPlanInfo()
    })
 
    const formRef = ref(null);
    // onReady(() => {
    //     formRef.value.setRules(rules);
    // })
    onShow(() => {})
    // onMounted(() => {
    //     formRef.value.setRules(rules);
 
    // });
    let isLoading = ref(false)
    const previewImage = (item) => {
        uni.previewImage({
            current: item,
            loop: true,
            urls: state.publicJob.imageList
        })
    }
    const confirmzhanghuPicker = (arr) => {
        defaultIndexAccount = arr.indexs
        state.publicJob.firmAccountId = String(arr.value[0].keyid)
        state.publicJob.firmAccountName = arr.value[0].accountName
        openzhanghuPicker()
    }
    const confirmzhanghuPickerType = (arr) => {
        defaultIndexAccount = [0]
        state.publicJob.accountType = arr.value[0]
        openzhanghuPickerType()
    }
    const openzhanghuPicker = () => {
        if (!state.publicJob.accountType) {
            return $util.showToast({
                title: '请先选择账户类型!'
            })
        }
        zhanghuList = allZhanghuList.filter(item => {
            return item.accountType == state.publicJob.accountType
        })
        zhanghuList = [zhanghuList]
        console.log(zhanghuList);
        zhanghuPicker.value = !zhanghuPicker.value
    }
    const openzhanghuPickerType = () => {
        zhanghuPickerType.value = !zhanghuPickerType.value
    }
    const GetProblemPlanInfo = () => {
        let getList = null
        // if (role.value == 'zhuGuan') {
        //     getList = $api.zhuGuanGetPlanInfo
        // } else {
        //     getList = $api.jingLiGetPlanInfo
        // }
        $api.GetProblemPlanInfo(keyid.value).then(res => {
            state.publicJob = res.data
            state.publicJob.deliverTime = $util.formatDate(state.publicJob.deliverTime)
            state.publicJob.feedbackName = state.publicJob.driver && state.publicJob.driver.name
            state.publicJob.responsibleName = state.publicJob.zerenrenInfo && state.publicJob.zerenrenInfo.name
        })
    }
    const confirmKemuPicker = (arr) => {
        console.log('----', arr);
        state.publicJob.rewardResult = String(arr.value[0].keyid)
        state.publicJob.rewardContent = arr.value[0].subjectName
        openKemuPicker()
    }
    const openKemuPicker = () => {
        kemuPicker.value = !kemuPicker.value
    }
    const saveOrder = (approvalStatus) => {
        isLoading.value = true
        let functionOrder = null
        // if (role.value == 'zhuGuan') {
        //     functionOrder = $api.ApprovalPlan
        // } else {
        //     functionOrder = $api.BaoxiaoPlan
        // }
        let obj = {
            keyid: state.publicJob.keyid,
            firmAccountId: state.publicJob.firmAccountId,
            planContent: state.publicJob.planContent,
            accountType: state.publicJob.accountType
        }
        formRef.value.validate().then(res => {
            $api.caiWuApprovalPlan(obj).then(res => {
                if (res.code == 1) {
                    uni.navigateBack()
                    $util.showToast({
                        title: "付款成功!",
                        icon: "success"
                    })
                } else {
                    $util.showToast({
                        title: res.error
                    })
                }
                isLoading.value = false
            })
        })
 
    }
</script>
 
<style>
    .list {}
 
    .u-button {
        width: 280rpx !important;
        margin: 0;
    }
 
    .content {
        width: 100%;
        box-sizing: border-box;
        background-color: #fff;
    }
 
    .u-textarea {
        padding: 0 !important;
    }
 
    .u-form-item__body {
        padding: 5px 0 !important;
    }
 
    .fui-upload__wrap {
        /* #ifndef APP-NVUE */
        display: flex;
        /* #endif */
        flex-direction: row;
        flex-wrap: wrap;
    }
 
    .fui-upload__item {
        /* #ifndef APP-NVUE */
        display: flex;
        /* #endif */
        align-items: center;
        justify-content: center;
        /* margin-right: 20rpx; */
        margin: 10rpx 10rpx 10rpx 0;
        /* margin-bottom: 20rpx; */
        /* #ifdef H5 */
        cursor: pointer;
        /* #endif */
        position: relative;
 
        /* #ifndef APP-NVUE */
        box-sizing: border-box;
        /* #endif */
    }
</style>