xinelu-applet-ui/pagesB/createnewconsultation/createnewconsultation.vue

356 lines
9.8 KiB
Vue
Raw Normal View History

2023-10-08 14:51:36 +08:00
<template>
<view class="app">
2023-10-08 16:18:56 +08:00
<view class="title">
<view class="left">
</view>
<view class="right">
第一步填写个人信息
</view>
</view>
<view class="item">
<view class="text">
现住址所在区
</view>
2023-10-09 15:19:17 +08:00
<view class="input" @tap='showPicker'>
2024-03-15 16:33:19 +08:00
<!-- <view class="inputtext"
2023-10-09 15:19:17 +08:00
:style="address=='请选择所属地区'?'font-size:22rpx;font-weight: 400;color: #8E8E8E !important;':''">
{{address}}
</view> -->
<view class="inputtext" v-if="address">
{{address}}
2023-10-09 15:19:17 +08:00
</view>
2024-06-25 18:25:50 +08:00
<image :src="require('@/pagesC/images/huijiantou.png')" mode=""></image>
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
患者姓名
</view>
<view class="input">
2023-10-09 15:19:17 +08:00
<input v-model="formdata.patientName" class="uinput noimageuinput" placeholder="请输入患者姓名" type="text"
placeholder-class="phsy" />
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
患者身份证号
</view>
<view class="input">
2023-10-09 15:19:17 +08:00
<input v-model="formdata.cardNo" class="uinput noimageuinput" placeholder="请输入患者身份证号" type="text"
placeholder-class="phsy" />
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
患者联系电话
</view>
<view class="input">
2023-10-09 15:19:17 +08:00
<input v-model="formdata.phone" class="uinput noimageuinput" placeholder="请输入患者联系电话" type="text"
placeholder-class="phsy" />
2023-10-08 16:18:56 +08:00
</view>
2023-10-12 15:54:10 +08:00
<view class="text">
选择医生
</view>
2023-10-13 13:39:29 +08:00
<view class="select" @tap='gochoosedoctor'>
2023-11-07 17:04:46 +08:00
<text v-if="!doctorName">请选择医生</text>
<text v-else style="font-size: 26rpx;color: #303133;">{{doctorName}}</text>
2024-06-25 18:25:50 +08:00
<image :src="require('@/pagesC/images/huijiantou.png')" mode=""></image>
2023-10-12 15:54:10 +08:00
</view>
2023-10-08 16:18:56 +08:00
</view>
<view class="title">
<view class="left">
</view>
<view class="right">
第二步填写问诊信息
</view>
</view>
<view class="item">
<view class="text">
问题简述
</view>
<view class="input">
2023-10-09 15:19:17 +08:00
<input v-model="formdata.problemDescription" class="uinput noimageuinput" placeholder="不多于五个字"
2023-10-24 09:47:58 +08:00
type="text" placeholder-class="phsy" :maxlength="5" />
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
患者个体情况说明
</view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;">
2023-10-09 15:19:17 +08:00
<u-input v-model="formdata.situationDescription" class="uinput noimageuinput" placeholder=" "
type="textarea" :maxlength="100" />
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
问题描述
</view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;">
2023-10-09 15:19:17 +08:00
<u-input v-model="formdata.problemStatement" class="uinput noimageuinput" placeholder=" "
type="textarea" :maxlength="500" />
2023-10-08 16:18:56 +08:00
</view>
<view class="text">
既往疾病史
</view>
<view class="input" style="height: 200rpx;overflow-Y: scroll;">
2023-10-09 15:19:17 +08:00
<u-input v-model="formdata.medicalRecord" class="uinput noimageuinput" placeholder=" " type="textarea"
:maxlength="100" />
2023-10-08 16:18:56 +08:00
</view>
</view>
<view class="title">
<view class="left">
</view>
<view class="right">
第三步上传附件文件
</view>
</view>
<view class="item">
<view class="text">
附件材料上传
</view>
2023-10-09 15:19:17 +08:00
<u-upload ref="uUpload" :max-count='9' :action="uoloadaction" :auto-upload="false" upload-text=' '
2023-11-13 13:41:05 +08:00
@on-choose-complete='onchoosecomplete' @on-uploaded='onuploaded'></u-upload>
<!-- @on-success='onsuccess' -->
2023-10-09 15:19:17 +08:00
<view class="textarea">
<view class="">
最多支持9个文件
</view>
<view class="">
单个文件大小不允许超过10MB
</view>
<view class="">
只支持上传照片图片视频文件后缀类型为JPG.PNG.MP4
</view>
</view>
2023-10-08 16:18:56 +08:00
</view>
<view class="btns">
<view class="btnleft">
返回
</view>
2023-10-09 15:19:17 +08:00
<view class="btnright" @tap='updata'>
2023-10-08 16:18:56 +08:00
保存
</view>
</view>
2023-10-09 15:19:17 +08:00
<view class="">
<m-city style='z-index: 10076;' :provinceData="list" headTitle="请选择所属地区" ref="cityPicker"
@funcValue="getpickerParentValue" pickerSize="4">
</m-city>
</view>
<u-toast ref="uToast" />
2023-10-08 14:51:36 +08:00
</view>
</template>
<script>
2023-10-09 15:19:17 +08:00
import {
getSubordinateRegions,
} from '@/api/pagesB/modifyAddress/modifyAddress.js';
import gkcity from "../../components/m-city/m-city.vue";
import baseurl from '@/api/baseurl.js'
import {
2023-11-07 13:54:06 +08:00
consultationInfo,
2023-11-07 17:04:46 +08:00
detail,
2023-10-09 15:19:17 +08:00
} from '@/api/pagesB/createnewconsultation/createnewconsultation.js'
2023-11-07 17:04:46 +08:00
import {
getHospitalPersonInfo
} from '@/api/pagesC/contractsigningprotocol/index.js'
2023-10-08 14:51:36 +08:00
export default {
2023-10-09 15:19:17 +08:00
components: {
"m-city": gkcity
},
2023-10-08 14:51:36 +08:00
data() {
return {
2023-10-09 15:19:17 +08:00
// 非真实地址
uoloadaction: '',
list: [],
addresslength: null,
imglistlength: null,
address: '', //页面所属区域
2023-10-09 15:19:17 +08:00
formdata: {
2023-11-13 13:41:05 +08:00
address: '', //页面所属区域
2023-11-07 13:54:06 +08:00
patientId: '',
patientName: '',
cardNo: '',
phone: '',
2023-11-07 17:04:46 +08:00
doctorId: '',
doctorName: '',
2023-10-09 15:19:17 +08:00
consultationType: 'IMAGE_TEXT_CONSULTATION',
problemDescription: '',
situationDescription: '',
problemStatement: '',
medicalRecord: '',
2023-11-07 13:54:06 +08:00
fileUrls: [],
2023-11-07 17:04:46 +08:00
},
doctorlist: [],
doctorName: '',
2023-11-09 15:55:25 +08:00
doctorId: '',
2023-10-08 14:51:36 +08:00
};
2023-10-09 15:19:17 +08:00
},
onLoad(options) {
this.uoloadaction = baseurl + '/nurseApplet/consultationInfo/uploadConsultationFile'
2023-11-13 13:41:05 +08:00
this.formdata = uni.getStorageSync('userinfo')
// this.formdata.address = ''
2023-11-13 13:41:05 +08:00
this.formdata.fileUrls = []
this.infolist()
this.areaInfo();
2023-10-09 15:19:17 +08:00
},
onShow() {
2023-10-13 13:39:29 +08:00
let that = this
uni.$on('doctordata', function(data) {
let item = JSON.parse(data.data)
2023-11-07 17:04:46 +08:00
that.formdata.doctorName = item.personName
that.formdata.doctorId = item.id
2023-10-13 13:39:29 +08:00
uni.$off('doctordata')
})
2023-10-09 15:19:17 +08:00
},
methods: {
updata() {
2023-11-09 15:55:25 +08:00
this.formdata.doctorName = this.doctorName
this.formdata.doctorId = this.doctorId
2023-10-09 15:19:17 +08:00
if (this.imglistlength > 0) {
this.$refs.uUpload.upload()
} else {
this.info();
}
},
onchoosecomplete(lists, name) {
this.imglistlength = lists.length
},
2023-11-13 13:41:05 +08:00
// onsuccess(data, index, lists, name) {
// if (data.code == 200) {
// this.formdata.fileUrls.push(data.fileUrl)
// }
// },
onuploaded(lists, name) {
this.formdata.fileUrls = []
lists.forEach(e => {
this.formdata.fileUrls.push(e.response.fileUrl)
})
2023-10-09 15:19:17 +08:00
this.info();
},
info() {
2023-11-13 13:41:05 +08:00
this.$delete(this.formdata, 'id')
2024-03-15 16:33:19 +08:00
this.formdata.patientId = uni.getStorageSync("patientId")
2023-11-09 15:55:25 +08:00
this.formdata.consultationType = 'IMAGE_TEXT_CONSULTATION'
if (!this.formdata.address) {
this.$refs.uToast.show({
title: '请选择地址',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.patientName) {
this.$refs.uToast.show({
title: '请选择姓名',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.cardNo) {
this.$refs.uToast.show({
title: '请选择身份证号',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.phone) {
this.$refs.uToast.show({
title: '请选择手机号',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.doctorName) {
this.$refs.uToast.show({
title: '请选择医生',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.problemDescription) {
this.$refs.uToast.show({
title: '请输入问题简述',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.situationDescription) {
this.$refs.uToast.show({
title: '请输入患者个体说明',
type: 'error',
duration: '1500',
})
} else if (!this.formdata.medicalRecord) {
this.$refs.uToast.show({
title: '请输入既往疾病史',
type: 'error',
duration: '1500',
})
} else {
consultationInfo(this.formdata).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '新建图文问诊成功',
type: 'success',
duration: '1500',
back: 1
})
} else if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500',
})
}
})
}
2023-10-09 15:19:17 +08:00
},
// 显示三级地址联动
showPicker() {
this.$refs.cityPicker.show();
},
//区街道
areaInfo() {
getSubordinateRegions().then(res => {
this.list = res.data;
})
},
// 三级地址联动回调
getpickerParentValue(e) {
e = e.filter(ele => ele.localName != '暂不选择')
e = e.filter(ele => ele.localName != '暂无需选择')
this.addresslength = e
this.formdata.address = ''
this.address = ''
if (e && e.length >= 1) {
e.forEach(el => {
this.formdata.address = this.formdata.address + el.localName
this.address = this.address + el.localName
})
} else {
this.formdata.address = ''
this.address = '请选择所属地区'
}
},
2023-11-07 17:04:46 +08:00
infolist() {
detail(this.formdata.cardNo).then(res => {
2024-03-15 16:33:19 +08:00
if (res.data.provinceName && res.data.cityName && res.data.countyName && res.data.townName) {
this.address = res.data.provinceName + res.data.cityName + res.data.countyName + res.data
.townName
this.formdata.address = this.address
} else if (res.data.provinceName && res.data.cityName && res.data.countyName) {
this.address = res.data.provinceName + res.data.cityName + res.data.countyName
this.formdata.address = this.address
}
2023-11-13 13:41:05 +08:00
if (res.code == 200) {
2024-11-13 15:03:50 +08:00
getHospitalPersonInfo(res.data.dutyDoctorNo).then(res => {
2023-11-10 10:43:32 +08:00
this.doctorName = res.data.personName
this.doctorId = res.data.id
this.doctorlist = res.data
})
2023-11-13 13:41:05 +08:00
} else if (res.code == 500) {
2023-11-10 10:43:32 +08:00
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1500',
})
}
2023-10-13 13:39:29 +08:00
})
},
2023-11-07 17:04:46 +08:00
gochoosedoctor() {
2023-11-09 15:55:25 +08:00
uni.navigateTo({
url: `/pagesC/choosedoctor/choosedoctor?item=${JSON.stringify(this.doctorlist)}`
})
2023-11-07 17:04:46 +08:00
},
2023-10-08 14:51:36 +08:00
}
}
</script>
<style lang="scss">
2023-10-13 13:39:29 +08:00
@import './createnewconsultation.scss';
2024-06-25 18:25:50 +08:00
</style>