Commit e2d190fc by 杨树贤

修复bug

parent 3605184b
......@@ -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\DataService())->exportSupplierJsonForUnited();
});
......@@ -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;
})
......
......@@ -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) {
......@@ -313,8 +311,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 !== '');
}
......
......@@ -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">
......
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