Commit 25fabaa0 by 杨树贤

完善审核

parent 08897255
......@@ -79,9 +79,24 @@ class SupplierAuditService
//发送队列消息同步到金蝶
$service = new SyncSupplierService();
$service->syncSupplierToErp($supplierId);
if ($status == SupplierChannelModel::STATUS_PASSED ) {
//同步给一体化系统
(new SyncSupplierService())->syncSupplierToUnited($supplierId);
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);
}
}
} else {
(new SyncSupplierService())->syncSupplierToUnited($supplierId);
}
}
}
return $result;
......
<script>
layui.use(['table', 'form', 'element', 'layer','admin'], function () {
layui.use(['table', 'form', 'element', 'layer', 'admin'], function () {
let admin = layui.admin;
let form = layui.form;
let element = layui.element;
form.on('submit(auditSupplier)', function (data) {
admin.showLoading({type: 3});
let supplierId = getQueryVariable('supplier_id');
let url = '/api/supplier/AuditSupplier?supplier_id=' + supplierId;
let res = ajax(url, data.field);
if (!res) {
layer.msg('网络错误,请重试', {icon: 6});
} else {
if (res.err_code === 0) {
admin.closeThisDialog();
parent.layer.msg(res.err_msg, {icon: 6});
} else {
parent.layer.msg(res.err_msg, {icon: 5});
$.ajax({
url: url,
type: 'post',
data: data.field,
dataType: 'json',
timeout: 20000,
success: function (res) {
if (!res) return layer.msg('网络错误,请重试', {icon: 5});
if (res.err_code === 0) {
admin.removeLoading();
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();
return layer.msg('网络错误,请重试', {icon: 5});
}
}
});
return false;
});
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