lrf402788946 4 years ago
parent
commit
1b49c4de8b
2 changed files with 6 additions and 0 deletions
  1. 2 0
      app/controller/client/.treaty.js
  2. 4 0
      app/model/treaty.js

+ 2 - 0
app/controller/client/.treaty.js

@@ -8,6 +8,7 @@ module.exports = {
       "period",
       "settle_up",
       "settle_up_period",
+      'expiry_date',
       "status",
       "!owner",
     ],
@@ -26,6 +27,7 @@ module.exports = {
       "period",
       "settle_up",
       "settle_up_period",
+      'expiry_date',
       "status",
       "!owner",
     ],

+ 4 - 0
app/model/treaty.js

@@ -1,5 +1,6 @@
 'use strict';
 const Schema = require('mongoose').Schema;
+const moment = require('moment');
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 // 合同
 const treaty = {
@@ -36,6 +37,7 @@ const treaty = {
     maxLength: 200,
     field: { label: '结算周期' },
   },
+  expiry_date: { type: String, required: true, maxLength: 200, field: { label: '有效日期' } },
   status: {
     type: String,
     maxLength: 200,
@@ -52,6 +54,8 @@ const treaty = {
     },
   }, // 状态:0=>使用;1禁用
   owner: { type: String, required: true }, // 创建人
+
+  create_date: { type: String, default: moment().format('YYYY-MM-DD') },
 };
 
 const schema = new Schema(treaty, { toJSON: { virtuals: true } });