明树Git Lab

Commit d6b88127 authored by zengfanpei's avatar zengfanpei

1

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