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