|
@ -82,7 +82,7 @@
|
|
transform: translateX(-50%);
|
|
transform: translateX(-50%);
|
|
width: 400px;
|
|
width: 400px;
|
|
}
|
|
}
|
|
.back-btn{
|
|
|
|
|
|
.back-btn {
|
|
position: absolute;
|
|
position: absolute;
|
|
bottom: 80px;
|
|
bottom: 80px;
|
|
left: 50%;
|
|
left: 50%;
|
|
@ -161,7 +161,7 @@
|
|
绑定后,血氧仪测量的数据将自动同步导入您的健康记录中!
|
|
绑定后,血氧仪测量的数据将自动同步导入您的健康记录中!
|
|
</div>
|
|
</div>
|
|
<el-button class="back-btn" v-if="!dataId" @click="backFn">返回</el-button>
|
|
<el-button class="back-btn" v-if="!dataId" @click="backFn">返回</el-button>
|
|
<el-button class="add-device-btn" v-if="!dataId" type="primary" @click="bindDeviceFn">立即绑定</el-button>
|
|
|
|
|
|
<el-button class="add-device-btn" v-if="!dataId" type="primary" @click="bindDeviceFn">立即绑定</el-button>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" src="../../../js/vue.js"></script>
|
|
<script type="text/javascript" src="../../../js/vue.js"></script>
|
|
@ -189,7 +189,8 @@
|
|
xuetangList: [],
|
|
xuetangList: [],
|
|
deviceObj: {},
|
|
deviceObj: {},
|
|
deviceId: null,
|
|
deviceId: null,
|
|
dataId: null
|
|
|
|
|
|
dataId: null,
|
|
|
|
docInfo: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@ -197,18 +198,16 @@
|
|
const vm = this
|
|
const vm = this
|
|
httpRequest.get('common/device/DeviceInfo', { data: { id: this.deviceId } }).then(function (res) {
|
|
httpRequest.get('common/device/DeviceInfo', { data: { id: this.deviceId } }).then(function (res) {
|
|
vm.deviceObj = res.data
|
|
vm.deviceObj = res.data
|
|
if(vm.deviceObj.isMultiUser == 1){
|
|
|
|
|
|
if (vm.deviceObj.isMultiUser == 1) {
|
|
vm.deviceObj.multiUser = JSON.parse(res.data.multiUser)
|
|
vm.deviceObj.multiUser = JSON.parse(res.data.multiUser)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
httpRequest.get('doctor/device/PatientDeviceInfo',{data:{id: this.dataId}}).then(function(res){
|
|
|
|
|
|
httpRequest.get('doctor/device/PatientDeviceInfo', { data: { id: this.dataId } }).then(function (res) {
|
|
vm.query = {
|
|
vm.query = {
|
|
deviceSn: res.data.deviceSn,
|
|
deviceSn: res.data.deviceSn,
|
|
sim: res.data.sim,
|
|
sim: res.data.sim,
|
|
userType: res.data.userType
|
|
userType: res.data.userType
|
|
}
|
|
}
|
|
console.log(vm.query);
|
|
|
|
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
tabChange(val) {
|
|
tabChange(val) {
|
|
@ -248,14 +247,13 @@
|
|
httpRequest.get('common/device/DeviceInfo', { data: { id: item.id } }).then(function (res) {
|
|
httpRequest.get('common/device/DeviceInfo', { data: { id: item.id } }).then(function (res) {
|
|
vm.step++
|
|
vm.step++
|
|
vm.deviceObj = res.data
|
|
vm.deviceObj = res.data
|
|
if(vm.deviceObj.isMultiUser == 1){
|
|
|
|
|
|
if (vm.deviceObj.isMultiUser == 1) {
|
|
vm.deviceObj.multiUser = JSON.parse(res.data.multiUser)
|
|
vm.deviceObj.multiUser = JSON.parse(res.data.multiUser)
|
|
}
|
|
}
|
|
vm.query = {}
|
|
vm.query = {}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
bindDeviceFn() {
|
|
bindDeviceFn() {
|
|
return
|
|
|
|
const vm = this
|
|
const vm = this
|
|
var b = /^[0-9a-zA-Z]*$/g
|
|
var b = /^[0-9a-zA-Z]*$/g
|
|
if (!b.test(this.device_sn)) {
|
|
if (!b.test(this.device_sn)) {
|
|
@ -267,17 +265,75 @@
|
|
type: this.deviceObj.categoryCode
|
|
type: this.deviceObj.categoryCode
|
|
}
|
|
}
|
|
httpRequest.get('doctor/device/PatientDeviceIdcard', { data: params }).then(function (res) {
|
|
httpRequest.get('doctor/device/PatientDeviceIdcard', { data: params }).then(function (res) {
|
|
|
|
|
|
|
|
if (res.status == 200) {
|
|
|
|
var name = ''
|
|
|
|
var others = null
|
|
|
|
for (var j in res.data) {
|
|
|
|
name = res.data[j].name
|
|
|
|
others = res.data[j].others
|
|
|
|
}
|
|
|
|
//没被绑定
|
|
|
|
if (name == '') {
|
|
|
|
if (vm.checkSuccess != null) {
|
|
|
|
vm.checkSuccess()
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
} else if (others != null && others == 1) {
|
|
|
|
// $("#bang-btn").removeClass("active");
|
|
|
|
//被绑定而且被别人绑定
|
|
|
|
vm.$message.warning('该设备已被他人绑定,设备解绑后,方可再次绑定')
|
|
|
|
|
|
|
|
return false
|
|
|
|
} else if (others != null && others == 0) {
|
|
|
|
// $("#bang-btn").removeClass("active");
|
|
|
|
if (oldSn != vm.query.deviceSn) {
|
|
|
|
//新增,编辑/被自己绑定
|
|
|
|
vm.$message.warning('对不起,该居民已绑定过该设备,解绑后方可继续操作')
|
|
|
|
return
|
|
|
|
} else {
|
|
|
|
if (vm.checkSuccess != null) {
|
|
|
|
vm.checkSuccess()
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
backFn(){
|
|
|
|
|
|
backFn() {
|
|
this.step = 1
|
|
this.step = 1
|
|
|
|
},
|
|
|
|
checkSuccess() {
|
|
|
|
const vm = this
|
|
|
|
const data = {
|
|
|
|
deviceId: this.deviceObj.id,
|
|
|
|
deviceName: this.deviceObj.name,
|
|
|
|
deviceSn: this.query.deviceSn,
|
|
|
|
categoryCode: this.deviceObj.categoryCode,
|
|
|
|
userType: this.deviceObj.categoryCode == 1 ? '-1' : this.query.userType,
|
|
|
|
user: this.patient,
|
|
|
|
hospital: this.docInfo.hospital,
|
|
|
|
hospitalName: this.docInfo.hospitalName,
|
|
|
|
checkDoctorName: this.docInfo.doctorName
|
|
|
|
}
|
|
|
|
|
|
|
|
httpRequest.post('doctor/device/SavePatientDevice', { data: {data:JSON.stringify(data)} }).then(function (res) {
|
|
|
|
if (res.status == '200') {
|
|
|
|
vm.$message.success('绑定设备成功!')
|
|
|
|
var index = parent.layer.getFrameIndex(window.name)
|
|
|
|
parent.layer.close(index)
|
|
|
|
}else{
|
|
|
|
vm.$message.error(res.msg)
|
|
|
|
}
|
|
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
this.getXueyaList()
|
|
this.getXueyaList()
|
|
this.patient = GetRequest().patient
|
|
this.patient = GetRequest().patient
|
|
|
|
this.docInfo = JSON.parse(localStorage.getItem('docInfo'))
|
|
|
|
|
|
this.deviceId = GetRequest().deviceId
|
|
this.deviceId = GetRequest().deviceId
|
|
this.dataId = GetRequest().id
|
|
this.dataId = GetRequest().id
|
|
if (this.dataId) {
|
|
if (this.dataId) {
|