|
|
@@ -171,6 +171,29 @@
|
|
|
}
|
|
|
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'
|
|
|
export default {
|
|
|
data () {
|
|
|
@@ -447,6 +470,8 @@
|
|
|
return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
|
|
|
},
|
|
|
isValidDate: function (date) {
|
|
|
+ date = formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
|
|
+ this.modifyObj.deadline = date
|
|
|
let now = new Date().getTime()
|
|
|
let time = new Date(date).getTime()
|
|
|
return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
|
|
|
@@ -576,10 +601,22 @@
|
|
|
},
|
|
|
setShowCodeWord: function (index, event) {
|
|
|
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
|
|
|
},
|
|
|
setShowBrandWord: function (index, event) {
|
|
|
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
|
|
|
},
|
|
|
modifyItemByWord: function (index, param, type) {
|