|
@@ -19,8 +19,7 @@
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
:picker-options="pickerOptions"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- :readonly="form.id">
|
|
|
+ value-format="yyyy-MM-dd">
|
|
|
</el-date-picker>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
@@ -82,13 +81,13 @@
|
|
|
clearable></el-input>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="place_name"
|
|
|
- :rules="formRules.required"
|
|
|
+ <el-form-item prop="place_pre_num"
|
|
|
+ :rules="form.id !== '' ? [] : formRules.required"
|
|
|
label="已预定:"
|
|
|
v-if="form.id">
|
|
|
<el-col :span="16">
|
|
|
- <el-input v-model="form.place_name"
|
|
|
- readonly
|
|
|
+ <el-input v-model="form.place_pre_num"
|
|
|
+ disabled
|
|
|
placeholder=""
|
|
|
clearable></el-input>
|
|
|
</el-col>
|
|
@@ -101,7 +100,6 @@
|
|
|
:rules="formRules.required">
|
|
|
<el-col :span="16">
|
|
|
<el-input v-model="desk.value"
|
|
|
- :readonly="form.id"
|
|
|
placeholder="请设置桌号"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="7" :offset="1">
|
|
@@ -166,17 +164,18 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
form: {
|
|
|
- place_time: '2021-05-23', // 年月日
|
|
|
- place_name: '10人卡座', // 座位名称
|
|
|
- place_desc: '卡座台费3200元', // 座位描述
|
|
|
- place_user_max: '10', // 最多到店人数
|
|
|
- place_price: '1000', // 座位价格(单位为分)
|
|
|
- place_latest_time: '2021-05-23 21:15:00', // 最晚到店时间
|
|
|
- place_max_time: '30', // 最晚保留时间
|
|
|
+ place_time: new Date(), // 年月日, 回传后端时间格式要求2021-05-23
|
|
|
+ place_name: '', // 座位名称
|
|
|
+ place_desc: '', // 座位描述
|
|
|
+ place_user_max: '', // 最多到店人数
|
|
|
+ place_price: '', // 座位价格(单位为分)
|
|
|
+ place_latest_time: '', // 最晚到店时间,回传后端时间格式要求2021-05-23 21:15:00
|
|
|
+ place_max_time: '', // 最晚保留时间
|
|
|
+ place_pre_num: 0, // 已预定
|
|
|
// 座位编号(数组)
|
|
|
place_number: [
|
|
|
{
|
|
|
- value: 'AF0004'
|
|
|
+ value: ''
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -204,6 +203,7 @@ export default {
|
|
|
if (valid) {
|
|
|
const data = await this.$fetch(url, {
|
|
|
...this.form,
|
|
|
+ place_latest_time: `${this.form.place_time} ${this.form.place_latest_time}:00`,
|
|
|
place_price: yuan2Fen(this.form.place_price)
|
|
|
})
|
|
|
if (data.code === 200) {
|
|
@@ -222,9 +222,16 @@ export default {
|
|
|
if (this.form.hasOwnProperty(key)) {
|
|
|
let value = this.exData[key]
|
|
|
if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
|
|
|
+ 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)
|
|
|
+ }
|
|
|
this.$set(this.form, key, value)
|
|
|
}
|
|
|
}
|