Commit 3a4149a1 by 杨树贤

优化下拉框

parent 6a303652
......@@ -55,16 +55,16 @@ class SkuApiController extends Controller
$supplierCode = $request->get('supplier_code');
$brandId = $request->get('brand_ids');
$brandId = str_replace(',', '', $brandId);
// $updateTime = $request->get('update_time');
// $updateTime = $request->get('update_time');
if (empty($supplierCode)) {
$this->response(-1, '请选择供应商');
}
// $startTime = $endTime = 0;
// if ($updateTime) {
// $updateTime = explode('~', $updateTime);
// $startTime = $updateTime[0];
// $endTime = $updateTime[1];
// }
// $startTime = $endTime = 0;
// if ($updateTime) {
// $updateTime = explode('~', $updateTime);
// $startTime = $updateTime[0];
// $endTime = $updateTime[1];
// }
$uploadLogId = SkuUploadLogModel::where('supplier_code', $supplierCode)
->where('status', SkuUploadLogModel::STATUS_HANDLED)->orderBy('id', 'desc')
......@@ -79,7 +79,6 @@ class SkuApiController extends Controller
//改成队列
(new SkuService())->batchOffShelfSkuQueue($data);
$this->response(0, '批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况');
}
......@@ -95,8 +94,7 @@ class SkuApiController extends Controller
$this->response(-1, '请选择供内部编码(采购员)');
}
//判断采购员是否属于该供应商
$flag = SupplierChannelModel::where('supplier_code', $canal)->
where('channel_uid', 'like', "%$encoded%")->exists();
$flag = SupplierChannelModel::where('supplier_code', $canal)->where('channel_uid', 'like', "%$encoded%")->exists();
if (!$flag) {
$this->response(-1, '选择的采购员不属于该供应商,请重新选择');
}
......@@ -107,7 +105,6 @@ class SkuApiController extends Controller
//改成队列
(new SkuService())->batchUpdateEncodedQueue($data);
$this->response(0, '批量修改内部编码任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况');
}
......@@ -177,14 +174,14 @@ class SkuApiController extends Controller
$skuIds = $request->get('sku_ids');
$skuTags = $request->get('sku_tags');
if ($type == 1 && empty($skuIds)) {
$this->response(-1,'按型号设置标签,必须先选择型号');
$this->response(-1, '按型号设置标签,必须先选择型号');
}
if ($type == 2 && empty($supplierCode)) {
$this->response(-1,'按供应商设置标签,必须先选择供应商');
$this->response(-1, '按供应商设置标签,必须先选择供应商');
}
(new SkuService())->batchAddSkuTags($type,$supplierCode,$skuIds, $skuTags);
(new SkuService())->batchAddSkuTags($type, $supplierCode, $skuIds, $skuTags);
$text = $type == 1? '设置标签成功':'批量设置供应商SKU标签任务已开始,请等待任务完成';
$text = $type == 1 ? '设置标签成功' : '批量设置供应商SKU标签任务已开始,请等待任务完成';
$this->response(0, $text);
}
......@@ -197,17 +194,17 @@ class SkuApiController extends Controller
$skuIds = $request->get('sku_ids');
$goodsLabel = $request->get('goods_label');
if ($type == 1 && empty($skuIds)) {
$this->response(-1,'按型号设置显示类型,必须先选择型号');
$this->response(-1, '按型号设置显示类型,必须先选择型号');
}
if ($type == 2 && empty($supplierCode)) {
$this->response(-1,'按供应商设置显示类型,必须先选择供应商');
$this->response(-1, '按供应商设置显示类型,必须先选择供应商');
}
if (empty($goodsLabel)) {
$this->response(-1,'请选择显示类型');
$this->response(-1, '请选择显示类型');
}
(new SkuService())->batchUpdateGoodsLabel($type,$supplierCode,$skuIds, $goodsLabel);
(new SkuService())->batchUpdateGoodsLabel($type, $supplierCode, $skuIds, $goodsLabel);
$text = $type == 1? '设置显示类型成功':'批量设置供应SKU商显示类型任务已开始,请等待任务完成';
$text = $type == 1 ? '设置显示类型成功' : '批量设置供应SKU商显示类型任务已开始,请等待任务完成';
$this->response(0, $text);
}
......
......@@ -95,6 +95,8 @@ class SkuController extends Controller
}
$this->data['supplierCodes'] = $supplierCodes;
$this->data['userCodes'] = $userCodes;
$supplierData = SupplierService::getSupplierCodeListForXmSelect();
$this->data['supplierData'] = $supplierData;
return $this->view('批量修改内部编码');
}
......
......@@ -7,17 +7,20 @@
<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('canal','供应商选择 : ',null,
$supplierCodes,['required'=>true,'width'=>'400px']) !!}
</div>
@inject('multiSelectorPresenter', 'App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('canal', '供应商选择', '', $supplierData, [
'required' => true,
'radio' => 'true',
'width' => '400px',
]) !!}
</div>
<div class="layui-form-item">
<div class="layui-inline" style="margin-left: -30px">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('encoded','内部编码 : ',null,
$userCodes,['required'=>true,'width'=>'400px']) !!}
<div class="layui-inline" style="">
@inject('statusPresenter', 'App\Presenters\StatusPresenter')
{!! $statusPresenter->render('encoded', '内部编码 : ', null, $userCodes, [
'required' => true,
'width' => '400px',
]) !!}
</div>
</div>
<div class="layui-form-item">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment