明树Git Lab

Commit d6b88127 authored by zengfanpei's avatar zengfanpei

1

parent a90fdc1d
......@@ -12,6 +12,12 @@
| router | 路由 |
| utils | 工具方法 |
# 命名
| 简称 | 解释 |
| --- | --- |
| IPS | 虫情 |
| SMC | 土壤墒情 |
| WS | 气象 |
# 记录
......
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
// const mongoose = require('mongoose');
// const Schema = mongoose.Schema;
// const moment = require('moment');
/**
* 乐田 农业投入品 采购
*/
const letianAgrInRecordSchema = new Schema({
purchaseDate: {
type: Date,
// default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
comment: "购买日期"
},
name: {
type: String,
required: true,
commnet: "产品名称",
},
specifications: {
type: String,
comment: "规格"
},
ingredients: {
type: String,
comment: "成分"
},
shipmentQuantity: {
type: Number,
default: 0,
comment: "出货数量"
},
unit: {
type: String,
comment: "单位"
},
shippingPrice: {
type: String,
comment: "出货价格(元)"
},
totalAmount : {
type: String,
comment: "合计金额(元)"
},
consumption : {
type: String,
comment: "用量"
},
agent : {
type: String,
comment: "代理商"
},
remarks : {
type: String,
comment: "备注"
},
// /**
// * 乐田 农业投入品 采购
// */
// const letianAgrInRecordSchema = new Schema({
// purchaseDate: {
// type: Date,
// // default: Date.now,
// get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
// comment: "购买日期"
// },
// name: {
// type: String,
// required: true,
// commnet: "产品名称",
// },
// specifications: {
// type: String,
// comment: "规格"
// },
// ingredients: {
// type: String,
// comment: "成分"
// },
// shipmentQuantity: {
// type: Number,
// default: 0,
// comment: "出货数量"
// },
// unit: {
// type: String,
// comment: "单位"
// },
// shippingPrice: {
// type: String,
// comment: "出货价格(元)"
// },
// totalAmount : {
// type: String,
// comment: "合计金额(元)"
// },
// consumption : {
// type: String,
// comment: "用量"
// },
// agent : {
// type: String,
// comment: "代理商"
// },
// remarks : {
// type: String,
// comment: "备注"
// },
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
id: false,
toJSON: {
getters: true,
}
});
// createdAt: {
// type: Date,
// default: Date.now,
// get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
// },
// updatedAt: {
// type: Date,
// default: Date.now,
// get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
// },
// del: {
// type: Number,
// default: 0,
// comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
// }
// }, {
// id: false,
// toJSON: {
// getters: true,
// }
// });
const AgrInRecord = mongoose.model('AgrInRecord', letianAgrInRecordSchema, 'letianAgrInRecord');
module.exports = AgrInRecord;
\ No newline at end of file
// const AgrInRecord = mongoose.model('AgrInRecord', letianAgrInRecordSchema, 'letianAgrInRecord');
// module.exports = AgrInRecord;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment