Commit 11feddee by mushishixian

fix

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