Commit 8c91c993 by chenwq

4种券,错误定位

1 parent 0f3cb035
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
</el-form-item> </el-form-item>
</template> </template>
<template slot="denominationHtml"> <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" id="denomination" style="width: 150px" :disabled="apear != 'couponAdd'" @blur.native.capture="editForm.useChannel == 1 && denominationBlur($event)">
<span slot="append">元</span> <span slot="append">元</span>
</el-input> </el-input>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span> <span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
...@@ -745,18 +745,31 @@ export default { ...@@ -745,18 +745,31 @@ export default {
return obj return obj
}, },
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild merchantval = merchantVaild
merchantErrorObj = errorObj
}) })
} }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) { if (valid && merchantval) {
if (this.priceFlag && this.editForm.useChannel == 1) { if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品 //存在零售价低于代金券的商品
this.whereToGo('denomination')
return return
} }
var params = this.getCouponInfoParams() var params = this.getCouponInfoParams()
...@@ -765,6 +778,7 @@ export default { ...@@ -765,6 +778,7 @@ export default {
message: '未选择商品', message: '未选择商品',
type: 'error' type: 'error'
}) })
this.whereToGo('denomination')
return return
} }
let method = '' let method = ''
......
...@@ -97,11 +97,11 @@ ...@@ -97,11 +97,11 @@
</template> </template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<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-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'" id="effectiveTime">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays" id="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <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" />
...@@ -528,15 +528,27 @@ export default { ...@@ -528,15 +528,27 @@ export default {
return obj return obj
}, },
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild merchantval = merchantVaild
merchantErrorObj = errorObj
}) })
} }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) { if (valid && merchantval) {
var params = this.getCouponInfoParams() var params = this.getCouponInfoParams()
let method = '' let method = ''
......
...@@ -77,11 +77,11 @@ ...@@ -77,11 +77,11 @@
</template> </template>
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<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-radio v-model="editForm.effectiveType" label="2" :disabled="apear != 'couponAdd'" id="effectiveTime">
<el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker> <el-date-picker v-model="editForm.effectiveTime" @change="haveChange" type="datetimerange" style="width: 340px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="defaultTime" :format="format" :picker-options="pickerOption" :disabled="editForm.effectiveType != 2 || apear != 'couponAdd'" clearable></el-date-picker>
</el-radio> </el-radio>
</el-form-item> </el-form-item>
<el-form-item prop="effectiveDays" ref="effectiveDays"> <el-form-item prop="effectiveDays" ref="effectiveDays" id="effectiveDays">
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear != 'couponAdd'"> <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" />
...@@ -431,15 +431,27 @@ export default { ...@@ -431,15 +431,27 @@ export default {
return obj return obj
}, },
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild merchantval = merchantVaild
merchantErrorObj = errorObj
}) })
} }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) { if (valid && merchantval) {
var params = this.getCouponInfoParams() var params = this.getCouponInfoParams()
let method = '' let method = ''
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
</div> </div>
<div class="live-room container" style="padding-top: 20px;"> <div class="live-room container" style="padding-top: 20px;">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm"> <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
<el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px"> <el-form-item size="small" label="服务名称" prop="couponName" style="width: 440px" id="couponName">
<el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input> <el-input size="small" :disabled="disabledContent" v-model.trim="ruleForm.couponName" maxlength="20" placeholder="请输入服务名称,如“精洗轿车”"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px"> <el-form-item size="small" label="预估成本/元" prop="anticipatedCost" style="width: 440px" id="anticipatedCost">
<el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input> <el-input size="small" :disabled="disabledCost" v-model.trim="ruleForm.anticipatedCost" maxlength="20" placeholder="请输入预估成本"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small" label="有效期" prop="effectiveType"> <el-form-item size="small" label="有效期" prop="effectiveType">
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent"> <el-radio-group v-model="ruleForm.effectiveType" :disabled="disabledContent">
<el-radio :label="3" class="itemBlock">永久有效</el-radio> <el-radio :label="3" class="itemBlock">永久有效</el-radio>
<!-- effectiveType:1, effectiveDays:5 --> <!-- effectiveType:1, effectiveDays:5 -->
<el-radio :label="1"> <el-radio :label="1" id="effectiveDays">
领取后 领取后
<el-input v-model="ruleForm.effectiveDays" maxlength="4" @input=" <el-input v-model="ruleForm.effectiveDays" maxlength="4" @input="
val => { val => {
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
天内有效 天内有效
</el-radio> </el-radio>
<!-- effectiveStartTime effectiveEndTime +具体时间 --> <!-- effectiveStartTime effectiveEndTime +具体时间 -->
<el-radio :label="2"> <el-radio :label="2" id="daterange">
<el-date-picker :size="small" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 2" style="width: 230px" v-model="ruleForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker> <el-date-picker :size="small" :disabled="title == '查看' || title == '编辑' || ruleForm.effectiveType != 2" style="width: 230px" v-model="ruleForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<el-button @click="add1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">+</el-button> <el-button @click="add1" class="addsubBtn" :disabled="title == '查看' || title == '编辑' || ruleForm.customUseLimit != 1">+</el-button>
次 次
</el-radio> </el-radio>
<el-radio :label="2"> <el-radio :label="2" id="limitDays">
有效期内每 有效期内每
<el-input v-model="ruleForm.limitDays" maxlength="4" @input=" <el-input v-model="ruleForm.limitDays" maxlength="4" @input="
val => { val => {
...@@ -400,14 +400,27 @@ export default { ...@@ -400,14 +400,27 @@ export default {
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据 this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
}) })
}, },
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
submitForm(formName) { submitForm(formName) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate((valid, errorObj) => {
var merchantval = true var merchantval = true
var merchantErrorObj = []
if (this.$isGroupUp) { if (this.$isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => { this.$refs.merchantRef.$refs[this.editChildRef].validate((merchantVaild, errorObj) => {
merchantval = merchantVaild merchantval = merchantVaild
merchantErrorObj = errorObj
}) })
} }
if (!valid) {
this.whereToGo(Object.keys(errorObj)[0])
} else if (!merchantval) {
this.whereToGo(Object.keys(merchantErrorObj)[0])
}
if (valid && merchantval) { if (valid && merchantval) {
if (this.isEdit == true) { if (this.isEdit == true) {
this.updateService() this.updateService()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!