Commit a1fe9e71 by 杨树贤

Merge branch 'ysx-新增签约公司-20250214'

# Conflicts:
#	app/Http/routes.php
parents af519277 d56eda19
Showing with 2919 additions and 195 deletions
......@@ -167,3 +167,5 @@ SKIP_SEND_EMAIL=true
IMAGE_SERVER_URL=http://image.liexindev.net
FILE_SERVER_URL=http://file.liexindev.net
CRM_URL=http://crmnew.liexindev.net
......@@ -2,25 +2,26 @@
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Filter\SupplierFilter;
use App\Http\Services\AdminUserService;
use App\Http\Services\CompanyService;
use App\Http\Services\LogService;
use App\Http\Services\StandardBrandService;
use App\Http\Services\SupplierAuditService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierStatisticsService;
use App\Http\Services\SyncSupplierService;
use App\Http\Transformers\SupplierTransformer;
use App\Http\Validators\SupplierValidator;
use Cookie;
use App\Model\LogModel;
use App\Model\RedisModel;
use App\Model\SupplierChannelModel;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use App\Http\Services\CrmService;
use App\Http\Services\LogService;
use App\Model\SupplierChannelModel;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Cookie;
use App\Http\Services\CompanyService;
use App\Http\Services\SupplierService;
use App\Http\Services\AdminUserService;
use App\Http\Services\SyncSupplierService;
use App\Http\Validators\SupplierValidator;
use App\Http\Services\StandardBrandService;
use App\Http\Services\SupplierAuditService;
use App\Http\Transformers\SupplierTransformer;
use App\Http\Controllers\Filter\SupplierFilter;
use App\Http\Services\SupplierStatisticsService;
class SupplierApiController extends Controller
{
......@@ -98,6 +99,7 @@ class SupplierApiController extends Controller
'has_legal_ID_card',
'agency_brands',
'purchase_type',
'sign_com_id',
];
public function Entrance(Request $request, $id)
......@@ -150,6 +152,7 @@ class SupplierApiController extends Controller
'swift_code',
'nation_id',
'intermediary_bank',
'sign_com_id',
]);
$channel = $request->only($channelMap);
......@@ -174,8 +177,9 @@ class SupplierApiController extends Controller
$channel['supplier_name'] = trim($channel['supplier_name']);
$channel['supplier_name'] = replaceSpecialSpace($channel['supplier_name']);
$channel['supplier_name'] = deleteExtraSpace($channel['supplier_name']);
$signComName = array_get(CrmService::getSignCompanyListMap(), $channel['sign_com_id']);
//校验一体化实体名单
$checkCompanyEntity = (new CompanyService())->checkCompanyEntity($channel['supplier_name'], $channel['supplier_name_en'], $channel['supplier_address'], $businessLicense);
$checkCompanyEntity = (new CompanyService())->checkCompanyEntity($channel['supplier_name'], $channel['supplier_name_en'], $channel['supplier_address'], $businessLicense, $signComName);
//待确认要透传到数据库里面去
if ($checkCompanyEntity == 0) {
$channel['is_entity'] = 0;
......@@ -277,7 +281,6 @@ class SupplierApiController extends Controller
} else {
$this->response(-1, '禁用失败');
}
}
//修改状态(禁用,启用(审核通过),驳回,草稿,取消黑名单)
......@@ -350,7 +353,6 @@ class SupplierApiController extends Controller
->where('supplier_name', '!=', $originSupplierName)
->value('supplier_name');
if ($supplierName !== $existedSupplierName) {
} else {
$this->response(-1, '供应商已存在,请重新输入或者咨询审批人');
}
......@@ -410,7 +412,6 @@ class SupplierApiController extends Controller
$this->response(-1, '审核失败');
}
$this->response(0, '审核成功');
}
//分配渠道开发员
......@@ -547,12 +548,12 @@ class SupplierApiController extends Controller
SupplierChannelModel::where('supplier_id', $supplierId)->update([
'tax_number' => $taxNumber,
]);
// $this->response(-1, '该供应商属于国内,但是没有税号,不允许同步');
// $this->response(-1, '该供应商属于国内,但是没有税号,不允许同步');
}
if ($supplier['is_standard_add'] == 1 && $supplier['region'] != SupplierChannelModel::REGION_CN) {
// if (empty($companyInfo)) {
// $this->response(-1, '该供应商属于海外,但是无法查询公司信息,不允许同步');
// }
// if (empty($companyInfo)) {
// $this->response(-1, '该供应商属于海外,但是无法查询公司信息,不允许同步');
// }
}
$service = new SyncSupplierService();
$service->syncSupplierToUnited($supplierId);
......@@ -797,5 +798,4 @@ class SupplierApiController extends Controller
}
$this->response(0, '修改供应商名称成功,请等待一体化再次审核');
}
}
......@@ -74,7 +74,10 @@ class SupplierFilter
$q->where('supplier_name', 'like', "%${map['supplier_search_fuzzy']}%")
->orWhere('supplier_code', 'like', "%${map['supplier_search_fuzzy']}%");
});
}
if (!empty($map['sign_com_id'])) {
$query->where('sign_com_id', $map['sign_com_id']);
}
if (!empty($map['create_uid'])) {
......
......@@ -4,13 +4,14 @@
namespace App\Http\Services;
//后台用户相关信息服务
use Log;
use App\Model\UserInfoModel;
use App\Model\IntracodeModel;
use App\Model\SupplierAddressModel;
use App\Model\SupplierAttachmentsModel;
use App\Model\SupplierChannelModel;
use App\Model\UserDepartmentModel;
use App\Model\UserInfoModel;
use Illuminate\Support\Facades\DB;
use App\Model\SupplierAddressModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierAttachmentsModel;
class CompanyService
{
......@@ -84,7 +85,7 @@ class CompanyService
}
//校验是否实体名单通过
public function checkCompanyEntity($supplierName, $supplierNameEn = '', $supplierAddress = '', $businessLicense = '')
public function checkCompanyEntity($supplierName, $supplierNameEn = '', $supplierAddress = '', $businessLicense = '', $signComName = '')
{
$params = [
'company_name_cn' => $supplierName,
......@@ -96,6 +97,7 @@ class CompanyService
'create_name' => request()->user->name,
'source_system_id' => 1,
'address_data' => [],
'sign_company_name' => $signComName,
];
$url = config('website.UnitedDataDomain') . '/sync/Company/checkCompanyEntity';
$result = curlJson($url, $params);
......@@ -103,7 +105,7 @@ class CompanyService
if (array_get($result, 'code') === 0) {
return $result['data']['result'];
}
\Log::error(json_encode($result));
Log::error(json_encode($result));
return '一体化校验实体名单失败,请联系管理员';
}
......@@ -178,7 +180,7 @@ class CompanyService
return $result['data']['result'];
}
\Log::error(json_encode($result));
Log::error(json_encode($result));
return '一体化校验实体名单失败,请联系管理员';
}
}
<?php
namespace App\Http\Services;
use GuzzleHttp\Client;
use App\Model\RedisModel;
use Illuminate\Support\Facades\DB;
class CrmService
{
//获取签约公司列表
public static function getSignCompanyList()
{
$cacheKey = 'sign_company_list';
$cachedData = (new RedisModel())->get($cacheKey);
if ($cachedData) {
return json_decode($cachedData, true);
}
$url = env('CRM_URL') . '/open/signComs/getSignComs?use_scope=2';
$client = new Client();
$response = $client->get($url);
$result = json_decode($response->getBody()->getContents(), true);
if ($result['code'] != 0) {
return [];
}
(new RedisModel())->setex($cacheKey, 60, json_encode($result['data']['list']));
return $result['data']['list'];
}
//获取简单形式给各个地方使用
public static function getSignCompanyListMap()
{
$list = self::getSignCompanyList();
$map = [];
foreach ($list as $item) {
$map[$item['sign_com_id']] = $item['com_name'];
}
return $map;
}
}
......@@ -712,4 +712,16 @@ class DataService
}
public static function initSignCom()
{
//读取excel
$filePath = public_path('data') . DIRECTORY_SEPARATOR . 'sign_com.xlsx';
$excel = Excel::load($filePath, function ($reader) {
$reader->sheet('sheet1', function ($sheet) {
$sheet->fromArray($sheet->toArray());
});
});
}
}
......@@ -908,7 +908,8 @@ class SupplierService
$businessLicense = $registrationCertificate;
}
}
$checkCompanyEntity = (new CompanyService())->checkCompanyEntity($supplierName, $supplier['supplier_name_en'], $supplier['supplier_address'], $businessLicense);
$signComName = array_get(CrmService::getSignCompanyListMap(), $supplier['sign_com_id']);
$checkCompanyEntity = (new CompanyService())->checkCompanyEntity($supplierName, $supplier['supplier_name_en'], $supplier['supplier_address'], $businessLicense, $signComName);
//还要去检测是否是一体化黑名单
//新增的时候要先去检验下一体化的数据,如果是实体黑名单用户,那么就不允许新增
//还要校验提交上来的公司是否有合法信息
......
......@@ -4,20 +4,21 @@
namespace App\Http\Transformers;
use App\Model\LogModel;
use App\Model\RedisModel;
use App\Model\IntracodeModel;
use App\Http\Services\CrmService;
use App\Http\Services\SkuService;
use App\Model\SupplierExtendModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Http\Services\SupplierService;
use App\Http\Services\AdminUserService;
use App\Http\Services\ViewCheckService;
use App\Http\Services\DepartmentService;
use App\Http\Services\SkuService;
use App\Http\Services\SupplierPayTypeService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierSkuAuditRulerService;
use App\Http\Services\SupplierSkuUploadRulerService;
use App\Http\Services\ViewCheckService;
use App\Model\IntracodeModel;
use App\Model\LogModel;
use App\Model\RedisModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Model\SupplierExtendModel;
class SupplierTransformer
{
......@@ -69,7 +70,7 @@ class SupplierTransformer
$userInfo = $adminUserService->getAdminUserInfo($supplier['create_uid']);
$supplier['create_name'] = array_get($userInfo, 'name');
}
$supplier['sign_com_name'] = array_get(CrmService::getSignCompanyListMap(), $supplier['sign_com_id']);
$supplier['last_upload_sku_time'] = array_get($lastUploadSkuTimes, $supplier['supplier_code']) ? date('Y-m-d H:i:s',
$lastUploadSkuTimes[$supplier['supplier_code']]) : '';
......@@ -178,6 +179,7 @@ class SupplierTransformer
$supplier['established_time'] = !empty($supplier['established_time']) ? date('Y-m-d',
$supplier['established_time']) : '';
$supplier = $this->getStockupType($supplier);
$supplier['sign_com_name'] = array_get(CrmService::getSignCompanyListMap(), $supplier['sign_com_id']);
$supplier['status_name'] = array_get(config('fixed.SupplierStatus'), $supplier['status']);
$supplier['region_name'] = array_get(config('fixed.Region'), $supplier['region']);
$supplier['currency_name'] = array_get(config('fixed.Currency'), $supplier['currency']);
......
......@@ -107,6 +107,7 @@ class SupplierValidator
'stockup_type' => 'required',
'main_brands' => 'required',
'pay_type' => 'required',
'sign_com_id' => 'required',
'settlement_type' => 'required',
'established_time' => 'required',
'currency' => 'required',
......@@ -385,7 +386,8 @@ class SupplierValidator
'registered_capital.required' => '注册资金 不能为空(单位为万)',
'registered_capital.min' => '注册资金至少50万(单位为万)',
'registered_capital.numeric' => '注册资金填纯数字即可,默认单位是万',
'is_business_abnormal.required' => '是否历史经营异常必选,请补充选择'
'is_business_abnormal.required' => '是否历史经营异常必选,请补充选择',
'sign_com_id.required' => '发生跨境交易时的合同签约公司 不能为空',
];
}
......
......@@ -12,7 +12,11 @@
*/
use App\Model\RedisModel;
use App\Http\Services\SkuService;
use App\Http\Services\CompanyService;
use App\Http\Services\CrmService;
use Illuminate\Support\Facades\Route;
use App\Http\Services\DepartmentService;
use App\Http\Services\SkuService;
use App\Model\RedisModel;
......@@ -86,6 +90,8 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route::match(['get', 'post'], '/test', function () {
$list = CrmService::getSignCompanyList();
dd($list);
\App\Model\SupplierChannelModel::where('supplier_id', 9033)->update([
'supplier_name' => 'Telsys Ltd.',
]);
......
......@@ -13,10 +13,11 @@ class StatusPresenter
$width = array_get($option, 'width', 'auto');
$noName = array_get($option, 'noName');
$name = $noName ? '' : $name;
$title = array_get($option, 'title');
$labelWidth = array_get($option, 'label_width');
$requiredHtml = $isRequired ? '<span class="require">*</span>' : "";
$html = <<<EOF
<label class="layui-form-label" style="width: $labelWidth">
<label class="layui-form-label" style="width: $labelWidth" title="$title">
$requiredHtml
$text
</label>
......@@ -45,4 +46,4 @@ EOF;
}
return $optionsHtml;
}
}
\ No newline at end of file
}
......@@ -327,10 +327,10 @@ return [
2 => '大陆',
3 => '日韩',
4 => '港台',
// 6 => '中国台湾',
5 => '其它',
],
'IsEntity' => [
-1 => '普通',
0 => '待处理',
......
......@@ -6,15 +6,14 @@ return [
'ChoiceSupplierList',
],
//api不用授权方法
'ApiNotAuth' => [
],
'MenuSign' => '/web/',//菜单去除掉标记,生成菜单时用
'ApiNotAuth' => [],
'MenuSign' => '/web/', //菜单去除掉标记,生成菜单时用
'UploadKey' => 'fh6y5t4rr351d2c3bryi',//上传加密
'UploadKey' => 'fh6y5t4rr351d2c3bryi', //上传加密
'MD5KEY' => 'LX@ichunt.com82560956-0755',//接口加密密钥
'MD5KEY' => 'LX@ichunt.com82560956-0755', //接口加密密钥
'WMSKEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp',//WMS加密密钥
'WMSKEY' => 'j9q##VRhaXBEtznIEeDiR@1Hvy0sW3wp', //WMS加密密钥
'SupplierGroup' => [
......@@ -43,9 +42,21 @@ return [
1 => '欧美',
2 => '国内',
3 => '日韩',
4 => '港台',
4 => '港澳',
6 => '中国台湾',
5 => '其它',
],
//所在区域对应的默认签约公司id
'RegionSignComMap' => [
1 => 105,
2 => 105,
3 => 105,
4 => 2,
6 => 105,
5 => 105,
],
//1 是否接口对接
'OutsideContactStatus' => [
1 => '否',
......@@ -65,7 +76,7 @@ return [
7 => '联营-原厂直供',
2 => '自营-自采',
4 => '自营-寄售',
// 5 => '联营-芯链商家',
// 5 => '联营-芯链商家',
],
'StockupType' => [
......@@ -86,7 +97,7 @@ return [
1 => '账期',
//账期-定期结算
2 => '货到付款',
// 4 => '定金'
// 4 => '定金'
5 => '验货付款',
],
......@@ -160,12 +171,12 @@ return [
//现货
'allow_stock_lte_0' => '允许库存为空',
'allow_moq_lte_0' => '允许起订量为空',
// 'allow_stock_lt_moq' => '允许起订量大于库存',
// 'allow_stock_lt_moq' => '允许起订量大于库存',
'allow_price_null' => '允许阶梯价为空',
//期货
'futures_allow_stock_lte_0' => '允许库存为空',
'futures_allow_moq_lte_0' => '允许起订量为空',
// 'futures_allow_stock_lt_moq' => '允许起订量大于库存',
// 'futures_allow_stock_lt_moq' => '允许起订量大于库存',
'futures_allow_price_null' => '允许阶梯价为空',
],
......@@ -191,18 +202,18 @@ return [
*/
'SkuAuditRuler' => [
"skip" => 0,//1无需审核,0需要审核
"skip" => 0, //1无需审核,0需要审核
"audit_ruler" => [
"1" => 1, //1=>1 如果其中一条数据型号与品牌都存在,value是1,代表需要审核;value是0,直接通过
// "2" => 1, //依次类推类推
// "3" => 1,
// "4" => 1,
// "2" => 1, //依次类推类推
// "3" => 1,
// "4" => 1,
],
"name_map" => [
"1" => '型号与品牌已存在',
// "2" => '型号不存在,品牌存在',
// "3" => '型号不存在,品牌不存在',
// "4" => '型号存在,品牌不存在',
// "2" => '型号不存在,品牌存在',
// "3" => '型号不存在,品牌不存在',
// "4" => '型号存在,品牌不存在',
]
],
......@@ -229,23 +240,23 @@ return [
//罗盘菜单对应id
'CompassMenuMap' => [
'total' => '全部',
// 'pending' => '待提审',
// 'pending' => '待提审',
'need_review' => '待复审',
// 'in_review' => '审核中',
// 'draft' => '草稿',
// 'passed' => '已通过',
// 'rejected' => '未通过',
// 'disable' => '禁止交易',
// 'no_purchase_uid' => '渠道未分配',
// 'no_channel_uid' => '采购未分配',
// 'invalid_channel_uid' => '无效采购员',
// 'invalid_purchase_uid' => '无效渠道员',
// 'contact_no_complete' => '联系人不完善',
// 'to_follow_up' => '待跟进',
// 'no_sku' => '无sku',
// 'no_quality_assurance_agreement' => '无品质协议',
// 'has_supplier_tag' => '客户指定供应商',
// 'history_abnormal' => '历史检测异常',
// 'in_review' => '审核中',
// 'draft' => '草稿',
// 'passed' => '已通过',
// 'rejected' => '未通过',
// 'disable' => '禁止交易',
// 'no_purchase_uid' => '渠道未分配',
// 'no_channel_uid' => '采购未分配',
// 'invalid_channel_uid' => '无效采购员',
// 'invalid_purchase_uid' => '无效渠道员',
// 'contact_no_complete' => '联系人不完善',
// 'to_follow_up' => '待跟进',
// 'no_sku' => '无sku',
// 'no_quality_assurance_agreement' => '无品质协议',
// 'has_supplier_tag' => '客户指定供应商',
// 'history_abnormal' => '历史检测异常',
'block' => '黑名单',
'level_a' => '战略供应商',
'pay_type_term' => '账期供应商',
......
......@@ -57,5 +57,7 @@ return [
'billing_period_detail' => '账期详情',
'registered_capital' => '注册资金(万)',
'purchase_type_name' => '代购类型',
'sign_com_id' => '签约公司id',
'sign_com_name' => '签约公司名称',
]
];
\ No newline at end of file
];
......@@ -42,5 +42,6 @@ return [
],
'TagUrl' => env('TAG_URL'),
'CloudUrl' => env('CLOUD_URL'),
'CrmUrl' => env('CRM_URL'),
'SkipSendEmail' => env('skip_send_email'),
];
......@@ -222,6 +222,7 @@
}
}
},
{field: 'sign_com_name', title: '签约公司', align: 'center', width: 130},
{field: 'last_update_name', title: '最新修改人', align: 'center', width: 110},
{
field: 'contact_num', title: '联系人', align: 'center', width: 70, templet: function (data) {
......
......@@ -265,12 +265,18 @@
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-col-md3">
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_type','代购类型 : ',!empty($supplier)?$supplier['purchase_type']:'',config('field.PurchaseType')) !!}
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('sign_com_id','签约公司 : ',!empty($supplier)?$supplier['sign_com_id']:105,\App\Http\Services\CrmService::getSignCompanyListMap(),['title'=>'发生跨境交易时的合同签约主体','required'=>true,'width'=>'200px']) !!}
</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">资信调查 : </label>
......
......@@ -210,6 +210,9 @@
<div class="layui-col-md2">
代购类型 : {{$supplier['purchase_type_name']}}
</div>
<div class="layui-col-md2">
签约公司 : {{$supplier['sign_com_name']}}
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
......
......@@ -271,12 +271,18 @@
</div>
</div>
</div>
<div class="layui-col-md6">
<div class="layui-inline">
<div class="layui-col-md3">
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('purchase_type','代购类型 : ',!empty($supplier)?$supplier['purchase_type']:'',config('field.PurchaseType')) !!}
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('sign_com_id','签约公司 : ',!empty($supplier)?$supplier['sign_com_id']:0,\App\Http\Services\CrmService::getSignCompanyListMap(),['title'=>'发生跨境交易时的合同签约主体','required'=>true,'width'=>'200px']) !!}
</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">资信调查 : </label>
......
......@@ -17,113 +17,6 @@
</div>
</div>
</div>
{{-- <div class="split-item" id="s2" style="text-align: center">--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="need_review" data-value="-1">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @if(checkPerm('SupplierPendingList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="pending" data-value="0">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierInReviewList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="in_review" data-value="1">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierRejectList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="rejected" data-value="3">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierPassedList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="passed" data-value="2">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- </div>--}}
{{-- <div class="split-item" id="s3" style="text-align: center">--}}
{{-- @if(checkPerm('SupplierNoPurchaseUidList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a title="非禁用状态的渠道开发员为空的供应商" class="main_filter" id="no_purchase_uid">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierNoChannelUidList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a title="采购员为空的供应商" class="main_filter" id="no_channel_uid">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierInvalidChannelUidList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a title="非禁止交易状态联系人绑定的采购员姓名不在组织架构中(采购员离职)的供应商"--}}
{{-- class="main_filter"--}}
{{-- id="invalid_channel_uid">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierInvalidPurchaseUidList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a title="非禁止交易状态联系人绑定的渠道开发员姓名不在组织架构中(渠道开发员离职)的供应商"--}}
{{-- class="main_filter"--}}
{{-- id="invalid_purchase_uid">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- <div class="layui-row">--}}
{{-- <a title="联系人中存在非必填字段未填写" class="main_filter"--}}
{{-- id="contact_no_complete">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- </div>--}}
{{-- <div class="split-item" id="s4" style="text-align: center">--}}
{{-- @if(checkPerm('SupplierToFollowUpList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a title="非禁止交易状态的供应商重新分配渠道员,且必填信息不完整;或者禁用状态的供应商重新分配渠道员"--}}
{{-- class="main_filter"--}}
{{-- id="to_follow_up">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierNoSkuList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="no_sku">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- <div class="layui-row">--}}
{{-- <a title="采购员全离职" class="main_filter" id="all_channel_user_resigned">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- </div>--}}
{{-- <div class="split-item" id="s5" style="text-align: center">--}}
{{-- @if(checkPerm('SupplierBlockList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="block" data-value="-3">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @if(checkPerm('SupplierDisableList'))--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" id="disable" data-value="-2">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" title="历史检测异常" id="history_abnormal">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- <div class="layui-row">--}}
{{-- <a class="main_filter" title="系统标签中贴有客户指定的供应商" id="has_supplier_tag">--}}
{{-- </a>--}}
{{-- </div>--}}
{{-- </div>--}}
<div class="split-item" id="s6" style="text-align: center">
<div class="layui-row">
<a class="main_filter" title="战略供应商" id="level_a">
......@@ -326,6 +219,10 @@
{!! $statusPresenter->render('is_entity','实体名单','',config('field.IsEntity')) !!}
</div>
<div class="layui-inline">
@inject('statusPresenter', 'App\Presenters\StatusPresenter')
{!! $statusPresenter->render('sign_com_id', '签约公司', 0, \App\Http\Services\CrmService::getSignCompanyListMap()) !!}
</div>
<div class="layui-inline">
<label class="layui-form-label">创建部门</label>
<div class="layui-input-inline">
<div id="create_user_department" style="width: 150px"></div>
......
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let admin = layui.admin;
let form = layui.form;
//要根据付款类型的不同选项,切换不同的显示
form.on('select(pay_type)', function (data) {
const payType = data.value;
let parentDiv = $(this).parents('.pay_type_div');
parentDiv.find('.pay_type_' + payType + '_div').show();
parentDiv.find('.pay_type_' + payType + '_div').find('.valueInput').first().attr('name', 'pay_type_value');
parentDiv.find('.pay_type_' + payType + '_div').find('.valueInput').eq(1).attr('name', 'pay_type_extra');
if (payType === '1') {
parentDiv.find('.pay_type_2_div').hide();
parentDiv.find('.pay_type_2_div').find('.valueInput').attr('name', '');
parentDiv.find('.pay_type_3_div').hide();
parentDiv.find('.pay_type_3_div').find('.valueInput').attr('name', '');
form.render('select');
}
if (payType === '2') {
parentDiv.find('.pay_type_1_div').hide();
parentDiv.find('.pay_type_1_div').find('.valueInput').attr('name', '');
parentDiv.find('.pay_type_3_div').hide();
parentDiv.find('.pay_type_3_div').find('.valueInput').attr('name', '');
form.render('select');
}
if (payType === '3') {
parentDiv.find('.pay_type_1_div').hide();
parentDiv.find('.pay_type_1_div').find('.valueInput').attr('name', '');
parentDiv.find('.pay_type_2_div').hide();
parentDiv.find('.pay_type_2_div').find('.valueInput').attr('name', '');
form.render('select');
}
});
form.on('select(pay_type_month)', function (data) {
const value = data.value;
console.log($(this).parents('.layui-input-inline').find('.valueInput').val(value));
});
form.on('select(pay_type_3_type)', function (data) {
const value = data.value;
let parentDiv = $(this).parents('.pay_type_3_div');
if (value === '首款比例') {
parentDiv.find('.temp').text('%')
parentDiv.find('.temp').next().val('%')
}
if (value === '首款金额') {
parentDiv.find('.temp').text('RMB')
parentDiv.find('.temp').next().val('RMB')
}
});
$(document).on('click', '.delete_pay_type', function () {
let count = $('.pay_type_div').size();
if (count <= 1) {
layer.msg('至少要保留一个付款方式', {icon: 5});
return;
}
var self = $(this);
layer.confirm('确定要删除付款方式吗?', function (index) {
self.parents('.pay_type_div').remove();
layer.closeAll();
});
});
$(document).on('click', '.add_pay_type', function () {
$('#pay_type_div_list').append($('#pay_type_template').html());
//不知道为什么元素的name总会变来变去,所以手动固定死,确保提交的时候,顺序和名称都是对的
$("input[name^='pay_type_value[']").attr('name','pay_type_value')
$("input[name^='pay_type_extra[']").attr('name','pay_type_extra')
$("select[name^='pay_type[']").attr('name','pay_type')
form.render('select');
});
});
</script>
\ No newline at end of file
<div class="layui-form-item">
<div class="layui-row">
<div clas="layui-col-md3">
<label class="layui-form-label"><span class="require" id="attachment_required_span">*</span>附件上传</label>
<div class="layui-input-inline" style="width: 155px" id="file_type_selector">
<select lay-verify="" lay-filter="file_type_selector" id="file_type_select">
<option value="">请选择</option>
<?php foreach(config('fixed.FileNameMapping') as $name=>$cnName): ?>
<option value="<?php echo e($name); ?>"><?php echo e($cnName); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<?php if(empty($supplier['supplier_id'])): ?>
<?php endif; ?>
<div class="layui-col-md9">
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm layui-btn-disabled"
id="disable_upload_button">请选择附件类型再上传
</button>
<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" id="upload_button"
style="display: none">选择文件上传
</button>
<input type="hidden" class="upload_obj" value="">
</div>
<div class="layui-col-md12" style="padding-left: 45px;margin-top: 5px" id="attachment_upload_div">
<blockquote class="layui-elem-quote layui-quote-nm" style="padding-bottom: 5px">
<div id="file_list" class="layui-row">
<?php foreach(config('fixed.FileNameMapping') as $name=>$cnName): ?>
<div id="<?php echo e($name); ?>_div" style="display: none">
<input type="hidden" id="<?php echo e($name); ?>">
<span><?php echo e($cnName); ?> :
<?php if($name=='registration_certificate'): ?>
<span style="color: red">如果供应商所在区域是海外,那么请确保商业登记证和供应商名称保持一致</span>
<?php endif; ?>
</span>
<div id="<?php echo e($name); ?>_file_div"></div>
<hr>
</div>
<?php endforeach; ?>
</blockquote>
</div>
</div>
</div>
<?php /*这个模板是用来附加附件的*/ ?>
<div id="file_template" style="display: none">
<div class="layui-row single_file_div">
<div class="layui-col-md3">
<label class="layui-form-label">附件文件名 : </label>
<div class="layui-input-inline" style="padding-top: 10px">
<a href="" target="_blank"></a>
<input type="hidden" id="file_name">
<input type="hidden" id="file_url">
<input type="hidden" id="field_name">
</div>
</div>
<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">
<option value="1">长期有效</option>
<option value="2">自定义</option>
</select>
</div>
<div class="layui-input-inline" style="width: 200px">
<input type="text" id="validity_period"
placeholder="请选择时间区间" autocomplete="off" class="" disabled>
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label">附件说明 :</label>
<div class="layui-input-inline" style="width: 300px">
<input type="text" id="description"
placeholder="附件说明" class="layui-input"
value="">
</div>
<button style="margin-top: 3px" class="layui-btn layui-btn-xs layui-btn-danger delete_file">删除</button>
</div>
</div>
</div>
<?php echo $__env->make('script.supplier.SupplierFileScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'upload'], function () {
let table = layui.table;
let form = layui.form;
let admin = layui.admin;
let element = layui.element;
let upload = layui.upload;
let supplierId = getQueryVariable('supplier_id')
table.render({
elem: '#receiptList',
url: '/api/supplier_receipt/getSupplierReceiptList',
method: 'post',
size: 'sm',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: supplierId
},
width: '70%',
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
<?php if($operate=='update'): ?>
{
type: 'radio',
},
<?php endif; ?>
{
field: 'receipt_type', title: '银行类型', align: 'center', width: 120
},
{field: 'bank_name', title: '<span class="require">* </span>开户名称', align: 'center', width: 150},
{field: 'bank_adderss', title: '<span class="require">* </span>开户行', align: 'center', width: 150},
{field: 'account_no', title: '<span class="require">* </span>银行账号', align: 'center', width: 130},
{field: 'account_name', title: '账户名称', align: 'center', width: 150},
{field: 'swift_code', title: 'Swift Code', align: 'center', width: 130},
// {field: 'international_code', title: '国际代码', align: 'center', width: 130},
{
field: 'certificate',
title: '<span class="require">* </span>信息凭证',
width: 150, align: 'center',
templet: function (data) {
return "<a style='color: blue' href='" + data.certificate + "' target='_blank'>" + data.certificate + "</a>";
}
},
{field: 'account_adderss', title: '银行地址', align: 'center', width: 200},
{
field: 'nation_name', title: '银行国家', align: 'center', width: 100, templet: function (data) {
return data.nation ? data.nation.name_cn : '';
}
},
{field: 'intermediary_bank', title: '中转行', align: 'center', width: 150},
{field: 'remark', title: '备注', align: 'center', width: 200},
]],
id: 'receiptList',
page: {},
});
//新增银行弹窗
$("#add_bank").click(function () {
layer.open({
type: 2,
content: '/supplier_receipt/AddSupplierReceipt?view=iframe&supplier_id=' + supplierId,
area: ['50%', '90%'],
title: '新增银行',
end: function () {
table.reload('receiptList');
}
});
})
//修改银行弹窗
$("#update_bank").click(function () {
let checkStatus = table.checkStatus('receiptList');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的银行数据', {icon: 5})
} else {
let receiptId = data[0].receipt_id;
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
content: '/supplier_receipt/UpdateSupplierReceipt?view=iframe&supplier_id=' + supplierId + '&receipt_id=' + receiptId,
area: ['50%', '90%'],
title: '修改银行',
end: function () {
table.reload('receiptList');
}
});
}
})
$("#delete_bank").click(function () {
let checkStatus = table.checkStatus('receiptList');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的银行', {icon: 5})
} else {
layer.confirm('确定要删除该银行信息?', function (index) {
let receiptId = data[0].receipt_id;
let res = ajax('/api/supplier_receipt/DeleteSupplierReceipt', {receipt_id: receiptId})
if (res.err_code === 0) {
table.reload('receiptList')
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'laydate', 'xmSelect'], function () {
let form = layui.form;
if (<?php echo e($supplier['sku_audit_ruler']['skip']); ?>){
$(function () {
$('.audit_ruler_item').prop('disabled', true);
form.render()
})
}
//点击无需审核,所有选项变灰
form.on('radio(is_skip)', function(data){
if (data.value === '1') {
$('.audit_ruler_item').prop('disabled', true);
form.render()
}else{
$('.audit_ruler_item').prop('disabled', false);
form.render()
}
console.log(data.elem); //得到radio原始DOM对象
console.log(data.value); //被点击的radio的value值
});
});
</script>
\ No newline at end of file
<div class="layui-row">
<?php if($operate == 'update'): ?>
<div class="layui-btn-group demoTable" style="margin-top: 5px">
<button type="button" class="layui-btn layui-btn-sm" id="add_bank">新增</button>
<button type="button" class="layui-btn layui-btn-sm" id="update_bank">修改</button>
<button type="button" class="layui-btn layui-btn-sm" id="delete_bank">删除</button>
</div>
<?php endif; ?>
<table class="layui-table" lay-filter="receiptList" id="receiptList"></table>
</div>
<?php echo $__env->make('script.supplier.SupplierReceiptScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="layui-header">
<div class="layui-logo">
<img src="/images/warehouse.png"/>
<cite>&nbsp;<?php echo e(config('website.webTitle')); ?> </cite>
</div>
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item" lay-unselect>
<a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
</li>
<li class="layui-nav-item" lay-unselect>
<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
</li>
</ul>
<ul class="layui-nav layui-layout-right">
<?php /* <li class="layui-nav-item" lay-unselect>*/ ?>
<?php /* <a id="Warehouse">当前仓库: A仓库</a>*/ ?>
<?php /* <dl class="layui-nav-child">*/ ?>
<?php /* <dd lay-unselect>*/ ?>
<?php /* <a data-id="A" class="SwitchWarehouse">A仓库</a>*/ ?>
<?php /* <a data-id="B" class="SwitchWarehouse">B仓库</a>*/ ?>
<?php /* </dd>*/ ?>
<?php /* </dl>*/ ?>
<?php /* </li>*/ ?>
<li class="layui-nav-item layui-hide-xs" lay-unselect>
<a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a>
</li>
<?php /* <li class="layui-nav-item layui-hide-xs" lay-unselect>*/ ?>
<?php /* <a ew-event="lockScreen" title="锁屏"><i class="layui-icon layui-icon-password"></i></a>*/ ?>
<?php /* </li>*/ ?>
<li class="layui-nav-item" lay-unselect>
<a>
<img src="<?php echo e(isset($header) ? $header : '/images/missing_face.png'); ?>" class="layui-nav-img">
<cite><?php echo e(isset($username) ? $username : ''); ?></cite>
</a>
<dl class="layui-nav-child">
<dd lay-unselect>
<a href="<?php echo e(Config::get('website.login')['logout'].'?redirect='.URL::current().'&from=login'); ?>" style="margin-right:10px;" onclick="clearTips()"><i class="fa fa-sign-out"></i><span class="nav-label">切换账号</span></a>
<a href="<?php echo e(Config::get('website.login')['logout'].'?redirect='.URL::current().'&from=login'); ?>" onclick="clearTips()" ><i class="fa fa-sign-out"></i><span class="nav-label">退出</span></a>
</dd>
</dl>
</li>
<li class="layui-nav-item" lay-unselect>
<a ew-event="" title=""><i class="layui-icon layui-icon-more-vertical"></i></a>
</li>
</ul>
</div>
<script>
function clearTips(){
layui.use(['admin', 'index'], function () {
let admin = layui.admin;
admin.putTempData('has_pop_up_all_channel_user_supplier_tips', 0);
});
}
</script>
\ No newline at end of file
<blockquote class="layui-elem-quote layui-text">
<b>SKU配置</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('sku_tag','SKU 标签',!empty($supplier)?$supplier['sku_tag']:'',config('field.SkuTag'),['width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('sku_mode','SKU 模式',!empty($supplier)?$supplier['sku_mode']:'',config('field.SkuMode'),['width'=>'150px','disable'=> true]); ?>
</div>
<div class="layui-col-md6">
</div>
</div>
<blockquote class="layui-elem-quote layui-text">
<b>SKU相关设置 - 联营库存数据</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-inline" style="width: 100%">
<label class="layui-form-label">数据新增规则 : </label>
<div class="layui-input-inline" style="width: 420px">
<?php if(!empty($supplier['sku_upload_ruler'])): ?>
<div class="layui-row">
现货 :
<?php foreach($supplier['sku_upload_ruler'] as $key=>$flag): ?>
<?php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
?>
<?php if(!empty($ruler) && strpos($key,'futures')===false): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
<?php if($flag): ?>
checked
<?php endif; ?>
title="<?php echo e(array_get(config('fixed.SkuUploadRuler'),$key)); ?>">
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="layui-row">
期货 :
<?php foreach($supplier['sku_upload_ruler'] as $key=>$flag): ?>
<?php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
?>
<?php if(!empty($ruler) && strpos($key,'futures')!==false): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
<?php if($flag): ?>
checked
<?php endif; ?>
title="<?php echo e(array_get(config('fixed.SkuUploadRuler'),$key)); ?>">
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php else: ?>
<div class="layui-row">
现货 :
<?php foreach(config('fixed.SkuUploadRuler') as $key=>$flag): ?>
<?php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
?>
<?php if(!empty($ruler) && strpos($key,'futures')===false): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
title="<?php echo e($flag); ?>">
<?php endif; ?>
<?php endforeach; ?>
</div>
<div class="layui-row">
期货 :
<?php foreach(config('fixed.SkuUploadRuler') as $key=>$flag): ?>
<?php
$ruler = array_get(config('fixed.SkuUploadRuler'),$key);
?>
<?php if(!empty($ruler) && strpos($key,'futures')!==false): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
title="<?php echo e($flag); ?>">
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<div class="layui-form-mid layui-word-aux">
SKU数据导入条件勾选后只要满足该条件,就可以导入数据;默认导入条件是有库存、价格、起订量且起订量>库存
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline" style="width: 100%">
<label class="layui-form-label">审核内容配置 : </label>
<div class="layui-input-inline" style="width: 205px">
<input type="radio" name="sku_audit_ruler[skip]" lay-filter="is_skip"
<?php if($supplier['sku_audit_ruler']['skip']==1): ?> checked <?php endif; ?> value="1" title="无需审核">
<input type="radio" name="sku_audit_ruler[skip]" lay-filter="is_skip"
<?php if($supplier['sku_audit_ruler']['skip']==0): ?> checked <?php endif; ?> value="0" title="需要审核内容">
</div>
<div class="layui-input-inline" style="width: 700px">
<?php if(!empty($supplier['sku_audit_ruler'])): ?>
<?php foreach($supplier['sku_audit_ruler']['audit_ruler'] as $key=>$flag): ?>
<?php if(!empty(array_get(config('fixed.SkuAuditRuler.audit_ruler'),$key))): ?>
<input type="checkbox" name="sku_audit_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
class="audit_ruler_item"
<?php if($flag): ?>
checked
<?php endif; ?>
title="<?php echo e(array_get(config('fixed.SkuAuditRuler.name_map'),$key)); ?>">
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php foreach(config('fixed.SkuAuditRuler.audit_ruler') as $key=>$flag): ?>
<input type="checkbox" name="sku_audit_ruler[<?php echo e($key); ?>]"
lay-skin="primary" checked class="audit_ruler_item"
title="<?php echo e(array_get(config('fixed.SkuAuditRuler.name_map'),$key)); ?>">
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php echo $__env->make('web.supplier.SkuUploadStatus', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>;
</div>
<?php echo $__env->make('script.supplier.SkuRulerScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>运费设置-国际运费<span
style="color: orange;margin-left: 10px">PS:设置后的运费规则,将会应用在【询报价系统】供销售看到(仅做为提示)</span></b>
</blockquote>
<?php /*运费规则*/ ?>
<div class="layui-form-item">
<?php if($operate==='update'): ?>
<button class="layui-btn layui-btn-sm" type="button" id="saveShippingCostRuler">添加运费规则</button>
<?php endif; ?>
<table class="layui-table" lay-filter="shippingCostRulerList" id="shippingCostRulerList"></table>
</div>
<blockquote class="layui-elem-quote layui-text">
<b>采购备注<span
style="color: orange;margin-left: 10px">PS:设置后的备注信息,将会应用在【询报价系统】供销售看到(仅做为提示)</span></b>
</blockquote>
<?php /*采购备注*/ ?>
<div class="layui-form-item">
<?php if($operate==='update'): ?>
<button class="layui-btn layui-btn-sm" type="button" id="savePurchaserRemark">添加备注</button>
<?php endif; ?>
<table class="layui-table" lay-filter="purchaseRemarkList" id="purchaseRemarkList"></table>
</div>
<div <?php if($operate==="detail"): ?> style="display: none" <?php endif; ?>>
<blockquote class="layui-elem-quote layui-text">
<b>采购附加费设置</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">商品总价不满</label>
<div class="layui-input-inline" style="width: 100px;">
<input class="layui-input" type="text" name="cn[max]" id="cn_max"
value="<?php echo e(isset($supplier['extra_fee']['cn']['max']) ? $supplier['extra_fee']['cn']['max'] : ''); ?>"
lay-verify="num">
</div>
<div class="layui-form-label" style="width: 100px;margin-left: -20px">元(人民币),收取</div>
<div class="layui-input-inline" style="width: 100px;">
<input class="layui-input" type="text" name="cn[price]"
value="<?php echo e(isset($supplier['extra_fee']['cn']['price']) ? $supplier['extra_fee']['cn']['price'] : ''); ?>"
lay-verify="float" value="">
</div>
<div class="layui-form-label" style="width: 40px;margin-left: -20px">元运费</div>
<div class="layui-input-inline" style="width: 100px;">
<input type="checkbox" title="全渠道收费" lay-skin="primary" lay-filter="cn_filter">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">商品总价不满</label>
<div class="layui-input-inline" style="width: 100px;">
<input class="layui-input" type="text" name="hk[max]" id="hk_max"
value="<?php echo e(isset($supplier['extra_fee']['hk']['max']) ? $supplier['extra_fee']['hk']['max'] : ''); ?>"
lay-verify="num" value="">
</div>
<div class="layui-form-label" style="width: 55px;margin-left: -20px">美金,收取</div>
<div class="layui-input-inline" style="width: 100px;">
<input class="layui-input" type="text" name="hk[price]"
value="<?php echo e(isset($supplier['extra_fee']['hk']['price']) ? $supplier['extra_fee']['hk']['price'] : ''); ?>"
lay-verify="float" value="">
</div>
<div class="layui-form-label" style="width: 40px;margin-left: -20px">元运费</div>
<div class="layui-input-inline" style="width: 100px;">
<input type="checkbox" title="全渠道收费" lay-skin="primary" lay-filter="hk_filter">
</div>
</div>
</div>
<blockquote class="layui-elem-quote layui-text">
</blockquote>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">人民币系数</label>
<div class="layui-input-inline" style="width: 50px">
<input type="text" name="cn_ratio" value="<?php echo e(isset($supplier['cn_ratio']) ? $supplier['cn_ratio'] : 1); ?>"
placeholder="请输入人民币系数" autocomplete="off" class="layui-input"
style="display: inline-block">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">美金系数</label>
<div class="layui-input-inline" style="width: 50px">
<input type="text" name="us_ratio" value="<?php echo e(isset($supplier['us_ratio']) ? $supplier['us_ratio'] : 1); ?>"
placeholder="请输入采购附加费" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">
基数为1,如利润为10%,请填写1.1
</div>
</div>
</div>
<blockquote class="layui-elem-quote layui-text">
<b>货期调整</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">大陆交期</label>
<div class="layui-input-inline" style="width: 50px">
<input type="text" name="cn_delivery_time" value="<?php echo e(isset($supplier['cn_delivery_time']) ? $supplier['cn_delivery_time'] : 1); ?>"
autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 50px">
<select name="cn_delivery_time_period">
<option value="天" <?php if($supplier['cn_delivery_time_period'] == '天'): ?> selected <?php endif; ?>></option>
<option value="周" <?php if($supplier['cn_delivery_time_period'] == '周'): ?> selected <?php endif; ?>></option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">香港交期</label>
<div class="layui-input-inline" style="width: 50px">
<input type="text" name="us_delivery_time" value="<?php echo e(isset($supplier['us_delivery_time']) ? $supplier['us_delivery_time'] : 1); ?>"
autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 50px">
<select name="us_delivery_time_period">
<option value="天" <?php if($supplier['us_delivery_time_period'] == '天'): ?> selected <?php endif; ?>></option>
<option value="周" <?php if($supplier['us_delivery_time_period'] == '周'): ?> selected <?php endif; ?>></option>
</select>
</div>
<div class="layui-form-mid layui-word-aux">
单位为工作日,周。格式2-6工作日,1-2周
</div>
</div>
</div>
</div>
<script type="text/html" id="shippingCostOperate">
<button class="layui-btn layui-btn-xs" type="button" lay-event="edit">查看</button>
<button class="layui-btn layui-btn-xs layui-btn-danger" type="button" lay-event="delete">删除</button>
</script>
<script type="text/html" id="operate">
<button class="layui-btn layui-btn-xs" type="button" lay-event="edit">查看</button>
<button class="layui-btn layui-btn-xs layui-btn-danger" type="button" lay-event="delete">删除</button>
</script>
<?php echo $__env->make('script.supplier.SupplierRulerScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="layui-collapse">
<?php
$routerName = explode('/', request()->path())[1];
?>
<?php if($routerName=='SupplierExaminationList'): ?>
<form class="layui-form" style="margin-top: 15px">
<div class="layui-row">
<div class="layui-inline">
<label class="layui-form-label">供应商名称</label>
<div class="layui-input-inline">
<input type="text" value="" name="supplier_name" placeholder="支持模糊匹配" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_name','采购员',request()->get('status'),$purchaseUserNames); ?>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('abnormal_level','异常等级',request()->get('abnormal_level'),config('field.SupplierAbnormalLevel')); ?>
</div>
<div class="layui-inline" style="width: 600px">
<?php $transformableTimeIntervalPresenter = app('App\Presenters\Filter\TransformableTimeIntervalPresenter'); ?>
<?php echo $transformableTimeIntervalPresenter->render(['examine_time'=>'检货时间']); ?>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $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=""
lay-filter="load">查询
</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn" lay-submit="" lay-filter="reset">重置
</button>
</div>
</form>
</div>
<?php endif; ?>
<div style="margin-left: 20px;margin-right: 20px">
<div class="layui-btn-group demoTable" style="margin-top: 15px">
<?php if(checkPerm('AddSupplierExamination')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="add_supplier_examination">新增</button>
<?php endif; ?>
<?php if(checkPerm('BatchUpdateSupplierExamination')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="batch_update_supplier_examination">批量修改</button>
<?php endif; ?>
<?php if(checkPerm('UpdateSupplierExamination')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="update_supplier_examination">编辑</button>
<?php endif; ?>
<?php if($routerName=='SupplierExaminationList'): ?>
<?php if(checkPerm('ImportSupplierExamination')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="import_supplier_examination">导入</button>
<?php endif; ?>
<a href="/data/import_examination_template.xlsx" target="_blank" class="layui-btn layui-btn-sm"
id="download_supplier_examination_import_template">下载模板</a>
<?php endif; ?>
<?php if(checkPerm('DeleteSupplierExamination')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="delete_supplier_examination">删除</button>
<?php endif; ?>
</div>
<table class="layui-table" id="supplierExaminationList" lay-filter="supplierExaminationList"></table>
</div>
<?php if(request()->get('supplier_id')): ?>
<?php echo $__env->make('script.SupplierExaminationListScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>控制台</title>
<link rel="stylesheet" href="/plugins/assets/libs/layui/css/layui.css"/>
<link rel="stylesheet" href="/plugins/assets/module/admin.css"/>
<script src="/js/jquery-2.2.1.js"></script>
<script type="text/javascript" src="/plugins/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/plugins/assets/js/common.js?version=<?php echo e(time()); ?>"></script>
<script type="text/javascript" src="/plugins/assets/js/alpine.js" defer></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style>
html * {
font-size: 12px !important;
}
.layui-input {
height: 30px;
}
.layui-input-inline {
margin-top: 5px;
}
input:focus, textarea:focus {
outline: 1px solid #AFECAB;
}
.require {
color: red;
font-size: 20px;
margin-right: 3px;
}
.layui-table-click {
background-color: #ddf2e9 !important;
}
.list-href {
color: dodgerblue;
}
.list-href:hover {
color: #1417F4;
}
</style>
<body>
<!-- 正文开始 -->
<div class="layui-fluid ew-console-wrapper">
<div class="layui-card">
<div class="layui-card-body">
<?php if(!empty($view)): ?>
<?php echo $__env->make("web.$view", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php else: ?>
<?php echo $__env->make("web.$id", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
</div>
</div>
</div>
<!-- 加载动画 -->
<!-- js部分 -->
<!-- 引入同名的js,默认引入 -->
<?php if(empty($lead_in_js) || $lead_in_js === true): ?>
<?php /* <script type="text/javascript" src="/js/<?php echo e($id); ?>.js?v=<?php echo e(random(3,true)); ?>"></script>*/ ?>
<?php if(!empty($view)): ?>
<?php echo $__env->make('script.'.$view.'Script', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php else: ?>
<?php echo $__env->make('script.'.$id.'Script', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
<?php endif; ?>
<script>
$(function () {
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let table = layui.table;
let form = layui.form;
let admin = layui.admin;
let element = layui.element;
let supplierId = getQueryVariable('supplier_id');
table.render({
elem: '#contactList',
url: '/api/supplier_contact/GetSupplierContactList',
method: 'get',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: getQueryVariable("supplier_id")
},
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
{
type: 'radio',
},
{
field: 'supplier_consignee',
title: '<span class="require">* </span>联系人',
align: 'center',
width: 150
},
{field: 'supplier_position', title: '<span class="require">* </span>职位', align: 'center', width: 100},
{
field: 'supplier_email',
title: '<span class="require">* </span>邮箱',
align: 'center',
width: 200,
templet: function (data) {
return data.supplier_email ? '<span>' + data.supplier_email + '</span><span style="color: dodgerblue" class="viewContact" type="supplier_email" contact_id="' + data.contact_id + '">查看</span>' : '';
}
},
{
field: 'supplier_mobile',
title: '<span class="require">* </span>手机号',
align: 'center',
width: 180,
templet: function (data) {
return data.supplier_mobile ? '<span>' + data.supplier_mobile + '</span><span style="color: dodgerblue" class="viewContact" type="supplier_mobile" contact_id="' + data.contact_id + '">查看</span>' : '';
}
},
{
field: 'supplier_telephone',
title: '<span class="require">* </span>座机',
align: 'center',
width: 180,
templet: function (data) {
return data.supplier_telephone ? '<span>' + data.supplier_telephone + '</span><span style="color: dodgerblue" class="viewContact" type="supplier_telephone" contact_id="' + data.contact_id + '">查看</span></span>' : '';
}
},
{
field: 'supplier_qq', title: 'QQ', align: 'center', width: 180, templet: function (data) {
return data.supplier_qq ? '<span>' + data.supplier_qq + '</span><span style="color: dodgerblue" class="viewContact" type="supplier_qq" contact_id="' + data.contact_id + '">查看</span>' : '';
}
},
{field: 'supplier_fax', title: '传真', align: 'center', width: 140},
{field: 'channel_name', title: '<span class="require">* </span>采购员', align: 'center', width: 110},
{field: 'working_status', title: '采购员状态', align: 'center', width: 120},
]],
id: 'contactList',
page: {},
});
//新增联系方式
$("#add_contact").click(function () {
let supplierId = getQueryVariable('supplier_id');
layer.open({
type: 2,
content: '/supplier_contact/AddSupplierContact?view=iframe&supplier_id=' + supplierId,
area: ['600px', '525px'],
title: '新增联系人',
end: function () { // 监听弹窗关闭
// location.href = '/supplier/UpdateSupplier?view=iframe&tab=contact&supplier_id='+supplierId;
table.reload('contactList');
}
});
})
//设置SKU采购
$("#set_yunxin_channel_user").click(function () {
let supplierId = getQueryVariable('supplier_id');
layer.open({
type: 2,
content: '/supplier/SetYunxinChannelUser?view=iframe&supplier_id=' + supplierId,
area: ['600px', '525px'],
title: '配置线上采购员',
end: function () { // 监听弹窗关闭
table.reload('contactList');
}
});
})
//更新
$(document).on('click', '#update_contact', function () {
let checkStatus = table.checkStatus('contactList');
let data = checkStatus.data;
if (!data.size) {
layer.msg('请先选择要操作的联系人', {icon: 5})
}
let contactId = data[0].contact_id;
layer.open({
type: 2,
content: '/supplier_contact/UpdateSupplierContact?view=iframe&contact_id=' + contactId,
area: ['600px', '525px'],
title: '编辑联系人',
end: function () { // 监听弹窗关闭
// location.href = '/supplier/UpdateSupplier?view=iframe&tab=contact&supplier_id='+supplierId;
table.reload('contactList');
}
});
});
//删除
$(document).on('click', '#batchDelete', function () {
let checkStatus = table.checkStatus('contactList');
let data = checkStatus.data;
let contactIds = [];
$.each(data, function (index, value) {
contactIds.push(value.contact_id);
});
batchDeleteContact(contactIds);
});
//批量删除操作
function batchDeleteContact(contactId) {
layer.confirm('确定要删除所选联系方式?', function (index) {
let resp = ajax('/api/supplier_contact/DeleteSupplierContact', {contact_id: contactId});
if (!resp) {
layer.msg('网络连接失败', {'icon': 5});
return false;
}
if (resp.err_code === 0) {
// location.href = '/supplier/UpdateSupplier?view=iframe&tab=contact&supplier_id='+supplierId;
table.reload('contactList');
layer.closeAll();
layer.msg(resp.err_msg, {'icon': 6});
} else {
layer.msg(resp.err_msg, {'icon': 5});
return false;
}
});
}
$(document).on('click', '.viewContact', function () {
if ($(this).text() === '隐藏') {
$(this).prev().text($(this).attr('prev_text'));
$(this).text('查看');
} else {
let contactId = $(this).attr('contact_id');
let type = $(this).attr('type');
let resp = ajax('/api/supplier_contact/GetSupplierContact', {contact_id: contactId, type: type});
if (!resp) {
layer.msg('网络连接失败', {'icon': 5});
return false;
}
let prevText = $(this).prev().text();
$(this).attr('prev_text', prevText);
if (resp.err_code === 0) {
switch (type) {
case 'supplier_email':
$(this).prev().text(resp.data.supplier_email);
break;
case 'supplier_qq':
$(this).prev().text(resp.data.supplier_qq);
break;
case 'supplier_mobile':
$(this).prev().text(resp.data.supplier_mobile);
break;
case 'supplier_telephone':
$(this).prev().text(resp.data.supplier_telephone);
break;
}
$(this).text('隐藏');
$.get(getLogDomain() + "/api/addSensitiveClick", {
uid: getCookie("oa_user_id") || 0,
sys_id: 4,
mask_type: type || 0,
origin_id: contactId || 0,
source_from: window.location.href
});
console.log(resp);
} else {
layer.msg(resp.err_msg, {'icon': 5});
return false;
}
}
});
});
</script>
\ No newline at end of file
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'upload'], function () {
let table = layui.table;
let form = layui.form;
let admin = layui.admin;
let element = layui.element;
let upload = layui.upload;
let supplierId = getQueryVariable('supplier_id')
table.render({
elem: '#attachmentList',
url: '/api/supplier_attachment/getSupplierAttachmentList?supplier_id=' + supplierId,
method: 'post',
size: 'sm',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: supplierId
},
width: '70%',
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
<?php if($operate=='update'): ?>
{
type: 'radio',
},
<?php endif; ?>
{
field: 'type_name', title: '<span class="require">* </span>附件类型', align: 'center', width: 150
},
{
field: 'file_name',
title: '<span class="require">* </span>附件名称', align: 'center', width: 270,
templet: function (data) {
return "<a style='color: blue' href='" + data.file_url + "' target='_blank'>" + data.file_name + "<div style='display:none' class='attachment_fields'>" + data.field_name + "</div></a>";
}
},
{field: 'description', title: '附件说明', align: 'center', width: 250},
{field: 'validity_period', title: '<span class="require">* </span>有效期', align: 'center', width: 220},
{field: 'create_name', title: '线上采购员', align: 'center', width: 100},
{field: 'create_time', title: '上传时间', align: 'center', width: 150},
]],
id: 'attachmentList',
page: {},
});
//新增附件弹窗
$("#add_attachment").click(function () {
layer.open({
type: 2,
content: '/supplier_attachment/AddSupplierAttachment?view=iframe&supplier_id=' + supplierId,
area: ['50%', '70%'],
title: '新增附件',
end: function () {
table.reload('attachmentList');
}
});
})
//修改附件弹窗
$("#update_attachment").click(function () {
let checkStatus = table.checkStatus('attachmentList');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的附件', {icon: 5})
} else {
let attachment_id = data[0].attachment_id;
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
content: '/supplier_attachment/UpdateSupplierAttachment?view=iframe&supplier_id=' + supplierId + '&attachment_id=' + attachment_id,
area: ['50%', '70%'],
title: '修改附件',
end: function () {
table.reload('attachmentList');
}
});
}
})
$("#delete_attachment").click(function () {
let checkStatus = table.checkStatus('attachmentList');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的附件', {icon: 5})
} else {
layer.confirm('确定要删除选中的附件吗?', function (index) {
let attachmentId = data[0].attachment_id;
let res = ajax('/api/supplier_attachment/DeleteSupplierAttachment', {attachment_id: attachmentId})
if (res.err_code === 0) {
table.reload('attachmentList')
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'laydate', 'xmSelect'], function () {
let admin = layui.admin;
let form = layui.form;
let table = layui.table;
let layDate = layui.laydate;
let element = layui.element;
let xmSelect = layui.xmSelect;
form.on('checkbox(cn_filter)', function (data) {
if (data.elem.checked === true) {
$('#cn_max').val(9999999);
}
});
form.on('checkbox(hk_filter)', function (data) {
if (data.elem.checked === true) {
$('#hk_max').val(9999999);
}
});
let isDetail = <?php echo e($operate==="update"?0:1); ?>;
let cols = [
{
field: 'status', title: '状态', width: 80, templet: function (data) {
return data.status == 1 ? "<span style='color: red'>停用</span>" : '启用';
}
},
{field: 'participate_type_name', title: '参与类型', width: 140},
{field: 'duration', title: '开始时间 - 截至时间', width: 250},
{field: 'remark', title: '备注内容',},
];
if (!isDetail) {
cols.unshift({field: 'operate', title: '操作', width: 130, templet: '#operate'});
}
table.render({
elem: '#purchaseRemarkList',
url: '/api/purchase_remark/GetPurchaseRemarkList',
method: 'get',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: getQueryVariable("supplier_id")
},
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [cols],
id: 'purchaseRemarkList',
page: {},
});
//新增
$("#savePurchaserRemark").click(function () {
let supplierId = getQueryVariable('supplier_id');
layer.open({
type: 2,
content: '/purchase_remark/SavePurchaseRemark?view=iframe&supplier_id=' + supplierId,
area: ['800px', '725px'],
title: '新增采购备注',
end: function () { // 监听弹窗关闭
table.reload('purchaseRemarkList');
}
});
})
table.on('tool(purchaseRemarkList)', function (obj) {
let data = obj.data;
let layEvent = obj.event;
if (layEvent === 'edit') {
layer.open({
type: 2,
area: ['800px', '725px'],
fixed: false,
offset: '50px',
//不固定
// maxmin: true,
title: '查看采购备注 ',
content: '/purchase_remark/SavePurchaseRemark?view=iframe&supplier_id=' + getQueryVariable('supplier_id') + '&id=' + data.id,
end: function () { // 监听弹窗关闭
table.reload('purchaseRemarkList');
}
});
}
if (layEvent === 'delete') {
layer.confirm('确定要删除该条采购备注吗?', function (index) {
let res = ajax('/api/purchase_remark/DeletePurchaseRemark', {id: data.id});
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6})
table.reload('purchaseRemarkList');
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
cols = [
{field: 'id', title: '规则', width: 80},
{field: 'ruler_text', title: '内容',},
];
if (!isDetail) {
cols.unshift({field: 'operate', title: '操作', width: 130, templet: '#operate'});
}
table.render({
elem: '#shippingCostRulerList',
url: '/api/shipping_cost_ruler/GetShippingCostRulerList',
method: 'get',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: getQueryVariable("supplier_id")
},
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [cols],
id: 'shippingCostRulerList',
page: {},
});
//新增
$("#saveShippingCostRuler").click(function () {
let supplierId = getQueryVariable('supplier_id');
layer.open({
type: 2,
content: '/shipping_cost_ruler/SaveShippingCostRuler?view=iframe&supplier_id=' + supplierId,
area: ['800px', '425px'],
title: '添加运费规则',
end: function () { // 监听弹窗关闭
table.reload('shippingCostRulerList');
}
});
})
table.on('tool(shippingCostRulerList)', function (obj) {
let data = obj.data;
console.log(data);
let layEvent = obj.event;
if (layEvent === 'edit') {
layer.open({
type: 2,
area: ['800px', '425px'],
fixed: false,
offset: '50px',
//不固定
// maxmin: true,
title: '查看运费规则 ',
content: '/shipping_cost_ruler/SaveShippingCostRuler?view=iframe&supplier_id=' + getQueryVariable('supplier_id') + '&id=' + data.id,
end: function () { // 监听弹窗关闭
table.reload('shippingCostRulerList');
}
});
}
if (layEvent === 'delete') {
layer.confirm('确定要删除该条运费规则吗?', function (index) {
let res = ajax('/api/shipping_cost_ruler/DeleteShippingCostRuler', {id: data.id});
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6})
table.reload('shippingCostRulerList');
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
});
</script>
\ No newline at end of file
<?php echo $__env->make('web.supplier.SupplierListFilter', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="layui-btn-group demoTable" style="margin-bottom: 15px;margin-top: 15px">
<?php if(checkPerm('AddSupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="add_supplier">新增</button>
<?php endif; ?>
<?php if(checkPerm('DisableSupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="disable_supplier">禁用</button>
<?php endif; ?>
<?php if(checkPerm('AuditSupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="audit_supplier">审核</button>
<?php endif; ?>
<?php /* <?php if(checkPerm('AllocatePurchaseUser')): ?>*/ ?>
<?php /* <button type="button" class="layui-btn layui-btn-sm" id="allocate_purchase_user">分配渠道员</button>*/ ?>
<?php /* <?php endif; ?>*/ ?>
<?php if(checkPerm('BatchAllocatePurchaseUser')): ?>
<?php /* <button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_purchase_user">批量分配渠道员</button>*/ ?>
<button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_purchase_user">分配渠道员</button>
<?php endif; ?>
<?php if(checkPerm('AllocateChannelUser')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="allocate_channel_user">分配采购员</button>
<?php endif; ?>
<?php if(checkPerm('ChangeSupplierIsType')): ?>
<button type="button" class="layui-btn layui-btn-sm" title="该操作可以将竞调供应商转为正式供应商"
id="change_supplier_is_type">
转正供应商
</button>
<?php endif; ?>
<?php /* <button type="button" class="layui-btn layui-btn-sm" title="点击确定审核后会进入审核中状态"*/ ?>
<?php /* id="batch_apply_in_review_supplier">*/ ?>
<?php /* 申请审核*/ ?>
<?php /* </button>*/ ?>
<?php if(checkPerm('BlockSupplier')): ?>
<?php /* <button type="button" class="layui-btn layui-btn-sm" id="block_supplier">*/ ?>
<?php /* 拉黑*/ ?>
<?php /* </button>*/ ?>
<?php endif; ?>
<?php if(request()->user->userId==1000 || request()->user->userId==2082): ?>
<button type="button" class="layui-btn layui-btn-sm" title="该操作可以将供应商同步到供应商"
id="sync_supplier_to_erp">
金蝶同步
</button>
<button type="button" class="layui-btn layui-btn-sm" title="该操作可以将供应商同步到一体化"
id="sync_supplier_to_united">
一体化同步
</button>
<?php endif; ?>
<?php if(checkPerm('ApplySupplierShare')): ?>
<?php /* <?php if(checkPerm('BlockSupplier')): ?>*/ ?>
<button type="button" class="layui-btn layui-btn-sm" id="apply_supplier_share">
共用申请
</button>
<?php endif; ?>
<?php if(checkPerm('AuditSupplierShare')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="audit_supplier_share_apply">
共用审核
<?php if(!empty($shareApplyCount)): ?>
(<?php echo e($shareApplyCount); ?>)
<span style="margin-left: 0" class="layui-badge-dot layui-bg-orange"></span>
<?php endif; ?>
</button>
<?php endif; ?>
<?php if(checkPerm('BatchAddTag')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="batch_add_tags">
新增供应商标签
</button>
<?php endif; ?>
<?php if(checkPerm('BatchAllocateYunxinChannelUser')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="batch_allocate_yunxin_channel_user">设置SKU采购
</button>
<?php endif; ?>
<?php if(checkPerm('ExportSupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="export_supplier">导出采购员全离职供应商</button>
<?php endif; ?>
<?php if(checkPerm('QuerySupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="query_supplier">查询供应商</button>
<?php endif; ?>
<?php if(checkPerm('TransferSupplier')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="transfer_supplier">供应商交接</button>
<?php endif; ?>
</div>
<button type="button" id="refreshWindow" style="display: none">刷新页面</button>
<table class="layui-table" id="list" lay-filter="list"></table>
<script>
</script>
<script type="text/html" id="operate">
<div style="text-align: left;">
<?php if($canAudit): ?>
<a href="/supplier/AddSupplier?supplier_id={{ d.supplier_id}}" class="btn btn-xs btn-outline btn-success"
target="_blank">修改</a>
<?php else: ?>
<a href="/supplier/AddSupplier?supplier_id={{ d.supplier_id}}" class="btn btn-xs btn-outline btn-success"
target="_blank">查看</a>
<?php endif; ?>
</div>
</script>
<blockquote class="layui-elem-quote layui-text">
<b>sku上传情况</b>
</blockquote>
<div class="layui-row" style="padding-left: 20px">
<div class="layui-col-md2">
SKU 上传次数 :<b style="color: red"><?php echo e(isset($sku_upload_log_count) ? $sku_upload_log_count : 0); ?></b>
</div>
</div>
<div class="layui-row" style="padding-left: 20px">
<div class="layui-col-md12">
SKU 历史上传情况 :
</div>
<table class="layui-table" lay-filter="skuUploadLogList" id="skuUploadLogList"></table>
</div>
<?php echo $__env->make('script.supplier.SkuUploadStatusScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
\ No newline at end of file
<style>
.layui-form-item {
margin-bottom: 5px;
}
</style>
<div class="layui-card">
<div class="layui-card-body">
<form class="layui-form" action="">
<input type="hidden" name="supplier_id" value="<?php echo e($supplier['supplier_id']); ?>">
<div class="layui-form-item">
<label class="layui-form-label">基本信息 : </label>
<div class="layui-input-block block-42" style="padding-top: 7px">
<?php echo e($supplier['supplier_name']); ?>
<a style="color: dodgerblue;margin-left: 20px"
ew-href="/supplier/SupplierDetail?view=iframe&supplier_id=<?php echo e($supplier['supplier_id']); ?>"
ew-title='供应商详情 - <?php echo e($supplier['supplier_code']); ?>'
><?php echo e($supplier['supplier_code']); ?></a>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">审核内容 : </label>
<div class="layui-input-block block-42" style="padding-top: 7px">
<?php if(!empty($auditContent)): ?>
<b><?php echo e($auditContent['action'] .' : '); ?></b>
<?php if(is_array($auditContent['content'])): ?>
<?php foreach($auditContent['content'] as $content): ?>
<p>
<?php echo e($content); ?>
</p>
<?php endforeach; ?>
<?php else: ?>
<?php echo e($auditContent['content']); ?>
<?php endif; ?>
<?php else: ?>
暂无
<?php endif; ?>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">供应商类别 : </label>
<div class="layui-input-block" style="padding-top: 7px">
<b><?php echo e(array_get(config('field.SupplierType'),$supplier['supplier_type'])); ?></b>
</div>
</div>
<?php 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><?php echo e($supplier['apply_audit_reason']); ?></p>
</div>
</div>
<?php endif; ?>
<div class="layui-form-item">
<label class="layui-form-label">审核意见 : </label>
<div class="layui-input-block">
<input type="radio" name="status" value="2" title="同意">
<input type="radio" name="status" value="3" title="不同意">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">原因说明 : </label>
<div class="layui-input-block">
<textarea name="reject_reason" placeholder="不同意时必须填写原因" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<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
lay-filter="auditSupplier">确认
</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" lay-submit
lay-filter="cancel">取消
</button>
</div>
</div>
</form>
</div>
</div>
\ No newline at end of file
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-tab">
<ul class="layui-tab-title">
<?php if(checkPerm('ViewAllLog')): ?>
<li style="padding: 0" class="layui-this" id="base_info">全部</li>
<?php endif; ?>
<?php if(checkPerm('ViewUpdateLog')): ?>
<li style="padding: 0" id="contact">修改记录</li>
<?php endif; ?>
<?php if(checkPerm('ViewLog')): ?>
<li style="padding: 0" id="ruler">查看记录</li>
<?php endif; ?>
<?php if(checkPerm('ViewSupplierLog')): ?>
<li style="padding: 0" id="ruler">信息记录</li>
<?php endif; ?>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<?php if(checkPerm('ViewAllLog')): ?>
<?php if(checkPerm('AddSupplierLog')): ?>
<form class="layui-form" action="">
<div class="layui-form-item" style="margin-left: -70px;margin-bottom: 0">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('type','类型',
'',config('fixed.SupplierLogType'),['required'=>false]); ?>
</div>
<div class="layui-form-item layui-form-text" style="margin-left: -70px">
<div class="layui-input-block">
<textarea name="desc" placeholder="请输入具体的信息内容"
class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<div align="left" style="margin-top: 20px;margin-left: 40px">
<button type="button"
class="layui-btn layui-btn-info layui-btn-sm submit-loading" lay-submit
lay-filter="addSupplierLog">添加信息记录
</button>
</div>
</div>
</form>
<?php endif; ?>
<div id="logs" style="margin-left: 5px">
<?php /*所有操作记录列表查看*/ ?>
<?php foreach($logs as $log): ?>
<?php if(is_array($log['content'])): ?>
<p><b><?php echo e($log['action']); ?></b> : </p>
<?php foreach($log['content'] as $content): ?>
<p><?php echo e($content); ?></p>
<?php endforeach; ?>
<?php else: ?>
<p><b><?php echo e($log['action']); ?></b> : <?php echo e($log['content']); ?></p>
<?php endif; ?>
<p style="color: grey"><?php echo e($log['add_time'].' '.$log['admin_name']); ?></p>
<hr/>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<div class="layui-tab-item">
<?php if(checkPerm('ViewUpdateLog')): ?>
<?php foreach($updateLogs as $log): ?>
<?php if(is_array($log['content'])): ?>
<p><b><?php echo e($log['action']); ?></b> : </p>
<?php foreach($log['content'] as $content): ?>
<p><?php echo e($content); ?></p>
<?php endforeach; ?>
<?php else: ?>
<p><b><?php echo e($log['action']); ?></b> : <?php echo e($log['content']); ?></p>
<?php endif; ?>
<p style="color: grey"><?php echo e($log['add_time'].' '.$log['admin_name']); ?></p>
<hr/>
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="layui-tab-item">
<?php if(checkPerm('ViewLog')): ?>
<?php foreach($viewLogs as $log): ?>
<?php if(is_array($log['content'])): ?>
<p><b><?php echo e($log['action']); ?></b> : </p>
<?php foreach($log['content'] as $content): ?>
<p><?php echo e($content); ?></p>
<?php endforeach; ?>
<?php else: ?>
<p><b><?php echo e($log['action']); ?></b> : <?php echo e($log['content']); ?></p>
<?php endif; ?>
<p style="color: grey"><?php echo e($log['add_time'].' '.$log['admin_name']); ?></p>
<hr/>
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="layui-tab-item">
<?php if(checkPerm('ViewSupplierLog')): ?>
<?php foreach($supplierLogs as $log): ?>
<p><?php echo e($log['desc']); ?></p>
<p style="color: grey"><?php echo e($log['add_time'].' '.$log['admin_name']); ?></p>
<hr/>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="layui-side">
<div class="layui-side-scroll">
<ul class="layui-nav layui-nav-tree arrow2" lay-filter="admin-side-nav" lay-shrink="all">
<?php if(!empty($menus)): ?>
<?php foreach($menus as $k=>$v): ?>
<li class="layui-nav-item">
<?php if(!empty($v['title'])): ?>
<?php if(!empty($v['target'])): ?>
<a <?php if(!empty($v['href'])): ?> href="<?php echo e($v['href']); ?>" target="_blank" <?php endif; ?>>
<i class="layui-icon <?php echo e(isset($v['class']) ? $v['class'] : ''); ?>"></i>&emsp;<cite><?php echo e(isset($v['title']) ? $v['title'] : ''); ?></cite>
</a>
<?php else: ?>
<a <?php if(!empty($v['href'])): ?> lay-href="<?php echo e(iframeUrl($v['href'])); ?>" <?php endif; ?>>
<i class="layui-icon <?php echo e(isset($v['class']) ? $v['class'] : ''); ?>"></i>&emsp;<cite><?php echo e(isset($v['title']) ? $v['title'] : ''); ?></cite>
</a>
<?php endif; ?>
<?php endif; ?>
<?php echo $__env->make("layouts.menu", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
</div>
\ No newline at end of file
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'upload'], function () {
let table = layui.table;
let form = layui.form;
let admin = layui.admin;
let element = layui.element;
let upload = layui.upload;
let supplierId = getQueryVariable('supplier_id')
table.render({
elem: '#memoList',
url: '/api/supplier_memo/getSupplierMemoList?supplier_id='+getQueryVariable('supplier_id'),
method: 'post',
size: 'sm',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: supplierId
},
width: '70%',
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
{
field: 'operate', title: '操作', align: 'left', width: 150, templet: '#memoOperate'
},
{
field: 'title', title: '标题', align: 'left', width: 200
},
{
field: 'content', title: '内容', align: 'left', width: 300
},
{
field: 'attachment',
title: '附件',
width: 300, align: 'left',
templet: function (data) {
return "<a style='color: blue' href='" + data.attachment + "' target='_blank'>" + data.attachment + "</a>";
}
},
]],
id: 'memoList',
page: {},
});
//新增备忘弹窗
$("#add_memo").click(function () {
layer.open({
type: 2,
content: '/supplier_memo/SaveSupplierMemo?view=iframe&supplier_id=' + supplierId,
area: ['80%', '80%'],
title: '保存备忘录',
end: function () {
table.reload('memoList');
}
});
})
table.on('tool(memoList)', function (obj) {
let data = obj.data;
let layEvent = obj.event;
if (layEvent === 'update') {
let id = data.id;
layer.open({
type: 2,
content: '/supplier_memo/SaveSupplierMemo?view=iframe&id=' + id + '&supplier_id=' + supplierId,
area: ['80%', '80%'],
title: '修改备忘',
end: function () {
table.reload('memoList');
}
});
}
if (layEvent === 'delete') {
layer.confirm('确定要删除该备忘信息?', function (index) {
let id = data.id;
let res = ajax('/api/supplier_memo/DeleteSupplierMemo', {id: id})
if (res.err_code === 0) {
table.reload('memoList')
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'index', 'laydate', 'xmSelect'], function () {
let admin = layui.admin;
let form = layui.form;
let table = layui.table;
$('#supplierDetailUrl').click(function () {
admin.showLoading({
type: 3,
});
});
//点击芯链
form.on('checkbox(stockup_type_filter)', function (data) {
if (data.elem.checked && data.elem.name === "stockup_type[5]") {
let url = '/api/supplier/checkHasLadderPriceSetting?supplier_id=' + getQueryVariable('supplier_id');
let elem = data.elem;
let self = $(this);
$.ajax({
url: url,
type: 'POST',
async: true,
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (res.err_code === 0) {
} else {
layer.msg('请先去魔方系统配置阶梯系数,再新建芯链账号', {icon: 5})
$('input[name="stockup_type[5]"]').next().click();
}
},
error: function () {
layer.msg('网络错误', {icon: 5});
}
});
}
});
form.on('submit(updateSupplier)', function (data) {
let confirmMessage = '';
if (data.field.status === '-2') {
confirmMessage = '确定要重新入驻吗,该供应商就会再次进入审核阶段'
} else if (data.field.status === '-1') {
confirmMessage = '确定要提交新增供应商信息吗?一旦提交,该供应商就会进入待复审阶段,审核过程中无法进行信息修改'
} else if (data.field.status === '3') {
confirmMessage = '确定要重新提交审核吗?一旦提交,该供应商就会再次进入审核中阶段,审核过程中无法进行信息修改';
} else {
//修改不需要进入审核了,有个单独提交审核的按钮
updateSupplier(data);
return;
}
layer.confirm(confirmMessage, function (index) {
updateSupplier(data);
});
})
form.on('select(apply_audit_reason_selector)', function (data) {
$('#apply_audit_reason').val(data.value);
});
form.on('submit(applyAuditSupplier)', function (data) {
$('input:disabled').attr('disabled', false);
let fieldNameList = [];
$('.attachment_fields').each(function () {
fieldNameList.push($(this).text());
});
//提交先提示是否要转换供应商类型
let radioObj = $('input[name="supplier_type"]');
//已经上传品质保证协议(代理商则提示为“已经上传代理证”),是否切换为正式供应商?
let supplierGroup = data.field.supplier_group;
let msg;
let obj1Checked = 0;
let obj2Checked = 0;
if (data.field.supplier_type === '2') {
//如果已经上传品质保证协议,并且供应商性质不是代理商(代理商要代理证)
if (inArray('quality_assurance_agreement', fieldNameList) && supplierGroup !== '1') {
msg = '已经上传品质保证协议,是否切换为正式供应商?'
obj1Checked = true;
obj2Checked = false;
}
if (inArray('proxy_certificate', fieldNameList) && supplierGroup === '1') {
msg = '该供应商为代理供应商,已经上传代理证,是否切换为正式供应商?'
obj1Checked = true;
obj2Checked = false;
}
} else {
if (!inArray('quality_assurance_agreement', fieldNameList) && !inArray(supplierGroup, ['1', '4'])) {
msg = '未上传品质保证协议,是否切换为临时供应商?'
obj1Checked = false;
obj2Checked = true;
}
if (!inArray('proxy_certificate', fieldNameList) && supplierGroup === '1') {
msg = '该供应商为代理供应商,但是未上传代理证,是否切换为临时供应商?'
obj1Checked = false;
obj2Checked = true;
}
}
<?php if($ignore_supplier_type_change_tips): ?>
msg = '';
<?php endif; ?>
if (msg) {
layer.confirm(msg, {btn: ["确认", "取消"]},
function (index) {
if (obj1Checked !== 0) {
radioObj.get(0).checked = obj1Checked;
radioObj.get(1).checked = obj2Checked;
layui.form.render('radio');
data.field.supplier_type = obj1Checked ? "1" : "2";
layer.closeAll();
}
auditAndUpdateSupplier(data);
},
function (index) {
auditAndUpdateSupplier(data);
}
);
} else {
auditAndUpdateSupplier(data);
}
return false;
});
//直接审核并且更新供应商
function auditAndUpdateSupplier(data) {
data.field.is_audit = 1;
if (data.field.supplier_type === '2') {
layer.open({
type: 1,
area: ['450px', '370px'], //宽高
content: $('#apply_audit_reason_div'),
btn: ['保存并申请审核', '取消'],
btn1: function (index, layero) {//点击保存按钮
let reason = $('#apply_audit_reason').val();
if (reason === '') {
layer.msg('请选择申请理由', {icon: 5})
return false;
}
data.field.apply_audit_reason = reason;
updateSupplier(data);
setTimeout(function () {
layer.close(index);
}, 1000);
},
});
} else {
layer.confirm('确定直接申请审核吗?确定后会直接进入审核中的状态,审核完成前无法进行二次修改', function (index) {
updateSupplier(data);
});
}
}
function updateSupplier(data) {
admin.showLoading();
admin.showLoading('.layui-layer-btn0');
$.ajax({
url: '/api/supplier/UpdateSupplier',
type: 'POST',
async: true,
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (res.err_code === 0) {
admin.putTempData("needFreshList", 1)
table.reload('receiptList')
location.href = "/supplier/SupplierDetail?view=iframe&supplier_id=<?php echo e($supplier['supplier_id']); ?>"
layer.msg(res.err_msg, {icon: 6})
} else {
let errMsg = res.err_msg;
let msg = '';
$.each(errMsg.split('|'), function (index, value) {
msg += "<span>" + value + "</span><br>"
});
layer.msg(msg, {icon: 5})
}
admin.removeLoading();
admin.showLoading('.layui-layer-btn0');
},
error: function () {
admin.removeLoading();
admin.showLoading('.layui-layer-btn0');
layer.msg('网络错误', {icon: 5});
}
});
}
});
</script>
\ No newline at end of file
<div id="apply_audit_reason_div" style="display:none;">
<div style="margin:20px;">
<blockquote class="layui-elem-quote layui-text">
<b>申请审核理由</b> (供应商类别为临时的时候,才会让选择申请审核理由)
</blockquote>
<div class="layui-form-item">
<label class="layui-form-label"><span class="require">*</span>申请理由 :
</label>
<div class="layui-input-inline">
<select lay-filter="apply_audit_reason_selector">
<option value="">请选择</option>
<?php foreach(config('field.ApplyAuditReason') as $item): ?>
<option value="<?php echo e($item); ?>"><?php echo e($item); ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="layui-row">
<?php if($operate == 'update'): ?>
<div class="layui-btn-group demoTable" style="margin-top: 5px">
<button type="button" class="layui-btn layui-btn-sm" id="add_attachment">上传</button>
<button type="button" class="layui-btn layui-btn-sm" id="update_attachment">修改</button>
<button type="button" class="layui-btn layui-btn-sm" id="delete_attachment">删除</button>
</div>
<?php endif; ?>
<table class="layui-table" lay-filter="attachmentList" id="attachmentList"></table>
</div>
<?php echo $__env->make('script.supplier.SupplierAttachmentScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
\ No newline at end of file
<?php if(!empty($v['childs'])): ?>
<dl class="layui-nav-child">
<?php foreach($v['childs'] as $k=>$v): ?>
<dd>
<a class="layui-icon <?php echo e(isset($v['class']) ? $v['class'] : ''); ?>" <?php if(!empty($v['href'])): ?> lay-href="<?php echo e(iframeUrl($v['href'])); ?>" <?php endif; ?>><?php echo e($v['title']); ?></a>
<?php echo $__env->make("layouts.menu", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</dd>
<?php endforeach; ?>
</dl>
<?php endif; ?>
\ No newline at end of file
<style>
.viewContact {
margin-left: 10px;
}
</style>
<div class="layui-row">
<blockquote class="layui-elem-quote layui-text">
<b>联系人管理</b>
</blockquote>
<?php /* <?php if($operate == 'update'): ?>*/ ?>
<div class="layui-btn-group demoTable" style="margin-top: 5px">
<?php if(checkPerm('AddSupplierContact')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="add_contact">新增</button>
<?php endif; ?>
<?php if(checkPerm('UpdateSupplierContact')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="update_contact">修改</button>
<?php endif; ?>
<?php if(checkPerm('DeleteSupplierContact')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="batchDelete">删除</button>
<?php endif; ?>
<?php if(checkPerm('SetYunxinChannelUser')): ?>
<button type="button" class="layui-btn layui-btn-sm" id="set_yunxin_channel_user">设置SKU采购</button>
<?php endif; ?>
</div>
<?php /* <?php endif; ?>*/ ?>
<table class="layui-table" lay-filter="contactList" id="contactList"></table>
</div>
<?php echo $__env->make('script.supplier.SupplierContactScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
\ No newline at end of file
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let admin = layui.admin;
let form = layui.form;
let element = layui.element;
form.on('submit(auditSupplier)', function (data) {
admin.showLoading({type: 3});
let supplierId = getQueryVariable('supplier_id');
let url = '/api/supplier/AuditSupplier?supplier_id=' + supplierId;
$.ajax({
url: url,
type: 'post',
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.err_code === 0) {
admin.removeLoading();
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
admin.removeLoading();
parent.layer.msg(res.err_msg, {icon: 5});
}
},
error: function () {
admin.removeLoading();
return layer.msg('网络错误,请重试', {icon: 5});
}
});
return false;
});
form.on('submit(cancel)', function (data) {
admin.closeThisDialog();
});
});
</script>
\ No newline at end of file
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'upload', 'index'], function () {
let layer = layui.layer;
let admin = layui.admin;
let supplierId = getQueryVariable('supplier_id')
$('#updateSupplierUrl').click(function () {
admin.showLoading({
type: 3,
});
let tabName = $('.layui-this').attr('id');
window.location.href = "/supplier/UpdateSupplier?view=iframe&supplier_id=<?php echo e($supplier['supplier_id']); ?>&tab=" + tabName;
})
$('#cancel_block_supplier').click(function () {
layer.confirm('对应的供应商设为取消拉黑后,该供应商将重新走审核流程,通过后将重新启用,是否执行当前操作?', function (index) {
let supplierId = getQueryVariable('supplier_id');
let res = ajax('/api/supplier/CancelBlockSupplier', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
admin.removeLoading();
layer.msg(res.err_msg, {icon: 6})
location.reload();
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
});
//取消禁用
$('#cancel_disable_supplier').click(function () {
layer.confirm('确定要取消禁用当前供应商吗?', function (index) {
let supplierId = getQueryVariable('supplier_id');
let res = ajax('/api/supplier/CancelDisableSupplier', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
admin.removeLoading();
layer.msg(res.err_msg, {icon: 6})
location.reload();
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
});
$('#change_supplier_name').click(function () {
layer.prompt({
title: '输入要修改的供应商名称',
btn: ['保存', '取消'],
}, function (supplierName, index) {
// layer.msg('sdasdas', {icon: 6});
let res = ajax('/api/supplier/changeSupplierName', {
supplier_id: supplierId,
supplier_name: supplierName
})
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6})
setTimeout(function () {
location.reload();
}, 1000);
} else {
layer.msg(res.err_msg, {icon: 5})
return false;
}
});
});
<?php /*index.setTabTitle('供应商详情 - <?php echo e(isset($supplier['supplier_code']) ? $supplier['supplier_code'] : ''); ?>');*/ ?>
function openLogView() {
// 打开右侧面板
layer.open({
type: 2,
content: '/log/SupplierLog?view=iframe&supplier_id=' + supplierId,
area: ['400px', '85%'],
shade: 0,
offset: 'rb',
title: '操作日志',
});
}
<?php if(checkPerm('SupplierLog')): ?>
setTimeout(function () {
openLogView();
}, 100);
<?php endif; ?>
//判断是否要切换tab
let tab = '<?php echo e(request()->get('tab')); ?>';
if (tab) {
$('#' + tab).click();
}
});
</script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?php echo e(config('website.webTitle')); ?> | <?php echo e(isset($title) ? $title : ''); ?></title>
<script src="/js/jquery-2.2.1.js"></script>
<?php /* <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>*/ ?>
<link rel="stylesheet" href="/plugins/assets/libs/layui/css/layui.css"/>
<link rel="stylesheet" href="/plugins/assets/module/admin.css?v=317"/>
<script type="text/javascript" src="https://frq.ichunt.net/js/web/backpopx.js"></script>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style>
.layui-layout-admin .layui-body {
buttom: 1px;
}
input:focus, textarea:focus {
outline: 1px solid #AFECAB;
}
</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<!-- 头部 -->
<?php echo $__env->make('layouts.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<!-- 侧边栏 -->
<?php echo $__env->make('layouts.navigation', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<!-- 主体部分 -->
<div class="layui-body">
</div>
</div>
<!-- 加载动画 -->
<!-- js部分 -->
<script type="text/javascript" src="/plugins/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/plugins/assets/js/common.js?v=317"></script>
<script type="text/javascript" src="/plugins/assets/js/alpine.js"></script>
<script>
layui.use(['index', 'layer', 'admin'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var index = layui.index;
var admin = layui.admin;
if (layui.admin.setter.pageTabs && layui.admin.setter.tabAutoRefresh == true) {
$('.layui-layout-admin>.layui-body>.layui-tab').attr('lay-autoRefresh', 'true');
}
let jumpUrl = getQueryVariable('jump_url');
if (jumpUrl) {
index.loadHome({
menuPath: jumpUrl + location.search + '&view=iframe',
menuName: '<i class="layui-icon layui-icon-home"></i>'
});
} else {
// 默认加载主页
index.loadHome({
menuPath: '/index/Index?view=iframe',
menuName: '<i class="layui-icon layui-icon-home"></i>'
});
}
admin.on('tab', function (d) {
//判断列表是否需要刷新
if (d.layId.search('SupplierList') !== -1) {
setTimeout(function () {
$('.admin-iframe').contents().find('#refreshWindow').click()
}, 10);
}
//判断详情是否需要刷新
if (d.layId.search('SupplierDetail') !== -1) {
let vars = d.layId.split("&");
let supplierFlag = vars[1];
let data = admin.getTempData("needFreshDetail_" + supplierFlag);
if (data) {
admin.refresh();
admin.putTempData("needFreshDetail_" + supplierFlag, null);
}
}
if (d.layId.search('SupplierApplyList') !== -1) {
setTimeout(function () {
$('.admin-iframe').contents().find('#refreshWindow').click()
}, 10);
}
});
});
</script>
</body>
</html>
<div class="layui-row">
<div class="layui-col-md3">
<h2><b>供应商新增统计</b></h2>
</div>
<div class="layui-col-md9" style="text-align: right">
</div>
</div>
<div style="width: 100%">
<div id="main" style="width: 100%;height:400px;"></div>
</div>
<script src="/plugins/echarts/echarts.min.js"></script>
<script>
let myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
let option = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['所有新增供应商', '我的新增供应商']
},
toolbox: {
show: true,
feature: {
dataZoom: {
yAxisIndex: 'none'
},
dataView: {readOnly: false},
magicType: {type: ['line', 'bar']},
restore: {},
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: <?php echo json_encode($dates); ?>
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value}'
}
},
series: [
{
name: '所有新增供应商',
type: 'line',
data: <?php echo e(json_encode($all_increase_statistics)); ?>,
markPoint: {
data: [
{type: 'max', name: '最大值'},
{type: 'min', name: '最小值'}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'}
]
}
},
{
name: '我的新增供应商',
type: 'line',
data: <?php echo e(json_encode($user_increase_statistics)); ?>,
markPoint: {
data: [
{name: '周最低', value: -2, xAxis: 1, yAxis: -1.5}
]
},
markLine: {
data: [
{type: 'average', name: '平均值'},
[{
symbol: 'none',
x: '90%',
yAxis: 'max'
}, {
symbol: 'circle',
label: {
position: 'start',
formatter: '最大值'
},
type: 'max',
name: '最高点'
}]
]
}
}
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
layui.use(['admin', 'index'], function () {
let index = layui.index;
let admin = layui.admin;
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer'], function () {
var table = layui.table;
var form = layui.form;
table.render({
elem: '#list'
, url: '/api/supplier/GetSupplierList'
, method: 'post'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度
, where: {
status: 1
}
, size: 'sm'
, limit: 8
, loading: true
, first: true //不显示首页
, last: false //不显示尾页
, cols: [[
{field: 'supplier_code', title: '供应商编码', align: 'center'},
{field: 'supplier_name', title: '供应商名称', align: 'center'},
{field: 'supplier_group', title: '供应商性质', align: 'center'},
{field: 'stockup_type', title: '合作类型', align: 'center'},
{field: 'channel_username', title: '渠道开发员', align: 'center'},
{field: 'create_name', title: '创建人', align: 'center'},
{field: 'create_time', title: '创建时间', align: 'center'},
{field: 'status_name', title: '状态', align: 'center'},
{field: 'operate', title: '操作', templet: '#operate', align: 'center'},
]]
, id: 'SupplierList'
, page: false
});
form.on('submit(load)', function (data) {
form.render();
//执行重载
table.reload('SupplierList', {
page: {
curr: 1
}
, where: data.field
});
return false;
});
table.on('tool(list)', function (obj) {
let data = obj.data;
let layEvent = obj.event;
let datas = {
group_id: data.group_id,
id: data.id
};
if (layEvent === 'edit') {
window.location = '/supplier'
} else if (layEvent === 'Del') {
datas.status = 3;
up_status(datas, '删除');
}
});
function up_status(data, info) {
layer.confirm('确定' + info + '组成员吗', {
title: info + '组成员'
, btn: ['确定', '取消']
}, function () {
layer.closeAll('dialog'); // 确定时关闭弹框
let res = ajax('/api/save_group_user', data);
if (!res) {
return layer.msg('禁用失败', {icon: 6});
} else {
layer.msg(res.errmsg, {icon: 6});
$('.load').click();
}
}, function () {
layer.close();
});
}
//我的供应商----------------------------------------------------
table.render({
elem: '#own'
, url: '/api/supplier/GetSupplierList'
, method: 'post'
, cellMinWidth: 80 //全局定义常规单元格的最小宽度
, where: {
source_type: 'own'
}
, limit: 8
, loading: true
, first: true //不显示首页
, last: false //不显示尾页
, cols: [[
{field: 'supplier_code', title: '供应商编码', align: 'center', width: 120},
{field: 'supplier_name', title: '供应商名称', align: 'center'},
{field: 'supplier_group', title: '供应商性质', align: 'center', width: 120},
{field: 'stockup_type', title: '合作类型', align: 'center', width: 100},
{field: 'channel_username', title: '采购员', align: 'center', width: 130},
{field: 'create_time', title: '创建时间', align: 'center', width: 170},
{field: 'purchase_username', title: '渠道开发员', align: 'center', width: 130},
{field: 'audit_time', title: '审批时间', align: 'center', width: 170},
{
field: 'status_name', title: '状态', align: 'center', width: 80, templet: function (data) {
if (data.status_name === "驳回") {
return "<span style='color: red' title='" + data.reject_reason + "'>" + data.status_name + "</sspan>";
}
return data.status_name;
}
},
{field: 'operate', title: '操作', templet: '#operate_own', align: 'center', width: 180},
]]
, id: 'SupplierList'
, page: false
});
form.on('submit(load)', function (data) {
form.render();
//执行重载
table.reload('SupplierList', {
page: {
curr: 1
}
, where: data.field
});
return false;
});
table.on('tool(own)', function (obj) {
let data = obj.data;
let layEvent = obj.event;
if (layEvent === 'draft') {
let map = {
supplier_id: data.supplier_id,
status: -1
};
updateStatus(map, '转为草稿');
}
});
});
</script>
\ No newline at end of file
<blockquote class="layui-elem-quote layui-text">
<b>付款方式</b>
</blockquote>
<div id="pay_type_div_list">
<div class="layui-row pay_type_div" style="margin-bottom: 5px;">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('settlement_type','结算方式 : ',
!empty($supplier)?$supplier['settlement_type']:'',config('field.SettlementType'),['required'=>true]); ?>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('pay_type','付款周期 : ',
!empty($supplier)?$supplier['pay_type']:'',config('fixed.SupplierPayType'),['required'=>true]); ?>
</div>
</div>
<div class="layui-col-md6" style="width:500px;margin-bottom: 3px;margin-left: -20px;">
<div class="layui-row">
<?php if(!empty($supplier)&&$supplier['pay_type']==1): ?>
<div class="pay_type_1_div">
<div class="layui-row" style="">
<span class="require">*</span>月结 : &nbsp
<div class="layui-input-inline" style="width: 80px;">
<input class="layui-input valueInput" type="hidden" name="pay_type_value"
value="<?php echo e(isset($supplier['pay_type_value']) ? $supplier['pay_type_value'] : ''); ?>">
<select lay-filter="pay_type_month">
<option value="">请选择</option>
<option value="7"
<?php if($supplier['pay_type_value']==7): ?>
selected='selected'
<?php endif; ?>>7
</option>
<option value="15"
<?php if($supplier['pay_type_value']==15): ?>
selected='selected'
<?php endif; ?>>15
</option>
<option value="30"
<?php if($supplier['pay_type_value']==30): ?>
selected='selected'
<?php endif; ?>>30
</option>
<option value="45"
<?php if($supplier['pay_type_value']==45): ?>
selected='selected'
<?php endif; ?>>45
</option>
<option value="60"
<?php if($supplier['pay_type_value']==60): ?>
selected='selected'
<?php endif; ?>>60
</option>
<option value="90"
<?php if($supplier['pay_type_value']==90): ?>
selected='selected'
<?php endif; ?>>90
</option>
</select>
</div>
&nbsp天
<input type="hidden" class="valueInput" name="pay_type_extra" value="天">
</div>
</div>
<?php else: ?>
<div class="pay_type_1_div" style="display: none">
<div class="layui-row">
<span class="require">*</span>月结 : &nbsp
<div class="layui-input-inline" style="width: 80px;">
<input class="layui-input valueInput" type="hidden" name="pay_type_value">
<select lay-filter="pay_type_month">
<option value="">请选择</option>
<option value="30">7</option>
<option value="30">15</option>
<option value="30">30</option>
<option value="30">45</option>
<option value="60">60</option>
<option value="90">90</option>
</select>
</div>
&nbsp天
<input type="hidden" class="valueInput" name="pay_type_extra" value="天">
</div>
</div>
<?php endif; ?>
<?php if(!empty($supplier)&&$supplier['pay_type']==2): ?>
<div class="pay_type_2_div">
<input type="hidden" class="valueInput" name="pay_type_value">
<input type="hidden" class="valueInput" name="pay_type_extra" value="">
</div>
<?php else: ?>
<div class="pay_type_2_div" style="display: none">
<input type="hidden" class="valueInput" name="">
<input type="hidden" class="valueInput" name="" value="">
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php echo $__env->make('script.supplier.SupplierPayTypeScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>备忘录</b>
</blockquote>
<div class="layui-row">
<div class="layui-btn-group demoTable" style="margin-top: 5px">
<button type="button" class="layui-btn layui-btn-sm" id="add_memo">添加备忘录</button>
</div>
<table class="layui-table" lay-filter="memoList" id="memoList"></table>
</div>
<script type="text/html" id="memoOperate">
<button class="layui-btn layui-btn-xs" type="button" lay-event="update">编辑</button>
<button class="layui-btn layui-btn-xs layui-btn-danger" type="button" lay-event="delete">删除</button>
</script>
<?php echo $__env->make('script.supplier.SupplierMemoScript', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo e(Autograph()); ?>
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'upload', 'laydate'], function () {
let upload = layui.upload;
let layer = layui.layer;
let form = layui.form;
let laydate = layui.laydate;
let fileName = '';
var loadIndex = 0;
let fileType = '';
//监听附件上传选择,有值才显示上传按钮
form.on('select(file_type_selector)', function (data) {
fileType = data.value;
if (data.value) {
$('#disable_upload_button').hide();
$('#upload_button').show();
} else {
$('#disable_upload_button').show();
$('#upload_button').hide();
}
});
form.on('select(validity_period_selector)', function (data) {
fileType = data.value;
let validityPeriodTimeSelector = $(this).parents('.validity_period_selector_div')
.find('.validity_period');
if (data.value === '1') {
validityPeriodTimeSelector.prop('disabled', true);
validityPeriodTimeSelector.addClass('layui-disabled');
validityPeriodTimeSelector.val('');
form.render();
} else {
validityPeriodTimeSelector.prop('disabled', false);
validityPeriodTimeSelector.removeClass('layui-disabled');
}
});
upload.render({
elem: '#upload_button',
url: '<?php echo e(config('website.UploadUrl')); ?>', //改成您自己的上传接口
accept: 'file', //文件
field: 'upload',
data: {
k1: k1,
k2: k2,
source: 1,
cancel_time_verify: 1,
},
multiple: true,
exts: 'jpg|png|bmp|jpeg|zip|pdf',
size: 20000,
before: function () {
},
choose: function (obj) {
let files = this.files = obj.pushFile();
let recentFile = files[Object.keys(files)[Object.keys(files).length - 1]]
fileName = recentFile.name;
loadIndex = layer.load(1);
},
error: function () {
layer.close(loadIndex);
},
done: function (res, index, upload) {
let fieldName = '';
fileName = this.files[index].name;
if (res.code === 200) {
//动态添加js
let fileTemplateObj = $('#file_template')
fileTemplateObj.find('a').attr('href', res.data[0]);
fileTemplateObj.find('a').text(fileName);
fileTemplateObj.find('a').attr('value', fileName);
fileTemplateObj.find('#file_name').val(fileName);
fileTemplateObj.find('#file_url').val(res.data[0]);
fieldName = $('#file_type_select').val();
fileTemplateObj.find('#field_name').val(fieldName);
fileTemplateObj.find('#validity_period').addClass('layui-input validity_period layui-disabled');
fileTemplateObj.find('#validity_period').prop('disabled', true);
let fileTemplate = fileTemplateObj.html();
$('#' + fileType + '_div').show();
$('#' + fileType + '_file_div').append(fileTemplate);
fileTemplateObj.find('#validity_period').removeClass('layui-input validity_period layui-disabled');
fileTemplateObj.find('#validity_period').prop('disabled', false);
form.render();
//如果是混合分销商,同时还是代理证类型,那么有效期要默认自定义
let supplierGroup = $('#supplier_group').val();
if (supplierGroup === '7' && fileType === 'proxy_certificate') {
let selector = $('#' + fileType + '_file_div').find('select').last();
selector.val('2');
selector.parent().next().find('input').removeClass('layui-disabled');
selector.parent().next().find('input').prop('disabled', false);
selector.parent().parent().find('label').first().prepend('<span style="color: red">* <span>')
form.render();
}
} else {
layer.msg('上传接口异常,请重试或者联系管理员 . ' + res.message);
}
lay('.validity_period').each(function () {
laydate.render({
elem: this,
type: 'date',
trigger: 'click',
range: '~', //或 range: '~' 来自定义分割字符,
value: '',
});
});
delete this.files[index];
layer.close(loadIndex);
},
});
//删除文件操作
$(document).on('click', '.delete_file', function () {
var self = $(this);
layer.confirm('确定要删除该文件吗?', function (index) {
self.parents('.single_file_div').remove();
layer.closeAll();
});
return false;
});
});
</script>
<script>
layui.use(['table', 'form', 'element', 'layer', 'Split', 'admin'], function () {
let $ = layui.jquery;
let admin = layui.admin;
let table = layui.table;
let form = layui.form;
form.on('submit(addSupplierLog)', function (data) {
let supplierId = <?php echo e($supplierId); ?>;
data.field.supplier_id = supplierId;
let res = ajax('/api/supplier_log/AddSupplierLog', data.field)
if (res.err_code === 0) {
layer.msg('新增信息记录成功', {'icon': 6});
location.reload();
} else {
layer.msg(res.err_msg, {'icon': 5});
}
});
});
</script>
\ No newline at end of file
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let table = layui.table;
table.render({
elem: '#skuUploadLogList',
url: '/api/sku_upload_log/GetSkuUploadLogList',
method: 'get',
cellMinWidth: 80,//全局定义常规单元格的最小宽度
where: {
supplier_id: getQueryVariable("supplier_id")
},
size: 'sm',
loading: true,
first: true,//不显示首页
last: false,//不显示尾页
cols: [[
{
field: 'create_time', title: '上传时间', align: 'center', width: 150
},
{field: 'status', title: '状态', align: 'center', width: 600},
{field: 'upload_items_count', title: '上传SKU数量', align: 'center', width: 500},
]],
id: 'skuUploadLogList',
page: {},
});
});
</script>
\ 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