Browse Source

预托书-保存数据中时间格式设置

jbb 1 year ago
parent
commit
0ff155a3e8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/views/pre-book/addPreBookDrawer.vue

+ 2 - 2
src/views/pre-book/addPreBookDrawer.vue

@@ -543,8 +543,8 @@ export default {
     saveAdd() {
       const that = this;
       var newObj = this.addPreBook;
-      newObj.latestDateOfShipment = moment(this.addPreBook.latestDateOfShipment).format('YYYY-MM-DD');
-      newObj.theFinalShippingDate = moment(this.addPreBook.theFinalShippingDate).format('YYYY-MM-DD');
+      newObj.latestDateOfShipment =(this.addPreBook.latestDateOfShipment&&this.addPreBook.latestDateOfShipment!=='') ?moment(this.addPreBook.latestDateOfShipment).format('YYYY-MM-DD'):'';
+      newObj.theFinalShippingDate =(this.addPreBook.theFinalShippingDate&&this.addPreBook.theFinalShippingDate!=='') ? moment(this.addPreBook.theFinalShippingDate).format('YYYY-MM-DD'):'';
       if (newObj.syLetterDepositItemList.length == 0){
         this.$message.error('当前记录没有子表记录,无法保存');
         return;