Commit 11feddee by mushishixian

fix

parent 087c79cf
......@@ -122,15 +122,18 @@ class SupplierService
$channel['update_time'] = time();
$model->where('supplier_id', $supplierId)->update($channel);
$this->saveSupplierCode($supplierId);
//插入系数到redis
$supplierAddressService = new SupplierAddressService();
$supplierAddressService->saveAddress($address);
//附加费
$extraFaxService = new SupplierExtraFeeService();
$extraFaxService->saveSupplierExtraFee($extraFax);
//插入系数到redis
$this->saveRatioToRedis($supplierId);
//各种规则
$this->saveSkuAuditRulerToRedis($supplierId, $channel['sku_audit_ruler']);
$this->saveSkuUploadRulerToRedis($supplierId, $channel['sku_upload_ruler']);
//判断是否要移出待跟进
// $this->updateIsFollowUp($supplierId);
}
//重新生成外部显示的编码
$supplierSn = $this->generateSupplierSn($supplierId, $channel['supplier_group']);
......@@ -272,7 +275,7 @@ class SupplierService
if ($supplier['purchase_uid'] != $purchaseUid) {
$auditService = new SupplierAuditService();
//还要判断是否为待跟进供应商
if (!$auditService->checkIsNeedToFollowUpSupplier($supplierId)) {
if ($auditService->checkIsNeedToFollowUpSupplier($supplierId)) {
$model->where('supplier_id', $supplierId)->update([
'to_follow_up' => 1,
]);
......@@ -293,6 +296,23 @@ class SupplierService
return $result;
}
//判断并且修改待跟进
private function updateIsFollowUp($supplierId)
{
$model = new SupplierChannelModel();
$auditService = new SupplierAuditService();
//还要判断是否为待跟进供应商
if ($auditService->checkIsNeedToFollowUpSupplier($supplierId)) {
$model->where('supplier_id', $supplierId)->update([
'to_follow_up' => 1,
]);
}else{
$model->where('supplier_id', $supplierId)->update([
'to_follow_up' => 0,
]);
}
}
//修改is_type
public function changeSupplierIsType($supplierId, $isType)
{
......
......@@ -76,24 +76,3 @@ function ajax(url, data) {
layer.closeAll();
return result;
}
\ No newline at end of file
//保存需要刷新的页面数据
function saveRefreshData(type,supplierId = 0) {
// if (type === 'detail') {
// let data = admin.getTempData("needFreshDetail");
// if (data) {
// data = JSON.parse(data);
// data.push(supplierId);
// data = JSON.stringify(data);
// admin.putTempData("needFreshDetail",data);
// }else{
// admin.putTempData("needFreshDetail",JSON.stringify([supplierId]));
// console.log(admin.getTempData("needFreshDetail"));
// }
//
// }
//
// if (type === 'list') {
// admin.putTempData("needFreshList",1);
// }
}
\ No newline at end of file
......@@ -90,6 +90,11 @@
, page: {}
});
//保存需要刷新的页面数据
function saveRefreshData(type, supplierId = 0) {
admin.putTempData("needFreshDetail_supplier_id=" + supplierId, 1);
}
//新增供应商弹窗
$("#add_supplier").click(function () {
layer.open({
......@@ -144,7 +149,7 @@
layer.msg('请先选择要操作的供应商', {icon: 5})
} else {
const status = data[0].status;
if ((status === 3 || status === 2 || status === -3)) {
if ((status === 3 || status === 2 || status === -2)) {
let supplierId = data[0].supplier_id;
layer.open({
type: 2,
......@@ -222,6 +227,7 @@
});
form.on('submit(load)', function (data) {
initCondition.source_type = whereCondition.source_type;
whereCondition = $.extend(false, initCondition, data.field);
//执行重载
table.reload('list', {
......
......@@ -62,36 +62,23 @@
});
admin.on('tab', function (d) {
// $(function () {
// $('#getSupplierListButton').click();
// })
// // d.layId表示当前tab的url
// //判断列表是否需要刷新
if (d.layId.search('SupplierList') !== -1) {
// alert(123);
// $(function () {
// $('.admin-iframe').contents().find('#getSupplierListButton').click()
// })
setTimeout(function () {
$('.admin-iframe').contents().find('#getSupplierListButton').click()
}, 10)
}
//判断详情是否需要刷新
if (d.layId.search('SupplierDetail') !== -1) {
let vars = d.layId.split("&");
let supplierFlag = vars[1];
let data = admin.getTempData("needFreshDetail_" + supplierFlag);
if (data) {
admin.refresh();
admin.putTempData("needFreshDetail_" + supplierFlag, null);
}
}
// }
// let needFreshList = admin.getTempData("needFreshList");
// if (needFreshList) {
// // admin.putTempData("needFreshList",0)
// console.log("刷新列表")
// // $('#getSupplierListButton').click();
// } else {
// console.log("不刷新列表")
// }
// }
// //判断详情是否需要刷新
// if (d.layId.search('SupplierDetail') !== -1) {
// let data = admin.getTempData("needFreshDetail");
// console.log(data)
// if (data) {
// console.log(data)
// }
// }
// console.log($('.admin-iframe').contents().find('#getSupplierListButton').click());
});
});
</script>
......
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