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
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) {
...
@@ -116,3 +116,22 @@ export function delDevice(data) {
data
:
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 @@
...
@@ -79,12 +79,12 @@
<el-cascader
<el-cascader
v-model=
"form.selectedOptions"
v-model=
"form.selectedOptions"
size=
"large"
size=
"large"
:options=
"
city
Options"
:options=
"
area
Options"
placeholder=
"请选择服务地点"
placeholder=
"请选择服务地点"
expand-trigger=
"hover"
expand-trigger=
"hover"
clearable
clearable
style=
"width: 250px"
style=
"width: 250px"
@
change=
"handleChange
Address
"
@
change=
"handleChange
Cascader
"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"address"
>
<el-form-item
prop=
"address"
>
...
@@ -262,14 +262,26 @@
...
@@ -262,14 +262,26 @@
<el-row>
<el-row>
<el-col>
<el-col>
<el-form-item
label=
"支持服务地区"
prop=
"serviceArea"
>
<el-form-item
label=
"支持服务地区"
prop=
"serviceArea"
>
<el-select
v-model=
"form.serviceArea"
placeholder=
"请选择支持服务地区"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-cascader
<el-option
v-model=
"form.serviceArea"
v-for=
"dict in dict.type.service_area"
size=
"large"
:key=
"dict.label"
:options=
"areaOptions"
:label=
"dict.label"
:props=
"props"
:value=
"dict.value"
placeholder=
"请选择服务地点"
/>
collapse-tags
</el-select>
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-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -279,10 +291,10 @@
...
@@ -279,10 +291,10 @@
<el-form-item
label=
"支持检查项目"
prop=
"checkType"
>
<el-form-item
label=
"支持检查项目"
prop=
"checkType"
>
<el-select
v-model=
"form.checkType"
placeholder=
"请选择支持检查项目"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-select
v-model=
"form.checkType"
placeholder=
"请选择支持检查项目"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-option
<el-option
v-for=
" dict in
dict.type.exam_type
"
v-for=
" dict in
checkItemOptions
"
:key=
"dict.
label
"
:key=
"dict.
id
"
:label=
"dict.
label
"
:label=
"dict.
name
"
:value=
"dict.
value
"
:value=
"dict.
id
"
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -306,11 +318,12 @@
...
@@ -306,11 +318,12 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
addDevice
}
from
'@/api/business/device'
import
{
addDevice
,
getAreTreeStructure
,
getAreNameById
}
from
'@/api/business/device'
import
{
regionData
,
CodeToText
}
from
'element-china-area-data'
import
{
regionData
,
CodeToText
}
from
'element-china-area-data'
import
{
getInfo
}
from
'@/api/login'
import
{
getInfo
}
from
'@/api/login'
import
{
isEmpty
}
from
'@/utils/ruoyi'
import
{
isEmpty
}
from
'@/utils/ruoyi'
import
{
deepClone
}
from
'@/utils'
import
{
deepClone
}
from
'@/utils'
import
{
listItemByType
}
from
'@/api/business/item'
export
default
{
export
default
{
name
:
'EquipmentAdd'
,
name
:
'EquipmentAdd'
,
...
@@ -320,12 +333,16 @@ export default {
...
@@ -320,12 +333,16 @@ export default {
return
{
return
{
// 检查类型
// 检查类型
checkType
:
[],
checkType
:
[],
// 地址列表
areaOptions
:
[],
// 服务价格
// 服务价格
serviceShow
:
true
,
serviceShow
:
true
,
// 下单价格是否禁用
// 下单价格是否禁用
disabledOrder
:
false
,
disabledOrder
:
false
,
// 是否医院自有设备
// 是否医院自有设备
loading
:
false
,
loading
:
false
,
// 检查项目下拉框
checkItemOptions
:
[],
option
:
[
option
:
[
{
{
value
:
'0'
,
value
:
'0'
,
...
@@ -340,6 +357,7 @@ export default {
...
@@ -340,6 +357,7 @@ export default {
// 设备归属 0 平台设备 1医院设备
// 设备归属 0 平台设备 1医院设备
isPrivate
:
''
,
isPrivate
:
''
,
cityOptions
:
regionData
,
cityOptions
:
regionData
,
props
:
{
multiple
:
true
},
// 地址码对用的文字
// 地址码对用的文字
addtions
:
{
addtions
:
{
...
@@ -407,8 +425,8 @@ export default {
...
@@ -407,8 +425,8 @@ export default {
{
min
:
2
,
max
:
200
,
message
:
'备注长度必须介于2~200之间'
,
trigger
:
'blur'
}
{
min
:
2
,
max
:
200
,
message
:
'备注长度必须介于2~200之间'
,
trigger
:
'blur'
}
],
],
serviceArea
:
[
serviceArea
:
[
{
required
:
true
,
message
:
'请选择支持服务地区'
,
trigger
:
'blur'
}
,
{
required
:
true
,
message
:
'请选择支持服务地区'
,
trigger
:
'blur'
}
{
type
:
'number'
,
validator
:
this
.
validserviceArea
,
trigger
:
'change'
}
//
{ type: 'number', validator: this.validserviceArea, trigger: 'change' }
],
],
checkType
:
[
checkType
:
[
{
required
:
true
,
message
:
'请选择支持检查项目'
,
trigger
:
'blur'
},
{
required
:
true
,
message
:
'请选择支持检查项目'
,
trigger
:
'blur'
},
...
@@ -442,7 +460,7 @@ export default {
...
@@ -442,7 +460,7 @@ export default {
// 支持服务地区
// 支持服务地区
serviceAreaS
:
[],
serviceAreaS
:
[],
serviceArea
:
''
,
//
serviceArea: '',
// 是否显示
// 是否显示
isShow
:
''
,
isShow
:
''
,
hpshow
:
''
,
hpshow
:
''
,
...
@@ -471,6 +489,7 @@ export default {
...
@@ -471,6 +489,7 @@ export default {
reservationMethod
:
''
,
reservationMethod
:
''
,
status
:
''
,
status
:
''
,
remark
:
''
,
remark
:
''
,
serviceProvince
:
''
,
useTime
:
{
useTime
:
{
ams
:
null
,
ams
:
null
,
ame
:
null
,
ame
:
null
,
...
@@ -499,6 +518,8 @@ export default {
...
@@ -499,6 +518,8 @@ export default {
},
},
created
()
{
created
()
{
this
.
getUserInfo
()
this
.
getUserInfo
()
this
.
getItemByType
()
this
.
getAreaData
()
},
},
methods
:
{
methods
:
{
// 获取登陆人信息
// 获取登陆人信息
...
@@ -519,6 +540,68 @@ export default {
...
@@ -519,6 +540,68 @@ export default {
console
.
log
(
'this.form--------------------'
,
this
.
form
)
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
()
{
getam
()
{
console
.
log
(
this
.
useTime
)
console
.
log
(
this
.
useTime
)
...
@@ -673,24 +756,31 @@ export default {
...
@@ -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
()
{
submitForm
()
{
const
form
=
deepClone
(
this
.
form
)
const
form
=
deepClone
(
this
.
form
)
console
.
log
(
'this.form-----------------------'
,
this
.
form
)
console
.
log
(
'this.form-----------------------'
,
this
.
form
)
if
(
form
.
selectedOptions
!=
null
)
{
if
(
form
.
selectedOptions
!=
null
)
{
form
.
addressCode
=
form
.
selectedOptions
.
join
(
','
)
form
.
addressCode
=
form
.
selectedOptions
.
join
(
','
)
console
.
log
(
'要提交的地址信息'
,
form
.
addressCode
)
}
}
if
(
this
.
addtions
.
names
!=
null
)
{
if
(
this
.
addtions
.
names
!=
null
)
{
form
.
addressText
=
this
.
addtions
.
names
form
.
addressText
=
this
.
addtions
.
names
}
}
// this.form.city = this.city
// console.log('city', this.form.city)
// }
if
(
!
isEmpty
(
form
.
checkType
))
{
if
(
!
isEmpty
(
form
.
checkType
))
{
form
.
checkType
=
form
.
checkType
.
toString
()
form
.
checkType
=
form
.
checkType
.
toString
()
}
}
if
(
!
isEmpty
(
form
.
serviceArea
))
{
if
(
!
isEmpty
(
form
.
serviceArea
))
{
form
.
serviceArea
=
form
.
serviceArea
.
toString
()
console
.
log
(
'支持服务地区'
,
form
.
serviceArea
)
form
.
serviceArea
=
form
.
serviceArea
.
join
(
';'
)
}
}
if
(
!
isEmpty
(
form
.
useTime
))
{
if
(
!
isEmpty
(
form
.
useTime
))
{
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
...
...
src/views/equipment-management/equipment-management/equipment-detail.vue
View file @
9568cc3b
...
@@ -82,12 +82,12 @@
...
@@ -82,12 +82,12 @@
v-model=
"form.selectedOptions"
v-model=
"form.selectedOptions"
disabled
disabled
size=
"large"
size=
"large"
:options=
"
city
Options"
:options=
"
area
Options"
placeholder=
"暂无数据"
placeholder=
"暂无数据"
expand-trigger=
"hover"
expand-trigger=
"hover"
clearable
clearable
style=
"width: 250px"
style=
"width: 250px"
@
change=
"handleChange
Address
"
@
change=
"handleChange
Cascader
"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
prop=
"address"
>
<el-form-item
prop=
"address"
>
...
@@ -391,12 +391,12 @@
...
@@ -391,12 +391,12 @@
ref=
"serviceArea"
ref=
"serviceArea"
v-model=
"form.selectedOptions"
v-model=
"form.selectedOptions"
size=
"large"
size=
"large"
:options=
"
city
Options"
:options=
"
area
Options"
placeholder=
"请选择服务地点"
placeholder=
"请选择服务地点"
expand-trigger=
"hover"
expand-trigger=
"hover"
clearable
clearable
style=
"width: 250px"
style=
"width: 250px"
@
change=
"handleChange
Address
"
@
change=
"handleChange
Cascader
"
/>
/>
</el-form-item>
</el-form-item>
...
@@ -570,14 +570,18 @@
...
@@ -570,14 +570,18 @@
<el-row>
<el-row>
<el-col>
<el-col>
<el-form-item
label=
"支持服务地区"
prop=
"serviceArea"
>
<el-form-item
label=
"支持服务地区"
prop=
"serviceArea"
>
<el-select
v-model=
"form.serviceArea"
placeholder=
"请选择支持服务地区"
style=
"width: 300px"
multiple
collapse-tags
clearable
>
<el-cascader
<el-option
v-model=
"form.serviceArea"
v-for=
"dictServiceArea in dict.type.service_area"
size=
"large"
:key=
"dictServiceArea.label"
:options=
"areaOptions"
:label=
"dictServiceArea.label"
:props=
"props"
:value=
"dictServiceArea.value"
placeholder=
"请选择服务地点"
/>
collapse-tags
</el-select>
expand-trigger=
"hover"
clearable
style=
"width: 250px"
@
change=
"handleChangeServiceArea"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -611,8 +615,8 @@
...
@@ -611,8 +615,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getDevice
,
updateDevice
}
from
'@/api/business/device'
import
{
get
AreNameById
,
getAreTreeStructure
,
get
Device
,
updateDevice
}
from
'@/api/business/device'
import
{
CodeToText
,
regionData
}
from
'element-china-area-data'
import
{
regionData
}
from
'element-china-area-data'
import
{
getInfo
}
from
'@/api/login'
import
{
getInfo
}
from
'@/api/login'
import
{
listCheckManage
}
from
'@/api/business/manage'
import
{
listCheckManage
}
from
'@/api/business/manage'
import
{
isEmpty
,
parseTime
,
selectDictLabels
}
from
'@/utils/ruoyi'
import
{
isEmpty
,
parseTime
,
selectDictLabels
}
from
'@/utils/ruoyi'
...
@@ -638,6 +642,8 @@ export default {
...
@@ -638,6 +642,8 @@ export default {
},
},
// 检查类型
// 检查类型
// checkType: [],
// checkType: [],
// 地址列表
areaOptions
:
[],
// 服务价格
// 服务价格
serviceShow
:
true
,
serviceShow
:
true
,
// 下单价格是否禁用
// 下单价格是否禁用
...
@@ -657,7 +663,7 @@ export default {
...
@@ -657,7 +663,7 @@ export default {
queryParams
:
{
queryParams
:
{
id
:
null
id
:
null
},
},
props
:
{
multiple
:
true
},
cityOptions
:
regionData
,
cityOptions
:
regionData
,
// 存储省市区选中的地址码
// 存储省市区选中的地址码
// selectedOptions: [],
// selectedOptions: [],
...
@@ -823,24 +829,11 @@ export default {
...
@@ -823,24 +829,11 @@ export default {
hpshow
:
''
hpshow
:
''
}
}
},
},
watch
:
{
useTime
:
{
handler
(
newVal
,
oldVal
)
{
if
((
this
.
useTime
.
ame
!=
null
&&
this
.
useTime
.
ams
!=
null
&&
this
.
useTime
.
pme
==
null
&&
this
.
useTime
.
pms
==
null
)
||
(
this
.
useTime
.
pme
!=
null
&&
this
.
useTime
.
pms
!=
null
&&
this
.
useTime
.
ame
==
null
&&
this
.
useTime
.
ams
==
null
)
||
(
this
.
useTime
.
ame
!=
null
&&
this
.
useTime
.
ams
!=
null
&&
this
.
useTime
.
pme
!=
null
&&
this
.
useTime
.
pms
!=
null
))
{
this
.
rules
.
userTime
.
forEach
(
item
=>
item
.
required
=
false
)
console
.
log
(
'111'
)
}
else
{
this
.
rules
.
userTime
.
forEach
(
item
=>
item
.
required
=
true
)
console
.
log
(
'2222'
)
}
},
deep
:
true
}
},
created
()
{
created
()
{
this
.
handleUpdate
()
this
.
handleUpdate
()
this
.
getUserInfo
()
this
.
getUserInfo
()
this
.
getuseList
()
this
.
getuseList
()
this
.
getAreaData
()
},
},
methods
:
{
methods
:
{
// 获取登陆人信息
// 获取登陆人信息
...
@@ -934,12 +927,6 @@ export default {
...
@@ -934,12 +927,6 @@ export default {
validateMorningStart
(
rule
,
value
,
callback
)
{
validateMorningStart
(
rule
,
value
,
callback
)
{
// // TODO: please clear this log
// // TODO: please clear this log
const
morningEnd
=
this
.
form
.
useTime
.
ame
const
morningEnd
=
this
.
form
.
useTime
.
ame
// console.log('value', value)
// console.log('morningEnd', morningEnd)
// console.log('this.form.useTime.ame', this.form.useTime.ame)
// console.log('this.form.useTime.pms', this.form.useTime.pms)
// console.log('his.form.useTime.pme', this.form.useTime.pme)
// if (isEmpty(value) && isEmpty(this.form.useTime.ams) || isEmpty(this.form.useTime.ame))
if
(
isEmpty
(
value
)
&&
isEmpty
(
this
.
form
.
useTime
.
ame
)
&&
isEmpty
(
this
.
form
.
useTime
.
pms
)
&&
isEmpty
(
this
.
form
.
useTime
.
pme
))
{
if
(
isEmpty
(
value
)
&&
isEmpty
(
this
.
form
.
useTime
.
ame
)
&&
isEmpty
(
this
.
form
.
useTime
.
pms
)
&&
isEmpty
(
this
.
form
.
useTime
.
pme
))
{
console
.
log
(
'上午开始时间第一层报错'
)
console
.
log
(
'上午开始时间第一层报错'
)
callback
(
new
Error
(
'请选择上午开始时间'
))
callback
(
new
Error
(
'请选择上午开始时间'
))
...
@@ -994,24 +981,66 @@ export default {
...
@@ -994,24 +981,66 @@ export default {
}
}
}
}
},
},
// 选择地址
// 获取地址数据
handleChangeAddress
(
value
)
{
getAreaData
()
{
this
.
form
.
selectedOptions
=
value
getAreTreeStructure
().
then
(
response
=>
{
console
.
log
(
'地区码'
,
this
.
form
.
selectedOptions
)
console
.
log
(
'地区三级'
,
response
)
var
name
=
''
if
(
response
.
code
===
200
)
{
this
.
form
.
selectedOptions
.
map
(
item
=>
name
+=
CodeToText
[
item
]
+
''
)
// 将省市区三个拼接一起
this
.
removeEmptyChildren
(
response
.
data
)
this
.
addtions
.
names
=
name
this
.
areaOptions
=
response
.
data
console
.
log
(
this
.
addtions
.
names
)
console
.
log
(
'dsa'
,
response
.
data
)
// 运用了CodeToText把编码转成了中文
}
this
.
addForm
.
province
=
CodeToText
[
this
.
form
.
selectedOptions
[
0
]]
})
this
.
addForm
.
county
=
CodeToText
[
this
.
form
.
selectedOptions
[
1
]]
},
this
.
addForm
.
area
=
CodeToText
[
this
.
form
.
selectedOptions
[
2
]]
removeEmptyChildren
(
array
)
{
if
(
this
.
addForm
.
county
===
'市辖区'
||
this
.
addForm
.
county
===
'县'
)
{
if
(
!
array
||
!
Array
.
isArray
(
array
))
{
this
.
city
=
this
.
addForm
.
province
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
{
}
else
{
this
.
city
=
this
.
addForm
.
county
// 取消后 清空数据
this
.
addtions
.
names
=
''
this
.
city
=
null
}
}
console
.
log
(
'中文'
,
this
.
addForm
)
},
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
)
{
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
)
})
},
},
// 提交
// 提交
...
@@ -1031,7 +1060,8 @@ export default {
...
@@ -1031,7 +1060,8 @@ export default {
form
.
checkType
=
form
.
checkType
.
toString
()
form
.
checkType
=
form
.
checkType
.
toString
()
}
}
if
(
!
isEmpty
(
form
.
serviceArea
))
{
if
(
!
isEmpty
(
form
.
serviceArea
))
{
form
.
serviceArea
=
form
.
serviceArea
.
toString
()
console
.
log
(
'支持服务地区'
,
form
.
serviceArea
)
form
.
serviceArea
=
form
.
serviceArea
.
join
(
';'
)
}
}
if
(
!
isEmpty
(
form
.
useTime
))
{
if
(
!
isEmpty
(
form
.
useTime
))
{
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
...
@@ -1076,23 +1106,17 @@ export default {
...
@@ -1076,23 +1106,17 @@ export default {
getDevice
(
this
.
id
).
then
(
response
=>
{
getDevice
(
this
.
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
this
.
form
=
response
.
data
// if (this.form.selectedOptions != null && this.form.selectedOptions !== '') {
// if (this.form.selectedOptions != null && this.form.selectedOptions !== '') {
this
.
form
.
selectedOptions
=
response
.
data
.
addressCode
.
split
(
','
)
this
.
form
.
selectedOptions
=
response
.
data
.
addressCode
.
split
(
','
).
map
(
Number
)
console
.
log
(
'查询到的地址信息'
,
this
.
form
.
selectedOptions
)
//
//
// }
// }
// if (this.form.serviceArea != null && this.form.serviceArea !== '') {
// if (this.form.serviceArea != null && this.form.serviceArea !== '') {
console
.
log
(
'this.form.serviceArea'
,
this
.
form
.
serviceArea
)
console
.
log
(
'this.form.serviceArea'
,
this
.
form
.
serviceArea
)
this
.
form
.
serviceAreaText
=
selectDictLabels
(
this
.
dict
.
type
.
service_area
,
this
.
form
.
serviceArea
)
this
.
form
.
serviceAreaText
=
selectDictLabels
(
this
.
dict
.
type
.
service_area
,
this
.
form
.
serviceArea
)
console
.
log
(
' this.form.serviceAreaText'
,
this
.
form
.
serviceAreaText
)
console
.
log
(
' this.form.serviceAreaText'
,
this
.
form
.
serviceAreaText
)
this
.
form
.
serviceArea
=
response
.
data
.
serviceArea
.
split
(
','
)
this
.
form
.
serviceArea
=
response
.
data
.
serviceArea
.
split
(
';'
)
console
.
log
(
'支持检查地区回显值'
,
this
.
form
.
serviceArea
)
// this.getDicts('service_area').then(response => {
// this.form.serviceAreaList = response.data
// this.form.checkTypeList = this.form.serviceArea.map(dictValue => this.form.serviceAreaList)
// console.log(' this.form.serviceAreaList.', this.form.serviceAreaList)
// console.log("this.form.idlist.", this.form.checkTypeList)
// })
// }
if
(
this
.
form
.
checkType
!=
null
&&
this
.
form
.
checkType
!==
''
)
{
if
(
this
.
form
.
checkType
!=
null
&&
this
.
form
.
checkType
!==
''
)
{
this
.
form
.
checkTypeText
=
selectDictLabels
(
this
.
dict
.
type
.
exam_type
,
this
.
form
.
checkType
)
this
.
form
.
checkTypeText
=
selectDictLabels
(
this
.
dict
.
type
.
exam_type
,
this
.
form
.
checkType
)
console
.
log
(
' this.form.checkTypeText'
,
this
.
form
.
checkTypeText
)
console
.
log
(
' this.form.checkTypeText'
,
this
.
form
.
checkTypeText
)
...
@@ -1102,17 +1126,7 @@ export default {
...
@@ -1102,17 +1126,7 @@ export default {
if
(
this
.
form
.
useTime
!=
null
&&
this
.
form
.
useTime
!==
''
)
{
if
(
this
.
form
.
useTime
!=
null
&&
this
.
form
.
useTime
!==
''
)
{
this
.
form
.
useTime
=
JSON
.
parse
(
response
.
data
.
useTime
)
this
.
form
.
useTime
=
JSON
.
parse
(
response
.
data
.
useTime
)
}
}
// this.checkType = response.data.checkType.split(',')
// console.log(':fsdfsddddddddd???????', response.data.addressCode)
// console.log('详细个bbbbb', this.selectedOptions)
// console.log('详细个ccccccccccc', this.form.selectedOptions)
console
.
log
(
'详情数据---'
,
this
.
form
)
console
.
log
(
'详情数据---'
,
this
.
form
)
// this.serviceAreaS = this.form.serviceArea.split(';')
// this.serviceArea = []
// for (let i = 0; i
<
this
.
serviceAreaS
.
length
;
i
++
)
{
// this.serviceAreaS[i] = this.serviceAreaS[i].split(',')
// this.serviceArea.push(this.serviceAreaS[i])
// }
})
})
}
}
}
}
...
...
src/views/equipment-management/equipment-management/equipment-management.vue
View file @
9568cc3b
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
<el-form-item>
<el-form-item>
<el-select
v-model=
"queryParams.checkTypeList"
placeholder=
"设备检查项目"
multiple
collapse-tags
clearable
>
<el-select
v-model=
"queryParams.checkTypeList"
placeholder=
"设备检查项目"
multiple
collapse-tags
clearable
>
<el-option
<el-option
v-for=
"dict in
dict.type.exam_type
"
v-for=
"dict in
checkItemOptions
"
:key=
"dict.
value
"
:key=
"dict.
id
"
:label=
"dict.
label
"
:label=
"dict.
name
"
:value=
"dict.
value
"
:value=
"dict.
id
"
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -253,6 +253,7 @@ import { listDevice, delDevice, listDeviceAll } from '@/api/business/device'
...
@@ -253,6 +253,7 @@ import { listDevice, delDevice, listDeviceAll } from '@/api/business/device'
import
{
getInfo
}
from
'@/api/login'
import
{
getInfo
}
from
'@/api/login'
import
{
parseTime
}
from
'@/utils/ruoyi'
import
{
parseTime
}
from
'@/utils/ruoyi'
import
{
mapGetters
}
from
'vuex'
import
{
mapGetters
}
from
'vuex'
import
{
listItemByType
}
from
'@/api/business/item'
export
default
{
export
default
{
name
:
'EquipmentManagement'
,
name
:
'EquipmentManagement'
,
...
@@ -267,6 +268,8 @@ export default {
...
@@ -267,6 +268,8 @@ export default {
isPrivate
:
''
,
isPrivate
:
''
,
// 下单价格
// 下单价格
orderShow
:
true
,
orderShow
:
true
,
// 检查设备下拉框
checkItemOptions
:
[],
// 筛选列表
// 筛选列表
sortedColumn
:
''
,
sortedColumn
:
''
,
...
@@ -470,6 +473,7 @@ export default {
...
@@ -470,6 +473,7 @@ export default {
},
},
created
()
{
created
()
{
this
.
getList
()
this
.
getList
()
this
.
getItemByType
()
},
},
methods
:
{
methods
:
{
// 获取登陆人信息
// 获取登陆人信息
...
@@ -486,7 +490,7 @@ export default {
...
@@ -486,7 +490,7 @@ export default {
}
}
})
})
},
},
// 显示两位数字
fun
(
val
)
{
fun
(
val
)
{
return
Number
(
val
).
toFixed
(
2
)
return
Number
(
val
).
toFixed
(
2
)
},
},
...
@@ -692,6 +696,14 @@ export default {
...
@@ -692,6 +696,14 @@ export default {
reverseSelect
()
{
reverseSelect
()
{
this
.
changeTableSelect
(
this
.
ids
)
this
.
changeTableSelect
(
this
.
ids
)
},
},
// 获取检查项目下拉框
getItemByType
()
{
listItemByType
({
itemType
:
null
}).
then
(
res
=>
{
console
.
log
(
'检查项目'
,
res
)
this
.
checkItemOptions
=
res
.
rows
console
.
log
(
'xdddd'
,
this
.
checkItemOptions
)
})
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
console
.
log
(
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