Browse Source

其他+关联没有回显其他选项和答案

master
aBin 4 years ago
parent
commit
78ec89ec28
  1. 10
      src/App.vue
  2. 5
      src/components/Echarts/PatientProgress.vue
  3. 154
      src/views/PatientInfo/PatientInfo.vue

10
src/App.vue

@ -3,7 +3,7 @@
* @email: 18603454788@163.com * @email: 18603454788@163.com
* @Date: 2021-04-19 10:23:19 * @Date: 2021-04-19 10:23:19
* @LastEditors: wally * @LastEditors: wally
* @LastEditTime: 2021-05-14 09:33:48 * @LastEditTime: 2021-05-19 18:09:18
--> -->
<template> <template>
<a-config-provider :locale="zh_CN"> <a-config-provider :locale="zh_CN">
@ -40,10 +40,10 @@ export default {
}, },
created() { created() {
// async created() { // async created() {
// const userId = '1390209035248209925'; // const userId = '1387952026067013632';
// const params = { userId }; // const params = { userId };
// await this.getUserId(params); // await this.getUserId(params);
// await this.getToken(); // await this.getToken();
if (localStorage.getItem('patientId')) { if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId')); this.setPatientId(localStorage.getItem('patientId'));
} }

5
src/components/Echarts/PatientProgress.vue

@ -115,7 +115,10 @@ export default {
bottom: '3%', bottom: '3%',
containLabel: true, containLabel: true,
}, },
xAxis: { type: 'value' }, xAxis: {
type: 'value',
show: false,
},
yAxis: { yAxis: {
type: 'category', type: 'category',
data: this.nameList, data: this.nameList,

154
src/views/PatientInfo/PatientInfo.vue

@ -12,25 +12,20 @@
<!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 --> <!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 -->
<div :key="a.name" v-for="a in item.questionVos" style="position: relative"> <div :key="a.name" v-for="a in item.questionVos" style="position: relative">
<a-form-item :label="a.question" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> <a-form-item :label="a.question" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<a-input :max-length="500" @change="onChange($event, a.type, a.id, a.recordId)" v-if="a.type === 1" v-model="a.answer" /> <a-input :max-length="500" @change="onChange($event, a.type, a.id)" v-if="a.type === 1" v-model="a.answer" />
<a-textarea <a-textarea
:max-length="500" :max-length="500"
@change="onChange($event, a.type, a.id, a.recordId)" @change="onChange($event, a.type, a.id)"
style="height: 150px; width: 100%" style="height: 150px; width: 100%"
v-else-if="a.type === 2" v-else-if="a.type === 2"
v-model="a.answer" v-model="a.answer"
/> />
<a-select <a-select @change="onChange($event, a.type, a.id)" style="width: 100%" v-else-if="a.type === 5" v-model="a.answer">
@change="onChange($event, a.type, a.id, a.recordId)"
style="width: 100%"
v-else-if="a.type === 5"
v-model="a.answer"
>
<a-select-option :key="c" :value="b.showValue" v-for="(b, c) in a.optionVos">{{ b.showValue }}</a-select-option> <a-select-option :key="c" :value="b.showValue" v-for="(b, c) in a.optionVos">{{ b.showValue }}</a-select-option>
</a-select> </a-select>
<a-date-picker <a-date-picker
:default-value="a.answer ? $moment(a.answer, dateFormat) : ''" :default-value="a.answer ? $moment(a.answer, dateFormat) : ''"
@change="onChange($event, a.type, a.id, a.recordId)" @change="onChange($event, a.type, a.id)"
placeholder="日期选择" placeholder="日期选择"
style="width: 100%" style="width: 100%"
:input-read-only="true" :input-read-only="true"
@ -54,7 +49,7 @@
</template> </template>
</div> </div>
<div v-else-if="a.type === 10"> <div v-else-if="a.type === 10">
<a-select :default-value="getAnswer(a.answer)" @change="onChange($event, a.type, a.id, a.recordId)" style="width: 100%"> <a-select :default-value="getAnswer(a.answer)" @change="onChange($event, a.type, a.id)" style="width: 100%">
<a-select-option :key="c" :value="b.showValue" v-for="(b, c) in a.optionVos">{{ b.showValue }}</a-select-option> <a-select-option :key="c" :value="b.showValue" v-for="(b, c) in a.optionVos">{{ b.showValue }}</a-select-option>
</a-select> </a-select>
<div :key="c" v-for="(b, c) in a.optionVos"> <div :key="c" v-for="(b, c) in a.optionVos">
@ -84,7 +79,7 @@
<div v-else-if="a.type === 4"> <div v-else-if="a.type === 4">
<a-checkbox-group <a-checkbox-group
:default-value="getList(a.optionVos)" :default-value="getList(a.optionVos)"
@change="onChange($event, a.type, a.id, a.recordId)" @change="onChange($event, a.type, a.id)"
class="d-flex flex-row flex-wrap" class="d-flex flex-row flex-wrap"
style="width: 100%" style="width: 100%"
> >
@ -106,13 +101,13 @@
<!-- <div v-if="ques.afterOperation > 0"> --> <!-- <div v-if="ques.afterOperation > 0"> -->
<a-input <a-input
:max-length="500" :max-length="500"
@change="inputChange1(a.id, $event, ques.showValue, a.recordId, a.optionVos, ques.id)" @change="inputChange1(a.id, $event, ques.showValue, a.optionVos, ques.id)"
style="width: 100%" style="width: 100%"
v-model="ques.otherInformation" v-model="ques.otherInformation"
v-if="ques.afterOperation === 1" v-if="ques.afterOperation === 1"
/> />
<a-textarea <a-textarea
@change="inputChange1(a.id, $event, ques.showValue, a.recordId, a.optionVos, ques.id)" @change="inputChange1(a.id, $event, ques.showValue, a.optionVos, ques.id)"
style="width: 100%; height: 150px" style="width: 100%; height: 150px"
:max-length="500" :max-length="500"
v-else-if="ques.afterOperation === 2" v-else-if="ques.afterOperation === 2"
@ -131,7 +126,7 @@
> >
<a-input <a-input
:max-length="500" :max-length="500"
@change="onChange($event, h.type, h.id, h.h.recordId)" @change="onChange($event, h.type, h.id, h.recordId)"
v-if="h.type === 1" v-if="h.type === 1"
v-model="h.answer" v-model="h.answer"
/> />
@ -353,10 +348,16 @@
</a-row> </a-row>
</a-checkbox-group> </a-checkbox-group>
</div> </div>
<!-- 当类型为12时为单选+关联 --> <!-- 当类型为3时为单选++++++其他 -->
<div v-else-if="a.type === 3"> <div v-else-if="a.type === 3">
<a-radio-group @change="onChange($event, a.type, a.id, a.recordId)" class="d-flex flex-row flex-wrap" v-model="a.answer"> <a-radio-group
<a-radio :key="g" :style="radioStyle" :value="f.showValue" v-for="(f, g) in a.optionVos">{{ f.showValue }}</a-radio> :default-value="getRadioAnswer(a.optionVos)"
@change="onChange($event, a.type, a.id)"
class="d-flex flex-row flex-wrap"
>
<a-radio :key="g" :style="radioStyle" :value="f.showValue" v-for="(f, g) in a.optionVos">
{{ f.showValue }}
</a-radio>
</a-radio-group> </a-radio-group>
<div :key="k" v-for="(j, k) in a.optionVos"> <div :key="k" v-for="(j, k) in a.optionVos">
<div <div
@ -365,11 +366,12 @@
return item.testQuestionsId === a.id && item.contents === `${j.showValue}`; return item.testQuestionsId === a.id && item.contents === `${j.showValue}`;
}) && }) &&
j.afterOperation > 0) || j.afterOperation > 0) ||
(j.afterOperation > 0 && j.showValue === a.answer) (j.afterOperation > 0 && (j.showValue === a.answer || getRadioAnswer(a.optionVos) === j.showValue))
" "
> >
<a-input <a-input
:max-length="500" :max-length="500"
v-model="j.otherInformation"
@change="inputChange(a.id, $event, j.showValue)" @change="inputChange(a.id, $event, j.showValue)"
style="width: 200px" style="width: 200px"
v-if="j.afterOperation === 1" v-if="j.afterOperation === 1"
@ -608,18 +610,13 @@
</div> </div>
</div> </div>
<div v-else-if="a.type === 13"> <div v-else-if="a.type === 13">
<a-input-number @change="onChange($event, a.type, a.id, a.recordId)" style="width: 200px" v-model="a.answer" /> <a-input-number @change="onChange($event, a.type, a.id)" style="width: 200px" v-model="a.answer" />
</div> </div>
<div v-else-if="a.type === 15"> <div v-else-if="a.type === 15">
<a-time-picker placeholder="时间选择" @change="onChange($event, a.type, a.id, a.recordId)" /> <a-time-picker placeholder="时间选择" @change="onChange($event, a.type, a.id)" />
</div> </div>
<div v-else-if="a.type === 16"> <div v-else-if="a.type === 16">
<a-date-picker <a-date-picker placeholder="日期时间选择" :input-read-only="true" @change="onChange($event, a.type, a.id)" show-time />
placeholder="日期时间选择"
:input-read-only="true"
@change="onChange($event, a.type, a.id, a.recordId)"
show-time
/>
</div> </div>
<div v-for="(dom, domIndex) in a.domList" :key="domIndex"> <div v-for="(dom, domIndex) in a.domList" :key="domIndex">
<a-input v-if="a.type === 1" v-model="a.domList[domIndex]"></a-input> <a-input v-if="a.type === 1" v-model="a.domList[domIndex]"></a-input>
@ -1039,11 +1036,12 @@
return item.testQuestionsId === e.id && item.contents === `${j.showValue}`; return item.testQuestionsId === e.id && item.contents === `${j.showValue}`;
}) && }) &&
j.afterOperation > 0) || j.afterOperation > 0) ||
(j.afterOperation > 0 && j.showValue === e.answer) (j.afterOperation > 0 && (j.showValue === e.answer || getRadioAnswer(e.optionVos) === j.showValue))
" "
> >
<a-input <a-input
:max-length="500" :max-length="500"
v-model="j.otherInformation"
@change="inputChange(e.id, $event, j.showValue)" @change="inputChange(e.id, $event, j.showValue)"
style="width: 100%" style="width: 100%"
v-if="j.afterOperation === 1" v-if="j.afterOperation === 1"
@ -1625,36 +1623,37 @@ export default {
} }
this.spinning = false; this.spinning = false;
}, },
onChange(e, type, id, recordId) { onChange(e, type, id) {
// console.log(e); console.log(e);
// //
if (this.contentList.find(item => item.testQuestionsId === id)) { if (this.contentList.find(item => item.testQuestionsId === id)) {
if (type === 1) { if (type === 1) {
// //
this.forFn(id, e.target.value, recordId); console.log(e);
this.forFn(id, e.target.value);
} else if (type === 2) { } else if (type === 2) {
// //
this.forFn(id, e.target.value, recordId); this.forFn(id, e.target.value);
} else if (type === 3) { } else if (type === 3) {
// //
this.forFn(id, e.target.value, recordId); this.forFn(id, e.target.value);
} else if (type === 4) { } else if (type === 4) {
// //
// //
this.ergodicList(id); this.ergodicList(id);
// //
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 5) { } else if (type === 5) {
// //
this.forFn(id, e, recordId); this.forFn(id, e);
} else if (type === 6) { } else if (type === 6) {
// 2020-01-01 // 2020-01-01
if (e) { if (e) {
this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'), recordId); this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'));
} else { } else {
this.forFn(id, '', recordId); this.forFn(id, '');
} }
} else if (type === 7) { } else if (type === 7) {
alert('上传文件,先空下'); alert('上传文件,先空下');
@ -1662,7 +1661,7 @@ export default {
// + // +
// //
this.ergodicList(id); this.ergodicList(id);
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 9) { } else if (type === 9) {
// + // +
// type === 9 : // type === 9 :
@ -1674,14 +1673,14 @@ export default {
} }
// //
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 10) { } else if (type === 10) {
// + // +
// //
this.ergodicList(id); this.ergodicList(id);
// //
this.failFn(id, e, recordId); this.failFn(id, e);
} else if (type === 11) { } else if (type === 11) {
// + + // + +
// type === 11 : // type === 11 :
@ -1693,89 +1692,98 @@ export default {
} }
// //
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 12) { } else if (type === 12) {
// + // +
// console.log(e.target.value, type, id); // console.log(e.target.value, type, id);
this.forFn(id, e.target.value, recordId); this.forFn(id, e.target.value);
} else if (type === 13) { } else if (type === 13) {
// //
this.forFn(id, e, recordId); this.forFn(id, e);
} else if (type === 15) { } else if (type === 15) {
// 00:00:00 // 00:00:00
if (e) { if (e) {
this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'), recordId); this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'));
} else { } else {
this.forFn(id, '', recordId); this.forFn(id, '');
} }
} else if (type === 16) { } else if (type === 16) {
// + 2020:01:01 00:00:00 // + 2020:01:01 00:00:00
if (e) { if (e) {
this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'), recordId); this.forFn(id, this.$moment(e._d).format('YYYY-MM-DD'));
} else { } else {
this.forFn(id, '', recordId); this.forFn(id, '');
} }
} }
} else { } else {
if (type === 1) { if (type === 1) {
// //
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 2) { } else if (type === 2) {
// //
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 3) { } else if (type === 3) {
// //
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 4) { } else if (type === 4) {
// //
// //
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 5) { } else if (type === 5) {
// //
this.failFn(id, e, recordId); this.failFn(id, e);
} else if (type === 6) { } else if (type === 6) {
// 2020-01-01 00:00:00 // 2020-01-01 00:00:00
this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD'), recordId); this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD'));
// console.log(this.$moment(e._d).format('YYYY-MM-DD')); // console.log(this.$moment(e._d).format('YYYY-MM-DD'));
} else if (type === 7) { } else if (type === 7) {
alert('上传文件,先空下'); alert('上传文件,先空下');
} else if (type === 8) { } else if (type === 8) {
// + // +
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 9) { } else if (type === 9) {
// + // +
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 10) { } else if (type === 10) {
// + // +
this.failFn(id, e, recordId); this.failFn(id, e);
} else if (type === 11) { } else if (type === 11) {
// + + // + +
for (let i = 0; i < e.length; i++) { for (let i = 0; i < e.length; i++) {
this.failFn(id, e[i], recordId); this.failFn(id, e[i]);
} }
} else if (type === 12) { } else if (type === 12) {
// + // +
this.failFn(id, e.target.value, recordId); this.failFn(id, e.target.value);
} else if (type === 13) { } else if (type === 13) {
// //
this.failFn(id, e, recordId); this.failFn(id, e);
} else if (type === 15) { } else if (type === 15) {
// 00:00:00 // 00:00:00
this.failFn(id, this.$moment(e._d).format('HH:mm:ss'), recordId); this.failFn(id, this.$moment(e._d).format('HH:mm:ss'));
} else if (type === 16) { } else if (type === 16) {
// + 2020:01:01 00:00:00 // + 2020:01:01 00:00:00
this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'), recordId); this.failFn(id, this.$moment(e._d).format('YYYY-MM-DD HH:mm:ss'));
} }
} }
console.log(this.contentList); console.log(this.contentList);
}, },
// +
getRadioAnswer(options) {
for (let i = 0; i < options.length; i++) {
if (options[i].choose - 0 === 1) {
console.log(options[i].submitValue);
return options[i].submitValue;
}
}
},
// for // for
forFn(id, value, recordId) { forFn(id, value) {
const { contentList } = this; const { contentList } = this;
// console.log(value); // console.log(value);
if (value || value === 0) { if (value || value === 0) {
@ -1797,12 +1805,12 @@ export default {
// console.log(this.contentList); // console.log(this.contentList);
}, },
// //
failFn(id, value, recordId) { failFn(id, value) {
// console.log(id, value); // console.log(id, value);
const { contentList } = this; const { contentList } = this;
let obj = { let obj = {
testQuestionsId: id, testQuestionsId: id,
patientRecordId: recordId ? recordId : '', patientRecordId: '',
contents: value, contents: value,
}; };
contentList.push(obj); contentList.push(obj);
@ -1819,7 +1827,7 @@ export default {
} }
}, },
// //
inputChange(id, e, value, recordId) { inputChange(id, e, value) {
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 1) { if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 1) {
this.contentList.splice(i, 1); this.contentList.splice(i, 1);
@ -1830,7 +1838,7 @@ export default {
let obj = { let obj = {
testQuestionsId: id, testQuestionsId: id,
contents: value + ':' + e.target.value, contents: value + ':' + e.target.value,
patientRecordId: recordId ? recordId : '', patientRecordId: '',
contentsType: 1, contentsType: 1,
}; };
this.contentList.push(obj); this.contentList.push(obj);
@ -1838,7 +1846,7 @@ export default {
console.log(this.contentList); console.log(this.contentList);
}, },
// //
inputChange1(id, e, value, recordId, list, str) { inputChange1(id, e, value, list, str) {
let listArr = this.getList(list); let listArr = this.getList(list);
console.log(listArr); console.log(listArr);
console.log(id); console.log(id);
@ -1853,7 +1861,7 @@ export default {
let obj11 = { let obj11 = {
testQuestionsId: id, testQuestionsId: id,
contents: listArr[i], contents: listArr[i],
patientRecordId: recordId ? recordId : '', patientRecordId: '',
contentsType: 0, contentsType: 0,
}; };
this.contentList.push(obj11); this.contentList.push(obj11);
@ -1870,7 +1878,7 @@ export default {
let obj = { let obj = {
testQuestionsId: id, testQuestionsId: id,
contents: value + ':' + e.target.value, contents: value + ':' + e.target.value,
patientRecordId: recordId ? recordId : '', patientRecordId: '',
contentsType: 1, contentsType: 1,
writeType: str, writeType: str,
}; };
@ -1879,7 +1887,7 @@ export default {
console.log(this.contentList); console.log(this.contentList);
}, },
// //
explainChange(id, e, recordId) { explainChange(id, e) {
for (let i = 0; i < this.contentList.length; i++) { for (let i = 0; i < this.contentList.length; i++) {
if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 2) { if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 2) {
this.contentList.splice(i, 1); this.contentList.splice(i, 1);
@ -1890,13 +1898,13 @@ export default {
testQuestionsId: id, testQuestionsId: id,
contents: e.target.value, contents: e.target.value,
contentsType: 2, contentsType: 2,
patientRecordId: recordId ? recordId : '', patientRecordId: '',
}; };
this.contentList.push(obj); this.contentList.push(obj);
} }
}, },
// //
fileChange(info, id, recordId) { fileChange(info, id) {
this.spinning = true; this.spinning = true;
if (info.file.status === 'done') { if (info.file.status === 'done') {
this.fileList = info.fileList; this.fileList = info.fileList;
@ -1909,7 +1917,7 @@ export default {
if (info.fileList.length > 0) { if (info.fileList.length > 0) {
let obj = { let obj = {
testQuestionsId: id, testQuestionsId: id,
patientRecordId: recordId ? recordId : '', patientRecordId: '',
contents: info.fileList[info.fileList.length - 1].response.data[0].visitUrl, contents: info.fileList[info.fileList.length - 1].response.data[0].visitUrl,
}; };
this.contentList.push(obj); this.contentList.push(obj);
@ -1927,7 +1935,7 @@ export default {
console.log(this.contentList); console.log(this.contentList);
}, },
// //
async handleChange(info, title, recordId, indexA, indexB) { async handleChange(info, title, indexA, indexB) {
this.spinning = true; this.spinning = true;
if (info.file.status === 'done') { if (info.file.status === 'done') {
const { list } = this; const { list } = this;

Loading…
Cancel
Save