Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7115c632
authored
May 19, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
审核代码
parent
bfeef9fc
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
139 additions
and
84 deletions
app/Http/Controllers/Api/SupplierCrmApiController.php
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Controllers/SupplierController.php
app/Http/Services/SupplierAuditService.php
app/Model/SupplierExtendModel.php
resources/views/script/ConfirmCrmSupplierScript.blade.php
resources/views/script/SupplierListScript.blade.php
resources/views/web/ConfirmCrmSupplier.blade.php
resources/views/web/SupplierList.blade.php
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
app/Http/Controllers/Api/SupplierCrmApiController.php
View file @
7115c632
...
@@ -26,6 +26,7 @@ class SupplierCrmApiController extends Controller
...
@@ -26,6 +26,7 @@ class SupplierCrmApiController extends Controller
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierId
=
$request
->
get
(
'supplier_id'
);
$auditOpinion
=
$request
->
get
(
'audit_opinion'
);
// agree / disagree
$auditOpinion
=
$request
->
get
(
'audit_opinion'
);
// agree / disagree
$remark
=
trim
(
$request
->
get
(
'remark'
,
''
));
$remark
=
trim
(
$request
->
get
(
'remark'
,
''
));
$channelUid
=
$request
->
get
(
'channel_uid'
,
''
);
if
(
empty
(
$auditOpinion
))
{
if
(
empty
(
$auditOpinion
))
{
$this
->
response
(
-
1
,
'必须选择一个审核意见'
);
$this
->
response
(
-
1
,
'必须选择一个审核意见'
);
...
@@ -33,12 +34,15 @@ class SupplierCrmApiController extends Controller
...
@@ -33,12 +34,15 @@ class SupplierCrmApiController extends Controller
if
(
$auditOpinion
==
'disagree'
&&
empty
(
$remark
))
{
if
(
$auditOpinion
==
'disagree'
&&
empty
(
$remark
))
{
$this
->
response
(
-
1
,
'请填写原因说明'
);
$this
->
response
(
-
1
,
'请填写原因说明'
);
}
}
if
(
$auditOpinion
==
'agree'
&&
empty
(
$channelUid
))
{
$this
->
response
(
-
1
,
'请指定采购员'
);
}
$approvalStatus
=
$auditOpinion
==
'agree'
?
1
:
2
;
$approvalStatus
=
$auditOpinion
==
'agree'
?
1
:
2
;
try
{
try
{
$auditService
=
new
SupplierAuditService
();
$auditService
=
new
SupplierAuditService
();
$result
=
$auditService
->
auditCustomerConvertSupplier
(
$supplierId
,
$approvalStatus
,
$remark
);
$result
=
$auditService
->
auditCustomerConvertSupplier
(
$supplierId
,
$approvalStatus
,
$remark
,
$channelUid
);
$this
->
response
(
0
,
'审核成功'
);
$this
->
response
(
0
,
'审核成功'
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$this
->
response
(
-
1
,
'审核失败: '
.
$e
->
getMessage
());
$this
->
response
(
-
1
,
'审核失败: '
.
$e
->
getMessage
());
...
...
app/Http/Controllers/Filter/SupplierFilter.php
View file @
7115c632
...
@@ -291,15 +291,21 @@ class SupplierFilter
...
@@ -291,15 +291,21 @@ class SupplierFilter
$canViewFakeSupplier
=
checkPerm
(
'ViewFakeSupplier'
);
$canViewFakeSupplier
=
checkPerm
(
'ViewFakeSupplier'
);
$canViewBlockSupplier
=
checkPerm
(
'ViewBlockSupplier'
);
$canViewBlockSupplier
=
checkPerm
(
'ViewBlockSupplier'
);
$canViewDisableSupplier
=
checkPerm
(
'ViewDisableSupplier'
);
$canViewDisableSupplier
=
checkPerm
(
'ViewDisableSupplier'
);
$canViewConfirmSupplier
=
checkPerm
(
'ViewConfirmSupplier'
);
// 构建复合查询条件:基础条件 OR 特殊状态
// 构建复合查询条件:基础条件 OR 特殊状态
$query
->
where
(
function
(
$mainQuery
)
use
(
$canViewFakeSupplier
,
$canViewBlockSupplier
,
$canViewDisableSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
$query
->
where
(
function
(
$mainQuery
)
use
(
$canViewFakeSupplier
,
$canViewBlockSupplier
,
$canViewDisableSupplier
,
$
canViewConfirmSupplier
,
$
userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 主要条件组:基础业务条件
// 主要条件组:基础业务条件
$mainQuery
->
where
(
function
(
$baseQuery
)
use
(
$canViewFakeSupplier
,
$userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
$mainQuery
->
where
(
function
(
$baseQuery
)
use
(
$canViewFakeSupplier
,
$
canViewConfirmSupplier
,
$
userId
,
$codeId
,
$canViewAllSupplier
,
$canViewSubordinateSupplier
)
{
// 基础类型限制
// 基础类型限制
if
(
!
$canViewFakeSupplier
)
{
if
(
!
$canViewFakeSupplier
)
{
$baseQuery
->
where
(
'is_type'
,
0
);
$baseQuery
->
where
(
'is_type'
,
0
);
}
}
// 如果没有查看待确认供应商权限,过滤掉待确认状态的供应商
if
(
!
$canViewConfirmSupplier
)
{
$baseQuery
->
where
(
'status'
,
'!='
,
SupplierChannelModel
::
STATUS_CONFIRM
);
}
// 权限相关的条件
// 权限相关的条件
if
(
!
$canViewAllSupplier
)
{
if
(
!
$canViewAllSupplier
)
{
if
(
$canViewSubordinateSupplier
)
{
if
(
$canViewSubordinateSupplier
)
{
...
@@ -338,6 +344,9 @@ class SupplierFilter
...
@@ -338,6 +344,9 @@ class SupplierFilter
if
(
$canViewDisableSupplier
&&
!
checkPerm
(
'ViewAllSupplier'
))
{
if
(
$canViewDisableSupplier
&&
!
checkPerm
(
'ViewAllSupplier'
))
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_DISABLE
);
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_DISABLE
);
}
}
if
(
$canViewConfirmSupplier
&&
!
checkPerm
(
'ViewAllSupplier'
))
{
$mainQuery
->
orWhere
(
'status'
,
SupplierChannelModel
::
STATUS_CONFIRM
);
}
// //只有原厂、代理商需要走权限,其他性质的随便看
// //只有原厂、代理商需要走权限,其他性质的随便看
// if (!checkPerm('ViewAllSupplier')) {
// if (!checkPerm('ViewAllSupplier')) {
...
...
app/Http/Controllers/SupplierController.php
View file @
7115c632
...
@@ -449,6 +449,13 @@ class SupplierController extends Controller
...
@@ -449,6 +449,13 @@ class SupplierController extends Controller
$extendInfo
=
SupplierExtendModel
::
getCrmExtendBySupplierId
(
$supplierId
);
$extendInfo
=
SupplierExtendModel
::
getCrmExtendBySupplierId
(
$supplierId
);
$this
->
data
[
'customer_nature'
]
=
array_get
(
$extendInfo
,
'customer_nature'
,
''
);
$this
->
data
[
'customer_nature'
]
=
array_get
(
$extendInfo
,
'customer_nature'
,
''
);
$this
->
data
[
'crm_remark'
]
=
array_get
(
$extendInfo
,
'crm_remark'
,
''
);
$this
->
data
[
'crm_remark'
]
=
array_get
(
$extendInfo
,
'crm_remark'
,
''
);
$this
->
data
[
'reverse_purchaser'
]
=
array_get
(
$extendInfo
,
'reverse_purchaser'
,
''
);
// 获取采购员列表
$intraCodeModel
=
new
IntracodeModel
();
$this
->
data
[
'userCodes'
]
=
$intraCodeModel
->
getChannelUsersEncode
(
false
);
return
$this
->
view
(
'转化供应商确认'
);
return
$this
->
view
(
'转化供应商确认'
);
}
}
...
...
app/Http/Services/SupplierAuditService.php
View file @
7115c632
...
@@ -601,7 +601,7 @@ class SupplierAuditService
...
@@ -601,7 +601,7 @@ class SupplierAuditService
/**
/**
* 客户转化供应商 - 审核操作
* 客户转化供应商 - 审核操作
*/
*/
public
function
auditCustomerConvertSupplier
(
$supplierId
,
$approvalStatus
,
$remark
)
public
function
auditCustomerConvertSupplier
(
$supplierId
,
$approvalStatus
,
$remark
,
$channelUid
=
''
)
{
{
$auditBillInfo
=
AuditCenterService
::
getAuditInfoByIdAndType
(
$supplierId
,
AuditCenterService
::
TYPE_CUSTOMER_CONVERT_SUPPLIER_AUDIT
);
$auditBillInfo
=
AuditCenterService
::
getAuditInfoByIdAndType
(
$supplierId
,
AuditCenterService
::
TYPE_CUSTOMER_CONVERT_SUPPLIER_AUDIT
);
if
(
empty
(
$auditBillInfo
))
{
if
(
empty
(
$auditBillInfo
))
{
...
@@ -619,7 +619,7 @@ class SupplierAuditService
...
@@ -619,7 +619,7 @@ class SupplierAuditService
}
}
// 处理审核结果
// 处理审核结果
$this
->
handleCustomerConvertAuditResult
(
$supplierId
,
$auditBillInfo
,
$approvalStatus
,
$remark
);
$this
->
handleCustomerConvertAuditResult
(
$supplierId
,
$auditBillInfo
,
$approvalStatus
,
$remark
,
$channelUid
);
return
true
;
return
true
;
}
}
...
@@ -627,25 +627,36 @@ class SupplierAuditService
...
@@ -627,25 +627,36 @@ class SupplierAuditService
/**
/**
* 客户转化供应商 - 处理审核结果
* 客户转化供应商 - 处理审核结果
*/
*/
private
function
handleCustomerConvertAuditResult
(
$supplierId
,
$billInfo
,
$approvalStatus
,
$remark
)
private
function
handleCustomerConvertAuditResult
(
$supplierId
,
$billInfo
,
$approvalStatus
,
$remark
,
$channelUid
=
''
)
{
{
$approverName
=
request
()
->
user
->
name
;
$approverName
=
request
()
->
user
->
name
;
$currentTime
=
date
(
'Y-m-d H:i:s'
);
if
(
$approvalStatus
==
1
)
{
// 通过
if
(
$approvalStatus
==
1
)
{
// 通过
if
(
$billInfo
[
'approval_status'
]
==
AuditCenterService
::
APPROVAL_STATUS_FINISH
)
{
if
(
$billInfo
[
'approval_status'
]
==
AuditCenterService
::
APPROVAL_STATUS_FINISH
)
{
// 最终审核完成,状态改为待提审
// 最终审核完成,状态改为待提审
,并分配采购员
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
(
[
$updateData
=
[
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
'status'
=>
SupplierChannelModel
::
STATUS_PENDING
,
'update_time'
=>
time
(),
'update_time'
=>
time
(),
]);
];
if
(
!
empty
(
$channelUid
))
{
$updateData
[
'channel_uid'
]
=
$channelUid
;
}
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
(
$updateData
);
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'can_check_uids'
=>
$channelUid
,
]);
// 回传CRM系统:转化供应商状态更新为完成
// 回传CRM系统:转化供应商状态更新为完成
$supplierName
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
$supplierName
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
CrmService
::
confirmCrmSupplier
(
$supplierName
,
$approverName
,
'completed'
,
$remark
);
CrmService
::
confirmCrmSupplier
(
$supplierName
,
$approverName
,
'completed'
,
$remark
);
// 记录审批日志
// 记录审批日志
$logContent
=
"确认客户转化供应商:审核通过"
;
$logContent
=
"确认客户转化供应商:审核通过"
;
if
(
!
empty
(
$channelUid
))
{
$adminUserService
=
new
AdminUserService
();
$channelUser
=
$adminUserService
->
getAdminUserInfoByCodeId
(
$channelUid
);
$channelUserName
=
\array_get
(
$channelUser
,
'name'
,
''
);
$logContent
.=
",分配采购员:
{
$channelUserName
}
"
;
}
$logService
=
new
LogService
();
$logService
=
new
LogService
();
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'客户转化供应商审核'
,
$logContent
);
$logService
->
AddLog
(
$supplierId
,
LogModel
::
UPDATE_OPERATE
,
'客户转化供应商审核'
,
$logContent
);
}
else
{
}
else
{
...
...
app/Model/SupplierExtendModel.php
View file @
7115c632
...
@@ -8,15 +8,16 @@ use RedisDB;
...
@@ -8,15 +8,16 @@ use RedisDB;
class
SupplierExtendModel
extends
Model
class
SupplierExtendModel
extends
Model
{
{
protected
$connection
=
'web'
;
protected
$connection
=
'web'
;
protected
$table
=
'supplier_extend'
;
protected
$table
=
'supplier_extend'
;
public
$timestamps
=
false
;
public
$timestamps
=
false
;
/*
/*
* 方法作废于20200402,原因附加费改版
* 方法作废于20200402,原因附加费改版
*/
*/
public
function
AddInfo
(
$supplierID
=
''
,
$supplierSn
=
''
,
$data
=
''
,
$isUpdate
=
false
){
public
function
AddInfo
(
$supplierID
=
''
,
$supplierSn
=
''
,
$data
=
''
,
$isUpdate
=
false
)
if
(
empty
(
$supplierID
)
||
empty
(
$data
)
||
!
is_array
(
$data
))
return
false
;
{
if
(
empty
(
$supplierID
)
||
empty
(
$data
)
||
!
is_array
(
$data
))
return
false
;
empty
(
$data
[
'price'
])
&&
$data
[
'price'
]
=
0
;
empty
(
$data
[
'price'
])
&&
$data
[
'price'
]
=
0
;
empty
(
$data
[
'max'
])
&&
$data
[
'max'
]
=
0
;
empty
(
$data
[
'max'
])
&&
$data
[
'max'
]
=
0
;
...
@@ -29,7 +30,7 @@ class SupplierExtendModel extends Model
...
@@ -29,7 +30,7 @@ class SupplierExtendModel extends Model
if
(
!
empty
(
$isUpdate
))
{
// 编辑
if
(
!
empty
(
$isUpdate
))
{
// 编辑
$Add
[
'update_time'
]
=
time
();
$Add
[
'update_time'
]
=
time
();
$Add
[
'status'
]
=
$data
[
'status'
];
$Add
[
'status'
]
=
$data
[
'status'
];
$res
=
$this
->
where
(
'supplier_id'
,
'='
,
$supplierID
)
->
update
(
$Add
);
$res
=
$this
->
where
(
'supplier_id'
,
'='
,
$supplierID
)
->
update
(
$Add
);
// 修改redis
// 修改redis
if
(
!
empty
(
$data
[
'status'
])
&&
$data
[
'status'
]
==
'-1'
)
{
// 禁用
if
(
!
empty
(
$data
[
'status'
])
&&
$data
[
'status'
]
==
'-1'
)
{
// 禁用
$charge_content_json
=
''
;
$charge_content_json
=
''
;
...
@@ -43,17 +44,19 @@ class SupplierExtendModel extends Model
...
@@ -43,17 +44,19 @@ class SupplierExtendModel extends Model
$Redis
=
RedisDB
::
connection
();
$Redis
=
RedisDB
::
connection
();
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$supplierSn
,
$charge_content_json
);
// 联营供应商ID是17,储存内容格式如下{"max":2000,"price":10}
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$supplierSn
,
$charge_content_json
);
// 联营供应商ID是17,储存内容格式如下{"max":2000,"price":10}
return
$res
;
return
$res
;
}
}
public
function
ExtendInfo
(
$SupplierID
=
''
){
public
function
ExtendInfo
(
$SupplierID
=
''
)
$collert
=
Request
::
only
(
'supplier_id'
);
{
$collert
=
TrimX
(
$collert
,
true
,[
'supplier_id'
]);
$collert
=
Request
::
only
(
'supplier_id'
);
empty
(
$collert
)
&&
$collert
[
'supplier_id'
]
=
$SupplierID
;
$collert
=
TrimX
(
$collert
,
true
,
[
'supplier_id'
]);
if
(
empty
(
$collert
[
'supplier_id'
]))
return
false
;
empty
(
$collert
)
&&
$collert
[
'supplier_id'
]
=
$SupplierID
;
$info
=
$this
->
where
(
'supplier_id'
,
'='
,
$collert
[
'supplier_id'
])
->
first
();
if
(
empty
(
$collert
[
'supplier_id'
]))
return
false
;
if
(
!
$info
)
return
false
;
$info
=
$info
->
toArray
();
$info
=
$this
->
where
(
'supplier_id'
,
'='
,
$collert
[
'supplier_id'
])
->
first
();
if
(
!
$info
)
return
false
;
$info
=
$info
->
toArray
();
if
(
!
empty
(
$info
))
{
if
(
!
empty
(
$info
))
{
if
(
$info
[
'charge_content'
])
{
if
(
$info
[
'charge_content'
])
{
$charge_content
=
json_decode
(
$info
[
'charge_content'
],
true
);
$charge_content
=
json_decode
(
$info
[
'charge_content'
],
true
);
...
@@ -64,20 +67,21 @@ class SupplierExtendModel extends Model
...
@@ -64,20 +67,21 @@ class SupplierExtendModel extends Model
}
}
// 获取附加费信息
// 获取附加费信息
public
function
getExtendExtra
(
$SupplierCode
=
''
,
$SupplierID
=
''
){
public
function
getExtendExtra
(
$SupplierCode
=
''
,
$SupplierID
=
''
)
if
(
empty
(
$SupplierCode
))
return
false
;
{
if
(
empty
(
$SupplierCode
))
return
false
;
$Redis
=
new
RedisModel
();
$Redis
=
new
RedisModel
();
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$extendInfo
=
$Redis
->
hget
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
);
// 联营供应商ID是17,储存内容格式如下{"max":2000,"price":10}
$extendInfo
=
$Redis
->
hget
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
);
// 联营供应商ID是17,储存内容格式如下{"max":2000,"price":10}
if
(
empty
(
$extendInfo
))
{
if
(
empty
(
$extendInfo
))
{
$charge_content
=
$this
->
select
([
'charge_content'
])
->
where
(
'supplier_id'
,
'='
,
$SupplierID
)
->
where
(
'status'
,
'='
,
1
)
->
first
();
$charge_content
=
$this
->
select
([
'charge_content'
])
->
where
(
'supplier_id'
,
'='
,
$SupplierID
)
->
where
(
'status'
,
'='
,
1
)
->
first
();
if
(
!
empty
(
$charge_content
))
{
if
(
!
empty
(
$charge_content
))
{
$charge_content
=
$charge_content
->
toArray
();
$charge_content
=
$charge_content
->
toArray
();
$extendInfo
=
$charge_content
[
'charge_content'
];
$extendInfo
=
$charge_content
[
'charge_content'
];
}
}
if
(
!
empty
(
$extendInfo
))
{
if
(
!
empty
(
$extendInfo
))
{
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
,
$extendInfo
);
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
,
$extendInfo
);
}
}
}
}
if
(
$extendInfo
)
{
if
(
$extendInfo
)
{
...
@@ -91,54 +95,57 @@ class SupplierExtendModel extends Model
...
@@ -91,54 +95,57 @@ class SupplierExtendModel extends Model
* @param string $UserInfo
* @param string $UserInfo
* @return array
* @return array
*/
*/
private
function
changeExtra
(
$UserInfo
=
''
){
private
function
changeExtra
(
$UserInfo
=
''
)
{
// return [20001,'新增供应商失败'];
// return [20001,'新增供应商失败'];
$arr
=
[
'extra'
];
$arr
=
[
'extra'
];
$collert
=
Request
::
only
(
$arr
);
$collert
=
Request
::
only
(
$arr
);
$collert
=
TrimX
(
$collert
,
true
,
$arr
);
$collert
=
TrimX
(
$collert
,
true
,
$arr
);
$extra
=
$collert
[
'extra'
];
$extra
=
$collert
[
'extra'
];
// 根据supplier_code 和supplier_id
// 根据supplier_code 和supplier_id
$extra
[
'status'
]
=
'1'
;
// 目前暂时皆为1启用(默认)
$extra
[
'status'
]
=
'1'
;
// 目前暂时皆为1启用(默认)
$re
=
$this
->
select
([
'supplier_id'
])
->
where
(
'supplier_id'
,
'='
,
$extra
[
'supplier_id'
])
->
get
()
->
toArray
();
$re
=
$this
->
select
([
'supplier_id'
])
->
where
(
'supplier_id'
,
'='
,
$extra
[
'supplier_id'
])
->
get
()
->
toArray
();
$isUpdate
=
false
;
$isUpdate
=
false
;
if
(
!
empty
(
$re
[
0
][
'supplier_id'
]))
$isUpdate
=
true
;
if
(
!
empty
(
$re
[
0
][
'supplier_id'
]))
$isUpdate
=
true
;
$FeeInfo
=
$this
->
getExtendExtra
(
$extra
[
'supplier_code'
],
$extra
[
'supplier_id'
]);
$FeeInfo
=
$this
->
getExtendExtra
(
$extra
[
'supplier_code'
],
$extra
[
'supplier_id'
]);
$res
=
$this
->
AddInfo
(
$extra
[
'supplier_id'
],
$extra
[
'supplier_code'
],
$extra
,
$isUpdate
);
$res
=
$this
->
AddInfo
(
$extra
[
'supplier_id'
],
$extra
[
'supplier_code'
],
$extra
,
$isUpdate
);
if
(
$res
)
{
if
(
$res
)
{
$url
=
Config
(
'website.Feer_Robot_Url'
);
$url
=
Config
(
'website.Feer_Robot_Url'
);
$UserModel
=
new
UserModel
();
$UserModel
=
new
UserModel
();
$UserName
=
$UserModel
->
FinduserInfoName
(
$UserInfo
->
userId
);
$UserName
=
$UserModel
->
FinduserInfoName
(
$UserInfo
->
userId
);
$RemindInfo
=
'附加费调整通知'
.
"
\n
"
;
$RemindInfo
=
'附加费调整通知'
.
"
\n
"
;
$RemindInfo
.=
'渠道编码:'
.
$extra
[
'supplier_code'
]
.
"
\n
"
;
$RemindInfo
.=
'渠道编码:'
.
$extra
[
'supplier_code'
]
.
"
\n
"
;
if
(
$FeeInfo
)
{
if
(
$FeeInfo
)
{
$RemindInfo
.=
'原附加费:不满'
.
$FeeInfo
[
'max'
]
.
'收取'
.
$FeeInfo
[
'price'
]
.
"运费
\n
"
;
$RemindInfo
.=
'原附加费:不满'
.
$FeeInfo
[
'max'
]
.
'收取'
.
$FeeInfo
[
'price'
]
.
"运费
\n
"
;
}
}
$RemindInfo
.=
'新附加费:不满'
.
$extra
[
'max'
]
.
'收取'
.
$extra
[
'price'
]
.
"运费
\n
"
;
$RemindInfo
.=
'新附加费:不满'
.
$extra
[
'max'
]
.
'收取'
.
$extra
[
'price'
]
.
"运费
\n
"
;
$RemindInfo
.=
'调整人:'
.
$UserName
;
$RemindInfo
.=
'调整人:'
.
$UserName
;
if
(
config
(
'website.data'
)
==
'http://supplier.ichunt.net'
)
SendRobot
(
$url
,
$RemindInfo
);
if
(
config
(
'website.data'
)
==
'http://supplier.ichunt.net'
)
SendRobot
(
$url
,
$RemindInfo
);
return
[
0
,
'修改成功'
];
return
[
0
,
'修改成功'
];
}
else
{
}
else
{
return
[
11010
,
'修改失败,失败原因:数据库修改更新失败'
];
return
[
11010
,
'修改失败,失败原因:数据库修改更新失败'
];
}
}
}
}
public
function
save_change_extra
(
$data
,
$supplier_code
){
public
function
save_change_extra
(
$data
,
$supplier_code
)
{
$data
[
'status'
]
=
1
;
$data
[
'status'
]
=
1
;
$data
[
'update_time'
]
=
time
();
$data
[
'update_time'
]
=
time
();
$res
=
$this
->
where
(
'supplier_id'
,
'='
,
$data
[
'supplier_id'
])
->
update
(
$data
);
$res
=
$this
->
where
(
'supplier_id'
,
'='
,
$data
[
'supplier_id'
])
->
update
(
$data
);
if
(
!
$res
)
{
if
(
!
$res
)
{
return
false
;
return
false
;
}
}
$this
->
set_change_extra_cache
(
$supplier_code
,
$data
[
'charge_content'
]);
$this
->
set_change_extra_cache
(
$supplier_code
,
$data
[
'charge_content'
]);
return
true
;
return
true
;
}
}
public
function
add_change_extra
(
$data
,
$supplier_code
){
public
function
add_change_extra
(
$data
,
$supplier_code
)
{
$data
[
'status'
]
=
1
;
$data
[
'status'
]
=
1
;
$data
[
'create_time'
]
=
time
();
$data
[
'create_time'
]
=
time
();
$data
[
'update_time'
]
=
time
();
$data
[
'update_time'
]
=
time
();
$res
=
$this
->
insert
(
$data
);
$res
=
$this
->
insert
(
$data
);
if
(
!
$res
)
{
if
(
!
$res
)
{
return
false
;
return
false
;
}
}
$this
->
set_change_extra_cache
(
$supplier_code
,
$data
[
'charge_content'
]);
$this
->
set_change_extra_cache
(
$supplier_code
,
$data
[
'charge_content'
]);
...
@@ -169,22 +176,17 @@ class SupplierExtendModel extends Model
...
@@ -169,22 +176,17 @@ class SupplierExtendModel extends Model
return
[];
return
[];
}
}
$record
=
self
::
where
(
'supplier_id'
,
$supplierId
)
$record
=
self
::
where
(
'supplier_id'
,
$supplierId
)
->
select
([
'customer_nature'
,
'crm_remark'
])
->
first
();
->
first
();
if
(
!
$record
)
{
return
$record
?
$record
->
toArray
()
:
[];
return
[
'customer_nature'
=>
''
,
'crm_remark'
=>
''
];
}
return
$record
->
toArray
();
}
}
public
function
set_change_extra_cache
(
$supplier_code
,
$charge_content
){
public
function
set_change_extra_cache
(
$supplier_code
,
$charge_content
)
{
$Redis
=
new
RedisModel
();
$Redis
=
new
RedisModel
();
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
// 联营供应商ID是17
// 联营供应商ID是17
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$supplier_code
,
$charge_content
);
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$supplier_code
,
$charge_content
);
return
true
;
return
true
;
}
}
}
}
\ No newline at end of file
resources/views/script/ConfirmCrmSupplierScript.blade.php
View file @
7115c632
...
@@ -7,12 +7,14 @@
...
@@ -7,12 +7,14 @@
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
auditOpinion
=
data
.
field
.
audit_opinion
;
let
auditOpinion
=
data
.
field
.
audit_opinion
;
let
remark
=
data
.
field
.
remark
||
''
;
let
remark
=
data
.
field
.
remark
||
''
;
let
channelUid
=
data
.
field
.
channel_uid
||
''
;
let
url
=
'/api/supplier_crm/AuditCustomerConvertSupplier'
;
let
url
=
'/api/supplier_crm/AuditCustomerConvertSupplier'
;
let
res
=
ajax
(
url
,
{
let
res
=
ajax
(
url
,
{
supplier_id
:
supplierId
,
supplier_id
:
supplierId
,
audit_opinion
:
auditOpinion
,
audit_opinion
:
auditOpinion
,
remark
:
remark
,
remark
:
remark
,
channel_uid
:
channelUid
,
});
});
if
(
!
res
)
{
if
(
!
res
)
{
parent
.
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
parent
.
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
5
});
...
...
resources/views/script/SupplierListScript.blade.php
View file @
7115c632
...
@@ -830,7 +830,7 @@
...
@@ -830,7 +830,7 @@
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
content
:
'/supplier/ConfirmCrmSupplier?view=iframe&supplier_id='
+
supplierId
,
content
:
'/supplier/ConfirmCrmSupplier?view=iframe&supplier_id='
+
supplierId
,
area
:
[
'7
80px
'
,
'720px'
],
area
:
[
'7
0%
'
,
'720px'
],
title
:
'转化供应商确认'
,
title
:
'转化供应商确认'
,
end
:
function
()
{
end
:
function
()
{
table
.
reload
(
'list'
);
table
.
reload
(
'list'
);
...
@@ -952,7 +952,8 @@
...
@@ -952,7 +952,8 @@
let
$this
=
$
(
this
);
let
$this
=
$
(
this
);
let
supplierId
=
$this
.
data
(
'supplier-id'
);
let
supplierId
=
$this
.
data
(
'supplier-id'
);
let
status
=
$this
.
data
(
'status'
);
let
status
=
$this
.
data
(
'status'
);
if
(
status
!==
1
)
{
// 审核中(1)和待确认(4)状态显示审批节点
if
(
status
!==
1
&&
status
!==
4
)
{
return
;
return
;
}
}
...
...
resources/views/web/ConfirmCrmSupplier.blade.php
View file @
7115c632
...
@@ -2,14 +2,17 @@
...
@@ -2,14 +2,17 @@
.layui-form-item
{
.layui-form-item
{
margin-bottom
:
8px
;
margin-bottom
:
8px
;
}
}
.require
{
.require
{
color
:
red
;
color
:
red
;
}
}
.info-label
{
.info-label
{
padding-top
:
7px
;
padding-top
:
7px
;
line-height
:
28px
;
line-height
:
28px
;
word-break
:
break-all
;
word-break
:
break-all
;
}
}
</style>
</style>
<div
class=
"layui-card"
style=
"margin: 0"
>
<div
class=
"layui-card"
style=
"margin: 0"
>
<div
class=
"layui-card-body"
style=
"padding: 20px 20px 10px;"
>
<div
class=
"layui-card-body"
style=
"padding: 20px 20px 10px;"
>
...
@@ -22,27 +25,46 @@
...
@@ -22,27 +25,46 @@
<label
class=
"layui-form-label"
>
供应商名称 :
</label>
<label
class=
"layui-form-label"
>
供应商名称 :
</label>
<div
class=
"layui-input-block block-42 info-label"
>
<div
class=
"layui-input-block block-42 info-label"
>
{{$supplier['supplier_name']}}
{{$supplier['supplier_name']}}
<a
style=
"color: dodgerblue;margin-left: 20px"
<a
style=
"color: dodgerblue;margin-left: 20px"
ew-href=
"/supplier/SupplierDetail?view=iframe&supplier_id={{$supplier['supplier_id']}}"
ew-title=
'供应商详情 - {{$supplier['
supplier_code
']}}'
>
{{$supplier['supplier_code']}}
</a>
ew-href=
"/supplier/SupplierDetail?view=iframe&supplier_id={{$supplier['supplier_id']}}"
ew-title=
'供应商详情 - {{$supplier['
supplier_code
']}}'
>
{{$supplier['supplier_code']}}
</a>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
客户性质 :
</label>
<div
class=
"layui-col-sm4"
>
<div
class=
"layui-input-block block-42 info-label"
>
<label
class=
"layui-form-label"
>
客户性质 :
</label>
{{$customer_nature ?: '无'}}
<div
class=
"layui-input-block block-42 info-label"
>
{{$customer_nature ?: '无'}}
</div>
</div>
<div
class=
"layui-col-sm4"
>
<label
class=
"layui-form-label"
>
逆向采购员 :
</label>
<div
class=
"layui-input-block block-42 info-label"
>
{{$reverse_purchaser ?: '无'}}
</div>
</div>
<div
class=
"layui-col-sm4"
>
<label
class=
"layui-form-label"
style=
"width:150px;margin-left:-50px"
>
销售转化供应商备注 :
</label>
<div
class=
"layui-input-block block-42 info-label"
>
{{$crm_remark ?: '无'}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
销售转化供应商备注 :
</label>
<div
class=
"layui-col-sm6"
>
<div
class=
"layui-input-block block-42 info-label"
>
<label
class=
"layui-form-label"
>
审核内容 :
</label>
{{$crm_remark ?: '无'}}
<div
class=
"layui-input-block block-42 info-label"
>
CRM提交转化供应商申请
</div>
</div>
<div
class=
"layui-col-sm6"
>
@inject('statusPresenter','App\Presenters\StatusPresenter')
{!! $statusPresenter->render('channel_uid','指定采购员 : ',null,
$userCodes,['required'=>true,'width'=>'150px']) !!}
</div>
</div>
</div>
</div>
<blockquote
class=
"layui-elem-quote layui-text"
>
<blockquote
class=
"layui-elem-quote layui-text"
>
<b>
审核
</b>
<b>
审核
</b>
</blockquote>
</blockquote>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
审核意见 :
</label>
<label
class=
"layui-form-label"
><span
class=
"require"
>
*
</span>
审核意见 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
...
@@ -53,17 +75,14 @@
...
@@ -53,17 +75,14 @@
<div
class=
"layui-form-item layui-form-text"
>
<div
class=
"layui-form-item layui-form-text"
>
<label
class=
"layui-form-label"
>
原因说明 :
</label>
<label
class=
"layui-form-label"
>
原因说明 :
</label>
<div
class=
"layui-input-block"
>
<div
class=
"layui-input-block"
>
<textarea
name=
"remark"
placeholder=
"请输入原因说明(选填)"
class=
"layui-textarea"
<textarea
name=
"remark"
placeholder=
"请输入原因说明(选填)"
class=
"layui-textarea"
style=
"min-height: 80px;"
></textarea>
style=
"min-height: 80px;"
></textarea>
</div>
</div>
</div>
</div>
<div
class=
"layui-form-item"
>
<div
class=
"layui-form-item"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<div
align=
"center"
style=
"margin-top: 20px;text-align: right"
>
<button
type=
"button"
class=
"layui-btn layui-btn-info submit-loading"
lay-submit
<button
type=
"button"
class=
"layui-btn layui-btn-info submit-loading"
lay-submit
lay-filter=
"confirmCrmSupplier"
>
确定
lay-filter=
"confirmCrmSupplier"
>
确定
</button>
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-primary"
lay-submit
<button
type=
"button"
class=
"layui-btn layui-btn-primary"
lay-submit
lay-filter=
"cancel"
>
取消
lay-filter=
"cancel"
>
取消
</button>
</button>
</div>
</div>
</div>
</div>
...
...
resources/views/web/SupplierList.blade.php
View file @
7115c632
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
@if(checkPerm('TransferSupplier'))
@if(checkPerm('TransferSupplier'))
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
transfer_supplier
">供应商交接</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
transfer_supplier
">供应商交接</button>
@endif
@endif
@if(checkPerm('ConfirmCrmSupplier'))
@if(checkPerm('ConfirmCrmSupplier')
&& checkPerm('ViewConfirmSupplier')
)
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
confirm_crm_supplier
">确认客户转化供应商</button>
<button type="
button
" class="
layui
-
btn
layui
-
btn
-
sm
" id="
confirm_crm_supplier
">确认客户转化供应商</button>
@endif
@endif
</div>
</div>
...
...
storage/framework/views/5238497145456f693cc29f1fe0a7ff8fb43fd269.php
View file @
7115c632
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
<?php
if
(
checkPerm
(
'TransferSupplier'
))
:
?>
<?php
if
(
checkPerm
(
'TransferSupplier'
))
:
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"transfer_supplier"
>
供应商交接
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"transfer_supplier"
>
供应商交接
</button>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
checkPerm
(
'ConfirmCrmSupplier'
))
:
?>
<?php
if
(
checkPerm
(
'ConfirmCrmSupplier'
)
&&
checkPerm
(
'ViewConfirmSupplier'
)
)
:
?>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"confirm_crm_supplier"
>
确认客户转化供应商
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-sm"
id=
"confirm_crm_supplier"
>
确认客户转化供应商
</button>
<?php
endif
;
?>
<?php
endif
;
?>
</div>
</div>
...
...
storage/framework/views/d4d13e9bcdea7366e4952031431aae4b22f055c1.php
View file @
7115c632
...
@@ -830,7 +830,7 @@
...
@@ -830,7 +830,7 @@
layer
.
open
({
layer
.
open
({
type
:
2
,
type
:
2
,
content
:
'/supplier/ConfirmCrmSupplier?view=iframe&supplier_id='
+
supplierId
,
content
:
'/supplier/ConfirmCrmSupplier?view=iframe&supplier_id='
+
supplierId
,
area
:
[
'7
80px
'
,
'720px'
],
area
:
[
'7
0%
'
,
'720px'
],
title
:
'转化供应商确认'
,
title
:
'转化供应商确认'
,
end
:
function
()
{
end
:
function
()
{
table
.
reload
(
'list'
);
table
.
reload
(
'list'
);
...
@@ -952,7 +952,8 @@
...
@@ -952,7 +952,8 @@
let
$this
=
$
(
this
);
let
$this
=
$
(
this
);
let
supplierId
=
$this
.
data
(
'supplier-id'
);
let
supplierId
=
$this
.
data
(
'supplier-id'
);
let
status
=
$this
.
data
(
'status'
);
let
status
=
$this
.
data
(
'status'
);
if
(
status
!==
1
)
{
// 审核中(1)和待确认(4)状态显示审批节点
if
(
status
!==
1
&&
status
!==
4
)
{
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment