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

5
src/components/Echarts/PatientProgress.vue

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

154
src/views/PatientInfo/PatientInfo.vue

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

Loading…
Cancel
Save