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
c50c7213
authored
May 06, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
13046fa5
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
475 additions
and
90 deletions
app/Http/Controllers/Api/CommonApiController.php
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/Api/SkuStatisticsApiController.php
app/Http/Controllers/Filter/SkuListFilter.php
app/Http/Controllers/SkuController.php
app/Http/Services/SkuService.php
app/Http/Services/SkuStatisticsService.php
app/Http/routes.php
config/field.php
config/fixed.php
config/perm.php
resources/views/script/BatchOffShelfScript.blade.php
resources/views/script/SkuListScript.blade.php
resources/views/script/supplier/SupplierBaseScript.blade.php
resources/views/web/BatchOffShelf.blade.php
resources/views/web/SkuList.blade.php
resources/views/web/sku/SkuListCommon.blade.php
app/Http/Controllers/Api/CommonApiController.php
View file @
c50c7213
...
...
@@ -8,6 +8,7 @@ use App\Model\BrandModel;
use
App\Model\SelfClassifyModel
;
use
Illuminate\Http\Request
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\DB
;
//通用API,比如获取品牌列表,分类列表等
class
CommonApiController
extends
Controller
...
...
@@ -61,6 +62,34 @@ class CommonApiController extends Controller
exit
();
}
private
function
SearchBrand
(
$request
)
{
$brandName
=
$request
->
input
(
'brand_name'
);
$type
=
$request
->
input
(
'type'
);
if
(
empty
(
$type
))
{
$type
=
1
;
}
$connection
=
$type
==
1
?
'spu'
:
'self'
;
$table
=
$type
==
1
?
'brand'
:
'brand'
;
$db
=
DB
::
connection
(
$connection
)
->
table
(
$table
)
->
where
(
'status'
,
'1'
);
if
(
$brandName
)
{
$db
=
$db
->
where
(
'brand_name'
,
'like'
,
'%'
.
$brandName
.
'%'
);
}
$count
=
$db
->
count
();
$list
=
$db
->
select
(
'brand_name'
,
'brand_id'
)
->
paginate
(
17
);
$list
=
$list
?
$list
->
toArray
()
:
[];
$data
=
array_get
(
$list
,
'data'
);
$lastPage
=
array_get
(
$list
,
'last_page'
);
echo
json_encode
([
'errcode'
=>
0
,
'errmsg'
=>
'ok'
,
'total'
=>
$count
,
'count'
=>
$count
,
'data'
=>
$data
,
'last_page'
=>
$lastPage
]);
}
public
function
test
(
$request
)
{
$as
=
new
AdminUserService
();
...
...
app/Http/Controllers/Api/SkuApiController.php
View file @
c50c7213
...
...
@@ -45,4 +45,37 @@ class SkuApiController extends Controller
$this
->
response
(
-
1
,
'操作失败,原因是 : '
.
$result
[
'errmsg'
]);
}
}
//批量下架
public
function
BatchOffShelf
(
$request
)
{
$supplierCode
=
$request
->
get
(
'supplier_code'
);
$brandId
=
$request
->
get
(
'brand_ids'
);
$brandId
=
str_replace
(
','
,
''
,
$brandId
);
$updateTime
=
$request
->
get
(
'update_time'
);
if
(
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'请选择供应商'
);
}
$startTime
=
$endTime
=
0
;
if
(
$updateTime
)
{
$updateTime
=
explode
(
'~'
,
$updateTime
);
$startTime
=
strtotime
(
$updateTime
[
0
]);
$endTime
=
strtotime
(
$updateTime
[
1
]);
}
$map
=
[
'supplier_code'
=>
$supplierCode
,
'brand_id'
=>
$brandId
,
'start_time'
=>
$startTime
,
'end_time'
=>
$endTime
,
];
$url
=
''
;
$result
=
curl
(
$url
,
$map
);
$result
=
json_decode
(
$result
,
true
);
if
(
isset
(
$result
[
'err_code'
])
&&
$result
[
'err_code'
]
===
0
)
{
$this
->
response
(
0
,
'批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
}
else
{
$this
->
response
(
-
1
,
'批量下架失败'
);
}
}
}
app/Http/Controllers/Api/SkuStatisticsApiController.php
View file @
c50c7213
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers\Api
;
use
App\Http\Controllers\Controller
;
use
App\Http\Services\SkuStatisticsService
;
use
App\Http\Services\SupplierStatisticsService
;
use
Illuminate\Http\Request
;
...
...
@@ -14,13 +15,13 @@ class SkuStatisticsApiController extends Controller
$this
->
$id
(
$request
,
$id
);
}
public
function
GetS
upplier
Statistics
(
$request
)
public
function
GetS
ku
Statistics
(
$request
)
{
$service
=
new
S
upplier
StatisticsService
();
$statistics
=
$service
->
getS
upplier
ListStatistics
();
$service
=
new
S
ku
StatisticsService
();
$statistics
=
$service
->
getS
ku
ListStatistics
();
$data
=
[];
foreach
(
$statistics
as
$name
=>
$count
)
{
$data
[
$name
]
=
array_get
(
config
(
'fixed.CompassMenuMap'
),
$name
)
.
"(${count})"
;
$data
[
$name
]
=
array_get
(
config
(
'fixed.
SkuList
CompassMenuMap'
),
$name
)
.
"(${count})"
;
}
$this
->
response
(
0
,
'ok'
,
$data
);
}
...
...
app/Http/Controllers/Filter/SkuListFilter.php
0 → 100644
View file @
c50c7213
<?php
namespace
App\Http\Controllers\Filter
;
use
App\Http\Services\DepartmentService
;
use
App\Model\SupplierSyncModel
;
class
SkuListFilter
{
//查询条件
public
function
listFilter
()
{
$map
=
request
()
->
all
();
//只获取专卖的数据
$map
[
'supplier_id'
]
=
17
;
if
((
!
empty
(
$map
[
'create_time'
])))
{
$times
=
explode
(
'~'
,
$map
[
'create_time'
]);
$startTime
=
strtotime
(
$times
[
0
])
?:
1420041600
;
$endTime
=
strtotime
(
$times
[
1
])
?:
time
();
$map
[
'create_time/range'
]
=
$startTime
.
','
.
$endTime
;
unset
(
$map
[
'create_time'
]);
}
if
((
!
empty
(
$map
[
'update_time'
])))
{
$times
=
explode
(
'~'
,
$map
[
'update_time'
]);
$startTime
=
strtotime
(
$times
[
0
])
?:
1420041600
;
$endTime
=
strtotime
(
$times
[
1
])
?:
time
();
$map
[
'update_time/range'
]
=
$startTime
.
','
.
$endTime
;
unset
(
$map
[
'update_time'
]);
}
if
(
!
empty
(
$map
[
'source_type'
]))
{
switch
(
$map
[
'source_type'
])
{
case
'all'
:
break
;
case
'expire'
:
$map
[
'expire_day'
]
=
7
;
break
;
case
"off_shelf"
:
$map
[
"goods_status/condition"
]
=
3
;
break
;
}
unset
(
$map
[
'source_type'
]);
}
if
(
!
empty
(
$map
[
'stock_compare_type'
])
&&
!
empty
(
$map
[
'stock_num'
]))
{
switch
(
$map
[
'stock_compare_type'
])
{
case
'eq'
:
$map
[
'stock/sr'
]
=
'eq,'
.
$map
[
'stock_num'
];
break
;
case
'gt'
:
$map
[
'stock/sr'
]
=
'gt,'
.
$map
[
'stock_num'
];
break
;
case
'lt'
:
$map
[
'stock/sr'
]
=
'lt,'
.
$map
[
'stock_num'
];
break
;
}
unset
(
$map
[
'stock_compare_type'
],
$map
[
'stock_num'
]);
}
foreach
(
$map
as
$k
=>
$v
)
{
if
(
empty
(
$v
)
and
$v
!=
'0'
)
{
unset
(
$map
[
$k
]);
}
}
$map
[
'p'
]
=
$map
[
'page'
];
unset
(
$map
[
'page'
]);
if
(
!
empty
(
$map
[
'p'
])
&&
$map
[
'p'
]
>
1000
)
{
$map
[
'p'
]
=
rand
(
5
,
1000
);
}
return
$map
;
}
}
\ No newline at end of file
app/Http/Controllers/SkuController.php
View file @
c50c7213
...
...
@@ -5,8 +5,10 @@ namespace App\Http\Controllers;
use
App\Http\Controllers\Filter\LogFilter
;
use
App\Http\Controllers\Filter\SupplierLogFilter
;
use
App\Http\Services\LogService
;
use
App\Model\BrandModel
;
use
App\Model\IntracodeModel
;
use
App\Model\LogModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierLogModel
;
use
Illuminate\Http\Request
;
use
DB
;
...
...
@@ -39,9 +41,36 @@ class SkuController extends Controller
public
function
SkuList
(
$request
)
{
//获取筛选框的品牌数据
$brandSelectValue
=
[];
$selectBrandIds
=
$request
->
get
(
'brand_id/condition'
);
if
(
$selectBrandIds
)
{
$brandModel
=
new
BrandModel
();
$brandSelectValue
=
$brandModel
->
whereIn
(
'brand_id'
,
explode
(
','
,
$selectBrandIds
))
->
get
();
$brandSelectValue
=
$brandSelectValue
?
$brandSelectValue
->
toArray
()
:
[];
$brandSelectValue
=
array_map
(
function
(
$value
)
{
return
array_only
(
$value
,
[
'brand_name'
,
'brand_id'
]);
},
$brandSelectValue
);
}
$this
->
data
[
'brandSelectValue'
]
=
$brandSelectValue
;
$intracodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intracodeModel
->
getSampleEncode
();
return
$this
->
view
(
'供应商日志'
);
}
//批量下sku
public
function
BatchOffShelf
(
$request
)
{
//获取所有启用的供应商编码
$model
=
new
SupplierChannelModel
();
$suppliers
=
$model
->
where
(
'is_type'
,
0
)
->
where
(
'status'
,
2
)
->
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
;
return
$this
->
view
(
'批量下架'
);
}
}
app/Http/Services/SkuService.php
View file @
c50c7213
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Services
;
use
App\Http\Controllers\Filter\SkuListFilter
;
use
App\Model\IntracodeModel
;
use
App\Model\RedisModel
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -13,33 +14,9 @@ class SkuService
public
function
getSkuList
()
{
$data
[
'data'
][
'goods_id'
]
=
[];
$map
=
request
()
->
all
();
//只获取专卖的数据
$map
[
'supplier_id'
]
=
17
;
if
((
!
empty
(
$map
[
'create_time'
])))
{
$times
=
explode
(
'~'
,
$map
[
'create_time'
]);
$startTime
=
strtotime
(
$times
[
0
])
?:
1420041600
;
$endTime
=
strtotime
(
$times
[
1
])
?:
time
();
$map
[
'create_time/range'
]
=
$startTime
.
','
.
$endTime
;
}
if
((
!
empty
(
$map
[
'update_time'
])))
{
$times
=
explode
(
'~'
,
$map
[
'update_time'
]);
$startTime
=
strtotime
(
$times
[
0
])
?:
1420041600
;
$endTime
=
strtotime
(
$times
[
1
])
?:
time
();
$map
[
'update_time/range'
]
=
$startTime
.
','
.
$endTime
;
}
foreach
(
$map
as
$k
=>
$v
)
{
if
(
empty
(
$v
)
and
$v
!=
'0'
)
{
unset
(
$map
[
$k
]);
}
}
$filter
=
new
SkuListFilter
();
$map
=
$filter
->
listFilter
();
$url
=
env
(
'ES_SKU_URL'
,
''
);
$map
[
'p'
]
=
$map
[
'page'
];
if
(
!
empty
(
$map
[
'p'
])
&&
$map
[
'p'
]
>
1000
)
{
$map
[
'p'
]
=
rand
(
5
,
1000
);
}
$map
[
'show_status'
]
=
1
;
$return
=
curl
(
$url
,
$map
,
1
);
$data
=
json_decode
(
$return
,
true
);
...
...
@@ -88,8 +65,11 @@ class SkuService
}
}
//获取价格
$priceService
=
new
PriceService
();
$moqPrice
=
$priceService
->
getMoqPrice
(
$sku
[
'ladder_price'
]);
$moqPrice
=
[];
if
(
!
empty
(
$sku
[
'ladder_price'
]))
{
$priceService
=
new
PriceService
();
$moqPrice
=
$priceService
->
getMoqPrice
(
$sku
[
'ladder_price'
]);
}
$sku
[
'cn_price'
]
=
array_get
(
$moqPrice
,
'price_cn'
);
$sku
[
'us_price'
]
=
array_get
(
$moqPrice
,
'price_us'
);
$list
[]
=
$sku
;
...
...
app/Http/Services/SkuStatisticsService.php
View file @
c50c7213
...
...
@@ -14,14 +14,14 @@ class SkuStatisticsService
{
$total
=
$this
->
getStatisticsCount
(
'all'
);
//七天内过期的
$
pending
=
$this
->
getStatisticsCount
(
'pending
'
);
$
expire
=
$this
->
getStatisticsCount
(
'expire
'
);
//下架的
$
inReview
=
$this
->
getStatisticsCount
(
'in_review
'
);
$
offShelf
=
$this
->
getStatisticsCount
(
'off_shelf
'
);
$result
=
[
'
tota
l'
=>
$total
,
'
pending'
=>
$pending
,
'
in_review'
=>
$inReview
,
'
al
l'
=>
$total
,
'
expire'
=>
$expire
,
'
off_shelf'
=>
$offShelf
,
];
$result
=
array_map
(
function
(
$value
)
{
if
(
$value
>
999
)
{
...
...
@@ -35,10 +35,24 @@ class SkuStatisticsService
private
function
getStatisticsCount
(
$type
)
{
$model
=
new
SupplierChannelModel
();
$model
=
$model
->
where
(
'supplier_id'
,
'>'
,
0
);
//显示默认的数据(有权限逻辑)
$filter
=
new
SupplierFilter
();
return
$filter
->
defaultFilter
(
$model
,
$type
)
->
count
();
$url
=
env
(
'ES_SKU_URL'
,
''
);
$map
[
'supplier_id'
]
=
17
;
switch
(
$type
)
{
case
"all"
:
break
;
case
"expire"
:
$map
[
'expire_day'
]
=
7
;
break
;
case
"off_shelf"
:
$map
[
"goods_status/condition"
]
=
3
;
break
;
}
$result
=
curl
(
$url
,
$map
);
$result
=
json_decode
(
$result
,
true
);
$total
=
0
;
if
(
isset
(
$result
[
'error_code'
])
&&
$result
[
'error_code'
]
==
0
)
{
$total
=
$result
[
'data'
][
'total'
];
}
return
$total
;
}
}
\ No newline at end of file
app/Http/routes.php
View file @
c50c7213
...
...
@@ -35,6 +35,7 @@ Route::group(['middleware' => ['web'], 'namespace' => 'Api'], function () {
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_log/{key}'
,
'SupplierLogApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_contact/{key}'
,
'SupplierContactApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier_statistics/{key}'
,
'SupplierStatisticsApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/sku_statistics/{key}'
,
'SkuStatisticsApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/supplier/{key}'
,
'SupplierApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/log/{key}'
,
'LogApiController@Entrance'
);
Route
::
match
([
'get'
,
'post'
],
'/api/sku/{key}'
,
'SkuApiController@Entrance'
);
...
...
config/field.php
View file @
c50c7213
...
...
@@ -13,6 +13,15 @@ return [
3
=>
'下架'
,
],
//sku列表用
'SkuStatus'
=>
array
(
0
=>
'待审核'
,
1
=>
'上架'
,
2
=>
'审核不通过'
,
3
=>
'下架'
,
4
=>
'删除'
),
'SKU'
=>
array
(
'spu_id'
=>
1
,
'encoded'
=>
1
,
...
...
config/fixed.php
View file @
c50c7213
...
...
@@ -216,4 +216,10 @@ return [
'to_follow_up'
=>
'待跟进'
,
'no_sku'
=>
'无sku'
,
],
//Sku列表的罗盘对应菜单id
'SkuListCompassMenuMap'
=>
[
'all'
=>
'全部'
,
'expire'
=>
'七天后过期'
,
'off_shelf'
=>
'下架'
,
],
];
config/perm.php
View file @
c50c7213
...
...
@@ -10,7 +10,8 @@ return [
'menuUrl'
=>
env
(
'MENU_URL'
),
'notAuth'
=>
[
'SwitchWarehouse'
,
'SkuList'
'SkuList'
,
'BatchOffShelf'
]
//不用验证权限的方法
],
];
resources/views/script/BatchOffShelfScript.blade.php
0 → 100644
View file @
c50c7213
<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
;
//渲染主营品牌的多选
function
getBrandOption
(
element
,
brandType
)
{
let
brandUrl
=
'/api/common/getBrandList?type='
+
brandType
;
let
brandRes
=
ajax
(
brandUrl
);
let
brandList
=
brandRes
.
data
;
return
{
el
:
'#'
+
element
,
filterable
:
true
,
paging
:
true
,
size
:
'small'
,
radio
:
true
,
height
:
'250px'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
name
:
'brand_name'
,
value
:
'brand_id'
,
},
pageSize
:
30
,
data
:
brandList
,
on
:
function
(
brandList
)
{
let
arr
=
brandList
.
arr
;
let
brandIds
=
''
;
for
(
let
i
in
arr
)
{
brandIds
+=
arr
[
i
].
brand_id
+
','
;
}
let
idName
=
'brand_ids'
;
$
(
'#'
+
idName
).
val
(
brandIds
);
},
};
}
let
brandOption
=
getBrandOption
(
'brand_selector'
,
2
);
xmSelect
.
render
(
brandOption
);
form
.
on
(
'submit(batchOffShelf)'
,
function
(
data
)
{
let
url
=
'/api/sku/BatchOffShelf'
;
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/SkuListScript.blade.php
View file @
c50c7213
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'Split'
,
'admin'
],
function
()
{
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'Split'
,
'admin'
,
'xmSelect'
],
function
()
{
let
$
=
layui
.
jquery
;
let
Split
=
layui
.
Split
;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
...
...
@@ -7,6 +7,7 @@
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'
;
...
...
@@ -26,7 +27,6 @@
});
let
cols
=
[
{
type
:
'checkbox'
},
{
field
:
'goods_id'
,
title
:
'SKUID'
,
align
:
'center'
,
width
:
180
},
{
field
:
'goods_name'
,
title
:
'型号'
,
align
:
'center'
,
width
:
200
},
{
field
:
'brand_name'
,
title
:
'品牌'
,
align
:
'center'
,
width
:
120
...
...
@@ -36,7 +36,7 @@
{
field
:
'moq'
,
title
:
'起订量'
,
align
:
'center'
,
width
:
70
},
{
field
:
'stock'
,
title
:
'库存'
,
align
:
'center'
,
width
:
80
},
{
field
:
'stock'
,
title
:
'库存
数量
'
,
align
:
'center'
,
width
:
80
},
{
field
:
'cn_price'
,
title
:
'国内含币价(¥)'
,
align
:
'center'
,
width
:
120
},
...
...
@@ -47,20 +47,18 @@
field
:
'status_name'
,
title
:
'状态'
,
align
:
'center'
,
width
:
70
,
templet
:
function
(
d
)
{
return
d
.
goods_status
===
1
?
"
<
a
class
=
'layui-btn layui-btn-xs'
>
上架
<
/a>"
:
"
<
a
class
=
'layui-btn layui-btn-xs layui-btn-danger'
>
下架
<
/a>"
;
}
},
{
field
:
'is_expire'
,
title
:
'过期'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
d
)
{
return
d
.
is_expire
===
1
?
"
<
a
class
=
'layui-btn layui-btn-xs layui-btn-danger'
>
是
<
/a>"
:
"
<
a
class
=
'layui-btn layui-btn-xs'
>
否
<
/a>"
;
}
},
{
field
:
'encoded_user_name'
,
title
:
'上传人'
,
align
:
'center'
,
width
:
100
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'mpq'
,
title
:
'标准包装量'
,
align
:
'center'
,
width
:
120
},
{
field
:
'batch_sn'
,
title
:
'批次'
,
align
:
'center'
,
width
:
80
},
{
field
:
'update_time'
,
title
:
'更新时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'encoded_user_name'
,
title
:
'上传人'
,
align
:
'center'
,
width
:
100
},
{
field
:
'audit_time'
,
title
:
'审核时间'
,
align
:
'center'
,
width
:
150
},
{
field
:
'audit_user'
,
title
:
'审核人'
,
align
:
'center'
,
width
:
100
},
// {field: 'create_time', title: '上传时间', align: 'center', width: 150},
...
...
@@ -69,6 +67,7 @@
return
"人工上传"
;
}
},
{
field
:
'goods_id'
,
title
:
'SKUID'
,
align
:
'center'
,
width
:
180
},
];
let
currentPage
=
0
;
table
.
render
({
...
...
@@ -90,6 +89,58 @@
}
});
//渲染多选
let
brandSelect
=
xmSelect
.
render
({
el
:
'#brandSelect'
,
name
:
'brand_id'
,
searchTips
:
'请输入要查找的制造商'
,
paging
:
true
,
empty
:
'没有查找到数据'
,
prop
:
{
name
:
'brand_name'
,
value
:
'brand_id'
},
height
:
"1300px"
,
remoteSearch
:
true
,
autoRow
:
true
,
pageRemote
:
true
,
filterable
:
true
,
remoteMethod
:
function
(
val
,
cb
,
show
,
pageIndex
)
{
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$
.
ajax
({
url
:
'/api/common/SearchBrand'
,
type
:
'post'
,
data
:
{
brand_ids
:
$
(
'#brand_ids'
).
val
(),
brand_name
:
val
,
page
:
pageIndex
},
dataType
:
'json'
,
timeout
:
10000
,
success
:
function
(
res
)
{
if
(
!
res
)
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
if
(
res
.
errcode
===
0
)
{
cb
(
res
.
data
,
res
.
last_page
);
}
else
{
layer
.
msg
(
res
.
errmsg
,
{
icon
:
6
});
}
},
error
:
function
()
{
return
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
}
});
},
on
:
function
(
data
)
{
let
brandIds
=
''
;
for
(
let
x
in
data
.
arr
)
// x 为属性名
{
brandIds
=
brandIds
+
data
.
arr
[
x
].
brand_id
+
','
;
}
$
(
"#brand_id_condition"
).
val
(
brandIds
);
}
});
brandSelect
.
setValue
(
JSON
.
parse
(
$
(
'#brand_id_condition'
).
attr
(
'select_value'
)));
//批量上架
$
(
"#batch_putaway"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'skuList'
);
...
...
@@ -106,29 +157,29 @@
})
//批量下架
$
(
"#batch_
unshelve
"
).
click
(
function
()
{
$
(
"#batch_
off_shelf
"
).
click
(
function
()
{
let
checkStatus
=
table
.
checkStatus
(
'skuList'
);
let
data
=
checkStatus
.
data
;
let
skuIds
=
[];
$
.
each
(
data
,
function
(
index
,
value
)
{
skuIds
.
push
(
value
.
goods_id
);
});
if
(
skuIds
.
length
===
0
)
{
layer
.
msg
(
'请选择要操作的sku'
,
{
icon
:
5
});
return
;
}
$
.
each
(
data
,
function
(
index
,
value
)
{
skuIds
.
push
(
value
.
goods_id
);
});
batchUpdateGoodsStatus
(
skuIds
,
'offshelf'
);
})
//根据供应商编码已经品牌等去基石调用接口下架
$
(
"#remote_batch_
unshelve
"
).
click
(
function
()
{
$
(
"#remote_batch_
off_shelf
"
).
click
(
function
()
{
layer
.
open
({
type
:
2
,
content
:
'/sku/
RemoteBatchUnshelve
?view=iframe'
,
area
:
[
'
600px'
,
'70%
'
],
content
:
'/sku/
BatchOffShelf
?view=iframe'
,
area
:
[
'
800px'
,
'600px
'
],
title
:
'批量下载SKU'
,
end
:
function
()
{
table
.
reload
(
'
l
ist'
);
table
.
reload
(
'
skuL
ist'
);
// supplierStatistics();
}
});
...
...
resources/views/script/supplier/SupplierBaseScript.blade.php
View file @
c50c7213
...
...
@@ -33,6 +33,7 @@
filterable
:
true
,
paging
:
true
,
height
:
'250px'
,
size
:
'small'
,
direction
:
'auto'
,
autoRow
:
true
,
prop
:
{
...
...
resources/views/web/BatchOffShelf.blade.php
0 → 100644
View file @
c50c7213
<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"
style=
"margin-left: -30px"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_code','供应商选择 : ',null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px;"
>
<label
class=
"layui-form-label"
>
品牌 :
</label>
<div
class=
"layui-input-block"
>
<div
id=
"brand_selector"
class=
"layui-input-inline"
style=
"width: 400px;height: 20px;line-height: 20px"
>
</div>
<input
type=
"hidden"
name=
"brand_ids"
id=
"brand_ids"
>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"margin-left: -30px"
>
@inject('timeIntervalPresenter','App\Presenters\TimeIntervalPresenter')
{!! $timeIntervalPresenter->render('update_time','更新时间 : ') !!}
</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=
"batchOffShelf"
>
确认
</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/SkuList.blade.php
View file @
c50c7213
...
...
@@ -5,8 +5,8 @@
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
add_supplier
">新增</button>
@endif
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
batch_putaway
">上架</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
batch_
unshelve
">下架</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
add_supplier
">批量下架</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
batch_
off_shelf
">下架</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
remote_batch_off_shelf
">批量下架</button>
</div>
<table class="
layui
-
table
" id="
skuList
" lay-filter="
skuList
"></table>
...
...
resources/views/web/sku/SkuListCommon.blade.php
View file @
c50c7213
...
...
@@ -2,6 +2,10 @@
.main_filter
{
cursor
:
pointer
;
}
xm-select
{
min-height
:
27px
;
}
</style>
<div
class=
"layui-fluid"
id=
"type_filter"
>
<div
class=
"layui-card"
>
...
...
@@ -13,24 +17,24 @@
</div>
</div>
<div
class=
"split-item"
id=
"s2"
style=
"text-align: center"
>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
id=
"pending
"
>
</a>
</div>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
id=
"in_review
"
>
</a>
</div>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
id=
"expire
"
>
</a>
</div>
<div
class=
"layui-row"
>
<a
class=
"main_filter"
id=
"off_shelf
"
>
</a>
</div>
</div>
<div
class=
"split-item"
id=
"s3"
style=
"text-align: center"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-collapse"
>
@if(checkPerm('ViewFilter'))
<!--通用的筛选-->
...
...
@@ -40,41 +44,77 @@
?>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_group','供应商性质','',
config('fixed.SupplierGroup')) !!}
<label
class=
"layui-form-label"
>
商品型号
</label>
<div
class=
"layui-input-inline"
>
<input
type=
"text"
value=
""
name=
"goods_name/condition"
placeholder=
"请输入型号"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
<div
class=
"layui-inline"
>
@inject('transformableInputPresenter','App\Presenters\Filter\TransformableInputPresenter')
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码','supplier_id'=>'供应商ID']) !!}
<label
class=
"layui-form-label"
>
品牌
</label>
<div
class=
"layui-input-inline"
>
<div
id=
"brandSelect"
style=
"width: 155px"
></div>
<input
type=
"hidden"
id=
"brand_id_condition"
select_value=
"{{json_encode($brandSelectValue)}}"
name=
"brand_id/condition"
value=
"{{request()->get('brand_id/condition') or ''}}"
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=
"canal/condition"
placeholder=
"请输入供应商编码"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
{{--
<div
class=
"layui-inline"
>
--}}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}--}}
{{--
</div>
--}}
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('
stockup_type','合作类型','',config('fixed.StockupType
')) !!}
{!! $statusPresenter->render('
goods_status/condition','SKU状态',request()->get('goods_status/condition'),config('field.SkuStatus
')) !!}
</div>
<div
class=
"layui-inline"
>
@inject('
transformableSelectPresenter','App\Presenters\Filter\TransformableSelect
Presenter')
{!! $
transformableSelectPresenter->render(['channel_uid'=>'采购员','purchase_uid'=>'开发员','create_uid'=>'创建人'],$userCodes
) !!}
@inject('
statusPresenter','App\Presenters\Status
Presenter')
{!! $
statusPresenter->render('status/condition','是否过期',request()->get('status/condition'),[0=>'是',1=>'否']
) !!}
</div>
@if(checkPerm('ViewFakeSupplier'))
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('is_type','正式供应商','',[0=>'是',1=>'否'],['width'=>'100px']) !!}
</div>
@endif
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
起订量和库存
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"moq_stock_compare"
>
<option
value=
""
>
请选择
</option>
<option
value=
"lt"
>
起订量
<
库存</
option
>
<option
value=
"gt"
>
起订量 > 库存
</option>
<option
value=
"e"
>
起订量 = 库存
</option>
</select>
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
库存数量
</label>
<div
class=
"layui-input-inline"
>
<div
class=
"layui-row"
>
<div
class=
"layui-col-xs6"
style=
"width: 74px"
>
<select
name=
"stock_compare_type"
>
<option
value=
""
>
请选择
</option>
<option
value=
"gt"
>
>
</option>
<option
value=
"lt"
>
<
</
option
>
<option
value=
"eq"
>
=
</option>
</select>
</div>
<div
class=
"layui-col-xs6"
style=
"width: 84px;"
>
<input
type=
"text"
value=
""
name=
"stock_num"
placeholder=
"数量"
autocomplete=
"off"
class=
"layui-input"
>
</div>
</div>
</div>
</div>
<div
class=
"layui-inline"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('has_sku','SKU上传','',[-1=>'否',1=>'是']) !!}
{!! $statusPresenter->render('encoded/condition','上传人',request()->get('encoded/condition'),
$userCodes) !!}
</div>
<div
class=
"layui-inline"
style=
"width: 600px"
>
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'
创建
时间']) !!}
{!! $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'
上传
时间']) !!}
</div>
</div>
<div
class=
"layui-row"
style=
"margin-top:10px;margin-bottom: 10px;margin-left: 20px;"
>
...
...
@@ -94,7 +134,7 @@
<script>
//一进来就去获取统计数据
function
supplierStatistics
()
{
let
res
=
ajax
(
'/api/s
upplier_statistics/GetSupplier
Statistics'
);
let
res
=
ajax
(
'/api/s
ku_statistics/GetSku
Statistics'
);
if
(
res
.
err_code
===
0
)
{
$
.
each
(
res
.
data
,
function
(
index
,
value
)
{
let
menuObj
=
$
(
'#'
+
index
);
...
...
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