Commit a1fe9e71 by 杨树贤

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

# Conflicts:
#	app/Http/routes.php
parents af519277 d56eda19
Showing with 6999 additions and 304 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) {
......
<script>
layui.use(['table', 'form', 'element', 'layer', 'admin', 'laydate', 'xmSelect', 'selectN', 'tagsInput'], function () {
layui.use(['table', 'form', 'element', 'layer', 'admin', 'laydate', 'xmSelect', 'selectN', 'tagsInput'],
function() {
let admin = layui.admin;
let form = layui.form;
let selectN = layui.selectN;
......@@ -8,36 +9,37 @@
let xmSelect = layui.xmSelect;
//这里有个权限,是可以跳过公司信息审核的
let ignoreCompanyCheck = {{checkPerm('IgnoreCompanyCheck') ? 1:0}};
let ignoreCompanyCheck = {{ checkPerm('IgnoreCompanyCheck') ? 1 : 0 }};
layDate.render({
elem: '#established_time'
, format: 'yyyy-MM-dd'
elem: '#established_time',
format: 'yyyy-MM-dd'
});
const supplierId = getQueryVariable('supplier_id');
$("#supplier_name,#tax_number").blur(function () {
$("#supplier_name,#tax_number").blur(function() {
let supplier_name = $('#supplier_name').val();
const supplier_id = supplierId;
const region = $('#region').val();
let tax_number = $('#tax_number').val();
var self = $(this);
self.next().find('p').text('');
let url = '/api/supplier/CheckSupplierName?supplier_name=' + supplier_name + '&supplier_id=' + supplier_id
+ '&tax_number=' + tax_number + '&region=' + region;
let url = '/api/supplier/CheckSupplierName?supplier_name=' + supplier_name +
'&supplier_id=' + supplier_id +
'&tax_number=' + tax_number + '&region=' + region;
@if (!checkPerm('IgnoreCompanyCheck'))
if (supplier_name === '' && self.attr('id') === 'supplier_name') {
$('#tax_number').val('');
tax_number = '';
resetCompanyInfo();
}
if (tax_number === '' && self.attr('id') === 'tax_number') {
$('#supplier_name').val('');
supplier_name = '';
resetCompanyInfo();
}
if (supplier_name === '' && self.attr('id') === 'supplier_name') {
$('#tax_number').val('');
tax_number = '';
resetCompanyInfo();
}
if (tax_number === '' && self.attr('id') === 'tax_number') {
$('#supplier_name').val('');
supplier_name = '';
resetCompanyInfo();
}
@endif
$.ajax({
......@@ -46,7 +48,7 @@
async: true,
dataType: 'json',
timeout: 20000,
success: function (res) {
success: function(res) {
if (supplier_name !== '' || tax_number !== '') {
if (res.err_code !== 0) {
//当code=-2的时候,是公司信息校验有问题,但是如果有跳过检查权限或者是非大陆港台地区的,那么就什么都不处理
......@@ -55,17 +57,23 @@
return;
}
if (!ignoreCompanyCheck) {
layer.msg(res.err_msg, {icon: 5});
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
} else if (res.err_code === -3) {
layer.msg(res.err_msg, {icon: 5});
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
} else {
//这个code代表供应商名称已经存在,自然要检测
layer.msg(res.err_msg, {icon: 5});
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
......@@ -83,7 +91,9 @@
$('#supplier_address').val(companyInfo.supplier_address);
$('#registered_capital').val(companyInfo.registered_capital);
$('#established_time').val(companyInfo.establishment_time);
layer.msg('校验公司信息通过,自动补全相关数据', {icon: 6})
layer.msg('校验公司信息通过,自动补全相关数据', {
icon: 6
})
if (!ignoreCompanyCheck) {
if (self.attr('id') === 'supplier_name') {
......@@ -98,8 +108,10 @@
},
error: function () {
layer.msg('网络错误,请重试', {icon: 5});
error: function() {
layer.msg('网络错误,请重试', {
icon: 5
});
}
});
......@@ -116,34 +128,35 @@
$('#registered_capital').val('');
}
@if(!empty($supplier))
@if($supplier['region']==2)
$('.city-div').show();
@endif
@if($supplier['supplier_group']==\App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX)
$('#agency_brands_div').show();
@endif
@if (!empty($supplier))
@if ($supplier['region'] == 2)
$('.city-div').show();
@endif
@if ($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX)
$('#agency_brands_div').show();
@endif
@endif
//监听所在区域变化,中国才显示省市选择
//而且有值+新增供应商操作 才能修改供应商名字和税号
//如果区域是海外(非中国),就去掉税号的必填星号
//如果选择区域为国内,那么成立时间disabled
form.on('select(region)', function (data) {
@if(empty($supplier))
let supplierNameObj = $('#supplier_name');
let taxNumberObj = $('#tax_number');
if (data.value) {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
}
//这里还有就是region有个对应公司id的映射关系,要自动切换对应的签约公司下拉
form.on('select(region)', function(data) {
@if (empty($supplier))
let supplierNameObj = $('#supplier_name');
let taxNumberObj = $('#tax_number');
if (data.value) {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
}
@endif
if (data.value === '2') {
$('#tax_number_required_span').show();
......@@ -161,11 +174,22 @@
$('#established_time').attr('disabled', false);
$('#established_time').removeClass('layui-disabled');
}
let signComId = 0;
@if (!empty($supplier))
signComId = {{ !empty($supplier['region']) ? array_get(config('fixed.RegionSignComMap'), $supplier['region'], 0) : 0 }};
@endif;
let regionSignComMap = {!! json_encode(config('fixed.RegionSignComMap')) !!};
signComId = regionSignComMap[data.value];
//根据获取的id,去修改下拉框内容
$('#sign_com_id').val(signComId);
//重新渲染下拉框
form.render('select');
});
//监听供应商性质选择,如果为混合分销商,那么要展示混合分销商品牌设置
form.on('select(supplier_group)', function (data) {
form.on('select(supplier_group)', function(data) {
if (data.value === '7') {
$('#agency_brands_div').show();
} else {
......@@ -175,34 +199,34 @@
//如果没有直接忽略公司校验的权限,那么就要做到下面的互相disable
@if (!checkPerm('IgnoreCompanyCheck'))
//修改供应商名称,那么公司税号就禁用,反之亦然
$('#supplier_name').change(function () {
let taxNumberObj = $('#tax_number');
if ($(this).val()) {
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
} else {
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
}
//修改供应商名称,那么公司税号就禁用,反之亦然
$('#supplier_name').change(function() {
let taxNumberObj = $('#tax_number');
if ($(this).val()) {
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
} else {
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
}
});
$('#tax_number').change(function () {
let supplierNameObj = $('#supplier_name');
if ($(this).val()) {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
}
});
});
$('#tax_number').change(function() {
let supplierNameObj = $('#supplier_name');
if ($(this).val()) {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
}
});
@endif
//监听供应商类别单选,如果是临时供应商,附件可以不上传
//如果是临时供应商并且不显示申请审核按钮
form.on('radio(supplier_type)', function (data) {
form.on('radio(supplier_type)', function(data) {
let supplier_type = data.value;
if (supplier_type === '1') {
$('#attachment_required_span').show();
......@@ -227,13 +251,18 @@
},
remoteSearch: true,
pageRemote: true,
template({item, sels, name, value}) {
return item.brand_name + '<span style="position: absolute; right: 10px; color: #8799a3">' + item.mapping_brand_names + '</span>'
},
filterMethod: function (val, item, index, prop) {
template({
item,
sels,
name,
value
}) {
return item.brand_name + '<span style="position: absolute; right: 10px; color: #8799a3">' +
item.mapping_brand_names + '</span>'
},
filterMethod: function(val, item, index, prop) {},
pageSize: 30,
remoteMethod: function (val, cb, show, pageIndex) {
remoteMethod: function(val, cb, show, pageIndex) {
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$.ajax({
url: '/api/common/getStandardBrandList',
......@@ -244,20 +273,26 @@
},
dataType: 'json',
timeout: 10000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
success: function(res) {
if (!res) return layer.msg('网络错误,请重试', {
icon: 5
});
if (res.err_code === 0) {
cb(res.data, res.last_page);
} else {
layer.msg(res.err_msg, {icon: 6});
layer.msg(res.err_msg, {
icon: 6
});
}
},
error: function () {
return layer.msg('网络错误,请重试', {icon: 5});
error: function() {
return layer.msg('网络错误,请重试', {
icon: 5
});
}
});
},
on: function (data) {
on: function(data) {
let arr = data.arr;
let brandIds = '';
for (let i in arr) {
......@@ -272,12 +307,12 @@
let brandOption = getBrandOption('brand_selector');
let brandSelector = xmSelect.render(brandOption);
let brandIds = $('#main_brands').attr('value');
let brandInitValue = {!! json_encode($brand_init_value?:[])!!};
let brandInitValue = {!! json_encode($brand_init_value ?: []) !!};
brandSelector.setValue(brandInitValue);
//批量新增主营品牌
$('#batchAddMainBrands').click(function () {
$('#batchAddMainBrands').click(function() {
layer.open({
title: "批量增加主营品牌",
area: ['600px', '400px'],
......@@ -286,17 +321,21 @@
});
});
$('#confirmBatchAddMainBrands').click(function () {
$('#confirmBatchAddMainBrands').click(function() {
let brandValue = brandSelector.getValue();
console.log(brandValue);
let standardBrandNames = $('#batchAddMainBrandsTextarea').val();
//请求接口获取返回的数据,并且合并目前选择的主营品牌,重新渲染xm-select
let res = ajax('/api/supplier/getBatchAddMainBrandsData', {standard_brand_names: standardBrandNames});
let res = ajax('/api/supplier/getBatchAddMainBrandsData', {
standard_brand_names: standardBrandNames
});
let data = res.data;
let brandNames = arrayColumn(data, 'brand_name').join(',')
$('#batchAddMainBrandsBlockQuote').text(brandNames);
if (data.length === 0) {
layer.msg('没有匹配到有效的标准品牌', {icon: 5});
layer.msg('没有匹配到有效的标准品牌', {
icon: 5
});
return false;
} else {
brandValue = brandValue.concat(data);
......@@ -305,11 +344,13 @@
$('#main_brands').val(arrayColumn(brandValue, 'brand_id').join(','));
$('#batchAddMainBrandsTextarea').val('');
$('#batchAddMainBrandsBlockQuote').text('');
layer.msg('批量添加主营品牌成功', {icon: 6});
layer.msg('批量添加主营品牌成功', {
icon: 6
});
}
});
$('#closeBatchAddMainBrands').click(function () {
$('#closeBatchAddMainBrands').click(function() {
$('#batchAddMainBrandsTextarea').val('');
$('#batchAddMainBrandsBlockQuote').text('');
layer.closeAll();
......@@ -320,12 +361,12 @@
let agencyBrandOption = getBrandOption('agency_brand_selector', 'agency_brands');
let agencyBrandSelector = xmSelect.render(agencyBrandOption);
let agencyBrandIds = $('#agency_brands').attr('value');
let agencyBrandInitValue = {!! json_encode($agency_brand_init_value?:[])!!};
let agencyBrandInitValue = {!! json_encode($agency_brand_init_value ?: []) !!};
agencyBrandSelector.setValue(agencyBrandInitValue);
//主营品牌数量逻辑
form.on('select(day_type)', function (data) {
form.on('select(day_type)', function(data) {
console.log(data.value)
if (data.value === '2') {
$('#cp_time_day').attr('disabled', true);
......@@ -370,19 +411,19 @@
if (supplierId) {
@if (checkPerm('UpdateSupplierTags'))
let systemTagOption = getTagOption('system_tags_selector');
systemTagOption.disabled = true;
let tagSelector = xmSelect.render(systemTagOption);
// let tagIds = $('#system_tags').attr('value');
tagSelector.setValue({!! json_encode(!empty($supplier['system_tags'])?$supplier['system_tags']:[]) !!});
//自定义标签
$('#customer_tags').tagsInput({});
let systemTagOption = getTagOption('system_tags_selector');
systemTagOption.disabled = true;
let tagSelector = xmSelect.render(systemTagOption);
// let tagIds = $('#system_tags').attr('value');
tagSelector.setValue({!! json_encode(!empty($supplier['system_tags']) ? $supplier['system_tags'] : []) !!});
//自定义标签
$('#customer_tags').tagsInput({});
@endif
}
//省市区选择
let regionData = {!! json_encode($region_data) !!};
let provinceCity = {!! !empty($province_city)?json_encode($province_city):'[]' !!};
let provinceCity = {!! !empty($province_city) ? json_encode($province_city) : '[]' !!};
//无限级分类-基本配置
selectN({
elem: '#city-selector',
......@@ -393,57 +434,73 @@
});
//重新查验公司信息,请求相关接口
$('#recheck_company_info').click(function () {
$('#recheck_company_info').click(function() {
let supplierName = $('#supplier_name').val();
let taxNumber = $('#tax_number').val();
let region = $('#region').val();
admin.btnLoading('#recheck_company_info', '正在查验公司信息,请稍等...');
if (!inArray(region, [2, 4])) {
layer.msg('该供应商地区不为大陆或者港台,无法查验', {icon: 5});
layer.msg('该供应商地区不为大陆或者港台,无法查验', {
icon: 5
});
admin.btnLoading('#recheck_company_info', false);
return;
}
if (!supplierName && !taxNumber) {
layer.msg('请填写供应商名称或者税号后再进行查验', {icon: 5});
layer.msg('请填写供应商名称或者税号后再进行查验', {
icon: 5
});
admin.btnLoading('#recheck_company_info', false);
return false;
}
$('#supplier_check_tip').remove();
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' + taxNumber + '&region=' + region;
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' +
taxNumber + '&region=' + region;
$.ajax({
url: url,
type: 'GET',
async: true,
dataType: 'json',
timeout: 20000,
success: function (res) {
success: function(res) {
admin.btnLoading('#recheck_company_info', false);
if (res.err_code === 0) {
let companyInfo = res.data;
$('#supplier_name').val(companyInfo.supplier_name);
//这个属性因为是disabled了,没法直接用jq去修改,就算直接修改layui也是没法接到值的
form.val('supplier_form', {tax_number: companyInfo.tax_number})
form.val('supplier_form', {
tax_number: companyInfo.tax_number
})
$('#tax_number').val(companyInfo.tax_number);
$('#supplier_address').val(companyInfo.supplier_address);
$('#phone').val(companyInfo.phone);
$('#registered_capital').val(companyInfo.registered_capital);
$('#established_time').val(companyInfo.establishment_time);
form.render();
layer.msg('验证成功,校验公司信息通过,自动补全相关数据', {icon: 6})
layer.msg('验证成功,校验公司信息通过,自动补全相关数据', {
icon: 6
})
} else if (res.err_code === -1) {
if (ignoreCompanyCheck) {
layer.msg('公司未进行工商注册', {icon: 5})
layer.msg('公司未进行工商注册', {
icon: 5
})
} else {
$('#supplier_name').next('#supplier_check_tip').find('p').text('公司未进行工商注册');
layer.msg('验证失败,公司未进行工商注册', {icon: 5})
$('#supplier_name').next('#supplier_check_tip').find('p').text(
'公司未进行工商注册');
layer.msg('验证失败,公司未进行工商注册', {
icon: 5
})
resetCompanyInfo(supplierName !== '');
}
}
},
error: function () {
error: function() {
admin.btnLoading('#recheck_company_info', false);
layer.msg('网络错误,请重试', {icon: 5});
layer.msg('网络错误,请重试', {
icon: 5
});
}
})
});
......
......@@ -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', 'upload', 'layer', 'Split', 'admin', 'xmSelect'], function () {
let $ = layui.jquery;
let Split = layui.Split;
let table = layui.table;
let upload = layui.upload;
let form = layui.form;
let admin = layui.admin;
let xmSelect = layui.xmSelect;
let initCondition = {source_type: 'all'};
let whereCondition = initCondition;
let type = 'all';
$(document).on("click", ".layui-table-body table.layui-table tbody tr", function () {
let index = $(this).attr('data-index');
let tableBox = $(this).parents('.layui-table-box');
let tableDiv = null;
if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) {
tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
} else {
tableDiv = tableBox.find(".layui-table-body.layui-table-main");
}
let checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
if (checkCell.length > 0) {
checkCell.click();
}
});
$(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) {
e.stopPropagation();
});
//监听复选框事件,被选中的行高亮显示
table.on('checkbox(supplierExaminationList)', function (obj) {
//拉黑就不用变色了
if (obj.data.status === -3) {
return
}
if (obj.checked === true && obj.type === 'all') {
//点击全选,拉黑的不用选上
$('.layui-table-body table.layui-table tbody tr:not(.block-class)').addClass('layui-table-click');
$('.layui-table-body table.layui-table tbody').find('.block-class').find('.layui-form-checkbox').remove();
$('.layui-table-body table.layui-table tbody tr .block-class').addClass('layui-table-click');
} else if (obj.checked === false && obj.type === 'all') {
//点击全不选
$('.layui-table-body table.layui-table tbody tr').removeClass('layui-table-click');
} else if (obj.checked === true && obj.type === 'one') {
//点击单行
if (obj.checked === true) {
obj.tr.addClass('layui-table-click');
} else {
obj.tr.removeClass('layui-table-click');
}
} else if (obj.checked === false && obj.type === 'one') {
//点击全选之后点击单行
if (obj.tr.hasClass('layui-table-click')) {
obj.tr.removeClass('layui-table-click');
}
}
});
let cols = [
{type: 'checkbox'},
{field: 'id', title: 'ID', align: 'center', width: 80},
{field: 'order_sn', title: '销售订单号', align: 'center', width: 150},
{field: 'purchase_sn', title: '采购订单号', align: 'center', width: 160},
{
field: 'examine_time', title: '检货时间', align: 'center', width: 130
},
{field: 'sales_name', title: '销售', align: 'center', width: 100},
{field: 'sales_department', title: '销售部门', align: 'center', width: 100},
{field: 'purchase_name', title: '采购员', align: 'center', width: 100},
{field: 'purchase_department', title: '采购部门', align: 'center', width: 100},
{field: 'ticket_type', title: 'A/B单', align: 'center', width: 100},
{
field: 'supplier_name', title: '供应商', align: 'center', width: 200
},
{field: 'sku_name', title: '型号', align: 'center', width: 160},
{field: 'brand_name', title: '品牌', align: 'center', width: 160},
{field: 'amount', title: '数量', align: 'center', width: 80},
{field: 'batch', title: '批次', align: 'center', width: 80},
{field: 'producing_area', title: '产地', align: 'center', width: 80},
{field: 'stock_in_date', title: '入库日期', align: 'center', width: 80},
{field: 'income_sn', title: '来货单号', align: 'center', width: 80},
{field: 'delivery_sn', title: '送货单', align: 'center', width: 80},
{field: 'tally_request', title: '理货要求', align: 'center', width: 80},
{field: 'examine_request', title: '验货要求', align: 'center', width: 100},
{field: 'unhealthy_amount', title: '不良数', align: 'center', width: 80},
{field: 'abnormal_level', title: '异常等级', align: 'center', width: 180},
{field: 'unhealthy_content', title: '不良现象', align: 'center', width: 150},
{field: 'examine_result', title: '检验结果', align: 'center', width: 150},
{field: 'remark', title: '备注', align: 'center', width: 150},
];
let currentPage = 0;
let url = '/api/supplier_examination/GetSupplierExaminationList';
if (getQueryVariable('supplier_id')) {
url = '/api/supplier_examination/GetSupplierExaminationList?supplier_id=' + getQueryVariable('supplier_id');
}
$('#three_days_button').remove();
table.render({
elem: '#supplierExaminationList'
, url: url
, method: 'post'
, size: 'sm'
, limit: 20
, height: 600
, cellMinWidth: 50 //全局定义常规单元格的最小宽度
, where: whereCondition
, loading: true
, first: true //不显示首页
, last: false //不显示尾页
, cols: [cols]
, id: 'supplierExaminationList'
, page: {}
, done: function (res, curr, count) {
currentPage = curr;
}
});
$("#add_supplier_examination").click(function () {
layer.open({
type: 2,
content: '/supplier_examination/AddSupplierExamination?view=iframe&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '90%'],
title: '添加IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
}
});
return false;
});
$("#update_supplier_examination").click(function () {
let checkStatus = table.checkStatus('supplierExaminationList');
let data = checkStatus.data;
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5});
return;
}
if (!data.length) {
layer.msg('请先选择要操作的记录', {icon: 5});
} else {
let id = data[0].id;
layer.open({
type: 2,
content: '/supplier_examination/UpdateSupplierExamination?view=iframe&id=' + id + '&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '90%'],
title: '添加IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
}
});
}
return false;
});
$("#batch_update_supplier_examination").click(function () {
let checkStatus = table.checkStatus('supplierExaminationList');
let data = checkStatus.data;
let ids = [];
$.each(data, function (i, v) {
ids.push(v.id);
});
if (!ids) {
layer.msg('请先选择要操作的记录', {icon: 5});
} else {
ids = ids.join(',')
layer.open({
type: 2,
content: '/supplier_examination/BatchUpdateSupplierExamination?view=iframe&ids=' + ids + '&supplier_id=' + getQueryVariable('supplier_id'),
area: ['80%', '90%'],
title: '批量修改IQC检测记录',
end: function () {
table.reload('supplierExaminationList');
}
});
}
return false;
});
//启用
$("#delete_supplier_examination").click(function () {
let checkStatus = table.checkStatus('supplierExaminationList');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的检测数据', {icon: 5})
} else {
layer.confirm('是否删除所选记录?', function (index) {
let ids = [];
$.each(data, function (index, value) {
ids.push(value.id);
});
ids = ids.join(',');
let res = ajax('/api/supplier_examination/DeleteSupplierExaminations', {ids: ids})
if (res.err_code === 0) {
table.reload('supplierExaminationList');
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
form.on('submit(load)', function (data) {
whereCondition = $.extend(false, initCondition, data.field);
//执行重载
table.reload('supplierExaminationList', {
page: {
curr: 1
}
, where: whereCondition
});
return false;
});
form.on('submit(reset)', function (data) {
layer.load(1);
location.reload();
});
//执行实例
var uploadInst = upload.render({
elem: '#import_supplier_examination', //绑定元素
url: '/api/supplier_examination/ImportSupplierExamination', //上传接口
auto: true,
exts: 'xlsx',
before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
layer.msg('上传中', {icon: 16}); //上传loading
},
done: function (res) {
if (!res) {
return layui.msg('上传失败', {icon: 5});
}
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6});
table.reload('supplierExaminationList');
} else {
let errMsg = res.err_msg;
let msg = '';
$.each(errMsg.split('&'), function (index, value) {
msg += "<span>" + value + "</span><br>"
});
layer.msg(msg, {icon: 5, time: 5000})
}
},
error: function () {
return layer.msg('上传失败', {icon: 5});
}
});
});
</script>
\ No newline at end of file
<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(); ?>
<style>
.layui-form-item {
margin-bottom: 5px;
}
.layui-input-inline {
margin-top: 0px;
}
.xm-select {
height: 30px;
line-height: 30px;
}
</style>
<div class="layui-card">
<?php echo e(Autograph()); ?>
<div class="layui-card-body">
<style>
.fix-button {
height: 40px;
margin-top: 0;
margin-left: -90px;
padding: 10px 45px;
position: fixed;
top: 0;
background: white;
width: 100%;
z-index: 10;
}
</style>
<div style="height:40px"></div>
<blockquote class="layui-elem-quote layui-text">
<b>基本信息</b>
</blockquote>
<form class="layui-form" action="" lay-filter="supplier_form">
<input type="hidden" name="apply_audit_reason" id="apply_audit_reason">
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $singleSelectPresenter = app('App\Presenters\SingleSelectPresenter'); ?>
<?php echo $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',[1=>'正式',2=>'临时'],['require'=>true]); ?>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('region','所在区域 : ','',
config('fixed.Region'),['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md6">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>供应商名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="选择所在区域才允许输入供应商名称" class="layui-input layui-disabled"
value="" disabled>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-block" id="tax_number_div">
<label class="layui-form-label"><span id="tax_number_required_span" class="require">*</span>公司税号</label>
<div class="layui-input-block">
<input type="text" name="tax_number" id="tax_number"
placeholder="选择所在区域才允许输入公司税号,海外供应商没有税号可以不填"
class="layui-input layui-disabled" disabled value="">
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div>
</div>
</div>
<div class="layui-col-md2" style="padding-left: 40px">
<button type="button" class="layui-btn layui-btn-sm" id="recheck_company_info">重新查验公司信息
</button>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label">英文名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input" value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_uid','渠道开发员 : ',$default_purchase_uid,$userCodes,['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>注册资金(万): </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="单位(万),至少50万" class="layui-input" value="">
</div>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ','',
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px','width'=>'100px']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>公司电话 : </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="phone" id="phone"
placeholder="请输入公司电话" class="layui-input" value="">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>注册地址 :
</label>
<div class="layui-input-block">
<input type="text" name="supplier_address" id="supplier_address"
placeholder="请输入注册地址" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md7">
<label class="layui-form-label">发货地址 : </label>
<div class="layui-input-block">
<input type="text" name="shipping_address" id="shipping_address"
placeholder="请输入发货地址" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('supplier_group','公司性质',!empty($supplier)?array_get($supplier,'supplier_group',null):'',
config('fixed.SupplierGroup'),['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>法人代表 :
</label>
<div class="layui-input-block">
<input type="text" style="width: 150px" name="legal_representative"
id="legal_representative"
placeholder="请输入法人代表" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md3">
<?php $singleSelectPresenter = app('App\Presenters\SingleSelectPresenter'); ?>
<?php echo $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',-1,[1=>'有',-1=>'无']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label" style="width: 80px"><span class="require">*</span>成立时间 :
</label>
<div class="layui-input-block" style="width: 150px">
<input type="text" id="established_time" name="established_time"
placeholder="请输入成立时间"
class="layui-input"
autocomplete="off"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('currency','结算币种',
isset($supplier)?$supplier['currency']:'',config('fixed.Currency'),['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<label class="layui-form-label">到票时间 :
</label>
<div class="layui-input-block">
<input type="text" style="width: 150px" name="ticket_time" id="ticket_time"
placeholder="请输入到票时间" class="layui-input" value="">
</div>
</div>
</div>
<div class="layui-col-md6">
<label class="layui-form-label">3-5家客户 :
</label>
<div class="layui-input-block">
<input type="text" name="main_customers" id="main_customers"
placeholder="请输入3-5家客户" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md12">
<label class="layui-form-label">
<span class="require">*</span>
主营品牌</label>
<div class="layui-input-block">
<div id="brand_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="main_brands" value=""
id="main_brands">
</div>
<a style="color: #009688;" id="batchAddMainBrands">+批量增加主营品牌</a>
<div id="batchAddMainBrandsDiv"
style="padding-left: 30px;padding-top: 30px;padding-right: 30px;display: none">
<div class="layui-col-md12">
<textarea rows="7" placeholder="标准品牌名称,多个用英文逗号隔开" class="layui-textarea"
id="batchAddMainBrandsTextarea"></textarea>
<blockquote class="layui-elem-quote" id="batchAddMainBrandsBlockQuote"></blockquote>
<span style="color: red" id="invalid_${name}_name_list"></span>
</div>
<div class="layui-col-md12">
<button class="layui-btn layui-btn-sm" type="button" id="confirmBatchAddMainBrands">
验证并且添加
</button>
<button class="layui-btn layui-btn-sm layui-btn-primary" type="button"
id="closeBatchAddMainBrands">关闭
</button>
</div>
</div>
</div>
</div>
<div class="layui-form-item" id="agency_brands_div" style="display: none">
<label class="layui-form-label">
<span class="require">*</span>
代理品牌</label>
<div class="layui-input-block" style="margin-top: 15px">
<div id="agency_brand_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="agency_brands" value=""
id="agency_brands">
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label"><span class="require">*</span>合作类型</label>
<div class="layui-input-block">
<input type="hidden" name="stockup_type"
value="<?php echo e(isset($supplier['stockup_type']) ? $supplier['stockup_type'] : ''); ?>">
<?php foreach(config('fixed.StockupType') as $k=>$type): ?>
<input type="checkbox" name="stockup_type[<?php echo e($k); ?>]" lay-filter="stockup_type_filter"
lay-skin="primary"
title="<?php echo e($type); ?>">
<?php endforeach; ?>
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_type','代购类型 : ',!empty($supplier)?$supplier['purchase_type']:'',config('field.PurchaseType')); ?>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $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>
<div class="layui-input-block">
<textarea name="credit_investigation" placeholder="请输入资信调查"
class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
</div>
<?php echo $__env->make('web.supplier.SupplierPayType', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>财务信息</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-col-md4">
<?php $singleSelectPresenter = app('App\Presenters\SingleSelectPresenter'); ?>
<?php echo $singleSelectPresenter->render('receipt_type','供应商类别',1,config('fixed.ReceiptType'),['require'=>true]); ?>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>开户名称 : </label>
<div class="layui-input-block block-42">
<input type="text" name="bank_name" id="bank_name"
placeholder="请输入开户名称,比如深圳市猎芯科技有限公司" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>开户行 : </label>
<div class="layui-input-block block-42">
<input type="text" name="bank_adderss" id="bank_adderss"
placeholder="请输入开户行,比如深圳建设银行" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>银行账号 : </label>
<div class="layui-input-block block-42">
<input type="text" name="account_no" id="account_no"
placeholder="请输入银行账号" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require" id="account_name_require_span"
style="display: none">*</span><span id="account_name_label">账户名称</span>
</label>
<div class="layui-input-block block-42">
<input type="text" name="account_name" id="account_name"
placeholder="请输入账户名称" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require" style="display: none"
id="bank_address_require_span">*</span>银行地址 : </label>
<div class="layui-input-block block-42">
<input type="text" name="account_adderss" id="account_adderss"
placeholder="请输入银行具体地址或银行所在国家" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item" id="nation_id_div" style="display: none">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('nation_id','银行国家 : ',0,
$nationList,['required'=>true]); ?>
</div>
</div>
<div class="layui-col-md4">
<div class="layui-form-item" id="swift_code_div" style="display: none">
<label class="layui-form-label"><span class="require">*</span>Swift Code : </label>
<div class="layui-input-block block-42">
<input type="text" name="swift_code" id="Swift Code"
placeholder="请输入银行国际代码" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">中转行 : </label>
<div class="layui-input-block block-42">
<input type="text" name="intermediary_bank" id="intermediary_bank"
placeholder="请输入中转行" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">备注 : </label>
<div class="layui-input-block block-42">
<input type="text" name="remark" id="remark"
placeholder="请输入备注" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md8">
<label class="layui-form-label">
<span class="require">*</span>银行凭证:
</label>
<div class="layui-input-block">
<input type="hidden" name="certificate" id="certificate"
value="">
<button type="button" class="layui-btn upload-img layui-btn-sm" preview="preview"
data-obj="certificate">
<i class="layui-icon">&#xe67c;</i>上传文件
</button>
<a target="_blank" id="certificate_url"
href=""></a>
</div>
</div>
</div>
<blockquote class="layui-elem-quote layui-text">
<b>联系人</b>
</blockquote>
<div class="layui-form-item">
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>联系人</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_consignee" id="supplier_consignee"
placeholder="请输入联系人" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>职位</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_position" id="supplier_position"
placeholder="请输入职位" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>邮箱</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_email" id="supplier_email"
placeholder="请输入邮箱" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>手机号</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_mobile" id="supplier_mobile"
placeholder="请输入手机号" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label"><span class="require">*</span>座机</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_telephone" id="supplier_telephone"
placeholder="请输入座机" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<label class="layui-form-label">QQ</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_qq" id="supplier_qq"
placeholder="请输入QQ" class="layui-input"
value="">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md4">
<label class="layui-form-label">传真</label>
<div class="layui-input-block block-42">
<input type="text" name="supplier_fax" id="supplier_fax"
placeholder="请输入传真" class="layui-input"
value="">
</div>
</div>
<div class="layui-col-md4">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('can_check_uids','采购员','',
$userCodes,['required'=>true]); ?>
</div>
<div class="layui-col-md4"></div>
</div>
<blockquote class="layui-elem-quote layui-text">
<b>附件管理</b>
</blockquote>
<?php echo $__env->make('web.supplier.SupplierFile', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('web.supplier.ApplyAuditReason', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="layui-form-item" style="margin-top: 10px;margin-left: 10px">
<p>
<b>特别说明:</b>
</p>
<p>
1、在创建新的供应商前,请先查询该供应商是否已经存在。如果供应商已存在,则不允许新增。
</p>
<p>
2、附件上传支持小于10M的PDF/JPG/PNG/BMP格式,ZIP格式则小于20M,每个类型允许上传多份;
</p>
<P>
3、此处新增供应商基本信息以及配置跟进人,其他信息补全必须进入编辑页面;
</P>
<P>
4、正式供应商建档必须上传营业执照,现货商类型必须上传品质协议;
</P>
<P>
5、正式供应商建档必须维护至少一条银行信息;
</P>
</div>
<div class="fix-button">
<div>
<div class="layui-row" style="width: 100%;padding-left: 50px">
<div class="layui-col-md12">
<div class="layui-row" style="text-align: left">
<button type="button" class="layui-btn layui-btn submit-loading" lay-submit
lay-filter="addSupplier">保存
</button>
<button type="button" class="layui-btn layui-btn submit-loading" id="apply_audit_button"
lay-submit lay-filter="addAndApplySupplier">申请审核
</button>
<button lay-filter="cancelAddSupplier"
type="button" lay-submit
class="layui-btn layui-btn-primary">取消
</button>
</div>
</div>
</div>
<hr>
</div>
</div>
</form>
</div>
</div>
<?php echo $__env->make('script.supplier.SupplierBaseScript', 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', 'laydate', 'xmSelect', 'selectN', 'tagsInput'],
function() {
let admin = layui.admin;
let form = layui.form;
let selectN = layui.selectN;
let layDate = layui.laydate;
let element = layui.element;
let xmSelect = layui.xmSelect;
//这里有个权限,是可以跳过公司信息审核的
let ignoreCompanyCheck = <?php echo e(checkPerm('IgnoreCompanyCheck') ? 1 : 0); ?>;
layDate.render({
elem: '#established_time',
format: 'yyyy-MM-dd'
});
const supplierId = getQueryVariable('supplier_id');
$("#supplier_name,#tax_number").blur(function() {
let supplier_name = $('#supplier_name').val();
const supplier_id = supplierId;
const region = $('#region').val();
let tax_number = $('#tax_number').val();
var self = $(this);
self.next().find('p').text('');
let url = '/api/supplier/CheckSupplierName?supplier_name=' + supplier_name +
'&supplier_id=' + supplier_id +
'&tax_number=' + tax_number + '&region=' + region;
<?php if(!checkPerm('IgnoreCompanyCheck')): ?>
if (supplier_name === '' && self.attr('id') === 'supplier_name') {
$('#tax_number').val('');
tax_number = '';
resetCompanyInfo();
}
if (tax_number === '' && self.attr('id') === 'tax_number') {
$('#supplier_name').val('');
supplier_name = '';
resetCompanyInfo();
}
<?php endif; ?>
$.ajax({
url: url,
type: 'GET',
async: true,
dataType: 'json',
timeout: 20000,
success: function(res) {
if (supplier_name !== '' || tax_number !== '') {
if (res.err_code !== 0) {
//当code=-2的时候,是公司信息校验有问题,但是如果有跳过检查权限或者是非大陆港台地区的,那么就什么都不处理
if (res.err_code === -2) {
if (!inArray(region, [2, 4])) {
return;
}
if (!ignoreCompanyCheck) {
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
} else if (res.err_code === -3) {
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
} else {
//这个code代表供应商名称已经存在,自然要检测
layer.msg(res.err_msg, {
icon: 5
});
self.next().find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
if (!ignoreCompanyCheck) {
//监听是不是供应商名称变化
resetCompanyInfo(self.attr('id') === 'supplier_name');
}
} else if (res.err_code === 0) {
//如果供应商没有问题,就要去自动填补部分资料
let companyInfo = res.data;
$('#supplier_name').val(companyInfo.supplier_name);
$('#tax_number').val(companyInfo.tax_number);
$('#phone').val(companyInfo.phone);
$('#supplier_address').val(companyInfo.supplier_address);
$('#registered_capital').val(companyInfo.registered_capital);
$('#established_time').val(companyInfo.establishment_time);
layer.msg('校验公司信息通过,自动补全相关数据', {
icon: 6
})
if (!ignoreCompanyCheck) {
if (self.attr('id') === 'supplier_name') {
$('#tax_number').attr('disabled', true);
} else {
$('#supplier_name').attr('disabled', true);
}
}
}
}
},
error: function() {
layer.msg('网络错误,请重试', {
icon: 5
});
}
});
});
function resetCompanyInfo(isSupplierNameChange = true) {
if (isSupplierNameChange) {
$('#tax_number').val('');
} else {
$('#supplier_name').val('');
}
$('#phone').val('');
$('#supplier_address').val('');
$('#registered_capital').val('');
}
<?php if(!empty($supplier)): ?>
<?php if($supplier['region'] == 2): ?>
$('.city-div').show();
<?php endif; ?>
<?php if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX): ?>
$('#agency_brands_div').show();
<?php endif; ?>
<?php endif; ?>
//监听所在区域变化,中国才显示省市选择
//而且有值+新增供应商操作 才能修改供应商名字和税号
//如果区域是海外(非中国),就去掉税号的必填星号
//如果选择区域为国内,那么成立时间disabled
//这里还有就是region有个对应公司id的映射关系,要自动切换对应的签约公司下拉
form.on('select(region)', function(data) {
<?php if(empty($supplier)): ?>
let supplierNameObj = $('#supplier_name');
let taxNumberObj = $('#tax_number');
if (data.value) {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
}
<?php endif; ?>
if (data.value === '2') {
$('#tax_number_required_span').show();
$('#tax_number_div').show();
$('.city-div').show();
//同时还要判断权限,有忽略公司校验权限的,成立时间可以不disabled,以及还有一个条件,修改的时候不能disable
if (!ignoreCompanyCheck && !supplierId) {
$('#established_time').attr('disabled', true);
$('#established_time').addClass('layui-disabled');
}
} else {
$('#tax_number_required_span').hide();
$('#tax_number_div').hide();
$('.city-div').hide();
$('#established_time').attr('disabled', false);
$('#established_time').removeClass('layui-disabled');
}
let signComId = 0;
<?php if(!empty($supplier)): ?>
signComId = <?php echo e(!empty($supplier['region']) ? array_get(config('fixed.RegionSignComMap'), $supplier['region'], 0) : 0); ?>;
<?php endif; ?>;
let regionSignComMap = <?php echo json_encode(config('fixed.RegionSignComMap')); ?>;
signComId = regionSignComMap[data.value];
//根据获取的id,去修改下拉框内容
$('#sign_com_id').val(signComId);
//重新渲染下拉框
form.render('select');
});
//监听供应商性质选择,如果为混合分销商,那么要展示混合分销商品牌设置
form.on('select(supplier_group)', function(data) {
if (data.value === '7') {
$('#agency_brands_div').show();
} else {
$('#agency_brands_div').hide();
}
});
//如果没有直接忽略公司校验的权限,那么就要做到下面的互相disable
<?php if(!checkPerm('IgnoreCompanyCheck')): ?>
//修改供应商名称,那么公司税号就禁用,反之亦然
$('#supplier_name').change(function() {
let taxNumberObj = $('#tax_number');
if ($(this).val()) {
taxNumberObj.attr('disabled', true);
taxNumberObj.addClass('layui-disabled');
} else {
taxNumberObj.attr('disabled', false);
taxNumberObj.removeClass('layui-disabled');
}
});
$('#tax_number').change(function() {
let supplierNameObj = $('#supplier_name');
if ($(this).val()) {
supplierNameObj.attr('disabled', true);
supplierNameObj.addClass('layui-disabled');
} else {
supplierNameObj.attr('disabled', false);
supplierNameObj.removeClass('layui-disabled');
}
});
<?php endif; ?>
//监听供应商类别单选,如果是临时供应商,附件可以不上传
//如果是临时供应商并且不显示申请审核按钮
form.on('radio(supplier_type)', function(data) {
let supplier_type = data.value;
if (supplier_type === '1') {
$('#attachment_required_span').show();
} else {
$('#attachment_required_span').hide();
}
});
//渲染主营品牌的多选
function getBrandOption(element, idName = 'main_brands') {
return {
el: '#' + element,
filterable: true,
paging: true,
height: '250px',
size: 'mini',
direction: 'auto',
autoRow: true,
prop: {
name: 'brand_name',
value: 'brand_id',
},
remoteSearch: true,
pageRemote: true,
template({
item,
sels,
name,
value
}) {
return item.brand_name + '<span style="position: absolute; right: 10px; color: #8799a3">' +
item.mapping_brand_names + '</span>'
},
filterMethod: function(val, item, index, prop) {},
pageSize: 30,
remoteMethod: function(val, cb, show, pageIndex) {
//val: 搜索框的内容, 不开启搜索默认为空, cb: 回调函数, show: 当前下拉框是否展开, pageIndex: 当前第几页
$.ajax({
url: '/api/common/getStandardBrandList',
type: 'post',
data: {
brand_name: val,
page: pageIndex
},
dataType: 'json',
timeout: 10000,
success: function(res) {
if (!res) return layer.msg('网络错误,请重试', {
icon: 5
});
if (res.err_code === 0) {
cb(res.data, res.last_page);
} else {
layer.msg(res.err_msg, {
icon: 6
});
}
},
error: function() {
return layer.msg('网络错误,请重试', {
icon: 5
});
}
});
},
on: function(data) {
let arr = data.arr;
let brandIds = '';
for (let i in arr) {
brandIds += arr[i].brand_id + ',';
}
$('#' + idName).val(brandIds);
},
};
}
//主营品牌的渲染
let brandOption = getBrandOption('brand_selector');
let brandSelector = xmSelect.render(brandOption);
let brandIds = $('#main_brands').attr('value');
let brandInitValue = <?php echo json_encode($brand_init_value ?: []); ?>;
brandSelector.setValue(brandInitValue);
//批量新增主营品牌
$('#batchAddMainBrands').click(function() {
layer.open({
title: "批量增加主营品牌",
area: ['600px', '400px'],
type: 1,
content: $('#batchAddMainBrandsDiv')
});
});
$('#confirmBatchAddMainBrands').click(function() {
let brandValue = brandSelector.getValue();
console.log(brandValue);
let standardBrandNames = $('#batchAddMainBrandsTextarea').val();
//请求接口获取返回的数据,并且合并目前选择的主营品牌,重新渲染xm-select
let res = ajax('/api/supplier/getBatchAddMainBrandsData', {
standard_brand_names: standardBrandNames
});
let data = res.data;
let brandNames = arrayColumn(data, 'brand_name').join(',')
$('#batchAddMainBrandsBlockQuote').text(brandNames);
if (data.length === 0) {
layer.msg('没有匹配到有效的标准品牌', {
icon: 5
});
return false;
} else {
brandValue = brandValue.concat(data);
brandValue = multiArrayUnique(brandValue);
brandSelector.setValue(brandValue);
$('#main_brands').val(arrayColumn(brandValue, 'brand_id').join(','));
$('#batchAddMainBrandsTextarea').val('');
$('#batchAddMainBrandsBlockQuote').text('');
layer.msg('批量添加主营品牌成功', {
icon: 6
});
}
});
$('#closeBatchAddMainBrands').click(function() {
$('#batchAddMainBrandsTextarea').val('');
$('#batchAddMainBrandsBlockQuote').text('');
layer.closeAll();
});
//代理品牌的渲染
let agencyBrandOption = getBrandOption('agency_brand_selector', 'agency_brands');
let agencyBrandSelector = xmSelect.render(agencyBrandOption);
let agencyBrandIds = $('#agency_brands').attr('value');
let agencyBrandInitValue = <?php echo json_encode($agency_brand_init_value ?: []); ?>;
agencyBrandSelector.setValue(agencyBrandInitValue);
//主营品牌数量逻辑
form.on('select(day_type)', function(data) {
console.log(data.value)
if (data.value === '2') {
$('#cp_time_day').attr('disabled', true);
$('#cp_time_day').addClass('layui-disabled');
} else {
$('#cp_time_day').attr('disabled', false);
$('#cp_time_day').removeClass('layui-disabled');
}
});
//供应商标签的多选
function getTagOption(element) {
//获取系统标签列表
let url = '/api/supplier_tag/GetSystemTagList';
let tagResult = ajax(url);
let tagList = tagResult.data;
return {
el: '#' + element,
filterable: true,
paging: true,
height: '250px',
size: 'small',
direction: 'auto',
autoRow: true,
prop: {
name: 'tag_name',
value: 'tag_id',
},
pageSize: 30,
data: tagList,
// on: function (tagList) {
// let arr = tagList.arr;
// let tagIds = '';
// for (let i in arr) {
// tagIds += arr[i].tag_id + ',';
// }
// let idName = 'system_tags';
// $('#' + idName).val(tagIds);
// },
};
}
if (supplierId) {
<?php if(checkPerm('UpdateSupplierTags')): ?>
let systemTagOption = getTagOption('system_tags_selector');
systemTagOption.disabled = true;
let tagSelector = xmSelect.render(systemTagOption);
// let tagIds = $('#system_tags').attr('value');
tagSelector.setValue(<?php echo json_encode(!empty($supplier['system_tags']) ? $supplier['system_tags'] : []); ?>);
//自定义标签
$('#customer_tags').tagsInput({});
<?php endif; ?>
}
//省市区选择
let regionData = <?php echo json_encode($region_data); ?>;
let provinceCity = <?php echo !empty($province_city) ? json_encode($province_city) : '[]'; ?>;
//无限级分类-基本配置
selectN({
elem: '#city-selector',
search: [true, true],
name: 'province_city',
data: regionData,
selected: provinceCity
});
//重新查验公司信息,请求相关接口
$('#recheck_company_info').click(function() {
let supplierName = $('#supplier_name').val();
let taxNumber = $('#tax_number').val();
let region = $('#region').val();
admin.btnLoading('#recheck_company_info', '正在查验公司信息,请稍等...');
if (!inArray(region, [2, 4])) {
layer.msg('该供应商地区不为大陆或者港台,无法查验', {
icon: 5
});
admin.btnLoading('#recheck_company_info', false);
return;
}
if (!supplierName && !taxNumber) {
layer.msg('请填写供应商名称或者税号后再进行查验', {
icon: 5
});
admin.btnLoading('#recheck_company_info', false);
return false;
}
$('#supplier_check_tip').remove();
let url = '/api/common/checkCompanyInfo?supplier_name=' + supplierName + '&tax_number=' +
taxNumber + '&region=' + region;
$.ajax({
url: url,
type: 'GET',
async: true,
dataType: 'json',
timeout: 20000,
success: function(res) {
admin.btnLoading('#recheck_company_info', false);
if (res.err_code === 0) {
let companyInfo = res.data;
$('#supplier_name').val(companyInfo.supplier_name);
//这个属性因为是disabled了,没法直接用jq去修改,就算直接修改layui也是没法接到值的
form.val('supplier_form', {
tax_number: companyInfo.tax_number
})
$('#tax_number').val(companyInfo.tax_number);
$('#supplier_address').val(companyInfo.supplier_address);
$('#phone').val(companyInfo.phone);
$('#registered_capital').val(companyInfo.registered_capital);
$('#established_time').val(companyInfo.establishment_time);
form.render();
layer.msg('验证成功,校验公司信息通过,自动补全相关数据', {
icon: 6
})
} else if (res.err_code === -1) {
if (ignoreCompanyCheck) {
layer.msg('公司未进行工商注册', {
icon: 5
})
} else {
$('#supplier_name').next('#supplier_check_tip').find('p').text(
'公司未进行工商注册');
layer.msg('验证失败,公司未进行工商注册', {
icon: 5
})
resetCompanyInfo(supplierName !== '');
}
}
},
error: function() {
admin.btnLoading('#recheck_company_info', false);
layer.msg('网络错误,请重试', {
icon: 5
});
}
})
});
});
</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
<style>
.main_filter {
cursor: pointer;
}
</style>
<div class="layui-fluid" id="type_filter">
<div class="layui-card">
<div class="layui-card-body" style="padding: 0;">
<div class="split-group" style="height: 170px;">
<div class="split-item" id="s1" style="text-align: center">
<div class="layui-row">
<a class="main_filter layui-badge layui-bg-green" id="total"></a>
<div class="layui-row">
<a class="main_filter" title="待复审" id="need_review">
待复审
</a>
</div>
</div>
</div>
<div class="split-item" id="s6" style="text-align: center">
<div class="layui-row">
<a class="main_filter" title="战略供应商" id="level_a">
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="账期供应商" id="pay_type_term">
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="缺少平台合作协议(线上)" id="no_cooperation_agreement">
缺少平台合作协议(线上)
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="缺少品质协议(线上)" id="no_quality_assurance_agreement_all">
缺少品质协议(线上)
</a>
</div>
<?php if(checkPerm('SupplierBlockList')): ?>
<div class="layui-row">
<a class="main_filter" id="block" data-value="-3">
</a>
</div>
<?php endif; ?>
</div>
<div class="split-item" id="s7" style="text-align: center">
<div class="layui-row">
<a class="main_filter" title="历史平台合作供应商" id="uploaded_sku">
历史平台合作供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="非芯链供应商" id="not_yunxin">
非芯链供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已上架(非芯链)供应商" id="not_yunxin_and_has_sku">
已上架(非芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已下架(非芯链)供应商" id="not_yunxin_and_has_no_sku">
已下架(非芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="芯链供应商" id="yunxin">
芯链供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已上架(芯链)供应商" id="yunxin_and_has_sku">
已上架(芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已下架(芯链)供应商" id="yunxin_and_has_no_sku">
已下架(芯链)供应商
</a>
</div>
</div>
<div class="split-item" id="s8" style="text-align: center">
<div class="layui-row">
<a class="main_filter" title="3天内到期(芯链)供应商" id="yunxin_expired_at_days">
3天内到期(芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="3天内到期(非芯链)供应商" id="not_yunxin_expired_at_days">
3天内到期(非芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已过期(芯链)供应商" id="yunxin_expired">
已过期(芯链)供应商
</a>
</div>
<div class="layui-row">
<a class="main_filter" title="已过期(非芯链)供应商" id="not_yunxin_expired">
已过期(非芯链)供应商
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="layui-collapse">
<?php if(checkPerm('ViewFilter')): ?>
<!--通用的筛选-->
<form class="layui-form" style="margin-top: 15px">
<?php
$routerName = explode('/', request()->path())[1];
?>
<div class="layui-row">
<div class="layui-row">
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['supplier_group'=>'供应商性质'],
['supplier_group'=>config('fixed.SupplierGroup')]); ?>
</div>
<div class="layui-inline">
<?php $transformableInputPresenter = app('App\Presenters\Filter\TransformableInputPresenter'); ?>
<?php echo $transformableInputPresenter->render(['supplier_name'=>'供应商名称']); ?>
</div>
<div class="layui-inline">
<?php $transformableInputPresenter = app('App\Presenters\Filter\TransformableInputPresenter'); ?>
<?php echo $transformableInputPresenter->render(['supplier_code'=>'供应商编码']); ?>
</div>
<div class="layui-inline">
<?php $multiSelectorPresenter = app('App\Presenters\MultiSelectorPresenter'); ?>
<?php echo $multiSelectorPresenter->render('status','供应商状态','',$statusData); ?>
</div>
<div class="layui-inline">
<?php $multiSelectorPresenter = app('App\Presenters\MultiSelectorPresenter'); ?>
<?php echo $multiSelectorPresenter->render('stockup_type','合作类型','',$stockupTypeData); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['has_sku'=>'SKU上传'],
['has_sku'=>[1=>'是',-1=>'否']]); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['yunxin_channel_uid' => '线上采购员'],
['yunxin_channel_uid' => $userCodes]); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['source' => 'SKU上传方式',],
['source'=>config('field.SkuSource')]); ?>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_type','代购类型','',config('field.PurchaseType')); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['has_uploaded_sku'=>'历史SKU合作'],
['has_uploaded_sku'=>[1=>'是',-1=>'否']]); ?>
</div>
<button class="layui-btn layui-btn-sm" type="button" id="show_filter_row2">展开</button>
</div>
</div>
<div class="layui-row" id="filter_row2" style="display: none">
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['company_nature'=>'公司实际性质'],
['company_nature'=>config('field.CompanyNature')]); ?>
</div>
<div class="layui-inline">
<?php $transformableInputPresenter = app('App\Presenters\Filter\TransformableInputPresenter'); ?>
<?php echo $transformableInputPresenter->render(['group_code'=>'集团编码']); ?>
</div>
<div class="layui-inline">
<?php $transformableInputPresenter = app('App\Presenters\Filter\TransformableInputPresenter'); ?>
<?php echo $transformableInputPresenter->render(['supplier_id'=>'供应商ID']); ?>
</div>
<div class="layui-inline">
<?php $transformableSelectPresenter = app('App\Presenters\Filter\TransformableSelectPresenter'); ?>
<?php echo $transformableSelectPresenter->render(['channel_uid'=>'采购员'],$userCodes); ?>
</div>
<div class="layui-inline">
<?php $transformableSelectPresenter = app('App\Presenters\Filter\TransformableSelectPresenter'); ?>
<?php echo $transformableSelectPresenter->render(['purchase_uid'=>'开发员'],$userCodes); ?>
</div>
<div class="layui-inline">
<?php $transformableSelectPresenter = app('App\Presenters\Filter\TransformableSelectPresenter'); ?>
<?php echo $transformableSelectPresenter->render(['create_uid'=>'创建人'],$userCodes); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['sku_tag'=>'SKU标准'],
['sku_tag'=>config('field.SkuTag')]); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['sku_mode'=>'SKU模式'],
['sku_mode'=>config('field.SkuMode')]); ?>
</div>
<div class="layui-inline">
<?php $multiSelectorPresenter = app('App\Presenters\MultiSelectorPresenter'); ?>
<?php echo $multiSelectorPresenter->render('supplier_type','供应商类型','',$supplierTypeData); ?>
</div>
<div class="layui-inline">
<?php $multiSelectorPresenter = app('App\Presenters\MultiSelectorPresenter'); ?>
<?php echo $multiSelectorPresenter->render('level','等级','',$levelData); ?>
</div>
<div class="layui-inline">
<?php $multiTransformableSelectPresenter = app('App\Presenters\Filter\MultiTransformableSelectPresenter'); ?>
<?php echo $multiTransformableSelectPresenter->render(['has_cooperation_agreement'=>'平台合作协议'],
['has_cooperation_agreement'=>[1=>'是',-1=>'否']]); ?>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('is_entity','实体名单','',config('field.IsEntity')); ?>
</div>
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $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>
</div>
</div>
<div class="layui-row">
<div class="layui-inline" style="width: 600px">
<?php $transformableTimeIntervalPresenter = app('App\Presenters\Filter\TransformableTimeIntervalPresenter'); ?>
<?php echo $transformableTimeIntervalPresenter->render(['update_time'=>'更新时间','create_time'=>'创建时间','sku_create_time' => '首次上传sku时间']); ?>
</div>
</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>
<button type="button" class="layui-btn layui-btn-sm layui-btn hide_filter_type">隐藏罗盘</button>
<button type="button" class="layui-btn layui-btn-sm layui-btn show_filter_type"
style="display: none">显示罗盘
</button>
</div>
</form>
<?php endif; ?>
</div>
<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
<style>
.fix-button {
height: 110px;
margin-top: 0;
margin-left: -30px;
padding: 10px 45px;
position: fixed;
bottom: 0;
background: white;
width: 100%;
z-index: 10;
}
</style>
<blockquote class="layui-elem-quote layui-text">
<b>基本信息</b>
</blockquote>
<?php if($operate=='add'): ?>
<form class="layui-form" action="" lay-filter="supplier_form">
<?php endif; ?>
<?php
$supplierType = config('field.SupplierType');
$option = ['required' => true];
//竞调供应商is_type=1也不允许修改供应商类型
if ((!empty($supplier) && $supplier['is_type'] == 1)) {
$option['disable'] = true;
}
//临时类型的供应商,不显示待转正选项
if ($supplier['supplier_type'] == 2 || $supplier['is_type'] == 0) {
unset($supplierType[3]);
}
?>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $singleSelectPresenter = app('App\Presenters\SingleSelectPresenter'); ?>
<?php echo $singleSelectPresenter->render('supplier_type','供应商类别',!empty($supplier)?array_get($supplier,'supplier_type',0):'1',$supplierType,$option); ?>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('region','所在区域 : ',$supplier['region'],
config('fixed.Region'),['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md6">
<div class="city-div" style="display: none">
<label class="layui-form-label">选择省市 : </label>
<div class="city-selector" id="city-selector"></div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>供应商名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name" id="supplier_name"
placeholder="选择所在区域才允许输入供应商名称" class="layui-input <?php if($supplier): ?>
layui-disabled
<?php endif; ?>"
value="<?php echo e(isset($supplier['supplier_name']) ? $supplier['supplier_name'] : ''); ?>"
<?php if($supplier): ?> disabled <?php endif; ?>>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-block" id="tax_number_div"
<?php if(!empty($supplier)&&$supplier['region']!=2): ?>
style="display: none"
<?php endif; ?>
>
<label class="layui-form-label"><span id="tax_number_required_span"
class="require">*</span>公司税号</label>
<div class="layui-input-block">
<input type="text" name="tax_number" id="tax_number" placeholder="选择所在区域才允许输入公司税号,海外供应商没有税号可以不填"
class="layui-input layui-disabled" disabled value="<?php echo e(isset($supplier['tax_number']) ? $supplier['tax_number'] : ''); ?>">
</div>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div>
</div>
<div class="layui-col-md2" style="padding-left: 40px">
<button type="button" class="layui-btn layui-btn-sm" id="recheck_company_info">重新查验公司信息</button>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label">注册公司名 : </label>
<div class="layui-input-block">
<input type="text" name="register_company_name" id="register_company_name"
placeholder="请输入注册公司名,注册公司名必须同执照" class="layui-input"
value="<?php echo e($supplier['register_company_name']); ?>">
</div>
</div>
<div class="layui-col-md5">
<label class="layui-form-label">英文名称 : </label>
<div class="layui-input-block">
<input type="text" name="supplier_name_en" id="supplier_name_en"
placeholder="请输入供应商英文名称" class="layui-input" value="<?php echo e($supplier['supplier_name_en']); ?>">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_uid','渠道开发员 : ',$supplier['purchase_uid'],$userCodes,['required'=>true,'width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>注册资金(万): </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="registered_capital" id="registered_capital"
placeholder="单位(万),至少50万" class="layui-input"
value="<?php echo e($supplier['registered_capital']); ?>">
</div>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('is_business_abnormal','是否历史经营异常 : ',$supplier['is_business_abnormal'],
[-1=>'否',1=>'是'],['required'=>true,'label_width'=>'120px']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>公司电话 : </label>
<div class="layui-input-block" style="width: 150px">
<input type="text" name="phone" id="phone"
placeholder="请输入公司电话" class="layui-input" value="<?php echo e($supplier['phone']); ?>">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md5">
<label class="layui-form-label"><span class="require">*</span>注册地址 :
</label>
<div class="layui-input-block">
<input type="text" name="supplier_address" id="supplier_address"
placeholder="请输入注册地址" class="layui-input"
value="<?php echo e(isset($supplier['supplier_address']) ? $supplier['supplier_address'] : ''); ?>">
</div>
</div>
<?php if($operate=='add'): ?>
<div class="layui-col-md7">
<label class="layui-form-label">发货地址 : </label>
<div class="layui-input-block">
<input type="text" name="shipping_address" id="shipping_address"
placeholder="请输入发货地址" class="layui-input"
value="<?php echo e(isset($address['shipping_address']) ? $address['shipping_address'] : ''); ?>">
</div>
</div>
<?php endif; ?>
</div>
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('supplier_group','公司性质',!empty($supplier)?array_get($supplier,'supplier_group',0):'',
config('fixed.SupplierGroup'),['required'=>true]); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label"><span class="require">*</span>法人代表 :
</label>
<div class="layui-input-block">
<input type="text" style="width: 150px" name="legal_representative" id="legal_representative"
placeholder="请输入法人代表" class="layui-input"
value="<?php echo e(isset($supplier['legal_representative']) ? $supplier['legal_representative'] : ''); ?>">
</div>
</div>
<div class="layui-col-md3">
<?php $singleSelectPresenter = app('App\Presenters\SingleSelectPresenter'); ?>
<?php echo $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',$supplier['has_legal_ID_card'],[1=>'有',-1=>'无']); ?>
</div>
<div class="layui-col-md3">
<label class="layui-form-label" style="width: 80px"><span class="require">*</span>成立时间 :
</label>
<div class="layui-input-block" style="width: 150px">
<input type="text" id="established_time" name="established_time"
placeholder="请输入成立时间"
class="layui-input"
autocomplete="off"
value="<?php echo e(isset($supplier['established_time']) ? $supplier['established_time'] : ''); ?>">
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('currency','结算币种',
isset($supplier)?$supplier['currency']:'',config('fixed.Currency'),['required'=>true]); ?>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<label class="layui-form-label">到票时间 :
</label>
<div class="layui-input-block">
<input type="text" style="width: 170px" name="ticket_time" id="ticket_time"
placeholder="请输入到票时间" class="layui-input"
value="<?php echo e(isset($supplier['ticket_time']) ? $supplier['ticket_time'] : ''); ?>">
</div>
</div>
</div>
<div class="layui-col-md6">
<label class="layui-form-label">3-5家客户 :
</label>
<div class="layui-input-block">
<input type="text" name="main_customers" id="main_customers"
placeholder="请输入3-5家客户" class="layui-input"
value="<?php echo e(isset($supplier['main_customers']) ? $supplier['main_customers'] : ''); ?>">
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md12">
<label class="layui-form-label">
<span class="require">*</span>
主营品牌</label>
<div class="layui-input-block">
<div id="brand_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="main_brands" value=""
id="main_brands" value="<?php echo e(isset($supplier['main_brands']) ? $supplier['main_brands'] : ''); ?>">
</div>
<a style="color: #009688;" id="batchAddMainBrands">+批量增加主营品牌</a>
<div id="batchAddMainBrandsDiv" style="padding-left: 30px;padding-top: 30px;padding-right: 30px;display: none">
<div class="layui-col-md12">
<textarea rows="7" placeholder="标准品牌名称,多个用英文逗号隔开" class="layui-textarea"
id="batchAddMainBrandsTextarea"></textarea>
<blockquote class="layui-elem-quote" id="batchAddMainBrandsBlockQuote"></blockquote>
<span style="color: red" id="invalid_${name}_name_list"></span>
</div>
<div class="layui-col-md12">
<button class="layui-btn layui-btn-sm" type="button" id="confirmBatchAddMainBrands">验证并且添加</button>
<button class="layui-btn layui-btn-sm layui-btn-primary" type="button" id="closeBatchAddMainBrands">关闭</button>
</div>
</div>
</div>
</div>
<?php /*选择“混合分销商”时,在主营品牌下面新增一栏“代理品牌”;代理品牌取值同主营品牌一样*/ ?>
<div class="layui-form-item" id="agency_brands_div"
style="
<?php if(!empty($supplier)&&$supplier['supplier_group']!=\App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX): ?>
display:none;
<?php endif; ?>
">
<label class="layui-form-label">
<span class="require">*</span>
代理品牌</label>
<div class="layui-input-block" style="margin-top: 15px">
<div id="agency_brand_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="agency_brands" value="<?php echo e(isset($supplier['agency_brands']) ? $supplier['agency_brands'] : ''); ?>"
id="agency_brands">
</div>
</div>
<div class="layui-form-item">
<div class="layui-col-md6">
<div class="layui-inline">
<label class="layui-form-label"><span class="require">*</span>合作类型</label>
<div class="layui-input-block">
<?php foreach(config('fixed.StockupType') as $k=>$type): ?>
<input type="checkbox" lay-filter="stockup_type_filter" name="stockup_type[<?php echo e($k); ?>]"
lay-skin="primary"
<?php if(!empty($supplier['stockup_type_data'])&&in_array($k,$supplier['stockup_type_data'])): ?>
checked
<?php endif; ?>
title="<?php echo e($type); ?>">
<?php endforeach; ?>
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('purchase_type','代购类型 : ',!empty($supplier)?$supplier['purchase_type']:'',config('field.PurchaseType')); ?>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-inline">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $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>
<div class="layui-input-block">
<textarea name="credit_investigation" placeholder="请输入资信调查"
class="layui-textarea"><?php echo e(isset($supplier['credit_investigation']) ? $supplier['credit_investigation'] : ''); ?></textarea>
</div>
</div>
<?php echo $__env->make('web.supplier.SupplierPayType', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div <?php if($operate!='add' && checkPerm('UpdateSupplierTags')): ?> <?php else: ?> style="display: none" <?php endif; ?>>
<blockquote class="layui-elem-quote layui-text">
<b>供应商标签 : </b>
</blockquote>
<div class="layui-form-item">
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('level','等级',!empty($supplier)?$supplier['level']:'',['A'=>'A','B'=>'B','C'=>'C','D'=>'D'],['width'=>'150px']); ?>
</div>
<div class="layui-col-md3">
<?php $statusPresenter = app('App\Presenters\StatusPresenter'); ?>
<?php echo $statusPresenter->render('has_certification','认证',!empty($supplier)?$supplier['has_certification']:'',[1=>'认证',-1=>'非认证'],['width'=>'150px']); ?>
</div>
<div class="layui-col-md6">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">
系统标签 : </label>
<div class="layui-input-block" style="margin-top: 15px">
<div id="system_tags_selector" class="layui-input-inline" style="width: 100%;">
</div>
<input type="hidden" name="system_tags"
id="system_tags">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">
自定义标签 : </label>
<div class="layui-input-block" style="margin-top: 15px">
<input name="customer_tags" id="customer_tags" value="<?php echo e(isset($supplier['customer_tags']) ? $supplier['customer_tags'] : ''); ?>">
</div>
</div>
</div>
<?php echo $__env->make('script.supplier.SupplierBaseScript', 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: '#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
<style>
.layui-form-item {
margin-bottom: 5px;
}
.layui-input-inline {
margin-top: 0px;
}
.xm-select {
height: 30px;
line-height: 30px;
}
.fix-top {
height: 140px;
margin-top: 0;
margin-left: -30px;
padding: 10px 45px;
position: fixed;
top: 0;
background: white;
width: 100%;
z-index: 10;
}
</style>
<div class="layui-card">
<form class="layui-form" action="" lay-filter="supplier_form">
<div class="layui-card-header fix-top" style="box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.5);">
<div class="layui-row">
<div class="layui-col-md2">
<b><?php echo e($supplier['supplier_name']); ?></b>
</div>
<div class="layui-col-md2">
供应商编码 : <?php echo e($supplier['supplier_code']); ?>
</div>
<div class="layui-col-md2">
状态 : <?php echo e($supplier['status_name']); ?>
</div>
<div class="layui-col-md2">
渠道开发员 : <?php echo e($supplier['purchase_username']); ?>
</div>
<div class="layui-col-md4">
最近修改时间 : <?php echo e($supplier['update_time']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
公司性质 : <?php echo e($supplier['supplier_group_name']); ?>
</div>
<div class="layui-col-md2">
合作类型 :
<?php if(mb_strlen($supplier['stockup_type_name'])>12): ?>
<span title="<?php echo e($supplier['stockup_type_name']); ?>">
<?php echo e(mb_substr($supplier['stockup_type_name'],0,12)); ?>...
</span>
<?php else: ?>
<?php echo e($supplier['stockup_type_name']); ?>
<?php endif; ?>
</div>
<div class="layui-col-md2">
线上采购员 : <?php echo e($supplier['yunxin_channel_username']); ?>
</div>
<div class="layui-col-md3">
<span title="<?php echo e($supplier['channel_username']); ?>">
采购员 : <?php echo e(str_limit($supplier['channel_username'],50,'...')); ?>
</span>
</div>
<div class="layui-col-md3"></div>
</div>
<div class="layui-row" style="margin-bottom: 25px;margin-top: 5px">
<?php if($supplier['status']==-1): ?>
<button type="button" class="layui-btn layui-btn submit-loading" lay-submit
lay-filter="updateSupplier">确认新建供应商
</button>
<?php elseif($supplier['status']==\App\Model\SupplierChannelModel::STATUS_REJECT): ?>
<button type="button" class="layui-btn layui-btn submit-loading" lay-submit
lay-filter="applyAuditSupplier">审核未通过,确认重新提交审核
</button>
<?php else: ?>
<?php /* <button type="button" class="layui-btn layui-btn submit-loading" lay-submit*/ ?>
<?php /* lay-filter="updateSupplier">确认修改供应商*/ ?>
<?php /* </button>*/ ?>
<?php if($supplier['status'] == \App\Model\SupplierChannelModel::STATUS_PASSED && checkPerm('IgnoreUpdateAudit')): ?>
<button type="button" class="layui-btn layui-btn submit-loading" lay-submit
lay-filter="updateSupplier">确认修改供应商
</button>
<?php else: ?>
<button type="button" class="layui-btn layui-btn submit-loading" lay-submit
lay-filter="applyAuditSupplier">申请审核
</button>
<?php endif; ?>
<?php endif; ?>
<a id="supplierDetailUrl"
href="/supplier/SupplierDetail?view=iframe&supplier_id=<?php echo e($supplier['supplier_id']); ?>"
class="layui-btn layui-btn-primary">取消</a>
</div>
</div>
<div class="layui-card-body" style="margin-top: 140px">
<input type="hidden" name="supplier_id" value="<?php echo e($supplier['supplier_id']); ?>">
<input type="hidden" name="supplier_code" value="<?php echo e($supplier['supplier_code']); ?>">
<div class="layui-tab">
<ul class="layui-tab-title">
<li
<?php if(request()->get('tab')=='base_info'||empty(request()->get('tab'))): ?>
class="layui-this"
<?php endif; ?>
id="base_info">基本信息
</li>
<li
<?php if(request()->get('tab')=='contact'): ?>
class="layui-this"
<?php endif; ?>
id="contact">联系人
</li>
<li
<?php if(request()->get('tab')=='ruler'): ?>
class="layui-this"
<?php endif; ?>
id="ruler">特殊规则
</li>
<li <?php if(!checkPerm('UpdateSkuRuler')): ?> style="display: none" <?php endif; ?>
<?php if(request()->get('tab')=='sku_ruler'): ?>
class="layui-this"
<?php endif; ?>
id="sku_ruler">SKU概况
</li>
<li <?php if(!checkPerm('ViewSupplierExamination')): ?> style="display: none" <?php endif; ?>
<?php if(request()->get('tab')=='examination'): ?>
class="layui-this"
<?php endif; ?>
id="examination">检测记录
</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item
<?php if(request()->get('tab')=='base_info'||empty(request()->get('tab'))): ?> layui-show <?php endif; ?>"
>
<div class="layui-row">
<input type="hidden" name="apply_audit_reason" id="apply_audit_reason">
<input type="hidden" name="status" value="<?php echo e(isset($supplier['status']) ? $supplier['status'] : 0); ?>">
<div class="layui-row">
<?php echo $__env->make('web.supplier.SupplierBase', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>系统设置</b>
</blockquote>
<div class="layui-row" style="margin-bottom: 10px;margin-left: 30px;">
<div class="layui-col-md3">
<div class="layui-inline">
供应商编码 :&nbsp;<?php echo e($supplier['supplier_code']); ?>
</div>
</div>
<div class="layui-col-md3" style="margin-left: 15px;">
<div class="layui-inline">
供应商ID :&nbsp;&nbsp;<?php echo e($supplier['supplier_id']); ?>
</div>
</div>
</div>
<blockquote class="layui-elem-quote layui-text">
<b><span class="require">*</span>财务信息</b>
</blockquote>
<?php echo $__env->make('web.supplier.SupplierReceipt', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b><span class="require">*</span>附件管理</b>
</blockquote>
<?php echo $__env->make('web.supplier.SupplierAttachment', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>运输信息</b>
</blockquote>
<div class="layui-form-item">
<label class="layui-form-label">发货地址 : </label>
<div class="layui-input-block block-42">
<input type="text" name="shipping_address" id="shipping_address"
placeholder="请输入发货地址" class="layui-input"
value="<?php echo e($address['shipping_address']); ?>">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">退货地址 : </label>
<div class="layui-input-block block-42">
<input type="text" name="return_address" id="return_address"
placeholder="请输入退货地址" class="layui-input"
value="<?php echo e($address['return_address']); ?>">
</div>
</div>
<div class="layui-form-item" style="width:70%">
<div class="layui-inline">
<label class="layui-form-label">退货收货人 : </label>
<div class="layui-input-inline">
<input type="text" name="return_consignee" id="return_consignee"
placeholder="请输入收货人"
class="layui-input" value="<?php echo e(isset($address['return_consignee']) ? $address['return_consignee'] : ''); ?>">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" style="width: 130px">退货收货人电话 : </label>
<div class="layui-input-inline">
<input type="text" name="return_phone" id="return_phone"
placeholder="请输入退货收货人电话"
class="layui-input" value="<?php echo e($address['return_phone']); ?>">
</div>
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>其他信息</b>
</blockquote>
<div class="layui-row">
<div class="layui-col-md2">
创建人:<?php echo e($supplier['create_name']); ?>
</div>
<div class="layui-col-md2">
创建时间:<?php echo e($supplier['create_time']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
最近修改人:<?php echo e($supplier['last_update_name']); ?>
</div>
<div class="layui-col-md3">
最近修改时间:<?php echo e($supplier['last_update_time']); ?>
</div>
</div>
<hr/>
</div>
</div>
<?php /*联系人*/ ?>
<div class="layui-tab-item <?php if(request()->get('tab')=='contact'): ?> layui-show <?php endif; ?>">
<div <?php if(!checkPerm('ViewSupplierContact')): ?>style="display: none"<?php endif; ?>>
<?php echo $__env->make('web.supplier.SupplierContact', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
</div>
<?php /*特殊规则*/ ?>
<div class="layui-tab-item <?php if(request()->get('tab')=='ruler'): ?> layui-show <?php endif; ?>">
<div
<?php if(!checkPerm('ViewRuler') || !checkPerm('UpdateRuler')): ?>
style="display: none"
<?php endif; ?>>
<?php echo $__env->make('web.supplier.SupplierMemo', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('web.supplier.SupplierRuler', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
</div>
<?php /*sku规则*/ ?>
<div class="layui-tab-item <?php if(request()->get('tab')=='sku_ruler'): ?> layui-show <?php endif; ?>">
<?php echo $__env->make('web.supplier.SkuRuler', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
<?php /*iqc记录*/ ?>
<div class="layui-tab-item <?php if(request()->get('tab')=='examination'): ?> layui-show <?php endif; ?>">
<?php echo $__env->make('web.SupplierExaminationList', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
</div>
</div>
</div>
<?php echo $__env->make('web.supplier.ApplyAuditReason', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</form>
</div>
<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(); ?>
<script>
layui.use(['table', 'form', 'element', 'layer', 'Split', 'admin', 'index', 'xmSelect'], function () {
let $ = layui.jquery;
let Split = layui.Split;
// 水平分割,需要分割的元素(id)、默认大小(百分比)、最小值(单位px)
Split(['#s1', '#s6', '#s7', '#s8'], {sizes: [9, 12, 12, 12], minSize: 70});
// Split(['#s1', '#s2', '#s3', '#s4', '#s5', '#s6', '#s7','#s8'], {sizes: [9, 12, 12, 12, 12, 12, 12,19], minSize: 70});
let table = layui.table;
let form = layui.form;
let index = layui.index;
let admin = layui.admin;
let xmSelect = layui.xmSelect;
let initCondition = {source_type: 'all'};
let whereCondition = initCondition;
let type = 'all';
let currentPage = 1;
//一进来就去获取统计数据
function supplierStatistics(hasLoading = false) {
if (hasLoading) {
admin.showLoading({
elem: '#type_filter',
type: 3,
});
}
$.ajax({
url: '/api/supplier_statistics/GetSupplierStatistics',
type: 'post',
async: true,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (res.err_code === 0) {
$.each(res.data, function (index, value) {
let menuObj = $('#' + index);
menuObj.text('');
menuObj.append(value);
});
if (getQueryVariable('source_type')) {
$('#' + getQueryVariable('source_type')).click();
}
}
if (hasLoading) {
admin.removeLoading('#type_filter');
}
}
})
}
supplierStatistics(true);
//罗盘隐藏
$('.hide_filter_type').click(function () {
$(this).hide();
$('#type_filter').hide();
$('.show_filter_type').show();
});
$('.show_filter_type').click(function () {
$(this).hide();
$('#type_filter').show();
$('.hide_filter_type').show();
});
$('#show_filter_row2').click(function () {
let isHidden = $('#filter_row2').is(':hidden');
if (isHidden) {
$('#filter_row2').show();
$('#show_filter_row2').text('隐藏');
} else {
$('#filter_row2').hide();
$('#show_filter_row2').text('展开');
}
});
$(function () {
$('.layui-form .layui-col-md5 .layui-edge').remove();
});
//这个是页面点击刷新方法,隐藏起来是为了页面切换回这个列表的时候触发的
$('#refreshWindow').click(function () {
//判断当前是否有layui弹窗窗口,有的话不刷新
let hasLayerIframe = $('.layui-layer').size() > 0;
if (!hasLayerIframe) {
$('#getSupplierListButton').click();
}
});
//点击罗盘筛选
$('.main_filter').click(function () {
clearTypeFilter();
$(this).attr('class', 'main_filter layui-badge layui-bg-green');
type = $(this).attr('id');
whereCondition.source_type = type
table.reload('list', {
page: {
curr: 1
}
, where: whereCondition
});
});
if (getQueryVariable('source_type')) {
whereCondition.source_type = getQueryVariable('source_type');
}
var createUserDepartmentSelector = xmSelect.render({
el: '#create_user_department',
autoRow: true,
name: 'create_user_department',
filterable: true,
direction: 'down',
tree: {
show: true,
showFolderIcon: true,
showLine: true,
indent: 20,
expandedKeys: true,
},
size: 'mini',
toolbar: {
show: true,
list: ['ALL', 'CLEAR']
},
height: 'auto',
data: function () {
//这个数据在对应的blade页面下面...
return <?php echo json_encode($createUserDepartmentList); ?>;
}
})
let cols = [
{type: 'checkbox', fixed: true},
{
field: 'supplier_code', title: '供应商编码', align: 'center', width: 90, templet: function (data) {
return "<a ew-href='/supplier/SupplierDetail?view=iframe&supplier_id=" + data.supplier_id +
"' class='list-href' ew-title='供应商详情 - " + data.supplier_code + "'>" + data.supplier_code + "</a>"
}
},
{field: 'group_code', title: '集团编码', align: 'center', width: 90},
{
field: 'supplier_name', title: '供应商名称', align: 'left', width: 180, templet: function (data) {
if (data.status === -3) {
return "<span title='" + data.block_reason + "'>" + data.supplier_name + "</span>"
} else {
return data.supplier_name;
}
}
},
{field: 'supplier_group', title: '供应商性质', align: 'center', width: 115},
{field: 'company_nature', title: '公司实际性质', align: 'center', width: 125},
{
field: 'level', title: '等级', align: 'center', width: 60, templet: function (d) {
return d.level ? d.level : '-';
}
},
{field: 'region_name', title: '区域', align: 'center', width: 60},
{
field: 'stockup_type', title: '合作类型', align: 'center', width: 120, templet: function (data) {
return "<span title='" + data.stockup_type + "'>" + data.stockup_type + "</span>"
}
},
{field: 'purchase_type_name', title: '代购类型', align: 'center', width: 80},
{
field: 'has_quality_assurance_agreement',
title: '品质协议',
align: 'center',
width: 80,
},
{
field: 'has_cooperation_agreement',
title: '平台合作协议',
align: 'center',
width: 120,
},
{
field: 'channel_username', title: '采购员', align: 'center', width: 130, templet: function (data) {
if (data.resign_channel_username) {
if (data.on_job_channel_username) {
return `<span>${data.on_job_channel_username}</span>` + `,<span style="color: #D7D7D7">${data.resign_channel_username}</span>`;
} else {
return `<span style="color: #D7D7D7">${data.resign_channel_username}</span>`
}
} else {
return `<span>${data.on_job_channel_username}</span>`;
}
}
},
{
field: 'is_entity', title: '实体名单', align: 'center', width: 80, templet: function (data) {
let color = '';
switch (data.is_entity) {
case 1:
color = '#FF0000';
break;
case 0:
color = '#FFA500';
break;
case -2:
color = '#ff0000';
break;
default:
color = '';
}
return '<span style="color: ' + color + ';" title="' + data.disable_reason + '">' + data.is_entity_name + '</span>';
}
},
{
field: 'status_name', title: '状态', align: 'center', width: 80, templet: function (data) {
switch (data.status) {
case 3:
return "<span style='color: red' title='" + data.reject_reason + "'>" + data.status_name + "</span>"
case -3:
return "<span style='color: red' title='" + data.block_reason + "'>" + data.status_name + "</span>"
case -2:
return "<span style='color: red' title='" + data.disable_reason + "'>" + data.status_name + "</span>"
default:
return data.status_name;
}
}
},
{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) {
return "<a ew-href='/supplier/SupplierDetail?view=iframe&tab=contact&supplier_id=" + data.supplier_id +
"' class='list-href' ew-title='供应商详情 - " + data.supplier_code + "' title='点击跳转查看联系人列表'>" + data.contact_num + "</a>"
}
},
{field: 'purchase_username', title: '渠道开发员', align: 'center', width: 110},
{field: 'yunxin_channel_username', title: '线上采购员', align: 'center', width: 110},
{field: 'has_sku', title: 'SKU上传', align: 'center', width: 80},
{
field: 'uploaded_sku', title: 'SKU合作', align: 'center', width: 80, templet: function (data) {
return data.uploaded_sku > 0 ? '是' : '否';
}
},
{field: 'average_sku_num', title: '日均上架数', align: 'center', width: 100},
{
field: 'cp_time_day', title: '有效期最高天数', align: 'center', width: 180, templet: function (data) {
let cpTime = data.cp_time_day == -1 ? '无限制' : data.cp_time_day + '天';
let futuresCpTime = data.futures_cp_time_day == -1 ? '无限制' : data.futures_cp_time_day + '天';
return '现货 : ' + cpTime + ' | 期货 : ' + futuresCpTime;
}
},
{field: 'create_name', title: '创建人', align: 'center', width: 70},
{field: 'create_user_department_name', title: '创建部门', align: 'center', width: 100},
{field: 'update_time', title: '最近修改时间', align: 'center', width: 145},
{field: 'supplier_type_name', title: '供应商类别', align: 'center', width: 110},
{field: 'create_time', title: '创建时间', align: 'center', width: 145},
{field: 'sku_create_time', title: '首次上传sku时间', align: 'center', width: 145},
{field: 'last_upload_sku_time', title: '最新上传sku时间', align: 'center', width: 145},
];
cols.push(
);
table.render({
elem: '#list'
, url: '/api/supplier/GetSupplierList'
, method: 'post'
, size: 'sm'
, limit: 20
, cellMinWidth: 50 //全局定义常规单元格的最小宽度
, where: whereCondition
, loading: true
, first: true //不显示首页
, last: false //不显示尾页
, cols: [cols]
, id: 'list'
, page: {}
, done: function (res, curr, count) {
//得到当前页码
currentPage = curr;
res.data.forEach(function (item, index) {
if (item.status === -3) {
//禁用复选框,设置不可选中标识,将该行设置为阴影色
var tr = $(".layui-table tr[data-index=" + index + "]");
tr.find("input[type='checkbox']").prop('disabled', true);
tr.find("input[type='checkbox']").next().addClass('layui-btn-disabled');
tr.find('.layui-form-checkbox').addClass('layui-hide');
tr.css("color", "#A9A5A5");
tr.addClass('block-class')
}
});
}
});
// 点击行checkbox选中
$(document).on("click", ".layui-table-body table.layui-table tbody tr", function () {
let index = $(this).attr('data-index');
let tableBox = $(this).parents('.layui-table-box');
let tableDiv = null;
if (tableBox.find(".layui-table-fixed.layui-table-fixed-l").length > 0) {
tableDiv = tableBox.find(".layui-table-fixed.layui-table-fixed-l");
} else {
tableDiv = tableBox.find(".layui-table-body.layui-table-main");
}
let checkCell = tableDiv.find("tr[data-index=" + index + "]").find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
if (checkCell.length > 0) {
checkCell.click();
}
});
$(document).on("click", "td div.laytable-cell-checkbox div.layui-form-checkbox", function (e) {
e.stopPropagation();
});
//监听复选框事件,被选中的行高亮显示
table.on('checkbox(list)', function (obj) {
//拉黑就不用变色了
if (obj.data.status === -3) {
return
}
if (obj.checked === true && obj.type === 'all') {
//点击全选,拉黑的不用选上
$('.layui-table-body table.layui-table tbody tr:not(.block-class)').addClass('layui-table-click');
$('.layui-table-body table.layui-table tbody').find('.block-class').find('.layui-form-checkbox').remove();
$('.layui-table-body table.layui-table tbody tr .block-class').addClass('layui-table-click');
} else if (obj.checked === false && obj.type === 'all') {
//点击全不选
$('.layui-table-body table.layui-table tbody tr').removeClass('layui-table-click');
} else if (obj.checked === true && obj.type === 'one') {
//点击单行
if (obj.checked === true) {
obj.tr.addClass('layui-table-click');
} else {
obj.tr.removeClass('layui-table-click');
}
} else if (obj.checked === false && obj.type === 'one') {
//点击全选之后点击单行
if (obj.tr.hasClass('layui-table-click')) {
obj.tr.removeClass('layui-table-click');
}
}
});
//保存需要刷新的页面数据
function saveRefreshData(type, supplierId = 0) {
admin.putTempData("needFreshDetail_supplier_id=" + supplierId, 1);
}
//新增供应商弹窗
$("#add_supplier").click(function () {
index.openTab({
title: '新增供应商',
url: '/supplier/AddSupplier?view=iframe',
end: function () {
// insTb.reload();
}
});
})
//同步金蝶的手动操作
$("#sync_supplier_to_erp").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/SyncToErp', {supplier_id: supplierId})
if (res.err_code === 0) {
table.reload('list')
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
}
});
//同步一体化的手动操作
$("#sync_supplier_to_united").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/SyncToUnited', {supplier_id: supplierId})
if (res.err_code === 0) {
table.reload('list')
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
}
});
//审批供应商弹窗
$("#audit_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
let supplierId = data[0].supplier_id;
let status = data[0].status;
let canReviewSupplier = <?php echo e(checkPerm("ReviewSupplier")?1:0); ?>;
if (canReviewSupplier === 0 && status === -1) {
layer.msg('你没有复审供应商的权限', {icon: 5})
return
}
if (status === 0) {
layer.msg('该供应商还没有申请审核', {icon: 5});
return;
}
if (status !== 1 && status !== -1) {
layer.msg('该供应商已经被审核', {icon: 5});
return;
}
let checkAuditMsg = checkCanAudit(supplierId);
if (checkAuditMsg !== '') {
layer.msg(checkAuditMsg, {icon: 5});
return
}
layer.open({
type: 2,
content: '/supplier/AuditSupplier?view=iframe&supplier_id=' + supplierId,
area: ['800px', '65%'],
title: '审核供应商',
end: function () {
table.reload('list');
saveRefreshData('detail', supplierId)
supplierStatistics();
}
});
}
})
//批量修改(分配)渠道员
$("#batch_allocate_purchase_user").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id);
supplierIds = supplierIds.join(',');
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
let status = Array.from(data, ({status}) => status);
//分配采购员的多选操作,需要先去判断是否存在审核中的供应商,存在的话,要提示
if (status.indexOf(1) !== -1 || status.indexOf(-3) !== -1 || status.indexOf(-1) !== -1) {
layer.msg('选择的供应商里,存在审核中/待复审/黑名单的供应商,无法分配渠道员', {icon: 5})
return
}
layer.open({
type: 2,
content: '/supplier/BatchAllocatePurchaseUser?view=iframe&supplier_ids=' + supplierIds,
area: ['600px', '70%'],
title: '批量分配渠道员',
end: function () {
table.reload('list');
supplierStatistics();
}
});
}
})
//申请进入审核中的状态
$("#batch_apply_in_review_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id);
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
supplierIds = supplierIds.join(',');
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
let status = Array.from(data, ({status}) => status);
let canApplyInReview = true;
$.each(status, function (index, value) {
if (value !== 0) {
canApplyInReview = false;
}
});
if (!canApplyInReview) {
layer.msg('选择的供应商里,存在非待提审状态的供应商,无法申请审核', {icon: 5})
return;
}
//还要去事先检测供应商信息是否完整
let checkApplyMsg = checkCanApplyInReview(supplierIds);
if (checkApplyMsg !== '') {
return false;
}
layer.open({
type: 2,
content: '/supplier/BatchApplyInReviewSupplier?view=iframe&supplier_ids=' + supplierIds,
area: ['800px', '70%'],
title: '申请审核供应商',
end: function () {
table.reload('list');
supplierStatistics();
}
});
}
})
//分配采购员,现在改成可以批量的了
$("#allocate_channel_user").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
let status = Array.from(data, ({status}) => status);
let canApplyInReview = true;
$.each(status, function (index, value) {
console.log(value);
if (value === -1 || value === 1) {
canApplyInReview = false;
}
});
if (!canApplyInReview) {
layer.msg('选择的供应商里,存在 审核中/待复审 状态的供应商,无法分配采购员', {icon: 5})
} else {
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id);
if (supplierIds.length > 20) {
layer.msg('最多一次操作20个供应商', {icon: 5})
return;
}
supplierIds = supplierIds.join(',');
layer.open({
type: 2,
content: '/supplier/AllocateChannelUser?view=iframe&supplier_ids=' + supplierIds,
area: ['80%', '80%'],
title: '新增采购员',
end: function () {
table.reload('list');
supplierStatistics();
}
});
}
}
})
//禁用供应商
$("#disable_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
const status = data[0].status;
const hasSku = data[0].sku_num;
const needReview = data[0].need_review;
if (needReview === 1 && status !== 0) {
layer.msg("该供应商还没有进行复审,不能直接禁用;", {icon: 5})
return;
}
if ((status === 3 || status === 2 || status === 0) && !hasSku) {
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
content: '/supplier/DisableSupplier?view=iframe&supplier_id=' + supplierId,
area: ['700px', '70%'],
title: '禁用供应商',
end: function () {
saveRefreshData('detail', supplierId)
table.reload('list');
supplierStatistics();
}
});
} else {
layer.msg('只有待提审,已通过或者未通过状态,并且没有sku的供应商才可以禁用', {'icon': 5});
}
}
});
//转正供应商
$("#change_supplier_is_type").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
const isType = data[0].is_type;
if (isType === 0) {
layer.msg('该供应商已经是正式供应商', {'icon': 5});
return
}
layer.confirm('如果转成正式供应商,会进入审核中状态,需要补全相关信息申请审核,确定要转正该供应商吗?', function (index) {
let supplierId = data[0].supplier_id;
let res = ajax('/api/supplier/ChangeSupplierIsType', {supplier_id: supplierId, is_type: 0})
if (res.err_code === 0) {
saveRefreshData('detail', supplierId)
table.reload('list')
supplierStatistics();
layer.closeAll();
layer.msg(res.err_msg, {icon: 6})
} else {
layer.msg(res.err_msg, {icon: 5})
}
});
}
});
//加入黑名单
$("#block_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
const status = data[0].status;
if (status === -3) {
layer.msg('该供应商已经在黑名单', {icon: 5});
return false;
}
if ((status === -1 || status === 1)) {
layer.msg('审核中/待复审状态的供应商无法加入黑名单', {icon: 5});
return false;
} else {
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
content: '/supplier/BlockSupplier?view=iframe&supplier_id=' + supplierId,
area: ['700px', '70%'],
title: '加入黑名单',
end: function () {
saveRefreshData('detail', supplierId)
table.reload('list');
supplierStatistics();
}
});
}
}
});
//共用供应商申请
$("#apply_supplier_share").click(function () {
layer.open({
type: 2,
content: '/supplier_share_apply/ApplySupplierShare?view=iframe',
area: ['700px', '80%'],
title: '申请共用供应商',
end: function () {
}
});
});
//共用供应商审核
$("#audit_supplier_share_apply").click(function () {
layer.open({
type: 2,
content: '/supplier_share_apply/AuditSupplierShareApply?view=iframe',
area: ['70%', '80%'],
title: '共用申请审核',
end: function () {
}
});
});
//批量修改供应商标签
$("#batch_add_tags").click(function () {
layer.open({
type: 2,
content: '/supplier_tag/BatchAddTag?view=iframe',
area: ['70%', '90%'],
title: '供应商标签添加',
end: function () {
}
});
});
//设置SKU采购
$("#batch_allocate_yunxin_channel_user").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
let supplierIds = Array.from(data, ({supplier_id}) => supplier_id);
supplierIds = supplierIds.join(',');
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
layer.open({
type: 2,
content: '/supplier/BatchAllocateYunxinChannelUser?view=iframe&supplier_ids=' + supplierIds,
area: ['80%', '80%'],
title: '批量配置线上采购员',
end: function () {
table.reload('list');
}
});
}
})
//查询供应商
$("#query_supplier").click(function () {
layer.open({
type: 2,
content: '/supplier/QuerySupplier?view=iframe',
area: ['70%', '30%'],
title: '查询供应商',
end: function () {
}
});
})
//交接供应商
$("#transfer_supplier").click(function () {
let checkStatus = table.checkStatus('list');
let data = checkStatus.data;
if (!data.length) {
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
if (data.length > 1) {
layer.msg('该操作不支持多选', {icon: 5})
return;
}
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
content: '/supplier/TransferSupplier?view=iframe&supplier_id=' + supplierId,
area: ['50%', '70%'],
title: '交接供应商',
end: function () {
table.reload('list');
}
});
}
})
//判断是否要展示有全部离职采购员的供应商,有的话提示
if (!admin.getTempData('has_pop_up_all_channel_user_supplier_tips')) {
$.ajax({
url: '/api/supplier/checkHasAllResignedChannelUserSupplier',
type: 'POST',
async: true,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
layer.confirm('<div style="width: 400px;height: 50px;"><p>属于你部门的正式供应商有 <span style="color: red;">' + res.data + '</span> 没有有效采购员(采购员全离职)<p><p>请尽快分配采购员进行维护</p></div>', {
btn: ['立即前往', '关闭提示'], //按钮
offset: 'rb',
}, function () {
admin.putTempData('has_pop_up_all_channel_user_supplier_tips', 1);
layer.closeAll();
index.openTab({
title: '供应商列表',
url: '/supplier/SupplierList?view=iframe&source_type=all_channel_user_resigned',
end: function () {
}
});
}, function () {
admin.putTempData('has_pop_up_all_channel_user_supplier_tips', 1);
layer.closeAll();
});
} else {
}
}
},
error: function () {
layer.msg('网络错误', {icon: 5});
}
});
}
let formValue = {};
$('#export_supplier').click(function () {
window.open('/api/supplier/exportSupplier', '_blank');
});
//点击查询按钮
form.on('submit(load)', function (data) {
formValue = data.field;
//罗盘选项会跳回全部
clearTypeFilter();
$('#total').attr('class', 'main_filter layui-badge layui-bg-green');
whereCondition.source_type = 'all';
initCondition.source_type = whereCondition.source_type;
whereCondition = $.extend(false, initCondition, data.field);
//执行重载
table.reload('list', {
page: {
curr: 1
}
, where: whereCondition
});
supplierStatistics();
return false;
});
//点击重置按钮
form.on('submit(reset)', function (data) {
layer.load(1);
location.reload();
});
})
;
//检查是否能够审核,因为审核人只能审自己相关部门人员修改的供应商记录
function checkCanAudit(supplierId) {
let url = '/api/supplier/CheckCanAuditSupplier?supplier_id=' + supplierId;
let res = ajax(url);
if (res.err_code !== 0) {
return res.err_msg;
} else {
return '';
}
}
function checkCanApplyInReview(supplierIds) {
let url = '/api/supplier/CheckCanApplyInReview?supplier_ids=' + supplierIds;
let res = ajax(url);
if (res.err_code !== 0) {
let errMsg = res.err_msg;
let msg = '';
$.each(errMsg.split('|'), function (index, value) {
msg += "<span>" + value + "</span><br>"
});
layer.msg(msg, {icon: 5})
return false;
} else {
return '';
}
}
function clearTypeFilter() {
$('.main_filter').attr('class', 'main_filter');
}
</script>
<style>
.fix-top {
height: 140px;
margin-top: 0;
margin-left: -30px;
padding: 10px 45px;
position: fixed;
top: 0;
background: white;
width: 100%;
z-index: 10;
}
.required_field {
color: red;
margin-right: 5px;
}
</style>
<div class="layui-card">
<div class="layui-card-header fix-top" style="box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.5);">
<div class="layui-row">
<div class="layui-col-md2">
<b><?php echo e($supplier['supplier_name']); ?></b>
</div>
<div class="layui-col-md2">
供应商编码 : <?php echo e($supplier['supplier_code']); ?>
</div>
<div class="layui-col-md2">
状态 : <?php echo e($supplier['status_name']); ?>
</div>
<div class="layui-col-md2">
渠道开发员 : <?php echo e($supplier['purchase_username']); ?>
</div>
<div class="layui-col-md4">
最近修改时间 : <?php echo e($supplier['update_time']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
公司性质 : <?php echo e($supplier['supplier_group_name']); ?>
</div>
<div class="layui-col-md2">
合作类型 :
<?php if(mb_strlen($supplier['stockup_type_name'])>12): ?>
<span title="<?php echo e($supplier['stockup_type_name']); ?>">
<?php echo e(mb_substr($supplier['stockup_type_name'],0,12)); ?>...
</span>
<?php else: ?>
<?php echo e($supplier['stockup_type_name']); ?>
<?php endif; ?>
</div>
<?php /* <div class="layui-col-md2">*/ ?>
<?php /* </div>*/ ?>
<div class="layui-col-md2">
线上采购员 : <?php echo e($supplier['yunxin_channel_username']); ?>
</div>
<div class="layui-col-md3">
<span title="<?php echo e($supplier['channel_username']); ?>">
采购员 : <?php echo e(str_limit($supplier['channel_username'],30,'...')); ?>
</span>
</div>
<div class="layui-col-md3"></div>
</div>
<div class="layui-row">
<?php if($supplier['is_type']==1): ?>
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">供应商为非正式供应商,请先转正
</button>
<?php else: ?>
<?php if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_NEED_REVIEW): ?>
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">待复审,不能修改
</button>
<?php elseif($supplier['status']==\App\Model\SupplierChannelModel::STATUS_PASSED||$supplier['status']==\App\Model\SupplierChannelModel::STATUS_REJECT
||$supplier['status']==\App\Model\SupplierChannelModel::STATUS_PENDING): ?>
<a id="updateSupplierUrl"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">修改</a>
<?php endif; ?>
<?php if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_DISABLE && $supplier['is_entity']==\App\Model\SupplierChannelModel::IS_ENTITY_FALSE): ?>
<?php if(checkPerm('CancelDisableSupplier')): ?>
<button id="cancel_disable_supplier"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">取消禁用
</button>
<?php endif; ?>
<?php endif; ?>
<?php if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_IN_REVIEW): ?>
<button type="button" style="margin-bottom: 25px;margin-top: 5px"
class="layui-btn layui-btn layui-btn-disabled">审核中,不能修改
</button>
<?php endif; ?>
<?php if($supplier['status']==\App\Model\SupplierChannelModel::STATUS_BLOCK && checkPerm('CancelBlockSupplier')): ?>
<?php /* <button type="button" style="margin-bottom: 25px;margin-top: 5px" id="cancel_block_supplier"*/ ?>
<?php /* class="layui-btn layui-btn">取消拉黑*/ ?>
<?php /* </button>*/ ?>
<?php endif; ?>
<?php /*如果是驳回,则可以修改名称*/ ?>
<?php if($supplier['is_entity'] == \App\Model\SupplierChannelModel::IS_ENTITY_REJECT && empty($supplier['group_code'])): ?>
<button id="change_supplier_name"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">修改名称
</button>
<?php endif; ?>
<?php /*如果是待提审/未通过并且集团编码为空,则可以修改名称*/ ?>
<?php if(($supplier['status'] == \App\Model\SupplierChannelModel::STATUS_PENDING || $supplier['status'] == \App\Model\SupplierChannelModel::STATUS_REJECT) && empty($supplier['group_code'])): ?>
<button id="change_supplier_name"
style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">修改名称
</button>
<?php endif; ?>
<?php endif; ?>
<?php if(checkPerm('PrintSupplier')): ?>
<?php /*禁用和黑名单不显示打印按钮*/ ?>
<?php if($supplier['status']== \App\Model\SupplierChannelModel::STATUS_DISABLE || $supplier['status']== \App\Model\SupplierChannelModel::STATUS_BLOCK): ?>
<?php else: ?>
<a href="/supplier/PrintSupplier?view=iframe&supplier_id=<?php echo e($supplier['supplier_id']); ?>"
target="_blank" style="margin-bottom: 25px;margin-top: 5px" class="layui-btn layui-btn">打印</a>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<div class="layui-card-body" style="margin-top: 140px">
<div class="layui-tab">
<ul class="layui-tab-title">
<li class="layui-this" id="base_info">基本信息</li>
<li id="contact">联系人</li>
<li id="ruler">特殊规则</li>
<li <?php if(!checkPerm('UpdateSkuRuler')): ?> style="display: none" <?php endif; ?> id="ruler">SKU概况</li>
<li <?php if(!checkPerm('ViewSupplierExamination')): ?> style="display: none" <?php endif; ?>
<?php if(request()->get('tab')=='examination'): ?>
class="layui-this"
<?php endif; ?>
id="examination">检测记录
</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-row" style="padding: 10px">
<div class="layui-row">
<blockquote class="layui-elem-quote layui-text">
<b>基本资料</b>
</blockquote>
<div class="layui-row">
<span class="required_field">*</span>供应商名称 :<?php echo e($supplier['supplier_name']); ?>
</div>
<div class="layui-row">
<span class="required_field">*</span>供应商类别 :<?php echo e($supplier['supplier_type_name']); ?>
</div>
<div class="layui-row">
注册公司名 :<?php echo e($supplier['register_company_name']); ?>
</div>
<div class="layui-row">
供应商英文名称 :<?php echo e($supplier['supplier_name_en']); ?>
</div>
<div class="layui-row">
<span class="required_field">*</span>注册资金
<?php echo e($supplier['registered_capital']?$supplier['registered_capital']."(万)":'未设置'); ?>
</div>
<div class="layui-row">
<span class="is_business_abnormal">*</span>是否历史经营异常
<?php echo e($supplier['is_business_abnormal_name']); ?>
</div>
<div class="layui-row">
<div class="layui-col-md2">
<span class="required_field">*</span> 所在区域 :<?php echo e($supplier['region_name']); ?>
</div>
<div class="layui-col-md3">
<?php if($supplier['region']==2): ?>
所属省市 :<?php echo e($province_city); ?>
<?php endif; ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md6">
<span class="required_field">*</span> 注册地址 :<?php echo e($supplier['supplier_address']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
<span class="required_field">*</span> 法人代表
<?php echo e($supplier['legal_representative']); ?>
</div>
<div class="layui-col-md3">
法人身份证 :
<?php echo e($supplier['has_legal_ID_card_name']); ?>
</div>
<div class="layui-col-md3">
<span class="required_field">*</span> 成立时间 :<?php echo e($supplier['established_time']); ?>
</div>
</div>
<div class="layui-row">
资信调查 :<?php echo e($supplier['credit_investigation']); ?>
</div>
<div class="layui-row">
<span class="required_field">*</span> 主营品牌 :<?php echo e($supplier['main_brand_names']); ?>
</div>
<?php if($supplier['supplier_group'] == \App\Model\SupplierChannelModel::SUPPLIER_GROUP_MIX): ?>
<div class="layui-row">
<span class="required_field">*</span> 代理品牌
<?php echo e(!empty($supplier['agency_brand_names'])?$supplier['agency_brand_names']:''); ?>
</div>
<?php endif; ?>
<div class="layui-row">
3-5家客户 :<?php echo e($supplier['main_customers']); ?>
</div>
<div class="layui-row">
<div class="layui-col-md2">
公司性质 : <?php echo e($supplier['supplier_group_name']); ?>
</div>
<div class="layui-col-md3">
<span class="required_field">*</span> 合作类型 :<?php echo e($supplier['stockup_type_name']); ?>
</div>
<div class="layui-col-md2">
代购类型 : <?php echo e($supplier['purchase_type_name']); ?>
</div>
<div class="layui-col-md2">
签约公司 : <?php echo e($supplier['sign_com_name']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
<span class="required_field">*</span> 结算币种 :<?php echo e($supplier['currency_name']); ?>
</div>
<div class="layui-col-md3">
<?php if($supplier['currency']==1): ?>
<span class="required_field">*</span>
<?php endif; ?>
公司税号 :<?php echo e($supplier['tax_number']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
到票时间 :<?php echo e($supplier['ticket_time']); ?>
</div>
<div class="layui-col-md3">
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>系统设置</b>
</blockquote>
<div class="layui-row">
<div class="layui-col-md2">
供应商编码 :<?php echo e($supplier['supplier_code']); ?>
</div>
<div class="layui-col-md3">
供应商ID :<?php echo e($supplier['supplier_id']); ?>
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>付款方式</b>
</blockquote>
<div class="layui-row">
<div class="layui-col-md2">
结算方式 :<?php echo e($supplier['settlement_type_name']); ?>
</div>
<div class="layui-col-md3">
付款周期 :<?php echo e($supplier['pay_type_name']); ?>
<?php if($supplier['pay_type'] == 1): ?>
(月结<?php echo e($supplier['pay_type_value'].$supplier['pay_type_extra']); ?>)
<?php endif; ?>
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>供应商标签</b>
</blockquote>
<div class="layui-row">
<div class="layui-col-md2">
等级 :<?php echo e($supplier['level']?:'无'); ?>
</div>
<div class="layui-col-md3">
认证 :<?php echo e($supplier['has_certification_name']?:'未设置'); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md6"></div>
<div class="layui-col-md12">
系统标签 :
<?php foreach(explode(',',$supplier['system_tags']) as $tag): ?>
<?php if(empty($tag)): ?>
<?php continue; ?>
<?php endif; ?>
<span class="layui-btn layui-btn-xs"><?php echo e($tag); ?></span>
<?php endforeach; ?>
<?php foreach(explode(',',$supplier['united_tags']) as $tag): ?>
<?php if(empty($tag)): ?>
<?php continue; ?>
<?php endif; ?>
<span class="layui-btn layui-btn-xs"><?php echo e($tag); ?></span>
<?php endforeach; ?>
</div>
<div class="layui-col-md12">
自定义标签 :
<?php foreach(explode(',',$supplier['customer_tags']) as $tag): ?>
<?php if(empty($tag)): ?>
暂无
<?php continue; ?>
<?php endif; ?>
<span class="layui-btn layui-btn-xs"><?php echo e($tag); ?></span>
<?php endforeach; ?>
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b><span class="require">*</span>财务信息</b>
</blockquote>
<?php echo $__env->make('web.supplier.SupplierReceipt', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b><span class="require">*</span>附件管理</b>
</blockquote>
<?php echo $__env->make('web.supplier.SupplierAttachment', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>运输信息</b>
</blockquote>
<div class="layui-row">
发货地址 :<?php echo e($address['shipping_address']); ?>
</div>
<div class="layui-row">
<div class="layui-col-md2">
退货地址 :<?php echo e($address['return_address']); ?>
</div>
<div class="layui-col-md2">
退货收货人 :<?php echo e($address['return_consignee']); ?>
</div>
<div class="layui-col-md3">
退货收货人电话 :<?php echo e($address['return_phone']); ?>
</div>
</div>
<hr/>
<blockquote class="layui-elem-quote layui-text">
<b>其他信息</b>
</blockquote>
<div class="layui-row">
<div class="layui-col-md2">
创建人 :<?php echo e($supplier['create_name']); ?>
</div>
<div class="layui-col-md2">
创建时间 :<?php echo e($supplier['create_time']); ?>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md2">
最近修改人 :<?php echo e($supplier['last_update_name']); ?>
</div>
<div class="layui-col-md3">
最近修改时间 :<?php echo e($supplier['last_update_time']); ?>
</div>
</div>
<hr/>
</div>
</div>
</div>
<div class="layui-tab-item">
<?php if(checkPerm('ViewSupplierContact')): ?>
<?php echo $__env->make('web.supplier.SupplierContact', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php endif; ?>
</div>
<div class="layui-tab-item">
<div
<?php if(!checkPerm('ViewRuler')): ?>
style="display: none"
<?php endif; ?>
>
<div class="layui-row" style="padding-bottom: 10px">
<?php echo $__env->make('web.supplier.SupplierMemo', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('web.supplier.SupplierRuler', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<blockquote class="layui-elem-quote layui-text">
<b>采购附加费设置</b>
</blockquote>
<?php if(empty($supplier['extra_fee']['cn']['max'])&&empty($supplier['extra_fee']['hk']['max'])): ?>
暂未设置附加费
<?php else: ?>
<div class="layui-row">
商品总价不满 <?php echo e(isset($supplier['extra_fee']['cn']['max']) ? $supplier['extra_fee']['cn']['max'] : ''); ?>
元,收取 <?php echo e(isset($supplier['extra_fee']['cn']['price']) ? $supplier['extra_fee']['cn']['price'] : ''); ?>
</div>
<div class="layui-row">
商品总价不满 <?php echo e(isset($supplier['extra_fee']['hk']['max']) ? $supplier['extra_fee']['hk']['max'] : ''); ?>
美金,收取 <?php echo e(isset($supplier['extra_fee']['hk']['price']) ? $supplier['extra_fee']['hk']['price'] : ''); ?>
</div>
<?php endif; ?>
</div>
<hr>
<blockquote class="layui-elem-quote layui-text">
<b>采购价格系数调整</b>
</blockquote>
<div class="layui-row" style="margin-bottom: 10px">
人民币系数 <?php echo e(isset($supplier['cn_ratio']) ? $supplier['cn_ratio'] : 1); ?> , 美金系数 <?php echo e(isset($supplier['us_ratio']) ? $supplier['us_ratio'] : 1); ?>
<div class="layui-word-aux" style="margin-left: -5px">
基数为1,如利润为10%,请填写1.1
</div>
</div>
<hr>
<blockquote class="layui-elem-quote layui-text">
<b>货期调整</b>
</blockquote>
<div class="layui-row" style="margin-bottom: 10px">
<?php if($supplier['cn_delivery_time']): ?>
大陆交期 : <?php echo e($supplier['cn_delivery_time'] .' '. $supplier['cn_delivery_time_period']); ?>
,
<?php else: ?>
大陆交期未设置
<?php endif; ?>
<?php if($supplier['us_delivery_time']): ?>
香港交期 : <?php echo e($supplier['us_delivery_time'] .' '. $supplier['us_delivery_time_period']); ?>
<?php else: ?>
香港交期未设置
<?php endif; ?>
<div class="layui-word-aux" style="margin-left: -5px">
单位为工作日,周. 格式 : 2-6 工作日,1-2 周
</div>
</div>
<hr>
</div>
</div>
<div class="layui-tab-item">
<blockquote class="layui-elem-quote layui-text">
<b>SKU配置</b>
</blockquote>
<div class="layui-row" style="margin-left: 20px">
<div class="layui-col-md2">
SKU 标签 :<?php echo e(isset($supplier['sku_tag_name']) ? $supplier['sku_tag_name'] : ''); ?>
</div>
<div class="layui-col-md3">
SKU 模式 :<?php echo e(isset($supplier['sku_mode_name']) ? $supplier['sku_mode_name'] : ''); ?>
</div>
</div>
<hr>
<blockquote class="layui-elem-quote layui-text">
<b>上传商品规则</b>
</blockquote>
<div class="layui-row">
<div class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">数据新增规则 : </label>
<div class="layui-input-inline" style="width: 380px;margin-top: 0px">
<?php if(!empty($supplier['sku_upload_ruler'])): ?>
<?php foreach($supplier['sku_upload_ruler'] as $key=>$flag): ?>
<?php if(!empty(array_get(config('fixed.SkuUploadRuler'),$key))): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
<?php if($flag): ?>
checked
<?php endif; ?>
disabled
title="<?php echo e(array_get(config('fixed.SkuUploadRuler'),$key)); ?>">
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php foreach(config('fixed.SkuUploadRuler') as $key=>$flag): ?>
<input type="checkbox" name="sku_upload_ruler[<?php echo e($key); ?>]"
lay-skin="primary"
disabled
title="<?php echo e($flag); ?>">
<?php endforeach; ?>
<?php endif; ?>
</div>
<div class="layui-form-mid layui-word-aux">
SKU数据导入条件勾选后只要满足该条件,就可以导入数据;默认导入条件是有库存、价格、起订量且起订量>库存
</div>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">审核内容配置 : </label>
<div class="layui-input-inline" style="width: 205px;margin-top: 0;">
<input type="radio" name="sku_audit_ruler[skip]" lay-filter="is_skip"
disabled
<?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"
disabled
<?php if($supplier['sku_audit_ruler']['skip']==0): ?> checked <?php endif; ?> value="0"
title="需要审核内容">
</div>
<div class="layui-input-inline" style="width: 700px;margin-top: 0;">
<?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"
disabled
<?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); ?>]" disabled
lay-skin="primary" class="audit_ruler_item"
title="<?php echo e(array_get(config('fixed.SkuAuditRuler.name_map'),$key)); ?>">
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<?php echo $__env->make('web.supplier.SkuUploadStatus', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>;
<hr>
</div>
<div class="layui-tab-item <?php if(request()->get('tab')=='examination'): ?> layui-show <?php endif; ?>">
<?php echo $__env->make('web.SupplierExaminationList', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
</div>
</div>
</div>
</div>
</div>
<div style="text-align: center; border-radius:50%;position: fixed;right: 1%;top: 80%;z-index: 4;
width: 50px;height: 50px;">
</div>
<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(); ?>
<script>
layui.use(['table', 'form', 'element', 'layer', 'index', 'admin', 'laydate', 'xmSelect', 'upload'], function () {
let admin = layui.admin;
let form = layui.form;
let index = layui.index;
let laydate = layui.laydate;
let upload = layui.upload;
let element = layui.element;
let xmSelect = layui.xmSelect;
form.on('radio(receipt_type)', function (data) {
if (data.value == 1) {
$('#swift_code_div').hide();
$('#nation_id_div').hide();
$('#account_name_label').text('账户名称 : ');
$('#account_name_require_span').hide();
$('#bank_address_require_span').hide();
} else {
$('#swift_code_div').show();
$('#nation_id_div').show();
$('#account_name_label').text('国外受益人 : ');
$('#account_name_require_span').show();
$('#bank_address_require_span').show();
}
});
//不让选,也不隐藏
form.on('checkbox(stockup_type_filter)', function (data) {
if (data.elem.checked && data.elem.name === "stockup_type[5]") {
layer.msg('新增供应商没法设置为芯链账号类型,设置芯链账号要先去魔方系统配置阶梯系数', {icon: 5})
$('input[name="stockup_type[5]"]').next().click();
}
});
//图片上传
upload.render({
elem: '.upload-img'
, url: UploadImgUrl
, field: 'upload'
, data: {
k1: k1,
k2: k2,
source: 1,
cancel_time_verify: 1,
}
, accept: 'file'
, exts: 'jpg|png|bmp|jpeg|zip|pdf'
, size: 20000
, before: function (obj) {
layer.msg('加载中', {
icon: 16
, shade: 0.01
});
let item = this.item;
obj.preview(function (index, file, result) {
});
}
, done: function (res) {
if (res.code === 200) {
layer.msg('上传成功', {icon: 6});
let item = this.item;
$('#' + item.attr('data-obj')).val(res.data[0]);
$('#certificate_url').text(res.data[0]);
return false;
} else {
layer.msg('上传失败:' + res.message, {icon: 5});
return false;
}
}
, error: function (res) {
layer.msg('上传失败:' + res.message, {icon: 5});
return false;
}
});
form.on('submit(cancelAddSupplier)', function (data) {
admin.closeThisTabs();
});
function getAttachmentData(data) {
let file_name = [];
let file_url = [];
let validity_type = [];
let field_name = [];
let validity_period = [];
let description = [];
//只要寻找上传主区域的数据即可
$('#attachment_upload_div').find('.single_file_div').each(function () {
file_name.push($(this).find('#file_name').val());
file_url.push($(this).find('#file_url').val());
field_name.push($(this).find('#field_name').val());
validity_type.push($(this).find('#validity_type').val());
description.push($(this).find('#description').val());
validity_period.push($(this).find('#validity_period').val());
});
data.field.file_name = file_name;
data.field.file_url = file_url;
data.field.field_name = field_name;
data.field.description = description;
data.field.validity_type = validity_type;
data.field.validity_period = validity_period;
data.field.apply_audit_reason = $('#apply_audit_reason').val();
return data;
}
form.on('submit(addSupplier)', function (data) {
data = getAttachmentData(data);
admin.showLoading();
admin.showLoading('.layui-layer-btn0');
$.ajax({
url: '/api/supplier/AddSupplier',
type: 'POST',
async: true,
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) {
admin.showLoading('.layui-layer-btn0');
admin.removeLoading();
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6});
setTimeout(function () {
admin.closeThisTabs();
location.href = "/supplier/SupplierList"
}, 1000);
} else {
admin.showLoading('.layui-layer-btn0');
admin.removeLoading();
layer.msg(res.err_msg, {icon: 5});
}
}
admin.showLoading('.layui-layer-btn0');
admin.removeLoading();
},
error: function () {
admin.removeLoading();
layer.msg('网络错误', {icon: 5});
}
});
return false;
});
form.on('select(apply_audit_reason_selector)', function (data) {
$('#apply_audit_reason').val(data.value);
});
form.on('submit(addAndApplySupplier)', function (data) {
data = getAttachmentData(data);
let fieldNameList = data.field.field_name ? data.field.field_name : [];
//提交先提示是否要转换供应商类型
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;
}
}
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();
}
auditAndAddSupplier(data);
},
function (index) {
auditAndAddSupplier(data);
}
);
} else {
auditAndAddSupplier(data);
}
return false;
});
function auditAndAddSupplier(data) {
if (data.field.supplier_type === '2') {
layer.open({
type: 1,
area: ['450px', '370px'], //宽高
content: $('#apply_audit_reason_div'),
btn: ['保存并申请审核', '取消'],
btn1: function (index, layero) {//点击保存按钮
if ($('#apply_audit_reason').val() === '') {
layer.msg('请选择申请理由', {icon: 5})
return false;
}
addSupplier(data);
layer.close(index);
},
});
} else {
let msg = '确定直接申请审核吗?确定后会直接进入审核中的状态,审核完成前无法进行二次修改';
//未上传品质保证协议(代理商则提示为“未上传代理证”),是否需要切换为临时供应商?
layer.confirm(msg, function (index) {
addSupplier(data);
});
}
}
function addSupplier(data) {
admin.showLoading();
admin.showLoading('.layui-layer-btn0');
$.ajax({
url: '/api/supplier/AddSupplier?direct_apply=1',
type: 'POST',
async: true,
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) {
admin.removeLoading();
admin.showLoading('.layui-layer-btn0');
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
layer.msg(res.err_msg, {icon: 6});
setTimeout(function () {
admin.closeThisTabs();
location.href = "/supplier/SupplierList"
}, 1000);
} else {
let errMsg = res.err_msg;
let msg = '';
admin.removeLoading();
admin.showLoading('.layui-layer-btn0');
$.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>
<?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