|
|
@ -16,6 +16,7 @@ |
|
|
|
<!-- 一级标题下的各种问题(questionVos),判断类型1-12,展示不同需要填写的内容 --> |
|
|
|
<div v-for="a in item.questionVos" :key="a.name"> |
|
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="a.question"> |
|
|
|
<a-button type="primary" v-if="a.reportType === 1">123</a-button> |
|
|
|
<a-input v-model="a.answer" :max-length="500" v-if="a.type === 1" @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
<a-textarea |
|
|
|
v-model="a.answer" |
|
|
@ -473,12 +474,30 @@ |
|
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> |
|
|
|
<!-- 二级大标题 --> |
|
|
|
<span class="hhh2"> {{ w.name }}:</span> |
|
|
|
<a-upload |
|
|
|
v-if="w.recordType" |
|
|
|
name="files" |
|
|
|
:multiple="true" |
|
|
|
:action="action" |
|
|
|
:headers="headers" |
|
|
|
@change="handleChange($event, w.code, w.recordId)" |
|
|
|
> |
|
|
|
<!-- <a-upload :multiple="true" :action="action" :headers="headers" @change="handleChange"> --> |
|
|
|
<a-button> <a-icon type="upload" />上传图片</a-button> |
|
|
|
</a-upload> |
|
|
|
</a-form-item> |
|
|
|
<!-- 二级标题下的各种类型 --> |
|
|
|
<div v-for="e in w.questionVos" :key="e.name"> |
|
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="e.question"> |
|
|
|
<a-input :max-length="500" v-model="e.answer" v-if="e.type === 1" @change="onChange($event, e.type, e.id, e.recordId)" /> |
|
|
|
<a-input |
|
|
|
:id="e.id" |
|
|
|
:max-length="500" |
|
|
|
v-model="e.answer" |
|
|
|
v-if="e.type === 1" |
|
|
|
@change="onChange($event, e.type, e.id, e.recordId)" |
|
|
|
/> |
|
|
|
<a-textarea |
|
|
|
:id="e.id" |
|
|
|
:max-length="500" |
|
|
|
v-model="e.answer" |
|
|
|
v-else-if="e.type === 2" |
|
|
@ -966,7 +985,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { queryAll, saveCaseMes, upload } from 'config/api'; |
|
|
|
import { queryAll, saveCaseMes, upload, basic } from 'config/api'; |
|
|
|
const formItemLayout = { |
|
|
|
labelCol: { span: 6 }, |
|
|
|
wrapperCol: { span: 12 }, |
|
|
@ -1006,23 +1025,31 @@ export default { |
|
|
|
getCode: '', |
|
|
|
visible: false, |
|
|
|
confirmLoading: false, |
|
|
|
recordTypeList: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState('home', ['patientId', 'hospitalization']), |
|
|
|
...mapState('home', ['patientId', 'hospitalization', 'hospitalId']), |
|
|
|
// 上传附加请求头 |
|
|
|
headers() { |
|
|
|
const token = sessionStorage.getItem('anyringToken'); |
|
|
|
return { Authorization: `Bearer ${token}` }; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
tabNums(val) { |
|
|
|
if (typeof val === 'number') { |
|
|
|
this.getQuery(); |
|
|
|
} |
|
|
|
}, |
|
|
|
recordTypeList() { |
|
|
|
for (let i = 0; i < this.recordTypeList.length; i++) { |
|
|
|
var dom = document.getElementById(`${this.recordTypeList[i].questionId}`); |
|
|
|
dom.value = this.recordTypeList[i].content; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
console.log(this.patientId); |
|
|
@ -1095,6 +1122,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
onChange(e, type, id, recordId) { |
|
|
|
console.log(e); |
|
|
|
// 监听所有得题目类型得填写情况(改变事件) |
|
|
|
if (this.contentList.find(item => item.testQuestionsId === id)) { |
|
|
|
if (type === 1) { |
|
|
@ -1355,6 +1383,61 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 图像识别 |
|
|
|
async handleChange(info, title, recordId) { |
|
|
|
if (info.file.status === 'done') { |
|
|
|
console.log(info.file.response.data[0].visitUrl); |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
hospitalId: this.hospitalId, |
|
|
|
code: title, |
|
|
|
url: info.file.response.data[0].visitUrl, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await basic(params); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.changeType(data, recordId); |
|
|
|
this.changeType(data, recordId); |
|
|
|
console.log(this.contentList); |
|
|
|
} else { |
|
|
|
console.log(msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async changeType(data) { |
|
|
|
await this.changeTypeList(data); |
|
|
|
// // 获取到答案,重新赋值,并且推到contentList里边 |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
if (this.contentList.length > 0) { |
|
|
|
for (let k = 0; k < this.contentList.length; k++) { |
|
|
|
// 如果当前题目的答案已经更改过 |
|
|
|
if (data[i].questionId === this.contentList[k].testQuestionsId) { |
|
|
|
this.contentList[k].contents = data[i].content; |
|
|
|
break; |
|
|
|
// 如果当前题目的答案为更改过 |
|
|
|
} else if (k === this.contentList.length - 1) { |
|
|
|
let obj = { |
|
|
|
testQuestionsId: data[i].questionId, |
|
|
|
contents: data[i].content, |
|
|
|
}; |
|
|
|
this.contentList.push(obj); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
let obj = { |
|
|
|
testQuestionsId: data[i].questionId, |
|
|
|
contents: data[i].content, |
|
|
|
}; |
|
|
|
this.contentList.push(obj); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
changeTypeList(data) { |
|
|
|
this.recordTypeList = data; |
|
|
|
}, |
|
|
|
// 改变提交时间 |
|
|
|
// changeDate(date) { |
|
|
|
// this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss'); |
|
|
|