Commit f5f80f27 by 杨树贤

Merge branch 'ysx-供应商类型-20220614' into ysx-供应商新需求-20220627

parents 52202507 35ce3993
......@@ -67,7 +67,7 @@ class SupplierController extends Controller
$applyData = $applyService->getAuditSupplierShareApplyList($request->user->userId);
$this->data['shareApplyCount'] = $applyData['total'];
$statusData = [];
foreach (config('fixed.SupplierStatus') as $key=>$value) {
foreach (config('fixed.SupplierStatus') as $key => $value) {
$statusData[] = [
'name' => $value,
'value' => $key,
......@@ -210,6 +210,8 @@ class SupplierController extends Controller
]);
$this->data['supplier'] = $supplier;
$this->data['address'] = $supplierService->getAddress($supplierId);
$this->data['ignore_supplier_type_change_tips'] = in_array($supplier['supplier_name'],
config('field.SkipChangeSupplierTypeNames'));
return $this->view('编辑供应商');
}
......
......@@ -518,5 +518,30 @@ class DataService
});
})->export('csv');
}
public function exportSupplierJsonForUnited()
{
$suppliers = SupplierChannelModel::where('is_type', 0)
->pluck('supplier_group', 'supplier_id')->toArray();
$exportJson = [];
$items = array_map(function ($value) {
$value = array_get(config('fixed.SupplierGroup'), $value);
return $value;
}, $suppliers);
$jsonItems = [];
foreach ($items as $key => $item) {
$jsonItems[] = [
'i' => $key,
'n' => $item
];
}
$exportJson = [
'sysId' => 1,
'cType' => 2,
'list' => $jsonItems,
];
echo json_encode($exportJson);
}
}
......@@ -99,6 +99,7 @@ class SkuService
$item['encoded_user_name'] = array_get($encodedUsers, $encoded, '');
$item['moq'] = $item['moq'] ?: 0;
$item['stock'] = $item['stock'] ?: 0;
$item['cp_time'] = $item['cp_time'] ? date('Y-m-d H:i:s', $item['cp_time']) : '';
return $item;
}, $list);
}
......
......@@ -57,6 +57,7 @@ class SupplierValidator
'main_brands' => 'required',
'pay_type' => 'required',
'settlement_type' => 'required',
'established_time' => 'required',
'currency' => 'required',
'supplier_group' => 'required',
'main_customers' => 'max:100',
......
......@@ -60,6 +60,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route::match(['get', 'post'], '/test', function () {
$resut = json_decode('{"group_code":"G000010","source_sn":0,"company_name":"深圳大事件科技有限公司","init_nature":"原厂","company_nature":"方案商","company_type":2}',true);
dd((new \App\Http\Services\SyncSupplierService())->syncSupplierToUnitedResult($resut));
(new \App\Http\Services\SyncSupplierService())->syncSupplierToUnited(5);
});
......@@ -86,6 +86,7 @@ return [
//账期-定期结算
2 => '验货付款',
// 4 => '定金'
5 => '验货付款',
],
'SupplierApiType' => [
......
......@@ -8,19 +8,32 @@
//提交数据
form.on('submit(saveSupplierAttachment)', function (data) {
layer.confirm('确定要保存附件信息吗?', function (index) {
let res = ajax('/api/supplier_attachment/SaveSupplierAttachment', data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.putTempData("needFreshList", 1);
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
admin.showLoading({
type: 3
});
$.ajax({
url: '/api/supplier_attachment/SaveSupplierAttachment',
type: 'GET',
async: true,
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (res.err_code === 0) {
admin.removeLoading();
admin.putTempData("needFreshList", 1);
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();
parent.layer.msg('网络错误', {icon: 5});
}
}
return false;
});
});
return false;
})
......
......@@ -38,11 +38,13 @@
@if (request()->get('search')==1)
setTimeout(function () {
$('#getSupplierListButton').click();
},500);
}, 500);
@endif
let cols = [
{type: 'checkbox'},
{field: 'cp_time', title: '上架有效期', align: 'center', width: 180},
{
field: 'goods_name', title: '型号', align: 'center', width: 200, templet: function (data) {
return "<a href='{{config('website.FootstoneUrl')}}/footstone/addsku?sku_id=" + data.goods_id + "' style='color:blue' target='_blank'>"
......
......@@ -71,6 +71,9 @@
obj2Checked = true;
}
}
@if ($ignore_supplier_type_change_tips)
msg = '';
@endif
if (msg) {
layer.confirm(msg, {btn: ["确认", "取消"]},
function (index) {
......
......@@ -54,15 +54,13 @@
if (res.err_code === -2) {
if (!ignoreCompanyCheck) {
layer.msg(res.err_msg, {icon: 5});
self.after("<div id='supplier_check_tip' style='margin-top: 5px'>" +
"<p style='color: red;'>" + res.err_msg + "</p></div>");
self.next('#supplier_check_tip').find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
} else {
//这个code代表供应商名称已经存在,自然要检测
layer.msg(res.err_msg, {icon: 5});
self.after("<div id='supplier_check_tip' style='margin-top: 5px'>" +
"<p style='color: red;'>" + res.err_msg + "</p></div>");
self.next('#supplier_check_tip').find('p').text(res.err_msg);
$('#supplier_name').prop('disabled', false);
}
if (!ignoreCompanyCheck) {
......@@ -306,6 +304,7 @@
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);
form.render();
layer.msg('验证成功,校验公司信息通过,自动补全相关数据', {icon: 6})
......@@ -313,8 +312,7 @@
if (ignoreCompanyCheck) {
layer.msg('公司未进行工商注册', {icon: 5})
} else {
$('#supplier_name').after("<div id='supplier_check_tip' style='margin-top: 5px'>" +
"<p style='color: red;'>公司未进行工商注册,请修改后重新提交</p></div>");
$('#supplier_name').next('#supplier_check_tip').find('p').text('公司未进行工商注册,请修改后重新提交');
layer.msg('验证失败,公司未进行工商注册,请修改后重新提交', {icon: 5})
resetCompanyInfo(supplierName !== '');
}
......
......@@ -162,7 +162,7 @@
{!! $singleSelectPresenter->render('has_legal_ID_card','法人身份证 :',-1,[1=>'有',-1=>'无']) !!}
</div>
<div class="layui-col-md3">
<label class="layui-form-label" style="width: 80px">成立时间 :
<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"
......
......@@ -74,7 +74,7 @@
style="text-align: left;padding-left: 20px">{{$printData['supplier_address']}}</td>
</tr>
<tr>
<td width="20%" colspan="1">供应商办公/发货地址*</td>
<td width="20%" colspan="1">供应商办公/发货地址</td>
<td width="80%" colspan="5"
style="text-align: left;padding-left: 20px">{{$printData['shipping_address']}}</td>
</tr>
......@@ -132,7 +132,7 @@
<td width="80%" colspan="5" style="text-align: left;padding-left: 20px"></td>
</tr>
<tr>
<td width="20%" colspan="1">供应商到票时间*</td>
<td width="20%" colspan="1">供应商到票时间</td>
<td width="80%" colspan="5"
style="text-align: left;padding-left: 20px">{{$printData['ticket_time'] or ''}}</td>
</tr>
......
......@@ -164,7 +164,7 @@
:{{$supplier['has_legal_ID_card_name']}}
</div>
<div class="layui-col-md3">
成立时间 :{{$supplier['established_time']}}
<span class="required_field">*</span> 成立时间 :{{$supplier['established_time']}}
</div>
</div>
<div class="layui-row">
......
......@@ -59,6 +59,9 @@
@endif"
value="{{$supplier['supplier_name'] or ''}}"
@if ($supplier) disabled @endif>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div>
</div>
<div class="layui-col-md5">
......@@ -68,6 +71,9 @@
<input type="text" name="tax_number" id="tax_number" placeholder="请输入公司税号,选择所在区域才允许输入"
class="layui-input layui-disabled" disabled value="{{$supplier['tax_number'] or ''}}">
</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: 20px">
......@@ -161,7 +167,7 @@
{!! $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">成立时间 :
<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"
......
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