Commit ecba3162 by wangzhihui

积分需求开发

1 parent 9f1e3aae
This diff could not be displayed because it is too large.
......@@ -46,6 +46,14 @@ export const routerName = {
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9140105",
parentId: "91401",
label: "刷新",
category: "Button",
type: "primary",
handle: "handleRefresh"
}
],
component: _import("pointManagement/pointExamine")
......
......@@ -126,6 +126,19 @@
</el-form-item></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="退款类型:" class="halfItem">
{{ detailInfo.status }}
</el-form-item></el-col
>
<el-col :span="8">
<el-form-item label="订单总积分:" class="halfItem">
{{ detailInfo.status }}
</el-form-item></el-col
>
</el-row>
</el-form>
</div>
<div class="examine-record">
......@@ -152,6 +165,23 @@
</div>
<div v-else class="empty">暂无记录</div>
</div>
<div class="examine-record">
<div class="title">操作记录</div>
<div
class="record-div"
v-if="detailInfo.operationList && detailInfo.operationList.length > 0"
>
<div
class="record-div-d"
v-for="(item, index) in detailInfo.operationList"
:key="index"
>
<div class="div-operator">操作人:{{ item.operator }}</div>
<div class="record-div-time">操作时间:{{ item.operateTime }}</div>
</div>
</div>
<div v-else class="empty">暂无记录</div>
</div>
</div>
<el-dialog
:visible="imgVisible"
......@@ -321,7 +351,11 @@ export default {
display: flex;
align-items: center;
}
.div-operator {
min-width:200px;
margin-right: 40px;
white-space: nowrap;
}
&-remark {
display: inline-block;
margin-left: 8px;
......@@ -427,7 +461,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
margin-top:20px;
margin-top: 20px;
}
</style>
......
......@@ -30,10 +30,16 @@
<!-- <el-button type="primary" size="mini" @click="handleExport">
导出
</el-button> -->
<auth-button category="Button" :show-btn-ids="['9140103']" />
<div>
<span style="margin-right: 10px"
><auth-button category="Button" :show-btn-ids="['9140105']"
/></span>
<auth-button category="Button" :show-btn-ids="['9140103']" />
</div>
</div>
<d2-table
v-if="show"
ref="pointTable"
:search-form="searchFormSearch"
:table-params="tableParams"
......@@ -61,11 +67,11 @@
:show-btn-ids="['9140101']"
v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1"
/>
<auth-button
:data="scope.scope"
:show-btn-ids="['9140104']"
v-if="scope.scope.status == 1&&scope.scope.pointsRefundAvailable=='Y'"
/>
<!-- v-if="
scope.scope.status == 1 &&
scope.scope.pointsRefundAvailable == 'Y'
" -->
<auth-button :data="scope.scope" :show-btn-ids="['9140104']" />
</span>
</div>
</d2-table>
......@@ -75,6 +81,26 @@
v-if="detailVisible"
:id="id"
/>
<d2-dialog
title="提示"
class="refund-dialog"
v-if="refundVisible"
:is-visible="refundVisible"
@closeDialog="handleRefundClose"
@confirmDialog="handleRefundConfirm"
>
<div class="title">请确定此次退款的类型</div>
<glsx-combi-form
:isBlock="true"
ref="refundFormRef"
label-width="220px"
default-width="400px"
:form-rules="formRules"
:form-obj="refundForm"
:form-data="refundFormData"
>
</glsx-combi-form>
</d2-dialog>
</div>
</d2-container>
</template>
......@@ -97,8 +123,24 @@ export default {
detailDialog
},
data() {
var checkIntegral = (rule, value, callback) => {
if (!value) {
return callback(new Error("请输入退回积分"))
}
console.log(Number.isInteger(+value))
if (!Number.isInteger(+value)) {
callback(new Error("请输入数字值"))
} else {
if (value > 18) {
callback(new Error("输入的积分超过当前订单最大积分"))
} else {
callback()
}
}
}
return {
userInfo: this.$store.state.d2admin.user.info,
show: true,
refundVisible: false,
activeName: "4",
tabPaneList: [
{
......@@ -116,6 +158,10 @@ export default {
{
label: "已失效",
name: "2"
},
{
label: "未兑换",
name: "3"
}
],
statusEnum: {
......@@ -236,12 +282,83 @@ export default {
],
merchantServiceList: []
},
getListApi: getList,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
tableColumns: [
tableColumns: []
},
loading: false,
options: [],
infoForm: {
fields: []
},
dialogConfig: {
title: "请选择导出的字段",
width: "860px"
},
editChildRef: "editChildRef",
chooseFieldVisible: false,
editFormData: [
{
label: "",
name: "fields",
addHtml: "fieldsHtml"
}
],
refundForm: {
id: ""
},
formRules: {
refundType: [
{ required: true, message: "请选择退款类型", trigger: "change" }
],
integral: [{ validator: checkIntegral, trigger: "blur" }]
},
refundFormData: [
{
label: "退款类型",
name: "refundType",
type: "radio",
optionId: "confId",
optionLabel: "confName",
optionList: [
{ confId: "1", confName: "全额退款" },
{ confId: "2", confName: "部分退款" }
],
handleRadioChange: (val) => {}
},
{
label: "退回积分",
name: "integral",
type: "input",
width: "290px"
}
]
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
created() {
this.getTableColumns()
},
mounted() {
getShopMerchantList({}).then((res) => {
this.baseData.merchantServiceList = res
this.getOptionsList()
})
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
getTableColumns() {
let { activeName } = this,
arr = [],
tableColumns = [
{
label: "业务场景",
prop: "sceneType",
......@@ -301,7 +418,7 @@ export default {
width: "200px",
prop: "referrerName",
formatter: (cell) => {
return `${cell.referrerName || '-'}${cell.referrerPhone || '-'}`
return `${cell.referrerName || "-"}${cell.referrerPhone || "-"}`
}
},
{
......@@ -309,7 +426,7 @@ export default {
width: "200px",
prop: "transferName",
formatter: (cell) => {
return `${cell.transferName || '-'}${cell.transferPhone || '-'}`
return `${cell.transferName || "-"}${cell.transferPhone || "-"}`
}
},
{
......@@ -317,7 +434,7 @@ export default {
width: "100px",
prop: "staffSource",
formatter: (cell) => {
return cell.staffSource == 1 ? '驻店员工' : '门店员工'
return cell.staffSource == 1 ? "驻店员工" : "门店员工"
}
},
{
......@@ -331,6 +448,7 @@ export default {
label: "督导审核",
prop: "supervisorAudit",
width: "100px",
isHide: true,
formatter: (cellValue) => {
return {
1: "是",
......@@ -343,43 +461,34 @@ export default {
prop: "status",
width: "80px",
type: "slot",
isHide: true,
addHtml: "statusSlot"
}
]
},
loading: false,
options: [],
infoForm: {
fields: []
},
dialogConfig: {
title: "请选择导出的字段",
width: "860px"
},
editChildRef: "editChildRef",
chooseFieldVisible: false,
editFormData: [
{
label: "",
name: "fields",
addHtml: "fieldsHtml"
this.show = false
if (activeName == "3") {
arr = tableColumns.filter((item) => {
if (!item.isHide) {
return item
}
})
this.tableParams.tableColumns = arr
} else {
arr = tableColumns
if (activeName == 2) {
arr.forEach((item) => {
if (item.label == "积分收益") {
item.label = "退回积分"
}
})
}
]
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
getShopMerchantList({}).then((res) => {
this.baseData.merchantServiceList = res
this.getOptionsList()
})
},
methods: {
...mapActions("d2admin/user", ["actionSetDownloadList"]),
this.tableParams.tableColumns = arr
}
setTimeout(() => {
this.show = true
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === "select") {
......@@ -439,6 +548,7 @@ export default {
} else {
this.searchForm.status = ""
}
this.getTableColumns()
this.handleSearch()
},
handleCheck(data) {
......@@ -488,22 +598,50 @@ export default {
// })
})
},
//标记退款
handleRefund(data) {
this.$confirm("确定将此订单标记为已退款", "", {
this.refundVisible = true
this.refundForm.id = data.id
},
//关闭标记退款
handleRefundClose() {
this.refundVisible = false
this.refundForm.id = ""
},
// 确定标记退款
handleRefundConfirm() {
this.$refs.refundFormRef.validate((valid) => {
if (valid) {
markAsRefunded({
orderCode: data.orderCode
}).then((res) => {
if (res) {
this.$message.success("退款成功!")
this.refundVisible = false
this.refundForm.id = ""
this.handleSearch()
}
})
}
})
},
//刷新
handleRefresh() {
this.$confirm("确定需要刷新并同步订单信息", "", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (action) => {
if (action == "confirm") {
markAsRefunded({
orderCode : data.orderCode
}).then((res) => {
if (res) {
this.$message.success("操作成功")
this.handleSearch()
}
})
}
// if (action == "confirm") {
// markAsRefunded({
// orderCode: data.orderCode
// }).then((res) => {
// if (res) {
// this.$message.success("订单信息已同步完成!")
// this.handleSearch()
// }
// })
// }
}
})
},
......@@ -569,5 +707,22 @@ export default {
margin-right: 8px;
vertical-align: middle;
}
.title {
color: #333333;
font-size: 14px;
text-align: center;
margin: -2px auto 28px;
}
.refund-dialog {
::v-deep .el-dialog__header {
border-bottom: 1px solid #e5e5e5;
color: #333333;
font-size: 20px;
font-weight: bold;
}
::v-deep .el-dialog__footer {
border-top: 1px solid #e5e5e5;
}
}
</style>
\ No newline at end of file
......@@ -86,8 +86,22 @@ export default {
isClear: true,
pickerOptions: "rangePickerOptions"
},
// {
// label: "积分兑换时间",
// name: "withdrawalTime",
// type: "datePicker",
// isClear: true,
// pickerOptions: "rangePickerOptions"
// },
{
label: "积分兑换时间",
label: "积分付款时间",
name: "rewardTime",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
},
{
label: "积分到账时间",
name: "withdrawalTime",
type: "datePicker",
isClear: true,
......
......@@ -9,11 +9,13 @@
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<div class="employee-wrap" v-if="qrCodeURL">
<div class="employee-wrap" v-if="qrCodeURL" ref="printContainer">
<div class="title">员工注册码</div>
<div class="code">
<img :src="qrCodeURL" alt="" />
</div>
<div class="merchantName">{{ info.merchantName }}</div>
<div class="merchantId">{{ info.merchantId }}</div>
</div>
</d2-dialog>
</template>
......@@ -21,6 +23,7 @@
<script>
// alipayQrcode
import { employeeRegister } from "@api/shopConfig"
import html2canvas from "html2canvas"
export default {
name: "employeeDialog",
data() {
......@@ -52,6 +55,7 @@ export default {
mounted() {
this.getEmployeeRegister()
console.log(this.info)
},
methods: {
......@@ -87,8 +91,57 @@ export default {
},
handleAddConfirm() {
// this.downImg(this.qrCodeURL, "员工注册码.png")
this.downloadIamge(this.qrCodeURL, "员工注册码.png")
const content = this.$refs.printContainer;
html2canvas(content, {
width: content.clientWidth, // 设置图片宽度
height: content.clientHeight,
allowTaint: true, // 允许污染
taintTest: true, // 在渲染前测试图片(没整明白有啥用)
useCORS: true // 使用跨域(当allowTaint为true时这段代码没什么用,下面解释)
}).then((canvas) => {
const url = canvas.toDataURL("image/png")
const filename = "员工注册码.png"
const link = document.createElement("a")
link.href = url
link.download = filename
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
// that.convertCanvasToImg(canvas, "员工注册码.png")
})
},
// 转换图片格式
convertCanvasToImg(canvas, name) {
// canvas base64 转 blob
var myBlob = this.dataURLtoBlob(canvas.toDataURL("img/png", 0.92))
// blob转URL对象
const myUrl = URL.createObjectURL(myBlob)
// 创建a标签,下载图片
this.downImg(myUrl, name)
},
// base64 转 blob
dataURLtoBlob(dataurl) {
var arr = dataurl.split(",")
var mime = arr[0].match(/:(.*?);/)[1]
var bstr = atob(arr[1])
var n = bstr.length
var u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new Blob([u8arr], { type: mime })
},
// 下载图片 filename是图片名称
downImg(url, name) {
// 创建a标签 并设置其相关属性,最后触发其点击事件
const a = document.createElement("a")
const clickEvent = document.createEvent("MouseEvents")
a.setAttribute("href", url)
a.setAttribute("download", name)
a.setAttribute("target", "_blank")
clickEvent.initEvent("click", true, true)
a.dispatchEvent(clickEvent)
},
handleClose() {
this.$emit("dialogClose", true)
......@@ -97,11 +150,18 @@ export default {
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog__body{
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
.employee-wrap {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
width:196px;
.title {
font-weight: 500;
font-size: 14px;
......@@ -115,6 +175,12 @@ export default {
width: 100%;
}
}
.merchantName,
.merchantId {
color: #333333;
font-size: 14px;
margin-top: 8px;
}
}
</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!