Commit f9b0adac by 杨树贤

一体化接口对接

parent e96bebd4
......@@ -321,6 +321,8 @@ class SupplierApiController extends Controller
}
}
//去请求天眼查获取资料
$this->response(0, '供应商名称合理');
}
......
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Services\SupplierService;
use Illuminate\Http\Request;
//提供外部系统的接口
class SupplierSyncController extends Controller
{
public function syncUniteResult(Request $request)
{
$resultData = $request->only([
'group_code',
'source_sn',
'company_name',
'init_nature',
'company_nature',
]);
}
}
<?php
namespace App\Http\Services;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Log;
//调用队列接口投掷队列服务
class QueueDeliveryService
{
const QUEUE_NAME = 'lie_queue_united_data'; //默认的队列名称
const PUSH_TYPE_QUEUE = 1;
const PUSH_TYPE_HTTP = 2;
const PUSH_TYPE_SYNC_HTTP = 3;//异步转发到http服务
public $queueName;
public function __construct()
{
$this->queueName = self::QUEUE_NAME;
}
public function setQueueName($name)
{
$this->queueName = $name;
return $this;
}
/**
* 队列推送队列数据
* @param int $types 类型:
* 1:队列接口soap推送;
* 2:队列原生推送,自己拼接json推送到接口
* @param string $func 如果是soap,则是 的函数:getCreditAmount 检测账期
* @param array $param 推送数据,如:["CURRENCY"=>'"民币","CUSTOMER"=>"深圳小明电子科技"]
* 如果 $types=3 ,则是原生推送,自己拼接json推送到接口队列:
* @param string $searchKey
* @param string $callbackPath 相对回调路径:/open/testa
* @param int $mainTimeOut 主推送超时时间
* @param int $callbackTimeout 推送数据
* @return array
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function push(
$types = 1,
$func = "",
$param = [],
$searchKey = "",
$callbackPath = "",
$mainTimeOut = 120,
$callbackTimeout = 10
) {
$client = new Client();
$rabmqUrl = config('website.QueueDomain');
$res = ""; //请求返回结果
$data = [];
try {
switch ($types) {
case self::PUSH_TYPE_QUEUE: #队列推送
$uk = md5(json_encode($param) . time());
$data = [
"queue_name" => $this->queueName,
"mq_data" => [
"__from" => $this->getFromUrl() ?: gethostname(),
"__insert_time" => time(),
"__timeout" => $mainTimeOut,
"__route_key" => $func,
"__type" => "soap",
"__uk" => $uk,
"__search_key" => $searchKey,
"data" => $param,
]
];
if ($callbackPath) {
$nowDomain = str_replace(request()->path(), "", request()->url());
$data["mq_data"]["__callback"] = [ // 选填字段,有回调时必填
"__callback_url" => $nowDomain . $callbackPath, // 回调的url路由地址,暂不支持回调soap接口列
"__callback_timeout" => $callbackTimeout, // 回调该接口的超时时间,默认为10秒,选填字段
"__callback_type" => "http", // 回调该接口的请求方式,同"__type",选填字段
"__callback_search_key" => $searchKey,
//"__callback_verify"=>"verify" // 若回调的接口需要校验,如请求龙哥的接口需要该字段,选填字段
];
}
$response = $client->request('POST', $rabmqUrl, [
'json' => $data,
]);
$res = $response->getBody();
break;
case self::PUSH_TYPE_SYNC_HTTP://异步转发到http请求
$uk = md5(json_encode($param) . time());
$data = [
"queue_name" => $this->queueName,
"mq_data" => [
"__from" => gethostname(),
"__insert_time" => time(),
"__timeout" => $mainTimeOut,
"__route_key" => $func,
"__type" => "http",
"__uk" => $uk,
"__search_key" => $searchKey,
"data" => $param,
]
];
if ($callbackPath) {
$nowDomain = str_replace(request()->path(), "", request()->url());
$data["mq_data"]["__callback"] = [ // 选填字段,有回调时必填
"__callback_url" => $nowDomain . $callbackPath, // 回调的url路由地址,暂不支持回调soap接口列
"__callback_timeout" => $callbackTimeout, // 回调该接口的超时时间,默认为10秒,选填字段
"__callback_type" => "http", // 回调该接口的请求方式,同"__type",选填字段
"__callback_search_key" => $searchKey,
];
}
$response = $client->request('POST', $rabmqUrl, [
'json' => $data
]);
$res = $response->getBody();
break;
case self::PUSH_TYPE_HTTP: #原生推送,自己组织数据
$data = $param;
$response = $client->request('POST', $rabmqUrl, [
'json' => $data
]);
$res = $response->getBody();
break;
}
} catch (\Exception $e) {
dd($e->getMessage());
Log::info("--- 推送数据:" . json_encode($data) . " 异常:" . $e->getMessage());
}
if (data_get($_REQUEST, "debug")) {
echo json_encode([
"队列接口:" => $rabmqUrl,
"请求数据:" => $data,
"返回结果" => json_decode($res, true),
]);
}
Log::info("--- 推送数据:" . json_encode($data) . " 返回数据:" . $res);
$arr = json_decode($res, true);
if (isset($arr['code'])) {
return $arr;
} else { //兼容旧接口
$arrTemp["code"] = isset($arr['0000']) ? 0 : 1;
$arrTemp["msg"] = $arrTemp["code"] == 0 ? "成功" : data_get($arr, "4444");
$arrTemp["data"] = $arr;
return $arrTemp;
}
}
private function getFromUrl()
{
$domain = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
$fromUrl = '';
if ($domain && $requestUrl) {
$fromUrl = $domain . $requestUrl;
}
return $fromUrl;
}
}
......@@ -4,6 +4,7 @@
namespace App\Http\Services;
//后台用户相关信息服务
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Model\SupplierSyncModel;
......@@ -98,4 +99,64 @@ class SyncSupplierService
$adminIds = DB::connection()->table('lie_intracode')->whereIn('code_id', $purchaseUid)->pluck('admin_id');
return DB::connection()->table('user_info')->whereIn('userId', $adminIds)->pluck('name');
}
/**
* 推送参数:
* {
* "system_id": "1",//来源系统id 1猎芯科技,2猎芯供应链,3crm
* "source_sn": "1", //源编码 各个系统标识公司的标识号
* "company_type": "1",//公司类型,1客户,2供应商
* "company_name": "测试公司", //公司名称
* "company_tax_no": "1234567",//公司税号
* "init_nature": "1234567",//来源公司初鉴性质
* "region": "1",//地区,1大陆,2海外
* "pi_file_url": "dasdsa" //pi附件地址
* }
*/
//同步供应商信息到一体化中心
public function syncSupplierToUnited($supplierId)
{
$supplier = SupplierChannelModel::where('supplier_id', $supplierId)->first()->toArray();
$fileUrl = SupplierAttachmentsModel::where('supplier_id', $supplierId)
->where('field_name', 'registration_certificate')
->value('file_url');
//构建需要同步的数据
$syncData = [
'system_id' => 1,
'source_sn' => (string)$supplier['supplier_id'],
'company_type' => 2,
'company_name' => $supplier['supplier_name'],
'company_tax_no' => $supplier['tax_number'],
'init_nature' => $supplier['supplier_group'],
'region' => $supplier['region'] == 2 ? 1 : 2,
'pi_file_url' => $fileUrl ?: '',
];
(new QueueDeliveryService())->push(QueueDeliveryService::PUSH_TYPE_SYNC_HTTP, '/sync/Company/syncCompany',
$syncData);
}
/**
* 推送参数为:
* {
* "group_code":"K0000013", //集团编码
* "source_sn":"1",//来源id,其实就是供应商id,因为新增的时候丢过去的就是供应商id
* "company_name":"\u6d4b\u8bd5\u516c\u53f8",//公司名
* "init_nature":"1234567",//初鉴性质
* "company_nature":"1234567"//公司真实性质
* }
**/
//接收一体化系统处理好的供应商数据,可能是第一次新增返回的数据,也可能是一体化那边修改的数据需要同步到供应商
public function syncSupplierToUnitedResult($syncResult)
{
$groupCode = array_get($syncResult, 'group_code');
$sourceSn = array_get($syncResult, 'source_sn');
$supplierId = $sourceSn;
SupplierChannelModel::where('supplier_id',$supplierId)
->update([
'sync_united_status' => SupplierChannelModel::SYNC_UNITED_STATUS_OK,
'group_code' => $groupCode,
'company_nature' => $syncResult['company_nature'],
]);
}
}
\ No newline at end of file
......@@ -92,6 +92,7 @@ class SupplierValidator
* 如果供应商类别为临时供应商,营业执照、开票资料必须上传(结算币种为人民币),品质保证协议不需要上传
* 必须上传品质保证协议才能成为正式供应商,没有上传品质保证协议只能为临时供应商(代理商跟原厂类型的供应商不需要上传品质保证协议)。
* 供应商类型为代理商的,需要上传代理证才能成为正式供应商,没有上传代理证的只能为临时供应商。
* 非国内的供应商,商业登记证不能为空
**/
//只有在提交供应商是正式的时候,才会去校验附件
//校验附件这块,新增和修改判断的逻辑不一样
......@@ -148,6 +149,12 @@ class SupplierValidator
}
}
if ($validateData['region'] != 2) {
if (!in_array('registration_certificate', $attachmentFields)) {
$errorMessageList[] = '海外供应商必须上传商业登记证/PI';
}
}
//银行信息校验
$receiptValidator = new ReceiptValidator();
if (empty($supplierId)) {
......
......@@ -49,11 +49,17 @@ Route::group(['middleware' => ['web'], 'namespace' => 'Api'], function () {
});
//提供给其它系统使用的接口
Route::group(['middleware' => ['external'],'namespace' => 'Api'], function () {
Route::get('/api/external/searchSupplier','ExternalApiController@searchSupplier');
Route::group(['middleware' => ['external'], 'namespace' => 'Api'], function () {
Route::get('/api/external/searchSupplier', 'ExternalApiController@searchSupplier');
});
//同步相关的接口
Route::group(['middleware' => [], 'namespace' => 'Sync'], function () {
//这个接口是用来接收同步结果,同时这个接口也是接收一体化那边的修改
Route::get('/sync/unitedData/syncResult', 'SupplierSyncController@syncUniteResult');
});
Route::match(['get', 'post'], '/test', function () {
$departmentService = new DepartmentService();
$subordinateUserIds = $departmentService->getSubordinateUserIds(1368);
(new \App\Http\Services\SyncSupplierService())->syncSupplierToUnited(10);
});
......@@ -28,6 +28,12 @@ class SupplierChannelModel extends Model
const SUPPLIER_TYPE_OFFICIAL = 1;
const SUPPLIER_TYPE_TEMPORARY = 2;
//一体化同步状态,失败,未同步,成功
const SYNC_UNITED_STATUS_FAIL = -1;
const SYNC_UNITED_STATUS_NOT_SYNC = 0;
const SYNC_UNITED_STATUS_OK = 1;
//黑名单信息
public function blacklist()
{
......
<?php
//这个文件是jekins构建的时候忽略掉的
return [
'admin' => ['admin@ichunt.com'],
......@@ -19,6 +20,7 @@ return [
'UploadUrl' => env('API_DOMAIN') . '/oss/upload',
'UploadKey' => 'fh6y5t4rr351d2c3bryi',
'QueueDomain' => 'http://192.168.1.252:16590/mq/push',
'WarningRobot' => 'https://oapi.dingtalk.com/robot/send?access_token=7ff88e1ee208e3a637c17bc51c1c879bccbf101fef5885d22ad70d21ea2f966a',
'CSWarningRobot' => 'https://oapi.dingtalk.com/robot/send?access_token=92917a6e090a8a39832c4843a579d6c6f9dfecc46fa275f8753ddee2b4399045',
......
......@@ -3,6 +3,7 @@ layui.config({ // common.js是配置layui扩展模块的目录,每个页面
version: '318', // 更新组件缓存,设为true不缓存,也可以设一个固定值
base: getProjectUrl() + 'assets/module/',
closeFooter: true,
defaultLoading: 3,
// tabAutoRefresh: true,
}).extend({
steps: 'steps/steps',
......
......@@ -3,6 +3,7 @@ layui.config({ // common.js是配置layui扩展模块的目录,每个页面
version: '318', // 更新组件缓存,设为true不缓存,也可以设一个固定值
base: getProjectUrl() + 'assets/module/',
closeFooter: true,
defaultLoading: 3,
}).extend({
steps: 'steps/steps',
notice: 'notice/notice',
......
......@@ -62,6 +62,9 @@
});
form.on('submit(addSupplier)', function (data) {
admin.showLoading({
type: 2,
});
let file_name = [];
let file_url = [];
let validity_type = [];
......@@ -150,6 +153,9 @@
});
function addSupplier(data) {
admin.showLoading({
type: 3,
});
let url = '/api/supplier/AddSupplier?direct_apply=1';
let res = ajax(url, data.field);
if (!res) {
......@@ -164,6 +170,7 @@
} else {
let errMsg = res.err_msg;
let msg = '';
admin.removeLoading();
$.each(errMsg.split('|'), function (index, value) {
msg += "<span>" + value + "</span><br>"
});
......
......@@ -3,7 +3,7 @@
let $ = layui.jquery;
let Split = layui.Split;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
Split(['#s1', '#s2', '#s3', '#s4', '#s5', '#s6', '#s7'], {sizes: [9, 12, 12, 12, 12, 12,31], minSize: 70});
Split(['#s1', '#s2', '#s3', '#s4', '#s5', '#s6', '#s7'], {sizes: [9, 12, 12, 12, 12, 12, 31], minSize: 70});
let table = layui.table;
let form = layui.form;
let index = layui.index;
......@@ -14,6 +14,50 @@
let type = 'all';
let currentPage = 1;
//一进来就去获取统计数据
function supplierStatistics(hasLoading = false) {
if (hasLoading) {
admin.showLoading({
elem: '#type_filter',
type: 3,
});
}
$.ajax({
url: '/api/supplier_statistics/GetSupplierStatistics',
type: 'post',
async: true,
dataType: 'json',
timeout: 10000,
success: function (res) {
if (res.err_code === 0) {
$.each(res.data, function (index, value) {
let menuObj = $('#' + index);
menuObj.text('');
menuObj.append(value);
});
}
if (hasLoading) {
admin.removeLoading('#type_filter');
}
}
})
}
supplierStatistics(true);
//罗盘隐藏
$('.hide_filter_type').click(function () {
$(this).hide();
$('#type_filter').hide();
$('.show_filter_type').show();
});
$('.show_filter_type').click(function () {
$(this).hide();
$('#type_filter').show();
$('.hide_filter_type').show();
});
//这个是页面点击刷新方法,隐藏起来是为了页面切换回这个列表的时候触发的
$('#refreshWindow').click(function () {
//判断当前是否有layui弹窗窗口,有的话不刷新
let hasLayerIframe = $('.layui-layer').size() > 0;
......@@ -125,13 +169,6 @@
{field: 'supplier_type_name', title: '供应商类别', align: 'center', width: 110},
];
{{-- @if(checkPerm('ViewFakeSupplier') && request()->user->userId == 1000)--}}
{{-- cols.push({--}}
{{-- field: 'is_type', title: '正式供应商', align: 'center', width: 110, templet: function (data) {--}}
{{-- return data.is_type === 0 ? '正式' : '<span style="color: red">待转正</span>';--}}
{{-- }--}}
{{-- })--}}
{{-- @endif--}}
cols.push(
{field: 'create_time', title: '创建时间', align: 'center', width: 145},
);
......@@ -224,17 +261,6 @@
//新增供应商弹窗
$("#add_supplier").click(function () {
// layer.open({
// type: 2,
// content: '/supplier/AddSupplier?view=iframe',
// area: ['1000px', '97%'],
// title: '新增供应商',
// offset: ['10px'],
// end: function () {
// table.reload('list');
// supplierStatistics();
// }
// });
index.openTab({
title: '新增供应商',
url: '/supplier/AddSupplier?view=iframe',
......@@ -293,10 +319,7 @@
layer.msg('该供应商已经被审核', {icon: 5});
return;
}
// if (status === -1) {
// layer.msg('要审核中的供应商才可以审核', {icon: 5});
// return
// }
let checkAuditMsg = checkCanAudit(supplierId);
if (checkAuditMsg !== '') {
layer.msg(checkAuditMsg, {icon: 5});
......
......@@ -28,12 +28,8 @@
if (res.err_code === -1) {
$(this).after("<div id='supplier_check_tip' style='margin-top: 10px'>" +
"<p style='color: red;'>供应商已存在,请重新输入或者咨询审批人</p></div>");
// $('input').prop('disabled', true);
// $('textarea').prop('disabled', true);
$('#supplier_name').prop('disabled', false);
} else {
// $('input').prop('disabled', false);
// $('textarea').prop('disabled', false);
}
}
}
......@@ -55,8 +51,23 @@
$('.city-div').show();
@endif
@endif
//监听所在区域变化,中国才显示省市选择
//而且有值才能修改供应商名字和税号
form.on('select(region)', function (data) {
let supplierNameObj = $('#supplier_name');
let taxNumberObj = $('#tax_number');
if (data.value) {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
}
if (data.value === '2') {
$('.city-div').show();
} else {
......@@ -64,14 +75,41 @@
}
});
//如果没有直接忽略公司校验的权限,那么就要做到下面的互相disable
@if (!checkPerm('IgnoreCompanyCheck'))
//修改供应商名称,那么公司税号就禁用,反之亦然
$('#supplier_name').change(function () {
let taxNumberObj = $('#tax_number');
if ($(this).val()) {
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
} else {
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
}
});
$('#tax_number').change(function () {
let supplierNameObj = $('#supplier_name');
if ($(this).val()) {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
}
});
@endif
//监听供应商类别单选,如果是临时供应商,附件可以不上传
//如果是临时供应商并且不显示申请审核按钮
form.on('radio(supplier_type)', function(data){
form.on('radio(supplier_type)', function (data) {
let supplier_type = data.value;
if (supplier_type === '1') {
$('#attachment_required_span').show();
// $('#apply_audit_button').show();
}else{
} else {
$('#attachment_required_span').hide();
// $('#apply_audit_button').hide();
}
......@@ -87,7 +125,7 @@
filterable: true,
paging: true,
height: '250px',
size: 'small',
size: 'mini',
direction: 'auto',
autoRow: true,
prop: {
......@@ -154,16 +192,17 @@
if (supplierId) {
@if (checkPerm('UpdateSupplierTags'))
let systemTagOption = getTagOption('system_tags_selector', 2);
let tagSelector = xmSelect.render(systemTagOption);
let tagIds = $('#system_tags').attr('value');
tagSelector.setValue(tagIds.split(','));
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({});
//自定义标签
$('#customer_tags').tagsInput({});
@endif
}
//省市区选择
let regionData = {!! json_encode($region_data) !!};
let provinceCity = {!! !empty($province_city)?json_encode($province_city):'[]' !!};
//无限级分类-基本配置
......@@ -174,5 +213,32 @@
data: regionData,
selected: provinceCity
});
//重新查验公司信息,请求相关接口
$('#recheck_company_info').click(function () {
let supplierName = $('#supplier_name').val();
let taxNumber = $('#tax_number').val();
admin.btnLoading('#recheck_company_info', '正在查验公司信息,请稍后');
if (!supplierName || !taxNumber) {
layer.msg('请填写供应商名称或者税号后再进行查验', {icon: 5});
admin.btnLoading('#recheck_company_info', false);
return false;
}
$('#supplier_check_tip').remove();
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' + taxNumber;
let res = ajax(url);
if (!res) {
layer.msg('网络错误,请重试', {icon: 5});
} else {
if (res.err_code === 0) {
let companyInfo = res.data;
} else {
$('#supplier_name').after("<div id='supplier_check_tip' style='margin-top: 10px'>" +
"<p style='color: red;'>公司未进行工商注册,请修改后重新提交</p></div>");
layer.msg('公司未进行工商注册,请修改后重新提交', {icon: 5})
}
admin.btnLoading('#recheck_company_info', false);
}
});
});
</script>
\ No newline at end of file
......@@ -38,13 +38,21 @@
<input type="hidden" name="apply_audit_reason" id="apply_audit_reason">
<div class="layui-form-item">
<div class="layui-col-md5">
<div class="layui-col-md3">
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',[1=>'正式',2=>'临时'],['require'=>true]) !!}
</div>
<div class="layui-col-md7">
<div class="layui-col-md3">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_uid','渠道开发员','',$userCodes,['required'=>true,'width'=>'150px']) !!}
{!! $statusPresenter->render('region','所在区域 : ','',
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
</div>
<div class="layui-col-md6">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
</div>
</div>
</div>
......@@ -53,32 +61,37 @@
<label class="layui-form-label"><span class="require">*</span>供应商名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input" value="">
placeholder="请输入供应商名称,选择所在区域才允许输入" class="layui-input layui-disabled" value="" disabled>
</div>
</div>
<div class="layui-col-md7">
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input" value="">
<div class="layui-col-md5">
<div class="layui-block" id="tax_number_div">
<label class="layui-form-label"><span class="require">*</span>公司税号</label>
<div class="layui-input-block">
<input type="text" name="tax_number" id="tax_number" placeholder="请输入公司税号,选择所在区域才允许输入"
class="layui-input layui-disabled" disabled value="">
</div>
</div>
</div>
<div class="layui-col-md2" style="padding-left: 20px">
<button type="button" class="layui-btn layui-btn-sm" id="recheck_company_info">重新查验公司信息</button>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label">英文名称 : </label>
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input" value="">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span> 注册资金(万): </label>
<div class="layui-input-block" style="width: 230px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="请输入注册资金(万),至少需要50万" class="layui-input" value="">
<label class="layui-form-label">英文名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input" value="">
</div>
</div>
</div>
......@@ -86,13 +99,13 @@
<div class="layui-row">
<div class="layui-col-md3">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('region','所在区域 : ','',
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
{!! $statusPresenter->render('purchase_uid','渠道开发员 : ','',$userCodes,['required'=>true,'width'=>'150px']) !!}
</div>
<div class="layui-col-md5">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>注册资金(万): </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="单位(万),至少50万" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md3">
......@@ -100,6 +113,13 @@
{!! $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ','',
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px']) !!}
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>公司电话 : </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="phone" id="phone"
placeholder="请输入公司电话" class="layui-input" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
......@@ -164,7 +184,7 @@
<label class="layui-form-label">到票时间 :
</label>
<div class="layui-input-block">
<input type="text" style="width: 170px" name="ticket_time" id="ticket_time"
<input type="text" style="width: 150px" name="ticket_time" id="ticket_time"
placeholder="请输入到票时间" class="layui-input" value="">
</div>
</div>
......@@ -212,14 +232,7 @@
</div>
<div class="layui-form-item">
<div class="layui-inline" id="tax_number_div"
style="display: none;margin-top: 10px"
>
<label class="layui-form-label"><span class="require">*</span>公司税号</label>
<div class="layui-input-inline">
<input type="text" name="tax_number" placeholder="请输入公司税号" class="layui-input" value="">
</div>
</div>
</div>
@include('web.supplier.SupplierPayType')
......
......@@ -134,7 +134,7 @@
供应商英文名称 :{{$supplier['supplier_name_en']}}
</div>
<div class="layui-row">
<span class="required_field">*</span>注册资金(万) :{{$supplier['registered_capital']?:'未设置'}}
<span class="required_field">*</span>注册资金 :{{$supplier['registered_capital']?$supplier['registered_capital']."(万)":'未设置'}}
</div>
<div class="layui-row">
<span class="is_business_abnormal">*</span>是否历史经营异常
......
......@@ -25,10 +25,10 @@
转正供应商
</button>
@endif
{{-- <button type="button" class="layui-btn layui-btn-sm" title="点击确定审核后会进入审核中状态"--}}
{{-- id="batch_apply_in_review_supplier">--}}
{{-- 申请审核--}}
{{-- </button>--}}
{{-- <button type="button" class="layui-btn layui-btn-sm" title="点击确定审核后会进入审核中状态"--}}
{{-- id="batch_apply_in_review_supplier">--}}
{{-- 申请审核--}}
{{-- </button>--}}
@if(checkPerm('BlockSupplier'))
<button type="button" class="layui-btn layui-btn-sm" id="block_supplier">
拉黑
......@@ -50,7 +50,7 @@
共用审核
@if (!empty($shareApplyCount))
({{$shareApplyCount}})
<span style="margin-left: 0" class="layui-badge-dot layui-bg-orange"></span>
<span style="margin-left: 0" class="layui-badge-dot layui-bg-orange"></span>
@endif
</button>
@endif
......
......@@ -32,8 +32,21 @@
?>
<div class="layui-form-item">
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',$supplierType,$option) !!}
<div class="layui-col-md3">
@inject('singleSelectPresenter','App\Presenters\SingleSelectPresenter')
{!! $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',$supplierType,$option) !!}
</div>
<div class="layui-col-md3">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('region','所在区域 : ',$supplier['region'],
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
</div>
<div class="layui-col-md6">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
</div>
</div>
</div>
<div class="layui-form-item">
......@@ -41,37 +54,39 @@
<label class="layui-form-label"><span class="require">*</span>供应商名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="请输入供应商名称" class="layui-input"
value="{{$supplier['supplier_name'] or ''}}">
placeholder="请输入供应商名称" class="layui-input @if ($supplier['sync_united_status']==1)
layui-disabled
@endif"
value="{{$supplier['supplier_name'] or ''}}" @if ($supplier['sync_united_status']==1) disabled @endif>
</div>
</div>
<div class="layui-col-md7">
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input"
value="{{$supplier['register_company_name'] or ''}}">
<div class="layui-col-md5">
<div class="layui-block" id="tax_number_div">
<label class="layui-form-label"><span class="require">*</span>公司税号</label>
<div class="layui-input-block">
<input type="text" name="tax_number" id="tax_number" placeholder="请输入公司税号,选择所在区域才允许输入"
class="layui-input layui-disabled" disabled value="{{$supplier['tax_number'] or ''}}">
</div>
</div>
{{-- <div style="margin-top: -15px;margin-left: 20px">--}}
{{-- <div class="layui-form-mid layui-word-aux">注册公司名必须同执照</div>--}}
{{-- </div>--}}
</div>
<div class="layui-col-md2" style="padding-left: 20px">
<button type="button" class="layui-btn layui-btn-sm" id="recheck_company_info">重新查验公司信息</button>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label">英文名称 : </label>
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input"
value="{{$supplier['supplier_name_en'] or ''}}">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>注册资金(万): </label>
<div class="layui-input-block" style="width: 230px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="请输入注册资金(万),至少需要50万" class="layui-input" value="{{$supplier['registered_capital']}}">
<label class="layui-form-label">英文名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input" value="">
</div>
</div>
</div>
......@@ -79,13 +94,14 @@
<div class="layui-row">
<div class="layui-col-md3">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('region','所在区域',!empty($supplier)?array_get($supplier,'region',''):'',
config('fixed.Region'),['required'=>true,'width'=>'150px']) !!}
{!! $statusPresenter->render('purchase_uid','渠道开发员 : ','',$userCodes,['required'=>true,'width'=>'150px']) !!}
</div>
<div class="layui-col-md5">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>注册资金(万): </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="单位(万),至少50万" class="layui-input"
value="{{$supplier['registered_capital']}}">
</div>
</div>
<div class="layui-col-md3">
......@@ -93,30 +109,39 @@
{!! $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ',$supplier['is_business_abnormal'],
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px']) !!}
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>注册地址 :
</label>
<div class="layui-input-block">
<input type="text" name="supplier_address" id="supplier_address"
placeholder="请输入注册地址" class="layui-input"
value="{{$supplier['supplier_address'] or ''}}">
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>公司电话 : </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="phone" id="phone"
placeholder="请输入公司电话" class="layui-input" value="{{$supplier['phone']}}">
</div>
@if($operate=='add')
<div class="layui-col-md7">
<label class="layui-form-label">发货地址 : </label>
<div class="layui-input-block">
<input type="text" name="shipping_address" id="shipping_address"
placeholder="请输入发货地址" class="layui-input"
value="{{$address['shipping_address'] or ''}}">
</div>
</div>
@endif
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>注册地址 :
</label>
<div class="layui-input-block">
<input type="text" name="supplier_address" id="supplier_address"
placeholder="请输入注册地址" class="layui-input"
value="{{$supplier['supplier_address'] or ''}}">
</div>
</div>
@if($operate=='add')
<div class="layui-col-md7">
<label class="layui-form-label">发货地址 : </label>
<div class="layui-input-block">
<input type="text" name="shipping_address" id="shipping_address"
placeholder="请输入发货地址" class="layui-input"
value="{{$address['shipping_address'] or ''}}">
</div>
</div>
@endif
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-md3">
@inject('statusPresenter','App\Presenters\StatusPresenter')
......
......@@ -27,13 +27,16 @@
<blockquote class="layui-elem-quote layui-quote-nm" style="padding-bottom: 5px">
<div id="file_list" class="layui-row">
@foreach(config('fixed.FileNameMapping') as $name=>$cnName)
<div id="{{$name}}_div" style="display: none">
<input type="hidden" id="{{$name}}">
<span>{{$cnName}} : </span>
<div id="{{$name}}_file_div"></div>
<hr>
</div>
<div id="{{$name}}_div" style="display: none">
<input type="hidden" id="{{$name}}">
<span>{{$cnName}} :
@if ($name=='registration_certificate')
<span style="color: red">如果供应商所在区域是海外,那么请确保商业登记证和供应商名称保持一致</span>
@endif
</span>
<div id="{{$name}}_file_div"></div>
<hr>
</div>
@endforeach
</blockquote>
</div>
......@@ -54,7 +57,7 @@
<div class="layui-col-md4 validity_period_selector_div">
<label class="layui-form-label">有效期 : </label>
<div class="layui-input-inline" style="width: 100px">
<select id="validity_type" lay-filter="validity_period_selector">
<select id="validity_type" lay-filter="validity_period_selector">
<option value="1">长期有效</option>
<option value="2">自定义</option>
</select>
......
......@@ -152,8 +152,8 @@
{!! $transformableInputPresenter->render(['supplier_name'=>'供应商名称','supplier_code'=>'供应商编码','supplier_id'=>'供应商ID']) !!}
</div>
<div class="layui-inline">
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}--}}
{{-- @inject('statusPresenter','App\Presenters\StatusPresenter')--}}
{{-- {!! $statusPresenter->render('status','供应商状态','',config('fixed.SupplierStatus')) !!}--}}
@inject('multiSelectorPresenter','App\Presenters\MultiSelectorPresenter')
{!! $multiSelectorPresenter->render('status','供应商状态','',$statusData) !!}
</div>
......@@ -201,39 +201,4 @@
</div>
</form>
@endif
</div>
<script>
//一进来就去获取统计数据
function supplierStatistics() {
$.ajax({
url: '/api/supplier_statistics/GetSupplierStatistics',
type: 'post',
async: true,
dataType: 'json',
timeout: 10000,
success: function (res) {
if (res.err_code === 0) {
$.each(res.data, function (index, value) {
let menuObj = $('#' + index);
menuObj.text('');
menuObj.append(value);
});
}
}
})
}
supplierStatistics();
//罗盘隐藏
$('.hide_filter_type').click(function () {
$(this).hide();
$('#type_filter').hide();
$('.show_filter_type').show();
});
$('.show_filter_type').click(function () {
$(this).hide();
$('#type_filter').show();
$('.hide_filter_type').show();
});
</script>
</div>
\ No newline at end of file
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