Commit 92caef32 by 胡悦

优惠券修改

1 parent b456a094
......@@ -7,17 +7,24 @@
<div class="card_one">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype"><span class="ctypeName">代金券</span></span>
<span class="ctype">
<span class="ctypeName">代金券</span>
</span>
</div>
<div class="ctime">
<span class="ctime_name">有效期:</span>
<span class="ctime_content" v-if="editForm.effectiveType == 3">无限制</span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{ editForm.effectiveDays }}天</span>
<span
class="ctime_content"
v-if="editForm.effectiveType == 1"
>{{ editForm.effectiveDays }}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{ couponTime }}</span>
</div>
<div class="ctime">
<span class="ctime_name">使用限制:</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无限制' : '满' + editForm.full + '可用' }}</span>
<span
class="ctime_content"
>{{ editForm.useBarriers == 1 ? '无限制' : '满' + editForm.full + '可用' }}</span>
</div>
</div>
<div class="card_two">
......@@ -26,7 +33,17 @@
</div>
</div>
<p class="edit-title">{{ title }}代金券</p>
<glsx-combi-form class="edit-form-container" style="min-height: 570px;" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<glsx-combi-form
class="edit-form-container"
style="min-height: 570px;"
ref="editFormRef"
:isEdit="true"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
<template slot="useChannelHtml">
<el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio>
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
......@@ -34,34 +51,68 @@
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br />
<el-form-item prop="effectiveTime" ref="effectiveTime" style="margin-top: 12px;display: block;">
<el-form-item
prop="effectiveTime"
ref="effectiveTime"
style="margin-top: 12px;display: block;"
>
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'">
<el-date-picker v-model="editForm.effectiveTime" type="daterange" style="width:295px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
<el-date-picker
v-model="editForm.effectiveTime"
type="daterange"
style="width:295px"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOption"
:disabled="editForm.effectiveType != 2 || apear != 'couponAdd'"
clearable
></el-date-picker>
</el-radio>
</el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'">
领取后
<el-input v-model="editForm.effectiveDays" style="width:100px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.effectiveType != 1" />
天内有效
<el-input
v-model="editForm.effectiveDays"
style="width:100px;margin-left:5px;margin-right:5px"
:disabled="apear != 'couponAdd' || editForm.effectiveType != 1"
/>天内有效
</el-radio>
</el-form-item>
</template>
<template slot="useBarriersHtml">
<el-radio v-model="editForm.useBarriers" label="1" :disabled="apear != 'couponAdd'">无限制</el-radio>
<el-form-item prop="full" ref="full">
<el-radio v-model="editForm.useBarriers" label="2" :disabled="apear != 'couponAdd' || editForm.useChannel == 2">
<el-radio
v-model="editForm.useBarriers"
label="2"
:disabled="apear != 'couponAdd' || editForm.useChannel == 2"
>
订单满
<el-input v-model="editForm.full" placeholder="输入金额(元)" style="width: 110px;margin-left:5px;margin-right:5px" :disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
元可用
<el-input
v-model="editForm.full"
placeholder="输入金额(元)"
style="width: 110px;margin-left:5px;margin-right:5px"
:disabled="apear != 'couponAdd' || editForm.useBarriers != 2"
/>元可用
</el-radio>
</el-form-item>
</template>
<template slot="denominationHtml">
<el-input v-model="editForm.denomination" style="width: 150px" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<el-input
v-model="editForm.denomination"
style="width: 150px"
:disabled="apear != 'couponAdd'"
@blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)"
>
<span slot="append">元</span>
</el-input>
<span style="color:red;margin-left:15px" v-if="priceFlag">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
<span
style="color:red;margin-left:15px"
v-if="priceFlag && editForm.useChannel == 1"
>{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
<template slot="goodsHtml">
......@@ -74,7 +125,13 @@
<!-- 新增时并且为指定商品时显示,编辑或者查看时也显示 -->
<div slot="proTable" class="select-pro">
<!-- <div style="height:70px" v-if="editForm.goodsRefList.length"></div> -->
<GLTable v-show="editForm.goodsRefList.length" :hasPage="false" :tableParams="tableParams" :tableData="editForm.goodsRefList" style="padding-left:10px;margin-right:340px;max-height:350px;overflow:auto;">
<GLTable
v-show="editForm.goodsRefList.length"
:hasPage="false"
:tableParams="tableParams"
:tableData="editForm.goodsRefList"
style="padding-left:10px;margin-right:340px;max-height:350px;overflow:auto;"
>
<template slot="goodsImage" slot-scope="scope">
<img class="img-60" :src="scope.scope.goodsImage" />
</template>
......@@ -84,7 +141,14 @@
</GLTable>
</div>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" />
<el-input
type="textarea"
v-model="editForm.useDescription"
style="width: 320px"
:autosize="{ minRows: 2, maxRows: 4 }"
maxlength="200"
:disabled="apear == 'couponSee'"
/>
</template>
</glsx-combi-form>
</div>
......@@ -93,7 +157,14 @@
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div>
<select-muti-pro-forcoupon-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-muti-pro-forcoupon-dialog>
<select-muti-pro-forcoupon-dialog
v-if="isMutiSelectVisible"
:isMutiSelectVisible="isMutiSelectVisible"
:searchForm="searchProForm"
:selectedProList="selectedProList"
@handleMutiSelectConfirm="handleMutiSelectConfirm"
@handleMutiSelectClose="handleMutiSelectClose"
></select-muti-pro-forcoupon-dialog>
</div>
</template>
......@@ -473,7 +544,7 @@ export default {
})
}
this.tableParams.tableOption = false //去掉操作栏
this.$nextTick(()=>{
this.$nextTick(() => {
this.editStatus = false
})
})
......@@ -573,7 +644,7 @@ export default {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
if (this.priceFlag) {
if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品
return
}
......@@ -614,12 +685,13 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
.then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
this.cancelJump()
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!