207 lines
5.7 KiB
Vue
207 lines
5.7 KiB
Vue
<template>
|
|
<view>
|
|
<scroll-view scroll-y class="page">
|
|
<cu-custom bgColor="bg-cyan" :isBack="true"><block slot="backText">返回</block><block slot="content">人员填报</block></cu-custom>
|
|
<view class="photoView">
|
|
<view class="photoImage">
|
|
<open-data type="userAvatarUrl"></open-data>
|
|
</view>
|
|
</view>
|
|
<form action="">
|
|
<view class="cu-form-group">
|
|
<view class="title">医院名称</view>
|
|
<input name="hospital" :value="hospital" disabled="true"></input>
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">分院名称</view>
|
|
<input name="sortHospital" :value="sortHospital" disabled="true"></input>
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">科室名称</view>
|
|
<input name="department" :value="department" @input="getDepartment"></input>
|
|
<!-- <picker @change="pickerDepartmentChange" :value="indexDepartment" :range="pickerDepartment">
|
|
<view class="picker">
|
|
{{indexDepartment>-1?pickerDepartment[indexDepartment]:'请选择科室名称'}}
|
|
</view>
|
|
</picker> -->
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">职务名称</view>
|
|
<input name="duty" :value="duty" disabled="true"></input>
|
|
</view>
|
|
<view class="cu-form-group margin-top">
|
|
<view class="title">身份证号码</view>
|
|
<input placeholder="请输入身份证号码" name="idcard" :value="idcard" @input="getIdcard"></input>
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">人员编码</view>
|
|
<input name="userCode" :value="userCode" disabled="true"></input>
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">姓名</view>
|
|
<input placeholder="请输入用户姓名" name="name" :value="name" @input="getName"></input>
|
|
</view>
|
|
<view class="cu-form-group">
|
|
<view class="title">联系电话</view>
|
|
<input placeholder="请输入联系电话" name="phone" :value="phone" @input="getPhone"></input>
|
|
</view>
|
|
</form>
|
|
<view class="padding flex flex-direction" style="padding-top: 100rpx;">
|
|
<button class="cu-btn round bg-cyan margin-tb-sm lg" @click="buttonClick" style="background:-webkit-linear-gradient(right,#15D2BB,#2CC9E9);color:#ffffff;">配置</button>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
hospital: '',
|
|
sortHospital: '',
|
|
department: '',
|
|
duty: '',
|
|
name: '',
|
|
phone: '',
|
|
userCode: '',
|
|
idcard: ''
|
|
}
|
|
},
|
|
onLoad(e) {
|
|
this.userCode = e.qrcode
|
|
this.hospital = '新疆医科大学第五附属医院'
|
|
this.sortHospital = '本院'
|
|
this.department = ''
|
|
this.duty = '交接人员'
|
|
// 判断是否该人员是否配置
|
|
this.isConfig();
|
|
},
|
|
methods: {
|
|
isConfig() {
|
|
let that = this;
|
|
uni.request({
|
|
url: 'https://mwapi.opmonitor.com/?c=app_api&a=getWfyIsConfig',
|
|
data: {userCode: that.userCode},
|
|
header: {
|
|
'Content-type': 'application/json'
|
|
},
|
|
success: function(res) {
|
|
if (res.data.data === "false"){
|
|
that.department = '',
|
|
that.name = '',
|
|
that.phone = '',
|
|
that.idcard = ''
|
|
} else {
|
|
that.department = res.data.data.dept_name,
|
|
that.name = res.data.data.name,
|
|
that.phone = res.data.data.phone,
|
|
that.idcard = res.data.data.id_card
|
|
}
|
|
},
|
|
fail: () => {
|
|
console.info('小程序域名不正确,请检查域名正确性')
|
|
}
|
|
});
|
|
},
|
|
// getDepartmentList() {
|
|
// let that = this;
|
|
// uni.request({
|
|
// url: 'https://mwapi.opmonitor.com/?c=app_api&a=getWfyDepartmentList',
|
|
// data: {hospital: that.hospital, sortHospital: that.sortHospital},
|
|
// header: {
|
|
// 'Content-type': 'application/json'
|
|
// },
|
|
// success: function(res) {
|
|
// that.pickerDepartment = res.data.data
|
|
// },
|
|
// fail: () => {
|
|
// console.info('小程序域名不正确,请检查域名正确性')
|
|
// }
|
|
// });
|
|
// },
|
|
// pickerDepartmentChange(e) {
|
|
// this.indexDepartment = e.detail.value
|
|
// this.department = this.pickerDepartment[this.indexDepartment]
|
|
// },
|
|
getDepartment: function(e){
|
|
this.department = e.target.value
|
|
},
|
|
getName: function(e){
|
|
this.name = e.target.value
|
|
},
|
|
getPhone: function(e){
|
|
this.phone = e.target.value
|
|
},
|
|
getIdcard: function(e){
|
|
this.idcard = e.target.value
|
|
},
|
|
buttonClick(e) {
|
|
let that = this;
|
|
uni.request({
|
|
url: 'https://mwapi.opmonitor.com/?c=app_api&a=WfyPostConfigUserInsert',
|
|
data: {
|
|
hospital: that.hospital,
|
|
sortHospital: that.sortHospital,
|
|
department: that.department,
|
|
duty: that.duty,
|
|
userCode: that.userCode,
|
|
name: that.name,
|
|
phone: that.phone,
|
|
idcard: that.idcard
|
|
},
|
|
header: {
|
|
'Content-type': 'application/x-www-form-urlencoded'
|
|
},
|
|
method: 'POST',
|
|
success: function(res){
|
|
if(res.data.data === 'success'){
|
|
uni.navigateTo({
|
|
url: '/pages/component/success'
|
|
})
|
|
} else if(res.data.data === 'false'){
|
|
uni.navigateTo({
|
|
url: '/pages/index/index'
|
|
})
|
|
}
|
|
},
|
|
fail: () => {
|
|
console.info('小程序域名不正确,请检查域名正确性')
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.page {
|
|
width: 100vw;
|
|
height: 120Vh;
|
|
}
|
|
.photoView {
|
|
padding-top: 50rpx;
|
|
position: relative;
|
|
color: #fff;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
.photoImage {
|
|
overflow:hidden;
|
|
display: block;
|
|
width: 200rpx;
|
|
height: 200rpx;
|
|
margin: 20rpx;
|
|
border-radius: 50%;
|
|
border: 2px solid #fff;
|
|
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
|
|
}
|
|
.cu-form-group .title{
|
|
min-width: calc(4em + 15px);
|
|
font-weight: 600;
|
|
}
|
|
.picker {
|
|
text-align: left;
|
|
}
|
|
</style>
|