cyy 1 год назад
Родитель
Сommit
409546cc3c

+ 26 - 0
src/api/platform/feature/satisfactionJson.js

@@ -0,0 +1,26 @@
+import request from '@/utils/request'
+import { BPMN_URL } from '@/api/baseUrl'
+
+/**
+ * 获取满意度数据
+ * @param {*} params
+ */
+
+export function getQuestionnaireByQrCodeId(params) {
+  return request({
+    url: BPMN_URL() + '/employee/satisfaction/getQuestionnaireByQrCodeId',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 保存满意度数据
+ * @param {*} params
+ */
+export function save(data) {
+  return request({
+    url: BPMN_URL() + '/employee/satisfaction/save',
+    method: 'post',
+    data
+  })
+}

BIN
src/assets/images/satisfactionV2/Arrow.png


BIN
src/assets/images/satisfactionV2/Send.png


BIN
src/assets/images/satisfactionV2/agentia.png


BIN
src/assets/images/satisfactionV2/bed.png


BIN
src/assets/images/satisfactionV2/hospital.png


BIN
src/assets/images/satisfactionV2/nurse.png


BIN
src/assets/images/satisfactionV2/panda.png


+ 6 - 0
src/router/routes.js

@@ -378,6 +378,12 @@ const frameCustom = [
         meta: { title: '外来人员登记' },
         component: _import('/platform/bpmn/alienRegistration/index')
       },
+      {
+        path: 'satisfactionV2/index',
+        name: 'satisfactionV2',
+        meta: { title: '满意度调查' },
+        component: _import('/platform/bpmn/satisfactionV2/index')
+      },
       {
         path: 'report/oralReport',
         name: 'oralReport',

+ 2 - 1
src/setting.js

@@ -28,7 +28,8 @@ export default {
     '/sealCompleted',
     '/fileView',
     '/bpmn/siginin/outIndex',
-    '/bpmn/alienRegistration/index'
+    '/bpmn/alienRegistration/index',
+    '/bpmn/satisfactionV2/index'
   ],
   // 全局key
   globalKey: 'ibps-app-' + version,

+ 255 - 0
src/views/platform/bpmn/satisfactionV2/components/edit.vue

@@ -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>

+ 114 - 0
src/views/platform/bpmn/satisfactionV2/components/objectSelection.vue

@@ -0,0 +1,114 @@
+<template>
+  <div class="selectionV20250327">
+    <div class="tips">
+      <div v-for="item in ObjectTypeList" :key="item.index" :style="{'width': ObjectTypeList.length<=1?'100%':'50%'}" :class="changeIndex!==item.index?'options':'options optionsFont'" @click="clickBtn(item.index)">
+        <img
+          class="pic"
+          :src="imgArr[item.index]"
+          alt=""
+          srcset=""
+        />
+        <div class="content">
+          {{ item.name }}
+        </div>
+      </div>
+    </div>
+    <div class="buttonArrow">
+      <img
+          class="pic"
+          src="@/assets/images/satisfactionV2/Send.png"
+          alt=""
+          srcset=""
+          @click="sumbitBtn()"
+        />
+    </div>
+
+  </div>
+</template>
+<script>
+import hospital from '@/assets/images/satisfactionV2/hospital.png'
+import bed from '@/assets/images/satisfactionV2/bed.png'
+import nurse from '@/assets/images/satisfactionV2/nurse.png'
+import agentia from '@/assets/images/satisfactionV2/agentia.png'
+import meth from '../satisfactionJson.json'
+export default {
+  props: {
+    objTypeNum: {
+      type: Number,
+      default: 0
+    },
+    allObj: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      ObjectTypeList: [],
+      imgArr: [hospital, bed, nurse, agentia],
+      changeIndex: this.objTypeNum
+    }
+  },
+  created() {
+    this.ObjectTypeList = meth.ObjectTypeList.filter(item => this.allObj.includes(item.name))
+    this.changeIndex = this.ObjectTypeList[0].index
+  },
+  methods: {
+    clickBtn(i) {
+      this.changeIndex = i
+    },
+    sumbitBtn() {
+      this.$emit('ObjTypeNumEmit', this.changeIndex)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.selectionV20250327{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  flex-wrap: wrap;
+  .tips{
+    display: flex;
+    flex-wrap: wrap;
+    width: 90%;
+    height: 40%;
+    position: relative;
+    margin-top: 40%;
+    .options{
+      width: 50%;
+      height: 20%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      flex-wrap: wrap;
+      color: #000;
+      .pic{
+        width: 50%;
+      }
+      .content{
+        width: 100%;
+        text-align: center;
+      }
+    }
+    .optionsFont{
+      color: #91d8d2;
+    }
+  }
+  .buttonArrow{
+    background-color: #91d8d2;
+    width: 30%;
+    height: 5%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border-radius: 10px;
+    .pic{
+      // width: 50%;
+      height: 80%;
+    }
+  }
+}
+</style>

+ 72 - 0
src/views/platform/bpmn/satisfactionV2/components/status.vue

@@ -0,0 +1,72 @@
+<template>
+  <div class="statusV20250327">
+    <div class="tips">
+      <img
+        class="pic"
+        src="@/assets/images/satisfactionV2/panda.png"
+        alt=""
+        srcset=""
+      />
+      <div class="content">
+        {{ textList[type].text }}
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import meth from '../satisfactionJson.json'
+export default {
+  props: {
+    type: {
+      type: Number,
+      default: 4
+    }
+  },
+  data() {
+    return {
+      textList: meth.textList
+    }
+  },
+  created() {
+  },
+  methods: {
+  }
+}
+</script>
+<style lang="scss" scoped>
+.statusV20250327{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  // align-items: center;
+  justify-content: center;
+  .tips{
+    width: 90%;
+    height: 25%;
+    position: relative;
+    border-radius: 5%;
+    margin-top: 40%;
+
+  }
+  .pic{
+    width: 50%;
+    position: absolute;
+    left: -5%;
+    top: -50%;
+  }
+  .content{
+    position: relative;
+    width: 90%;
+    height: 90%;
+    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
+    border-radius: 5%;
+    background-color: #fff;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 5%;
+    color: #01a39e;
+    line-height: 1.5;
+  }
+}
+</style>

+ 106 - 0
src/views/platform/bpmn/satisfactionV2/index.vue

@@ -0,0 +1,106 @@
+<template>
+  <div ref="containerV20250327" class="containerV20250327">
+    <status v-if="isError" :type = "errorType"></status>
+    <ObjectSelection v-else-if="isNormal" :obj-type-num="objTypeNum" :all-obj="allObj" @ObjTypeNumEmit="ObjTypeNumEmit"></ObjectSelection>
+    <edit v-else-if="isEdit" :obj-type-num="objTypeNum" :info-data="questionnaireData" :code-id="codeId"></edit>
+  </div>
+</template>
+<script>
+import Edit from './components/edit.vue'
+import ObjectSelection from './components/objectSelection.vue'
+import status from './components/status.vue'
+import meth from './satisfactionJson.json'
+import { getQuestionnaireByQrCodeId } from '@/api/platform/feature/satisfactionJson'
+
+export default {
+  components: {
+    status,
+    ObjectSelection,
+    Edit
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'default'
+    },
+    width: {
+      type: String,
+      default: '80%'
+    }
+  },
+  data() {
+    return {
+      isError: false,
+      isNormal: false,
+      isEdit: false,
+      objTypeNum: 0,
+      errorType: 4,
+      infoData: [],
+      questionnaireData: [],
+      allObj: '',
+      codeId: this.$route.query.codeId
+    }
+  },
+  created() {
+    this.isWeChatBrowser()
+    getQuestionnaireByQrCodeId({ id: this.codeId }).then(res => {
+      this.infoData = res.data || []
+      if (this.infoData.length > 0) {
+        const state = this.infoData[0].shi_fou_guo_shen_
+        this.allObj = this.infoData[0].diao_cha_dui_xian
+        if (state === '已删除') {
+          this.changeTagStateErr()
+          this.errorType = 4
+        } else if (state === '已暂停') {
+          this.changeTagStateErr()
+          this.errorType = 3
+        } else if (!this.isWeChatBrowser()) {
+          this.changeTagStateErr()
+          this.errorType = 0
+        } else if (localStorage.getItem(this.codeId) !== null) {
+          this.changeTagStateErr()
+          this.errorType = 2
+        } else if (this.isWeChatBrowser() && state === '已发布' && localStorage.getItem(this.codeId) === null) {
+          this.changeTagStateObj()
+        }
+      }
+    })
+  },
+  mounted() {
+    this.$refs.containerV20250327.style.height = document.documentElement.clientHeight + 'px'
+  },
+  methods: {
+    isWeChatBrowser() {
+      const userAgent = window.navigator.userAgent.toLowerCase()
+      // return !!userAgent.match(/micromessenger/i)
+      return true
+    },
+    ObjTypeNumEmit(val) {
+      this.ObjTypeNum = val
+      this.questionnaireData = this.infoData.filter(item => item.zi_diao_cha_dui_x === meth.ObjectTypeList[val].name)
+      this.changeTagStateEdit()
+    },
+    changeTagStateErr() {
+      this.isError = true
+      this.isNormal = false
+      this.isEdit = false
+    },
+    changeTagStateObj() {
+      this.isError = false
+      this.isNormal = true
+      this.isEdit = false
+    },
+    changeTagStateEdit() {
+      this.isError = false
+      this.isNormal = false
+      this.isEdit = true
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.containerV20250327{
+  width: 100%;
+  overflow: hidden;
+}
+</style>

+ 31 - 0
src/views/platform/bpmn/satisfactionV2/satisfactionJson.json

@@ -0,0 +1,31 @@
+{
+	"ObjectTypeList": [{
+		"name": "门诊患者",
+		"index": 0
+	}, {
+		"name": "住院患者",
+		"index": 1
+	}, {
+		"name": "医务人员",
+		"index": 2
+	}, {
+		"name": "员工",
+		"index": 3
+	}],
+	"textList": [{
+		"text": "请使用微信扫描二维码,感谢配合!"
+	}, {
+		"text": "该问卷已结束,若有疑问请联系相关工作人员,祝您生活愉快!"
+	}, {
+		"text": "您已填写过该问卷,请勿重复填写!"
+	}, {
+		"text": "该问卷已暂停,若有疑问请联系相关工作人员,祝您生活愉快!"
+	}, {
+		"text": "不存在该问卷,若有疑问请联系相关工作人员,祝您生活愉快!"
+	}],
+	"tousuList": [{
+		"name": "有"
+	}, {
+		"name": "无"
+	}]
+}