Commit 066d8515 by 周子尧

1

1 parent b3edbf3e
......@@ -33,6 +33,10 @@
<el-radio v-model="editForm.useChannel" label="1" :disabled="apear != 'couponAdd'">线上商品</el-radio>
<el-radio v-model="editForm.useChannel" label="2" :disabled="apear != 'couponAdd'">到店核销</el-radio>
</template>
<template slot="directionalFlagHtml">
<el-radio v-model="editForm.directionalFlag" label="0" :disabled="apear != 'couponAdd'">否</el-radio>
<el-radio v-model="editForm.directionalFlag" label="1" :disabled="apear != 'couponAdd'">是</el-radio>
</template>
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
<br />
......@@ -88,6 +92,9 @@
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="apear == 'couponSee'" />
</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' }">
......@@ -134,6 +141,7 @@ export default {
isMutiSelectVisible: false,
editForm: {
couponName: '',
estimatedCost: '',
useChannel: '1',
effectiveType: '3',
effectiveTime: [],
......@@ -141,7 +149,8 @@ export default {
useBarriers: '1',
full: '',
goods: '1',
goodsRefList: []
goodsRefList: [],
directionalFlag: '0'
},
//商品列表
tableParams: {
......@@ -178,6 +187,7 @@ export default {
selectedProList: [],
editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
estimatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'change' }],
......@@ -195,49 +205,80 @@ export default {
width: '320px',
type: 'input',
maxlength: 20
// index:0
},
{
label: '预估成本',
name: 'estimatedCost',
width: '320px',
type: 'input',
maxlength: 20
// 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: 'directionalFlag',
addHtml: 'directionalFlagHtml',
isHide: false
// index:5
},
{
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
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
// index:10
},
{
name: '',
addHtml: 'editHtml',
isHide: true
// index:11
}
]
}
......@@ -256,12 +297,14 @@ export default {
if (addOrEdit == 3) {
this.apear = 'couponSee'
this.title = '查看'
this.editFormData[11].isHide = false
} else if (addOrEdit == 2) {
this.apear = 'couponEdit'
this.title = '编辑'
}
this.editFormData[0].isDisabled = true
this.editFormData[7].isDisabled = true
this.editFormData[1].isDisabled = true
this.editFormData[9].isDisabled = true
} else {
this.apear = 'couponAdd'
this.title = '创建'
......@@ -300,28 +343,31 @@ export default {
}
},
'editForm.useChannel'(newValue, oldValue) {
let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods')
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue == 1) {
this.editFormData[4].isHide = false
this.editFormData[goodHtmlIndex].isHide = false
if (this.editForm.goodsRefList.length) {
this.editFormData[5].isHide = false
this.editFormData[proTableIndex].isHide = false
}
} else {
this.editForm.useBarriers = '1'
this.editForm.full = ''
this.editFormData[4].isHide = true
this.editFormData[5].isHide = true
this.editFormData[goodHtmlIndex].isHide = true
this.editFormData[proTableIndex].isHide = true
}
},
'editForm.goods'(newValue, oldValue) {
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue == 1) {
//全部商品
this.minPirce = this.minPirceForAll
this.editFormData[5].isHide = true
this.editFormData[proTableIndex].isHide = true
} else {
//指定商品
this.minPirce = this.minPirceForPart
if (this.editForm.goodsRefList.length) {
this.editFormData[5].isHide = false
this.editFormData[proTableIndex].isHide = false
}
}
if (this.editForm.denomination && this.minPirce && this.editForm.denomination * 100 > this.minPirce) {
......@@ -332,10 +378,12 @@ export default {
},
'editForm.goodsRefList'(newValue, oldValue) {
let goodHtmlIndex = this.editFormData.findIndex(item => item.name == 'goods')
let proTableIndex = this.editFormData.findIndex(item => item.addHtml == 'proTable')
if (newValue.length) {
this.editFormData[5].isHide = false
this.editFormData[proTableIndex].isHide = false
} else {
this.editFormData[5].isHide = true
this.editFormData[proTableIndex].isHide = true
}
},
......@@ -358,6 +406,10 @@ export default {
},
methods: {
// 编辑按钮
editMessage(){
},
setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value
......@@ -458,9 +510,10 @@ export default {
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveTime = []
this.editForm.useChannel = this.editForm.useChannel + ''
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.estimatedCost = (this.editForm.estimatedCost / 100).toFixed(2)
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
......@@ -544,7 +597,10 @@ export default {
//满多少减
obj.full = form.full
}
//是否定制礼包专用
obj.directionalFlag = form.directionalFlag
//预估成本
obj.estimatedCost = form.estimatedCost
//面值
obj.denomination = form.denomination
//库存
......@@ -593,6 +649,7 @@ export default {
} else {
method = 'createCouponApi' //后台创建优惠券
}
console.log(params)
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
......
......@@ -127,6 +127,13 @@ export default {
}
},
{
label: '预估成本',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost / 100
}
},
{
label: '已领取',
prop: 'getAmount'
},
......
......@@ -3,17 +3,17 @@
<!-- //提示面板组件 -->
<tip-panel panelWidth="616px" panelMinHeight="60px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<div class="live-room container">
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="70px" label-position="right">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="70px" label-position="right">
<el-row>
<!-- <el-form-item size="small"> -->
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" -->
<GLButton type="primary" @click="handleCreate" style="margin-right:30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton>
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" -->
<GLButton type="primary" @click="handleCreate" style="margin-right: 30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton>
<!-- </el-form-item> -->
<el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
......@@ -33,7 +33,7 @@
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleLossOption(scope.scope)" fn="失效">失效</GLButton>
<GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务" >查看</GLButton>
<GLButton type="text" @click="handleLook(scope.scope)" fn="查看服务">查看</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<template v-else-if="scope.scope.status == 3">
......@@ -48,7 +48,7 @@
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleTakeOption(scope.scope)" fn="生效">生效</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑服务">编辑</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
</span>
</GLTable>
......@@ -57,8 +57,8 @@
</template>
<script>
import { getServiceListApi, effectiveService, deleteService,getLoginCount } from '@/api/modules/service'
import url from "@/assets/empty.png"
import { getServiceListApi, effectiveService, deleteService, getLoginCount } from '@/api/modules/service'
import url from '@/assets/empty.png'
import { serviceStatusList } from '@/common/constant'
import tipPanel from '@/components/tipPanel/index.vue'
export default {
......@@ -67,8 +67,8 @@ export default {
},
data() {
return {
url:url,
isReload:true,
url: url,
isReload: true,
isFirstShow: false,
panelContent: '会员服务:是由门店根据自店服务项目创建的线上服务券,如“一年十二次洗车券”、“陶瓷镀膜”等,客户购买后可到店出示服务券享受服务,门店扫码进行次数核销。',
size: 'small',
......@@ -76,7 +76,7 @@ export default {
searchForm: {
couponName: '',
merchantId: 44184606,
discountType:7//6:商品折扣券,7:会员服务
discountType: 7 //6:商品折扣券,7:会员服务
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
......@@ -99,6 +99,13 @@ export default {
line: 1
},
{
label: '预估成本(元)',
prop: 'anticipatedCost ',
formatter: cellValue => {
return cellValue.anticipatedCost/100
}
},
{
label: '有效期',
prop: 'effectiveType',
addHtml: 'effectiveType'
......@@ -125,7 +132,7 @@ export default {
{
label: '创建时间',
prop: 'createdDate',
width:95
width: 95
}
]
},
......@@ -139,13 +146,11 @@ export default {
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.searchForm.merchantId=this.merchantId
this.searchForm.merchantId = this.merchantId
}
this.getLoginCountFun()
},
mounted () {
this.getLoginCountFun()
},
mounted() {},
methods: {
getLoginCountFun() {
//loginType:4是查会员服务浏览次数
......@@ -179,13 +184,12 @@ export default {
},
handleReset() {
this.isReload=false
this.searchForm = { couponName: '', merchantId: this.merchantId, discountType:7 }
this.isReload = false
this.searchForm = { couponName: '', merchantId: this.merchantId, discountType: 7 }
// this.handleSearch()
this.$nextTick(()=>{
this.isReload=true
})
this.$nextTick(() => {
this.isReload = true
})
},
handleSearch() {
this.$refs.memberServiceRef.refreshTable()
......@@ -196,14 +200,14 @@ export default {
// if (!this.$refs.memberServiceRef.data.length) {
// this.$refs.memberServiceRef.setTableHeightFun()
// }
this.$refs.memberServiceRef.data.length ? (this.$refs.memberServiceRef.tableHeightValues = '') : this.$refs.memberServiceRef.setTableHeightFun()
this.$refs.memberServiceRef.data.length ? (this.$refs.memberServiceRef.tableHeightValues = '') : this.$refs.memberServiceRef.setTableHeightFun()
},
//创建服务
handleCreate() {
this.$router.push({
path: '/memberCenter/serviceAddUpdateLook',
query:{
$title:encodeURI('创建服务')
query: {
$title: encodeURI('创建服务')
}
})
},
......@@ -246,7 +250,7 @@ export default {
query: {
couponId: row.id,
title: '编辑',
$title:encodeURI('编辑服务')
$title: encodeURI('编辑服务')
}
})
},
......@@ -256,7 +260,7 @@ export default {
query: {
couponId: row.id,
title: '查看',
$title:encodeURI('查看服务')
$title: encodeURI('查看服务')
}
})
},
......@@ -285,8 +289,7 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.el-input--small .el-input__inner{
/deep/.el-input--small .el-input__inner {
width: 215px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!