Commit cc97a281 by 王志慧

积分需求开发

1 parent e74ebb04
......@@ -3524,27 +3524,6 @@
"whatwg-fetch": "^3.6.2"
},
"dependencies": {
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"acorn-walk": {
"version": "8.2.0",
"resolved": "https://registry.npmmirror.com/acorn-walk/-/acorn-walk-8.2.0.tgz",
......@@ -3934,6 +3913,27 @@
"lodash": "^4.17.4"
}
},
"@vue/vue-loader-v15": {
"version": "npm:vue-loader@15.11.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.11.1.tgz",
"integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.1.0",
"hash-sum": "^1.0.2",
"loader-utils": "^1.1.0",
"vue-hot-reload-api": "^2.3.0",
"vue-style-loader": "^4.1.0"
},
"dependencies": {
"hash-sum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
"integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
"dev": true
}
}
},
"@vue/vue2-jest": {
"version": "27.0.0",
"resolved": "https://registry.npmmirror.com/@vue/vue2-jest/-/vue2-jest-27.0.0.tgz",
......@@ -17101,7 +17101,7 @@
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
"resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
......
import request from "./request"
// const path = 'dj.api.'
const path2 = "dj.api.smartcarlife."
/** 积分管理-积分审批列表*/
export function getList(data) {
data.method = `${path2}staff.motivation.page`
return request(data)
}
/** 积分管理-积分审批*/
export function pointCheck(data) {
data.method = `${path2}staff.motivation.audit`
return request(data)
}
/**积分管理-积分审批列表导出*/
export function exportFile(data) {
data.method = `${path2}staff.motivation.list.export`
return request(data)
}
/**积分管理-积分审批详情*/
export function getPointDetail(data) {
data.method = `${path2}staff.motivation.detail`
return request(data)
}
/**积分管理-积分明细列表*/
export function getScorePage(data) {
data.method = `${path2}staff.score.page`
return request(data)
}
/**积分管理-积分明细列表导出*/
export function exportScore(data) {
data.method = `${path2}staff.score.export`
return request(data)
}
// 积分管理-积分明细收益列表
export function getDetailList(data) {
data.method = `${path2}staff.score.detail.list`
return request(data)
}
// 积分管理-积分明细收益列表导出
export function exportDetailScore(data) {
data.method = `${path2}staff.score.detail.list.export`
return request(data)
}
// 积分管理-积分明细收益记录详情
export function getScoreDetail(data) {
data.method = `${path2}staff.score.detail`
return request(data)
}
export function getShopMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list`
return request(data, 'post')
}
\ No newline at end of file
<!--
* @Author: 王志慧 wangzh@didihu.com.cn
* @Date: 2024-06-12 15:21:09
* @LastEditors: 王志慧 wangzh@didihu.com.cn
* @LastEditTime: 2024-08-19 15:10:19
* @FilePath: \dj-car-life-system\src\components\d2-table-header\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<el-row class="table-header">
<el-col :span="leftSpan">
<span v-text="title" />
<el-col :span="leftSpan" :class="titleClassName">
<span v-text="title" class="table-header-title" />
<slot name="left" />
</el-col>
<el-col :span="24 - leftSpan">
......@@ -19,6 +27,10 @@ export default {
required: false,
default: ''
},
titleClassName:{
type: String,
default: ''
},
leftSpan: {
type: Number,
required: false,
......
......@@ -780,7 +780,13 @@ export const routerName = {
category: "Button",
type: "primary",
handle: "handleExportLabel"
}
},
{
authId: "9061912",
parentId: "90619",
label: "员工注册码",
handle: "employeeRegistrationCode"
},
],
component: _import("systemConfig/ShopConfig/index")
},
......
/*
* @Author: 王志慧 wangzh@didihu.com.cn
* @Date: 2024-08-13 14:35:06
* @LastEditors: 王志慧 wangzh@didihu.com.cn
* @LastEditTime: 2024-08-19 15:21:02
* @FilePath: \dj-car-life-system\src\router\modules\914_pointManagement.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
914: {
path: "/pointManagement",
name: "pointManagement",
meta: {
title: "积分管理",
authId: "914",
parentId: "1",
cache: false
}
},
91401: {
path: "/pointExamine",
name: "pointExamine",
meta: {
title: "积分审批",
authId: "91401",
parentId: "914",
cache: false
},
auth: [
{
authId: "9140101",
parentId: "91401",
label: "审核",
handle: "handleCheck"
},
{
authId: "9140102",
parentId: "91401",
label: "查看",
handle: "handleDetail"
},
{
authId: "9140103",
parentId: "91401",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("pointManagement/pointExamine")
},
91402: {
path: "/pointParticulars",
name: "pointParticulars",
meta: {
title: "积分明细",
authId: "91402",
parentId: "914",
cache: false
},
auth: [
{
authId: "9140201",
parentId: "91402",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "91403",
name: "详情",
parentId: "91402"
}
]
},
{
authId: "9140202",
parentId: "91402",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("pointManagement/pointParticulars")
},
91403: {
path: "/pointDetail",
name: "pointDetail",
meta: {
title: "详情",
authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointDetail"
},
component: _import("pointManagement/pointDetail")
},
}
<template>
<baseDialog
:is-show.sync="dialogShow"
:config="dialogConfig.setting"
:dialog-config="dialogConfig.config"
@closeDialog="handleDetailClose"
>
<div class="detail-content">
<div class="form_div">
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="积分类型:">
{{ detailInfo.infoName ? detailInfo.infoName : "-" }}
</el-form-item></el-col
>
<el-col :span="12">
<el-form-item label="积分明细:" class="halfItem">
{{
detailInfo.rewardScore
? (detailInfo.type == 0 ? "+" : "-") +
detailInfo.rewardScore
: "--"
}}
</el-form-item></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="客户名称:">
{{ detailInfo.customerName ? detailInfo.customerName : "-" }}
</el-form-item></el-col
>
<el-col :span="12">
<el-form-item label="客户手机号:" class="halfItem">
{{ detailInfo.customerPhone ? detailInfo.customerPhone : "-" }}
</el-form-item></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="订单编号:">
{{ detailInfo.orderCode ? detailInfo.orderCode : "-" }}
</el-form-item></el-col
>
<el-col :span="12">
<el-form-item label="商品名称:" class="halfItem">
{{ detailInfo.goodsName ? detailInfo.goodsName : "-" }}
</el-form-item></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="积分变化时间:">
{{ detailInfo.rewardTime ? detailInfo.rewardTime : "-" }}
</el-form-item></el-col
>
<el-col :span="12">
<el-form-item label="员工名称:" class="halfItem">
{{ detailInfo.staffName ? detailInfo.staffName : "-" }}
</el-form-item></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="员工手机号:" class="halfItem">
{{ detailInfo.staffPhone ? detailInfo.staffPhone : "-" }}
</el-form-item></el-col
>
<el-col :span="12">
<el-form-item label="门店名称:" class="halfItem">
{{ detailInfo.merchantName ? detailInfo.merchantName : "-" }}
</el-form-item></el-col
>
</el-row>
<el-row>
<el-col :span="12">
<template
v-if="
detailInfo.infoName == '积分兑换' ||
detailInfo.infoName == '积分返还'
"
>
<el-form-item label="兑换时间:" class="halfItem">
{{
detailInfo.withdrawalTime ? detailInfo.withdrawalTime : "-"
}}
</el-form-item>
</template>
<template v-if="detailInfo.infoName == '退款抵扣'">
<el-form-item label="退款时间:" class="halfItem">
{{ detailInfo.refundTime ? detailInfo.refundTime : "-" }}
</el-form-item></template
>
<template v-if="detailInfo.infoName == '错单抵扣'">
<el-form-item label="错单时间:" class="halfItem">
{{ detailInfo.errorTime ? detailInfo.errorTime : "-" }}
</el-form-item>
</template>
<template v-if="detailInfo.infoName == '撤单抵扣'">
<el-form-item label="撤单时间:" class="halfItem">
{{ detailInfo.revokeTime ? detailInfo.revokeTime : "-" }}
</el-form-item>
</template>
</el-col>
</el-row>
</el-form>
</div>
</div>
</baseDialog>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { getScoreDetail } from "@api/point"
export default {
name: "DetailDialog",
props: {
visible: {
type: Boolean,
default: false
},
id: {
type: Number,
default: ""
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit("update:visible", val)
}
}
},
watch: {
id(val) {
if (val) this.getDetail()
}
},
mounted() {
this.getDetail()
},
data() {
return {
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
btnList: []
},
config: {
title: "查看详情",
width: "1080px"
}
},
detailInfo: {}
}
},
methods: {
handleDetailClose() {
this.dialogShow = false
},
getDetail() {
getScoreDetail({ id: this.id }).then((res) => {
if (res) {
console.log(res)
res.rewardTime = res.rewardTime
? Util.dateFormate(res.rewardTime, "YYYY-MM-DD HH:mm:ss")
: "--"
res.withdrawalTime = res.withdrawalTime
? Util.dateFormate(res.withdrawalTime, "YYYY-MM-DD HH:mm:ss")
: "--"
res.refundTime = res.refundTime
? Util.dateFormate(res.refundTime, "YYYY-MM-DD HH:mm:ss")
: "--"
res.errorTime = res.errorTime
? Util.dateFormate(res.errorTime, "YYYY-MM-DD HH:mm:ss")
: "--"
res.revokeTime = res.revokeTime
? Util.dateFormate(res.revokeTime, "YYYY-MM-DD HH:mm:ss")
: "--"
this.detailInfo = res
}
})
}
}
}
</script>
<style lang="scss" scoped>
.form_div {
color: #333333;
padding: 20px 30px;
// border-bottom: 1px solid #eee;
// .edit-sub-title {
// font-weight: bold;
// margin-bottom: 10px;
// }
.edit-sub-block {
// padding: 0 10px;
.el-form-item {
width: 100%;
margin-bottom: 0px;
}
.itemDiv {
display: flex;
.halfItem {
width: 50%;
}
}
.detail-txt {
display: inline-block;
width: 200px;
vertical-align: bottom;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
::v-deep .el-form-item__content {
max-width: calc(100% - 110px);
word-break: break-all;
}
}
.edit-sub-block-two {
.el-form-item {
// width: 300px;
margin-bottom: 0px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="detail-wrap">
<d2-container class="point-list">
<div class="detail-tabs">
<div
class="detail-tabs-item"
v-for="(item, index) in list"
:key="index"
>
<div class="title">{{ item.title }}</div>
<div class="score">
{{ detailObj[item.key] ||detailObj[item.key]==0? detailObj[item.key] : "--" }}
</div>
</div>
</div>
<div class="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header
:title="'积分明细列表'"
:title-class-name="'tableHeaderTitle'"
>
<el-button size="small" type="primary" @click="handleExport"> 导出 </el-button>
</d2-table-header>
<d2-table
ref="pointTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
<div slot="auth-button" slot-scope="scope">
<!-- 查看 -->
<el-button type="text" @click="handleDetail(scope.scope)"
>详情</el-button
>
</div>
</d2-table>
<!-- 详细信息 -->
<point-detail-dialog
:visible.sync="detailVisible"
v-if="detailVisible"
:id="recordInfo.id"
/>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { getDetailList, exportDetailScore } from "@api/point"
import pointDetailDialog from "./components/pointDetailDialog"
export default {
components: {
pointDetailDialog
},
data() {
return {
detailVisible: false,
recordInfo: {},
searchForm: {
infoName: "",
rewardTime: []
},
searchFormSearch: {},
list: [
{
title: "当前积分",
key: "currentScore"
},
{
title: "累计收益积分",
key: "totalRewardScore"
},
{
title: "累计兑换积分",
key: "totalWithdrawalScore"
}
],
showFormData: [
{
label: "积分类型",
name: "infoName",
type: "select",
optionId: "confId",
optionLabel: "confLabel",
optionsName: "infoNameList"
},
{
label: "积分变化时间",
name: "rewardTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
}
],
getListApi: getDetailList,
baseData: {
infoNameList: [
{
confId: "积分收益",
confLabel: "积分收益"
},
{
confId: "积分兑换",
confLabel: "积分兑换"
},
{
confId: "退款抵扣",
confLabel: "退款抵扣"
},
{
confId: "撤单抵扣",
confLabel: "撤单抵扣"
},
{
confId: "错单抵扣",
confLabel: "错单抵扣"
}
]
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
tableColumns: [
{
label: "积分类型",
prop: "infoName"
},
{
label: "积分明细",
prop: "rewardScore",
formatter: (cell) => {
return cell.rewardScore
? (cell.type == 0 ? "+" : "-") + cell.rewardScore
: "--"
}
},
{
label: "当前积分",
prop: "finalTotalScore"
},
{
label: "变化前积分",
prop: "currentTotalScore"
},
{
label: "积分变化时间",
prop: "updatedTime",
formatter: (cell) => {
return Util.dateFormate(cell.updatedTime, "YYYY-MM-DD HH:mm:ss")
}
}
]
}
}
},
created() {
this.detailObj = this.$route.query
console.log(this.detailObj)
this.getOptionsList()
},
methods: {
// 导出
handleExport() {
let params = {
...this.searchFormSearch,
currentPage: 1,
pageSize: 9999
}
exportDetailScore(params).then((res) => {
console.log(res)
this.$open(res.data)
})
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.rewardTime&&this.searchFormSearch.rewardTime.length) {
this.searchFormSearch.rewardTimeBegin =
Util.dateFormate(
this.searchFormSearch.rewardTime[0],
"YYYY-MM-DD"
) + " 00:00:00"
this.searchFormSearch.rewardTimeEnd =
Util.dateFormate(
this.searchFormSearch.rewardTime[1],
"YYYY-MM-DD"
) + " 23:59:59"
}
delete this.searchFormSearch.rewardTime
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
// 查看详情
handleDetail(data) {
this.recordInfo = data
this.detailVisible = true
},
handleSearch() {
this.$refs.pointTable.refreshTable()
},
handleReset() {
this.searchForm = {
infoName: "",
rewardTime: []
}
this.searchFormSearch = {}
this.$refs.pointTable.refreshTable(true, true)
}
}
}
</script>
<style lang="scss" scoped>
.d2-container-content {
::v-deep {
.tableHeaderTitle {
font-weight: 500;
font-size: 16px;
color: #333333;
}
}
}
.detail-wrap {
margin: 16px 24px;
.detail-tabs {
width: 100%;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-around;
padding: 20px 16px;
box-sizing: border-box;
margin-bottom: 16px;
.detail-tabs-item {
flex: 1;
height: 104px;
background: #f8faff;
border-radius: 5px;
padding: 20px;
box-sizing: border-box;
margin-right: 16px;
.title {
font-size: 16px;
color: #333333;
}
.score {
font-weight: 700;
font-size: 28px;
color: #185efe;
line-height: 42px;
}
}
}
}
</style>
\ No newline at end of file
<template>
<d2-container class="point-list">
<div class="header" slot="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header
:title="'积分明细列表'"
:title-class-name="'tableHeaderTitle'"
>
<auth-button category="Button" :show-btn-ids="['9140202']" />
</d2-table-header>
<d2-table
ref="pointTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
>
<div slot="auth-button" slot-scope="scope">
<!-- 查看 -->
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9140201']" />
</span>
</div>
</d2-table>
</div>
</d2-container>
</template>
<script>
import { getScorePage, getShopMerchantList,exportScore } from "@api/point"
export default {
data() {
return {
searchForm: {
staffName: "",
staffPhone: "",
merchantId: ""
},
getListApi: getScorePage,
showFormData: [
{
label: "员工名称",
name: "staffName",
type: "input",
isClear: true
},
{
label: "员工手机号",
name: "staffPhone",
type: "input",
isClear: true
},
{
label: "门店名称",
name: "merchantId",
type: "select",
optionList: [],
optionId: "merchantId",
optionLabel: "merchantName",
optionsName: "merchantServiceList"
}
],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
tableColumns: [
{
label: "门店名称",
prop: "merchantName"
},
{
label: "员工名称",
prop: "staffName"
},
{
label: "员工手机号",
prop: "staffPhone"
},
{
label: "当前积分",
prop: "currentScore"
},
{
label: "累计收益积分",
prop: "totalRewardScore"
},
{
label: "累计兑换积分",
prop: "totalWithdrawalScore"
}
]
},
baseData: {
merchantServiceList: []
}
}
},
mounted() {
getShopMerchantList({}).then((res) => {
this.baseData.merchantServiceList = res
this.getOptionsList()
})
},
methods: {
// 导出
handleExport() {
let params = {
...this.searchForm,
currentPage: 1,
pageSize: 9999
}
exportScore(params).then((res) => {
console.log(res)
this.$open(res.data)
})
},
handleDetail(data) {
this.$router.push({
name: "pointDetail",
query: data
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
handleSearch() {
this.$refs.pointTable.refreshTable()
},
handleReset() {
this.searchForm = {
staffName: "",
staffPhone: "",
merchantId: ""
}
this.$refs.pointTable.refreshTable(true, true)
}
}
}
</script>
<style scoped lang="scss">
.d2-container-content {
::v-deep {
.tableHeaderTitle {
font-weight: 500;
font-size: 16px;
color: #333333;
}
}
}
</style>
\ 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!