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
93249a35
authored
May 25, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查询供应商和联系人权限
parent
917ab2cd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
133 additions
and
10 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierContactService.php
app/Http/Services/SupplierService.php
resources/views/script/QuerySupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/supplier/SupplierContactScript.blade.php
resources/views/web/QuerySupplier.blade.php
resources/views/web/SupplierList.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
93249a35
...
...
@@ -732,4 +732,16 @@ class SupplierApiController extends Controller
exit
;
}
//查询供应商
public
function
querySupplier
(
$request
)
{
$supplierName
=
trim
(
$request
->
input
(
'supplier_name'
));
if
(
!
$supplierName
)
{
$this
->
response
(
-
1
,
'供应商名称不能为空'
);
}
$supplier
=
(
new
SupplierService
())
->
querySupplier
(
$supplierName
);
$this
->
response
(
0
,
'查询成功'
,
$supplier
);
}
}
app/Http/Controllers/SupplierController.php
View file @
93249a35
...
...
@@ -396,4 +396,10 @@ class SupplierController extends Controller
return
$this
->
view
(
'批量分配渠道开发员'
);
}
//查询供应商
public
function
QuerySupplier
(
$request
)
{
return
$this
->
view
(
'查询供应商'
);
}
}
\ No newline at end of file
app/Http/Services/SupplierContactService.php
View file @
93249a35
...
...
@@ -88,14 +88,14 @@ class SupplierContactService
$newContact
=
$model
->
where
(
'contact_id'
,
$contactId
)
->
first
()
->
toArray
();
if
(
$result
)
{
$needAudit
=
$this
->
checkNeedAudit
(
$oldContact
,
$newContact
);
if
(
$needAudit
)
{
//修改供应商为审核状态
$supplierModel
->
where
(
'supplier_id'
,
$contact
[
'supplier_id'
])
->
update
([
'update_time'
=>
time
(),
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
]);
}
//
$needAudit = $this->checkNeedAudit($oldContact, $newContact);
//
if ($needAudit) {
//
//修改供应商为审核状态
//
$supplierModel->where('supplier_id', $contact['supplier_id'])->update([
//
'update_time' => time(),
//
'status' => SupplierChannelModel::STATUS_PENDING,
//
]);
//
}
$logService
=
new
LogService
();
$content
=
!
empty
(
$contact
[
'contact_id'
])
?
'修改联系人'
:
'添加联系人'
;
...
...
app/Http/Services/SupplierService.php
View file @
93249a35
...
...
@@ -733,4 +733,17 @@ class SupplierService
exportCsv
(
$csvData
,
'导出供应商列表'
,
$header
);
}
//查询供应商
public
function
querySupplier
(
$supplierName
)
{
$supplier
=
SupplierChannelModel
::
where
(
'supplier_name'
,
$supplierName
)
->
first
();
$supplier
=
!
empty
(
$supplier
)
?
$supplier
->
toArray
()
:
[];
if
(
$supplier
)
{
//查询是否是云芯商家
$existsYunxinAccount
=
SupplierAccountModel
::
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
exists
();
$supplier
[
'is_yunxin_supplier'
]
=
$existsYunxinAccount
?
1
:
0
;
}
return
$supplier
;
}
}
\ No newline at end of file
resources/views/script/QuerySupplierScript.blade.php
0 → 100644
View file @
93249a35
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'layer'
,
'admin'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
table
=
layui
.
table
let
element
=
layui
.
element
;
$
(
'#querySupplier'
).
click
(
function
()
{
let
supplierName
=
$
(
'#supplier_name'
).
val
();
admin
.
showLoading
({
type
:
3
,
});
let
url
=
'/api/supplier/querySupplier?supplier_name='
+
supplierName
;
let
res
=
ajax
(
url
);
if
(
!
res
)
{
admin
.
removeLoading
();
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
let
exists
=
res
.
data
.
supplier_id
?
'是(无需新建)'
:
'否(可以新建)'
;
$
(
'#exists'
).
text
(
exists
);
let
uploadedSku
=
res
.
data
.
uploaded_sku
?
'是(有上传过sku)'
:
'否(没有上传过sku)'
;
$
(
'#uploaded_sku'
).
text
(
uploadedSku
);
let
isYunxinSupplier
=
res
.
data
.
is_yunxin_supplier
?
'是'
:
'否'
;
$
(
'#is_yunxin_supplier'
).
text
(
isYunxinSupplier
);
admin
.
removeLoading
();
if
(
res
.
data
.
length
===
0
)
{
layer
.
msg
(
'供应商不存在'
,{
icon
:
5
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
}
else
{
admin
.
removeLoading
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
return
false
;
});
});
</script>
\ No newline at end of file
resources/views/script/SupplierListScript.blade.php
View file @
93249a35
...
...
@@ -637,6 +637,18 @@
}
})
//设置SKU采购
$
(
"#query_supplier"
).
click
(
function
()
{
layer
.
open
({
type
:
2
,
content
:
'/supplier/QuerySupplier?view=iframe'
,
area
:
[
'70%'
,
'30%'
],
title
:
'查询供应商'
,
end
:
function
()
{
}
});
})
//判断是否要展示有全部离职采购员的供应商,有的话提示
if
(
!
admin
.
getTempData
(
'has_pop_up_all_channel_user_supplier_tips'
))
{
$
.
ajax
({
...
...
resources/views/script/supplier/SupplierContactScript.blade.php
View file @
93249a35
...
...
@@ -17,11 +17,9 @@
first
:
true
,
//不显示首页
last
:
false
,
//不显示尾页
cols
:
[[
@
if
(
$operate
==
'update'
)
{
type
:
'radio'
,
},
@
endif
{
field
:
'supplier_consignee'
,
title
:
'
<
span
class
=
"require"
>*
<
/span>联系人'
,
...
...
resources/views/web/QuerySupplier.blade.php
0 → 100644
View file @
93249a35
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height: 120px"
>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-col-md9"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
名称
</label>
<div
class=
"layui-input-block block-42"
>
<input
type=
"text"
name=
"supplier_name"
id=
"supplier_name"
placeholder=
"请输入供应商名称(全称)"
class=
"layui-input"
value=
""
>
</div>
</div>
<div
class=
"layui-col-md3"
style=
"padding-left: 10px;"
>
<button
class=
"layui-btn layui-btn-sm layui-btn-info"
style=
"margin-bottom: 13px"
id=
"querySupplier"
>
查询
</button>
</div>
</div>
<div
class=
"layui-form-item"
style=
"padding-left: 70px;"
>
<div
class=
"layui-col-md4"
>
是否建档 :
<span
id=
"exists"
></span>
</div>
<div
class=
"layui-col-md4"
>
是否有平台合作 :
<span
id=
"uploaded_sku"
></span>
</div>
<div
class=
"layui-col-md4"
>
是否云芯商家 :
<span
id=
"is_yunxin_supplier"
></span>
</div>
</div>
</form>
</div>
</div>
resources/views/web/SupplierList.blade.php
View file @
93249a35
...
...
@@ -68,6 +68,9 @@
@if(checkPerm('ExportSupplier'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
export_supplier
">导出采购员全离职供应商</button>
@endif
@if(checkPerm('QuerySupplier'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
query_supplier
">查询供应商</button>
@endif
</div>
<button type="
button
" id="
refreshWindow
" style="
display
:
none
">刷新页面</button>
<table class="
layui
-
table
" id="
list
" lay-filter="
list
"></table>
...
...
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