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
76de2e20
authored
May 22, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
查询供应商完善
parent
cdb6e112
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
70 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierService.php
resources/views/script/QuerySupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/QuerySupplier.blade.php
resources/views/web/SupplierList.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
76de2e20
...
...
@@ -735,9 +735,12 @@ class SupplierApiController extends Controller
//查询供应商
public
function
querySupplier
(
$request
)
{
$supplierName
=
$request
->
input
(
'supplier_name'
);
$supplierName
=
trim
(
$request
->
input
(
'supplier_name'
));
if
(
!
$supplierName
)
{
$this
->
response
(
-
1
,
'供应商名称不能为空'
);
}
$supplier
=
(
new
SupplierService
())
->
querySupplier
(
$supplierName
);
$this
->
response
(
0
,
'
ok
'
,
$supplier
);
$this
->
response
(
0
,
'
查询成功
'
,
$supplier
);
}
}
app/Http/Services/SupplierService.php
View file @
76de2e20
...
...
@@ -8,6 +8,7 @@ use App\Http\Transformers\SupplierTransformer;
use
App\Http\Validators\SupplierValidator
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierAddressModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
...
...
@@ -738,6 +739,11 @@ class SupplierService
{
$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
;
}
...
...
resources/views/script/QuerySupplierScript.blade.php
View file @
76de2e20
...
...
@@ -4,37 +4,38 @@
let
form
=
layui
.
form
;
let
table
=
layui
.
table
let
element
=
layui
.
element
;
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
$
(
'#querySupplier'
).
click
(
function
()
{
let
supplierName
=
$
(
'#supplier_name'
).
val
();
admin
.
showLoading
({
type
:
3
type
:
3
,
});
let
supplierIds
=
getQueryVariable
(
'supplier_ids'
);
let
url
=
'/api/supplier/BatchAllocatePurchaseUser?supplier_ids='
+
supplierIds
;
$
.
ajax
({
url
:
url
,
type
:
'GET'
,
async
:
true
,
data
:
data
.
field
,
dataType
:
'json'
,
timeout
:
20000
,
success
:
function
(
res
)
{
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
?
'是'
:
'否'
;
$
(
'#uploaded_sku'
).
text
(
uploadedSku
);
let
isYunxinSupplier
=
res
.
data
.
is_yunxin_supplier
?
'是'
:
'否'
;
$
(
'#is_yunxin_supplier'
).
text
(
isYunxinSupplier
);
admin
.
removeLoading
();
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
if
(
res
.
data
.
length
===
0
)
{
layer
.
msg
(
'供应商不存在'
,{
icon
:
5
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
},
error
:
function
()
{
}
else
{
admin
.
removeLoading
();
parent
.
layer
.
msg
(
'网络错误'
,
{
icon
:
5
});
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
);
}
return
false
;
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/script/SupplierListScript.blade.php
View file @
76de2e20
...
...
@@ -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/web/QuerySupplier.blade.php
View file @
76de2e20
...
...
@@ -4,55 +4,32 @@
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height: 170px"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
渠道开发员设置
</b>
</blockquote>
<div
class=
"layui-card-header"
style=
"height: 120px"
>
<form
class=
"layui-form"
action=
""
>
<input
type=
"hidden"
name=
"supplier_ids"
value=
"{{$supplierIds}}"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_uid','渠道开发员',null,
$userCodes,['required'=>true,'width'=>'150px']) !!}
<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"
>
<div
align=
"center"
style=
"margin-top: 10px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"auditSupplier"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
<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
class=
"layui-card-body"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
当前选中需要批量修改渠道员的供应商列表
</b>
</blockquote>
<table
class=
"layui-table"
>
<colgroup>
<col
width=
"300"
>
<col
width=
"100"
>
<col>
</colgroup>
<thead>
<tr>
<th>
供应商名称
</th>
<th>
当前渠道开发员
</th>
</tr>
</thead>
<tbody>
@foreach($suppliers as $supplier)
<tr>
<td>
{{$supplier['supplier_name']}}
</td>
<td>
{{$supplier['purchase_username']}}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
resources/views/web/SupplierList.blade.php
View file @
76de2e20
...
...
@@ -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