Commit dbc8e236 by 胡悦

订单详情、积分审批详情联调

1 parent f35fff60
......@@ -99,4 +99,10 @@ export function getOperationRecord(data) {
export function getOrderByScore(data) {
data.method = `dj.api.smartcarlife.staff.motivation.order.score`
return request(data)
}
/** 积分退款订单详情查询 */
export function getGoodsSubOrder(data) {
data.method = 'dj.api.smartcarlife.goodsOrder.goodsSubOrder.list'
return request(data)
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ export const routerName = {
authId: "9140104",
parentId: "91401",
label: "标记退款",
handle: "handleRefund"
handle: "openRefundDetail"
},
{
authId: "9140102",
......
......@@ -71,20 +71,20 @@ export default {
tableColumns: [
{
label: "品牌",
prop: "merchantName"
prop: "brandName"
},
{
label: "子品牌",
prop: "merchantId"
prop: "subBrandName"
},
{
label: "关联门店",
prop: "merchantId",
addHtml: "polishContent"
prop: "merchantName",
addHtml: "merchantName"
},
{
label: "更新时间",
prop: "merchantId",
prop: "updatedDate",
},
]
},
......
......@@ -368,6 +368,14 @@ export default {
busiInfoAttrObj: {
fixed: [
{
label: "退款子项",
name: "refundSubOrderCode"
},
{
label: "可退总价",
name: "refundableTotalPrice"
},
{
label: "退款类型",
name: "refundTypeTxt"
},
......
<template>
<d2-dialog title="请选择退款明细" :is-visible.sync="refundVisible" width="70%" btn-ok-label="下一步"
@confirmDialog="handleConfirm" @closeDialog="handleClose" class="relateStore">
<el-dialog title="请选择退款明细" :visible.sync="refundVisible" :before-close="handleClose"
:close-on-click-modal="false" width="70%" class="relateStore">
<div>
<el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange"
@select-all="handleAll">
......@@ -15,7 +15,11 @@
</el-table>
<div class="total">可选可退总价:<div class="price">¥{{ total }}</div></div>
</div>
</d2-dialog>
<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>
<script>
......
......@@ -7,7 +7,7 @@
>
<div class="detail-content">
<div class="form_div">
<el-form class="edit-sub-block" label-width="110px" :inline="true">
<el-form class="edit-sub-block" label-width="140px" :inline="true">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="客户:">
......@@ -154,6 +154,26 @@
{{ addScore ? addScore : "-" }}
</el-form-item>
</el-col>
<el-col
:span="8"
v-if="detailInfo.status == '已失效'"
>
<el-form-item label="退款金额:" class="halfItem">
{{
detailInfo.orderMoney
? "¥" + detailInfo.orderMoney.toFixed(2)
: "-"
}}
</el-form-item>
</el-col>
<el-col
:span="8"
v-if="detailInfo.status == '已失效'"
>
<el-form-item label="退款子订单信息:" class="halfItem">
{{ detailInfo.refundSubOrderCode ? detailInfo.refundSubOrderCode : "-" }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
......
<template>
<el-dialog title="请选择退款明细" :visible.sync="refundVisible" :before-close="handleClose"
:close-on-click-modal="false" width="70%" class="relateStore">
<div>
<el-table ref="seletingTable" :data="tableData" class="table" border @select="handleChange"
@select-all="handleAll">
<el-table-column :selectable-fn="selectableFn" type="selection" width="55" align="center" />
<template v-for="item in tableColumn">
<el-table-column :prop="item.prop" :label="item.label" align="center">
<span slot-scope="scope">{{
scope.row[item.prop] ? scope.row[item.prop] : "-"
}}</span>
</el-table-column>
</template>
</el-table>
<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>
<script>
import { getGoodsSubOrder } from "@api/point"
export default {
name: 'refundDetail',
data() {
return {
tableData: [],
tableColumn: [
{
label: '子订单编码',
prop: 'subOrderCode'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '商品别名',
prop: 'goodsAlias'
},
{
label: '商品ID',
prop: 'goodsCommodityCode'
},
{
label: '分类',
prop: 'upgradeGoodsTypeName'
},
{
label: '售价',
prop: 'upgradePrice'
},
{
label: '数量/件',
prop: 'number'
},
{
label: '支付金额',
prop: 'totalPrice'
}
],
total: 0,
refundSubOrderCode: ''
}
},
props: {
refundVisible: {
type: Boolean,
default: false
},
dataInfo: {
type: Object,
default: {}
}
},
watch: {
dataInfo(val) {
console.log(val)
if (val && val.orderCode) this.getList(val.orderCode)
}
},
methods: {
// 设置禁用
selectableFn(row) {
console.log(row)
if (row.status == 2) return false
else if (row.status == 1) return true
},
async getList(orderCode) {
const res = await getGoodsSubOrder({ orderCode })
this.tableData = res
},
handleChange(selection) {
console.log(selection)
this.getParams(selection)
},
handleAll(selection) {
console.log(selection)
this.getParams(selection)
},
getParams(selection) {
let _total = 0
let _refundSubOrderCode = []
selection.forEach(item => {
_total += item.totalPrice
_refundSubOrderCode.push(item.subOrderCode)
})
this.total = _total
this.refundSubOrderCode = _refundSubOrderCode.join('/')
console.log(this.refundSubOrderCode)
},
handleConfirm() {
const {refundSubOrderCode, total} = this
this.$emit("handleConfirm", {
total,
refundSubOrderCode
})
},
handleClose() {
this.$emit("handleClose")
}
}
}
</script>
<style lang="scss" scoped>
.total {
display: flex;
align-items: center;
color: #666666;
font-size: 14px;
.price {
color: #2A58AD;
margin-left: 10px;
}
}
</style>
\ No newline at end of file
......@@ -103,11 +103,13 @@
>
</glsx-combi-form>
</d2-dialog>
<refundDetail :dataInfo="dataInfo" :refundVisible="refundDetailVisible" @handleClose="handleRefundDetailClose" @handleConfirm="handleConfirm"></refundDetail>
</div>
</d2-container>
</template>
<script>
import refundDetail from './components/refundDetail'
import { Util, deepClone } from "@/common/util"
import { mapActions, mapState } from "vuex"
import detailDialog from "./components/detailDialog"
......@@ -125,7 +127,8 @@ import {
export default {
name: "PointList",
components: {
detailDialog
detailDialog,
refundDetail
},
data() {
var checkIntegral = (rule, value, callback) => {
......@@ -387,7 +390,10 @@ export default {
width: "290px",
isDisabled: false
}
]
],
refundDetailVisible: false,
dataInfo: {},
refundInfo: {}
}
},
computed: {
......@@ -650,6 +656,24 @@ export default {
// })
})
},
// 添加选择退款明细弹窗
openRefundDetail(data) {
this.refundDetailVisible = true
this.dataInfo = {
orderCode: data.orderCode
}
this.refundInfo = data
},
handleRefundDetailClose() {
this.refundDetailVisible = false
},
handleConfirm(val) {
console.log(val, '=====')
this.refundInfo.refundSubOrderCode = val.refundSubOrderCode
this.refundInfo.total = val.total
this.handleRefund(this.refundInfo) // 原来的逻辑
this.refundDetailVisible = false
},
//标记退款
handleRefund(data) {
this.refundVisible = true
......@@ -660,6 +684,8 @@ export default {
this.refundForm.refundPoints = data.integralIncome //退还积分
this.refundForm.refundAmount = data.orderMoney //退还金额
this.refundForm.staffUuid = data.staffUuid
this.refundForm.refundSubOrderCode = data.refundSubOrderCode
this.refundForm.refundableTotalPrice = data.total
//当前积分能抵扣的最大值
this.getScore()
},
......@@ -721,7 +747,9 @@ export default {
refundPoints: this.refundForm.refundPoints,
refundAmount: this.refundForm.refundAmount,
employeeUserId: this.refundForm.employeeUserId,
employeeName: this.refundForm.employeeName
employeeName: this.refundForm.employeeName,
refundSubOrderCode: this.refundForm.refundSubOrderCode,
refundableTotalPrice: this.refundForm.refundableTotalPrice
})
.then((res) => {
if (res) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!