|
|
@@ -7,47 +7,7 @@
|
|
|
@cancel="cancel"
|
|
|
@ok="handleSubmit"
|
|
|
>
|
|
|
- <a-form :form="form" style="margin-top: 30px" v-bind="formItemLayout">
|
|
|
- <a-form-item label="优惠券类型" v-bind="formItemLayout">
|
|
|
- <a-select
|
|
|
- v-decorator="[
|
|
|
- 'type',
|
|
|
- { rules: [{ required: true, message: '请选择类型' }] }]"
|
|
|
- @change="changeType"
|
|
|
- >
|
|
|
- <a-select-option value="1">生日特惠</a-select-option>
|
|
|
- <a-select-option value="2">多间特惠</a-select-option>
|
|
|
- <a-select-option value="3">满减特惠</a-select-option>
|
|
|
- <a-select-option value="4">限时特惠</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="券名" v-bind="formItemLayout">
|
|
|
- <a-input
|
|
|
- placeholder="请填写券名"
|
|
|
- v-decorator="['name', { rules: [{ required: true, message: '请输入券名' }] }]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="优惠简介" v-bind="formItemLayout">
|
|
|
- <a-input
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
- placeholder="请填写优惠简介"
|
|
|
- v-decorator="['description', { rules: [{ required: true, message: '请填写优惠简介' }] }]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="达标金额">
|
|
|
- <a-input
|
|
|
- placeholder="请填写达标金额"
|
|
|
- v-decorator="['targetMoney', { rules: [{ required: true, message: '请填写达标金额' }] }]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- <a-form-item label="优惠金额" v-bind="formItemLayout">
|
|
|
- <a-input
|
|
|
- placeholder="请填写优惠金额"
|
|
|
- v-decorator="['discountMoney', { rules: [{ required: true, message: '请填写优惠金额' }] }]"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
+ <!-- 这里是添加策略模态框区域,请编写表单 -->
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -75,6 +35,7 @@ export default {
|
|
|
])
|
|
|
},
|
|
|
beforeCreate() {
|
|
|
+ // 表单名默认为“form”
|
|
|
this.form = this.$form.createForm(this, { name: 'addCouponModal' });
|
|
|
},
|
|
|
mounted() {
|
|
|
@@ -85,6 +46,7 @@ export default {
|
|
|
'set_addCouponVisible'
|
|
|
]),
|
|
|
...mapActions([
|
|
|
+ // addHotelCoupon:添加酒店策略接口
|
|
|
'addHotelCoupon'
|
|
|
]),
|
|
|
cancel() {
|
|
|
@@ -102,16 +64,9 @@ export default {
|
|
|
this.form.validateFieldsAndScroll((err, values) => {
|
|
|
if (!err) {
|
|
|
const data = {
|
|
|
- name: this.form.getFieldValue('name'),
|
|
|
- description: this.form.getFieldValue('description'),
|
|
|
- type: Number(this.form.getFieldValue('type')),
|
|
|
- targetMoney: Number(this.form.getFieldValue('targetMoney')),
|
|
|
- discountMoney: Number(this.form.getFieldValue('discountMoney')),
|
|
|
- hotelId: Number(this.activeHotelId),
|
|
|
- status: 1,
|
|
|
+ // 这里添加接口参数
|
|
|
}
|
|
|
this.addHotelCoupon(data)
|
|
|
- console.log(data)
|
|
|
}
|
|
|
});
|
|
|
},
|