|
@@ -124,6 +124,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
+ const date = new Date()
|
|
|
+ const yyyy = date.getFullYear()
|
|
|
+ const MM = (date.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ const dd = (date.getDate()).toString().padStart(2, '0')
|
|
|
return {
|
|
|
dialog: !!this.value,
|
|
|
pickerOptions: {
|
|
@@ -152,7 +156,7 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
form: {
|
|
|
- place_time: new Date(), // 年月日, 回传后端时间格式要求2021-05-23
|
|
|
+ place_time: yyyy + '-' + MM + '-' + dd, // 年月日, 回传后端时间格式要求2021-05-23
|
|
|
place_name: '', // 座位名称
|
|
|
place_desc: '', // 座位描述
|
|
|
place_user_max: '', // 最多到店人数
|
|
@@ -213,16 +217,15 @@ export default {
|
|
|
if (this.form.hasOwnProperty(key)) {
|
|
|
let value = this.exData[key]
|
|
|
if ((Array.isArray(value) && value.length >= 1) || (Object.prototype.toString.call(value) === '[object Object]') || (typeof value === 'string' && value) || typeof value === 'number') {
|
|
|
- if (key === 'place_time') {
|
|
|
- value = new Date(`${value}`)
|
|
|
- console.log(value)
|
|
|
- }
|
|
|
if (key === 'place_price') {
|
|
|
value = fen2Yuan(value)
|
|
|
}
|
|
|
if (key === 'place_number') {
|
|
|
value = JSON.parse(value)
|
|
|
}
|
|
|
+ if (key === 'place_latest_time') {
|
|
|
+ value = value.replace(/(\d{4}-\d{2}-\d{2}\s*)(\d{2}:\d{2})(\W.*)/, '$2')
|
|
|
+ }
|
|
|
this.$set(this.form, key, value)
|
|
|
}
|
|
|
}
|