<template>
|
|
<view class="box">
|
|
<view class="box1">
|
<view class="uni-padding-wrap uni-common-mt">
|
|
<view class="center" v-for="(item, index) in items" :key="index"
|
:class="{ active: current === index, inactive: current !== index }" @click="onClickItem(index)">
|
{{ item }}
|
</view>
|
|
</view>
|
|
<view class="content">
|
<view v-if="current === 0">
|
|
<uni-forms v-for="(item, index) in intList" :key="index">
|
<uni-card>
|
<uni-forms-item><text style=" color: #FF4949;">*</text><text
|
class="title">{{ (index + 1).toString().padStart(2, '0') }}.{{ item.question }}</text>
|
|
<u-radio-group class="radio-group" @change="checkOne" v-show="item.type == '1'"
|
v-model="selectedValue">
|
<u-radio v-for="(item3, i) in item.tjSurveyOptionsList" :key="i"
|
v-if="item3.ooption" :value="item3.oid" :label="item3.ooption"
|
style="transform:scale(0.7); margin-bottom: 10px;">
|
<text>{{ item3.ooption }}</text>
|
</u-radio>
|
</u-radio-group>
|
<checkbox-group @change="checkbox" v-show="item.type == '2'">
|
<label v-for="(item3, i) in item.tjSurveyOptionsList" :key="i">
|
<checkbox @click="fnbox" :value="item3.oid" :checked="item3.checked">
|
{{item3.ooption}}
|
</checkbox>
|
</label>
|
</checkbox-group>
|
<u-rate v-if="item.type == '3'" v-model="b" @change="onChange" inactive-color="#b2b2b2"
|
active-color="#008cd3"></u-rate>
|
</uni-forms-item>
|
</uni-card>
|
</uni-forms>
|
<view class="button-section" >
|
<button type="primary" @click="tijiao" style="background-color:#419FFD; width: 668rpx; height: 96rpx;border-radius: 48rpx;font-size: 32rpx;
|
color: #FFFFFF;line-height: 96rpx;display: flex;
|
justify-content: center;
|
align-items: center;" v-if="!num">提交</button>
|
</view>
|
|
</view>
|
<view v-if="current === 1">
|
<uni-forms v-for="(item, index) in intList" :key="index">
|
<uni-card>
|
<uni-forms-item><text style=" color: #FF4949;">*</text><text
|
class="title">{{ (index + 1).toString().padStart(2, '0') }}.{{ item.question }}</text>
|
<u-radio-group class="radio-group" @change="checkOne" v-show="item.type == '1'"
|
v-model="selectedValue">
|
<u-radio v-for="(item3, i) in item.tjSurveyOptionsList" :key="i"
|
v-if="item3.ooption" :value="item3.oid" :label="item3.ooption"
|
style="transform:scale(0.7); margin-bottom: 10px;">
|
<text>{{ item3.ooption }}</text>
|
</u-radio>
|
</u-radio-group>
|
<checkbox-group @change="checkbox" v-show="item.type == '2'">
|
<label v-for="(item3, i) in item.tjSurveyOptionsList" :key="i">
|
<checkbox @click="fnbox" :value="item3.oid" :checked="item3.checked">
|
{{item3.ooption}}
|
</checkbox>
|
</label>
|
</checkbox-group>
|
|
<u-rate v-if="item.type == '3'" v-model="b" @change="onChange" inactive-color="#b2b2b2"
|
active-color="#008cd3"></u-rate>
|
</uni-forms-item>
|
</uni-card>
|
</uni-forms>
|
<view class="button-section" >
|
<button type="primary" @click="tijiao" style="background-color:#419FFD; width: 668rpx; height: 96rpx;border-radius: 48rpx;font-size: 32rpx;
|
color: #FFFFFF;line-height: 96rpx;" v-if="!num">提交</button>
|
</view>
|
</view>
|
</view>
|
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import {
|
printCode,
|
addSurveyRecord
|
} from "@/api/system/visit";
|
import {
|
CLIENT_RENEG_LIMIT
|
} from "tls";
|
export default {
|
data() {
|
return {
|
tyesOptions: [],
|
statusOptions: [],
|
index: 0,
|
index1: 0,
|
index2: 0,
|
index3: 0,
|
index5: 0,
|
tjAskHistorysList: [],
|
tjworkOptions: [],
|
items: ['满意度调查问卷', '回访调查问卷'],
|
current: 0,
|
activeColor: '#FFFFFF ',
|
styleType: 'button',
|
b: "",
|
value: [],
|
rad: true,
|
Star: false,
|
data: [],
|
ooption: "",
|
qid: "",
|
qname: "",
|
checkboxqid: "",
|
checkboxqname: "",
|
checkboxooption: "",
|
tjSurveyRecordDetailList: [],
|
ooids: "",
|
tjSurveyList: [],
|
ProblemEcho: [],
|
intList: {},
|
mid: "2",
|
mname: "体检调查满意度模板2",
|
fromBy: "小程序端",
|
emerc: false,
|
tjNumber: "",
|
oid: "",
|
tjSurveyRecordDetailLists: [],
|
tjSurveyRecordDetailListss: [],
|
tjSurveyRecordDetailListsss: [],
|
question: "",
|
qids: "",
|
num: "",
|
}
|
},
|
//生命周期方法 —— 页面加载时
|
onLoad(option) {
|
this.tjNumber = option.tjNumber;
|
this.investigation(this.tjNumber);
|
this.cusName = option.cusName;
|
this.cusPhone = option.cusPhone;
|
},
|
|
methods: {
|
picker1(workStatus) {
|
this.index = workStatus.detail.value;
|
// console.log(this.index);
|
},
|
picker2(work) {
|
this.index1 = work.detail.value;
|
},
|
picker5(work) {
|
this.index5 = work.detail.value;
|
|
},
|
picker3(xiyan) {
|
this.index2 = xiyan.detail.value;
|
// console.log(this.index2);
|
},
|
picker4(yinjiu) {
|
this.index3 = yinjiu.detail.value;
|
},
|
onClickItem(index) {
|
this.current = index;
|
},
|
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">
|
/* .uni-common-mt {
|
margin-top: 15px;
|
border: none !important;
|
}
|
|
.uni-padding-wrap {
|
// width: 750rpx;
|
padding: 0px 20px;
|
}
|
*/
|
.u-rate {
|
margin-top: 20rpx !important;
|
}
|
|
.uni-card {
|
width: 702rpx;
|
background: linear-gradient(90deg, #FFFFFF 0%, #FCFFFE 100%);
|
box-shadow: 0rpx 0rpx 12rpx 1rpx rgba(127, 153, 177, 0.14);
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
margin: 0 auto;
|
}
|
|
.uni-padding-wrap {
|
width: 702rpx;
|
height: 80rpx;
|
background: #419FFD;
|
// border-radius: 0rpx 12rpx 12rpx 12rpx;
|
text-align: center;
|
margin: 0 auto;
|
display: flex;
|
|
.center {
|
width: 351rpx;
|
height: 80rpx;
|
line-height: 80rpx;
|
background: #419FFD;
|
font-size: 32rpx;
|
color: #D8E6FF;
|
transition: all 0.1s;
|
}
|
|
.center.active {
|
font-weight: bold;
|
font-size: 32rpx;
|
color: #419FFD;
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
background: linear-gradient(180deg, #E9F7FE 0%, #FFFFFF 100%);
|
}
|
|
}
|
|
.u-radio-group {
|
display: flex !important;
|
flex-direction: column !important;
|
/* 设置为纵向排列 */
|
}
|
|
.u-radio {
|
margin-top: 40rpx;
|
}
|
|
.title {
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #373E58;
|
}
|
|
.box {
|
width: 750rpx;
|
height: 1804rpx;
|
background: linear-gradient(180deg, #419FFD 0%, #E9F7FE 68%);
|
border-radius: 0rpx 0rpx 0rpx 0rpx;
|
}
|
|
.box1 {
|
padding-top: 5px;
|
}
|
|
|
/* 固定底部容器 */
|
.button-section {
|
position: fixed;
|
/* 固定定位 */
|
bottom: 0;
|
/* 贴紧底部 */
|
left: 0;
|
/* 横向铺满 */
|
right: 0;
|
display: flex;
|
/* 启用Flex布局 */
|
justify-content: space-around;
|
/* 按钮等间距分布 */
|
align-items: center;
|
padding: 20rpx;
|
background: #fff;
|
/* 背景色 */
|
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
|
/* 顶部阴影分隔线 */
|
z-index: 999;
|
/* 确保按钮在顶层 */
|
}
|
</style>
|