Commit b6b36fd7 by wangzhihui

```

feat(api): 增加积分调整相关API接口

- 添加手动积分增加、减少功能
- 新增验证码获取、管理员查询等接口
- 增加手机号变更及操作记录查询功能
- 添加批量导入功能

refactor(components): 重构对话框组件代码格式

- 更新relateProDialog.vue和glsk-form-dialog/index.vue的代码风格
- 统一代码缩进和格式规范
- 优化组件结构和属性排序

style(api): 格式化point.js文件注释和语句结尾

- 修复注释中缺少空格的问题
- 统一所有函数调用的语句结尾格式
- 规范代码格式以提高可读性
```
1 parent 131bc7f6
import request from "./request" import request from "./request";
// const path = 'dj.api.' // const path = 'dj.api.'
const path2 = "dj.api.smartcarlife." const path2 = "dj.api.smartcarlife.";
/** 积分管理-积分审批列表*/ /** 积分管理-积分审批列表 */
export function getList(data) { export function getList(data) {
data.method = `${path2}staff.motivation.page` data.method = `${path2}staff.motivation.page`;
return request(data) return request(data);
} }
/** 积分管理-积分审批*/ /** 积分管理-积分审批 */
export function pointCheck(data) { export function pointCheck(data) {
data.method = `${path2}staff.motivation.audit` data.method = `${path2}staff.motivation.audit`;
return request(data) return request(data);
} }
/**积分管理-积分审批列表导出*/ /** 积分管理-积分审批列表导出 */
export function exportFile(data) { export function exportFile(data) {
data.method = `${path2}staff.motivation.list.export` data.method = `${path2}staff.motivation.list.export`;
return request(data) return request(data);
} }
/**积分管理-积分审批详情*/ /** 积分管理-积分审批详情 */
export function getPointDetail(data) { export function getPointDetail(data) {
data.method = `${path2}staff.motivation.detail` data.method = `${path2}staff.motivation.detail`;
return request(data) return request(data);
} }
/**积分管理-积分明细列表*/ /** 积分管理-积分明细列表 */
export function getScorePage(data) { export function getScorePage(data) {
data.method = `${path2}staff.score.page` data.method = `${path2}staff.score.page`;
return request(data) return request(data);
} }
/**积分管理-积分明细列表导出*/ /** 积分管理-积分明细列表导出 */
export function exportScore(data) { export function exportScore(data) {
data.method = `${path2}staff.score.export` data.method = `${path2}staff.score.export`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益列表 // 积分管理-积分明细收益列表
export function getDetailList(data) { export function getDetailList(data) {
data.method = `${path2}staff.score.detail.list` data.method = `${path2}staff.score.detail.list`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益列表导出 // 积分管理-积分明细收益列表导出
export function exportDetailScore(data) { export function exportDetailScore(data) {
data.method = `${path2}staff.score.detail.list.export` data.method = `${path2}staff.score.detail.list.export`;
return request(data) return request(data);
} }
// 积分管理-积分明细收益记录详情 // 积分管理-积分明细收益记录详情
export function getScoreDetail(data) { export function getScoreDetail(data) {
data.method = `${path2}staff.score.detail` data.method = `${path2}staff.score.detail`;
return request(data) return request(data);
} }
export function getShopMerchantList(data) { export function getShopMerchantList(data) {
data.method = `dj.smartcarlife.api.shopMerchant.list` data.method = `dj.smartcarlife.api.shopMerchant.list`;
return request(data, "post") return request(data, "post");
} }
//订单阳光激励标记退款 // 订单阳光激励标记退款
export function markAsRefunded(data) { export function markAsRefunded(data) {
data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded` data.method = `dj.api.smartcarlife.goodsOrder.points.markAsRefunded`;
return request(data) return request(data);
} }
//积分管理-手动抵扣 // 积分管理-手动抵扣
export function manualDeduct(data) { export function manualDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.manual.deduct` data.method = `dj.api.smartcarlife.staff.score.manual.deduct`;
return request(data) return request(data);
} }
// 查询可手动抵扣的订单列表 // 查询可手动抵扣的订单列表
export function deductOrderPage(data) { export function deductOrderPage(data) {
data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page` data.method = `dj.api.smartcarlife.merchant.score.deduct.order.page`;
return request(data) return request(data);
} }
// 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】 // 积分管理-撤销抵扣【参数:scoreId(必传)、remark、orderCode】
export function cancelDeduct(data) { export function cancelDeduct(data) {
data.method = `dj.api.smartcarlife.staff.score.cancel.deduct` data.method = `dj.api.smartcarlife.staff.score.cancel.deduct`;
return request(data) return request(data);
} }
// 积分审批列表同步 // 积分审批列表同步
export function refreshData(data) { export function refreshData(data) {
data.method = `dj.api.smartcarlife.staff.motivation.page.sync` data.method = `dj.api.smartcarlife.staff.motivation.page.sync`;
return request(data) return request(data);
} }
//查询指定订单的操作记录 // 查询指定订单的操作记录
export function getOperationRecord(data) { export function getOperationRecord(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.operation` data.method = `dj.api.smartcarlife.staff.motivation.order.operation`;
return request(data) return request(data);
} }
//根据订单号查询剩余积分 // 根据订单号查询剩余积分
// export function getScoreByscore(data) { // export function getScoreByscore(data) {
// data.method = `dj.api.smartcarlife.staff.motivation.order.score` // data.method = `dj.api.smartcarlife.staff.motivation.order.score`
// return request(data) // return request(data)
// } // }
//获取到总积分 // 获取到总积分
export function getOrderByScore(data) { export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score` data.method = `dj.api.smartcarlife.staff.motivation.order.score`;
return request(data) return request(data);
} }
/** 积分退款订单详情查询 */ /** 积分退款订单详情查询 */
export function getGoodsSubOrder(data) { export function getGoodsSubOrder(data) {
data.method = 'dj.api.smartcarlife.goodsOrder.goodsSubOrder.list'
return request(data)
}
\ No newline at end of file \ No newline at end of file
data.method = "dj.api.smartcarlife.goodsOrder.goodsSubOrder.list";
return request(data);
}
/** 积分调整 -积分增加 */
export function manualAdd(data) {
data.method = "dj.api.smartcarlife.staff.score.manual.add";
return request(data);
}
/** 积分调整-积分减少 */
export function manualSubtract(data) {
data.method = "dj.api.smartcarlife.staff.score.manual.subtract";
return request(data);
}
/** 验证码 */
export function getSms(data) {
data.method = "dj.api.smartcarlife.staff.score.admin.sms";
return request(data);
}
/* 获取管理员 */
export function getAdmin(data = {}) {
data.method = "dj.api.smartcarlife.staff.score.getAdmin";
return request(data);
}
/** 变更手机号 */
export function changePhone(data) {
data.method = "dj.api.smartcarlife.staff.score.change.phone";
return request(data);
}
/** 积分审批 */
export function motivationAudit(data) {
data.method = "dj.api.smartcarlife.staff.motivation.audit";
return request(data);
}
/** 更改手机号操作记录 */
export function changePhoneRecord(data = {}) {
data.method = "dj.api.smartcarlife.staff.score.change.phone.list";
return request(data);
}
// 批量导入
export function governingImport(data) {
data.method = `dj.api.smartcarlife.staff.score.manual.import`;
return request(data, "post", ["file"]);
}
<!-- 通用表单弹窗组件 --> <!-- 通用表单弹窗组件 -->
<template> <template>
<div class="glsk-form-dialog"> <div class="glsk-form-dialog">
<d2-dialog <d2-dialog :append-to-body="appendToBody"
:title="dialogConfig.title" :btn-ok-label="dialogConfig.okText"
:is-visible="selectVisible" :is-visible="selectVisible"
:width="dialogWidth" :title="dialogConfig.title"
:btn-ok-label="dialogConfig.okText" :width="dialogWidth"
@closeDialog="handleClose" @closeDialog="handleClose"
:appendToBody="appendToBody" @confirmDialog="handleConfirm">
@confirmDialog="handleConfirm" <glsx-combi-form ref="editFormRef"
> class="edit-form-container"
<glsx-combi-form :default-width="defaultWidth"
class="edit-form-container" :form-data="editFormData"
ref="editFormRef" :form-obj="editData"
:label-width="labelWidth" :form-ref="editChildRef"
:default-width="defaultWidth" :form-rules="formRules"
:is-block="isBlock" :is-block="isBlock"
:form-ref="editChildRef" :label-width="labelWidth"
:form-obj="editData" @handleAddSelectTypeConfirm="handleAddSelectTypeConfirm"
:form-data="editFormData" @handleEditSelectTypeConfirm="handleEditSelectTypeConfirm">
:form-rules="formRules" <template v-for="name in slotArr" #[name]>
@handleAddSelectTypeConfirm="handleAddSelectTypeConfirm" <slot :name="name"></slot>
@handleEditSelectTypeConfirm="handleEditSelectTypeConfirm" </template>
> </glsx-combi-form>
<template v-for="name in slotArr" #[name]> </d2-dialog>
<slot :name="name"></slot> </div>
</template>
</glsx-combi-form>
</d2-dialog>
</div>
</template> </template>
<script> <script>
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util";
export default { export default {
name: "GlskFormDialog", name: "GlskFormDialog",
data() {
return {
isBlock: true,
editChildRef: "editChildRef"
}
},
props: { props: {
slotArr: { slotArr: {
type: Array, type: Array,
default: () => ["resumeUrlHtml"] default: () => ["resumeUrlHtml"],
}, },
dialogWidth: { dialogWidth: {
type: String, type: String,
default: "700px" default: "700px",
}, },
labelWidth: { labelWidth: {
type: String, type: String,
default: "100px" default: "100px",
}, },
defaultWidth: { defaultWidth: {
type: String, type: String,
default: "314px" default: "314px",
}, },
dialogConfig: { dialogConfig: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
title: "提示", title: "提示",
okText: "确定" okText: "确定",
} };
} },
}, },
selectVisible: { selectVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
formRules: { formRules: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
editData: { editData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
editFormData: { editFormData: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
baseData: { baseData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
appendToBody: { appendToBody: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
data() {
return {
isBlock: true,
editChildRef: "editChildRef",
};
},
mounted() { mounted() {
this.getOptionsList("editFormData", false) this.getOptionsList("editFormData", false);
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find((k) => k.name == refreshSigle) let item = this[formName].find(k => k.name == refreshSigle);
var index = this[formName].findIndex((k) => k.name == refreshSigle) let index = this[formName].findIndex(k => k.name == refreshSigle);
this.$set( this.$set(
this[formName][index], this[formName][index],
"optionList", "optionList",
deepClone(this.baseData[item.optionsName]) deepClone(this.baseData[item.optionsName]),
) );
if ( if (
hasAll && hasAll
this.baseData[item.optionsName].length && && this.baseData[item.optionsName].length
this.baseData[item.optionsName][0][ && this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {};
temp[this[formName][index].optionId] = "" temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部" temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp) this[formName][index].optionList.unshift(temp);
} }
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if ( if (
["select", "radio"].includes(item.type) && ["select", "radio"].includes(item.type)
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length
) { ) {
this.$set( this.$set(
this[formName][index], this[formName][index],
"optionList", "optionList",
deepClone(this.baseData[item.optionsName]) deepClone(this.baseData[item.optionsName]),
) );
if ( if (
hasAll && hasAll
this.baseData[item.optionsName].length && && this.baseData[item.optionsName].length
this.baseData[item.optionsName][0][ && this.baseData[item.optionsName][0][
this[formName][index].optionLabel this[formName][index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {};
temp[this[formName][index].optionId] = "" temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部" temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp) this[formName][index].optionList.unshift(temp);
} }
} }
}) });
} }
}, },
handleConfirm() { handleConfirm() {
console.log(this.editFormData, this.editData) console.log(this.editFormData, this.editData);
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => { this.$refs.editFormRef.$refs[this.editChildRef].validate((valid) => {
if (valid) { if (valid) {
this.$emit("handleConfirm", this.editData) this.$emit("handleConfirm", this.editData);
} }
}) });
}, },
handleAddSelectTypeConfirm(data) { handleAddSelectTypeConfirm(data) {
this.$emit("handleAddSelectTypeConfirm", data) this.$emit("handleAddSelectTypeConfirm", data);
}, },
handleEditSelectTypeConfirm(data) { handleEditSelectTypeConfirm(data) {
this.$emit("handleEditSelectTypeConfirm", data) this.$emit("handleEditSelectTypeConfirm", data);
}, },
handleClose() { handleClose() {
this.$emit("handleClose") this.$emit("handleClose");
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.glsk-form-dialog { .glsk-form-dialog {
::v-deep { ::v-deep {
.el-dialog__header { .el-dialog__header {
border-bottom: 1px solid #e5e5e5 !important; border-bottom: 1px solid #e5e5e5 !important;
} }
} }
::v-deep { ::v-deep {
.el-dialog__footer { .el-dialog__footer {
border-top: 1px solid #e5e5e5 !important; border-top: 1px solid #e5e5e5 !important;
.el-button { .el-button {
width: 80px; width: 80px;
} }
} }
} }
} }
</style> </style>
const _import = require("@/libs/util.import." + process.env.NODE_ENV) const _import = require("@/libs/util.import." + process.env.NODE_ENV);
export const routerName = { export const routerName = {
914: { 914: {
path: "/pointManagement", path: "/pointManagement",
name: "pointManagement", name: "pointManagement",
meta: { meta: {
title: "积分管理", title: "积分管理",
authId: "914", authId: "914",
parentId: "1", parentId: "1",
cache: false cache: false,
} },
}, },
91401: { 91401: {
path: "/pointExamine", path: "/pointExamine",
name: "pointExamine", name: "pointExamine",
meta: { meta: {
title: "积分审批", title: "积分审批",
authId: "91401", authId: "91401",
parentId: "914", parentId: "914",
cache: false cache: false,
}, },
auth: [ auth: [
{ {
authId: "9140101", authId: "9140101",
parentId: "91401", parentId: "91401",
label: "审核", label: "审核",
handle: "handleCheck" handle: "handleCheck",
}, },
{ {
authId: "9140104", authId: "9140104",
parentId: "91401", parentId: "91401",
label: "标记退款", label: "标记退款",
handle: "openRefundDetail" handle: "openRefundDetail",
}, },
{ {
authId: "9140102", authId: "9140102",
parentId: "91401", parentId: "91401",
label: "查看", label: "查看",
handle: "handleDetail" handle: "handleDetail",
}, },
{ {
authId: "9140103", authId: "9140103",
parentId: "91401", parentId: "91401",
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", handle: "handleExport",
handle: "handleExport" },
}, {
{ authId: "9140105",
authId: "9140105", parentId: "91401",
parentId: "91401", label: "刷新",
label: "刷新", category: "Button",
category: "Button", handle: "handleRefresh",
type: "primary", },
handle: "handleRefresh" {
} authId: "9140106",
], parentId: "91401",
component: _import("pointManagement/pointExamine") label: "一键审批",
}, category: "Button",
91402: { type: "primary",
path: "/pointParticulars", handle: "handleApproveAll",
name: "pointParticulars", },
meta: { {
title: "积分明细", authId: "9140107",
authId: "91402", parentId: "91401",
parentId: "914", label: "审批",
cache: false handle: "handleApproveAll",
}, },
auth: [ ],
{ component: _import("pointManagement/pointExamine"),
authId: "9140201", },
parentId: "91402", 91402: {
label: "明细", path: "/pointParticulars",
handle: "handleDetail", name: "pointParticulars",
addRoutePath: [ meta: {
{ title: "积分明细",
authId: "91403", authId: "91402",
name: "详情", parentId: "914",
parentId: "91402" cache: false,
} },
] auth: [
}, {
authId: "9140201",
parentId: "91402",
label: "明细",
handle: "handleDetail",
addRoutePath: [
{
authId: "91403",
name: "详情",
parentId: "91402",
},
],
},
{
authId: "9140205",
parentId: "91402",
label: "更换手机号",
handle: "handleChangePhone",
},
{ {
authId: "9140202", authId: "9140202",
parentId: "91402", parentId: "91402",
label: "导出", label: "导出",
category: "Button", category: "Button",
type: "primary", handle: "handleExport",
handle: "handleExport" },
}, {
{ authId: "9140204",
authId: "9140203", parentId: "91402",
parentId: "91402", label: "批量积分调整",
label: "新增", category: "Button",
handle: "handleDetail", type: "primary",
addRoutePath: [ handle: "handleGoverning",
{ },
authId: "91404", {
name: "新增手动抵扣", authId: "9140203",
parentId: "91402" parentId: "91402",
} label: "新增",
] handle: "handleDetail",
} addRoutePath: [
], {
component: _import("pointManagement/pointParticulars") authId: "91404",
}, name: "新增手动抵扣",
91403: { parentId: "91402",
path: "/pointDetail", },
name: "pointDetail", ],
meta: { },
title: "详情", ],
authId: "91403", component: _import("pointManagement/pointParticulars"),
parentId: "91402", },
cache: false, 91403: {
activePath: "/pointParticulars" path: "/pointDetail",
}, name: "pointDetail",
component: _import("pointManagement/pointDetail") meta: {
}, title: "详情",
//新增抵扣 authId: "91403",
91404: { parentId: "91402",
path: "/deduction", cache: false,
name: "deduction", activePath: "/pointParticulars",
meta: { },
title: "新增抵扣", component: _import("pointManagement/pointDetail"),
authId: "91403", },
parentId: "91402", // 新增抵扣
cache: false, 91404: {
activePath: "/pointParticulars" path: "/deduction",
}, name: "deduction",
component: _import("pointManagement/addDeduction") meta: {
} title: "新增抵扣",
} authId: "91403",
parentId: "91402",
cache: false,
activePath: "/pointParticulars",
},
component: _import("pointManagement/addDeduction"),
},
};
<!-- 积分调整 -->
<template>
<d2-dialog btn-ok-label="提交审核"
class="adjustDialog"
:is-visible.sync="visible"
title="积分调整"
width="640px"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div class="tip-text">
提交审核通过后,积分将自动更新
</div>
<glsx-combi-form ref="editFormRef"
class="edit-form-container"
:default-width="defaultWidth"
:form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth">
<template #scoreHtml>
<div class="scroe-wrap">
<el-input v-model="editData.score"
placeholder="请输入"
:prefix-icon="prefixIcon"
style="width: 136px;">
</el-input>
</div>
</template>
<template #captcha>
<div class="captcha-wrap">
<el-input v-model="editData.captcha"
placeholder="请输入"
style="width: 338px;">
</el-input>
<div class="captcha-text" @click.prevent="getCode">
{{ !isCodeDisabled ? '获取验证码' : `${count}s` }}
</div>
</div>
</template>
</glsx-combi-form>
</d2-dialog>
</template>
<script>
// import { limitPrice } from "@/common/format";
import { getAdmin, getSms, manualAdd, manualSubtract } from "@/api/point";
import { deepClone, Util } from "@/common/util";
export default {
name: "AdjustDialog",
props: {
visible: {
type: Boolean,
default: false,
},
infoData: {
type: Object,
default: () => {},
},
},
data() {
return {
prefixIcon: "el-icon-plus",
labelWidth: "110px",
editChildRef: "editChildRef",
isBlock: true,
defaultWidth: "338px",
isCodeDisabled: false,
count: "",
timer: null,
editData: {
type: 1,
score: "",
captcha: "",
phone: "",
orderCode: "",
admin: "",
},
editFormData: [
{
label: "积分变更",
name: "type",
type: "radio",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "pointChangeOpt",
handleRadioChange: (val) => {
this.prefixIcon = val === 1 ? "el-icon-plus" : "el-icon-minus";
},
},
{
label: "",
name: "score",
addHtml: "scoreHtml",
style: {
marginLeft: "110px",
},
},
{
label: "关联订单编号",
name: "orderCode",
type: "input",
maxlength: "20",
placeholder: "请输入",
isClear: true,
},
{
label: "管理员",
name: "admin",
type: "select",
optionsName: "adminList",
optionId: "adminId",
optionLabel: "adminName",
changeAttr: (val) => {
this.editData.phone = val;
this.isCodeDisabled = false;
clearInterval(this.timer);
this.timer = null;
this.editData.captcha = "";
},
},
{
label: "验证码",
addHtml: "captcha",
name: "captcha",
},
{
label: "备注",
name: "remark",
type: "input",
inputType: "textarea",
maxlength: "200",
width: "436px",
rows: 4,
showLimit: true,
},
],
formRules: {
orderCode: [{ required: true, message: "请输入关联订单编号", trigger: "blur" }],
score: [
{ required: true, message: "请输入积分", trigger: "blur" },
{
validator(rule, value, callback) {
if (value === "" || value === null || value === undefined) {
callback(new Error("请输入积分"));
return;
}
const str = String(value).trim();
// 仅允许:0 或非0开头的整数,且可选最多两位小数
const pattern = /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/;
if (!pattern.test(str)) {
callback(new Error("积分必须为非负数,最多保留两位小数"));
return;
}
const num = Number(str);
if (!isFinite(num) || num < 0) {
callback(new Error("积分必须为非负数"));
return;
}
callback();
},
trigger: ["blur", "change"],
},
],
captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }, {
validator(rule, value, callback) {
const str = String(value || "").trim();
if (str === "") {
// 空值交给 required 规则处理
callback();
return;
}
if (!/^\d+$/.test(str)) {
callback(new Error("验证码只能输入数字"));
return;
}
callback();
},
trigger: ["blur", "change"],
}],
admin: [{ required: true, message: "请选择管理员", trigger: "change" }],
remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
},
baseData: {
pointChangeOpt: [
{
confId: 1,
confValue: "积分增加",
},
{
confId: 2,
confValue: "积分减少",
},
],
},
};
},
created() {
this.getAdminData();
},
methods: {
getAdminData() {
getAdmin().then((res) => {
if (res) {
this.baseData.adminList = res.map((item) => {
return {
adminId: `${item.phone}`,
adminName: `${item.name} ${item.phone}`,
name: item.name,
phone: item.phone,
};
});
this.getOptionsList(this, "editFormData", false);
if (this.baseData.adminList.length == 0) {
this.editData.admin = "";
this.editData.phone = "";
} else {
this.editData.admin = this.baseData.adminList[0].adminId;
this.editData.phone = this.baseData.adminList[0].phone;
}
}
});
},
getCode() {
if (!this.editData.phone) {
this.$message.error("请选择管理员");
return;
}
if (this.isCodeDisabled)
return;
if (!this.timer) {
this.count = 60;
getSms({
phone: this.editData.phone,
})
.then((res) => {
console.log(res, "res");
if (res) {
this.$message.success("短信验证码发送成功");
this.isCodeDisabled = true;
this.timer = setInterval(() => {
if (this.count > 0 && this.count <= 60) {
this.count--;
} else {
this.isCodeDisabled = false;
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
} else {
this.$message.error(res.message);
}
});
}
},
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid1) => {
console.log(valid1);
if (valid1) {
let Methods = this.editData.type === 1 ? manualAdd : manualSubtract;
let params = {
phone: this.editData.phone,
score: this.editData.score,
orderCode: this.editData.orderCode,
remark: this.editData.remark,
captcha: this.editData.captcha,
merchantId: this.infoData.merchantId,
staffPhone: this.infoData.staffPhone,
};
Methods(params).then((res) => {
if (res) {
this.$message.success("积分调整成功");
this.$emit("handleConfirm");
}
});
}
});
},
handleClose() {
this.$emit("handleClose");
},
getOptionsList(that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = that[formName].find(k => k.name == refreshSigle);
let index = that[formName].findIndex(k => k.name == refreshSigle);
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
} else {
that[formName].forEach((item, index) => {
if (
that.baseData[item.optionsName]?.length
) {
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
}
});
}
},
},
};
</script>
<style scoped lang="scss">
.adjustDialog {
::v-deep {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
.el-dialog__footer {
border-top: 1px solid #e5e5e5;
}
.el-input__count {
right: 12px;
bottom: 1px;
}
}
}
.tip-text {
border-radius: 4px;
background: #f7f7f7;
color: #333333;
font-size: 14px;
padding: 8px 0;
text-align: center;
margin-bottom: 26px;
margin-top: -10px;
}
.captcha-wrap {
.captcha-text {
font-size: 12px;
color: #2a58ad;
position: absolute;
right: 0;
top: 2px;
margin-right: 10px;
cursor: pointer;
width: 100px;
height: 32px;
text-align: right;
}
}
</style>
<!-- 批量积分调整审批 -->
<template>
<d2-dialog btn-ok-label="提交审核"
class="adjustDialog"
:is-visible.sync="visible"
:title="dataInfo && dataInfo.id ? '积分调整审批' : '批量积分调整审批'"
width="640px"
@closeDialog="handleClose"
@confirmDialog="handleConfirm">
<div class="tip-text">
审批通过后,将更新对应人员积分了;<br />
审核驳回后,不更新对应人员积分,需要新提交审核
</div>
<glsx-combi-form ref="editFormRef"
class="edit-form-container"
:default-width="defaultWidth"
:form-data="editFormData"
:form-obj="editData"
:form-ref="editChildRef"
:form-rules="formRules"
:is-block="isBlock"
:label-width="labelWidth">
</glsx-combi-form>
</d2-dialog>
</template>
<script>
import { motivationAudit } from "@/api/point";
import { deepClone } from "@/common/util";
export default {
name: "AdjustDialog",
props: {
visible: {
type: Boolean,
default: false,
},
dataInfo: {
type: Object,
default: () => {},
},
},
data() {
return {
title: "",
labelWidth: "110px",
editChildRef: "editChildRef",
isBlock: true,
defaultWidth: "338px",
isCodeDisabled: false,
count: "",
timer: null,
editData: {
auditResult: 0,
operatorRemark: "",
},
editFormData: [
{
label: "审核结果",
name: "auditResult",
type: "radio",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "approveOpt",
handleRadioChange: (val) => {
},
},
{
label: "备注",
name: "operatorRemark",
type: "input",
inputType: "textarea",
maxlength: "200",
width: "436px",
rows: 4,
showLimit: true,
},
],
formRules: {
auditResult: [{ required: true, message: "请选择审核结果", trigger: "change" }],
operatorRemark: [{ required: true, message: "请输入备注", trigger: "blur" }],
},
baseData: {
approveOpt: [
{
confId: 0,
confValue: "审核通过",
},
{
confId: 1,
confValue: "审核驳回",
},
],
},
};
},
mounted() {
this.getOptionsList(this, "editFormData", false);
},
methods: {
handleConfirm() {
this.$refs.editFormRef.$refs[this.editChildRef].validate((valid1) => {
console.log(valid1);
if (valid1) {
let params = {
auditResult: this.editData.auditResult,
operatorRemark: this.editData.operatorRemark,
};
if (this.dataInfo && this.dataInfo.id) {
params.id = this.dataInfo.id;
}
motivationAudit(params).then((res) => {
if (res) {
this.$message.success("操作成功");
this.$emit("handleConfirm");
}
});
}
});
},
handleClose() {
this.$emit("handleClose");
},
getOptionsList(that, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = that[formName].find(k => k.name == refreshSigle);
let index = that[formName].findIndex(k => k.name == refreshSigle);
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
} else {
that[formName].forEach((item, index) => {
if (
that.baseData[item.optionsName]?.length
) {
that.$set(
that[formName][index],
"optionList",
deepClone(that.baseData[item.optionsName]),
);
if (
hasAll
&& that.baseData[item.optionsName].length
&& that.baseData[item.optionsName][0][
that[formName][index].optionLabel
] !== "全部"
) {
const temp = {};
temp[that[formName][index].optionId] = "";
temp[that[formName][index].optionLabel] = "全部";
that[formName][index].optionList.unshift(temp);
}
}
});
}
},
},
};
</script>
<style scoped lang="scss">
.adjustDialog {
::v-deep {
.el-dialog__header {
border-bottom: 1px solid #e5e5e5;
}
.el-dialog__footer {
border-top: 1px solid #e5e5e5;
}
.el-input__count {
right: 12px;
bottom: 1px;
}
}
}
.tip-text {
border-radius: 4px;
background: #f7f7f7;
color: #333333;
font-size: 14px;
padding: 8px 0;
text-align: center;
margin-bottom: 26px;
margin-top: -10px;
}
</style>
<template> <template>
<el-dialog title="请选择退款明细" :visible.sync="refundVisible" :before-close="handleClose" <el-dialog :before-close="handleClose"
:close-on-click-modal="false" width="70%" class="relateStore"> class="relateStore"
<div> :close-on-click-modal="false"
<el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange" title="请选择退款明细"
@select-all="handleAll"> :visible.sync="refundVisible"
<el-table-column :selectable="selectableFn" type="selection" width="55" align="center" /> width="70%">
<template v-for="item in tableColumn"> <div>
<el-table-column :prop="item.prop" :label="item.label" align="center"> <el-table ref="seletingTable"
<span slot-scope="scope"> border
{{ scope.row[item.prop] ? item.unit ? item.unit + scope.row[item.prop] : scope.row[item.prop] : "-" }} class="table"
:data="tableData"
@select="handleChange"
@select-all="handleAll">
<el-table-column align="center"
:selectable="selectableFn"
type="selection"
width="55" />
<template v-for="item in tableColumn">
<el-table-column align="center"
:label="item.label"
:prop="item.prop">
<template #default="scope">
<span>
{{ scope.row[item.prop] ? item.unit ? item.unit + scope.row[item.prop] : scope.row[item.prop] : "-" }}
</span>
</template>
</el-table-column>
</template>
</el-table>
<div class="total">
可选可退总价:<div class="price">
¥{{ total }}
</div>
</div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button :disabled="!refundSubOrderCode"
type="primary"
@click="handleConfirm">
下一步
</el-button>
</span> </span>
</el-table-column>
</template> </template>
</el-table> </el-dialog>
<div class="total">可选可退总价:<div class="price">¥{{ total }}</div></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleConfirm" :disabled="!refundSubOrderCode">下一步</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
import { getGoodsSubOrder } from "@api/point" import { getGoodsSubOrder } from "@api/point";
export default { export default {
name: 'refundDetail', name: "RefundDetail",
data() { props: {
return { refundVisible: {
tableData: [], type: Boolean,
tableColumn: [ default: false,
{ },
label: '子订单编码', dataInfo: {
prop: 'subOrderCode' type: Object,
}, default: {},
{ },
label: '商品名称', },
prop: 'goodsName' data() {
}, return {
{ tableData: [],
label: '商品别名', tableColumn: [
prop: 'goodsAlias' {
}, label: "子订单编码",
{ prop: "subOrderCode",
label: '商品ID', },
prop: 'goodsCommodityCode' {
}, label: "商品名称",
{ prop: "goodsName",
label: '分类', },
prop: 'upgradeGoodsTypeName' {
}, label: "商品别名",
{ prop: "goodsAlias",
label: '售价', },
prop: 'upgradePrice', {
unit: '¥' label: "商品ID",
}, prop: "goodsCommodityCode",
{ },
label: '数量/件', {
prop: 'number' label: "分类",
}, prop: "upgradeGoodsTypeName",
{ },
label: '支付金额', {
prop: 'totalPrice', label: "售价",
unit: '¥' prop: "upgradePrice",
} unit: "¥",
], },
total: 0, {
refundSubOrderCode: '', label: "数量/件",
refundApplyDetailList: [], prop: "number",
isAll: false, },
// 是否只有一个子订单并且未退过款的 {
isOneSubFirst: false label: "支付金额",
} prop: "totalPrice",
}, unit: "¥",
props: { },
refundVisible: { ],
type: Boolean, total: 0,
default: false refundSubOrderCode: "",
}, refundApplyDetailList: [],
dataInfo: { isAll: false,
type: Object, // 是否只有一个子订单并且未退过款的
default: {} isOneSubFirst: false,
} };
}, },
watch: { watch: {
dataInfo(val) { dataInfo(val) {
console.log(val) console.log(val);
if (val && val.orderCode) this.getList(val.orderCode) if (val && val.orderCode)
} this.getList(val.orderCode);
}, },
methods: { },
// 设置禁用 methods: {
selectableFn(row) { // 设置禁用
console.log(row) selectableFn(row) {
if (row.status == 2) return false console.log(row);
else return true if (row.status == 2)
}, return false;
async getList(orderCode) { else return true;
const res = await getGoodsSubOrder({ orderCode }) },
this.tableData = res async getList(orderCode) {
this.isOneSubFirst = this.tableData.length == 1 && this.tableData.every(item => item.status == 1) const res = await getGoodsSubOrder({ orderCode });
this.$refs.seletingTable.toggleAllSelection() this.tableData = res;
}, this.isOneSubFirst = this.tableData.length == 1 && this.tableData.every(item => item.status == 1);
handleChange(selection) { this.$refs.seletingTable.toggleAllSelection();
console.log(selection) },
this.isAll = selection.length ==this.tableData.length handleChange(selection) {
this.getParams(selection) console.log(selection);
}, this.isAll = selection.length == this.tableData.length;
handleAll(selection) { this.getParams(selection);
console.log(selection) },
this.isAll = selection.length ==this.tableData.length handleAll(selection) {
this.getParams(selection) console.log(selection);
}, this.isAll = selection.length == this.tableData.length;
getParams(selection) { this.getParams(selection);
let _total = 0 },
let _refundSubOrderCode = [] getParams(selection) {
selection.forEach(item => { let _total = 0;
_total += item.totalPrice let _refundSubOrderCode = [];
_refundSubOrderCode.push(item.subOrderCode) selection.forEach((item) => {
}) _total += item.totalPrice;
this.total = parseFloat(_total.toFixed(2)) _refundSubOrderCode.push(item.subOrderCode);
this.refundSubOrderCode = _refundSubOrderCode.join('/') });
this.refundApplyDetailList = selection this.total = Number.parseFloat(_total.toFixed(2));
console.log(this.refundSubOrderCode) this.refundSubOrderCode = _refundSubOrderCode.join("/");
}, this.refundApplyDetailList = selection;
handleConfirm() { console.log(this.refundSubOrderCode);
const {refundSubOrderCode, refundApplyDetailList, total, isAll, isOneSubFirst} = this },
this.$emit("handleConfirm", { handleConfirm() {
total, const { refundSubOrderCode, refundApplyDetailList, total, isAll, isOneSubFirst } = this;
refundSubOrderCode, this.$emit("handleConfirm", {
isAll, total,
refundApplyDetailList, refundSubOrderCode,
isOneSubFirst isAll,
}) refundApplyDetailList,
}, isOneSubFirst,
handleClose() { });
this.$emit("handleClose") },
} handleClose() {
} this.$emit("handleClose");
} },
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.total { .total {
display: flex; display: flex;
align-items: center; align-items: center;
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
.price { .price {
color: #2A58AD; color: #2a58ad;
margin-left: 10px; margin-left: 10px;
} }
} }
</style> </style>
<!-- 驳回 --> <!-- 驳回 -->
<template> <template>
<d2-dialog <d2-dialog :is-visible="visible"
title="提示" title="提示"
:is-visible="visible" @closeDialog="handleClose"
@closeDialog="handleClose" @confirmDialog="handleAddConfirm">
@confirmDialog="handleAddConfirm" <div class="reject-dialog">
> <glsx-combi-form ref="formRef"
<div class="reject-dialog"> class="edit-form-container"
<glsx-combi-form default-width="390px"
class="edit-form-container" :form-data="editFormData"
ref="formRef" :form-obj="infoForm"
label-width="112px" :form-ref="rejectRef"
default-width="390px" :form-rules="formRules"
:form-ref="rejectRef" label-width="112px">
:form-obj="infoForm" </glsx-combi-form>
:form-data="editFormData" </div>
:form-rules="formRules" </d2-dialog>
></glsx-combi-form>
</div>
</d2-dialog>
</template> </template>
<script> <script>
import { cancelDeduct, getScoreDetail } from "@api/point" import { cancelDeduct, getScoreDetail } from "@api/point";
export default { export default {
name: "RejectDialog", name: "RejectDialog",
data() {
return {
infoForm: {
remark: ""
},
dialogConfig: {
title: "提示",
width: "576px",
height: "315px"
},
rejectRef: "rejectRef",
formRules: {
// remark: [{ required: true, message: "请输入撤销原因", trigger: "blur" }]
},
editFormData: [
{
label: "撤销原因",
name: "remark",
type: "input",
maxlength: 20,
inputType: "textarea",
showLimit: true,
rows: 4
}
],
baseData: {}
}
},
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
id: { id: {
type: Number, type: Number,
default: "" default: "",
} },
}, },
computed: { data() {
isVisible: { return {
get() { infoForm: {
return this.visible remark: "",
}, },
set(newVal) {} dialogConfig: {
} title: "提示",
}, width: "576px",
height: "315px",
},
rejectRef: "rejectRef",
formRules: {
// remark: [{ required: true, message: "请输入撤销原因", trigger: "blur" }]
},
editFormData: [
{
label: "撤销原因",
name: "remark",
type: "input",
maxlength: 20,
inputType: "textarea",
showLimit: true,
rows: 4,
},
],
baseData: {},
};
},
computed: {
isVisible: {
get() {
return this.visible;
},
set(newVal) {},
},
},
mounted() {}, mounted() {},
methods: { methods: {
handleAddConfirm() { handleAddConfirm() {
this.$refs.formRef.$refs[this.rejectRef].validate(async (valid) => { this.$refs.formRef.$refs[this.rejectRef].validate(async (valid) => {
if (valid) { if (valid) {
let detailData = await getScoreDetail({ id: this.id }) let detailData = await getScoreDetail({ id: this.id });
let params = {} let params = {};
params.remark = this.infoForm.remark params.remark = this.infoForm.remark;
params.orderCode = detailData.orderCode params.orderCode = detailData.orderCode;
params.scoreId = this.id params.scoreId = this.id;
cancelDeduct(params).then((res) => { cancelDeduct(params).then((res) => {
console.log(res) console.log(res);
if (res) { if (res) {
this.$emit("handleConfirm", false) this.$emit("handleConfirm", false);
this.notice.okTips("操作成功") this.notice.okTips("操作成功");
} }
}) });
} }
}) });
}, },
handleClose() { handleClose() {
this.$emit("dialogClose", false) this.$emit("dialogClose", false);
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.reject-dialog { .reject-dialog {
margin: 21px 0 83px; margin: 21px 0 83px;
::v-deep .el-textarea__inner { ::v-deep .el-textarea__inner {
height: 70px; height: 70px;
} }
::v-deep .el-input__count { ::v-deep .el-input__count {
right: 15px !important; right: 15px !important;
bottom: 3px !important; bottom: 3px !important;
font-size: 12px; font-size: 12px;
color: #999999; color: #999999;
} }
} }
</style> </style>
\ 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!