init 初始化订单管理
This commit is contained in:
parent
a54379f1af
commit
a63504e4d1
46
src/api/business/OrderManage/Orders/order.js
Normal file
46
src/api/business/OrderManage/Orders/order.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 orderList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/Order/getOrderList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单新增或修改
|
||||||
|
export function addOrUpdateOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/Order/addOrUpdateOrder',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单删除
|
||||||
|
export function delOrder(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/business/Order/'+ ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单导出
|
||||||
|
export function exportOrder(query) {
|
||||||
|
return request({
|
||||||
|
url: 'business/Order/exportOrder',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
365
src/views/business/OrderManage/Orders/components/AddDialog.vue
Normal file
365
src/views/business/OrderManage/Orders/components/AddDialog.vue
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (订单/tb_order 添加弹窗)
|
||||||
|
* @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="goodsGuid">
|
||||||
|
<el-input v-model="formData.goodsGuid" placeholder="请输入商品guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单流水guid" prop="paymentGuid">
|
||||||
|
<el-input v-model="formData.paymentGuid" 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="店铺guid" prop="shopGuid">
|
||||||
|
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单号" prop="orderNumber">
|
||||||
|
<el-input v-model="formData.orderNumber" placeholder="请输入订单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品总金额" prop="goodsTotalAmoun">
|
||||||
|
<el-input v-model="formData.goodsTotalAmoun" placeholder="请输入商品总金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单金额" prop="orderAmount">
|
||||||
|
<el-input v-model="formData.orderAmount" placeholder="请输入订单金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券guid" prop="couponGuid">
|
||||||
|
<el-input v-model="formData.couponGuid" placeholder="请输入优惠券guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券抵扣金额" prop="couponMoney">
|
||||||
|
<el-input v-model="formData.couponMoney" placeholder="请输入优惠券抵扣金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣金额" prop="pointsMoney">
|
||||||
|
<el-input v-model="formData.pointsMoney" placeholder="请输入积分抵扣金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣数量" prop="pointsNum">
|
||||||
|
<el-input v-model="formData.pointsNum" placeholder="请输入积分抵扣数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际付款金额(包含运费)" prop="payPrice">
|
||||||
|
<el-input v-model="formData.payPrice" placeholder="请输入实际付款金额(包含运费)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="后台修改的订单金额(差价)" prop="updatePrice">
|
||||||
|
<el-input v-model="formData.updatePrice" placeholder="请输入后台修改的订单金额(差价)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="买家留言" prop="orderRemark">
|
||||||
|
<el-input v-model="formData.orderRemark" placeholder="请输入买家留言" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="支付方式(1微信支付 2余额支付)" prop="payType">
|
||||||
|
<el-select v-model="formData.payType" placeholder="请选择支付方式(1微信支付 2余额支付)">
|
||||||
|
<el-option v-for="item in pay_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="付款状态(1未付款 2已付款)" prop="payStatus">
|
||||||
|
<el-select v-model="formData.payStatus" placeholder="请选择付款状态(1未付款 2已付款)">
|
||||||
|
<el-option v-for="item in pay_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="payTime">
|
||||||
|
<el-date-picker v-model="formData.payTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="配送方式(1快递配送)" prop="deliveryType">
|
||||||
|
<el-select v-model="formData.deliveryType" placeholder="请选择配送方式(1快递配送)">
|
||||||
|
<el-option v-for="item in delivery_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="expressPrice">
|
||||||
|
<el-input v-model="formData.expressPrice" placeholder="请输入运费金额" />
|
||||||
|
</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="logisticsCompany">
|
||||||
|
<el-input v-model="formData.logisticsCompany" placeholder="请输入物流公司" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="物流单号" prop="logisticsTrackingNumber">
|
||||||
|
<el-input v-model="formData.logisticsTrackingNumber" placeholder="请输入物流单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="发货状态(1未发货 2已发货)" prop="deliveryStatus">
|
||||||
|
<el-select v-model="formData.deliveryStatus" placeholder="请选择发货状态(1未发货 2已发货)">
|
||||||
|
<el-option v-for="item in delivery_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="deliveryTime">
|
||||||
|
<el-date-picker v-model="formData.deliveryTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="收货状态(1未收货 2已收货)" prop="receiptStatus">
|
||||||
|
<el-select v-model="formData.receiptStatus" placeholder="请选择收货状态(1未收货 2已收货)">
|
||||||
|
<el-option v-for="item in receipt_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="receiptTime">
|
||||||
|
<el-date-picker v-model="formData.receiptTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单状态(1进行中 2取消 3待取消 4已完成)" prop="orderStatus">
|
||||||
|
<el-select v-model="formData.orderStatus" placeholder="请选择订单状态(1进行中 2取消 3待取消 4已完成)">
|
||||||
|
<el-option v-for="item in order_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="pointsBonus">
|
||||||
|
<el-input v-model="formData.pointsBonus" placeholder="请输入赠送的积分数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单是否已结算(1未结算 2已结算)" prop="isSettled">
|
||||||
|
<el-select v-model="formData.isSettled" placeholder="请选择订单是否已结算(1未结算 2已结算)">
|
||||||
|
<el-option v-for="item in is_settled " :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="transactionId">
|
||||||
|
<el-input v-model="formData.transactionId" placeholder="请输入微信支付交易号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否已评价(1否 2是)" prop="isComment">
|
||||||
|
<el-select v-model="formData.isComment" placeholder="请选择是否已评价(1否 2是)">
|
||||||
|
<el-option v-for="item in is_comment " :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普通订单)" prop="orderSource">
|
||||||
|
<el-input v-model="formData.orderSource" placeholder="请输入订单来源(1普通订单)" />
|
||||||
|
</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 { addOrUpdateOrder } from '@/api/business/OrderManage/Orders/order.js';
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
await getpay_type()
|
||||||
|
await getpay_status()
|
||||||
|
await getdelivery_type()
|
||||||
|
await getdelivery_status()
|
||||||
|
await getreceipt_status()
|
||||||
|
await getorder_status()
|
||||||
|
await getis_settled()
|
||||||
|
await getis_comment()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 支付方式(1微信支付 2余额支付)字典选项列表
|
||||||
|
const pay_type = ref([]);
|
||||||
|
// 付款状态(1未付款 2已付款)字典选项列表
|
||||||
|
const pay_status = ref([]);
|
||||||
|
// 配送方式(1快递配送)字典选项列表
|
||||||
|
const delivery_type = ref([]);
|
||||||
|
// 发货状态(1未发货 2已发货)字典选项列表
|
||||||
|
const delivery_status = ref([]);
|
||||||
|
// 收货状态(1未收货 2已收货)字典选项列表
|
||||||
|
const receipt_status = ref([]);
|
||||||
|
// 订单状态(1进行中 2取消 3待取消 4已完成)字典选项列表
|
||||||
|
const order_status = ref([]);
|
||||||
|
// 订单是否已结算(1未结算 2已结算)字典选项列表
|
||||||
|
const is_settled = ref([]);
|
||||||
|
// 是否已评价(1否 2是)字典选项列表
|
||||||
|
const is_comment = ref([]);
|
||||||
|
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getpay_type() {
|
||||||
|
await proxy.getDicts('pay_type').then((res) => {
|
||||||
|
pay_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getpay_status() {
|
||||||
|
await proxy.getDicts('pay_status').then((res) => {
|
||||||
|
pay_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdelivery_type() {
|
||||||
|
await proxy.getDicts('delivery_type').then((res) => {
|
||||||
|
delivery_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdelivery_status() {
|
||||||
|
await proxy.getDicts('delivery_status').then((res) => {
|
||||||
|
delivery_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getreceipt_status() {
|
||||||
|
await proxy.getDicts('receipt_status').then((res) => {
|
||||||
|
receipt_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getorder_status() {
|
||||||
|
await proxy.getDicts('order_status').then((res) => {
|
||||||
|
order_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_settled() {
|
||||||
|
await proxy.getDicts('is_settled').then((res) => {
|
||||||
|
is_settled.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_comment() {
|
||||||
|
await proxy.getDicts('is_comment').then((res) => {
|
||||||
|
is_comment.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: "Order"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
orderGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsGuid: [{ required: true, message: "商品guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
paymentGuid: [{ required: true, message: "订单流水guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
orderNumber: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
|
||||||
|
goodsTotalAmoun: [{ required: true, message: "商品总金额不能为空", trigger: "blur" }],
|
||||||
|
orderAmount: [{ required: true, message: "订单金额不能为空", trigger: "blur" }],
|
||||||
|
payPrice: [{ required: true, message: "实际付款金额(包含运费)不能为空", trigger: "blur" }],
|
||||||
|
payType: [{ required: true, message: "支付方式(1微信支付 2余额支付)不能为空", trigger: "change", type: "number" }],
|
||||||
|
payStatus: [{ required: true, message: "付款状态(1未付款 2已付款)不能为空", trigger: "change", type: "number" }],
|
||||||
|
payTime: [{ required: true, message: "付款时间不能为空", trigger: "blur" }],
|
||||||
|
deliveryType: [{ required: true, message: "配送方式(1快递配送)不能为空", trigger: "change", type: "number" }],
|
||||||
|
expressPrice: [{ required: true, message: "运费金额不能为空", trigger: "blur" }],
|
||||||
|
deliveryStatus: [{ required: true, message: "发货状态(1未发货 2已发货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
receiptStatus: [{ required: true, message: "收货状态(1未收货 2已收货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderStatus: [{ required: true, message: "订单状态(1进行中 2取消 3待取消 4已完成)不能为空", trigger: "change", type: "number" }],
|
||||||
|
isSettled: [{ required: true, message: "订单是否已结算(1未结算 2已结算)不能为空", trigger: "change", type: "number" }],
|
||||||
|
isComment: [{ required: true, message: "是否已评价(1否 2是)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderSource: [{ required: true, message: "订单来源(1普通订单)不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleAddClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateOrder(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,349 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (订单/tb_order 详情弹窗)
|
||||||
|
* @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.goodsGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单流水guid" >
|
||||||
|
<el-input v-model="formData.paymentGuid" />
|
||||||
|
</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="店铺guid" >
|
||||||
|
<el-input v-model="formData.shopGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单号" >
|
||||||
|
<el-input v-model="formData.orderNumber" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品总金额" >
|
||||||
|
<el-input v-model="formData.goodsTotalAmoun" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单金额" >
|
||||||
|
<el-input v-model="formData.orderAmount" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券guid" >
|
||||||
|
<el-input v-model="formData.couponGuid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券抵扣金额" >
|
||||||
|
<el-input v-model="formData.couponMoney" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣金额" >
|
||||||
|
<el-input v-model="formData.pointsMoney" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣数量" >
|
||||||
|
<el-input v-model="formData.pointsNum" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际付款金额(包含运费)" >
|
||||||
|
<el-input v-model="formData.payPrice" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="后台修改的订单金额(差价)" >
|
||||||
|
<el-input v-model="formData.updatePrice" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="买家留言" >
|
||||||
|
<el-input v-model="formData.orderRemark" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="支付方式(1微信支付 2余额支付)" >
|
||||||
|
<el-select v-model="formData.payType" >
|
||||||
|
<el-option v-for="item in pay_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="付款状态(1未付款 2已付款)" >
|
||||||
|
<el-select v-model="formData.payStatus" >
|
||||||
|
<el-option v-for="item in pay_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-date-picker v-model="formData.payTime" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="配送方式(1快递配送)" >
|
||||||
|
<el-select v-model="formData.deliveryType" >
|
||||||
|
<el-option v-for="item in delivery_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-input v-model="formData.expressPrice" />
|
||||||
|
</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.logisticsCompany" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="物流单号" >
|
||||||
|
<el-input v-model="formData.logisticsTrackingNumber" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="发货状态(1未发货 2已发货)" >
|
||||||
|
<el-select v-model="formData.deliveryStatus" >
|
||||||
|
<el-option v-for="item in delivery_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-date-picker v-model="formData.deliveryTime" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="收货状态(1未收货 2已收货)" >
|
||||||
|
<el-select v-model="formData.receiptStatus" >
|
||||||
|
<el-option v-for="item in receipt_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-date-picker v-model="formData.receiptTime" type="datetime" :teleported="false" isabledStr}></el-date-picker>
|
||||||
|
</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.orderStatus" >
|
||||||
|
<el-option v-for="item in order_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.pointsBonus" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单是否已结算(1未结算 2已结算)" >
|
||||||
|
<el-select v-model="formData.isSettled" >
|
||||||
|
<el-option v-for="item in is_settled " :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.transactionId" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否已评价(1否 2是)" >
|
||||||
|
<el-select v-model="formData.isComment" >
|
||||||
|
<el-option v-for="item in is_comment " :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普通订单)" >
|
||||||
|
<el-input v-model="formData.orderSource" />
|
||||||
|
</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 getpay_type()
|
||||||
|
await getpay_status()
|
||||||
|
await getdelivery_type()
|
||||||
|
await getdelivery_status()
|
||||||
|
await getreceipt_status()
|
||||||
|
await getorder_status()
|
||||||
|
await getis_settled()
|
||||||
|
await getis_comment()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
// 支付方式(1微信支付 2余额支付)字典选项列表
|
||||||
|
const pay_type = ref([]);
|
||||||
|
// 付款状态(1未付款 2已付款)字典选项列表
|
||||||
|
const pay_status = ref([]);
|
||||||
|
// 配送方式(1快递配送)字典选项列表
|
||||||
|
const delivery_type = ref([]);
|
||||||
|
// 发货状态(1未发货 2已发货)字典选项列表
|
||||||
|
const delivery_status = ref([]);
|
||||||
|
// 收货状态(1未收货 2已收货)字典选项列表
|
||||||
|
const receipt_status = ref([]);
|
||||||
|
// 订单状态(1进行中 2取消 3待取消 4已完成)字典选项列表
|
||||||
|
const order_status = ref([]);
|
||||||
|
// 订单是否已结算(1未结算 2已结算)字典选项列表
|
||||||
|
const is_settled = ref([]);
|
||||||
|
// 是否已评价(1否 2是)字典选项列表
|
||||||
|
const is_comment = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getpay_type() {
|
||||||
|
await proxy.getDicts('pay_type').then((res) => {
|
||||||
|
pay_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getpay_status() {
|
||||||
|
await proxy.getDicts('pay_status').then((res) => {
|
||||||
|
pay_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdelivery_type() {
|
||||||
|
await proxy.getDicts('delivery_type').then((res) => {
|
||||||
|
delivery_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getdelivery_status() {
|
||||||
|
await proxy.getDicts('delivery_status').then((res) => {
|
||||||
|
delivery_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getreceipt_status() {
|
||||||
|
await proxy.getDicts('receipt_status').then((res) => {
|
||||||
|
receipt_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getorder_status() {
|
||||||
|
await proxy.getDicts('order_status').then((res) => {
|
||||||
|
order_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_settled() {
|
||||||
|
await proxy.getDicts('is_settled').then((res) => {
|
||||||
|
is_settled.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 字典获取
|
||||||
|
async function getis_comment() {
|
||||||
|
await proxy.getDicts('is_comment').then((res) => {
|
||||||
|
is_comment.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>
|
409
src/views/business/OrderManage/Orders/components/EditDialog.vue
Normal file
409
src/views/business/OrderManage/Orders/components/EditDialog.vue
Normal file
@ -0,0 +1,409 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (订单/tb_order 编辑弹窗)
|
||||||
|
* @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="goodsGuid">
|
||||||
|
<el-input v-model="formData.goodsGuid" placeholder="请输入商品guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单流水guid" prop="paymentGuid">
|
||||||
|
<el-input v-model="formData.paymentGuid" 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="店铺guid" prop="shopGuid">
|
||||||
|
<el-input v-model="formData.shopGuid" placeholder="请输入店铺guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单号" prop="orderNumber">
|
||||||
|
<el-input v-model="formData.orderNumber" placeholder="请输入订单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="商品总金额" prop="goodsTotalAmoun">
|
||||||
|
<el-input v-model="formData.goodsTotalAmoun" placeholder="请输入商品总金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单金额" prop="orderAmount">
|
||||||
|
<el-input v-model="formData.orderAmount" placeholder="请输入订单金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券guid" prop="couponGuid">
|
||||||
|
<el-input v-model="formData.couponGuid" placeholder="请输入优惠券guid" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="优惠券抵扣金额" prop="couponMoney">
|
||||||
|
<el-input v-model="formData.couponMoney" placeholder="请输入优惠券抵扣金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣金额" prop="pointsMoney">
|
||||||
|
<el-input v-model="formData.pointsMoney" placeholder="请输入积分抵扣金额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="积分抵扣数量" prop="pointsNum">
|
||||||
|
<el-input v-model="formData.pointsNum" placeholder="请输入积分抵扣数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="实际付款金额(包含运费)" prop="payPrice">
|
||||||
|
<el-input v-model="formData.payPrice" placeholder="请输入实际付款金额(包含运费)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="后台修改的订单金额(差价)" prop="updatePrice">
|
||||||
|
<el-input v-model="formData.updatePrice" placeholder="请输入后台修改的订单金额(差价)" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="买家留言" prop="orderRemark">
|
||||||
|
<el-input v-model="formData.orderRemark" placeholder="请输入买家留言" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="支付方式(1微信支付 2余额支付)" prop="payType">
|
||||||
|
<el-select v-model="formData.payType" placeholder="请选择支付方式(1微信支付 2余额支付)">
|
||||||
|
<el-option v-for="item in pay_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="付款状态(1未付款 2已付款)" prop="payStatus">
|
||||||
|
<el-select v-model="formData.payStatus" placeholder="请选择付款状态(1未付款 2已付款)">
|
||||||
|
<el-option v-for="item in pay_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="payTime">
|
||||||
|
<el-date-picker v-model="formData.payTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="配送方式(1快递配送)" prop="deliveryType">
|
||||||
|
<el-select v-model="formData.deliveryType" placeholder="请选择配送方式(1快递配送)">
|
||||||
|
<el-option v-for="item in delivery_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="expressPrice">
|
||||||
|
<el-input v-model="formData.expressPrice" placeholder="请输入运费金额" />
|
||||||
|
</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="logisticsCompany">
|
||||||
|
<el-input v-model="formData.logisticsCompany" placeholder="请输入物流公司" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="物流单号" prop="logisticsTrackingNumber">
|
||||||
|
<el-input v-model="formData.logisticsTrackingNumber" placeholder="请输入物流单号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="发货状态(1未发货 2已发货)" prop="deliveryStatus">
|
||||||
|
<el-select v-model="formData.deliveryStatus" placeholder="请选择发货状态(1未发货 2已发货)">
|
||||||
|
<el-option v-for="item in delivery_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="deliveryTime">
|
||||||
|
<el-date-picker v-model="formData.deliveryTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="收货状态(1未收货 2已收货)" prop="receiptStatus">
|
||||||
|
<el-select v-model="formData.receiptStatus" placeholder="请选择收货状态(1未收货 2已收货)">
|
||||||
|
<el-option v-for="item in receipt_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="receiptTime">
|
||||||
|
<el-date-picker v-model="formData.receiptTime" type="datetime" :teleported="false" placeholder="选择日期时间"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单状态(1进行中 2取消 3待取消 4已完成)" prop="orderStatus">
|
||||||
|
<el-select v-model="formData.orderStatus" placeholder="请选择订单状态(1进行中 2取消 3待取消 4已完成)">
|
||||||
|
<el-option v-for="item in order_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="pointsBonus">
|
||||||
|
<el-input v-model="formData.pointsBonus" placeholder="请输入赠送的积分数量" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="订单是否已结算(1未结算 2已结算)" prop="isSettled">
|
||||||
|
<el-select v-model="formData.isSettled" placeholder="请选择订单是否已结算(1未结算 2已结算)">
|
||||||
|
<el-option v-for="item in is_settled " :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="transactionId">
|
||||||
|
<el-input v-model="formData.transactionId" placeholder="请输入微信支付交易号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="是否已评价(1否 2是)" prop="isComment">
|
||||||
|
<el-select v-model="formData.isComment" placeholder="请选择是否已评价(1否 2是)">
|
||||||
|
<el-option v-for="item in is_comment " :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普通订单)" prop="orderSource">
|
||||||
|
<el-input v-model="formData.orderSource" placeholder="请输入订单来源(1普通订单)" />
|
||||||
|
</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 { addOrUpdateOrder } from "@/api/business/OrderManage/Orders/order.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getpay_type()
|
||||||
|
await getpay_status()
|
||||||
|
await getdelivery_type()
|
||||||
|
await getdelivery_status()
|
||||||
|
await getreceipt_status()
|
||||||
|
await getorder_status()
|
||||||
|
await getis_settled()
|
||||||
|
await getis_comment()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
// 支付方式(1微信支付 2余额支付)字典选项列表
|
||||||
|
const pay_type = ref([]);
|
||||||
|
// 付款状态(1未付款 2已付款)字典选项列表
|
||||||
|
const pay_status = ref([]);
|
||||||
|
// 配送方式(1快递配送)字典选项列表
|
||||||
|
const delivery_type = ref([]);
|
||||||
|
// 发货状态(1未发货 2已发货)字典选项列表
|
||||||
|
const delivery_status = ref([]);
|
||||||
|
// 收货状态(1未收货 2已收货)字典选项列表
|
||||||
|
const receipt_status = ref([]);
|
||||||
|
// 订单状态(1进行中 2取消 3待取消 4已完成)字典选项列表
|
||||||
|
const order_status = ref([]);
|
||||||
|
// 订单是否已结算(1未结算 2已结算)字典选项列表
|
||||||
|
const is_settled = ref([]);
|
||||||
|
// 是否已评价(1否 2是)字典选项列表
|
||||||
|
const is_comment = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
//字典获取
|
||||||
|
async function getpay_type() {
|
||||||
|
await proxy.getDicts('pay_type').then((res) => {
|
||||||
|
pay_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getpay_status() {
|
||||||
|
await proxy.getDicts('pay_status').then((res) => {
|
||||||
|
pay_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getdelivery_type() {
|
||||||
|
await proxy.getDicts('delivery_type').then((res) => {
|
||||||
|
delivery_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getdelivery_status() {
|
||||||
|
await proxy.getDicts('delivery_status').then((res) => {
|
||||||
|
delivery_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getreceipt_status() {
|
||||||
|
await proxy.getDicts('receipt_status').then((res) => {
|
||||||
|
receipt_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getorder_status() {
|
||||||
|
await proxy.getDicts('order_status').then((res) => {
|
||||||
|
order_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_settled() {
|
||||||
|
await proxy.getDicts('is_settled').then((res) => {
|
||||||
|
is_settled.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//字典获取
|
||||||
|
async function getis_comment() {
|
||||||
|
await proxy.getDicts('is_comment').then((res) => {
|
||||||
|
is_comment.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: "Order"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
orderGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
goodsGuid: [{ required: true, message: "商品guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
paymentGuid: [{ required: true, message: "订单流水guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
customerGuid: [{ required: true, message: "客户guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
orderNumber: [{ required: true, message: "订单号不能为空", trigger: "blur" }],
|
||||||
|
goodsTotalAmoun: [{ required: true, message: "商品总金额不能为空", trigger: "blur" }],
|
||||||
|
orderAmount: [{ required: true, message: "订单金额不能为空", trigger: "blur" }],
|
||||||
|
payPrice: [{ required: true, message: "实际付款金额(包含运费)不能为空", trigger: "blur" }],
|
||||||
|
payType: [{ required: true, message: "支付方式(1微信支付 2余额支付)不能为空", trigger: "change", type: "number" }],
|
||||||
|
payStatus: [{ required: true, message: "付款状态(1未付款 2已付款)不能为空", trigger: "change", type: "number" }],
|
||||||
|
payTime: [{ required: true, message: "付款时间不能为空", trigger: "blur" }],
|
||||||
|
deliveryType: [{ required: true, message: "配送方式(1快递配送)不能为空", trigger: "change", type: "number" }],
|
||||||
|
expressPrice: [{ required: true, message: "运费金额不能为空", trigger: "blur" }],
|
||||||
|
deliveryStatus: [{ required: true, message: "发货状态(1未发货 2已发货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
receiptStatus: [{ required: true, message: "收货状态(1未收货 2已收货)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderStatus: [{ required: true, message: "订单状态(1进行中 2取消 3待取消 4已完成)不能为空", trigger: "change", type: "number" }],
|
||||||
|
isSettled: [{ required: true, message: "订单是否已结算(1未结算 2已结算)不能为空", trigger: "change", type: "number" }],
|
||||||
|
isComment: [{ required: true, message: "是否已评价(1否 2是)不能为空", trigger: "change", type: "number" }],
|
||||||
|
orderSource: [{ required: true, message: "订单来源(1普通订单)不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
// 提交
|
||||||
|
const handleEditClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingStatus.value = true
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateOrder(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>
|
370
src/views/business/OrderManage/Orders/index.vue
Normal file
370
src/views/business/OrderManage/Orders/index.vue
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (订单/tb_order)
|
||||||
|
* @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="订单号" prop="orderNumber">
|
||||||
|
<el-input v-model="queryParams.orderNumber" placeholder="请输入订单号" clearable @keyup.enter="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付方式(1微信支付 2余额支付)" prop="payType">
|
||||||
|
<el-select v-model="queryParams.payType" placeholder="请选择支付方式(1微信支付 2余额支付)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in pay_type " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="付款状态(1未付款 2已付款)" prop="payStatus">
|
||||||
|
<el-select v-model="queryParams.payStatus" placeholder="请选择付款状态(1未付款 2已付款)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in pay_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="配送方式(1快递配送)" prop="deliveryType">
|
||||||
|
<el-select v-model="queryParams.deliveryType" placeholder="请选择配送方式(1快递配送)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in delivery_type " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物流单号" prop="logisticsTrackingNumber">
|
||||||
|
<el-input v-model="queryParams.logisticsTrackingNumber" placeholder="请输入物流单号" clearable @keyup.enter="handleQuery"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="发货状态(1未发货 2已发货)" prop="deliveryStatus">
|
||||||
|
<el-select v-model="queryParams.deliveryStatus" placeholder="请选择发货状态(1未发货 2已发货)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in delivery_status " :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收货状态(1未收货 2已收货)" prop="receiptStatus">
|
||||||
|
<el-select v-model="queryParams.receiptStatus" placeholder="请选择收货状态(1未收货 2已收货)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in receipt_status " :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="orderStatus">
|
||||||
|
<el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态(1进行中 2取消 3待取消 4已完成)" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="item in order_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:order: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:order: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:order: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="orderNumber" label="订单号" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="goodsTotalAmoun" label="商品总金额" align="center" />
|
||||||
|
<el-table-column prop="orderAmount" label="订单金额" align="center" />
|
||||||
|
<el-table-column prop="couponMoney" label="优惠券抵扣金额" align="center" />
|
||||||
|
<el-table-column prop="pointsMoney" label="积分抵扣金额" align="center" />
|
||||||
|
<el-table-column prop="pointsNum" label="积分抵扣数量" align="center" />
|
||||||
|
<el-table-column prop="payPrice" label="实际付款金额(包含运费)" align="center" />
|
||||||
|
<el-table-column prop="updatePrice" label="后台修改的订单金额(差价)" align="center" />
|
||||||
|
<el-table-column prop="orderRemark" label="买家留言" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="payType" label="支付方式(1微信支付 2余额支付)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" pay_type " :value="scope.row.payType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="payStatus" label="付款状态(1未付款 2已付款)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" pay_status " :value="scope.row.payStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="payTime" label="付款时间" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="deliveryType" label="配送方式(1快递配送)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" delivery_type " :value="scope.row.deliveryType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="expressPrice" label="运费金额" align="center" />
|
||||||
|
<el-table-column prop="logisticsCompany" label="物流公司" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="logisticsTrackingNumber" label="物流单号" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="deliveryStatus" label="发货状态(1未发货 2已发货)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" delivery_status " :value="scope.row.deliveryStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="deliveryTime" label="发货时间" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="receiptStatus" label="收货状态(1未收货 2已收货)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" receipt_status " :value="scope.row.receiptStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="receiptTime" label="收货时间" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="orderStatus" label="订单状态(1进行中 2取消 3待取消 4已完成)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" order_status " :value="scope.row.orderStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="pointsBonus" label="赠送的积分数量" align="center" />
|
||||||
|
<el-table-column prop="isSettled" label="订单是否已结算(1未结算 2已结算)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" is_settled " :value="scope.row.isSettled" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="transactionId" label="微信支付交易号" align="center" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="isComment" label="是否已评价(1否 2是)" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options=" is_comment " :value="scope.row.isComment" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="orderSource" label="订单来源(1普通订单)" align="center" />
|
||||||
|
|
||||||
|
<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:order:addOrUpdate']">编辑</el-button>
|
||||||
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:order: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="order">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { exportOrder, orderList , delOrder } from '@/api/business/OrderManage/Orders/order.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 pay_type = ref([]);
|
||||||
|
async function getpay_type() {
|
||||||
|
await proxy.getDicts('pay_type').then((res) => {
|
||||||
|
pay_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getpay_type()
|
||||||
|
// 字典获取
|
||||||
|
const pay_status = ref([]);
|
||||||
|
async function getpay_status() {
|
||||||
|
await proxy.getDicts('pay_status').then((res) => {
|
||||||
|
pay_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getpay_status()
|
||||||
|
// 字典获取
|
||||||
|
const delivery_type = ref([]);
|
||||||
|
async function getdelivery_type() {
|
||||||
|
await proxy.getDicts('delivery_type').then((res) => {
|
||||||
|
delivery_type.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getdelivery_type()
|
||||||
|
// 字典获取
|
||||||
|
const delivery_status = ref([]);
|
||||||
|
async function getdelivery_status() {
|
||||||
|
await proxy.getDicts('delivery_status').then((res) => {
|
||||||
|
delivery_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getdelivery_status()
|
||||||
|
// 字典获取
|
||||||
|
const receipt_status = ref([]);
|
||||||
|
async function getreceipt_status() {
|
||||||
|
await proxy.getDicts('receipt_status').then((res) => {
|
||||||
|
receipt_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getreceipt_status()
|
||||||
|
// 字典获取
|
||||||
|
const order_status = ref([]);
|
||||||
|
async function getorder_status() {
|
||||||
|
await proxy.getDicts('order_status').then((res) => {
|
||||||
|
order_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getorder_status()
|
||||||
|
// 字典获取
|
||||||
|
const is_settled = ref([]);
|
||||||
|
async function getis_settled() {
|
||||||
|
await proxy.getDicts('is_settled').then((res) => {
|
||||||
|
is_settled.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_settled()
|
||||||
|
// 字典获取
|
||||||
|
const is_comment = ref([]);
|
||||||
|
async function getis_comment() {
|
||||||
|
await proxy.getDicts('is_comment').then((res) => {
|
||||||
|
is_comment.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getis_comment()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//基础方法
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
function getList() {
|
||||||
|
loading.value = true
|
||||||
|
|
||||||
|
|
||||||
|
orderList(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.orderId)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置查询操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm('queryForm')
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.orderId || ids.value
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return delOrder(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
handleQuery()
|
||||||
|
modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport(row) {
|
||||||
|
const Ids = row.orderId || 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 exportOrder(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