Browse Source

(*)客户联系人跟进表

master
ww664853070 2 years ago
parent
commit
2e9d2b35e6
  1. 23
      api/app/lib/controllers/customerContactsFollup/index.js
  2. 65
      api/app/lib/models/customerContactsFollup.js
  3. 8
      api/app/lib/routes/customerContactsFollup/index.js

23
api/app/lib/controllers/customerContactsFollup/index.js

@ -0,0 +1,23 @@
'use strict';
// 查询储备项目统计表
async function getCustomerContactsFollowup(ctx, next) {
const { type } = ctx.params;
let rslt = null;
try {
rslt = await ctx.fs.dc.models.ReserveItemReport.findAll({
order: [['id', 'DESC']],
// where: { type: type }
})
ctx.status = 200
ctx.body = rslt
} catch (error) {
ctx.fs.logger.error(`path:${ctx.path},error:${error}`)
ctx.status = 400;
ctx.body = { name: 'FindAllError', message: '获取失败' }
}
}
module.exports = {
getCustomerContactsFollowup
}

65
api/app/lib/models/customerContactsFollup.js

@ -0,0 +1,65 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ReserveItemReport = sequelize.define("reserveItemReport", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
field: "id",
autoIncrement: true,
},
customer: {
type: DataTypes.STRING,
allowNull: true,
field: "customer",
},
items: {
type: DataTypes.STRING,
allowNull: true,
field: "items",
},
department: {
type: DataTypes.STRING,
allowNull: false,
field: "department",
},
sale: {
type: DataTypes.STRING,
allowNull: true,
field: "sale",
},
updatetime: {
type: DataTypes.DATE,
allowNull: false,
field: "updatetime",
},
customerContacts: {
type: DataTypes.STRING,
allowNull: true,
field: "customer_contacts",
},
phone: {
type: DataTypes.STRING,
allowNull: true,
field: "phone",
},
visitStyle: {
type: DataTypes.STRING,
allowNull: true,
field: "visit_style",
},
itemText: {
type: DataTypes.STRING,
allowNull: true,
field: "item_text",
}
}, {
tableName: "customer_contacts_followup",
});
dc.models.ReserveItemReport = ReserveItemReport;
return ReserveItemReport;
};

8
api/app/lib/routes/customerContactsFollup/index.js

@ -0,0 +1,8 @@
'use strict';
const report = require('../../controllers/customerContactsFollup');
module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/customerContactsFollup'] = { content: '客户联系人对接跟进', visible: false };
router.get('/customerContactsFollup', report.getReserveItemReport);
};
Loading…
Cancel
Save