Commit 38742cf3 by 前端

Merge branch 'v3.22.1' into 'master'

合并V3.22.1

See merge request !18
2 parents 6243d4dd 7a13d84b
...@@ -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">
<span>{{ filterData(scope.scope.oilList,'oilList').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div
v-for="(item,index) in filterData(scope.scope.oilList,'oilList')"
:key="index"
>
{{item}}
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope.oilList.length }})</span>
</el-popover>
</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">
<span>{{ filterData(scope.scope.couponList,'couponList').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover"
>
<div
v-for="(item,index) in filterData(scope.scope.couponList,'couponList')"
:key="index"
>
{{item}}
</div>
<span
class="more-info"
slot="reference"
>...({{ scope.scope.couponList.length }})</span>
</el-popover>
</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: 200
},
{
label: '用户姓名',
prop: 'customerName',
minWidth: 100
},
{
label: '身份证号',
minWidth: 200,
prop: 'idCardNo',
},
{
label: '用户手机号',
minWidth: 150,
prop: 'customerPhone',
},
{
label: '返现金额',
minWidth: 150,
prop: 'cashBackValue'
},
{
label: '商品兑换积分',
prop: 'buyValue',
minWidth: 150,
},
{
label: '赠送油券',
addHtml: 'oilList',
minWidth: 260,
},
{
label: '赠送自店服务',
addHtml: 'couponList',
minWidth: 260,
},
{
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.salesPrice, 0.01))
return total
}
},
]
},
}
},
mounted () {
},
methods: {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.recordId = this.detailObj.recordId
this.loading = false
resolve()
})
},
handleClose () {
this.$emit('update:detailObj', {})
},
filterData (list, name) {
return list?.map(i => {
return name == 'oilList' ? `${i.aliasName}*${i.amount} (${NP.times(i.amount, i.salesPrice, 0.01)}积分)` : `${i.couponName}*${i.amount}`
}) || []
},
}
}
</script>
<style scoped lang='scss'>
.more-info {
white-space: nowrap;
color: #5850ff;
cursor: pointer;
}
</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="scope.scope.maxStock"
: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 => {
let maxStock = e.stock - e.usedStock
e.amount = 1
e.oilCouponId = e.id
e.maxStock = maxStock > 10 ? 10 : maxStock
})
// 重置分页组件
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">
<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%;
display: flex;
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="提交"
@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"
:selectedGasList="configParams.oilList"
/>
<service
v-show="currentComponent == 'service'"
ref="serviceRef"
:selectedServiceList="configParams.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: () => { }
}
},
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,
salesPrice: e.salesPrice,
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>
<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="scope.scope.maxStock"
: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 { openTab } from '@/utils/index'
import selectedMixin from '../mixins/selectedMixin'
export default {
name: 'service',
mixins: [selectedMixin],
props: {
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.getServiceList()
},
methods: {
getServiceList () {
const { discountType } = this,
{ page: { pageNum, pageSize } } = this.$refs[`serviceRef${discountType}`][0],
params = {
status: 2,
discountType: discountType,
merchantId: this.$globalState.session.merchantId,
limitStockFlag: 2,
pageNum,
pageSize
}
this.loading = true
this.$apis.giftBag.getghDirectionalGiftListApi(params).then(res => {
this.loading = false
res.list.map(e => {
let maxStock = e.residueAmount
e.amount = 1
e.couponId = e.id
e.maxStock = maxStock > 10 ? 10 : maxStock
})
// 重置分页组件
this.serviceList = res.list
// this.fnCallBack = true
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 () {
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
<template>
<div class="container">
<GLCombiForm
ref="showSearch"
:rowNumber="2"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="sticky-btns">
<el-button
type="default"
plain
@click="jump"
size="small"
>客户积分充值</el-button>
<el-button
@click="handleExport"
size="small"
>导出
</el-button>
</div>
<div class="tabelList">
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<template
slot="customerNumber"
slot-scope="scope"
>
<div
class="link"
@click="openDetail(scope.scope.id)"
>{{scope.scope.customerNumber}}</div>
</template>
<template
slot="totalIntegral"
slot-scope="scope"
>
<div class="totalIntegral">
{{scope.scope.totalIntegral}}
<div class="service">(含{{scope.scope.totalIntegral}}%手续费)</div>
</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-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</template>
</GLTable>
</div>
<detail-dialog :detailObj.sync="detailObj" />
</div>
</template>
<script type='text/ecmascript-6'>
import detailDialog from './components/detailDialog.vue'
import * as dayjs from 'dayjs'
import { aToExport } from '@/common/constant'
export default {
name: '',
components: {
detailDialog
},
data () {
return {
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
searchForm: {
batchNo: '',
policyNo: '',
customerName: '',
customerPhone: '',
auditDate: [],
merchantId: this.$globalState.session.merchantId
},
searchFormData: [
{
label: '批次',
name: 'batchNo',
type: 'input',
maxlength: 100
},
{
label: '保单号',
name: 'policyNo',
type: 'input',
maxlength: 100
},
{
label: '用户姓名',
name: 'customerName',
type: 'input',
maxlength: 100
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'input',
maxlength: 100
},
{
label: '发放时间',
name: 'auditDate',
type: 'datePicker',
valueFormat: 'yyyy-MM-dd',
isClear: true,
customPickerOptions: {
disabledDate (date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
],
getListApi: this.$apis.points.getIntegralList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '批次',
prop: 'batchNo',
minWidth: 100
},
{
label: '客户数量',
addHtml: 'customerNumber',
minWidth: 100
},
{
label: '充值积分总数',
minWidth: 120,
prop: 'totalIntegral',
},
{
label: '状态',
minWidth: 100,
addHtml: 'status',
},
{
label: '创建时间',
minWidth: 150,
formatter: cell => dayjs(cell.createdDate).format('YYYY/MM/DD hh:mm:ss')
},
{
label: '操作人',
prop: 'updatedBy',
minWidth: 150,
},
]
},
tableButtonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
},
condition: row => row.status == 1,
listeners: {
click: row => this.editForm(row)
}
},
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
},
condition: row => row.status == 0,
listeners: {
click: row => this.editForm(row, 'edit')
}
},
],
tableSearchForm: {},
detailObj: {}
}
},
mounted () {
},
methods: {
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handleSearch () {
// this.tableSearchForm = this.getParams()
this.$refs.listRef.refreshTable()
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
},
handleExport () {
const params = this.getParams()
this.$apis.points.exportIntegralList({ ...params, ...this.$refs.listRef.page }).then(res => {
aToExport(res)
})
},
getParams () {
let params = JSON.parse(JSON.stringify(this.searchForm))
this.setTimeFormat(params, 'auditDate', 'auditDateBegin', 'auditDateEnd')
return params
},
setTimeFormat (target, name, start, end) {
if (target[name] && target[name].length) {
target[start] = `${dayjs(target[name][0]).format('YYYY-MM-DD')} 00:00:00`
target[end] = `${dayjs(target[name][1]).format('YYYY-MM-DD')} 23:59:59`
delete target[name]
}
},
jump () {
this.$router.push({
path: '/points/add',
query: {
$title: '客户积分充值',
}
})
},
openDetail (recordId) {
this.detailObj = {
show: true,
recordId
}
},
editForm (row, type = '') {
this.$router.push({
path: '/points/add',
query: {
$title: type ? '编辑客户积分充值' : '查看客户积分充值',
id: row.id,
type
}
})
}
}
}
</script>
<style scoped lang='scss'>
.container {
height: 100%;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
padding: 20px;
.sticky-btns {
margin-bottom: 10px;
display: flex;
justify-content: flex-end;
.el-button {
min-width: 60px;
}
.el-button + .el-button {
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>
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!