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
ca559480
Commit
ca559480
authored
Aug 13, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库房,部门,类别增加修改功能
parent
3a62844c
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
241 additions
and
28 deletions
+241
-28
inventory.js
src/api/inventory.js
+10
-0
DepartmentList.vue
src/views/dep/DepartmentList.vue
+6
-0
addDepartmentModal.vue
src/views/dep/modules/addDepartmentModal.vue
+20
-1
GoodsCateogory.vue
src/views/inv/GoodsCateogory.vue
+10
-0
StoreList.vue
src/views/inv/StoreList.vue
+32
-22
WarehouseAdmin.vue
src/views/inv/WarehouseAdmin.vue
+1
-1
addCategory.vue
src/views/inv/modules/addCategory.vue
+20
-1
updateNumModal.vue
src/views/inv/modules/updateNumModal.vue
+16
-3
updateStoreModal.vue
src/views/inv/modules/updateStoreModal.vue
+126
-0
No files found.
src/api/inventory.js
View file @
ca559480
...
@@ -100,6 +100,16 @@ export function addGoods(params) {
...
@@ -100,6 +100,16 @@ export function addGoods(params) {
params
params
})
})
}
}
// 万科后台_根据物品id修改一条数据
export
function
updateGoods
(
data
)
{
return
request
({
url
:
'vankeGoods/updateGoods'
,
method
:
'post'
,
data
})
}
// 万科后台_插入多条物品信息
// 万科后台_插入多条物品信息
export
function
addGoodList
(
data
)
{
export
function
addGoodList
(
data
)
{
return
request
({
return
request
({
...
...
src/views/dep/DepartmentList.vue
View file @
ca559480
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
align=
"center"
>
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
<el-button
size=
"mini"
type=
"warning"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"danger"
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
</
template
>
</
template
>
...
@@ -120,6 +123,9 @@ export default {
...
@@ -120,6 +123,9 @@ export default {
handleAdd
(){
handleAdd
(){
this
.
$refs
.
addDepartment
.
add
()
this
.
$refs
.
addDepartment
.
add
()
},
},
handleUpdate
(
row
){
this
.
$refs
.
addDepartment
.
update
(
row
)
},
// 删除
// 删除
handleDelete
(
id
){
handleDelete
(
id
){
this
.
$confirm
(
'是否删除该部门?'
,
'提示'
,
{
this
.
$confirm
(
'是否删除该部门?'
,
'提示'
,
{
...
...
src/views/dep/modules/addDepartmentModal.vue
View file @
ca559480
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</el-dialog>
</el-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
addDepart
}
from
'@/api/inventory'
import
{
addDepart
,
editDepart
}
from
'@/api/inventory'
// 移动属性
// 移动属性
export
default
{
export
default
{
name
:
'addDepartmentModal'
,
name
:
'addDepartmentModal'
,
...
@@ -54,6 +54,14 @@ export default {
...
@@ -54,6 +54,14 @@ export default {
this
.
init
()
this
.
init
()
this
.
visible
=
true
this
.
visible
=
true
},
},
update
(
row
){
let
obj
=
JSON
.
stringify
(
row
)
this
.
title
=
"修改部门"
this
.
init
()
this
.
model
=
JSON
.
parse
(
obj
)
this
.
id
=
this
.
model
.
id
this
.
visible
=
true
},
// detail (id) {
// detail (id) {
// this.id = id
// this.id = id
// this.init()
// this.init()
...
@@ -73,6 +81,15 @@ export default {
...
@@ -73,6 +81,15 @@ export default {
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 验证通过
// 验证通过
if
(
this
.
id
){
editDepart
({
id
:
this
.
id
,
name
:
this
.
model
.
name
}).
then
(
res
=>
{
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'ok'
)
}).
catch
(
err
=>
{
this
.
loading
=
false
})
}
else
{
addDepart
(
this
.
model
).
then
(
res
=>
{
addDepart
(
this
.
model
).
then
(
res
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
visible
=
false
this
.
visible
=
false
...
@@ -81,6 +98,8 @@ export default {
...
@@ -81,6 +98,8 @@ export default {
this
.
loading
=
false
this
.
loading
=
false
})
})
}
}
}
})
})
},
},
close
()
{
close
()
{
...
...
src/views/inv/GoodsCateogory.vue
View file @
ca559480
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
align=
"center"
>
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
</
template
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"创建人"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createName
}}
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
<el-table-column
label=
"创建时间"
align=
"center"
>
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createtime
|
formatTime
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createtime
|
formatTime
}}
</
template
>
...
@@ -26,6 +30,9 @@
...
@@ -26,6 +30,9 @@
align=
"center"
>
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
<el-button
size=
"mini"
type=
"warning"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"danger"
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
</
template
>
</
template
>
...
@@ -120,6 +127,9 @@ export default {
...
@@ -120,6 +127,9 @@ export default {
handleAdd
(){
handleAdd
(){
this
.
$refs
.
addCategory
.
add
()
this
.
$refs
.
addCategory
.
add
()
},
},
handleUpdate
(
row
){
this
.
$refs
.
addCategory
.
update
(
row
)
},
// 删除
// 删除
handleDelete
(
id
){
handleDelete
(
id
){
this
.
$confirm
(
'是否删除该物品类别?'
,
'提示'
,
{
this
.
$confirm
(
'是否删除该物品类别?'
,
'提示'
,
{
...
...
src/views/inv/StoreList.vue
View file @
ca559480
...
@@ -108,14 +108,17 @@
...
@@ -108,14 +108,17 @@
align=
"center"
>
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
stockRoomName
||
'--'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
stockRoomName
||
'--'
}}
</
template
>
</el-table-column>
</el-table-column>
<!-- <el-table-column label="操作"-->
<el-table-column
label=
"操作"
<!-- align="center">-->
align=
"center"
>
<!-- <template slot-scope="scope">-->
<
template
slot-scope=
"scope"
>
<!-- <el-button size="mini"-->
<el-button
size=
"mini"
<!-- type="danger"-->
type=
"warning"
<!-- @click="handleDelete(scope.row.id)">删除</el-button>-->
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<!-- </template>-->
<el-button
size=
"mini"
<!-- </el-table-column>-->
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-table>
</div>
</div>
<!-- 分页栏 -->
<!-- 分页栏 -->
...
@@ -136,16 +139,18 @@
...
@@ -136,16 +139,18 @@
<import-goods-modal
ref=
"importGoods"
@
ok=
"getList"
></import-goods-modal>
<import-goods-modal
ref=
"importGoods"
@
ok=
"getList"
></import-goods-modal>
<scan-put-storage
ref=
"scanPut"
@
ok=
"getList"
></scan-put-storage>
<scan-put-storage
ref=
"scanPut"
@
ok=
"getList"
></scan-put-storage>
<scan-out-storage
ref=
"scanOut"
@
ok=
"getList"
></scan-out-storage>
<scan-out-storage
ref=
"scanOut"
@
ok=
"getList"
></scan-out-storage>
<update-store-modal
ref=
"updateStore"
@
ok=
"getList"
></update-store-modal>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
moment
from
'moment'
import
moment
from
'moment'
import
{
getGoodsList
,
getGoodsCategoryList
,
getStockRooms
,
edit
Goods
}
from
'@/api/inventory'
import
{
getGoodsList
,
getGoodsCategoryList
,
getStockRooms
,
update
Goods
}
from
'@/api/inventory'
import
{
getSuppliersList
}
from
'@/api/supplier'
import
{
getSuppliersList
}
from
'@/api/supplier'
import
AddGoodsModal
from
'./modules/addGoodsModal'
import
AddGoodsModal
from
'./modules/addGoodsModal'
import
ImportGoodsModal
from
'./modules/importGoodsModal'
import
ImportGoodsModal
from
'./modules/importGoodsModal'
import
ScanPutStorage
from
'./modules/scanPutStorage'
import
ScanPutStorage
from
'./modules/scanPutStorage'
import
ScanOutStorage
from
'./modules/scanOutStorage'
import
ScanOutStorage
from
'./modules/scanOutStorage'
import
UpdateStoreModal
from
'./modules/updateStoreModal'
// 列表查询参数默认值
// 列表查询参数默认值
const
defaultListQuery
=
{
const
defaultListQuery
=
{
pageNum
:
1
,
pageNum
:
1
,
...
@@ -162,7 +167,8 @@ export default {
...
@@ -162,7 +167,8 @@ export default {
ScanOutStorage
,
ScanOutStorage
,
AddGoodsModal
,
AddGoodsModal
,
ImportGoodsModal
,
ImportGoodsModal
,
ScanPutStorage
ScanPutStorage
,
UpdateStoreModal
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -212,18 +218,22 @@ export default {
...
@@ -212,18 +218,22 @@ export default {
this
.
multipleSelection
=
vals
this
.
multipleSelection
=
vals
},
},
// 删除
// 删除
// handleDelete(id){
handleDelete
(
id
){
// this.$confirm('是否删除该物品?', '提示', {
this
.
$confirm
(
'是否删除该物品?'
,
'提示'
,
{
// confirmButtonText: '确定',
confirmButtonText
:
'确定'
,
// cancelButtonText: '取消',
cancelButtonText
:
'取消'
,
// type: 'warning'
type
:
'warning'
// }).then(() => {
}).
then
(()
=>
{
// editGoods({id: id,deleteStatus: 0 }).then(res=>{
updateGoods
({
id
:
id
,
deleteStatus
:
0
}).
then
(
res
=>
{
// this.getList()
this
.
getList
()
// })
})
// }).catch(() => {
}).
catch
(()
=>
{
// });
});
// },
},
// 修改
handleUpdate
(
row
){
this
.
$refs
.
updateStore
.
update
(
row
)
},
// 物品类别
// 物品类别
getGoodsCategoryList
(){
getGoodsCategoryList
(){
getGoodsCategoryList
().
then
(
res
=>
{
getGoodsCategoryList
().
then
(
res
=>
{
...
...
src/views/inv/WarehouseAdmin.vue
View file @
ca559480
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
<
script
>
<
script
>
import
moment
from
'moment'
import
moment
from
'moment'
import
{
getOutboundRecordList
,
getGoodsCategoryList
,
getStockRooms
,
getDepartmentList
,
updateOutboundRecord
}
from
'@/api/inventory'
import
{
getOutboundRecordList
,
getGoodsCategoryList
,
getStockRooms
,
getDepartmentList
,
updateOutboundRecord
}
from
'@/api/inventory'
import
UpdateNumModal
from
'./modules/
U
pdateNumModal'
import
UpdateNumModal
from
'./modules/
u
pdateNumModal'
// 列表查询参数默认值
// 列表查询参数默认值
const
defaultListQuery
=
{
const
defaultListQuery
=
{
pageNum
:
1
,
pageNum
:
1
,
...
...
src/views/inv/modules/addCategory.vue
View file @
ca559480
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
</el-dialog>
</el-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
addGoodsCategory
}
from
'@/api/inventory'
import
{
addGoodsCategory
,
editGoodsCategory
}
from
'@/api/inventory'
// 移动属性
// 移动属性
export
default
{
export
default
{
name
:
'addCategory'
,
name
:
'addCategory'
,
...
@@ -54,6 +54,14 @@ export default {
...
@@ -54,6 +54,14 @@ export default {
this
.
init
()
this
.
init
()
this
.
visible
=
true
this
.
visible
=
true
},
},
update
(
row
){
let
obj
=
JSON
.
stringify
(
row
)
this
.
title
=
"修改物品类别"
this
.
init
()
this
.
model
=
JSON
.
parse
(
obj
)
this
.
id
=
this
.
model
.
id
this
.
visible
=
true
},
// detail (id) {
// detail (id) {
// this.id = id
// this.id = id
// this.init()
// this.init()
...
@@ -73,6 +81,15 @@ export default {
...
@@ -73,6 +81,15 @@ export default {
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 验证通过
// 验证通过
if
(
this
.
id
){
editGoodsCategory
({
id
:
this
.
id
,
name
:
this
.
model
.
name
}).
then
(
res
=>
{
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'ok'
)
}).
catch
(
err
=>
{
this
.
loading
=
false
})
}
else
{
addGoodsCategory
(
this
.
model
).
then
(
res
=>
{
addGoodsCategory
(
this
.
model
).
then
(
res
=>
{
this
.
loading
=
false
this
.
loading
=
false
this
.
visible
=
false
this
.
visible
=
false
...
@@ -81,6 +98,8 @@ export default {
...
@@ -81,6 +98,8 @@ export default {
this
.
loading
=
false
this
.
loading
=
false
})
})
}
}
}
})
})
},
},
close
()
{
close
()
{
...
...
src/views/inv/modules/
U
pdateNumModal.vue
→
src/views/inv/modules/
u
pdateNumModal.vue
View file @
ca559480
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<el-dialog
:visible
.
sync=
"visible"
<el-dialog
:visible
.
sync=
"visible"
:title=
"title"
:title=
"title"
center
center
@
close=
"close"
width=
"500px"
>
width=
"500px"
>
<!-- start -->
<!-- start -->
<el-form
:model=
"model"
<el-form
:model=
"model"
...
@@ -18,7 +19,7 @@
...
@@ -18,7 +19,7 @@
<span>
{{
model
.
categoryName
}}
</span>
<span>
{{
model
.
categoryName
}}
</span>
</el-form-item>
</el-form-item>
<el-form-item
label=
"出库数量:"
<el-form-item
label=
"出库数量:"
:rules=
"[
{
required: true, trigger: 'blur', message: '请输入出库数量
'}]"
:rules=
"[
{
validator: validateNum,trigger: 'blur
'}]"
prop="outboundNum">
prop="outboundNum">
<el-input
size=
"small"
<el-input
size=
"small"
class=
"input-width"
class=
"input-width"
...
@@ -47,9 +48,21 @@
...
@@ -47,9 +48,21 @@
import
{
updateOutboundRecord
}
from
'@/api/inventory'
import
{
updateOutboundRecord
}
from
'@/api/inventory'
// 移动属性
// 移动属性
export
default
{
export
default
{
name
:
'
U
pdateNumModal'
,
name
:
'
u
pdateNumModal'
,
data
()
{
data
()
{
var
validateNum
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'数量不能为空'
))
}
else
{
let
myReg
=
/^
\d{1,}
$/
if
(
!
myReg
.
test
(
value
))
{
callback
(
new
Error
(
'数量必须为正整数'
))
}
callback
()
}
}
return
{
return
{
validateNum
:
validateNum
,
visible
:
false
,
visible
:
false
,
title
:
null
,
title
:
null
,
loading
:
false
,
loading
:
false
,
...
@@ -87,7 +100,7 @@ export default {
...
@@ -87,7 +100,7 @@ export default {
})
})
},
},
close
()
{
close
()
{
this
.
$emit
(
'
close
'
)
this
.
$emit
(
'
ok
'
)
this
.
visible
=
false
this
.
visible
=
false
}
}
}
}
...
...
src/views/inv/modules/updateStoreModal.vue
0 → 100644
View file @
ca559480
<
template
>
<el-dialog
:visible
.
sync=
"visible"
:title=
"title"
center
@
close=
"close"
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-item
label=
"型号:"
:rules=
"[
{required: true, trigger: 'blur', message: '请输入型号'}]"
prop="goodsNo">
<el-input
size=
"small"
class=
"input-width"
placeholder=
"请输入型号"
v-model=
"model.goodsNo"
></el-input>
</el-form-item>
<el-form-item
label=
"数量:"
:rules=
"[
{validator: validateNum,trigger: 'blur'}]"
prop="goodsNum">
<el-input
size=
"small"
class=
"input-width"
placeholder=
"请输入数量"
v-model=
"model.goodsNum"
></el-input>
</el-form-item>
<el-form-item
label=
"条形码:"
>
<span>
{{
model
.
barCode
}}
</span>
</el-form-item>
<el-form-item
label=
"物品类别:"
>
<span>
{{
model
.
goodsCategoryName
}}
</span>
</el-form-item>
<el-form-item
label=
"价格:"
>
<span>
{{
model
.
price
}}
</span>
</el-form-item>
<el-form-item
label=
"供应商:"
>
<span>
{{
model
.
supplierName
}}
</span>
</el-form-item>
<el-form-item
label=
"所属库房:"
>
<span>
{{
model
.
stockRoomName
}}
</span>
</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
{
updateGoods
}
from
'@/api/inventory'
// 移动属性
export
default
{
name
:
'updateStoreModal'
,
data
()
{
var
validateNum
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
)
{
callback
(
new
Error
(
'数量不能为空'
))
}
else
{
let
myReg
=
/^
\d{1,}
$/
if
(
!
myReg
.
test
(
value
))
{
callback
(
new
Error
(
'数量必须为正整数'
))
}
callback
()
}
}
return
{
validateNum
:
validateNum
,
visible
:
false
,
title
:
null
,
loading
:
false
,
id
:
null
,
model
:
{}
}
},
methods
:
{
init
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
.
attributeForm
.
clearValidate
()
})
},
update
(
row
){
this
.
id
=
null
this
.
title
=
"修改出库数量"
this
.
init
()
this
.
model
=
row
this
.
visible
=
true
},
// 提交保存
submit
()
{
this
.
$refs
.
attributeForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
// 验证通过
updateGoods
(
this
.
model
).
then
(
res
=>
{
this
.
loading
=
false
this
.
visible
=
false
this
.
$emit
(
'ok'
)
}).
catch
(
err
=>
{
this
.
loading
=
false
})
}
})
},
close
()
{
this
.
$emit
(
'ok'
)
this
.
visible
=
false
}
}
}
</
script
>
<
style
scoped
>
.input-width
{
width
:
200px
;
}
</
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