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
5384ad1e
authored
Apr 26, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
46959db6
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
160 additions
and
37 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/AdminUserService.php
app/Http/Services/LogService.php
app/Http/Services/SupplierService.php
app/Http/Services/SupplierSkuUploadRulerService.php
config/fixed.php
public/plugins/assets/js/common.js
resources/views/script/AllocatePurchaseUserScript.blade.php
resources/views/script/SupplierDetailScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/script/UpdateSupplierScript.blade.php
resources/views/web.blade.php
resources/views/web/SupplierDetail.blade.php
resources/views/web/SupplierList.blade.php
resources/views/web/UpdateSupplier.blade.php
resources/views/web/supplier/SupplierContact.blade.php
resources/views/web/supplier/SupplierListCommon.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
5384ad1e
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Filter\SupplierFilter
;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\LogService
;
use
App\Http\Services\MessageService
;
use
App\Http\Services\SupplierAuditService
;
...
...
@@ -271,6 +272,11 @@ class SupplierApiController extends Controller
if
(
empty
(
$purchaseUid
))
{
$this
->
response
(
-
1
,
'渠道开发员不能为空'
);
}
$adminService
=
new
AdminUserService
();
$check
=
$adminService
->
checkIsResignedByCodeId
(
$purchaseUid
);
if
(
$check
)
{
$this
->
response
(
-
1
,
'该渠道开发员已经离职,请选择其他人员'
);
}
$service
=
new
SupplierService
();
$result
=
$service
->
allocatePurchaseUser
(
$supplierId
,
$purchaseUid
);
if
(
!
$result
)
{
...
...
app/Http/Services/AdminUserService.php
View file @
5384ad1e
...
...
@@ -47,6 +47,16 @@ class AdminUserService
return
$user
?
$user
->
toArray
()
:
[];
}
//判断是否是离职人员
public
function
checkIsResignedByCodeId
(
$codeId
)
{
$userInfoModel
=
new
UserInfoModel
();
$count
=
$userInfoModel
->
leftJoin
(
'lie_intracode'
,
'user_info.userId'
,
'='
,
'lie_intracode.admin_id'
)
->
where
(
'lie_intracode.code_id'
,
$codeId
)
->
where
(
'user_info.status'
,
4
)
->
where
(
'lie_intracode.code_id'
,
'!='
,
''
)
->
count
();
return
$count
?
true
:
false
;
}
//获取渠道开发员(运营部)的所有用户信息
public
function
getPurchaseUsers
()
...
...
app/Http/Services/LogService.php
View file @
5384ad1e
...
...
@@ -112,12 +112,12 @@ class LogService
$content
=
''
;
foreach
(
$diffKeys
as
$key
)
{
$oldFileName
=
array_get
(
$oldFileNames
,
$key
);
$oldFileName
=
$oldFileName
==
'选择文件上传'
?
'
空
'
:
$oldFileName
;
$oldFileName
=
$oldFileName
==
'选择文件上传'
?
'
'
:
$oldFileName
;
$newFileName
=
array_get
(
$newFileNames
,
$key
);
$content
.=
array_get
(
config
(
'fixed.FileNameMapping'
),
$key
)
.
'由 ['
.
$oldFileName
.
'] 修改为 ['
.
$newFileName
.
']; '
;
$result
[]
=
$content
;
}
$result
[]
=
$content
;
}
if
(
$key
==
'extra_fee'
)
{
$oldFee
=
json_decode
(
$oldSupplier
[
'extra_fee'
],
true
);
...
...
app/Http/Services/SupplierService.php
View file @
5384ad1e
...
...
@@ -72,7 +72,8 @@ class SupplierService
$channel
[
'qualification_photos'
]
=
$this
->
getPhotosData
(
$channel
[
'upload_file'
]);
unset
(
$channel
[
'upload_file'
]);
$channel
[
'established_time'
]
=
strtotime
(
$channel
[
'established_time'
]);
$channel
[
'sku_upload_ruler'
]
=
$this
->
getSkuRulerData
(
$channel
[
'sku_upload_ruler'
]);
$skuUploadRulerService
=
new
SupplierSkuUploadRulerService
();
$channel
[
'sku_upload_ruler'
]
=
$skuUploadRulerService
->
getSkuUploadRulerForDB
(
$channel
[
'sku_upload_ruler'
]);
$logService
=
new
LogService
();
$model
=
new
SupplierChannelModel
();
...
...
@@ -129,6 +130,7 @@ class SupplierService
$extraFaxService
->
saveSupplierExtraFee
(
$extraFax
);
$this
->
saveRatioToRedis
(
$supplierId
);
$this
->
saveSkuAuditRulerToRedis
(
$supplierId
,
$channel
[
'sku_audit_ruler'
]);
$this
->
saveSkuUploadRulerToRedis
(
$supplierId
,
$channel
[
'sku_upload_ruler'
]);
}
//重新生成外部显示的编码
$supplierSn
=
$this
->
generateSupplierSn
(
$supplierId
,
$channel
[
'supplier_group'
]);
...
...
@@ -215,6 +217,13 @@ class SupplierService
}
public
function
saveSkuUploadRulerToRedis
(
$supplierId
,
$ruler
)
{
$redis
=
new
RedisModel
();
$redis
->
hset
(
'supplier_sku_upload_ruler'
,
$supplierId
,
$ruler
);
}
public
function
getAddress
(
$supplierId
)
{
$model
=
new
SupplierAddressModel
();
...
...
app/Http/Services/SupplierSkuUploadRulerService.php
View file @
5384ad1e
...
...
@@ -31,6 +31,26 @@ class SupplierSkuUploadRulerService
return
config
(
'fixed.SkuUploadDefaultRuler'
);
}
else
{
return
json_decode
(
$ruler
,
true
);
}
}
//获取需要存储到数据库的数据格式
public
function
getSkuUploadRulerForDB
(
$uploadRuler
)
{
if
(
empty
(
$uploadRuler
))
{
return
json_encode
(
config
(
'fixed.SkuUploadDefaultRuler'
));
}
else
{
$defaultRuler
=
config
(
'fixed.SkuUploadDefaultRuler'
);
$rulers
=
[];
foreach
(
$defaultRuler
as
$key
=>
$ruler
)
{
if
(
empty
(
$uploadRuler
[
$key
]))
{
$rulers
[
$key
]
=
0
;
}
else
{
$rulers
[
$key
]
=
1
;
}
}
return
json_encode
(
$rulers
);
}
}
}
\ No newline at end of file
config/fixed.php
View file @
5384ad1e
...
...
@@ -154,7 +154,7 @@ return [
'SkuUploadDefaultRuler'
=>
[
'allow_stock_lte_0'
=>
0
,
'allow_moq_lte_0'
=>
0
,
//
'allow_stock_lt_moq' => 0,
'allow_stock_lt_moq'
=>
0
,
'allow_price_null'
=>
0
,
],
...
...
public/plugins/assets/js/common.js
View file @
5384ad1e
...
...
@@ -22,10 +22,6 @@ layui.config({ // common.js是配置layui扩展模块的目录,每个页面
var
layer
=
layui
.
layer
;
var
admin
=
layui
.
admin
;
// $('.submit-loading').click(function () {
// admin.btnLoading('.submit-loading');
// });
});
/** 获取当前项目的根路径,通过获取layui.js全路径截取assets之前的地址 */
...
...
@@ -58,25 +54,46 @@ function getQueryVariable(variable) {
return
''
;
}
function
ajax
(
url
,
data
)
{
function
ajax
(
url
,
data
)
{
layer
.
msg
(
'加载中'
,
{
icon
:
16
,
shade
:
0.01
,
shade
:
0.01
});
var
result
=
false
;
var
result
=
false
;
$
.
ajax
({
url
:
url
,
type
:
'post'
,
data
:
data
,
url
:
url
,
type
:
'post'
,
data
:
data
,
async
:
false
,
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
resp
)
{
if
(
resp
)
{
result
=
resp
;
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
resp
)
{
if
(
resp
)
{
result
=
resp
;
}
}
})
layer
.
closeAll
();
return
result
;
}
//保存需要刷新的页面数据
function
saveRefreshData
(
type
,
supplierId
=
0
)
{
// if (type === 'detail') {
// let data = admin.getTempData("needFreshDetail");
// if (data) {
// data = JSON.parse(data);
// data.push(supplierId);
// data = JSON.stringify(data);
// admin.putTempData("needFreshDetail",data);
// }else{
// admin.putTempData("needFreshDetail",JSON.stringify([supplierId]));
// console.log(admin.getTempData("needFreshDetail"));
// }
//
// }
//
// if (type === 'list') {
// admin.putTempData("needFreshList",1);
// }
}
\ No newline at end of file
resources/views/script/AllocatePurchaseUserScript.blade.php
View file @
5384ad1e
...
...
@@ -30,7 +30,7 @@
,
page
:
{}
});
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
admin
.
btnLoading
(
'.submit-loading'
);
//
admin.btnLoading('.submit-loading');
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
url
=
'/api/supplier/AllocatePurchaseUser?supplier_id='
+
supplierId
;
let
res
=
ajax
(
url
,
data
.
field
);
...
...
resources/views/script/SupplierDetailScript.blade.php
View file @
5384ad1e
...
...
@@ -12,13 +12,6 @@
$
(
'#updateSupplierUrl'
).
click
(
function
()
{
layer
.
load
(
1
);
})
// admin.on('tab', function (d) {
// console.log(d);
// });
{{
--
console
.
log
(
"{{$supplier['update_time']}}"
)
--
}}
{{
--
if
(
admin
.
getTempData
(
"{{$supplier['supplier_code']}}"
)
!=
{{
$supplier
[
'update_time'
]}}){
--
}}
{{
--
admin
.
putTempData
(
'{{$supplier['
supplier_code
']}}'
,
{{
$supplier
[
'update_time'
]}});
--
}}
{{
--
}
--
}}
{{
--
index
.
setTabTitle
(
'供应商详情 - {{$supplier['
supplier_code
'] or ''}}'
);
--
}}
...
...
resources/views/script/SupplierListScript.blade.php
View file @
5384ad1e
...
...
@@ -6,6 +6,7 @@
Split
([
'#s1'
,
'#s2'
,
'#s3'
,
'#s4'
,
'#s5'
],
{
sizes
:
[
9
,
12
,
12
,
12
,
55
],
minSize
:
70
});
let
table
=
layui
.
table
;
let
form
=
layui
.
form
;
let
admin
=
layui
.
admin
;
let
initCondition
=
{
source_type
:
'all'
};
let
whereCondition
=
initCondition
;
...
...
@@ -58,7 +59,7 @@
}
}
},
{
field
:
'channel_username'
,
title
:
'采购员'
,
align
:
'center'
,
width
:
130
},
{
field
:
'channel_username'
,
title
:
'采购员'
,
align
:
'center'
,
width
:
130
},
{
field
:
'purchase_username'
,
title
:
'渠道开发员'
,
align
:
'center'
,
width
:
120
},
{
field
:
'create_name'
,
title
:
'创建人'
,
align
:
'center'
,
width
:
80
},
{
field
:
'update_time'
,
title
:
'最近修改时间'
,
align
:
'center'
,
width
:
160
},
...
...
@@ -128,6 +129,7 @@
title
:
'审核供应商'
,
end
:
function
()
{
table
.
reload
(
'list'
);
saveRefreshData
(
'detail'
,
supplierId
)
supplierStatistics
();
}
});
...
...
@@ -150,6 +152,7 @@
area
:
[
'600px'
,
'70%'
],
title
:
'配置渠道开发员'
,
end
:
function
()
{
saveRefreshData
(
'detail'
,
supplierId
)
table
.
reload
(
'list'
);
supplierStatistics
();
}
...
...
@@ -176,6 +179,7 @@
let
supplierId
=
data
[
0
].
supplier_id
;
let
res
=
ajax
(
'/api/supplier/DisableSupplier'
,
{
supplier_id
:
supplierId
})
if
(
res
.
err_code
===
0
)
{
saveRefreshData
(
'detail'
,
supplierId
)
table
.
reload
(
'list'
)
supplierStatistics
();
layer
.
closeAll
();
...
...
@@ -205,6 +209,7 @@
let
supplierId
=
data
[
0
].
supplier_id
;
let
res
=
ajax
(
'/api/supplier/ChangeSupplierIsType'
,
{
supplier_id
:
supplierId
,
is_type
:
0
})
if
(
res
.
err_code
===
0
)
{
saveRefreshData
(
'detail'
,
supplierId
)
table
.
reload
(
'list'
)
supplierStatistics
();
layer
.
closeAll
();
...
...
resources/views/script/UpdateSupplierScript.blade.php
View file @
5384ad1e
...
...
@@ -24,6 +24,7 @@
layer
.
confirm
(
confirmMessage
,
function
(
index
)
{
let
res
=
ajax
(
'/api/supplier/UpdateSupplier'
,
data
.
field
)
if
(
res
.
err_code
===
0
)
{
admin
.
putTempData
(
"needFreshList"
,
1
)
table
.
reload
(
'receiptList'
)
location
.
href
=
"/supplier/SupplierDetail?view=iframe&supplier_id={{$supplier['supplier_id']}}"
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
...
...
resources/views/web.blade.php
View file @
5384ad1e
...
...
@@ -6,7 +6,7 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1"
>
<title>
{{config('website.webTitle')}} | {{$title or ''}}
</title>
<script
src=
"/js/jquery-2.2.1.js"
></script>
{{--
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"
></script>
--}}
{{--
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"
></script>
--}}
<link
rel=
"stylesheet"
href=
"/plugins/assets/libs/layui/css/layui.css"
/>
<link
rel=
"stylesheet"
href=
"/plugins/assets/module/admin.css?v=317"
/>
<!--[if lt IE 9]>
...
...
@@ -51,12 +51,41 @@
var
index
=
layui
.
index
;
var
admin
=
layui
.
admin
;
if
(
layui
.
admin
.
setter
.
pageTabs
&&
layui
.
admin
.
setter
.
tabAutoRefresh
==
true
)
{
$
(
'.layui-layout-admin>.layui-body>.layui-tab'
).
attr
(
'lay-autoRefresh'
,
'true'
);
}
// 默认加载主页
index
.
loadHome
({
menuPath
:
'/index/Index?view=iframe'
,
menuName
:
'
<
i
class
=
"layui-icon layui-icon-home"
><
/i>
'
});
admin
.
on
(
'tab'
,
function
(
d
)
{
// $(function () {
// $('#getSupplierListButton').click();
// })
// // d.layId表示当前tab的url
// //判断列表是否需要刷新
// if (d.layId.search('SupplierList') !== -1) {
// let needFreshList = admin.getTempData("needFreshList");
// if (needFreshList) {
// // admin.putTempData("needFreshList",0)
// console.log("刷新列表")
// // $('#getSupplierListButton').click();
// } else {
// console.log("不刷新列表")
// }
// }
// //判断详情是否需要刷新
// if (d.layId.search('SupplierDetail') !== -1) {
// let data = admin.getTempData("needFreshDetail");
// console.log(data)
// if (data) {
// console.log(data)
// }
// }
});
});
</script>
</body>
...
...
resources/views/web/SupplierDetail.blade.php
View file @
5384ad1e
...
...
@@ -201,9 +201,16 @@
</div>
</div>
<div
class=
"layui-tab-item"
>
@if(checkPerm('ViewSupplierContact'))
@include('web.supplier.SupplierContact')
@endif
</div>
<div
class=
"layui-tab-item"
>
<div
@
if
(!
checkPerm
('
ViewRuler
'))
style=
"display: none"
@
endif
>
<div
class=
"layui-row"
style=
"padding-bottom: 10px"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
采购附加费设置
</b>
...
...
@@ -292,10 +299,15 @@
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
审核内容配置 :
</label>
<div
class=
"layui-input-inline"
style=
"width: 205px;margin-top: 0;"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
disabled
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
1
)
checked
@
endif
value=
"1"
title=
"无需审核"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
disabled
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
0
)
checked
@
endif
value=
"0"
title=
"需要审核内容"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
disabled
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
1
)
checked
@
endif
value=
"1"
title=
"无需审核"
>
<input
type=
"radio"
name=
"sku_audit_ruler[skip]"
lay-filter=
"is_skip"
disabled
@
if
($
supplier
['
sku_audit_ruler
']['
skip
']==
0
)
checked
@
endif
value=
"0"
title=
"需要审核内容"
>
</div>
<div
class=
"layui-input-inline"
style=
"width: 700px;margin-top: 0;"
>
@if(!empty($supplier['sku_audit_ruler']))
...
...
@@ -328,6 +340,7 @@
</div>
</div>
</div>
</div>
</div>
<div
style=
"text-align: center; border-radius:50%;position: fixed;right: 1%;top: 80%;z-index: 4;
...
...
resources/views/web/SupplierList.blade.php
View file @
5384ad1e
...
...
@@ -10,7 +10,7 @@
@if(checkPerm('AuditSupplier'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
audit_supplier
">审核</button>
@endif
@if(checkPerm('AllocatePurchaseU
id
'))
@if(checkPerm('AllocatePurchaseU
ser
'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
allocate_purchase_user
">分配渠道员</button>
@endif
@if(checkPerm('ChangeSupplierIsType'))
...
...
resources/views/web/UpdateSupplier.blade.php
View file @
5384ad1e
...
...
@@ -85,7 +85,7 @@
<div
class=
"layui-tab-content"
>
<div
class=
"layui-tab-item layui-show"
>
<div
class=
"layui-row"
style=
"padding: 10px"
>
<input
type=
"hidden"
name=
"status"
value=
"{{$supplier['status'] or 0}}"
>
<input
type=
"hidden"
name=
"status"
value=
"{{$supplier['status'] or 0}}"
>
<div
class=
"layui-row"
>
@include('web.supplier.SupplierBase')
</div>
...
...
@@ -184,11 +184,18 @@
</div>
</div>
<div
class=
"layui-tab-item"
>
@if(checkPerm('ViewSupplierContact'))
@include('web.supplier.SupplierContact')
@endif
</div>
<div
class=
"layui-tab-item"
>
<div
@
if
(!
checkPerm
('
ViewRuler
')
||
!
checkPerm
('
UpdateRuler
'))
style=
"display: none"
@
endif
>
@include('web.supplier.SupplierRuler')
</div>
</div>
<div
class=
"layui-tab-item"
>
内容4
</div>
<div
class=
"layui-tab-item"
>
内容5
</div>
</div>
...
...
resources/views/web/supplier/SupplierContact.blade.php
View file @
5384ad1e
...
...
@@ -4,9 +4,15 @@
</blockquote>
@if($operate == 'update')
<div
class=
"layui-btn-group demoTable"
style=
"margin-top: 5px"
>
@if(checkPerm('AddSupplierContact'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"add_contact"
>
新增
</button>
@endif
@if(checkPerm('UpdateSupplierContact'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"update_contact"
>
修改
</button>
@endif
@if(checkPerm('DeleteSupplierContact'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"batchDelete"
>
删除
</button>
@endif
</div>
@endif
<table
class=
"layui-table"
lay-filter=
"contactList"
id=
"contactList"
></table>
...
...
resources/views/web/supplier/SupplierListCommon.blade.php
View file @
5384ad1e
...
...
@@ -89,6 +89,7 @@
</div>
</div>
<div
class=
"layui-collapse"
>
@if(checkPerm('ViewFilter'))
<!--通用的筛选-->
<form
class=
"layui-form"
style=
"margin-top: 15px"
>
<?php
...
...
@@ -134,14 +135,18 @@
</div>
</div>
<div
class=
"layui-row"
style=
"margin-top:10px;margin-bottom: 10px;margin-left: 20px;"
>
<button
class=
"layui-btn layui-btn-sm layui-btn load"
lay-submit=
""
lay-filter=
"load"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn"
lay-submit=
""
lay-filter=
"reset"
>
重置
</button>
<button
class=
"layui-btn layui-btn-sm layui-btn load"
id=
"getSupplierListButton"
lay-submit=
""
lay-filter=
"load"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn"
lay-submit=
""
lay-filter=
"reset"
>
重置
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn hide_filter_type"
>
隐藏罗盘
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn show_filter_type"
style=
"display: none"
>
显示罗盘
</button>
</div>
</form>
@endif
</div>
<script>
//一进来就去获取统计数据
...
...
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