Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manage
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
vanke
manage
Commits
6d75d46a
Commit
6d75d46a
authored
Jun 28, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物品新增和导入物品,部门,报表管理
parent
bf9f35cc
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
672 additions
and
223 deletions
+672
-223
inventory.js
src/api/inventory.js
+24
-0
report.js
src/api/report.js
+11
-18
index.js
src/router/index.js
+14
-0
getters.js
src/store/getters.js
+3
-0
user.js
src/store/modules/user.js
+17
-0
DepartmentList.vue
src/views/dep/DepartmentList.vue
+157
-0
addDepartmentModal.vue
src/views/dep/modules/addDepartmentModal.vue
+97
-0
StockAdmin.vue
src/views/inv/StockAdmin.vue
+16
-7
StoreList.vue
src/views/inv/StoreList.vue
+27
-2
WarehouseAdmin.vue
src/views/inv/WarehouseAdmin.vue
+50
-27
addGoodsModal.vue
src/views/inv/modules/addGoodsModal.vue
+2
-2
importGoodsModal.vue
src/views/inv/modules/importGoodsModal.vue
+1
-1
InventoryChart.vue
src/views/sta/InventoryChart.vue
+127
-83
Recipients.vue
src/views/sta/Recipients.vue
+126
-83
No files found.
src/api/inventory.js
View file @
6d75d46a
...
...
@@ -98,3 +98,27 @@ export function addGoodList(data) {
data
})
}
// 万科后台_部门分页操作
export
function
getDepartmentList
(
params
)
{
return
request
({
url
:
'vankeDepartment/list'
,
method
:
'get'
,
params
})
}
// 万科后台_部门插入操作
export
function
addDepart
(
params
)
{
return
request
({
url
:
'vankeDepartment/insertDepartment'
,
method
:
'post'
,
params
})
}
// 万科后台_根据部门id修改一条数据
export
function
editDepart
(
params
)
{
return
request
({
url
:
'vankeDepartment/updateDepartment'
,
method
:
'post'
,
params
})
}
src/api/report.js
View file @
6d75d46a
import
request
from
'@/utils/request'
// 获取商品举报列表
export
function
reportList
(
params
)
{
// 万科后台_根据物品id 以及时间list 查询这个时间段内每天的领用情况
export
function
getRecipientList
(
data
)
{
return
request
({
url
:
'
/report/quperPageList
'
,
method
:
'
ge
t'
,
params
url
:
'
vankeStatisticalChart/selectGoodsCollection
'
,
method
:
'
pos
t'
,
data
})
}
//
举报详情
export
function
reportDetail
(
params
)
{
//
万科后台_根据物品id 以及时间list 查询这个时间段内每天的库存信息
export
function
getInventoryList
(
data
)
{
return
request
({
url
:
'/report/detail'
,
method
:
'get'
,
params
})
}
// 举报处理
export
function
reportHanlde
(
params
)
{
return
request
({
url
:
'/report/process'
,
method
:
'get'
,
params
url
:
'vankeStatisticalChart/OutVankeGoodsStockChange'
,
method
:
'post'
,
data
})
}
src/router/index.js
View file @
6d75d46a
...
...
@@ -106,6 +106,20 @@ export const asyncRouterMap = [
meta
:
{
title
:
'领用情况'
,
icon
:
'product-list'
},
}]
},
// 部门管理
{
path
:
'/dep'
,
component
:
Layout
,
redirect
:
'/dep/departmentList'
,
name
:
'dep'
,
meta
:
{
title
:
'部门管理'
,
icon
:
'sms-subject'
},
children
:
[{
path
:
'departmentList'
,
name
:
'departmentList'
,
component
:
()
=>
import
(
'@/views/dep/DepartmentList'
),
meta
:
{
title
:
'部门列表'
,
icon
:
'product-list'
}
}]
},
// 管理员
{
path
:
'/use'
,
...
...
src/store/getters.js
View file @
6d75d46a
...
...
@@ -3,6 +3,9 @@ const getters = {
device
:
state
=>
state
.
app
.
device
,
token
:
state
=>
state
.
user
.
token
,
avatar
:
state
=>
state
.
user
.
avatar
,
stockRoomId
:
state
=>
state
.
user
.
stockRoomId
,
type
:
state
=>
state
.
user
.
type
,
memberId
:
state
=>
state
.
user
.
memberId
,
userId
:
state
=>
state
.
user
.
userId
,
name
:
state
=>
state
.
user
.
name
,
roles
:
state
=>
state
.
user
.
roles
,
...
...
src/store/modules/user.js
View file @
6d75d46a
...
...
@@ -7,6 +7,8 @@ const user = {
token
:
getToken
(),
name
:
''
,
userId
:
getCookie
(
"userId"
),
memeberId
:
getCookie
(
"memeberId"
),
stockRoomId
:
getCookie
(
"stockRoomId"
),
avatar
:
''
,
roles
:
[]
},
...
...
@@ -25,6 +27,18 @@ const user = {
state
.
userId
=
userId
setCookie
(
"userId"
,
userId
,
15
)
},
SET_MEMBERID
:
(
state
,
memeberId
)
=>
{
state
.
memeberId
=
memeberId
setCookie
(
"memeberId"
,
memeberId
,
15
)
},
SET_STOCKROOMID
:
(
state
,
stockRoomId
)
=>
{
state
.
stockRoomId
=
stockRoomId
setCookie
(
"stockRoomId"
,
stockRoomId
,
15
)
},
SET_TYPE
:
(
state
,
type
)
=>
{
state
.
type
=
type
setCookie
(
"type"
,
type
,
15
)
},
SET_ROLES
:
(
state
,
roles
)
=>
{
state
.
roles
=
roles
}
...
...
@@ -60,6 +74,9 @@ const user = {
commit
(
'SET_NAME'
,
data
.
username
)
commit
(
'SET_AVATAR'
,
data
.
icon
)
commit
(
'SET_USERID'
,
data
.
userId
)
commit
(
'SET_MEMBERID'
,
data
.
memberId
)
commit
(
'SET_STOCKROOMID'
,
data
.
stockRoomId
)
commit
(
'SET_TYPE'
,
data
.
type
)
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
...
...
src/views/dep/DepartmentList.vue
0 → 100644
View file @
6d75d46a
<
template
>
<div
class=
"app-container"
>
<!-- 表格栏 -->
<el-card
class=
"filter-container mt15"
shadow=
"never"
>
<el-row
type=
"flex"
class=
"btn-groups"
>
<el-button
type=
"primary"
@
click=
"handleAdd"
>
新增
</el-button>
</el-row>
<div
class=
"table-container"
>
<el-table
:data=
"list"
v-loading=
"listLoading"
@
selection-change=
"handleSelectionChange"
border
>
<el-table-column
type=
"selection"
align=
"center"
width=
"50"
></el-table-column>
<el-table-column
label=
"物品类别"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createtime
|
formatTime
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</div>
<!-- 分页栏 -->
<div
class=
"pagination-container"
>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
layout=
"total, sizes, prev, pager, next, jumper"
:current-page
.
sync=
"listQuery.pageNum"
:page-size=
"listQuery.pageSize"
:page-sizes=
"[10,30,50]"
:total=
"total"
>
</el-pagination>
</div>
</el-card>
<!-- 弹窗-->
<add-department-modal
ref=
"addDepartment"
@
ok=
"getList"
></add-department-modal>
</div>
</template>
<
script
>
import
moment
from
'moment'
import
{
getDepartmentList
,
editDepart
}
from
'@/api/inventory'
import
AddDepartmentModal
from
'./modules/addDepartmentModal'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
pageSize
:
10
}
export
default
{
name
:
'DepartmentList'
,
components
:
{
AddDepartmentModal
},
data
()
{
return
{
listQuery
:
Object
.
assign
({},
defaultListQuery
),
list
:
[],
total
:
0
,
listLoading
:
false
,
multipleSelection
:
[],
}
},
created
()
{
this
.
getList
()
},
filters
:
{
formatTime
(
time
)
{
if
(
!
time
)
{
return
'--'
}
return
moment
(
time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
},
methods
:
{
handleResetSearch
()
{
this
.
listQuery
=
Object
.
assign
({},
defaultListQuery
)
this
.
getList
()
},
handleSearchList
()
{
this
.
listQuery
.
pageNum
=
1
this
.
getList
()
},
handleSizeChange
(
val
)
{
this
.
listQuery
.
pageNum
=
1
this
.
listQuery
.
pageSize
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
pageNum
=
val
this
.
getList
()
},
handleSelectionChange
(
vals
)
{
this
.
multipleSelection
=
vals
},
//请求数据
getList
()
{
this
.
listLoading
=
true
//请求数据
console
.
log
(
'listQuery'
,
this
.
listQuery
)
getDepartmentList
(
this
.
listQuery
).
then
(
res
=>
{
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
}).
catch
(
err
=>
{
this
.
listLoading
=
false
})
},
// 添加
handleAdd
(){
this
.
$refs
.
addDepartment
.
add
()
},
// 删除
handleDelete
(
id
){
this
.
$confirm
(
'是否删除该部门?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
editDepart
({
id
:
id
,
deleteStatus
:
0
}).
then
(
res
=>
{
this
.
getList
()
})
}).
catch
(()
=>
{
});
}
}
}
</
script
>
<
style
scoped
>
.app-container
{
font-size
:
14px
;
color
:
#606266
;
padding
:
0
15px
;
margin-top
:
0
;
}
.mt15
{
margin-top
:
15px
;
}
.input-width
{
width
:
180px
;
}
.btn-groups
button
{
width
:
100px
;
}
</
style
>
src/views/dep/modules/addDepartmentModal.vue
0 → 100644
View file @
6d75d46a
<
template
>
<el-dialog
:visible
.
sync=
"visible"
:title=
"title"
center
width=
"500px"
>
<!-- start -->
<el-form
:model=
"model"
ref=
"attributeForm"
v-loading=
"loading"
label-width=
"150px"
>
<el-form-item
label=
"部门:"
:rules=
"[
{required: true, trigger: 'blur', message: '请输入部门名称'}]"
prop="name">
<el-input
size=
"small"
class=
"input-width"
placeholder=
"请输入部门名称"
v-model=
"model.name"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
>
<el-button
type=
"primary"
@
click=
"submit"
>
确认
</el-button>
<el-button
@
click=
"close"
>
取消
</el-button>
</div>
<!-- end -->
</el-dialog>
</
template
>
<
script
>
import
{
addDepart
}
from
'@/api/inventory'
// 移动属性
export
default
{
name
:
'addDepartmentModal'
,
data
()
{
return
{
visible
:
false
,
title
:
null
,
loading
:
false
,
id
:
null
,
model
:
{}
}
},
methods
:
{
init
()
{
this
.
model
=
{
name
:
null
}
this
.
$nextTick
(()
=>
{
this
.
$refs
.
attributeForm
.
clearValidate
()
})
},
add
(){
this
.
id
=
null
this
.
title
=
"新增部门"
this
.
init
()
this
.
visible
=
true
},
// detail (id) {
// this.id = id
// this.init()
// this.visible = true
// this.title = '移动属性'
// this.loading = true
// getAttribute(id).then(res => {
// this.model = res.data
// this.loading = false
// }).catch(err => {
// this.loading = false
// this.close()
// })
// },
// 提交保存
submit
()
{
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 验证通过
addDepart
(
this
.
model
).
then
(
res
=>
{
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'ok'
)
}).
catch
(
err
=>
{
this
.
loading
=
false
})
}
})
},
close
()
{
this
.
$emit
(
'close'
)
this
.
visible
=
false
}
}
}
</
script
>
<
style
scoped
>
.input-width
{
width
:
200px
;
}
</
style
>
src/views/inv/StockAdmin.vue
View file @
6d75d46a
...
...
@@ -15,10 +15,12 @@
<el-button
type=
"primary"
@
click=
"handleSearchList"
icon=
"el-icon-search"
size=
"small"
>
搜索
</el-button>
size=
"small"
>
搜索
</el-button>
<el-button
@
click=
"handleResetSearch"
icon=
"el-icon-refresh"
size=
"small"
>
重置
</el-button>
size=
"small"
>
重置
</el-button>
</el-form-item>
</el-form>
</el-card>
...
...
@@ -43,7 +45,8 @@
</el-table-column>
<el-table-column
label=
"入库人"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
backInboundName
||
'--'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
$store
.
getters
.
type
==
1
?
scope
.
row
.
backInboundName
:
scope
.
row
.
receptInboundName
}}
</
template
>
</el-table-column>
<el-table-column
label=
"入库日期"
align=
"center"
>
...
...
@@ -60,10 +63,12 @@
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"success"
@
click=
"handleView(scope.row)"
>
查看详情
</el-button>
@
click=
"handleView(scope.row)"
>
查看详情
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"exportEntry(scope.row.id)"
>
生成入库单
</el-button>
@
click=
"exportEntry(scope.row.id)"
>
生成入库单
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -101,7 +106,7 @@ const defaultListQuery = {
export
default
{
name
:
'StockAdmin'
,
components
:
{
inventoryDetailsModal
},
components
:
{
inventoryDetailsModal
},
data
()
{
return
{
listQuery
:
Object
.
assign
({},
defaultListQuery
),
...
...
@@ -147,7 +152,10 @@ export default {
getList
()
{
this
.
listLoading
=
true
//请求数据
console
.
log
(
'listQuery'
,
this
.
listQuery
)
console
.
log
(
'listQuery'
,
this
.
listQuery
)
if
(
this
.
$store
.
getters
.
type
==
2
){
this
.
listQuery
.
stockRoomId
=
this
.
$store
.
getters
.
stockRoomId
}
getInboundRecordList
(
this
.
listQuery
).
then
(
res
=>
{
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
...
...
@@ -170,6 +178,7 @@ export default {
padding
:
0
15px
;
margin-top
:
0
;
}
.mt15
{
margin-top
:
15px
;
}
...
...
src/views/inv/StoreList.vue
View file @
6d75d46a
...
...
@@ -34,7 +34,8 @@
</el-select>
</el-form-item>
<!-- 超级管理员可见-->
<el-form-item
label=
"库房:"
>
<el-form-item
label=
"库房:"
v-if=
"$store.getters.type == 1"
>
<el-select
v-model=
"listQuery.stockRoomId"
class=
"input-width"
clearable
...
...
@@ -103,6 +104,14 @@
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
stockRoomName
||
'--'
}}
</
template
>
</el-table-column>
<!-- <el-table-column label="操作"-->
<!-- align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini"-->
<!-- type="danger"-->
<!-- @click="handleDelete(scope.row.id)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<!-- 分页栏 -->
...
...
@@ -125,7 +134,7 @@
</template>
<
script
>
import
moment
from
'moment'
import
{
getGoodsList
,
getGoodsCategoryList
,
getStockRooms
,
getAuditDetail
,
updateMcht
}
from
'@/api/inventory'
import
{
getGoodsList
,
getGoodsCategoryList
,
getStockRooms
,
editGoods
}
from
'@/api/inventory'
import
{
getSuppliersList
}
from
'@/api/supplier'
import
AddGoodsModal
from
'./modules/addGoodsModal'
import
ImportGoodsModal
from
'./modules/importGoodsModal'
...
...
@@ -192,6 +201,19 @@ export default {
handleSelectionChange
(
vals
)
{
this
.
multipleSelection
=
vals
},
// 删除
// handleDelete(id){
// this.$confirm('是否删除该物品?', '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// editGoods({id: id,deleteStatus: 0 }).then(res=>{
// this.getList()
// })
// }).catch(() => {
// });
// },
// 物品类别
getGoodsCategoryList
(){
getGoodsCategoryList
().
then
(
res
=>
{
...
...
@@ -215,6 +237,9 @@ export default {
this
.
listLoading
=
true
//请求数据
console
.
log
(
'listQuery'
,
this
.
listQuery
)
if
(
this
.
$store
.
getters
.
type
==
2
){
this
.
listQuery
.
stockRoomId
=
this
.
$store
.
getters
.
stockRoomId
}
getGoodsList
(
this
.
listQuery
).
then
(
res
=>
{
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
...
...
src/views/inv/WarehouseAdmin.vue
View file @
6d75d46a
...
...
@@ -16,43 +16,45 @@
class=
"input-width"
clearable
placeholder=
"请选择物品类别"
>
<el-option
v-for=
"item in
status
Options"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
></el-option>
<el-option
v-for=
"item in
category
Options"
:key=
"item.
id
"
:label=
"item.
name
"
:value=
"item.
id
"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"部门:"
>
<el-select
v-model=
"listQuery.
stockRoom
Id"
<el-select
v-model=
"listQuery.
depart
Id"
class=
"input-width"
clearable
placeholder=
"请选择部门"
>
<el-option
v-for=
"item in
status
Options"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
></el-option>
<el-option
v-for=
"item in
department
Options"
:key=
"item.
id
"
:label=
"item.
name
"
:value=
"item.
id
"
></el-option>
</el-select>
</el-form-item>
<!-- 超级管理员可见-->
<el-form-item
label=
"库房:"
>
<el-select
v-model=
"listQuery.st
atus
"
<!-- 超级管理员可见-->
<el-form-item
label=
"库房:"
v-if=
"$store.getters.type == 1"
>
<el-select
v-model=
"listQuery.st
ockRoomId
"
class=
"input-width"
clearable
placeholder=
"请选择库房"
>
<el-option
v-for=
"item in
status
Options"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
></el-option>
<el-option
v-for=
"item in
depot
Options"
:key=
"item.
id
"
:label=
"item.
name
"
:value=
"item.
id
"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"handleSearchList"
icon=
"el-icon-search"
size=
"small"
>
搜索
</el-button>
size=
"small"
>
搜索
</el-button>
<el-button
@
click=
"handleResetSearch"
icon=
"el-icon-refresh"
size=
"small"
>
重置
</el-button>
size=
"small"
>
重置
</el-button>
</el-form-item>
</el-form>
</el-card>
...
...
@@ -118,15 +120,16 @@
</template>
<
script
>
import
moment
from
'moment'
import
{
getOutboundRecordList
,
getGoodsCategoryList
,
getAuditDetail
,
updateMch
t
}
from
'@/api/inventory'
import
{
getOutboundRecordList
,
getGoodsCategoryList
,
getStockRooms
,
getDepartmentLis
t
}
from
'@/api/inventory'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
pageSize
:
10
,
accouuntType
:
1
,
name
:
''
,
phone
:
''
,
status
:
''
goodsCategoryId
:
''
,
stockRoomId
:
''
,
goodsMame
:
''
,
memberName
:
''
,
departId
:
''
}
export
default
{
...
...
@@ -139,11 +142,16 @@ export default {
total
:
0
,
listLoading
:
false
,
multipleSelection
:
[],
categoryOptions
:
[],
depotOptions
:
[],
departmentOptions
:
[]
}
},
created
()
{
this
.
getList
()
this
.
getGoodsCategoryList
()
this
.
getStockRooms
()
this
.
getDepartmentList
()
},
filters
:
{
formatTime
(
time
)
{
...
...
@@ -175,16 +183,30 @@ export default {
this
.
multipleSelection
=
vals
},
// 物品类别
getGoodsCategoryList
(){
getGoodsCategoryList
().
then
(
res
=>
{
getGoodsCategoryList
()
{
getGoodsCategoryList
().
then
(
res
=>
{
this
.
categoryOptions
=
res
.
data
.
list
})
},
// 库房
getStockRooms
()
{
getStockRooms
().
then
(
res
=>
{
this
.
depotOptions
=
res
.
data
.
list
})
},
getDepartmentList
()
{
getDepartmentList
().
then
(
res
=>
{
this
.
departmentOptions
=
res
.
data
.
list
})
},
//请求数据
getList
()
{
this
.
listLoading
=
true
//请求数据
console
.
log
(
'listQuery'
,
this
.
listQuery
)
console
.
log
(
'listQuery'
,
this
.
listQuery
)
if
(
this
.
$store
.
getters
.
type
==
2
)
{
this
.
listQuery
.
stockRoomId
=
this
.
$store
.
getters
.
stockRoomId
}
getOutboundRecordList
(
this
.
listQuery
).
then
(
res
=>
{
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
...
...
@@ -203,6 +225,7 @@ export default {
padding
:
0
15px
;
margin-top
:
0
;
}
.mt15
{
margin-top
:
15px
;
}
...
...
src/views/inv/modules/addGoodsModal.vue
View file @
6d75d46a
...
...
@@ -114,7 +114,7 @@
class=
"input-width"
clearable
placeholder=
"库房"
:disabled=
"scope.row.id? true: false"
>
:disabled=
"scope.row.id
|| ($store.getters.type == 2)
? true: false"
>
<el-option
v-for=
"item in depotOptions"
:key=
"item.id"
:label=
"item.name"
...
...
@@ -226,7 +226,7 @@ export default {
prict
:
''
,
supplierId
:
''
,
goodsCategoryId
:
''
,
stockRoomId
:
''
,
stockRoomId
:
this
.
$store
.
getters
.
stockRoomId
,
barCode
:
''
,
isOK
:
true
},)
...
...
src/views/inv/modules/importGoodsModal.vue
View file @
6d75d46a
...
...
@@ -126,7 +126,7 @@
class=
"input-width"
clearable
placeholder=
"库房"
:disabled=
"scope.row.id? true: false"
>
:disabled=
"scope.row.id
|| ($store.getters.type == 2)
? true: false"
>
<el-option
v-for=
"item in depotOptions"
:key=
"item.id"
:label=
"item.name"
...
...
src/views/sta/InventoryChart.vue
View file @
6d75d46a
...
...
@@ -7,36 +7,38 @@
:model=
"listQuery"
size=
"small"
>
<el-form-item
label=
"供应商:"
>
<el-select
v-model=
"listQuery.s
tatus
"
<el-select
v-model=
"listQuery.s
upplierId
"
class=
"input-width"
clearable
placeholder=
"请选择供应商"
>
<el-option
v-for=
"item in s
tatus
Options"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
></el-option>
<el-option
v-for=
"item in s
upplier
Options"
:key=
"item.
id
"
:label=
"item.
supplierName
"
:value=
"item.
id
"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物品类别:"
>
<el-select
v-model=
"listQuery.
status
"
<el-select
v-model=
"listQuery.
goodsCategoryId
"
class=
"input-width"
clearable
placeholder=
"请选择物品类别"
>
<el-option
v-for=
"item in statusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
placeholder=
"请选择物品类别"
@
visible-change=
"handleOpenCate"
>
<el-option
v-for=
"item in categoryOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物品:"
>
<el-select
v-model=
"listQuery.
status
"
<el-select
v-model=
"listQuery.
goodsId
"
class=
"input-width"
clearable
placeholder=
"请选择物品"
>
<el-option
v-for=
"item in statusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
placeholder=
"请选择物品"
@
visible-change=
"handleOpenGoods"
>
<el-option
v-for=
"item in goodOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
...
...
@@ -60,7 +62,7 @@
:legend-visible=
"false"
:loading=
"loading"
:data-empty=
"dataEmpty"
:settings=
"chartSettings"
></ve-line>
></ve-line>
</div>
</el-card>
</div>
...
...
@@ -68,40 +70,25 @@
<
script
>
import
moment
from
'moment'
import
{
str2Date
}
from
'@/utils/date'
import
{
getSupplier
,
getAuditDetail
,
updateMcht
}
from
'@/api/audit'
import
{
getSuppliersList
}
from
'@/api/supplier'
import
{
getGoodsList
,
getGoodsCategoryList
}
from
'@/api/inventory'
import
{
getInventoryList
}
from
'@/api/report'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
pageSize
:
10
,
accouuntType
:
1
,
name
:
''
,
phone
:
''
,
status
:
''
}
const
DATA_FROM_BACKEND
=
{
columns
:
[
'date'
,
'orderCount'
,
'orderAmount'
],
rows
:
[
{
date
:
'2018-11-01'
,
orderCount
:
10
,
orderAmount
:
1093
},
{
date
:
'2018-11-02'
,
orderCount
:
20
,
orderAmount
:
2230
},
{
date
:
'2018-11-03'
,
orderCount
:
33
,
orderAmount
:
3623
},
{
date
:
'2018-11-04'
,
orderCount
:
50
,
orderAmount
:
6423
},
{
date
:
'2018-11-05'
,
orderCount
:
80
,
orderAmount
:
8492
},
{
date
:
'2018-11-06'
,
orderCount
:
60
,
orderAmount
:
6293
},
{
date
:
'2018-11-07'
,
orderCount
:
20
,
orderAmount
:
2293
},
{
date
:
'2018-11-08'
,
orderCount
:
60
,
orderAmount
:
6293
},
{
date
:
'2018-11-09'
,
orderCount
:
50
,
orderAmount
:
5293
},
{
date
:
'2018-11-10'
,
orderCount
:
30
,
orderAmount
:
3293
},
{
date
:
'2018-11-11'
,
orderCount
:
20
,
orderAmount
:
2293
},
{
date
:
'2018-11-12'
,
orderCount
:
80
,
orderAmount
:
8293
},
{
date
:
'2018-11-13'
,
orderCount
:
100
,
orderAmount
:
10293
},
{
date
:
'2018-11-14'
,
orderCount
:
10
,
orderAmount
:
1293
},
{
date
:
'2018-11-15'
,
orderCount
:
40
,
orderAmount
:
4293
}
]
goodsId
:
''
,
supplierId
:
''
,
goodsCategoryId
:
''
}
export
default
{
name
:
'InventoryChart'
,
data
()
{
return
{
categoryOptions
:
[],
supplierOptions
:
[],
goodOptions
:
[],
inventoryList
:
[],
orderCountDate
:
''
,
statusOptions
:
[{
label
:
'启用'
,
...
...
@@ -116,14 +103,8 @@ export default {
total
:
0
,
listLoading
:
false
,
multipleSelection
:
[],
chartSettings
:
{
xAxisType
:
'time'
,
area
:
true
,
axisSite
:
{
right
:
[
'orderAmount'
]
},
labelMap
:
{
'orderCount'
:
'订单数量'
,
'orderAmount'
:
'订单金额'
}
},
chartData
:
{
columns
:
[],
columns
:
[
'data'
,
'num'
],
rows
:
[]
},
loading
:
false
,
...
...
@@ -131,8 +112,8 @@ export default {
}
},
created
()
{
this
.
initOrderCountDate
()
this
.
getData
()
this
.
getSuppliersList
()
//
this.getData()
},
filters
:
{
formatTime
(
time
)
{
...
...
@@ -143,6 +124,97 @@ export default {
}
},
methods
:
{
getDay
(
num
,
str
)
{
var
today
=
new
Date
()
var
nowTime
=
today
.
getTime
()
var
ms
=
24
*
3600
*
1000
*
num
today
.
setTime
(
parseInt
(
nowTime
+
ms
))
var
oYear
=
today
.
getFullYear
()
var
oMoth
=
(
today
.
getMonth
()
+
1
).
toString
()
if
(
oMoth
.
length
<=
1
)
oMoth
=
'0'
+
oMoth
var
oDay
=
today
.
getDate
().
toString
()
if
(
oDay
.
length
<=
1
)
oDay
=
'0'
+
oDay
return
oYear
+
str
+
oMoth
+
str
+
oDay
},
formatDate
(
date
)
{
date
=
new
Date
(
date
)
let
myyear
=
date
.
getFullYear
()
let
mymonth
=
date
.
getMonth
()
+
1
let
myweekday
=
date
.
getDate
()
mymonth
<
10
?
mymonth
=
'0'
+
mymonth
:
mymonth
myweekday
<
10
?
myweekday
=
'0'
+
myweekday
:
myweekday
return
`
${
myyear
}
-
${
mymonth
}
-
${
myweekday
}
`
},
mGetDate
()
{
var
date
=
new
Date
()
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
var
d
=
new
Date
(
year
,
month
,
0
)
return
d
.
getDate
()
},
getNowM
(
e
)
{
let
now
=
new
Date
()
let
current_month_num
=
this
.
mGetDate
()
let
current_month
=
[]
for
(
let
i
=
1
;
i
<=
current_month_num
;
i
++
)
{
let
day
=
now
.
setDate
(
i
)
let
everyDay
=
this
.
formatDate
(
day
)
current_month
.
push
(
everyDay
)
}
console
.
log
(
'current_month'
,
current_month
)
return
current_month
},
getWeekDay
()
{
let
that
=
this
let
dateString
=
that
.
formatDate
(
new
Date
())
//当天的日期,例如2020-2-28
let
presentDate
=
new
Date
(
dateString
)
let
today
=
presentDate
.
getDay
()
!==
0
?
presentDate
.
getDay
()
:
7
return
Array
.
from
(
new
Array
(
7
),
function
(
val
,
index
)
{
return
that
.
formatDate
(
new
Date
(
presentDate
.
getTime
()
-
(
today
-
index
-
1
)
*
24
*
60
*
60
*
1000
))
})
},
handleOpenCate
(
visible
)
{
if
(
visible
)
{
this
.
getGoodsCategoryList
()
}
},
handleOpenGoods
(
visible
)
{
if
(
visible
)
{
this
.
getGoodsList
()
}
},
// 物品
getGoodsList
()
{
getGoodsList
({
goodsCategoryI
:
this
.
listQuery
.
goodsCategoryId
,
supplierId
:
this
.
listQuery
.
supplierId
}).
then
(
res
=>
{
this
.
goodOptions
=
res
.
data
.
list
})
},
// 物品类别
getGoodsCategoryList
()
{
getGoodsCategoryList
({
supplierId
:
this
.
listQuery
.
supplierId
}).
then
(
res
=>
{
this
.
categoryOptions
=
res
.
data
.
list
})
},
// 供应商
getSuppliersList
()
{
getSuppliersList
().
then
(
res
=>
{
this
.
supplierOptions
=
res
.
data
.
list
})
},
getList
()
{
if
(
!
this
.
listQuery
.
goodsId
){
this
.
$message
.
warning
(
'请选择物品'
)
return
}
getInventoryList
({
dateList
:
this
.
getWeekDay
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
this
.
chartData
.
rows
=
res
.
data
console
.
log
(
'res'
,
this
.
chartData
)
})
},
handleResetSearch
()
{
this
.
listQuery
=
Object
.
assign
({},
defaultListQuery
)
this
.
getList
()
...
...
@@ -151,39 +223,10 @@ export default {
this
.
listQuery
.
pageNum
=
1
this
.
getList
()
},
handleSelectionChange
(
vals
)
{
this
.
multipleSelection
=
vals
},
initOrderCountDate
()
{
let
start
=
new
Date
()
start
.
setFullYear
(
2018
)
start
.
setMonth
(
10
)
start
.
setDate
(
1
)
const
end
=
new
Date
()
end
.
setTime
(
start
.
getTime
()
+
1000
*
60
*
60
*
24
*
7
)
this
.
orderCountDate
=
[
start
,
end
]
},
getData
()
{
setTimeout
(()
=>
{
this
.
chartData
=
{
columns
:
[
'date'
,
'orderCount'
,
'orderAmount'
],
rows
:
[]
}
for
(
let
i
=
0
;
i
<
DATA_FROM_BACKEND
.
rows
.
length
;
i
++
)
{
let
item
=
DATA_FROM_BACKEND
.
rows
[
i
]
let
currDate
=
str2Date
(
item
.
date
)
let
start
=
this
.
orderCountDate
[
0
]
let
end
=
this
.
orderCountDate
[
1
]
if
(
currDate
.
getTime
()
>=
start
.
getTime
()
&&
currDate
.
getTime
()
<=
end
.
getTime
())
{
this
.
chartData
.
rows
.
push
(
item
)
}
}
this
.
dataEmpty
=
false
this
.
loading
=
false
},
1000
)
},
handleAdd
(){
handleAdd
()
{
this
.
$refs
.
addGoods
.
add
()
}
}
...
...
@@ -204,7 +247,8 @@ export default {
.input-width
{
width
:
180px
;
}
.btn-groups
button
{
.btn-groups
button
{
width
:
100px
;
}
</
style
>
src/views/sta/Recipients.vue
View file @
6d75d46a
...
...
@@ -7,36 +7,38 @@
:model=
"listQuery"
size=
"small"
>
<el-form-item
label=
"供应商:"
>
<el-select
v-model=
"listQuery.s
tatus
"
<el-select
v-model=
"listQuery.s
upplierId
"
class=
"input-width"
clearable
placeholder=
"请选择供应商"
>
<el-option
v-for=
"item in s
tatus
Options"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
></el-option>
<el-option
v-for=
"item in s
upplier
Options"
:key=
"item.
id
"
:label=
"item.
supplierName
"
:value=
"item.
id
"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物品类别:"
>
<el-select
v-model=
"listQuery.
status
"
<el-select
v-model=
"listQuery.
goodsCategoryId
"
class=
"input-width"
clearable
placeholder=
"请选择物品类别"
>
<el-option
v-for=
"item in statusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
placeholder=
"请选择物品类别"
@
visible-change=
"handleOpenCate"
>
<el-option
v-for=
"item in categoryOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"物品:"
>
<el-select
v-model=
"listQuery.
status
"
<el-select
v-model=
"listQuery.
goodsId
"
class=
"input-width"
clearable
placeholder=
"请选择物品"
>
<el-option
v-for=
"item in statusOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
placeholder=
"请选择物品"
@
visible-change=
"handleOpenGoods"
>
<el-option
v-for=
"item in goodOptions"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
...
...
@@ -60,7 +62,7 @@
:legend-visible=
"false"
:loading=
"loading"
:data-empty=
"dataEmpty"
:settings=
"chartSettings"
></ve-line>
></ve-line>
</div>
</el-card>
</div>
...
...
@@ -68,40 +70,25 @@
<
script
>
import
moment
from
'moment'
import
{
str2Date
}
from
'@/utils/date'
import
{
getSupplier
,
getAuditDetail
,
updateMcht
}
from
'@/api/audit'
import
{
getSuppliersList
}
from
'@/api/supplier'
import
{
getGoodsList
,
getGoodsCategoryList
}
from
'@/api/inventory'
import
{
getRecipientList
}
from
'@/api/report'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
pageSize
:
10
,
accouuntType
:
1
,
name
:
''
,
phone
:
''
,
status
:
''
}
const
DATA_FROM_BACKEND
=
{
columns
:
[
'date'
,
'orderCount'
,
'orderAmount'
],
rows
:
[
{
date
:
'2018-11-01'
,
orderCount
:
10
,
orderAmount
:
1093
},
{
date
:
'2018-11-02'
,
orderCount
:
20
,
orderAmount
:
2230
},
{
date
:
'2018-11-03'
,
orderCount
:
33
,
orderAmount
:
3623
},
{
date
:
'2018-11-04'
,
orderCount
:
50
,
orderAmount
:
6423
},
{
date
:
'2018-11-05'
,
orderCount
:
80
,
orderAmount
:
8492
},
{
date
:
'2018-11-06'
,
orderCount
:
60
,
orderAmount
:
6293
},
{
date
:
'2018-11-07'
,
orderCount
:
20
,
orderAmount
:
2293
},
{
date
:
'2018-11-08'
,
orderCount
:
60
,
orderAmount
:
6293
},
{
date
:
'2018-11-09'
,
orderCount
:
50
,
orderAmount
:
5293
},
{
date
:
'2018-11-10'
,
orderCount
:
30
,
orderAmount
:
3293
},
{
date
:
'2018-11-11'
,
orderCount
:
20
,
orderAmount
:
2293
},
{
date
:
'2018-11-12'
,
orderCount
:
80
,
orderAmount
:
8293
},
{
date
:
'2018-11-13'
,
orderCount
:
100
,
orderAmount
:
10293
},
{
date
:
'2018-11-14'
,
orderCount
:
10
,
orderAmount
:
1293
},
{
date
:
'2018-11-15'
,
orderCount
:
40
,
orderAmount
:
4293
}
]
goodsId
:
''
,
supplierId
:
''
,
goodsCategoryId
:
''
}
export
default
{
name
:
'Recipients'
,
data
()
{
return
{
categoryOptions
:
[],
supplierOptions
:
[],
goodOptions
:
[],
inventoryList
:
[],
orderCountDate
:
''
,
statusOptions
:
[{
label
:
'启用'
,
...
...
@@ -116,14 +103,8 @@ export default {
total
:
0
,
listLoading
:
false
,
multipleSelection
:
[],
chartSettings
:
{
xAxisType
:
'time'
,
area
:
true
,
axisSite
:
{
right
:
[
'orderAmount'
]
},
labelMap
:
{
'orderCount'
:
'订单数量'
,
'orderAmount'
:
'订单金额'
}
},
chartData
:
{
columns
:
[],
columns
:
[
'data'
,
'num'
],
rows
:
[]
},
loading
:
false
,
...
...
@@ -131,8 +112,8 @@ export default {
}
},
created
()
{
this
.
initOrderCountDate
()
this
.
getData
()
this
.
getSuppliersList
()
//
this.getData()
},
filters
:
{
formatTime
(
time
)
{
...
...
@@ -143,6 +124,96 @@ export default {
}
},
methods
:
{
getDay
(
num
,
str
)
{
var
today
=
new
Date
()
var
nowTime
=
today
.
getTime
()
var
ms
=
24
*
3600
*
1000
*
num
today
.
setTime
(
parseInt
(
nowTime
+
ms
))
var
oYear
=
today
.
getFullYear
()
var
oMoth
=
(
today
.
getMonth
()
+
1
).
toString
()
if
(
oMoth
.
length
<=
1
)
oMoth
=
'0'
+
oMoth
var
oDay
=
today
.
getDate
().
toString
()
if
(
oDay
.
length
<=
1
)
oDay
=
'0'
+
oDay
return
oYear
+
str
+
oMoth
+
str
+
oDay
},
formatDate
(
date
)
{
date
=
new
Date
(
date
)
let
myyear
=
date
.
getFullYear
()
let
mymonth
=
date
.
getMonth
()
+
1
let
myweekday
=
date
.
getDate
()
mymonth
<
10
?
mymonth
=
'0'
+
mymonth
:
mymonth
myweekday
<
10
?
myweekday
=
'0'
+
myweekday
:
myweekday
return
`
${
myyear
}
-
${
mymonth
}
-
${
myweekday
}
`
},
mGetDate
()
{
var
date
=
new
Date
()
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
var
d
=
new
Date
(
year
,
month
,
0
)
return
d
.
getDate
()
},
getNowM
(
e
)
{
let
now
=
new
Date
()
let
current_month_num
=
this
.
mGetDate
()
let
current_month
=
[]
for
(
let
i
=
1
;
i
<=
current_month_num
;
i
++
)
{
let
day
=
now
.
setDate
(
i
)
let
everyDay
=
this
.
formatDate
(
day
)
current_month
.
push
(
everyDay
)
}
console
.
log
(
'current_month'
,
current_month
)
return
current_month
},
getWeekDay
()
{
let
that
=
this
let
dateString
=
that
.
formatDate
(
new
Date
())
//当天的日期,例如2020-2-28
let
presentDate
=
new
Date
(
dateString
)
let
today
=
presentDate
.
getDay
()
!==
0
?
presentDate
.
getDay
()
:
7
return
Array
.
from
(
new
Array
(
7
),
function
(
val
,
index
)
{
return
that
.
formatDate
(
new
Date
(
presentDate
.
getTime
()
-
(
today
-
index
-
1
)
*
24
*
60
*
60
*
1000
))
})
},
handleOpenCate
(
visible
)
{
if
(
visible
)
{
this
.
getGoodsCategoryList
()
}
},
handleOpenGoods
(
visible
)
{
if
(
visible
)
{
this
.
getGoodsList
()
}
},
// 物品
getGoodsList
()
{
getGoodsList
({
goodsCategoryI
:
this
.
listQuery
.
goodsCategoryId
,
supplierId
:
this
.
listQuery
.
supplierId
}).
then
(
res
=>
{
this
.
goodOptions
=
res
.
data
.
list
})
},
// 物品类别
getGoodsCategoryList
()
{
getGoodsCategoryList
({
supplierId
:
this
.
listQuery
.
supplierId
}).
then
(
res
=>
{
this
.
categoryOptions
=
res
.
data
.
list
})
},
// 供应商
getSuppliersList
()
{
getSuppliersList
().
then
(
res
=>
{
this
.
supplierOptions
=
res
.
data
.
list
})
},
getList
()
{
if
(
!
this
.
listQuery
.
goodsId
){
this
.
$message
.
warning
(
'请选择物品'
)
return
}
getRecipientList
({
dateList
:
this
.
getWeekDay
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
this
.
chartData
.
rows
=
res
.
data
})
},
handleResetSearch
()
{
this
.
listQuery
=
Object
.
assign
({},
defaultListQuery
)
this
.
getList
()
...
...
@@ -151,39 +222,10 @@ export default {
this
.
listQuery
.
pageNum
=
1
this
.
getList
()
},
handleSelectionChange
(
vals
)
{
this
.
multipleSelection
=
vals
},
initOrderCountDate
()
{
let
start
=
new
Date
()
start
.
setFullYear
(
2018
)
start
.
setMonth
(
10
)
start
.
setDate
(
1
)
const
end
=
new
Date
()
end
.
setTime
(
start
.
getTime
()
+
1000
*
60
*
60
*
24
*
7
)
this
.
orderCountDate
=
[
start
,
end
]
},
getData
()
{
setTimeout
(()
=>
{
this
.
chartData
=
{
columns
:
[
'date'
,
'orderCount'
,
'orderAmount'
],
rows
:
[]
}
for
(
let
i
=
0
;
i
<
DATA_FROM_BACKEND
.
rows
.
length
;
i
++
)
{
let
item
=
DATA_FROM_BACKEND
.
rows
[
i
]
let
currDate
=
str2Date
(
item
.
date
)
let
start
=
this
.
orderCountDate
[
0
]
let
end
=
this
.
orderCountDate
[
1
]
if
(
currDate
.
getTime
()
>=
start
.
getTime
()
&&
currDate
.
getTime
()
<=
end
.
getTime
())
{
this
.
chartData
.
rows
.
push
(
item
)
}
}
this
.
dataEmpty
=
false
this
.
loading
=
false
},
1000
)
},
handleAdd
(){
handleAdd
()
{
this
.
$refs
.
addGoods
.
add
()
}
}
...
...
@@ -204,7 +246,8 @@ export default {
.input-width
{
width
:
180px
;
}
.btn-groups
button
{
.btn-groups
button
{
width
:
100px
;
}
</
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