16 changed files with 644 additions and 316 deletions
			
			
		| @ -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 | ||||
|  | } | ||||
| @ -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; | ||||
|  | }; | ||||
| @ -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…
					
					
				
		Reference in new issue