Commit 543ac090 by chenwq

代金券-加字段(集团版集团账号)

1 parent 2c298503
......@@ -8,8 +8,7 @@
<div class="card_one">
<div class="flex">
<div :class="editForm.status == 3 ? 'darkColor' : ''" class="cname">{{ editForm.couponName }}</div>
<img src="../../images/unCash.png" class="couponImg" v-if="editForm.status == 3" />
<img src="../../images/cash.png" class="couponImg" v-else />
<img class="couponImg" :src="require(`../../images/${editForm.status == 3 ? 'unCash' : 'cash'}.png`)" />
</div>
<!-- <div class="ctype">
<div class="ctypeName"></div>
......@@ -33,16 +32,13 @@
</div>
<div style="height: 1px;background-color: rgb(238, 238, 238);margin: 7px 16px 8px;"></div>
<div class="process">
<img src="../../images/unArrow.png" v-if="editForm.status == 3" />
<img src="../../images/arrow.png" v-else />
<img :src="require(`../../images/${editForm.status == 3 ? 'unArrow' : 'arrow'}.png`)" />
<span class="process_text">导航到店</span>
<img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unCar.png" v-if="editForm.status == 3" />
<img src="../../images/car.png" v-else />
<img :src="require(`../../images/${editForm.status == 3 ? 'unCar' : 'car'}.png`)" />
<span class="process_text">开始服务</span>
<img class="rightArrow" src="../../images/rightArrow.png" />
<img src="../../images/unTicket.png" v-if="editForm.status == 3" />
<img src="../../images/ticket.png" v-else />
<img :src="require(`../../images/${editForm.status == 3 ? 'unTicket' : 'ticket'}.png`)" />
<span class="process_text">出示核销码</span>
</div>
</div>
......@@ -110,6 +106,11 @@
</el-input>
<span style="color: red; margin-left: 15px" v-if="priceFlag && editForm.useChannel == 1">{{ selectedAllProList.length ? '存在零售价低于代金券的商品' : '系统暂无已创建的商品,请先创建好商品后再配置代金券' }}</span>
</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="goodsHtml">
<el-radio v-model="editForm.goods" label="1" v-if="apear == 'couponAdd'">全部商品可用</el-radio>
......@@ -137,6 +138,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>
......@@ -159,10 +164,8 @@ export default {
userDisable: false,
size: 'small',
title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
// 集团版集团账号
isGroupUp: false,
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
......@@ -250,7 +253,6 @@ export default {
width: '320px',
type: 'input',
maxlength: 20
// index:0
},
{
label: '预估成本/元',
......@@ -258,82 +260,99 @@ export default {
width: '320px',
type: 'input',
isDisabled: false
// index:1
},
{
label: '使用途径',
name: 'useChannel',
addHtml: 'useChannelHtml'
// index:2
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
// index:3
},
{
label: '使用限制',
name: 'useBarriers',
addHtml: 'useBarriersHtml'
// index:4
},
{
label: '适用商品',
name: 'goods',
addHtml: 'goodsHtml',
isHide: false
// index:6
},
{
// label: '门店',
name: '',
addHtml: 'proTable',
isHide: true
// index:7
},
{
label: '面值',
name: 'denomination',
addHtml: 'denominationHtml'
// index:8
},
{
label: '库存',
name: 'stock',
width: '150px',
type: 'input'
// index:9
addHtml: 'stock'
// width: '150px',
// type: 'input'
},
{
label: '使用规则',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
// index:10
},
{
name: '',
name: 'editHtml',
addHtml: 'editHtml',
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.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
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.getAllGoods()
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
......@@ -342,7 +361,8 @@ export default {
this.apear = 'couponSee'
this.showSubmit = false
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) {
this.apear = 'couponEdit'
this.title = '编辑'
......@@ -699,7 +719,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) {
if (this.priceFlag && this.editForm.useChannel == 1) {
//存在零售价低于代金券的商品
return
......@@ -745,7 +771,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......@@ -854,6 +880,10 @@ export default {
margin-top: 8px;
}
.w-150 {
width: 150px;
}
.link-top {
width: 227px;
height: 1px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!