Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
police-jyzb-vue-hzzj
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
Tian
police-jyzb-vue-hzzj
Commits
c9b3cea7
Commit
c9b3cea7
authored
Oct 09, 2022
by
T
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
89fd8240
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
435 行增加
和
6 行删除
+435
-6
index.js
config/index.js
+1
-1
view.js
src/api/view.js
+8
-0
PanelGroup.vue
src/views/dashboard/PanelGroup.vue
+10
-5
form.vue
src/views/warehouse/inventoryStatistics/form.vue
+82
-0
index.vue
src/views/warehouse/inventoryStatistics/index.vue
+334
-0
没有找到文件。
config/index.js
View file @
c9b3cea7
...
@@ -32,7 +32,7 @@ module.exports = {
...
@@ -32,7 +32,7 @@ module.exports = {
},
},
// Various Dev Server settings
// Various Dev Server settings
host
:
'192.168.2.
246
'
,
// can be overwritten by process.env.HOST
host
:
'192.168.2.
105
'
,
// can be overwritten by process.env.HOST
port
:
9998
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port
:
9998
,
// can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser
:
true
,
autoOpenBrowser
:
true
,
errorOverlay
:
true
,
errorOverlay
:
true
,
...
...
src/api/view.js
View file @
c9b3cea7
...
@@ -17,6 +17,14 @@ export function getCountOrg(data) {
...
@@ -17,6 +17,14 @@ export function getCountOrg(data) {
})
})
}
}
export
function
getCountOrgHZ
(
data
)
{
return
request
({
url
:
window
.
_CONFIG
[
'serviceURL'
]
+
'/api/View/GetCountOrgHZ'
,
method
:
'post'
,
data
})
}
// 区域分类在库总量
// 区域分类在库总量
export
function
getGroupByAreaCount
(
data
)
{
export
function
getGroupByAreaCount
(
data
)
{
return
request
({
return
request
({
...
...
src/views/dashboard/PanelGroup.vue
View file @
c9b3cea7
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
今年出库数
</div>
<div
class=
"card-panel-text"
>
今年出库数
</div>
<count-to
:start-val=
"0"
:end-val=
"
2600
"
:duration=
"2600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
count.jncksCount
"
:duration=
"2600"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
</div>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
今年报废数
</div>
<div
class=
"card-panel-text"
>
今年报废数
</div>
<count-to
:start-val=
"0"
:end-val=
"
280
"
:duration=
"2600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
count.jnbfsCount
"
:duration=
"2600"
class=
"card-panel-num"
/>
</div>
</div>
</div>
</div>
</el-col>
</el-col>
...
@@ -106,14 +106,16 @@
...
@@ -106,14 +106,16 @@
<
script
>
<
script
>
import
CountTo
from
'vue-count-to'
import
CountTo
from
'vue-count-to'
import
{
getCountOrg
,
getCount
}
from
'@/api/view'
// import { getCountOrg, getCount } from '@/api/view'
import
{
getCountOrgHZ
,
getCount
}
from
'@/api/view'
export
default
{
export
default
{
components
:
{
components
:
{
CountTo
CountTo
},
},
data
()
{
data
()
{
return
{
return
{
count
:
{
zkTopCount
:
0
,
zkCount
:
0
,
bfCount
:
0
,
lyCount
:
0
,
wxCount
:
0
,
useCount
:
0
,
houseCount
:
0
,
jjbfCount
:
0
},
count
:
{
zkTopCount
:
0
,
zkCount
:
0
,
bfCount
:
0
,
lyCount
:
0
,
wxCount
:
0
,
useCount
:
0
,
houseCount
:
0
,
jjbfCount
:
0
,
jncksCount
:
0
,
jnbfsCount
:
0
},
orgId
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
,
orgId
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
,
findCode
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
findCode
findCode
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
findCode
}
}
...
@@ -135,12 +137,13 @@ export default {
...
@@ -135,12 +137,13 @@ export default {
this
.
count
.
useCount
=
res
.
data
.
zkTopCount
-
res
.
data
.
wxCount
-
res
.
data
.
bfCount
this
.
count
.
useCount
=
res
.
data
.
zkTopCount
-
res
.
data
.
wxCount
-
res
.
data
.
bfCount
this
.
count
.
houseCount
=
res
.
data
.
houseCount
// 调拨
this
.
count
.
houseCount
=
res
.
data
.
houseCount
// 调拨
this
.
count
.
jjbfCount
=
res
.
data
.
jjbfCount
this
.
count
.
jjbfCount
=
res
.
data
.
jjbfCount
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
msg
)
this
.
$message
.
error
(
res
.
msg
)
}
}
})
})
}
else
{
}
else
{
getCountOrg
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
getCountOrg
HZ
({
orgId
:
this
.
orgId
}).
then
(
res
=>
{
if
(
res
.
code
===
'10000'
)
{
if
(
res
.
code
===
'10000'
)
{
this
.
count
.
zkTopCount
=
res
.
data
.
zkTopCount
this
.
count
.
zkTopCount
=
res
.
data
.
zkTopCount
this
.
count
.
zkCount
=
res
.
data
.
zkCount
this
.
count
.
zkCount
=
res
.
data
.
zkCount
...
@@ -150,6 +153,8 @@ export default {
...
@@ -150,6 +153,8 @@ export default {
this
.
count
.
useCount
=
res
.
data
.
zkTopCount
-
res
.
data
.
wxCount
-
res
.
data
.
bfCount
this
.
count
.
useCount
=
res
.
data
.
zkTopCount
-
res
.
data
.
wxCount
-
res
.
data
.
bfCount
this
.
count
.
houseCount
=
res
.
data
.
houseCount
// 调拨
this
.
count
.
houseCount
=
res
.
data
.
houseCount
// 调拨
this
.
count
.
jjbfCount
=
res
.
data
.
jjbfCount
this
.
count
.
jjbfCount
=
res
.
data
.
jjbfCount
this
.
count
.
jncksCount
=
res
.
data
.
jncksCount
this
.
count
.
jnbfsCount
=
res
.
data
.
jnbfsCount
eventBus
.
$emit
(
'fasong'
,
res
.
data
.
cqwhCount
,
res
.
data
.
ycqCount
)
// 超期未还 // 已超期
eventBus
.
$emit
(
'fasong'
,
res
.
data
.
cqwhCount
,
res
.
data
.
ycqCount
)
// 超期未还 // 已超期
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
msg
)
this
.
$message
.
error
(
res
.
msg
)
...
...
src/views/warehouse/inventoryStatistics/form.vue
0 → 100644
View file @
c9b3cea7
<
template
>
<el-dialog
:append-to-body=
"true"
:close-on-click-modal=
"false"
:before-close=
"cancel"
ref=
"form"
:visible
.
sync=
"dialog"
:title=
"'查看装备库存状态'"
width=
"1200px"
>
<!--表格渲染-->
<el-table
ref=
"table"
v-loading=
"loading"
:row-key=
"getRowKeys"
:data=
"data"
style=
"width: 100%;"
stripe
border
>
<el-table-column
type=
"expand"
width=
"50"
>
<template
slot-scope=
"props"
>
<detail-form
:orgId=
"props.row.orgId"
:warehouseId=
"props.row.warehouseCode"
:equipmentSizeId=
"props.row.equipmentSizecode"
/>
</
template
>
</el-table-column>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
align=
"center"
/>
<el-table-column
prop=
"warehouseName"
label=
"仓库名称"
align=
"center"
/>
<el-table-column
prop=
"equipmentName"
label=
"装备名称"
align=
"center"
/>
<el-table-column
prop=
"sizeName"
label=
"装备型号名称"
align=
"center"
/>
<el-table-column
prop=
"zsCount"
label=
"装备总数"
align=
"center"
/>
<el-table-column
prop=
"zkCount"
label=
"今年入库数"
align=
"center"
/>
<el-table-column
prop=
"ckCount"
label=
"今年出库数"
align=
"center"
/>
<el-table-column
prop=
"bfCount"
label=
"报废数"
align=
"center"
/>
</el-table>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"info"
plain
@
click=
"cancel"
>
关闭
</el-button>
</div>
</el-dialog>
</template>
<
script
>
import
detailForm
from
'@/views/warehouse/stock/detail'
import
{
initData
,
initPdata
,
initGdata
}
from
'@/api/data'
import
{
transform
}
from
'@/utils/index'
export
default
{
components
:{
detailForm
},
data
()
{
return
{
dialog
:
false
,
data
:
[],
loading
:
true
,
url
:
''
,
params
:
{}
}
},
methods
:
{
initTable
(
equipmentId
,
findCode
,
orgCode
,
code
)
{
this
.
url
=
window
.
_CONFIG
[
'serviceURL'
]
+
'/api/Inventory/GetListEquByFindCode'
this
.
params
=
{
findCode
:
findCode
,
equipmentId
:
equipmentId
,
orgCode
:
orgCode
.
substring
(
6
,
8
)
===
'00'
?
(
orgCode
===
code
?
orgCode
:
''
)
:
orgCode
}
// 先判断是不是 派出所还是上级,派出所直接传orgCode,上级会包含本级及下级的,相等的话传本级
this
.
initPost
()
},
getRowKeys
(
row
)
{
return
row
.
equipmentCode
+
row
.
equipmentSizecode
+
row
.
warehouseCode
},
async
initPost
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
loading
=
true
initPdata
(
this
.
url
,
transform
(
this
.
params
)).
then
(
res
=>
{
if
(
res
.
code
===
'10000'
)
{
this
.
data
=
res
.
data
setTimeout
(()
=>
{
this
.
loading
=
false
},
this
.
time
)
resolve
(
res
)
}
else
this
.
$message
.
error
(
res
.
msg
)
}).
catch
(
err
=>
{
this
.
loading
=
false
reject
(
err
)
})
})
},
cancel
()
{
this
.
resetForm
()
},
resetForm
()
{
this
.
dialog
=
false
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
/
deep
/
.el-input-number
.el-input__inner
{
text-align
:
left
;
}
</
style
>
src/views/warehouse/inventoryStatistics/index.vue
0 → 100644
View file @
c9b3cea7
<
template
>
<div
class=
"dashboard-editor-container"
>
<el-card>
<!-- 搜索 -->
<div
class=
"head-container"
>
<el-popover
placement=
"bottom-end"
width=
"150"
trigger=
"click"
>
<el-button
class=
"filter-item"
slot=
"reference"
icon=
"el-icon-s-grid"
style=
"float: right;"
/>
<el-checkbox
v-model=
"allColumnsSelected"
:indeterminate=
"allColumnsSelectedIndeterminate"
@
change=
"handleCheckAllChange"
>
全选
</el-checkbox>
<el-checkbox
v-for=
"item in columns"
:key=
"item.label"
v-model=
"item.visible"
@
change=
"handleCheckedTableColumnsChange(item)"
>
{{
item
.
label
}}
</el-checkbox>
</el-popover>
<el-cascader
v-model=
"orgId"
:options=
"orgList"
:props=
"
{ value: 'id', label: 'name', checkStrictly: true, emitPath: false }" filterable
clearable :show-all-levels="false" class="filter-item" style="width: 300px;margin-left:0px" placeholder="请选择本级或下级的组织机构" @change="orgChange"/>
<el-cascader
v-model=
"typeId"
:options=
"typeList"
:props=
"
{ value: 'id', label: 'name', checkStrictly: true, emitPath: false }" filterable
clearable :show-all-levels="false" class="filter-item" style="width: 300px;" placeholder="请选择装备类型" @change="typeChange"/>
<el-select
v-model=
"equipmentCode"
style=
"width:240px"
class=
"filter-item"
:filterable=
"true"
clearable
:filter-method=
"dataFilter"
placeholder=
"请选择装备"
@
change=
"equipmentChange"
ref=
"select"
>
<el-option
v-for=
"item in equipmentList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
<el-select
v-model=
"equipmentSizecode"
style=
"width:240px"
clearable
class=
"filter-item"
:filterable=
"true"
placeholder=
"请选择装备型号"
@
change=
"initPost"
>
<el-option
v-for=
"item in equipmentSizeList"
:key=
"item.id"
:label=
"item.sizeName"
:value=
"item.id"
/>
</el-select>
<!--
<el-input
v-model=
"excelName"
placeholder=
"请输入导出文件名称"
style=
"width: 200px;"
class=
"filter-item"
/>
-->
<el-button
:loading=
"downloadLoading"
class=
"filter-item"
type=
"warning"
icon=
"el-icon-download"
style=
"float: right"
@
click=
"download"
>
导出
</el-button>
</div>
<!--表格渲染-->
<el-table
ref=
"table"
v-loading=
"loading"
:data=
"data"
show-summary
:summary-method=
"getSummaries"
stripe
border
style=
"width: 100%;"
@
row-click=
"rowClick"
>
<el-table-column
type=
"expand"
width=
"50"
>
<template
slot-scope=
"props"
>
<el-table
:data=
"props.row.children"
stripe
border
style=
"width: 94%;margin: auto;"
>
<el-table-column
type=
"index"
label=
"序号"
align=
"center"
width=
"50"
/>
<el-table-column
prop=
"name"
label=
"装备类型名称"
align=
"center"
/>
<el-table-column
prop=
"zsCount"
label=
"总数"
sortable
align=
"center"
/>
<el-table-column
prop=
"zkCount"
label=
"今年入库数"
sortable
align=
"center"
/>
<el-table-column
prop=
"ckCount"
label=
"今年出库数"
sortable
align=
"center"
/>
<el-table-column
prop=
"bfCount"
label=
"报废数"
sortable
align=
"center"
/>
<el-table-column
label=
"操作"
width=
"80"
align=
"center"
fixed=
"right"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"primary"
@
click=
"show(scope.row.id, props.row.findCode, props.row.orgCode)"
>
查看
</el-button>
</
template
>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column
type=
"index"
label=
"序号"
align=
"center"
width=
"50"
/>
<el-table-column
prop=
"orgName"
label=
"组织机构名称"
align=
"center"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
orgCode
===
code
?
scope
.
row
.
orgName
+
'本级'
:
scope
.
row
.
orgName
.
replace
(
orgName
,
''
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"zsCount"
label=
"总数"
sortable
align=
"center"
/>
<el-table-column
prop=
"zkCount"
label=
"今年入库数"
sortable
align=
"center"
/>
<el-table-column
prop=
"ckCount"
label=
"今年出库数"
sortable
align=
"center"
/>
<el-table-column
prop=
"bfCount"
label=
"报废数"
sortable
align=
"center"
/>
</el-table>
<!--分页组件-->
<el-pagination
:total=
"total"
:current-page=
"page + 1"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"postSizeChange"
@
current-change=
"postPageChange"
/>
<eForm
ref=
"form"
/>
</el-card>
</div>
</template>
<
script
>
import
{
getListOrg
,
getOrgById
}
from
'@/api/org'
import
{
getListEquipment
}
from
'@/api/equipmentInfo'
import
{
getListEquipmentDetail
}
from
'@/api/equipmentDetail'
import
{
getListEquipmentSize
}
from
'@/api/equipmentSize'
import
initData
from
'@/mixins/initData'
import
{
initPdata
}
from
'@/api/data'
import
md5
from
'js-md5'
import
cnchar
from
"cnchar"
;
import
eForm
from
'./form'
export
default
{
name
:
'Equipmentall'
,
mixins
:
[
initData
],
components
:{
eForm
},
data
()
{
return
{
orgId
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
,
orgName
:
''
,
code
:
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
code
,
typeId
:
''
,
orgList
:
[],
typeList
:
[],
equipmentCode
:
''
,
equipmentSizecode
:
''
,
copy
:
[],
equipmentList
:
[],
equipmentSizeList
:
[],
downloadLoading
:
false
,
excelName
:
''
,
sheetNameArray
:
[],
// 导出sheet表名称
openEdData
:
{}
// 展开的数据列
}
},
created
()
{
this
.
initOrgList
()
this
.
initTypeList
()
this
.
initEquipmentList
()
this
.
$nextTick
(()
=>
{
this
.
initPost
()
const
columns
=
[]
this
.
$refs
[
'table'
].
columns
.
forEach
((
e
,
index
)
=>
{
if
(
!
e
.
property
||
e
.
type
!==
'default'
)
{
return
}
e
.
__index
=
index
columns
.
push
({
property
:
e
.
property
,
index
,
label
:
e
.
label
,
visible
:
true
})
})
this
.
columns
=
columns
})
},
methods
:
{
beforeInit
()
{
this
.
url
=
window
.
_CONFIG
[
'serviceURL'
]
+
'/api/Tj/GetPageOrgTj'
this
.
params
=
{
page
:
this
.
page
,
size
:
this
.
size
,
orgId
:
this
.
orgId
||
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
}
const
typeId
=
this
.
typeId
const
equipmentCode
=
this
.
equipmentCode
const
equipmentSizecode
=
this
.
equipmentSizecode
if
(
typeId
)
{
this
.
params
[
'typeId'
]
=
typeId
}
if
(
equipmentCode
)
{
this
.
params
[
'equipmentCode'
]
=
equipmentCode
}
if
(
equipmentSizecode
)
{
this
.
params
[
'equipmentSizecode'
]
=
equipmentSizecode
}
return
true
},
async
initPost
()
{
if
(
!
await
this
.
beforeInit
())
{
return
}
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
loading
=
true
initPdata
(
this
.
url
,
this
.
params
).
then
(
res
=>
{
if
(
res
.
code
===
'10000'
)
{
this
.
total
=
res
.
data
.
totalElements
this
.
data
=
res
.
data
.
content
setTimeout
(()
=>
{
this
.
loading
=
false
},
this
.
time
)
resolve
(
res
)
}
else
this
.
$message
.
error
(
res
.
msg
)
}).
catch
(
err
=>
{
this
.
loading
=
false
reject
(
err
)
})
})
},
initOrgList
()
{
getListOrg
({
id
:
this
.
orgId
}).
then
(
res
=>
{
this
.
orgList
=
res
.
data
})
},
orgChange
(
id
)
{
getOrgById
({
id
:
id
}).
then
(
res
=>
{
this
.
orgName
=
res
.
data
.
name
this
.
code
=
res
.
data
.
code
this
.
initPost
()
})
},
initTypeList
()
{
getListEquipment
({}).
then
(
res
=>
{
this
.
typeList
=
res
.
data
})
},
initEquipmentList
()
{
this
.
equipmentSizecode
=
''
this
.
equipmentSizeList
=
[]
getListEquipmentDetail
({
equipmentId
:
this
.
typeId
}).
then
(
res
=>
{
this
.
equipmentList
=
res
.
data
//保留数据源
this
.
copy
=
Object
.
assign
(
this
.
equipmentList
)
})
},
typeChange
()
{
this
.
initEquipmentList
()
this
.
initPost
()
},
equipmentChange
()
{
this
.
equipmentSizecode
=
''
this
.
equipmentSizeList
=
[]
this
.
getListEquipmentSize
()
this
.
initPost
()
},
getListEquipmentSize
()
{
if
(
this
.
equipmentCode
)
{
getListEquipmentSize
({
detailId
:
this
.
equipmentCode
}).
then
(
res
=>
{
this
.
equipmentSizeList
=
res
.
data
})
}
},
dataFilter
(
v
)
{
//对绑定数据赋值
this
.
equipmentList
=
this
.
copy
.
filter
((
item
)
=>
{
console
.
log
(
item
)
//如果直接包含输入值直接返回true
if
(
item
.
name
.
indexOf
(
v
)
!==
-
1
)
return
true
;
//将label拆散成小写拼音数组
let
arr
=
item
.
name
.
spell
(
'array'
,
'first'
,
'low'
);
//拼接成完整label的拼音
let
spell
=
arr
.
join
(
''
);
//lengths 是label完整拼音 中每个汉字第一个拼音字母的index值的数组
let
lengths
=
[
0
];
for
(
var
i
=
0
;
i
<
arr
.
length
-
1
;
i
++
)
{
lengths
.
push
(
lengths
[
i
]
+
arr
[
i
].
length
);
};
//判断label完整拼音 中 输入值的 index 是不是等于某个汉字第一个拼音字母的index值
return
lengths
.
indexOf
(
spell
.
indexOf
(
v
))
!==
-
1
;
})
},
download
()
{
this
.
downloadLoading
=
true
var
params
=
{
page
:
this
.
page
,
size
:
9999
,
orgId
:
this
.
orgId
||
this
.
$store
.
state
.
user
.
user
.
baseJpOrganization
.
id
}
const
typeId
=
this
.
typeId
const
equipmentCode
=
this
.
equipmentCode
const
equipmentSizecode
=
this
.
equipmentSizecode
if
(
typeId
)
{
params
[
'typeId'
]
=
typeId
}
if
(
equipmentCode
)
{
params
[
'equipmentCode'
]
=
equipmentCode
}
if
(
equipmentSizecode
)
{
params
[
'equipmentSizecode'
]
=
equipmentSizecode
}
let
list
=
[]
let
result
=
[]
initPdata
(
this
.
url
,
params
).
then
(
res
=>
{
if
(
res
.
code
==
'10000'
)
{
list
=
res
.
data
.
content
import
(
'@/utils/Export2Excel'
).
then
(
excel
=>
{
const
tHeader
=
[
'装备名称'
,
'总数'
,
'今年入库数'
,
'今年出库数'
,
'报废数'
]
const
filterVal
=
[
'name'
,
'zsCount'
,
'zkCount'
,
'ckCount'
,
'bfCount'
]
for
(
let
org
of
list
)
{
result
.
push
({
sheetTitle
:
org
.
orgName
,
th
:
tHeader
,
data
:
this
.
formatJson
(
filterVal
,
org
.
children
)
})
}
excel
.
export_json_to_excel
({
// header: tHeader,
data
:
result
,
filename
:
this
.
excelName
||
'库存统计报表'
,
autoWidth
:
true
,
bookType
:
'xlsx'
})
this
.
downloadLoading
=
false
})
}
else
{
this
.
$message
.
error
(
res
.
msg
)
}
})
},
formatJson
(
filterVal
,
jsonData
)
{
return
jsonData
.
map
(
v
=>
filterVal
.
map
(
j
=>
{
return
v
[
j
]
}))
},
rowClick
(
row
,
column
,
event
)
{
this
.
$refs
.
table
.
toggleRowExpansion
(
row
);
},
getSummaries
(
param
)
{
const
{
columns
,
data
}
=
param
;
const
sums
=
[];
columns
.
forEach
((
column
,
index
)
=>
{
if
(
index
===
2
)
{
sums
[
index
]
=
'本页合计'
;
return
;
}
const
values
=
data
.
map
(
item
=>
Number
(
item
[
column
.
property
]));
if
(
!
values
.
every
(
value
=>
isNaN
(
value
)))
{
sums
[
index
]
=
values
.
reduce
((
prev
,
curr
)
=>
{
const
value
=
Number
(
curr
);
if
(
!
isNaN
(
value
))
{
return
prev
+
curr
;
}
else
{
return
prev
;
}
},
0
);
sums
[
index
]
+=
''
;
}
else
{
sums
[
index
]
=
''
;
}
});
return
sums
;
},
show
(
equipmentId
,
findCode
,
orgCode
)
{
const
_this
=
this
.
$refs
.
form
_this
.
initTable
(
equipmentId
,
findCode
,
orgCode
,
this
.
code
)
_this
.
dialog
=
true
}
}
}
</
script
>
<
style
scoped
>
</
style
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.dashboard-editor-container
{
padding
:
10px
12px
12px
12px
;
background-color
:
rgb
(
240
,
242
,
245
);
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论