Commit 0bb747c5 by 杨树贤

Merge branch 'ysx-供应商需求-20220725'

parents fe60457a 2ef6ad04
Showing with 743 additions and 298 deletions
...@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api; ...@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Services\AdminUserService; use App\Http\Services\AdminUserService;
use App\Http\Services\CompanyService; use App\Http\Services\CompanyService;
use App\Http\Services\StandardBrandService;
use App\Model\BrandModel; use App\Model\BrandModel;
use App\Model\StandardBrandModel; use App\Model\StandardBrandModel;
use App\Model\SupplierChannelModel; use App\Model\SupplierChannelModel;
...@@ -35,9 +36,19 @@ class CommonApiController extends Controller ...@@ -35,9 +36,19 @@ class CommonApiController extends Controller
//获取标准品牌 //获取标准品牌
public function getStandardBrandList($request) public function getStandardBrandList($request)
{ {
$model = new BrandModel(); $list = (new StandardBrandService())->getStandardBrandList($request->all());
$brandList = $model->getStandardBrandList(); $data = array_get($list, 'data');
$this->response(0, 'ok', $brandList); $lastPage = array_get($list, 'last_page');
$total = array_get($list, 'total');
echo json_encode([
'err_code' => 0,
'err_msg' => 'ok',
'total' => $total,
'count' => $total,
'data' => $data,
'last_page' => $lastPage
]);
exit();
} }
private function SearchBrand($request) private function SearchBrand($request)
......
...@@ -31,18 +31,27 @@ class SupplierExaminationApiController extends Controller ...@@ -31,18 +31,27 @@ class SupplierExaminationApiController extends Controller
public function AddSupplierExamination($request) public function AddSupplierExamination($request)
{ {
$params = $request->only([ $params = $request->only([
'supplier_name', 'order_sn',
'purchase_sn',
'examine_time', 'examine_time',
'sales_name',
'purchase_name', 'purchase_name',
'ticket_type',
'supplier_name',
'sku_name', 'sku_name',
'brand_name', 'brand_name',
'amount', 'amount',
'examine_amount', 'batch',
'producing_area',
'stock_in_date',
'income_sn',
'delivery_sn',
'tally_request',
'examine_request',
'unhealthy_amount', 'unhealthy_amount',
'abnormal_level',
'unhealthy_content', 'unhealthy_content',
'examine_result', 'examine_result',
'abnormal_level',
'handle_way',
'remark', 'remark',
]); ]);
$validator = new SupplierExaminationValidator(); $validator = new SupplierExaminationValidator();
...@@ -63,18 +72,27 @@ class SupplierExaminationApiController extends Controller ...@@ -63,18 +72,27 @@ class SupplierExaminationApiController extends Controller
{ {
$params = $request->only([ $params = $request->only([
'id', 'id',
'supplier_name', 'order_sn',
'purchase_sn',
'examine_time', 'examine_time',
'sales_name',
'purchase_name', 'purchase_name',
'ticket_type',
'supplier_name',
'sku_name', 'sku_name',
'brand_name', 'brand_name',
'amount', 'amount',
'examine_amount', 'batch',
'producing_area',
'stock_in_date',
'income_sn',
'delivery_sn',
'tally_request',
'examine_request',
'unhealthy_amount', 'unhealthy_amount',
'abnormal_level',
'unhealthy_content', 'unhealthy_content',
'examine_result', 'examine_result',
'abnormal_level',
'handle_way',
'remark', 'remark',
]); ]);
$validator = new SupplierExaminationValidator(); $validator = new SupplierExaminationValidator();
...@@ -111,7 +129,7 @@ class SupplierExaminationApiController extends Controller ...@@ -111,7 +129,7 @@ class SupplierExaminationApiController extends Controller
if ($file->isValid()) { if ($file->isValid()) {
$ext = $file->getClientOriginalExtension(); $ext = $file->getClientOriginalExtension();
$realPath = $file->getRealPath(); $realPath = $file->getRealPath();
if ($ext != 'csv') { if ($ext != 'xlsx') {
$this->response(-1, '上传格式错误'); $this->response(-1, '上传格式错误');
} }
// 上传文件 // 上传文件
......
...@@ -54,6 +54,11 @@ class SupplierExaminationFilter ...@@ -54,6 +54,11 @@ class SupplierExaminationFilter
$query->where('purchase_name', $map['purchase_name']); $query->where('purchase_name', $map['purchase_name']);
} }
if (!empty($map['examine_result'])) {
$query->where('examine_result', $map['examine_result']);
}
if ((isset($map['abnormal_level']) && $map['abnormal_level'] === '0') || !empty($map['abnormal_level'])) { if ((isset($map['abnormal_level']) && $map['abnormal_level'] === '0') || !empty($map['abnormal_level'])) {
$query->where('abnormal_level', $map['abnormal_level']); $query->where('abnormal_level', $map['abnormal_level']);
} }
......
...@@ -5,6 +5,7 @@ namespace App\Http\Controllers; ...@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Http\Services\LogService; use App\Http\Services\LogService;
use App\Http\Services\RegionService; use App\Http\Services\RegionService;
use App\Http\Services\SkuUploadLogService; use App\Http\Services\SkuUploadLogService;
use App\Http\Services\StandardBrandService;
use App\Http\Services\SupplierAttachmentService; use App\Http\Services\SupplierAttachmentService;
use App\Http\Services\SupplierService; use App\Http\Services\SupplierService;
use App\Http\Services\SupplierShareApplyService; use App\Http\Services\SupplierShareApplyService;
...@@ -76,7 +77,7 @@ class SupplierController extends Controller ...@@ -76,7 +77,7 @@ class SupplierController extends Controller
} }
$this->data['statusData'] = $statusData; $this->data['statusData'] = $statusData;
$stockupTypeData = []; $stockupTypeData = [];
foreach (config('fixed.StockupType') as $key=>$value) { foreach (config('fixed.StockupType') as $key => $value) {
$stockupTypeData[] = [ $stockupTypeData[] = [
'name' => $value, 'name' => $value,
'value' => $key, 'value' => $key,
...@@ -84,7 +85,7 @@ class SupplierController extends Controller ...@@ -84,7 +85,7 @@ class SupplierController extends Controller
} }
$this->data['stockupTypeData'] = $stockupTypeData; $this->data['stockupTypeData'] = $stockupTypeData;
$levelData = []; $levelData = [];
foreach (config('field.LevelMap') as $key=>$value) { foreach (config('field.LevelMap') as $key => $value) {
$levelData[] = [ $levelData[] = [
'name' => $value, 'name' => $value,
'value' => $key, 'value' => $key,
...@@ -92,7 +93,7 @@ class SupplierController extends Controller ...@@ -92,7 +93,7 @@ class SupplierController extends Controller
} }
$this->data['levelData'] = $levelData; $this->data['levelData'] = $levelData;
$supplierTypeData = []; $supplierTypeData = [];
foreach (config('field.SupplierType') as $key=>$value) { foreach (config('field.SupplierType') as $key => $value) {
$supplierTypeData[] = [ $supplierTypeData[] = [
'name' => $value, 'name' => $value,
'value' => $key, 'value' => $key,
...@@ -155,6 +156,7 @@ class SupplierController extends Controller ...@@ -155,6 +156,7 @@ class SupplierController extends Controller
//省市区数据放到script模板 //省市区数据放到script模板
$regionService = new RegionService(); $regionService = new RegionService();
$this->data['region_data'] = $regionService->getCityRegionData(); $this->data['region_data'] = $regionService->getCityRegionData();
$this->data['brand_init_value'] = [];
//编辑 //编辑
if (!empty($supplierId)) { if (!empty($supplierId)) {
$this->data['title'] = '编辑供应商'; $this->data['title'] = '编辑供应商';
...@@ -215,6 +217,7 @@ class SupplierController extends Controller ...@@ -215,6 +217,7 @@ class SupplierController extends Controller
$this->data['ignore_supplier_type_change_tips'] = in_array($supplier['supplier_name'], $this->data['ignore_supplier_type_change_tips'] = in_array($supplier['supplier_name'],
config('field.SkipChangeSupplierTypeNames')); config('field.SkipChangeSupplierTypeNames'));
$this->data['sku_upload_log_count'] = (new SkuUploadLogService())->getSkuUploadLogCount($supplierId); $this->data['sku_upload_log_count'] = (new SkuUploadLogService())->getSkuUploadLogCount($supplierId);
$this->data['brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
return $this->view('编辑供应商'); return $this->view('编辑供应商');
} }
......
...@@ -81,7 +81,7 @@ class SupplierExaminationController extends Controller ...@@ -81,7 +81,7 @@ class SupplierExaminationController extends Controller
$this->data['supplierName'] = $supplierName; $this->data['supplierName'] = $supplierName;
} }
//获取所有采购员提供选择 //获取所有采购员提供选择
$purchaseUsers = (new IntracodeModel())->getEncode(); $purchaseUsers = (new IntracodeModel())->getAllEncode();
$purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray(); $purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray();
$this->data['purchaseUserNames'] = $purchaseUserNames; $this->data['purchaseUserNames'] = $purchaseUserNames;
$this->data['supplierNames'] = (new SupplierChannelModel())->where('is_type',0) $this->data['supplierNames'] = (new SupplierChannelModel())->where('is_type',0)
......
...@@ -44,14 +44,22 @@ class SupplierTagController extends Controller ...@@ -44,14 +44,22 @@ class SupplierTagController extends Controller
//供应商详情 //供应商详情
public function BatchAddTag($request) public function BatchAddTag($request)
{ {
$supplierIds = $request->get('supplier_ids'); $suppliers = (new SupplierChannelModel())->where('is_type', 0)
$this->data['supplierIds'] = $supplierIds; ->select([
$supplierIds = explode(',', $supplierIds); 'supplier_id',
$model = new SupplierChannelModel(); 'supplier_code',
$suppliers = $model->whereIn('supplier_id', $supplierIds)->get()->toArray(); 'system_tags',
$transformer = new SupplierTransformer(); 'customer_tags',
$suppliers = $transformer->transformList($suppliers); 'supplier_name',
])->get();
$this->data['suppliers'] = $suppliers; $this->data['suppliers'] = $suppliers;
$supplierCodes = [];
foreach ($suppliers as $supplier) {
$supplier = $supplier->toArray();
$supplierCodes[$supplier['supplier_code']] = $supplier['supplier_name'] . '(' . $supplier['supplier_code'] . ')';
}
$this->data['supplierCodes'] = $supplierCodes;
$this->data['suppliers'] = collect($suppliers)->keyBy('supplier_code')->toArray();
$this->data['title'] = '批量修改供应商编码'; $this->data['title'] = '批量修改供应商编码';
return $this->view('批量修改供应商编码'); return $this->view('批量修改供应商编码');
} }
......
...@@ -112,4 +112,12 @@ class DepartmentService ...@@ -112,4 +112,12 @@ class DepartmentService
} }
return []; return [];
} }
//根据用户名获取部门名称
public function getDepartmentNameByUserName($userName)
{
$departmentId = UserInfoModel::where('name', $userName)->value('department_id');
$departmentName = DepartmentModel::where('department_id', $departmentId)->value('department_name');
return $departmentName;
}
} }
\ No newline at end of file
<?php
namespace App\Http\Services;
use App\Model\SpuBrandModel;
use App\Model\RedisModel;
use App\Model\StandardBrandMappingModel;
use App\Model\StandardBrandModel;
use Illuminate\Support\Facades\DB;
class StandardBrandService
{
public function getStandardBrandList($params)
{
$limit = array_get($params, 'limit', 30);
$searchBrandName = array_get($params, 'brand_name');
$standardBrandModel = new StandardBrandModel();
$query = $standardBrandModel->selectRaw('brand_name,standard_brand_id as brand_id')
->where('status', 1);
$flag = false;
//这里搜索的普通品牌名字,要根据普通品牌名字去搜索出相关的标准品牌名称
if (!empty($searchBrandName)) {
$brandIds = SpuBrandModel::where('brand_name', 'like', "%$searchBrandName%")->limit(100)->pluck('brand_id');
if (!empty($brandIds)) {
$standardBrandIds = StandardBrandMappingModel::whereIn('brand_id',
$brandIds)->pluck('standard_brand_id');
if (!empty($standardBrandIds)) {
$query->whereIn('standard_brand_id', $standardBrandIds)->orWhere('brand_name', 'like',
"%$searchBrandName%")->orderByRaw("CASE WHEN brand_name LIKE '${searchBrandName}' THEN 1 WHEN brand_name LIKE '${searchBrandName}%' THEN 2 WHEN brand_name LIKE '%${searchBrandName}' THEN 4 ELSE 3 END");
$flag = true;
}
}
}
$list = $query->paginate($limit)->toArray();
//如果有根据普通品牌搜出标准品牌,那么还要补充数据显示
if ($flag) {
$list['data'] = array_map(function ($value) use ($searchBrandName) {
$brandIds = StandardBrandMappingModel::where('standard_brand_id',
$value['brand_id'])->pluck('brand_id')->toArray();
$brandNames = SpuBrandModel::whereIn('brand_id', $brandIds)->where('brand_name', 'like',
"%${searchBrandName}%")->limit(10)->pluck('brand_name')->toArray();
//去除原始数据那些换行或者tab符号,原始数据是很乱的
$brandNames = array_map(function ($value) {
return $value ? str_replace("\t", '', $value) : $value;
}, $brandNames);
$value['mapping_brand_names'] = $brandNames ? implode($brandNames, ' | ') : '-';
$value['show_name'] = $value['brand_name'];
return $value;
}, $list['data']);
} else {
$list['data'] = array_map(function ($value) {
$value['mapping_brand_names'] = '-';
$value['show_name'] = $value['brand_name'];
return $value;
}, $list['data']);
}
return $list;
}
//获取供应商一开始给xm-select用的保存的品牌数据
public function getBrandInitValue($brandIds)
{
if (!trim($brandIds, ',')) {
return [];
}
$brandIds = explode(',', $brandIds);
$brands = StandardBrandModel::whereIn('standard_brand_id', $brandIds)->select([
'brand_name',
'standard_brand_id as brand_id',
])->get();
$brands = !empty($brands) ? $brands->toArray() : [];
return array_map(function ($brand) {
$brand['show_name'] = $brand['brand_name'];
$brand['mapping_brand_names'] = '-';
return $brand;
}, $brands);
}
}
\ No newline at end of file
...@@ -9,10 +9,12 @@ use App\Http\Transformers\SupplierExaminationTransformer; ...@@ -9,10 +9,12 @@ use App\Http\Transformers\SupplierExaminationTransformer;
use App\Model\IntracodeModel; use App\Model\IntracodeModel;
use App\Model\SupplierChannelModel; use App\Model\SupplierChannelModel;
use App\Model\SupplierExaminationModel; use App\Model\SupplierExaminationModel;
use App\Utils\CsvValueBinder;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
class SupplierExaminationService class SupplierExaminationService
{ {
public function getSupplierExaminationList($request) public function getSupplierExaminationList($request)
{ {
$limit = $request->get('limit', 10); $limit = $request->get('limit', 10);
...@@ -51,10 +53,12 @@ class SupplierExaminationService ...@@ -51,10 +53,12 @@ class SupplierExaminationService
ini_set('memory_limit', -1); ini_set('memory_limit', -1);
try { try {
$content = file_get_contents($filePath);
$fileType = mb_detect_encoding($content, array('UTF-8', 'GBK', 'LATIN1', 'BIG5'));
Excel::load($filePath, function ($reader) { Excel::load($filePath, function ($reader) {
$data = $reader->getSheet(0)->toArray(); $data = $reader->getSheet(0)->toArray();
$header = $data[0];
if (!$this->checkImportCsvHeader($header)) {
throw new \Exception('文件不是标准上传模板,请核对后再上传');
}
$dataMd5 = md5(json_encode($data)); $dataMd5 = md5(json_encode($data));
if (SupplierExaminationModel::where('data_md5', $dataMd5)->exists()) { if (SupplierExaminationModel::where('data_md5', $dataMd5)->exists()) {
throw new \Exception('该文件已经上传过,请选择其它文件'); throw new \Exception('该文件已经上传过,请选择其它文件');
...@@ -66,103 +70,148 @@ class SupplierExaminationService ...@@ -66,103 +70,148 @@ class SupplierExaminationService
//拼装数据插入校验,校验完成插入数据库 //拼装数据插入校验,校验完成插入数据库
$examineData = []; $examineData = [];
foreach ($data as $index => $item) { foreach ($data as $index => $item) {
$lineNo = $index + 1;
//检测模板头部
if ($index == 0) { if ($index == 0) {
if (!$this->checkImportCsvHeader($item)) {
throw new \Exception('文件不是标准上传模板');
}
continue; continue;
} }
$lineNo = $index + 1;
$item = array_map(function ($value) { $item = array_map(function ($value) {
return trim($value); return trim($value);
}, $item); }, $item);
$examineTime = $item[0]; $orderSn = $item[0];
$channelUserName = $item[1]; $purchaseSn = $item[1];
$supplierName = $item[2]; $examineTime = $item[2];
$skuName = $item[3]; $salesName = $item[3];
$brandName = $item[4]; $channelUserName = $item[4];
$amount = $item[5]; $ticketType = $item[5];
$examineAmount = $item[6]; $supplierName = $item[6];
$unhealthyAmount = $item[7]; $skuName = $item[7];
$abnormalLevel = (int)$item[8]; $brandName = $item[8];
$unhealthyContent = $item[9]; $amount = $item[9];
$examineResult = $item[10]; $batch = $item[10];
$handleWay = $item[11]; $producingArea = $item[11];
$remark = $item[12]; $stockInDate = $item[12];
$incomeSn = $item[13];
$deliverySn = $item[14];
$tallyRequest = $item[15];
$examineRequest = $item[16];
$unhealthyAmount = $item[17];
$abnormalLevel = $item[18];
$unhealthyContent = $item[19];
$examineResult = $item[20];
$remark = $item[21];
if (empty($supplierName)) { if (empty($supplierName)) {
throw new \Exception("存在供应商名称为空的数据(第${lineNo}行),请修改后再次提交"); throw new \Exception("供应商名称不能为空! (第${lineNo}行),请修改后再次提交");
}
if (empty($examineTime)) {
throw new \Exception("检货时间不能为空! (第${lineNo}行),请修改为 2000-01-01 这种格式后再次提交");
}
if (!isDateTime($examineTime)) {
throw new \Exception("检货时间格式不规范! (第${lineNo}行),请修改为 2022/10/10 这种格式后再次提交");
}
if (!empty($stockInDate) && !isDateTime($stockInDate)) {
throw new \Exception("入库日期时间格式不规范! (第${lineNo}行),请修改后再次提交");
} }
if (!in_array($supplierName,$supplierNames)) {
if (!in_array($supplierName, $supplierNames)) {
throw new \Exception("存在无效供应商(供应商系统不存在)的数据(第${lineNo}行),请修改后再次提交"); throw new \Exception("存在无效供应商(供应商系统不存在)的数据(第${lineNo}行),请修改后再次提交");
} }
if (!in_array($channelUserName,$channelUserNames)) { if (!in_array($channelUserName, $channelUserNames)) {
throw new \Exception("存在无效的采购员(第${lineNo}行),请修改后再次提交"); throw new \Exception("存在无效的采购员(第${lineNo}行),请修改后再次提交");
} }
if (empty($skuName)) {
if (!is_numeric($amount)) { throw new \Exception("型号不能为空! (第${lineNo}行),请修改后再次提交");
throw new \Exception("数量只能为纯数字(第${lineNo}行),请修改后再次提交"); }
if (empty($brandName)) {
throw new \Exception("品牌不能为空! (第${lineNo}行),请修改后再次提交");
} }
if (!is_numeric($examineAmount)) { if (!is_numeric($amount) || empty($amount)) {
throw new \Exception("检测数量只能为纯数字(第${lineNo}行),请修改后再次提交"); throw new \Exception("数量只能为纯数字且不能为空! (第${lineNo}行),请修改后再次提交");
} }
if (!is_numeric($unhealthyAmount)) { if (!is_numeric($unhealthyAmount) || empty($unhealthyAmount)) {
throw new \Exception("不良数量只能为纯数字(第${lineNo}行),请修改后再次提交"); throw new \Exception("不良数量只能为纯数字且不能为空 (第${lineNo}行),请修改后再次提交");
} }
if (!in_array($abnormalLevel,[1,2,3])) { if (empty($examineResult) || !in_array($examineResult,
throw new \Exception("存在不合理的异常等级,等级必须为纯数字1,2,3 (第${lineNo}行),请修改后再次提交"); array_values(config('field.SupplierExamineResult')))) {
throw new \Exception("检验结果只能(退货|特批入库|正常入库)其中一个且不能为空 (第${lineNo}行),请修改后再次提交");
}
if (!empty($abnormalLevel) && !in_array($abnormalLevel, [1, 2, 3])) {
throw new \Exception("存在不合理的异常等级,等级必须为纯数字1,2,3或者不填 (第${lineNo}行),请修改后再次提交");
} }
$examineData[] = [ $examineData[] = [
'examine_time' => $examineTime ? strtotime($examineTime) : '', 'order_sn' => $orderSn,
'purchase_sn' => $purchaseSn,
'examine_time' => $examineTime ? strtotime($examineTime) : 0,
'sales_name' => $salesName,
'purchase_name' => $channelUserName, 'purchase_name' => $channelUserName,
'ticket_type' => $ticketType,
'supplier_name' => $supplierName, 'supplier_name' => $supplierName,
'sku_name' => $skuName, 'sku_name' => $skuName,
'brand_name' => $brandName, 'brand_name' => $brandName,
'amount' => $amount, 'amount' => $amount,
'examine_amount' => $examineAmount, 'batch' => $batch,
'producing_area' => $producingArea,
'stock_in_date' => $stockInDate ? strtotime($stockInDate) : 0,
'income_sn' => $incomeSn,
'delivery_sn' => $deliverySn,
'tally_request' => $tallyRequest,
'examine_request' => $examineRequest,
'unhealthy_amount' => $unhealthyAmount, 'unhealthy_amount' => $unhealthyAmount,
'abnormal_level' => $abnormalLevel, 'abnormal_level' => $abnormalLevel,
'unhealthy_content' => $unhealthyContent, 'unhealthy_content' => $unhealthyContent,
'examine_result' => $examineResult, 'examine_result' => $examineResult,
'handle_way' => $handleWay,
'remark' => $remark, 'remark' => $remark,
'create_time' => time(),
'data_md5' => $dataMd5, 'data_md5' => $dataMd5,
'create_uid' => request()->user->userId,
'create_name' => request()->user->name,
]; ];
} }
$examineData = collect($examineData); $examineData = collect($examineData);
foreach ($examineData->chunk(50) as $chunk) { foreach ($examineData->chunk(50) as $chunk) {
SupplierExaminationModel::insert($chunk->toArray()); SupplierExaminationModel::insert($chunk->toArray());
} }
return true; return true;
}, $fileType); });
return true;
} catch (\Exception $exception) { } catch (\Exception $exception) {
return $exception->getMessage(); return $exception->getMessage();
} finally { } finally {
unlink($filePath); unlink($filePath);
} }
return true;
} }
private function checkImportCsvHeader($header) private function checkImportCsvHeader($header)
{ {
$header = array_map(function ($value) {
return trim($value, '*');
}, $header);
$validHeader = [ $validHeader = [
'销售订单号',
'采购订单号',
'检货时间', '检货时间',
'销售',
'采购员', '采购员',
'A/B单',
'供应商', '供应商',
'型号', '型号',
'品牌', '品牌',
'数量', '数量',
'检验数量', '批次',
'产地',
'入库日期',
'来货单号',
'送货单',
'理货要求',
'验货要求',
'不良数', '不良数',
'异常等级', '异常等级',
'不良现象', '不良现象',
'检验结果', '检验结果',
'处理方式',
'备注' '备注'
]; ];
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
namespace App\Http\Transformers; namespace App\Http\Transformers;
use App\Http\Services\DepartmentService;
use App\Model\SupplierChannelModel; use App\Model\SupplierChannelModel;
class SupplierExaminationTransformer class SupplierExaminationTransformer
...@@ -11,9 +12,14 @@ class SupplierExaminationTransformer ...@@ -11,9 +12,14 @@ class SupplierExaminationTransformer
public function transformList($list) public function transformList($list)
{ {
foreach ($list as &$item) { foreach ($list as &$item) {
$item['purchase_department'] = (new DepartmentService())->getDepartmentNameByUserName($item['purchase_name']);
$item['sales_department'] = $item['sales_name'] ? (new DepartmentService())->getDepartmentNameByUserName($item['sales_name']) : '';
$item['create_time'] = $item['create_time'] ? date('Y-m-d H:i:s', $item['create_time']) : ''; $item['create_time'] = $item['create_time'] ? date('Y-m-d H:i:s', $item['create_time']) : '';
$item['update_time'] = $item['update_time'] ? date('Y-m-d H:i:s', $item['update_time']) : ''; $item['update_time'] = $item['update_time'] ? date('Y-m-d H:i:s', $item['update_time']) : '';
$item['examine_time'] = $item['examine_time'] ? date('Y-m-d', $item['examine_time']) : ''; $item['examine_time'] = $item['examine_time'] ? date('Y-m-d', $item['examine_time']) : '';
$item['stock_in_date'] = $item['stock_in_date'] ? date('Y-m-d', $item['stock_in_date']) : '';
$item['abnormal_level'] = $item['abnormal_level'] ? array_get(config('field.SupplierAbnormalLevel'),
$item['abnormal_level']) : '';
} }
unset($item); unset($item);
return $list; return $list;
......
...@@ -22,12 +22,8 @@ class SupplierExaminationValidator ...@@ -22,12 +22,8 @@ class SupplierExaminationValidator
"sku_name" => "required", "sku_name" => "required",
"brand_name" => "required", "brand_name" => "required",
"amount" => "required|integer|min:1", "amount" => "required|integer|min:1",
"examine_amount" => "required|integer",
"unhealthy_amount" => "required|integer", "unhealthy_amount" => "required|integer",
"unhealthy_content" => "required",
"examine_result" => "required", "examine_result" => "required",
"abnormal_level" => "required",
"handle_way" => "required",
]; ];
$messages = $this->messages(); $messages = $this->messages();
$validator = Validator::make($params, $rules, $messages, $this->attributes()); $validator = Validator::make($params, $rules, $messages, $this->attributes());
...@@ -52,7 +48,7 @@ class SupplierExaminationValidator ...@@ -52,7 +48,7 @@ class SupplierExaminationValidator
{ {
return [ return [
'supplier_name' => '供应商名称', 'supplier_name' => '供应商名称',
'examine_time' => '检时间', 'examine_time' => '检时间',
'purchase_name' => '采购员', 'purchase_name' => '采购员',
'sku_name' => '型号', 'sku_name' => '型号',
'brand_name' => '品牌', 'brand_name' => '品牌',
......
...@@ -243,4 +243,10 @@ function makePassword($length) ...@@ -243,4 +243,10 @@ function makePassword($length)
$password .= $str[$keys[$i]]; $password .= $str[$keys[$i]];
} }
return $password; return $password;
} }
\ No newline at end of file
function isDateTime($dateTime){
$ret = strtotime($dateTime);
return $ret !== FALSE && $ret != -1;
}
...@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model; ...@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
//自营分类模型
class BrandModel extends Model class BrandModel extends Model
{ {
protected $connection = 'self'; protected $connection = 'self';
...@@ -63,19 +64,4 @@ class BrandModel extends Model ...@@ -63,19 +64,4 @@ class BrandModel extends Model
} }
return $brandList; return $brandList;
} }
public function getStandardBrandList()
{
$redis = new RedisModel();
$standardBrands = json_decode($redis->get('standard_brands_for_supplier'),true);
if (empty($standardBrands)) {
$standardBrandModel = new StandardBrandModel();
$standardBrands = $standardBrandModel->selectRaw('brand_name,standard_brand_id as brand_id')
->where('status', 1)->get()->toArray();
$redis->set('standard_brands_for_supplier', json_encode($standardBrands));
$redis->expire('standard_brands_for_supplier', 600);
}
return $standardBrands;
}
} }
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
//联营分类模型
class SpuBrandModel extends Model
{
protected $connection = 'spu';
protected $table='brand';
protected $primaryKey = 'brand_id';
public $timestamps = false;
}
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class StandardBrandMappingModel extends Model
{
protected $connection='spu';
protected $table='brand_standard_mapping';
public $timestamps = false;
}
...@@ -64,4 +64,10 @@ class SupplierChannelModel extends Model ...@@ -64,4 +64,10 @@ class SupplierChannelModel extends Model
{ {
return $this->hasMany(SupplierPayTypeModel::class, 'supplier_id', 'supplier_id'); return $this->hasMany(SupplierPayTypeModel::class, 'supplier_id', 'supplier_id');
} }
//获取正式供应商
public function getOfficialSuppliers()
{
return SupplierChannelModel::whereIn('is_type', 0)->get()->toArray();
}
} }
...@@ -6,7 +6,7 @@ namespace App\Presenters; ...@@ -6,7 +6,7 @@ namespace App\Presenters;
class DatePresenter class DatePresenter
{ {
public function render($name, $text, $value,$option = []) public function render($name, $text, $value, $option = [])
{ {
$isRequired = array_get($option, 'required', false); $isRequired = array_get($option, 'required', false);
$isDisable = array_get($option, 'disable') === true ? 'disabled' : ''; $isDisable = array_get($option, 'disable') === true ? 'disabled' : '';
...@@ -16,7 +16,7 @@ class DatePresenter ...@@ -16,7 +16,7 @@ class DatePresenter
$time = $value; $time = $value;
return <<<EOF return <<<EOF
<label class="layui-form-label"> $requiredHtml $text</label> <label class="layui-form-label"> $requiredHtml $text</label>
<div class="layui-input-inline"> <div class="layui-input-inline" style="margin-top: 0px">
<input type="text" id="$name" name="$name" <input type="text" id="$name" name="$name"
placeholder="请输入$text" placeholder="请输入$text"
class="layui-input $disableClass" $isDisable class="layui-input $disableClass" $isDisable
...@@ -24,13 +24,15 @@ class DatePresenter ...@@ -24,13 +24,15 @@ class DatePresenter
</div> </div>
<script> <script>
window.onload = function(){ window.onload = function(){
layui.use('laydate', function(){ layui.use(['laydate'], function(){
let laydate = layui.laydate; let laydate = layui.laydate;
laydate.render({ laydate.render({
elem: 'input[name=$name]' elem: 'input[name=$name]'
,type: 'date' ,type: 'date'
,format: 'yyyy-MM-dd' ,format: 'yyyy-MM-dd'
}); });
// $('input[name=$name]').removeAttr('lay-key');
}); });
} }
</script> </script>
......
...@@ -39,7 +39,7 @@ class TransformableTimeIntervalPresenter ...@@ -39,7 +39,7 @@ class TransformableTimeIntervalPresenter
dateInterval="$todayTimeInterval" dateInterval="$todayTimeInterval"
id="${unique}_today">今日</button> id="${unique}_today">今日</button>
</div> </div>
<div class="layui-col-md2"> <div class="layui-col-md2" id="three_days_button">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button" <button type="button" class="layui-btn layui-btn-primary layui-btn-sm day_type_button"
dateInterval="$threeDayTimeInterval" dateInterval="$threeDayTimeInterval"
id="${unique}_last_days">近三天</button> id="${unique}_last_days">近三天</button>
......
<?php
namespace App\Utils;
use PHPExcel_Cell;
use PHPExcel_Cell_DataType;
use PHPExcel_Cell_IValueBinder;
use PHPExcel_Cell_DefaultValueBinder;
class CsvValueBinder extends PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
{
public function bindValue(PHPExcel_Cell $cell, $value = null)
{
if (is_numeric($value)) {
$cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
return true;
}
return parent::bindValue($cell, $value);
}
}
\ No newline at end of file
...@@ -363,7 +363,7 @@ return array( ...@@ -363,7 +363,7 @@ return array(
| |
*/ */
'heading' => 'false', 'heading' => 'true',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
......
...@@ -191,5 +191,17 @@ return [ ...@@ -191,5 +191,17 @@ return [
2 => '处理中', 2 => '处理中',
3 => '执行上传完成', 3 => '执行上传完成',
4 => '其他失败', 4 => '其他失败',
],
'SupplierAbnormalLevel' => [
1 => '1 : (假货,贴牌,翻新,散新)',
2 => '2 : (氧化,划痕,歪角,丝印不清楚/磨字)',
3 => '3 : (来料错误,包装不良,无标签)',
],
'SupplierExamineResult' => [
'退货' => '退货',
'特批入库' => '特批入库',
'正常入库' => '正常入库',
] ]
]; ];
\ No newline at end of file
检货时间,采购员,供应商,型号,品牌,数量,检验数量,不良数,异常等级,不良现象,检验结果,处理方式,备注
检货时间,采购员,供应商,型号,品牌,数量,检验数量,不良数,异常等级,不良现象,检验结果,处理方式,备注
2020/8/28,张华,北京创易特科技有限公司,MIC2940A-12WU-TR ,MICROCHIP,3K,3K,,,标签不正常,疑是山寨货,,采购有原厂COC
2020/8/31,谭博利,Bentley Technologies,PM75CSA120,MITSUBISHI,2,2,,,使用过的擦磨旧货,,己跟采购说明,已出货。,
2020/8/31,马玉强,深圳市有芯电子有限公司,17-21/Y2C-AN1P2B/3T,亿光,3K,3K,,,标签不正常,,己跟采购说明,已出货。,
2020/9/1,邓小姣,深圳市铭盛微电子有限公司,MP6922DSE-LF-Z,MPS,2253,2253,标签不正常,,本体丝印格式错误且与标签信息不符,山寨货,退货,
2020/9/1,陈燕,深圳市长河世纪科技有限公司,LMDL301T1G,LRC,3K,3K,标签不正常,,本体丝印错误,山寨货,退货1,
2020/9/1,段灵芝,Integrated Electronics Company,IXBA14N300HV,IXYS,525,525,无原标签,,本体丝印不统一且与标签D/C不相符,重编带货,让步采用,
2020/9/17,汤浩升,深圳市亿威盛创科技有限公司,TS3USB221RSER,TI,800,800,无盘无标签,,反面有明显划痕,1136重新编带货,,
2020/9/21,陈泽彬,深圳市满多鑫电子有限公司,MTFC4GMDEA-4M IT,MICRON,12,12,无盘无标签,,反面有污迹少数球珠有伤痕个别球珠有氧化现象,重编带货,,
2020/10/19,邓小姣,深圳市沃德顺科电子科技有限公司,ADP151AUJZ-3.3,ADI,600,600,无盘无标签有盘标签照片,,丝印格式不正常,标签不正常,山寨货,退货,
2020/10/21,张佑辉,深圳市芯毅科技有限公司,MP3202DJ-LF-Z,MPS,"3,000",3000,3000,,标签不正常,本体丝印错误,山寨货,退货,
2020/11/3,马玉强,深圳市粤鑫朋电子有限公司,RT8272GSP,RICHTEK,60,6,6,,反面金属面及引脚有明显氧化现象,氧化货,退货,
2020/12/8,王秋,深圳市菱睿供应链管理有限公司,FQP13N50C,ON,2400,1000X8,2400,,包装盒标签不正确,本体丝印不正常。,山寨货,退货1,
2020/12/29,陈欢,深圳市联翔兴业电子有限公司,24LC512T-I/SN, MicroChip,3300,4,4,,包装盘袋标签均不正常,本体外形非MicroChip封装外形,山寨货,退货,
2020/12/30,汤浩升,深圳明嘉瑞科技有限公司,TL431AILPR,TI,2000,4,4,,本体信息与包装标签信息不一致且标签涂抹,山寨货,退货,
2021/1/4,廖长青,深圳市路泽半导体有限公司(顺乐),SG6742MRSY,ON,2500+1500,8,8,,本体信息与包装标签信息不一致,换盘换标签货,换货,
2021/1/5,张佑辉,深圳市汇联微电子有限公司,MSS6132-103MLC,COILCAFT,1500+300,4,4,,1500PCS整盘标签不正常且无负标签,山寨货,退货,
2021/1/8,陈欢,HongXin Technology Limited,RPI-221,ROHM,4000,4,4,,包装盒标签明显错误,本体无丝印,山寨货,退货,
2021/1/12,杨康,上海竹开电子科技有限公司,DS1302ZN-TR,MAX,510,4,4,,无盘无外包装无标签,本体外形不正常,此封装此系列无台湾产地,山寨货,建议退货,
2021/1/25,陈欢,深圳市纳立科技有限公司,LESD5Z12T1G,LRC,18K,4,4,,盘标签错误,本体丝印信息与标签信息不一致。,山寨货,建议退货,
2021/1/29,陈燕,深圳市潮光科技有限公司,SM712-02HTG,??LITTELFUSE,6K,4,4,,盘标签错误,本体丝印少定位点,山寨货,建议退货,
2021/2/1,陈燕,深圳市佰昇电子有限公司,MT41K128M16JT-125:K,MICRON,2K,6,6,,内外标签及包装均不正常,IC本体为磨面重打字,反面球珠平头和掉珠,旧翻新货,退货,
2021/2/2,陈海佳,深圳市福田区联信源经营部,PMEG3010EGWJ,NEXPERIA,120K,4,4,,盒标签错误,本体丝印不正常。,山寨货,建议退货,
2021/3/2,廖长青,北京京北通宇电子元件有限公司济南分公司,H5008NL,PULSE,705,3,3,,盘标签有低级的错误,山寨货,建议退货,
2021/3/8,陈燕,北京京北通宇电子元件有限公司济南分公司,P0353NLT,PULSE,403,3,3,,盘标签有低级的错误,山寨货,建议退货,
2021/3/10,陈海佳,深圳市成轩恒业电子科技有限公司,FDN306P,ON,3000,4,4,,盘标签不正常,本体D/C与标签D/C不一致,老D/C换标签货,建议退货,
2021/3/16,张佑辉,深圳市独角兽半导体有限公司,MP3202DJ-LF-Z,MPS,3000,4,4,,盘标签不正常,本体丝印不正确,山寨货,建议退货,
2021/3/17,段灵芝,北京京北通宇电子元件有限公司济南分公司,VLCF5020T-3R3N2R0-1,TDK,1000,4,4,,盘标签不正常,本体做功粗糙,山寨货,建议退货,
2021/3/24,陈海佳,深圳市福田区联信源经营部,BSH114,215,NEXPERIA,51K,4,4,,标签错误,本体外形不正常,山寨货,建议退货,
2021/3/29,王秋,?东莞一锋光电材料有限公司,FQD2N90TM,ON,10K,5,5,,包装及标签均不正常,D/C表示方法错误,山寨货,建议退货,
2021/4/9,夏继永,深圳禾靖贸易有限公司,CD74HC4514M,TI,650,4,5,,"本体丝印不正常:Logo非原品牌Logo,丝印信息错误",山寨货,建议退货,
2021/4/9,夏继永,深圳禾靖贸易有限公司,AD8346ARUZ,ADI,150,3,3,,本体非原面非原字非原引脚,旧翻新货,建议退货,
2021/4/14,陈欢,深圳庞田科技有限公司,STM8S208RBT6??,STM,1920,8,8,,本体非原面非原字非原引脚,磨面重新改丝印货,建议退货,
2021/6/3,韦诗相,深圳市特克电子技术有限公司,SN65HVD230QDRG4Q1,TI,5000,8,8,,标签有明显的错误,包装不正常,本体丝印信息与标签信息不一致,老D/C重编带换标签货,建议退货,
2021/6/4,韦诗相,上海贤泽电子科技有限公司,SPZT651T1G,ON,24K,12,12,,标签有明显的错误,本体丝印信息与标签信息不一致,山寨货,建议退货,
2021/6/7,王文娟,深圳市亿博创电子公司,TLC372CDR,TI,10K,4,4,,包装不正常,标签错误,本体外形不正常,本体信息与标签不一致。,山寨货,建议退货,
2021/6/17,刘域芳,深圳市天富盛电子有限公司,SM6T36CA,ST,40K,8,8,,包装不正常,标签错误,本体丝印字体不正常。,山寨货,建议退货,
2021/7/5,刘巍雄,武汉芯中心科技有限公司,TJA1021TK/20/C,NXP,100,4,4,,磨面打字,改丝印货,改丝印货,建议退货,
2021/7/9,刘巍雄,深圳市炬荣电子有限公司,PESD3V3L1UB,NXP,34000,6,6,,标签错误,本体外形不正常,山寨货,建议退货,
2021/7/14,韦燕,KST COMPONENTS LIMITED,NVTR01P02LT1G,ON,21000,10,10,,标签错误,本体信息与标签信息不一致,换盘换标签货,建议退货,
2021/7/23,刘巍雄,武汉芯中心科技有限公司,AO4616,AOS,520,4,4,,标签错误,本体外形及丝印字体不正常,山寨货,建议退货,
2021/7/27,邓小姣,深圳市展卓信电子有限公司 ,ADP7118WAUJZ-5.0-R7?,ADI,6K,6,6,,标签错误,本体外形不正常,山寨货,建议退货,
2021/7/28,陈欢,深圳纳立科技有限公司,DRV8702QRHBRQ1,TI,3K,10,10,,标签明显低级错误,本体正反面均有明显划痕,丝印不统一,散新重新编带打标签货,建议退货,
2021/8/2,刘巍雄,武汉蜜蜂微科技有限公司,AOZ1282CI,AOS,3K,4,4,,标签错误,本体外形及丝印均不正常,山寨货,建议退货,
2021/8/5,彭红超,深圳市深晔电子有限公司,SN65HVD72DR,TI,5K,6,6,,包装不正常,标签已涂抹,本体丝印信息与标签信息不一致。,山寨货,建议退货,
2021/8/24,张越,Zilex Electronics Inc,TS922AIDT,STM,2500,4,4,,标签完全错误,IC本体非原面非原字非原引脚,丝印错误,旧翻新货,建议退货,
,李妹,深圳市世芯电子有限公司,FSV10150V,ON,4000,4,4,,标签错误,料件本体丝印错误,字体也不正常,山寨货,建议退货,
,李妹,深圳市世芯电子有限公司,EGF1T-E3/67A,VISHAY,30000,6,6,,标签错误,料件本体外形不正常,山寨货,建议退货,
2021/9/10,邹琪,厦门翰科科技有限公司,STL130N6F7,STM,6000,6,6,,涂标,料件本体为磨面喷柒打字,旧引脚,磨面重新改丝印货,建议退货,
2021/9/10,邹琪,深圳市誉鼎科技有限公司,FSUSB42MUX,ON,10000,12,12,,标签错误,本体丝印信息与标签信息不一致,老D/C换盘换标签货,建议退货,
2021/9/13,彭红超,深圳市深晔电子有限公司,OPA2277UA/2K5,TI,2500,4,4,,标签错误,本体信息与标签信息不一致,山寨货,建议退货,
2021/9/16,张雪佳,深圳市卓美信电子科技有限公司,DMP2035U-7,DIODES,12000,8,8,,包装盘及标签均不正常,本体外形及丝印均不正常,山寨货,建议退货,
2021/9/16,易娜,深圳市成兴光电子科技有限公司,LPA675-N1P2-25-0-30-R33-Z,OSRAM,6000,6,6,,包装标签不正常,本体是无字的LED,山寨货,建议退货,
2021/9/17,彭红超,深圳市深晔电子有限公司,LM324MX/NOPB,TI,3150,4,4,,标签涂抹,料件本体外形及丝印字体均不正常,山寨货,建议退货,
检货时间,采购员,供应商,型号,品牌,数量,检验数量,不良数,异常等级,不良现象,检验结果,处理方式,备注 销售订单号,采购订单号,*检货时间,销售,*采购员,A/B单,*供应商,*型号,*品牌,*数量,批次,产地,入库日期,来货单号,送货单,理货要求,验货要求,*不良数,异常等级,不良现象,*检验结果,备注
销售订单号,采购订单号,*检货时间,销售,*采购员,A/B单,*供应商,*型号,*品牌,*数量,批次,产地,入库日期,来货单号,送货单,理货要求,验货要求,*不良数,异常等级,不良现象,*检验结果,备注
1202206066763110000,120220606676313000,2020/2/3,易敏,易敏,123,深圳市华之电科技有限公司,123,123,123,123,123,2020/2/3,123,123,123,123,123,1,特批入库,特批入库,123
<script> <script>
layui.use(['table', 'form', 'element', 'table', 'layer', 'admin', 'xmSelect'], function () { layui.use(['table', 'form', 'element', 'table', 'layer', 'admin', 'xmSelect','laydate'], function () {
let admin = layui.admin; let admin = layui.admin;
let form = layui.form; let form = layui.form;
let element = layui.element; let element = layui.element;
let laydate = layui.laydate;
let xmSelect = layui.xmSelect; let xmSelect = layui.xmSelect;
laydate.render({
elem: '#examine_time'
, type: 'date'
, format: 'yyyy-MM-dd'
});
laydate.render({
elem: '#stock_in_date'
, type: 'date'
, format: 'yyyy-MM-dd'
});
form.on('submit(addSupplierExamination)', function (data) { form.on('submit(addSupplierExamination)', function (data) {
layer.confirm('是否确认新增IQC检测资料?', function (index) { layer.confirm('是否确认新增IQC检测资料?', function (index) {
let url = '/api/supplier_examination/AddSupplierExamination'; let url = '/api/supplier_examination/AddSupplierExamination';
......
...@@ -74,10 +74,49 @@ ...@@ -74,10 +74,49 @@
let systemTagOption = getTagOption('system_tags_selector', 2); let systemTagOption = getTagOption('system_tags_selector', 2);
let tagSelector = xmSelect.render(systemTagOption); let tagSelector = xmSelect.render(systemTagOption);
let tagIds = $('#system_tags').attr('value');
tagSelector.setValue(tagIds.split(','));
//自定义标签 //自定义标签
$('#customer_tags').tagsInput({}); $('#customer_tags').tagsInput({});
//点击添加选择的供应商到待修改列表
$(document).on('click', '#addSupplierToList', function () {
let supplierCode = $('#supplier_selector').val();
if (!supplierCode) {
layer.msg('请先选择需要操作的供应商', {icon: 5});
return;
}
let suppliers = {!! json_encode($suppliers) !!};
let supplier = suppliers[supplierCode];
let selectedSupplierIds = $('#supplier_ids').val();
selectedSupplierIds = selectedSupplierIds ? selectedSupplierIds.split(',') : [];
if (jQuery.inArray(supplier['supplier_id'].toString(), selectedSupplierIds) === 0) {
layer.msg('列表已经有该供应商,请重新选择', {icon: 6});
return;
}
let appendHtml = `
<tr>
<td>${supplier['supplier_name']}</td>
<td>${supplier['system_tags']}</td>
<td>${supplier['customer_tags']}</td>
<td><button type="button" class="layui-btn layui-btn-xs deleteSupplier" value="${supplier['supplier_id']}">删除</button> </td>
</tr>
`;
selectedSupplierIds.push(supplier['supplier_id']);
$('#supplier_ids').val(selectedSupplierIds.join(','));
$('#operateSupplierList').append(appendHtml);
//清空
$('#supplier_selector').val('');
form.render();
});
$(document).on('click', '.deleteSupplier', function () {
let selectedSupplierIds = $('#supplier_ids').val();
let deleteSupplierId = $(this).attr('value');
selectedSupplierIds = selectedSupplierIds ? selectedSupplierIds.split(',') : [];
selectedSupplierIds.splice(jQuery.inArray(deleteSupplierId, selectedSupplierIds), 1);
$('#supplier_ids').val(selectedSupplierIds.join(','));
$(this).parents('tr').remove();
});
}); });
</script> </script>
\ No newline at end of file
...@@ -63,22 +63,34 @@ ...@@ -63,22 +63,34 @@
let cols = [ let cols = [
{type: 'checkbox'}, {type: 'checkbox'},
{field: 'id', title: 'ID', align: 'center', width: 80}, {field: 'id', title: 'ID', align: 'center', width: 80},
{field: 'order_sn', title: '销售订单号', align: 'center', width: 150},
{field: 'purchase_sn', title: '采购订单号', align: 'center', width: 160},
{ {
field: 'examine_time', title: '检货时间', align: 'center', width: 130 field: 'examine_time', title: '检货时间', align: 'center', width: 130
}, },
{field: 'sales_name', title: '销售', align: 'center', width: 100},
{field: 'sales_department', title: '销售部门', align: 'center', width: 100},
{field: 'purchase_name', title: '采购员', align: 'center', width: 100}, {field: 'purchase_name', title: '采购员', align: 'center', width: 100},
{field: 'purchase_department', title: '采购部门', align: 'center', width: 100},
{field: 'ticket_type', title: 'A/B单', align: 'center', width: 100},
{ {
field: 'supplier_name', title: '供应商', align: 'center', width: 200 field: 'supplier_name', title: '供应商', align: 'center', width: 200
}, },
{field: 'sku_name', title: '型号', align: 'center', width: 160}, {field: 'sku_name', title: '型号', align: 'center', width: 160},
{field: 'brand_name', title: '品牌', align: 'center', width: 160}, {field: 'brand_name', title: '品牌', align: 'center', width: 160},
{field: 'amount', title: '数量', align: 'center', width: 100}, {field: 'amount', title: '数量', align: 'center', width: 80},
{field: 'examine_amount', title: '检测数量', align: 'center', width: 100}, {field: 'batch', title: '批次', align: 'center', width: 80},
{field: 'unhealthy_amount', title: '不良数', align: 'center', width: 100}, {field: 'producing_area', title: '产地', align: 'center', width: 80},
{field: 'abnormal_level', title: '异常等级', align: 'center', width: 80}, {field: 'stock_in_date', title: '入库日期', align: 'center', width: 80},
{field: 'income_sn', title: '来货单号', align: 'center', width: 80},
{field: 'delivery_sn', title: '送货单', align: 'center', width: 80},
{field: 'tally_request', title: '理货要求', align: 'center', width: 80},
{field: 'examine_request', title: '验货要求', align: 'center', width: 100},
{field: 'unhealthy_amount', title: '不良数', align: 'center', width: 80},
{field: 'abnormal_level', title: '异常等级', align: 'center', width: 180},
{field: 'unhealthy_content', title: '不良现象', align: 'center', width: 150}, {field: 'unhealthy_content', title: '不良现象', align: 'center', width: 150},
{field: 'examine_result', title: '检验结果', align: 'center', width: 150}, {field: 'examine_result', title: '检验结果', align: 'center', width: 150},
{field: 'handle_way', title: '处理方式', align: 'center', width: 150},
{field: 'remark', title: '备注', align: 'center', width: 150}, {field: 'remark', title: '备注', align: 'center', width: 150},
]; ];
let currentPage = 0; let currentPage = 0;
...@@ -86,6 +98,9 @@ ...@@ -86,6 +98,9 @@
if (getQueryVariable('supplier_id')) { if (getQueryVariable('supplier_id')) {
url = '/api/supplier_examination/GetSupplierExaminationList?supplier_id=' + getQueryVariable('supplier_id'); url = '/api/supplier_examination/GetSupplierExaminationList?supplier_id=' + getQueryVariable('supplier_id');
} }
$('#three_days_button').remove();
table.render({ table.render({
elem: '#supplierExaminationList' elem: '#supplierExaminationList'
, url: url , url: url
...@@ -111,7 +126,7 @@ ...@@ -111,7 +126,7 @@
layer.open({ layer.open({
type: 2, type: 2,
content: '/supplier_examination/AddSupplierExamination?view=iframe&supplier_id=' + getQueryVariable('supplier_id'), content: '/supplier_examination/AddSupplierExamination?view=iframe&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'], area: ['80%', '90%'],
title: '添加IQC检测记录', title: '添加IQC检测记录',
end: function () { end: function () {
table.reload('supplierExaminationList'); table.reload('supplierExaminationList');
...@@ -134,7 +149,7 @@ ...@@ -134,7 +149,7 @@
layer.open({ layer.open({
type: 2, type: 2,
content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id + '&supplier_id=' + getQueryVariable('supplier_id'), content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id + '&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'], area: ['80%', '90%'],
title: '添加IQC检测记录', title: '添加IQC检测记录',
end: function () { end: function () {
table.reload('supplierExaminationList'); table.reload('supplierExaminationList');
...@@ -192,7 +207,7 @@ ...@@ -192,7 +207,7 @@
elem: '#import_supplier_examination', //绑定元素 elem: '#import_supplier_examination', //绑定元素
url: '/api/supplier_examination/ImportSupplierExamination', //上传接口 url: '/api/supplier_examination/ImportSupplierExamination', //上传接口
auto: true, auto: true,
exts: 'csv', exts: 'xlsx',
before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。 before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
layer.msg('上传中', {icon: 16}); //上传loading layer.msg('上传中', {icon: 16}); //上传loading
}, },
......
...@@ -587,22 +587,14 @@ ...@@ -587,22 +587,14 @@
//批量修改供应商标签 //批量修改供应商标签
$("#batch_add_tags").click(function () { $("#batch_add_tags").click(function () {
let checkStatus = table.checkStatus('list'); layer.open({
let data = checkStatus.data; type: 2,
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id); content: '/supplier_tag/BatchAddTag?view=iframe',
supplierIds = supplierIds.join(','); area: ['70%', '90%'],
if (!data.length) { title: '供应商标签添加',
layer.msg('请先选择要操作的供应商', {icon: 5}) end: function () {
} else { }
layer.open({ });
type: 2,
content: '/supplier_tag/BatchAddTag?view=iframe&supplier_ids=' + supplierIds,
area: ['70%', '90%'],
title: '供应商标签添加',
end: function () {
}
});
}
}); });
//设置SKU采购 //设置SKU采购
......
...@@ -192,9 +192,6 @@ ...@@ -192,9 +192,6 @@
//渲染主营品牌的多选 //渲染主营品牌的多选
function getBrandOption(element, brandType) { function getBrandOption(element, brandType) {
let brandUrl = '/api/common/getStandardBrandList';
let brandRes = ajax(brandUrl);
let brandList = brandRes.data;
return { return {
el: '#' + element, el: '#' + element,
filterable: true, filterable: true,
...@@ -207,17 +204,41 @@ ...@@ -207,17 +204,41 @@
name: 'brand_name', name: 'brand_name',
value: 'brand_id', value: 'brand_id',
}, },
remoteSearch: true,
pageRemote: true,
template({ item, sels, name, value }){
return item.brand_name + '<span style="position: absolute; right: 10px; color: #8799a3">'+ item.mapping_brand_names +'</span>'
},
filterMethod: function (val, item, index, prop) { filterMethod: function (val, item, index, prop) {
if (val.toLowerCase() === item.brand_name.toLowerCase()) {//把brand_name相同的搜索出来
return true;
}
return item.brand_name.toLowerCase().indexOf(val.toLowerCase()) === 0;
//不知道的就不管了
}, },
pageSize: 30, pageSize: 30,
data: brandList, remoteMethod: function (val, cb, show, pageIndex) {
on: function (brandList) { //val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
let arr = brandList.arr; $.ajax({
url: '/api/common/getStandardBrandList',
type: 'post',
data: {
brand_name: val,
page: pageIndex
},
dataType: 'json',
timeout: 10000,
success: function (res) {
console.log(res)
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.err_code === 0) {
cb(res.data, res.last_page);
} else {
layer.msg(res.err_msg, {icon: 6});
}
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
}
});
},
on: function (data) {
let arr = data.arr;
let brandIds = ''; let brandIds = '';
for (let i in arr) { for (let i in arr) {
brandIds += arr[i].brand_id + ','; brandIds += arr[i].brand_id + ',';
...@@ -231,7 +252,9 @@ ...@@ -231,7 +252,9 @@
let brandOption = getBrandOption('brand_selector', 2); let brandOption = getBrandOption('brand_selector', 2);
let brandSelector = xmSelect.render(brandOption); let brandSelector = xmSelect.render(brandOption);
let brandIds = $('#main_brands').attr('value'); let brandIds = $('#main_brands').attr('value');
brandSelector.setValue(brandIds.split(',')); let brandInitValue = {!! json_encode($brand_init_value?:[])!!};
console.log(brandInitValue);
brandSelector.setValue(brandInitValue);
//供应商标签的多选 //供应商标签的多选
function getTagOption(element) { function getTagOption(element) {
......
...@@ -11,8 +11,30 @@ ...@@ -11,8 +11,30 @@
<form class="layui-form" action="" autocomplete="off"> <form class="layui-form" action="" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
@inject('datePresenter','App\Presenters\DatePresenter') <label class="layui-form-label">销售订单号 : </label>
{!! $datePresenter->render('examine_time','检货时间 : ','',['required'=>true]) !!} <div class="layui-input-block">
<input type="text" name="order_sn" id="order_sn"
placeholder="请填写销售订单号" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">采购订单号 : </label>
<div class="layui-input-block">
<input type="text" name="purchase_sn" id="purchase_sn"
placeholder="请填写采购订单号" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<label class="layui-form-label">销售员 : </label>
<div class="layui-input-block">
<input type="text" name="sales_name" id="sales_name"
placeholder="请填写销售员" class="layui-input"
value="">
</div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
@if(empty($supplierName)) @if(empty($supplierName))
...@@ -31,6 +53,22 @@ ...@@ -31,6 +53,22 @@
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"> <span class="require">*</span> 检货时间 : </label>
<div class="layui-input-inline" style="margin-top: 0px">
<input type="text" id="examine_time" name="examine_time" placeholder="请输入检货时间 : " class="layui-input " value="">
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">A/B单 : </label>
<div class="layui-input-block">
<input type="text" name="ticket_type" id="ticket_type"
placeholder="请填写A/B单" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
@if(empty($supplierName)) @if(empty($supplierName))
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_name','供应商 : ','', {!! $statusPresenter->render('supplier_name','供应商 : ','',
...@@ -44,13 +82,14 @@ ...@@ -44,13 +82,14 @@
@endif @endif
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>数量 : </label> <label class="layui-form-label"><span class="require">*</span>型号 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="amount" id="amount" <input type="text" name="sku_name" id="sku_name"
placeholder="请填写数量(个)" class="layui-input" placeholder="请输入型号" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
...@@ -62,46 +101,84 @@ ...@@ -62,46 +101,84 @@
</div> </div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>型号 : </label> <label class="layui-form-label"><span class="require">*</span>数量 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="sku_name" id="sku_name" <input type="text" name="amount" id="amount"
placeholder="请输入型号" class="layui-input" placeholder="请填写数量(个)" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>检测数量 : </label> <label class="layui-form-label">批次 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="examine_amount" id="examine_amount" <input type="text" name="batch" id="batch"
placeholder="请填写检测数量(个)" class="layui-input" placeholder="请填写批次" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良数 : </label> <label class="layui-form-label">产地 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="unhealthy_amount" id="unhealthy_amount" <input type="text" name="producing_area" id="producing_area"
placeholder="请填写不良数(个)" class="layui-input" placeholder="请填写产地" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
{{-- <div class="layui-col-xs6">--}}
{{-- @inject('datePresenter','App\Presenters\DatePresenter')--}}
{{-- {!! $datePresenter->render('stock_in_date','入库日期 : ','') !!}--}}
{{-- </div>--}}
<div class="layui-col-xs6">
<label class="layui-form-label"> 入库日期 : </label>
<div class="layui-input-inline" style="margin-top: 0px">
<input type="text" id="stock_in_date" name="stock_in_date" placeholder="请输入入库日期 : " class="layui-input " value="">
</div>
</div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良现象 : </label> <label class="layui-form-label">来货单号 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="unhealthy_content" id="unhealthy_content" <input type="text" name="income_sn" id="income_sn"
placeholder="请填写不良现象" class="layui-input" placeholder="请填写来货单号" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>检验结果 : </label> <label class="layui-form-label">送货单 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="examine_result" id="examine_result" <input type="text" name="delivery_sn" id="delivery_sn"
placeholder="请填写检验结果" class="layui-input" placeholder="请填写送货单" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">理货要求 : </label>
<div class="layui-input-block">
<input type="text" name="tally_request" id="tally_request"
placeholder="请填写理货要求" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<label class="layui-form-label">验货要求 : </label>
<div class="layui-input-block">
<input type="text" name="examine_request" id="examine_request"
placeholder="请填写验货要求" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良数 : </label>
<div class="layui-input-block">
<input type="text" name="unhealthy_amount" id="unhealthy_amount"
placeholder="请填写不良数" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
...@@ -110,23 +187,30 @@ ...@@ -110,23 +187,30 @@
<div class="layui-col-xs6"> <div class="layui-col-xs6">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ','', {!! $statusPresenter->render('abnormal_level','异常等级 : ','',
[1=>1,2=>2,3=>3],['required'=>true]) !!} config('field.SupplierAbnormalLevel'),['width'=>'250px']) !!}
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>处理方式 : </label> <label class="layui-form-label">不良现象 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="handle_way" id="handle_way" <input type="text" name="unhealthy_content" id="unhealthy_content"
placeholder="请填写处理方式" class="layui-input" placeholder="请填写不良现象" class="layui-input"
value=""> value="">
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">备注说明 : </label> <div class="layui-col-xs6">
<div class="layui-input-block"> @inject('statusPresenter','App\Presenters\StatusPresenter')
<input type="text" name="remark" id="remark" {!! $statusPresenter->render('examine_result','检验结果 : ','',
placeholder="备注说明" class="layui-input" config('field.SupplierExamineResult'),['required'=>true]) !!}
value=""> </div>
<div class="layui-col-xs6">
<label class="layui-form-label">备注 : </label>
<div class="layui-input-block">
<input type="text" name="remark" id="remark"
placeholder="请填写备注" class="layui-input"
value="">
</div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
</style> </style>
<div class="layui-card"> <form class="layui-form" action="">
<div class="layui-card-header" style="height: 230px"> <div class="layui-card">
<blockquote class="layui-elem-quote layui-text"> <div class="layui-card-header" style="height: 230px">
<b>标签新增</b> <blockquote class="layui-elem-quote layui-text">
</blockquote> <b>标签新增</b>
<form class="layui-form" action=""> </blockquote>
<input type="hidden" name="supplier_ids" value="{{$supplierIds}}"> <input type="hidden" name="supplier_ids" id="supplier_ids">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block" style="margin-left: -30px"> <div class="layui-input-block" style="margin-left: -30px">
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="layui-input-block" style="margin-top: 15px"> <div class="layui-input-block" style="margin-top: 15px">
<div id="system_tags_selector" class="layui-input-inline" style="width: 100%;"> <div id="system_tags_selector" class="layui-input-inline" style="width: 100%;">
</div> </div>
<input type="hidden" name="system_tags" value="{{$supplier['system_tags'] or ''}}" <input type="hidden" name="system_tags"
id="system_tags"> id="system_tags">
</div> </div>
</div> </div>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<label class="layui-form-label"> <label class="layui-form-label">
自定义标签 : </label> 自定义标签 : </label>
<div class="layui-input-block" style="margin-top: 15px"> <div class="layui-input-block" style="margin-top: 15px">
<input name="customer_tags" id="customer_tags" value="{{$supplier['customer_tags'] or ''}}"> <input name="customer_tags" id="customer_tags">
</div> </div>
</div> </div>
</div> </div>
...@@ -41,34 +41,37 @@ ...@@ -41,34 +41,37 @@
</button> </button>
</div> </div>
</div> </div>
</form> </div>
</div> <div class="layui-card-body">
<div class="layui-card-body"> <blockquote class="layui-elem-quote layui-text">
<blockquote class="layui-elem-quote layui-text"> <b>选择需要新增标签的供应商</b>
<b>当前选中需要批量新增标签的供应商列表</b> </blockquote>
</blockquote> <div class="layui-row" style="margin-bottom: 12px">
<table class="layui-table"> @inject('statusPresenter','App\Presenters\StatusPresenter')
<colgroup> {!! $statusPresenter->render('supplier_selector','供应商选择 : ',null,
<col width="300"> $supplierCodes,['width'=> '500px']) !!}
<col width="400">
<col width="400"> <button type="button" class="layui-btn-sm layui-btn" style="margin-top: 5px;margin-left: 5px;" id="addSupplierToList">确认添加到操作列表</button>
</colgroup> </div>
<thead> <table class="layui-table">
<tr> <colgroup>
<th>供应商名称</th> <col width="300">
<th>系统标签</th> <col width="400">
<th>自定义标签</th> <col width="400">
</tr> <col width="200">
</thead> </colgroup>
<tbody> <thead>
@foreach($suppliers as $supplier)
<tr> <tr>
<td>{{$supplier['supplier_name']}}</td> <th>供应商名称</th>
<td>{{$supplier['system_tags']}}</td> <th>系统标签</th>
<td>{{$supplier['customer_tags']}}</td> <th>自定义标签</th>
<th>操作</th>
</tr> </tr>
@endforeach </thead>
</tbody> <tbody id="operateSupplierList">
</table>
</tbody>
</table>
</div>
</div> </div>
</div> </form>
...@@ -18,12 +18,16 @@ ...@@ -18,12 +18,16 @@
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级',request()->get('abnormal_level'),[1=>1,2=>2,3=>3]) !!} {!! $statusPresenter->render('abnormal_level','异常等级',request()->get('abnormal_level'),config('field.SupplierAbnormalLevel')) !!}
</div> </div>
<div class="layui-inline" style="width: 600px"> <div class="layui-inline" style="width: 600px">
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter') @inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['examine_time'=>'检货时间']) !!} {!! $transformableTimeIntervalPresenter->render(['examine_time'=>'检货时间']) !!}
</div> </div>
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('examine_result','检验结果',request()->get('status'),config('field.SupplierExamineResult')) !!}
</div>
</div> </div>
<div class="layui-row" style="margin-top:10px;margin-bottom: 10px;margin-left: 20px;"> <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="" <button class="layui-btn layui-btn-sm layui-btn load" id="getSupplierListButton" lay-submit=""
...@@ -48,7 +52,7 @@ ...@@ -48,7 +52,7 @@
@if(checkPerm('ImportSupplierExamination')) @if(checkPerm('ImportSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button> <button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button>
@endif @endif
<a href="/data/import_supplier_examination_template.csv" target="_blank" class="layui-btn layui-btn-sm" <a href="/data/import_supplier_examination_template.xlsx" target="_blank" class="layui-btn layui-btn-sm"
id="download_supplier_examination_import_template">下载模板</a> id="download_supplier_examination_import_template">下载模板</a>
@endif @endif
@if(checkPerm('DeleteSupplierExamination')) @if(checkPerm('DeleteSupplierExamination'))
......
...@@ -11,9 +11,30 @@ ...@@ -11,9 +11,30 @@
<form class="layui-form" action="" autocomplete="off"> <form class="layui-form" action="" autocomplete="off">
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<input type="hidden" name="id" value="{{$examination['id']}}"> <label class="layui-form-label">销售订单号 : </label>
@inject('datePresenter','App\Presenters\DatePresenter') <div class="layui-input-block">
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time'],['disable'=>true,'required'=>true]) !!} <input type="text" name="order_sn" id="order_sn"
placeholder="请填写销售订单号" class="layui-input layui-disabled"
value="{{$examination['order_sn'] or ''}}" disabled>
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">采购订单号 : </label>
<div class="layui-input-block">
<input type="text" name="purchase_sn" id="purchase_sn"
placeholder="请填写采购订单号" class="layui-input layui-disabled"
value="{{$examination['purchase_sn'] or ''}}" disabled>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<label class="layui-form-label">销售员 : </label>
<div class="layui-input-block">
<input type="text" name="sales_name" id="sales_name"
placeholder="请填写销售员" class="layui-input layui-disabled"
value="{{$examination['sales_name'] or ''}}" disabled>
</div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
@if(empty($supplierName)) @if(empty($supplierName))
...@@ -23,10 +44,26 @@ ...@@ -23,10 +44,26 @@
@else @else
<label class="layui-form-label"><span class="require">*</span>采购员 : </label> <label class="layui-form-label"><span class="require">*</span>采购员 : </label>
<div class="layui-input-block" style="padding-top: 7px"> <div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="purchase_name" value="{{$examination['purchase_name']}}"> <input type="hidden" name="purchase_name" value="{{request()->user->name}}" disabled>
{{$examination['purchase_name']}} {{request()->user->name}}
</div> </div>
@endif @endif
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<input type="hidden" name="id" value="{{$examination['id']}}" disabled>
@inject('datePresenter','App\Presenters\DatePresenter')
{!! $datePresenter->render('examine_time','检货时间 : ',$examination['examine_time'],['disable'=>true,'required'=>true,'disable'=>true]) !!}
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">A/B单 : </label>
<div class="layui-input-block">
<input type="text" name="ticket_type" id="ticket_type"
placeholder="请填写A/B单" class="layui-input layui-disabled"
value="{{$examination['ticket_type'] or ''}}" disabled>
</div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
...@@ -34,23 +71,24 @@ ...@@ -34,23 +71,24 @@
@if(empty($supplierName)) @if(empty($supplierName))
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_name','供应商 : ',$examination['supplier_name'], {!! $statusPresenter->render('supplier_name','供应商 : ',$examination['supplier_name'],
$supplierNames,['required'=>true,'width'=>'70%','disable'=>true]) !!} $supplierNames,['required'=>true,'disable'=>true,'width'=>'70%']) !!}
@else @else
<label class="layui-form-label"><span class="require">*</span>供应商 : </label> <label class="layui-form-label"><span class="require">*</span>供应商 : </label>
<div class="layui-input-block" style="padding-top: 7px"> <div class="layui-input-block" style="padding-top: 7px">
<input type="hidden" name="supplier_name" value="{{$examination['supplier_name']}}"> <input type="hidden" name="supplier_name" value="{{$supplierName}}" disabled>
{{$examination['supplier_name']}} {{$supplierName}}
</div> </div>
@endif @endif
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>数量 : </label> <label class="layui-form-label"><span class="require">*</span>型号 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="amount" id="amount" <input type="text" name="sku_name" id="sku_name"
placeholder="请填写数量(个)" class="layui-input layui-disabled" placeholder="请输入型号" class="layui-input layui-disabled"
value="{{$examination['amount'] or ''}}" disabled> value="{{$examination['sku_name'] or ''}}" disabled>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
...@@ -62,47 +100,79 @@ ...@@ -62,47 +100,79 @@
</div> </div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>型号 : </label> <label class="layui-form-label"><span class="require">*</span>数量 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="sku_name" id="sku_name" <input type="text" name="amount" id="amount"
placeholder="请输入型号" class="layui-input layui-disabled" placeholder="请填写数量(个)" class="layui-input layui-disabled"
value="{{$examination['sku_name'] or ''}}" disabled> value="{{$examination['amount'] or ''}}" disabled>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>检测数量 : </label> <label class="layui-form-label">批次 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="examine_amount" id="examine_amount" <input type="text" name="batch" id="batch"
placeholder="请填写检测数量(个)" class="layui-input layui-disabled" placeholder="请填写批次" class="layui-input layui-disabled"
value="{{$examination['examine_amount'] or ''}}" disabled> value="{{$examination['batch'] or ''}}" disabled>
</div> </div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良数 : </label> <label class="layui-form-label">产地 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="unhealthy_amount" id="unhealthy_amount" <input type="text" name="producing_area" id="producing_area"
placeholder="请填写不良数(个)" class="layui-input layui-disabled" placeholder="请填写产地(个)" class="layui-input layui-disabled"
value="{{$examination['unhealthy_amount'] or ''}}" disabled> value="{{$examination['producing_area'] or ''}}" disabled>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良现象 : </label> @inject('datePresenter','App\Presenters\DatePresenter')
{!! $datePresenter->render('stock_in_date','入库日期 : ',$examination['stock_in_date'],['disable'=>true]) !!}
</div>
<div class="layui-col-xs6">
<label class="layui-form-label">来货单号 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="unhealthy_content" id="unhealthy_content" <input type="text" name="income_sn" id="income_sn"
placeholder="请填写不良现象" class="layui-input layui-disabled" placeholder="请填写来货单号" class="layui-input layui-disabled"
value="{{$examination['unhealthy_content'] or ''}}" disabled> value="{{$examination['income_sn'] or ''}}" disabled>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<label class="layui-form-label">送货单 : </label>
<div class="layui-input-block">
<input type="text" name="delivery_sn" id="delivery_sn"
placeholder="请填写送货单" class="layui-input layui-disabled"
value="{{$examination['delivery_sn'] or ''}}" disabled>
</div> </div>
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>检验结果 : </label> <label class="layui-form-label">理货要求 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="examine_result" id="examine_result" <input type="text" name="tally_request" id="tally_request"
placeholder="请填写检验结果" class="layui-input layui-disabled" placeholder="请填写理货要求" class="layui-input layui-disabled"
value="{{$examination['examine_result'] or ''}}" disabled> value="{{$examination['tally_request'] or ''}}" disabled>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-xs6">
<label class="layui-form-label">验货要求 : </label>
<div class="layui-input-block">
<input type="text" name="examine_request" id="examine_request"
placeholder="请填写验货要求" class="layui-input layui-disabled"
value="{{$examination['examine_request'] or ''}}" disabled>
</div>
</div>
<div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>不良数 : </label>
<div class="layui-input-block">
<input type="text" name="unhealthy_amount" id="unhealthy_amount"
placeholder="请填写不良数" class="layui-input layui-disabled"
value="{{$examination['unhealthy_amount'] or ''}}" disabled>
</div> </div>
</div> </div>
</div> </div>
...@@ -110,23 +180,30 @@ ...@@ -110,23 +180,30 @@
<div class="layui-col-xs6"> <div class="layui-col-xs6">
@inject('statusPresenter','App\Presenters\StatusPresenter') @inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('abnormal_level','异常等级 : ',$examination['abnormal_level'], {!! $statusPresenter->render('abnormal_level','异常等级 : ',$examination['abnormal_level'],
[1=>1,2=>2,3=>3],['required'=>true]) !!} config('field.SupplierAbnormalLevel'),['width'=>'250px']) !!}
</div> </div>
<div class="layui-col-xs6"> <div class="layui-col-xs6">
<label class="layui-form-label"><span class="require">*</span>处理方式 : </label> <label class="layui-form-label">不良现象 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="handle_way" id="handle_way" <input type="text" name="unhealthy_content" id="unhealthy_content"
placeholder="请填写处理方式" class="layui-input layui-disabled" placeholder="请填写不良现象" class="layui-input layui-disabled"
value="{{$examination['handle_way'] or ''}}" disabled> value="{{$examination['unhealthy_content'] or ''}}" disabled>
</div> </div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">备注说明 : </label> <div class="layui-col-xs6">
<div class="layui-input-block"> @inject('statusPresenter','App\Presenters\StatusPresenter')
<input type="text" name="remark" id="remark" {!! $statusPresenter->render('examine_result','检验结果 : ',$examination['examine_result'],
placeholder="备注说明" class="layui-input layui-disabled" config('field.SupplierExamineResult'),['required'=>true,'disable'=>true]) !!}
value="{{$examination['remark'] or ''}}" disabled> </div>
<div class="layui-col-xs6">
<label class="layui-form-label">备注 : </label>
<div class="layui-input-block">
<input type="text" name="remark" id="remark"
placeholder="请填写备注" class="layui-input layui-disabled"
value="{{$examination['remark'] or ''}}" disabled>
</div>
</div> </div>
</div> </div>
<div class="layui-form-item"> <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