|
@@ -1,31 +1,109 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
|
|
+ <div class="table-layout">
|
|
|
|
+ <div style="margin-top: 20px">
|
|
|
|
+ <svg-icon icon-class="shopping" style="color: #606266" />
|
|
|
|
+ <span class="font-small">卡券包</span>
|
|
|
|
+ </div>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">卡券包名称</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">卡券包金额</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">卡券包数量</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">所属渠道</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">所属引荐人</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">卡券包开始时间</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="4" class="table-cell">{{ couponPackage.pkName }}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell">{{ couponPackage.pkMoney }}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell">{{ total }}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell" style="line-height:20px">{{formateChannel(couponPackage.channel)}}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell">{{ couponPackage.refereeName }}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell">
|
|
|
|
+ {{ couponPackage.startTime }}
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">卡券包到期时间</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">每人限领</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">分享二维码</el-col>
|
|
|
|
+ <!-- <el-col :span="4" class="table-cell-title">优惠兑换码</el-col> -->
|
|
|
|
+ <el-col :span="4" class="table-cell-title">分享短链</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell-title">发送短信</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="4" class="table-cell" style="height: 120px">{{ couponPackage.endTime }}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell" style="height: 120px">{{ couponPackage.limit}}</el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell" style="text-align:center;padding-top: 5px;height: 120px">
|
|
|
|
+ <el-image :preview-src-list="[couponPackage.qrUrl]" :lazy="true" :src="couponPackage.qrUrl" style="width:100px"></el-image>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="4" class="table-cell" style="word-wrap:break-word; height: 120px">{{couponPackage.shortChain}}</el-col>
|
|
|
|
+ <!-- <el-col :span="4" class="table-cell">{{ coupon.code }}</el-col> -->
|
|
|
|
+
|
|
|
|
+ <el-col :span="4" class="table-cell" style="height: 120px" >
|
|
|
|
+ <el-button
|
|
|
|
+ v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
|
|
|
|
+ type="text" size="mini" @click="handleSendNew()">发送短信</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <div style="margin-top: 20px">
|
|
|
|
+ <svg-icon icon-class="order-return" />
|
|
|
|
+ <span class="font-small">卷包内优惠卷</span>
|
|
|
|
+ </div>
|
|
|
|
+ <el-table :data="couponPackage.couponList" height="200px" :header-cell-style="{ background: '#f2f6fc' }"
|
|
|
|
+ style="width: 100%;margin-top: 20px;overflow-y: auto !important;" border>
|
|
|
|
+ <el-table-column label="优惠卷名称" align="center" prop="name" :key="Math.random()" >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="优惠卷介绍" align="center" prop="desc">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="最低消费" align="center" prop="min" />
|
|
|
|
+ <el-table-column label="满减金额/折扣率" align="center" prop="discount" >
|
|
|
|
+ <template slot-scope="scope1">
|
|
|
|
+ <span v-if="scope1.row.voucherType == 1">减免{{ scope1.row.discount }}元</span>
|
|
|
|
+ <span v-if="scope1.row.voucherType == 2">折扣率{{ scope1.row.discount }}%</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="商品范围限制" align="center" prop="goodsType" >
|
|
|
|
+ <template slot-scope="scope1">
|
|
|
|
+ {{ scope1.row.goodsType | formatGoodsType }}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="所限商品、类型" align="center" prop="couponGoodsName" width="320px">
|
|
|
|
+ <template slot-scope="scope1">
|
|
|
|
+ <span style="color:red;font-size:12px;" v-html="scope1.row.couponGoodsName"> </span>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
<!-- 查询操作 -->
|
|
<!-- 查询操作 -->
|
|
<div class="filter-container">
|
|
<div class="filter-container">
|
|
- <el-input v-model="listQuery.pkSn" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包编号" />
|
|
|
|
|
|
+<!-- <el-input v-model="listQuery.pkSn" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包编号" />-->
|
|
<el-input v-model="listQuery.mobile" clearable class="filter-item" style="width: 160px;" placeholder="请输入用户手机" />
|
|
<el-input v-model="listQuery.mobile" clearable class="filter-item" style="width: 160px;" placeholder="请输入用户手机" />
|
|
<el-input v-model="listQuery.pkCode" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包码" />
|
|
<el-input v-model="listQuery.pkCode" clearable class="filter-item" style="width: 150px;" placeholder="请输入券包码" />
|
|
<el-select v-model="listQuery.isExchange" clearable style="width: 150px" class="filter-item" placeholder="请选择使用状态">
|
|
<el-select v-model="listQuery.isExchange" clearable style="width: 150px" class="filter-item" placeholder="请选择使用状态">
|
|
<el-option key="0" label="未兑换" value="0" />
|
|
<el-option key="0" label="未兑换" value="0" />
|
|
<el-option key="1" label="已兑换" value="1" />
|
|
<el-option key="1" label="已兑换" value="1" />
|
|
</el-select>
|
|
</el-select>
|
|
- <el-date-picker v-model="exchangeTimeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
|
|
|
|
- range-separator="至" start-placeholder="兑换开始日期" end-placeholder="兑换结束日期" :picker-options="{}" />
|
|
|
|
|
|
+<!-- <el-date-picker v-model="exchangeTimeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"-->
|
|
|
|
+<!-- range-separator="至" start-placeholder="兑换开始日期" end-placeholder="兑换结束日期" :picker-options="{}" />-->
|
|
|
|
|
|
<el-select v-model="listQuery.isPre" clearable style="width: 150px" class="filter-item" placeholder="请选择预售状态">
|
|
<el-select v-model="listQuery.isPre" clearable style="width: 150px" class="filter-item" placeholder="请选择预售状态">
|
|
<el-option key="0" label="未预售" value="0" />
|
|
<el-option key="0" label="未预售" value="0" />
|
|
<el-option key="1" label="已预售" value="1" />
|
|
<el-option key="1" label="已预售" value="1" />
|
|
</el-select>
|
|
</el-select>
|
|
<el-input v-model="listQuery.preMobile" clearable class="filter-item" style="width: 150px;" placeholder="请输入预售手机" />
|
|
<el-input v-model="listQuery.preMobile" clearable class="filter-item" style="width: 150px;" placeholder="请输入预售手机" />
|
|
- <el-date-picker v-model="timeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"
|
|
|
|
- range-separator="至" start-placeholder="预售开始日期" end-placeholder="预售结束日期" :picker-options="{}" />
|
|
|
|
|
|
+<!-- <el-date-picker v-model="timeArray" type="datetimerange" value-format="yyyy-MM-dd hh:mm" class="filter-item"-->
|
|
|
|
+<!-- range-separator="至" start-placeholder="预售开始日期" end-placeholder="预售结束日期" :picker-options="{}" />-->
|
|
|
|
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
|
|
- icon="el-icon-search" @click="handleFilter(false)">查找</el-button>
|
|
|
|
|
|
+ icon="el-icon-search" @click="handleFilter(false)">查找</el-button>
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/list']" class="filter-item" type="primary"
|
|
- icon="el-icon-download" @click="handleFilter(true)">导出</el-button>
|
|
|
|
|
|
+ icon="el-icon-download" @click="handleFilter(true)">导出</el-button>
|
|
<el-button v-permission="['POST /admin/couponPackageDetail/import']" class="filter-item" type="primary"
|
|
<el-button v-permission="['POST /admin/couponPackageDetail/import']" class="filter-item" type="primary"
|
|
- icon="el-icon-upload2" @click="handleImport()">导入预售手机号</el-button>
|
|
|
|
|
|
+ icon="el-icon-upload2" @click="handleImport()">导入预售手机号</el-button>
|
|
<div style="display:inline;color:#09afff;font-size:12px">导入格式:券包名、券包编码、团长手机号、客户手机号;excel第一个sheet的第一行的表头</div>
|
|
<div style="display:inline;color:#09afff;font-size:12px">导入格式:券包名、券包编码、团长手机号、客户手机号;excel第一个sheet的第一行的表头</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -41,10 +119,10 @@
|
|
? 'success'
|
|
? 'success'
|
|
: ''
|
|
: ''
|
|
">{{
|
|
">{{
|
|
- scope.row.preMobile != null && scope.row.preMobile.length > 0
|
|
|
|
- ? "已预售"
|
|
|
|
- : "未预售"
|
|
|
|
- }}</el-tag>
|
|
|
|
|
|
+ scope.row.preMobile != null && scope.row.preMobile.length > 0
|
|
|
|
+ ? "已预售"
|
|
|
|
+ : "未预售"
|
|
|
|
+ }}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
@@ -66,8 +144,8 @@
|
|
<el-table-column align="center" label="有效时间" prop="startTime">
|
|
<el-table-column align="center" label="有效时间" prop="startTime">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.startTime | formatTime }}到{{
|
|
<span>{{ scope.row.startTime | formatTime }}到{{
|
|
- scope.row.endTime | formatTime
|
|
|
|
- }}</span>
|
|
|
|
|
|
+ scope.row.endTime | formatTime
|
|
|
|
+ }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
@@ -83,22 +161,22 @@
|
|
<el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
|
|
<el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile == null"
|
|
<el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile == null"
|
|
- v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
|
|
|
|
- type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
|
|
|
|
|
|
+ v-permission="['GET /admin/couponPackageDetail/send']" style="width:100px" icon="el-icon-chat-dot-round"
|
|
|
|
+ type="text" size="mini" @click="handleSend(scope.row)">发送预售短信</el-button>
|
|
<el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile != null"
|
|
<el-button v-if="scope.row.deleted == false && scope.row.isExchange == false && scope.row.preMobile != null"
|
|
- v-permission="['GET /admin/couponPackageDetail/rsend']" style="width:100px" icon="el-icon-refresh-left"
|
|
|
|
- type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
|
|
|
|
|
|
+ v-permission="['GET /admin/couponPackageDetail/rsend']" style="width:100px" icon="el-icon-refresh-left"
|
|
|
|
+ type="text" size="mini" @click="handleRSend(scope.row)">补发预售短信</el-button>
|
|
<el-button v-if="scope.row.deleted == false" v-permission="['GET /admin/couponPackageDetail/delete']"
|
|
<el-button v-if="scope.row.deleted == false" v-permission="['GET /admin/couponPackageDetail/delete']"
|
|
- style="width:100px" icon="el-icon-delete" type="text" size="mini"
|
|
|
|
- @click="handleDelete(scope.row)">券码作废</el-button>
|
|
|
|
|
|
+ style="width:100px" icon="el-icon-delete" type="text" size="mini"
|
|
|
|
+ @click="handleDelete(scope.row)">券码作废</el-button>
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/read']" type="text" size="mini" icon="el-icon-view"
|
|
<el-button v-permission="['GET /admin/couponPackageDetail/read']" type="text" size="mini" icon="el-icon-view"
|
|
- @click="handleDetail(scope.row)">详情</el-button>
|
|
|
|
|
|
+ @click="handleDetail(scope.row)">详情</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
|
|
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
|
|
- @pagination="getList" />
|
|
|
|
|
|
+ @pagination="getList" />
|
|
|
|
|
|
<el-dialog :visible.sync="detailFormVisible" title="详情" width="1000px" center>
|
|
<el-dialog :visible.sync="detailFormVisible" title="详情" width="1000px" center>
|
|
<el-table :data="detail" border>
|
|
<el-table :data="detail" border>
|
|
@@ -135,10 +213,10 @@
|
|
<el-table-column align="center" label="订单状态" prop="orderStatus">
|
|
<el-table-column align="center" label="订单状态" prop="orderStatus">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-tag>{{
|
|
<el-tag>{{
|
|
- orderStatusFilter(
|
|
|
|
- scope.row.order == null ? null : scope.row.order.orderStatus
|
|
|
|
- )
|
|
|
|
- }}</el-tag>
|
|
|
|
|
|
+ orderStatusFilter(
|
|
|
|
+ scope.row.order == null ? null : scope.row.order.orderStatus
|
|
|
|
+ )
|
|
|
|
+ }}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
@@ -157,8 +235,8 @@
|
|
|
|
|
|
<el-table-column align="center" label="优惠券类型" prop="coupon.type">
|
|
<el-table-column align="center" label="优惠券类型" prop="coupon.type">
|
|
<template>兑换券 </template>
|
|
<template>兑换券 </template>
|
|
- </el-table-column>
|
|
|
|
- <el-table-column align="center" label="有效期" prop="coupon.startTime">
|
|
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="有效期" prop="coupon.startTime">
|
|
<template slot-scope="scope">{{scope.row.coupon.startTime}}至{{scope.row.coupon.endTime}}</template>
|
|
<template slot-scope="scope">{{scope.row.coupon.startTime}}至{{scope.row.coupon.endTime}}</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column align="center" label="状态" prop="coupon.status">
|
|
<el-table-column align="center" label="状态" prop="coupon.status">
|
|
@@ -175,7 +253,7 @@
|
|
|
|
|
|
<el-dialog title="发送预售短信" :visible.sync="dialogSendFormVisible" width="600px">
|
|
<el-dialog title="发送预售短信" :visible.sync="dialogSendFormVisible" width="600px">
|
|
<el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px"
|
|
<el-form ref="sendForm" :rules="rules" :model="sendForm" status-icon label-position="left" label-width="100px"
|
|
- style="margin-left:20px;">
|
|
|
|
|
|
+ style="margin-left:20px;">
|
|
<el-form-item label="客户手机号" prop="mobile">
|
|
<el-form-item label="客户手机号" prop="mobile">
|
|
<el-input v-model="sendForm.mobile" maxlength="11" type="number" placeholder="请输入接收短信的手机号码" />
|
|
<el-input v-model="sendForm.mobile" maxlength="11" type="number" placeholder="请输入接收短信的手机号码" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -193,7 +271,7 @@
|
|
|
|
|
|
<el-form-item label="短信内容" prop="name">
|
|
<el-form-item label="短信内容" prop="name">
|
|
<el-input type="textarea" rows="5" disabled="disabled"
|
|
<el-input type="textarea" rows="5" disabled="disabled"
|
|
- value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-920-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
|
|
|
|
|
|
+ value="尊敬的客户:感谢您购买鲸致生活%s,请点击》 https://mall.zhaijieshi.cc/groupon/index.html?coupon=%s,登录官方小程序兑换服务。如有疑问,请致电鲸致生活全国统一客服热线400-920-8987(客服时间7:30-21:30)。祝您生活如意!"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -205,11 +283,11 @@
|
|
<!-- 导入预售 -->
|
|
<!-- 导入预售 -->
|
|
<el-dialog title="预售信息导入" :visible.sync="dialogImportVisible">
|
|
<el-dialog title="预售信息导入" :visible.sync="dialogImportVisible">
|
|
<el-form ref="dataForm" :rules="rules" :model="dataImportForm" status-icon label-position="left" label-width="100px"
|
|
<el-form ref="dataForm" :rules="rules" :model="dataImportForm" status-icon label-position="left" label-width="100px"
|
|
- style="width: 400px; margin-left:50px;">
|
|
|
|
|
|
+ style="width: 400px; margin-left:50px;">
|
|
|
|
|
|
<el-form-item label="团长" prop="rid">
|
|
<el-form-item label="团长" prop="rid">
|
|
<el-select v-model="dataImportForm.rid" style="width: 100%" class="filter-item" placeholder="请选择团长"
|
|
<el-select v-model="dataImportForm.rid" style="width: 100%" class="filter-item" placeholder="请选择团长"
|
|
- filterable="">
|
|
|
|
|
|
+ filterable="">
|
|
<el-option v-for="item in referees" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
|
|
<el-option v-for="item in referees" :key="item.refereeId" :label="item.refereeName" :value="item.refereeId" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -236,6 +314,35 @@
|
|
<el-button icon="el-icon-upload2" type="primary" @click="importConfirm">导入</el-button>
|
|
<el-button icon="el-icon-upload2" type="primary" @click="importConfirm">导入</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="发送预售短信" :visible.sync="dialogImportPhoneVisible">
|
|
|
|
+ <el-form ref="dataForm" :rules="rules" :model="dataImportPhoneForm" status-icon label-position="left" label-width="100px"
|
|
|
|
+ style="width: 600px; margin-left:50px;">
|
|
|
|
+ <el-button v-permission="['POST /admin/couponPackageDetail/import']" @click="importPhoneConfirm" class="filter-item" type="primary"
|
|
|
|
+ icon="el-icon-upload2" >导入手机号</el-button>
|
|
|
|
+ <span style="margin-left: 30px;color: #0eaefc">导入格式(表头):客户手机号:第一个sheet的第一列</span>
|
|
|
|
+ <el-form-item label="手机号文件">
|
|
|
|
+ <input type="file" @change="getImportPhoneFile($event)" ref="fileupload" />
|
|
|
|
+ <span style="color: black">导入成功手机号<span style="color: red">{{importPhoneCount}}</span>个</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="领取短链">
|
|
|
|
+ <span style="color: #0b0b0b">{{couponPackage.shortChain}}</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="短信模板" prop="rid">
|
|
|
|
+ <el-select @change="selectTemplage" v-model="dataImportPhoneForm.smsTemplateId" style="width: 100%" class="filter-item" placeholder="请选择短信模板" filterable="">
|
|
|
|
+ <el-option v-for="item in smsTemplateList" :key="item.id" :label="item.templateName" :value="item.id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="短信内容">
|
|
|
|
+ <el-input type="textarea" disabled
|
|
|
|
+ :rows="5" v-model="dataImportPhoneForm.content" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogImportPhoneVisible = false">取消</el-button>
|
|
|
|
+ <el-button icon="el-icon-upload2" type="primary" @click="sendPhoneMsg" >发送</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -248,7 +355,7 @@ import {
|
|
packageDetailSend,
|
|
packageDetailSend,
|
|
listPackageDetailExport,
|
|
listPackageDetailExport,
|
|
packageImport,
|
|
packageImport,
|
|
- packageDetailDelete,
|
|
|
|
|
|
+ packageDetailDelete, importPhone, sendSmsInPhone, getSmsTemplateByType,
|
|
} from "@/api/couponpackage";
|
|
} from "@/api/couponpackage";
|
|
import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
|
|
import Pagination from "@/components/Pagination"; // Secondary package based on el-pagination
|
|
import {
|
|
import {
|
|
@@ -257,6 +364,7 @@ import {
|
|
statusMap,
|
|
statusMap,
|
|
defaultTypeOptions,
|
|
defaultTypeOptions,
|
|
} from "@/api/enumUtils";
|
|
} from "@/api/enumUtils";
|
|
|
|
+import {allChannel} from "@/api/channel";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "CouponPackageDetail",
|
|
name: "CouponPackageDetail",
|
|
@@ -359,11 +467,27 @@ export default {
|
|
dataImportForm: {
|
|
dataImportForm: {
|
|
file: undefined,
|
|
file: undefined,
|
|
},
|
|
},
|
|
- importResult: [], //导入结果
|
|
|
|
|
|
+ importResult: [], //导入结果,
|
|
|
|
+ couponPackage:{},
|
|
|
|
+ channels:[],
|
|
|
|
+ couponList:[],
|
|
|
|
+ dialogImportPhoneVisible: false,
|
|
|
|
+ dataImportPhoneForm: {
|
|
|
|
+ file: undefined,
|
|
|
|
+ smsTemplateId:'',
|
|
|
|
+ content:''
|
|
|
|
+ },
|
|
|
|
+ importPhoneCount:0,
|
|
|
|
+ importMarkers:'',
|
|
|
|
+ smsTemplateList:[]
|
|
|
|
+
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.init();
|
|
this.init();
|
|
|
|
+ allChannel().then((res) => {
|
|
|
|
+ this.channels = res.data.data;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init: function () {
|
|
init: function () {
|
|
@@ -381,6 +505,7 @@ export default {
|
|
if (this.listQuery.isExport == false) {
|
|
if (this.listQuery.isExport == false) {
|
|
listPackageDetail(this.listQuery).then((response) => {
|
|
listPackageDetail(this.listQuery).then((response) => {
|
|
this.list = response.data.data.list;
|
|
this.list = response.data.data.list;
|
|
|
|
+ this.couponPackage=this.list[0]
|
|
this.total = response.data.data.total;
|
|
this.total = response.data.data.total;
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
});
|
|
});
|
|
@@ -527,8 +652,8 @@ export default {
|
|
message: "短信补发成功",
|
|
message: "短信补发成功",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- else
|
|
|
|
- this.$message.warning(res.data.errmsg);
|
|
|
|
|
|
+ else
|
|
|
|
+ this.$message.warning(res.data.errmsg);
|
|
}
|
|
}
|
|
)
|
|
)
|
|
.catch((response) => {
|
|
.catch((response) => {
|
|
@@ -606,6 +731,138 @@ export default {
|
|
this.downloadLoading = false;
|
|
this.downloadLoading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ formateChannel(channelId) {
|
|
|
|
+ if (channelId == null || channelId == '') {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let nm = '';
|
|
|
|
+ this.channels.forEach(f => {
|
|
|
|
+ if (f.id == channelId) {
|
|
|
|
+ nm = f.name;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return nm;
|
|
|
|
+ },
|
|
|
|
+ formatGoodsType(goodsType) {
|
|
|
|
+ if (goodsType === 0) {
|
|
|
|
+ return "全场通用";
|
|
|
|
+ } else if (goodsType === 1) {
|
|
|
|
+ return "指定分类";
|
|
|
|
+ } else {
|
|
|
|
+ return "指定商品";
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleSendNew(){
|
|
|
|
+ this.dialogImportPhoneVisible=true
|
|
|
|
+ this.importPhoneCount=0;
|
|
|
|
+ this.importMarkers='';
|
|
|
|
+ this.getSmsTemplate();
|
|
|
|
+ },
|
|
|
|
+ importPhoneConfirm() {
|
|
|
|
+ if (this.dataImportPhoneForm.file == "" || this.dataImportPhoneForm.file == undefined) {
|
|
|
|
+ this.$message.warning("请选择文件!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // console.info(this.dataImportForm.file.name)
|
|
|
|
+ if (this.dataImportPhoneForm.file.name.lastIndexOf("xlsx") < 0) {
|
|
|
|
+ this.$message.warning("请选择excel文件!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: "文件导入中,请耐心等待...",
|
|
|
|
+ spinner: "el-icon-loading",
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
+ });
|
|
|
|
+ var formData = new window.FormData(); // vue 中使用 window.FormData(),否则会报 'FormData isn't definded'
|
|
|
|
+ formData.append("file", this.dataImportPhoneForm.file);
|
|
|
|
+ formData.append("pkSn", this.couponPackage.pkSn);
|
|
|
|
+
|
|
|
|
+ importPhone(formData)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log("导入返回数据", res);
|
|
|
|
+ loading.close();
|
|
|
|
+ if (res.data.errno == 0) {
|
|
|
|
+ if (res.data.data.count >= 1) {
|
|
|
|
+ this.importPhoneCount = res.data.data.count;
|
|
|
|
+ this.importMarkers = res.data.data.importMarkers;
|
|
|
|
+ console.log(2000)
|
|
|
|
+ console.log(this.importPhoneCount)
|
|
|
|
+ this.$message.success("导入"+this.importPhoneCount+"个手机号成功!")
|
|
|
|
+ }else {
|
|
|
|
+ this.$message.error("导入0个手机号,请联系管理员!")
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(res.data.errmsg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ this.$message.warning(err.data.errmsg);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ getImportPhoneFile: function (event) {
|
|
|
|
+ this.dataImportPhoneForm.file = event.target.files[0];
|
|
|
|
+ console.log(this.file);
|
|
|
|
+ },
|
|
|
|
+ sendPhoneMsg(){
|
|
|
|
+ if(this.importPhoneCount==0){
|
|
|
|
+ this.$message.error("请先导入手机号!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(this.dataImportPhoneForm.smsTemplateId==''){
|
|
|
|
+ this.$message.error("请先选择短信模板!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: "发送短信中,请耐心等待...",
|
|
|
|
+ spinner: "el-icon-loading",
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
+ });
|
|
|
|
+ var formData = new window.FormData(); // vue 中使用 window.FormData(),否则会报 'FormData isn't definded'
|
|
|
|
+ formData.append("importMarkers", this.importMarkers);
|
|
|
|
+ formData.append("content", this.dataImportPhoneForm.content);
|
|
|
|
+ sendSmsInPhone(formData)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log("发送短信数据", res);
|
|
|
|
+ loading.close();
|
|
|
|
+ if (res.data.errno == 0) {
|
|
|
|
+ console.log(2000)
|
|
|
|
+ this.$message.success("发送成功!")
|
|
|
|
+ this.dialogImportPhoneVisible=false;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(res.data.errmsg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ this.$message.warning(err.data.errmsg);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getSmsTemplate(){
|
|
|
|
+ getSmsTemplateByType({type:1})
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.data.errno == 0) {
|
|
|
|
+ console.log(res.data.data)
|
|
|
|
+ this.smsTemplateList=res.data.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(res.data.errmsg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {
|
|
|
|
+ this.$message.warning(err.data.errmsg);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ selectTemplage(){
|
|
|
|
+ let smsTemplateId=this.dataImportPhoneForm.smsTemplateId
|
|
|
|
+ let smsTemplate=this.smsTemplateList.find(item=>item.id==smsTemplateId);
|
|
|
|
+
|
|
|
|
+ this.dataImportPhoneForm.content=smsTemplate.content.replace("#changeable",this.couponPackage.shortChain);
|
|
|
|
+ console.log(smsTemplate)
|
|
|
|
+
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|