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
1780df75
authored
May 11, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
ff1fa8e0
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
794 additions
and
10 deletions
app/Http/Controllers/Api/SupplierAccountApiController.php
app/Http/Controllers/Filter/SupplierAccountFilter.php
app/Http/Controllers/SupplierAccountController.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierAccountService.php
app/Http/Transformers/SupplierAccountTransformer.php
app/Http/routes.php
app/Model/SupplierAccountModel.php
config/field.php
resources/views/script/AddSupplierAccountScript.blade.php
resources/views/script/SetYunxinChannelUserScript.blade.php
resources/views/script/SupplierAccountListScript.blade.php
resources/views/script/UpdateSupplierAccountScript.blade.php
resources/views/web/AddSupplierAccount.blade.php
resources/views/web/SetYunxinChannelUser.blade.php
resources/views/web/SupplierAccountList.blade.php
resources/views/web/UpdateSupplierAccount.blade.php
resources/views/web/supplier/SupplierContact.blade.php
app/Http/Controllers/Api/SupplierAccountApiController.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Http\Controllers\Api
;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Filter\SupplierAccountFilter
;
use
App\Http\Services\SupplierAccountService
;
use
App\Http\Transformers\SupplierLogTransformer
;
use
App\Model\LogModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierLogModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Hash
;
//通用API,比如获取品牌列表,分类列表等
class
SupplierAccountApiController
extends
Controller
{
public
function
Entrance
(
Request
$request
,
$id
)
{
$this
->
$id
(
$request
,
$id
);
}
//获取供应商信息变更记录
public
function
GetSupplierAccountList
(
$request
)
{
$service
=
new
SupplierAccountService
();
$list
=
$service
->
getSupplierAccountList
(
$request
);
$this
->
response
(
0
,
'ok'
,
$list
[
'data'
],
$list
[
'total'
]);
}
//添加
public
function
AddSupplierAccount
(
$request
)
{
$data
=
$request
->
only
([
'supplier_code'
,
'mobile'
,
'password_raw'
,
'a_type'
,
]);
$supplierModel
=
new
SupplierChannelModel
();
$supplierId
=
$supplierModel
->
where
(
'supplier_code'
,
$data
[
'supplier_code'
])
->
value
(
'supplier_id'
);
$data
[
'supplier_id'
]
=
$supplierId
;
$data
[
'a_type'
]
=
empty
(
$data
[
'a_type'
])
?
0
:
1
;
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'create_uid'
]
=
$request
->
user
->
userId
;
$data
[
'password'
]
=
Hash
::
make
(
$data
[
'password_raw'
]);
$model
=
new
SupplierAccountModel
();
$result
=
$model
->
insert
(
$data
);
if
(
$result
)
{
$this
->
response
(
0
,
'添加成功'
);
}
$this
->
response
(
-
1
,
'添加失败'
,
$result
);
}
//修改
public
function
UpdateSupplierAccount
(
$request
)
{
$data
=
$request
->
only
([
'id'
,
'supplier_code'
,
'mobile'
,
'password_raw'
,
'a_type'
,
]);
$supplierModel
=
new
SupplierChannelModel
();
$supplierId
=
$supplierModel
->
where
(
'supplier_code'
,
$data
[
'supplier_code'
])
->
value
(
'supplier_id'
);
$data
[
'supplier_id'
]
=
$supplierId
;
$data
[
'a_type'
]
=
empty
(
$data
[
'a_type'
])
?
0
:
1
;
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'create_uid'
]
=
$request
->
user
->
userId
;
$data
[
'password'
]
=
Hash
::
make
(
$data
[
'password_raw'
]);
$model
=
new
SupplierAccountModel
();
$result
=
$model
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$data
);
if
(
$result
)
{
$this
->
response
(
0
,
'修改成功'
);
}
$this
->
response
(
-
1
,
'修改失败'
,
$result
);
}
//禁用
public
function
DisableSupplierAccount
(
$request
)
{
$id
=
$request
->
get
(
'id'
);
$model
=
new
SupplierAccountModel
();
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$data
[
'a_status'
]
=
0
;
$result
=
$model
->
where
(
'id'
,
$id
)
->
update
(
$data
);
if
(
$result
)
{
$this
->
response
(
0
,
'禁用成功'
);
}
$this
->
response
(
-
1
,
'禁用失败'
,
$result
);
}
}
app/Http/Controllers/Filter/SupplierAccountFilter.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Http\Controllers\Filter
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
class
SupplierAccountFilter
{
//查询条件
public
function
listFilter
(
$request
)
{
$map
=
$request
->
all
();
$model
=
new
SupplierAccountModel
();
$query
=
$model
->
orderBy
(
'id'
,
'desc'
);
if
(
!
empty
(
$map
[
'supplier_name'
]))
{
//先去供应商主表找出id
$supplierChannelModel
=
new
SupplierChannelModel
();
$supplierIds
=
$supplierChannelModel
->
whereLike
(
'supplier_name'
,
"%${map['supplier_name']}%"
)
->
pluck
(
'supplier_id'
);
$query
->
whereIn
(
'supplier_id'
,
$supplierIds
);
}
if
(
!
empty
(
$map
[
'supplier_code'
]))
{
$query
->
whereLike
(
'supplier_code'
,
"%${map['supplier_code']}%"
);
}
if
((
isset
(
$map
[
'status'
])
&&
$map
[
'status'
]
===
'0'
)
||
!
empty
(
$map
[
'status'
]))
{
$query
->
where
(
'status'
,
$map
[
'status'
]);
}
if
(
!
empty
(
$map
[
'mobile'
]))
{
$query
->
whereLike
(
'mobile'
,
"%${map['mobile']}%"
);
}
if
(
!
empty
(
$map
[
'create_time'
]))
{
$times
=
explode
(
'~'
,
$map
[
'create_time'
]);
$startTime
=
strtotime
(
$times
[
0
]);
$endTime
=
strtotime
(
$times
[
1
]);
$query
->
whereBetween
(
'create_time'
,
[
$startTime
,
$endTime
]);
}
if
(
!
empty
(
$map
[
'update_time'
]))
{
$times
=
explode
(
'~'
,
$map
[
'update_time'
]);
$startTime
=
strtotime
(
$times
[
0
]);
$endTime
=
strtotime
(
$times
[
1
]);
$query
->
whereBetween
(
'update_time'
,
[
$startTime
,
$endTime
]);
}
return
$query
;
}
}
\ No newline at end of file
app/Http/Controllers/SupplierAccountController.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Http\Controllers
;
use
App\Http\Services\RoleService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\ViewCheckService
;
use
App\Model\IntracodeModel
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
class
SupplierAccountController
extends
Controller
{
public
function
info
(
Request
$request
,
$id
=
''
)
{
if
(
$request
->
path
()
==
'/'
)
{
$path
=
'web/index'
;
}
else
{
$path
=
$request
->
path
();
}
$this
->
data
=
[
'menus'
=>
$request
->
menus
,
'header'
=>
$request
->
user
->
header
,
'username'
=>
$request
->
user
->
email
,
'user_email'
=>
$request
->
user
->
email
,
'uri'
=>
'/'
.
$path
,
'id'
=>
$id
];
return
$this
->
$id
(
$request
);
}
public
function
__call
(
$name
,
$arr
)
{
$data
[
'errinfo'
]
=
'访问路径错误'
;
return
view
(
'errors.error'
,
$data
);
}
//操作日志列表
public
function
SupplierAccountList
(
$request
)
{
$this
->
data
[
'title'
]
=
'供应商账号列表'
;
return
$this
->
view
(
'供应商账号列表'
);
}
public
function
AddSupplierAccount
(
$request
)
{
//获取所有启用的供应商编码,而且类型是包括云芯
$model
=
new
SupplierChannelModel
();
$suppliers
=
$model
->
where
(
'is_type'
,
0
)
->
whereRaw
(
'stockup_type like "%5%"'
)
->
where
(
'status'
,
SupplierChannelModel
::
STATUS_PASSED
)
->
select
([
'supplier_name'
,
'supplier_code'
])
->
get
();
$supplierCodes
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$supplier
=
$supplier
->
toArray
();
$supplierCodes
[
$supplier
[
'supplier_code'
]]
=
$supplier
[
'supplier_name'
]
.
'('
.
$supplier
[
'supplier_code'
]
.
')'
;
}
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
$this
->
data
[
'title'
]
=
'添加供应商账号'
;
return
$this
->
view
(
'添加供应商账号'
);
}
public
function
UpdateSupplierAccount
(
$request
)
{
$id
=
$request
->
get
(
'id'
);
$model
=
new
SupplierAccountModel
();
$account
=
$model
->
where
(
'id'
,
$id
)
->
first
()
->
toArray
();
//获取所有启用的供应商编码,而且类型是包括云芯
$model
=
new
SupplierChannelModel
();
$suppliers
=
$model
->
where
(
'is_type'
,
0
)
->
whereRaw
(
'stockup_type like "%5%"'
)
->
where
(
'status'
,
SupplierChannelModel
::
STATUS_PASSED
)
->
select
([
'supplier_name'
,
'supplier_code'
])
->
get
();
$supplierCodes
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$supplier
=
$supplier
->
toArray
();
$supplierCodes
[
$supplier
[
'supplier_code'
]]
=
$supplier
[
'supplier_name'
]
.
'('
.
$supplier
[
'supplier_code'
]
.
')'
;
}
$this
->
data
[
'supplierCodes'
]
=
$supplierCodes
;
$this
->
data
[
'title'
]
=
'编辑供应商账号'
;
$this
->
data
[
'account'
]
=
$account
;
return
$this
->
view
(
'编辑供应商账号'
);
}
}
\ No newline at end of file
app/Http/Controllers/SupplierController.php
View file @
1780df75
...
...
@@ -200,4 +200,23 @@ class SupplierController extends Controller
return
view
(
'web'
,
$data
);
}
//分配云芯采购员
public
function
SetYunxinChannelUser
(
$request
)
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$model
=
new
SupplierChannelModel
();
$supplier
=
$model
->
where
(
'supplier_id'
,
$supplierId
)
->
first
();
$supplier
=
$supplier
?
$supplier
->
toArray
()
:
[];
$transformer
=
new
SupplierTransformer
();
$supplier
=
$transformer
->
transformInfo
(
$supplier
);
$this
->
data
[
'supplier'
]
=
$supplier
;
$intracodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getPurchaseUserCodes
();
$logModel
=
new
LogModel
();
$this
->
data
[
'logs'
]
=
$logModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'action'
,
'分配渠道开发员'
)
->
orderBy
(
'id'
,
'desc'
)
->
limit
(
10
)
->
get
();
return
$this
->
view
(
'审核供应商'
);
}
}
\ No newline at end of file
app/Http/Services/SupplierAccountService.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Http\Services
;
use
App\Http\Controllers\Filter\SupplierAccountFilter
;
use
App\Http\Transformers\SupplierAccountTransformer
;
use
App\Model\LogModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
class
SupplierAccountService
{
public
function
getSupplierAccountList
(
$request
)
{
$limit
=
$request
->
get
(
'limit'
,
10
);
$filter
=
new
SupplierAccountFilter
();
$query
=
$filter
->
listFilter
(
$request
);
$list
=
$query
->
paginate
(
$limit
)
->
toArray
();
$transformer
=
new
SupplierAccountTransformer
();
$list
[
'data'
]
=
$transformer
->
transformList
(
$list
[
'data'
]);
return
$list
;
}
}
\ No newline at end of file
app/Http/Transformers/SupplierAccountTransformer.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Http\Transformers
;
use
App\Model\SupplierChannelModel
;
class
SupplierAccountTransformer
{
public
function
transformList
(
$list
)
{
//获取供应商名称
$supplierIds
=
array_column
(
$list
,
'supplier_id'
);
$supplierModel
=
new
SupplierChannelModel
();
$suppliers
=
$supplierModel
->
whereIn
(
'supplier_id'
,
$supplierIds
)
->
pluck
(
'supplier_name'
,
'supplier_id'
);
foreach
(
$list
as
&
$item
)
{
$item
[
'supplier_name'
]
=
array_get
(
$suppliers
,
$item
[
'supplier_id'
]);
$item
[
'type_name'
]
=
array_get
(
config
(
'field.SupplierAccountType'
),
$item
[
'a_type'
]);
// $item['create_time'] = date('Y-m-d H:i:s', $item['create_time']);
// $item['update_time'] = date('Y-m-d H:i:s', $item['update_time']);
}
unset
(
$item
);
return
$list
;
}
}
\ No newline at end of file
app/Http/routes.php
View file @
1780df75
...
...
@@ -15,17 +15,13 @@
Route
::
group
([
'middleware'
=>
[
'web'
,
'menu'
]],
function
()
{
Route
::
get
(
'/'
,
'WebController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/web/{key}'
,
'WebController@Entrance'
);
// Route::get('/', 'WebController@info');
// Route::match(['get', 'post'], '/web/{key}', 'WebController@info');
Route
::
match
([
'get'
,
'post'
],
'/supplier/{key}'
,
'SupplierController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/supplier_contact/{key}'
,
'SupplierContactController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/supplier_receipt/{key}'
,
'SupplierReceiptController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/supplier_account/{key}'
,
'SupplierAccountController@info'
);
Route
::
match
([
'get'
,
'post'
],
'/index/{key}'
,
'IndexController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/sku/{key}'
,
'SkuController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/log/{key}'
,
'LogController@Entrance'
);
// Route::match(['get', 'post'], '/api/{key}', 'ApiController@Entrance');
// Route::match(['get', 'post'], '/hd/{key}', 'HandleController@Entrance');
Route
::
get
(
'/pushAmq'
,
'QueuedController@pushAmq'
);
Route
::
get
(
'/pullAmq'
,
'QueuedController@pullAmq'
);
});
...
...
@@ -41,6 +37,7 @@ Route::group(['middleware' => ['web'], 'namespace' => 'Api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/api/sku/{key}'
,
'SkuApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_receipt/{key}'
,
'SupplierReceiptApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_sync_log/{key}'
,
'SupplierSyncLogApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_account/{key}'
,
'SupplierAccountApiController@Entrance'
);
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
$service
=
new
\App\Http\Services\DataService
();
...
...
app/Model/SupplierAccountModel.php
0 → 100644
View file @
1780df75
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
SupplierAccountModel
extends
Model
{
protected
$connection
=
'yunxin'
;
protected
$table
=
'yunxin_account'
;
protected
$primaryKey
=
'id'
;
public
$timestamps
=
false
;
}
config/field.php
View file @
1780df75
...
...
@@ -8,21 +8,21 @@ return [
2
=>
'专卖'
,
],
'GoodsStatus'
=>
[
'GoodsStatus'
=>
[
1
=>
'上架'
,
3
=>
'下架'
,
],
//sku列表用
'SkuStatus'
=>
array
(
'SkuStatus'
=>
[
0
=>
'待审核'
,
1
=>
'上架'
,
2
=>
'审核不通过'
,
3
=>
'下架'
,
4
=>
'删除'
)
,
]
,
'SKU'
=>
array
(
'SKU'
=>
[
'spu_id'
=>
1
,
'encoded'
=>
1
,
'moq'
=>
1
,
...
...
@@ -40,5 +40,10 @@ return [
'canal'
=>
1
,
'supplier_id'
=>
1
,
'cp_time'
=>
1
,
),
],
'SupplierAccountType'
=>
[
0
=>
'其它'
,
1
=>
'云芯商家'
]
];
\ No newline at end of file
resources/views/script/AddSupplierAccountScript.blade.php
0 → 100644
View file @
1780df75
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'layer'
,
'admin'
,
'xmSelect'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
form
.
on
(
'submit(addSupplierAccount)'
,
function
(
data
)
{
let
url
=
'/api/supplier_account/AddSupplierAccount'
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
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/SetYunxinChannelUserScript.blade.php
0 → 100644
View file @
1780df75
<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
;
table
.
render
({
elem
:
'#logList'
,
url
:
'/api/log/GetLogList'
,
method
:
'post'
,
size
:
'sm'
,
limit
:
10
,
cellMinWidth
:
80
//全局定义常规单元格的最小宽度
,
where
:
{
supplier_id
:{{
$supplier
[
'supplier_id'
]}},
action
:
'分配云芯采购员'
,
}
,
loading
:
true
,
first
:
true
//不显示首页
,
last
:
false
//不显示尾页
,
cols
:
[[
{
field
:
'add_time'
,
title
:
'日志时间'
,
width
:
150
,
align
:
'center'
},
{
field
:
'content'
,
title
:
'日志内容'
,
align
:
'center'
,
templet
:
function
(
data
)
{
return
data
.
admin_name
+
data
.
content
;
}
},
]]
,
id
:
'logList'
,
page
:
{}
});
form
.
on
(
'submit(auditSupplier)'
,
function
(
data
)
{
admin
.
btnLoading
(
'.submit-loading'
);
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
url
=
'/api/supplier/AllocatePurchaseUser?supplier_id='
+
supplierId
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
//修改罗盘显示数量(cao)
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
admin
.
btnLoading
(
'.submit-loading'
,
false
);
parent
.
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/SupplierAccountListScript.blade.php
0 → 100644
View file @
1780df75
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'Split'
,
'admin'
,
'xmSelect'
],
function
()
{
let
$
=
layui
.
jquery
;
let
Split
=
layui
.
Split
;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
let
table
=
layui
.
table
;
let
form
=
layui
.
form
;
let
admin
=
layui
.
admin
;
let
xmSelect
=
layui
.
xmSelect
;
let
initCondition
=
{
source_type
:
'all'
};
let
whereCondition
=
initCondition
;
let
type
=
'all'
;
let
cols
=
[
{
type
:
'radio'
},
{
field
:
'id'
,
title
:
'ID'
,
align
:
'center'
,
width
:
80
},
{
field
:
'mobile'
,
title
:
'账号'
,
align
:
'center'
,
width
:
170
},
{
field
:
'password_raw'
,
title
:
'密码'
,
align
:
'center'
,
width
:
170
},
{
field
:
'supplier_code'
,
title
:
'供应商编码'
,
align
:
'center'
,
width
:
120
},
{
field
:
'supplier_name'
,
title
:
'供应商名称'
,
align
:
'center'
},
{
field
:
'type_name'
,
title
:
'账号类型'
,
align
:
'center'
},
{
field
:
'a_status'
,
title
:
'状态'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
return
data
.
a_status
===
1
?
'启用'
:
"
<
span
style
=
'color: red'
>
禁用
<
/span>
"
}
},
{
field
:
'create_time'
,
title
:
'创建时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
];
let
currentPage
=
0
;
table
.
render
({
elem
:
'#supplierAccountList'
,
url
:
'/api/supplier_account/GetSupplierAccountList'
,
method
:
'post'
,
size
:
'sm'
,
limit
:
20
,
cellMinWidth
:
50
//全局定义常规单元格的最小宽度
,
where
:
whereCondition
,
loading
:
true
,
first
:
true
//不显示首页
,
last
:
false
//不显示尾页
,
cols
:
[
cols
]
,
id
:
'supplierAccountList'
,
page
:
{}
,
done
:
function
(
res
,
curr
,
count
)
{
currentPage
=
curr
;
}
});
//禁用
$
(
"#disable_supplier_account"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierAccountList'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的供应商账号'
,
{
icon
:
5
})
}
else
{
layer
.
confirm
(
'确定要禁用该供应商账号吗?'
,
function
(
index
)
{
let
id
=
data
[
0
].
id
;
let
res
=
ajax
(
'/api/supplier_account/DisableSupplierAccount'
,
{
id
:
id
})
if
(
res
.
err_code
===
0
)
{
table
.
reload
(
'supplierAccountList'
);
layer
.
closeAll
();
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
})
}
else
{
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
})
}
});
}
});
//根据供应商编码已经品牌等去基石调用接口下架
$
(
"#add_supplier_account"
).
click
(
function
()
{
layer
.
open
({
type
:
2
,
content
:
'/supplier_account/AddSupplierAccount?view=iframe'
,
area
:
[
'800px'
,
'600px'
],
title
:
'批量下架SKU'
,
end
:
function
()
{
table
.
reload
(
'supplierAccountList'
);
// supplierStatistics();
}
});
});
$
(
"#update_supplier_account"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'supplierAccountList'
);
let
data
=
checkStatus
.
data
;
if
(
!
data
.
length
)
{
layer
.
msg
(
'请先选择要操作的供应商'
,
{
icon
:
5
})
}
else
{
let
id
=
data
[
0
].
id
;
layer
.
open
({
type
:
2
,
content
:
'/supplier_account/UpdateSupplierAccount?view=iframe&id='
+
id
,
area
:
[
'800px'
,
'600px'
],
title
:
'批量下架SKU'
,
end
:
function
()
{
table
.
reload
(
'supplierAccountList'
);
// supplierStatistics();
}
});
}
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
whereCondition
=
$
.
extend
(
false
,
initCondition
,
data
.
field
);
//执行重载
table
.
reload
(
'supplierAccountList'
,
{
page
:
{
curr
:
1
}
,
where
:
whereCondition
});
return
false
;
});
form
.
on
(
'submit(reset)'
,
function
(
data
)
{
layer
.
load
(
1
);
location
.
reload
();
});
});
</script>
\ No newline at end of file
resources/views/script/UpdateSupplierAccountScript.blade.php
0 → 100644
View file @
1780df75
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'table'
,
'layer'
,
'admin'
,
'xmSelect'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
element
=
layui
.
element
;
let
xmSelect
=
layui
.
xmSelect
;
form
.
on
(
'submit(addSupplierAccount)'
,
function
(
data
)
{
let
url
=
'/api/supplier_account/UpdateSupplierAccount'
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
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/web/AddSupplierAccount.blade.php
0 → 100644
View file @
1780df75
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择 : ',!empty($account['supplier_code'])?$account['supplier_code']:null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
登陆账号 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"mobile"
id=
"mobile"
placeholder=
"请输入登陆账号"
class=
"layui-input"
value=
"{{$account['mobile'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号密码 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"password_raw"
id=
"password_raw"
placeholder=
"请输入账号密码"
class=
"layui-input"
value=
"{{$account['password_raw'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号类型 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"checkbox"
name=
""
title=
"云芯商家"
lay-skin=
"primary"
@
if
(!
empty
($
account
['
a_type
'])&&$
account
['
a_type
']==
1
)
checked
@
endif
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"addSupplierAccount"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-warm"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
resources/views/web/SetYunxinChannelUser.blade.php
0 → 100644
View file @
1780df75
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
style=
"height: 90px"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6"
>
供应商名称 :
<b>
{{$supplier['supplier_name']}}
</b>
</div>
<div
class=
"layui-col-xs6"
>
状态 : {{$supplier['status_name']}}
</div>
<div
class=
"layui-col-xs6"
>
公司性质 : {{$supplier['supplier_group_name']}}
</div>
<div
class=
"layui-col-xs6"
>
合作类型 : {{$supplier['stockup_type']}}
</div>
</div>
</div>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<input
type=
"hidden"
name=
"supplier_id"
value=
"{{$supplier['supplier_id']}}"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_uid','渠道开发员',$supplier['purchase_uid'],
$userCodes,['required'=>true,'width'=>'110px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;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-warm"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
操作日志
</b>
</blockquote>
<table
class=
"layui-table"
id=
"logList"
lay-filter=
"logList"
></table>
resources/views/web/SupplierAccountList.blade.php
0 → 100644
View file @
1780df75
<div
class=
"layui-collapse"
>
<form
class=
"layui-form"
style=
"margin-top: 15px"
>
<?php
$routerName
=
explode
(
'/'
,
request
()
->
path
())[
1
];
?>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
供应商名称
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
value=
""
name=
"supplier_name"
placeholder=
"支持模糊匹配"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
供应商编码
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
value=
""
name=
"supplier_code"
placeholder=
"支持模糊匹配"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('status/condition','账号状态',request()->get('status'),[0=>'禁用',1=>'启用']) !!}
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
账号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
value=
""
name=
"mobile"
placeholder=
"支持模糊匹配"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
style=
"width: 600px"
>
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['create_time'=>'创建时间','update_time'=>'更新时间']) !!}
</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"
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>
</div>
</form>
</div>
<div
style=
"margin-left: 20px;margin-right: 20px"
>
<div
class=
"layui-btn-group demoTable"
style=
"margin-top: 15px"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"add_supplier_account"
>
新增账号
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"update_supplier_account"
>
修改
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"forbid_supplier_account"
>
禁用
</button>
</div>
<table
class=
"layui-table"
id=
"supplierAccountList"
lay-filter=
"supplierAccountList"
></table>
</div>
<script>
</script>
resources/views/web/UpdateSupplierAccount.blade.php
0 → 100644
View file @
1780df75
<style>
.layui-form-item
{
margin-bottom
:
5px
;
}
</style>
<div
class=
"layui-card"
>
<div
class=
"layui-card-body"
>
<form
class=
"layui-form"
action=
""
>
<input
type=
"hidden"
name=
"id"
value=
"{{$account['id']}}"
>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择 : ',!empty($account['supplier_code'])?$account['supplier_code']:null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
登陆账号 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"mobile"
id=
"mobile"
disabled
placeholder=
"请输入登陆账号"
class=
"layui-input layui-disabled"
value=
"{{$account['mobile'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号密码 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"text"
name=
"password_raw"
id=
"password_raw"
placeholder=
"请输入账号密码"
class=
"layui-input"
value=
"{{$account['password_raw'] or ''}}"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
账号类型 :
</label>
<div
class=
"layui-input-block"
>
<input
type=
"checkbox"
name=
"a_type"
title=
"云芯商家"
lay-skin=
"primary"
@
if
(!
empty
($
account
['
a_type
'])&&$
account
['
a_type
']==
1
)
checked
@
endif
>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-info submit-loading"
lay-submit
lay-filter=
"addSupplierAccount"
>
确认
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm layui-btn-warm"
lay-submit
lay-filter=
"cancel"
>
取消
</button>
</div>
</div>
</form>
</div>
</div>
resources/views/web/supplier/SupplierContact.blade.php
View file @
1780df75
...
...
@@ -13,6 +13,9 @@
@if(checkPerm('DeleteSupplierContact'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"batchDelete"
>
删除
</button>
@endif
@if(checkPerm('SetYunxinChannelUser'))
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"setYunxinChannelUser"
>
设置云芯采购
</button>
@endif
</div>
@endif
<table
class=
"layui-table"
lay-filter=
"contactList"
id=
"contactList"
></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