Commit 25747286 by chenyu

update: dist

parent 0c657dd8
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet type=text/css href=./static/css/iconfont.css><link rel=stylesheet type=text/css href=./static/css/common.css><link rel="shortcut icon" type=image/x-icon href=./static/img/favicon.ico><title>积分商城</title><link href=./static/css/app.e310b41f4a08e0d2e6f0f9d5db31ff3a.css rel=stylesheet></head><body><div id=app></div><script>(function() {
<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="stylesheet" href="./static/css/iconfont.css"><link rel="stylesheet" href="./static/css/common.css"><link rel="shortcut icon" type="image/x-icon" href="./static/img/favicon.ico"><title>积分商城</title><script defer="defer" src="/integral-mall/js/main.d8100c87a0922f5d0c1f.js"></script><link href="/integral-mall/css/main.f5689c5f6ca00e0735fb.css" rel="stylesheet"></head><body><div id="app"></div><script>(function() {
var src = '/component/static/import-component.js?timestrap=' + new Date().getTime();
var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host;
document.write('<script src="//' + host + src + '"><\/script>');
})();</script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.242a74965f304ce7e306.js></script><script type=text/javascript src=./static/js/app.adb3bd401fc167314d22.js></script></body></html>
\ No newline at end of file
})();</script><script src="//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js"></script><script src="//web-1251519181.file.myqcloud.com/components/track.1.0.4.js"></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version v4.2.6+9869a4bc
*/
/*!
* clipboard.js v2.0.1
* https://zenorocha.github.io/clipboard.js
*
* Licensed MIT © Zeno Rocha
*/
/*!
* vue-treeselect v0.0.35 | (c) 2017-2018 Riophae Lee
* Released under the MIT License.
* https://vue-treeselect.js.org/
*/
/**!
* Sortable 1.10.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,10 +3,14 @@
<div class="mall-content-section">
<div class="mall-content-title">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '' }"><a href="/report/#/memberSummary">首页</a></el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '' }">
<a href="/report/#/memberSummary">首页</a>
</el-breadcrumb-item>
<el-breadcrumb-item>积分商城</el-breadcrumb-item>
<el-breadcrumb-item>商品</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/coupon' }">优惠券</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/coupon' }">
优惠券
</el-breadcrumb-item>
<el-breadcrumb-item>{{ mallProId === '-1' ? '新建' : '编辑' }}优惠券</el-breadcrumb-item>
</el-breadcrumb>
<h3>
......@@ -14,25 +18,49 @@
</h3>
</div>
<div class="section" v-loading="submitLoading">
<el-form :model="couponForm" :rules="couponRules" ref="couponForm" label-width="100px" class="demo-ruleForm" label-position="right">
<el-form
:model="couponForm"
:rules="couponRules"
ref="couponForm"
label-width="100px"
class="demo-ruleForm"
label-position="right"
>
<div class="section-content">
<h3>选择卡券</h3>
<el-form-item label="选择卡券" required v-show="mallProId === '-1'">
<el-button plain @click="showCard" :disabled="cardList.length >= addCardMax">添加卡券</el-button>
<el-button plain @click="showCard" :disabled="cardList.length >= addCardMax">
添加卡券
</el-button>
<span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;">支持选择兑换券,最多支持添加{{ addCardMax }}张卡券</span>
</el-form-item>
<div class="alert-content" v-if="couponStatus">
<el-alert title="原卡券已被删除,请及时下线卡券,否则用户将无法兑换" type="warning"> </el-alert>
<el-alert title="原卡券已被删除,请及时下线卡券,否则用户将无法兑换" type="warning" />
</div>
<el-form-item label="选择卡券" required v-show="mallProId !== '-1'"> </el-form-item>
<el-table :data="cardList" style="width: 1000px;margin-left:135px;margin-bottom:22px;display:inline-block" v-show="cardList.length > 0" :style="{ marginTop: mallProId !== '-1' ? '-60px' : '' }">
<el-form-item label="选择卡券" required v-show="mallProId !== '-1'" />
<el-table
:data="cardList"
style="width: 1000px;margin-left:135px;margin-bottom:22px;display:inline-block"
v-show="cardList.length > 0"
:style="{ marginTop: mallProId !== '-1' ? '-60px' : '' }"
>
<el-table-column label="卡券名称" prop="cardName" min-width="140">
<template slot-scope="scope">
<p style="line-height:22px;">{{ scope.row.cardName }}</p>
<p class="fz13 gray" style="line-height:20px;color:#909399">{{ scope.row.subName }}</p>
<p style="line-height:22px;">
{{ scope.row.cardName }}
</p>
<p class="fz13 gray" style="line-height:20px;color:#909399">
{{ scope.row.subName }}
</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="false" width="165" align="left" prop="createTime" label="卡券模板投放期限">
<el-table-column
:show-overflow-tooltip="false"
width="165"
align="left"
prop="createTime"
label="卡券模板投放期限"
>
<template slot-scope="scope">
<span v-if="scope.row.putEffectiveMode == 0"> 固定日期:{{ getTime2(scope.row.putBeginDate) }}{{ getTime2(scope.row.putEndDate) }} </span>
<span v-else>长期有效</span>
......@@ -40,9 +68,15 @@
</el-table-column>
<el-table-column label="用户使用有效期" prop="limitDay" width="165">
<template slot-scope="scope">
<div v-if="scope.row.cardEffectiveMode == 0">固定日期:{{ getTime2(scope.row.beginDate) + '至' + getTime2(scope.row.endDate) }}</div>
<div v-if="scope.row.cardEffectiveMode == 1">领取后{{ (scope.row.startDay === 0 ? '当' : scope.row.startDay) + '天,有效天数' + scope.row.limitDay }}</div>
<div v-if="scope.row.cardEffectiveMode == 2">投放后当月</div>
<div v-if="scope.row.cardEffectiveMode == 0">
固定日期:{{ getTime2(scope.row.beginDate) + '至' + getTime2(scope.row.endDate) }}
</div>
<div v-if="scope.row.cardEffectiveMode == 1">
领取后{{ (scope.row.startDay === 0 ? '当' : scope.row.startDay) + '天,有效天数' + scope.row.limitDay }}
</div>
<div v-if="scope.row.cardEffectiveMode == 2">
投放后当月
</div>
</template>
</el-table-column>
<el-table-column label="领取限制">
......@@ -55,11 +89,13 @@
{{ scope.row.storeMode === 0 ? '所有门店' : scope.row.storeMode === 1 ? '部分分组' : '部分门店' }}
</template>
</el-table-column>
<el-table-column label="库存" prop="couponStock"> </el-table-column>
<el-table-column label="库存" prop="couponStock" />
<el-table-column label="操作" v-if="mallProId === '-1'">
<template slot-scope="scope">
<dm-delete @confirm="deleteCard(scope.$index)" tips="确定删除该卡券吗?">
<el-button type="text">删除</el-button>
<el-button type="text">
删除
</el-button>
</dm-delete>
</template>
</el-table-column>
......@@ -72,12 +108,23 @@
</el-table-column>
</el-table>
<el-form-item label="券包名称" v-if="cardList.length > 1" prop="proName">
<el-input v-model.trim="couponForm.proName" class="w-600" type="text" placeholder="请输入券包名称" @input="value => goodsLimit(value)">
<el-input
v-model.trim="couponForm.proName"
class="w-600"
type="text"
placeholder="请输入券包名称"
@input="value => goodsLimit(value)"
>
<span slot="suffix">{{ proNameLen }}/30</span>
</el-input>
</el-form-item>
<el-form-item label="数据对话">
<dm-activity-select :repProjectName="projectName" width="300" :actId.sync="couponForm.dataDialogueId" :showAdd="false"></dm-activity-select>
<dm-activity-select
:repProjectName="projectName"
width="300"
:actId.sync="couponForm.dataDialogueId"
:showAdd="false"
/>
</el-form-item>
<!-- <el-form-item label="卡券主图">
<span style="font-size: 12px;color: rgb(144, 147, 153);">小程序积分商城请升级至V3.0.5及以上版本方可支持</span>
......@@ -109,26 +156,39 @@
<div class="upload-list-box">
<div style="display: inline-block;vertical-align: top;margin-right:5px">
<div v-for="(item, index) in couponForm.images" :key="index" class="img-box">
<img width="100%" :src="item.imageUrl" alt="" />
<i class="el-icon-arrow-left" @click="moveLeft(index)" v-show="index !== 0"></i>
<i class="el-icon-arrow-right" @click="moveRight(index)" v-show="index + 1 !== couponForm.images.length"></i>
<i class="el-icon-delete" @click="deteletDialogImageUrl(index)"></i>
<i class="el-icon-zoom-in" @click="enlargeDialogImageUrl(index)"></i>
<div class="dialog-img"></div>
<img width="100%" :src="item.imageUrl" alt="">
<i class="el-icon-arrow-left" @click="moveLeft(index)" v-show="index !== 0" />
<i class="el-icon-arrow-right" @click="moveRight(index)" v-show="index + 1 !== couponForm.images.length" />
<i class="el-icon-delete" @click="deteletDialogImageUrl(index)" />
<i class="el-icon-zoom-in" @click="enlargeDialogImageUrl(index)" />
<div class="dialog-img" />
</div>
<el-upload :action="uploadAction" :headers="headersUpload" list-type="picture-card" :on-preview="handlePictureCardPreview" :before-upload="beforeUpload" :on-success="uploadSuccess" with-credentials :show-file-list="false" v-show="uploadStatus" style="display: inline-block;vertical-align: top;">
<i class="el-icon-plus"></i>
<el-upload
:action="uploadAction"
:headers="headersUpload"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
with-credentials
:show-file-list="false"
v-show="uploadStatus"
style="display: inline-block;vertical-align: top;"
>
<i class="el-icon-plus" />
</el-upload>
</div>
<p style="font-size: 12px; color: rgb(144, 147, 153);line-height:18px;margin-top:10px">图片宽度≥700px,≤1500px,图片宽高比1:1,单张图片大小不超过 2 MB。</p>
<p style="font-size: 12px; color: rgb(144, 147, 153);line-height:18px;margin-top:10px">
图片宽度≥700px,≤1500px,图片宽高比1:1,单张图片大小不超过 2 MB。
</p>
<el-dialog :visible.sync="dialogVisibleImg">
<img width="100%" :src="dialogEnlargeImageUrl" alt="" />
<img width="100%" :src="dialogEnlargeImageUrl" alt="">
</el-dialog>
</div>
</el-form-item>
<el-form-item label="图文信息">
<div class="tinymce-wrap">
<tinymce-edit ref="tinymceWrap" :bodyHtml="couponForm.detailDescription" :projectName="projectName"></tinymce-edit>
<tinymce-edit ref="tinymceWrap" :bodyHtml="couponForm.detailDescription" :projectName="projectName" />
</div>
</el-form-item>
</div>
......@@ -136,73 +196,154 @@
<h3>销售信息</h3>
<el-form-item label="卡券费用" v-if="cardCouponList.length > 1" required>
<el-table :data="cardCouponList" style="width:900px">
<el-table-column label="卡券名称" prop="proRefName"> </el-table-column>
<el-table-column label="卡券名称" prop="proRefName" />
<el-table-column label="积分费用">
<template slot-scope="scope">
<el-input-number v-model="scope.row.integralCost" :precision="0" :min="0" controls-position="right" @blur="handleIntegralCostTotal" @change="handleIntegralCostTotal"></el-input-number>
<el-input-number
v-model="scope.row.integralCost"
:precision="0"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</template>
</el-table-column>
<el-table-column label="现金费用">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cashCost" :precision="2" :min="0" controls-position="right" @blur="handleIntegralCostTotal" @change="handleIntegralCostTotal"></el-input-number>
<el-input-number
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="积分费用" prop="integralCost">
<el-input-number class="w-350" :disabled="cardCouponList.length > 1" :precision="0" :min="0" v-model="couponForm.integralCost"></el-input-number>
<el-input-number
class="w-350"
:disabled="cardCouponList.length > 1"
:precision="0"
:min="0"
v-model="couponForm.integralCost"
/>
</el-form-item>
<el-form-item label="现金费用" prop="cashCost">
<el-input-number class="w-350" :disabled="cardCouponList.length > 1" :precision="2" :min="0" v-model="couponForm.cashCost"></el-input-number>
<el-input-number
class="w-350"
:disabled="cardCouponList.length > 1"
:precision="2"
:min="0"
v-model="couponForm.cashCost"
/>
</el-form-item>
<el-form-item label="礼品成本" prop="cashCost">
<el-input-number class="w-350" :precision="2" :min="0" v-model="costValue" :disabled="costValueStatus"></el-input-number>
<el-input-number
class="w-350"
:precision="2"
:min="0"
v-model="costValue"
:disabled="costValueStatus"
/>
</el-form-item>
<el-form-item label="库存" prop="virtualStock">
<el-input class="w-350" :precision="0" :min="1" v-model="couponForm.virtualStock"></el-input>
<span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;" v-show="cardList.length"
>兑换限制不得大于此优惠券的库存:<i>{{ couponCardStock }}</i
></span
>
<el-input
class="w-350"
:precision="0"
:min="1"
v-model="couponForm.virtualStock"
/>
<span
style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;"
v-show="cardList.length"
>兑换限制不得大于此优惠券的库存:<i>{{ couponCardStock }}</i></span>
</el-form-item>
</div>
<div class="section-content">
<h3>可兑换配置<span class="sub_title">该配置决定客户是否可以兑换</span></h3>
<el-form-item label="适用会员" prop="gradeType" v-if="cliqueStatus">
<el-radio-group v-model="couponForm.gradeType" @change="handleChange">
<el-radio :label="1">品牌卡</el-radio>
<el-radio :label="2">集团卡</el-radio>
<el-radio :label="1">
品牌卡
</el-radio>
<el-radio :label="2">
集团卡
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="memberGrade" :label="cliqueStatus ? '' : '适用会员'">
<el-select v-model="couponForm.memberGrade" multiple placeholder="请选择" size="small" class="w-600" @change="memberChange">
<el-option v-for="item in memberGradeList" :key="item.gradeId" :label="item.gradeName" :value="item.gradeId"> </el-option>
<el-select
v-model="couponForm.memberGrade"
multiple
placeholder="请选择"
size="small"
class="w-600"
@change="memberChange"
>
<el-option
v-for="item in memberGradeList"
:key="item.gradeId"
:label="item.gradeName"
:value="item.gradeId"
/>
</el-select>
</el-form-item>
<el-form-item prop="ladder" v-if="specialOrder">
<el-checkbox-group v-model="couponForm.ladder" @change="changeladder" style="display:inline-block">
<el-checkbox label="1" :disabled="!couponForm.memberGrade.length">设置阶梯价</el-checkbox>
<el-checkbox label="1" :disabled="!couponForm.memberGrade.length">
设置阶梯价
</el-checkbox>
</el-checkbox-group>
<el-popover placement="bottom" width="500" trigger="click" ref="popover" :disabled="!(cardCouponList.length && couponForm.memberGrade.length)">
<el-popover
placement="bottom"
width="500"
trigger="click"
ref="popover"
:disabled="!(cardCouponList.length && couponForm.memberGrade.length)"
>
<div style="margin-top:10px;margin-bottom:10px">
<span style="color:#303133;font-size:16px">设置阶梯价</span>
<span style="color:#606266;font-size:12px;margin-left:20px">*若未设置阶梯价则以原价进行兑换,请勿随意填入0积分/现金;</span>
</div>
<el-tabs :value="selectTab" type="border-card" class="card-style">
<el-tab-pane :name="index" v-for="(item, index) in ladderMemberGrade" :key="index" :label="item.gradeName" :value="item.gradeId">
<el-tab-pane
:name="index"
v-for="(item, index) in ladderMemberGrade"
:key="index"
:label="item.gradeName"
:value="item.gradeId"
>
<el-form v-if="list3.length">
<el-form-item label="积分">
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px"></el-input>
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px" />
</el-form-item>
<el-form-item label="现金">
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuCash" style="width:180px" />&nbsp;&nbsp;
</el-form-item>
<el-form-item label="现金"> <el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuCash" style="width:180px"></el-input>&nbsp;&nbsp;</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
<div style="margin-top:10px;text-align:right">
<el-button type="default" @click="$refs.popover.showPopper = false">取消</el-button>
<el-button type="primary" @click="saveLadderDetail">保存</el-button>
<el-button type="default" @click="$refs.popover.showPopper = false">
取消
</el-button>
<el-button type="primary" @click="saveLadderDetail">
保存
</el-button>
</div>
<el-button slot="reference" type="text" v-show="isDifferentialPricing" class="set-ladder" @click="setLadder">点击设置</el-button>
<el-button
slot="reference"
type="text"
v-show="isDifferentialPricing"
class="set-ladder"
@click="setLadder"
>
点击设置
</el-button>
</el-popover>
</el-form-item>
<!-- <el-form-item label="会员筛选">
......@@ -219,105 +360,245 @@
<span v-if="sendChildData.storeType === 1" class="store-tip">若选中的门店分组下有新增的门店,系统不会默认选中此新增门店,请重新确认选择并保存礼品</span>
</el-form-item> -->
<el-form-item label="限兑">
<el-checkbox v-model="couponForm.limitTimesStatus" @change="refashData()">每个会员限制兑换</el-checkbox>
<span v-if="couponForm.limitTimesStatus"><el-input-number controls-position="right" v-model="couponForm.limitTimes" :precision="0" :min="0" @change="limitTimeChange"></el-input-number></span>
<span v-show="cardList.length" style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;"
>兑换限制不得大于此优惠券的领取次数:<i>{{ limitTimesNum }}</i
></span
>
<el-checkbox v-model="couponForm.limitTimesStatus" @change="refashData()">
每个会员限制兑换
</el-checkbox>
<span v-if="couponForm.limitTimesStatus"><el-input-number
controls-position="right"
v-model="couponForm.limitTimes"
:precision="0"
:min="0"
@change="limitTimeChange"
/></span>
<span
v-show="cardList.length"
style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;"
>兑换限制不得大于此优惠券的领取次数:<i>{{ limitTimesNum }}</i></span>
</el-form-item>
<el-form-item label="兑换日期" required>
<template>
<el-radio v-model="couponForm.exchangeDateType" :label="1">全部日期</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="2">固定日期</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="3">每月</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="4">每周</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="6">生日当日</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="5">生日当月</el-radio>
</template>
<el-radio v-model="couponForm.exchangeDateType" :label="1">
全部日期
</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="2">
固定日期
</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="3">
每月
</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="4">
每周
</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="6">
生日当日
</el-radio>
<el-radio v-model="couponForm.exchangeDateType" :label="5">
生日当月
</el-radio>
</el-form-item>
<!-- 兑换日期 -->
<!-- 固定日期 -->
<el-form-item class="form-item-mt" v-if="couponForm.exchangeDateType === 2" prop="exchangeFixDate">
<el-date-picker class="w300" v-model="couponForm.exchangeFixDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker
class="w300"
v-model="couponForm.exchangeFixDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<!-- 每月 -->
<el-form-item class="form-item-mt" v-if="couponForm.exchangeDateType === 3" prop="exchangeDateDayArr">
<el-select size="small" v-model="couponForm.exchangeDateDayArr" multiple placeholder="请选择" class="w-350">
<el-option v-for="item in monthOptions" :key="item" :label="item" :value="item"></el-option>
<el-select
size="small"
v-model="couponForm.exchangeDateDayArr"
multiple
placeholder="请选择"
class="w-350"
>
<el-option
v-for="item in monthOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<!-- 每周 -->
<el-form-item class="form-item-mt" v-if="couponForm.exchangeDateType === 4" prop="exchangeDateWeekArr">
<el-select size="small" v-model="couponForm.exchangeDateWeekArr" multiple placeholder="请选择" class="w-350">
<el-option v-for="item in weekOptions" :key="item" :label="item" :value="item"></el-option>
<el-select
size="small"
v-model="couponForm.exchangeDateWeekArr"
multiple
placeholder="请选择"
class="w-350"
>
<el-option
v-for="item in weekOptions"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="兑换时段" required>
<template>
<el-radio v-model="couponForm.exchangeTimeType" :label="1">全部时段</el-radio>
<el-radio v-model="couponForm.exchangeTimeType" :label="2">部分时段</el-radio>
</template>
<el-radio v-model="couponForm.exchangeTimeType" :label="1">
全部时段
</el-radio>
<el-radio v-model="couponForm.exchangeTimeType" :label="2">
部分时段
</el-radio>
</el-form-item>
<div v-if="couponForm.exchangeTimeType === 2">
<el-form-item class="mt8" v-for="(v, i) in couponForm.timeRangeList" :key="i" :prop="'timeRangeList.' + i + '.timeRange'" :rules="[{ validator: validateTime, trigger: 'change' }]">
<el-time-picker is-range v-model="v.timeRange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" value-format="HH:mm" format="HH:mm" placeholder="选择时间范围"> </el-time-picker>
<el-button v-if="i" type="text" @click="delTimeRange(i)">删除</el-button>
<el-form-item
class="mt8"
v-for="(v, i) in couponForm.timeRangeList"
:key="i"
:prop="'timeRangeList.' + i + '.timeRange'"
:rules="[{ validator: validateTime, trigger: 'change' }]"
>
<el-time-picker
is-range
v-model="v.timeRange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="HH:mm"
format="HH:mm"
placeholder="选择时间范围"
/>
<el-button v-if="i" type="text" @click="delTimeRange(i)">
删除
</el-button>
</el-form-item>
<p style="font-size:12px;color:#909399;line-height:12px;margin-left:130px;">请使用24小时制输入时间,格式如11:00至14:30</p>
<p><el-button type="text" style="margin:8px 0 10px 130px" @click="addTimeRange">添加时间段</el-button></p>
<p style="font-size:12px;color:#909399;line-height:12px;margin-left:130px;">
请使用24小时制输入时间,格式如11:00至14:30
</p>
<p>
<el-button type="text" style="margin:8px 0 10px 130px" @click="addTimeRange">
添加时间段
</el-button>
</p>
</div>
</div>
<div class="section-content">
<h3>可见配置<span class="sub_title">该配置决定客户是否可见</span></h3>
<el-form-item label="上架时间" required>
<template>
<el-radio v-model="couponForm.releaseType" :label="1">立即上架</el-radio>
<el-radio v-model="couponForm.releaseType" :label="2">自定义上架时间段</el-radio>
</template>
<el-radio v-model="couponForm.releaseType" :label="1">
立即上架
</el-radio>
<el-radio v-model="couponForm.releaseType" :label="2">
自定义上架时间段
</el-radio>
</el-form-item>
<!-- 定时上架 -->
<el-form-item class="form-item-mt" v-if="couponForm.releaseType === 2" prop="limitTimeBegin">
<el-date-picker v-model="couponForm.limitTimeBegin" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker>
<el-date-picker
v-model="couponForm.limitTimeBegin"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
/>
</el-form-item>
<el-form-item label="显示状态" required>
<el-radio-group v-model="couponForm.proShowStatus">
<el-radio :label="1">上架状态就显示</el-radio>
<el-radio :label="2">兑换状态下显示</el-radio>
<el-radio :label="1">
上架状态就显示
</el-radio>
<el-radio :label="2">
兑换状态下显示
</el-radio>
</el-radio-group>
<div v-if="couponForm.proShowStatus == 1" style="margin-left:20px;">
<el-checkbox v-model="couponForm.isNewGuestVisible" :true-label="1" :false-label="0">非会员可见</el-checkbox>
<el-checkbox v-model="couponForm.isNewGuestVisible" :true-label="1" :false-label="0">
非会员可见
</el-checkbox>
<span class="tips">开启后,未开卡客户在积分商城也可见该礼品(前提是该礼品的“适用会员”包含最低会员卡等级)</span>
</div>
</el-form-item>
<el-form-item label="展现门店" required style="position:relative" v-if="useNewStoreWidget === 0">
<el-tooltip class="tips-content" popper-class="store-tips" effect="dark" placement="top-start">
<div slot="content" style="line-height:18px">会员的门店(常规设置)满足展示门店设置,则在礼品/优惠券列表可见</div>
<i class="iconfont icon-xinxixianshi" style="color:#1890ff"></i>
<el-form-item
label="展现门店"
required
style="position:relative"
v-if="useNewStoreWidget === 0"
>
<el-tooltip
class="tips-content"
popper-class="store-tips"
effect="dark"
placement="top-start"
>
<div slot="content" style="line-height:18px">
会员的门店(常规设置)满足展示门店设置,则在礼品/优惠券列表可见
</div>
<i class="iconfont icon-xinxixianshi" style="color:#1890ff" />
</el-tooltip>
<vue-gic-store-linkage style="margin-left:10px" v-if="(mallProId && creatorId) || mallProId == -1" :creatorId="creatorId" :disabled="isInfo" @getDisGroupList="getDisGroupList" :msg="sendChildData" :openFlag="openFlag" ref="selectTree" @sendSelectGroupData="getSelectGroupData"></vue-gic-store-linkage>
<vue-gic-store-linkage
style="margin-left:10px"
v-if="(mallProId && creatorId) || mallProId == -1"
:creatorId="creatorId"
:disabled="isInfo"
@getDisGroupList="getDisGroupList"
:msg="sendChildData"
:openFlag="openFlag"
ref="selectTree"
@sendSelectGroupData="getSelectGroupData"
/>
<span v-if="sendChildData.storeType === 1" class="store-tip">若选中的父分组下有新增的门店分组,系统不会默认选中此新增门店分组,请重新确认选择并保存礼品</span>
</el-form-item>
<el-form-item label="展现门店" v-if="useNewStoreWidget === 1" class="store-card">
<el-tooltip class="tips-content" popper-class="store-tips" effect="dark" placement="top-start">
<div slot="content" style="line-height:18px">会员的门店(常规设置)满足展示门店设置,则在礼品/优惠券列表可见</div>
<i class="iconfont icon-xinxixianshi" style="color:#1890ff"></i>
<el-tooltip
class="tips-content"
popper-class="store-tips"
effect="dark"
placement="top-start"
>
<div slot="content" style="line-height:18px">
会员的门店(常规设置)满足展示门店设置,则在礼品/优惠券列表可见
</div>
<i class="iconfont icon-xinxixianshi" style="color:#1890ff" />
</el-tooltip>
<vue-gic-store-card style="margin-left:10px" class="pt10" ref="storeCard" :uuid.sync="uuid" scenes="" />
<vue-gic-store-card
style="margin-left:10px"
class="pt10"
ref="storeCard"
:uuid.sync="uuid"
scenes=""
/>
</el-form-item>
</div>
<div class="confim-btn" :style="{ width: fixedWidth + 'px' }">
<el-form-item class="fix-btn">
<!-- <el-button type="primary" size="small" @click="submitForm('couponForm')" :disabled="!canEdit" :loading="submitLoading">保存</el-button> -->
<el-button type="primary" size="small" @click="submitForm('couponForm')" :disabled="!canEdit">保存</el-button>
<el-button size="small" @click="goBack">返回</el-button>
<el-button
type="primary"
size="small"
@click="submitForm('couponForm')"
:disabled="!canEdit"
>
保存
</el-button>
<el-button size="small" @click="goBack">
返回
</el-button>
</el-form-item>
</div>
</el-form>
</div>
</div>
<!-- 卡券选择弹框 -->
<vue-gic-card :disabledList="disabledList" :featureModule="projectName" :projectName="projectName" :showCardDialog.sync="showCardDialog" :cardLimit="cardLimit" :cardType="cardType" @selectCard="selectCard" ref="dmcard"></vue-gic-card>
<vue-gic-card
:disabledList="disabledList"
:featureModule="projectName"
:projectName="projectName"
:showCardDialog.sync="showCardDialog"
:cardLimit="cardLimit"
:cardType="cardType"
@selectCard="selectCard"
ref="dmcard"
/>
</div>
</template>
......@@ -328,7 +609,10 @@ import copy from '../../../utils/clone.js';
import getInputVal from '../../../utils/common.js';
import tinymceEdit from '../../../components/tinymce-edit';
export default {
data() {
components: {
tinymceEdit,
},
data () {
const validateTime = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入时间'));
......@@ -337,7 +621,7 @@ export default {
}
};
const stockValidator = (rule, value, callback) => {
var reg = /^[1-9]+\d*$/;
const reg = /^[1-9]+\d*$/;
if (!reg.test(Number(value))) {
return callback(new Error('库存必须为大于0整数'));
} else {
......@@ -371,11 +655,11 @@ export default {
fixedWidth: document.documentElement.clientWidth - 200,
// 卡券数据
// 可传参数
projectName: 'integral-mall', //当前项目名
projectName: 'integral-mall', // 当前项目名
showCardDialog: false,
// cardLimit: 3, //卡券限制类型 1-限制领取1张的卡券 2- 限制领取 1~100的卡券 3-限制领取&=100 的卡券
cardLimit: -1, //卡券限制类型 1-限制领取1张的卡券 2- 限制领取 1~100的卡券 3-限制领取&=100 的卡券
cardType: null, //卡券类型集合(0:抵金券,1:折扣券,2:兑换券)null-为全部类型 逗号分隔
cardLimit: -1, // 卡券限制类型 1-限制领取1张的卡券 2- 限制领取 1~100的卡券 3-限制领取&=100 的卡券
cardType: null, // 卡券类型集合(0:抵金券,1:折扣券,2:兑换券)null-为全部类型 逗号分隔
disabledList: [],
selectedData: {},
cardList: [],
......@@ -383,49 +667,49 @@ export default {
limitTimesNumArr: [],
limitTimes: 0,
limitTimesNum: 0,
proReferId: '', //卡券关联id
proReferId: '', // 卡券关联id
couponForm: {
cardType: '', //卡券类型
cardType: '', // 卡券类型
images: [],
detailDescription: '', //图文详情
integralCost: '', //积分费用
detailDescription: '', // 图文详情
integralCost: '', // 积分费用
cashCost: '',
virtualStock: '',
memberLabelType: 1,
gradeType: 1,
memberGrade: [], //适用会员
limitTimesStatus: false, //限兑
limitTimes: '', //限兑次数
releaseType: 1, //上架时间
proShowStatus: 1, //显示状态
exchangeDateType: 1, //兑换日期
exchangeTimeType: 1, //兑换时段
exchangeFixDate: [], //固定日期
memberGrade: [], // 适用会员
limitTimesStatus: false, // 限兑
limitTimes: '', // 限兑次数
releaseType: 1, // 上架时间
proShowStatus: 1, // 显示状态
exchangeDateType: 1, // 兑换日期
exchangeTimeType: 1, // 兑换时段
exchangeFixDate: [], // 固定日期
exchangeDateDayArr: [],
exchangeDateWeekArr: [],
timeRangeList: [{ timeRange: '' }], //部分时段数组
timeRangeList: [{ timeRange: '' }], // 部分时段数组
limitTimeBegin: [],
timeZones: ['', ''],
isNewGuestVisible: 0, // 0:新客不可见、1:新客可见
dataDialogueId: '', // 数据对话id
ladder: []
ladder: [],
},
uploadAction: window.location.origin + '/api-plug/upload-img?requestProject=integral-mall',
// uploadAction: 'http://gicdev.demogic.com/api-plug/upload-img?requestProject=integral-mall',
headersUpload: {
sign: ''
sign: '',
},
uploadStatus: true, //上传按钮
dialogVisibleImg: false, //上传图片
uploadStatus: true, // 上传按钮
dialogVisibleImg: false, // 上传图片
refash: false,
memberGradeList: [], //会员等级
memberGradeList: [], // 会员等级
// 门店控件
sendChildData: {
storeType: 1,
storeGroupIds: '',
storeIds: []
storeIds: [],
},
cliqueStatus: true, //是否有集团卡
cliqueStatus: true, // 是否有集团卡
openFlag: false,
monthOptions: Array.from(Array(31), (v, k) => (k + 1).toString()),
weekOptions: ['1', '2', '3', '4', '5', '6', '7'],
......@@ -439,23 +723,23 @@ export default {
exchangeDateDayArr: [{ required: true, message: '请选择时间', trigger: 'change' }],
exchangeDateWeekArr: [{ required: true, message: '请选择时间', trigger: 'change' }],
limitTimeBegin: [{ required: true, message: '请选择时间', trigger: 'change' }],
proName: [{ required: true, message: '请输入券包名称', trigger: 'blur' }]
proName: [{ required: true, message: '请输入券包名称', trigger: 'blur' }],
},
validateTime,
mallProId: '',
coupCardId: '', //卡券id
costValue: '', //礼品成本
coupCardId: '', // 卡券id
costValue: '', // 礼品成本
costValueArr: [],
costValueStatus: true,
couponCardStock: '', //优惠券库存
couponCardStock: '', // 优惠券库存
couponCardStockArr: [],
couponStatus: false, //卡券状态
couponStatus: false, // 卡券状态
canEdit: true,
submitLoading: false,
groupIdDisableList: [],
proNameLen: 0,
creatorId: '',
useNewStoreWidget: 1, //1新的卡券门店组件 ,0老的门店组件
useNewStoreWidget: 1, // 1新的卡券门店组件 ,0老的门店组件
// 新版门店卡券选择器
uuid: '',
isAdd: true,
......@@ -477,22 +761,22 @@ export default {
enterpriseId: '', // 商户id
specialOrder: false, // 是否定制
pickerOptions: {
disabledDate(time) {
disabledDate (time) {
return time.getTime() < Date.now() - 24 * 3600 * 1000;
}
}
},
},
};
},
mounted() {
mounted () {
this.getOpenStatus();
this.getUserId();
window.onbeforeunload = function(e) {
window.onbeforeunload = function (e) {
localStorage.removeItem('giftListObj');
};
let val = {
const val = {
storeType: 0,
storeGroupIds: '',
storeIds: []
storeIds: [],
};
this.getSelectGroupData(val);
this.mallProId = this.$route.query.giftId;
......@@ -509,7 +793,7 @@ export default {
this.isAdd = false;
this.isEdit = true;
} else {
this.getMemberGradeList(); //会员等级列表
this.getMemberGradeList(); // 会员等级列表
}
},
methods: {
......@@ -518,7 +802,7 @@ export default {
// 达摩生产 ff8080816a36326c016a53380d8b5f52
// 地素 ff80808163218c030163429b47110635
// 地素测试 ff8080816f12b5c0016f1d5896820147
getUserId() {
getUserId () {
request.get('/api-integral-mall/can-differential-pricing').then(res => {
if (res.data.errorCode === 0) {
this.specialOrder = res.data.result == 1;
......@@ -527,7 +811,7 @@ export default {
}
});
},
memberChange() {
memberChange () {
// this.ladderMemberGradeChange = [];
// let lists = this.memberGradeList.filter(item => {
// return this.couponForm.memberGrade.join(',').indexOf(item.gradeId) != -1;
......@@ -544,7 +828,7 @@ export default {
this.submitLadderList = copy(this.list3);
}
},
changeladder(value) {
changeladder (value) {
if (value.length) {
this.isDifferentialPricing = 1;
// 勾选了阶梯价,先设置默认数据
......@@ -553,19 +837,19 @@ export default {
this.isDifferentialPricing = 0;
}
},
setLadder() {
setLadder () {
if (!this.cardCouponList.length) {
this.$message.error('请先添加卡券');
return;
}
this.ladderMemberGrade = [];
let lists = this.memberGradeList.filter(item => {
const lists = this.memberGradeList.filter(item => {
return this.couponForm.memberGrade.join(',').indexOf(item.gradeId) != -1;
});
lists.forEach(item => {
this.ladderMemberGrade.push({
gradeId: item.gradeId,
gradeName: item.gradeName
gradeName: item.gradeName,
});
});
this.list2 = copy(this.ladderMemberGrade);
......@@ -590,10 +874,10 @@ export default {
});
}
},
saveLadderDetail() {
saveLadderDetail () {
this.isCorrect = true;
for (let i = 0; i < this.list3.length; i++) {
let skuList = this.list3[i].skuList;
const skuList = this.list3[i].skuList;
if (this.isCorrect) {
for (let j = 0; j < skuList.length; j++) {
if (skuList[j].giftProSkuCash && (skuList[j].giftProSkuIntegral === '' || skuList[j].giftProSkuIntegral === null)) {
......@@ -607,7 +891,7 @@ export default {
break;
}
if (skuList[j].giftProSkuCash && skuList[j].giftProSkuIntegral) {
let itemPlus = Number(skuList[j].giftProSkuCash) + Number(skuList[j].giftProSkuIntegral);
const itemPlus = Number(skuList[j].giftProSkuCash) + Number(skuList[j].giftProSkuIntegral);
if (!itemPlus) {
this.isCorrect = false;
this.$message.error('积分和现金相加不可为0');
......@@ -625,10 +909,10 @@ export default {
this.$refs.popover.showPopper = false;
}
},
refashData() {
refashData () {
this.refash = !this.refash;
},
getOpenStatus() {
getOpenStatus () {
request.post('/api-integral-mall/is-show-self ').then(res => {
if (res.data.errorCode === 0) {
this.openFlag = res.data.result.openFlag;
......@@ -640,23 +924,23 @@ export default {
}
});
},
getDisGroupList(arr) {
getDisGroupList (arr) {
this.groupIdDisableList = arr;
// if (this.mallProId !== '-1') {
// this.getInfo();
// }
},
handleChange() {
handleChange () {
this.couponForm.memberGrade = [];
this.getMemberGradeList();
},
// 获取会员等级
async getMemberGradeList() {
async getMemberGradeList () {
return request.post('/api-integral-mall/load-grade').then(res => {
if (res.data.errorCode === 0) {
this.cliqueStatus = res.data.result.cliqueGrade ? true : false;
this.cliqueStatus = !!res.data.result.cliqueGrade;
if (this.couponForm.gradeType === 1) {
//品牌卡
// 品牌卡
this.memberGradeList = res.data.result.enterpriseGrade || [];
} else if (this.couponForm.gradeType === 2) {
this.memberGradeList = res.data.result.cliqueGrade || [];
......@@ -667,9 +951,9 @@ export default {
});
},
// 获取详情
getInfo() {
let params = {
integralMallProId: this.mallProId
getInfo () {
const params = {
integralMallProId: this.mallProId,
};
this.submitLoading = true;
request.post('/api-integral-mall/get-integral-mall-pro', qs.stringify(params)).then(res => {
......@@ -683,7 +967,7 @@ export default {
}
this.couponForm.proName = res.data.result.proName;
this.proNameLen = getInputVal.getZhLen(this.couponForm.proName);
this.couponForm.isNewGuestVisible = res.data.result.isNewGuestVisible || 0; //新客是否可见
this.couponForm.isNewGuestVisible = res.data.result.isNewGuestVisible || 0; // 新客是否可见
// this.list3 = res.data.result.gradeProSkus && res.data.result.gradeProSkus.length ? res.data.result.gradeProSkus : []; // 阶梯价详情
this.couponForm.ladder = res.data.result.isDifferentialPricing ? ['1'] : []; // 是否设置阶梯价
if (this.couponForm.ladder.length) {
......@@ -704,17 +988,17 @@ export default {
proRefId: '',
proRefName: '',
integralCost: undefined,
cashCost: undefined
cashCost: undefined,
});
}
//积分费用
// 积分费用
this.couponForm.integralCost = res.data.result.integralCost;
//现金费用
// 现金费用
this.couponForm.cashCost = res.data.result.cashCost;
//库存
// 库存
this.couponForm.virtualStock = res.data.result.virtualStock;
this.currentStock = res.data.result.virtualStock;
this.couponForm.detailDescription = res.data.result.detailDescription; //图文详情
this.couponForm.detailDescription = res.data.result.detailDescription; // 图文详情
// if (res.data.result.searchParams) {
// this.searchParams = res.data.result.searchParams; //会员筛选
// } else {
......@@ -729,13 +1013,13 @@ export default {
// this.useId = res.data.result.integralMallProId;
this.hasSearchData = res.data.result.searchParams;
//适用会员
// 适用会员
this.couponForm.gradeType = res.data.result.gradeType;
this.getMemberGradeList()
.then(() => {
if (res.data.result.memberGrade) {
this.memberGrade = res.data.result.memberGrade;
this.couponForm.memberGrade = res.data.result.memberGrade.split(','); //适用会员
this.couponForm.memberGrade = res.data.result.memberGrade.split(','); // 适用会员
} else {
this.memberGrade = '';
this.couponForm.memberGrade = [];
......@@ -743,29 +1027,29 @@ export default {
})
.finally(() => {
if (this.$route.query.proReferId !== '-1') {
let list = this.memberGradeList.filter(item => {
const list = this.memberGradeList.filter(item => {
return this.memberGrade.indexOf(item.gradeId) != -1;
});
list.forEach(item => {
this.ladderMemberGrade.push({
gradeId: item.gradeId,
gradeName: item.gradeName
gradeName: item.gradeName,
});
});
}
}); //会员等级列表\
}); // 会员等级列表\
// if (res.data.result.memberGrade) {
// this.couponForm.memberGrade = res.data.result.memberGrade.split(',');
// } else {
// this.couponForm.memberGrade = [];
// }
if (res.data.result.images) {
//主图
// 主图
this.couponForm.images = [];
for (let item of res.data.result.images) {
for (const item of res.data.result.images) {
this.couponForm.images.push({
imageUrl: item.imageUrl,
imageCode: item.imageFieldCode
imageCode: item.imageFieldCode,
});
}
}
......@@ -781,10 +1065,10 @@ export default {
this.sendChildData.storeType = Number(res.data.result.showStore);
if (this.sendChildData.storeType === 1) {
let arr = res.data.result.storeGroupIds.split(',');
const arr = res.data.result.storeGroupIds.split(',');
for (let i = 0; i < arr.length; i++) {
if (this.groupIdDisableList.indexOf(arr[i]) !== -1) {
//存在
// 存在
// console.log('不可删除的');
arr.splice(i, 1);
i--;
......@@ -793,9 +1077,9 @@ export default {
this.sendChildData.storeGroupIds = arr.join(',');
// this.sendChildData.storeGroupIds = res.data.result.storeGroupIds || '';
} else if (this.sendChildData.storeType === 2) {
let list = [];
const list = [];
if (res.data.result.storeInfo) {
res.data.result.storeInfo.map(v => {
res.data.result.storeInfo.forEach(v => {
list.push(v);
});
}
......@@ -809,16 +1093,16 @@ export default {
this.$refs.storeCard.init();
});
}
//限兑
// 限兑
if (res.data.result.limitTimes === -1) {
this.couponForm.limitTimesStatus = false;
} else {
this.couponForm.limitTimesStatus = true;
}
//限兑
// 限兑
this.couponForm.limitTimes = res.data.result.limitTimes;
this.costValue = res.data.result.costValue; //礼品陈本
this.costValue = res.data.result.costValue; // 礼品陈本
// 兑换日期
// 兑换日期
this.couponForm.exchangeDateType = res.data.result.exchangeDateType;
......@@ -837,23 +1121,23 @@ export default {
// 兑换时段
this.couponForm.exchangeTimeType = res.data.result.exchangeTimeType;
//部分时间段
// 部分时间段
let timeDate;
let timeRangeList;
if (this.couponForm.exchangeTimeType === 2) {
timeDate = res.data.result.timeZones.split('#');
timeRangeList = [];
for (let item of timeDate) {
for (const item of timeDate) {
timeRangeList.push({
timeRange: item.split('-')
timeRange: item.split('-'),
});
}
this.couponForm.timeRangeList = timeRangeList;
}
//显示状态
// 显示状态
this.couponForm.proShowStatus = res.data.result.proShowStatus;
//上架时间
// 上架时间
this.couponForm.releaseType = res.data.result.releaseType;
if (this.couponForm.releaseType === 2) {
this.couponForm.limitTimeBegin[0] = res.data.result.limitTimeBegin || '';
......@@ -870,16 +1154,16 @@ export default {
});
},
// 礼品字数限制
goodsLimit(value) {
goodsLimit (value) {
this.$nextTick(() => {
this.couponForm.proName = getInputVal.getInputVal(value, 30);
this.proNameLen = getInputVal.getZhLen(this.couponForm.proName);
});
},
// 获取卡券详情
getCardInfo() {
let params = {
coupCardId: this.coupCardId
getCardInfo () {
const params = {
coupCardId: this.coupCardId,
};
request.post('/api-integral-mall/get-card', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -891,7 +1175,7 @@ export default {
}
if (this.cardList) {
this.couponForm.cardType = this.cardList[0].cardType;
for (let item of this.cardList) {
for (const item of this.cardList) {
// item.beginDate = this.getTime2(item.beginDate);
// item.endDate = this.getTime2(item.endDate);
// item.putBeginDate = this.getTime2(item.putBeginDate);
......@@ -921,7 +1205,7 @@ export default {
}
});
},
limitTimeChange() {
limitTimeChange () {
if (this.cardList.length) {
if (Number(this.couponForm.limitTimes) > Number(this.limitTimes)) {
this.$message.error('兑换限制不得大于此优惠券的领取次数');
......@@ -932,26 +1216,26 @@ export default {
this.limitTimesNum = this.couponForm.limitTimes;
}
},
//门店分类回执方法
getSelectGroupData(val) {
// 门店分类回执方法
getSelectGroupData (val) {
this.sendChildData = {
storeType: val.storeType || 0,
storeGroupIds: val.storeGroupIds || '',
storeIds: val.storeIds || []
storeIds: val.storeIds || [],
};
},
// 显示卡券弹窗
showCard() {
showCard () {
if (this.cardList.length >= this.addCardMax) return;
this.showCardDialog = true;
},
// 子组件触发方法
selectCard(val) {
selectCard (val) {
this.showCardDialog = false;
// this.cardList = [];
if (val) {
//重复卡券去掉
// 重复卡券去掉
if (
!this.cardList.find(row => {
return row.coupCardId === val.coupCardId;
......@@ -962,7 +1246,7 @@ export default {
proRefId: val.coupCardId,
proRefName: val.cardName,
integralCost: undefined,
cashCost: undefined
cashCost: undefined,
});
this.limitTimesNumArr.push(val.cardLimit);
this.couponCardStockArr.push(val.couponStock);
......@@ -982,15 +1266,15 @@ export default {
// this.couponForm.virtualStock = this.couponCardStock;
// this.couponForm.proName = val.cardName;
this.couponForm.limitTimesStatus = true;
let params = {
const params = {
coupCardId: val.coupCardId,
proType: 1
proType: 1,
};
request.post('/api-integral-mall/get-integral-mall-CashCost', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.costValueArr.push(res.data.result.costValue);
//计算数组的总和
let sum = this.costValueArr.reduce(function(prev, cur, index, array) {
// 计算数组的总和
const sum = this.costValueArr.reduce(function (prev, cur, index, array) {
return prev + cur;
});
this.costValue = sum;
......@@ -1000,18 +1284,18 @@ export default {
});
}
},
deleteCard(index) {
deleteCard (index) {
this.cardList.splice(index, 1);
this.cardCouponList.splice(index, 1);
this.costValueArr.splice(index, 1);
let sum = this.costValueArr.reduce(function(prev, cur, index, array) {
const sum = this.costValueArr.reduce(function (prev, cur, index, array) {
return prev + cur;
});
this.costValue = sum;
if (this.cardList.length > 0) {
this.limitTimesNumArr = [];
this.couponCardStockArr = [];
for (let item of this.cardList) {
for (const item of this.cardList) {
this.limitTimesNumArr.push(item.cardLimit);
this.couponCardStockArr.push(item.couponStock);
this.limitTimes = Math.min.apply(null, this.limitTimesNumArr);
......@@ -1026,10 +1310,10 @@ export default {
}
},
// 券包积分计算
handleIntegralCostTotal() {
handleIntegralCostTotal () {
let total = 0;
let totalCash = 0;
for (let item of this.cardCouponList) {
for (const item of this.cardCouponList) {
if (item.integralCost) {
total = total + Number(item.integralCost);
} else {
......@@ -1045,7 +1329,7 @@ export default {
this.couponForm.cashCost = totalCash;
},
// 添加兑换时段
addTimeRange() {
addTimeRange () {
if (this.couponForm.timeRangeList.length >= 5) {
this.$message.error('最多五个时间段');
return false;
......@@ -1053,13 +1337,13 @@ export default {
this.couponForm.timeRangeList.push({ timeRange: '' });
},
// 删除兑换时段
delTimeRange(index) {
delTimeRange (index) {
this.couponForm.timeRangeList.splice(index, 1);
},
// 图片上传
// 上传图片前
beforeUpload(file) {
beforeUpload (file) {
if (this.couponForm.images === null) {
this.couponForm.images = [];
}
......@@ -1080,14 +1364,14 @@ export default {
} else {
this.headersUpload.sign = '';
}
var that = this;
return new Promise(function(resolve, reject) {
let reader = new FileReader();
reader.onload = function(event) {
let image = new Image();
image.onload = function() {
let width = this.width;
let height = this.height;
const that = this;
return new Promise(function (resolve, reject) {
const reader = new FileReader();
reader.onload = function (event) {
const image = new Image();
image.onload = function () {
const width = this.width;
const height = this.height;
if (width < 700 || width > 1500 || width / height != 1) {
that.$message.error('请上传正确的图片尺寸');
reject();
......@@ -1100,16 +1384,16 @@ export default {
});
},
// 预览
handlePictureCardPreview(file) {
handlePictureCardPreview (file) {
this.couponForm.images = file.url;
this.dialogVisibleImg = true;
},
// 上传图片成功
uploadSuccess(response, file, fileList) {
uploadSuccess (response, file, fileList) {
if (response.errorCode === 0) {
this.couponForm.images.push({
imageUrl: response.result[0].qcloudImageUrl,
imageCode: response.result[0].imageFiledCode
imageCode: response.result[0].imageFiledCode,
});
this.$message.success('上传成功');
if (this.couponForm.images.length === 1) {
......@@ -1122,44 +1406,44 @@ export default {
}
},
// 删除
deteletDialogImageUrl(index) {
deteletDialogImageUrl (index) {
this.uploadStatus = true;
this.couponForm.images.splice(index, 1);
},
// 放大
enlargeDialogImageUrl(index) {
enlargeDialogImageUrl (index) {
this.dialogEnlargeImageUrl = this.couponForm.images[index].imageUrl;
this.dialogVisibleImg = true;
},
// 左移一位
moveLeft(index) {
moveLeft (index) {
this.swapArray(this.couponForm.images, index, index - 1);
},
//右移一位
moveRight(index) {
// 右移一位
moveRight (index) {
this.swapArray(this.couponForm.images, index, index + 1);
},
//两个数据条换位置
swapArray(arr, index1, index2) {
// 两个数据条换位置
swapArray (arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0];
return arr;
},
// 校验datePricker
vaidataDataPicker() {
vaidataDataPicker () {
const endTime = this.couponForm.limitTimeBegin[1];
const startTime = this.couponForm.limitTimeBegin[0];
const currentTime = new Date().getTime();
return endTime > currentTime && endTime > startTime;
},
// 提交数据
async submitForm(couponForm) {
async submitForm (couponForm) {
this.couponForm.detailDescription = this.$refs.tinymceWrap.tinymceHtml;
let proReferIdArr = [];
const proReferIdArr = [];
if (this.cardList.length === 0) {
this.$message.error('请选择卡券');
return false;
} else {
for (let item of this.cardList) {
for (const item of this.cardList) {
proReferIdArr.push(item.coupCardId);
}
}
......@@ -1171,7 +1455,7 @@ export default {
}
}
if (this.cardCouponList.length > 1) {
for (let item of this.cardCouponList) {
for (const item of this.cardCouponList) {
if (item.cashCost === undefined || item.integralCost === undefined) {
this.$message.error('卡券积分或现金不能为空');
return false;
......@@ -1189,7 +1473,7 @@ export default {
}
}
if (this.useNewStoreWidget === 1) {
let data = await this.$refs.storeCard.getRightList();
const data = await this.$refs.storeCard.getRightList();
if (!data.length) {
this.$message.error('请选择展示门店');
return;
......@@ -1202,7 +1486,7 @@ export default {
}
} else {
if (this.cardList[0].cardType === 2) {
//兑换券必须上传主图
// 兑换券必须上传主图
if (this.couponForm.images.length === 0) {
this.$message.error('兑换券要上传商品主图');
return false;
......@@ -1210,49 +1494,49 @@ export default {
}
}
let giftImageUrls = [];
let giftImageFiledCodes = [];
for (let item of this.couponForm.images) {
const giftImageUrls = [];
const giftImageFiledCodes = [];
for (const item of this.couponForm.images) {
giftImageUrls.push(item.imageUrl);
giftImageFiledCodes.push(item.imageCode);
}
this.$refs[couponForm].validate(valid => {
if (valid) {
let params = {
const params = {
proName: this.cardList.length > 1 ? this.couponForm.proName : this.cardList[0].cardName,
integralMallProId: this.mallProId === '-1' ? '' : this.mallProId, //礼品id
proType: 1, //优惠券
proReferId: proReferIdArr.join(','), //卡券id
integralMallProId: this.mallProId === '-1' ? '' : this.mallProId, // 礼品id
proType: 1, // 优惠券
proReferId: proReferIdArr.join(','), // 卡券id
dataDialogueId: this.couponForm.dataDialogueId, // 数据对话id
cardCostList: this.cardCouponList.length > 1 ? this.cardCouponList : null,
detailDescription: this.couponForm.detailDescription, //图文详情
giftImageUrls: giftImageUrls.join(','), //礼品主图
detailDescription: this.couponForm.detailDescription, // 图文详情
giftImageUrls: giftImageUrls.join(','), // 礼品主图
giftImageFiledCodes: giftImageFiledCodes.join(','),
cardType: this.cardList[0].cardType,
integralCost: this.couponForm.integralCost, //积分费用
costValue: this.costValue, //礼品成本
cashCost: this.couponForm.cashCost, //现金
virtualStock: this.isEdit ? this.couponForm.virtualStock - (this.currentStock || 0) : this.couponForm.virtualStock, //库存
integralCost: this.couponForm.integralCost, // 积分费用
costValue: this.costValue, // 礼品成本
cashCost: this.couponForm.cashCost, // 现金
virtualStock: this.isEdit ? this.couponForm.virtualStock - (this.currentStock || 0) : this.couponForm.virtualStock, // 库存
gradeType: this.couponForm.gradeType,
memberGrade: this.couponForm.memberGrade.join(','), //适用会员
memberGrade: this.couponForm.memberGrade.join(','), // 适用会员
showStore: this.sendChildData.storeType, // 显示门店 0所有 1部分分类 2部分门店
storeIds: '', //展现门店id
storeIds: '', // 展现门店id
storeWidgetId: '',
useNewStoreWidget: this.useNewStoreWidget,
limitTimes: this.couponForm.limitTimesStatus ? this.couponForm.limitTimes : '-1', //限兑
exchangeDateType: this.couponForm.exchangeDateType, //兑换日期
exchangeFixDateBegin: this.couponForm.exchangeDateType === 2 ? this.getTime(this.couponForm.exchangeFixDate[0]) : '', //固定日期
limitTimes: this.couponForm.limitTimesStatus ? this.couponForm.limitTimes : '-1', // 限兑
exchangeDateType: this.couponForm.exchangeDateType, // 兑换日期
exchangeFixDateBegin: this.couponForm.exchangeDateType === 2 ? this.getTime(this.couponForm.exchangeFixDate[0]) : '', // 固定日期
exchangeFixDateEnd: this.couponForm.exchangeDateType === 2 ? this.getTime(this.couponForm.exchangeFixDate[1]) : '',
exchangeDateDay: this.couponForm.exchangeDateType === 3 ? this.couponForm.exchangeDateDayArr.join(',') : '', //兑换日期月
exchangeDateWeek: this.couponForm.exchangeDateType === 4 ? this.couponForm.exchangeDateWeekArr.join(',') : '', //兑换日期周
exchangeTimeType: this.couponForm.exchangeTimeType, //兑换时段
proShowStatus: this.couponForm.proShowStatus, //显示状态
releaseType: this.couponForm.releaseType, //上架状态
limitTimeBegin: this.couponForm.releaseType === 2 ? this.getTimeAll(this.couponForm.limitTimeBegin[0]) : '', //定时上架开始时间
limitTimeEnd: this.couponForm.releaseType === 2 ? this.getTimeAll(this.couponForm.limitTimeBegin[1]) : '', //定时上架结束时间
exchangeDateDay: this.couponForm.exchangeDateType === 3 ? this.couponForm.exchangeDateDayArr.join(',') : '', // 兑换日期月
exchangeDateWeek: this.couponForm.exchangeDateType === 4 ? this.couponForm.exchangeDateWeekArr.join(',') : '', // 兑换日期周
exchangeTimeType: this.couponForm.exchangeTimeType, // 兑换时段
proShowStatus: this.couponForm.proShowStatus, // 显示状态
releaseType: this.couponForm.releaseType, // 上架状态
limitTimeBegin: this.couponForm.releaseType === 2 ? this.getTimeAll(this.couponForm.limitTimeBegin[0]) : '', // 定时上架开始时间
limitTimeEnd: this.couponForm.releaseType === 2 ? this.getTimeAll(this.couponForm.limitTimeBegin[1]) : '', // 定时上架结束时间
isNewGuestVisible: this.couponForm.proShowStatus == 1 ? this.couponForm.isNewGuestVisible : 0, // 新客是否可见 0:新客不可见、1:新客可见'
isDifferentialPricing: this.isDifferentialPricing,
differentialPricingJson: JSON.stringify(this.submitLadderList)
differentialPricingJson: JSON.stringify(this.submitLadderList),
};
// 校验定时上架时间
if (this.couponForm.releaseType == 2 && !this.vaidataDataPicker()) return this.$message.error('定时上架结束时间必须大于当前时间和开始时间');
......@@ -1279,9 +1563,9 @@ export default {
}
// 部分时段时间转换
let timeLink = [];
const timeLink = [];
if (this.couponForm.exchangeTimeType === 2) {
for (let item of this.couponForm.timeRangeList) {
for (const item of this.couponForm.timeRangeList) {
timeLink.push(item.timeRange[0] + '-' + item.timeRange[1]);
}
}
......@@ -1325,26 +1609,26 @@ export default {
}
});
},
confirmDetail(params) {
confirmDetail (params) {
this.$confirm('<div>如更改规格或适用会员后,请先去设置阶梯价并保存,否则会使用原阶梯价,是否继续操作?</div>', '提示', {
closeOnClickModal: false,
showClose: false,
type: 'warning',
customClass: 'show-title',
dangerouslyUseHTMLString: true,
confirmButtonText: '保存'
confirmButtonText: '保存',
}).then(() => {
this.submitLoading = true;
this.saveDeatail(params);
console.log('保存');
});
},
saveDeatail(params) {
saveDeatail (params) {
request.post('/api-integral-mall/create-integral-pro', params).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('保存成功');
this.$router.push({
name: 'coupon'
name: 'coupon',
});
this.submitLoading = false;
} else {
......@@ -1353,11 +1637,11 @@ export default {
}
});
},
goBack() {
goBack () {
this.$router.push({
name: 'coupon'
name: 'coupon',
});
}
},
// //人群筛选器使用的方法
// // 父组件调用子组件方法,触发父组件事件
// getData() {
......@@ -1403,9 +1687,6 @@ export default {
// }
// }
},
components: {
tinymceEdit
}
};
</script>
<style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment