1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /**
- * Created by Administrator on 2018/7/25.
- * 加工出入库记录
- */
- var mongoose = require("./mongodb");
- var Schema = mongoose.Schema;
- var moment=require('moment');
- var processWarehouseSchema = new Schema(
- {
- SOCIAL_CREDIT_CODE:{type: String,default:''},//统一社会信用代码
- OP_CODE:{type: Number},//类别 1.原料普通入库 2 原料挑选出库 3原料挑选入库 4原料生产出库 5 半成品入库 6 半成品出库 7 成品入库 8 成品出库
- Job:{type: String,default:""},//工序名称
- source:{type: String,default:''},//来源
- destination:{type: String,default:''},//去往
- ID:{type: String,default:''},//物料ID
- CODE:{type: String,default:''},//物料编码
- NAME:{type: String,default:''},//物料名称
- batchCode:{type: String,default:''},//批次码
- batchType:{type: String,default:''},//批次码类别
- ORDER_NUMBER:{type: String,default:''},//出入库单号
- DATE:{type: Date,default:Date.now},//日期
- UNIT:{type: String,default:'KG'},//计量单位,默认KG
- NUM:{type: Number,default:0},//数量
- PERSON_IN_CHARGE:{type: String,default:''},//负责人姓名
- CONTACT_TEL:{type: String,default:''},//负责人联系方式
- Operator:{type: String,default:''},//操作人
- Workgroup:{type: String,default:''},//工人班组
- Deleted:{type: Number,default:0}//是否已删除 默认0未删除 1已删除
- },{
- strict: true,
- toObject: {
- virtuals: true
- },
- toJSON: {
- virtuals: true
- }
- });
- processWarehouseSchema.virtual('DATE2').get(function () {
- if(this.DATE =="")//判断传入的参数
- {
- return "";
- };
- return moment(this.DATE).format('YYYY-MM-DD HH:mm:ss');
- });
- var processWarehouse = mongoose.model('processWarehouse',
- processWarehouseSchema,'t_processWarehouse');
- module.exports = processWarehouse;
|