Commit 8551ebe2 by 李伟康

提交需求

1 parent 5569516d
...@@ -6457,14 +6457,16 @@ ...@@ -6457,14 +6457,16 @@
} }
}, },
"glsx-components": { "glsx-components": {
"version": "1.5.2", "version": "1.5.7",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.2.tgz", "resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.5.7.tgz",
"integrity": "sha512-5/LaPu0B1uT7Kzl6oyIqyFT/NXIz2w7HNstiRtHaUQN1waSrPPPtzRRwywJg6CSSL+p994NaqPRnX696NAYzKg==", "integrity": "sha512-WEWt1Ev7uf8VgILrEr15ZHxOreqWEVEY2WRP5EmZKzYKTVF/7dQU/oI84+Xo4vSmlz7ltblaATyrwm1U1LDnHg==",
"requires": { "requires": {
"@amap/amap-jsapi-loader": "^1.0.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"glsx-common": "^1.4.9", "glsx-common": "^1.4.9",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3" "vuedraggable": "^2.24.3"
}, },
"dependencies": { "dependencies": {
...@@ -6477,16 +6479,6 @@ ...@@ -6477,16 +6479,6 @@
"md5": "^2.3.0", "md5": "^2.3.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"sha1": "^1.1.1" "sha1": "^1.1.1"
},
"dependencies": {
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
}
}
} }
} }
} }
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
"echarts": "^5.4.3", "echarts": "^5.4.3",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^2.0.4", "glsx-common": "^2.0.4",
"glsx-components": "^1.2.5", "glsx-components": "^1.5.7",
"moment": "^2.29.4", "moment": "^2.29.4",
"number-precision": "^1.6.0",
"vod-js-sdk-v6": "^1.6.2", "vod-js-sdk-v6": "^1.6.2",
"wangeditor": "^4.7.15", "wangeditor": "^4.7.15",
"word-edit": "^1.3.3" "word-edit": "^1.3.3"
......
import { http } from '@/main'
/**自店服务 */
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
})
}
export default {
getghDirectionalGiftListApi,
importCustomerIntegral,
updateCustomerIntegral,
getOilCouponList,
getMerchantCharge,
getIntegralList,
exportIntegralList,
getIntegralDetail,
getCustomerIntegralList,
}
\ No newline at end of file \ No newline at end of file
...@@ -902,3 +902,6 @@ html { ...@@ -902,3 +902,6 @@ html {
color: #5850ff; color: #5850ff;
} }
} }
.el-message{
z-index: 9999999 !important;
}
\ 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: '赠送油券',
addHtml: 'oilList',
minWidth: 150,
},
{
label: '赠送自店服务',
addHtml: 'couponList',
minWidth: 150,
},
{
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
...@@ -5,11 +5,31 @@ ...@@ -5,11 +5,31 @@
:tableData="serviceList" :tableData="serviceList"
:tableParams="tableParams" :tableParams="tableParams"
@refreshTable="getServiceList" @refreshTable="getServiceList"
@select="handleSelectionServiceTable" @select="handleSelectionServiceTable(...arguments, 'oilCouponId')"
@select-all="handleSelectionServiceTableAll" @select-all="handleSelectionServiceTableAll(...arguments, 'oilCouponId')"
> >
<template <template
slot="residueAmount" 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" slot-scope="scope"
> >
<el-input-number <el-input-number
...@@ -17,7 +37,8 @@ ...@@ -17,7 +37,8 @@
:min="1" :min="1"
:max="10" :max="10"
:step="1" :step="1"
v-model="scope.scope.residueAmount" v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'oilCouponId')"
></el-input-number> ></el-input-number>
</template> </template>
</GLTable> </GLTable>
...@@ -28,6 +49,12 @@ import selectedMixin from '../mixins/selectedMixin' ...@@ -28,6 +49,12 @@ import selectedMixin from '../mixins/selectedMixin'
export default { export default {
name: 'gas', name: 'gas',
mixins: [selectedMixin], mixins: [selectedMixin],
props: {
selectedGasList: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
loading: false, loading: false,
...@@ -44,57 +71,55 @@ export default { ...@@ -44,57 +71,55 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '商品图片', label: '商品图片',
prop: 'couponName', addHtml: 'gasImageSlot',
width: 180 width: 100
}, },
{ {
label: '名称', label: '名称',
prop: 'anticipatedCost', prop: 'aliasName',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
}, },
{ {
label: '油卡面额/元', label: '油卡面额/元',
prop: 'effectiveType', prop: 'faceValue',
}, },
{ {
label: '售价/元', label: '售价/元',
prop: 'useType', formatter: cellValue => {
return cellValue.salesPrice ? Number(cellValue.salesPrice / 100).toFixed(2) : '--'
}
}, },
{ {
label: '选择数量', label: '选择数量',
prop: 'residueAmount', addHtml: 'amount'
addHtml: 'residueAmount'
} }
] ]
}, },
selectedGasList: [], selectedList: [],
selectedList: []
} }
}, },
mounted () { mounted () {
this.selectedList = this.selectedGasList
this.getServiceList() this.getServiceList()
}, },
methods: { methods: {
getServiceList () { getServiceList () {
const { page: { pageNum, pageSize } } = this.$refs.serviceRef, const { page: { pageNum, pageSize } } = this.$refs.serviceRef,
params = { params = {
status: 2,
discountType: 7,
merchantId: this.$globalState.session.merchantId,
limitStockFlag: 2,
pageNum, pageNum,
pageSize pageSize
} }
this.loading = true this.loading = true
this.$apis.giftBag.getghDirectionalGiftListApi(params).then(res => { this.$apis.points.getOilCouponList(params).then(res => {
this.loading = false this.loading = false
res.list.map(e => {
e.amount = 1
e.oilCouponId = e.id
})
// 重置分页组件 // 重置分页组件
this.serviceList = res.list this.serviceList = res.list
// this.fnCallBack = true
this.$refs.serviceRef.tableTotal = res.total this.$refs.serviceRef.tableTotal = res.total
this.selectedPreExisting(this.selectedList, this.serviceList, 'id', this.$refs.serviceRef) this.selectedPreExisting(this.selectedList, this.serviceList, 'oilCouponId', this.$refs.serviceRef)
this.setAmount(this.selectedList, this.serviceList, 'oilCouponId')
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
...@@ -105,4 +130,16 @@ export default { ...@@ -105,4 +130,16 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
.img {
width: 36px;
height: 36px;
// img{
// width: 100%;
// height: 100%;
// }
}
.img-plus {
width: 200px;
height: 200px;
}
</style> </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'>
import { aToExport } from '@/common/constant'
export default {
name: '',
props: {
importObj: {
type: Object,
default: () => { }
}
},
data () {
return {
loading: false,
checked: false
}
},
mounted () {
},
methods: {
handleClose () {
this.$emit('update:importObj', {})
},
handleConfirm () {
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
...@@ -13,16 +13,20 @@ ...@@ -13,16 +13,20 @@
v-model="currentComponent" v-model="currentComponent"
:tabPaneList="tabPaneList" :tabPaneList="tabPaneList"
></GLTabs> ></GLTabs>
<div class="component"> <template v-if="configParams.show">
<gas <div class="component">
v-show="currentComponent == 'gas'" <gas
ref="gasRef" v-show="currentComponent == 'gas'"
/> ref="gasRef"
<service :selectedGasList="configParams.row.oilList || []"
v-show="currentComponent == 'service'" />
ref="serviceRef" <service
/> v-show="currentComponent == 'service'"
</div> ref="serviceRef"
:selectedServiceList="configParams.row.couponList || []"
/>
</div>
</template>
</GLDialog> </GLDialog>
</template> </template>
...@@ -57,24 +61,38 @@ export default { ...@@ -57,24 +61,38 @@ export default {
] ]
} }
}, },
watch: {
'configParams.show' (n) {
if (n) this.currentComponent = this.configParams.type == 1 ? 'service' : 'gas'
}
},
mounted () { mounted () {
}, },
methods: { methods: {
handleGiftClose () { handleGiftClose () {
this.$emit('update:configParams', { this.$emit('update:configParams', {})
show: false
})
}, },
handleConfirm () { handleConfirm () {
const { gasRef, serviceRef } = this.$refs const { gasRef, serviceRef } = this.$refs,
this.$emit('confirm', [...gasRef.selectedList, ...serviceRef.selectedList].map(e => { oilList = gasRef.selectedList?.map(e => {
return { return {
couponId: e.id, oilCouponId: e.oilCouponId,
couponAmount: 1, amount: e.amount,
couponAnticipatedCost: e.denomination || e.anticipatedCost || e.couponAnticipatedCost faceValue: e.faceValue,
} aliasName: e.aliasName
})) }
this.handleGiftClose() }) || [],
couponList = serviceRef.selectedList?.map(e => {
return {
couponId: e.couponId,
amount: e.amount,
couponName: e.couponName
}
}) || []
this.$emit('confirm', {
oilList,
couponList
})
} }
} }
} }
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
:tableData="serviceList" :tableData="serviceList"
:tableParams="tableParams" :tableParams="tableParams"
@refreshTable="getServiceList" @refreshTable="getServiceList"
@select="handleSelectionServiceTable" @select="handleSelectionServiceTable(...arguments, 'couponId')"
@select-all="handleSelectionServiceTableAll" @select-all="handleSelectionServiceTableAll(...arguments, 'couponId')"
> >
<template <template
slot="effectiveType" slot="effectiveType"
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<span>{{ toRestrictLabelText(scope.scope) }}</span> <span>{{ toRestrictLabelText(scope.scope) }}</span>
</template> </template>
<template <template
slot="residueAmount" slot="amount"
slot-scope="scope" slot-scope="scope"
> >
<el-input-number <el-input-number
...@@ -76,14 +76,14 @@ ...@@ -76,14 +76,14 @@
:min="1" :min="1"
:max="10" :max="10"
:step="1" :step="1"
v-model="scope.scope.residueAmount" v-model="scope.scope.amount"
@change="changeAmount(...arguments,scope.scope,'couponId')"
></el-input-number> ></el-input-number>
</template> </template>
</GLTable> </GLTable>
</div> </div>
</template> </template>
</template> </template>
</div> </div>
</template> </template>
...@@ -93,9 +93,14 @@ import selectedMixin from '../mixins/selectedMixin' ...@@ -93,9 +93,14 @@ import selectedMixin from '../mixins/selectedMixin'
export default { export default {
name: 'service', name: 'service',
mixins: [selectedMixin], mixins: [selectedMixin],
props: {
selectedServiceList: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
selectedList: [],
serviceTabList: [ serviceTabList: [
{ label: '门店服务', type: 7 }, { label: '门店服务', type: 7 },
{ label: '折扣券', type: 2 }, { label: '折扣券', type: 2 },
...@@ -139,11 +144,12 @@ export default { ...@@ -139,11 +144,12 @@ export default {
}, },
{ {
label: '选择数量', label: '选择数量',
prop: 'residueAmount', prop: 'amount',
addHtml: 'residueAmount' addHtml: 'amount'
} }
] ]
} },
selectedList: []
} }
}, },
watch: { watch: {
...@@ -176,11 +182,16 @@ export default { ...@@ -176,11 +182,16 @@ export default {
this.loading = true this.loading = true
this.$apis.giftBag.getghDirectionalGiftListApi(params).then(res => { this.$apis.giftBag.getghDirectionalGiftListApi(params).then(res => {
this.loading = false this.loading = false
res.list.map(e => {
e.amount = 1
e.couponId = e.id
})
// 重置分页组件 // 重置分页组件
this.serviceList = res.list this.serviceList = res.list
// this.fnCallBack = true // this.fnCallBack = true
this.$refs['serviceRef' + discountType][0].tableTotal = res.total this.$refs['serviceRef' + discountType][0].tableTotal = res.total
this.selectedPreExisting(this.selectedList, this.serviceList, 'id', this.$refs['serviceRef' + this.discountType][0]) this.selectedPreExisting(this.selectedList, this.serviceList, 'couponId', this.$refs['serviceRef' + this.discountType][0])
this.setAmount(this.selectedList, this.serviceList, 'couponId')
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
......
...@@ -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,54 +52,60 @@ ...@@ -35,54 +52,60 @@
:buttonItem="scope.scope" :buttonItem="scope.scope"
:buttonNum="3" :buttonNum="3"
></GLTableButton> ></GLTableButton>
</span> </template>
</GLTable> </GLTable>
</div> </div>
<detail-dialog :detailObj.sync="detailObj" />
</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 { aToExport } from '@/common/constant'
export default { export default {
name: '', name: '',
components: {
detailDialog
},
data () { data () {
return { return {
url, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: { searchForm: {
merchantName: '', batchNo: '',
merchantId: '', policyNo: '',
staffName: '' customerName: '',
customerPhone: '',
createdDate: []
}, },
searchFormData: [ searchFormData: [
{ {
label: '批次', label: '批次',
name: 'activityName', name: 'batchNo',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
{ {
label: '保单号', label: '保单号',
name: 'merchantName', name: 'policyNo',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
{ {
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: 100
}, },
{ {
label: '发放时间', label: '发放时间',
name: 'showTime', name: 'createdDate',
type: 'datePicker', type: 'datePicker',
valueFormat: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd',
isClear: true, isClear: true,
...@@ -97,44 +120,40 @@ export default { ...@@ -97,44 +120,40 @@ export default {
} }
}, },
], ],
getListApi: this.$apis.activity.activityPageList, getListApi: this.$apis.points.getIntegralList,
tableParams: { tableParams: {
listName: 'data', listName: 'list',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '批次', label: '批次',
prop: 'wechatName', prop: 'batchNo',
minWidth: 100 minWidth: 100
}, },
{ {
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: 100,
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: 'createdBy',
minWidth: 150, minWidth: 150,
formatter: cell => {
// 0:随机红包;1:九宫格;2:翻牌;3:大转盘;
return { 0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘' }[cell.activityType]
}
}, },
] ]
}, },
...@@ -145,6 +164,7 @@ export default { ...@@ -145,6 +164,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)
} }
...@@ -155,14 +175,14 @@ export default { ...@@ -155,14 +175,14 @@ 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, tableSearchForm: {},
tableSearchForm: {} detailObj: {}
} }
}, },
mounted () { mounted () {
...@@ -178,27 +198,21 @@ export default { ...@@ -178,27 +198,21 @@ 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) 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');
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({
...@@ -207,6 +221,22 @@ export default { ...@@ -207,6 +221,22 @@ export default {
$title: '客户积分充值', $title: '客户积分充值',
} }
}) })
},
openDetail (batchNo) {
this.detailObj = {
show: true,
batchNo
}
},
editForm (row, type = '') {
this.$router.push({
path: '/points/add',
query: {
$title: type ? '编辑客户积分充值' : '查看客户积分充值',
id: row.id,
type
}
})
} }
} }
...@@ -228,9 +258,27 @@ export default { ...@@ -228,9 +258,27 @@ export default {
.el-button { .el-button {
min-width: 60px; min-width: 60px;
} }
.el-button+.el-button{ .el-button + .el-button {
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 { export default {
methods: { methods: {
handleSelectionServiceTable (selection, row) { handleSelectionServiceTable (selection, row, id) {
if (selection && selection.find(item => item && item.id == row.id)) { if (selection && selection.find(item => item && item[id] == row[id])) {
this.addRows(this.selectedList, [row], 'id') this.addRows(this.selectedList, [row], id)
} else { } else {
this.selectedList = this.deleteRows(this.selectedList, [row], 'id') this.selectedList = this.deleteRows(this.selectedList, [row], id)
} }
}, },
handleSelectionServiceTableAll (selected) { handleSelectionServiceTableAll (selected, id) {
if (selected.length > 0) { if (selected.length > 0) {
this.addRows(this.selectedList, selected, 'id') this.addRows(this.selectedList, selected, id)
} else { } else {
this.selectedList = this.deleteRows(this.selectedList, this.serviceList, 'id') this.selectedList = this.deleteRows(this.selectedList, this.serviceList, id)
} }
}, },
//添加选中 //添加选中
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
//选中table已有数据 //选中table已有数据
selectedPreExisting (rows, list, val, refTabel) { selectedPreExisting (rows, list, val, refTabel) {
refTabel.$refs['listMutiTable'].clearSelection() refTabel.$refs['listMutiTable'].clearSelection()
if (rows?.length > 0) { if (rows?.length) {
//这里使用this.$nextTick是防止表格未渲染完成就执行,导致无法添加选中效果 //这里使用this.$nextTick是防止表格未渲染完成就执行,导致无法添加选中效果
this.$nextTick(() => { this.$nextTick(() => {
rows.forEach(row => { rows.forEach(row => {
...@@ -54,5 +54,22 @@ export default { ...@@ -54,5 +54,22 @@ export default {
refTabel.$refs['listMutiTable'].clearSelection() 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!