init 初始化订单售后
This commit is contained in:
parent
a63504e4d1
commit
ed5411b50f
46
src/api/business/OrderManage/OrderRefunds/orderrefund.js
Normal file
46
src/api/business/OrderManage/OrderRefunds/orderrefund.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Descripttion: 售后单记录表Api接口
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-08-29)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-08-29)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 售后单记录表分页查询列表
|
||||||
|
export function orderRefundList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/OrderRefund/getOrderRefundList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 售后单记录表新增或修改
|
||||||
|
export function addOrUpdateOrderRefund(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/OrderRefund/addOrUpdateOrderRefund',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 售后单记录表删除
|
||||||
|
export function delOrderRefund(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/business/OrderRefund/'+ ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 售后单记录表导出
|
||||||
|
export function exportOrderRefund(query) {
|
||||||
|
return request({
|
||||||
|
url: 'business/OrderRefund/exportOrderRefund',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,255 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (售后单记录表/tb_order_refund 添加弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-08-29)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-08-29)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="添加售后单记录表信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单guid" prop="orderGuid">
|
||||||
|
<el-input v-model="formData.orderGuid" placeholder="请输入订单guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户guid" prop="customerGuid">
|
||||||
|
<el-input v-model="formData.customerGuid" placeholder="请输入客户guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后类型(1退货退款 2退货(无需退款) 3换货)" prop="refundType">
|
||||||
|
<el-select v-model="formData.refundType" placeholder="请选择售后类型(1退货退款 2退货(无需退款) 3换货)">
|
||||||
|
<el-option v-for="item in refund_type " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退货原因" prop="refundReason">
|
||||||
|
<el-select v-model="formData.refundReason" placeholder="请选择客户退货原因">
|
||||||
|
<el-option v-for="item in refund_reason " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款说明" prop="customerRefundDesc">
|
||||||
|
<el-input v-model="formData.customerRefundDesc" placeholder="请输入客户退款说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款凭证" prop="customerRefundImg">
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.customerRefundImg" :data=imgData :limit="1" :fileSize="5"
|
||||||
|
:drag="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品收货状态(1未收到货 2已收到货)" prop="goodsReceiveStatus">
|
||||||
|
<el-select v-model="formData.goodsReceiveStatus" placeholder="请选择商品收货状态(1未收到货 2已收到货)">
|
||||||
|
<el-option v-for="item in goods_receive_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家审核状态(1待审核 2已同意 3已拒绝)" prop="merchantAuditStatus">
|
||||||
|
<el-select v-model="formData.merchantAuditStatus" placeholder="请选择商家审核状态(1待审核 2已同意 3已拒绝)">
|
||||||
|
<el-option v-for="item in merchant_audit_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家拒绝原因(说明)" prop="merchantRefuseDesc">
|
||||||
|
<el-input v-model="formData.merchantRefuseDesc" placeholder="请输入商家拒绝原因(说明)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际退款金额" prop="refundMoney">
|
||||||
|
<el-input v-model="formData.refundMoney" placeholder="请输入实际退款金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家退货地址guid" prop="shopRefundAddressGuid">
|
||||||
|
<el-input v-model="formData.shopRefundAddressGuid" placeholder="请输入商家退货地址guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="用户是否发货(1未发货 2已发货)" prop="isCustomerSend">
|
||||||
|
<el-select v-model="formData.isCustomerSend" placeholder="请选择用户是否发货(1未发货 2已发货)">
|
||||||
|
<el-option v-for="item in is_customer_send " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货时间" prop="customerSendTime">
|
||||||
|
<el-date-picker v-model="formData.customerSendTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流公司guid" prop="logisticsCompanyGuid">
|
||||||
|
<el-input v-model="formData.logisticsCompanyGuid" placeholder="请输入客户发货物流公司guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流单号" prop="expressNo">
|
||||||
|
<el-input v-model="formData.expressNo" placeholder="请输入客户发货物流单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后单状态(1进行中 2已拒绝 3已完成 4已取消)" prop="orderRefundStatus">
|
||||||
|
<el-select v-model="formData.orderRefundStatus" placeholder="请选择售后单状态(1进行中 2已拒绝 3已完成 4已取消)">
|
||||||
|
<el-option v-for="item in order_refund_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div key="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleAddClick(formRef)" :loading="loadingStatus">添加</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { addOrUpdateOrderRefund } from '@/api/business/OrderManage/OrderRefunds/orderRefund.js';
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
await getrefund_type()
|
||||||
|
await getrefund_reason()
|
||||||
|
await getgoods_receive_status()
|
||||||
|
await getmerchant_audit_status()
|
||||||
|
await getis_customer_send()
|
||||||
|
await getorder_refund_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 售后类型(1退货退款 2退货(无需退款) 3换货)字典选项列表
|
||||||
|
const refund_type = ref([]);
|
||||||
|
// 客户退货原因字典选项列表
|
||||||
|
const refund_reason = ref([]);
|
||||||
|
// 商品收货状态(1未收到货 2已收到货)字典选项列表
|
||||||
|
const goods_receive_status = ref([]);
|
||||||
|
// 商家审核状态(1待审核 2已同意 3已拒绝)字典选项列表
|
||||||
|
const merchant_audit_status = ref([]);
|
||||||
|
// 用户是否发货(1未发货 2已发货)字典选项列表
|
||||||
|
const is_customer_send = ref([]);
|
||||||
|
// 售后单状态(1进行中 2已拒绝 3已完成 4已取消)字典选项列表
|
||||||
|
const order_refund_status = ref([]);
|
||||||
|
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getrefund_type() {
|
||||||
|
await proxy.getDicts('refund_type').then((res) => {
|
||||||
|
refund_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getrefund_reason() {
|
||||||
|
await proxy.getDicts('refund_reason').then((res) => {
|
||||||
|
refund_reason.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getgoods_receive_status() {
|
||||||
|
await proxy.getDicts('goods_receive_status').then((res) => {
|
||||||
|
goods_receive_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getmerchant_audit_status() {
|
||||||
|
await proxy.getDicts('merchant_audit_status').then((res) => {
|
||||||
|
merchant_audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_customer_send() {
|
||||||
|
await proxy.getDicts('is_customer_send').then((res) => {
|
||||||
|
is_customer_send.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getorder_refund_status() {
|
||||||
|
await proxy.getDicts('order_refund_status').then((res) => {
|
||||||
|
order_refund_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = reactive({
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "OrderRefund"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
orderRefundGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
orderGuid: [{ required: true, message: "订单guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
refundType: [{ required: true, message: "售后类型(1退货退款 2退货(无需退款) 3换货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
refundReason: [{ required: true, message: "客户退货原因不能为空", trigger: "change", type: "number" }],
|
||||||
|
goodsReceiveStatus: [{ required: true, message: "商品收货状态(1未收到货 2已收到货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
merchantAuditStatus: [{ required: true, message: "商家审核状态(1待审核 2已同意 3已拒绝)不能为空", trigger: "change", type: "number" }],
|
||||||
|
refundMoney: [{ required: true, message: "实际退款金额不能为空", trigger: "blur" }],
|
||||||
|
isCustomerSend: [{ required: true, message: "用户是否发货(1未发货 2已发货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderRefundStatus: [{ required: true, message: "售后单状态(1进行中 2已拒绝 3已完成 4已取消)不能为空", trigger: "change", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleAddClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateOrderRefund(formData);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('添加成功')
|
||||||
|
closeDialog();
|
||||||
|
loadingStatus.value = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeDialog = () => {
|
||||||
|
handleResetClick(formRef.value);
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,232 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (售后单记录表/tb_order_refund 详情弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-08-29)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-08-29)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="售后单记录表信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单guid" >
|
||||||
|
<el-input v-model="formData.orderGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户guid" >
|
||||||
|
<el-input v-model="formData.customerGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后类型(1退货退款 2退货(无需退款) 3换货)" >
|
||||||
|
<el-select v-model="formData.refundType" >
|
||||||
|
<el-option v-for="item in refund_type " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退货原因" >
|
||||||
|
<el-select v-model="formData.refundReason" >
|
||||||
|
<el-option v-for="item in refund_reason " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款说明" >
|
||||||
|
<el-input v-model="formData.customerRefundDesc" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款凭证" >
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.customerRefundImg" :limit="1" :fileSize="5"
|
||||||
|
:drag="true" :isShowTip="false" :isDisabled="true"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品收货状态(1未收到货 2已收到货)" >
|
||||||
|
<el-select v-model="formData.goodsReceiveStatus" >
|
||||||
|
<el-option v-for="item in goods_receive_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家审核状态(1待审核 2已同意 3已拒绝)" >
|
||||||
|
<el-select v-model="formData.merchantAuditStatus" >
|
||||||
|
<el-option v-for="item in merchant_audit_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家拒绝原因(说明)" >
|
||||||
|
<el-input v-model="formData.merchantRefuseDesc" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际退款金额" >
|
||||||
|
<el-input v-model="formData.refundMoney" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家退货地址guid" >
|
||||||
|
<el-input v-model="formData.shopRefundAddressGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="用户是否发货(1未发货 2已发货)" >
|
||||||
|
<el-select v-model="formData.isCustomerSend" >
|
||||||
|
<el-option v-for="item in is_customer_send " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货时间" >
|
||||||
|
<el-date-picker v-model="formData.customerSendTime" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流公司guid" >
|
||||||
|
<el-input v-model="formData.logisticsCompanyGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流单号" >
|
||||||
|
<el-input v-model="formData.expressNo" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后单状态(1进行中 2已拒绝 3已完成 4已取消)" >
|
||||||
|
<el-select v-model="formData.orderRefundStatus" >
|
||||||
|
<el-option v-for="item in order_refund_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getrefund_type()
|
||||||
|
await getrefund_reason()
|
||||||
|
await getgoods_receive_status()
|
||||||
|
await getmerchant_audit_status()
|
||||||
|
await getis_customer_send()
|
||||||
|
await getorder_refund_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 售后类型(1退货退款 2退货(无需退款) 3换货)字典选项列表
|
||||||
|
const refund_type = ref([]);
|
||||||
|
// 客户退货原因字典选项列表
|
||||||
|
const refund_reason = ref([]);
|
||||||
|
// 商品收货状态(1未收到货 2已收到货)字典选项列表
|
||||||
|
const goods_receive_status = ref([]);
|
||||||
|
// 商家审核状态(1待审核 2已同意 3已拒绝)字典选项列表
|
||||||
|
const merchant_audit_status = ref([]);
|
||||||
|
// 用户是否发货(1未发货 2已发货)字典选项列表
|
||||||
|
const is_customer_send = ref([]);
|
||||||
|
// 售后单状态(1进行中 2已拒绝 3已完成 4已取消)字典选项列表
|
||||||
|
const order_refund_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getrefund_type() {
|
||||||
|
await proxy.getDicts('refund_type').then((res) => {
|
||||||
|
refund_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getrefund_reason() {
|
||||||
|
await proxy.getDicts('refund_reason').then((res) => {
|
||||||
|
refund_reason.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getgoods_receive_status() {
|
||||||
|
await proxy.getDicts('goods_receive_status').then((res) => {
|
||||||
|
goods_receive_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getmerchant_audit_status() {
|
||||||
|
await proxy.getDicts('merchant_audit_status').then((res) => {
|
||||||
|
merchant_audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_customer_send() {
|
||||||
|
await proxy.getDicts('is_customer_send').then((res) => {
|
||||||
|
is_customer_send.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getorder_refund_status() {
|
||||||
|
await proxy.getDicts('order_refund_status').then((res) => {
|
||||||
|
order_refund_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 基础参数
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,283 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (售后单记录表/tb_order_refund 编辑弹窗)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-08-29)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-08-29)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="修改售后单记录表信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单guid" prop="orderGuid">
|
||||||
|
<el-input v-model="formData.orderGuid" placeholder="请输入订单guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户guid" prop="customerGuid">
|
||||||
|
<el-input v-model="formData.customerGuid" placeholder="请输入客户guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后类型(1退货退款 2退货(无需退款) 3换货)" prop="refundType">
|
||||||
|
<el-select v-model="formData.refundType" placeholder="请选择售后类型(1退货退款 2退货(无需退款) 3换货)">
|
||||||
|
<el-option v-for="item in refund_type " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退货原因" prop="refundReason">
|
||||||
|
<el-select v-model="formData.refundReason" placeholder="请选择客户退货原因">
|
||||||
|
<el-option v-for="item in refund_reason " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款说明" prop="customerRefundDesc">
|
||||||
|
<el-input v-model="formData.customerRefundDesc" placeholder="请输入客户退款说明" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户退款凭证" prop="customerRefundImg">
|
||||||
|
<UploadImage ref="uploadRef" v-model="formData.customerRefundImg" :data=imgData :limit="1" :fileSize="5"
|
||||||
|
:drag="true" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品收货状态(1未收到货 2已收到货)" prop="goodsReceiveStatus">
|
||||||
|
<el-select v-model="formData.goodsReceiveStatus" placeholder="请选择商品收货状态(1未收到货 2已收到货)">
|
||||||
|
<el-option v-for="item in goods_receive_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家审核状态(1待审核 2已同意 3已拒绝)" prop="merchantAuditStatus">
|
||||||
|
<el-select v-model="formData.merchantAuditStatus" placeholder="请选择商家审核状态(1待审核 2已同意 3已拒绝)">
|
||||||
|
<el-option v-for="item in merchant_audit_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家拒绝原因(说明)" prop="merchantRefuseDesc">
|
||||||
|
<el-input v-model="formData.merchantRefuseDesc" placeholder="请输入商家拒绝原因(说明)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际退款金额" prop="refundMoney">
|
||||||
|
<el-input v-model="formData.refundMoney" placeholder="请输入实际退款金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商家退货地址guid" prop="shopRefundAddressGuid">
|
||||||
|
<el-input v-model="formData.shopRefundAddressGuid" placeholder="请输入商家退货地址guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="用户是否发货(1未发货 2已发货)" prop="isCustomerSend">
|
||||||
|
<el-select v-model="formData.isCustomerSend" placeholder="请选择用户是否发货(1未发货 2已发货)">
|
||||||
|
<el-option v-for="item in is_customer_send " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货时间" prop="customerSendTime">
|
||||||
|
<el-date-picker v-model="formData.customerSendTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流公司guid" prop="logisticsCompanyGuid">
|
||||||
|
<el-input v-model="formData.logisticsCompanyGuid" placeholder="请输入客户发货物流公司guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="客户发货物流单号" prop="expressNo">
|
||||||
|
<el-input v-model="formData.expressNo" placeholder="请输入客户发货物流单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="售后单状态(1进行中 2已拒绝 3已完成 4已取消)" prop="orderRefundStatus">
|
||||||
|
<el-select v-model="formData.orderRefundStatus" placeholder="请选择售后单状态(1进行中 2已拒绝 3已完成 4已取消)">
|
||||||
|
<el-option v-for="item in order_refund_status " :key="item.dictValue" :label="item.dictLabel" :value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEditClick(formRef)" :loading="loadingStatus">编辑</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { addOrUpdateOrderRefund } from "@/api/business/OrderManage/OrderRefunds/orderRefund.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getrefund_type()
|
||||||
|
await getrefund_reason()
|
||||||
|
await getgoods_receive_status()
|
||||||
|
await getmerchant_audit_status()
|
||||||
|
await getis_customer_send()
|
||||||
|
await getorder_refund_status()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
// 售后类型(1退货退款 2退货(无需退款) 3换货)字典选项列表
|
||||||
|
const refund_type = ref([]);
|
||||||
|
// 客户退货原因字典选项列表
|
||||||
|
const refund_reason = ref([]);
|
||||||
|
// 商品收货状态(1未收到货 2已收到货)字典选项列表
|
||||||
|
const goods_receive_status = ref([]);
|
||||||
|
// 商家审核状态(1待审核 2已同意 3已拒绝)字典选项列表
|
||||||
|
const merchant_audit_status = ref([]);
|
||||||
|
// 用户是否发货(1未发货 2已发货)字典选项列表
|
||||||
|
const is_customer_send = ref([]);
|
||||||
|
// 售后单状态(1进行中 2已拒绝 3已完成 4已取消)字典选项列表
|
||||||
|
const order_refund_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
//字典获取
|
||||||
|
async function getrefund_type() {
|
||||||
|
await proxy.getDicts('refund_type').then((res) => {
|
||||||
|
refund_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getrefund_reason() {
|
||||||
|
await proxy.getDicts('refund_reason').then((res) => {
|
||||||
|
refund_reason.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getgoods_receive_status() {
|
||||||
|
await proxy.getDicts('goods_receive_status').then((res) => {
|
||||||
|
goods_receive_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getmerchant_audit_status() {
|
||||||
|
await proxy.getDicts('merchant_audit_status').then((res) => {
|
||||||
|
merchant_audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_customer_send() {
|
||||||
|
await proxy.getDicts('is_customer_send').then((res) => {
|
||||||
|
is_customer_send.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getorder_refund_status() {
|
||||||
|
await proxy.getDicts('order_refund_status').then((res) => {
|
||||||
|
order_refund_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
|
||||||
|
const loadingStatus = ref(false)
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "OrderRefund"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
orderRefundGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
orderGuid: [{ required: true, message: "订单guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
refundType: [{ required: true, message: "售后类型(1退货退款 2退货(无需退款) 3换货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
refundReason: [{ required: true, message: "客户退货原因不能为空", trigger: "change", type: "number" }],
|
||||||
|
goodsReceiveStatus: [{ required: true, message: "商品收货状态(1未收到货 2已收到货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
merchantAuditStatus: [{ required: true, message: "商家审核状态(1待审核 2已同意 3已拒绝)不能为空", trigger: "change", type: "number" }],
|
||||||
|
refundMoney: [{ required: true, message: "实际退款金额不能为空", trigger: "blur" }],
|
||||||
|
isCustomerSend: [{ required: true, message: "用户是否发货(1未发货 2已发货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderRefundStatus: [{ required: true, message: "售后单状态(1进行中 2已拒绝 3已完成 4已取消)不能为空", trigger: "change", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
// 提交
|
||||||
|
const handleEditClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateOrderRefund(formData.value);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('修改成功')
|
||||||
|
closeDialog();
|
||||||
|
loadingStatus.value = false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
}
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
332
src/views/business/OrderManage/OrderRefunds/index.vue
Normal file
332
src/views/business/OrderManage/OrderRefunds/index.vue
Normal file
@ -0,0 +1,332 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (售后单记录表/tb_order_refund)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (lwh)
|
||||||
|
* @Date: (2023-08-29)
|
||||||
|
* @LastEditors: (lwh)
|
||||||
|
* @LastEditTime: (2023-08-29)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
||||||
|
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" v-show="showSearch"
|
||||||
|
@submit.prevent>
|
||||||
|
<el-form-item label="售后类型(1退货退款 2退货(无需退款) 3换货)" prop="refundType">
|
||||||
|
<el-select v-model="queryParams.refundType" placeholder="请选择售后类型(1退货退款 2退货(无需退款) 3换货)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in refund_type " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户退货原因" prop="refundReason">
|
||||||
|
<el-select v-model="queryParams.refundReason" placeholder="请选择客户退货原因" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in refund_reason " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品收货状态(1未收到货 2已收到货)" prop="goodsReceiveStatus">
|
||||||
|
<el-select v-model="queryParams.goodsReceiveStatus" placeholder="请选择商品收货状态(1未收到货 2已收到货)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in goods_receive_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商家审核状态(1待审核 2已同意 3已拒绝)" prop="merchantAuditStatus">
|
||||||
|
<el-select v-model="queryParams.merchantAuditStatus" placeholder="请选择商家审核状态(1待审核 2已同意 3已拒绝)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in merchant_audit_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户是否发货(1未发货 2已发货)" prop="isCustomerSend">
|
||||||
|
<el-select v-model="queryParams.isCustomerSend" placeholder="请选择用户是否发货(1未发货 2已发货)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in is_customer_send " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="售后单状态(1进行中 2已拒绝 3已完成 4已取消)" prop="orderRefundStatus">
|
||||||
|
<el-select v-model="queryParams.orderRefundStatus" placeholder="请选择售后单状态(1进行中 2已拒绝 3已完成 4已取消)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in order_refund_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||||
|
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 工具按钮 -->
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" v-hasPermi="['business:orderrefund:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
|
||||||
|
{{ $t('btn.add') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:orderrefund:delete']" plain icon="delete" @click="handleDelete">
|
||||||
|
{{ $t('btn.delete') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['business:orderrefund:export']">
|
||||||
|
{{ $t('btn.export') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 表格渲染 prop="对应的字段"-->
|
||||||
|
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
|
||||||
|
<el-table-column prop="refundType" label="售后类型(1退货退款 2退货(无需退款) 3换货)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" refund_type " :value="scope.row.refundType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="refundReason" label="客户退货原因" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" refund_reason " :value="scope.row.refundReason" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="customerRefundDesc" label="客户退款说明" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="customerRefundImg" label="客户退款凭证" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.customerRefundImg?.split(',')[0]" :preview-src-list="scope.row.customerRefundImg?.split(',')">
|
||||||
|
<div><el-icon :size="15"><document /></el-icon></div>
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsReceiveStatus" label="商品收货状态(1未收到货 2已收到货)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" goods_receive_status " :value="scope.row.goodsReceiveStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="merchantAuditStatus" label="商家审核状态(1待审核 2已同意 3已拒绝)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" merchant_audit_status " :value="scope.row.merchantAuditStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="merchantRefuseDesc" label="商家拒绝原因(说明)" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="refundMoney" label="实际退款金额" align="center" />
|
||||||
|
<el-table-column prop="isCustomerSend" label="用户是否发货(1未发货 2已发货)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" is_customer_send " :value="scope.row.isCustomerSend" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="customerSendTime" label="客户发货时间" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="expressNo" label="客户发货物流单号" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="orderRefundStatus" label="售后单状态(1进行中 2已拒绝 3已完成 4已取消)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" order_refund_status " :value="scope.row.orderRefundStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="350" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:orderrefund:addOrUpdate']">编辑</el-button>
|
||||||
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:orderrefund:delete']">删除</el-button>
|
||||||
|
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加 -->
|
||||||
|
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||||
|
<!-- 编辑 -->
|
||||||
|
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||||
|
<!-- 详情 -->
|
||||||
|
<DetailDialog v-model="DetailDialogVisible" :data="DetailDialogRow" :done="() => resetQuery()"></DetailDialog>
|
||||||
|
</template>
|
||||||
|
<script setup name="orderrefund">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { exportOrderRefund, orderRefundList , delOrderRefund } from '@/api/business/OrderManage/OrderRefunds/orderRefund.js'
|
||||||
|
import AddDialog from "./components/AddDialog.vue";
|
||||||
|
import EditDialog from "./components/EditDialog.vue";
|
||||||
|
import DetailDialog from "./components/DetailDialog.vue";
|
||||||
|
|
||||||
|
const AddDialogVisible = ref(false);
|
||||||
|
const EditDialogVisible = ref(false);
|
||||||
|
const EditDialogRow = ref({});
|
||||||
|
const DetailDialogVisible = ref(false);
|
||||||
|
const DetailDialogRow = ref({});
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
|
// 选中categoryId数组数组
|
||||||
|
const ids = ref([])
|
||||||
|
// 非单选禁用
|
||||||
|
const single = ref(true)
|
||||||
|
// 非多个禁用
|
||||||
|
const multiple = ref(true)
|
||||||
|
// 显示搜索条件
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 数据列表
|
||||||
|
const dataList = ref([])
|
||||||
|
// 总记录数
|
||||||
|
const total = ref(0)
|
||||||
|
// 是否加载
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const { queryParams } = toRefs(data)
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
|
||||||
|
|
||||||
|
// 业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const refund_type = ref([]);
|
||||||
|
async function getrefund_type() {
|
||||||
|
await proxy.getDicts('refund_type').then((res) => {
|
||||||
|
refund_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getrefund_type()
|
||||||
|
// 字典获取
|
||||||
|
const refund_reason = ref([]);
|
||||||
|
async function getrefund_reason() {
|
||||||
|
await proxy.getDicts('refund_reason').then((res) => {
|
||||||
|
refund_reason.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getrefund_reason()
|
||||||
|
// 字典获取
|
||||||
|
const goods_receive_status = ref([]);
|
||||||
|
async function getgoods_receive_status() {
|
||||||
|
await proxy.getDicts('goods_receive_status').then((res) => {
|
||||||
|
goods_receive_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getgoods_receive_status()
|
||||||
|
// 字典获取
|
||||||
|
const merchant_audit_status = ref([]);
|
||||||
|
async function getmerchant_audit_status() {
|
||||||
|
await proxy.getDicts('merchant_audit_status').then((res) => {
|
||||||
|
merchant_audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getmerchant_audit_status()
|
||||||
|
// 字典获取
|
||||||
|
const is_customer_send = ref([]);
|
||||||
|
async function getis_customer_send() {
|
||||||
|
await proxy.getDicts('is_customer_send').then((res) => {
|
||||||
|
is_customer_send.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_customer_send()
|
||||||
|
// 字典获取
|
||||||
|
const order_refund_status = ref([]);
|
||||||
|
async function getorder_refund_status() {
|
||||||
|
await proxy.getDicts('order_refund_status').then((res) => {
|
||||||
|
order_refund_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getorder_refund_status()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//基础方法
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
function getList() {
|
||||||
|
loading.value = true
|
||||||
|
|
||||||
|
|
||||||
|
orderRefundList(queryParams.value).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
loading.value = false;
|
||||||
|
dataList.value = res.data.result;
|
||||||
|
total.value = res.data.totalNum;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.orderRefundId)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置查询操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm('queryForm')
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.orderRefundId || ids.value
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return delOrderRefund(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
handleQuery()
|
||||||
|
modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport(row) {
|
||||||
|
const Ids = row.orderRefundId || ids.value
|
||||||
|
const name = ref("所有")
|
||||||
|
|
||||||
|
if (Ids.length != 0) {
|
||||||
|
let str = ''
|
||||||
|
for (const key in Ids) {
|
||||||
|
str += Ids[key] + ','
|
||||||
|
}
|
||||||
|
str = str.slice(0, str.length - 1)
|
||||||
|
queryParams.value.ids = str
|
||||||
|
name.value = "选中"
|
||||||
|
}
|
||||||
|
|
||||||
|
ElMessageBox.confirm('是否确认导出' + name.value + '数据?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return exportOrderRefund(queryParams.value)
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
proxy.download(response.data.path)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditDialogVisible.value = true
|
||||||
|
EditDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailDialogVisible.value = true
|
||||||
|
DetailDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
handleQuery()
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user