Commit 0c82cb8d by zhangquan

修改单词

1 parent f4d03d85
......@@ -101,23 +101,23 @@ const staticRoutes = Object.freeze([
},
{
//商品优惠券
name: 'goodsConpon',
path: '/goodsConpon/index',
component: resolve => require([`@/views/goodsConpon/index.vue`], resolve),
name: 'goodsCoupon',
path: '/goodsCoupon/index',
component: resolve => require([`@/views/goodsCoupon/index.vue`], resolve),
meta: {}
},
{
//增加商品优惠券
name: 'addConpon',
path: '/goodsConpon/addConpon',
component: resolve => require([`@/views/goodsConpon/addConpon.vue`], resolve),
name: 'addCoupon',
path: '/goodsCoupon/addCoupon',
component: resolve => require([`@/views/goodsCoupon/addCoupon.vue`], resolve),
meta: {}
},
{
//商品优惠券领取详情页
name: 'receivedDetail',
path: '/goodsConpon/receivedDetail',
component: resolve => require([`@/views/goodsConpon/receivedDetail.vue`], resolve),
path: '/goodsCoupon/receivedDetail',
component: resolve => require([`@/views/goodsCoupon/receivedDetail.vue`], resolve),
meta: {}
}
])
......
<template>
<div class="container">
<glsx-combi-form :isInline="false" ref="couponRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="conponFormObj" :formData="conponFormData" :formRules="conponRule">
<glsx-combi-form :isInline="false" ref="couponRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="couponFormObj" :formData="couponFormData" :formRules="couponRule">
<div slot="selectGoods">
<el-button icon="el-icon-plus" size="small" @click="openConponDialog">选择商品</el-button>
<GLTable v-if="conponFormObj.selectedGoodsList.length" class="selected_table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="conponFormObj.selectedGoodsList">
<el-button icon="el-icon-plus" size="small" @click="openCouponDialog">选择商品</el-button>
<GLTable v-if="couponFormObj.selectedGoodsList.length" class="selected_table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="couponFormObj.selectedGoodsList">
<div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-if="scope.scope.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }}
</div>
<div class="conpon_cost" slot="conponCost" slot-scope="scope">
<div class="coupon_cost" slot="couponCost" slot-scope="scope">
<el-input :class="{ lowerZero: Number(scope.scope.newCost) <= 0 || Number(scope.scope.newCost) >= Number(scope.scope.salesPrice) }" v-model="scope.scope.newCost" @input="formatNum(scope.scope.id, scope.scope.newCost)" />
</div>
<div slot="auth-button" slot-scope="scope">
......@@ -18,10 +18,10 @@
</GLTable>
</div>
<div slot="validityDate">
<el-input class="date_input" v-model.number="conponFormObj.effectiveDays" oninput="value=value.replace(/^0/g,'').replace(/[^\d]/g,'')" type="text" />
<el-input class="date_input" v-model.number="couponFormObj.effectiveDays" oninput="value=value.replace(/^0/g,'').replace(/[^\d]/g,'')" type="text" />
</div>
</glsx-combi-form>
<gooods-dialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :selectedGoodsList="conponFormObj.selectedGoodsList" v-if="isVisible" :isVisible="isVisible"></gooods-dialog>
<gooods-dialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :selectedGoodsList="couponFormObj.selectedGoodsList" v-if="isVisible" :isVisible="isVisible"></gooods-dialog>
<div class="btn">
<el-button type="primary" @click="commit()">创建优惠券</el-button>
</div>
......@@ -31,9 +31,9 @@
<i class="el-icon-warning icon"></i>
<div class="tip">以下品牌商品优惠券面额已存在,请修改面额或删除</div>
</div>
<div class="error_conpon">
<div class="conpon_item" v-for="(item, index) in errorConponList" :key="index">
<img v-if="item.appearance == 1" src="@/assets/conpon.png" alt="" />
<div class="error_coupon">
<div class="coupon_item" v-for="(item, index) in errorCouponList" :key="index">
<img v-if="item.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
<span class="info">【{{ item.brandName }}{{ item.productName }}{{ item.appearance == 2 ? item.denomination : '' }}】{{ item.newCost }}元</span>
</div>
......@@ -54,8 +54,8 @@ export default {
return {
isVisible: false,
errorVisible: false,
errorConponList: [],
conponFormData: [
errorCouponList: [],
couponFormData: [
{
label: '选择产品',
name: 'selectedGoodsList',
......@@ -67,11 +67,11 @@ export default {
addHtml: 'validityDate'
}
],
conponFormObj: {
couponFormObj: {
selectedGoodsList: [],
effectiveDays: ''
},
conponRule: {
couponRule: {
selectedGoodsList: [{ required: true, message: '请选择商品', trigger: 'change' }],
effectiveDays: [{ required: true, message: '请输入有效期', trigger: 'change' }]
},
......@@ -105,7 +105,7 @@ export default {
},
{
label: '券面额',
addHtml: 'conponCost',
addHtml: 'couponCost',
width: 110
},
{
......@@ -154,13 +154,13 @@ export default {
.replace('$#$', '.')
temp = temp.replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') //只能输入两个小数
this.$nextTick(() => {
const target = this.conponFormObj.selectedGoodsList.find(item => item.id == id)
const target = this.couponFormObj.selectedGoodsList.find(item => item.id == id)
target.newCost = temp
})
},
delSelectedGoods(row) {
const idx = this.conponFormObj.selectedGoodsList.findIndex(item => item.id == row.id)
this.conponFormObj.selectedGoodsList.splice(idx, 1)
const idx = this.couponFormObj.selectedGoodsList.findIndex(item => item.id == row.id)
this.couponFormObj.selectedGoodsList.splice(idx, 1)
this.validateGoods()
},
validateGoods() {
......@@ -170,10 +170,10 @@ export default {
this.isVisible = false
},
confirmDialog(e) {
this.conponFormObj.selectedGoodsList = e || []
this.couponFormObj.selectedGoodsList = e || []
this.validateGoods()
},
openConponDialog() {
openCouponDialog() {
this.isVisible = true
},
closeErrorDialog() {
......@@ -182,7 +182,7 @@ export default {
commit() {
this.$refs.couponRef.$refs.formRef.validate(valid => {
if (!valid) return
let { selectedGoodsList, effectiveDays } = this.conponFormObj
let { selectedGoodsList, effectiveDays } = this.couponFormObj
const target = selectedGoodsList.find(item => Number(item.newCost) <= 0 || Number(item.newCost) >= Number(item.salesPrice))
console.log(target)
if (target) return this.$message.error('请填写大于0,小于会员价的券面额')
......@@ -194,12 +194,12 @@ export default {
effectiveDays,
equityCouponRequestList
}
this.$apis.goodsConponApi.createCoupons(params).then(res => {
this.$apis.goodsCouponApi.createCoupons(params).then(res => {
if (res && res.length === 0) {
this.$message.success('创建成功')
this.$router.push({ path: '/goodsConpon/index' })
this.$router.push({ path: '/goodsCoupon/index' })
} else if (res && res.length > 0) {
this.errorConponList = selectedGoodsList.filter(item => res.indexOf(item.id) > -1)
this.errorCouponList = selectedGoodsList.filter(item => res.indexOf(item.id) > -1)
this.errorVisible = true
}
})
......@@ -228,7 +228,7 @@ export default {
margin-top: 10px;
width: 100%;
max-width: 1100px;
.conpon_cost {
.coupon_cost {
/deep/ .el-input__inner {
width: 80px;
color: #2cca74;
......@@ -274,11 +274,11 @@ export default {
color: #333333;
}
}
.error_conpon {
.error_coupon {
margin: 20px 0 0 74px;
height: 124px;
overflow-y: auto;
.conpon_item {
.coupon_item {
margin-bottom: 8px;
img {
width: 40px;
......
......@@ -2,14 +2,14 @@
<GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="onCancel">
<div class="dialog_body">
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<div class="conpon_type">
<span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</span>
<span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
<div class="coupon_type">
<span :class="['type', { active_type: curType == '1' }]" @click="changeCouponType(1)">卡券</span>
<span :class="['type', { active_type: curType == '2' }]" @click="changeCouponType(2)">直充</span>
</div>
<div class="dialog_table">
<GLTable v-if="showTable" :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-if="scope.scope.appearance == 1" src="@/assets/coupon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
<!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} -->
{{ scope.scope.productName }}
......@@ -125,7 +125,7 @@ export default {
curType: 1,
showTable: true,
copyList: [],
conponList: [],
couponList: [],
directChargeList: [],
pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: {
......@@ -186,7 +186,7 @@ export default {
this.resetParam(type)
this.handleOk()
},
changeConponType(type) {
changeCouponType(type) {
if (this.curType == type) return
this.getBeforeChangeList(type)
this.showTable = false
......@@ -202,10 +202,10 @@ export default {
},
getBeforeChangeList(type = 1) {
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
this[type == 2 ? 'conponList' : 'directChargeList'] = [...list]
this[type == 2 ? 'couponList' : 'directChargeList'] = [...list]
},
onOk() {
let selectedList = this.curType == 2 ? this.conponList : this.directChargeList
let selectedList = this.curType == 2 ? this.couponList : this.directChargeList
let list = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName] || []
list = [...selectedList, ...list]
for (let i = 0; i < this.selectedGoodsList.length; i++) {
......@@ -225,7 +225,7 @@ export default {
this.$emit('closeDialog')
},
setTableFinishFun() {
this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'conponList' : 'directChargeList']]
this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'couponList' : 'directChargeList']]
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
......@@ -270,7 +270,7 @@ export default {
width: 312px;
}
}
.conpon_type {
.coupon_type {
width: 100%;
display: inline-block;
border-bottom: 1px solid #eee;
......
......@@ -4,14 +4,14 @@
<div class="operate_wrap">
<span class="table_title">商品优惠券列表</span>
<div class="operate_btn">
<GLButton fn="新增商品优惠券" plain size="small" @click="addConpon">创建优惠券</GLButton>
<GLButton fn="新增商品优惠券" plain size="small" @click="addCoupon">创建优惠券</GLButton>
<el-button class="export_btn" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodsName" slot-scope="scope">
<img class="conpon_type" v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img class="conpon_type" v-else src="@/assets/directCharge.png" alt="" />
<img class="coupon_type" v-if="scope.scope.appearance == 1" src="@/assets/coupon.png" alt="" />
<img class="coupon_type" v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.goodsName + (scope.scope.rechargeDenomination || '') : scope.scope.goodsName }}
</div>
<div class="good_status" slot="goodStatus" slot-scope="scope">
......@@ -32,7 +32,7 @@ export default {
name: 'index',
data() {
return {
getListApi: this.$apis.goodsConponApi.getCouponsList,
getListApi: this.$apis.goodsCouponApi.getCouponsList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: {
brandName: '',
......@@ -235,7 +235,7 @@ export default {
const params = {
couponId: row.id
}
this.secondConfirm('删除', '确定删除此优惠券?', 'goodsConponApi', 'deleteCouponApi', params)
this.secondConfirm('删除', '确定删除此优惠券?', 'goodsCouponApi', 'deleteCouponApi', params)
},
takeEffect(row, key) {
......@@ -244,7 +244,7 @@ export default {
status: key
}
const title = key == 2 ? '生效' : '失效'
this.secondConfirm(title, `确定要${title}该优惠券?`, 'goodsConponApi', 'effectiveCouponApi', params)
this.secondConfirm(title, `确定要${title}该优惠券?`, 'goodsCouponApi', 'effectiveCouponApi', params)
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
......@@ -281,7 +281,7 @@ export default {
// 导出
handleExport() {
var params = { ...this.searchForm }
this.$apis.goodsConponApi.getExportApi(params).then(res => {
this.$apis.goodsCouponApi.getExportApi(params).then(res => {
let tempaa = this.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
......@@ -294,11 +294,11 @@ export default {
})
},
goDetailPage(row) {
this.$router.push({ path: '/goodsConpon/receivedDetail', query: { id: row.scope.id } })
this.$router.push({ path: '/goodsCoupon/receivedDetail', query: { id: row.scope.id } })
},
changeStatus() {},
addConpon() {
this.$router.push('/goodsConpon/addConpon')
addCoupon() {
this.$router.push('/goodsCoupon/addCoupon')
}
}
}
......@@ -308,7 +308,7 @@ export default {
background-color: #fff;
padding: 20px;
.good_name {
.conpon_type {
.coupon_type {
width: 40px;
height: 20px;
vertical-align: text-bottom;
......
<template>
<div class="container">
<div class="info_ctnr">
<glsx-combi-form :isInline="true" ref="couponInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="conponInfoFormObj" :formData="conponInfoFormData" :formRules="conponInfoRule">
<glsx-combi-form :isInline="true" ref="couponInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="couponInfoFormObj" :formData="couponInfoFormData" :formRules="couponInfoRule">
<div slot="goodsName" class="txt">
{{ conponInfoFormObj.appearance == 2 ? conponInfoFormObj.goodsName + (conponInfoFormObj.goodsName || '') : conponInfoFormObj.goodsName }}
{{ couponInfoFormObj.appearance == 2 ? couponInfoFormObj.goodsName + (couponInfoFormObj.goodsName || '') : couponInfoFormObj.goodsName }}
</div>
<div slot="appearance" class="txt">
{{ conponInfoFormObj.appearance == 1 ? '卡券' : '直充' }}
{{ couponInfoFormObj.appearance == 1 ? '卡券' : '直充' }}
</div>
</glsx-combi-form>
</div>
......@@ -81,7 +81,7 @@ export default {
cancelRules: {
cancelReason: [{ required: true, message: '请输入作废原因', trigger: 'change' }]
},
conponInfoFormObj: {
couponInfoFormObj: {
brandName: '',
goodsName: '',
appearance: '',
......@@ -108,7 +108,7 @@ export default {
}
}
],
conponInfoFormData: [
couponInfoFormData: [
{
label: '品牌',
name: 'brandName',
......@@ -145,8 +145,8 @@ export default {
type: 'showTxt'
}
],
conponInfoRule: {},
getListApi: this.$apis.goodsConponApi.getListReceiveRecordApi,
couponInfoRule: {},
getListApi: this.$apis.goodsCouponApi.getListReceiveRecordApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'list',
......@@ -253,25 +253,25 @@ export default {
getInfo(couponId) {
var params = {}
params.couponId = couponId
this.$apis.goodsConponApi.getCouponDetailApi(params).then(res => {
this.conponInfoFormObj = res
this.$apis.goodsCouponApi.getCouponDetailApi(params).then(res => {
this.couponInfoFormObj = res
//有效期
if (res.effectiveType == 1) {
this.conponInfoFormObj.effectiveTxt = res.effectiveDays + '天'
this.couponInfoFormObj.effectiveTxt = res.effectiveDays + '天'
} else if (res.effectiveType == 2) {
//时间段
this.conponInfoFormObj.effectiveTxt = res.effectiveStartTime + ' - ' + res.effectiveEndTime
this.couponInfoFormObj.effectiveTxt = res.effectiveStartTime + ' - ' + res.effectiveEndTime
} else if (res.effectiveType == 3) {
//永久有效
this.conponInfoFormObj.effectiveTxt = '永久有效'
this.couponInfoFormObj.effectiveTxt = '永久有效'
}
})
},
// 导出
handleExport() {
let params = this.getParams()
this.$apis.goodsConponApi.detailExportApi(params).then(res => {
this.$apis.goodsCouponApi.detailExportApi(params).then(res => {
let tempaa = this.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
......@@ -304,7 +304,7 @@ export default {
handleCancelConfirm() {
this.$refs.cancelRef.validate(valid => {
if (valid) {
this.$apis.goodsConponApi.couponUserCancelApi(this.cancelForm).then(res => {
this.$apis.goodsCouponApi.couponUserCancelApi(this.cancelForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!