Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-back-soil
Overview
Overview
Details
Activity
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
wangweidong
patzn-cloud-web-back-soil
Commits
a7904402
Commit
a7904402
authored
Jun 30, 2020
by
lichengming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了统计报表个人检测任务查询
parent
cb736890
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
876 additions
and
196 deletions
+876
-196
AutoCompletes.vue
components/base/AutoCompletes.vue
+0
-1
SelMultiGroup.vue
components/user-info/SelMultiGroup.vue
+63
-0
SelMultiUserGroup.vue
components/user-info/SelMultiUserGroup.vue
+111
-0
Detail.vue
pages/meter-statistics/personal-task/Detail.vue
+256
-0
MeterPersonalTask.vue
pages/meter-statistics/personal-task/MeterPersonalTask.vue
+251
-195
UserTestPie.vue
pages/meter-statistics/personal-task/UserTestPie.vue
+165
-0
common.js
plugins/common.js
+30
-0
No files found.
components/base/AutoCompletes.vue
View file @
a7904402
...
@@ -121,7 +121,6 @@ export default {
...
@@ -121,7 +121,6 @@ export default {
// 聚焦
// 聚焦
_inputFocus
()
{
_inputFocus
()
{
// this.isFocus = true;
// this.isFocus = true;
console
.
log
(
'默认单位名'
,
this
.
value
,
this
.
dataValue
)
if
(
this
.
focus
!==
undefined
)
{
if
(
this
.
focus
!==
undefined
)
{
this
.
$emit
(
'on-result-change'
,
'focus'
,
''
,
this
.
dataHandObj
)
this
.
$emit
(
'on-result-change'
,
'focus'
,
''
,
this
.
dataHandObj
)
}
}
...
...
components/user-info/SelMultiGroup.vue
0 → 100644
View file @
a7904402
<
template
>
<div>
<el-select
v-model=
"groupIds"
@
change=
"_selMultiUser"
multiple
size=
"small"
style=
"width:100%"
placeholder=
"请选择检测科室,可多选"
>
<el-option
v-for=
"item in groupData"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</div>
</
template
>
<
script
>
/* 选择科室(或叫用户编组),默认展示20条数据(多选) */
export
default
{
props
:
{
isGroupName
:
null
// 是否显示名称
},
data
()
{
return
{
groupData
:
[],
groupIds
:
[]
}
},
mounted
()
{
// this._page()
},
methods
:
{
_open
(
groupIds
)
{
if
(
groupIds
)
{
this
.
groupIds
=
groupIds
}
else
{
this
.
groupIds
=
[]
}
},
// 科室下的人员
_page
()
{
this
.
$store
.
dispatch
(
'LmsUserGroup/list'
).
then
(()
=>
{
this
.
groupData
=
this
.
$store
.
state
.
LmsUserGroup
.
list
})
},
_selMultiUser
()
{
if
(
this
.
isGroupName
!==
undefined
)
{
// isGroupName 有值,需要显示name
const
ids
=
this
.
groupIds
const
groupNames
=
[]
for
(
let
i
=
0
;
i
<
ids
.
length
;
i
++
)
{
groupNames
.
push
(
this
.
groupData
.
find
(
item
=>
{
return
item
.
id
===
ids
[
i
]
})
)
}
this
.
$emit
(
'on-result-change'
,
groupNames
)
}
else
{
this
.
$emit
(
'on-result-change'
,
this
.
groupIds
)
}
}
}
}
</
script
>
components/user-info/SelMultiUserGroup.vue
0 → 100644
View file @
a7904402
<
template
>
<div>
<el-select
v-model=
"testerIds"
@
change=
"_selMultiUser"
:filter-method=
"_queryChangeMethod"
multiple
size=
"small"
filterable
placeholder=
"请选择人员,可多选"
style=
"width: 100%;"
>
<el-option
v-for=
"item in userList"
:key=
"item.userId"
:label=
"item.realname"
:value=
"item.userId"
>
</el-option>
</el-select>
</div>
</
template
>
<
script
>
/* (1)查询科室下的所有人,默认展示20条数据
(2)根据科室(多个科室)选择科室下面的人(有参数 isGroupIds)
用这个组件人员需要跟科室有关
* */
export
default
{
props
:
{
isGroupIds
:
null
// 是否显示某几个科室下的人员
},
data
()
{
return
{
userList
:
[],
testerIds
:
[],
keyword
:
''
,
groupIds
:
[]
}
},
methods
:
{
// 所有科室下的人员
_open
(
data
)
{
this
.
keyword
=
''
// 清空搜索字
if
(
data
)
{
this
.
testerIds
=
data
}
else
{
this
.
testerIds
=
[]
}
this
.
_page
()
},
// 查询某几个科室下的人员(多个科室)
_openUserByGroup
(
ids
,
testerIds
)
{
this
.
groupIds
=
ids
this
.
testerIds
=
testerIds
||
[]
this
.
keyword
=
''
// 清空搜索字
this
.
_pageByGroup
()
},
_pageByGroup
()
{
this
.
$store
.
dispatch
(
'LmsUserGroup/getUserByGroupIds'
,
this
.
_searchParams
())
.
then
(()
=>
{
this
.
userList
=
this
.
$store
.
state
.
LmsUserGroup
.
userPage
.
records
})
},
// 科室下的人员
_page
()
{
this
.
$store
.
dispatch
(
'LmsMarshalManage/userPage'
,
this
.
_searchParams
())
.
then
(()
=>
{
this
.
userList
=
this
.
$store
.
state
.
LmsMarshalManage
.
userPage
.
records
})
},
_searchParams
()
{
const
data
=
{
page
:
1
,
rows
:
20
}
if
(
this
.
keyword
)
{
data
.
realname
=
this
.
keyword
}
if
(
this
.
isGroupIds
!==
undefined
)
{
data
.
groupIds
=
this
.
groupIds
?
this
.
groupIds
.
join
(
','
)
:
''
}
// 这个查询条件是为了将某个人设置为第一个
if
(
this
.
testerIds
&&
this
.
testerIds
.
length
>
0
)
{
data
.
userId
=
this
.
testerIds
[
0
]
}
return
data
},
_queryChangeMethod
(
query
)
{
this
.
keyword
=
query
if
(
this
.
isGroupIds
!==
undefined
)
{
this
.
_pageByGroup
()
}
else
{
this
.
_page
()
}
},
_selMultiUser
()
{
if
(
this
.
testerIds
.
length
===
0
)
{
this
.
keyword
=
''
if
(
this
.
isGroupIds
!==
undefined
)
{
this
.
_pageByGroup
()
}
else
{
this
.
_page
()
}
}
this
.
$emit
(
'on-result-change'
,
this
.
testerIds
)
}
}
}
</
script
>
pages/meter-statistics/personal-task/Detail.vue
0 → 100644
View file @
a7904402
<
template
>
<div>
<Modal
v-model=
"showModal"
width=
"1200"
class=
"modal-footer-none"
>
<p
slot=
"header"
>
详情
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col
span=
"24"
>
<Form
id=
"search-personal-detail"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
style=
"width:32%"
label=
"录入时间:"
>
<Date-picker
:editable=
"false"
@
on-change=
"_dateChange"
v-model=
"dateList"
type=
"daterange"
placeholder=
"录入时间"
format=
"yyyy-MM-dd"
style=
"width:100%"
></Date-picker>
<input
v-model=
"formObj.testDateBegin"
type=
"hidden"
name=
"testDateBegin"
>
<input
v-model=
"formObj.testDateEnd"
type=
"hidden"
name=
"testDateEnd"
>
<input
v-model=
"groupIds"
type=
"hidden"
name=
"groupIds"
>
<input
v-model=
"testerIds"
type=
"hidden"
name=
"testerIds"
>
</Form-item>
<Form-item
style=
"width:32%"
label=
"检测科室:"
>
<SelMultiGroup
ref=
"groupModal"
@
on-result-change=
"_groupResult"
></SelMultiGroup>
</Form-item>
<Form-item
style=
"width:32%"
label=
"检测人:"
>
<!--显示某几个科室下的人员 isGroupIds为标识-->
<SelMultiUserGroup
ref=
"userModal"
@
on-result-change=
"_userResult"
is-group-ids
></SelMultiUserGroup>
</Form-item>
<Form-item
style=
"width:32%"
label=
"检测项目:"
>
<Input
v-model=
"formObj.name"
@
on-enter=
"_formSearch"
name=
"name"
placeholder=
"请输入检测项目"
clearable
/>
</Form-item>
<Form-item
style=
"width:32%"
label=
"检测依据:"
>
<Input
v-model=
"formObj.testBasis"
@
on-enter=
"_formSearch"
name=
"testBasis"
placeholder=
"请输入检测依据"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
@
on-result-change=
"_btnClick"
class=
"contHide"
></btn-list>
</Col>
<Col
span=
"24"
>
<PTVXETable
id=
"groupStatisticTable"
ref=
"pageTable"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
select-data
>
<vxe-table-column
v-for=
"item in pageColumns"
:key=
"item.key"
:field=
"item.key"
:title=
"item.title"
:width=
"item.width"
:min-width=
"200"
:fixed=
"item.fixed?item.fixed:undefined"
sortable
>
<template
slot-scope=
"scope"
>
<span
v-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
"yyyy-mm-dd"
):
''
}}
</span>
<span
v-else-if=
"item.status"
>
{{
scope
.
row
[
item
.
key
]?
scope
.
row
[
item
.
key
].
display
:
''
}}
</span>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</
template
>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</Modal>
</div>
</template>
<
script
>
/* 个人检测量统计------项目查看项目详情 */
import
SelMultiUserGroup
from
'../../../components/user-info/SelMultiUserGroup'
import
SelMultiGroup
from
'../../../components/user-info/SelMultiGroup'
export
default
{
components
:
{
SelMultiUserGroup
,
SelMultiGroup
},
data
()
{
return
{
btn
:
[{
type
:
''
,
id
:
''
,
name
:
'导出'
}],
showModal
:
false
,
selectData
:
[],
getPage
:
{},
pageColumns
:
[
{
title
:
'样品编号'
,
key
:
'num'
,
width
:
180
,
fixed
:
'left'
},
{
title
:
'样品名称'
,
key
:
'sampleName'
,
width
:
180
},
{
title
:
'检测项目'
,
key
:
'name'
,
width
:
120
},
{
title
:
'检测值'
,
key
:
'testValue'
,
width
:
140
},
{
title
:
'单位'
,
key
:
'unit'
,
width
:
100
},
{
title
:
'结果判定'
,
key
:
'qualified'
,
width
:
100
,
status
:
true
},
{
title
:
'单项结论'
,
key
:
'singleConclusion'
,
width
:
100
},
{
title
:
'复测值'
,
key
:
'retestValue'
,
width
:
100
},
{
title
:
'检出类别'
,
key
:
'detectionType'
,
width
:
100
},
{
title
:
'检出限'
,
key
:
'detection'
,
width
:
100
},
{
title
:
'检测依据'
,
key
:
'testBasis'
,
width
:
200
},
{
title
:
'检测依据名称'
,
key
:
'testBasisName'
,
width
:
200
},
{
title
:
'检测方法'
,
key
:
'testMethod'
,
width
:
200
},
{
title
:
'判定依据'
,
key
:
'judgeBasis'
,
width
:
200
},
{
title
:
'判定依据名称'
,
key
:
'judgeBasisName'
,
width
:
200
},
{
title
:
'限量'
,
key
:
'limitDefault'
,
width
:
100
},
{
title
:
'检测科室'
,
key
:
'groupName'
,
width
:
100
},
{
title
:
'检测人'
,
key
:
'tester'
,
width
:
100
},
{
title
:
'录入时间'
,
key
:
'testDate'
,
width
:
120
,
date
:
true
}
],
dateList
:
[],
formObj
:
{
name
:
''
,
testDateBegin
:
''
,
testDateEnd
:
''
,
testBasis
:
''
},
groupIds
:
[],
testerIds
:
[]
}
},
computed
:
{
tableHeight
:
function
()
{
return
this
.
$tableHeight
(
'tableModal'
)
}
},
methods
:
{
// 选择科室返回
_groupResult
(
data
)
{
this
.
groupIds
=
data
// 查询科室下的人员
if
(
data
.
length
===
0
)
{
this
.
testerIds
=
[]
}
this
.
$refs
.
userModal
.
_openUserByGroup
(
data
)
},
// 选择人员返回
_userResult
(
data
)
{
this
.
testerIds
=
data
},
_dateChange
(
data
)
{
this
.
formObj
.
testDateBegin
=
data
[
0
]
this
.
formObj
.
testDateEnd
=
data
[
1
]
},
_open
(
formObj
)
{
// 显示科室信息
this
.
groupIds
=
formObj
.
groupIds
this
.
$refs
.
groupModal
.
_open
(
this
.
groupIds
)
// 显示人员信息
this
.
testerIds
=
formObj
.
testerIds
this
.
$refs
.
userModal
.
_openUserByGroup
(
this
.
groupIds
,
this
.
testerIds
)
this
.
selectData
=
[]
this
.
formObj
=
this
.
$resetFields
(
this
.
formObj
)
/** ***********时间处理*********/
const
beginDate
=
formObj
.
beginDate
?
formObj
.
beginDate
+
'-01'
:
''
const
endDate
=
formObj
.
endDate
?
formObj
.
endDate
.
split
(
'-'
)
:
''
this
.
formObj
.
testDateBegin
=
beginDate
||
''
this
.
formObj
.
testDateEnd
=
formObj
.
endDate
?
formObj
.
endDate
+
'-'
+
this
.
$getLastDay
(
endDate
[
0
],
endDate
[
1
])
:
''
if
(
formObj
.
beginDate
)
{
this
.
dateList
=
[
new
Date
(
this
.
formObj
.
testDateBegin
),
new
Date
(
this
.
formObj
.
testDateEnd
)
]
}
else
{
this
.
dateList
=
[]
}
/** ***********时间处理*********/
this
.
showModal
=
true
this
.
$nextTick
(
function
()
{
// this._page()
})
},
_page
()
{
this
.
$refs
.
pageTable
.
_page
(
'search-personal-detail'
,
'FoodItem/yearTestDetail'
,
this
.
$serializeFormSearch
(
this
.
formObj
)
)
},
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
FoodItem
.
page
break
case
'selectData'
:
this
.
selectData
=
data
break
case
'changeSize'
:
// this._page()
break
}
},
_btnClick
(
msg
)
{
switch
(
msg
)
{
case
'导出'
:
if
(
this
.
getPage
.
records
.
length
===
0
)
{
this
.
$Message
.
warning
(
'暂无数据,不可导出!'
)
}
else
{
this
.
_export
()
}
break
}
},
/** *********************************************导出*****************************************/
_export
()
{
if
(
this
.
selectData
.
length
===
0
)
{
// 导出全部数据
this
.
_exportOk
(
this
.
getPage
.
total
)
}
else
{
// 只导出选中的数据
this
.
_exportOk
(
this
.
selectData
.
length
)
}
},
_exportOk
(
length
)
{
this
.
$Message
.
destroy
()
this
.
$Modal
.
confirm
({
title
:
'提示'
,
content
:
'确定导出这'
+
length
+
'条数据?'
,
onOk
:
()
=>
{
if
(
this
.
selectData
.
length
>
0
)
{
this
.
$exportExcel
(
'groupStatisticTable'
,
'项目统计信息'
,
this
.
pageColumns
,
this
.
selectData
)
}
else
{
this
.
$Message
.
loading
({
content
:
'正在处理,请稍后...'
,
duration
:
0
})
this
.
$store
.
dispatch
(
'EnvItem/yearTestDetail'
,
this
.
_searchParams
())
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
EnvItem
.
page
.
records
this
.
$exportExcel
(
'groupStatisticTable'
,
'项目统计信息'
,
this
.
pageColumns
,
result
)
})
}
}
})
},
// 参数
_searchParams
()
{
const
data
=
this
.
$serialize
(
'search-personal-detail'
)
Object
.
assign
(
data
,
this
.
formObj
)
return
this
.
$extend
(
data
,
{
page
:
1
,
rows
:
this
.
$exportRows
()
})
}
/** *********************************************导出*****************************************/
}
}
</
script
>
pages/meter-statistics/personal-task/MeterPersonalTask.vue
View file @
a7904402
<
template
>
<
template
>
<div>
<div>
<!--内容-->
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-padding"
>
<div
class=
"layout-content-main"
>
<div
class=
"layout-content-main"
>
<Row>
<Row
style=
"margin-top: 10px;"
>
<!--查询-->
<!--查询条件-->
<Col
span=
"24"
style=
"margin-top:10px"
>
<Form
:d=
"formId"
:label-width=
"90"
v-show=
"searchOpen"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"检定依据:"
style=
"margin-left: -20px"
>
<Input
@
on-enter=
"_formSearch"
v-model=
"formObj.code"
name=
"judgeBasis"
placeholder=
"请输入判定依据"
clearable
/>
</Form-item>
<Form-item
class=
"search-item"
label=
"检定依据名称:"
>
<Input
@
on-enter=
"_formSearch"
v-model=
"formObj.name"
name=
"judgeBasisName"
placeholder=
"请输入判定依据名称"
clearable
/>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_formSearch"
type=
"primary"
>
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col
span=
"24"
>
<Col
span=
"24"
>
<btn-list
:msg=
"btn"
:open=
"searchOpen"
:showSearchBtn=
"true"
@
on-result-change=
"_btnClick"
<div
class=
"fl"
>
class=
"contHide"
></btn-list>
<Form
id=
"search-form"
:label-width=
"70"
inline
onsubmit=
"return false"
>
<label
class=
"label-sign"
></label>
<Form-item
class=
"search-item"
label=
"检测科室:"
>
<Select
v-model=
"groupId"
@
on-change=
"_groupChange"
placeholder=
"请选择检测科室"
clearable
label-in-value
>
<Option
v-for=
"item in groupData"
:value=
"item.id"
:key=
"item.id"
>
{{
item
.
name
}}
</Option>
</Select>
</Form-item>
<Form-item
class=
"search-item"
label=
"人员:"
>
<AutoCompletes
:value=
"tester"
:blur=
"true"
:downData=
"testerData"
@
on-result-change=
"_testerChange"
show-key=
"realname"
placeholder=
"请选择人员"
></AutoCompletes>
</Form-item>
<Form-item
class=
"search-item"
label=
"服务类型:"
>
<Select
v-model=
"serviceType"
placeholder=
"请选择服务类型"
clearable
>
<Option
v-for=
"item in serviceTypeList"
:value=
"item.name"
:key=
"item.name"
>
{{
item
.
name
}}
</Option>
</Select>
</Form-item>
<Form-item
label=
"检测日期:"
>
<el-date-picker
v-model=
"queryDate"
@
change=
"_dateChange"
type=
"monthrange"
range-separator=
"-"
start-placeholder=
"开始月份"
end-placeholder=
"结束月份"
size=
"small"
value-format=
"yyyy-MM"
>
</el-date-picker>
</Form-item>
<Form-item
class=
"search-btn"
>
<Button
@
click=
"_search"
type=
"primary"
class=
"width-80"
>
搜索
</Button>
</Form-item>
</Form>
</div>
<div
class=
"fr"
>
<Button
@
click=
"_exportSampleForm"
class=
"width-80"
>
导出
</Button>
</div>
<div
class=
"clear"
></div>
</Col>
</Col>
<!--
表格
-->
<!--
内容
-->
<Col
span=
"24"
>
<Col
span=
"24"
>
<PTVXETable
<Row
:gutter=
"16"
>
ref=
"pageTable"
<Col
span=
"14"
>
:form-id=
"formId"
<PTVXETable
id=
"personalTestNum"
ref=
"pageTable"
:tableHeight=
"tableHeight"
:pageColumns=
"pageColumns"
:getPage=
"getPage"
:tableHeight=
"tableHeight"
@
on-result-change=
"_tableResultChange"
:getPage=
"getPage"
hide-checkbox
>
:iconMsg=
"iconMsg"
<vxe-table-column
@
on-result-change=
"_tableResultChange"
>
:field=
"item.key"
<vxe-table-column
:title=
"item.title"
v-for=
"item in pageColumns"
:min-width=
"item.width?item.width:200"
:key=
"item.key"
:fixed=
"item.fixed?item.fixed:undefined"
:field=
"item.key"
v-for=
"item in pageColumns"
:title=
"item.title"
:key=
"item.key"
sortable
>
:width=
"item.width"
<template
slot-scope=
"scope"
>
:min-width=
"200"
<span
v-if=
"item.detail"
><a
:fixed=
"item.fixed?item.fixed:undefined"
@
click
.
stop=
"_detailModal(scope.row)"
>
{{
scope
.
row
[
item
.
key
]
}}
</a></span>
sortable
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
>
</
template
>
<template
slot-scope=
"scope"
>
</vxe-table-column>
<span
v-if=
"item.date"
>
{{
scope
.
row
[
item
.
key
]?
$dateformat
(
scope
.
row
[
item
.
key
],
'yyyy-mm-dd'
):
''
}}
</span>
</PTVXETable>
<span
v-else
>
{{
scope
.
row
[
item
.
key
]
}}
</span>
</Col>
</
template
>
<Col
span=
"10"
>
</vxe-table-column>
<!--pie-->
</PTVXETable>
<UserTestPie
ref=
"testPieModal"
></UserTestPie>
</Col>
</Row>
</Col>
</Col>
</Row>
</Row>
</div>
</div>
</div>
</div>
<!--检测项目详情-->
<Detail
ref=
"detailModal"
></Detail>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
meterAptitude
}
from
'../../../api'
import
AutoCompletes
from
'../../../components/base/AutoCompletes'
import
UserTestPie
from
'./UserTestPie'
import
Detail
from
'./Detail'
export
default
{
export
default
{
name
:
'MeterAptitudeStandard'
,
components
:
{
components
:
{},
UserTestPie
,
AutoCompletes
,
Detail
},
data
()
{
data
()
{
const
date
=
this
.
$dateformat
(
new
Date
(),
'yyyy-mm'
)
return
{
return
{
formId
:
'meterAptitudeFormId'
,
beginDate
:
new
Date
(),
endDate
:
new
Date
(),
groupId
:
''
,
groupName
:
''
,
tester
:
''
,
testerId
:
''
,
pageColumns
:
[
pageColumns
:
[
{
title
:
'检定依据'
,
key
:
'code'
,
width
:
160
},
{
title
:
'姓名'
,
key
:
'tester'
,
detail
:
true
},
{
title
:
'检定依据名称'
,
key
:
'name'
},
{
title
:
'项目量'
,
key
:
'total'
},
{
title
:
'登记时间'
,
key
:
'ctime'
,
date
:
true
,
width
:
140
},
{
title
:
'项目占比(%)'
,
key
:
'ratio'
},
{
title
:
'备注'
,
key
:
'remark'
}
{
title
:
'项目总价'
,
key
:
'price'
,
width
:
205
}
],
btn
:
[
{
type
:
'success'
,
id
:
''
,
name
:
'添加'
},
{
type
:
'error'
,
id
:
''
,
name
:
'删除'
}
],
iconMsg
:
[
{
type
:
'md-create'
,
id
:
''
,
name
:
'编辑'
},
{
type
:
'md-trash'
,
id
:
''
,
name
:
'删除'
}
],
],
formObj
:
{
groupData
:
[],
name
:
undefined
,
code
:
undefined
},
searchOpen
:
true
,
selectIds
:
[],
getPage
:
{},
getPage
:
{},
typeData
:
[]
tempData
:
{
groupId
:
''
,
groupName
:
''
,
beginDate
:
date
,
endDate
:
date
},
testerData
:
[],
queryDate
:
[
date
,
date
],
serviceType
:
''
,
serviceTypeList
:
[]
}
}
},
},
computed
:
{
computed
:
{
tableHeight
:
function
()
{
tableHeight
:
function
()
{
if
(
this
.
searchOpen
)
{
return
this
.
$tableHeight
(
'search'
)
return
this
.
$tableHeight
(
'search'
)
}
else
{
return
this
.
$tableHeight
(
'noSearch'
)
}
}
}
},
},
mounted
()
{
mounted
()
{
this
.
_page
()
// this._contHide()
// this._getUserGroup()
// this._getUserList()
// this._getServiceTypeList()
},
},
methods
:
{
methods
:
{
_btnClick
(
msg
)
{
// 服务类型
switch
(
msg
)
{
_getServiceTypeList
()
{
case
'添加'
:
this
.
$store
.
dispatch
(
'LmsServiceType/list'
).
then
(()
=>
{
this
.
_editModal
(
false
)
this
.
serviceTypeList
=
this
.
$store
.
state
.
LmsServiceType
.
list
break
})
case
'删除'
:
},
this
.
_deleteSelected
()
// 检测项目详情
break
_detailModal
(
data
)
{
case
'导入'
:
const
obj
=
{
this
.
_import
()
testerIds
:
[
data
.
testerId
],
break
groupIds
:
this
.
groupIds
,
case
'导出'
:
beginDate
:
this
.
tempData
.
beginDate
,
this
.
_export
()
endDate
:
this
.
tempData
.
endDate
break
case
'search'
:
this
.
searchOpen
=
!
this
.
searchOpen
break
}
}
console
.
log
(
obj
)
// this.$refs.detailModal._open(obj)
},
},
_iconClick
(
res
,
data
)
{
_dateChange
(
data
)
{
switch
(
res
)
{
if
(
data
)
{
case
'编辑'
:
this
.
tempData
.
beginDate
=
data
[
0
]
this
.
_editModal
(
true
,
data
.
id
)
this
.
tempData
.
endDate
=
data
[
1
]
break
}
else
{
case
'删除'
:
this
.
tempData
.
beginDate
=
''
this
.
_deleteById
(
data
.
id
)
this
.
tempData
.
endDate
=
''
break
case
'操作日志'
:
this
.
_record
(
data
.
id
)
break
}
}
},
},
_page
:
async
function
()
{
_contHide
()
{
console
.
log
(
9522123
)
this
.
tempData
.
beginDate
=
this
.
$dateformat
(
new
Date
(),
'yyyy-mm'
)
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
this
.
tempData
.
endDate
=
this
.
$dateformat
(
new
Date
(),
'yyyy-mm'
)
Object
.
assign
(
this
.
formObj
,
this
.
$refs
.
pageTable
.
_searchParams
())
// this._page()
console
.
log
(
'this.formObj'
,
this
.
formObj
)
// this._getById()
const
result
=
await
meterAptitude
.
page
(
this
.
formObj
)
},
if
(
result
)
{
_getById
()
{
console
.
log
(
55555
)
this
.
$store
console
.
log
(
result
)
.
dispatch
(
'FoodItem/getMostTaskId'
,
{
this
.
getPage
=
result
beginDate
:
this
.
tempData
.
beginDate
,
console
.
log
(
123456789
)
endDate
:
this
.
tempData
.
endDate
console
.
log
(
this
.
getPage
)
})
this
.
$refs
.
pageTable
.
_hideLoading
()
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
FoodItem
.
list
this
.
tempData
.
groupId
=
result
.
groupId
this
.
tempData
.
groupName
=
result
.
groupName
this
.
$refs
.
testPieModal
.
_openPie
(
this
.
tempData
)
})
},
_page
()
{
const
data
=
{}
if
(
this
.
groupId
)
{
data
.
groupId
=
this
.
groupId
}
}
if
(
this
.
tester
&&
this
.
testerId
)
{
data
.
testerId
=
this
.
testerId
}
else
{
this
.
testerId
=
''
}
if
(
this
.
tempData
.
beginDate
)
{
data
.
beginDate
=
this
.
tempData
.
beginDate
}
if
(
this
.
tempData
.
endDate
)
{
data
.
endDate
=
this
.
tempData
.
endDate
}
if
(
this
.
serviceType
)
{
data
.
serviceType
=
this
.
serviceType
}
this
.
$refs
.
pageTable
.
_page
(
'search-form'
,
'FoodItem/pagePersonalTask'
,
data
)
},
},
_formSearch
()
{
_formSearch
()
{
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
this
.
$refs
.
pageTable
.
_pageChange
(
1
)
},
},
_search
()
{
this
.
tempData
.
groupId
=
this
.
groupId
this
.
tempData
.
groupName
=
this
.
groupId
?
this
.
groupName
:
''
this
.
tempData
.
serviceType
=
this
.
serviceType
?
this
.
serviceType
:
''
this
.
$refs
.
testPieModal
.
_openPie
(
this
.
tempData
)
this
.
_formSearch
()
},
_tableResultChange
(
msg
,
data
)
{
_tableResultChange
(
msg
,
data
)
{
switch
(
msg
)
{
switch
(
msg
)
{
case
'page'
:
case
'page'
:
this
.
getPage
=
this
.
$store
.
state
.
FoodJudgeBasis
.
page
this
.
getPage
=
this
.
$store
.
state
.
FoodItem
.
page
break
case
'selectIds'
:
this
.
selectIds
=
data
break
case
'iconClick'
:
this
.
_iconClick
(
data
.
name
,
data
.
rowData
)
break
break
case
'changeSize'
:
case
'changeSize'
:
this
.
_page
()
//
this._page()
break
break
}
}
},
},
// 删除
/** *********************************导出-begin*********************************************/
_deleteByIds
(
ids
,
content
)
{
_exportSampleForm
()
{
this
.
$Modal
.
confirm
({
let
result
=
[]
title
:
'提示'
,
this
.
$store
content
:
content
||
'确定删除该记录?'
,
.
dispatch
(
'FoodItem/pagePersonalTask'
,
this
.
_searchParams
())
onOk
:
()
=>
{
.
then
(()
=>
{
this
.
_delete
(
ids
)
result
=
this
.
$store
.
state
.
FoodItem
.
page
.
records
}
this
.
$Modal
.
confirm
({
})
title
:
'提示'
,
content
:
'确定导出全部数据?'
,
onOk
:
()
=>
{
this
.
$exportExcel
(
'personalTestNum'
,
'个人检测量统计表'
,
this
.
pageColumns
,
result
)
}
})
})
},
},
_delete
:
async
function
(
ids
)
{
// 参数
const
result
=
await
meterAptitude
.
deleteById
(
ids
)
_searchParams
()
{
if
(
result
)
{
const
data
=
{}
this
.
_formSearch
()
if
(
this
.
groupId
)
{
this
.
$Message
.
success
(
'删除成功!'
)
data
.
groupId
=
this
.
groupId
}
}
},
if
(
this
.
tester
&&
this
.
testerId
)
{
_deleteById
(
id
)
{
data
.
testerId
=
this
.
testerId
// 删除一条记录
this
.
_deleteByIds
([
id
])
},
_deleteSelected
()
{
// 批量删除
const
ids
=
this
.
selectIds
if
(
ids
.
length
===
0
)
{
this
.
$Message
.
warning
(
'请选择一条或多条数据!'
)
}
else
{
}
else
{
this
.
_deleteByIds
(
ids
,
'确定删除这 '
+
ids
.
length
+
' 条记录?'
)
this
.
testerId
=
''
}
}
},
if
(
this
.
tempData
.
beginDate
)
{
// 编辑&添加
data
.
beginDate
=
this
.
tempData
.
beginDate
_editModal
(
edit
,
id
)
{
}
if
(
edit
)
{
if
(
this
.
tempData
.
endDate
)
{
this
.
_getById
(
id
)
data
.
endDate
=
this
.
tempData
.
endDate
// 编辑
// this.$store.dispatch('FoodJudgeBasis/getById', id).then(() => {
// this.$refs.editModal._open(this.$store.state.FoodJudgeBasis.model)
// })
}
else
{
// 添加
this
.
$refs
.
editModal
.
_open
()
}
}
return
this
.
$extend
(
data
,
{
page
:
1
,
rows
:
5000
})
},
},
/** *********************************导出样品台账-end*********************************************/
_getById
:
async
function
(
id
)
{
_getUserGroup
()
{
const
result
=
await
meterAptitude
.
getById
(
id
)
this
.
$store
.
dispatch
(
'LmsUserGroup/list'
).
then
(()
=>
{
if
(
result
)
{
this
.
groupData
=
this
.
$store
.
state
.
LmsUserGroup
.
list
this
.
$refs
.
editModal
.
_open
(
result
)
})
},
// 主检人&检测科室
_groupChange
(
data
)
{
if
(
data
)
{
this
.
groupName
=
data
.
label
this
.
groupId
=
data
.
value
this
.
testerId
=
''
this
.
tester
=
''
this
.
_getUserList
(
data
.
value
)
}
}
},
},
// 导入
_getUserList
(
groupId
,
realname
)
{
_import
()
{
const
data
=
{
page
:
1
,
rows
:
50
}
const
data
=
{
if
(
groupId
)
{
importUrl
:
Object
.
assign
(
data
,
{
groupId
:
groupId
})
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_import'
,
}
downloadUrl
:
'/food/v1/excel/template/FoodAptitudeJudgeBasis'
,
if
(
realname
)
{
title
:
'导入检验方法管理'
Object
.
assign
(
data
,
{
realname
:
realname
})
}
}
this
.
$refs
.
sampleModal
.
_open
(
data
)
this
.
$store
.
dispatch
(
'LmsUserGroup/getUserByGroupId'
,
data
).
then
(()
=>
{
this
.
testerData
=
this
.
$store
.
state
.
LmsUserGroup
.
userPage
.
records
})
},
},
// 导出
_testerChange
(
msg
,
data
)
{
_export
()
{
switch
(
msg
)
{
console
.
log
(
'.this.selectIds'
,
this
.
selectIds
)
case
'select'
:
if
(
this
.
selectIds
.
length
===
0
)
{
this
.
tester
=
data
.
realname
this
.
$Message
.
warning
(
'请选择需要导出的数据'
)
this
.
testerId
=
data
.
userId
}
else
{
break
const
content
=
'确定导出 '
+
this
.
selectIds
.
length
+
' 条记录?'
case
'blur'
:
this
.
$Modal
.
confirm
({
this
.
tester
=
''
title
:
'提示'
,
break
content
:
content
,
case
'query'
:
onOk
:
()
=>
{
this
.
tester
=
data
.
realname
// eslint-disable-next-line no-undef
this
.
_getUserList
(
''
,
data
.
realname
)
http
.
open
(
break
'/food/v1/food_aptitude_judge_basis/food_aptitude_judge_export?ids='
+
this
.
selectIds
)
}
})
}
}
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
</
style
>
pages/meter-statistics/personal-task/UserTestPie.vue
0 → 100644
View file @
a7904402
<
template
>
<div
class=
"border-chart-color"
>
<div
class=
"chartTitle"
>
<label>
{{
groupName
}}
科室员工工作量比率
</label>
</div>
<div
:style=
"heightObj"
class=
"chartCont"
>
<div
v-if=
"showStatistic"
style=
"width:90%"
>
<IEcharts
:option=
"option"
:style=
"optionObj"
></IEcharts>
</div>
<div
v-else
:style=
"noDataObj"
class=
"no-statistic-bg"
></div>
</div>
<form
id=
"persontal-task-pie"
>
<input
name=
"groupId"
type=
"hidden"
/>
<input
name=
"beginDate"
type=
"hidden"
/>
<input
name=
"endDate"
type=
"hidden"
/>
<input
name=
"groupName"
type=
"hidden"
/>
<input
name=
"serviceType"
type=
"hidden"
/>
</form>
</div>
</
template
>
<
script
>
// import IEcharts from 'vue-echarts-v3/src/full'
export
default
{
// components: { IEcharts },
data
()
{
return
{
// 科室名称
groupName
:
''
,
showStatistic
:
true
,
heightObj
:
{
height
:
'300px'
},
option
:
{
title
:
{
x
:
'center'
,
textStyle
:
{
fontSize
:
14
,
fontWeight
:
'normal'
}
},
tooltip
:
{
trigger
:
'item'
,
formatter
:
function
(
a
)
{
return
(
a
.
name
+
'</br>检测项目: '
+
a
.
data
.
total
+
'<br>占比: '
+
a
.
percent
+
'%'
)
}
},
legend
:
{
type
:
'scroll'
,
orient
:
'vertical'
,
right
:
0
,
top
:
20
,
bottom
:
20
,
data
:
[]
},
color
:
this
.
$echartColor
,
series
:
[
{
name
:
'访问来源'
,
type
:
'pie'
,
radius
:
[
'50%'
,
'70%'
],
avoidLabelOverlap
:
false
,
label
:
{
show
:
false
,
position
:
'center'
},
emphasis
:
{
label
:
{
show
:
true
,
fontSize
:
'30'
,
fontWeight
:
'bold'
}
},
labelLine
:
{
show
:
false
},
data
:
[
{
value
:
335
,
name
:
'直接访问'
},
{
value
:
310
,
name
:
'邮件营销'
},
{
value
:
234
,
name
:
'联盟广告'
},
{
value
:
135
,
name
:
'视频广告'
},
{
value
:
1548
,
name
:
'搜索引擎'
}
]
}
]
},
optionObj
:
{
height
:
''
},
noDataObj
:
{
marginTop
:
''
}
}
},
mounted
()
{
this
.
_contHide
()
},
methods
:
{
_contHide
()
{
this
.
optionObj
.
height
=
document
.
documentElement
.
clientHeight
-
300
+
'px'
this
.
heightObj
.
height
=
document
.
documentElement
.
clientHeight
-
272
+
'px'
this
.
noDataObj
.
marginTop
=
(
document
.
documentElement
.
clientHeight
-
450
)
/
2
+
'px'
this
.
optionObj
.
width
=
(
document
.
documentElement
.
clientWidth
-
200
)
/
2.6
+
'px'
},
_openPie
(
data
)
{
this
.
showStatistic
=
false
$
(
'input[name=groupId]'
).
val
(
data
.
groupId
)
$
(
'input[name=beginDate]'
).
val
(
data
.
beginDate
)
$
(
'input[name=endDate]'
).
val
(
data
.
endDate
)
$
(
'input[name=serviceType]'
).
val
(
data
.
serviceType
)
this
.
groupName
=
data
.
groupName
if
(
data
.
groupName
)
{
this
.
_getTask
()
}
else
{
this
.
option
.
title
.
text
=
'检测项目总量(个):'
+
0
this
.
option
.
legend
.
data
=
[]
this
.
option
.
series
[
0
].
data
=
[]
}
},
_getTask
()
{
const
testerList
=
[]
const
seriesList
=
[]
let
total
=
0
this
.
$store
.
dispatch
(
'FoodItem/pagePersonalTaskPie'
,
this
.
_searchParams
())
.
then
(()
=>
{
const
result
=
this
.
$store
.
state
.
FoodItem
.
list
if
(
result
!==
undefined
)
{
for
(
let
i
=
0
;
i
<
result
.
length
;
i
++
)
{
testerList
.
push
(
result
[
i
].
tester
)
total
=
total
+
result
[
i
].
total
seriesList
.
push
({
value
:
result
[
i
].
total
,
name
:
result
[
i
].
tester
,
total
:
result
[
i
].
total
,
ratio
:
result
[
i
].
ratio
})
}
if
(
testerList
.
length
===
0
)
{
this
.
showStatistic
=
false
}
else
{
this
.
showStatistic
=
true
}
}
this
.
option
.
title
.
text
=
'检测项目总量(个):'
+
total
this
.
option
.
legend
.
data
=
testerList
this
.
option
.
series
[
0
].
data
=
seriesList
})
},
_searchParams
()
{
const
data
=
this
.
$serialize
(
'persontal-task-pie'
)
return
this
.
$extend
(
data
)
}
}
}
</
script
>
plugins/common.js
View file @
a7904402
...
@@ -8,6 +8,36 @@ import FileSaver from 'file-saver'
...
@@ -8,6 +8,36 @@ import FileSaver from 'file-saver'
import
XLSX
from
'xlsx'
import
XLSX
from
'xlsx'
import
global
from
'../api/config'
import
global
from
'../api/config'
/**
/**
*echart颜色
*
*/
Vue
.
prototype
.
$echartColor
=
[
'#00a0e9'
,
'#CD5555'
,
'#fa8e19'
,
'#fad819'
,
'#ff7f50'
,
'#87cefa'
,
'#da70d6'
,
'#32cd32'
,
'#6495ed'
,
'#ff69b4'
,
'#ba55d3'
,
'#cd5c5c'
,
'#ffa500'
,
'#40e0d0'
,
'#1e90ff'
,
'#ff6347'
,
'#7b68ee'
,
'#00fa9a'
,
'#ffd700'
,
'#6699FF'
,
'#ff6666'
,
'#3cb371'
,
'#b8860b'
,
'#30e0e0'
]
/**
* 字符串函数库
* 字符串函数库
* https://www.npmjs.com/package/string
* https://www.npmjs.com/package/string
*/
*/
...
...
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