Commit f26f3c55 by zhangquan

Merge branch 'v3.22.2' of http://192.168.3.233:8090/saas/scrm-micro-points into v3.22.2

2 parents f0711692 89ef5ac1
...@@ -8858,6 +8858,11 @@ ...@@ -8858,6 +8858,11 @@
"integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
"dev": true "dev": true
}, },
"number-precision": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/number-precision/-/number-precision-1.6.0.tgz",
"integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"oauth-sign": { "oauth-sign": {
"version": "0.9.0", "version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^2.0.9", "glsx-common": "^2.0.9",
"glsx-components": "^1.5.7", "glsx-components": "^1.5.7",
"number-precision": "^1.6.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
......
...@@ -113,4 +113,132 @@ const getIntegralDetailExport = params => { ...@@ -113,4 +113,132 @@ const getIntegralDetailExport = params => {
sign: true sign: true
}) })
} }
export default { getList, getOrderDetail, orderExport, orderImport, integralorderSettle, getIntegralCustomerList, getIntegralCustomerExport, getIntegralDetailList, customerDetail, getIntegralDetailExport }
/**自店服务 */
const getghDirectionalGiftListApi = params => {
params.method = 'scrm.api.coupon.gh.group.equity.coupon.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
/**
* 客户积分导入
*/
const importCustomerIntegral = params => {
params.method = 'scrm.api.shopmall.integral.import.excel.analysis'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true
})
}
/**
* 客户积分充值
*/
const updateCustomerIntegral = params => {
params.method = 'scrm.api.shopmall.integral.import.save.or.update'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**
* 获取油劵列表
*/
const getOilCouponList = params => {
params.method = 'scrm.api.shopmall.goods.oil.coupon.list'
params.status = 1
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
/**
* 查询门店的通道手续费和油卡费率设置
*/
const getMerchantCharge = params => {
params.method = 'scrm.api.shopmall.integral.import.charge.config.query'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**
* 客户积分导入记录分页查询
*/
const getIntegralList = params => {
params.method = 'scrm.api.shopmall.integral.import.record.page'
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
/**
* 客户积分导入数据详情
*/
const getIntegralDetail = params => {
params.method = 'scrm.api.shopmall.integral.import.record.detail'
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
/**
* 客户积分导入明细数据分页查询
*/
const getCustomerIntegralList = params => {
params.method = 'scrm.api.shopmall.integral.import.detail.page'
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
/**
* 客户积分导入记录导出
*/
const exportIntegralList = params => {
params.method = 'scrm.api.shopmall.integral.import.record.export'
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
/**
* 客户积分审核
*/
const auditIntegral = params => {
params.method = 'scrm.api.shopmall.integral.import.audit'
return http({
url: 'rop-scrm-shopmall/router',
data: params
})
}
export default {
getList, getOrderDetail, orderExport, orderImport, integralorderSettle, getIntegralCustomerList, getIntegralCustomerExport, getIntegralDetailList, customerDetail, getIntegralDetailExport,
getghDirectionalGiftListApi,
importCustomerIntegral,
updateCustomerIntegral,
getOilCouponList,
getMerchantCharge,
getIntegralList,
exportIntegralList,
getIntegralDetail,
getCustomerIntegralList,
auditIntegral
}
...@@ -74,3 +74,7 @@ p{ ...@@ -74,3 +74,7 @@ p{
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.el-message{
z-index: 9999999 !important;
}
\ No newline at end of file \ No newline at end of file
function debounce(func, wait = 200) { function debounce (func, wait = 200) {
let timeout let timeout
return function(event) { return function (event) {
clearTimeout(timeout) clearTimeout(timeout)
timeout = setTimeout(() => { timeout = setTimeout(() => {
func.call(this, event) func.call(this, event)
...@@ -8,7 +8,7 @@ function debounce(func, wait = 200) { ...@@ -8,7 +8,7 @@ function debounce(func, wait = 200) {
} }
} }
function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') { function dateFormat (dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime) const date = new Date(dateTime)
const config = { const config = {
YYYY: date.getFullYear(), YYYY: date.getFullYear(),
...@@ -26,7 +26,7 @@ function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') { ...@@ -26,7 +26,7 @@ function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
function checkPhone(mobile) { function checkPhone (mobile) {
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/ const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile) return myreg.test(mobile)
} }
...@@ -37,7 +37,7 @@ function checkPhone(mobile) { ...@@ -37,7 +37,7 @@ function checkPhone(mobile) {
* hasAll Boolean 是否需要添加“全部”属性 * hasAll Boolean 是否需要添加“全部”属性
* refreshSigle String 更新特定的属性的options * refreshSigle String 更新特定的属性的options
*/ */
function getOptionsList(that, formName, hasAll = true, refreshSigle) { function getOptionsList (that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = that[formName].find(k => k.name == refreshSigle) var item = that[formName].find(k => k.name == refreshSigle)
var index = that[formName].findIndex(k => k.name == refreshSigle) var index = that[formName].findIndex(k => k.name == refreshSigle)
...@@ -64,7 +64,7 @@ function getOptionsList(that, formName, hasAll = true, refreshSigle) { ...@@ -64,7 +64,7 @@ function getOptionsList(that, formName, hasAll = true, refreshSigle) {
} }
/** 二次确认封装 */ /** 二次确认封装 */
function secondConfirm(that, title, txt, apiModule, apiName, apiParams, type = 'warning', fn) { function secondConfirm (that, title, txt, apiModule, apiName, apiParams, type = 'warning', fn) {
that.$confirm(txt, title, { that.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -86,7 +86,7 @@ function secondConfirm(that, title, txt, apiModule, apiName, apiParams, type = ' ...@@ -86,7 +86,7 @@ function secondConfirm(that, title, txt, apiModule, apiName, apiParams, type = '
}) })
} }
function aToExport(url) { function aToExport (url) {
var a = document.createElement('a') var a = document.createElement('a')
a.setAttribute('id', 'exportToExport') a.setAttribute('id', 'exportToExport')
a.setAttribute('href', url) a.setAttribute('href', url)
...@@ -100,6 +100,14 @@ function aToExport(url) { ...@@ -100,6 +100,14 @@ function aToExport(url) {
return arr1.includes(item) return arr1.includes(item)
}) })
} }
function openTab (url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
export default { export default {
debounce, debounce,
dateFormat, dateFormat,
...@@ -107,5 +115,6 @@ export default { ...@@ -107,5 +115,6 @@ export default {
getOptionsList, getOptionsList,
secondConfirm, secondConfirm,
aToExport, aToExport,
openTab,
getArrayIsSubset getArrayIsSubset
} }
<template>
<div v-if="auditObj.show">
<GLDialog
mode="small"
title="批次审核"
:visible.sync="auditObj.show"
:before-close="handleClose"
>
<template #default>
<div class="audit-content flex">
<div class="title">请和财务确认是否已收到以下门店积分打款</div>
<div class="info flex">{{auditObj.row.merchantName}}:
<div class="price flex">
{{auditObj.row.totalIntegral}}<div class="unit">元</div>
</div>
</div>
<el-checkbox
v-model="checked"
class="check-box"
>
已确认收款
</el-checkbox>
<div class="tips">审核通过后客户积分将实时发放,无法撤销。</div>
</div>
</template>
<template #footer>
<el-button
size="small"
@click="handleClose"
>否,未收到款项,关闭弹窗</el-button>
<el-button
type="primary"
size="small"
@click="handleConfirm"
>是,已确认收到款项,赠送积分</el-button>
</template>
</GLDialog>
</div>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
props: {
auditObj: {
type: Object,
default: () => { }
}
},
data () {
return {
loading: false,
checked: false
}
},
mounted () {
},
methods: {
handleClose () {
this.$emit('update:auditObj', {})
},
async handleConfirm () {
const { checked } = this,
{ id } = this.auditObj.row
if (checked) {
this.$loading()
try {
const res = await this.$apis.points.auditIntegral({ id })
if (res) {
this.$loading().close()
this.handleClose()
this.$message.success('操作成功')
this.$parent.handleSearch()
}
} catch (error) {
this.$loading().close()
if (error) this.$message.error(error)
}
} else this.$message.error('请先勾选确认收款')
}
}
}
</script>
<style scoped lang='scss'>
.audit-content {
flex-direction: column;
justify-content: center;
align-items: center;
.title {
font-size: 16px;
color: #333333;
}
.check-box {
font-size: 14px;
color: #333333;
}
.info {
align-items: center;
font-size: 16px;
color: #333333;
margin: 16px 0 10px;
.price {
align-items: center;
font-weight: 600;
font-size: 26px;
color: #eb4e4e;
.unit {
font-weight: 400;
font-size: 16px;
}
}
}
.tips {
font-size: 14px;
color: #999999;
margin-top: 10px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div v-if="detailObj.show">
<GLDialog
mode="big"
bigTitle="查看"
:visible.sync="detailObj.show"
:hasFooter="false"
:before-close="handleClose"
>
<GLTable
v-loading="loading"
ref="serviceRef"
:getListApi="getListApi"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<template
slot="oilList"
slot-scope="scope"
>
<template v-if="scope.scope.oilList && scope.scope.oilList.length">
<div class="flex">
<div class="list">
<template v-for="(i,index) in scope.scope.oilList">
<template>
<div
:key="index"
class="item flex"
>
{{i.aliasName}}*{{i.amount}} ({{NP.times(i.amount, i.faceValue)}}积分)
</div>
</template>
</template>
</div>
</div>
</template>
<template v-else>
无
</template>
</template>
<template
slot="couponList"
slot-scope="scope"
>
<template v-if="scope.scope.couponList && scope.scope.couponList.length">
<div class="flex">
<div class="list">
<template v-for="(i,index) in scope.scope.couponList">
<template>
<div
:key="index"
class="item flex"
>
{{i.couponName}}*{{i.amount}}
</div>
</template>
</template>
</div>
</div>
</template>
<template v-else>
无
</template>
</template>
</GLTable>
</GLDialog>
</div>
</template>
<script type='text/ecmascript-6'>
import NP from 'number-precision'
export default {
name: '',
props: {
detailObj: {
type: Object,
default: () => { }
}
},
data () {
return {
NP,
loading: false,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
getListApi: this.$apis.points.getCustomerIntegralList,
searchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
{
label: '保单号',
prop: 'policyNo',
minWidth: 100
},
{
label: '用户姓名',
prop: 'customerName',
minWidth: 100
},
{
label: '身份证号',
minWidth: 100,
prop: 'idCardNo',
},
{
label: '用户手机号',
minWidth: 150,
prop: 'customerPhone',
},
{
label: '返现金额',
minWidth: 150,
prop: 'cashBackValue'
},
{
label: '商品兑换积分',
prop: 'buyValue',
minWidth: 150,
},
{
label: '赠送油券',
minWidth: 150,
addHtml: 'oilList'
},
{
label: '赠送自店服务',
minWidth: 150,
addHtml: 'couponList'
},
{
label: '充值积分小计',
minWidth: 150,
formatter: cell => {
const { oilList, cashBackValue, buyValue } = cell
let total = NP.plus((cashBackValue || 0), (buyValue || 0))
oilList && oilList.map(i => total += NP.times(i.amount, i.faceValue))
return total
}
},
]
},
}
},
mounted () {
},
methods: {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.batchNo = this.detailObj.batchNo
this.loading = false
resolve()
})
},
handleClose () {
this.$emit('update:detailObj', {})
}
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<GLTable
v-loading="loading"
ref="serviceRef"
:tableData="serviceList"
:tableParams="tableParams"
@refreshTable="getServiceList"
@select="handleSelectionServiceTable(...arguments, 'oilCouponId')"
@select-all="handleSelectionServiceTableAll(...arguments, 'oilCouponId')"
>
<template
slot="gasImageSlot"
slot-scope="scope"
>
<el-popover
placement="top"
trigger="hover"
>
<img
class="img-plus"
:src="scope.scope.aliasUrl"
/>
<template slot="reference">
<img
:src="scope.scope.aliasUrl"
class="img"
>
</template>
</el-popover>
</template>
<template
slot="amount"
slot-scope="scope"
>
<el-input-number
size="small"
:min="1"
:max="10"
:step="1"
v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'oilCouponId')"
></el-input-number>
</template>
</GLTable>
</template>
<script type='text/ecmascript-6'>
import selectedMixin from '../mixins/selectedMixin'
export default {
name: 'gas',
mixins: [selectedMixin],
props: {
selectedGasList: {
type: Array,
default: () => []
}
},
data () {
return {
loading: false,
serviceList: [],
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'packageCode',
checkSelectKey: 'id',
checkSelectVal: '',
checkSelectable: null,
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '商品图片',
addHtml: 'gasImageSlot',
width: 100
},
{
label: '名称',
prop: 'aliasName',
},
{
label: '油卡面额/元',
prop: 'faceValue',
},
{
label: '售价/元',
formatter: cellValue => {
return cellValue.salesPrice ? Number(cellValue.salesPrice / 100).toFixed(2) : '--'
}
},
{
label: '选择数量',
addHtml: 'amount'
}
]
},
selectedList: [],
}
},
mounted () {
this.selectedList = this.selectedGasList
this.getServiceList()
},
methods: {
getServiceList () {
const { page: { pageNum, pageSize } } = this.$refs.serviceRef,
params = {
pageNum,
pageSize
}
this.loading = true
this.$apis.points.getOilCouponList(params).then(res => {
this.loading = false
res.list.map(e => {
e.amount = 1
e.oilCouponId = e.id
})
// 重置分页组件
this.serviceList = res.list
this.$refs.serviceRef.tableTotal = res.total
this.selectedPreExisting(this.selectedList, this.serviceList, 'oilCouponId', this.$refs.serviceRef)
this.setAmount(this.selectedList, this.serviceList, 'oilCouponId')
}).finally(() => {
this.loading = false
})
},
}
}
</script>
<style scoped lang='scss'>
.img {
width: 36px;
height: 36px;
// img{
// width: 100%;
// height: 100%;
// }
}
.img-plus {
width: 200px;
height: 200px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<GLDialog
mode="small"
title="操作结果"
:visible.sync="importObj.show"
:before-close="handleClose"
>
<template #default>
<div class="importObj-content flex">
<div class="success item">
<div class="num">{{importObj.successCount}}</div>
有效数据
</div>
<div class="line"></div>
<div class="error item">
<div class="num">{{importObj.errorCount}}</div>
异常数据
</div>
</div>
</template>
<template #footer>
<el-button
size="small"
@click="handleClose"
>确定</el-button>
<el-button
type="primary"
size="small"
@click="handleConfirm"
>导出错误结果</el-button>
</template>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
props: {
importObj: {
type: Object,
default: () => { }
}
},
data () {
return {
loading: false,
checked: false
}
},
mounted () {
},
methods: {
handleClose () {
this.$emit('update:importObj', {})
},
handleConfirm () {
this.$utils.aToExport(this.importObj.errorUrl)
this.handleClose()
}
}
}
</script>
<style scoped lang='scss'>
.importObj-content {
height: 100%;
align-items: center;
.item {
flex: 1;
text-align: center;
.num {
font-weight: 700;
font-size: 26px;
line-height: 32px;
margin-bottom: 10px;
}
}
.error{
.num{
color: #EB4E4E;
}
}
.success{
.num{
color: #2CCA74;
}
}
.line {
width: 1px;
height: 56px;
background: #e8e8ea;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<GLDialog
mode="big"
class="points-panel"
bigTitle="选择"
okText="提交"
:before-close="handleGiftClose"
@onCancel="handleGiftClose"
@onOk="handleConfirm"
:visible.sync="configParams.show"
>
<GLTabs
v-model="currentComponent"
:tabPaneList="tabPaneList"
></GLTabs>
<template v-if="configParams.show">
<div class="component">
<gas
v-show="currentComponent == 'gas'"
ref="gasRef"
:merchantId="merchantId"
:selectedGasList="configParams.row.oilList || []"
/>
<service
v-show="currentComponent == 'service'"
ref="serviceRef"
:merchantId="merchantId"
:selectedServiceList="configParams.row.couponList || []"
/>
</div>
</template>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import service from './service.vue'
import gas from './gas.vue'
export default {
name: '',
components: {
service,
gas
},
props: {
configParams: {
type: Object,
default: () => { }
},
merchantId: [Number, String]
},
data () {
return {
giftVisible: true,
currentComponent: 'gas',
tabPaneList: [
{
label: '油卡',
name: 'gas'
},
{
label: '自店服务',
name: 'service'
}
]
}
},
watch: {
'configParams.show' (n) {
if (n) this.currentComponent = this.configParams.type == 1 ? 'service' : 'gas'
}
},
mounted () {
},
methods: {
handleGiftClose () {
this.$emit('update:configParams', {})
},
handleConfirm () {
const { gasRef, serviceRef } = this.$refs,
oilList = gasRef.selectedList?.map(e => {
return {
oilCouponId: e.oilCouponId,
amount: e.amount,
faceValue: e.faceValue,
aliasName: e.aliasName
}
}) || [],
couponList = serviceRef.selectedList?.map(e => {
return {
couponId: e.couponId,
amount: e.amount,
couponName: e.couponName
}
}) || []
this.$emit('confirm', {
oilList,
couponList
})
}
}
}
</script>
<style scoped lang='scss'>
.points-panel {
/deep/.el-dialog__wrapper {
.el-dialog__body {
padding-top: 0;
}
}
}
.component {
padding-top: 20px;
}
</style>
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
</glsx-combi-form> </glsx-combi-form>
<GLTable <GLTable
ref="storeRef" ref="storeRef"
:noDataImg="url"
:tableTotal="total" :tableTotal="total"
:searchForm="searchForm" :searchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
...@@ -54,19 +53,16 @@ ...@@ -54,19 +53,16 @@
</GLDialog> </GLDialog>
</template> </template>
<script> <script>
import url from '@/assets/empty.png'
export default { export default {
name: 'selectStore', name: 'selectStore',
data () { data () {
return { return {
url: url,
searchForm: { searchForm: {
merchantId: '', merchantId: '',
merchantName: '' merchantName: ''
}, },
total: 0, total: 0,
storeList: [], storeList: [],
heightBox: 200,
merchantId: '', merchantId: '',
merchantName: '', merchantName: '',
// 搜索 // 搜索
...@@ -163,8 +159,6 @@ export default { ...@@ -163,8 +159,6 @@ export default {
}, },
methods: { methods: {
init () { init () {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.merchantId = this.merchantInfo this.merchantId = this.merchantInfo
this.getList() this.getList()
}, },
......
<template>
<div class="service-box">
<div class="service-flex">
<div class="service-tab">
<template v-for="(item) in serviceTabList">
<template>
<div
:class="['tab-item',{ active: discountType == item.type }]"
:key="item.type"
@click="discountType = item.type"
>
{{ item.label }}
</div>
</template>
</template>
<div
class="tab-border"
:style="setLeft"
></div>
</div>
<!-- <div class="service-tip">(仅支持引用无限库存券)</div> -->
<div class="tab-right">
<div
class="refresh-btn"
@click="getServiceList"
>
<i class="el-icon-refresh-right"></i>
刷新列表
</div>
<div
class="add-btn"
@click="addCoupon"
>
<i class="el-icon-plus"></i>
新建
</div>
</div>
</div>
<template v-for="(item, index) in serviceTabList">
<template>
<div :key="index">
<GLTable
v-loading="loading"
v-show="discountType == item.type"
:ref="'serviceRef' + item.type"
:tableData="serviceList"
:tableParams="tableParams"
@refreshTable="getServiceList"
@select="handleSelectionServiceTable(...arguments, 'couponId')"
@select-all="handleSelectionServiceTableAll(...arguments, 'couponId')"
>
<template
slot="effectiveType"
slot-scope="scope"
>
<span>{{ toLabelText(scope.scope) }}</span>
</template>
<template
slot="stock"
slot-scope="scope"
>
<span>{{ scope.scope.limitStockFlag == 1 ? scope.scope.stock : '无限制' }}</span>
</template>
<template
slot="useType"
slot-scope="scope"
>
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</template>
<template
slot="amount"
slot-scope="scope"
>
<el-input-number
size="small"
:min="1"
:max="10"
:step="1"
v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'couponId')"
></el-input-number>
</template>
</GLTable>
</div>
</template>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import util from '@/utils/index'
import selectedMixin from '../mixins/selectedMixin'
export default {
name: 'service',
mixins: [selectedMixin],
props: {
merchantId: [Number, String],
selectedServiceList: {
type: Array,
default: () => []
}
},
data () {
return {
serviceTabList: [
{ label: '门店服务', type: 7 },
{ label: '折扣券', type: 2 },
{ label: '代金券', type: 3 },
{ label: '兑换券', type: 4 }
],
discountType: 7,
loading: false,
serviceList: [],
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'packageCode',
checkSelectKey: 'id',
checkSelectVal: '',
checkSelectable: null,
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '名称',
prop: 'couponName',
width: 180
},
{
label: '车主展示价/元',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
},
{
label: '有效期',
prop: 'effectiveType',
addHtml: 'effectiveType'
},
{
label: '使用限制',
prop: 'useType',
addHtml: 'useType'
},
{
label: '选择数量',
prop: 'amount',
addHtml: 'amount'
}
]
},
selectedList: []
}
},
watch: {
discountType () {
this.serviceList = []
this.getServiceList()
}
},
computed: {
setLeft () {
const { discountType } = this
return { left: (discountType == 7 ? 0 : discountType - 1) * 88 + 2 + 'px' }
}
},
mounted () {
this.selectedList = this.selectedServiceList
this.getServiceList()
},
methods: {
getServiceList () {
const { discountType, merchantId } = this,
{ page: { pageNum, pageSize } } = this.$refs[`serviceRef${discountType}`][0],
params = {
status: 2,
discountType,
merchantId,
limitStockFlag: 2,
pageNum,
pageSize
}
this.loading = true
this.$apis.points.getghDirectionalGiftListApi(params).then(res => {
this.loading = false
res.list.map(e => {
e.amount = 1
e.couponId = e.id
})
// 重置分页组件
this.serviceList = res.list
this.$refs['serviceRef' + discountType][0].tableTotal = res.total
this.selectedPreExisting(this.selectedList, this.serviceList, 'couponId', this.$refs['serviceRef' + this.discountType][0])
this.setAmount(this.selectedList, this.serviceList, 'couponId')
}).finally(() => {
this.loading = false
})
},
//格式化数据
toLabelText (row) {
return {
3: '永久有效',
2: row.effectiveStartTime ? row.effectiveStartTime.split(' ')[0] + '-' + row.effectiveEndTime.split(' ')[0] : '',
1: row.effectiveDays + '天'
}[row.effectiveType]
},
toRestrictLabelText (row) {
return {
0: '无限制',
1: '有效期内可使用' + row.useAmount + '次',
2: '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次'
}[row.useType]
},
addCoupon () {
util.openTab('/tools/couponManage/index')
},
}
}
</script>
<style scoped lang='scss'>
.service-flex {
display: flex;
align-items: center;
margin-bottom: 10px;
.service-tip {
color: #999;
margin-left: 8px;
}
.tab-right {
display: flex;
margin-left: auto;
.refresh-btn {
cursor: pointer;
color: #666666;
}
.add-btn {
cursor: pointer;
margin-left: 10px;
color: #5850ff;
}
}
.service-tab {
height: 36px;
background: #f8f8f8;
border-radius: 4px;
display: flex;
// max-width: 352px;
position: relative;
.tab-border {
position: absolute;
left: 2px;
top: 2px;
z-index: 1;
width: 84px;
height: 32px;
background: #ffffff;
transition: all 0.25s;
border-radius: 4px;
}
.tab-item {
width: 88px;
z-index: 2;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
&.active {
border-radius: 3px;
color: #5850ff;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -22,11 +22,28 @@ ...@@ -22,11 +22,28 @@
ref="listRef" ref="listRef"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="tableSearchForm" :searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams" :tableParams="tableParams"
:pageConf="pageConf" :pageConf="pageConf"
> >
<span <template
slot="customerNumber"
slot-scope="scope"
>
<div
class="link"
@click="openDetail(scope.scope.batchNo)"
>{{scope.scope.customerNumber}}</div>
</template>
<template
slot="status"
slot-scope="scope"
>
<div class="status-box">
<span :class="['status',`status-${scope.scope.status}`]"></span>
{{{0:'待充值',1:'充值成功'}[scope.scope.status]}}
</div>
</template>
<template
slot="auth-button" slot="auth-button"
slot-scope="scope" slot-scope="scope"
> >
...@@ -35,30 +52,40 @@ ...@@ -35,30 +52,40 @@
:buttonItem="scope.scope" :buttonItem="scope.scope"
:buttonNum="3" :buttonNum="3"
></GLTableButton> ></GLTableButton>
</span> </template>>
</GLTable> </GLTable>
</div> </div>
<detail-dialog :detailObj.sync="detailObj" />
<audit-dialog :auditObj.sync="auditObj" />
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import url from '@/assets/empty.png' import detailDialog from './components/detailDialog.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import auditDialog from './components/auditDialog.vue'
export default { export default {
name: 'RedEnvelopeConfig', name: '',
components: {
detailDialog,
auditDialog
},
data () { data () {
return { return {
url, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: { searchForm: {
batchNo: '',
merchantName: '', merchantName: '',
merchantId: '', customerName: '',
staffName: '' customerPhone: '',
createdDate: [],
auditDate: [],
status: ''
}, },
searchFormData: [ searchFormData: [
{ {
label: '批次', label: '批次',
name: 'activityName', name: 'batchNo',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
...@@ -70,19 +97,19 @@ export default { ...@@ -70,19 +97,19 @@ export default {
}, },
{ {
label: '用户姓名', label: '用户姓名',
name: 'wechatName', name: 'customerName',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
{ {
label: '用户手机号', label: '用户手机号',
name: 'wechatName', name: 'customerPhone',
type: 'input', type: 'input',
maxlength: 100 maxlength: 13
}, },
{ {
label: '创建时间', label: '创建时间',
name: 'showTime', name: 'createdDate',
type: 'datePicker', type: 'datePicker',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
isClear: true, isClear: true,
...@@ -98,23 +125,20 @@ export default { ...@@ -98,23 +125,20 @@ export default {
}, },
{ {
label: '状态', label: '状态',
name: 'statuses', name: 'status',
type: 'select', type: 'select',
maxlength: 100, maxlength: 100,
optionList: [ optionList: [
{ text: '全部', id: '-1,0,1' }, { text: '全部', id: '' },
{ text: '待付款', id: '0' }, { text: '待充值 ', id: '0' },
{ text: '已取消', id: '1' }, { text: '充值成功', id: '1' }
{ text: '发放中', id: '-1' },
{ text: '发放成功', id: '-2' },
{ text: '发放失败', id: '-3' },
], ],
optionId: 'id', optionId: 'id',
optionLabel: 'text' optionLabel: 'text'
}, },
{ {
label: '审核时间', label: '审核时间',
name: 'showTime', name: 'auditDate',
type: 'datePicker', type: 'datePicker',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
isClear: true, isClear: true,
...@@ -129,54 +153,50 @@ export default { ...@@ -129,54 +153,50 @@ export default {
} }
}, },
], ],
getListApi: this.$apis.points.getList, getListApi: this.$apis.points.getIntegralList,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '商户名称', label: '商户名称',
prop: 'userPhone', prop: 'merchantName',
minWidth: 100 minWidth: 150
}, },
{ {
label: '批次', label: '批次',
prop: 'wechatName', prop: 'batchNo',
minWidth: 100 minWidth: 120
}, },
{ {
label: '客户数量', label: '客户数量',
prop: 'activityName', addHtml: 'customerNumber',
minWidth: 100 minWidth: 100
}, },
{ {
label: '充值积分数', label: '充值积分数',
minWidth: 100, minWidth: 120,
prop: 'activityName', prop: 'totalIntegral',
}, },
{ {
label: '状态', label: '状态',
minWidth: 100, minWidth: 120,
prop: 'activityName', addHtml: 'status',
}, },
{ {
label: '创建时间', label: '创建时间',
minWidth: 150, minWidth: 150,
formatter: cell => `${dayjs(cell.activityStartTime).format('YYYY/MM/DD')}-${dayjs(cell.activityEndTime).format('YYYY/MM/DD')}` formatter: cell => dayjs(cell.createdDate).format('YYYY/MM/DD hh:mm:ss')
}, },
{ {
label: '审核人', label: '审核人',
prop: 'activityType', prop: 'auditBy',
minWidth: 150, minWidth: 150,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
}
}, },
{ {
label: '审核时间', label: '审核时间',
prop: 'link', minWidth: 150,
minWidth: 150 formatter: cell => cell.auditDate ? dayjs(cell.auditDate).format('YYYY/MM/DD hh:mm:ss') : ''
}, },
] ]
}, },
...@@ -187,11 +207,11 @@ export default { ...@@ -187,11 +207,11 @@ export default {
attrs: { attrs: {
type: 'text', type: 'text',
}, },
condition: row => row.status != 0, condition: row => row.status == 0,
listeners: { listeners: {
click: row => this.dataObj = { click: row => this.auditObj = {
show: true, show: true,
...row row
} }
} }
}, },
...@@ -201,6 +221,7 @@ export default { ...@@ -201,6 +221,7 @@ export default {
attrs: { attrs: {
type: 'text', type: 'text',
}, },
condition: row => row.status == 1,
listeners: { listeners: {
click: row => this.editForm(row) click: row => this.editForm(row)
} }
...@@ -211,14 +232,16 @@ export default { ...@@ -211,14 +232,16 @@ export default {
attrs: { attrs: {
type: 'text', type: 'text',
}, },
condition: row => true, condition: row => row.status == 0,
listeners: { listeners: {
click: row => this.editForm(row, 'edit') click: row => this.editForm(row, 'edit')
} }
}, },
], ],
showImportRecord: false, showImportRecord: false,
tableSearchForm: {} tableSearchForm: {},
detailObj: {},
auditObj: {}
} }
}, },
mounted () { mounted () {
...@@ -234,27 +257,22 @@ export default { ...@@ -234,27 +257,22 @@ export default {
}, },
handleExport () { handleExport () {
const params = this.getParams() const params = this.getParams()
this.$apis.points.orderExport(params).then(res => { this.$apis.points.exportIntegralList({ ...params, ...this.$refs.listRef.page }).then(res => {
this.$utils.aToExport(res) this.$utils.aToExport(res)
}) })
}, },
getParams () { getParams () {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
this.updateParams(params, 'showTime', 'showTime', 'startShowTime', 'endShowTime'); this.setTimeFormat(params, 'createdDate', 'createdDateBegin', 'createdDateEnd')
this.updateParams(params, 'lotteryDrawTime', 'lotteryDrawTime', 'startLotteryDrawTime', 'endLotteryDrawTime'); this.setTimeFormat(params, 'auditDate', 'auditDateBegin', 'auditDateEnd')
return params return params
}, },
updateParams (params, paramKey, formKey, beginKey, endKey) { setTimeFormat (target, name, start, end) {
if (params[paramKey]) { if (target[name] && target[name].length) {
params[beginKey] = this.searchForm[formKey][0]; target[start] = `${dayjs(target[name][0]).format('YYYY-MM-DD')} 00:00:00`
params[endKey] = this.searchForm[formKey][1]; target[end] = `${dayjs(target[name][1]).format('YYYY-MM-DD')} 23:59:59`
delete params[paramKey]; delete target[name]
} else {
delete params[beginKey];
delete params[endKey];
} }
// delete params[paramKey];
return params
}, },
jump () { jump () {
this.$router.push({ this.$router.push({
...@@ -263,6 +281,22 @@ export default { ...@@ -263,6 +281,22 @@ export default {
$title: '门店客户积分充值', $title: '门店客户积分充值',
} }
}) })
},
openDetail (batchNo) {
this.detailObj = {
show: true,
batchNo
}
},
editForm (row, type = '') {
this.$router.push({
path: '/storeCredit/add',
query: {
$title: type ? '编辑门店客户积分充值' : '查看门店客户积分充值',
id: row.id,
type
}
})
} }
} }
...@@ -288,5 +322,23 @@ export default { ...@@ -288,5 +322,23 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
} }
.link {
color: #5850ff;
cursor: pointer;
}
}
.status-box {
display: flex;
align-items: center;
.status {
width: 6px;
height: 6px;
border-radius: 4px;
background: #fdb757;
margin-right: 8px;
}
.status-1 {
background: #2cca74;
}
} }
</style> </style>
export default {
methods: {
handleSelectionServiceTable (selection, row, id) {
if (selection && selection.find(item => item && item[id] == row[id])) {
this.addRows(this.selectedList, [row], id)
} else {
this.selectedList = this.deleteRows(this.selectedList, [row], id)
}
},
handleSelectionServiceTableAll (selected, id) {
if (selected.length > 0) {
this.addRows(this.selectedList, selected, id)
} else {
this.selectedList = this.deleteRows(this.selectedList, this.serviceList, id)
}
},
//添加选中
addRows (selectedItems, rows, val) {
rows.forEach(row => {
//过滤,当selectedItems有此条数据时,则直接返回,不执行添加
if (selectedItems.find(item => item[val] == row[val])) {
return
}
selectedItems.push(row)
})
},
//取消选中
deleteRows (selectedItems, rows, val) {
//当selectedItems为空数组时,不执行删除
if (selectedItems.length == 0) {
return
}
rows.forEach(row => {
selectedItems = selectedItems.filter(item => item[val] != row[val])
})
return selectedItems
},
//选中table已有数据
selectedPreExisting (rows, list, val, refTabel) {
refTabel.$refs['listMutiTable'].clearSelection()
if (rows?.length) {
//这里使用this.$nextTick是防止表格未渲染完成就执行,导致无法添加选中效果
this.$nextTick(() => {
rows.forEach(row => {
//判断row是存在当前tableData
list.forEach(i => {
if (i[val] == row[val]) {
refTabel.$refs['listMutiTable'].toggleRowSelection(i, true)
}
})
})
})
} else {
refTabel.$refs['listMutiTable'].clearSelection()
}
},
setAmount (rows, list, val) {
if (rows?.length) {
this.$nextTick(() => {
rows.forEach(row => {
list.forEach(i => {
if (i[val] == row[val]) this.$set(i, 'amount', row.amount)
})
})
})
}
},
changeAmount () {
const [amount, , row, id] = arguments,
{ selectedList } = this,
that = selectedList.find(e => e[id] == row[id])
that.amount = amount
}
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!