From a1bcd464887aa71122b24c84cd74913663e4fc67 Mon Sep 17 00:00:00 2001 From: aBin Date: Fri, 6 Jan 2023 19:04:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=AF=95=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/carbasics.js | 5 + src/components/Test/Test copy.vue | 985 ++++++++++++++++++++++++++ src/components/Test/Test.vue | 194 +++-- src/pages/MoreCar/detail.vue | 43 +- src/pages/MoreCar/index.vue | 107 +-- src/pages/inner/inner-old.vue | 411 +++++++++++ src/pages/inner/inner.vue | 69 +- src/pages/patientLine/patientLine.vue | 50 +- src/static/news/logo-car.png | Bin 0 -> 19217 bytes 9 files changed, 1644 insertions(+), 220 deletions(-) create mode 100644 src/components/Test/Test copy.vue create mode 100644 src/pages/inner/inner-old.vue create mode 100644 src/static/news/logo-car.png diff --git a/src/apis/carbasics.js b/src/apis/carbasics.js index 566318a..e0d5e88 100644 --- a/src/apis/carbasics.js +++ b/src/apis/carbasics.js @@ -3,6 +3,7 @@ const fileUrl = process.env.VUE_APP_BASE_URL; export const carbasics = `${apiUrl}/carbasics/v4.0`; export const filedeal = `${fileUrl}/filedeal`; const patient = `${carbasics}/patient`; // 患者相关接口 +const plugin = `${carbasics}/plugin`; // 插件相关接口 const firstAid = `${carbasics}/firstAid`; // 急救数据相关接口 const screening = `${carbasics}/screening`; // 高危人群筛查相关接口 const questionnaire = `${carbasics}/questionnaire`; // 调查问卷相关接口 @@ -128,6 +129,10 @@ const install = (Vue, vm) => { `); // 查询平车绑定患者的当前环节信息 vm.$u.api.getStep = params => vm.$u.post(`${firstAid}/step`, params); + // 查询患者信息的目录列表 + vm.$u.api.queryParentCode = params => vm.$u.post(`${plugin}/queryParentCode`, params); + // 根据目录类型查询类型下的题目 + vm.$u.api.queryQuestionCode = params => vm.$u.post(`${plugin}/queryQuestionCode`, params); }; export default { install }; diff --git a/src/components/Test/Test copy.vue b/src/components/Test/Test copy.vue new file mode 100644 index 0000000..e535b05 --- /dev/null +++ b/src/components/Test/Test copy.vue @@ -0,0 +1,985 @@ + + + + + diff --git a/src/components/Test/Test.vue b/src/components/Test/Test.vue index 2f849d6..701f46c 100644 --- a/src/components/Test/Test.vue +++ b/src/components/Test/Test.vue @@ -1,7 +1,7 @@ - + + @@ -433,6 +445,7 @@ export default { timeItemIndex: 0, // 当前时间选择器对应试题的 index 位置 timeCode: '', // 当前时间选择器对应试题的 code show: false, // 是否显示时间选择器组件 + dateShow: false, // 是否显示日期选择器组件 ZQTHSJ: null, // 知情谈话时间 timeSelectparams: { // 时间选择器可以选择那个时间 @@ -443,6 +456,15 @@ export default { minute: true, second: false, }, + timeSelectparams1: { + // 日期选择器可以选择那个时间 + year: true, + month: true, + day: true, + hour: false, + minute: false, + second: false, + }, dropTitle: '', dropList: [], dropCode: '', @@ -518,63 +540,20 @@ export default { * 如果 Fcode 和 isShow 都存在,而且 (父级code存在且父级code的value和isShow值相等) 则返回ture * 否则返回false */ - itemIsShow(code, isShow, level) { - if (!level) { - if (code && isShow) { - for (let i = 0; i < this.test.length; i++) { - const item = this.test[i]; - if (item) { - for (let j = 0; j < item.length; j++) { - const jtem = item[j]; - if (jtem.code === code && jtem.value === isShow) { - return true; - } else if (i === this.test.length - 1 && j === item.length) { - return false; - } - } - } - } - } else { - return true; - } - } else { - if (this.answerList && this.answerList[code]) { - const value = this.answerList[code]; - if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - if (value[i] === isShow) { - return true; - } else if (i === value.length - 1) { - return false; - } - } - } else { - return value === isShow; - } - } else { - return true; - } - } - }, - /** - * 判断当前试题是否显示 - * 不是根据父级试题选了哪一项而显示,而是根据父级试题没选哪一项而显示 - * 比如 选了 '死亡',不能再出现'出院带药'等试题,选了其他选项则可以出现 - * 需要根据 @param level 来判断父级试题与当前题是否处于同一分类下 - * 并且 父级 题目的 答案不一定是字符串,也有可能是数组 - */ - itemNoShow(NFcode, noShow, level) { - if (level && NFcode && noShow) { + itemIsShow(code, isShow) { + if (code && isShow) { for (let i = 0; i < this.test.length; i++) { const item = this.test[i]; - for (let j = 0; j < item.length; j++) { - const jtem = item[j]; - if (jtem.code === NFcode) { - return this.judgeType(jtem.value, noShow); - } else if (i === this.test.length - 1 && j === item.length) { - return false; - } + // if (item) { + // for (let j = 0; j < item.length; j++) { + // const jtem = item[j]; + if (item.code === code && item.answer[0] === isShow) { + return true; + } else if (i === this.test.length - 1) { + return false; } + // } + // }. } } else { return true; @@ -600,19 +579,17 @@ export default { * 先获取到 this.test 数组(props接收的值不能在当前界面修改,所以用将list的值赋值给了 test ,渲染界面也是用的 test) * 通过 index 修改掉 test 数组后,存储答案给服务端 */ - changeIpt(e, code, index, itemIndex) { - this.Rerender(e, index, itemIndex); + changeIpt(e, code, index) { + console.log('e, code, index: ', e, code, index); + // this.Rerender(e, index, itemIndex); this.setAnswer(code, e); }, /** * 修改单选框内容 * 和输入框操作一样 */ - changeRadio(e, code, index, itemIndex) { - this.Rerender(e, index, itemIndex); - // if (this.canChange) { - // this.$emit('getCollaoseHeight', this.testIndex); - // } + changeRadio(e, code, index) { + this.Rerender([e], index); this.setAnswer(code, e); }, // 修改是否是烟雾病的题时, @@ -623,10 +600,9 @@ export default { this.setAnswer(code, e); }, // 修改试题时,重新赋值test,达到重新渲染界面的目的 - Rerender(value, index, itemIndex) { + Rerender(value, index) { let Arr = [...this.test]; - Arr[index][itemIndex].value = value; - console.log('Arr[index][itemIndex].value: ', Arr[index][itemIndex].value); + Arr[index].answer = [...value]; this.test = [...Arr]; }, // 修改带评分输入框的单选题内的输入框 @@ -739,10 +715,9 @@ export default { this.setAnswer(code, e); }, // 打开时间选择器组件 - async openTimeSelect(title, code, index, listIndex, time) { + async openTimeSelect(title, code, listIndex, time) { this.timeValue = time ? time : 0; this.title = title; - this.timeIndex = index; this.timeItemIndex = listIndex; this.timeCode = code; this.show = true; @@ -756,34 +731,43 @@ export default { this.ZQTHSJ = data.record['ZQTH-SJ'] && data.record['ZQTH-SJ'].length ? data.record['ZQTH-SJ'][0] : null; } }, + // 打开日期选择器组件 + async openTimeSelect1(title, code, listIndex, time) { + this.timeValue = time ? time : 0; + this.title = title; + this.timeItemIndex = listIndex; + this.timeCode = code; + this.dateShow = true; + }, // 时间选择器组件选择了时间 chooseTime(time) { - const timeValue = this.$moment(`${time.year}-${time.month}-${time.day} ${time.hour}:${time.minute}:00`).valueOf(); - if (this.timeCode === 'YJJL-CTendTime' && this.ZQTHSJ && timeValue - 0 < this.ZQTHSJ - 0) { - // this.$message.error('CT完成时间不能晚于签署知情同意书时间,请重新选择'); - this.$refs.uToast.show({ - title: 'CT完成时间不能晚于签署知情同意书时间,请重新选择', - type: 'warning', - }); - return; - } - this.Rerender(timeValue, this.timeIndex, this.timeItemIndex); - this.setAnswer(this.timeCode, timeValue); - this.show = false; + console.log('time: ', time); + // const timeValue = this.$moment(`${time.year}-${time.month}-${time.day} ${time.hour}:${time.minute}:00`).valueOf(); + // if (this.timeCode === 'YJJL-CTendTime' && this.ZQTHSJ && timeValue - 0 < this.ZQTHSJ - 0) { + // // this.$message.error('CT完成时间不能晚于签署知情同意书时间,请重新选择'); + // this.$refs.uToast.show({ + // title: 'CT完成时间不能晚于签署知情同意书时间,请重新选择', + // type: 'warning', + // }); + // return; + // } + // this.Rerender(timeValue, this.timeIndex, this.timeItemIndex); + // this.setAnswer(this.timeCode, timeValue); + // this.show = false; }, // 打开底部下拉 - openDropDown(title, list, code, index, itemIndex, value) { + openDropDown(title, list, code, itemIndex, value) { + console.log('title, list, code, itemIndex, value: ', title, list, code, itemIndex, value); this.dropTitle = title; - this.dropList = list; + this.dropList = list.map(item=> {return item.optionContent}); this.dropCode = code; - this.dropIndex = index; - this.dropItemIndex = itemIndex; + this.dropIndex = itemIndex; this.dValue = value; this.showDrop = true; }, // 底部下拉选中 chooseSelector(e) { - this.Rerender(this.dropList[e], this.dropIndex, this.dropItemIndex); + this.Rerender([this.dropList[e]], this.dropIndex); this.setAnswer(this.dropCode, this.dropList[e]); }, /** @@ -902,6 +886,7 @@ export default { list: { handler() { this.test = [...this.list]; + console.log('this.test: ', this.test); }, deep: true, }, @@ -916,6 +901,7 @@ export default { }, created() { this.test = [...this.list]; + console.log('this.test: ', this.test); }, // 组件周期函数--监听组件数据更新之前 beforeUpdate() {}, diff --git a/src/pages/MoreCar/detail.vue b/src/pages/MoreCar/detail.vue index 5222efb..be845c0 100644 --- a/src/pages/MoreCar/detail.vue +++ b/src/pages/MoreCar/detail.vue @@ -5,46 +5,53 @@ class="car-box bor-left-lv" v-if="car" :class="{ - 'bor-left-lv': car.carStatus === 0, - 'bor-left-zhan': car.carStatus === 1, + 'bor-left-lv': car.carStatus === 1, + 'bor-left-zhan': car.carStatus === 0 || car.carStatus === 3, 'bor-left-xian': car.carStatus === 2, - 'bor-left-dian': car.carStatus === 3, - 'bor-left-li': car.carStatus === 4, }" @click="openDetail" > + {{ car.carNo }} - {{ car.nursesName || '患者姓名' }} + {{ + car.nursesName ? car.nursesName : car.carStatus === 3 ? '无病历' : '无名氏' + }} {{ car.gender === 0 ? '女' : car.gender === 1 ? '男' : '性别' }} - {{ car.age || '年龄' }} + {{ car.age || '年龄' }} - - + + - - + + {{ medical }} - 身份证:{{ car.idcard }} + 身份证:{{ car.idcard || '暂无' }} @@ -125,6 +132,7 @@ export default { onLoad(options) { console.log('options: ', options); this.car = JSON.parse(options.info); + console.log('this.car: ', this.car); this.getSteps(); }, // 页面周期函数--监听页面初次渲染完成0 @@ -211,6 +219,11 @@ export default { .car-no { width: 140rpx; margin-right: 10rpx; + overflow: hidden; + text-overflow: ellipsis; + /* display: -webkit-box; */ + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; } .id-card { font-size: 28rpx; diff --git a/src/pages/MoreCar/index.vue b/src/pages/MoreCar/index.vue index a223b78..659561a 100644 --- a/src/pages/MoreCar/index.vue +++ b/src/pages/MoreCar/index.vue @@ -12,51 +12,63 @@ > - -
- - - {{ car.carNo }} - {{ car.nursesName || '患者姓名' }} - {{ car.gender === 0 ? '女' : car.gender === 1 ? '男' : '性别' }} - {{ car.age || '年龄' }} - - - - - - - - + + @@ -94,12 +106,12 @@ export default { computed: {}, methods: { detailCar(info) { - console.log('info: ', info); - if (this.status === 0 || this.status === 1) { + if ((this.status === 0 || this.status === 1) && info.carStatus !== 3) { uni.navigateTo({ url: `/pages/MoreCar/detail?info=${JSON.stringify(info)}` }); } }, change(index) { + this.carList = []; this.status = index; this.getData(); }, @@ -141,9 +153,19 @@ export default { diff --git a/src/pages/inner/inner.vue b/src/pages/inner/inner.vue index 412e834..efdaa40 100644 --- a/src/pages/inner/inner.vue +++ b/src/pages/inner/inner.vue @@ -1,38 +1,25 @@ --> +
OCR
@@ -99,6 +84,16 @@ export default { openOcr() { uni.navigateTo({ url: '/pages/camera/camera' }); }, + async getAllTest() { + try { + const param = { parentCode: this.type }; + const res = await this.$u.api.queryQuestionCode(param); + console.log('res: ', res); + this.testList = [...res]; + } catch (error) { + console.log('error: ', error); + } + }, // 获取到所有的code,调用接口获取答案 async getAnswer() { const codeList = []; @@ -321,18 +316,8 @@ export default { }); } this.type = this.InputCode; - // if (this.type === 'RYPG') { - // this.afterStr = '主要治疗'; - // this.beforeStr = '基本信息'; - // } else if (this.type === 'SSXG') { - // this.afterStr = '出院记录'; - // this.beforeStr = '入院评估'; - // } else if (this.type === 'CYJL') { - // this.afterStr = '无数据'; - // this.beforeStr = '主要治疗'; - // } - // this.tips = '正在获取试题...'; - this.getAnswer(); + this.getAllTest(); + // this.getAnswer(); }, // 页面周期函数--监听页面初次渲染完成 onReady() {}, diff --git a/src/pages/patientLine/patientLine.vue b/src/pages/patientLine/patientLine.vue index b35aae8..d62e125 100644 --- a/src/pages/patientLine/patientLine.vue +++ b/src/pages/patientLine/patientLine.vue @@ -6,9 +6,9 @@ 患者信息 - {{ patient.name }} - {{ patient.gender === 0 ? '女' : '男' }} - {{ patient.age }} + {{ patient.name || '' }} + {{ patient.gender === 0 ? '女' : patient.gender === 1 ? '男' : '-' }} + {{ patient.age || '-' }}