Browse Source

(*)合同明细表字段调整

master
zmh 2 years ago
parent
commit
c2de45a493
  1. 2
      api/app/lib/controllers/report/achievement.js
  2. 35
      api/app/lib/models/contract_detail.js

2
api/app/lib/controllers/report/achievement.js

@ -346,6 +346,7 @@ async function getContractDetail(ctx) {
where[keywordTarget] = { $iLike: `%${keyword}%` }; where[keywordTarget] = { $iLike: `%${keyword}%` };
} }
let contractDetail = await models.ContractDetail.findAndCountAll({ let contractDetail = await models.ContractDetail.findAndCountAll({
attributes: { exclude: ['iscopy', 'hiredate', 'regularDate'] },
where: where, where: where,
offset: Number(page) * Number(limit), offset: Number(page) * Number(limit),
limit: Number(limit), limit: Number(limit),
@ -394,6 +395,7 @@ async function exportContractDetail(ctx) {
try { try {
const { models } = ctx.fs.dc; const { models } = ctx.fs.dc;
let exportData = await models.ContractDetail.findAll({ let exportData = await models.ContractDetail.findAll({
attributes: { exclude: ['iscopy', 'hiredate', 'regularDate'] },
order: [['id', 'ASC']] order: [['id', 'ASC']]
}); });
const { utils: { simpleExcelDown, contractDetailsColumnKeys } } = ctx.app.fs; const { utils: { simpleExcelDown, contractDetailsColumnKeys } } = ctx.app.fs;

35
api/app/lib/models/contract_detail.js

@ -16,12 +16,12 @@ module.exports = dc => {
autoIncrement: true autoIncrement: true
}, },
year: { year: {
type: DataTypes.STRING, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: "年度", comment: "年度",
primaryKey: false, primaryKey: false,
field: "year ", field: "year",
autoIncrement: false autoIncrement: false
}, },
serialNo: { serialNo: {
@ -402,13 +402,13 @@ module.exports = dc => {
field: "cus_province", field: "cus_province",
autoIncrement: false autoIncrement: false
}, },
cusArea: { itemArea: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: "项目所在地", comment: "项目所在地",
primaryKey: false, primaryKey: false,
field: "cus_area", field: "item_area",
autoIncrement: false autoIncrement: false
}, },
text: { text: {
@ -419,6 +419,33 @@ module.exports = dc => {
primaryKey: false, primaryKey: false,
field: "text", field: "text",
autoIncrement: false autoIncrement: false
},
iscopy: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "是否可复制的业务路径",
primaryKey: false,
field: "iscopy",
autoIncrement: false
},
hiredate: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "入职时间",
primaryKey: false,
field: "hiredate",
autoIncrement: false
},
regularDate: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "转正时间",
primaryKey: false,
field: "regular_date",
autoIncrement: false
} }
}, { }, {
tableName: "contract_detail", tableName: "contract_detail",

Loading…
Cancel
Save