Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
24a9a03f
authored
May 06, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
f5fee41a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
app/Http/Services/SupplierAttachmentService.php
app/Http/Validators/SupplierAttachmentValidator.php
resources/views/script/supplier/SupplierFileScript.blade.php
app/Http/Services/SupplierAttachmentService.php
View file @
24a9a03f
...
...
@@ -79,6 +79,7 @@ class SupplierAttachmentService
'field_name'
=>
$attachmentData
[
'field_name'
][
$key
],
'validity_type'
=>
$attachmentData
[
'validity_type'
][
$key
],
'create_uid'
=>
request
()
->
user
->
userId
,
'create_time'
=>
time
(),
'create_name'
=>
request
()
->
user
->
name
,
'description'
=>
$attachmentData
[
'description'
][
$key
],
'type_name'
=>
array_get
(
config
(
'fixed.FileNameMapping'
),
$attachmentData
[
'field_name'
][
$key
]),
...
...
app/Http/Validators/SupplierAttachmentValidator.php
View file @
24a9a03f
...
...
@@ -13,7 +13,7 @@ class SupplierAttachmentValidator
public
function
checkSave
(
$request
)
{
//整理下请求数据
$
receip
t
=
$request
->
all
();
$
attachmen
t
=
$request
->
all
();
$rules
=
[
'field_name'
=>
'required'
,
'validity_type'
=>
'required'
,
...
...
@@ -22,12 +22,16 @@ class SupplierAttachmentValidator
];
$messages
=
$this
->
messages
();
$validator
=
Validator
::
make
(
$receipt
,
$rules
,
$messages
);
$validator
=
Validator
::
make
(
$attachment
,
$rules
,
$messages
);
//判断联系方式的表单验证
if
(
$validator
->
fails
())
{
return
$validator
->
errors
()
->
first
();
}
if
(
$attachment
[
'validity_type'
]
==
2
&&
!
$attachment
[
'validity_period'
])
{
return
'附件有效期为自定义的时候,时间区间必须选择'
;
}
}
private
function
messages
()
...
...
resources/views/script/supplier/SupplierFileScript.blade.php
View file @
24a9a03f
...
...
@@ -97,11 +97,12 @@
//删除文件操作
$
(
document
)
.
on
(
'click'
,
'.delete_file'
,
function
()
{
// layer.confirm('确定要删除该文件吗?', function (index) {
//找出对应的div删除
$
(
this
)
.
parents
(
'.single_file_div'
)
.
remove
();
// return false;
// });
var
self
=
$
(
this
);
layer
.
confirm
(
'确定要删除该文件吗?'
,
function
(
index
)
{
self
.
parents
(
'.single_file_div'
)
.
remove
();
layer
.
closeAll
();
});
return
false
;
});
});
...
...
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