Commit b2c338f3 by 杨树贤

供应商0.5

parent 91567bc6
...@@ -5,3 +5,4 @@ Homestead.json ...@@ -5,3 +5,4 @@ Homestead.json
/.idea /.idea
/.vscode /.vscode
/.history /.history
/vendor/_laravel_idea
...@@ -80,7 +80,8 @@ class SupplierApiController extends Controller ...@@ -80,7 +80,8 @@ class SupplierApiController extends Controller
//付款方式 //付款方式
'pay_type', 'pay_type',
'pay_type_value', 'pay_type_value',
'pay_type_extra' 'pay_type_extra',
'supplier_type'
]; ];
public function Entrance(Request $request, $id) public function Entrance(Request $request, $id)
...@@ -152,9 +153,6 @@ class SupplierApiController extends Controller ...@@ -152,9 +153,6 @@ class SupplierApiController extends Controller
$list = $query->paginate($limit)->toArray(); $list = $query->paginate($limit)->toArray();
$transformer = new SupplierTransformer(); $transformer = new SupplierTransformer();
$list['data'] = $transformer->transformList($list['data']); $list['data'] = $transformer->transformList($list['data']);
if (env('LOGIN_DOMAIN') == 'user.liexin.net') {
// $list['total'] = $list['total'] > 50 ? 50 : $list['total'];
}
$this->response(0, 'ok', $list['data'], $list['total']); $this->response(0, 'ok', $list['data'], $list['total']);
} }
...@@ -491,10 +489,23 @@ class SupplierApiController extends Controller ...@@ -491,10 +489,23 @@ class SupplierApiController extends Controller
//批量申请审核供应商 //批量申请审核供应商
public function BatchApplyInReviewSupplier($request) public function BatchApplyInReviewSupplier($request)
{ {
$supplierIds = $request->get('supplier_ids'); $supplierIds = $request->get('supplier_id');
$supplierIds = explode(',', $supplierIds); $supplierTypeList = $request->get('supplier_type');
$applyAuditReasonList = $request->get('apply_audit_reason');
$auditData = [];
foreach ($supplierIds as $key => $supplierId) {
$supplierType = array_get($supplierTypeList, $key);
$reason = array_get($applyAuditReasonList, $key);
if ($supplierType == SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY && !$reason) {
$this->response(-1, '临时类型的供应商申请审核必须填写申请原因');
}
$auditData[] = [
'supplier_id' => $supplierId,
'apply_audit_reason' => $reason,
];
}
$supplierService = new SupplierService(); $supplierService = new SupplierService();
$supplierService->batchApplyInReviewSupplier($supplierIds); $supplierService->batchApplyInReviewSupplier($auditData);
$this->response(0, '申请审核成功'); $this->response(0, '申请审核成功');
} }
......
...@@ -51,7 +51,7 @@ class SupplierFilter ...@@ -51,7 +51,7 @@ class SupplierFilter
$adminId = $user['userId']; $adminId = $user['userId'];
$query->where('create_uid', $adminId); $query->where('create_uid', $adminId);
} }
if (!empty($map['status'])) { if ((isset($map['status']) && $map['status'] === "0") || !empty($map['status'])) {
$query->where('status', $map['status']); $query->where('status', $map['status']);
} }
...@@ -254,7 +254,7 @@ class SupplierFilter ...@@ -254,7 +254,7 @@ class SupplierFilter
}); });
$query->whereNotIn('status', $query->whereNotIn('status',
[SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK]); [SupplierChannelModel::STATUS_DISABLE, SupplierChannelModel::STATUS_BLOCK]);
//而且还是贸易商类型的供应商 //而且还是现货商类型的供应商
$query->where('supplier_group', 2); $query->where('supplier_group', 2);
break; break;
//联系人待完善 //联系人待完善
......
...@@ -2,11 +2,6 @@ ...@@ -2,11 +2,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Model\ApplyExamineUserModel;
use App\Model\ApplyModel;
use App\Model\DingTalk;
use App\Model\UserInfoModel;
use Common\Model\RedisModel;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use DB; use DB;
......
...@@ -216,7 +216,7 @@ class DataService ...@@ -216,7 +216,7 @@ class DataService
} }
//给特定类型的供应商打上标签 //给特定类型的供应商打上标签
//找出 国内/港台 + 贸易商性质的,而且没有上传品质协议的供应商,自动打上临时供应商标签 //找出 国内/港台 + 现货商性质的,而且没有上传品质协议的供应商,自动打上临时供应商标签
public function makeSupplierSystemTag() public function makeSupplierSystemTag()
{ {
$channelModel = new SupplierChannelModel(); $channelModel = new SupplierChannelModel();
...@@ -240,6 +240,48 @@ class DataService ...@@ -240,6 +240,48 @@ class DataService
} }
} }
//打上历史检测异常标签
public function makeSupplierSystemTagAbnormal()
{
ini_set('memory_limit', '-1');
$channelModel = new SupplierChannelModel();
//读取excel
$filePath = public_path('data') . DIRECTORY_SEPARATOR . 'abnormal_supplier.xlsx';
$suppliers = [];
try {
Excel::selectSheetsByIndex(0)->load($filePath, function ($reader) {
$reader->sheet('Sheet1', function () use ($reader) {
$supplierModel = new SupplierChannelModel();
foreach ($reader->all()->toArray() as $key => $item) {
$supplierName = trim($item[0]);
if (empty($supplierName)) {
continue;
}
$supplier = $supplierModel->where('supplier_name',$supplierName)->first();
if (!empty($supplier)) {
$suppliers[] = $supplier->toArray();
}
}
$tagService = new SupplierTagService();
//找到后打上标签
foreach ($suppliers as $supplier) {
$supplierId = $supplier['supplier_id'];
$oldTags = $supplier['system_tags'];
$newTags = $supplier['system_tags'] ? rtrim($supplier['system_tags'], ',') . ',历史检测异常' : '历史检测异常';
if ($tagService->saveTags($supplierId, 14, $newTags, $oldTags)) {
$supplierModel->where('supplier_id', $supplierId)->update([
'system_tags' => $newTags
]);
}
}
});
});
} catch (\Exception $exception) {
dd($exception);
}
}
//初始化供应商对应的搜索标签到redis //初始化供应商对应的搜索标签到redis
public function initSupplierSearchTags() public function initSupplierSearchTags()
{ {
......
...@@ -182,6 +182,11 @@ class SupplierAuditService ...@@ -182,6 +182,11 @@ class SupplierAuditService
'credit_investigation', 'credit_investigation',
'system_tags', 'system_tags',
'customer_tags', 'customer_tags',
'sku_tag',
'sku_tag',
'sku_tag',
'sku_upload_ruler',
'sku_audit_ruler',
]; ];
//先找出目前数据库里面的数据 //先找出目前数据库里面的数据
$selectField = array_keys($channel); $selectField = array_keys($channel);
......
...@@ -65,6 +65,7 @@ class SupplierService ...@@ -65,6 +65,7 @@ class SupplierService
} }
//走事务 //走事务
$dataResult = DB::connection('web')->transaction(function () use ($channel, $model, $oldSupplier) { $dataResult = DB::connection('web')->transaction(function () use ($channel, $model, $oldSupplier) {
$tagService = new SupplierTagService();
//获取和非主表有关的数据 //获取和非主表有关的数据
$extraFax = [ $extraFax = [
'supplier_id' => $channel['supplier_id'], 'supplier_id' => $channel['supplier_id'],
...@@ -90,6 +91,7 @@ class SupplierService ...@@ -90,6 +91,7 @@ class SupplierService
$skuAuditRulerService = new SupplierSkuAuditRulerService(); $skuAuditRulerService = new SupplierSkuAuditRulerService();
$channel['sku_audit_ruler'] = $skuAuditRulerService->getSkuAuditRulerForDB($channel['sku_audit_ruler']); $channel['sku_audit_ruler'] = $skuAuditRulerService->getSkuAuditRulerForDB($channel['sku_audit_ruler']);
$channel['pay_type'] = SupplierPayTypeService::getSupplierPayTypeForChannelDB($payTypeData); $channel['pay_type'] = SupplierPayTypeService::getSupplierPayTypeForChannelDB($payTypeData);
//新增供应商操作 //新增供应商操作
if (empty($channel['supplier_id'])) { if (empty($channel['supplier_id'])) {
//先去插入到channel表 //先去插入到channel表
...@@ -134,6 +136,11 @@ class SupplierService ...@@ -134,6 +136,11 @@ class SupplierService
$contactModel = new SupplierContactModel(); $contactModel = new SupplierContactModel();
$contactModel->insert($contact); $contactModel->insert($contact);
//如果是临时供应商,要打上临时供应商的标签
if ($channel['supplier_type'] == SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY) {
$tagService->saveTags($supplierId, SupplierTagService::TAG_TYPE_SYSTEM, '临时供应商',
'');
}
//保存生成的内部编码 //保存生成的内部编码
$this->saveSupplierCode($supplierId); $this->saveSupplierCode($supplierId);
//新增的时候也要去添加地址了 //新增的时候也要去添加地址了
...@@ -148,7 +155,25 @@ class SupplierService ...@@ -148,7 +155,25 @@ class SupplierService
$channel['status'] = SupplierChannelModel::STATUS_PENDING; $channel['status'] = SupplierChannelModel::STATUS_PENDING;
} }
$channel['update_time'] = time(); $channel['update_time'] = time();
//这里有个逻辑,就是如果供应商类型是临时,那么要打上临时供应商的标签,如果不是,那么就要去掉这个标签
if ($channel['supplier_type'] == SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY) {
$channel['system_tags'] = explode(',' , $channel['system_tags']);
if (!in_array('临时供应商',$channel['system_tags'])) {
$channel['system_tags'][] = '临时供应商';
}
} else {
$channel['system_tags'] = explode(',' , $channel['system_tags']);
foreach ($channel['system_tags'] as $key=>$tag) {
if ($tag == '临时供应商') {
unset($channel['system_tags'][$key]);
}
}
}
$channel['system_tags'] = trim(implode(',', $channel['system_tags']),',');
$model->where('supplier_id', $supplierId)->update($channel); $model->where('supplier_id', $supplierId)->update($channel);
//保存地址
$supplierAddressService = new SupplierAddressService(); $supplierAddressService = new SupplierAddressService();
$supplierAddressService->saveAddress($address); $supplierAddressService->saveAddress($address);
//保存附加费 //保存附加费
...@@ -164,9 +189,10 @@ class SupplierService ...@@ -164,9 +189,10 @@ class SupplierService
//保存标签到标签系统 //保存标签到标签系统
$oldCustomerTags = array_get($oldSupplier, 'customer_tags'); $oldCustomerTags = array_get($oldSupplier, 'customer_tags');
$oldSystemTags = array_get($oldSupplier, 'system_tags'); $oldSystemTags = array_get($oldSupplier, 'system_tags');
$tagService = new SupplierTagService(); $tagService->saveTags($supplierId, SupplierTagService::TAG_TYPE_SYSTEM, $channel['system_tags'],
$tagService->saveTags($supplierId, 14, $channel['system_tags'], $oldSystemTags); $oldSystemTags);
$tagService->saveTags($supplierId, 4, $channel['customer_tags'], $oldCustomerTags); $tagService->saveTags($supplierId, SupplierTagService::TAG_TYPE_CUSTOMER, $channel['customer_tags'],
$oldCustomerTags);
} }
//保存付款方式列表 //保存付款方式列表
SupplierPayTypeService::saveSupplierPayTypeList($supplierId, $payTypeData); SupplierPayTypeService::saveSupplierPayTypeList($supplierId, $payTypeData);
...@@ -422,12 +448,13 @@ class SupplierService ...@@ -422,12 +448,13 @@ class SupplierService
} }
//批量申请审核供应商 //批量申请审核供应商
public function batchApplyInReviewSupplier($supplierIds) public function batchApplyInReviewSupplier($auditData = [])
{ {
$model = new SupplierChannelModel(); $model = new SupplierChannelModel();
foreach ($supplierIds as $supplierId) { foreach ($auditData as $data) {
$result = $model->where('supplier_id', $supplierId)->update([ $result = $model->where('supplier_id', $data['supplier_id'])->update([
'update_time' => time(), 'update_time' => time(),
'apply_audit_reason' => $data['apply_audit_reason'],
'status' => SupplierChannelModel::STATUS_IN_REVIEW 'status' => SupplierChannelModel::STATUS_IN_REVIEW
]); ]);
if (!$result) { if (!$result) {
...@@ -450,7 +477,6 @@ class SupplierService ...@@ -450,7 +477,6 @@ class SupplierService
} }
} }
//搜索供应商 //搜索供应商
public static function searchSupplier($params) public static function searchSupplier($params)
{ {
......
...@@ -14,6 +14,9 @@ class SupplierTagService ...@@ -14,6 +14,9 @@ class SupplierTagService
private $client; private $client;
const TAG_TYPE_SYSTEM = 14;
const TAG_TYPE_CUSTOMER = 4;
public function __construct() public function __construct()
{ {
$this->client = new Client([ $this->client = new Client([
...@@ -41,10 +44,10 @@ class SupplierTagService ...@@ -41,10 +44,10 @@ class SupplierTagService
} }
//获取供应商对应的标签 //获取供应商对应的标签
public function getTagsBySupplierId($supplierId, $type = 1) public function getTagsBySupplierId($supplierId, $type)
{ {
//1是系统标签,2是自定义标签 //1是系统标签,2是自定义标签
$tagUse = $type == 1 ? 14 : 4; $tagUse = $type == 1 ? self::TAG_TYPE_SYSTEM : self::TAG_TYPE_CUSTOMER;
$response = $this->client->get('/get?tag_use=' . $tagUse . '&req_id=' . $supplierId); $response = $this->client->get('/get?tag_use=' . $tagUse . '&req_id=' . $supplierId);
$data = json_decode($response->getBody()->getContents(), true); $data = json_decode($response->getBody()->getContents(), true);
return !empty($data['data']) ? $data['data'] : []; return !empty($data['data']) ? $data['data'] : [];
......
...@@ -37,6 +37,7 @@ class SupplierTransformer ...@@ -37,6 +37,7 @@ class SupplierTransformer
$supplier['channel_username'] = $this->getChannelUserNames($supplier['channel_uid']); $supplier['channel_username'] = $this->getChannelUserNames($supplier['channel_uid']);
$supplier['purchase_username'] = array_get($users, $supplier['purchase_uid']); $supplier['purchase_username'] = array_get($users, $supplier['purchase_uid']);
$supplier['status_name'] = array_get(config('fixed.SupplierStatus'), $supplier['status']); $supplier['status_name'] = array_get(config('fixed.SupplierStatus'), $supplier['status']);
$supplier['supplier_type_name'] = array_get(config('field.SupplierType'), $supplier['supplier_type']);
$supplier['region_name'] = array_get(config('fixed.Region'), $supplier['region'], '暂无'); $supplier['region_name'] = array_get(config('fixed.Region'), $supplier['region'], '暂无');
$supplier['contact_num'] = $this->getContactNum($supplier['supplier_id']); $supplier['contact_num'] = $this->getContactNum($supplier['supplier_id']);
$supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否'; $supplier['has_sku'] = $supplier['sku_num'] ? '是' : '否';
...@@ -120,6 +121,7 @@ class SupplierTransformer ...@@ -120,6 +121,7 @@ class SupplierTransformer
//获取供应商地址信息 //获取供应商地址信息
$supplier = $this->getSupplierAddress($supplier); $supplier = $this->getSupplierAddress($supplier);
$supplier['pay_type_list'] = SupplierPayTypeService::getSupplierPayTypeList($supplier['supplier_id']); $supplier['pay_type_list'] = SupplierPayTypeService::getSupplierPayTypeList($supplier['supplier_id']);
$supplier['supplier_type_name'] = array_get(config('field.SupplierType'), $supplier['supplier_type']);
//获取最近修改信息 //获取最近修改信息
$logModel = new LogModel(); $logModel = new LogModel();
$log = $logModel->where('supplier_id', $supplier['supplier_id']) $log = $logModel->where('supplier_id', $supplier['supplier_id'])
......
...@@ -18,6 +18,7 @@ class SupplierValidator ...@@ -18,6 +18,7 @@ class SupplierValidator
$requestData = $request->all(); $requestData = $request->all();
$requestData = $this->transformRequestData($requestData); $requestData = $this->transformRequestData($requestData);
$rules = [ $rules = [
'supplier_type' => 'required',
'supplier_name' => 'required', 'supplier_name' => 'required',
'legal_representative' => 'required', 'legal_representative' => 'required',
'stockup_type' => 'required', 'stockup_type' => 'required',
...@@ -44,18 +45,34 @@ class SupplierValidator ...@@ -44,18 +45,34 @@ class SupplierValidator
'can_check_uids' => 'required', 'can_check_uids' => 'required',
]; ];
//校验附件,只要营业执照、商业登记证、公司注册证至少其中一个上传了附件,就判定已经上传了附件 //只有在提交供应商是正式的时候,才会去校验附件
$attachmentValidateFields = ['business_license', 'registration_certificate', 'incorporation_certificate']; if ($requestData['supplier_type'] == 1) {
$attachmentValidateFieldsExist = false; //校验附件,只要营业执照、商业登记证、公司注册证至少其中一个上传了附件,就判定已经上传了附件
foreach ($attachmentValidateFields as $field) { $attachmentValidateFields = [
if (array_get($requestData, $field)) { 'business_license',
$attachmentValidateFieldsExist = true; 'registration_certificate',
break; 'incorporation_certificate'
];
$attachmentValidateFieldsExist = false;
foreach ($attachmentValidateFields as $field) {
if (array_get($requestData, $field)) {
$attachmentValidateFieldsExist = true;
break;
}
}
if (!$attachmentValidateFieldsExist) {
return '附件里营业执照、商业登记证、公司注册证至少要上传一个';
}
//如果供应商性质是现货商,那么品质协议也不能为空
if ($requestData['supplier_group'] == 2) {
if (empty($requestData['quality_assurance_agreement'])) {
return '该供应商为现货商,请上传品质协议!';
}
} }
} }
if (!$attachmentValidateFieldsExist) {
return '附件里营业执照、商业登记证、公司注册证至少要上传一个';
}
//第一次新增的时候,是要校验联系人的 //第一次新增的时候,是要校验联系人的
if (empty($requestData['supplier_id'])) { if (empty($requestData['supplier_id'])) {
$rules = array_merge($rules, $contactRuler); $rules = array_merge($rules, $contactRuler);
...@@ -71,7 +88,6 @@ class SupplierValidator ...@@ -71,7 +88,6 @@ class SupplierValidator
$rules['purchase_uid'] = 'required'; $rules['purchase_uid'] = 'required';
} }
//营业执照是不能为空的
$messages = $this->messages(); $messages = $this->messages();
$validator = Validator::make($requestData, $rules, $messages); $validator = Validator::make($requestData, $rules, $messages);
if ($validator->fails()) { if ($validator->fails()) {
...@@ -107,7 +123,8 @@ class SupplierValidator ...@@ -107,7 +123,8 @@ class SupplierValidator
if (!empty($supplierId)) { if (!empty($supplierId)) {
//还要去判断当前提交人是否存在与其关联的联系人没有完善 //还要去判断当前提交人是否存在与其关联的联系人没有完善
$codeId = $request->user->codeId; $codeId = $request->user->codeId;
$notCompleteContacts = $contactModel->where('supplier_id', $supplierId)->where('can_check_uids', $codeId) $notCompleteContacts = $contactModel->where('supplier_id', $supplierId)
->where('can_check_uids', $codeId)
->where(function ($q) { ->where(function ($q) {
$q->where('supplier_consignee', '') $q->where('supplier_consignee', '')
->orWhere('supplier_position', '') ->orWhere('supplier_position', '')
...@@ -126,8 +143,8 @@ class SupplierValidator ...@@ -126,8 +143,8 @@ class SupplierValidator
$payTypeData = SupplierPayTypeService::getSupplierPayTypeListDBData($supplierId, $payTypeData); $payTypeData = SupplierPayTypeService::getSupplierPayTypeListDBData($supplierId, $payTypeData);
foreach ($payTypeData as $key => $payType) { foreach ($payTypeData as $key => $payType) {
//非货到付款的要判断value和extra //非货到付款的要判断value和extra
if ($payType['pay_type']!=2) { if ($payType['pay_type'] != 2) {
if (!$payType['pay_type_value']|| !$payType['pay_type_extra']) { if (!$payType['pay_type_value'] || !$payType['pay_type_extra']) {
return "请补充完整付款方式信息"; return "请补充完整付款方式信息";
} }
} }
...@@ -140,6 +157,7 @@ class SupplierValidator ...@@ -140,6 +157,7 @@ class SupplierValidator
private function messages() private function messages()
{ {
return [ return [
'supplier_type.required' => '供应商类别不能为空',
'supplier_name.required' => '供应商名称不能为空', 'supplier_name.required' => '供应商名称不能为空',
'legal_representative.required' => '法人代表不能为空', 'legal_representative.required' => '法人代表不能为空',
'stockup_type.required' => '合作类型不能为空', 'stockup_type.required' => '合作类型不能为空',
......
...@@ -49,5 +49,6 @@ Route::group(['middleware' => ['external'],'namespace' => 'Api'], function () { ...@@ -49,5 +49,6 @@ Route::group(['middleware' => ['external'],'namespace' => 'Api'], function () {
}); });
Route::match(['get', 'post'], '/test', function () { Route::match(['get', 'post'], '/test', function () {
\App\Model\SupplierChannelModel::where('supplier_name','like',"%TONMY%")->get()->toArray(); $service = new \App\Http\Services\DataService();
$service->makeSupplierSystemTagAbnormal();
}); });
...@@ -25,6 +25,9 @@ class SupplierChannelModel extends Model ...@@ -25,6 +25,9 @@ class SupplierChannelModel extends Model
//黑名单 //黑名单
const STATUS_BLOCK = -3; const STATUS_BLOCK = -3;
const SUPPLIER_TYPE_OFFICIAL = 1;
const SUPPLIER_TYPE_TEMPORARY = 2;
//黑名单信息 //黑名单信息
public function blacklist() public function blacklist()
{ {
......
...@@ -34,7 +34,7 @@ class TransformableTimeIntervalPresenter ...@@ -34,7 +34,7 @@ class TransformableTimeIntervalPresenter
</div> </div>
<div class="layui-col-md6"> <div class="layui-col-md6">
<div style="margin-top: 5px;"> <div style="margin-top: 5px;">
<div class="layui-col-md2" style="margin-left: 17px"> <div class="layui-col-md2" style="margin-left: -18px">
<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="$todayTimeInterval" dateInterval="$todayTimeInterval"
id="${unique}_today">今日</button> id="${unique}_today">今日</button>
......
<?php
namespace App\Presenters;
class SingleSelectPresenter
{
public function render($name, $text, $value = null, $data = [0 => '禁用', 1 => '启用'], $option = [])
{
$isRequired = array_get($option, 'required', false);
$requiredHtml = $isRequired ? '<span style="color: red">*</span>' : "";
$html = <<<EOF
<label class="layui-form-label">
$requiredHtml
$text
</label>
<div class="layui-input-block">
{$this->itemRender($data,$name, $value)}
</div>
EOF;
return $html;
}
public function itemRender($data,$name, $value)
{
$checked = '';
$itemsHtml = '';
foreach ($data as $v => $item) {
if ($value !== null) {
$checked = ($v == $value) ? "checked" : '';
}
$itemsHtml = $itemsHtml . "<input type='radio' lay-filter='${name}' name='${name}' value='${v}' title='${item}' $checked>";
}
return $itemsHtml;
}
}
\ No newline at end of file
...@@ -96,5 +96,23 @@ return [ ...@@ -96,5 +96,23 @@ return [
'ZiYingDepartmentId' => 51, 'ZiYingDepartmentId' => 51,
//60是本地的数据 //60是本地的数据
'LiangYingDepartmentIds' => [47, 60, 72] 'LiangYingDepartmentIds' => [47, 60, 72],
//等级显示对应数据
'LevelMap' => [
'A' => 'A(战略级)',
'B' => 'B(优秀级)',
'C' => 'C(次优级)',
'D' => 'D(合格级)',
'E' => 'E(临时供应商)',
],
'SupplierIsType' => [
0 => '正式',
1 => '临时',
],
'SupplierType' => [
1 => '正式',
2 => '临时',
]
]; ];
\ No newline at end of file
...@@ -24,15 +24,15 @@ return [ ...@@ -24,15 +24,15 @@ return [
'MD5KEY' => 'LX@ichunt.com82560956-0755',//接口加密密钥 'MD5KEY' => 'LX@ichunt.com82560956-0755',//接口加密密钥
'WMSKEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp',//WMS加密密钥 'WMSKEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp',//WMS加密密钥
//1代理商,2贸易商,3财务供应商,4原厂,5代工厂,6黑名单 //1代理商,2现货商,3财务供应商,4原厂,5代工厂,6黑名单
'SupplierGroup' => [ 'SupplierGroup' => [
0 => '其它', 0 => '其它',
1 => '代理商', 1 => '代理商',
2 => '贸易商', 2 => '现货商',
3 => '方案商IDH/IDM', 3 => '方案商',
4 => '原厂', 4 => '原厂',
5 => '分销商/平台', 5 => '分销平台',
6 => 'EMS/OEM/ODM', 6 => '代工厂',
], ],
//供应商编码规则映射表,用于根据供应商类型生成编码 //供应商编码规则映射表,用于根据供应商类型生成编码
//比如 : 原厂=>M+7位数 代理=>D+7位数 //比如 : 原厂=>M+7位数 代理=>D+7位数
......
...@@ -15,6 +15,7 @@ return [ ...@@ -15,6 +15,7 @@ return [
//供应商需要记录日志字段对应的中文 //供应商需要记录日志字段对应的中文
'SupplierNeedLogColumn' => [ 'SupplierNeedLogColumn' => [
'supplier_type_name' => '供应商类型',
'supplier_name' => '供应商名称', 'supplier_name' => '供应商名称',
'stockup_type' => '合作方式', 'stockup_type' => '合作方式',
'pay_type_name' => '付款类型', 'pay_type_name' => '付款类型',
......
This diff could not be displayed because it is too large.
No preview for this file type
...@@ -4,23 +4,41 @@ ...@@ -4,23 +4,41 @@
let form = layui.form; let form = layui.form;
let table = layui.table let table = layui.table
let element = layui.element; let element = layui.element;
$('#batch_apply_in_review_supplier').click(function () { // $('#batch_apply_in_review_supplier').click(function () {
admin.btnLoading('.submit-loading'); // admin.btnLoading('.submit-loading');
let supplierIds = getQueryVariable('supplier_ids'); // let supplierIds = getQueryVariable('supplier_ids');
let url = '/api/supplier/BatchApplyInReviewSupplier?supplier_ids=' + supplierIds; // let url = '/api/supplier/BatchApplyInReviewSupplier?supplier_ids=' + supplierIds;
let res = ajax(url); // let res = ajax(url);
// if (!res) {
// layer.msg('网络错误,请重试', {icon: 6});
// } else {
// if (res.err_code === 0) {
// admin.closeThisDialog();
// parent.layer.msg(res.err_msg, {icon: 6});
// } else {
// admin.btnLoading('.submit-loading', false);
// parent.layer.msg(res.err_msg, {icon: 5});
// }
// }
// });
form.on('submit(batch_apply_in_review_supplier)', function (data) {
let url = '/api/supplier/BatchApplyInReviewSupplier';
let res = ajax(url, data.field);
console.log(data.field)
if (!res) { if (!res) {
layer.msg('网络错误,请重试', {icon: 6}); layer.msg('网络错误,请重试', {icon: 6});
} else { } else {
if (res.err_code === 0) { if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6}); parent.layer.msg(res.err_msg, {icon: 6});
admin.closeThisDialog();
} else { } else {
admin.btnLoading('.submit-loading', false);
parent.layer.msg(res.err_msg, {icon: 5}); parent.layer.msg(res.err_msg, {icon: 5});
} }
} }
return false;
}); });
form.on('submit(cancel)', function (data) { form.on('submit(cancel)', function (data) {
admin.closeThisDialog(); admin.closeThisDialog();
}); });
......
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
{field: 'purchase_username', title: '渠道开发员', align: 'center', width: 110}, {field: 'purchase_username', title: '渠道开发员', align: 'center', width: 110},
{field: 'create_name', title: '创建人', align: 'center', width: 70}, {field: 'create_name', title: '创建人', align: 'center', width: 70},
{field: 'update_time', title: '最近修改时间', align: 'center', width: 145}, {field: 'update_time', title: '最近修改时间', align: 'center', width: 145},
{field: 'supplier_type_name', title: '供应商类别', align: 'center', width: 110},
]; ];
@if(checkPerm('ViewFakeSupplier')) @if(checkPerm('ViewFakeSupplier'))
...@@ -296,7 +297,7 @@ ...@@ -296,7 +297,7 @@
layer.open({ layer.open({
type: 2, type: 2,
content: '/supplier/AuditSupplier?view=iframe&supplier_id=' + supplierId, content: '/supplier/AuditSupplier?view=iframe&supplier_id=' + supplierId,
area: ['800px', '50%'], area: ['800px', '65%'],
title: '审核供应商', title: '审核供应商',
end: function () { end: function () {
table.reload('list'); table.reload('list');
...@@ -358,7 +359,7 @@ ...@@ -358,7 +359,7 @@
layer.open({ layer.open({
type: 2, type: 2,
content: '/supplier/BatchApplyInReviewSupplier?view=iframe&supplier_ids=' + supplierIds, content: '/supplier/BatchApplyInReviewSupplier?view=iframe&supplier_ids=' + supplierIds,
area: ['600px', '70%'], area: ['800px', '70%'],
title: '批量申请审核供应商', title: '批量申请审核供应商',
end: function () { end: function () {
table.reload('list'); table.reload('list');
......
...@@ -64,6 +64,18 @@ ...@@ -64,6 +64,18 @@
} }
}); });
//监听供应商类别单选,如果是临时供应商,附件可以不上传
form.on('radio(is_type)', function(data){
console.log(data.elem); //得到radio原始DOM对象
console.log(data.value); //被点击的radio的value值
let isType = data.value;
if (isType === '1') {
$('#attachment_required_span').hide();
}else{
$('#attachment_required_span').show();
}
});
//渲染主营品牌的多选 //渲染主营品牌的多选
function getBrandOption(element, brandType) { function getBrandOption(element, brandType) {
let brandUrl = '/api/common/getStandardBrandList'; let brandUrl = '/api/common/getStandardBrandList';
...@@ -156,7 +168,7 @@ ...@@ -156,7 +168,7 @@
//无限级分类-基本配置 //无限级分类-基本配置
selectN({ selectN({
elem: '#city-selector', elem: '#city-selector',
search: [false, true], search: [true, true],
name: 'province_city', name: 'province_city',
data: regionData, data: regionData,
selected: provinceCity selected: provinceCity
......
...@@ -37,6 +37,12 @@ ...@@ -37,6 +37,12 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">供应商类别 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<b>{{array_get(config('field.SupplierType'),$supplier['supplier_type'])}}</b>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核意见 : </label> <label class="layui-form-label">审核意见 : </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="radio" name="status" value="2" title="同意"> <input type="radio" name="status" value="2" title="同意">
...@@ -49,6 +55,14 @@ ...@@ -49,6 +55,14 @@
<textarea name="reject_reason" placeholder="不同意时必须填写原因" class="layui-textarea"></textarea> <textarea name="reject_reason" placeholder="不同意时必须填写原因" class="layui-textarea"></textarea>
</div> </div>
</div> </div>
@if ($supplier['supplier_type'] == \App\Model\SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY)
<div class="layui-form-item">
<label class="layui-form-label">申请原因 : </label>
<div class="layui-input-block block-42" style="padding-top: 7px">
<p>{{$supplier['apply_audit_reason']}}</p>
</div>
</div>
@endif
<div class="layui-form-item"> <div class="layui-form-item">
<div align="center" style="margin-top: 20px;text-align: right"> <div align="center" style="margin-top: 20px;text-align: right">
<button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading" lay-submit <button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading" lay-submit
......
...@@ -4,33 +4,62 @@ ...@@ -4,33 +4,62 @@
} }
</style> </style>
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-body"> <form class="layui-form" action="">
<blockquote class="layui-elem-quote layui-text"> <div class="layui-card-body">
<b>当前选中需要批量申请审核的供应商列表</b> <blockquote class="layui-elem-quote layui-text">
</blockquote> <b>当前选中需要批量申请审核的供应商列表</b>
<table class="layui-table"> </blockquote>
<colgroup> <table class="layui-table">
<col> <colgroup>
<col> <col>
</colgroup> <col>
<thead> </colgroup>
<tr> <thead>
<th>供应商名称</th>
</tr>
</thead>
<tbody>
@foreach($suppliers as $supplier)
<tr> <tr>
<td>{{$supplier['supplier_name']}}</td> <th>供应商名称</th>
<th>供应商类型</th>
<th>申请原因</th>
</tr> </tr>
@endforeach </thead>
</tbody> <tbody>
</table> @foreach($suppliers as $supplier)
</div> <tr>
<div align="center" style="margin-top: 20px;text-align: right"> <td>
<button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading" id="batch_apply_in_review_supplier">确认 {{$supplier['supplier_name']}}
</button> <input type="hidden" name="supplier_id[]" value="{{$supplier['supplier_id']}}">
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="cancel">取消 </td>
</button> <td>{{array_get(config('field.SupplierType'),$supplier['supplier_type'])}}</td>
</div> <td>
<div class="layui-row">
<div class="layui-col-xs1">
<input type="hidden" name="supplier_type[]" value="{{$supplier['supplier_type']}}">
@if ($supplier['supplier_type']==\App\Model\SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY)
<span class="require">*</span>
@endif
</div>
<div class="layui-col-xs11"
@if ($supplier['supplier_type']==\App\Model\SupplierChannelModel::SUPPLIER_TYPE_TEMPORARY) style="margin-left: -15px" @endif>
<input type="text" name="apply_audit_reason[]"
placeholder="如果供应商类型为临时,则要填写申请原因" class="layui-input supplier_reason">
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div style="margin-top: 20px;text-align: right">
{{-- <button type="button" class="layui-btn layui-btn-sm layui-btn-info submit-loading"--}}
{{-- id="batch_apply_in_review_supplier">确认--}}
{{-- </button>--}}
<button type="button" class="layui-btn layui-btn-sm submit-loading" lay-submit
lay-filter="batch_apply_in_review_supplier">确认
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="cancel">取消
</button>
</div>
</form>
</div> </div>
...@@ -110,7 +110,9 @@ ...@@ -110,7 +110,9 @@
<li class="layui-this" id="base_info">基本信息</li> <li class="layui-this" id="base_info">基本信息</li>
<li id="contact">联系人</li> <li id="contact">联系人</li>
<li id="ruler">特殊规则</li> <li id="ruler">特殊规则</li>
<li id="ruler">SKU概况</li> @if (checkPerm('ViewSkuRuler'))
<li id="ruler">SKU概况</li>
@endif
</ul> </ul>
<div class="layui-tab-content"> <div class="layui-tab-content">
<div class="layui-tab-item layui-show"> <div class="layui-tab-item layui-show">
...@@ -123,6 +125,9 @@ ...@@ -123,6 +125,9 @@
<span class="required_field">*</span>供应商名称 :{{$supplier['supplier_name']}} <span class="required_field">*</span>供应商名称 :{{$supplier['supplier_name']}}
</div> </div>
<div class="layui-row"> <div class="layui-row">
<span class="required_field">*</span>供应商类别 :{{$supplier['supplier_type_name']}}
</div>
<div class="layui-row">
注册公司名 :{{$supplier['supplier_name']}} 注册公司名 :{{$supplier['supplier_name']}}
</div> </div>
<div class="layui-row"> <div class="layui-row">
......
...@@ -110,12 +110,14 @@ ...@@ -110,12 +110,14 @@
@endif @endif
id="ruler">特殊规则 id="ruler">特殊规则
</li> </li>
<li @if (checkPerm('UpdateSkuRuler'))
@if(request()->get('tab')=='sku_ruler') <li
class="layui-this" @if(request()->get('tab')=='sku_ruler')
@endif class="layui-this"
id="sku_ruler">SKU概况 @endif
</li> id="sku_ruler">SKU概况
</li>
@endif
</ul> </ul>
<div class="layui-tab-content"> <div class="layui-tab-content">
<div class="layui-tab-item @if(request()->get('tab')=='base_info'||empty(request()->get('tab'))) layui-show @endif"> <div class="layui-tab-item @if(request()->get('tab')=='base_info'||empty(request()->get('tab'))) layui-show @endif">
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
<form class="layui-form" action=""> <form class="layui-form" action="">
@endif @endif
<div class="layui-form-item"> <div class="layui-form-item">
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'',config('field.SupplierType'),['required'=>true]) !!}
</div>
<div class="layui-form-item">
<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="supplier_name" id="supplier_name" <input type="text" name="supplier_name" id="supplier_name"
......
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-row"> <div class="layui-row">
<div class="@if (empty($supplier['supplier_id']))layui-col-md4 @else layui-col-md2 @endif"> <div class="@if (empty($supplier['supplier_id']))layui-col-md4 @else layui-col-md2 @endif">
<label class="layui-form-label"><span class="require">*</span>附件上传</label> <label class="layui-form-label"><span class="require" id="attachment_required_span">*</span>附件上传</label>
<div class="layui-input-block block-12" style="width: 155px" id="file_type_selector"> <div class="layui-input-block block-12" style="width: 155px" id="file_type_selector">
<select lay-verify="" lay-filter="file_type_selector"> <select lay-verify="" lay-filter="file_type_selector">
<option value="">请选择</option> <option value="">请选择</option>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div class="split-group" style="height: 130px;"> <div class="split-group" style="height: 130px;">
<div class="split-item" id="s1"> <div class="split-item" id="s1">
<div class="layui-row"> <div class="layui-row">
{{-- <a class="main_filter layui-badge layui-bg-green" id="all">全部({{$statistics['total']}})</a>--}} {{-- <a class="main_filter layui-badge layui-bg-green" id="all">全部({{$statistics['total']}})</a>--}}
<a class="main_filter layui-badge layui-bg-green" id="total"></a> <a class="main_filter layui-badge layui-bg-green" id="total"></a>
</div> </div>
</div> </div>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</div> </div>
@endif @endif
<div class="layui-row"> <div class="layui-row">
<a title="公司性质为贸易商性质的供应商没有上传品质协议" class="main_filter" id="no_quality_assurance_agreement"> <a title="公司性质为现货商性质的供应商没有上传品质协议" class="main_filter" id="no_quality_assurance_agreement">
</a> </a>
</div> </div>
</div> </div>
...@@ -157,8 +157,8 @@ ...@@ -157,8 +157,8 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-inline"> <div class="layui-inline">
@inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter') @inject('multiTransformableSelectPresenter','App\Presenters\Filter\MultiTransformableSelectPresenter')
{!! $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传','sku_tag'=>'SKU标准','sku_mode'=>'SKU模式'], {!! $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传','sku_tag'=>'SKU标准','sku_mode'=>'SKU模式','uploaded_sku' => '历史SKU合作'],
['has_sku'=>[-1=>'否',1=>'是'],'sku_tag'=>config('field.SkuTag'),'sku_mode'=>config('field.SkuMode')]) !!} ['has_sku'=>[1=>'是',-1=>'否'],'sku_tag'=>config('field.SkuTag'),'sku_mode'=>config('field.SkuMode')]) !!}
</div> </div>
@if(checkPerm('ViewFakeSupplier')) @if(checkPerm('ViewFakeSupplier'))
<div class="layui-inline"> <div class="layui-inline">
...@@ -166,10 +166,10 @@ ...@@ -166,10 +166,10 @@
{!! $statusPresenter->render('is_type','正式供应商','',[0=>'是',1=>'否']) !!} {!! $statusPresenter->render('is_type','正式供应商','',[0=>'是',1=>'否']) !!}
</div> </div>
@endif @endif
{{-- <div class="layui-inline">--}} <div class="layui-inline">
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}} @inject('statusPresenter','App\Presenters\StatusPresenter')
{{-- {!! $statusPresenter->render('has_sku','SKU上传','',[-1=>'否',1=>'是']) !!}--}} {!! $statusPresenter->render('level','等级','',config('field.LevelMap')) !!}
{{-- </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')
...@@ -194,12 +194,12 @@ ...@@ -194,12 +194,12 @@
//一进来就去获取统计数据 //一进来就去获取统计数据
function supplierStatistics() { function supplierStatistics() {
$.ajax({ $.ajax({
url:'/api/supplier_statistics/GetSupplierStatistics', url: '/api/supplier_statistics/GetSupplierStatistics',
type:'post', type: 'post',
async: true, async: true,
dataType:'json', dataType: 'json',
timeout:10000, timeout: 10000,
success:function (res) { success: function (res) {
if (res.err_code === 0) { if (res.err_code === 0) {
$.each(res.data, function (index, value) { $.each(res.data, function (index, value) {
let menuObj = $('#' + index); let menuObj = $('#' + index);
......
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