Commit 8431eec5 by 前端

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

Wangzh dev 2.3.0

See merge request !146
2 parents 1a641c51 c1175b88
......@@ -77,6 +77,16 @@ const exportGiftInfoApi = params => {
// 编辑-选择定向礼包列表
const getDirectionalGiftListApi = params => {
params.method = 'scrm.api.coupon.directional.gift.coupon.list'
// params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
const getghDirectionalGiftListApi = params => {
// params.method = 'scrm.api.coupon.directional.gift.coupon.list'
params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({
......@@ -85,7 +95,7 @@ const getDirectionalGiftListApi = params => {
data: params,
sign: true
})
}
}
const insertGiftApi = params => {
params.method = 'scrm.api.coupon.directional.gift.create'
......@@ -109,4 +119,4 @@ const templateModal = params => {
})
}
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal }
export default { getFollowerStaffListApi, getListApi, giftExportApi, deleteGiftApi, getGiftInfoApi, getReceivedGiftInfoApi, exportGiftInfoApi, getDirectionalGiftListApi, insertGiftApi, templateModal ,getghDirectionalGiftListApi }
......@@ -40,7 +40,8 @@ const orderRefund = params => {
url: '/rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
sign: true,
returnAll: true
})
}
//套餐使用详情
......
......@@ -8,15 +8,15 @@ export function debounce(func, wait = 200) {
}
}
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm:ss') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
mm: date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes(),
ss: date.getSeconds()<10?'0'+date.getSeconds():date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
......
......@@ -11,7 +11,7 @@
<el-input :size="size" v-model="searchForm.packageName" placeholder="请输入名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="类型" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.orderType" placeholder="请选择">
<el-select size="small" v-model="searchForm.orderType" placeholder="请选择">
<el-option v-for="item in orderTypeList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
......@@ -150,7 +150,10 @@ export default {
{
label: '用户信息',
prop: 'accountName'
prop: 'accountName',
formatter: cellValue => {
return cellValue.accountName + ' ' + cellValue.mobile
}
},
{
label: '订单号',
......@@ -167,12 +170,8 @@ export default {
},
created() {
if (window.__POWERED_BY_QIANKUN__) {
console.log('kkk', this.$globalState)
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
if (this.merchantModel == 1 && this.accountLevel == 1) {
this.searchForm.orderType = 2
}
}
},
mounted() {},
......@@ -231,6 +230,13 @@ export default {
this.refundVisible = !this.refundVisible
},
refundConfirmDialog() {
if (this.refund == '') {
this.$message({
message: '请输入退款说明',
type: 'error'
})
return
}
const params = {
reason: this.refund,
orderCode: this.orderCode
......@@ -251,8 +257,7 @@ export default {
this.$router.push({
path: '/memberCenter/orderDetail',
query: {
id: row.id,
detail: row
id: row.id
}
})
},
......
......@@ -27,6 +27,13 @@
<template slot="orderType" slot-scope="scope">
<span>{{ scope.scope.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template>
<template slot="amount">
<span>1</span>
</template>
<template slot="totalPrice" slot-scope="scope">
<span>{{ scope.scope.originalPrice * 1 }}</span>
</template>
<template slot="orderStatus" slot-scope="scope">
<span>{{ scope.scope.orderStatus == 2 ? '待收货' : scope.scope.orderStatus == 3 ? '已完成' : scope.scope.orderStatus == 4 ? '售后中' : scope.scope.orderStatus == 5 ? '退款失败' : scope.scope.orderStatus == 6 ? '已退款' : '' }}</span>
</template>
......@@ -59,80 +66,6 @@
<el-button type="primary" @click="goBack">返回</el-button>
</div>
</div>
<!-- <div class="live-room container">
<div class="topMsg">
<div class="orderNo">订单编号:{{ detail.orderCode }}</div>
<div class="orderTime">下单时间:{{ detail.createDate }}</div>
<el-button type="primary" size="small" class="backBtn" @click="goBack">
返回
</el-button>
</div>
<div class="midMsgWrap">
<div class="midMsgTitle">
<span>支付信息</span>
<span>用户信息</span>
<span>服务名称</span>
<span>已核/总次数</span>
</div>
<div class="midMsgContent">
<div class="item">
<div>付款状态:已付款</div>
<div>
付款金额:{{ detail.realPayPrice }}
<span v-show="detail.realPayPrice">元</span>
</div>
<div>付款方式:微信支付</div>
<div>付款时间:{{ detail.createDate }}</div>
</div>
<div class="item">
<div class="userName">用户名称:{{ detail.accountName }}</div>
<div class="phoneNumber">用户手机号:{{ detail.mobile }}</div>
</div>
<div class="item">
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceName }}</div>
</div>
<div class="item">
<div v-for="(item, index) in detail.list" :key="index">{{ item.serviceAmount }}/{{ item.serviceCount }}次</div>
</div>
</div>
</div>
<div id="tableWrap">
<div class="tableWrapBox">
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ height: '54px', background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column label="商品名称" align="center">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.couponList" :key="index">{{ item.couponName }}</div>
</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">
<span>{{ scope.row.orderType == 1 ? '套餐' : '权益卡' }}</span>
</template>
</el-table-column>
<el-table-column label="有效期" align="center" v-if="detail.orderType == 2">
<template slot-scope="scope">
<span>{{ scope.row.effectiveNum == '-1' ? '无限制' : scope.row.effectiveNum + '天' }}</span>
</template>
</el-table-column>
<el-table-column prop="originalPrice" label="单价/元" align="center"></el-table-column>
<el-table-column prop="amount" label="数量" align="center"></el-table-column>
<el-table-column prop="totalPrice" label="小计/元" align="center"></el-table-column>
<el-table-column prop="realPayPrice" label="实收金额" align="center">
<template slot-scope="scope">
<span style="color:#EB4E4E">{{ scope.row.realPayPrice }}</span>
</template>
</el-table-column>
<el-table-column prop="orderStatus" label="状态" align="center">
<template slot-scope="scope">
<div>{{ scope.row.refundReason }}</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div> -->
</div>
</template>
......@@ -233,8 +166,8 @@ export default {
},
{
colList: [
{ thColspan: 1, tdColspan: 2, label: '数量', name: 'amount' },
{ thColspan: 1, tdColspan: 2, label: '小计/元', name: 'totalPrice' }
{ thColspan: 1, tdColspan: 2, label: '数量', name: 'amount', addHtml: 'amount' },
{ thColspan: 1, tdColspan: 2, label: '小计/元', name: 'totalPrice', addHtml: 'totalPrice' }
]
},
{
......@@ -306,9 +239,6 @@ export default {
created() {
if (window.__POWERED_BY_QIANKUN__) {
this.accountLevel = this.$globalState.session.accountLevel
if (this.accountLevel == 4) {
this.basicParams.splice(6, 1)
}
}
this.tableSearchForm = {
id: this.$route.query.id
......@@ -316,20 +246,13 @@ export default {
this.getOrderPageDetail()
},
mounted() {
// this.$nextTick(() => {
// let clientHeight = document.documentElement.clientHeight
// let offsettop = document.getElementById('tableWrap').offsetTop
// document.getElementById('tableWrap').style.minHeight = clientHeight - offsettop - 120 + 'px'
// })
},
mounted() {},
methods: {
dateFormatFun(date) {
return dateFormat(date)
},
getOrderPageDetail() {
getOrderPageDetail({ id: this.$route.query.id }).then(res => {
// this.mylist=res.list
if (res.code == '0') {
this.detailData = res.data
} else {
......
......@@ -23,6 +23,9 @@
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
......@@ -31,6 +34,9 @@
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toCashRestrictLabelText(scope.scope) }}</span>
</span>
......@@ -39,6 +45,9 @@
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
......@@ -47,6 +56,9 @@
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="stock" slot-scope="scope">
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
......@@ -142,13 +154,6 @@ export default {
label: '名称',
prop: 'couponName'
},
// {
// label: '预估成本/元',
// prop: 'anticipatedCost',
// formatter: cellValue => {
// return (cellValue.anticipatedCost / 100).toFixed(2)
// }
// },
{
label: '有效期',
prop: 'effectiveType',
......@@ -156,8 +161,8 @@ export default {
},
{
label: '可用次数',
prop: 'effectiveType',
addHtml: 'effectiveType'
prop: 'useType',
addHtml: 'useType'
},
{
label: '适用范围',
......@@ -172,7 +177,8 @@ export default {
},
{
label: '剩余库存',
prop: 'residueAmount'
prop: 'stock',
addHtml: 'stock'
}
]
}
......@@ -236,7 +242,7 @@ export default {
}
this.loading = true
this.$apis.giftBag
.getDirectionalGiftListApi(params)
.getghDirectionalGiftListApi(params)
.then(res => {
// 重置分页组件
if (this.$refs[this.activeName + 'Ref'] && isResetPage) {
......
......@@ -16,7 +16,7 @@
/>
</div>
<tip-panel class="list-panel" panelMinHeight="40px" :panelContent="panelContent" v-if="isFirstShow" @closePanel="closePanel"></tip-panel>
<template v-if="accountLevel == 4">
<template v-if="accountLevel == 4 && merchantModel == 1">
<div class="setmeal-tabs flex-default m-t-10">
<template v-for="(tab, index) in tabList">
<div :class="['tab', tab.checked ? 'active' : '']" @click="changeTab(index)" :key="index">{{ tab.text }}</div>
......@@ -33,31 +33,33 @@
<ticket :choseItemList="scope.scope.list"></ticket>
</div>
</span>
<span class="table-btns" slot="optionsFun" slot-scope="scope" :data="scope.scope">
<!-- 是否置顶推荐:1 是;2 否 -->
<el-button type="text" v-if="scope.scope.topFlag == 1">已指定推荐</el-button>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2" fn="置顶推荐">置顶推荐</GLButton>
<template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<template v-if="!(accountLevel == 4 && activetab == 1)">
<template v-if="scope.scope.state === 0">
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<template v-else-if="scope.scope.state === 1">
<!-- <el-button type="text" @click="handleDownOption(scope.scope)">下架</el-button>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<template v-else-if="scope.scope.state === 1">
<!-- <el-button type="text" @click="handleDownOption(scope.scope)">下架</el-button>
<el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button> -->
<GLButton type="text" @click="handleDownOption(scope.scope)" fn="下架">下架</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
</template>
<template v-else>
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<GLButton type="text" @click="handleDownOption(scope.scope)" fn="下架">下架</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
</template>
<template v-else>
<!-- <el-button type="text" @click="handleEdit(scope.scope)">编辑</el-button>
<el-button type="text" @click="handleUpOption(scope.scope)">上架</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
<GLButton type="text" @click="handleEdit(scope.scope)" fn="编辑套餐">编辑</GLButton>
<GLButton type="text" @click="handleUpOption(scope.scope)" fn="上架">上架</GLButton>
<GLButton type="text" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
</template>
<GLButton type="text" @click="handleUpdateToTop(scope.scope)" v-if="scope.scope.topFlag == 2" fn="置顶推荐">置顶推荐</GLButton>
<el-button type="text" v-if="scope.scope.topFlag == 1">已置顶推荐</el-button>
</template>
</span>
</GLTable>
......@@ -141,33 +143,25 @@ export default {
{
label: '套餐名称',
prop: 'packageName',
width: '180'
width: 220
},
{
label: '套餐售价/元',
prop: 'packagePrice',
width: 140
prop: 'packagePrice'
},
{
label: '说明',
prop: 'notes',
width: 160,
width: 300,
line: 4
},
{
label: '购买人数',
prop: 'buyNumber',
line: 1
label: '售出数量',
prop: 'buyNumber'
},
{
label: '套餐总价',
prop: 'referencePrice'
},
{
label: '状态',
prop: 'state',
width: '80',
formatter: cellValue => {
return this.baseDataList.stateList.find(item => item.confId == cellValue.state).confName
}
......@@ -176,7 +170,7 @@ export default {
label: '操作',
prop: 'optionsFun',
addHtml: 'optionsFun',
width: 160
width: 220
}
]
},
......@@ -191,7 +185,7 @@ export default {
},
computed: {
getListApi() {
const { activetab, merchantModel, accountLevel } = this
const { activetab } = this
let listApi = getSetMealListApi
if (activetab == 1) {
listApi = getSetMealListApi
......@@ -202,39 +196,48 @@ export default {
}
},
created() {
console.log(this.$route.query.activetab)
if (window.__POWERED_BY_QIANKUN__) {
//运行在qiankun容器中
this.merchantId = this.$globalState.session.merchantId
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
// this.userType = this.$globalState.session.userType
if (this.merchantModel == 2) {
this.activetab = 0
}
}
this.searchForm = {
merchantId: this.merchantId
// merchantName
}
if (this.$route.query && this.$route.query.activetab) {
this.activetab = 0
// this.changeTab(this.activetab)
this.tabList.forEach(item => (item.checked = false))
this.tabList[this.activetab].checked = true
}
this.dynamicFile()
this.getLoginCountFun()
},
mounted() {},
methods: {
dynamicFile() {
const { activetab, merchantModel, accountLevel } = this
let { activetab, accountLevel } = this
const saleParam = {
label: '在本店售出数量',
prop: 'buyNumber',
width: 140
label: '售出数量',
prop: 'buyNumber'
}
const referencePrice = {
label: '套餐总价',
prop: 'referencePrice'
}
// accountLevel == 4
if (activetab == 1 && accountLevel == 4) {
this.tableParams.tableColumns.splice(5, 1, saleParam)
} else {
this.tableParams.tableColumns.splice(5, 1, referencePrice)
if ((activetab == 1 && accountLevel == 4) || accountLevel != 4) {
this.tableParams.tableColumns.splice(4, 1, saleParam)
} else if (activetab == 0 && accountLevel == 4) {
this.tableParams.tableColumns.splice(4, 1, referencePrice)
}
},
changeTab(index) {
......
......@@ -13,15 +13,9 @@
<el-form-item size="small" label="服务内容" class="is-required">
<el-button @click="handleGiftAdd" size="small" class="default-blue-btn">选择服务</el-button>
<div class="gift-block m-t-10" :style="{ 'margin-left': labelWidth }" v-show="choseItemList.length != 0">
<!-- <div class="gift-title">
合计:
<span class="price">{{ totalEstimatedCost }}</span>
元
</div> -->
<div v-for="(item, index) in orderShow" :key="index">
<div class="gift-box flex-top" v-show="couponObj[item].list.length">
<img class="gift-logo" :src="couponObj[item].logo" alt="" />
<!-- <div class="gift-label">{{ couponObj[item].label }}:</div> -->
<div class="gift-content">
<div class="gift-item" v-for="(subItem, subIndex) in couponObj[item].list" :key="subIndex">
<span :class="['circle', subItem.status == '3' ? ' grey' : '']"></span>
......@@ -33,23 +27,11 @@
</div>
</div>
</div>
<!-- <div class="allChoseWrap" v-if="this.choseItemList.length > 0">
<div class="choseItem" v-for="(item, index) in choseItemList" :key="index">
<span>{{ item.couponName }}×{{ item.serviceQuantity }}</span>
<div class="close-x" @click="closeChoseItemFun(item, index)">×</div>
</div>
</div> -->
<div class="el-form-item__error" v-if="setmealContentRules">请选择套餐</div>
<!-- <div class="totalWrap" v-if="this.choseItemList.length > 0">
<span>合计:</span>
<span>{{ totalPrice }}元</span>
</div> -->
</el-form-item>
<el-form-item size="small" label="套餐售价" prop="packagePrice" style="width: 315px">
<el-input size="small" v-model="ruleForm.packagePrice" placeholder="请输入套餐售价" @keyup.native="ruleForm.packagePrice = oninput(ruleForm.packagePrice)">
<!-- <template slot="append">元</template> -->
<span slot="suffix" class="suffix-label">元</span>
</el-input>
</el-form-item>
......@@ -83,18 +65,14 @@
</el-form-item>
</el-form>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="submitForm()" size="medium" :loading="sloading">创建</el-button>
<el-button type="primary" @click="goBack" size="medium">取消</el-button>
<div class="footer-panel">
<div>
<el-button type="primary" @click="submitForm()" size="medium" :loading="sloading">创建</el-button>
<el-button type="primary" @click="goBack" size="medium">取消</el-button>
</div>
</div>
<!-- :modalAppendToBody="false" -->
<glsx-dialog title="套餐服务" class="setmealServiceDialog" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<!-- <glsx-dialog title="套餐服务" class="setmealServiceDialog" width="1142px" :noCancel="true" :noClose="false" btnSize="small" :isVisible="setmealDialogVisible" @closeDialog="handleClose" @confirmDialog="handleConfirm">
<div class="content-body">
<div class="subTitle">
<span>请选择套餐服务:</span>
......@@ -116,13 +94,6 @@
<div class="useTime" v-if="item.useType == 0">有效期内无限制</div>
<div class="useTime" v-if="item.useType == 1">有效期内可使用{{ item.useAmount }}次</div>
<div class="useTime" v-if="item.useType == 2">每{{ item.useLimitDays }}天可以使用{{ item.useAmount }}次</div>
<!-- <div class="select-package-time" ng-show="item.effectiveType == 3">有效期:无有效期</div>
<div class="select-package-time" ng-show="item.effectiveType == 1">有效期:{{item.effectiveDays}}天</div>
<div class="select-package-time" ng-show="item.effectiveType == 2">有效期:{{item.effectiveStartTime.split(' ')[0]}} - {{item.effectiveEndTime.split(' ')[0]}}</div>
<div class="select-package-time" ng-show="item.useType == 0">有效期内无限制</div>
<div class="select-package-time" ng-show="item.useType == 1">有效期内可使用{{item.useAmount}}次</div>
<div class="select-package-time" ng-show="item.useType == 2">每{{item.useLimitDays}}天可以使用{{item.useAmount}}次</div> -->
</div>
<div class="optionBtns" v-if="item.serviceQuantity > 0">
......@@ -144,7 +115,7 @@
<span class="redText">{{ totalPrice }}</span>
</div>
</div>
</glsx-dialog>
</glsx-dialog> -->
<glsx-dialog title="" top="30vh" :hasScroll="false" class="tipDialog" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isTipDialogVisible" :showClose="false" @closeDialog="handleTipClose" @confirmDialog="handleTipConfirm">
<div class="content-body">
<img src="@/assets/icon-warning.png" alt="" />
......@@ -197,7 +168,6 @@ export default {
merchantName: '',
setmealContentRules: false,
//弹窗
setmealDialogVisible: false,
//弹窗2(提示弹窗)
isTipDialogVisible: false,
selectNum: 0,
......@@ -274,23 +244,7 @@ export default {
this.getCardContentFun()
this.getSetmealServiceFun() //获取服务套餐,执行完了之后去获取编辑详情
},
watch: {
// allItemList: {
// deep: true,
// handler(val) {
// this.choseItemList = this.allItemList.filter(item => item.serviceQuantity > 0)
// this.choseItemList = this.choseItemList.map(ele => {
// return {
// ...ele,
// serviceId: ele.id
// }
// })
// }
// }
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
getCardContentFun() {
......@@ -311,8 +265,6 @@ export default {
this.choseItemList.push(k)
})
})
console.log(this.choseItemList, 'choseItemList')
// this.hasCouponBlock()
},
handleGiftDelete(attr, idx) {
this.couponObj[attr].list.splice(idx, 1)
......@@ -333,7 +285,6 @@ export default {
this.totalEstimatedCost = (this.totalEstimatedCost / 100).toFixed(2)
},
handleGiftAdd() {
console.log(this.couponObj)
this.selectedMealList = JSON.parse(JSON.stringify(this.couponObj))
this.handleGiftClose()
},
......@@ -343,7 +294,6 @@ export default {
handleGiftConfirm(selectedData) {
this.handleGiftClose()
this.couponObj = selectedData
// this.recoveryTotalPrice()
this.recoveryGiftList()
},
recoveryCoupon() {
......@@ -353,26 +303,6 @@ export default {
this.choseItemList.forEach(item => {
this.couponObj[this.numToCoupon[item.discountType]].list.push(item)
})
console.log(this.couponObj, 'this.couponObj')
// this.currentCoupons = this.$common.utils.deepClone(this.editForm.couponList)
// this.currentPeople = this.$common.utils.deepClone(this.editForm.staffList)
// this.hasCouponBlock(false)
},
openDialog() {
this.allItemList.forEach(item => {
item.serviceQuantity = 0
})
this.allItemList.forEach(item => {
for (let i = 0; i < this.choseItemList.length; i++) {
if (this.choseItemList[i].serviceId == item.id) {
item.serviceQuantity = this.choseItemList[i].serviceQuantity
}
}
})
this.selectNumFun()
this.setmealDialogVisible = true
this.setmealContentRules = false
},
//编辑详情
getServiceInfo() {
......@@ -391,9 +321,6 @@ export default {
}
})
this.recoveryCoupon()
// this.recoveryTotalPrice()
console.log('编辑内容', this.choseItemList, this.totalPrice)
this.copyTotalPrice = this.totalPrice
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm)) //深拷贝一份数据
this.copyChoseItemList = this.choseItemList
......@@ -415,56 +342,14 @@ export default {
serviceQuantity: 0
}
})
console.log(this.allItemList, '服务套餐')
if (this.id) {
this.getServiceInfo() //获取编辑详情
}
})
},
//选中该条服务套餐
handlePackage(item, index) {
if (item.serviceQuantity == 0) {
item.serviceQuantity++
this.selectNumFun()
}
},
//删除该条服务套餐(让item.serviceQuantity==0)
closeChoseItemFun(item, index) {
this.totalPrice = ((this.totalPrice * 100 - item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
// item.serviceQuantity = 0
// this.allItemList.forEach(ele => {
// if (ele.id == item.serviceId) {
// ele.serviceQuantity = 0
// }
// })
// this.selectNumFun()
this.choseItemList.splice(index, 1)
},
selectNumFun() {
this.selectNum = 0
this.totalPrice = 0
this.allItemList.forEach(item => {
if (item.serviceQuantity) {
this.selectNum++
this.totalPrice = ((this.totalPrice * 100 + item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
}
})
},
cutPackage(item, index) {
item.serviceQuantity--
this.selectNumFun()
},
addPackage(item, index) {
item.serviceQuantity++
this.selectNumFun()
},
submitForm(formName) {
console.log(formName)
this.$refs.ruleForm.validate(valid => {
console.log(valid)
if (!valid) {
console.log(this.choseItemList, 'this.choseItemList')
if (this.choseItemList.length <= 0) {
this.setmealContentRules = true
}
......@@ -511,7 +396,6 @@ export default {
this.sloading = false
})
} else {
console.log('创建')
//调创建的接口
let params = {}
params.referencePrice = this.totalPrice
......@@ -521,7 +405,6 @@ export default {
params.packagePrice = this.ruleForm.packagePrice
params.notes = this.ruleForm.notes
params.switchStatus = this.ruleForm.switchStatus ? 1 : 0
console.log(this.choseItemList)
let list = this.choseItemList
for (var i in list) {
params[`list[${i}].serviceQuantity`] = list[i].couponAmount
......@@ -536,7 +419,7 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.$router.push('/memberCenter/setmeal')
this.$router.push('/memberCenter/setmeal?activetab=0')
}
})
.catch(err => {
......@@ -601,36 +484,6 @@ export default {
str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位
return str
},
handleConfirm() {
var idx = this.allItemList.some(item => item.serviceQuantity > 0)
if (!idx) {
this.$message.error('请选择服务套餐')
return
}
// this.$emit('selectItem', this.allItemList,this.totalPrice);
this.choseItemList = this.allItemList.filter(item => item.serviceQuantity > 0)
this.choseItemList = this.choseItemList.map(ele => {
return {
...ele,
serviceId: ele.id
}
})
console.log('确定之后choseItemList', this.choseItemList)
this.setmealDialogVisible = false
},
handleClose() {
this.setmealDialogVisible = false
this.totalPrice = 0
this.choseItemList.forEach(item => {
this.totalPrice = ((this.totalPrice * 100 + item.vipPrice * item.serviceQuantity * 100) / 100).toFixed(2)
})
// this.totalPrice = this.choseItemList.reduce(function(preValue, choseItem) {
// //第二个参数这里是对象,不是number(n)
// return preValue + choseItem.vipPrice * choseItem.serviceQuantity
// }, 0)
// this.getSetmealServiceFun()
},
handleTipClose() {
this.isTipDialogVisible = false
},
......@@ -843,16 +696,22 @@ export default {
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
width: 100%;
bottom: 0px;
height: 64px;
height: 78px;
left: 220px;
width: 100%;
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
z-index: 999;
div {
display: inline-block;
position: relative;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
margin-left: -110px;
}
}
.setmealServiceDialog {
/deep/.el-dialog__headerbtn {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!