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.
......@@ -17,12 +17,12 @@
<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'" style="margin-bottom:66px;">
<el-form-item label="选择卡券" required v-show="mallProId === '-1'">
<el-button plain @click="showCard">添加卡券</el-button>
<span style="font-size: 12px;color: rgb(144, 147, 153);margin-left:10px;">支持选择兑换券</span>
</el-form-item>
<el-form-item label="选择卡券" required v-show="mallProId !== '-1'"> </el-form-item>
<el-table :data="cardList" style="width: 900px;margin-left:135px;margin-top:-44px;" v-show="cardList.length > 0">
<el-table :data="cardList" style="width: 900px;margin-left:135px;margin-bottom:22px" v-show="cardList.length > 0" :style="{ marginTop: mallProId !== '-1' ? '-60px' : '' }">
<el-table-column label="卡券名称" prop="cardName"> </el-table-column>
<el-table-column label="有效期" prop="limitDay">
<template slot-scope="scope">
......@@ -42,6 +42,35 @@
</el-table-column>
<el-table-column label="库存" prop="couponStock"> </el-table-column>
</el-table>
<el-form-item label="卡券主图">
<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>
</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>
</div>
<p style="font-size: 12px; color: rgb(144, 147, 153);line-height:18px;margin-top:10px">图片宽度≥700px,图片宽高比1:1,单张图片大小不超过 2 MB。</p>
<el-dialog :visible.sync="dialogVisibleImg">
<img width="100%" :src="dialogEnlargeImageUrl" alt="" />
</el-dialog>
</div>
</el-form-item>
</div>
<div class="section-content">
<h3>图文信息</h3>
<el-form-item label="">
<div class="tinymce-wrap">
<tinymce-edit ref="tinymceWrap" :bodyHtml="couponForm.detailDescription" :projectName="projectName"></tinymce-edit>
</div>
</el-form-item>
</div>
<div class="section-content">
<h3>销售信息</h3>
......@@ -155,7 +184,7 @@
import qs from 'qs';
import request from '../../../service/request.js';
import getInputVal from '../../../utils/common.js';
import tinymceEdit from '../../../components/tinymce-edit';
export default {
data() {
const validateTime = (rule, value, callback) => {
......@@ -184,6 +213,8 @@ export default {
proReferId: '', //卡券关联id
couponForm: {
cardType: '', //卡券类型
images: [],
detailDescription: '', //图文详情
integralCost: '', //积分费用
cashCost: '',
virtualStock: '',
......@@ -202,6 +233,13 @@ export default {
limitTimeBegin: '',
timeZones: ['', '']
},
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: ''
},
uploadStatus: true, //上传按钮
dialogVisibleImg: false, //上传图片
refash: false,
memberGradeList: [], //会员等级
// 门店控件
......@@ -288,14 +326,22 @@ export default {
this.couponForm.cashCost = res.data.result.cashCost;
//库存
this.couponForm.virtualStock = res.data.result.virtualStock;
this.couponForm.detailDescription = res.data.result.detailDescription; //图文详情
//适用会员
if (res.data.result.memberGrade) {
this.couponForm.memberGrade = res.data.result.memberGrade.split(',');
} else {
this.couponForm.memberGrade = [];
}
if (res.data.result.images) {
//主图
for (let item of res.data.result.images) {
this.couponForm.images.push({
imageUrl: item.imageUrl,
imageCode: item.imageFieldCode
});
}
}
this.sendChildData.storeType = res.data.result.showStore || 0;
if (this.sendChildData.storeType === 1) {
this.sendChildData.storeGroupIds = res.data.result.storeGroupIds || '';
......@@ -455,6 +501,94 @@ export default {
delTimeRange(index) {
this.couponForm.timeRangeList.splice(index, 1);
},
// 图片上传
// 上传图片前
beforeUpload(file) {
if (this.couponForm.images === null) {
this.couponForm.images = [];
}
if (this.couponForm.images.length > 4) {
this.$message.warning('最多上传5张商品主图');
return false;
}
if (file.size > 2 * 1024 * 1024) {
this.$message.error('请上传小于2MB的图片');
return false;
}
if (file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/jpg' && file.type !== 'image/gif') {
this.$message.error('请上传jpg,png,gif格式的图片');
return false;
}
if (localStorage.getItem('sign')) {
this.headersUpload.sign = localStorage.getItem('sign');
} 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;
if (width < 700 || width / height != 1) {
that.$message.error('请上传正确的图片尺寸');
reject();
}
resolve();
};
image.src = event.target.result;
};
reader.readAsDataURL(file);
});
},
// 预览
handlePictureCardPreview(file) {
this.couponForm.images = file.url;
this.dialogVisibleImg = true;
},
// 上传图片成功
uploadSuccess(response, file, fileList) {
if (response.errorCode === 0) {
this.couponForm.images.push({
imageUrl: response.result[0].qcloudImageUrl,
imageCode: response.result[0].imageFiledCode
});
this.$message.success('上传成功');
if (this.couponForm.images.length === 1) {
this.uploadStatus = false;
} else {
this.uploadStatus = true;
}
} else {
this.$message.error(response.message);
}
},
// 删除
deteletDialogImageUrl(index) {
this.uploadStatus = true;
this.couponForm.images.splice(index, 1);
},
// 放大
enlargeDialogImageUrl(index) {
this.dialogEnlargeImageUrl = this.couponForm.images[index].imageUrl;
this.dialogVisibleImg = true;
},
// 左移一位
moveLeft(index) {
this.swapArray(this.couponForm.images, index, index - 1);
},
//右移一位
moveRight(index) {
this.swapArray(this.couponForm.images, index, index + 1);
},
//两个数据条换位置
swapArray(arr, index1, index2) {
arr[index1] = arr.splice(index2, 1, arr[index1])[0];
return arr;
},
// 提交数据
submitForm(couponForm) {
if (this.cardList.length === 0) {
......@@ -485,6 +619,23 @@ export default {
return false;
}
}
//图文详情的大小限制
if (this.couponForm.detailDescription) {
if (this.couponForm.detailDescription.length > 5000) {
this.$message.error('图文详情输入内容不能超过5000');
return false;
}
}
//商品主图的处理
let giftImageUrls = [];
let giftImageFiledCodes = [];
if (this.couponForm.images.length) {
for (let item of this.couponForm.images) {
giftImageUrls.push(item.imageUrl);
giftImageFiledCodes.push(item.imageCode);
}
}
this.$refs[couponForm].validate(valid => {
if (valid) {
let params = {
......@@ -492,6 +643,9 @@ export default {
integralMallProId: this.mallProId === '-1' ? '' : this.mallProId, //礼品id
proType: 1, //优惠券
proReferId: this.proReferId, //卡券id
detailDescription: this.couponForm.detailDescription, //图文详情
giftImageUrls: giftImageUrls.join(','), //礼品主图
giftImageFiledCodes: giftImageFiledCodes.join(','),
cardType: this.couponForm.cardType,
integralCost: this.couponForm.integralCost, //积分费用
costValue: this.costValue, //礼品成本
......@@ -560,7 +714,9 @@ export default {
});
}
},
components: {}
components: {
tinymceEdit
}
};
</script>
<style scoped>
......@@ -608,6 +764,101 @@ export default {
.mb8 {
margin-bottom: 8px;
}
/* 主图 */
.img-box {
width: 104px;
height: 104px;
border-radius: 4px;
display: inline-block;
margin-right: 8px;
position: relative;
}
.img-box img {
border-radius: 4px;
}
.dialog-img {
width: 104px;
height: 104px;
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
display: none;
cursor: pointer;
border-radius: 6px;
}
.img-box:hover .dialog-img {
display: block;
}
.upload-list-box .el-icon-delete {
position: absolute;
left: 56px;
top: 50%;
transform: translateY(-50%);
display: none;
font-size: 20px;
color: #fff;
z-index: 2;
}
.el-icon-zoom-in {
position: absolute;
left: 30px;
top: 50%;
transform: translateY(-50%);
display: none;
font-size: 20px;
color: #fff;
z-index: 2;
}
.el-icon-arrow-left {
position: absolute;
left: 5px;
top: 50%;
transform: translateY(-50%);
display: none;
font-size: 20px;
color: #fff;
z-index: 2;
}
.el-icon-arrow-right {
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
display: none;
font-size: 20px;
color: #fff;
z-index: 2;
}
.img-box:hover i {
display: block;
cursor: pointer;
}
.img-box:first-child .el-icon-arrow-left {
display: none;
}
.img-box:last-child .el-icon-arrow-right {
display: none;
}
/*.img-box:hover img{
opacity:0.6;
cursor: pointer;
}*/
.img-box img {
width: 104px;
height: 104px;
}
.w-300 {
width: 300px;
}
.w-600 {
width: 600px;
}
.mall-content-section {
position: relative;
}
</style>
<style>
.select-shop__right {
......@@ -616,4 +867,9 @@ export default {
.section-content .pagination {
float: none !important;
}
.upload-list-box .el-upload--picture-card {
width: 104px;
height: 104px;
line-height: 104px;
}
</style>
<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