|
|
@@ -0,0 +1,255 @@
|
|
|
+<template>
|
|
|
+ <div class="editV20250327">
|
|
|
+ <van-progress pivot-text=" " stroke-width="6" color="#f2826a" :percentage="scheduleNum" class="scheduleSty"/>
|
|
|
+ <div class="title">{{ infoDataEdit[0].dc_name }}</div>
|
|
|
+ <div class="greetings">{{ infoDataEdit[0].wen_hou_yu_ }}</div>
|
|
|
+ <div class="tips">
|
|
|
+ <div v-for="(item,i) in sumbitSubList" :key="i" class="options" @click="clickBtn(i)">
|
|
|
+ <div class="Title">
|
|
|
+ <span style="color:red">*</span>
|
|
|
+ {{ (i+1)+'、'+item.tiGan }}
|
|
|
+ <span>({{ item.tiXing }})</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.tiXing === '单选题'" class="content">
|
|
|
+ <van-radio-group v-if="Object.keys(item.xuanXiang).length>0" v-model="item.daAn">
|
|
|
+ <van-radio v-for="(t,e) in item.xuanXiang" :key="item.tm_id + e" :name="e" checked-color="#ee0a24" class="xuanXiangSty">{{t}}</van-radio>
|
|
|
+ <!-- <van-radio name="2" checked-color="#ee0a24">单选框 2</van-radio> -->
|
|
|
+ </van-radio-group>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.tiXing === '多选题'" class="content">
|
|
|
+ <van-checkbox-group v-if="Object.keys(item.xuanXiang).length>0" v-model="item.daAn">
|
|
|
+ <van-checkbox v-for="(t,e) in item.xuanXiang" :key="item.tm_id + e" :name="e">{{ t }}</van-checkbox>
|
|
|
+ <!-- <van-checkbox name="b">复选框 b</van-checkbox> -->
|
|
|
+ </van-checkbox-group>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="item.tiXing === '问答题'" class="content">
|
|
|
+ <van-field
|
|
|
+ v-model="item.daAn"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ type="textarea"
|
|
|
+ :border="true"
|
|
|
+ clearable
|
|
|
+ maxlength="2000"
|
|
|
+ class="shortAnswer"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="buttonArrow">
|
|
|
+ <div :class="sumbitSubList.filter(item => item.daAn !== '').length!==sumbitSubList.length?'btn':'btn btnColor'" @click="sumbitChange()">提交</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+// import meth from '../satisfactionJson.json'
|
|
|
+import { save } from '@/api/platform/feature/satisfactionJson'
|
|
|
+import { Toast } from 'vant'
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ objTypeNum: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ infoData: {
|
|
|
+ type: Array,
|
|
|
+ default: function() { return [] }
|
|
|
+ },
|
|
|
+ codeId: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ infoDataEdit: this.infoData,
|
|
|
+ sumbitMaster: {},
|
|
|
+ sumbitSubList: [],
|
|
|
+ scheduleNum: 0,
|
|
|
+ jinRuShiJian: this.$common.getDateNow(19)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ sumbitSubList: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ const arr = val.filter(item => item.daAn !== '')
|
|
|
+ this.scheduleNum = val.length === 0 ? 0 : ((arr.length / val.length) * 100)
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.infoDataEdit.length > 0) {
|
|
|
+ this.sumbitMaster = {
|
|
|
+ bianZhiShiJian: this.jinRuShiJian,
|
|
|
+ createTime: this.jinRuShiJian,
|
|
|
+ // dataStatus: 'string',
|
|
|
+ // delBeforeSave: true,
|
|
|
+ diaoChaDuiXian: this.infoDataEdit[0].diao_cha_dui_xian,
|
|
|
+ diaoChaMingChe: this.infoDataEdit[0].dc_name,
|
|
|
+ // dsAlias: '',
|
|
|
+ faQiShiJian: this.jinRuShiJian,
|
|
|
+ satisfactionDetailPoList: [],
|
|
|
+ diaoChaId: this.infoDataEdit[0].dc_id,
|
|
|
+ wenJuanId: this.infoDataEdit[0].wj_id,
|
|
|
+ wenJuanMingCheng: this.infoDataEdit[0].wj_name,
|
|
|
+ tianBiaoShiJian: this.jinRuShiJian,
|
|
|
+ tiJiaoShiJian: ''
|
|
|
+
|
|
|
+ }
|
|
|
+ this.infoData.forEach((item, i) => {
|
|
|
+ const o = {
|
|
|
+ // bianZhiBuMen: '',
|
|
|
+ // bianZhiRen: '',
|
|
|
+ // bianZhiShiJian: '',
|
|
|
+ // createBy: '',
|
|
|
+ // createTime: '',
|
|
|
+ // dataStatus: '',
|
|
|
+ // dbType: '',
|
|
|
+ // diDian: '',
|
|
|
+ // dsAlias: '',
|
|
|
+ // id: '',
|
|
|
+ // ip: '',
|
|
|
+ // kuaiZhao: '',
|
|
|
+ // name: '',
|
|
|
+ // parentId: '',
|
|
|
+ // pk: '',
|
|
|
+ // shiFouGuoShen: '',
|
|
|
+ // tenantId: '',
|
|
|
+ // updateBy: '',
|
|
|
+ // updateTime: '',
|
|
|
+ tiMuId: item.tm_id,
|
|
|
+ tiXing: item.ti_xing_,
|
|
|
+ tiGan: item.ti_gan_,
|
|
|
+ xuanXiang: item.xuan_xiang_ === '' ? {} : JSON.parse(item.xuan_xiang_),
|
|
|
+ daAn: ''
|
|
|
+ }
|
|
|
+ this.sumbitSubList.push(o)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ const toast = Toast({
|
|
|
+ duration: 3000, // 持续展示 toast
|
|
|
+ message: '无数据,请重新扫码,或联系相关人员!'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.push({ name: 'dashboard' })
|
|
|
+ }, 3000)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ clickBtn(i) {
|
|
|
+ this.changeIndex = i
|
|
|
+ },
|
|
|
+ sumbitChange() {
|
|
|
+ if (this.sumbitSubList.filter(item => item.daAn !== '').length === this.sumbitSubList.length) {
|
|
|
+ const obj = []
|
|
|
+ this.sumbitSubList.forEach((e, i) => {
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ obj[i] = structuredClone(e)
|
|
|
+ obj[i].xuanXiang = Object.keys(e.xuanXiang).length > 0 ? '' : JSON.stringify(e.xuanXiang)
|
|
|
+ })
|
|
|
+ this.sumbitMaster.satisfactionDetailPoList = obj
|
|
|
+ this.sumbitMaster.tiJiaoShiJian = this.$common.getDateNow(16)
|
|
|
+ this.sumbitMaster.shiFouGuoShen = '已完成'
|
|
|
+ console.log(this.sumbitMaster, 'this.sumbitMasterthis.sumbitMaster')
|
|
|
+ save(
|
|
|
+ this.sumbitMaster
|
|
|
+ ).then((res) => {
|
|
|
+ localStorage.setItem(this.codeId, '已完成')
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ const toast = Toast({
|
|
|
+ duration: 3000, // 持续展示 toast
|
|
|
+ message: '已提交成功!'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.push({ name: 'dashboard' })
|
|
|
+ }, 3000)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ const toast = Toast({
|
|
|
+ duration: 3000, // 持续展示 toast
|
|
|
+ message: '有未填写的问题,请检查!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.editV20250327{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: scroll;
|
|
|
+ .scheduleSty{
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+ .title{
|
|
|
+ font-size: 18px;
|
|
|
+ text-align: center;
|
|
|
+ margin: 20px 0;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #91d8d2;
|
|
|
+ }
|
|
|
+ .greetings{
|
|
|
+ font-size: 14px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ line-height: 1.5;
|
|
|
+ color: #5e5f61;
|
|
|
+ padding: 0 5% 20px 5%;
|
|
|
+ border-bottom: 1px dashed #b6b7bb;
|
|
|
+ }
|
|
|
+ .tips{
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 5%;
|
|
|
+ .options{
|
|
|
+ div{
|
|
|
+ line-height: 1.5;
|
|
|
+ }
|
|
|
+ .title{
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ .content{
|
|
|
+ width: 100%;
|
|
|
+ margin: 2% 0;
|
|
|
+ .shortAnswer{
|
|
|
+ font-size: 16px; background-color: #f7f7f7; height: 10%;
|
|
|
+ }
|
|
|
+ .xuanXiangSty{
|
|
|
+ font-size: 14px;
|
|
|
+ color: #5e5f61;
|
|
|
+ margin: 1% 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .buttonArrow{
|
|
|
+ // width: 30%;
|
|
|
+ height: 5%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin: 5% 0;
|
|
|
+
|
|
|
+ .btn{
|
|
|
+ height: 100%;
|
|
|
+ width: 80%;
|
|
|
+ background-color: #91d8d2;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ border-radius: 10px;
|
|
|
+ }
|
|
|
+ .btnColor{
|
|
|
+ background-color: #30c2bd;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|