Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psa-web
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
高滢
psa-web
Commits
c99207e4
Commit
c99207e4
authored
Mar 24, 2025
by
ZhangRunSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物资草稿
parent
78ceddfc
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
475 additions
and
93 deletions
+475
-93
entry.js
src/api/material/entry.js
+16
-1
material.js
src/api/material/material.js
+9
-0
add.vue
src/views/material/add.vue
+13
-2
draft.vue
src/views/material/draft.vue
+81
-62
edit.vue
src/views/material/edit.vue
+6
-2
index.vue
src/views/material/index.vue
+3
-1
draft.vue
src/views/materialentry/draft.vue
+338
-0
edit.vue
src/views/materialentry/edit.vue
+4
-4
index.vue
src/views/materialentry/index.vue
+5
-21
No files found.
src/api/material/entry.js
View file @
c99207e4
...
@@ -8,7 +8,14 @@ export function listEntry(query) {
...
@@ -8,7 +8,14 @@ export function listEntry(query) {
params
:
query
params
:
query
})
})
}
}
// 查询草稿箱列表
export
function
listDraftEntry
(
query
)
{
return
request
({
url
:
'/psa/entry/list/draft'
,
method
:
'get'
,
params
:
query
})
}
// 查询物品入库信息详细
// 查询物品入库信息详细
export
function
getEntry
(
id
)
{
export
function
getEntry
(
id
)
{
return
request
({
return
request
({
...
@@ -33,6 +40,14 @@ export function addDraft(data) {
...
@@ -33,6 +40,14 @@ export function addDraft(data) {
data
:
data
data
:
data
})
})
}
}
// 提交草稿
export
function
addDraftSubmit
(
data
)
{
return
request
({
url
:
'/psa/entry/add/draft'
,
method
:
'post'
,
data
:
data
})
}
// 修改物品入库信息
// 修改物品入库信息
export
function
updateEntry
(
data
)
{
export
function
updateEntry
(
data
)
{
return
request
({
return
request
({
...
...
src/api/material/material.js
View file @
c99207e4
...
@@ -9,6 +9,15 @@ export function listMaterial(query) {
...
@@ -9,6 +9,15 @@ export function listMaterial(query) {
})
})
}
}
// 查询草稿箱列表
export
function
listMaterialDraft
(
query
)
{
return
request
({
url
:
'/psa/material/list/draft'
,
method
:
'get'
,
params
:
query
})
}
// 查询物品信息详细
// 查询物品信息详细
export
function
getMaterial
(
materialId
)
{
export
function
getMaterial
(
materialId
)
{
return
request
({
return
request
({
...
...
src/views/material/add.vue
View file @
c99207e4
...
@@ -82,7 +82,17 @@ const headOptions = ref([])
...
@@ -82,7 +82,17 @@ const headOptions = ref([])
const
managerOptions
=
ref
([])
const
managerOptions
=
ref
([])
const
membersOptions
=
ref
([])
const
membersOptions
=
ref
([])
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{},
form
:
{
typeId
:
null
,
typeName
:
null
,
materialName
:
null
,
itemId
:
null
,
stock
:
null
,
unit
:
null
,
remark
:
null
,
delFlag
:
null
,
draft
:
null
},
})
})
const
{
form
}
=
toRefs
(
data
);
const
{
form
}
=
toRefs
(
data
);
...
@@ -147,7 +157,8 @@ const saveDraft = () => {
...
@@ -147,7 +157,8 @@ const saveDraft = () => {
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
}).
then
(()
=>
{
}).
then
(()
=>
{
addDraft
(
form
).
then
(
response
=>
{
form
.
value
.
draft
=
"1"
addMaterial
(
form
.
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
){
if
(
response
.
code
===
200
){
proxy
.
$modal
.
msgSuccess
(
"草稿保存成功"
);
proxy
.
$modal
.
msgSuccess
(
"草稿保存成功"
);
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
...
...
src/views/material/draft.vue
View file @
c99207e4
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<div
class=
"formSearch"
>
<div
class=
"formSearch"
>
<el-form
:model=
"queryParams"
ref=
"queryRef"
:inline=
"true"
v-show=
"showSearch"
label-width=
"1
0
0x"
>
<el-form
:model=
"queryParams"
ref=
"queryRef"
:inline=
"true"
v-show=
"showSearch"
label-width=
"1
2
0x"
>
<el-form-item
label=
"物品编号"
prop=
"itemCode"
>
<el-form-item
label=
"物品编号"
prop=
"itemCode"
>
<el-input
<el-input
style=
"width: 220px"
v-model=
"queryParams.itemCode"
v-model=
"queryParams.itemCode"
placeholder=
"请输入物品编号"
placeholder=
"请输入物品编号"
clearable
clearable
@
keyup
.
enter=
"handleQuery"
@
keyup
.
enter=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"物品名称"
prop=
"item
Name
"
>
<el-form-item
label=
"物品名称"
prop=
"item
Id
"
>
<el-input
<el-input
v-model=
"queryParams.itemName"
style=
"width: 220px"
v-model=
"queryParams.itemId"
placeholder=
"请输入物品名称"
placeholder=
"请输入物品名称"
clearable
clearable
@
keyup
.
enter=
"handleQuery"
@
keyup
.
enter=
"handleQuery"
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"物品类型"
prop=
"
itemType
"
>
<el-form-item
label=
"物品类型"
prop=
"
typeId
"
>
<el-select
<el-select
style=
"width: 2
0
0px"
style=
"width: 2
2
0px"
v-model=
"queryParams.
itemType
"
v-model=
"queryParams.
typeId
"
placeholder=
"请选择物品类型"
placeholder=
"请选择物品类型"
>
>
<el-option
<el-option
v-for=
"dict in material_type"
v-for=
"dict in material_type"
:key=
"dict.
value
"
:key=
"dict.
id
"
:label=
"dict.
label
"
:label=
"dict.
typeName
"
:value=
"dict.
value
"
:value=
"dict.
id
"
style=
"width: 100%"
style=
"width: 100%"
/>
/>
</el-select>
</el-select>
...
@@ -51,43 +53,29 @@
...
@@ -51,43 +53,29 @@
</el-form>
</el-form>
</div>
</div>
<div
class=
"contentTable"
>
<div
class=
"contentTable"
>
<div
style=
"padding-left: 8px ;margin-bottom: 20px"
>
<div
style=
"margin-bottom: 18px "
>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
物资信息
</span>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
草稿箱
</span>
<span
style=
"padding-left: 80%"
>
<span
style=
"padding-left: 85%"
>
<el-button
class=
"el-button-primary-pain"
plain
icon=
"Plus"
@
click=
"handleAdd"
v-hasPermi=
"['psa:material:add']"
>
新增物品
</el-button>
<el-tooltip
content=
"草稿箱"
placement=
"top"
>
<el-button
<el-button
type=
"text"
icon=
"ArrowLeft"
plain
class=
"el-button-primary-pain"
@
click=
"handleDraft"
@
click=
"resetback"
>
返回
</el-button>
v-hasPermi=
"['system:project:draft']"
><img
src=
"../../assets/icons/common/rightone.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"导出"
placement=
"top"
>
<el-button
type=
"text"
plain
@
click=
"handleExport"
v-hasPermi=
"['psa:material:export']"
><img
src=
"../../assets/icons/common/print.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
</span>
</span>
</div>
</div>
<el-table
v-loading=
"loading"
:data=
"materialList"
border
style=
"width: 100%"
>
<el-table
v-loading=
"loading"
:data=
"materialList"
border
style=
"width: 100%"
>
<el-table-column
label=
"物品编号"
align=
"center"
prop=
"itemCode"
/>
<el-table-column
label=
"物品编号"
align=
"center"
prop=
"itemCode"
/>
<el-table-column
label=
"物品名称"
align=
"center"
prop=
"itemName"
/>
<el-table-column
label=
"物品类型"
align=
"center"
prop=
"typeId"
>
<el-table-column
label=
"物品类型"
align=
"center"
prop=
"itemType"
/>
<
template
v-slot:default=
"scope"
>
<span>
{{
material_type
.
find
(
item
=>
item
.
id
===
scope
.
row
.
typeId
)?.
typeName
||
'未知类型'
}}
</span>
</
template
>
</el-table-column>
>
<el-table-column
label=
"物品名称"
align=
"center"
prop=
"itemId"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
material_type_detail
.
find
(
item
=>
item
.
id
===
scope
.
row
.
itemId
)?.
materialName
||
'未知类型'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"库存数量"
align=
"center"
prop=
"stock"
/>
<el-table-column
label=
"库存数量"
align=
"center"
prop=
"stock"
/>
<el-table-column
label=
"单位"
align=
"center"
prop=
"unit"
/>
<el-table-column
label=
"单位"
align=
"center"
prop=
"unit"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-popover
placement=
"right"
:width=
"400"
trigger=
"click"
>
<el-popover
placement=
"right"
:width=
"400"
trigger=
"click"
>
...
@@ -115,31 +103,32 @@
...
@@ -115,31 +103,32 @@
</el-button>
</el-button>
</el-tooltip>
</el-tooltip>
<el-tooltip
content=
"删除"
placement=
"top"
>
<el-tooltip
content=
"删除"
placement=
"top"
>
<el-button
link
type=
"text"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['psa:material:
edit
']"
>
<el-button
link
type=
"text"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['psa:material:
remove
']"
>
<img
src=
"../../assets/icons/common/delete.png"
height=
"32"
width=
"32"
/>
<img
src=
"../../assets/icons/common/delete.png"
height=
"32"
width=
"32"
/>
</el-button>
</el-button>
</el-tooltip>
</el-tooltip>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<div
class=
"pagination-containerA"
>
<div
class=
"pagination"
>
<pagination
<pagination
v-show=
"total>0"
layout=
"prev, pager, next, sizes, jumper"
:total=
"total"
v-show=
"total > 0"
v-model:page=
"queryParams.pageNum"
:total=
"total"
v-model:limit=
"queryParams.pageSize"
v-model:page=
"queryParams.pageNum"
@
pagination=
"getList"
v-model:limit=
"queryParams.pageSize"
/>
@
pagination=
"getList"
</div>
/>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
setup
name=
"Material
Draft
"
>
<
script
setup
name=
"Material"
>
import
{
listMaterial
,
getMaterial
,
delMaterial
}
from
"@
/api/material/material"
;
import
{
listMaterial
,
delMaterial
,
listMaterialType
,
listMaterialTypeDetail
,
listMaterialDraft
}
from
"../..
/api/material/material"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
material_type
}
=
proxy
.
useDict
(
'material_type'
);
const
material_type
=
ref
([]
);
const
material_type_detail
=
ref
([]);
const
materialList
=
ref
([]);
const
materialList
=
ref
([]);
const
open
=
ref
(
false
);
const
open
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
loading
=
ref
(
true
);
...
@@ -180,13 +169,17 @@ const { queryParams, form, rules } = toRefs(data);
...
@@ -180,13 +169,17 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询物品信息列表 */
/** 查询物品信息列表 */
function
getList
()
{
function
getList
()
{
loading
.
value
=
true
;
loading
.
value
=
true
;
listMaterial
(
queryParams
.
value
).
then
(
response
=>
{
listMaterial
Draft
(
queryParams
.
value
).
then
(
response
=>
{
materialList
.
value
=
response
.
rows
;
materialList
.
value
=
response
.
rows
;
total
.
value
=
response
.
total
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
loading
.
value
=
false
;
});
});
}
}
const
resetback
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
resetForm
()
}
// 表单重置
// 表单重置
function
reset
()
{
function
reset
()
{
...
@@ -252,8 +245,27 @@ function handleExport() {
...
@@ -252,8 +245,27 @@ function handleExport() {
...
queryParams
.
value
...
queryParams
.
value
},
`material_
${
new
Date
().
getTime
()}
.xlsx`
)
},
`material_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
/** 获取物品类型 */
function
getTypeList
()
{
listMaterialType
().
then
(
response
=>
{
material_type
.
value
=
response
.
data
;
});
}
/** 获取类型的物品列表 */
function
getTypeDetailList
(){
listMaterialTypeDetail
().
then
(
response
=>
{
material_type_detail
.
value
=
response
.
data
;
});
}
getList
();
getList
();
// 在组件挂载时执行
onMounted
(()
=>
{
//获取物品类型
getTypeList
();
//获取物品信息
getTypeDetailList
();
});
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
...
@@ -278,11 +290,18 @@ getList();
...
@@ -278,11 +290,18 @@ getList();
:deep
.el-table
.error-row
{
:deep
.el-table
.error-row
{
--el-table-tr-bg-color
:
var
(
--
el-color-warning-light-9
);
--el-table-tr-bg-color
:
var
(
--
el-color-warning-light-9
);
}
}
.contentTable
{
.pagination-containerA
{
position
:
relative
;
/* 父容器需要相对定位 */
//display: flex;
min-height
:
400px
;
/* 最小高度防止内容过少时变形 */
//justify-content: center; /* 水平居中 */
padding-bottom
:
80px
;
/* 底部留出分页空间 */
padding-right
:
43%
;
}
.pagination
{
position
:
absolute
;
bottom
:
20px
;
/* 距离父容器底部20px */
left
:
60%
;
/* 水平居中关键步骤1 */
transform
:
translateX
(
-50%
);
/* 水平居中关键步骤2 */
margin-right
:
0
;
/* 移除旧代码中的右侧间距 */
z-index
:
1
;
/* 确保分页在表格上方 */
}
}
.el-alert
{
.el-alert
{
...
...
src/views/material/edit.vue
View file @
c99207e4
...
@@ -170,7 +170,9 @@ const handleSubmit = () => {
...
@@ -170,7 +170,9 @@ const handleSubmit = () => {
newItemName
:
form
.
value
.
itemId
,
// 传递用户修改后的物品名称
newItemName
:
form
.
value
.
itemId
,
// 传递用户修改后的物品名称
unit
:
form
.
value
.
unit
,
unit
:
form
.
value
.
unit
,
stock
:
form
.
value
.
stock
,
stock
:
form
.
value
.
stock
,
remark
:
form
.
value
.
remark
remark
:
form
.
value
.
remark
,
draft
:
form
.
value
.
draft
,
delFlag
:
form
.
value
.
delFlag
};
};
updateMaterial
(
submitData
).
then
(
response
=>
{
updateMaterial
(
submitData
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
if
(
response
.
code
===
200
)
{
...
@@ -221,7 +223,9 @@ function resetForm() {
...
@@ -221,7 +223,9 @@ function resetForm() {
updateTime
:
null
,
updateTime
:
null
,
createBy
:
null
,
createBy
:
null
,
updateBy
:
null
,
updateBy
:
null
,
remark
:
null
remark
:
null
,
draft
:
null
,
delFlag
:
null
};
};
proxy
.
resetForm
(
"materialRef"
);
proxy
.
resetForm
(
"materialRef"
);
}
}
...
...
src/views/material/index.vue
View file @
c99207e4
...
@@ -196,7 +196,9 @@ function getList() {
...
@@ -196,7 +196,9 @@ function getList() {
loading
.
value
=
false
;
loading
.
value
=
false
;
});
});
}
}
function
handleDraft
()
{
proxy
.
$router
.
push
({
path
:
'/materials/material/materialdraft'
});
}
// 表单重置
// 表单重置
function
reset
()
{
function
reset
()
{
...
...
src/views/materialentry/draft.vue
0 → 100644
View file @
c99207e4
<
template
>
<div
class=
"app-container"
>
<div
class=
"formSearch"
>
<el-form
:model=
"queryParams"
ref=
"queryRef"
:inline=
"true"
v-show=
"showSearch"
label-width=
"110x"
>
<el-form-item
label=
"入库方式"
prop=
"entryMethod"
>
<el-select
v-model=
"queryParams.entryMethod"
placeholder=
"请选择入库方式"
clearable
style=
"width: 180px"
>
<el-option
v-for=
"dict in entry_type"
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"物品类型"
prop=
"itemType"
>
<el-select
v-model=
"queryParams.typeId"
placeholder=
"请选择物品类型"
clearable
style=
"width: 180px"
>
<el-option
v-for=
"dict in material_type"
:key=
"dict.id"
:label=
"dict.typeName"
:value=
"dict.id"
style=
"width: 100%"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"物品名称"
prop=
"itemName"
>
<el-input
v-model=
"queryParams.itemName"
placeholder=
"请输入物品名称"
clearable
@
keyup
.
enter=
"handleQuery"
/>
</el-form-item>
<el-form-item
style=
"padding-left: 15%"
>
<el-button
@
click=
"resetQuery"
class=
"el-button-defalut"
>
<template
#
icon
>
<img
src=
"../../assets/icons/common/reset.png"
height=
"25"
width=
"24"
/>
</
template
>
重置
</el-button>
<el-button
type=
"primary"
@
click=
"handleQuery"
class=
"el-button-primary"
>
<
template
#
icon
>
<img
src=
"../../assets/icons/common/search.png"
height=
"24"
width=
"24"
/>
</
template
>
查询
</el-button>
</el-form-item>
</el-form>
</div>
<div
class=
"contentTable"
>
<div
style=
"margin-bottom: 18px "
>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
草稿箱
</span>
<span
style=
"padding-left: 85%"
>
<el-button
icon=
"ArrowLeft"
class=
"el-button-primary-pain"
@
click=
"resetback"
>
返回
</el-button>
</span>
</div>
<el-table
v-loading=
"loading"
:data=
"entryList"
border
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"入库人"
align=
"center"
prop=
"createBy"
/>
<el-table-column
label=
"入库时间"
align=
"center"
prop=
"createTime"
>
未入库
</el-table-column>
<el-table-column
label=
"入库方式"
align=
"center"
prop=
"entryMethod"
>
<
template
#
default=
"scope"
>
<dict-tag
:options=
"entry_type"
:value=
"scope.row.entryMethod"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"物品类型"
align=
"center"
prop=
"typeId"
>
<
template
v-slot:default=
"scope"
>
<span>
{{
material_type
.
find
(
item
=>
item
.
id
===
scope
.
row
.
typeId
)?.
typeName
||
'未知类型'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"物品名称"
align=
"center"
prop=
"itemName"
/>
<el-table-column
label=
"入库数量"
align=
"center"
prop=
"entryQuantity"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
>
<
template
#
default=
"scope"
>
<el-popover
placement=
"right"
:width=
"400"
trigger=
"click"
>
<template
#
reference
>
<el-button
type=
"text"
>
查看详情
</el-button>
</
template
>
<div
style=
"padding: 10px;"
>
<el-input
type=
"textarea"
:rows=
"5"
v-model=
"scope.row.remark"
readonly
style=
"width: 100%;"
>
</el-input>
</div>
</el-popover>
</template>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
fixed=
"right"
min-width=
"50"
>
<
template
#
default=
"scope"
>
<el-tooltip
content=
"编辑"
placement=
"top"
>
<el-button
link
type=
"text"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['material:apply:edit']"
>
<img
src=
"../../assets/icons/common/edit.png"
height=
"32"
width=
"32"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"删除记录"
placement=
"top"
>
<el-button
link
type=
"text"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['psa:material:remove']"
>
<img
src=
"../../assets/icons/common/delete.png"
height=
"32"
width=
"32"
/>
</el-button>
</el-tooltip>
</
template
>
</el-table-column>
</el-table>
<div
class=
"pagination"
>
<pagination
layout=
"prev, pager, next, sizes, jumper"
v-show=
"total > 0"
:total=
"total"
v-model:page=
"queryParams.pageNum"
v-model:limit=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</div>
</div>
</div>
</template>
<
script
setup
name=
"Entry"
>
import
{
listEntry
,
listDraftEntry
,
delEntry
,
addEntry
,
updateEntry
}
from
"../../api/material/entry"
;
import
{
listMaterialType
,
listMaterialTypeDetail
}
from
"@/api/material/material"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
entry_type
}
=
proxy
.
useDict
(
'entry_type'
);
const
material_type
=
ref
([]);
const
material_type_detail
=
ref
([]);
const
entryList
=
ref
([]);
const
open
=
ref
(
false
);
const
loading
=
ref
(
true
);
const
showSearch
=
ref
(
true
);
const
ids
=
ref
([]);
const
single
=
ref
(
true
);
const
multiple
=
ref
(
true
);
const
total
=
ref
(
0
);
const
title
=
ref
(
""
);
const
data
=
reactive
({
form
:
{},
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
entryMethod
:
null
,
itemType
:
null
,
itemName
:
null
,
},
rules
:
{
}
});
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
);
/** 查询物品入库信息列表 */
function
getList
()
{
loading
.
value
=
true
;
listDraftEntry
(
queryParams
.
value
).
then
(
response
=>
{
entryList
.
value
=
response
.
rows
;
total
.
value
=
response
.
total
;
loading
.
value
=
false
;
});
}
// 取消按钮
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
// 表单重置
function
reset
()
{
form
.
value
=
{
id
:
null
,
entryMethod
:
null
,
materialId
:
null
,
expenseId
:
null
,
itemType
:
null
,
itemName
:
null
,
entryQuantity
:
null
,
unit
:
null
,
createTime
:
null
,
updateTime
:
null
,
createBy
:
null
,
updateBy
:
null
,
remark
:
null
,
draft
:
null
,
delFlag
:
null
};
proxy
.
resetForm
(
"entryRef"
);
}
/** 搜索按钮操作 */
function
handleQuery
()
{
queryParams
.
value
.
pageNum
=
1
;
getList
();
}
/** 重置按钮操作 */
function
resetQuery
()
{
proxy
.
resetForm
(
"queryRef"
);
handleQuery
();
}
function
resetback
()
{
proxy
.
$router
.
push
({
path
:
'/material/materialEntry'
})
}
// 多选框选中数据
function
handleSelectionChange
(
selection
)
{
ids
.
value
=
selection
.
map
(
item
=>
item
.
id
);
single
.
value
=
selection
.
length
!=
1
;
multiple
.
value
=
!
selection
.
length
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
_id
=
row
.
id
||
ids
.
value
/* getEntry(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改物品入库信息";
});*/
proxy
.
$router
.
push
({
path
:
'/materials/entry/entryedit'
,
query
:
{
id
:
_id
}
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"entryRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateEntry
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addEntry
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
_ids
=
row
.
id
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'是否确认删除物品入库信息编号为"'
+
_ids
+
'"的数据项?'
).
then
(
function
()
{
return
delEntry
(
_ids
);
}).
then
(()
=>
{
getList
();
proxy
.
$modal
.
msgSuccess
(
"删除成功"
);
}).
catch
((
error
)
=>
{
// 捕获所有错误
if
(
error
===
'cancel'
)
{
// 用户点击取消的特殊标识
proxy
.
$modal
.
msgWarning
(
"取消删除"
);
}
else
{
// 真正的删除失败
proxy
.
$modal
.
msgError
(
"删除入库数量大于当前库存,无法删除!"
);
}
});
}
/** 导出按钮操作 */
function
handleExport
()
{
proxy
.
download
(
'psa/entry/export'
,
{
...
queryParams
.
value
},
`entry_
${
new
Date
().
getTime
()}
.xlsx`
)
}
/** 获取物品类型 */
function
getTypeList
()
{
listMaterialType
().
then
(
response
=>
{
material_type
.
value
=
response
.
data
;
});
}
/** 获取类型的物品列表 */
function
getTypeDetailList
(){
listMaterialTypeDetail
().
then
(
response
=>
{
material_type_detail
.
value
=
response
.
data
;
});
}
getList
();
// 在组件挂载时执行
onMounted
(()
=>
{
//获取物品类型
getTypeList
();
//获取物品信息
getTypeDetailList
();
});
</
script
>
<
style
scoped
lang=
"scss"
>
.bold-text
{
width
:
72px
;
height
:
15px
;
font-family
:
PingFangSC-Medium
;
font-weight
:
900
;
font-size
:
18px
;
color
:
#0D162A
;
letter-spacing
:
0
;
line-height
:
15px
;
}
// 表格的标头
:deep
(
.el-table
th
.el-table__cell
)
{
line-height
:
35px
;
//height: 56px;
background
:
#F6F8FC
!
important
;
}
/* 设置当member字段为空时的行背景色 */
:deep
.el-table
.error-row
{
--el-table-tr-bg-color
:
var
(
--
el-color-warning-light-9
);
}
.contentTable
{
position
:
relative
;
/* 父容器需要相对定位 */
min-height
:
400px
;
/* 最小高度防止内容过少时变形 */
padding-bottom
:
80px
;
/* 底部留出分页空间 */
}
.pagination
{
position
:
absolute
;
bottom
:
20px
;
/* 距离父容器底部20px */
left
:
60%
;
/* 水平居中关键步骤1 */
transform
:
translateX
(
-50%
);
/* 水平居中关键步骤2 */
margin-right
:
0
;
/* 移除旧代码中的右侧间距 */
z-index
:
1
;
/* 确保分页在表格上方 */
}
.el-alert
{
margin
:
23px
0
23px
;
}
</
style
>
src/views/materialentry/edit.vue
View file @
c99207e4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<div
class=
"content"
>
<div
class=
"content"
>
<div
style=
"padding-left: 10px"
>
<div
style=
"padding-left: 10px"
>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
修改入库
</span>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid #0062FF;"
>
草稿箱
</span>
</div>
</div>
<div
style=
"padding-top: 40px"
>
<div
style=
"padding-top: 40px"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-width=
"auto"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-width=
"auto"
>
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<
script
setup
name=
"materialAdd"
>
<
script
setup
name=
"materialAdd"
>
import
{
listMaterialType
,
listMaterialTypeDetail
}
from
"../../api/material/material.js"
;
import
{
listMaterialType
,
listMaterialTypeDetail
}
from
"../../api/material/material.js"
;
import
{
add
Entry
,
getEntry
}
from
"../../api/material/entry.js"
import
{
add
DraftSubmit
,
getEntry
}
from
"../../api/material/entry.js"
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
entry_type
}
=
proxy
.
useDict
(
'entry_type'
);
const
{
entry_type
}
=
proxy
.
useDict
(
'entry_type'
);
const
formRef
=
ref
()
const
formRef
=
ref
()
...
@@ -145,7 +145,7 @@ const rules = {
...
@@ -145,7 +145,7 @@ const rules = {
const
handleSubmit
=
()
=>
{
const
handleSubmit
=
()
=>
{
proxy
.
$refs
[
"formRef"
].
validate
(
valid
=>
{
proxy
.
$refs
[
"formRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
add
Entry
(
form
.
value
).
then
(
response
=>
{
add
DraftSubmit
(
form
.
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
){
if
(
response
.
code
===
200
){
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
resetForm
()
resetForm
()
...
@@ -205,7 +205,7 @@ function resetForm() {
...
@@ -205,7 +205,7 @@ function resetForm() {
// 返回项目管理页面
// 返回项目管理页面
const
reset
=
()
=>
{
const
reset
=
()
=>
{
// 返回项目
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material
/materialEntry'
})
proxy
.
$router
.
push
({
path
:
'/material
s/entry/entrydraft'
});
resetForm
()
resetForm
()
}
}
/** 获取 修改 数据 */
/** 获取 修改 数据 */
...
...
src/views/materialentry/index.vue
View file @
c99207e4
...
@@ -235,7 +235,10 @@ function handleAdd() {
...
@@ -235,7 +235,10 @@ function handleAdd() {
// 跳转新增物品页面
// 跳转新增物品页面
proxy
.
$router
.
push
({
path
:
'/materials/entry/entryadd'
});
proxy
.
$router
.
push
({
path
:
'/materials/entry/entryadd'
});
}
}
/** 跳转草稿箱 */
function
handleDraft
()
{
proxy
.
$router
.
push
({
path
:
'/materials/entry/entrydraft'
});
}
/** 修改按钮操作 */
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
function
handleUpdate
(
row
)
{
reset
();
reset
();
...
@@ -248,26 +251,7 @@ function handleUpdate(row) {
...
@@ -248,26 +251,7 @@ function handleUpdate(row) {
proxy
.
$router
.
push
({
path
:
'/materials/entry/entryedit'
,
query
:
{
id
:
_id
}
});
proxy
.
$router
.
push
({
path
:
'/materials/entry/entryedit'
,
query
:
{
id
:
_id
}
});
}
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"entryRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
null
)
{
updateEntry
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"修改成功"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addEntry
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
/** 删除按钮操作 */
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
function
handleDelete
(
row
)
{
...
...
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