Commit 57341e02 by 周子尧

1

1 parent d10d5159
......@@ -90,15 +90,15 @@
</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="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left:80px" @click="editMessage">编辑</el-button>
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div>
......@@ -112,6 +112,8 @@ export default {
name: 'editCashCoupon',
data() {
return {
showSubmit:true,
userDisable:false,
size: 'small',
title: '创建',
titleObj: {
......@@ -212,67 +214,67 @@ export default {
name: 'estimatedCost',
width: '320px',
type: 'input',
maxlength: 20
// index:1
isDisabled: false
// index:1
},
{
label: '使用途径',
name: 'useChannel',
addHtml: 'useChannelHtml'
// index:2
// index:2
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
// index:3
// index:3
},
{
label: '使用限制',
name: 'useBarriers',
addHtml: 'useBarriersHtml'
// index:4
// index:4
},
{
label: '定制礼包专用',
name: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
// index:5
},
{
label: '适用商品',
name: 'goods',
addHtml: 'goodsHtml',
isHide: false
// index:6
// index:6
},
{
// label: '门店',
name: '',
addHtml: 'proTable',
isHide: true
// index:7
// index:7
},
{
label: '面值',
name: 'denomination',
addHtml: 'denominationHtml'
// index:8
// index:8
},
{
label: '库存',
name: 'stock',
width: '150px',
type: 'input'
// index:9
// index:9
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
// index:10
addHtml: 'useDescriptionHtml',
// index:10
},
{
name: '',
......@@ -296,8 +298,9 @@ export default {
if (id) {
if (addOrEdit == 3) {
this.apear = 'couponSee'
this.showSubmit = false
this.title = '查看'
this.editFormData[11].isHide = false
this.editFormData[11].isHide = false
} else if (addOrEdit == 2) {
this.apear = 'couponEdit'
this.title = '编辑'
......@@ -305,6 +308,7 @@ export default {
this.editFormData[0].isDisabled = true
this.editFormData[1].isDisabled = true
this.editFormData[9].isDisabled = true
this.userDisable = true
} else {
this.apear = 'couponAdd'
this.title = '创建'
......@@ -407,8 +411,11 @@ export default {
methods: {
// 编辑按钮
editMessage(){
editMessage() {
let estimatedCostIndex = this.editFormData.findIndex(item => item.name == 'estimatedCost')
this.editFormData[estimatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
......
......@@ -64,12 +64,15 @@
</el-form-item>
</template>
<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="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div>
......@@ -82,6 +85,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
showSubmit:true,
userDisable:false,
size: 'small',
title: '创建',
titleObj: {
......@@ -121,9 +126,11 @@ export default {
couponName: '',
effectiveType: '2',
effectiveTime: [],
effectiveDays: ''
effectiveDays: '',
estimatedCost: ''
},
editRule: {
estimatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
......@@ -140,6 +147,13 @@ export default {
maxlength: 20
},
{
label: '预估成本',
name: 'estimatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量',
name: 'stock',
width: '180px',
......@@ -155,6 +169,11 @@ export default {
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
}
]
}
......@@ -171,7 +190,9 @@ export default {
if (id) {
if (addOrEdit == 3) {
this.apear = 'couponSee'
this.showSubmit = false
this.title = '查看'
this.editFormData[5].isHide = false
} else if (addOrEdit == 2) {
this.apear = 'couponEdit'
this.title = '编辑'
......@@ -179,6 +200,8 @@ export default {
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled
this.editFormData[2].isDisabled = this.isDisabled
this.userDisable = true
} else {
this.apear = 'couponAdd'
this.title = '创建'
......@@ -216,6 +239,13 @@ export default {
},
methods: {
// 编辑按钮
editMessage() {
let estimatedCostIndex = this.editFormData.findIndex(item => item.name == 'estimatedCost')
this.editFormData[estimatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value
......@@ -225,13 +255,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.estimatedCost = (this.editForm.estimatedCost / 100).toFixed(2)
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
}
this.$nextTick(()=>{
this.$nextTick(() => {
this.editStatus = false
})
})
......@@ -265,7 +295,8 @@ export default {
obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '2'
//预估成本
obj.estimatedCost = form.estimatedCost
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
......@@ -327,12 +358,13 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.cancelJump()
})
.catch(() => {})
.then(() => {
this.cancelJump()
})
.catch(() => {})
} else {
this.cancelJump()
this.cancelJump()
}
}
}
......
<!-- 编辑兑换券 -->
<template>
<div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 630px;position: relative;">
<div class="container edit-container" style="height: 630px; position: relative">
<div class="right_show">
<div class="card-top"></div>
<div class="card_one">
......@@ -29,26 +29,29 @@
<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="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-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="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="userDisable" />
</template>
<template slot="editHtml">
<el-button style="margin-left: 80px" @click="editMessage">编辑</el-button>
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear != 'couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="primary" v-if="showSubmit" @click="handleConfirm">确定</el-button>
<el-button v-if="apear != 'couponSee'" @click="handleCancel">取消</el-button>
<el-button v-if="apear == 'couponSee'" @click="handleCancel">返回</el-button>
</div>
......@@ -61,6 +64,8 @@ export default {
name: 'editDiscountCoupon',
data() {
return {
showSubmit: true,
userDisable: false,
size: 'small',
title: '创建',
titleObj: {
......@@ -100,9 +105,11 @@ export default {
couponName: '',
effectiveType: '2',
effectiveTime: [],
effectiveDays: ''
effectiveDays: '',
estimatedCost: ''
},
editRule: {
estimatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
......@@ -119,6 +126,13 @@ export default {
maxlength: 20
},
{
label: '预估成本',
name: 'estimatedCost',
width: '320px',
type: 'input',
isDisabled: false
},
{
label: '发放数量',
name: 'stock',
width: '180px',
......@@ -134,6 +148,11 @@ export default {
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
},
{
name: '',
addHtml: 'editHtml',
isHide: true
}
]
}
......@@ -150,6 +169,8 @@ export default {
if (id) {
if (addOrEdit == 3) {
this.apear = 'couponSee'
this.editFormData[5].isHide = false
this.showSubmit = false
this.title = '查看'
} else if (addOrEdit == 2) {
this.apear = 'couponEdit'
......@@ -158,6 +179,7 @@ export default {
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[1].isDisabled = this.isDisabled
this.userDisable = true
} else {
this.apear = 'couponAdd'
this.title = '创建'
......@@ -195,6 +217,13 @@ export default {
},
methods: {
// 编辑按钮
editMessage() {
let estimatedCostIndex = this.editFormData.findIndex(item => item.name == 'estimatedCost')
this.editFormData[estimatedCostIndex].isDisabled = false
this.userDisable = false
this.showSubmit = true
},
setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value
......@@ -204,13 +233,13 @@ export default {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.estimatedCost = (this.editForm.estimatedCost / 100).toFixed(2)
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime, this.editForm.effectiveEndTime]
}
this.$nextTick(()=>{
this.$nextTick(() => {
this.editStatus = false
})
})
......@@ -244,7 +273,8 @@ export default {
obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '4'
//预估成本
obj.estimatedCost = form.estimatedCost
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
......@@ -306,12 +336,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!