|
|
@@ -0,0 +1,130 @@
|
|
|
+<template>
|
|
|
+ <div class="panel">
|
|
|
+ <div class="panel-header">
|
|
|
+ <h3 class="header-title">{{ data.name }}设置</h3>
|
|
|
+ <a class="el-icon-close close-btn" @click="closeRightTemplateHandle"></a>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-form label-position="top" ref="form" label-width="80px">
|
|
|
+ <el-form-item style="margin-bottom: 0;" label="选择优惠券">
|
|
|
+ <el-select size="mini" @change="couponChange" v-model="selectId" placeholder="选择优惠券">
|
|
|
+ <el-option label="请选择" value=""></el-option>
|
|
|
+ <el-option :label="item.title" :value="item.id" v-for="item in couponList" :key="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'settingCoupon',
|
|
|
+ props: ['data', 'className'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ content: JSON.parse(JSON.stringify(this.data)),
|
|
|
+ selectId:'',
|
|
|
+ couponList:[{
|
|
|
+ id:101,
|
|
|
+ title:'xxx优惠券'
|
|
|
+ },{
|
|
|
+ id:220,
|
|
|
+ title:'xxx2优惠券'
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getCouponList()
|
|
|
+ this.selectId = this.content.id?this.content.id:''
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 获取优惠券列表
|
|
|
+ getCouponList() {
|
|
|
+ // service.get("/custom/form/column/list?formId=" + formId).then((res) => {
|
|
|
+ // if (res.data.code != 0) {
|
|
|
+ // return that.$message.error(res.data.data.msg);
|
|
|
+ // }
|
|
|
+ // this.formColumnList = res.data.data;
|
|
|
+ // }).catch(function () {
|
|
|
+ // });
|
|
|
+ },
|
|
|
+ couponChange(val){
|
|
|
+ console.log('val',val)
|
|
|
+ let obj = this.couponList.filter(item=>{return item.id==val})[0]
|
|
|
+ this.content.value.couponObj = obj
|
|
|
+ this.handleDate()
|
|
|
+ },
|
|
|
+ handleDate() {
|
|
|
+ this.$emit('updataContent', this.content)
|
|
|
+ },
|
|
|
+ closeRightTemplateHandle() {
|
|
|
+ this.$emit('closeRightTemplateHandle', false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.panel {
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.panel .panel-header {
|
|
|
+ position: relative;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ margin-left: 8px;
|
|
|
+ margin-right: 8px;
|
|
|
+ vertical-align: middle;
|
|
|
+ border-bottom: 1px solid #dcdcdc;
|
|
|
+ box-sizing: border-box;
|
|
|
+ z-index: 10;
|
|
|
+}
|
|
|
+
|
|
|
+.panel .panel-header .header-title {
|
|
|
+ padding-left: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #29304e;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.panel .panel-header .header-title:before {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ left: 0;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ width: 3px;
|
|
|
+ height: 18px;
|
|
|
+ background: #1890ff;
|
|
|
+ opacity: 1;
|
|
|
+ border-radius: 2px;
|
|
|
+}
|
|
|
+
|
|
|
+.panel .panel-header .close-btn {
|
|
|
+ position: absolute;
|
|
|
+ top: 12px;
|
|
|
+ right: 0;
|
|
|
+ border: none;
|
|
|
+ outline: none;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #999;
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+
|
|
|
+.panel .panel-body {
|
|
|
+ position: absolute;
|
|
|
+ top: 40px;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.text-setting {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+</style>
|