Commit fde91e50 by Sxy

fix:订单自动分配业务员

parent decf2668
...@@ -556,7 +556,7 @@ class UserService extends ServiceBase { ...@@ -556,7 +556,7 @@ class UserService extends ServiceBase {
const users = companyFind.us; const users = companyFind.us;
const cansels = users.filter((u) => { const cansels = users.filter((u) => {
if (regionName && regionName != '' && u.regiontags) { if (regionName && regionName != '' && u.regiontags) {
if (u.isAllocated && u.isDelivery && u.skilltags.indexOf(productCatName) >= 0) { if (u.isAllocated && u.isSalesman && u.skilltags.indexOf(productCatName) >= 0) {
if (u.regiontags.indexOf(regionName) >= 0 || u.isAllArea) { if (u.regiontags.indexOf(regionName) >= 0 || u.isAllArea) {
return true; return true;
} }
...@@ -564,12 +564,12 @@ class UserService extends ServiceBase { ...@@ -564,12 +564,12 @@ class UserService extends ServiceBase {
} }
return false; return false;
} }
if (u.isAllocated && u.isDelivery && u.isAllArea && u.skilltags.indexOf(productCatName) >= 0) { if (u.isAllocated && u.isSalesman && u.isAllArea && u.skilltags.indexOf(productCatName) >= 0) {
return true; return true;
} }
return false; return false;
}); });
console.log(`getBizUserForDelivery可以接单的交付员:${JSON.stringify(cansels)}服务商id:${companyFind.id}`); console.log(`getBizUserForDelivery可以接单的业务员:${JSON.stringify(cansels)}服务商id:${companyFind.id}`);
const lngth = cansels.length; const lngth = cansels.length;
if (lngth > 0) { if (lngth > 0) {
const randindex = Math.floor(Math.random() * lngth); const randindex = Math.floor(Math.random() * lngth);
......
...@@ -70,7 +70,7 @@ class TxHandler { ...@@ -70,7 +70,7 @@ class TxHandler {
if (salesmanInfo.userInfo && salesmanInfo.userInfo != 'undefined') { if (salesmanInfo.userInfo && salesmanInfo.userInfo != 'undefined') {
params.salesmanOpcode = salesmanInfo.userInfo.opath; params.salesmanOpcode = salesmanInfo.userInfo.opath;
params.salesmanId = salesmanInfo.userInfo.userId; params.salesmanId = salesmanInfo.userInfo.userId;
params.clerkName = salesmanInfo.userInfo.userName; params.clerkName = salesmanInfo.userInfo.nickName || salesmanInfo.userInfo.userName;
params.clerkPhone = system.encryptStr(salesmanInfo.userInfo.mobile); params.clerkPhone = system.encryptStr(salesmanInfo.userInfo.mobile);
} }
const rtn = await rc.execPost3({ d: params }, requrl); const rtn = await rc.execPost3({ d: params }, requrl);
...@@ -259,7 +259,7 @@ class TxHandler { ...@@ -259,7 +259,7 @@ class TxHandler {
if (salesmanInfo.userInfo && salesmanInfo.userInfo != 'undefined') { if (salesmanInfo.userInfo && salesmanInfo.userInfo != 'undefined') {
params.clerkOpcode = salesmanInfo.userInfo.opath; params.clerkOpcode = salesmanInfo.userInfo.opath;
params.clerkId = salesmanInfo.userInfo.userId; params.clerkId = salesmanInfo.userInfo.userId;
params.clerkName = salesmanInfo.userInfo.userName; params.clerkName = salesmanInfo.userInfo.nickName || salesmanInfo.userInfo.userName;
// params.clerkPhone = salesmanInfo.userInfo.mobile; // params.clerkPhone = salesmanInfo.userInfo.mobile;
params.baseInfo.clerkName = salesmanInfo.userInfo.userName; params.baseInfo.clerkName = salesmanInfo.userInfo.userName;
// params.baseInfo.clerkPhone = salesmanInfo.userInfo.mobile // params.baseInfo.clerkPhone = salesmanInfo.userInfo.mobile
......
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 to comment