yangc 7 years ago
parent
commit
752e3a4dcc
2 changed files with 48 additions and 11 deletions
  1. 37 0
      components/applyPurchase/BatchPublish.vue
  2. 11 11
      components/default/Footer.vue

+ 37 - 0
components/applyPurchase/BatchPublish.vue

@@ -171,6 +171,29 @@
     }
     }
     return str
     return str
   }
   }
+  let formatDate = function (date, fmt) {
+    if (typeof date === 'string') {
+      date = new Date(date)
+    }
+    let o = {
+      'M+': date.getMonth() + 1, // 月份
+      'd+': date.getDate(), // 日
+      'h+': 23, // 小时
+      'm+': 59, // 分
+      's+': 59, // 秒
+      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+      'S': date.getMilliseconds() // 毫秒
+    }
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt
+  }
   import Page from '~components/common/page/pageComponent.vue'
   import Page from '~components/common/page/pageComponent.vue'
   export default {
   export default {
     data () {
     data () {
@@ -447,6 +470,8 @@
         return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
         return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
       },
       },
       isValidDate: function (date) {
       isValidDate: function (date) {
+        date = formatDate(date, 'yyyy-MM-dd hh:mm:ss')
+        this.modifyObj.deadline = date
         let now = new Date().getTime()
         let now = new Date().getTime()
         let time = new Date(date).getTime()
         let time = new Date(date).getTime()
         return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
         return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
@@ -576,10 +601,22 @@
       },
       },
       setShowCodeWord: function (index, event) {
       setShowCodeWord: function (index, event) {
         event.stopPropagation()
         event.stopPropagation()
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          if (i !== index) {
+            this.bomList.content[i].showCodeWord = false
+          }
+          this.bomList.content[i].showBrandWord = false
+        }
         this.bomList.content[index].showCodeWord = !this.bomList.content[index].showCodeWord
         this.bomList.content[index].showCodeWord = !this.bomList.content[index].showCodeWord
       },
       },
       setShowBrandWord: function (index, event) {
       setShowBrandWord: function (index, event) {
         event.stopPropagation()
         event.stopPropagation()
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          if (i !== index) {
+            this.bomList.content[i].showBrandWord = false
+          }
+          this.bomList.content[i].showCodeWord = false
+        }
         this.bomList.content[index].showBrandWord = !this.bomList.content[index].showBrandWord
         this.bomList.content[index].showBrandWord = !this.bomList.content[index].showBrandWord
       },
       },
       modifyItemByWord: function (index, param, type) {
       modifyItemByWord: function (index, param, type) {

+ 11 - 11
components/default/Footer.vue

@@ -84,18 +84,18 @@
           title: '迈迪杰科技'
           title: '迈迪杰科技'
         }]
         }]
       }
       }
-    },
-    watch: {
-      $route: function (val, oldVal) {
-        let footer = document.getElementsByClassName('footer')[0]
-        if (this.$route.path === '/applyPurchase') {
-          footer.style.position = 'absolute'
-          footer.style.top = '2581px'
-        } else {
-          footer.style.position = 'initial'
-        }
-      }
     }
     }
+//    watch: {
+//      $route: function (val, oldVal) {
+//        let footer = document.getElementsByClassName('footer')[0]
+//        if (this.$route.path === '/applyPurchase') {
+//          footer.style.position = 'absolute'
+//          footer.style.top = '2581px'
+//        } else {
+//          footer.style.position = 'initial'
+//        }
+//      }
+//    }
 //    mounted () {
 //    mounted () {
 //      let footer = document.getElementsByClassName('footer')[0]
 //      let footer = document.getElementsByClassName('footer')[0]
 //      if (this.$route.path === '/applyPurchase') {
 //      if (this.$route.path === '/applyPurchase') {