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
0a415adc
authored
Jan 11, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
供应商小需求
parent
c827b662
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
24 deletions
app/Http/Validators/SupplierContactValidator.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/SupplierDetail.blade.php
app/Http/Validators/SupplierContactValidator.php
View file @
0a415adc
...
...
@@ -27,29 +27,7 @@ class SupplierContactValidator
if
(
$validator
->
fails
())
{
return
$validator
->
errors
()
->
first
();
}
$contactModel
=
new
SupplierContactModel
();
//如果是原厂或者代理商性质的供应商,联系人不能重复
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$data
[
'supplier_id'
])
->
first
()
->
toArray
();
if
(
$supplier
[
'supplier_group'
]
==
1
||
$supplier
[
'supplier_group'
]
==
4
)
{
$query
=
$contactModel
->
where
(
'supplier_id'
,
$data
[
'supplier_id'
])
->
where
(
function
(
$q
)
use
(
$data
)
{
$q
->
where
(
'supplier_email'
,
$data
[
'supplier_email'
])
->
orWhere
(
'supplier_mobile'
,
$data
[
'supplier_mobile'
]);
});
//新增
if
(
empty
(
$data
[
'contact_id'
]))
{
$count
=
$query
->
count
();
}
else
{
//修改
$count
=
$query
->
where
(
'contact_id'
,
'!='
,
$data
[
'contact_id'
])
->
count
();
}
if
(
$count
)
{
return
'原厂或者代理商性质的供应商不允许重复的联系人,<br>该供应商已经存在手机号或者邮箱一样的联系人,请联系管理人员查看具体详情'
;
}
}
return
true
;
}
private
function
messages
()
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
0a415adc
...
...
@@ -128,6 +128,7 @@
//监听所在区域变化,中国才显示省市选择
//而且有值+新增供应商操作 才能修改供应商名字和税号
//如果区域是海外(非中国),就去掉税号的必填星号
//如果选择区域为国内,那么成立时间disabled
form
.
on
(
'select(region)'
,
function
(
data
)
{
@
if
(
empty
(
$supplier
))
let
supplierNameObj
=
$
(
'#supplier_name'
);
...
...
@@ -148,10 +149,17 @@
$
(
'#tax_number_required_span'
).
show
();
$
(
'#tax_number_div'
).
show
();
$
(
'.city-div'
).
show
();
//同时还要判断权限,有忽略公司校验权限的,成立时间可以不disabled
if
(
!
ignoreCompanyCheck
)
{
$
(
'#established_time'
).
attr
(
'disabled'
,
true
);
$
(
'#established_time'
).
addClass
(
'layui-disabled'
);
}
}
else
{
$
(
'#tax_number_required_span'
).
hide
();
$
(
'#tax_number_div'
).
hide
();
$
(
'.city-div'
).
hide
();
$
(
'#established_time'
).
attr
(
'disabled'
,
false
);
$
(
'#established_time'
).
removeClass
(
'layui-disabled'
);
}
});
...
...
resources/views/web/SupplierDetail.blade.php
View file @
0a415adc
...
...
@@ -55,7 +55,7 @@
</div>
<div
class=
"layui-col-md3"
>
<span
title=
"{{$supplier['channel_username']}}"
>
采购员 : {{str_limit($supplier['channel_username'],
5
0,'...')}}
采购员 : {{str_limit($supplier['channel_username'],
3
0,'...')}}
</span>
</div>
<div
class=
"layui-col-md3"
></div>
...
...
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