路泰科技体检小程序UI设计新版本
1
wwl
5 天以前 a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57
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
<template>
    <view class="box">
        <view class="box1">
            <uni-forms v-for="(item, index) in intList" :key="index">
                <uni-card>
                    <uni-forms-item>{{ item.question }}(必填)<br />
                        <radio-group @change="checkOne">
                            <label v-for="(item3, i) in item.tjSurveyOptionsList" :key="i">
                                <radio @click="fn" v-show="item.type == '1'" :value="item3.oid"
                                    :checked="item3.checked" />
                                <text>{{item3.ooption}}</text>
                            </label>
                        </radio-group>
                        <uni-rate v-show="item.type == '3'" v-model="b" @change="onChange" color="#bbb"
                            active-color="#ffca3e" show-text></uni-rate>
                        <!-- </label> -->
                    </uni-forms-item>
                </uni-card>
            </uni-forms>
            <button type="primary" size="mini" @click="tijiao" style="background-color: #fd8b4d;left: 140px;">提交</button>
        </view>
            
    </view>
</template>
 
<script>
    import {
        printCode,
        addSurveyRecord
    } from "@/api/system/visit";
    import {
        CLIENT_RENEG_LIMIT
    } from "tls";
    export default {
        data() {
            return {
                b: "",
                rad: true,
                Star: false,
                data: [],
                ooption: "",
                qid: "",
                qname: "",
                tjSurveyRecordDetailList: [],
                ooids: "",
                tjSurveyList: [],
                intList: {},
                mid: "2",
                emerc: false,
                tjNumber: "",
                oid: "",
                tjSurveyRecordDetailLists: [],
                question: "",
                qids: "",
            }
        },
        //生命周期方法 —— 页面加载时
        onLoad(option) {
            this.tjNumber = option.tjNumber;
            this.investigation(this.tjNumber);
            this.cusName = option.cusName;
            this.cusPhone = option.cusPhone;
        },
        // watch: {
        //     myscore(val) {
        //         this.ooption = val.toString();
        //         console.log(this.ooption)
        //     },
        // },
        methods: {
            checkOne(e) {
                this.oid = "";
                this.oid = e.detail.value
            },
            investigation() {
                let mid = "2";
                printCode(mid).then((response) => {
                    this.intList = response.data;
                });
            },
            onChange(b) {
                this.b = b.value.toString();
            },
            fn() {
                this.tjSurveyRecordDetailList = [];
                this.intList.forEach((item1) => {
                    item1.tjSurveyOptionsList.forEach((item2) => {
                        let num = 0
                        if (num === 0) {
                            this.tjSurveyRecordDetailLists = [];
                            if (item1.type === "3") {
                                this.question = item1.question
                                this.qids = item1.qid;
                                this.tjSurveyRecordDetailLists.push({
                                    qid: item1.qid,
                                    qname: item1.question,
                                    oid: item2.oid,
                                    ooption: this.b,
                                });
                            }
                        }
                        num = num + 1;
                        if (this.oid === item2.oid) {
                            this.qid = item1.qid;
                            this.qname = item1.question;
                            this.ooption = item2.ooption;
                            this.tjSurveyRecordDetailList.push({
                                qid: this.qid,
                                qname: this.qname,
                                oid: this.oid,
                                ooption: this.ooption,
                            });
 
                            let mid = "2";
                            let mname = "体检调查满意度模板2";
                            let fromBy = "小程序端"
                            this.data.push({
                                tjnumber: this.tjNumber,
                                phone: this.cusPhone,
                                userName: this.cusName,
                                mid: mid,
                                mname: mname,
                                qid: this.qid,
                                qname: this.qname,
                                fromBy: fromBy,
                                tjSurveyRecordDetailList: this.tjSurveyRecordDetailList,
                            });
                        }
                    });
                });
            },
            tijiao() {
                let mid = "2";
                let mname = "体检调查满意度模板2";
                let fromBy = "小程序端"
                this.data.push({
                    tjnumber: this.tjNumber,
                    phone: this.cusPhone,
                    userName: this.cusName,
                    mid: mid,
                    mname: mname,
                    qid: this.qids,
                    qname: this.question,
                    fromBy: fromBy,
                    tjSurveyRecordDetailList: this.tjSurveyRecordDetailLists,
                })
                addSurveyRecord(this.data).then((res) => {
                    this.$modal.msgSuccess("问卷提交成功");
                    uni.navigateBack({
                        delta: 1
                    })
                });
            },
        }
    }
</script>
 
<style lang="scss">
    .box {
        width: 100%;
        min-height: 1240rpx;
        background: linear-gradient(180deg, #fd8b4d, #f4f8f7, #f7f7f7 100%, );
    }
    .box1{
        padding-top: 5px;
    }
</style>