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
eaa09766
authored
May 05, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
附件问题
parent
f6280398
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
6 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierAttachmentService.php
app/Http/Services/SupplierService.php
app/Http/Validators/SupplierValidator.php
resources/views/script/supplier/SupplierFileScript.blade.php
resources/views/web/supplier/SupplierFile.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
eaa09766
...
@@ -123,6 +123,7 @@ class SupplierApiController extends Controller
...
@@ -123,6 +123,7 @@ class SupplierApiController extends Controller
'field_name'
,
'field_name'
,
'validity_type'
,
'validity_type'
,
'validity_period'
,
'validity_period'
,
'description'
,
//银行信息
//银行信息
'receipt_type'
,
'receipt_type'
,
'bank_name'
,
'bank_name'
,
...
...
app/Http/Services/SupplierAttachmentService.php
View file @
eaa09766
...
@@ -62,7 +62,7 @@ class SupplierAttachmentService
...
@@ -62,7 +62,7 @@ class SupplierAttachmentService
$item
=
array_values
(
$item
);
$item
=
array_values
(
$item
);
}
}
return
$item
;
return
$item
;
},
$attachmentData
);
},
$attachmentData
);
if
(
empty
(
$attachmentData
))
{
if
(
empty
(
$attachmentData
))
{
return
true
;
return
true
;
}
}
...
@@ -80,12 +80,16 @@ class SupplierAttachmentService
...
@@ -80,12 +80,16 @@ class SupplierAttachmentService
'validity_type'
=>
$attachmentData
[
'validity_type'
][
$key
],
'validity_type'
=>
$attachmentData
[
'validity_type'
][
$key
],
'create_uid'
=>
request
()
->
user
->
userId
,
'create_uid'
=>
request
()
->
user
->
userId
,
'create_name'
=>
request
()
->
user
->
name
,
'create_name'
=>
request
()
->
user
->
name
,
'description'
=>
$attachmentData
[
'description'
][
$key
],
'type_name'
=>
array_get
(
config
(
'fixed.FileNameMapping'
),
$attachmentData
[
'field_name'
][
$key
]),
'type_name'
=>
array_get
(
config
(
'fixed.FileNameMapping'
),
$attachmentData
[
'field_name'
][
$key
]),
];
];
if
(
!
empty
(
$attachmentData
[
'validity_period'
][
$key
]))
{
if
(
!
empty
(
$attachmentData
[
'validity_period'
][
$key
]))
{
$validityPeriod
=
explode
(
'~'
,
$attachmentData
[
'validity_period'
][
$key
]);
$validityPeriod
=
explode
(
'~'
,
$attachmentData
[
'validity_period'
][
$key
]);
$attachment
[
'validity_start'
]
=
strtotime
(
trim
(
$validityPeriod
[
0
]));
$attachment
[
'validity_start'
]
=
strtotime
(
trim
(
$validityPeriod
[
0
]));
$attachment
[
'validity_end'
]
=
strtotime
(
trim
(
$validityPeriod
[
1
]));
$attachment
[
'validity_end'
]
=
strtotime
(
trim
(
$validityPeriod
[
1
]));
}
else
{
$attachment
[
'validity_start'
]
=
0
;
$attachment
[
'validity_end'
]
=
0
;
}
}
$attachments
[]
=
$attachment
;
$attachments
[]
=
$attachment
;
}
}
...
...
app/Http/Services/SupplierService.php
View file @
eaa09766
...
@@ -89,6 +89,7 @@ class SupplierService
...
@@ -89,6 +89,7 @@ class SupplierService
'field_name'
,
'field_name'
,
'validity_type'
,
'validity_type'
,
'validity_period'
,
'validity_period'
,
'description'
,
];
];
$attachmentData
=
array_only
(
$channel
,
$attachmentField
);
$attachmentData
=
array_only
(
$channel
,
$attachmentField
);
$channel
=
array_except
(
$channel
,
$attachmentField
);
$channel
=
array_except
(
$channel
,
$attachmentField
);
...
...
app/Http/Validators/SupplierValidator.php
View file @
eaa09766
...
@@ -44,6 +44,7 @@ class SupplierValidator
...
@@ -44,6 +44,7 @@ class SupplierValidator
'supplier_type'
=>
'required'
,
'supplier_type'
=>
'required'
,
'supplier_name'
=>
'required'
,
'supplier_name'
=>
'required'
,
'legal_representative'
=>
'required'
,
'legal_representative'
=>
'required'
,
'supplier_address'
=>
'required'
,
'stockup_type'
=>
'required'
,
'stockup_type'
=>
'required'
,
'main_brands'
=>
'required'
,
'main_brands'
=>
'required'
,
'pay_type'
=>
'required'
,
'pay_type'
=>
'required'
,
...
...
resources/views/script/supplier/SupplierFileScript.blade.php
View file @
eaa09766
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
form
.
on
(
'select(validity_period_selector)'
,
function
(
data
)
{
form
.
on
(
'select(validity_period_selector)'
,
function
(
data
)
{
fileType
=
data
.
value
;
fileType
=
data
.
value
;
let
validityPeriodTimeSelector
=
$
(
this
)
.
parents
(
'.
layui-col-md7
'
)
let
validityPeriodTimeSelector
=
$
(
this
)
.
parents
(
'.
validity_period_selector_div
'
)
.
find
(
'.validity_period'
);
.
find
(
'.validity_period'
);
if
(
data
.
value
===
'1'
)
{
if
(
data
.
value
===
'1'
)
{
validityPeriodTimeSelector
.
attr
(
'disabled'
,
true
);
validityPeriodTimeSelector
.
attr
(
'disabled'
,
true
);
...
...
resources/views/web/supplier/SupplierFile.blade.php
View file @
eaa09766
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
<input
type=
"hidden"
id=
"field_name"
>
<input
type=
"hidden"
id=
"field_name"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-md
5
"
>
<div
class=
"layui-col-md
4 validity_period_selector_div
"
>
<label
class=
"layui-form-label"
>
有效期 :
</label>
<label
class=
"layui-form-label"
>
有效期 :
</label>
<div
class=
"layui-input-inline"
style=
"width: 100px"
>
<div
class=
"layui-input-inline"
style=
"width: 100px"
>
<select
id=
"validity_type"
lay-filter=
"validity_period_selector"
>
<select
id=
"validity_type"
lay-filter=
"validity_period_selector"
>
...
@@ -59,14 +59,14 @@
...
@@ -59,14 +59,14 @@
<option
value=
"2"
>
自定义
</option>
<option
value=
"2"
>
自定义
</option>
</select>
</select>
</div>
</div>
<div
class=
"layui-input-inline"
style=
"width:
3
00px"
>
<div
class=
"layui-input-inline"
style=
"width:
2
00px"
>
<input
type=
"text"
id=
"validity_period"
<input
type=
"text"
id=
"validity_period"
placeholder=
"请选择时间区间"
autocomplete=
"off"
class=
""
disabled
>
placeholder=
"请选择时间区间"
autocomplete=
"off"
class=
""
disabled
>
</div>
</div>
</div>
</div>
<div
class=
"layui-col-md
4
"
>
<div
class=
"layui-col-md
5
"
>
<label
class=
"layui-form-label"
>
附件说明 :
</label>
<label
class=
"layui-form-label"
>
附件说明 :
</label>
<div
class=
"layui-input-
block block-42
"
>
<div
class=
"layui-input-
inline"
style=
"width: 300px
"
>
<input
type=
"text"
id=
"description"
<input
type=
"text"
id=
"description"
placeholder=
"附件说明"
class=
"layui-input"
placeholder=
"附件说明"
class=
"layui-input"
value=
""
>
value=
""
>
...
...
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