|
@@ -37,12 +37,12 @@
|
|
<el-button style="width: 150px;" size="mini" plain round @click="handleEditPatient(subItem.customer_id,subItem.frame_bed.id)">
|
|
<el-button style="width: 150px;" size="mini" plain round @click="handleEditPatient(subItem.customer_id,subItem.frame_bed.id)">
|
|
<i class="el-icon-user" /> {{ subItem.customer_name+ ' '+ subItem.customer_age+subItem.customer_age_unit }}
|
|
<i class="el-icon-user" /> {{ subItem.customer_name+ ' '+ subItem.customer_age+subItem.customer_age_unit }}
|
|
<span v-if="subItem.customer_sex === 1">男</span>
|
|
<span v-if="subItem.customer_sex === 1">男</span>
|
|
- <span v-else-if="subItem.customer_sex === 2">女</span>
|
|
|
|
|
|
+ <span v-else-if="subItem.customer_sex === 0">女</span>
|
|
<span v-else>未知</span>
|
|
<span v-else>未知</span>
|
|
</el-button>
|
|
</el-button>
|
|
</span>
|
|
</span>
|
|
<span v-else>
|
|
<span v-else>
|
|
- <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline" /> 病人</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline" /> 用户</el-button>
|
|
</span>
|
|
</span>
|
|
<span>
|
|
<span>
|
|
<el-dropdown size="mini" @command="handleGroupCommand">
|
|
<el-dropdown size="mini" @command="handleGroupCommand">
|
|
@@ -66,9 +66,9 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="病人信息"
|
|
|
|
- :visible.sync="dialogPatientVisible"
|
|
|
|
- width="85%"
|
|
|
|
|
|
+ title="用户信息"
|
|
|
|
+ :visible.sync="dialogPatientVisible"
|
|
|
|
+ width="85%"
|
|
>
|
|
>
|
|
<customer-edit :customer-id="customerId" :frame-id="frameId" @saved="handlePatientFinished" />
|
|
<customer-edit :customer-id="customerId" :frame-id="frameId" @saved="handlePatientFinished" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -109,10 +109,10 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
<el-drawer
|
|
<el-drawer
|
|
- :title="selectedFrame.full_name+' 设备'"
|
|
|
|
- :visible.sync="deviceVisible"
|
|
|
|
- :append-to-body="true"
|
|
|
|
- size="60%"
|
|
|
|
|
|
+ :title="selectedFrame.full_name+' 设备'"
|
|
|
|
+ :visible.sync="deviceVisible"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ size="60%"
|
|
>
|
|
>
|
|
<device-info :frame-id="frameId" :frame="selectedFrame" />
|
|
<device-info :frame-id="frameId" :frame="selectedFrame" />
|
|
</el-drawer>
|
|
</el-drawer>
|
|
@@ -120,206 +120,206 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
|
|
|
|
-import * as RegExp from '@/utils/RegExp'
|
|
|
|
-import customerEdit from '@/views/customer/customerEdit'
|
|
|
|
-import DeviceInfo from '@/views/ncs-device/deviceInfo'
|
|
|
|
|
|
+ import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
|
|
|
|
+ import * as RegExp from '@/utils/RegExp'
|
|
|
|
+ import customerEdit from '@/views/customer/customerEdit'
|
|
|
|
+ import DeviceInfo from '@/views/ncs-device/deviceInfo'
|
|
|
|
|
|
-export default {
|
|
|
|
- name: 'HospitalFrame',
|
|
|
|
- components: { DeviceInfo, customerEdit },
|
|
|
|
- data: function() {
|
|
|
|
- return {
|
|
|
|
- hospital_frame: null,
|
|
|
|
- frameAddVisible: false,
|
|
|
|
- frameName: '',
|
|
|
|
- dialogPatientVisible: false,
|
|
|
|
- customerId: null,
|
|
|
|
- dialogFrameVisible: false,
|
|
|
|
- frameInfo: {},
|
|
|
|
- deviceVisible: false,
|
|
|
|
- frameId: 0,
|
|
|
|
- selectedFrame: {},
|
|
|
|
- rules: {
|
|
|
|
- name: [
|
|
|
|
- this.MixinRequired('请输入名称!'),
|
|
|
|
- { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- if (!RegExp.userName.test(value)) {
|
|
|
|
- callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
|
|
+ export default {
|
|
|
|
+ name: 'HospitalFrame',
|
|
|
|
+ components: { DeviceInfo, customerEdit },
|
|
|
|
+ data: function() {
|
|
|
|
+ return {
|
|
|
|
+ hospital_frame: null,
|
|
|
|
+ frameAddVisible: false,
|
|
|
|
+ frameName: '',
|
|
|
|
+ dialogPatientVisible: false,
|
|
|
|
+ customerId: null,
|
|
|
|
+ dialogFrameVisible: false,
|
|
|
|
+ frameInfo: {},
|
|
|
|
+ deviceVisible: false,
|
|
|
|
+ frameId: 0,
|
|
|
|
+ selectedFrame: {},
|
|
|
|
+ rules: {
|
|
|
|
+ name: [
|
|
|
|
+ this.MixinRequired('请输入名称!'),
|
|
|
|
+ { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if (!RegExp.userName.test(value)) {
|
|
|
|
+ callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- ],
|
|
|
|
- alias: [
|
|
|
|
- { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- if (!value) {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- if (!RegExp.userName.test(value)) {
|
|
|
|
- callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
|
|
+ ],
|
|
|
|
+ alias: [
|
|
|
|
+ { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
|
|
|
|
+ {
|
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
|
+ if (!value) {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ if (!RegExp.userName.test(value)) {
|
|
|
|
+ callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
|
+ } else {
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- fullName: null
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- deviceVisible: function(newData) {
|
|
|
|
- if (!newData) {
|
|
|
|
- this.GET_All()
|
|
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ fullName: null
|
|
}
|
|
}
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted() {
|
|
|
|
- this.GET_All()
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- GET_All() {
|
|
|
|
- HospitalFrame_API.getHospitalFrameList(this.$store.getters.userInfo.last_login_shopid).then(response => {
|
|
|
|
- if (response) {
|
|
|
|
- console.log(response)
|
|
|
|
- this.hospital_frame = response
|
|
|
|
- }
|
|
|
|
- }).catch(response => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: response.message
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 下拉触发 */
|
|
|
|
- handleGroupCommand(object) {
|
|
|
|
- console.log(object)
|
|
|
|
- this.selectedFrame = object.frame
|
|
|
|
- switch (object.type) {
|
|
|
|
- case 'edit':
|
|
|
|
- this.handelEditFrame(object.frame)
|
|
|
|
- break
|
|
|
|
- case 'delete':
|
|
|
|
- this.handlerDeleteFrame(object.frame.id)
|
|
|
|
- break
|
|
|
|
- case 'device':
|
|
|
|
- this.frameId = object.frame.id
|
|
|
|
- this.openDeviceList()
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleAddPatient(bedFrame) {
|
|
|
|
- this.customerId = 0
|
|
|
|
- this.frameId = bedFrame.id
|
|
|
|
- this.dialogPatientVisible = true
|
|
|
|
- },
|
|
|
|
- handlePatientFinished() {
|
|
|
|
- this.dialogPatientVisible = false
|
|
|
|
- this.GET_All()
|
|
|
|
- },
|
|
|
|
- handleEditPatient(id, frameId) {
|
|
|
|
- this.dialogPatientVisible = true
|
|
|
|
- this.customerId = id
|
|
|
|
- this.frameId = frameId
|
|
|
|
},
|
|
},
|
|
- // frame handle
|
|
|
|
- handleAddRoom() {
|
|
|
|
- let parent_id = null
|
|
|
|
- if (this.hospital_frame) {
|
|
|
|
- parent_id = this.hospital_frame.frame_part.id
|
|
|
|
|
|
+ watch: {
|
|
|
|
+ deviceVisible: function(newData) {
|
|
|
|
+ if (!newData) {
|
|
|
|
+ this.GET_All()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- const params = { type: 4, name: this.frameName, part_id: this.$store.getters.partId, parent_id: parent_id }
|
|
|
|
- params.full_name = params.name + '房'
|
|
|
|
- HospitalFrame_API.addHospitalFrame(params).then(response => {
|
|
|
|
- this.$message.success('添加成功!')
|
|
|
|
- this.GET_All()
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- handleAddFrame(id, name) { // 新增床位
|
|
|
|
- this.frameInfo = {}
|
|
|
|
- this.frameInfo = { parent_id: id, type: 5 }
|
|
|
|
- this.fullName = name
|
|
|
|
- this.dialogFrameVisible = true
|
|
|
|
},
|
|
},
|
|
- handelEditFrame(frame) {
|
|
|
|
- this.frameInfo = { id: frame.id, type: frame.type, name: frame.name, alias: frame.alias, full_name: frame.full_name }
|
|
|
|
- this.dialogFrameVisible = true
|
|
|
|
- },
|
|
|
|
- handleFrameFinished() {
|
|
|
|
- this.dialogFrameVisible = false
|
|
|
|
|
|
+ mounted() {
|
|
this.GET_All()
|
|
this.GET_All()
|
|
},
|
|
},
|
|
- /** 单条数据删除处理 */
|
|
|
|
- handlerDeleteFrame(ids) {
|
|
|
|
- this.$confirm('确定要删除此结构及其所有下级吗?', '警告', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- HospitalFrame_API.deleteHospitalFrame(ids).then(response => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'success',
|
|
|
|
- message: '已删除!'
|
|
|
|
- })
|
|
|
|
- this.GET_All()
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ GET_All() {
|
|
|
|
+ HospitalFrame_API.getHospitalFrameList(this.$store.getters.userInfo.last_login_shopid).then(response => {
|
|
|
|
+ if (response) {
|
|
|
|
+ console.log(response)
|
|
|
|
+ this.hospital_frame = response
|
|
|
|
+ }
|
|
}).catch(response => {
|
|
}).catch(response => {
|
|
this.$message({
|
|
this.$message({
|
|
type: 'info',
|
|
type: 'info',
|
|
message: response.message
|
|
message: response.message
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+ /** 下拉触发 */
|
|
|
|
+ handleGroupCommand(object) {
|
|
|
|
+ console.log(object)
|
|
|
|
+ this.selectedFrame = object.frame
|
|
|
|
+ switch (object.type) {
|
|
|
|
+ case 'edit':
|
|
|
|
+ this.handelEditFrame(object.frame)
|
|
|
|
+ break
|
|
|
|
+ case 'delete':
|
|
|
|
+ this.handlerDeleteFrame(object.frame.id)
|
|
|
|
+ break
|
|
|
|
+ case 'device':
|
|
|
|
+ this.frameId = object.frame.id
|
|
|
|
+ this.openDeviceList()
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleAddPatient(bedFrame) {
|
|
|
|
+ this.customerId = 0
|
|
|
|
+ this.frameId = bedFrame.id
|
|
|
|
+ this.dialogPatientVisible = true
|
|
|
|
+ },
|
|
|
|
+ handlePatientFinished() {
|
|
|
|
+ this.dialogPatientVisible = false
|
|
|
|
+ this.GET_All()
|
|
|
|
+ },
|
|
|
|
+ handleEditPatient(id, frameId) {
|
|
|
|
+ this.dialogPatientVisible = true
|
|
|
|
+ this.customerId = id
|
|
|
|
+ this.frameId = frameId
|
|
|
|
+ },
|
|
|
|
+ // frame handle
|
|
|
|
+ handleAddRoom() {
|
|
|
|
+ let parent_id = null
|
|
|
|
+ if (this.hospital_frame) {
|
|
|
|
+ parent_id = this.hospital_frame.frame_part.id
|
|
|
|
+ }
|
|
|
|
+ const params = { type: 4, name: this.frameName, part_id: this.$store.getters.partId, parent_id: parent_id }
|
|
|
|
+ params.full_name = params.name + '房'
|
|
|
|
+ HospitalFrame_API.addHospitalFrame(params).then(response => {
|
|
|
|
+ this.$message.success('添加成功!')
|
|
|
|
+ this.GET_All()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleAddFrame(id, name) { // 新增床位
|
|
|
|
+ this.frameInfo = {}
|
|
|
|
+ this.frameInfo = { parent_id: id, type: 5 }
|
|
|
|
+ this.fullName = name
|
|
|
|
+ this.dialogFrameVisible = true
|
|
|
|
+ },
|
|
|
|
+ handelEditFrame(frame) {
|
|
|
|
+ this.frameInfo = { id: frame.id, type: frame.type, name: frame.name, alias: frame.alias, full_name: frame.full_name }
|
|
|
|
+ this.dialogFrameVisible = true
|
|
|
|
+ },
|
|
|
|
+ handleFrameFinished() {
|
|
|
|
+ this.dialogFrameVisible = false
|
|
|
|
+ this.GET_All()
|
|
|
|
+ },
|
|
|
|
+ /** 单条数据删除处理 */
|
|
|
|
+ handlerDeleteFrame(ids) {
|
|
|
|
+ this.$confirm('确定要删除此结构及其所有下级吗?', '警告', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ HospitalFrame_API.deleteHospitalFrame(ids).then(response => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '已删除!'
|
|
|
|
+ })
|
|
|
|
+ this.GET_All()
|
|
|
|
+ }).catch(response => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'info',
|
|
|
|
+ message: response.message
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
|
|
- // --------------------设备管理
|
|
|
|
- handlePartDevice() {
|
|
|
|
- this.frameId = this.hospital_frame.frame_part.id
|
|
|
|
- this.selectedFrame = this.hospital_frame.frame_part
|
|
|
|
- this.openDeviceList()
|
|
|
|
- },
|
|
|
|
- openDeviceList() {
|
|
|
|
- this.deviceVisible = true
|
|
|
|
- },
|
|
|
|
- handlerSubmit(formName) {
|
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- const params = this.MixinClone(this.frameInfo)
|
|
|
|
- if (params.id) {
|
|
|
|
- if (params.type === 5) {
|
|
|
|
- const name = params.full_name.split('-')
|
|
|
|
- params.full_name = name[0] + '-' + params.name + '床'
|
|
|
|
- } else if (params.type === 4) {
|
|
|
|
- params.full_name = params.name + '房'
|
|
|
|
|
|
+ // --------------------设备管理
|
|
|
|
+ handlePartDevice() {
|
|
|
|
+ this.frameId = this.hospital_frame.frame_part.id
|
|
|
|
+ this.selectedFrame = this.hospital_frame.frame_part
|
|
|
|
+ this.openDeviceList()
|
|
|
|
+ },
|
|
|
|
+ openDeviceList() {
|
|
|
|
+ this.deviceVisible = true
|
|
|
|
+ },
|
|
|
|
+ handlerSubmit(formName) {
|
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const params = this.MixinClone(this.frameInfo)
|
|
|
|
+ if (params.id) {
|
|
|
|
+ if (params.type === 5) {
|
|
|
|
+ const name = params.full_name.split('-')
|
|
|
|
+ params.full_name = name[0] + '-' + params.name + '床'
|
|
|
|
+ } else if (params.type === 4) {
|
|
|
|
+ params.full_name = params.name + '房'
|
|
|
|
+ }
|
|
|
|
+ HospitalFrame_API.updateHospitalFrame(params.id, params).then(response => {
|
|
|
|
+ this.$message.success('修改成功!')
|
|
|
|
+ this.handleFrameFinished()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ if (!params.part_id) {
|
|
|
|
+ params.part_id = this.$store.getters.partId
|
|
|
|
+ }
|
|
|
|
+ params.full_name = this.fullName + '房-' + params.name + '床'
|
|
|
|
+ HospitalFrame_API.addHospitalFrame(params).then(response => {
|
|
|
|
+ this.$message.success('添加成功!')
|
|
|
|
+ this.handleFrameFinished()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- HospitalFrame_API.updateHospitalFrame(params.id, params).then(response => {
|
|
|
|
- this.$message.success('修改成功!')
|
|
|
|
- this.handleFrameFinished()
|
|
|
|
- })
|
|
|
|
} else {
|
|
} else {
|
|
- if (!params.part_id) {
|
|
|
|
- params.part_id = this.$store.getters.partId
|
|
|
|
- }
|
|
|
|
- params.full_name = this.frameInfo.name + '房-' + params.name + '床'
|
|
|
|
- HospitalFrame_API.addHospitalFrame(params).then(response => {
|
|
|
|
- this.$message.success('添加成功!')
|
|
|
|
- this.handleFrameFinished()
|
|
|
|
- })
|
|
|
|
|
|
+ this.$message.error('表单填写有误,请检查!')
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- this.$message.error('表单填写有误,请检查!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-}
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style type="text/scss" lang="scss" scoped>
|
|
<style type="text/scss" lang="scss" scoped>
|