|
@@ -16,7 +16,39 @@
|
|
|
<p>采集时间:{{pathInfo.systemTime}}</p>
|
|
|
</div>
|
|
|
<div class="personMsg">
|
|
|
- 主诉
|
|
|
+ <ul class="previewParts">
|
|
|
+ <li v-if="symptom.choose.length>0">
|
|
|
+ <h4><i :style="{'background': '#FF9A9A'}"></i> 主诉:</h4>
|
|
|
+ <p>
|
|
|
+ <span v-for="(item,idx) in symptom.choose" :key="item.name">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
|
|
|
+ </p>
|
|
|
+ </li>
|
|
|
+ <li v-if="diagnose.text.length>0">
|
|
|
+ <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
|
|
|
+ <p>
|
|
|
+ <span v-for="(item,idx) in symptom.text" :key="item.text">{{item.text+(idx == symptom.choose.length-1?'。':';')}}</span>
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ <span v-for="(item,idx) in diagnose.text" :key="item.text">{{item.text+(idx == diagnose.text.length-1?'。':';')}}</span>
|
|
|
+ </p>
|
|
|
+ </li>
|
|
|
+ <li v-if="others.text.length>0">
|
|
|
+ <h4><i></i> 其他史:</h4>
|
|
|
+ <p>
|
|
|
+ <span v-for="(item,idx) in others.text" :key="item.text">{{item.text+(idx == others.text.length-1?'。':';')}}</span>
|
|
|
+ </p>
|
|
|
+ </li>
|
|
|
+ <li v-if="addContent.txt">
|
|
|
+ <h4><i></i> 补充内容:</h4>
|
|
|
+ <p>{{addContent.txt}}</p>
|
|
|
+ </li>
|
|
|
+ <li v-if="JSON.stringify(diagnose.imgSrc) !='{}'">
|
|
|
+ <h4><i></i> 最近一次治疗报告:</h4>
|
|
|
+ <div v-for="(value,key) in diagnose.imgSrc" class="imgView">
|
|
|
+ <img :src="value" alt="">
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
<div class="foot">
|
|
|
<span
|
|
@@ -33,22 +65,32 @@
|
|
|
:showType="showType"
|
|
|
@showSubmit="showSubmit"
|
|
|
></Submit>
|
|
|
+ <Loading v-if="show"></Loading>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import api from '@utils/api.js';
|
|
|
import Submit from '../common/Submit';
|
|
|
+import Loading from '../common/Loading';
|
|
|
export default {
|
|
|
props: ['preName'],
|
|
|
data() {
|
|
|
const { pathInfo, originDatas } = this.$store.state;
|
|
|
+ let symptomDate = this.$store.state.symptom;
|
|
|
let diagnoseDate = this.$store.state.diagnose;
|
|
|
+ let othersDate = this.$store.state.others;
|
|
|
+ let addContentDate = this.$store.state.addContent;
|
|
|
return {
|
|
|
msg: '预览',
|
|
|
pathInfo: pathInfo,
|
|
|
+ symptom: symptomDate,
|
|
|
diagnose: diagnoseDate,
|
|
|
+ others: othersDate,
|
|
|
+ addContent: addContentDate,
|
|
|
submit: false,
|
|
|
showType: 'fail',
|
|
|
+ imgList:[],
|
|
|
+ show:false,//提交等待的动画loading
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -62,18 +104,34 @@ export default {
|
|
|
saveAllImage() {
|
|
|
let formData = new FormData();
|
|
|
let imgList = this.diagnose.imgFile;
|
|
|
- if (imgList.length > 0) {
|
|
|
+ if (imgList.length > 0) {//有图片先上传图片
|
|
|
+ this.show = true
|
|
|
for (let i = 0; i < imgList.length; i++) {
|
|
|
let pageFile = imgList[i].file
|
|
|
formData.append('upfiles', imgList[i].file);
|
|
|
- formData.append('type', i + 1);
|
|
|
+ formData.append('type', imgList[i].type);
|
|
|
}
|
|
|
api.uploadImageThums(formData).then((res) => {//获取图片
|
|
|
console.log(res)
|
|
|
- if (res.data.length > 0) {
|
|
|
- this.showType = 'success'
|
|
|
- this.submit = true
|
|
|
- } else {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.length > 0) {//图片提交成功再保存数据
|
|
|
+ // this.showType = 'success'
|
|
|
+ // this.submit = true
|
|
|
+ let reportList = []
|
|
|
+ for(let i = 0;i < result.length;i++){
|
|
|
+ let obg = {}
|
|
|
+ obg.narrowImage = result[i].thumbnail.url
|
|
|
+ obg.narrowName = result[i].thumbnail.original
|
|
|
+ obg.originalImage = result[i].source.url
|
|
|
+ obg.originalName = result[i].source.original
|
|
|
+ obg.orderNum = i+1
|
|
|
+ obg.type = result[i].source.type
|
|
|
+ reportList.push(obg)
|
|
|
+ }
|
|
|
+ this.imgList = reportList
|
|
|
+ this.saveAllDate()
|
|
|
+ } else {//提交失败提示
|
|
|
+ this.show=false
|
|
|
this.showType = 'fail'
|
|
|
this.submit = true
|
|
|
let timer = setTimeout(() => {
|
|
@@ -83,53 +141,74 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
return;
|
|
|
- } else {
|
|
|
-
|
|
|
+ } else {//没有图片直接保存数据
|
|
|
+ this.show = true
|
|
|
+ this.saveAllDate()
|
|
|
}
|
|
|
},
|
|
|
+ getStr(arr,flg){
|
|
|
+ let tmpStr = '',obg={};
|
|
|
+ for(let i = 0;i<arr.length;i++){
|
|
|
+ tmpStr+=arr[i].text+';'
|
|
|
+ }
|
|
|
+ obg.content=tmpStr
|
|
|
+ obg.contentValue=tmpStr
|
|
|
+ obg.type=flg
|
|
|
+ return obg;
|
|
|
+ },
|
|
|
saveAllDate() {
|
|
|
+ const {pathInfo,symptom,diagnose,others,addContent} = this
|
|
|
+ let detailList = []
|
|
|
+ if(symptom.text.length>0){
|
|
|
+ detailList.push(this.getStr(symptom.text,1))
|
|
|
+ }
|
|
|
+ if(diagnose.text.length>0){
|
|
|
+ detailList.push(this.getStr(diagnose.text,2))
|
|
|
+ }
|
|
|
+ if(others.text.length>0){
|
|
|
+ let obg = {}
|
|
|
+ detailList.push(this.getStr(others.text,3))
|
|
|
+ }
|
|
|
+ if(addContent.txt){
|
|
|
+ let obg = {}
|
|
|
+ obg.content=addContent.txt
|
|
|
+ obg.contentValue=addContent.txt
|
|
|
+ obg.type=4
|
|
|
+ detailList.push(obg)
|
|
|
+ }
|
|
|
let params = {
|
|
|
"dataJson": "1",
|
|
|
- "detailList": [
|
|
|
- {
|
|
|
- "content": "string",
|
|
|
- "contentValue": "string",
|
|
|
- "type": 0
|
|
|
- }
|
|
|
- ],
|
|
|
- "doctorCode": "string",//医生编码
|
|
|
- "doctorId": 0,//医生id
|
|
|
- "doctorName": "string",//医生name
|
|
|
- "hospitalCode": "string",//医院编码
|
|
|
- "hospitalDeptCode": "string",//医院科室编码
|
|
|
- "hospitalDeptId": 0,//科室id
|
|
|
- "hospitalDeptName": "string",//科室name
|
|
|
- "hospitalId": 0,//医院id
|
|
|
- "hospitalName": "string",//医院名称
|
|
|
- "inquiryCode": "string",//就诊序列号
|
|
|
- "patientBirthday": "2019-07-11T07:27:28.981Z",//患者出生日期,格式为:2018-11-28 17:25:30
|
|
|
- "patientCode": "string",//患者编号
|
|
|
- "patientId": 0,//患者id
|
|
|
- "patientIdNo": "string",//患者证件号码(病历号)
|
|
|
- "patientName": "string",//患者姓名
|
|
|
- "patientPhone": "string",//患者联系电话(非)
|
|
|
- "patientSex": 0,//患者性别:1男2女(非)
|
|
|
- "regVisitedState": 0,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
|
|
|
- "reportList": [
|
|
|
- {
|
|
|
- "narrowImage": "string",//缩略图
|
|
|
- "orderNum": 0,//图片排序号
|
|
|
- "originalImage": "string"//原图
|
|
|
- }
|
|
|
- ],
|
|
|
- "type": 0//病历分类(1:门诊,2:住院)
|
|
|
+ "detailList": detailList,
|
|
|
+ "hospitalId": pathInfo.hospitalId,//医院id
|
|
|
+ "hospitalName": pathInfo.hospitalName,//医院名称
|
|
|
+ "hospitalCode": pathInfo.hospitalCode,//医院编码
|
|
|
+ "doctorId": pathInfo.doctorId,//医生id
|
|
|
+ "doctorCode": pathInfo.doctorCode,//医生编码
|
|
|
+ "doctorName": pathInfo.doctorName,//医生name
|
|
|
+ "hospitalDeptCode": pathInfo.hospitalDeptCode,//医院科室编码
|
|
|
+ "hospitalDeptId": pathInfo.hospitalDeptId,//科室id
|
|
|
+ "hospitalDeptName": pathInfo.hospitalDeptName,//科室name
|
|
|
+ "inquiryCode": '1',//就诊序列号,目前没有先写死
|
|
|
+ "patientBirthday": pathInfo.birthday+':00',//患者出生日期,格式为:2018-11-28 17:25:30
|
|
|
+ "patientCode": pathInfo.patientCode,//患者编号
|
|
|
+ "patientId": pathInfo.patientId,//患者id
|
|
|
+ "patientIdNo": pathInfo.patientIdNo,//患者证件号码(病历号)
|
|
|
+ "patientName": pathInfo.patientName,//患者姓名
|
|
|
+ // "patientPhone": pathInfo,//患者联系电话(非)
|
|
|
+ "patientSex": pathInfo.patientSex=='男'?1:2,//患者性别:1男2女(非)
|
|
|
+ // "regVisitedState": pathInfo,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
|
|
|
+ "reportList": this.imgList,
|
|
|
+ // "type": 0//病历分类(1:门诊,2:住院)
|
|
|
}
|
|
|
- api.saveInquiry(params).then((res) => {//获取图片
|
|
|
+ console.log(params)
|
|
|
+ api.saveInquiry(params).then((res) => {
|
|
|
console.log(res)
|
|
|
- if (res.data.length > 0) {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.show=false
|
|
|
this.showType = 'success'
|
|
|
this.submit = true
|
|
|
} else {
|
|
|
+ this.show=false
|
|
|
this.showType = 'fail'
|
|
|
this.submit = true
|
|
|
let timer = setTimeout(() => {
|
|
@@ -141,7 +220,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- Submit
|
|
|
+ Submit,
|
|
|
+ Loading,
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -159,7 +239,17 @@ export default {
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
box-sizing: border-box;
|
|
|
- padding: 0.3rem 0.4rem;
|
|
|
+ padding: 0.3rem 0.4rem 1rem .4rem;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+.imgView {
|
|
|
+ width: 2.44rem;
|
|
|
+ height: 3.25rem;
|
|
|
+ float: left;
|
|
|
+ margin: .3rem .2rem 0 0;
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
.personMsg {
|
|
|
padding: 0.3rem 0.4rem;
|
|
@@ -167,6 +257,33 @@ export default {
|
|
|
background-color: #fff;
|
|
|
border-radius: 0.16rem;
|
|
|
margin-bottom: 0.38rem;
|
|
|
+ .previewParts {
|
|
|
+ li {
|
|
|
+ padding: .1rem .3rem;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ h4 {
|
|
|
+ color: #000;
|
|
|
+ font-size: .32rem;
|
|
|
+ font-weight: bold;
|
|
|
+ position: relative;
|
|
|
+ i {
|
|
|
+ width: .16rem;
|
|
|
+ height: .16rem;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #767676;
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ top: .15rem;
|
|
|
+ left: -0.3rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ p {
|
|
|
+ font-size: .28rem;
|
|
|
+ color: #424242;
|
|
|
+ margin: .2rem 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
.baseMsg {
|
|
|
font-size: 0.32rem;
|
|
|
color: #000000;
|