|
|
@ -1,5 +1,8 @@ |
|
|
|
<template> |
|
|
|
<div class="flex-column"> |
|
|
|
<a-tabs type="card" @change="callback"> |
|
|
|
<a-tab-pane width="100" v-for="item in tabList" :key="item" :tab="item + '天'" /> |
|
|
|
</a-tabs> |
|
|
|
<a-form :form="form"> |
|
|
|
<!-- 首先遍历整个data大数组 --> |
|
|
|
<div v-for="(item, index) in list" :key="index"> |
|
|
@ -10,9 +13,14 @@ |
|
|
|
<!-- 一级标题下的各种问题(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-input v-if="a.type === 1" @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
<a-textarea v-else-if="a.type === 2" style="height: 100px" @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
<a-radio-group v-else-if="a.type === 3" v-model="value" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-input v-model="a.answer" v-if="a.type === 1" @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
<a-textarea |
|
|
|
v-model="a.answer" |
|
|
|
v-else-if="a.type === 2" |
|
|
|
style="height: 100px" |
|
|
|
@change="onChange($event, a.type, a.id, a.recordId)" |
|
|
|
/> |
|
|
|
<a-radio-group v-model="a.answer" v-else-if="a.type === 3" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-radio v-for="(b, c) in a.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio> |
|
|
|
</a-radio-group> |
|
|
|
<a-checkbox-group v-else-if="a.type === 4" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
@ -22,13 +30,14 @@ |
|
|
|
</a-col> |
|
|
|
</a-row> |
|
|
|
</a-checkbox-group> |
|
|
|
<a-select v-else-if="a.type === 5" style="width: 120px" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-select v-model="a.answer" v-else-if="a.type === 5" style="width: 120px" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-select-option v-for="(b, c) in a.optionVos" :key="c" :value="b.showValue"> {{ b.showValue }} </a-select-option> |
|
|
|
</a-select> |
|
|
|
<a-date-picker |
|
|
|
show-time |
|
|
|
placeholder="日期时间选择" |
|
|
|
v-else-if="a.type === 6" |
|
|
|
:default-value="a.answer ? $moment(a.answer, dateFormat) : ''" |
|
|
|
@change="onChange($event, a.type, a.id, a.recordId)" |
|
|
|
/> |
|
|
|
<a-upload |
|
|
@ -42,12 +51,14 @@ |
|
|
|
> |
|
|
|
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> |
|
|
|
</a-upload> |
|
|
|
<a-radio-group v-else-if="a.type === 8" v-model="value" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-radio-group @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<a-radio-group v-model="a.answer" v-else-if="a.type === 8" @change="onChange($event, a.type, a.id, a.recordId)"> |
|
|
|
<!-- <a-radio-group @change="onChange($event, a.type, a.id, a.recordId)"> --> |
|
|
|
<div> |
|
|
|
<a-radio v-for="(f, g) in a.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> |
|
|
|
{{ f.showValue }} |
|
|
|
</a-radio> |
|
|
|
</a-radio-group> |
|
|
|
</div> |
|
|
|
<!-- </a-radio-group> --> |
|
|
|
<div v-for="(j, k) in a.optionVos" :key="k"> |
|
|
|
<div |
|
|
|
v-if=" |
|
|
@ -161,11 +172,7 @@ |
|
|
|
style="height: 100px" |
|
|
|
@change="onChange($event, ohter.type, ohter.id)" |
|
|
|
/> |
|
|
|
<a-radio-group |
|
|
|
v-else-if="ohter.type === 3" |
|
|
|
v-model="value" |
|
|
|
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)" |
|
|
|
> |
|
|
|
<a-radio-group v-else-if="ohter.type === 3" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> |
|
|
|
<a-radio v-for="(b, c) in ohter.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> |
|
|
|
{{ b.showValue }} |
|
|
|
</a-radio> |
|
|
@ -203,11 +210,7 @@ |
|
|
|
> |
|
|
|
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> |
|
|
|
</a-upload> |
|
|
|
<a-radio-group |
|
|
|
v-else-if="ohter.type === 8" |
|
|
|
v-model="value" |
|
|
|
@change="onChange($event, ohter.type, ohter.id, ohter.recordId)" |
|
|
|
> |
|
|
|
<a-radio-group v-else-if="ohter.type === 8" @change="onChange($event, ohter.type, ohter.id, ohter.recordId)"> |
|
|
|
<a-radio-group @change="onChange($event, ohter.type, ohter.id)"> |
|
|
|
<a-radio v-for="(f, g) in ohter.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> |
|
|
|
{{ f.showValue }} |
|
|
@ -344,7 +347,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else-if="a.type === 13"> |
|
|
|
<a-input-number @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
<a-input-number v-model="a.answer" @change="onChange($event, a.type, a.id, a.recordId)" /> |
|
|
|
</div> |
|
|
|
<div v-else-if="a.type === 14">图片识别</div> |
|
|
|
</a-form-item> |
|
|
@ -360,7 +363,7 @@ |
|
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="e.question"> |
|
|
|
<a-input v-if="e.type === 1" @change="onChange($event, e.type, e.id, e.recordId)" /> |
|
|
|
<a-textarea v-else-if="e.type === 2" style="height: 100px" @change="onChange($event, e.type, e.id, e.recordId)" /> |
|
|
|
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange($event, e.type, e.id, e.recordId)"> |
|
|
|
<a-radio-group v-else-if="e.type === 3" @change="onChange($event, e.type, e.id, e.recordId)"> |
|
|
|
<a-radio v-for="(b, c) in e.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> {{ b.showValue }} </a-radio> |
|
|
|
</a-radio-group> |
|
|
|
<a-checkbox-group v-else-if="e.type === 4" @change="onChange($event, e.type, e.id, e.recordId)"> |
|
|
@ -390,7 +393,7 @@ |
|
|
|
> |
|
|
|
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> |
|
|
|
</a-upload> |
|
|
|
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange($event, e.type, e.id, e.recordId)"> |
|
|
|
<a-radio-group v-else-if="e.type === 8" @change="onChange($event, e.type, e.id, e.recordId)"> |
|
|
|
<a-radio-group @change="onChange($event, e.type, e.id)"> |
|
|
|
<a-radio v-for="(f, g) in e.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> |
|
|
|
{{ f.showValue }} |
|
|
@ -504,7 +507,7 @@ |
|
|
|
style="height: 100px" |
|
|
|
@change="onChange($event, h.type, h.id, h.recordId)" |
|
|
|
/> |
|
|
|
<a-radio-group v-else-if="h.type === 3" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)"> |
|
|
|
<a-radio-group v-else-if="h.type === 3" @change="onChange($event, h.type, h.id, h.recordId)"> |
|
|
|
<a-radio v-for="(b, c) in h.optionVos" :key="c" :style="radioStyle" :value="b.showValue"> |
|
|
|
{{ b.showValue }} |
|
|
|
</a-radio> |
|
|
@ -538,7 +541,7 @@ |
|
|
|
> |
|
|
|
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button> |
|
|
|
</a-upload> |
|
|
|
<a-radio-group v-else-if="h.type === 8" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)"> |
|
|
|
<a-radio-group v-else-if="h.type === 8" @change="onChange($event, h.type, h.id, h.recordId)"> |
|
|
|
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)"> |
|
|
|
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue"> |
|
|
|
{{ f.showValue }} |
|
|
@ -714,6 +717,8 @@ export default { |
|
|
|
lineHeight: '30px', |
|
|
|
}, |
|
|
|
list: [], |
|
|
|
tabList: [], |
|
|
|
tabNums: 0, |
|
|
|
contentList: [], |
|
|
|
numList: [1, 2, 3, 4, 5], |
|
|
|
action: upload, // 上传附件地址 |
|
|
@ -722,8 +727,10 @@ export default { |
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
dateChoose: new Date(), |
|
|
|
subDateTime: '', |
|
|
|
getCode: '', |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
...mapState('home', ['patientId']), |
|
|
|
// 上传附加请求头 |
|
|
@ -732,13 +739,32 @@ export default { |
|
|
|
return { Authorization: `Bearer ${token}` }; |
|
|
|
}, |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
watch: { |
|
|
|
tabNums() { |
|
|
|
this.getQuery(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getCode = ''; |
|
|
|
this.tabNums = 0; |
|
|
|
if (this.$route.query && this.$route.query.code) { |
|
|
|
// vue从路径中获取参数 此处参数名为code |
|
|
|
this.getCode = this.$route.query.code; |
|
|
|
} |
|
|
|
this.getQuery(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
callback(key) { |
|
|
|
console.log(key); |
|
|
|
this.tabNums = key; |
|
|
|
}, |
|
|
|
async getQuery() { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
code: '', |
|
|
|
id: 1, |
|
|
|
nums: 0, |
|
|
|
code: this.getCode ? this.getCode : '', |
|
|
|
id: localStorage.getItem('patientId') ? localStorage.getItem('patientId') : '', |
|
|
|
nums: this.tabNums, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await queryAll(params); |
|
|
@ -746,6 +772,17 @@ export default { |
|
|
|
if (code === 200) { |
|
|
|
// console.log(data); |
|
|
|
this.list = data; |
|
|
|
if (this.getCode) { |
|
|
|
if (data[0].reportType === 0) { |
|
|
|
this.tabList = []; |
|
|
|
} else if (data[0].reportType === 1) { |
|
|
|
this.tabList = [0, 14, 90]; |
|
|
|
} else { |
|
|
|
this.tabList = [180, 360]; |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tabList = [0, 14, 90]; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log(msg); |
|
|
|
} |
|
|
@ -753,7 +790,6 @@ export default { |
|
|
|
console.log(error); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onChange(e, type, id, recordId) { |
|
|
|
// 监听所有得题目类型得填写情况(改变事件) |
|
|
|
if (this.contentList.find(item => item.testQuestionsId === id)) { |
|
|
@ -825,7 +861,7 @@ export default { |
|
|
|
this.forFn(id, e.target.value, recordId); |
|
|
|
} else if (type === 13) { |
|
|
|
// 数字类型 |
|
|
|
this.forFn(id, e.target.value, recordId); |
|
|
|
this.forFn(id, e, recordId); |
|
|
|
} else if (type === 14) { |
|
|
|
// 图片识别 暂时不做 |
|
|
|
} |
|
|
@ -871,7 +907,7 @@ export default { |
|
|
|
this.failFn(id, e.target.value, recordId); |
|
|
|
} else if (type === 13) { |
|
|
|
// 数字类型 |
|
|
|
this.failFn(id, e.target.value, recordId); |
|
|
|
this.failFn(id, e, recordId); |
|
|
|
} else if (type === 14) { |
|
|
|
// 图片识别 暂时不做 |
|
|
|
} |
|
|
@ -915,7 +951,7 @@ export default { |
|
|
|
// 其他输入框发生改变时 |
|
|
|
inputChange(id, e, value, recordId) { |
|
|
|
for (let i = 0; i < this.contentList.length; i++) { |
|
|
|
if (this.contentList[i].testQuestionsId === id && this.contentList[i].type === 1) { |
|
|
|
if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 1) { |
|
|
|
this.contentList.splice(i, 1); |
|
|
|
i -= 1; |
|
|
|
} |
|
|
@ -925,16 +961,15 @@ export default { |
|
|
|
testQuestionsId: id, |
|
|
|
contents: value + ':' + e.target.value, |
|
|
|
patientRecordId: recordId ? recordId : '', |
|
|
|
type: 1, |
|
|
|
contentsType: 1, |
|
|
|
}; |
|
|
|
this.contentList.push(obj); |
|
|
|
} |
|
|
|
console.log(this.contentList); |
|
|
|
}, |
|
|
|
// 说明输入框发生改变时 |
|
|
|
explainChange(id, e, recordId) { |
|
|
|
for (let i = 0; i < this.contentList.length; i++) { |
|
|
|
if (this.contentList[i].testQuestionsId === id && this.contentList[i].type === 2) { |
|
|
|
if (this.contentList[i].testQuestionsId === id && this.contentList[i].contentsType === 2) { |
|
|
|
this.contentList.splice(i, 1); |
|
|
|
} |
|
|
|
} |
|
|
@ -942,12 +977,11 @@ export default { |
|
|
|
let obj = { |
|
|
|
testQuestionsId: id, |
|
|
|
contents: e.target.value, |
|
|
|
type: 2, |
|
|
|
contentsType: 2, |
|
|
|
patientRecordId: recordId ? recordId : '', |
|
|
|
}; |
|
|
|
this.contentList.push(obj); |
|
|
|
} |
|
|
|
console.log(this.contentList); |
|
|
|
}, |
|
|
|
// 上传图片事件 |
|
|
|
fileChange(info, id, recordId) { |
|
|
@ -990,6 +1024,7 @@ export default { |
|
|
|
list: this.contentList, |
|
|
|
patientId: this.patientId, |
|
|
|
timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'), |
|
|
|
nums: this.tabNums, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await saveCaseMes(params); |
|
|
|