Commit e2d190fc by 杨树贤

修复bug

parent 3605184b
...@@ -60,6 +60,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function () ...@@ -60,6 +60,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
}); });
Route::match(['get', 'post'], '/test', 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); (new \App\Http\Services\DataService())->exportSupplierJsonForUnited();
dd((new \App\Http\Services\SyncSupplierService())->syncSupplierToUnitedResult($resut));
}); });
...@@ -8,19 +8,32 @@ ...@@ -8,19 +8,32 @@
//提交数据 //提交数据
form.on('submit(saveSupplierAttachment)', function (data) { form.on('submit(saveSupplierAttachment)', function (data) {
layer.confirm('确定要保存附件信息吗?', function (index) { layer.confirm('确定要保存附件信息吗?', function (index) {
let res = ajax('/api/supplier_attachment/SaveSupplierAttachment', data.field); admin.showLoading({
if (!res) { type: 3
layer.msg('网络错误,请重试', {icon: 6}); });
} else { $.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) { if (res.err_code === 0) {
admin.removeLoading();
admin.putTempData("needFreshList", 1); admin.putTempData("needFreshList", 1);
admin.closeThisDialog(); admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6}); parent.layer.msg(res.err_msg, {icon: 6});
} else { } else {
admin.removeLoading();
parent.layer.msg(res.err_msg, {icon: 5}); parent.layer.msg(res.err_msg, {icon: 5});
} }
},
error: function () {
admin.removeLoading();
parent.layer.msg('网络错误', {icon: 5});
} }
return false; });
}); });
return false; return false;
}) })
......
...@@ -54,15 +54,13 @@ ...@@ -54,15 +54,13 @@
if (res.err_code === -2) { if (res.err_code === -2) {
if (!ignoreCompanyCheck) { if (!ignoreCompanyCheck) {
layer.msg(res.err_msg, {icon: 5}); layer.msg(res.err_msg, {icon: 5});
self.after("<div id='supplier_check_tip' style='margin-top: 5px'>" + self.next('#supplier_check_tip').find('p').text(res.err_msg);
"<p style='color: red;'>" + res.err_msg + "</p></div>");
$('#supplier_name').prop('disabled', false); $('#supplier_name').prop('disabled', false);
} }
} else { } else {
//这个code代表供应商名称已经存在,自然要检测 //这个code代表供应商名称已经存在,自然要检测
layer.msg(res.err_msg, {icon: 5}); layer.msg(res.err_msg, {icon: 5});
self.after("<div id='supplier_check_tip' style='margin-top: 5px'>" + self.next('#supplier_check_tip').find('p').text(res.err_msg);
"<p style='color: red;'>" + res.err_msg + "</p></div>");
$('#supplier_name').prop('disabled', false); $('#supplier_name').prop('disabled', false);
} }
if (!ignoreCompanyCheck) { if (!ignoreCompanyCheck) {
...@@ -313,8 +311,7 @@ ...@@ -313,8 +311,7 @@
if (ignoreCompanyCheck) { if (ignoreCompanyCheck) {
layer.msg('公司未进行工商注册', {icon: 5}) layer.msg('公司未进行工商注册', {icon: 5})
} else { } else {
$('#supplier_name').after("<div id='supplier_check_tip' style='margin-top: 5px'>" + $('#supplier_name').next('#supplier_check_tip').find('p').text('公司未进行工商注册,请修改后重新提交');
"<p style='color: red;'>公司未进行工商注册,请修改后重新提交</p></div>");
layer.msg('验证失败,公司未进行工商注册,请修改后重新提交', {icon: 5}) layer.msg('验证失败,公司未进行工商注册,请修改后重新提交', {icon: 5})
resetCompanyInfo(supplierName !== ''); resetCompanyInfo(supplierName !== '');
} }
......
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
@endif" @endif"
value="{{$supplier['supplier_name'] or ''}}" value="{{$supplier['supplier_name'] or ''}}"
@if ($supplier) disabled @endif> @if ($supplier) disabled @endif>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div> </div>
</div> </div>
<div class="layui-col-md5"> <div class="layui-col-md5">
...@@ -68,6 +71,9 @@ ...@@ -68,6 +71,9 @@
<input type="text" name="tax_number" id="tax_number" placeholder="请输入公司税号,选择所在区域才允许输入" <input type="text" name="tax_number" id="tax_number" placeholder="请输入公司税号,选择所在区域才允许输入"
class="layui-input layui-disabled" disabled value="{{$supplier['tax_number'] or ''}}"> class="layui-input layui-disabled" disabled value="{{$supplier['tax_number'] or ''}}">
</div> </div>
<div id='supplier_check_tip' style='margin-top: 5px'>
<p style='color: red;'></p>
</div>
</div> </div>
</div> </div>
<div class="layui-col-md2" style="padding-left: 20px"> <div class="layui-col-md2" style="padding-left: 20px">
......
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