Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pet-business-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
pet-business-web
Commits
9568cc3b
Commit
9568cc3b
authored
Aug 07, 2023
by
王飞龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备管理
parent
637806eb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
234 additions
and
99 deletions
+234
-99
device.js
src/api/business/device.js
+19
-0
equipment-add.vue
...uipment-management/equipment-management/equipment-add.vue
+112
-22
equipment-detail.vue
...ment-management/equipment-management/equipment-detail.vue
+86
-72
equipment-management.vue
...-management/equipment-management/equipment-management.vue
+17
-5
No files found.
src/api/business/device.js
View file @
9568cc3b
...
...
@@ -116,3 +116,22 @@ export function delDevice(data) {
data
:
data
})
}
// 获取地址树
export
function
getAreTreeStructure
()
{
return
request
({
url
:
'/system/hospital/are-tree-structure'
,
method
:
'get'
})
}
/**
* 通过id-List查询地区名
* @param query
* @returns {AxiosPromise}
*/
export
function
getAreNameById
(
query
)
{
return
request
({
url
:
'/system/hospital/getAreNameById'
,
method
:
'get'
,
params
:
query
})
}
src/views/equipment-management/equipment-management/equipment-add.vue
View file @
9568cc3b
...
...
@@ -79,12 +79,12 @@
<el-cascader
v-model=
"form.selectedOptions"
size=
"large"
:options=
"
city
Options"
:options=
"
area
Options"
placeholder=
"请选择服务地点"
expand-trigger=
"hover"
clearable
style=
"width: 250px"
@
change=
"handleChange
Address
"
@
change=
"handleChange
Cascader
"
/>
</el-form-item>
<el-form-item
prop=
"address"
>
...
...
@@ -262,14 +262,26 @@
<el-row>
<el-col>
<el-form-item
label=
"支持服务地区"
prop=
"serviceArea"
>
<el-select
v-model=
"form.serviceArea"
placeholder=
"请选择支持服务地区"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-option
v-for=
"dict in dict.type.service_area"
:key=
"dict.label"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
<el-cascader
v-model=
"form.serviceArea"
size=
"large"
:options=
"areaOptions"
:props=
"props"
placeholder=
"请选择服务地点"
collapse-tags
expand-trigger=
"hover"
clearable
style=
"width: 250px"
@
change=
"handleChangeServiceArea"
/>
<!--
<el-select
v-model=
"form.serviceArea"
placeholder=
"请选择支持服务地区"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
-->
<!--
<el-option-->
<!-- v-for="dict in dict.type.service_area"-->
<!-- :key="dict.label"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!--
</el-select>
-->
</el-form-item>
</el-col>
</el-row>
...
...
@@ -279,10 +291,10 @@
<el-form-item
label=
"支持检查项目"
prop=
"checkType"
>
<el-select
v-model=
"form.checkType"
placeholder=
"请选择支持检查项目"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-option
v-for=
" dict in
dict.type.exam_type
"
:key=
"dict.
label
"
:label=
"dict.
label
"
:value=
"dict.
value
"
v-for=
" dict in
checkItemOptions
"
:key=
"dict.
id
"
:label=
"dict.
name
"
:value=
"dict.
id
"
/>
</el-select>
</el-form-item>
...
...
@@ -306,11 +318,12 @@
</
template
>
<
script
>
import
{
addDevice
}
from
'@/api/business/device'
import
{
addDevice
,
getAreTreeStructure
,
getAreNameById
}
from
'@/api/business/device'
import
{
regionData
,
CodeToText
}
from
'element-china-area-data'
import
{
getInfo
}
from
'@/api/login'
import
{
isEmpty
}
from
'@/utils/ruoyi'
import
{
deepClone
}
from
'@/utils'
import
{
listItemByType
}
from
'@/api/business/item'
export
default
{
name
:
'EquipmentAdd'
,
...
...
@@ -320,12 +333,16 @@ export default {
return
{
// 检查类型
checkType
:
[],
// 地址列表
areaOptions
:
[],
// 服务价格
serviceShow
:
true
,
// 下单价格是否禁用
disabledOrder
:
false
,
// 是否医院自有设备
loading
:
false
,
// 检查项目下拉框
checkItemOptions
:
[],
option
:
[
{
value
:
'0'
,
...
...
@@ -340,6 +357,7 @@ export default {
// 设备归属 0 平台设备 1医院设备
isPrivate
:
''
,
cityOptions
:
regionData
,
props
:
{
multiple
:
true
},
// 地址码对用的文字
addtions
:
{
...
...
@@ -407,8 +425,8 @@ export default {
{
min
:
2
,
max
:
200
,
message
:
'备注长度必须介于2~200之间'
,
trigger
:
'blur'
}
],
serviceArea
:
[
{
required
:
true
,
message
:
'请选择支持服务地区'
,
trigger
:
'blur'
}
,
{
type
:
'number'
,
validator
:
this
.
validserviceArea
,
trigger
:
'change'
}
{
required
:
true
,
message
:
'请选择支持服务地区'
,
trigger
:
'blur'
}
//
{ type: 'number', validator: this.validserviceArea, trigger: 'change' }
],
checkType
:
[
{
required
:
true
,
message
:
'请选择支持检查项目'
,
trigger
:
'blur'
},
...
...
@@ -442,7 +460,7 @@ export default {
// 支持服务地区
serviceAreaS
:
[],
serviceArea
:
''
,
//
serviceArea: '',
// 是否显示
isShow
:
''
,
hpshow
:
''
,
...
...
@@ -471,6 +489,7 @@ export default {
reservationMethod
:
''
,
status
:
''
,
remark
:
''
,
serviceProvince
:
''
,
useTime
:
{
ams
:
null
,
ame
:
null
,
...
...
@@ -499,6 +518,8 @@ export default {
},
created
()
{
this
.
getUserInfo
()
this
.
getItemByType
()
this
.
getAreaData
()
},
methods
:
{
// 获取登陆人信息
...
...
@@ -519,6 +540,68 @@ export default {
console
.
log
(
'this.form--------------------'
,
this
.
form
)
})
},
// 获取地址数据
getAreaData
()
{
getAreTreeStructure
().
then
(
response
=>
{
console
.
log
(
'地区三级'
,
response
)
if
(
response
.
code
===
200
)
{
this
.
removeEmptyChildren
(
response
.
data
)
this
.
areaOptions
=
response
.
data
console
.
log
(
'dsa'
,
response
.
data
)
}
})
},
removeEmptyChildren
(
array
)
{
if
(
!
array
||
!
Array
.
isArray
(
array
))
{
return
}
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
const
item
=
array
[
i
]
if
(
item
&&
Array
.
isArray
(
item
.
children
))
{
if
(
item
.
children
.
length
===
0
)
{
// 如果 children 数组为空,则删除该属性
delete
item
.
children
}
else
{
// 否则继续递归遍历 children 数组
this
.
removeEmptyChildren
(
item
.
children
)
}
}
}
},
handleChangeCascader
(
value
)
{
console
.
log
(
'handleChangeCascader'
,
value
)
if
(
value
.
length
>
0
)
{
this
.
getAreNameById
(
value
)
}
else
{
// 取消后 清空数据
this
.
addtions
.
names
=
''
this
.
city
=
null
}
},
handleChangeServiceArea
(
value
)
{
console
.
log
(
'handleChangeServiceArea'
,
value
)
// 拿到所选的省级id 把重复的过滤掉
const
uniqueFirstItems
=
value
.
map
((
arr
)
=>
arr
[
0
]).
filter
((
item
,
index
,
arr
)
=>
arr
.
indexOf
(
item
)
===
index
)
this
.
form
.
serviceProvince
=
uniqueFirstItems
},
// 获取地区名 通过 idList
getAreNameById
(
ids
)
{
console
.
log
(
'拿到的list'
,
ids
)
getAreNameById
({
idList
:
ids
}).
then
(
response
=>
{
let
addressText
=
''
let
city
=
''
for
(
let
i
=
0
;
i
<
response
.
data
.
length
;
i
++
)
{
addressText
+=
response
.
data
[
i
].
nameLocal
if
(
i
===
1
)
{
city
=
response
.
data
[
i
].
nameLocal
}
}
this
.
addtions
.
names
=
addressText
this
.
city
=
city
console
.
log
(
'地区名'
,
addressText
)
console
.
log
(
'城市名'
,
city
)
})
},
// 时间段获取
getam
()
{
console
.
log
(
this
.
useTime
)
...
...
@@ -673,24 +756,31 @@ export default {
}
}
},
// 获取检查项目下拉框
getItemByType
()
{
listItemByType
({
itemType
:
null
}).
then
(
res
=>
{
console
.
log
(
'检查项目'
,
res
)
this
.
checkItemOptions
=
res
.
rows
console
.
log
(
'xdddd'
,
this
.
checkItemOptions
)
})
},
/** 提交按钮 */
submitForm
()
{
const
form
=
deepClone
(
this
.
form
)
console
.
log
(
'this.form-----------------------'
,
this
.
form
)
if
(
form
.
selectedOptions
!=
null
)
{
form
.
addressCode
=
form
.
selectedOptions
.
join
(
','
)
console
.
log
(
'要提交的地址信息'
,
form
.
addressCode
)
}
if
(
this
.
addtions
.
names
!=
null
)
{
form
.
addressText
=
this
.
addtions
.
names
}
// this.form.city = this.city
// console.log('city', this.form.city)
// }
if
(
!
isEmpty
(
form
.
checkType
))
{
form
.
checkType
=
form
.
checkType
.
toString
()
}
if
(
!
isEmpty
(
form
.
serviceArea
))
{
form
.
serviceArea
=
form
.
serviceArea
.
toString
()
console
.
log
(
'支持服务地区'
,
form
.
serviceArea
)
form
.
serviceArea
=
form
.
serviceArea
.
join
(
';'
)
}
if
(
!
isEmpty
(
form
.
useTime
))
{
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
...
...
src/views/equipment-management/equipment-management/equipment-detail.vue
View file @
9568cc3b
This diff is collapsed.
Click to expand it.
src/views/equipment-management/equipment-management/equipment-management.vue
View file @
9568cc3b
...
...
@@ -33,10 +33,10 @@
<el-form-item>
<el-select
v-model=
"queryParams.checkTypeList"
placeholder=
"设备检查项目"
multiple
collapse-tags
clearable
>
<el-option
v-for=
"dict in
dict.type.exam_type
"
:key=
"dict.
value
"
:label=
"dict.
label
"
:value=
"dict.
value
"
v-for=
"dict in
checkItemOptions
"
:key=
"dict.
id
"
:label=
"dict.
name
"
:value=
"dict.
id
"
/>
</el-select>
</el-form-item>
...
...
@@ -253,6 +253,7 @@ import { listDevice, delDevice, listDeviceAll } from '@/api/business/device'
import
{
getInfo
}
from
'@/api/login'
import
{
parseTime
}
from
'@/utils/ruoyi'
import
{
mapGetters
}
from
'vuex'
import
{
listItemByType
}
from
'@/api/business/item'
export
default
{
name
:
'EquipmentManagement'
,
...
...
@@ -267,6 +268,8 @@ export default {
isPrivate
:
''
,
// 下单价格
orderShow
:
true
,
// 检查设备下拉框
checkItemOptions
:
[],
// 筛选列表
sortedColumn
:
''
,
...
...
@@ -470,6 +473,7 @@ export default {
},
created
()
{
this
.
getList
()
this
.
getItemByType
()
},
methods
:
{
// 获取登陆人信息
...
...
@@ -486,7 +490,7 @@ export default {
}
})
},
// 显示两位数字
fun
(
val
)
{
return
Number
(
val
).
toFixed
(
2
)
},
...
...
@@ -692,6 +696,14 @@ export default {
reverseSelect
()
{
this
.
changeTableSelect
(
this
.
ids
)
},
// 获取检查项目下拉框
getItemByType
()
{
listItemByType
({
itemType
:
null
}).
then
(
res
=>
{
console
.
log
(
'检查项目'
,
res
)
this
.
checkItemOptions
=
res
.
rows
console
.
log
(
'xdddd'
,
this
.
checkItemOptions
)
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
console
.
log
(
row
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment