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
1af7f9a1
authored
Jul 22, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审核申请
parent
64cb897c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
150 additions
and
2 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierService.php
config/fixed.php
resources/views/script/BatchApplyInReviewSupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/BatchApplyInReviewSupplier.blade.php
resources/views/web/SupplierList.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
1af7f9a1
...
...
@@ -461,4 +461,14 @@ class SupplierApiController extends Controller
$this
->
response
(
-
1
,
'取消禁用操作失败'
);
}
}
//批量申请审核供应商
public
function
BatchApplyInReviewSupplier
(
$request
)
{
$supplierIds
=
$request
->
get
(
'supplier_ids'
);
$supplierIds
=
explode
(
','
,
$supplierIds
);
$supplierService
=
new
SupplierService
();
$supplierService
->
batchApplyInReviewSupplier
(
$supplierIds
);
$this
->
response
(
0
,
'批量申请审核成功'
);
}
}
app/Http/Controllers/SupplierController.php
View file @
1af7f9a1
...
...
@@ -289,9 +289,22 @@ class SupplierController extends Controller
$supplierService
=
new
SupplierService
();
$supplierId
=
$request
->
get
(
'supplier_id'
);
$printData
=
$supplierService
->
getSupplierPrintData
(
$supplierId
);
// dd($printData);
$this
->
data
[
'printData'
]
=
$printData
;
return
$this
->
view
(
'打印供应商详情'
);
}
//批量申请审批供应商
public
function
BatchApplyInReviewSupplier
(
$request
)
{
$supplierIds
=
$request
->
get
(
'supplier_ids'
);
$this
->
data
[
'supplierIds'
]
=
$supplierIds
;
$supplierIds
=
explode
(
','
,
$supplierIds
);
$model
=
new
SupplierChannelModel
();
$suppliers
=
$model
->
whereIn
(
'supplier_id'
,
$supplierIds
)
->
get
()
->
toArray
();
$transformer
=
new
SupplierTransformer
();
$suppliers
=
$transformer
->
transformList
(
$suppliers
);
$this
->
data
[
'suppliers'
]
=
$suppliers
;
return
$this
->
view
(
'批量分配渠道开发员'
);
}
}
\ No newline at end of file
app/Http/Services/SupplierService.php
View file @
1af7f9a1
...
...
@@ -439,4 +439,20 @@ class SupplierService
$printData
[
'department_name'
]
=
$user
[
'department_name'
];
return
$printData
;
}
//批量申请审核供应商
public
function
batchApplyInReviewSupplier
(
$supplierIds
)
{
$model
=
new
SupplierChannelModel
();
foreach
(
$supplierIds
as
$supplierId
)
{
$result
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'update_time'
=>
time
(),
'status'
=>
1
]);
if
(
!
$result
)
{
return
$result
;
}
}
return
true
;
}
}
\ No newline at end of file
config/fixed.php
View file @
1af7f9a1
...
...
@@ -87,6 +87,7 @@ return [
'SupplierStatus'
=>
[
0
=>
'待审核'
,
-
1
=>
'待复审'
,
1
=>
'审核中'
,
3
=>
'未通过'
,
...
...
resources/views/script/BatchApplyInReviewSupplierScript.blade.php
0 → 100644
View file @
1af7f9a1
<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
;
$
(
'#batch_apply_in_review_supplier'
).
click
(
function
()
{
admin
.
btnLoading
(
'.submit-loading'
);
let
supplierIds
=
getQueryVariable
(
'supplier_ids'
);
let
url
=
'/api/supplier/BatchApplyInReviewSupplier?supplier_ids='
+
supplierIds
;
let
res
=
ajax
(
url
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
admin
.
btnLoading
(
'.submit-loading'
,
false
);
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
});
form
.
on
(
'submit(cancel)'
,
function
(
data
)
{
admin
.
closeThisDialog
();
});
});
</script>
\ No newline at end of file
resources/views/script/SupplierListScript.blade.php
View file @
1af7f9a1
...
...
@@ -325,6 +325,40 @@
}
})
//申请进入审核中的状态
$
(
"#batch_apply_in_review_supplier"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'list'
);
let
data
=
checkStatus
.
data
;
let
supplierIds
=
Array
.
from
(
data
,
({
supplier_id
})
=>
supplier_id
);
supplierIds
=
supplierIds
.
join
(
','
);
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的供应商'
,
{
icon
:
5
})
}
else
{
let
status
=
Array
.
from
(
data
,
({
status
})
=>
status
);
let
checkCanApplyInReview
=
true
;
status
.
every
(
function
(
value
)
{
if
(
value
!==
0
)
{
checkCanApplyInReview
=
false
;
}
})
if
(
!
checkCanApplyInReview
)
{
layer
.
msg
(
'选择的供应商里,存在非待审核状态的供应商,无法申请审核'
,
{
icon
:
5
})
return
false
;
}
layer
.
open
({
type
:
2
,
content
:
'/supplier/BatchApplyInReviewSupplier?view=iframe&supplier_ids='
+
supplierIds
,
area
:
[
'600px'
,
'70%'
],
title
:
'批量申请审核供应商'
,
end
:
function
()
{
table
.
reload
(
'list'
);
supplierStatistics
();
}
});
}
})
//分配采购员
$
(
"#allocate_channel_user"
).
click
(
function
()
{
...
...
resources/views/web/BatchApplyInReviewSupplier.blade.php
0 → 100644
View file @
1af7f9a1
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<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
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
id=
"batch_apply_in_review_supplier"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-primary"
id=
"cancel"
>
取消
</button>
</div>
</div>
resources/views/web/SupplierList.blade.php
View file @
1af7f9a1
...
...
@@ -25,8 +25,11 @@
转正供应商
</button>
@endif
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" title="
点击确定审核后会进入审核中状态
" id="
batch_apply_in_review_supplier
">
申请审核
</button>
@if(checkPerm('ChangeSupplierIsType'))
{{-- @if(checkPerm('BlockSupplier'))--}}
{{-- @if(checkPerm('BlockSupplier'))--}}
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
block_supplier
">
拉黑
</button>
...
...
@@ -36,6 +39,7 @@
金蝶同步
</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