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
9dbb9738
Commit
9dbb9738
authored
Mar 26, 2025
by
ZhangRunSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:借出草稿
parent
c06c6cb1
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1558 additions
and
57 deletions
+1558
-57
apply.js
src/api/material/apply.js
+8
-0
return.js
src/api/material/return.js
+9
-0
add.vue
src/views/material/add.vue
+3
-2
edit.vue
src/views/material/edit.vue
+1
-24
index.vue
src/views/material/index.vue
+1
-1
add.vue
src/views/materialapply/add.vue
+8
-4
draft.vue
src/views/materialapply/draft.vue
+404
-0
draftview.vue
src/views/materialapply/draftview.vue
+220
-0
edit.vue
src/views/materialapply/edit.vue
+435
-0
index.vue
src/views/materialapply/index.vue
+12
-9
materialBorrowApproval.vue
src/views/materialapply/materialBorrowApproval.vue
+5
-3
view.vue
src/views/materialapply/view.vue
+1
-1
add.vue
src/views/materialentry/add.vue
+1
-1
edit.vue
src/views/materialentry/edit.vue
+1
-1
index.vue
src/views/materialentry/index.vue
+1
-1
add.vue
src/views/materialreturn/add.vue
+1
-1
index.vue
src/views/materialreturn/index.vue
+10
-8
returnApproval.vue
src/views/materialreturn/returnApproval.vue
+436
-0
view.vue
src/views/materialreturn/view.vue
+1
-1
No files found.
src/api/material/apply.js
View file @
9dbb9738
...
...
@@ -34,6 +34,14 @@ export function updateApply(data) {
data
:
data
})
}
// 审核借用申请
export
function
approve
(
data
)
{
return
request
({
url
:
'/material/apply/check'
,
method
:
'put'
,
data
:
data
})
}
// 删除物品借用申请
export
function
delApply
(
id
)
{
...
...
src/api/material/return.js
View file @
9dbb9738
...
...
@@ -35,6 +35,15 @@ export function updateReturn(data) {
})
}
// 修改物品归还申请
export
function
approve
(
data
)
{
return
request
({
url
:
'/material/return/check'
,
method
:
'put'
,
data
:
data
})
}
// 删除物品归还申请
export
function
delReturn
(
id
)
{
return
request
({
...
...
src/views/material/add.vue
View file @
9dbb9738
...
...
@@ -135,6 +135,7 @@ const getUserList = () => {
const
handleSubmit
=
()
=>
{
proxy
.
$refs
[
"formRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
form
.
value
.
draft
=
"0"
addMaterial
(
form
.
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
){
proxy
.
$modal
.
msgSuccess
(
"新增成功"
);
...
...
@@ -157,7 +158,7 @@ const saveDraft = () => {
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
form
.
value
.
draft
=
"1"
form
.
value
.
draft
=
"1"
addMaterial
(
form
.
value
).
then
(
response
=>
{
if
(
response
.
code
===
200
){
proxy
.
$modal
.
msgSuccess
(
"草稿保存成功"
);
...
...
@@ -185,7 +186,7 @@ function resetForm() {
proxy
.
resetForm
(
"materialRef"
);
}
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
...
...
src/views/material/edit.vue
View file @
9dbb9738
...
...
@@ -187,29 +187,6 @@ const handleSubmit = () => {
});
};
// 新增草稿
const
saveDraft
=
()
=>
{
proxy
.
$refs
[
"formRef"
].
validate
(
valid
=>
{
if
(
valid
)
{
proxy
.
$confirm
(
'确认提交吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
addDraft
(
form
).
then
(
response
=>
{
if
(
response
.
code
===
200
){
proxy
.
$modal
.
msgSuccess
(
"草稿保存成功"
);
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
}
else
{
proxy
.
$modal
.
msgError
(
response
.
msg
)
}
});
}).
catch
(()
=>
{})
}
});
}
// 表单重置
function
resetForm
()
{
form
.
value
=
{
...
...
@@ -230,7 +207,7 @@ function resetForm() {
proxy
.
resetForm
(
"materialRef"
);
}
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialDetail'
})
...
...
src/views/material/index.vue
View file @
9dbb9738
...
...
@@ -78,7 +78,7 @@
plain
@
click=
"handleExport"
v-hasPermi=
"['psa:material:export']"
><img
src=
"../../assets/icons/common/
print
.png"
height=
"38"
width=
"38"
/>
><img
src=
"../../assets/icons/common/
export2
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
</span>
...
...
src/views/materialapply/add.vue
View file @
9dbb9738
...
...
@@ -288,11 +288,14 @@ const handleSubmit = () => {
const saveDraft = () => {
proxy.$refs["formRef"].validate(valid => {
if (valid) {
addDraft(form).then(response => {
form.value.draft = "1";
addApply(form.value).then(response => {
if (response.code === 200){
proxy.$modal.msgSuccess("草稿保存成功");
proxy.$router.push({ path: '/material/materialDetail' })
resetForm();
proxy.$router.push({ path: '/material/materialApply' })
}else {
resetForm();
proxy.$modal.msgError(response.msg)
}
});
...
...
@@ -314,12 +317,13 @@ function resetForm() {
unit: null,
maxStock: null
}],
remark: null
remark: null,
draft : null
};
proxy.resetForm("materialRef");
}
// 返回
项目管理页面
// 返回
const reset = () => {
// 返回项目
proxy.$router.push({ path: '/material/materialApply' })
...
...
src/views/materialapply/draft.vue
0 → 100644
View file @
9dbb9738
This diff is collapsed.
Click to expand it.
src/views/materialapply/draftview.vue
0 → 100644
View file @
9dbb9738
<
template
>
<div
class=
"app-container"
>
<div
class=
"content"
style=
"position: relative"
>
<div
style=
"padding-left: 15px ;padding-top: 15px"
>
<span
class=
"bold-text"
style=
"border-bottom: 3px solid blue;"
>
借用草稿
</span>
</div>
<div
style=
"padding-top: 28px ;padding-left: 10px; "
>
<el-form
:model=
"form"
label-width=
"auto"
>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
项目名称:
</label>
</el-col>
<el-col
:span=
"2"
>
<span
class=
"label"
>
{{
project_list
.
find
(
item
=>
item
.
id
===
form
.
projectId
)?.
projectName
||
'未知类型'
}}
</span>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
申请人:
</label>
</el-col>
<el-col
:span=
"2"
>
<span
class=
"label"
>
{{
form
.
userName
}}
</span>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
申请时间:
</label>
</el-col>
<el-col
:span=
"5"
>
<span
class=
"label"
>
未开始
</span>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
审批状态:
</label>
</el-col>
<el-col
:span=
"2"
>
<template
v-for=
"(item, index) in material_status"
:key=
"index"
>
<span
class=
"label"
v-if=
"item.value === form.checkStatus"
>
无
</span>
</
template
>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
申请备注:
</label>
</el-col>
<el-col
:span=
"15"
>
<span
class=
"label"
>
{{ form.remark }}
</span>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"2"
>
<label
class=
"label-title"
>
申请物品:
</label>
</el-col>
<el-col
:span=
"20"
>
<div
v-for=
"(item, index) in form.items"
:key=
"index"
class=
"item-row"
style=
"display: flex; gap: 30px"
>
<span
style=
"flex: 1; min-width: 120px"
class=
"label"
>
物品类型:{{ material_type.find(m => m.id === item.type)?.typeName || '—' }}
</span>
<span
style=
"flex: 1; min-width: 120px"
class=
"label"
>
物品名称:{{ all_material_type_detail.find(d => d.id === item.material_detail)?.materialName || '—' }}
</span>
<span
style=
"flex: 1; min-width: 120px"
class=
"label"
>
申请数量:{{ item.quantity || 0 }}
</span>
</div>
</el-col>
</el-row>
</el-form>
<div
style=
"position: absolute;right: 52px;bottom: 42px"
>
<el-button
type=
"primary"
size=
"large"
class=
"btn-A"
@
click=
"reset"
>
返回
</el-button>
</div>
</div>
</div>
</div>
</template>
<
script
setup
>
import
{
getApply
}
from
"../../api/material/apply"
;
import
{
listProject
}
from
"../../api/project/project.js"
;
import
{
listMaterialType
,
listMaterialTypeDetail
}
from
"../../api/material/material.js"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
material_status
}
=
proxy
.
useDict
(
'material_status'
);
const
project_list
=
ref
([]);
const
all_material_type_detail
=
ref
([]);
const
material_type
=
ref
([]);
const
form
=
ref
({
id
:
null
,
projectId
:
null
,
userId
:
null
,
userName
:
null
,
checkStatus
:
null
,
remark
:
null
,
createBy
:
null
,
createTime
:
null
,
items
:
[{
type
:
null
,
material_detail
:
null
,
quantity
:
null
}],
})
// 格式化日期
/*function formatDate(date) {
if (!date) return '-';
const d = new Date(date);
return `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, '0')}/${String(d.getDate()).padStart(2, '0')}`;
}*/
// 返回
const
reset
=
()
=>
{
if
(
returnType
===
"1"
){
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialBorrowApproval'
})
}
else
if
(
returnType
===
"0"
)
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialApply'
})
}
else
if
(
returnType
===
"2"
)
{
proxy
.
$router
.
push
({
path
:
'/materials/apply/applydraft'
})
}
}
// 条页面来源
let
returnType
=
null
;
/** 根据ID查到的详细信息 */
const
getInfo
=
()
=>
{
returnType
=
proxy
.
$route
.
query
.
type
;
getApply
(
proxy
.
$route
.
query
.
id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
})
}
/** 获取项目列表 */
function
getProjectList
(){
listProject
().
then
(
response
=>
{
project_list
.
value
=
response
.
rows
;
console
.
log
(
"project_list:"
,
project_list
.
value
)
})
}
/** 获取物品类型 */
function
getTypeList
()
{
listMaterialType
().
then
(
response
=>
{
material_type
.
value
=
response
.
data
;
});
}
/** 获取类型的物品列表 */
function
getTypeDetailList
(){
listMaterialTypeDetail
().
then
(
response
=>
{
all_material_type_detail
.
value
=
response
.
data
;
});
}
onMounted
(()
=>
{
//根据id查询信息
getInfo
();
//获取项目列表
getProjectList
();
//获取物品类型
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
;
}
.label-title
{
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
19px
;
color
:
#666666
;
letter-spacing
:
0
;
//text-align: right;
line-height
:
40px
;
}
.bordered
{
margin-left
:
110px
;
padding
:
20px
;
background
:
#FAFAFA
;
border
:
1px
solid
#C8CEDE
;
border-radius
:
2px
;
//min-height: 200px;
}
.label
{
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
19px
;
color
:
#4A4E54
;
letter-spacing
:
0
;
line-height
:
40px
;
}
.file-item
{
display
:
block
;
margin
:
9px
0
;
}
.file-item
.el-link
{
font-size
:
18px
;
}
.table-container
{
display
:
flex
;
justify-content
:
center
;
}
</
style
>
src/views/materialapply/edit.vue
0 → 100644
View file @
9dbb9738
This diff is collapsed.
Click to expand it.
src/views/materialapply/index.vue
View file @
9dbb9738
...
...
@@ -78,22 +78,23 @@
@
click=
"handleAdd"
v-hasPermi=
"['material:apply:add']"
>
借用申请
</el-button>
<el-tooltip
content=
"
导出
"
placement=
"top"
>
<el-tooltip
content=
"
草稿箱
"
placement=
"top"
>
<el-button
type=
"text"
plain
@
click=
"
handleExpor
t"
v-hasPermi=
"['material:apply:
expor
t']"
><img
src=
"../../assets/icons/common/
daochu
.png"
height=
"38"
width=
"38"
/>
@
click=
"
draf
t"
v-hasPermi=
"['material:apply:
draf
t']"
><img
src=
"../../assets/icons/common/
rightone
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"草稿箱"
placement=
"top"
>
<el-tooltip
content=
"导出"
placement=
"top"
>
<el-button
type=
"text"
plain
@
click=
"
draf
t"
v-hasPermi=
"['material:apply:
draf
t']"
><img
src=
"../../assets/icons/common/
rightone
.png"
height=
"38"
width=
"38"
/>
@
click=
"
handleExpor
t"
v-hasPermi=
"['material:apply:
expor
t']"
><img
src=
"../../assets/icons/common/
export2
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
</span>
...
...
@@ -331,7 +332,9 @@ function handleAdd() {
title.value = "添加物品借用申请";*/
proxy
.
$router
.
push
({
path
:
'/materials/apply/applyadd'
}
);
}
function
draft
()
{
proxy
.
$router
.
push
({
path
:
'/materials/apply/applydraft'
}
);
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
...
...
src/views/materialapply/materialBorrowApproval.vue
View file @
9dbb9738
...
...
@@ -213,7 +213,7 @@
<
/template
>
<
script
setup
>
import
{
listApply
}
from
"@/api/material/apply
"
;
import
{
listApply
,
approve
}
from
"../../api/material/apply.js
"
;
import
{
listMaterialType
,
listMaterialTypeDetail
}
from
"../../api/material/material.js"
;
import
{
listProject
}
from
"../../api/project/project.js"
;
...
...
@@ -346,7 +346,8 @@ function handleApprove(row) {
cancelButtonText
:
'取消'
,
type
:
'warning'
}
).
then
(()
=>
{
approve
(
row
.
id
).
then
(
response
=>
{
row
.
checkStatus
=
"1"
approve
(
row
).
then
(
response
=>
{
proxy
.
$message
({
message
:
'通过成功'
,
type
:
'success'
...
...
@@ -363,7 +364,8 @@ function handleReject(row) {
cancelButtonText
:
'取消'
,
type
:
'warning'
}
).
then
(()
=>
{
reject
(
row
.
id
).
then
(
response
=>
{
row
.
checkStatus
=
"2"
approve
(
row
).
then
(
response
=>
{
proxy
.
$message
({
message
:
'驳回成功'
,
type
:
'success'
...
...
src/views/materialapply/view.vue
View file @
9dbb9738
...
...
@@ -114,7 +114,7 @@ const form = ref({
return `${d.getFullYear()
}
/${String(d.getMonth() + 1).padStart(2, '0')
}
/${String(d.getDate()).padStart(2, '0')
}
`;
}
*/
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
if
(
returnType
===
"1"
){
// 返回项目
...
...
src/views/materialentry/add.vue
View file @
9dbb9738
...
...
@@ -194,7 +194,7 @@ function resetForm() {
proxy
.
resetForm
(
"materialRef"
);
}
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialEntry'
})
...
...
src/views/materialentry/edit.vue
View file @
9dbb9738
...
...
@@ -202,7 +202,7 @@ function resetForm() {
proxy
.
resetForm
(
"materialRef"
);
}
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/materials/entry/entrydraft'
});
...
...
src/views/materialentry/index.vue
View file @
9dbb9738
...
...
@@ -73,7 +73,7 @@
plain
@
click=
"handleExport"
v-hasPermi=
"['psa:entry:export']"
><img
src=
"../../assets/icons/common/
print
.png"
height=
"38"
width=
"38"
/>
><img
src=
"../../assets/icons/common/
export2
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
</span>
...
...
src/views/materialreturn/add.vue
View file @
9dbb9738
...
...
@@ -290,7 +290,7 @@ function resetForm() {
proxy
.
resetForm
(
"materialRef"
);
}
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialReturn'
})
...
...
src/views/materialreturn/index.vue
View file @
9dbb9738
...
...
@@ -58,22 +58,24 @@
@
click=
"handleAdd"
v-hasPermi=
"['material:return:add']"
>
归还申请
</el-button>
<el-tooltip
content=
"导出"
placement=
"top"
>
<el-tooltip
content=
"草稿箱"
placement=
"top"
>
<el-button
type=
"text"
plain
@
click=
"
handleExpor
t"
v-hasPermi=
"['material:apply:
expor
t']"
><img
src=
"../../assets/icons/common/
daochu
.png"
height=
"38"
width=
"38"
/>
@
click=
"
draf
t"
v-hasPermi=
"['material:apply:
draf
t']"
><img
src=
"../../assets/icons/common/
rightone
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"草稿箱"
placement=
"top"
>
<el-tooltip
content=
"导出"
placement=
"top"
>
<el-button
type=
"text"
plain
@
click=
"
draf
t"
v-hasPermi=
"['material:apply:
draf
t']"
><img
src=
"../../assets/icons/common/
rightone
.png"
height=
"38"
width=
"38"
/>
@
click=
"
handleExpor
t"
v-hasPermi=
"['material:apply:
expor
t']"
><img
src=
"../../assets/icons/common/
export2
.png"
height=
"38"
width=
"38"
/>
</el-button>
</el-tooltip>
</span>
...
...
src/views/materialreturn/returnApproval.vue
0 → 100644
View file @
9dbb9738
This diff is collapsed.
Click to expand it.
src/views/materialreturn/view.vue
View file @
9dbb9738
...
...
@@ -114,7 +114,7 @@ const form = ref({
return `${d.getFullYear()
}
/${String(d.getMonth() + 1).padStart(2, '0')
}
/${String(d.getDate()).padStart(2, '0')
}
`;
}
*/
// 返回
项目管理页面
// 返回
const
reset
=
()
=>
{
// 返回项目
proxy
.
$router
.
push
({
path
:
'/material/materialReturn'
}
)
...
...
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