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
e733c871
Commit
e733c871
authored
Jun 21, 2023
by
v_liuhuaizhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
f554c7c1
2c44b00c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
97 deletions
+175
-97
ruoyi.js
src/utils/ruoyi.js
+7
-0
equipment-add.vue
...uipment-management/equipment-management/equipment-add.vue
+61
-58
equipment-detail.vue
...ment-management/equipment-management/equipment-detail.vue
+100
-32
equipment-management.vue
...-management/equipment-management/equipment-management.vue
+7
-7
No files found.
src/utils/ruoyi.js
View file @
e733c871
...
...
@@ -134,6 +134,13 @@ export function parseStrEmpty(str) {
return
str
;
}
/**
* 判断传入内容是否为空
*/
export
function
isEmpty
(
str
)
{
return
parseStrEmpty
(
str
)
===
''
}
// 数据合并
export
function
mergeRecursive
(
source
,
target
)
{
for
(
var
p
in
target
)
{
...
...
src/views/equipment-management/equipment-management/equipment-add.vue
View file @
e733c871
This diff is collapsed.
Click to expand it.
src/views/equipment-management/equipment-management/equipment-detail.vue
View file @
e733c871
...
...
@@ -436,7 +436,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"上午开始时间"
>
<el-form-item
label=
"上午开始时间"
prop=
"useTime.ams"
>
<el-time-select
v-model=
"form.useTime.ams"
style=
"width: 250px"
...
...
@@ -453,7 +453,7 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"上午结束时间"
>
<el-form-item
label=
"上午结束时间"
prop=
"useTime.ame"
>
<el-time-select
v-model=
"form.useTime.ame"
style=
"width: 250px"
...
...
@@ -473,8 +473,8 @@
</el-row>
<!-- 5-->
<el-row>
<el-col
:span=
"8"
style=
"margin-left: 33.
5
%"
>
<el-form-item
label=
"下午开始时间"
>
<el-col
:span=
"8"
style=
"margin-left: 33.
3
%"
>
<el-form-item
label=
"下午开始时间"
prop=
"useTime.pms"
>
<el-time-select
v-model=
"form.useTime.pms"
style=
"width: 250px"
...
...
@@ -490,9 +490,8 @@
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"下午结束时间"
>
<el-form-item
label=
"下午结束时间"
prop=
"useTime.pme"
>
<el-time-select
v-model=
"form.useTime.pme"
style=
"width: 250px"
...
...
@@ -610,7 +609,8 @@ import { getDevice, updateDevice } from '@/api/business/device'
import
{
CodeToText
,
regionData
}
from
'element-china-area-data'
import
{
getInfo
}
from
'@/api/login'
import
{
listCheckManage
}
from
'@/api/business/manage'
import
{
parseTime
}
from
'@/utils/ruoyi'
import
{
isEmpty
,
parseTime
}
from
'@/utils/ruoyi'
import
{
deepClone
}
from
'@/utils'
export
default
{
name
:
'EquipmentDetail'
,
dicts
:
[
'device_status'
,
'device_type'
,
'exam_type'
,
'check_type'
,
'service_area'
],
...
...
@@ -711,18 +711,18 @@ export default {
address
:
[
{
required
:
true
,
message
:
'请输入服务地址'
,
trigger
:
'blur'
}
],
// ams
: [
// { required: true, validator: this.validateMorningStart, trigger: 'blur
' }
//
],
// ame
: [
//
{ required: true, validator: this.validateMorningEnd, trigger: 'blur' }
//
],
// pms
: [
//
{ required: true, validator: this.validateAfternoonStart, trigger: 'blur' }
//
],
// pme
: [
//
{ required: true, validator: this.validateAfternoonEnd, trigger: 'blur' }
//
],
'useTime.ams'
:
[
{
required
:
true
,
validator
:
this
.
validateMorningStart
,
trigger
:
'change
'
}
],
'useTime.ame'
:
[
{
required
:
true
,
validator
:
this
.
validateMorningEnd
,
trigger
:
'blur'
}
],
'useTime.pms'
:
[
{
required
:
true
,
validator
:
this
.
validateAfternoonStart
,
trigger
:
'blur'
}
],
'useTime.pme'
:
[
{
required
:
true
,
validator
:
this
.
validateAfternoonEnd
,
trigger
:
'blur'
}
],
useNum
:
[
{
required
:
true
,
message
:
'请输入服务单位时段服务数'
,
trigger
:
'change,blur'
},
{
type
:
'number'
,
validator
:
this
.
validUseNum
,
trigger
:
'change'
}
...
...
@@ -880,6 +880,70 @@ export default {
callback
(
new
Error
(
'单位时段服务数不能为0'
))
}
},
// 四个时间的表单校验
validateMorningStart
(
rule
,
value
,
callback
)
{
// // TODO: please clear this log
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
))
{
console
.
log
(
'上午开始时间第一层报错'
)
callback
(
new
Error
(
'请选择上午开始时间'
))
}
else
{
if
(
isEmpty
(
value
)
&&
isEmpty
(
morningEnd
))
{
console
.
log
(
'上午开始时间第二层报错'
)
callback
(
new
Error
(
'请选择上午开始时间'
))
}
else
{
callback
()
}
}
},
validateMorningEnd
(
rule
,
value
,
callback
)
{
const
morningStart
=
this
.
form
.
useTime
.
ams
if
(
isEmpty
(
value
)
&&
isEmpty
(
this
.
form
.
useTime
.
ams
)
&&
isEmpty
(
this
.
form
.
useTime
.
pms
)
&&
isEmpty
(
this
.
form
.
useTime
.
pme
))
{
console
.
log
(
'上午结束时间第一层报错'
)
callback
(
new
Error
(
'请选择上午结束时间'
))
}
else
{
if
(
isEmpty
(
value
)
&&
isEmpty
(
morningStart
))
{
console
.
log
(
'上午结束时间第一层报错'
)
callback
(
new
Error
(
'请选择上午结束时间'
))
}
else
{
callback
()
}
}
},
validateAfternoonStart
(
rule
,
value
,
callback
)
{
const
afternoonEnd
=
this
.
form
.
useTime
.
pme
if
(
isEmpty
(
value
)
&&
isEmpty
(
this
.
form
.
useTime
.
ams
)
&&
isEmpty
(
this
.
form
.
useTime
.
ame
)
&&
isEmpty
(
this
.
form
.
useTime
.
pme
))
{
console
.
log
(
' 下午开始时间第一层报错'
)
callback
(
new
Error
(
'请选择下午开始时间'
))
}
else
{
if
(
isEmpty
(
value
)
&&
isEmpty
(
afternoonEnd
))
{
console
.
log
(
'下午开始时间开始第二层报错'
)
callback
(
new
Error
(
'请选择下午开始时间'
))
}
else
{
callback
()
}
}
},
validateAfternoonEnd
(
rule
,
value
,
callback
)
{
const
afternoonStart
=
this
.
form
.
useTime
.
pms
if
(
isEmpty
(
value
)
&&
isEmpty
(
this
.
form
.
useTime
.
ams
)
&&
isEmpty
(
this
.
form
.
useTime
.
ame
)
&&
isEmpty
(
this
.
form
.
useTime
.
pms
))
{
console
.
log
(
'下午结束时间结束第一层报错'
)
callback
(
new
Error
(
'请选择下午结束时间'
))
}
else
{
if
(
isEmpty
(
value
)
&&
isEmpty
(
afternoonStart
))
{
console
.
log
(
'下午结束时间结束第二层报错'
)
callback
(
new
Error
(
'请选择下午结束时间'
))
}
else
{
callback
()
}
}
},
// 选择地址
handleChangeAddress
(
value
)
{
this
.
selectedOptions
=
value
...
...
@@ -899,25 +963,29 @@ export default {
}
console
.
log
(
'中文'
,
this
.
addForm
)
},
// 提交
submitForm
()
{
const
form
=
deepClone
(
this
.
form
)
console
.
log
(
'selectedOptions'
,
this
.
form
.
addressCode
)
if
(
this
.
form
.
selectedOptions
!=
null
&&
this
.
form
.
selectedOptions
!==
''
)
{
this
.
form
.
addressCode
=
this
.
form
.
selectedOptions
.
join
(
','
)
console
.
log
(
'xxaa'
,
this
.
selectedOptions
)
if
(
this
.
selectedOptions
!=
null
)
{
form
.
addressCode
=
this
.
selectedOptions
.
join
(
','
)
}
if
(
this
.
addtions
.
names
!=
null
)
{
this
.
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
))
{
form
.
checkType
=
form
.
checkType
.
toString
()
}
if
(
this
.
form
.
serviceArea
!=
null
&&
this
.
form
.
serviceArea
!==
''
)
{
this
.
form
.
serviceArea
=
this
.
form
.
serviceArea
.
toString
()
console
.
log
(
'serviceArea'
,
this
.
form
.
serviceArea
)
if
(
!
isEmpty
(
form
.
serviceArea
))
{
form
.
serviceArea
=
form
.
serviceArea
.
toString
()
}
if
(
this
.
form
.
checkType
!=
null
&&
this
.
form
.
checkType
!==
''
)
{
this
.
form
.
checkType
=
this
.
form
.
checkType
.
toString
()
console
.
log
(
'checkType'
,
this
.
form
.
checkType
)
if
(
!
isEmpty
(
form
.
useTime
))
{
form
.
useTime
=
JSON
.
stringify
(
form
.
useTime
)
}
this
.
form
.
useTime
=
JSON
.
stringify
(
this
.
form
.
useTime
)
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
...
...
@@ -930,10 +998,10 @@ export default {
type
:
'warning'
}).
then
(()
=>
{
updateDevice
(
this
.
form
).
then
(
response
=>
{
updateDevice
(
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
'修改成功'
)
this
.
cancel
()
console
.
log
(
'this.form)'
,
this
.
form
)
console
.
log
(
'this.form)'
,
form
)
})
})
}
...
...
src/views/equipment-management/equipment-management/equipment-management.vue
View file @
e733c871
...
...
@@ -21,7 +21,7 @@
</el-select>
</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
v-for=
"dict in dict.type.exam_type"
:key=
"dict.value"
...
...
@@ -31,7 +31,7 @@
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model=
"queryParams.status"
placeholder=
"
请选择
设备状态"
collapse-tags
clearable
>
<el-select
v-model=
"queryParams.status"
placeholder=
"设备状态"
collapse-tags
clearable
>
<el-option
v-for=
"dict in dict.type.device_status"
:key=
"dict.value"
...
...
@@ -115,7 +115,7 @@
</el-col>
</el-row>
<el-table
ref=
"table"
v-loading=
"loading"
:data=
"deviceList"
:header-cell-style=
"
{ background:'#E8E9E8'}" border
@selection-change="handleSelectionChange" :row-key="getRowKeys
">
<el-table
ref=
"table"
v-loading=
"loading"
:data=
"deviceList"
:header-cell-style=
"
{ background:'#E8E9E8'}" border
:row-key="getRowKeys" @selection-change="handleSelectionChange
">
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
:reserve-selection=
"true"
/>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
/>
<el-table-column
label=
"设备名称"
align=
"left"
prop=
"deviceName"
show-overflow-tooltip
/>
...
...
@@ -132,7 +132,7 @@
</el-table-column>
<el-table-column
label=
"设备类型"
align=
"left"
prop=
"deviceType"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.device_type"
:value=
"scope.row.deviceType
"
/>
<dict-tag
:options=
"dict.type.device_type"
:value=
"scope.row.deviceType
"
placeholder=
"-"
/>
</
template
>
</el-table-column>
<el-table-column
:label=
"userType === '00' ?'平台自有设备':'医院自有设备'"
align=
"left"
prop=
"isPrivate"
>
...
...
@@ -443,8 +443,8 @@ export default {
})
},
fun
(
val
){
return
Number
(
val
).
toFixed
(
2
)
;
fun
(
val
)
{
return
Number
(
val
).
toFixed
(
2
)
},
// 日期格式化
replace
(
time
)
{
...
...
@@ -564,7 +564,7 @@ export default {
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
console
.
log
(
"this.ids"
,
this
.
ids
)
console
.
log
(
'this.ids'
,
this
.
ids
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
...
...
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