Commit 48812800 by Sxy

feat: 新增筛选

parent cd8cda67
......@@ -90,6 +90,20 @@ class DeliverybillDao extends Dao {
delete qc.where.deliveryNumber;
}
if (qc.where.deliveryStatus) {
filters.push({
delivery_status: qc.where.deliveryStatus
});
delete qc.where.deliveryStatus;
}
if (qc.where.setupStatus) {
filters.push({
v_setup_status: qc.where.setupStatus
});
delete qc.where.setupStatus;
}
qc.where["$and"] = filters;
return qw;
}
......@@ -220,9 +234,9 @@ class DeliverybillDao extends Dao {
/**
* 根据服务实例id查找服务所有信息
*/
async findByBizId(pobj){
var oid=pobj.bizId;
return await this.findOne({biz_id:oid});
async findByBizId(pobj) {
var oid = pobj.bizId;
return await this.findOne({ biz_id: oid });
}
}
module.exports = DeliverybillDao;
......@@ -22,6 +22,10 @@ module.exports = (db, DataTypes) => {
allowNull: true,
type: DataTypes.STRING
},
company_name: { // 公司名称-虚拟字段
allowNull: true,
type: DataTypes.STRING
},
v_coname: { // 联系人-虚拟字段
allowNull: true,
type: DataTypes.STRING
......@@ -30,6 +34,10 @@ module.exports = (db, DataTypes) => {
allowNull: true,
type: DataTypes.STRING
},
v_setup_status: {// 公司名称-建账状态
allowNull: true,
type: DataTypes.STRING
},
demand_code: {// 商机编号
allowNull: true,
type: DataTypes.STRING
......@@ -62,14 +70,14 @@ module.exports = (db, DataTypes) => {
allowNull: false,
type: DataTypes.STRING
},
master_source_number:{//主订单号
master_source_number: {//主订单号
allowNull: true,
type: DataTypes.STRING
},
settle_status: {// 服务单流转状态
allowNull: false,
type: DataTypes.STRING,
defaultValue:'waittosettle'
defaultValue: 'waittosettle'
},
selling_price: {//售价
allowNull: true,
......
......@@ -92,7 +92,7 @@ class DeliverybillService extends ServiceBase {
deliveryId: deliverData.id, // id
deliveryNumber: deliverData.delivery_code, // 交付单编号
companyName: deliverData.delivery_info.companyName,// 企业名称
uscc: deliverData.delivery_info.uscc, //统一信用代码
uscc: deliverData.delivery_info.creditCode, //统一信用代码
taxpayerType: delivery_info.taxpayerType, //纳税人类型 1 一般;2 小规模
//会计准侧
companyBizType: delivery_info.companyBizType,// 公司类型 1-商贸型;2-服务型;3-特殊行业;4-其他
......@@ -377,48 +377,48 @@ class DeliverybillService extends ServiceBase {
});
}
//根据bizId查询deliverybill表中的所有信息
async getInfo(pobj){
let result={};
async getInfo(pobj) {
let result = {};
let deliveryBillInfo = await this.dao.findByBizId(pobj);
// console.log("gggg"+deliveryBillInfo+pobj.bizId)
if(!deliveryBillInfo){
if (!deliveryBillInfo) {
throw new Error("没有服务信息");
}
//封装deliverybill表数据
result.deliveryBillInfo={
deliveryCode:deliveryBillInfo.delivery_code,//交付单编号
sourceNumber:deliveryBillInfo.source_number,//渠道来源编号
demandCode:deliveryBillInfo.demand_code,//商机编号
skuCode:deliveryBillInfo.sku_code,//sku编号
schemeNumber:deliveryBillInfo.scheme_number,//方案编号
productCode:deliveryBillInfo.product_code,//产品编码
productName:deliveryBillInfo.product_name,//产品名称
serviceAddress:deliveryBillInfo.service_address,//服务地区
deliveryInfo:deliveryBillInfo.delivery_info,//交付单详情
payStatus:deliveryBillInfo.pay_status,//交付状态-虚拟字段
vConame:deliveryBillInfo.v_coname,//联系人-虚拟字段
vCophone:deliveryBillInfo.v_cophone,//联系电话-虚拟字段
delivery_status:deliveryBillInfo.delivery_status,//交付单状态
sellingPrice:deliveryBillInfo.selling_price,//交付单价格
costPrice:deliveryBillInfo.cost_price,//成本价
closeReason:deliveryBillInfo.close_reason,//状态为关闭原因
facilitatorId:deliveryBillInfo.facilitator_id,//服务商id
facilitatorName:deliveryBillInfo.facilitator_name,//服务商名称
salesmanOpcode:deliveryBillInfo.salesman_opcode,//业务员opcode
salesmanId:deliveryBillInfo.salesman_id,//业务员id
salesmanName:deliveryBillInfo.salesman_name,//业务员名称
salesmanPhone:deliveryBillInfo.salesman_phone,//业务员联系方式
sourceName:deliveryBillInfo.source_name,//渠道名称
createdAt:deliveryBillInfo.created_at,//创建时间
updatedAt:deliveryBillInfo.updated_at,//更新时间
version:deliveryBillInfo.version,//o
masterSourceNumber:deliveryBillInfo.master_source_number,//主来源单
settleStatus:deliveryBillInfo.settle_status,//结算状态
settlebillId:deliveryBillInfo.settlebill_id,//结算单id
deliveryManId:deliveryBillInfo.delivery_man_id,//销售员id
deliveryManName:deliveryBillInfo.delivery_man_name,//销售员姓名
deliveryManOpcode:deliveryBillInfo.delivery_man_opcode,//销售员opcode
bizId:pobj.bizId//融易算-服务实例id
result.deliveryBillInfo = {
deliveryCode: deliveryBillInfo.delivery_code,//交付单编号
sourceNumber: deliveryBillInfo.source_number,//渠道来源编号
demandCode: deliveryBillInfo.demand_code,//商机编号
skuCode: deliveryBillInfo.sku_code,//sku编号
schemeNumber: deliveryBillInfo.scheme_number,//方案编号
productCode: deliveryBillInfo.product_code,//产品编码
productName: deliveryBillInfo.product_name,//产品名称
serviceAddress: deliveryBillInfo.service_address,//服务地区
deliveryInfo: deliveryBillInfo.delivery_info,//交付单详情
payStatus: deliveryBillInfo.pay_status,//交付状态-虚拟字段
vConame: deliveryBillInfo.v_coname,//联系人-虚拟字段
vCophone: deliveryBillInfo.v_cophone,//联系电话-虚拟字段
delivery_status: deliveryBillInfo.delivery_status,//交付单状态
sellingPrice: deliveryBillInfo.selling_price,//交付单价格
costPrice: deliveryBillInfo.cost_price,//成本价
closeReason: deliveryBillInfo.close_reason,//状态为关闭原因
facilitatorId: deliveryBillInfo.facilitator_id,//服务商id
facilitatorName: deliveryBillInfo.facilitator_name,//服务商名称
salesmanOpcode: deliveryBillInfo.salesman_opcode,//业务员opcode
salesmanId: deliveryBillInfo.salesman_id,//业务员id
salesmanName: deliveryBillInfo.salesman_name,//业务员名称
salesmanPhone: deliveryBillInfo.salesman_phone,//业务员联系方式
sourceName: deliveryBillInfo.source_name,//渠道名称
createdAt: deliveryBillInfo.created_at,//创建时间
updatedAt: deliveryBillInfo.updated_at,//更新时间
version: deliveryBillInfo.version,//o
masterSourceNumber: deliveryBillInfo.master_source_number,//主来源单
settleStatus: deliveryBillInfo.settle_status,//结算状态
settlebillId: deliveryBillInfo.settlebill_id,//结算单id
deliveryManId: deliveryBillInfo.delivery_man_id,//销售员id
deliveryManName: deliveryBillInfo.delivery_man_name,//销售员姓名
deliveryManOpcode: deliveryBillInfo.delivery_man_opcode,//销售员opcode
bizId: pobj.bizId//融易算-服务实例id
}
return result;
}
......
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