Commit 0bb747c5 by 杨树贤

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

parents fe60457a 2ef6ad04
Showing with 511 additions and 227 deletions
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Services\AdminUserService;
use App\Http\Services\CompanyService;
use App\Http\Services\StandardBrandService;
use App\Model\BrandModel;
use App\Model\StandardBrandModel;
use App\Model\SupplierChannelModel;
......@@ -35,9 +36,19 @@ class CommonApiController extends Controller
//获取标准品牌
public function getStandardBrandList($request)
{
$model = new BrandModel();
$brandList = $model->getStandardBrandList();
$this->response(0, 'ok', $brandList);
$list = (new StandardBrandService())->getStandardBrandList($request->all());
$data = array_get($list, 'data');
$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)
......
......@@ -31,18 +31,27 @@ class SupplierExaminationApiController extends Controller
public function AddSupplierExamination($request)
{
$params = $request->only([
'supplier_name',
'order_sn',
'purchase_sn',
'examine_time',
'sales_name',
'purchase_name',
'ticket_type',
'supplier_name',
'sku_name',
'brand_name',
'amount',
'examine_amount',
'batch',
'producing_area',
'stock_in_date',
'income_sn',
'delivery_sn',
'tally_request',
'examine_request',
'unhealthy_amount',
'abnormal_level',
'unhealthy_content',
'examine_result',
'abnormal_level',
'handle_way',
'remark',
]);
$validator = new SupplierExaminationValidator();
......@@ -63,18 +72,27 @@ class SupplierExaminationApiController extends Controller
{
$params = $request->only([
'id',
'supplier_name',
'order_sn',
'purchase_sn',
'examine_time',
'sales_name',
'purchase_name',
'ticket_type',
'supplier_name',
'sku_name',
'brand_name',
'amount',
'examine_amount',
'batch',
'producing_area',
'stock_in_date',
'income_sn',
'delivery_sn',
'tally_request',
'examine_request',
'unhealthy_amount',
'abnormal_level',
'unhealthy_content',
'examine_result',
'abnormal_level',
'handle_way',
'remark',
]);
$validator = new SupplierExaminationValidator();
......@@ -111,7 +129,7 @@ class SupplierExaminationApiController extends Controller
if ($file->isValid()) {
$ext = $file->getClientOriginalExtension();
$realPath = $file->getRealPath();
if ($ext != 'csv') {
if ($ext != 'xlsx') {
$this->response(-1, '上传格式错误');
}
// 上传文件
......
......@@ -54,6 +54,11 @@ class SupplierExaminationFilter
$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'])) {
$query->where('abnormal_level', $map['abnormal_level']);
}
......
......@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Http\Services\LogService;
use App\Http\Services\RegionService;
use App\Http\Services\SkuUploadLogService;
use App\Http\Services\StandardBrandService;
use App\Http\Services\SupplierAttachmentService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierShareApplyService;
......@@ -76,7 +77,7 @@ class SupplierController extends Controller
}
$this->data['statusData'] = $statusData;
$stockupTypeData = [];
foreach (config('fixed.StockupType') as $key=>$value) {
foreach (config('fixed.StockupType') as $key => $value) {
$stockupTypeData[] = [
'name' => $value,
'value' => $key,
......@@ -84,7 +85,7 @@ class SupplierController extends Controller
}
$this->data['stockupTypeData'] = $stockupTypeData;
$levelData = [];
foreach (config('field.LevelMap') as $key=>$value) {
foreach (config('field.LevelMap') as $key => $value) {
$levelData[] = [
'name' => $value,
'value' => $key,
......@@ -92,7 +93,7 @@ class SupplierController extends Controller
}
$this->data['levelData'] = $levelData;
$supplierTypeData = [];
foreach (config('field.SupplierType') as $key=>$value) {
foreach (config('field.SupplierType') as $key => $value) {
$supplierTypeData[] = [
'name' => $value,
'value' => $key,
......@@ -155,6 +156,7 @@ class SupplierController extends Controller
//省市区数据放到script模板
$regionService = new RegionService();
$this->data['region_data'] = $regionService->getCityRegionData();
$this->data['brand_init_value'] = [];
//编辑
if (!empty($supplierId)) {
$this->data['title'] = '编辑供应商';
......@@ -215,6 +217,7 @@ class SupplierController extends Controller
$this->data['ignore_supplier_type_change_tips'] = in_array($supplier['supplier_name'],
config('field.SkipChangeSupplierTypeNames'));
$this->data['sku_upload_log_count'] = (new SkuUploadLogService())->getSkuUploadLogCount($supplierId);
$this->data['brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
return $this->view('编辑供应商');
}
......
......@@ -81,7 +81,7 @@ class SupplierExaminationController extends Controller
$this->data['supplierName'] = $supplierName;
}
//获取所有采购员提供选择
$purchaseUsers = (new IntracodeModel())->getEncode();
$purchaseUsers = (new IntracodeModel())->getAllEncode();
$purchaseUserNames = collect($purchaseUsers)->pluck('name', 'name')->toArray();
$this->data['purchaseUserNames'] = $purchaseUserNames;
$this->data['supplierNames'] = (new SupplierChannelModel())->where('is_type',0)
......
......@@ -44,14 +44,22 @@ class SupplierTagController extends Controller
//供应商详情
public function BatchAddTag($request)
{
$supplierIds = $request->get('supplier_ids');
$this->data['supplierIds'] = $supplierIds;
$supplierIds = explode(',', $supplierIds);
$model = new SupplierChannelModel();
$suppliers = $model->whereIn('supplier_id', $supplierIds)->get()->toArray();
$transformer = new SupplierTransformer();
$suppliers = $transformer->transformList($suppliers);
$suppliers = (new SupplierChannelModel())->where('is_type', 0)
->select([
'supplier_id',
'supplier_code',
'system_tags',
'customer_tags',
'supplier_name',
])->get();
$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'] = '批量修改供应商编码';
return $this->view('批量修改供应商编码');
}
......
......@@ -112,4 +112,12 @@ class DepartmentService
}
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
......@@ -4,6 +4,7 @@
namespace App\Http\Transformers;
use App\Http\Services\DepartmentService;
use App\Model\SupplierChannelModel;
class SupplierExaminationTransformer
......@@ -11,9 +12,14 @@ class SupplierExaminationTransformer
public function transformList($list)
{
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['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['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);
return $list;
......
......@@ -22,12 +22,8 @@ class SupplierExaminationValidator
"sku_name" => "required",
"brand_name" => "required",
"amount" => "required|integer|min:1",
"examine_amount" => "required|integer",
"unhealthy_amount" => "required|integer",
"unhealthy_content" => "required",
"examine_result" => "required",
"abnormal_level" => "required",
"handle_way" => "required",
];
$messages = $this->messages();
$validator = Validator::make($params, $rules, $messages, $this->attributes());
......@@ -52,7 +48,7 @@ class SupplierExaminationValidator
{
return [
'supplier_name' => '供应商名称',
'examine_time' => '检时间',
'examine_time' => '检时间',
'purchase_name' => '采购员',
'sku_name' => '型号',
'brand_name' => '品牌',
......
......@@ -243,4 +243,10 @@ function makePassword($length)
$password .= $str[$keys[$i]];
}
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;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
//自营分类模型
class BrandModel extends Model
{
protected $connection = 'self';
......@@ -63,19 +64,4 @@ class BrandModel extends Model
}
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
{
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;
class DatePresenter
{
public function render($name, $text, $value,$option = [])
public function render($name, $text, $value, $option = [])
{
$isRequired = array_get($option, 'required', false);
$isDisable = array_get($option, 'disable') === true ? 'disabled' : '';
......@@ -16,7 +16,7 @@ class DatePresenter
$time = $value;
return <<<EOF
<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"
placeholder="请输入$text"
class="layui-input $disableClass" $isDisable
......@@ -24,13 +24,15 @@ class DatePresenter
</div>
<script>
window.onload = function(){
layui.use('laydate', function(){
layui.use(['laydate'], function(){
let laydate = layui.laydate;
laydate.render({
elem: 'input[name=$name]'
,type: 'date'
,format: 'yyyy-MM-dd'
});
// $('input[name=$name]').removeAttr('lay-key');
});
}
</script>
......
......@@ -39,7 +39,7 @@ class TransformableTimeIntervalPresenter
dateInterval="$todayTimeInterval"
id="${unique}_today">今日</button>
</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"
dateInterval="$threeDayTimeInterval"
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(
|
*/
'heading' => 'false',
'heading' => 'true',
/*
|--------------------------------------------------------------------------
......
......@@ -191,5 +191,17 @@ return [
2 => '处理中',
3 => '执行上传完成',
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>
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 form = layui.form;
let element = layui.element;
let laydate = layui.laydate;
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) {
layer.confirm('是否确认新增IQC检测资料?', function (index) {
let url = '/api/supplier_examination/AddSupplierExamination';
......
......@@ -74,10 +74,49 @@
let systemTagOption = getTagOption('system_tags_selector', 2);
let tagSelector = xmSelect.render(systemTagOption);
let tagIds = $('#system_tags').attr('value');
tagSelector.setValue(tagIds.split(','));
//自定义标签
$('#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>
\ No newline at end of file
......@@ -63,22 +63,34 @@
let cols = [
{type: 'checkbox'},
{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: '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_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: 'sku_name', title: '型号', align: 'center', width: 160},
{field: 'brand_name', title: '品牌', align: 'center', width: 160},
{field: 'amount', title: '数量', align: 'center', width: 100},
{field: 'examine_amount', title: '检测数量', align: 'center', width: 100},
{field: 'unhealthy_amount', title: '不良数', align: 'center', width: 100},
{field: 'abnormal_level', title: '异常等级', align: 'center', width: 80},
{field: 'amount', title: '数量', align: 'center', width: 80},
{field: 'batch', title: '批次', align: 'center', width: 80},
{field: 'producing_area', 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: 'examine_result', title: '检验结果', align: 'center', width: 150},
{field: 'handle_way', title: '处理方式', align: 'center', width: 150},
{field: 'remark', title: '备注', align: 'center', width: 150},
];
let currentPage = 0;
......@@ -86,6 +98,9 @@
if (getQueryVariable('supplier_id')) {
url = '/api/supplier_examination/GetSupplierExaminationList?supplier_id=' + getQueryVariable('supplier_id');
}
$('#three_days_button').remove();
table.render({
elem: '#supplierExaminationList'
, url: url
......@@ -111,7 +126,7 @@
layer.open({
type: 2,
content: '/supplier_examination/AddSupplierExamination?view=iframe&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'],
area: ['80%', '90%'],
title: '添加IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
......@@ -134,7 +149,7 @@
layer.open({
type: 2,
content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id + '&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '70%'],
area: ['80%', '90%'],
title: '添加IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
......@@ -192,7 +207,7 @@
elem: '#import_supplier_examination', //绑定元素
url: '/api/supplier_examination/ImportSupplierExamination', //上传接口
auto: true,
exts: 'csv',
exts: 'xlsx',
before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
layer.msg('上传中', {icon: 16}); //上传loading
},
......
......@@ -587,22 +587,14 @@
//批量修改供应商标签
$("#batch_add_tags").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id);
supplierIds = supplierIds.join(',');
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
layer.open({
type: 2,
content: '/supplier_tag/BatchAddTag?view=iframe&supplier_ids=' + supplierIds,
area: ['70%', '90%'],
title: '供应商标签添加',
end: function () {
}
});
}
layer.open({
type: 2,
content: '/supplier_tag/BatchAddTag?view=iframe',
area: ['70%', '90%'],
title: '供应商标签添加',
end: function () {
}
});
});
//设置SKU采购
......
......@@ -192,9 +192,6 @@
//渲染主营品牌的多选
function getBrandOption(element, brandType) {
let brandUrl = '/api/common/getStandardBrandList';
let brandRes = ajax(brandUrl);
let brandList = brandRes.data;
return {
el: '#' + element,
filterable: true,
......@@ -207,17 +204,41 @@
name: 'brand_name',
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) {
if (val.toLowerCase() === item.brand_name.toLowerCase()) {//把brand_name相同的搜索出来
return true;
}
return item.brand_name.toLowerCase().indexOf(val.toLowerCase()) === 0;
//不知道的就不管了
},
pageSize: 30,
data: brandList,
on: function (brandList) {
let arr = brandList.arr;
remoteMethod: function (val, cb, show, pageIndex) {
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$.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 = '';
for (let i in arr) {
brandIds += arr[i].brand_id + ',';
......@@ -231,7 +252,9 @@
let brandOption = getBrandOption('brand_selector', 2);
let brandSelector = xmSelect.render(brandOption);
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) {
......
......@@ -3,13 +3,13 @@
margin-bottom: 5px;
}
</style>
<div class="layui-card">
<div class="layui-card-header" style="height: 230px">
<blockquote class="layui-elem-quote layui-text">
<b>标签新增</b>
</blockquote>
<form class="layui-form" action="">
<input type="hidden" name="supplier_ids" value="{{$supplierIds}}">
<form class="layui-form" action="">
<div class="layui-card">
<div class="layui-card-header" style="height: 230px">
<blockquote class="layui-elem-quote layui-text">
<b>标签新增</b>
</blockquote>
<input type="hidden" name="supplier_ids" id="supplier_ids">
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left: -30px">
<div class="layui-form-item">
......@@ -18,7 +18,7 @@
<div class="layui-input-block" style="margin-top: 15px">
<div id="system_tags_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="system_tags" value="{{$supplier['system_tags'] or ''}}"
<input type="hidden" name="system_tags"
id="system_tags">
</div>
</div>
......@@ -26,7 +26,7 @@
<label class="layui-form-label">
自定义标签 : </label>
<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>
......@@ -41,34 +41,37 @@
</button>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<blockquote class="layui-elem-quote layui-text">
<b>当前选中需要批量新增标签的供应商列表</b>
</blockquote>
<table class="layui-table">
<colgroup>
<col width="300">
<col width="400">
<col width="400">
</colgroup>
<thead>
<tr>
<th>供应商名称</th>
<th>系统标签</th>
<th>自定义标签</th>
</tr>
</thead>
<tbody>
@foreach($suppliers as $supplier)
</div>
<div class="layui-card-body">
<blockquote class="layui-elem-quote layui-text">
<b>选择需要新增标签的供应商</b>
</blockquote>
<div class="layui-row" style="margin-bottom: 12px">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('supplier_selector','供应商选择 : ',null,
$supplierCodes,['width'=> '500px']) !!}
<button type="button" class="layui-btn-sm layui-btn" style="margin-top: 5px;margin-left: 5px;" id="addSupplierToList">确认添加到操作列表</button>
</div>
<table class="layui-table">
<colgroup>
<col width="300">
<col width="400">
<col width="400">
<col width="200">
</colgroup>
<thead>
<tr>
<td>{{$supplier['supplier_name']}}</td>
<td>{{$supplier['system_tags']}}</td>
<td>{{$supplier['customer_tags']}}</td>
<th>供应商名称</th>
<th>系统标签</th>
<th>自定义标签</th>
<th>操作</th>
</tr>
@endforeach
</tbody>
</table>
</thead>
<tbody id="operateSupplierList">
</tbody>
</table>
</div>
</div>
</div>
</form>
......@@ -18,12 +18,16 @@
</div>
<div class="layui-inline">
@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 class="layui-inline" style="width: 600px">
@inject('transformableTimeIntervalPresenter','App\Presenters\Filter\TransformableTimeIntervalPresenter')
{!! $transformableTimeIntervalPresenter->render(['examine_time'=>'检货时间']) !!}
</div>
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('examine_result','检验结果',request()->get('status'),config('field.SupplierExamineResult')) !!}
</div>
</div>
<div class="layui-row" style="margin-top:10px;margin-bottom: 10px;margin-left: 20px;">
<button class="layui-btn layui-btn-sm layui-btn load" id="getSupplierListButton" lay-submit=""
......@@ -48,7 +52,7 @@
@if(checkPerm('ImportSupplierExamination'))
<button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button>
@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>
@endif
@if(checkPerm('DeleteSupplierExamination'))
......
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