Browse Source

(+)合同明细表、开票明细表模型

master
zmh 2 years ago
parent
commit
8e1275fa5a
  1. 430
      api/app/lib/models/contract_detail.js
  2. 196
      api/app/lib/models/invoice_detail.js
  3. 1
      api/package.json
  4. 10
      api/sequelize-automate.config.js
  5. 128
      web/client/src/sections/business/constants/index.js

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

@ -0,0 +1,430 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const ContractDetail = sequelize.define("contractDetail", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: true
},
year: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "年度",
primaryKey: false,
field: "year ",
autoIncrement: false
},
serialNo: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "序号",
primaryKey: false,
field: "serial_no",
autoIncrement: false
},
number: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "编号",
primaryKey: false,
field: "number",
autoIncrement: false
},
introduction: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "简介",
primaryKey: false,
field: "introduction",
autoIncrement: false
},
contractNo: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "合同编号",
primaryKey: false,
field: "contract_no",
autoIncrement: false
},
applyDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "申请日期",
primaryKey: false,
field: "apply_date",
autoIncrement: false
},
recConDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "收到合同日期",
primaryKey: false,
field: "rec_con_date",
autoIncrement: false
},
contractPaper: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "合同纸质版情况",
primaryKey: false,
field: "contract_paper",
autoIncrement: false
},
contractElec: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "合同电子版情况",
primaryKey: false,
field: "contract_elec",
autoIncrement: false
},
department: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "部门",
primaryKey: false,
field: "department",
autoIncrement: false
},
business: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "业务线",
primaryKey: false,
field: "business",
autoIncrement: false
},
sale: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "销售人员",
primaryKey: false,
field: "sale",
autoIncrement: false
},
customer: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "客户名称",
primaryKey: false,
field: "customer",
autoIncrement: false
},
item: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目名称",
primaryKey: false,
field: "item",
autoIncrement: false
},
itemType: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目类型",
primaryKey: false,
field: "item_type",
autoIncrement: false
},
amount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "合同金额",
primaryKey: false,
field: "amount",
autoIncrement: false
},
changeAmount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "变更后合同金额",
primaryKey: false,
field: "change_amount",
autoIncrement: false
},
cInvoicedAmount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "累计开票金额",
primaryKey: false,
field: "c_invoiced_amount",
autoIncrement: false
},
cBackAmount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "累计回款金额",
primaryKey: false,
field: "c_back_amount",
autoIncrement: false
},
invoicedBack: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "开票-回款",
primaryKey: false,
field: "invoiced_back",
autoIncrement: false
},
unInvoicedAmount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "未开票金额",
primaryKey: false,
field: "un_invoiced_amount",
autoIncrement: false
},
remainConAmount: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "剩余合同金额",
primaryKey: false,
field: "remain_con_amount",
autoIncrement: false
},
backPercent: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "回款率",
primaryKey: false,
field: "back_percent",
autoIncrement: false
},
retentionMoney: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "质保金",
primaryKey: false,
field: "retention_money",
autoIncrement: false
},
retentionPercent: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "质保金比例",
primaryKey: false,
field: "retention_percent",
autoIncrement: false
},
retentionTerm: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "质保期",
primaryKey: false,
field: "retention_term",
autoIncrement: false
},
invoiceTax1: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "发票税率金额",
primaryKey: false,
field: "invoice_tax1",
autoIncrement: false
},
invoiceTax2: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "invoice_tax2",
autoIncrement: false
},
invoiceTax3: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "invoice_tax3",
autoIncrement: false
},
payType: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "合同付款方式",
primaryKey: false,
field: "pay_type",
autoIncrement: false
},
cost: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "预支提成及委外费用",
primaryKey: false,
field: "cost",
autoIncrement: false
},
performanceRatio: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "业绩折算比例",
primaryKey: false,
field: "performance_ratio",
autoIncrement: false
},
realPerformance: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "实际业绩",
primaryKey: false,
field: "real_performance",
autoIncrement: false
},
assessmentPerformance: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "考核业绩",
primaryKey: false,
field: "assessment_performance",
autoIncrement: false
},
acceptanceDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "验收日期",
primaryKey: false,
field: "acceptance_date",
autoIncrement: false
},
backConfirmDate: {
type: DataTypes.DATEONLY,
allowNull: true,
defaultValue: null,
comment: "收入确认时间",
primaryKey: false,
field: "back_confirm_date",
autoIncrement: false
},
recYear: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "接单年份",
primaryKey: false,
field: "rec_year",
autoIncrement: false
},
recMonth: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "接单月份",
primaryKey: false,
field: "rec_month",
autoIncrement: false
},
cusAttribute: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "客户属性",
primaryKey: false,
field: "cus_attribute",
autoIncrement: false
},
cusType: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "客户类型",
primaryKey: false,
field: "cus_type",
autoIncrement: false
},
industry: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "行业",
primaryKey: false,
field: "industry",
autoIncrement: false
},
source: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "信息来源",
primaryKey: false,
field: "source",
autoIncrement: false
},
cusProvince: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "客户省份",
primaryKey: false,
field: "cus_province",
autoIncrement: false
},
cusArea: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "项目所在地",
primaryKey: false,
field: "cus_area",
autoIncrement: false
},
text: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "text",
autoIncrement: false
}
}, {
tableName: "contract_detail",
comment: "",
indexes: []
});
dc.models.ContractDetail = ContractDetail;
return ContractDetail;
};

196
api/app/lib/models/invoice_detail.js

@ -0,0 +1,196 @@
/* eslint-disable*/
'use strict';
module.exports = dc => {
const DataTypes = dc.ORM;
const sequelize = dc.orm;
const InvoiceDetail = sequelize.define("invoiceDetail", {
id: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: true,
field: "id",
autoIncrement: false
},
year: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "年度:【申请日期】-年份",
primaryKey: false,
field: "year",
autoIncrement: false
},
serialNo: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: null,
comment: "序号:自动生成\n(自动升序),每一年自动从1开始",
primaryKey: false,
field: "serial_no",
autoIncrement: false
},
number: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "编号:年份+序号 如2022年1",
primaryKey: false,
field: "number",
autoIncrement: false
},
department: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "部门:申请部门",
primaryKey: false,
field: "department",
autoIncrement: false
},
sale: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "销售人员:申请人",
primaryKey: false,
field: "sale",
autoIncrement: false
},
contractNo: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "合同编号",
primaryKey: false,
field: "contract_no",
autoIncrement: false
},
customer: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "客户名称:【甲方名称】",
primaryKey: false,
field: "customer",
autoIncrement: false
},
item: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "项目名称",
primaryKey: false,
field: "item",
autoIncrement: false
},
amount: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "合同金额:【合同金额\n(元)】",
primaryKey: false,
field: "amount",
autoIncrement: false
},
changeAmount: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "变更后合同金额",
primaryKey: false,
field: "change_amount",
autoIncrement: false
},
invoiceNo: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "发票号码:《发票申请单》【发票号】一个发票号码一个行数据",
primaryKey: false,
field: "invoice_no",
autoIncrement: false
},
invoiceType: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "开票类型:《发票申请单》\n【发票类型】",
primaryKey: false,
field: "invoice_type",
autoIncrement: false
},
invoiceDate: {
type: DataTypes.DATEONLY,
allowNull: false,
defaultValue: null,
comment: "开票日期:《发票申请单》\n【开票日期】",
primaryKey: false,
field: "invoice_date",
autoIncrement: false
},
invoiceAmount: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "开票金额:《发票申请单》【发票金额】取财务填写数据",
primaryKey: false,
field: "invoice_amount",
autoIncrement: false
},
outputTax: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "销项税额:《发票申请单》-销项税额",
primaryKey: false,
field: "output_tax",
autoIncrement: false
},
total: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "合计:自动算出\n(开票金额+销项税额)",
primaryKey: false,
field: "total",
autoIncrement: false
},
taxRate13: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "税率13%:《发票申请单》",
primaryKey: false,
field: "tax_rate13",
autoIncrement: false
},
taxRate9: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "税率9%:《发票申请单》",
primaryKey: false,
field: "tax_rate9",
autoIncrement: false
},
taxRate6: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "税率6%:《发票申请单》",
primaryKey: false,
field: "tax_rate6",
autoIncrement: false
}
}, {
tableName: "invoice_detail",
comment: "",
indexes: []
});
dc.models.InvoiceDetail = InvoiceDetail;
return InvoiceDetail;
};

1
api/package.json

@ -33,6 +33,7 @@
"pg": "^7.9.0", "pg": "^7.9.0",
"redis": "^3.1.2", "redis": "^3.1.2",
"request": "^2.88.2", "request": "^2.88.2",
"sequelize-automate-freesun": "^1.2.2",
"superagent": "^3.5.2", "superagent": "^3.5.2",
"uuid": "^3.3.2" "uuid": "^3.3.2"
}, },

10
api/sequelize-automate.config.js

@ -1,11 +1,11 @@
module.exports = { module.exports = {
// 数据库配置 与 sequelize 相同 // 数据库配置 与 sequelize 相同
dbOptions: { dbOptions: {
database: 'hr-dev', database: 'data_center',
username: 'postgres', username: 'FashionAdmin',
password: '123', password: '123456',
dialect: 'postgres', dialect: 'postgres',
host: '10.8.30.166', host: '10.8.30.36',
port: 5432, port: 5432,
define: { define: {
underscored: false, underscored: false,
@ -26,7 +26,7 @@ module.exports = {
dir: './app/lib/models', // 指定输出 models 文件的目录 dir: './app/lib/models', // 指定输出 models 文件的目录
typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义 typesDir: 'models', // 指定输出 TypeScript 类型定义的文件目录,只有 TypeScript / Midway 等会有类型定义
emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir` emptyDir: false, // !!! 谨慎操作 生成 models 之前是否清空 `dir` 以及 `typesDir`
tables: ['overtime_day','vacate_day'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性 tables: ['contract_detail', 'invoice_detail'], // 指定生成哪些表的 models,如 ['user', 'user_post'];如果为 null,则忽略改属性
skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性 skipTables: [], // 指定跳过哪些表的 models,如 ['user'];如果为 null,则忽略改属性
tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中 tsNoCheck: false, // 是否添加 `@ts-nocheck` 注释到 models 文件中
ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面 ignorePrefix: [], // 生成的模型名称忽略的前缀,因为 项目中有以下表名是以 t_ 开头的,在实际模型中不需要, 可以添加多个 [ 't_data_', 't_',] ,长度较长的 前缀放前面

128
web/client/src/sections/business/constants/index.js

@ -4,71 +4,71 @@ export const RESERVEITEM_TYPE = {
lostStatistic: 3 lostStatistic: 3
} }
export const contractDetailsColumnKeys = { export const contractDetailsColumnKeys = {
a1: '年度', year: '年度',
a2: '序号', serialNo: '序号',
a3: '编号', number: '编号',
a4: '简介', introduction: '简介',
a5: '合同编号', contractNo: '合同编号',
a6: '申请日期', applyDate: '申请日期',
a7: '收到合同日期', recConDate: '收到合同日期',
a8: '合同纸质版情况', contractPaper: '合同纸质版情况',
a9: '合同电子版情况', contractElec: '合同电子版情况',
a10: '部门', department: '部门',
a11: '业务线', business: '业务线',
a12: '销售人员', sale: '销售人员',
a13: '客户名称', customer: '客户名称',
a14: '项目名称', item: '项目名称',
a15: '项目类型', itemType: '项目类型',
a16: '合同金额', amount: '合同金额',
a17: '变更后合同金额', changeAmount: '变更后合同金额',
a18: '累计开票金额', cInvoicedAmount: '累计开票金额',
a19: '累计回款金额', cBackAmount: '累计回款金额',
a20: '开票-回款', invoicedBack: '开票-回款',
a21: '未开票金额', unInvoicedAmount: '未开票金额',
a22: '剩余合同金额', remainConAmount: '剩余合同金额',
a23: '回款率', backPercent: '回款率',
a24: '质保金', retentionMoney: '质保金',
a25: '质保金比例', retentionPercent: '质保金比例',
a26: '质保期', retentionTerm: '质保期',
a27: '发票税率金额13%', invoiceTax1: '发票税率金额13%',
a28: '发票税率金额9%', invoiceTax2: '发票税率金额9%',
a29: '发票税率金额6%', invoiceTax3: '发票税率金额6%',
a30: '合同付款方式', payType: '合同付款方式',
a31: '预支提成及委外费用', cost: '预支提成及委外费用',
a32: '业绩折算比例', performanceRatio: '业绩折算比例',
a33: '实际业绩', realPerformance: '实际业绩',
a34: '考核业绩', assessmentPerformance: '考核业绩',
a35: '验收日期', acceptanceDate: '验收日期',
a36: '收入确认时间', backConfirmDate: '收入确认时间',
a37: '接单年份', recYear: '接单年份',
a38: '接单月份', recMonth: '接单月份',
a39: '客户属性', cusAttribute: '客户属性',
a40: '客户类型', cusType: '客户类型',
a41: '行业', industry: '行业',
a42: '信息来源', source: '信息来源',
a43: '客户省份', cusProvince: '客户省份',
a44: '项目所在地', cusArea: '项目所在地',
a45: '备注', text: '备注',
} }
export const invoicingDetailsColumnKeys = { export const invoicingDetailsColumnKeys = {
a1: '年度', year: '年度',
a2: '序号', serialNo: '序号',
a3: '编号', number: '编号',
a4: '部门', department: '部门',
a5: '销售人员', sale: '销售人员',
a6: '合同编号', contractNo: '合同编号',
a7: '客户名称', customer: '客户名称',
a8: '项目名称', item: '项目名称',
a9: '合同金额', amount: '合同金额',
a10: '变更后合同金额', changeAmount: '变更后合同金额',
a11: '发票号码', invoiceNo: '发票号码',
a12: '开票类型', invoiceType: '开票类型',
a13: '开票日期', invoiceDate: '开票日期',
a14: '开票金额', invoiceAmount: '开票金额',
a15: '销项税额', outputTax: '销项税额',
a16: '合计', total: '合计',
a17: '税率13%', taxRate13: '税率13%',
a18: '税率9%', taxRate9: '税率9%',
a19: '税率6%' taxRate6: '税率6%'
} }
Loading…
Cancel
Save