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
d7914268
authored
Jul 12, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
8ad695f2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
1 deletions
app/Http/Controllers/Api/SupplierContactApiController.php
app/Http/Services/SupplierService.php
app/Http/Validators/SupplierContactValidator.php
app/Http/Validators/SupplierValidator.php
app/Http/function.php
resources/views/script/AddSupplierContactScript.blade.php
app/Http/Controllers/Api/SupplierContactApiController.php
View file @
d7914268
...
@@ -83,6 +83,7 @@ class SupplierContactApiController extends Controller
...
@@ -83,6 +83,7 @@ class SupplierContactApiController extends Controller
'supplier_position'
,
'supplier_position'
,
'can_check_uids'
'can_check_uids'
]);
]);
$data
=
BatchTrim
(
$data
);
//先去表单验证
//先去表单验证
$validator
=
new
SupplierContactValidator
();
$validator
=
new
SupplierContactValidator
();
$validateResult
=
$validator
->
checkSave
(
$request
);
$validateResult
=
$validator
->
checkSave
(
$request
);
...
...
app/Http/Services/SupplierService.php
View file @
d7914268
...
@@ -375,8 +375,9 @@ class SupplierService
...
@@ -375,8 +375,9 @@ class SupplierService
$logService
=
new
LogService
();
$logService
=
new
LogService
();
$content
=
"添加采购员 : "
.
$channelUserName
;
$content
=
"添加采购员 : "
.
$channelUserName
;
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'添加采购员'
,
$content
);
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'添加采购员'
,
$content
);
}
}
$syncService
=
new
SyncSupplierService
();
$syncService
->
syncSupplierToErp
(
$supplierId
);
return
$contactResult
;
return
$contactResult
;
}
}
...
...
app/Http/Validators/SupplierContactValidator.php
View file @
d7914268
...
@@ -13,6 +13,7 @@ class SupplierContactValidator
...
@@ -13,6 +13,7 @@ class SupplierContactValidator
{
{
$data
=
$request
->
all
();
$data
=
$request
->
all
();
$data
=
BatchTrim
(
$data
);
$rules
=
[
$rules
=
[
"supplier_consignee"
=>
"required"
,
"supplier_consignee"
=>
"required"
,
"supplier_email"
=>
"required|email"
,
"supplier_email"
=>
"required|email"
,
...
...
app/Http/Validators/SupplierValidator.php
View file @
d7914268
...
@@ -54,6 +54,7 @@ class SupplierValidator
...
@@ -54,6 +54,7 @@ class SupplierValidator
if
(
empty
(
$requestData
[
'supplier_id'
]))
{
if
(
empty
(
$requestData
[
'supplier_id'
]))
{
$rules
[
'purchase_uid'
]
=
'required'
;
$rules
[
'purchase_uid'
]
=
'required'
;
}
}
//营业执照是不能为空的
//营业执照是不能为空的
$messages
=
$this
->
messages
();
$messages
=
$this
->
messages
();
$validator
=
Validator
::
make
(
$requestData
,
$rules
,
$messages
);
$validator
=
Validator
::
make
(
$requestData
,
$rules
,
$messages
);
...
...
app/Http/function.php
View file @
d7914268
...
@@ -176,3 +176,15 @@ function checkPerm($perm)
...
@@ -176,3 +176,15 @@ function checkPerm($perm)
$perms
=
request
()
->
perms
;
$perms
=
request
()
->
perms
;
return
in_array
(
$perm
,
$perms
);
return
in_array
(
$perm
,
$perms
);
}
}
//批量清楚前后空格
function
BatchTrim
(
$data
)
{
if
(
!
empty
(
$data
))
{
foreach
(
$data
as
&
$item
)
{
$item
=
trim
(
$item
);
}
unset
(
$item
);
}
return
$data
;
}
resources/views/script/AddSupplierContactScript.blade.php
View file @
d7914268
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
$
(
'#supplier_email'
).
blur
(
function
()
{
$
(
'#supplier_email'
).
blur
(
function
()
{
let
value
=
$
(
this
).
val
();
let
value
=
$
(
this
).
val
();
value
=
value
.
trim
();
if
(
value
!==
''
)
{
if
(
value
!==
''
)
{
let
reg
=
/^
([
a-zA-Z0-9_-
])
+@
([
a-zA-Z0-9_-
])
+
(
.
[
a-zA-Z0-9_-
])
+/
;
let
reg
=
/^
([
a-zA-Z0-9_-
])
+@
([
a-zA-Z0-9_-
])
+
(
.
[
a-zA-Z0-9_-
])
+/
;
if
(
!
reg
.
test
(
value
)){
if
(
!
reg
.
test
(
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