Commit 98aee18a by 王志慧

Merge branch 'v2.3.0' into 'wangzh_dev_2.3.0'

V2.3.0

See merge request !128
2 parents cc362578 30659278
...@@ -138,6 +138,10 @@ html { ...@@ -138,6 +138,10 @@ html {
margin-bottom: 18px; margin-bottom: 18px;
} }
.marketing .color-transparent {
background-color: transparent;
}
.marketing .default-blue-btn { .marketing .default-blue-btn {
color: #5850ff; color: #5850ff;
border-color: #5850ff; border-color: #5850ff;
...@@ -152,6 +156,29 @@ html { ...@@ -152,6 +156,29 @@ html {
background-color: rgba(144, 147, 153, 0.5) !important; background-color: rgba(144, 147, 153, 0.5) !important;
} }
.marketing .table-title {
line-height: 32px;
}
.marketing .table-cicle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 4px;
}
.marketing .back-orange {
background-color: #FDB757;
}
.marketing .back-blue {
background-color: #5850ff;
}
.marketing .back-grey {
background-color: #999999;
}
.marketing .el-table .cell { .marketing .el-table .cell {
line-height: 16px; line-height: 16px;
} }
...@@ -193,6 +220,7 @@ html { ...@@ -193,6 +220,7 @@ html {
cursor: pointer; cursor: pointer;
} }
.marketing .w-100-percent,
.marketing .img-w-100 { .marketing .img-w-100 {
width: 100%; width: 100%;
} }
...@@ -212,6 +240,10 @@ html { ...@@ -212,6 +240,10 @@ html {
height: 120px; height: 120px;
} }
.marketing .w-150 {
width: 150px;
}
.marketing .w-320 { .marketing .w-320 {
width: 320px; width: 320px;
} }
...@@ -242,6 +274,10 @@ html { ...@@ -242,6 +274,10 @@ html {
margin-bottom: 60px; margin-bottom: 60px;
} }
.marketing .m-r-8 {
margin-right: 8px;
}
.marketing .m-r-10 { .marketing .m-r-10 {
margin-right: 10px; margin-right: 10px;
} }
...@@ -254,6 +290,11 @@ html { ...@@ -254,6 +290,11 @@ html {
margin-left: 20px; margin-left: 20px;
} }
.marketing.p-t-10,
.marketing .p-t-10 {
padding-top: 10px;
}
.marketing.p-t-20, .marketing.p-t-20,
.marketing .p-t-20 { .marketing .p-t-20 {
padding-top: 20px; padding-top: 20px;
......
...@@ -22,6 +22,8 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -22,6 +22,8 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
// 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.merchantModel == 1 && globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
......
...@@ -27,6 +27,8 @@ export async function start() { ...@@ -27,6 +27,8 @@ export async function start() {
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : '' var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : ''
Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } }) Vue.prototype.$http2 = new Http({ response, request: request2, sign, secret, alert: message.error, headers: { token } })
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } }) Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
// 集团版集团账号
Vue.prototype.$isGroupUp = false
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
Vue.prototype.$common = { utils: utils } Vue.prototype.$common = { utils: utils }
render('/', routes) render('/', routes)
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
<div class="card_one"> <div class="card_one">
<div class="flex"> <div class="flex">
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="cname">{{ editForm.couponName }}</div> <div :class="editForm.status == 3 ? 'darkColor' : ''" class="cname">{{ editForm.couponName }}</div>
<img src="../../images/unCash.png" class="couponImg" v-if="editForm.status == 3" /> <img class="couponImg" :src="require(`../../images/${editForm.status == 3 ? 'unCash' : 'cash'}.png`)" />
<img src="../../images/cash.png" class="couponImg" v-else />
</div> </div>
<!-- <div class="ctype"> <!-- <div class="ctype">
<div class="ctypeName"></div> <div class="ctypeName"></div>
...@@ -33,16 +32,13 @@ ...@@ -33,16 +32,13 @@
</div> </div>
<div style="height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"></div> <div style="height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"></div>
<div class="process"> <div class="process">
<img src="../../images/unArrow.png" v-if="editForm.status == 3" /> <img :src="require(`../../images/${editForm.status == 3 ? 'unArrow' : 'arrow'}.png`)" />
<img src="../../images/arrow.png" v-else />
<span class="process_text">导航到店</span> <span class="process_text">导航到店</span>
<img class="rightArrow" src="../../images/rightArrow.png" /> <img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unCar.png" v-if="editForm.status == 3" /> <img :src="require(`../../images/${editForm.status == 3 ? 'unCar' : 'car'}.png`)" />
<img src="../../images/car.png" v-else />
<span class="process_text">开始服务</span> <span class="process_text">开始服务</span>
<img class="rightArrow" src="../../images/rightArrow.png" /> <img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unTicket.png" v-if="editForm.status == 3" /> <img :src="require(`../../images/${editForm.status == 3 ? 'unTicket' : 'ticket'}.png`)" />
<img src="../../images/ticket.png" v-else />
<span class="process_text">出示核销码</span> <span class="process_text">出示核销码</span>
</div> </div>
</div> </div>
...@@ -110,6 +106,13 @@ ...@@ -110,6 +106,13 @@
</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>
</template> </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="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
<!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 --> <!-- 只有使用途径为线上商品时才有效,到店核销时屏蔽 -->
<template slot="goodsHtml"> <template slot="goodsHtml">
<el-radio v-model="editForm.goods" label="1" v-if="apear == 'couponAdd'">全部商品可用</el-radio> <el-radio v-model="editForm.goods" label="1" v-if="apear == 'couponAdd'">全部商品可用</el-radio>
...@@ -137,6 +140,10 @@ ...@@ -137,6 +140,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</glsx-combi-form> </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>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
...@@ -159,10 +166,6 @@ export default { ...@@ -159,10 +166,6 @@ export default {
userDisable: false, userDisable: false,
size: 'small', size: 'small',
title: '创建', title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
...@@ -250,7 +253,6 @@ export default { ...@@ -250,7 +253,6 @@ export default {
width: '320px', width: '320px',
type: 'input', type: 'input',
maxlength: 20 maxlength: 20
// index:0
}, },
{ {
label: '预估成本/元', label: '预估成本/元',
...@@ -258,82 +260,97 @@ export default { ...@@ -258,82 +260,97 @@ export default {
width: '320px', width: '320px',
type: 'input', type: 'input',
isDisabled: false isDisabled: false
// index:1
}, },
{ {
label: '使用途径', label: '使用途径',
name: 'useChannel', name: 'useChannel',
addHtml: 'useChannelHtml' addHtml: 'useChannelHtml'
// index:2
}, },
{ {
label: '有效期', label: '有效期',
name: 'effectiveType', name: 'effectiveType',
addHtml: 'effectiveHtml' addHtml: 'effectiveHtml'
// index:3
}, },
{ {
label: '使用限制', label: '使用限制',
name: 'useBarriers', name: 'useBarriers',
addHtml: 'useBarriersHtml' addHtml: 'useBarriersHtml'
// index:4
}, },
{ {
label: '适用商品', label: '适用商品',
name: 'goods', name: 'goods',
addHtml: 'goodsHtml', addHtml: 'goodsHtml',
isHide: false isHide: false
// index:6
}, },
{ {
// label: '门店', // label: '门店',
name: '', name: '',
addHtml: 'proTable', addHtml: 'proTable',
isHide: true isHide: true
// index:7
}, },
{ {
label: '面值', label: '面值',
name: 'denomination', name: 'denomination',
addHtml: 'denominationHtml' addHtml: 'denominationHtml'
// index:8
}, },
{ {
label: '库存', label: '库存',
name: 'stock', name: 'stock',
width: '150px', addHtml: 'stock'
type: 'input' // width: '150px',
// index:9 // type: 'input'
}, },
{ {
label: '使用规则', label: '使用规则',
name: 'directionalFlag', name: 'directionalFlag',
addHtml: 'directionalFlagHtml', addHtml: 'directionalFlagHtml',
isHide: false isHide: false
// index:5
}, },
{ {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
// index:10
}, },
{ {
name: '', name: 'editHtml',
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true isHide: true
// index:11 }
],
// 适用门店
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.editRule.stock[0].required = !this.$isGroupUp
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.getAllGoods() this.getAllGoods()
var id = this.routeInfo.id var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit var addOrEdit = this.routeInfo.addOrEdit
...@@ -342,7 +359,8 @@ export default { ...@@ -342,7 +359,8 @@ export default {
this.apear = 'couponSee' this.apear = 'couponSee'
this.showSubmit = false this.showSubmit = false
this.title = '查看' this.title = '查看'
this.editFormData[11].isHide = false let idx = this.editFormData.findIndex(item => item.name == 'editHtml')
this.editFormData[idx].isHide = false
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -699,7 +717,13 @@ export default { ...@@ -699,7 +717,13 @@ export default {
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { 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) {
if (this.priceFlag && this.editForm.useChannel == 1) { if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品 //存在零售价低于代金券的商品
return return
...@@ -745,7 +769,7 @@ export default { ...@@ -745,7 +769,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -119,6 +119,13 @@ ...@@ -119,6 +119,13 @@
</el-radio> </el-radio>
</el-form-item> </el-form-item>
</template> </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="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
<template slot="useDescriptionHtml"> <template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" /> <el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template> </template>
...@@ -126,6 +133,10 @@ ...@@ -126,6 +133,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</glsx-combi-form> </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>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
...@@ -201,7 +212,7 @@ export default { ...@@ -201,7 +212,7 @@ export default {
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }], effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }], useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }],
stock: [{ required: true, message: '发放数量不能为空', trigger: 'change' }] stock: [{ required: true, message: '库存不能为空', trigger: 'change' }]
}, },
editFormData: [ editFormData: [
{ {
...@@ -231,18 +242,18 @@ export default { ...@@ -231,18 +242,18 @@ export default {
addHtml: 'useLimitHtml' addHtml: 'useLimitHtml'
}, },
{ {
label: '发放数量', label: '库存',
name: 'stock', name: 'stock',
width: '180px', addHtml: 'stock'
type: 'input', // width: '180px',
append: '张' // type: 'input',
// append: '张'
}, },
{ {
label: '使用规则', label: '使用规则',
name: 'directionalFlag', name: 'directionalFlag',
addHtml: 'directionalFlagHtml', addHtml: 'directionalFlagHtml',
isHide: false isHide: false
// index:5
}, },
{ {
label: '有效期', label: '有效期',
...@@ -259,10 +270,37 @@ export default { ...@@ -259,10 +270,37 @@ export default {
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true 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.editRule.stock[0].required = !this.$isGroupUp
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -470,7 +508,13 @@ export default { ...@@ -470,7 +508,13 @@ export default {
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { 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() var params = this.getCouponInfoParams()
let method = '' let method = ''
if (params.couponId) { if (params.couponId) {
...@@ -505,7 +549,7 @@ export default { ...@@ -505,7 +549,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <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="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="slider"> <div class="slider">
...@@ -54,6 +54,13 @@ ...@@ -54,6 +54,13 @@
</div> </div>
<p class="edit-title">{{ title }}兑换券</p> <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"> <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="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
<template slot="directionalFlagHtml"> <template slot="directionalFlagHtml">
<div> <div>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio> <el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">所有客户可用</el-radio>
...@@ -89,6 +96,10 @@ ...@@ -89,6 +96,10 @@
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button> <el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template> </template>
</glsx-combi-form> </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>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button> <el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
...@@ -158,7 +169,7 @@ export default { ...@@ -158,7 +169,7 @@ export default {
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }], effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }], effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }], useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }],
stock: [{ required: true, message: '发放数量不能为空', trigger: 'change' }] stock: [{ required: true, message: '库存不能为空', trigger: 'change' }]
}, },
editFormData: [ editFormData: [
{ {
...@@ -176,11 +187,12 @@ export default { ...@@ -176,11 +187,12 @@ export default {
isDisabled: false isDisabled: false
}, },
{ {
label: '发放数量', label: '库存',
name: 'stock', name: 'stock',
width: '180px', addHtml: 'stock'
type: 'input', // width: '180px',
append: '张' // type: 'input',
// append: '张'
}, },
{ {
label: '使用规则', label: '使用规则',
...@@ -204,10 +216,37 @@ export default { ...@@ -204,10 +216,37 @@ export default {
addHtml: 'editHtml', addHtml: 'editHtml',
isHide: true 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.editRule.stock[0].required = !this.$isGroupUp
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -373,7 +412,13 @@ export default { ...@@ -373,7 +412,13 @@ export default {
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { 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() var params = this.getCouponInfoParams()
let method = '' let method = ''
if (params.couponId) { if (params.couponId) {
...@@ -408,7 +453,7 @@ export default { ...@@ -408,7 +453,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => {}) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -42,10 +42,21 @@ ...@@ -42,10 +42,21 @@
</el-form-item> </el-form-item>
</el-radio> </el-radio>
</template> </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="请输入库存">
<span slot="suffix">张</span>
</el-input>
</template>
<template slot="useDescriptionHtml"> <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> </template>
</glsx-combi-form> </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>
<!-- <div class="left_show"> <!-- <div class="left_show">
<div class="card-panel-top"> <div class="card-panel-top">
...@@ -156,18 +167,46 @@ export default { ...@@ -156,18 +167,46 @@ export default {
{ {
label: '库存', label: '库存',
name: 'stock', name: 'stock',
width: '150px', addHtml: 'stock'
type: 'input' // width: '150px',
// type: 'input'
}, },
{ {
label: '使用说明', label: '使用说明',
name: 'useDescription', name: 'useDescription',
addHtml: 'useDescriptionHtml' addHtml: 'useDescriptionHtml'
} }
],
// 适用门店
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.editRule.stock[0].required = !this.$isGroupUp
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -335,7 +374,13 @@ export default { ...@@ -335,7 +374,13 @@ export default {
handleConfirm() { handleConfirm() {
this.validateRules() this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { 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() var params = this.getCouponInfoParams()
let method = '' let method = ''
if (params.couponId) { if (params.couponId) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!