|
@@ -1,6 +1,10 @@
|
|
'use strict';
|
|
'use strict';
|
|
const Schema = require('mongoose').Schema;
|
|
const Schema = require('mongoose').Schema;
|
|
|
|
+const moment = require('moment');
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
|
+const dateNow = function () {
|
|
|
|
+ return moment().format("YYYY-MM-DD");
|
|
|
|
+};
|
|
// 维修单
|
|
// 维修单
|
|
const RepairSchema = {
|
|
const RepairSchema = {
|
|
name: { type: String, required: false, maxLength: 200 }, // 维修项目名
|
|
name: { type: String, required: false, maxLength: 200 }, // 维修项目名
|
|
@@ -8,6 +12,8 @@ const RepairSchema = {
|
|
parts: { type: String, required: false, maxLength: 200 }, // 配件
|
|
parts: { type: String, required: false, maxLength: 200 }, // 配件
|
|
jobdate: { type: String, required: false, maxLength: 200 }, // 工时
|
|
jobdate: { type: String, required: false, maxLength: 200 }, // 工时
|
|
totalmoney: { type: String, required: false, maxLength: 200 }, // 合计
|
|
totalmoney: { type: String, required: false, maxLength: 200 }, // 合计
|
|
|
|
+ create_data: { type: String, required: false, maxLength: 200, default: dateNow }, // 来店时间
|
|
|
|
+ finish_date: { type: String, required: false, maxLength: 200 }, // 交车时间
|
|
uid: { type: String, required: true, maxLength: 500 }, // 所属用户id
|
|
uid: { type: String, required: true, maxLength: 500 }, // 所属用户id
|
|
// ref:'Company',关联数据
|
|
// ref:'Company',关联数据
|
|
};
|
|
};
|