Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jilinzhongdianrenqun-web
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
jilinzhongdianrenqun-web
Commits
5fb48cf8
Commit
5fb48cf8
authored
Dec 25, 2025
by
zhangtw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入库、申领
parent
d3c15121
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
128 行增加
和
7 行删除
+128
-7
src/view/key-person/key_dm_inventory/inbound.vue
+0
-0
src/view/key-person/key_dm_inventory/index.vue
+128
-7
没有找到文件。
src/view/key-person/key_dm_inventory/inbound.vue
View file @
5fb48cf8
差异被折叠。
点击展开。
src/view/key-person/key_dm_inventory/index.vue
View file @
5fb48cf8
...
@@ -215,10 +215,13 @@ export default {
...
@@ -215,10 +215,13 @@ export default {
components
:
{
MaterialSelector
},
components
:
{
MaterialSelector
},
data
()
{
data
()
{
return
{
return
{
// 申请弹窗中的可编辑行状态
editingRowIndex
:
-
1
,
editingCellField
:
''
,
// 审批状态映射字典
// 审批状态映射字典
approvalStatusMap
:
{
'0'
:
'待提交'
,
'1'
:
'审核中'
,
'9'
:
'审核通过'
,
'-1'
:
'驳回'
},
approvalStatusMap
:
{
'0'
:
'待提交'
,
'1'
:
'审核中'
,
'9'
:
'审核通过'
,
'-1'
:
'驳回'
},
activeTab
:
'apply'
,
activeTab
:
'apply'
,
filters
:
{
filters
:
{
apply
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
},
apply
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
},
history
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
}
history
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
}
},
},
...
@@ -248,7 +251,14 @@ export default {
...
@@ -248,7 +251,14 @@ export default {
{
title
:
'申请单号'
,
key
:
'application_no'
,
align
:
'center'
},
{
title
:
'申请单号'
,
key
:
'application_no'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
{
title
:
'部门'
,
key
:
'department_name'
,
align
:
'center'
},
{
title
:
'部门'
,
key
:
'department_name'
,
align
:
'center'
},
{
title
:
'提交时间'
,
key
:
'submit_time'
,
align
:
'center'
},
{
title
:
'提交时间'
,
key
:
'submit_time'
,
align
:
'center'
,
render
:
(
h
,
{
row
})
=>
{
return
h
(
'span'
,
this
.
formatDate
(
row
.
submit_time
)
||
row
.
submit_time
||
'-'
)
}
},
{
title
:
'操作'
,
slot
:
'action'
,
width
:
120
,
align
:
'center'
}
{
title
:
'操作'
,
slot
:
'action'
,
width
:
120
,
align
:
'center'
}
],
],
historyColumns
:
[
historyColumns
:
[
...
@@ -271,7 +281,77 @@ export default {
...
@@ -271,7 +281,77 @@ export default {
{
type
:
'selection'
,
width
:
60
},
{
type
:
'selection'
,
width
:
60
},
{
title
:
'物料编码'
,
key
:
'material_code'
},
{
title
:
'物料编码'
,
key
:
'material_code'
},
{
title
:
'物料名称'
,
key
:
'material_name'
},
{
title
:
'物料名称'
,
key
:
'material_name'
},
{
title
:
'申请数量'
,
key
:
'apply_quantity'
},
{
title
:
'申请数量'
,
key
:
'apply_quantity'
,
render
:
(
h
,
{
row
,
column
,
index
})
=>
{
// 如果当前行是编辑状态,显示输入框
if
(
this
.
editingRowIndex
===
index
&&
this
.
editingCellField
===
'apply_quantity'
)
{
return
h
(
'InputNumber'
,
{
props
:
{
value
:
row
.
apply_quantity
,
min
:
1
,
max
:
row
.
available_quantity
||
9999
,
precision
:
0
},
style
:
{
width
:
'100%'
},
on
:
{
input
:
(
value
)
=>
{
// 更新数据
this
.
applyModal
.
details
[
index
].
apply_quantity
=
value
},
'on-blur'
:
()
=>
{
// 失去焦点时退出编辑模式
this
.
editingRowIndex
=
-
1
this
.
editingCellField
=
''
},
'on-keyup'
:
(
event
)
=>
{
// 按回车键保存并退出编辑
if
(
event
.
keyCode
===
13
)
{
this
.
editingRowIndex
=
-
1
this
.
editingCellField
=
''
}
}
}
})
}
else
{
// 非编辑状态,显示文本和编辑图标
return
h
(
'div'
,
{
style
:
{
display
:
'flex'
,
justifyContent
:
'space-between'
,
alignItems
:
'center'
,
cursor
:
'pointer'
,
padding
:
'0 8px'
},
on
:
{
click
:
()
=>
{
// 点击进入编辑模式
this
.
editingRowIndex
=
index
this
.
editingCellField
=
'apply_quantity'
// 下一个tick聚焦到输入框
this
.
$nextTick
(()
=>
{
const
input
=
document
.
querySelector
(
`.ivu-table-cell-with-input input`
)
if
(
input
)
input
.
focus
()
})
}
}
},
[
h
(
'span'
,
row
.
apply_quantity
||
0
),
h
(
'Icon'
,
{
props
:
{
type
:
'md-create'
,
size
:
14
},
style
:
{
color
:
'#2d8cf0'
,
marginLeft
:
'8px'
}
})
])
}
}
},
{
title
:
'单位'
,
key
:
'unit'
},
{
title
:
'单位'
,
key
:
'unit'
},
{
title
:
'备注'
,
key
:
'issue_remark'
}
{
title
:
'备注'
,
key
:
'issue_remark'
}
],
],
...
@@ -297,16 +377,41 @@ export default {
...
@@ -297,16 +377,41 @@ export default {
// 选择器控制与已选明细
// 选择器控制与已选明细
showMaterialSelector
:
false
,
showMaterialSelector
:
false
,
applySelectedDetails
:
[],
applySelectedDetails
:
[],
applyModal
:
{
visible
:
false
,
isEdit
:
false
,
saving
:
false
,
form
:
{},
details
:
[]
},
applyModal
:
{
visible
:
false
,
isEdit
:
false
,
saving
:
false
,
form
:
{},
details
:
[]
,
isEditing
:
false
},
approveModal
:
{
visible
:
false
,
record
:
{},
details
:
[],
opinion
:
''
,
submitting
:
false
},
approveModal
:
{
visible
:
false
,
record
:
{},
details
:
[],
opinion
:
''
,
submitting
:
false
},
detailModal
:
{
visible
:
false
,
loading
:
false
,
data
:
{},
details
:
[],
logs
:
[]
}
detailModal
:
{
visible
:
false
,
loading
:
false
,
data
:
{},
details
:
[],
logs
:
[]
}
}
}
},
},
created
()
{
this
.
fetchList
(
'apply'
)
},
created
()
{
this
.
fetchList
(
'apply'
)
},
methods
:
{
methods
:
{
// 获取当天日期,格式为 yyyy-MM-dd
getTodayDate
()
{
const
today
=
new
Date
()
const
year
=
today
.
getFullYear
()
const
month
=
String
(
today
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
day
=
String
(
today
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
year
}
-
${
month
}
-
${
day
}
`
},
// 处理单元格点击编辑
handleCellEdit
(
row
,
column
,
index
,
field
)
{
if
(
field
===
'apply_quantity'
)
{
this
.
editingRowIndex
=
index
this
.
editingCellField
=
field
// 下一个tick聚焦到输入框
this
.
$nextTick
(()
=>
{
const
input
=
document
.
querySelector
(
`.ivu-table-cell-with-input input`
)
if
(
input
)
input
.
focus
()
})
}
},
// 添加方法:退出编辑模式
exitEditMode
()
{
this
.
editingRowIndex
=
-
1
this
.
editingCellField
=
''
},
// 转换时间戳为yyyy-MM-dd
// 转换时间戳为yyyy-MM-dd
formatDate
(
timestamp
)
{
formatDate
(
timestamp
)
{
if
(
!
timestamp
||
isNaN
(
Number
(
timestamp
)))
return
'
未设置
'
if
(
!
timestamp
||
isNaN
(
Number
(
timestamp
)))
return
''
const
d
=
new
Date
(
Number
(
timestamp
))
const
d
=
new
Date
(
Number
(
timestamp
))
return
`
${
d
.
getFullYear
()}
-
${
String
(
d
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)}
-
${
String
(
d
.
getDate
()).
padStart
(
2
,
'0'
)}
`
return
`
${
d
.
getFullYear
()}
-
${
String
(
d
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)}
-
${
String
(
d
.
getDate
()).
padStart
(
2
,
'0'
)}
`
},
},
...
@@ -350,9 +455,10 @@ export default {
...
@@ -350,9 +455,10 @@ export default {
openApplyModal
()
{
openApplyModal
()
{
this
.
applyModal
.
isEdit
=
false
this
.
applyModal
.
isEdit
=
false
this
.
applyModal
.
form
=
{
applicant_id
:
''
,
applicant_name
:
''
,
department_id
:
''
,
department_name
:
''
,
borrow_purpose
:
''
,
expected_return_date
:
''
,
approval_status
:
0
}
this
.
applyModal
.
form
=
{
applicant_id
:
''
,
applicant_name
:
''
,
department_id
:
''
,
department_name
:
''
,
borrow_purpose
:
''
,
expected_return_date
:
this
.
getTodayDate
()
,
approval_status
:
0
}
this
.
applyModal
.
details
=
[]
this
.
applyModal
.
details
=
[]
this
.
applyModal
.
visible
=
true
this
.
applyModal
.
visible
=
true
this
.
exitEditMode
()
},
},
openEdit
(
row
)
{
openEdit
(
row
)
{
console
.
log
(
row
)
console
.
log
(
row
)
...
@@ -363,7 +469,7 @@ export default {
...
@@ -363,7 +469,7 @@ export default {
this
.
applyModal
.
form
.
expected_return_date
=
this
.
formatDate
(
this
.
applyModal
.
form
.
expected_return_date
)
this
.
applyModal
.
form
.
expected_return_date
=
this
.
formatDate
(
this
.
applyModal
.
form
.
expected_return_date
)
}
else
{
}
else
{
// 空值兜底
// 空值兜底
this
.
applyModal
.
form
.
expected_return_date
=
''
this
.
applyModal
.
form
.
expected_return_date
=
this
.
getTodayDate
()
}
}
// load details from backend when open (simplified)
// load details from backend when open (simplified)
getBorrowById
({
id
:
row
.
id
}).
then
(
ret
=>
{
getBorrowById
({
id
:
row
.
id
}).
then
(
ret
=>
{
...
@@ -372,6 +478,7 @@ export default {
...
@@ -372,6 +478,7 @@ export default {
}
}
})
})
this
.
applyModal
.
visible
=
true
this
.
applyModal
.
visible
=
true
this
.
exitEditMode
()
},
},
onApplyDetailSelectionChange
(
list
)
{
onApplyDetailSelectionChange
(
list
)
{
this
.
applySelectedDetails
=
list
||
[]
this
.
applySelectedDetails
=
list
||
[]
...
@@ -409,6 +516,7 @@ export default {
...
@@ -409,6 +516,7 @@ export default {
this
.
applySelectedDetails
=
[]
this
.
applySelectedDetails
=
[]
},
},
saveApplication
()
{
saveApplication
()
{
this
.
exitEditMode
()
this
.
applyModal
.
saving
=
true
this
.
applyModal
.
saving
=
true
const
payload
=
Object
.
assign
({},
this
.
applyModal
.
form
,
{
details
:
this
.
applyModal
.
details
})
const
payload
=
Object
.
assign
({},
this
.
applyModal
.
form
,
{
details
:
this
.
applyModal
.
details
})
saveBorrowApplication
(
payload
).
then
(
ret
=>
{
saveBorrowApplication
(
payload
).
then
(
ret
=>
{
...
@@ -536,4 +644,17 @@ export default {
...
@@ -536,4 +644,17 @@ export default {
padding
:
16px
0
0
0
;
padding
:
16px
0
0
0
;
}
}
}
}
/* 添加一些样式来美化编辑状态 */
.ivu-table-cell
{
position
:
relative
;
}
.edit-icon
{
opacity
:
0
;
transition
:
opacity
0.2s
;
}
.ivu-table-row
:hover
.edit-icon
{
opacity
:
1
;
}
</
style
>
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论