Commit 99ca1ec5 by damodmg

add:文本券码

parent 9095de02
<!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.2fdb8aca6fd409b54d025af163f812a9.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.05.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.bf93010d9b9b1322a27b.js></script><script type=text/javascript src=./static/js/app.7e2ec8aba8120871bdc4.js></script></body></html>
\ No newline at end of file
<!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.f854bfaec886e8664adf68103e83359c.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/aside-menu.2.0.05.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-linkage.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-new.2.0.11.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.03.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.bf93010d9b9b1322a27b.js></script><script type=text/javascript src=./static/js/app.e81ad39e7f0dc0e9f684.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.
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.
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
<div>
<el-dialog title="券码" :visible.sync="couponListModal.dialogVisible" width="620px">
<div>
<div class="coupon-search">
<el-input v-model="searchValue" placeholder="请输入卡号/卡密券码" prefix-icon="el-icon-search" clearable @keyup.enter.native="getSearchList" @clear="getSearchList"> </el-input>
</div>
<el-table :data="couponListModal.tableDate" style="width: 100%">
<el-table-column prop="cardNum" label="卡号" width="160px;"> </el-table-column>
<el-table-column prop="cardPass" label="卡密/券码" width="160px;"> </el-table-column>
<el-table-column prop="status" label="兑换状态" width="120px;">
<template slot-scope="scope">
<p class="intergral-edit">{{ scope.row.status === 0 ? '未兑换' : '已兑换' }}</p>
</template>
</el-table-column>
<el-table-column label="操作" width="140px;">
<template slot-scope="scope">
<div>
<el-popover placement="top" width="160" v-model="scope.row.visible2" style="margin-left:8px">
<p style="line-height:1.5;padding: 10px 10px 20px;">确定删除该券码吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, 0)">确定</el-button>
</div>
<el-button slot="reference" type="text">删除</el-button>
</el-popover>
</div>
</template>
</el-table-column>
<template slot="empty">
<div class="no-data-wrap">
<div class="no-data-icon">
<img src="../../../../static/img/no-data_icon.png" />
</div>
<p>暂无数据</p>
</div>
</template>
</el-table>
<div style="margin:15px 0;text-align:right">
<el-pagination :page-size="20" :pager-count="5" @current-change="handleCurrentChange" layout="prev, pager, next" :current-page="couponCurrentPage" :total="total"> </el-pagination>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import qs from 'qs';
import request from '../../../service/request.js';
export default {
props: {
couponListModal: {
type: Object
}
},
data() {
return {
dialogVisible: true,
searchValue: '',
couponCurrentPage: 1
};
},
methods: {
//搜索
getSearchList() {
this.couponCurrentPage = 1;
this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
},
//设置页码
handleCurrentChange(val) {
this.couponCurrentPage = val;
this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
},
//删除
deleteList(item) {
let params = {
id: item.id
};
request.post('/api-integral-mall/delete-pro', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('删除成功');
this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
} else {
this.$message.error(res.data.message);
}
});
}
},
components: {}
};
</script>
<style scoped>
.coupon-search {
width: 260px;
margin-bottom: 22px;
}
</style>
......@@ -67,7 +67,7 @@
</el-table-column>
<el-table-column prop="sortCost" label="库存" sortable="custom">
<template slot-scope="scope">
<p class="intergral-edit">{{ scope.row.virtualStock }}<i class="el-icon-edit" @click="handleTable(scope.row, 'stock')"></i></p>
<p class="intergral-edit">{{ scope.row.virtualStock }}<i class="el-icon-edit" v-if="scope.row.giftType === 1" @click="handleTable(scope.row, 'stock')"></i></p>
</template>
</el-table-column>
<el-table-column prop="sortTimes" label="销量" sortable="custom">
......@@ -95,10 +95,11 @@
<span style="display:none">{{ refash }}</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="180px">
<el-table-column label="操作" min-width="220px">
<template slot-scope="scope">
<div>
<el-button type="text" @click="getLink(scope.row)">推广</el-button>
<el-button type="text" v-if="scope.row.changeType === '5'" @click="getCouponList(scope.row.integralMallProId)">券码</el-button>
<el-button type="text" v-if="scope.row.status === 2" @click="deleteList(scope.row, 1)">下架</el-button>
<el-button type="text" v-if="scope.row.status === 1" @click="deleteList(scope.row, 2)">上架</el-button>
<el-button type="text" @click="goAdd(scope.row)">编辑</el-button>
......@@ -137,6 +138,8 @@
<selectType :addModalData="addModalData"></selectType>
<!-- 调整积分费用 -->
<stockModal :intergralModal="intergralModal" @getList="getList" v-if="intergralModal.dialogVisible"></stockModal>
<!-- 卡券列表 -->
<couponList :couponListModal="couponListModal" v-if="couponListModal.dialogVisible" @getChildSearch="getChildSearch"></couponList>
</div>
</template>
......@@ -149,6 +152,7 @@ import eqCode from '../../../components/eqCode';
import selectType from '../../../components/selectGoodsType';
import stockModal from '../../../components/getSkuList';
import copy from '../../../utils/clone.js';
import couponList from './couponList';
export default {
data() {
return {
......@@ -199,7 +203,26 @@ export default {
type: ''
},
list: [],
giftListObj: {} //缓存数据
giftListObj: {}, //缓存数据
couponListModal: {
dialogVisible: false,
integralMallProId: '',
tableDate: [
{
cardNum: '154621154',
cardPass: '4546542312dwa',
status: 1
},
{
cardNum: '16577777777777',
cardPass: '2313214444444445',
status: 0
}
]
},
couponListSearch: '',
couponCurrentPage: 1,
couponPageSize: 20
};
},
created() {
......@@ -313,6 +336,36 @@ export default {
}
});
},
// 获取卡券列表
// showCouponListModal(item) {
// // console.log(item);
// this.getCouponList(item)
// this.couponListModal.dialogVisible = true;
// },
getChildSearch(val, id, couponCurrentPage) {
this.couponListSearch = val;
this.couponCurrentPage = couponCurrentPage;
this.getCouponList(id);
},
// 获取文本卡券列表
getCouponList(integralMallProId) {
let params = {
integralMallProId: integralMallProId,
search: this.couponListSearch,
currentPage: this.couponCurrentPage,
pageSize: 20
};
request.get('/api-integral-mall/page-gift', { params }).then(res => {
if (res.data.errorCode === 0) {
this.couponListModal.dialogVisible = true;
this.couponListModal.integralMallProId = integralMallProId;
} else {
this.$message.error(res.data.message);
}
});
},
// 删除操作
deleteList(item, type) {
let params = {
......@@ -569,7 +622,8 @@ export default {
editName,
eqCode,
selectType,
stockModal
stockModal,
couponList
}
};
</script>
......
<template>
<div>
<el-dialog title="批量导入文本券码" :visible.sync="importCouponModal.dialogVisible" width="620px">
<el-form :model="dialogForm" label-position="right" label-width="80px" v-loading="loading">
<el-form-item label="选择文件" required>
<div>
<div class="upload-btn">
<el-upload class="upload-ele" :action="action" :headers="headersUpload" :before-upload="uploadFileBefore" :on-success="uploadFile" with-credentials :show-file-list="showList" :data="uploadData">
<el-button size="small"><i class="el-icon-upload2" style="margin-right:5px"></i>点击上传</el-button>
</el-upload>
</div>
<el-button type="info" plain @click="downloadFile">下载EXCEL模板</el-button>
</div>
<p class="import-info" v-show="importMess">
本次共导入&nbsp;<span style="font-weight:600">{{ errornumber + correctNumber }}</span
>&nbsp;个商品,其中成功&nbsp;<span style="font-weight:600">{{ correctNumber }}</span
>&nbsp;个,失败&nbsp;<span style="color:#f5222d">{{ errornumber }}</span
>&nbsp;<a href="javaScript:void(0)" v-show="errornumber > 0" style="margin-left:10px" @click="showInfo">查看失败原因</a>
</p>
</el-form-item>
<el-form-item label="导入规则">
<div class="line"></div>
<div class="upload-rules">
<p>1. 每个sheet表最多1000条信息,文件大小不超过2M</p>
<p>2. 卡号可不填写,卡密/券码必填</p>
<p>3. 仅支持.xlsx 文件的导入(建议直接下载模板,在模板的基础上进行数据的填充)</p>
</div>
</el-form-item>
</el-form>
</el-dialog>
<errorList :importInfo="importInfo"></errorList>
</div>
</template>
<script>
import errorList from '../../order/errorList';
export default {
props: {
importCouponModal: {
type: Object
}
},
data() {
return {
// action: window.location.origin + '/api-integral-mall/upload-gift-card?requestProject=intergral-mall',
action: 'http://gicdev.demogic.com/api-integral-mall/upload-gift-card?requestProject=intergral-mall',
headersUpload: {
sign: ''
},
uploadData: {
integralMallProId: ''
},
dialogForm: {},
errorList: [],
showList: false,
correctNumber: 0,
errornumber: 0,
importInfo: {
//失败原因列表
dialogVisible: false,
list: []
},
importMess: false
};
},
methods: {
//下载模板
downloadFile() {
let url = 'static/文本券码导入模板.xlsx';
window.open(url);
},
//上传之前
uploadFileBefore(file) {
const isXlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (file.type !== isXlsx) {
this.$message.error('文件格式错误,请导入.xlsx格式的文件');
return false;
}
if (file.size > 2 * 1024 * 1024) {
this.$message.error('请上传小于2MB的文件');
return false;
}
if (localStorage.getItem('sign')) {
this.headersUpload.sign = localStorage.getItem('sign');
} else {
this.headersUpload.sign = '';
}
this.uploadData.integralMallProId = this.importCouponModal.integralMallProId;
this.loading = true;
this.fileName = file.name;
},
//上传文件
uploadFile(file, fileList) {
if (file.errorCode === 0) {
this.importMess = true;
if (file.result !== '') {
this.importInfo.list = file.result.list;
this.correctNumber = file.result.correctNumber;
this.errornumber = file.result.errornumber;
this.dialogFormVisible = true;
this.loading = false;
this.$emit('getSuceessNum', this.correctNumber);
} else {
this.errorList = [];
}
} else {
this.loading = false;
this.$message.error(file.message);
this.fileName = '';
}
},
showInfo() {
this.importInfo.dialogVisible = true;
}
},
components: {
errorList
}
};
</script>
<style scoped>
.dialog-body {
display: flex;
justify-content: center;
margin-bottom: 25px;
/* justify-content: space-around; */
}
/*上传文件*/
.upload-btn {
height: 30px;
/* text-align: center; */
border: 1px dashed rgba(192, 196, 204, 1);
display: inline-block;
font-size: 14px;
color: #c0c4cc;
cursor: pointer;
margin-right: 10px;
width: 120px;
/* text-align: center; */
border-radius: 4px;
}
.import-info {
color: #606266;
margin-top: 10px;
}
.upload-ele .el-button {
border: none;
color: #c0c4cc;
}
.upload-ele .el-button--small {
padding: 7px 15px;
}
.upload-btn .el-icon-upload2 {
font-size: 16px;
color: #c0c4cc;
}
.upload-btn:hover {
border-color: #1890ff;
}
.line {
border-top: 1px solid #e4e7ed;
position: absolute;
left: 0px;
top: 15px;
width: 100%;
}
.upload-rules {
color: #909399;
font-size: 13px;
line-height: 18px;
margin-top: 30px;
}
.upload-ele .el-upload {
width: 120px !important;
display: inline !important;
}
</style>
......@@ -23,9 +23,8 @@
</el-input>
</el-form-item>
<el-form-item label="礼品主图" required>
<p style="font-size: 12px; color: rgb(144, 147, 153);">图片宽度≥700px,图片宽高比1:1,单张图片大小不超过 2 MB,至少上传1张,最多可上传 5 张。</p>
<div class="upload-list-box">
<div style="display: inline-block;vertical-align: top;margin-right:5px">
<div style="display: inline-block;vertical-align: top;margin-right:5px;height:104px;">
<div v-for="(item, index) in giftForm.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>
......@@ -38,7 +37,7 @@
<i class="el-icon-plus"></i>
</el-upload>
</div>
<p style="font-size: 12px; color: rgb(144, 147, 153);line-height:18px;margin-top:10px;">图片宽度≥700px,图片宽高比1:1,单张图片大小不超过 2 MB,至少上传1张,最多可上传 5 张。</p>
<el-dialog :visible.sync="dialogVisibleImg">
<img width="100%" :src="dialogEnlargeImageUrl" alt="" />
</el-dialog>
......@@ -205,11 +204,11 @@
</el-form-item> -->
<el-form-item label="配送方式" required v-if="giftType !== 1">
<el-radio-group v-model="giftForm.changeType" @change="changeDeliver" :disabled="editChangeTypeStatus">
<el-radio :label="3" v-if="giftForm.changeType !== 5">在线发货 </el-radio>
<el-radio :label="1" v-if="giftForm.changeType !== 5">微信兑换券</el-radio>
<el-radio :label="5" v-if="giftForm.changeType === 5">文本券码</el-radio>
<el-radio :label="3">在线发货 </el-radio>
<el-radio :label="1" v-if="giftForm.changeType === 1">微信兑换券</el-radio>
<el-radio :label="5" v-if="giftForm.changeType !== 1">文本券码</el-radio>
</el-radio-group>
<el-button type="primary" size="mini" v-if="giftForm.changeType === 5" style="margin-left:20px;">批量导入</el-button>
<el-button type="primary" size="mini" v-if="giftForm.changeType === 5" style="margin-left:20px;" @click="handleImportCoupon">批量导入</el-button>
</el-form-item>
<!-- <el-form-item label="配送方式" required>
<el-radio-group v-model="giftForm.changeType" @change="changeDeliver" :disabled="editChangeTypeStatus">
......@@ -288,6 +287,7 @@
<el-button type="primary" @click="goDeliverSet">确 定</el-button>
</span>
</el-dialog>
<importCoupon :importCouponModal="importCouponModal" @getSuceessNum="getSuceessNum"></importCoupon>
</div>
</template>
......@@ -298,6 +298,7 @@ import copy from '../../../utils/clone.js';
import getInputVal from '../../../utils/common.js';
import addCate from '../../../components/addGiftCate';
import tinymceEdit from '../../../components/tinymce-edit';
import importCoupon from './importCoupon';
import addSku from './addSku';
export default {
data() {
......@@ -363,8 +364,8 @@ export default {
changeTypeList: [{ type: 'array', required: true, message: '请至少选择一个配送方式', trigger: 'change' }]
},
refundTypeStatus: false,
uploadAction: window.location.origin + '/api-plug/upload-img?requestProject=integral-mall',
// uploadAction: 'http://gicdev.demogic.com/api-plug/upload-img?requestProject=integral-mall',
// 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: ''
},
......@@ -406,7 +407,13 @@ export default {
couponCostValue: 0, //兑换券成本
couponCardStock: 0, //兑换券库存
costValueStatus: false,
dialogVisibleLink: false
dialogVisibleLink: false,
importCouponModal: {
//文本券码导入
dialogVisible: false,
integralMallProId: ''
},
textStock: 0 //文本券码库存数
// proReferId: ''
};
},
......@@ -427,10 +434,17 @@ export default {
} else if (this.giftType === 0) {
//虚拟
this.giftForm.changeType = 5;
this.stockDisabled = this.giftForm.changeType === 5 ? true : false;
}
if (this.mallProId !== '-1') {
this.getInfo();
this.editChangeTypeStatus = true;
} else {
if (this.giftType === 0) {
this.getGiftId();
} else {
this.mallProId === '-1';
}
}
let val = {
......@@ -989,6 +1003,34 @@ export default {
this.refundTypeStatus = false;
this.cardList = [];
}
if (this.giftForm.changeType === 3) {
//在线发货
this.giftForm.virtualStock = 0;
} else if (this.giftForm.changeType === 5) {
//文本卡券
this.giftForm.virtualStock = this.textStock;
}
this.stockDisabled = this.giftForm.changeType === 5 ? true : false;
},
//获取商品的id
getGiftId() {
request.post('/api-integral-mall/get-gift-id').then(res => {
if (res.data.errorCode === 0) {
this.mallProId = res.data.result;
} else {
this.$message.error(res.data.message);
}
});
},
// 导入文本券码
handleImportCoupon() {
this.importCouponModal.dialogVisible = true;
this.importCouponModal.integralMallProId = this.mallProId;
},
// 获取文本券码成功的数据
getSuceessNum(val) {
this.textStock = val;
this.giftForm.virtualStock = this.textStock;
},
// 勾选自提点
handleStatus() {
......@@ -1335,7 +1377,8 @@ export default {
components: {
addCate,
tinymceEdit,
addSku
addSku,
importCoupon
}
};
</script>
......
......@@ -31,8 +31,8 @@
</div>
</div>
<div class="fr">
<el-button plain @click="exportExcel" v-if="integralMallProId"><i class="iconfont icon-icon_yunxiazai" style="margin-right:5px"></i>导出订单</el-button>
<el-button plain @click="exportExcelAll" v-else><i class="iconfont icon-icon_yunxiazai" style="margin-right:5px"></i>导出订单</el-button>
<el-button @click="exportExcel" v-if="integralMallProId" type="primary"><i class="iconfont icon-icon_yunxiazai" style="margin-right:5px"></i>导出订单</el-button>
<el-button @click="exportExcelAll" v-else type="primary"><i class="iconfont icon-icon_yunxiazai" style="margin-right:5px"></i>导出订单</el-button>
</div>
</div>
</div>
......
......@@ -25,6 +25,7 @@
<el-option label="物流发货" :value="2"></el-option>
<el-option label="在线发货(虚拟商品)" :value="3"></el-option>
<el-option label="门店自提" :value="4"></el-option>
<el-option label="文本券码" :value="5"></el-option>
</el-select>
</div>
<div class="search-item">
......
......@@ -93,7 +93,8 @@
<p>
<span>支付流水号:</span><span>{{ orderDetail.transactionId ? orderDetail.transactionId : '--' }}</span>
</p>
<el-button slot="reference" type="text" class="iconfont icon-icon-"></el-button>
<!-- <el-button slot="reference" type="text" class="iconfont icon-icon-"></el-button> -->
<i slot="reference" class="iconfont icon-icon-"></i>
</el-popover>
</p>
<p class="order-mess-item">
......@@ -737,4 +738,11 @@ export default {
.el-timeline-item__timestamp.is-bottom {
margin-top: 8px;
}
.icon-icon- {
color: #606266;
cursor: pointer;
}
.icon-icon-:hover {
color: #303133;
}
</style>
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