Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NLT-e-cigarette
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
张伯涛
NLT-e-cigarette
Commits
42e8dc97
Commit
42e8dc97
authored
Mar 10, 2023
by
杨硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消产出统计需要时间的校验
parent
c7104966
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
578 additions
and
88 deletions
+578
-88
produceStatistics.vue
src/views/productionStatis/produceStatistics.vue
+578
-88
No files found.
src/views/productionStatis/produceStatistics.vue
View file @
42e8dc97
<
template
>
<div
v-loading=
"echartsLoading"
class=
"RepairStatistics_module"
>
<div
v-loading=
"echartsLoading"
class=
"RepairStatistics_module"
>
<div
class=
"search"
>
<el-form
ref=
"queryForm"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
label-width=
"auto"
>
<el-form-item
label=
"计划开工时间"
>
<div
slot=
"label"
class=
"labelClass"
>
<div>
开始时间
</div>
<div>
Start time
</div>
</div>
<el-date-picker
v-model=
"queryParams.startDate"
:picker-options=
"choseType === 'day' ? start_date :choseType === 'week' ? week_date : choseType === 'month' ? month_date : start_date "
type=
"datetime"
placeholder=
"选择日期"
popper-class=
"date_picker"
:editable=
"false"
:clearable=
"false"
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
style=
"width: 220px"
:default-time=
"'07:00:00'"
@
change=
"changeTime"
/>
<span>
-
</span>
<el-date-picker
v-model=
"queryParams.endDate"
:picker-options=
"choseType === 'day' ? end_date :choseType === 'week' ? week_end :choseType === 'month' ? month_end : end_date"
type=
"datetime"
popper-class=
"date_picker"
placeholder=
"选择日期"
:editable=
"false"
:clearable=
"false"
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
style=
"width: 220px"
:default-time=
"'07:00:00'"
@
change=
"changeTime"
/>
</el-form-item>
<el-form
ref=
"queryForm"
:rules=
"queryRules"
style=
"padding: 0 0 0 10px"
:model=
"queryParams"
:inline=
"true"
label-width=
"auto"
>
<div>
<el-form-item
label=
"统计维度"
prop=
""
style=
""
>
<div
slot=
"label"
style=
"padding-top: 8px"
>
<div>
统计维度
</div>
</div>
<el-select
v-model=
"queryParams.status"
placeholder=
"请选择状态"
clearable
size=
"small"
@
change=
"changeChoseType"
>
<!--
<el-option
:value=
"btnList[0].dictValue "
label=
"日报"
/>
-->
<!--
<el-option
:value=
"'' "
label=
" "
/>
-->
<el-option
v-for=
"(dict,index) in btnList"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item
class=
"flotr"
>
<el-button
class=
"redBtn"
type=
"danger"
size=
"small"
@
click=
"handleQuery('queryForm')"
>
查询 Query
</el-button>
<el-button
class=
"resetBtn"
size=
"small"
@
click=
"resetQuery"
>
重置 Reset
</el-button>
</el-form-item>
</div>
<div>
<el-form-item
label=
"报修时间"
required
>
<div
slot=
"label"
class=
"labelClass;text-alleft"
style=
"position: relative;top: -16px;left: -12px"
>
<div>
需要时间
</div>
<div>
Need Time
</div>
</div>
<el-form-item
prop=
"startDate"
>
<el-date-picker
v-model=
"queryParams.startDate"
type=
"datetime"
placeholder=
"选择日期"
:editable=
"false"
:clearable=
"false"
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
popper-class=
"date_picker"
style=
"width: 220px"
:default-time=
"'00:00:00'"
@
change=
"changeTime"
/>
</el-form-item>
<span>
-
</span>
<el-form-item
prop=
"endDate"
>
<el-date-picker
v-model=
"queryParams.endDate"
type=
"datetime"
placeholder=
"选择日期"
:editable=
"false"
:clearable=
"false"
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
popper-class=
"date_picker"
style=
"width: 220px"
:default-time=
"'23:59:59'"
@
change=
"changeTime"
/>
</el-form-item>
<!--
<el-input
placeholder=
"请输入主机追溯号"
size=
"small"
/>
-->
</el-form-item>
</div>
<div>
<el-row
type=
""
>
<el-row
type=
"flex"
justify=
"space-around"
>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass;text-alleft"
style=
"width: 100px;text-align: right;"
>
<div>
项目
</div>
<div>
Family Desc
</div>
</div>
<el-select
v-model=
"queryParams.xmCode"
clearable
multiple
filterable
collapse-tags
style=
""
placeholder=
"请选择项目"
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"日报"
/>
-->
<el-option
v-for=
"(dict,index) in familyOptions"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass"
style=
"width: 70px;text-align: right;"
>
<div>
线体
</div>
<div>
Line No.
</div>
</div>
<el-select
v-model=
"queryParams.xtCode"
placeholder=
"请选择线体"
clearable
multiple
collapse-tags
filterable
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"全部"
/>
-->
<el-option
v-for=
"(dict,index) in lineOptions"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass"
style=
"width: 70px;text-align: right;"
>
<div>
班次
</div>
<div>
Shift
</div>
</div>
<el-select
v-model=
"queryParams.bcCode"
clearable
multiple
filterable
collapse-tags
style=
""
placeholder=
"请选择班次"
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"日报"
/>
-->
<el-option
v-for=
"(dict,index) in shiftOptions"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row
type=
"flex"
>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass"
style=
"width: 100px;text-align: right;"
>
<div>
装配工单
</div>
<div>
Device Order
</div>
</div>
<el-select
v-model=
"queryParams.zpgdCode"
clearable
multiple
filterable
collapse-tags
style=
""
placeholder=
"请选择装配工单"
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"日报"
/>
-->
<el-option
v-for=
"(dict,index) in workingOrderOptions"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass"
style=
"width: 100px;text-align: right;"
>
<div>
装配追溯号
</div>
<div>
Beach Line No.
</div>
</div>
<el-select
v-model=
"queryParams.lineBatchCode"
clearable
multiple
filterable
collapse-tags
style=
""
placeholder=
"请选择追溯号"
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"日报"
/>
-->
<el-option
v-for=
"(dict,index) in lineBatchFilterOptions"
:key=
"index"
:label=
"dict"
:value=
"dict"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
""
prop=
""
style=
"display:flex;"
>
<div
slot=
"label"
class=
"labelClass"
style=
"width: 70px;text-align: right;"
>
<div>
成品料号
</div>
<div>
Part No.
</div>
</div>
<el-select
v-model=
"queryParams.partNumCode"
clearable
multiple
filterable
collapse-tags
style=
""
placeholder=
"请选择成品料号"
size=
"small"
class=
"lmtags"
>
<!--
<el-option
:value=
" '' "
label=
"日报"
/>
-->
<el-option
v-for=
"(dict,index) in partNumOptions"
:key=
"index"
:label=
"dict.dictLabel"
:value=
"dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</div>
</el-form>
</div>
<el-divider
/>
<div
class=
"search_btn"
>
<el-button
<
!--
<
el-button
v-for=
"(item,index) in btnList"
:key=
"index"
class=
"setupBtn"
...
...
@@ -51,7 +257,7 @@
<div>
{{
item
.
dictLabel
}}
</div>
<div>
{{
item
.
dictLabelEnglish
}}
</div>
<img
v-if=
"choseType === item.dictValue"
:src=
"logo"
class=
"chose-icon"
>
</el-button>
</el-button>
-->
</div>
<div
class=
"homePageIndex-body"
>
<el-card
class=
"box-card"
>
...
...
@@ -176,8 +382,12 @@
<
script
>
import
moment
from
'moment'
import
*
as
echarts
from
'echarts'
import
{
getProDetails
,
produceStatisicsExport
}
from
'./apis'
import
{
getProDetails
,
produceStatisicsExport
,
getProDetailsJson
}
from
'./apis'
import
request
from
'@/utils/request'
import
{
forEach
}
from
'element-resize-detector/src/collection-utils'
import
{
getDicts
}
from
'@/api/system/dict/data'
import
{
listData
,
getData
,
delData
,
addData
,
updateData
,
exportData
,
checkDictLabelUnique
}
from
'@/api/system/dict/data'
import
{
listOrder
}
from
'@/api/workOrder'
export
default
{
name
:
'ProduceStatistics'
,
data
()
{
...
...
@@ -186,8 +396,24 @@ export default {
start_date
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
endDate
)
{
return
time
.
getTime
()
>
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
19
).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() > new Date(this.queryParams.endDate).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
start_date1
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
endDate
)
{
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
end_date1
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
startDate
)
{
return
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
-
1000
*
60
*
60
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
...
...
@@ -195,8 +421,10 @@ export default {
week_date
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
endDate
)
{
return
time
.
getTime
()
>
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() > new Date(this.queryParams.endDate).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
7
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
...
...
@@ -204,8 +432,10 @@ export default {
month_date
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
endDate
)
{
return
time
.
getTime
()
>
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
30
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() > new Date(this.queryParams.endDate).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
30
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
endDate
).
getTime
()
-
3600
*
1000
*
24
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
...
...
@@ -213,32 +443,49 @@ export default {
end_date
:
{
disabledDate
:
time
=>
{
if
(
this
.
queryParams
.
startDate
)
{
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
().
getTime
()
+
3600
*
1000
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() >= new Date(moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD')).getTime() ||
// time.getTime() >= new Date(moment(new Date(this.queryParams.startDate).getTime() + 3600 * 1000 * 24 * 20).format('YYYY-MM-DD')).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
+
3600
*
1000
*
24
*
19
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
-
1000
*
60
*
60
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
}
},
// 选周报时结束时间范围(20周内)
week_end
:
{
disabledDate
:
time
=>
{
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
().
getTime
()
+
3600
*
1000
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
7
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() >= new Date(moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD')).getTime() ||
// time.getTime() >= new Date(moment(new Date(this.queryParams.startDate).getTime() + 3600 * 1000 * 24 * 7 * 20).format('YYYY-MM-DD')).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
+
3600
*
1000
*
24
*
19
*
7
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
-
1000
*
60
*
60
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
},
// 选月报时结束时间范围(20月内)
month_end
:
{
disabledDate
:
time
=>
{
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
().
getTime
()
+
3600
*
1000
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
30
*
20
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
// return time.getTime() >= new Date(moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD')).getTime() ||
// time.getTime() >= new Date(moment(new Date(this.queryParams.startDate).getTime() + 3600 * 1000 * 24 * 30 * 20).format('YYYY-MM-DD')).getTime() ||
// time.getTime()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()).
format
(
'YYYY-MM-DD'
)).
getTime
()
return
time
.
getTime
()
>=
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
+
3600
*
1000
*
24
*
19
).
format
(
'YYYY-MM-DD'
)).
getTime
()
||
time
.
getTime
()
<
new
Date
(
moment
(
new
Date
(
this
.
queryParams
.
startDate
).
getTime
()
-
1000
*
60
*
60
*
24
).
format
(
'YYYY-MM-DD'
)).
getTime
()
}
},
// 搜索框数据
queryParams
:
{
startDate
:
moment
(
new
Date
().
setTime
(
new
Date
().
getTime
()
-
3600
*
1000
*
24
*
18
)).
format
(
'YYYY-MM-DD'
)
+
' 07:00:00'
,
endDate
:
moment
(
new
Date
().
getTime
()
+
3600
*
1000
*
24
).
format
(
'YYYY-MM-DD'
)
+
' 07:00:00'
// startDate: moment(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 18)).format('YYYY-MM-DD') + ' 07:00:00',
// endDate: moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD') + ' 07:00:00'
// startDate: moment(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 18)).format('YYYY-MM-DD') + ' 00:00:00',
// endDate: moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD') + ' 23:59:59',
startDate
:
''
,
endDate
:
''
,
xtCode
:
[],
// 线体号
xmCode
:
[],
// 项目
bcCode
:
[],
// 班次
zpgdCode
:
[],
// 装配工单
lineBatchCode
:
[],
// 追溯号
partNumCode
:
[]
// 成品料号
},
HistoricalInvestigation
:
[],
logo
:
require
(
'@/assets/image/btnChose.png'
),
...
...
@@ -257,13 +504,37 @@ export default {
// { dictLabel: '按PO号统计', dictValue: 'Po Number' },
{
dictLabel
:
'按项目统计'
,
dictLabelEnglish
:
'PO No.'
,
dictValue
:
'Project'
},
{
dictLabel
:
'按成品料号统计'
,
dictLabelEnglish
:
'Part Number'
,
dictValue
:
'PartNumber'
}
]
],
// 按项目下拉框
familyOptions
:
[],
// 线体下拉框
lineOptions
:
[],
// 班次下拉框
shiftOptions
:
[],
// 装配工单下拉框
workingOrderOptions
:
[],
// 装配追溯号
lineBatchOptions
:
[],
lineBatchFilterOptions
:
[],
// 成品料号
partNumOptions
:
[],
// 查询的校验
queryRules
:
{
startDate
:
[
{
type
:
'string'
,
required
:
true
,
message
:
'请选择日期'
,
trigger
:
'change'
}
],
endDate
:
[
{
type
:
'string'
,
required
:
true
,
message
:
'请选择日期'
,
trigger
:
'change'
}
]
}
}
},
created
()
{
this
.
getDictFun
()
},
mounted
()
{
this
.
getRepairStats
()
// 获取页面数据
this
.
queryParams
.
status
=
'day'
// this.getRepairStats() // 获取页面数据
// 通过监听内容部分的宽度让图表resize
const
elementResizeDetectorMaker
=
require
(
'element-resize-detector'
)
const
erd
=
elementResizeDetectorMaker
()
...
...
@@ -295,6 +566,35 @@ export default {
this
.
getDateType
=
false
},
methods
:
{
getRepairStats
()
{
},
/** 重置按钮*/
resetQuery
()
{
// 清空校验
this
.
$refs
.
queryForm
.
resetFields
()
// 恢复默认维度
this
.
queryParams
.
status
=
'day'
// 恢复时间// 清除筛选项
// this.queryParams.startDate = moment(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 18)).format('YYYY-MM-DD') + ' 00:00:00',
// this.queryParams.endDate = moment(new Date().getTime() + 3600 * 1000 * 24).format('YYYY-MM-DD') + ' 23:59:59',
this
.
queryParams
.
startDate
=
''
this
.
queryParams
.
endDate
=
''
// 按项目下拉框
this
.
queryParams
.
familyOptions
=
[]
// 线体下拉框
this
.
queryParams
.
lineOptions
=
[]
// 班次下拉框
this
.
queryParams
.
shiftOptions
=
[]
// 装配工单下拉框
this
.
queryParams
.
workingOrderOptions
=
[]
// 装配追溯号
this
.
queryParams
.
lineBatchOptions
=
[]
this
.
queryParams
.
lineBatchFilterOptions
=
[]
// 成品料号
this
.
queryParams
.
partNumOptions
=
[]
// 根据恢复时间重新填充下拉框
this
.
getDictFun
()
},
/** 导出按钮操作*/
handleExport
()
{
const
params
=
{
...
...
@@ -323,36 +623,193 @@ export default {
})
},
/** 获取页面数据*/
getRepairStats
()
{
this
.
echartsLoading
=
true
const
params
=
{
beginDate
:
this
.
queryParams
.
startDate
,
endDate
:
this
.
queryParams
.
endDate
,
type
:
this
.
choseType
}
getProDetails
(
params
).
then
(
res
=>
{
if
(
this
.
getDateType
===
true
)
{
this
.
dataList
=
res
.
data
this
.
getProLineMonitor
()
this
.
getStatistics
()
this
.
echartsLoading
=
false
// getRepairStats() {
// this.echartsLoading = true
// const params = {
// beginDate: this.queryParams.startDate,
// endDate: this.queryParams.endDate,
// type: this.choseType
// }
// getProDetails(params).then(res => {
// if (this.getDateType === true) {
// this.dataList = res.data
// this.getProLineMonitor()
// this.getStatistics()
// this.echartsLoading = false
// }
// })
// },
/** 更改筛选时间*/
changeTime
()
{
this
.
getDictFun
()
},
/** 修改范围类型*/
changeChoseType
(
val
)
{
console
.
log
(
'choseType'
,
val
)
this
.
choseType
=
val
},
/** 获取数据字典方法 **/
getDictFun
()
{
// 填充线体下拉框
const
paramsLine
=
'productionLine'
getDicts
(
paramsLine
).
then
(
response
=>
{
this
.
lineOptions
=
response
.
data
})
// 项目数据
request
({
url
:
'/ifs/all'
,
methods
:
'get'
}).
then
(
res
=>
{
this
.
familyOptions
.
length
=
0
forEach
(
res
.
data
,
(
item
)
=>
{
// 填充下拉框
const
dict
=
{
dictLabel
:
item
.
description
,
dictValue
:
item
.
businessId
}
this
.
familyOptions
.
push
(
dict
)
})
})
// 班次下拉框查询
this
.
queryShiftOptions
()
// 获取时间范围内的工单 // 获取成品料号
request
({
url
:
'/nltifsorder/findOrdersByNeedTime'
,
methods
:
'get'
,
params
:
{
startNeedTime
:
this
.
queryParams
.
startDate
,
endNeedTime
:
this
.
queryParams
.
endDate
}
}).
then
(
res
=>
{
this
.
workingOrderOptions
.
length
=
0
this
.
partNumOptions
.
length
=
0
const
partNos
=
[]
forEach
(
res
.
data
,
(
item
)
=>
{
const
dict
=
{
dictLabel
:
item
.
orderNo
,
dictValue
:
item
.
orderNo
,
orderId
:
item
.
businessId
}
// 过滤
if
(
partNos
.
indexOf
(
item
.
partNo
)
===
-
1
)
{
partNos
.
push
(
item
.
partNo
)
}
this
.
workingOrderOptions
.
push
(
dict
)
// this.partNumOptions.push(dict1)
})
forEach
(
partNos
,
(
item
)
=>
{
const
dict
=
{
dictLabel
:
item
,
dictValue
:
item
}
this
.
partNumOptions
.
push
(
dict
)
})
// 获取装配追溯号 -- 根据工单的自增id
if
(
this
.
workingOrderOptions
!==
null
&&
this
.
workingOrderOptions
.
length
>
0
)
{
// 获取工单id列表
const
purl
=
'/nltorderlinelogic/selectByOrderId?'
+
'oidlist='
let
orderlist
=
''
for
(
let
i
=
0
;
i
<
this
.
workingOrderOptions
.
length
;
i
++
)
{
// workingOrderOptions[i].orderId
orderlist
+=
this
.
workingOrderOptions
[
i
].
orderId
if
(
i
+
1
<
this
.
workingOrderOptions
.
length
)
{
orderlist
=
orderlist
+
','
}
}
console
.
log
(
purl
+
orderlist
)
request
({
url
:
purl
+
orderlist
,
methods
:
'get'
,
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}
}).
then
(
res
=>
{
forEach
(
res
.
data
,
(
item
)
=>
{
console
.
log
(
item
)
const
dict
=
{
dictLabel
:
item
.
lineCode
,
dictValue
:
item
.
lineCode
}
this
.
lineBatchOptions
.
push
(
dict
)
})
this
.
filterSamelineCode
()
})
}
})
},
/** 更改筛选时间*/
changeTime
()
{
this
.
echartsLoading
=
true
const
params
=
{
beginDate
:
this
.
queryParams
.
startDate
,
endDate
:
this
.
queryParams
.
endDate
,
type
:
this
.
choseType
}
getProDetails
(
params
).
then
(
res
=>
{
if
(
this
.
getDateType
===
true
)
{
this
.
dataList
=
res
.
data
this
.
getProLineMonitor
()
this
.
getStatistics
()
this
.
echartsLoading
=
false
filterSamelineCode
()
{
// const lineBatchOptions = []
this
.
lineBatchFilterOptions
.
length
=
0
forEach
(
this
.
lineBatchOptions
,
(
item
)
=>
{
// alert(item.dictLabel)
// 没有一样的线体号就加入其中
if
(
this
.
lineBatchFilterOptions
.
indexOf
(
item
.
dictLabel
)
===
-
1
)
{
this
.
lineBatchFilterOptions
.
push
(
item
.
dictLabel
)
}
})
},
/** 查询按钮*/
handleQuery
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
// if (this.choseType === 'day') {
// const start = Date.parse(this.queryParams.startDate)
// const end = Date.parse(this.queryParams.endDate)
// const diffDate = Math.abs(end - start)
// const totalDays = Math.floor(diffDate / (1000 * 3600 * 24))
// } else if (this.choseType === 'week') {
// var date1 = new Date(this.queryParams.startDate)
// var date2 = new Date(this.queryParams.endDate)
// var dt1 = date1.getTime()
// var dt2 = date2.getTime()
// var num = Math.ceil(Math.abs(dt1 - dt2) / 1000 / 60 / 60 / 24 / 7)
// // 向上取整
// // TODO: clear this log
// console.log(`num`, num)
// } else if(this.choseType=='month'){
// var date3 = new Date(this.queryParams.startDate)
// var date4 = new Date(this.queryParams.endDate)
// var dt3 = date3.getTime()
// var dt4 = date4.getTime()
// var num1 = Math.ceil(Math.abs(dt3 - dt4) / 1000 / 60 / 60 / 24 / 30)
// // 向上取整
// // TODO: clear this log
// console.log(`num`, num1)
// }
this
.
echartsLoading
=
true
const
params
=
{
beginDate
:
this
.
queryParams
.
startDate
,
endDate
:
this
.
queryParams
.
endDate
,
type
:
this
.
choseType
,
xtCode
:
this
.
queryParams
.
xtCode
,
// 线体号
xmCode
:
this
.
queryParams
.
xmCode
,
// 项目
bcCode
:
this
.
queryParams
.
bcCode
,
// 班次
zpgdCode
:
this
.
queryParams
.
zpgdCode
,
// 装配工单
lineBatchCode
:
this
.
queryParams
.
lineBatchCode
,
// 追溯号
partNumCode
:
this
.
queryParams
.
partNumCode
// 成品料号
}
console
.
log
(
params
)
const
paramjson
=
JSON
.
stringify
(
params
)
getProDetailsJson
(
paramjson
.
toString
()).
then
(
res
=>
{
// console.log(res.data)
if
(
this
.
getDateType
===
true
)
{
this
.
dataList
=
res
.
data
this
.
getProLineMonitor
()
this
.
getStatistics
()
this
.
echartsLoading
=
false
}
})
// getProDetails(params).then(res => {
// if (this.getDateType === true) {
// this.dataList = res.data
// this.getProLineMonitor()
// this.getStatistics()
// this.echartsLoading = false
// }
// })
}
})
},
...
...
@@ -521,10 +978,34 @@ export default {
]
}
myChartAge.setOption(option)
},
/** 填充班次 - 查的数据字典*/
queryShiftOptions() {
// this.queryOptionsParams.dictType = '
defectiveParts
'
listData({ dictType: '
shift
' }).then(res => {
this.shiftOptions.length = 0
forEach(res.rows, (item) => {
console.log(item)
const dict = {
dictLabel: item.dictLabel,
dictValue: item.dictValue
}
this.shiftOptions.push(dict)
})
})
}
}
}
</
script
>
<
style
scoped
>
/* 样式穿透 */
.lmtags
>>>
.el-select__tags
.el-tag
:nth-child
(
1
)
{
/* color: #D20A10 !important; */
max-width
:
69px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
</
style
>
<
style
scoped
lang=
"scss"
>
.RepairStatistics_module
{
...
...
@@ -535,8 +1016,13 @@ export default {
}
.labelClass
{
position
:
relative
;
right
:
13px
;
//
right: 13px;
text-align
:
center
;
//padding-top: 8px;
// width: 70px;
}
.labelClass
div
:first-child
{
padding-left
:
13px
;
}
}
.el-divider--horizontal
{
...
...
@@ -580,5 +1066,9 @@ export default {
margin-left
:
15px
}
}
.flotr
{
float
:right
;
}
}
</
style
>
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