Commit b7e41686 by 杨树贤

Merge branch 'ysx-供应商费用规则配置-20250326'

parents f809b15f 241d2ecd
......@@ -169,3 +169,5 @@ IMAGE_SERVER_URL=http://image.liexindev.net
FILE_SERVER_URL=http://file.liexindev.net
CRM_URL=http://crmnew.liexindev.net
CUBE_URL=http://cube.liexindev.net
\ No newline at end of file
......@@ -2,26 +2,27 @@
namespace App\Http\Controllers;
use App\Http\Services\DepartmentService;
use function foo\func;
use App\Model\LogModel;
use App\Model\NationModel;
use Illuminate\Http\Request;
use App\Model\IntracodeModel;
use App\Http\Services\LogService;
use App\Http\Services\RuleService;
use Illuminate\Support\Facades\DB;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use App\Http\Services\RegionService;
use App\Http\Services\SupplierService;
use App\Http\Services\DepartmentService;
use App\Http\Services\SupplierTagService;
use App\Http\Transformers\LogTransformer;
use App\Http\Services\SkuUploadLogService;
use App\Http\Services\StandardBrandService;
use App\Http\Transformers\SupplierTransformer;
use App\Http\Services\SupplierAttachmentService;
use App\Http\Services\SupplierService;
use App\Http\Services\SupplierShareApplyService;
use App\Http\Services\SupplierStatisticsService;
use App\Http\Services\SupplierTagService;
use App\Http\Transformers\LogTransformer;
use App\Http\Transformers\SupplierTransformer;
use App\Model\IntracodeModel;
use App\Model\LogModel;
use App\Model\NationModel;
use App\Model\SupplierChannelModel;
use App\Model\SupplierContactModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use function foo\func;
class SupplierController extends Controller
{
......@@ -146,6 +147,8 @@ class SupplierController extends Controller
$this->data['province_city'] = implode(' | ', $regionNames);
$this->data['address'] = $supplierService->getAddress($supplierId);
$this->data['sku_upload_log_count'] = (new SkuUploadLogService())->getSkuUploadLogCount($supplierId);
$ruleService = new RuleService();
$this->data['rule'] = $ruleService->getSupplierRule($supplier['supplier_code']);
return $this->view('供应商详情');
}
......@@ -243,6 +246,10 @@ class SupplierController extends Controller
$this->data['brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
$this->data['exclude_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['main_brands']);
$this->data['agency_brand_init_value'] = (new StandardBrandService())->getBrandInitValue($supplier['agency_brands']);
$ruleService = new RuleService();
$this->data['rule'] = $ruleService->getSupplierRule($supplier['supplier_code']);
return $this->view('编辑供应商');
}
......
<?php
namespace App\Http\Services;
//后台用户相关信息服务
use App\Model\RedisModel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
//用于判断是否已经查看的服务
class RuleService
{
//获取供应商起订、运费、其他费用规则
public function getSupplierRule($supplierCode)
{
try {
$url = config('website.CubeUrl').'/open/rule/getSupplierFeeRule?supplier_id=17&supplier_code='.$supplierCode;
$rule = \curl($url);
$rule = json_decode($rule, true);
$rule = array_get($rule, 'data', []);
} catch (\Throwable $th) {
Log::error('获取供应商起订、运费、其他费用规则失败: '.$th->getMessage());
return [];
}
return $rule;
}
}
\ No newline at end of file
......@@ -44,4 +44,5 @@ return [
'CloudUrl' => env('CLOUD_URL'),
'CrmUrl' => env('CRM_URL'),
'SkipSendEmail' => env('skip_send_email'),
'CubeUrl' => env('CUBE_URL'),
];
<blockquote class="layui-elem-quote layui-text">
<b>运费设置-国际运费<span
style="color: orange;margin-left: 10px">PS:设置后的运费规则,将会应用在【询报价系统】供销售看到(仅做为提示)</span></b>
<b>运费设置-国际运费<span style="color: orange;margin-left: 10px">PS:设置后的运费规则,将会应用在【询报价系统】供销售看到(仅做为提示)</span></b>
</blockquote>
{{--运费规则--}}
<div class="layui-form-item">
@if($operate==='update')
<button class="layui-btn layui-btn-sm" type="button" id="saveShippingCostRuler">添加运费规则</button>
<button class="layui-btn layui-btn-sm" type="button" id="saveShippingCostRuler">添加运费规则</button>
@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>
<b>采购备注<span style="color: orange;margin-left: 10px">PS:设置后的备注信息,将会应用在【询报价系统】供销售看到(仅做为提示)</span></b>
</blockquote>
{{--采购备注--}}
<div class="layui-form-item">
@if($operate==='update')
<button class="layui-btn layui-btn-sm" type="button" id="savePurchaserRemark">添加备注</button>
<button class="layui-btn layui-btn-sm" type="button" id="savePurchaserRemark">添加备注</button>
@endif
<table class="layui-table" lay-filter="purchaseRemarkList" id="purchaseRemarkList"></table>
</div>
<div @if($operate==="detail") style="display: none" @endif>
{{--供应商起订、运费、其他费用规则--}}
<blockquote class="layui-elem-quote layui-text">
<b>供应商起订、运费、其他费用规则</b>
</blockquote>
<div class="layui-form-item">
<table class="layui-table">
<thead>
<tr>
<th>规则名称</th>
<th>规则详情</th>
</tr>
</tr>
<tbody>
<tr>
<td>起订规则</td>
<td>{!! array_get($rule, 'minOrderRule', '无') !!}</td>
</tr>
<tr>
<td>运费规则</td>
<td>{!! array_get($rule, 'shippingRule', '无') !!}</td>
</tr>
<tr>
<td>其他费用规则</td>
<td>
{!! array_get($rule, 'otherFeeRule.rolling_rule', '无') !!}
<br>
{!! array_get($rule, 'otherFeeRule.operation_rule', '无') !!}
</td>
</tr>
</tbody>
</thead>
</table>
</div>
<div @if($operate==="detail" ) style="display: none" @endif>
<blockquote class="layui-elem-quote layui-text">
<b>采购附加费设置</b>
</blockquote>
......@@ -33,15 +64,11 @@
<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="{{$supplier['extra_fee']['cn']['max'] or ''}}"
lay-verify="num">
<input class="layui-input" type="text" name="cn[max]" id="cn_max" value="{{$supplier['extra_fee']['cn']['max'] or ''}}" 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="{{$supplier['extra_fee']['cn']['price'] or ''}}"
lay-verify="float" value="">
<input class="layui-input" type="text" name="cn[price]" value="{{$supplier['extra_fee']['cn']['price'] or ''}}" 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;">
......@@ -53,15 +80,11 @@
<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="{{$supplier['extra_fee']['hk']['max'] or ''}}"
lay-verify="num" value="">
<input class="layui-input" type="text" name="hk[max]" id="hk_max" value="{{$supplier['extra_fee']['hk']['max'] or ''}}" 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="{{$supplier['extra_fee']['hk']['price'] or ''}}"
lay-verify="float" value="">
<input class="layui-input" type="text" name="hk[price]" value="{{$supplier['extra_fee']['hk']['price'] or ''}}" 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;">
......@@ -76,16 +99,13 @@
<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="{{$supplier['cn_ratio'] or 1}}"
placeholder="请输入人民币系数" autocomplete="off" class="layui-input"
style="display: inline-block">
<input type="text" name="cn_ratio" value="{{$supplier['cn_ratio'] or 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="{{$supplier['us_ratio'] or 1}}"
placeholder="请输入采购附加费" autocomplete="off" class="layui-input">
<input type="text" name="us_ratio" value="{{$supplier['us_ratio'] or 1}}" placeholder="请输入采购附加费" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">
基数为1,如利润为10%,请填写1.1
......@@ -99,26 +119,24 @@
<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="{{$supplier['cn_delivery_time'] or 1}}"
autocomplete="off" class="layui-input">
<input type="text" name="cn_delivery_time" value="{{$supplier['cn_delivery_time'] or 1}}" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 50px">
<select name="cn_delivery_time_period">
<option value="天" @if($supplier['cn_delivery_time_period'] == '天') selected @endif></option>
<option value="周" @if($supplier['cn_delivery_time_period'] == '周') selected @endif></option>
<option value="天" @if($supplier['cn_delivery_time_period']=='天' ) selected @endif></option>
<option value="周" @if($supplier['cn_delivery_time_period']=='周' ) selected @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="{{$supplier['us_delivery_time'] or 1}}"
autocomplete="off" class="layui-input">
<input type="text" name="us_delivery_time" value="{{$supplier['us_delivery_time'] or 1}}" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline" style="width: 50px">
<select name="us_delivery_time_period">
<option value="天" @if($supplier['us_delivery_time_period'] == '天') selected @endif></option>
<option value="周" @if($supplier['us_delivery_time_period'] == '周') selected @endif></option>
<option value="天" @if($supplier['us_delivery_time_period']=='天' ) selected @endif></option>
<option value="周" @if($supplier['us_delivery_time_period']=='周' ) selected @endif></option>
</select>
</div>
<div class="layui-form-mid layui-word-aux">
......@@ -130,11 +148,13 @@
<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>
......
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