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
6eac583f
authored
Apr 14, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
cd06e008
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
451 additions
and
79 deletions
app/Http/Controllers/SupplierController.php
app/Http/Services/AdminUserService.php
app/Http/Services/SupplierStatisticsService.php
app/Http/Transformers/SupplierTransformer.php
app/Model/SupplierChannelModel.php
app/Model/SupplierContactModel.php
app/Presenters/Filter/DayTypePresenter.php
app/Presenters/Filter/TransformableInputPresenter.php
app/Presenters/Filter/TransformableSelectPresenter.php
app/Presenters/Filter/TransformableTimeIntervalPresenter.php
app/Presenters/StatusPresenter.php
config/fixed.php
resources/views/script/SupplierList.blade.php
resources/views/web/supplier/SupplierListCommon.blade.php
app/Http/Controllers/SupplierController.php
View file @
6eac583f
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Http\Services\RoleService
;
use
App\Http\Services\RoleService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierStatisticsService
;
use
App\Http\Services\ViewCheckService
;
use
App\Http\Services\ViewCheckService
;
use
App\Model\IntracodeModel
;
use
App\Model\IntracodeModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
...
@@ -53,6 +54,9 @@ class SupplierController extends Controller
...
@@ -53,6 +54,9 @@ class SupplierController extends Controller
$intracodeModel
=
new
IntracodeModel
();
$intracodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getSampleEncode
();
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getSampleEncode
();
$this
->
data
[
'users'
]
=
$intracodeModel
->
getAdminUserAndCode
();
$this
->
data
[
'users'
]
=
$intracodeModel
->
getAdminUserAndCode
();
$supplierStatisticsService
=
new
SupplierStatisticsService
();
$statistics
=
$supplierStatisticsService
->
getSupplierListStatistics
();
$this
->
data
[
'statistics'
]
=
$statistics
;
$this
->
data
[
'validPerms'
]
=
[];
$this
->
data
[
'validPerms'
]
=
[];
return
$this
->
view
(
'供应商列表'
);
return
$this
->
view
(
'供应商列表'
);
}
}
...
...
app/Http/Services/AdminUserService.php
View file @
6eac583f
...
@@ -23,6 +23,14 @@ class AdminUserService
...
@@ -23,6 +23,14 @@ class AdminUserService
public
function
getAdminUserInfo
(
$userId
)
public
function
getAdminUserInfo
(
$userId
)
{
{
$user
=
DB
::
connection
()
->
table
(
'user_info'
)
->
where
(
'userId'
,
$userId
)
->
first
();
$user
=
DB
::
connection
()
->
table
(
'user_info'
)
->
where
(
'userId'
,
$userId
)
->
first
();
return
$user
?
:
[];
return
$user
?:
[];
}
//获取离职人员列表
public
function
getResignedUsers
()
{
$user
=
DB
::
connection
()
->
table
(
'user_info'
)
->
leftJoin
(
'lie_intracode'
,
'user_info.userId'
,
'='
,
'lie_intracode.admin_id'
)
->
where
(
'user_info.status'
,
4
)
->
where
(
'lie_intracode.code_id'
,
'!='
,
''
)
->
get
();
return
$user
?:
[];
}
}
}
}
\ No newline at end of file
app/Http/Services/SupplierStatisticsService.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Http\Services
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Support\Facades\DB
;
class
SupplierStatisticsService
{
//获取供应商列表需要统计的信息
public
function
getSupplierListStatistics
()
{
$model
=
new
SupplierChannelModel
();
$total
=
$model
->
count
();
//待审核,就是以前的草稿
$pending
=
$model
->
where
(
'status'
,
$model
::
STATUS_PENDING
)
->
count
();
//审核中
$inReview
=
$model
->
where
(
'status'
,
$model
::
STATUS_IN_REVIEW
)
->
count
();
//通过
$passed
=
$model
->
where
(
'status'
,
$model
::
STATUS_PASSED
)
->
count
();
//未通过
$rejected
=
$model
->
where
(
'status'
,
$model
::
STATUS_REJECT
)
->
count
();
//禁用
$disable
=
$model
->
where
(
'status'
,
$model
::
STATUS_DISABLE
)
->
count
();
//没有渠道开发员
$noPurchaseUid
=
$model
->
where
(
'status'
,
'!='
,
$model
::
STATUS_DISABLE
)
->
where
(
'purchase_uid'
,
'='
,
''
)
->
count
();
//没有sku的
$noSku
=
$model
->
where
(
'sku_num'
,
'=='
,
0
)
->
count
();
$adminUserService
=
new
AdminUserService
();
$resignedUsers
=
$adminUserService
->
getResignedUsers
();
$resignedUserCodes
=
array_column
(
$resignedUsers
,
'code_id'
);
//存在无效(离职)开发员
$invalidPurchaseUid
=
$model
->
where
(
'status'
,
'!='
,
$model
::
STATUS_DISABLE
)
->
whereIn
(
'purchase_uid'
,
$resignedUserCodes
)
->
count
();
//构建likeIn语句需要的数据
$likeSqlRaw
=
implode
(
'|'
,
$resignedUserCodes
);
//存在无效(离职)采购员
$invalidChannelUid
=
$model
->
where
(
'status'
,
'!='
,
$model
::
STATUS_DISABLE
)
->
whereRaw
(
DB
::
raw
(
"channel_uid REGEXP '
$likeSqlRaw
'"
))
->
count
();
//待跟进
$toFollowUp
=
$model
->
where
(
'status'
,
'!='
,
$model
::
STATUS_DISABLE
)
->
where
(
'to_follow_up'
,
1
)
->
count
();
$result
=
[
'total'
=>
$total
,
'pending'
=>
$pending
,
'in_review'
=>
$inReview
,
'passed'
=>
$passed
,
'rejected'
=>
$rejected
,
'disable'
=>
$disable
,
'no_purchase_uid'
=>
$noPurchaseUid
,
'invalid_channel_uid'
=>
$invalidChannelUid
,
'invalid_purchase_uid'
=>
$invalidPurchaseUid
,
'to_follow_up'
=>
$toFollowUp
,
'no_sku'
=>
$noSku
,
];
$result
=
array_map
(
function
(
$value
)
{
if
(
$value
>
999
)
{
$value
=
'999+'
;
}
return
$value
;
},
$result
);
return
$result
;
}
}
\ No newline at end of file
app/Http/Transformers/SupplierTransformer.php
View file @
6eac583f
...
@@ -7,6 +7,7 @@ namespace App\Http\Transformers;
...
@@ -7,6 +7,7 @@ namespace App\Http\Transformers;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\ViewCheckService
;
use
App\Http\Services\ViewCheckService
;
use
App\Model\IntracodeModel
;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierContactModel
;
class
SupplierTransformer
class
SupplierTransformer
{
{
...
@@ -32,7 +33,8 @@ class SupplierTransformer
...
@@ -32,7 +33,8 @@ class SupplierTransformer
$item
[
'channel_username'
]
=
$this
->
getChannelNames
(
$item
[
'channel_uid'
]);
$item
[
'channel_username'
]
=
$this
->
getChannelNames
(
$item
[
'channel_uid'
]);
$item
[
'purchase_username'
]
=
array_get
(
$users
,
$item
[
'purchase_uid'
]);
$item
[
'purchase_username'
]
=
array_get
(
$users
,
$item
[
'purchase_uid'
]);
$item
[
'status_name'
]
=
array_get
(
config
(
'fixed.SupplierStatus'
),
$item
[
'status'
]);
$item
[
'status_name'
]
=
array_get
(
config
(
'fixed.SupplierStatus'
),
$item
[
'status'
]);
$item
[
'contact_num'
]
=
1
;
$item
[
'contact_num'
]
=
$this
->
getContactNum
(
$item
[
'supplier_id'
]);
$item
[
'has_sku'
]
=
$item
[
'sku_num'
]
?
'是'
:
'否'
;
$item
[
'is_own'
]
=
$item
[
'create_uid'
]
==
request
()
->
user
->
userId
?
"创建"
:
"指派"
;
$item
[
'is_own'
]
=
$item
[
'create_uid'
]
==
request
()
->
user
->
userId
?
"创建"
:
"指派"
;
if
(
empty
(
$item
[
'create_name'
]))
{
if
(
empty
(
$item
[
'create_name'
]))
{
$userInfo
=
$adminUserService
->
getAdminUserInfo
(
$item
[
'create_uid'
]);
$userInfo
=
$adminUserService
->
getAdminUserInfo
(
$item
[
'create_uid'
]);
...
@@ -52,6 +54,12 @@ class SupplierTransformer
...
@@ -52,6 +54,12 @@ class SupplierTransformer
return
$list
;
return
$list
;
}
}
public
function
getContactNum
(
$supplierId
)
{
$model
=
new
SupplierContactModel
();
return
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
count
();
}
public
function
getChannelNames
(
$channelUid
)
public
function
getChannelNames
(
$channelUid
)
{
{
$intracodeModel
=
new
IntracodeModel
();
$intracodeModel
=
new
IntracodeModel
();
...
...
app/Model/SupplierChannelModel.php
View file @
6eac583f
...
@@ -9,6 +9,11 @@ use RedisDB;
...
@@ -9,6 +9,11 @@ use RedisDB;
class
SupplierChannelModel
extends
Model
class
SupplierChannelModel
extends
Model
{
{
const
STATUS_PENDING
=
-
1
;
const
STATUS_IN_REVIEW
=
1
;
const
STATUS_PASSED
=
2
;
const
STATUS_REJECT
=
3
;
const
STATUS_DISABLE
=
-
2
;
protected
$connection
=
'web'
;
protected
$connection
=
'web'
;
protected
$table
=
'supplier_channel'
;
protected
$table
=
'supplier_channel'
;
public
$timestamps
=
false
;
public
$timestamps
=
false
;
...
...
app/Model/SupplierContactModel.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Request
;
class
SupplierContactModel
extends
Model
{
protected
$connection
=
'web'
;
protected
$table
=
'supplier_contact'
;
public
$timestamps
=
false
;
public
function
AddInfo
(
$SupplierID
=
''
,
$data
=
''
){
if
(
empty
(
$SupplierID
)
||
empty
(
$data
)
||
!
is_array
(
$data
))
return
false
;
$Add
=
array
();
foreach
(
$data
as
$k
=>
$v
){
foreach
(
$v
as
$kk
=>
$vv
){
$Add
[
$kk
][
$k
]
=
$vv
;
$Add
[
$kk
][
'supplier_id'
]
=
$SupplierID
;
}
}
foreach
(
$Add
as
$v
){
$this
->
insert
(
$v
);
}
return
true
;
}
public
function
AddContactInfo
(
$data
=
''
,
$is_update
=
false
){
if
(
empty
(
$data
)
||
!
is_array
(
$data
))
return
false
;
if
(
$is_update
)
{
// 更新
$supplier_id
=
$data
[
'supplier_id'
];
unset
(
$data
[
'supplier_id'
]);
$this
->
where
(
'supplier_id'
,
'='
,
$supplier_id
)
->
update
(
$data
);
}
else
{
$this
->
insert
(
$data
);
}
}
public
function
SaveInfo
(
$SupplierID
=
''
,
$data
=
''
){
if
(
$SupplierID
<=
0
)
return
false
;
$this
->
where
(
'supplier_id'
,
'='
,
$SupplierID
)
->
delete
();
return
$this
->
AddInfo
(
$SupplierID
,
$data
);
}
public
function
ContactInfo
(
$SupplierID
=
''
){
$collert
=
Request
::
only
(
'supplier_id'
);
$collert
=
TrimX
(
$collert
,
true
,[
'supplier_id'
]);
empty
(
$collert
)
&&
$collert
[
'supplier_id'
]
=
$SupplierID
;
if
(
empty
(
$collert
[
'supplier_id'
]))
return
false
;
$info
=
$this
->
where
(
'supplier_id'
,
'='
,
$collert
[
'supplier_id'
])
->
get
();
if
(
!
$info
)
return
false
;
$info
=
$info
->
toArray
();
// $Arr=[];
// foreach ($info as $k=>$v){
// $Arr[$v['address_type']]=$v;
// }
return
$info
;
}
}
app/Presenters/Filter/DayTypePresenter.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Presenters\Filter
;
class
DayTypePresenter
{
public
function
render
(
$map
=
[],
$linkageName
=
''
)
{
$unique
=
"unique_"
.
mt_rand
(
1
,
100000
);
$html
=
<<<EOF
<div class="layui-row" style="width:268px;margin-bottom: 3px;margin-top: 5px">
<div class="layui-col-md2" style="margin-left: 34px">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button" id="${unique}_today">今日</button>
</div>
<div class="layui-col-md2">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button" id="${unique}_today">近三天</button>
</div>
<div class="layui-col-md2">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button" style="margin-left: 11px" id="${unique}_today">本周</button>
</div>
<div class="layui-col-md2">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button" style="margin-left: 10px" id="${unique}_today">本月</button>
</div>
<div class="layui-col-md3">
</div>
</div>
<script>
layui.use(['form', 'element'], function () {
$('.day_type_button').click(function() {
$('.day_type_button').attr('class','layui-btn layui-btn-primary layui-btn-sm day_type_button');
$(this).attr('class','layui-btn layui-btn-sm layui-btn-normal day_type_button');
});
});
</script>
EOF;
return
$html
;
}
public
function
optionsRender
(
$data
)
{
$optionsHtml
=
''
;
foreach
(
$data
as
$key
=>
$value
)
{
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'>
$value
</option>"
;
}
return
$optionsHtml
;
}
}
\ No newline at end of file
app/Presenters/Filter/TransformableInputPresenter.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Presenters\Filter
;
class
TransformableInputPresenter
{
public
function
render
(
$map
=
[])
{
$unique
=
"unique_"
.
mt_rand
(
1
,
100000
);
$defaultKey
=
array_keys
(
$map
)[
0
];
$html
=
<<<EOF
<div class="layui-row" style="width:268px;margin-bottom: 3px;">
<div class="layui-col-md5">
<div class="layui-input-inline" style="width: 100px;margin-left: 10px">
<select lay-filter="$unique">
{$this->optionsRender($map)}
</select>
</div>
</div>
<div class="layui-col-md7" style="margin-left: -3px">
<div class="layui-input-inline">
<input type="text" name="$defaultKey" placeholder="请输入" class="layui-input"
style="width: 158px">
</div>
</div>
</div>
<script>
layui.use(['form', 'element'], function () {
let form = layui.form;
form.on('select($unique)', function(data){
data.othis.parent().parent().parent().find('input').attr('name',data.value);
});
});
</script>
EOF;
return
$html
;
}
public
function
optionsRender
(
$data
)
{
$optionsHtml
=
''
;
foreach
(
$data
as
$key
=>
$value
)
{
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'>
$value
</option>"
;
}
return
$optionsHtml
;
}
}
\ No newline at end of file
app/Presenters/Filter/TransformableSelectPresenter.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Presenters\Filter
;
class
TransformableSelectPresenter
{
public
function
render
(
$map
=
[],
$data
=
[])
{
$defaultKey
=
array_keys
(
$map
)[
0
];
$unique
=
"unique_"
.
mt_rand
(
1
,
100000
);
$selectUnique
=
"unique_"
.
mt_rand
(
1
,
100000
);
$html
=
<<<EOF
<div class="layui-row" style="width:268px;margin-bottom: 3px;">
<div class="layui-col-md5">
<div class="layui-input-inline" style="width: 100px;margin-left: 10px">
<select lay-filter="$unique">
{$this->optionsRender($map)}
</select>
</div>
</div>
<div class="layui-col-md7" style="margin-left: -3px">
<div class="layui-input-inline">
<select class="value_select" name="$defaultKey" lay-filter="$selectUnique">
{$this->selectOptionsRender($data)}
</select>
</div>
</div>
</div>
<script>
layui.use(['form', 'element'], function () {
let form = layui.form;
form.on('select($unique)', function(data){
data.othis.parent().parent().parent().find('.value_select').attr('name',data.value);
});
});
</script>
EOF;
return
$html
;
}
public
function
optionsRender
(
$data
)
{
$optionsHtml
=
''
;
foreach
(
$data
as
$key
=>
$value
)
{
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'>
$value
</option>"
;
}
return
$optionsHtml
;
}
public
function
selectOptionsRender
(
$data
)
{
$optionsHtml
=
' <option value="">请选择</option>'
;
foreach
(
$data
as
$key
=>
$value
)
{
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'>
$value
</option>"
;
}
return
$optionsHtml
;
}
}
\ No newline at end of file
app/Presenters/Filter/TransformableTimeIntervalPresenter.php
0 → 100644
View file @
6eac583f
<?php
namespace
App\Presenters\Filter
;
class
TransformableTimeIntervalPresenter
{
public
function
render
(
$map
=
[])
{
$unique
=
"unique_"
.
mt_rand
(
1
,
100000
);
$defaultKey
=
array_keys
(
$map
)[
0
];
$html
=
<<<EOF
<div class="layui-row" style="width:268px;margin-bottom: 3px;">
<div class="layui-col-md5">
<div class="layui-input-inline" style="width: 100px;margin-left: 10px">
<select lay-filter="$unique">
{$this->optionsRender($map)}
</select>
</div>
</div>
<div class="layui-col-md7" style="margin-left: -3px">
<div class="layui-input-inline" style="min-width: 150px;width: 158px">
<input type="text" name="$defaultKey" id="$unique" placeholder="请选择时间区间" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<script>
layui.use(['form', 'element','laydate'], function(){
let laydate = layui.laydate;
let form = layui.form;
form.on('select($unique)', function(data){
data.othis.parent().parent().parent().find('input').attr('name',data.value);
});
laydate.render({
elem: '#$unique'
,type: 'date'
,trigger:'click'
,range: '~' //或 range: '~' 来自定义分割字符
});
});
</script>
EOF;
return
$html
;
}
public
function
optionsRender
(
$data
)
{
$optionsHtml
=
''
;
foreach
(
$data
as
$key
=>
$value
)
{
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'>
$value
</option>"
;
}
return
$optionsHtml
;
}
}
\ No newline at end of file
app/Presenters/StatusPresenter.php
View file @
6eac583f
...
@@ -30,7 +30,7 @@ EOF;
...
@@ -30,7 +30,7 @@ EOF;
$checked
=
''
;
$checked
=
''
;
foreach
(
$data
as
$key
=>
$value
)
{
foreach
(
$data
as
$key
=>
$value
)
{
if
(
$status
!==
null
)
{
if
(
$status
!==
null
)
{
$checked
=
(
$key
==
$status
)
?
"selected='selected'"
:
''
;
$checked
=
(
$key
==
=
$status
)
?
"selected='selected'"
:
''
;
}
}
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'
$checked
>
$value
</option>"
;
$optionsHtml
=
$optionsHtml
.
"<option value='
$key
'
$checked
>
$value
</option>"
;
}
}
...
...
config/fixed.php
View file @
6eac583f
...
@@ -110,11 +110,11 @@ return [
...
@@ -110,11 +110,11 @@ return [
'SupplierStatus'
=>
[
'SupplierStatus'
=>
[
-
3
=>
'已拉黑'
,
-
3
=>
'已拉黑'
,
-
2
=>
'禁
用
'
,
-
2
=>
'禁
止交易
'
,
-
1
=>
'
草稿
'
,
-
1
=>
'
待审核
'
,
1
=>
'
待审核
'
,
1
=>
'
审核中
'
,
2
=>
'
启用
'
,
2
=>
'
已通过
'
,
3
=>
'
驳回
'
3
=>
'
未通过
'
],
],
'Currency'
=>
[
'Currency'
=>
[
...
...
resources/views/script/SupplierList.blade.php
View file @
6eac583f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
let
$
=
layui
.
jquery
;
let
$
=
layui
.
jquery
;
let
Split
=
layui
.
Split
;
let
Split
=
layui
.
Split
;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
Split
([
'#s1'
,
'#s2'
,
'#s3'
,
'#s4'
,
'#s5'
],
{
sizes
:
[
7
,
10
,
10
,
10
,
63
],
minSize
:
10
0
});
Split
([
'#s1'
,
'#s2'
,
'#s3'
,
'#s4'
,
'#s5'
],
{
sizes
:
[
7
,
9
,
9
,
9
,
63
],
minSize
:
7
0
});
let
table
=
layui
.
table
;
let
table
=
layui
.
table
;
let
form
=
layui
.
form
;
let
form
=
layui
.
form
;
...
@@ -22,7 +22,13 @@
...
@@ -22,7 +22,13 @@
,
cols
:
[[
,
cols
:
[[
{
type
:
'radio'
},
{
type
:
'radio'
},
{
field
:
'supplier_id'
,
title
:
'供应商ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'supplier_id'
,
title
:
'供应商ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'supplier_code'
,
title
:
'供应商编码'
,
align
:
'center'
,
width
:
90
},
{
field
:
'supplier_code'
,
title
:
'供应商编码'
,
align
:
'center'
,
width
:
90
,
templet
:
function
(
data
)
{
console
.
log
(
data
)
return
"
<
a
href
=
'/supplier/EditSupplier?view=iframe&supplier_id=" + data.supplier_id +
"'
target
=
'_blank'
style
=
'color: dodgerblue'
>
" + data.supplier_code + "
<
/a>
"
}
},
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'center'
},
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'center'
},
{
field
:
'supplier_group'
,
title
:
'供应商性质'
,
align
:
'center'
,
width
:
120
},
{
field
:
'supplier_group'
,
title
:
'供应商性质'
,
align
:
'center'
,
width
:
120
},
{
{
...
@@ -37,7 +43,16 @@
...
@@ -37,7 +43,16 @@
},
},
{
field
:
'has_sku'
,
title
:
'SKU上传'
,
align
:
'center'
,
width
:
80
},
{
field
:
'has_sku'
,
title
:
'SKU上传'
,
align
:
'center'
,
width
:
80
},
{
field
:
'status_name'
,
title
:
'状态'
,
align
:
'center'
,
width
:
80
},
{
field
:
'status_name'
,
title
:
'状态'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
console
.
log
(
data
.
status
)
if
(
data
.
status
===
3
)
{
return
"
<
span
style
=
'color: red'
title
=
'" + data.reject_reason + "'
>
" + data.status_name + "
<
/span>
"
}
else
{
return
data
.
status_name
;
}
}
},
{
field
:
'channel_username'
,
title
:
'采购员'
,
align
:
'center'
,
width
:
150
},
{
field
:
'channel_username'
,
title
:
'采购员'
,
align
:
'center'
,
width
:
150
},
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'create_name'
,
title
:
'创建人'
,
align
:
'center'
,
width
:
80
},
{
field
:
'create_name'
,
title
:
'创建人'
,
align
:
'center'
,
width
:
80
},
...
@@ -48,6 +63,22 @@
...
@@ -48,6 +63,22 @@
,
page
:
{}
,
page
:
{}
});
});
// layer.confirm('确定禁用该供应商吗', {
// title: info + '供应商'
// , btn: ['确定', '取消']
// }, function () {
// layer.closeAll('dialog'); // 确定时关闭弹框
// let res = ajax('/api/supplier/ChangeSupplierStatus', data);
// if (!res) {
// layer.msg(res.err_msg, {icon: 6});
// } else {
// layer.msg(res.err_msg, {icon: 6});
// location.reload();
// }
// }, function () {
// layer.close();
// });
form
.
on
(
'submit(load)'
,
function
(
data
)
{
form
.
on
(
'submit(load)'
,
function
(
data
)
{
form
.
render
();
form
.
render
();
//执行重载
//执行重载
...
...
resources/views/web/supplier/SupplierListCommon.blade.php
View file @
6eac583f
...
@@ -3,45 +3,52 @@
...
@@ -3,45 +3,52 @@
<div
class=
"layui-card-body"
style=
"padding: 0;"
>
<div
class=
"layui-card-body"
style=
"padding: 0;"
>
<div
class=
"split-group"
style=
"height: 130px;"
>
<div
class=
"split-group"
style=
"height: 130px;"
>
<div
class=
"split-item"
id=
"s1"
>
<div
class=
"split-item"
id=
"s1"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=all"
id=
"all"
>
全部
(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=all"
id=
"all"
>
全部
({{$statistics['total']}})
</a>
</div>
</div>
<div
class=
"split-item"
id=
"s2"
style=
"text-align: center"
>
<div
class=
"split-item"
id=
"s2"
style=
"text-align: center"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=pending"
id=
"pending"
>
待审核(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=pending"
id=
"pending"
>
待审核({{$statistics['pending']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=in_review"
id=
"in_review"
>
审核中(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=in_review"
id=
"in_review"
>
审核中({{$statistics['in_review']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=passed"
id=
"passed"
>
已通过(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=passed"
id=
"passed"
>
已通过({{$statistics['passed']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=rejected"
id=
"rejected"
>
未通过(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=rejected"
id=
"rejected"
>
未通过({{$statistics['rejected']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=disable"
id=
"disable"
>
禁止交易(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=disable"
id=
"disable"
>
禁止交易({{$statistics['disable']}})
</a>
</div>
</div>
</div>
</div>
<div
class=
"split-item"
id=
"s3"
style=
"text-align: center"
>
<div
class=
"split-item"
id=
"s3"
style=
"text-align: center"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=no_purchase_uid"
id=
"no_purchase_uid"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=no_purchase_uid"
id=
"no_purchase_uid"
>
渠道未分配
(125)
</a>
渠道未分配
({{$statistics['no_purchase_uid']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=invalid_channel_uid"
id=
"invalid_channel_uid"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=invalid_channel_uid"
id=
"invalid_channel_uid"
>
无效采购员
(125)
</a>
无效采购员
({{$statistics['invalid_channel_uid']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=invalid_purchase_uid"
<a
href=
"/supplier/SupplierList?view=iframe&type=invalid_purchase_uid"
id=
"invalid_purchase_uid"
>
无效渠道员
(125)
</a>
id=
"invalid_purchase_uid"
>
无效渠道员
({{$statistics['invalid_purchase_uid']}})
</a>
</div>
</div>
</div>
</div>
<div
class=
"split-item"
id=
"s4"
style=
"text-align: center"
>
<div
class=
"split-item"
id=
"s4"
style=
"text-align: center"
>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=to_follow_up"
id=
"to_follow_up"
>
待跟进(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=to_follow_up"
id=
"to_follow_up"
>
待跟进({{$statistics['to_follow_up']}})
</a>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<a
href=
"/supplier/SupplierList?view=iframe&type=no_sku"
id=
"no_sku"
>
无sku(125)
</a>
<a
href=
"/supplier/SupplierList?view=iframe&type=no_sku"
id=
"no_sku"
>
无sku({{$statistics['no_sku']}})
</a>
</div>
</div>
</div>
</div>
...
@@ -64,83 +71,44 @@
...
@@ -64,83 +71,44 @@
config('fixed.SupplierGroup')) !!}
config('fixed.SupplierGroup')) !!}
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
@inject('transformableInputPresenter','App\Presenters\Filter\TransformableInputPresenter')
供应商名称 :
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码']) !!}
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
name=
"supplier_name"
placeholder=
"名称模糊匹配"
class=
"layui-input"
>
</div>
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('status','状态','',
{!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}
[2=>'启用',3=>'驳回']) !!}
</div>
</div>
{{--
<div
class=
"layui-inline"
>
--}}
{{--
<label
class=
"layui-form-label"
>
--}}
{{-- 供应商编码 :--}}
{{--
</label>
--}}
{{--
<div
class=
"layui-input-inline"
>
--}}
{{--
<input
type=
"text"
name=
"supplier_code"
placeholder=
"多个用英文逗号分隔"
class=
"layui-input"
>
--}}
{{--
</div>
--}}
{{--
</div>
--}}
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('stockup_type','合作类型','',
{!! $statusPresenter->render('stockup_type','合作类型','',config('fixed.StockupType')) !!}
config('fixed.StockupType')) !!}
</div>
<div
class=
"layui-inline"
>
@inject('transformableSelectPresenter','App\Presenters\Filter\TransformableSelectPresenter')
{!! $transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes) !!}
</div>
</div>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('
channel_uid','采购员','',$userCodes
) !!}
{!! $statusPresenter->render('
has_sku','SKU上传','',[0=>'否',1=>'是']
) !!}
</div>
</div>
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('
statusPresenter','App\Presenters\Status
Presenter')
@inject('
transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeInterval
Presenter')
{!! $
statusPresenter->render('purchase_uid','渠道开发员','',$userCodes
) !!}
{!! $
transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间'],true
) !!}
</div>
</div>
@if($routerName=='SupplierBlackList')
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('blacklist_uid','操作人','',$users) !!}
</div>
@elseif($routerName!='SupplierListOwn')
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('create_uid','创建人','',$users) !!}
</div>
@endif
<div
class=
"layui-inline"
>
<div
class=
"layui-inline"
>
@inject('
timeIntervalPresenter','App\Presenters\TimeInterval
Presenter')
@inject('
dayTypePresent','App\Presenters\Filter\DayType
Presenter')
{!! $
timeIntervalPresenter->render('create_time','创建时间 : '
) !!}
{!! $
dayTypePresent->render(
) !!}
</div>
</div>
</div>
</div>
@if($routerName=='SupplierListOwn')
<div
class=
"layui-row"
style=
"margin-top:10px;margin-bottom: 10px;margin-left: 20px;"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('status','状态','',
config('fixed.SupplierStatus')) !!}
</div>
</div>
@endif
@if($routerName=='SupplierListAll')
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('status','状态','',
[2=>'启用',-2=>'禁用']) !!}
</div>
</div>
@endif
<div
class=
"layui-row"
style=
"margin:10px;"
>
<button
class=
"layui-btn layui-btn-sm layui-btn-normal load"
lay-submit=
""
lay-filter=
"load"
>
查询
</button>
<button
class=
"layui-btn layui-btn-sm layui-btn-normal load"
lay-submit=
""
lay-filter=
"load"
>
查询
</button>
<a
class=
"layui-btn layui-btn-sm layui-btn-normal "
href=
""
>
重置
</a>
<a
class=
"layui-btn layui-btn-sm layui-btn-normal "
href=
""
>
重置
</a>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal hide_filter_type"
>
隐藏罗盘
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal hide_filter_type"
>
隐藏罗盘
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal show_filter_type"
style=
"display: none"
>
显示罗盘
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-normal show_filter_type"
@if($routerName=='SupplierListOwn')
style=
"display: none"
>
显示罗盘
<a
href=
"/supplier/AddSupplier"
target=
"_blank"
class=
"layui-btn load"
>
新增供应商
</a>
</button>
@endif
</div>
</div>
</form>
</form>
</div>
</div>
...
@@ -148,6 +116,7 @@
...
@@ -148,6 +116,7 @@
let
type
=
"{{request()->get('type','all')}}"
;
let
type
=
"{{request()->get('type','all')}}"
;
$
(
'#'
+
type
).
attr
(
'class'
,
'layui-badge layui-bg-green'
);
$
(
'#'
+
type
).
attr
(
'class'
,
'layui-badge layui-bg-green'
);
//罗盘隐藏
$
(
'.hide_filter_type'
).
click
(
function
()
{
$
(
'.hide_filter_type'
).
click
(
function
()
{
$
(
this
).
hide
();
$
(
this
).
hide
();
$
(
'#type_filter'
).
hide
();
$
(
'#type_filter'
).
hide
();
...
...
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