Commit 25fabaa0 by 杨树贤

完善审核

parent 08897255
...@@ -79,11 +79,26 @@ class SupplierAuditService ...@@ -79,11 +79,26 @@ class SupplierAuditService
//发送队列消息同步到金蝶 //发送队列消息同步到金蝶
$service = new SyncSupplierService(); $service = new SyncSupplierService();
$service->syncSupplierToErp($supplierId); $service->syncSupplierToErp($supplierId);
if ($status == SupplierChannelModel::STATUS_PASSED ) { if ($status == SupplierChannelModel::STATUS_PASSED) {
if (!checkPerm('IgnoreCompanyCheck')) {
//判断有公司信息才允许同步给一体化
$regionType = $supplier['region'] == 2 ? 1 : 2;
if ($regionType == 2) {
(new SyncSupplierService())->syncSupplierToUnited($supplierId);
} else {
$supplier['tax_number'] = $supplier['supplier_name'] ?: $supplier['tax_number'];
$company = (new CompanyService())->getCompanyInfo($supplier['supplier_name'],
$supplier['tax_number'], $regionType);
if (!empty($company)) {
//同步给一体化系统 //同步给一体化系统
(new SyncSupplierService())->syncSupplierToUnited($supplierId); (new SyncSupplierService())->syncSupplierToUnited($supplierId);
} }
} }
} else {
(new SyncSupplierService())->syncSupplierToUnited($supplierId);
}
}
}
return $result; return $result;
} }
......
<script> <script>
layui.use(['table', 'form', 'element', 'layer','admin'], function () { layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let admin = layui.admin; let admin = layui.admin;
let form = layui.form; let form = layui.form;
let element = layui.element; let element = layui.element;
form.on('submit(auditSupplier)', function (data) { form.on('submit(auditSupplier)', function (data) {
admin.showLoading({type: 3});
let supplierId = getQueryVariable('supplier_id'); let supplierId = getQueryVariable('supplier_id');
let url = '/api/supplier/AuditSupplier?supplier_id=' + supplierId; let url = '/api/supplier/AuditSupplier?supplier_id=' + supplierId;
let res = ajax(url, data.field); $.ajax({
if (!res) { url: url,
layer.msg('网络错误,请重试', {icon: 6}); type: 'post',
} else { data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.err_code === 0) { if (res.err_code === 0) {
admin.removeLoading();
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();
return layer.msg('网络错误,请重试', {icon: 5});
} }
});
return false; return false;
}); });
form.on('submit(cancel)', function (data) { form.on('submit(cancel)', function (data) {
......
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