Commit 94d0a8c8 by chenwq

折扣券,兑换券-加字段,集团版集团账号

1 parent 0cfd5ea3
......@@ -119,6 +119,11 @@
</el-radio>
</el-form-item>
</template>
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
......@@ -126,6 +131,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
<div v-if="isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
......@@ -151,6 +160,8 @@ export default {
1: '创建晒单',
2: '编辑晒单'
},
// 集团版集团账号
isGroupUp: false,
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
......@@ -233,16 +244,16 @@ export default {
{
label: '库存',
name: 'stock',
width: '180px',
type: 'input',
append: '张'
addHtml: 'stock'
// width: '180px',
// type: 'input',
// append: '张'
},
{
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '有效期',
......@@ -259,10 +270,39 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
// 适用门店
merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'merchantRadio',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
],
}
]
}
},
created() {
this.userInfo = this.$globalState.session
this.isGroupUp = this.userInfo.merchantModel == 1 && this.userInfo.accountLevel != 4
this.editRule.stock[0].required = !this.isGroupUp
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
......@@ -470,7 +510,13 @@ export default {
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var merchantval = true
if (this.isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.merchantval = merchantVaild
})
}
if (valid && merchantval) {
var params = this.getCouponInfoParams()
let method = ''
if (params.couponId) {
......@@ -505,7 +551,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......
<!-- 编辑兑换券 -->
<template>
<div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 650px; position: relative">
<div class="container edit-container" style="position: relative">
<div class="right_show">
<div class="card-top"></div>
<div class="slider">
......@@ -54,6 +54,11 @@
</div>
<p class="edit-title">{{ title }}兑换券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<!-- 库存,集团版集团账号-无限制库存;其他-输入框 -->
<template slot="stock" slot-scope="scope">
<span v-if="isGroupUp">无库存限制</span>
<el-input v-else class="w-150" v-model="editForm[scope.scope.name]" placeholder="请输入库存"></el-input>
</template>
<template slot="directionalFlagHtml">
<div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
......@@ -89,6 +94,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
<div v-if="isGroupUp">
<p class="edit-title">适用门店配置</p>
<glsx-combi-form class="edit-form-container" ref="merchantRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="merchantRule"></glsx-combi-form>
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
......@@ -114,6 +123,8 @@ export default {
1: '创建晒单',
2: '编辑晒单'
},
// 集团版集团账号
isGroupUp: false,
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
......@@ -178,9 +189,10 @@ export default {
{
label: '库存',
name: 'stock',
width: '180px',
type: 'input',
append: '张'
addHtml: 'stock'
// width: '180px',
// type: 'input',
// append: '张'
},
{
label: '使用规则',
......@@ -204,10 +216,39 @@ export default {
addHtml: 'editHtml',
isHide: true
}
],
// 适用门店
merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
},
merchantEditFormData: [
{
label: '适用范围',
name: 'merchantRadio',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: '1',
confName: '旗下所有店通用'
},
{
confId: '2',
confName: '旗下同品牌店通用(根据客户绑定车辆品牌自动筛选出适用门店)'
}
]
}
]
}
},
created() {
this.userInfo = this.$globalState.session
this.isGroupUp = this.userInfo.merchantModel == 1 && this.userInfo.accountLevel != 4
this.editRule.stock[0].required = !this.isGroupUp
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
......@@ -373,7 +414,13 @@ export default {
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var merchantval = true
if (this.isGroupUp) {
this.$refs.merchantRef.$refs[this.editChildRef].validate(merchantVaild => {
this.merchantval = merchantVaild
})
}
if (valid && merchantval) {
var params = this.getCouponInfoParams()
let method = ''
if (params.couponId) {
......@@ -408,7 +455,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!