Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiqiao-vue
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
金民
weiqiao-vue
Commits
eae30358
Commit
eae30358
authored
Mar 19, 2026
by
sunhaiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
库存账本页面添加到期时间和提前预警天数字段
parent
9ea285cd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
4 deletions
+165
-4
xjrsoft-vue3/src/api/ckgl/kczb/model/KczbModel.ts
+16
-0
xjrsoft-vue3/src/views/ckgl/kczb/components/config.ts
+67
-1
xjrsoft-vue3/src/views/ckgl/kczb/components/workflowPermission.ts
+34
-0
xjrsoft-vue3/src/views/ckgl/kczb/index.vue
+48
-3
No files found.
xjrsoft-vue3/src/api/ckgl/kczb/model/KczbModel.ts
View file @
eae30358
...
...
@@ -17,6 +17,12 @@ export interface MesWarehouseProductNumberPageParams extends BasicPageParams {
kxs
:
string
;
erpid
:
string
;
dqsj
:
string
;
tqyjts
:
string
;
bz
:
string
;
}
/**
...
...
@@ -46,6 +52,12 @@ export interface MesWarehouseProductNumberPageModel {
erpid
:
string
;
bz
:
string
;
cpbh
:
string
;
dqsj
:
string
;
tqyjts
:
string
;
}
/**
...
...
@@ -112,6 +124,10 @@ export interface MesWarehouseProductNumberModel {
modifyUserId
:
string
;
dqsj
:
string
;
tqyjts
:
string
;
mesWarehouseProductNumInfoList
?:
MesWarehouseProductNumInfoModel
;
}
...
...
xjrsoft-vue3/src/views/ckgl/kczb/components/config.ts
View file @
eae30358
...
...
@@ -730,6 +730,72 @@ export const formProps: FormProps = {
],
},
{
span
:
8
,
list
:
[
{
key
:
'749c23841dd84b2c994bf00fcb546dd4'
,
field
:
'dqsj'
,
label
:
'到期时间'
,
type
:
'date'
,
component
:
'DatePicker'
,
colProps
:
{
span
:
24
},
defaultValue
:
''
,
componentProps
:
{
span
:
7
,
defaultValue
:
''
,
width
:
'100%'
,
placeholder
:
'请选择到期时间'
,
format
:
'YYYY-MM-DD HH:mm:ss'
,
showLabel
:
true
,
allowClear
:
true
,
disabled
:
false
,
required
:
false
,
isShow
:
true
,
rules
:
[],
events
:
{},
isGetCurrent
:
false
,
tooltipConfig
:
{
visible
:
false
,
title
:
'提示文本'
},
searchType
:
'time'
,
style
:
{
width
:
'100%'
},
},
},
],
},
{
span
:
8
,
list
:
[
{
key
:
'25477fb57417425195a30e82c266c670'
,
field
:
'tqyjts'
,
label
:
'提前预警天数'
,
type
:
'number'
,
component
:
'InputNumber'
,
colProps
:
{
span
:
24
},
defaultValue
:
''
,
componentProps
:
{
width
:
'100%'
,
span
:
7
,
defaultValue
:
''
,
min
:
0
,
max
:
100
,
step
:
1
,
maxlength
:
null
,
disabled
:
false
,
showLabel
:
true
,
controls
:
true
,
required
:
false
,
subTotal
:
false
,
isShow
:
true
,
rules
:
[],
events
:
{},
placeholder
:
'请输入提前预警天数'
,
tooltipConfig
:
{
visible
:
false
,
title
:
'提示文本'
},
style
:
{
width
:
'100%'
},
},
},
],
},
{
span
:
24
,
list
:
[
{
...
...
@@ -774,7 +840,7 @@ export const formProps: FormProps = {
colProps
:
{
span
:
24
},
componentProps
:
{
api
:
uploadApi
,
span
:
2
,
span
:
3
,
defaultValue
:
''
,
accept
:
''
,
maxNumber
:
5
,
...
...
xjrsoft-vue3/src/views/ckgl/kczb/components/workflowPermission.ts
View file @
eae30358
...
...
@@ -173,6 +173,40 @@ export const permissionList = [
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'到期时间'
,
fieldId
:
'dqsj'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'date'
,
key
:
'749c23841dd84b2c994bf00fcb546dd4'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'提前预警天数'
,
fieldId
:
'tqyjts'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'number'
,
key
:
'25477fb57417425195a30e82c266c670'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'备注'
,
fieldId
:
'bz'
,
isSubTable
:
false
,
...
...
xjrsoft-vue3/src/views/ckgl/kczb/index.vue
View file @
eae30358
...
...
@@ -202,6 +202,7 @@
title
:
'操作'
,
dataIndex
:
'action'
,
slots
:
{
customRender
:
'action'
},
className
:
'action-column-cell'
,
},
tableSetting
:
{
size
:
false
,
...
...
@@ -287,8 +288,11 @@
function
customRow
(
record
:
Recordable
)
{
//判断行数据是否需要变红
const
isRedRow
=
isNeedWarn
(
record
);
return
{
// 核心修改:添加类名,而非行内style
class
:
isRedRow
?
'red-row'
:
''
,
ondblclick
:
()
=>
{
if
(
record
.
isCanEdit
&&
hasPermission
(
"kczb:edit"
))
{
handleEdit
(
record
);
...
...
@@ -297,6 +301,31 @@
};
}
/**
* 计算是否需要预警(变红)的函数
* @param record
*/
function
isNeedWarn
(
record
:
Recordable
):
boolean
{
// 1. 校验字段是否存在,避免报错
if
(
!
record
.
dqsj
||
!
record
.
tqyjts
)
return
false
;
// 2. 解析到期时间(兼容字符串/时间戳)
const
dqsjDate
=
new
Date
(
record
.
dqsj
);
// 校验时间格式是否合法
if
(
isNaN
(
dqsjDate
.
getTime
()))
return
false
;
// 3. 当前时间(取当天0点,避免时分秒干扰)
const
now
=
new
Date
();
// 4. 计算到期时间 - 当前时间的毫秒差 → 转换为天数
const
timeDiff
=
dqsjDate
.
getTime
()
-
now
.
getTime
();
const
dayDiff
=
Math
.
ceil
(
timeDiff
/
(
1000
*
60
*
60
*
24
));
// 向上取整(比如剩余1.2天算2天)
// 5. 判断:天数差
<
提前预警天数
→
需要预警(变红)
// 补充:如果到期时间已过(dayDiff
<
0
),也强制变红
return
dayDiff
<
record
.
tqyjts
||
dayDiff
<
0
;
}
function
handleSuccess
()
{
...
...
@@ -379,7 +408,23 @@
display
:
none
!important
;
}
//
其他样式不变,修改预警行样式
:deep
(
.ant-table-tbody
>
tr
.red-row
)
{
td
{
background-color
:
#ff4d4f
!important
;
color
:
black
!important
;
}
//
覆盖操作列样式
td
.action-column-cell
{
background-color
:
white
!important
;
color
:
black
!important
;
}
/*&:hover td {
background-color: #ff1f1f !important;
}
&:hover td.action-column-cell {
background-color: white !important;
}*/
}
</
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