You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

158 lines
3.0 KiB

'use strict';
module.exports = app => {
const mongoose = app.mongoose;
const Schema = mongoose.Schema;
const DingdanSchema = new Schema({
// 创建时间
create_at: {
type: Date,
default: Date.now
},
// 更新时间
update_at: {
type: Date,
default: Date.now
},
// 客户编号
kehubianhao: {
type: String,
default: ""
},
// 简称
username: {
type: String,
default: ""
},
// 客户名称
kehumingcheng: {
type: String,
default: ""
},
// 产品代码
chanpindaima: {
type: String,
default: ""
},
// 厂编
changbian: {
type: String,
default: ""
},
// 货号
huohao: {
type: String,
default: ""
},
// 单据单位数量
danjudanweishuliang: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 条码
tiaoma: {
type: String,
default: ""
},
// 最小单位条码
zuixiaodanweitiaoma: {
type: String,
default: ""
},
// 修改后销售数量
xiugaihouxiaoshoushuliang: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最高采购价
zuigaocaigoujia: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 箱装量
xiangzhuangliang: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 最大箱装量
zuidaxiangzhuangliang: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 规格型号
guigexinghao: {
type: String,
default: ""
},
// 计量单位
jiliangdanwei: {
type: String,
default: ""
},
// 箱条码
xiangtiaoma: {
type: String,
default: ""
},
// 最大箱条码
zuidaxiangtiaoma: {
type: String,
default: ""
},
// 条码
tiaoma: {
type: String,
default: ""
},
// 品名
pinming: {
type: String,
default: ""
},
// 品名选项
pinmingxuanxiang: {
type: Array,
default: []
},
// 单位
danwei: {
type: String,
default: ""
},
// 规格
guige: {
type: String,
default: ""
},
// 销售数量
xiaoshoushuliang: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
// 销售金额
xiaoshoujine: {
type: Number,
default: 0,
set: (val) => { return Number(Number(val).toFixed(2)) }
},
//是否无售卖
isNotSale: {
type: Boolean,
default: true,
},
//数据是否删除
isExit: {
type: Number,
default: 1,
index: true
},
}, { strict: false });
return mongoose.model('Dingdan', DingdanSchema);
};