Commit 84f8632e by zhangmengjie

23.4.13

parent 3fbeb6e9
<template>
<div class="app-container">
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleCancle"
>
<el-form
:model="form"
:rules="rules"
ref="form"
label-width="100px"
class="demo-form"
>
<el-dialog :title="title" :visible.sync="dialogVisible" width="60%" :before-close="handleCancle">
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="demo-form">
<el-form-item label="券类型" prop="couponType">
<el-select v-model="form.couponType" placeholder="请选择">
<el-option
v-for="item in activeAreaList"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-select :disabled="disableds" v-model="form.couponType" placeholder="请选择">
<el-option v-for="item in activeAreaList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="优惠内容" prop="fullSubtraction">
<div class="d-flex a-center custom-input">
<div class="margin-right">减免</div>
<el-input
type="number"
class="delInput flex-1"
min="1"
placeholder="减免金额>0且<99999"
v-model="form.fullSubtraction"
>
<el-input :disabled="disabled" type="number" class="delInput flex-1" min="1" placeholder="减免金额>0且<99999"
v-model="form.fullSubtraction">
</el-input>
<div class="margin-left"></div>
</div>
......@@ -41,31 +20,18 @@
<el-form-item label="优惠门槛" prop="minUsed">
<div class="d-flex a-center custom-input">
<div class="margin-right">最低消费,满</div>
<el-input
type="number"
class="delInput flex-1"
min="0"
v-model="form.minUsed"
/>
<el-input :disabled="disabled" type="number" class="delInput flex-1" min="0" v-model="form.minUsed" />
<div class="margin-left">元,可用</div>
</div>
</el-form-item>
<el-form-item label="生效时间" prop="effectiveTime">
<el-date-picker
v-model="form.effectiveTime"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
>
<el-date-picker :disabled="disabled" v-model="form.effectiveTime" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="失效时间" prop="failureTime">
<el-date-picker
v-model="form.failureTime"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
>
<el-date-picker :disabled="disabled" v-model="form.failureTime" type="date" placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-form>
......@@ -78,7 +44,7 @@
</template>
<script>
import { coupontsGET} from '@/api/orderform/index'
import { coupontsGET } from '@/api/orderform/index'
export default {
props: {
......@@ -88,7 +54,15 @@ export default {
title: {
type: String,
},
isEdit:Boolean
isEdit: Boolean,
disabled: {
type: Boolean,
default: false,
},
disableds:{
type:Boolean,
default:false,
}
},
data() {
return {
......@@ -99,7 +73,7 @@ export default {
fullSubtraction: "", // 减免
minUsed: "", // 最低消费
effectiveTime: '', // 生效时间
failureTime:'', // 失效时间
failureTime: '', // 失效时间
},
rules: {
fullSubtraction: [
......@@ -112,10 +86,10 @@ export default {
{ required: true, message: "请选择优惠门槛", trigger: "change" },
],
effectiveTime: [
{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }
{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }
],
failureTime: [
{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }
{ type: 'string', required: true, message: '请选择日期', trigger: 'change' }
],
},
activeAreaList: [
......@@ -130,16 +104,16 @@ export default {
],
};
},
created() {},
created() { },
methods: {
handleCancle() {
this.$emit("cancle");
},
couponts(val){
coupontsGET(val).then((res)=>{
if(res.code == 200){
this.form = res.data
}
couponts(val) {
coupontsGET(val).then((res) => {
if (res.code == 200) {
this.form = res.data
}
})
},
onSubmit() {
......@@ -157,7 +131,6 @@ export default {
};
</script>
<style lang="scss" scoped>
::v-deep .delInput input::-webkit-outer-spin-button,
::v-deep .delInput input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
......@@ -166,28 +139,36 @@ export default {
::v-deep .delInput input[type="number"] {
-moz-appearance: textfield;
}
.description {
font-size: 25px;
margin-top: 10px;
}
.d-flex {
display: flex;
}
.a-center {
align-items: center;
}
.flex-1 {
flex: 1;
}
.margin-left {
margin-left: 10px;
}
.margin-right {
margin-right: 10px;
}
.custom-input {
width: 250px !important;
}
.customer {
display: flex;
flex-wrap: wrap;
......
......@@ -34,7 +34,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 弹出框 -->
<dialogFile :dialogVisible="dialogVisible" :title="title" @cancle="handleCancleDialog" @onSubmit="handleSave"
<dialogFile :dialogVisible="dialogVisible" :disableds="disableds" :disabled="disabled" :title="title" @cancle="handleCancleDialog" @onSubmit="handleSave"
:isEdit="isEdit" ref="refDialogFile"></dialogFile>
</div>
</template>
......@@ -56,6 +56,8 @@ export default {
pageNum: 0,
pageSize: 10,
},
disabled:false,
disableds:false,
value: "",
tableData: [],
isEdit: true,//判断添加修改详情的保存按钮是否显示
......@@ -89,6 +91,8 @@ export default {
let that = this;
that.title = "添加优惠券";
this.$refs['refDialogFile'].form = {}
this.disabled = false
this.disableds = false
that.isEdit = true
that.dialogVisible = true;
},
......@@ -109,9 +113,13 @@ export default {
if (type == "1") {
that.title = "修改优惠券";
this.$refs['refDialogFile'].couponts(sta.id)
this.disabled = false
this.disableds = true
that.isEdit = true
} else if (type == "2") {
this.$refs['refDialogFile'].couponts(sta.id)
this.disabled = true
this.disableds = true
that.title = "查看优惠券";
that.isEdit = false
}
......
......@@ -117,7 +117,7 @@ export default {
this.$nextTick(() => {
if (res.data.videoList && res.data.videoList.length) {
self.video = res.data.videoList[0].url
self.videoCover = res.data.videoList[0].videoCover
self.videoCover = res.data.videoList[0].cropImage
console.log(self.particulars.video,'self.particulars.video')
} else {
self.video = ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment