|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="flex-column"> |
|
|
<div class="flex-column"> |
|
|
<a-form :form="form" @submit="handleSubmit"> |
|
|
<a-form :form="form"> |
|
|
<!-- 首先遍历整个data大数组 --> |
|
|
<!-- 首先遍历整个data大数组 --> |
|
|
<div v-for="(item, index) in list" :key="index"> |
|
|
<div v-for="(item, index) in list" :key="index"> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol"> |
|
@ -55,17 +55,23 @@ |
|
|
</a-radio-group> |
|
|
</a-radio-group> |
|
|
<a-checkbox-group v-else-if="a.type === 9" @change="onChange($event, a.type, a.id)"> |
|
|
<a-checkbox-group v-else-if="a.type === 9" @change="onChange($event, a.type, a.id)"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="12"> |
|
|
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum"> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
|
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> |
|
|
</a-col> |
|
|
|
|
|
<a-col :span="12"> |
|
|
|
|
|
<a-checkbox value="B"> B </a-checkbox> |
|
|
|
|
|
</a-col> |
|
|
|
|
|
<a-col :span="12"> |
|
|
|
|
|
<a-checkbox value="C"> 其他 </a-checkbox> |
|
|
|
|
|
</a-col> |
|
|
</a-col> |
|
|
<a-col :span="100"> |
|
|
<a-col :span="100"> |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
<a-input |
|
|
|
|
|
v-if=" |
|
|
|
|
|
contentList.find(item => { |
|
|
|
|
|
return ( |
|
|
|
|
|
item.testQuestionsId === a.id && |
|
|
|
|
|
item.contents.find(a => { |
|
|
|
|
|
return a === '其他'; |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
}) |
|
|
|
|
|
" |
|
|
|
|
|
:style="{ width: 100, marginLeft: 10 }" |
|
|
|
|
|
/> |
|
|
</a-col> |
|
|
</a-col> |
|
|
</a-row> |
|
|
</a-row> |
|
|
</a-checkbox-group> |
|
|
</a-checkbox-group> |
|
@ -79,17 +85,25 @@ |
|
|
<div v-else-if="a.type === 11"> |
|
|
<div v-else-if="a.type === 11"> |
|
|
<a-checkbox-group @change="onChange($event, a.type, a.id)"> |
|
|
<a-checkbox-group @change="onChange($event, a.type, a.id)"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="12"> |
|
|
<a-col :span="24" v-for="(ques, indexNum) in a.optionVos" :key="indexNum"> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
|
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> |
|
|
</a-col> |
|
|
</a-col> |
|
|
<a-col :span="12"> |
|
|
<a-col :span="100"> |
|
|
<a-checkbox value="B"> B </a-checkbox> |
|
|
<a-input |
|
|
</a-col> |
|
|
v-if=" |
|
|
<a-col :span="12"> |
|
|
contentList.find(item => { |
|
|
<a-checkbox value="C"> 其他 </a-checkbox> |
|
|
return ( |
|
|
|
|
|
item.testQuestionsId === a.id && |
|
|
|
|
|
item.contents.find(a => { |
|
|
|
|
|
return a === '其他'; |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
}) |
|
|
|
|
|
" |
|
|
|
|
|
:style="{ width: 100, marginLeft: 10 }" |
|
|
|
|
|
/> |
|
|
</a-col> |
|
|
</a-col> |
|
|
</a-row> |
|
|
</a-row> |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
|
|
|
说明: <a-input :style="{ width: 100, marginLeft: 10 }" /> |
|
|
说明: <a-input :style="{ width: 100, marginLeft: 10 }" /> |
|
|
</a-checkbox-group> |
|
|
</a-checkbox-group> |
|
|
</div> |
|
|
</div> |
|
@ -120,14 +134,14 @@ |
|
|
<!-- 二级标题下的各种类型 --> |
|
|
<!-- 二级标题下的各种类型 --> |
|
|
<div v-for="e in c.questionVos" :key="e.name"> |
|
|
<div v-for="e in c.questionVos" :key="e.name"> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="e.question"> |
|
|
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="e.question"> |
|
|
<a-input v-if="e.type === 1" /> |
|
|
<a-input v-if="e.type === 1" @change="onChange($event, e.type, e.id)" /> |
|
|
<a-textarea v-else-if="e.type === 2" style="height: 100px" /> |
|
|
<a-textarea v-else-if="e.type === 2" style="height: 100px" @change="onChange($event, e.type, e.id)" /> |
|
|
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange"> |
|
|
<a-radio-group v-else-if="e.type === 3" v-model="value" @change="onChange($event, e.type, e.id)"> |
|
|
<a-radio :style="radioStyle" value="高血压"> 高血压 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血压"> 没有单选题 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血脂"> 高血脂 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血脂"> 没有单选题 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血糖"> 高血糖 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血糖"> 没有单选题 </a-radio> |
|
|
</a-radio-group> |
|
|
</a-radio-group> |
|
|
<a-checkbox-group v-else-if="e.type === 4" @change="onChange"> |
|
|
<a-checkbox-group v-else-if="e.type === 4" @change="onChange($event, e.type, e.id)"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="8"> |
|
|
<a-col :span="8"> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
@ -140,10 +154,13 @@ |
|
|
</a-col> |
|
|
</a-col> |
|
|
</a-row> |
|
|
</a-row> |
|
|
</a-checkbox-group> |
|
|
</a-checkbox-group> |
|
|
<a-select v-else-if="e.type === 5" default-value="lucy" style="width: 120px" loading> |
|
|
<a-select v-else-if="e.type === 5" default-value="lucy" style="width: 120px" loading @change="onChange($event, e.type, e.id)"> |
|
|
<a-select-option value="lucy"> Lucy </a-select-option> |
|
|
<a-select-option value="1"> Lucy1 </a-select-option> |
|
|
|
|
|
<a-select-option value="2"> Lucy2 </a-select-option> |
|
|
|
|
|
<a-select-option value="3"> Lucy3 </a-select-option> |
|
|
|
|
|
<a-select-option value="4"> Lucy4 </a-select-option> |
|
|
</a-select> |
|
|
</a-select> |
|
|
<a-date-picker v-else-if="e.type === 6" /> |
|
|
<a-date-picker show-time placeholder="日期时间选择" v-else-if="e.type === 6" @change="onChange($event, e.type, e.id)" /> |
|
|
<a-upload v-else-if="e.type === 7"> |
|
|
<a-upload v-else-if="e.type === 7"> |
|
|
<img v-if="imageUrl" :src="imageUrl" alt="avatar" /> |
|
|
<img v-if="imageUrl" :src="imageUrl" alt="avatar" /> |
|
|
<div v-else> |
|
|
<div v-else> |
|
@ -151,28 +168,35 @@ |
|
|
<div class="ant-upload-text">Upload</div> |
|
|
<div class="ant-upload-text">Upload</div> |
|
|
</div> |
|
|
</div> |
|
|
</a-upload> |
|
|
</a-upload> |
|
|
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange"> |
|
|
<a-radio-group v-else-if="e.type === 8" v-model="value" @change="onChange($event, e.type, e.id)"> |
|
|
<a-radio :style="radioStyle" value="高血压"> 高血压 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血压"> 高血压 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血脂"> 高血脂 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血脂"> 高血脂 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血糖"> 高血糖 </a-radio> |
|
|
<a-radio :style="radioStyle" value="高血糖"> 高血糖 </a-radio> |
|
|
<!-- <a-radio :style="radioStyle" :value="4"> |
|
|
<!-- <a-radio :style="radioStyle" :value="4"> |
|
|
其它 |
|
|
其它 |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
</a-radio> --> |
|
|
</a-radio> --> |
|
|
</a-radio-group> |
|
|
</a-radio-group> |
|
|
<a-checkbox-group v-else-if="e.type === 9" @change="onChange"> |
|
|
<a-checkbox-group v-else-if="e.type === 9" @change="onChange($event, e.type, e.id)"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="12"> |
|
|
<a-col :span="12" v-for="(ques, indexNum) in e.optionVos" :key="indexNum"> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
|
<a-checkbox :value="ques.submitValue"> {{ ques.showValue }} </a-checkbox> |
|
|
</a-col> |
|
|
|
|
|
<a-col :span="12"> |
|
|
|
|
|
<a-checkbox value="B"> B </a-checkbox> |
|
|
|
|
|
</a-col> |
|
|
|
|
|
<a-col :span="12"> |
|
|
|
|
|
<a-checkbox value="C"> 其他 </a-checkbox> |
|
|
|
|
|
</a-col> |
|
|
</a-col> |
|
|
|
|
|
{{ e.id }} |
|
|
<a-col :span="100"> |
|
|
<a-col :span="100"> |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
<a-input |
|
|
|
|
|
v-if=" |
|
|
|
|
|
contentList.find(item => { |
|
|
|
|
|
return ( |
|
|
|
|
|
item.testQuestionsId === e.id && |
|
|
|
|
|
item.contents.find(a => { |
|
|
|
|
|
return a === '其他'; |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
}) |
|
|
|
|
|
" |
|
|
|
|
|
:style="{ width: 100, marginLeft: 10 }" |
|
|
|
|
|
/> |
|
|
</a-col> |
|
|
</a-col> |
|
|
</a-row> |
|
|
</a-row> |
|
|
</a-checkbox-group> |
|
|
</a-checkbox-group> |
|
@ -184,7 +208,7 @@ |
|
|
<a-input v-if="value === 2"></a-input> |
|
|
<a-input v-if="value === 2"></a-input> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else-if="e.type === 11"> |
|
|
<div v-else-if="e.type === 11"> |
|
|
<a-checkbox-group @change="onChange"> |
|
|
<a-checkbox-group @change="onChange($event, e.type, e.id)"> |
|
|
<a-row> |
|
|
<a-row> |
|
|
<a-col :span="12"> |
|
|
<a-col :span="12"> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
|
<a-checkbox value="A"> A </a-checkbox> |
|
@ -203,33 +227,33 @@ |
|
|
<!-- 当类型为12时,为单选+关联 --> |
|
|
<!-- 当类型为12时,为单选+关联 --> |
|
|
<div v-else-if="e.type === 12"> |
|
|
<div v-else-if="e.type === 12"> |
|
|
<a-radio-group @change="onChange($event, e.type, e.id)"> |
|
|
<a-radio-group @change="onChange($event, e.type, e.id)"> |
|
|
<a-radio :style="radioStyle" value="1"> 高血压 </a-radio> |
|
|
<a-radio :style="radioStyle" :value="1"> 高血压 </a-radio> |
|
|
<a-radio :style="radioStyle" value="2"> 高血脂 </a-radio> |
|
|
<a-radio :style="radioStyle" :value="2"> 高血脂 </a-radio> |
|
|
<a-radio :style="radioStyle" value="3"> 高血糖 </a-radio> |
|
|
<a-radio :style="radioStyle" :value="3"> 高血糖 </a-radio> |
|
|
<a-radio :style="radioStyle" value="4"> |
|
|
<a-radio :style="radioStyle" :value="4"> |
|
|
其它 |
|
|
其它 |
|
|
<a-input |
|
|
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" /> |
|
|
v-if="contentList.find(item => (item.id - 0 === e.id - 0, item.content === '4'))" |
|
|
|
|
|
:style="{ width: 100, marginLeft: 10 }" |
|
|
|
|
|
/> |
|
|
|
|
|
</a-radio> |
|
|
</a-radio> |
|
|
</a-radio-group> |
|
|
</a-radio-group> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else-if="e.type === 13">数字输入框</div> |
|
|
<div v-else-if="e.type === 13"> |
|
|
|
|
|
<a-input-number @change="onChange($event, e.type, e.id)" /> |
|
|
|
|
|
</div> |
|
|
<div v-else-if="e.type === 14">图片识别</div> |
|
|
<div v-else-if="e.type === 14">图片识别</div> |
|
|
</a-form-item> |
|
|
</a-form-item> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<a-form-item class="d-flex flex-row-reverse"> |
|
|
<!-- <a-form-item class="d-flex flex-row-reverse"> |
|
|
<a-button class="white--text px-10" html-type="submit" type="primary">提交</a-button> |
|
|
<a-button class="white--text px-10" html-type="submit" type="primary">提交</a-button> |
|
|
</a-form-item> |
|
|
</a-form-item> --> |
|
|
</a-form> |
|
|
</a-form> |
|
|
|
|
|
<a-button class="white--text px-10" type="primary" @click="setData()">提交</a-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { queryAll } from 'config/api'; |
|
|
import { queryAll, saveCaseMes } from 'config/api'; |
|
|
const formItemLayout = { |
|
|
const formItemLayout = { |
|
|
labelCol: { span: 6 }, |
|
|
labelCol: { span: 6 }, |
|
|
wrapperCol: { span: 9 }, |
|
|
wrapperCol: { span: 9 }, |
|
@ -250,6 +274,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
list: [], |
|
|
list: [], |
|
|
contentList: [], |
|
|
contentList: [], |
|
|
|
|
|
numList: [1, 2, 3, 4, 5], |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
async created() { |
|
|
async created() { |
|
@ -274,6 +299,12 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
changeNum() { |
|
|
|
|
|
const { numList } = this; |
|
|
|
|
|
numList[0] = 5; |
|
|
|
|
|
this.numList = [...numList]; |
|
|
|
|
|
console.log(this.numList[0]); |
|
|
|
|
|
}, |
|
|
onChange(e, type, id) { |
|
|
onChange(e, type, id) { |
|
|
// 监听所有得题目类型得填写情况(改变事件) |
|
|
// 监听所有得题目类型得填写情况(改变事件) |
|
|
if (this.contentList.find(item => item.testQuestionsId === id)) { |
|
|
if (this.contentList.find(item => item.testQuestionsId === id)) { |
|
@ -289,6 +320,7 @@ export default { |
|
|
} else if (type === 4) { |
|
|
} else if (type === 4) { |
|
|
// 多选 |
|
|
// 多选 |
|
|
alert('多选,没有这类的题,先参考多选+其他类型的题,那个有'); |
|
|
alert('多选,没有这类的题,先参考多选+其他类型的题,那个有'); |
|
|
|
|
|
// this.forFn(id, e); |
|
|
} else if (type === 5) { |
|
|
} else if (type === 5) { |
|
|
// 下拉框 |
|
|
// 下拉框 |
|
|
this.forFn(id, e); |
|
|
this.forFn(id, e); |
|
@ -300,12 +332,22 @@ export default { |
|
|
alert('上传文件,先控下'); |
|
|
alert('上传文件,先控下'); |
|
|
} else if (type === 8) { |
|
|
} else if (type === 8) { |
|
|
// 单选 + 其他 |
|
|
// 单选 + 其他 |
|
|
// console.log(e.target.value); |
|
|
console.log(e.target.value); |
|
|
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改'); |
|
|
// alert('暂时没有单选 + 其他类型的题,等导入题型之后再改'); |
|
|
} else if (type === 9) { |
|
|
} else if (type === 9) { |
|
|
|
|
|
this.forFn(id, e); |
|
|
// 多选 + 其他 |
|
|
// 多选 + 其他 |
|
|
} else if (type === 10) { |
|
|
} else if (type === 10) { |
|
|
// 下拉 + 其他 |
|
|
// 下拉 + 其他 |
|
|
|
|
|
} else if (type === 11) { |
|
|
|
|
|
// 多选 + 其他 + 说明 |
|
|
|
|
|
this.forFn(id, e); |
|
|
|
|
|
} else if (type === 12) { |
|
|
|
|
|
// 单选 + 关联其他内容 |
|
|
|
|
|
} else if (type === 13) { |
|
|
|
|
|
// 数字类型 |
|
|
|
|
|
} else if (type === 14) { |
|
|
|
|
|
// 图片识别 |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if (type === 1) { |
|
|
if (type === 1) { |
|
@ -331,35 +373,61 @@ export default { |
|
|
alert('上传文件,先控下'); |
|
|
alert('上传文件,先控下'); |
|
|
} else if (type === 8) { |
|
|
} else if (type === 8) { |
|
|
// 单选 + 其他 |
|
|
// 单选 + 其他 |
|
|
// console.log(e.target.value); |
|
|
console.log(e.target.value); |
|
|
alert('暂时没有单选 + 其他类型的题,等导入题型之后再改'); |
|
|
// alert('暂时没有单选 + 其他类型的题,等导入题型之后再改'); |
|
|
} else if (type === 9) { |
|
|
} else if (type === 9) { |
|
|
|
|
|
this.failFn(id, e); |
|
|
// 多选 + 其他 |
|
|
// 多选 + 其他 |
|
|
} else if (type === 10) { |
|
|
} else if (type === 10) { |
|
|
// 下拉 + 其他 |
|
|
// 下拉 + 其他 |
|
|
|
|
|
} else if (type === 11) { |
|
|
|
|
|
this.failFn(id, e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// for循环封装函数 |
|
|
// for循环封装函数 |
|
|
forFn(id, value) { |
|
|
forFn(id, value) { |
|
|
for (let i = 0; i < this.contentList.length; i++) { |
|
|
const { contentList } = this; |
|
|
if (this.contentList[i].id === id) { |
|
|
console.log(value); |
|
|
this.contentList[i].contents = value; |
|
|
for (let i = 0; i < contentList.length; i++) { |
|
|
|
|
|
if (contentList[i].testQuestionsId === id) { |
|
|
|
|
|
contentList[i].contents = value; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
this.contentList = [...contentList]; |
|
|
|
|
|
console.log(this.contentList); |
|
|
}, |
|
|
}, |
|
|
// 第一次填写题目答案得时候(在已经填写好的题目答案数组中没有找到当前所填得题) |
|
|
// 第一次填写题目答案得时候(在已经填写好的题目答案数组中没有找到当前所填得题) |
|
|
failFn(id, value) { |
|
|
failFn(id, value) { |
|
|
|
|
|
// console.log(id, value); |
|
|
let obj = { |
|
|
let obj = { |
|
|
testQuestionsId: id, |
|
|
testQuestionsId: id, |
|
|
contents: value, |
|
|
contents: value, |
|
|
}; |
|
|
}; |
|
|
this.contentList.push(obj); |
|
|
this.contentList.push(obj); |
|
|
|
|
|
console.log(this.contentList); |
|
|
}, |
|
|
}, |
|
|
// 提交表单 |
|
|
// 提交表单 |
|
|
handleSubmit() { |
|
|
async setData() { |
|
|
console.log(this.contentList); |
|
|
try { |
|
|
|
|
|
const params = { |
|
|
|
|
|
param: { |
|
|
|
|
|
list: this.contentList, |
|
|
|
|
|
patientId: 1, |
|
|
|
|
|
timeSlot: 123, |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
const res = await saveCaseMes(params); |
|
|
|
|
|
const { code, msg, data } = res.data; |
|
|
|
|
|
if (code === 200) { |
|
|
|
|
|
console.log(data); |
|
|
|
|
|
} else { |
|
|
|
|
|
console.log(msg); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error('error'); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|