Commit cae1d58a by chenwq

Merge branch 'v2.1.0' into chenwq_dev_v2.1.0

2 parents d8e5fa34 e7d1c829
......@@ -18,9 +18,9 @@ module.exports = {
code_message_map: {}
},
request: {
baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
// baseURL: 'http://scrm.dev.glsx.com.cn/',
baseURL: 'http://scrm.dev.glsx.com.cn/',
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -11,7 +11,7 @@
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
......
......@@ -5,18 +5,21 @@
<div class="right_show">
<div class="card-top"></div>
<div class="card_one">
<div>
<span class="cname">{{ editForm.couponName }}</span>
<span class="ctype">
<span class="ctypeName">代金券</span>
</span>
<div class="flex">
<div class="cname">{{ editForm.couponName }}</div>
<img src="../../images/cash.png" class="couponImg" />
</div>
<div class="ctime">
<span class="ctime_name">有效期:</span>
<span class="ctime_content" v-if="editForm.effectiveType == 3">无限制</span>
<span class="ctime_content" v-if="editForm.effectiveType == 1">{{ editForm.effectiveDays }}天</span>
<span class="ctime_content" v-if="editForm.effectiveType == 2">{{ couponTime }}</span>
<!-- <div class="ctype">
<div class="ctypeName"></div>
</div> -->
<div class="validityPeriod">
<!-- <span class="ctime_name">有效期:</span> -->
<span v-if="editForm.effectiveType == 3">永久有效</span>
<span v-if="editForm.effectiveType == 1">领取后{{ editForm.effectiveDays }}天内有效</span>
<span v-if="editForm.effectiveType == 2">{{ couponTime }}</span>
</div>
<div style="height: 1px;background-color: rgb(238, 238, 238);margin: 0 16px;"></div>
<div></div>
<div class="ctime">
<span class="ctime_name">使用限制:</span>
<span class="ctime_content">{{ editForm.useBarriers == 1 ? '无限制' : '满' + editForm.full + '可用' }}</span>
......@@ -100,6 +103,7 @@
</GLTable>
</div>
<template slot="useDescriptionHtml">
<!-- <fileBox @change="writeChange" ref="fileBox"></fileBox> -->
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
<template slot="editHtml">
......@@ -118,8 +122,12 @@
<script>
import { limitPrice } from '@/common/constant'
import fileBox from './fileBox.vue'
export default {
name: 'editCashCoupon',
components: {
// fileBox
},
data() {
return {
defaultTime: ['00:00:00', '23:59:59'], // 选择日期后的默认时间
......@@ -304,7 +312,6 @@ export default {
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.getAllGoods()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
if (id) {
......@@ -431,6 +438,12 @@ export default {
},
methods: {
// 获取富文本框内容
// writeChange(val) {
// let reg = /(?<=(<p[^>]*?>)).*?(?=(<\/p>))/g
// this.editForm.useDescription = val.match(reg)
// console.log('this.editForm.useDescription', this.editForm.useDescription)
// },
haveChange() {
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime()
......@@ -476,6 +489,7 @@ export default {
} else {
this.priceFlag = true
}
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
})
},
......@@ -749,15 +763,16 @@ export default {
}
.cname {
width: 170px;
height: 17px;
font-family: PingFangSC-Regular;
font-size: 12px;
color: #666666;
font-weight: 400;
margin-left: 8px;
margin-top: 10px;
margin: 16px 0 10px 16px;
display: inline-block;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #fc5b32;
max-width: 164px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ctype {
......@@ -873,4 +888,18 @@ export default {
color: #999;
margin-left: -10px;
}
.couponImg {
width: 69px;
height: 69px;
position: absolute;
right: 20px;
top: 114px;
}
.validityPeriod {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #a0a0a0;
margin: 0 0 16px 16px;
}
</style>
<!-- 编辑折扣券 -->
<template>
<div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="height: 630px; position: relative">
<div class="container edit-container" style="position: relative">
<!-- <div class="right_show">
<div class="card-top"></div>
<div class="card-middle">
......@@ -77,6 +77,16 @@
</el-radio>
</el-form-item>
</template>
<template slot="useLimitHtml">
<el-radio v-model="editForm.useBarriers" label="1" :disabled="apear != 'couponAdd'">无门槛</el-radio>
<el-form-item prop="full" ref="full">
<el-radio v-model="editForm.useBarriers" label="2" :disabled="apear != 'couponAdd'">
满
<el-input v-model="editForm.full" @blur="loseFocus" style="width: 100px; margin-left: 5px; margin-right: 5px" :disabled="apear != 'couponAdd' || editForm.useBarriers != 2" />
元可用
</el-radio>
</el-form-item>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 320px" :autosize="{ minRows: 2, maxRows: 4 }" maxlength="200" :disabled="userDisable" />
</template>
......@@ -141,9 +151,12 @@ export default {
editForm: {
couponName: '',
effectiveType: '2',
useBarriers: '1',
full: '',
effectiveTime: [],
effectiveDays: '',
anticipatedCost: '',
discountIntensity: '',
directionalFlag: '1'
},
editRule: {
......@@ -171,6 +184,18 @@ export default {
isDisabled: false
},
{
label: '优惠内容',
name: 'discountIntensity',
width: '180px',
type: 'input',
append: '折'
},
{
label: '使用限制',
name: 'useBarriers',
addHtml: 'useLimitHtml'
},
{
label: '发放数量',
name: 'stock',
width: '180px',
......@@ -226,9 +251,11 @@ export default {
const couponNameIndex = this.editFormData.findIndex(val => val.name == 'couponName')
const anticipatedCostIndex = this.editFormData.findIndex(val => val.name == 'anticipatedCost')
const stockIndex = this.editFormData.findIndex(val => val.name == 'stock')
const discountIndex = this.editFormData.findIndex(val => val.name == 'discountIntensity')
this.editFormData[couponNameIndex].isDisabled = this.isDisabled
this.editFormData[anticipatedCostIndex].isDisabled = this.isDisabled
this.editFormData[stockIndex].isDisabled = this.isDisabled
this.editFormData[discountIndex].isDisabled = this.isDisabled
this.userDisable = true
} else {
this.apear = 'couponAdd'
......@@ -252,6 +279,19 @@ export default {
},
'editForm.stock'(newValue, oldValue) {
this.editForm.stock = limitPrice(newValue, oldValue, 6, 0, 1)
if (newValue) {
if (this.editForm.discountIntensity == 0) {
this.editForm.discountIntensity = ''
}
}
},
'editForm.discountIntensity'(newValue, oldValue) {
this.editForm.discountIntensity = limitPrice(newValue, oldValue, 1, 2, 0, 9.99)
},
'editForm.useBarriers'(newValue, oldValue) {
if (newValue != 2) {
this.$refs['full'].resetField()
}
},
'editForm.effectiveTime'(newValue, oldValue) {
if (newValue && newValue.length == 2) {
......@@ -269,8 +309,15 @@ export default {
}
}
},
methods: {
loseFocus() {
if (this.editForm.useLimitPrice <= 0) {
this.editForm.useLimitPrice = ''
}
if (this.editForm.discountIntensity == 0) {
this.editForm.discountIntensity = ''
}
},
haveChange() {
let oDateOne = new Date(this.editForm.effectiveTime[0]).getTime()
let timeStamp = new Date().getTime()
......@@ -290,10 +337,17 @@ export default {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
console.log(res)
this.editForm = this.$common.utils.deepClone(res)
this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
this.editForm.discountIntensity = (this.editForm.discountIntensity / 100).toFixed(2)
//使用限制,满多少元可用
if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full
}
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
......@@ -319,6 +373,9 @@ export default {
} else {
this.editRule.effectiveDays[0].required = false
}
if (this.editForm.discountIntensity == 0) {
this.editForm.discountIntensity = ''
}
},
getCouponInfoParams() {
......@@ -348,9 +405,15 @@ export default {
obj.effectiveEndTime = d[1]
}
}
//使用限制
obj.useBarriers = form.useBarriers
if (form.useBarriers == 2) {
obj.full = form.full
}
//库存
obj.stock = form.stock
//折扣
obj.discountIntensity = form.discountIntensity * 100
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
......
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E('#div-demo')
// 配置菜单栏,删减菜单,调整顺序
this.editor.config.menus = []
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.width = 500
this.editor.config.uploadVideoServer = '/api/upload-video'
this.editor.config.excludeMenus = ['code', 'video']
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
height: 70px !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
.w-e-text {
width: 220px !important;
}
</style>
......@@ -59,7 +59,7 @@ export default {
previewList(val) {
if (val.length && val[0].attType == 1) {
const attContent = val[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
......@@ -125,7 +125,7 @@ export default {
color: #333;
background-color: #fff;
border-radius: 4px;
word-wrap: break-word;
word-break: break-all;
display: flex;
img {
width: 20px;
......@@ -133,6 +133,7 @@ export default {
}
}
.text {
display: inline-block;
font-size: 16px;
padding: 8px 11px;
}
......
......@@ -11,8 +11,8 @@
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click.self="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
{{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked">
......
......@@ -27,11 +27,15 @@ export default {
giftList,
receivedGiftList
},
created() {
this.activeName = sessionStorage.getItem('GIFTNAME') ? sessionStorage.getItem('GIFTNAME') : 'giftList'
},
mounted() {},
methods: {
handleTabClick() {}
handleTabClick() {
sessionStorage.setItem('GIFTNAME', this.activeName)
}
}
}
</script>
......
......@@ -69,8 +69,8 @@
<div slot="content">{{ subItem.couponName }}</div>
</el-tooltip>
<div class="gift-sum">
<el-input-number v-if="subItem.discountType == 7" :disabled="subItem.status == '3'" class="sum-input" v-model="subItem.couponAmount" @change="handleChange" :min="1" :max="999999" size="mini" label="描述文字"></el-input-number>
<p :class="[subItem.status == '3' ? ' txt-grey' : '']" v-else>×{{ subItem.couponAmount }}</p>
<el-input-number :disabled="subItem.status == '3'" class="sum-input" v-model="subItem.couponAmount" @change="handleChange" :min="1" :max="999999" size="mini" label="描述文字"></el-input-number>
<!-- <p :class="[subItem.status == '3' ? ' txt-grey' : '']" v-else>×{{ subItem.couponAmount }}</p> -->
</div>
</div>
</div>
......
......@@ -21,8 +21,8 @@
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="关联订单号">
<el-input :size="size" v-model="searchForm.orderCode" placeholder="请输入关联订单号" clearable></el-input>
<el-form-item size="small" label="关联信息">
<el-input :size="size" v-model="searchForm.orderCode" placeholder="请输入关联信息" clearable></el-input>
</el-form-item>
<el-form-item size="small" label="核销日期">
<!-- verificationTimeStart verificationTimeEnd -->
......@@ -40,6 +40,10 @@
</el-form>
</div>
<GLTable ref="memberRecordRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="orderCodeHtml" slot-scope="scope">
<span class="cursor-pointer" @click="couponNameHandleDetail(scope.scope)" v-if="scope.scope.directionalGiftId">{{ scope.scope.directionalGiftName }}</span>
<span class="cursor-pointer" @click="orderCodeHandleDetail(scope.scope)" v-else>{{ scope.scope.orderCode }}</span>
</span>
<span slot="verificationTime" slot-scope="scope">
<span>{{ dateFormatFun(scope.scope.verificationTime) }}</span>
</span>
......@@ -125,15 +129,15 @@ export default {
},
{
label: '核销用户',
prop: 'userName'
prop: 'phone'
},
{
label: '核销员',
prop: 'verificationOperator'
},
{
label: '关联订单号',
prop: 'orderCode'
label: '关联信息',
addHtml: 'orderCodeHtml'
},
{
label: '核销日期',
......@@ -153,6 +157,26 @@ export default {
}
},
methods: {
// 跳转到礼包领取详情页
couponNameHandleDetail(row) {
console.log('row', row)
this.$router.push({
path: '/giftBag/giftDetail',
query: {
id: row.directionalGiftId
}
})
},
// 跳转到订单详情页
orderCodeHandleDetail(row) {
this.$router.push({
path: '/memberCenter/orderDetail',
query: {
id: row.id,
detail: row
}
})
},
dateFormatFun(date) {
return dateFormat(date)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!