修复:智能判断订单商品orderGoods和订单信息orderInfo的显示问题
This commit is contained in:
@@ -53,8 +53,8 @@ export async function addCmsDomain(data: CmsDomain) {
|
||||
* 修改网站域名记录表
|
||||
*/
|
||||
export async function updateCmsDomain(data: CmsDomain) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-domain',
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/cms/cms-domain/domain',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { ShopOrderGoods } from '@/api/shop/shopOrderGoods/model';
|
||||
import { OrderInfo } from '@/api/shop/orderInfo/model';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -23,6 +25,10 @@ export interface Order {
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
couponId?: number;
|
||||
cardId?: number;
|
||||
confirmId?: number;
|
||||
icCard?: string;
|
||||
userId?: number;
|
||||
// 用户id
|
||||
uid?: number;
|
||||
// 使用的优惠券id
|
||||
@@ -37,6 +43,7 @@ export interface Order {
|
||||
code?: string;
|
||||
// 真实姓名
|
||||
name?: string;
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 订单总额
|
||||
@@ -89,6 +96,8 @@ export interface Order {
|
||||
expirationTime?: string;
|
||||
// 对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
isSettled?: boolean;
|
||||
version?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
@@ -97,6 +106,8 @@ export interface Order {
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
orderInfo?: OrderInfo[];
|
||||
orderGoods?: ShopOrderGoods[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
106
src/api/shop/orderGoods/index.ts
Normal file
106
src/api/shop/orderGoods/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderGoods, OrderGoodsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrderGoods(params: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
|
||||
MODULES_API_URL + '/shop/order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrderGoods(params?: OrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<OrderGoods[]>>(
|
||||
MODULES_API_URL + '/shop/order-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addOrderGoods(data: OrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrderGoods(data: OrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrderGoods(id: number) {
|
||||
const res = await request.get<ApiResult<OrderGoods>>(
|
||||
MODULES_API_URL + '/shop/order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
58
src/api/shop/orderGoods/model/index.ts
Normal file
58
src/api/shop/orderGoods/model/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface OrderGoods {
|
||||
//
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
oid?: number;
|
||||
// 关联场馆id
|
||||
sid?: number;
|
||||
// 关联场地id
|
||||
fid?: number;
|
||||
// 场馆
|
||||
siteName?: string;
|
||||
// 场地
|
||||
fieldName?: string;
|
||||
// 预约时间段
|
||||
dateTime?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 成人人数
|
||||
adultNum?: string;
|
||||
// 儿童人数
|
||||
childrenNum?: string;
|
||||
// 1已付款,2未付款,3无需付款或占用状态
|
||||
payStatus?: string;
|
||||
// 是否免费:1免费、2收费
|
||||
isFree?: string;
|
||||
// 是否支持儿童票:1支持,2不支持
|
||||
isChildren?: string;
|
||||
// 预订类型:1全场,2半场
|
||||
type?: string;
|
||||
// 组合数据:日期+时间段+场馆id+场地id
|
||||
mergeData?: string;
|
||||
// 开场时间
|
||||
startTime?: number;
|
||||
// 下单时间
|
||||
orderTime?: number;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderGoodsParam extends PageParam {
|
||||
id?: number;
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -2,13 +2,7 @@
|
||||
<a-image-preview-group>
|
||||
<a-space>
|
||||
<template v-for="(item, index) in data" :key="index">
|
||||
<div class="image-upload-item" v-if="type == 'video'">
|
||||
{{ item.url }}
|
||||
<a class="image-upload-close" @click="onDeleteItem(index)">
|
||||
<CloseOutlined />
|
||||
</a>
|
||||
</div>
|
||||
<div class="image-upload-item" v-else>
|
||||
<div class="image-upload-item" v-if="isImage(item.url)">
|
||||
<a-image
|
||||
:style="{
|
||||
border: '1px dashed var(--grey-7)',
|
||||
@@ -21,6 +15,12 @@
|
||||
<CloseOutlined />
|
||||
</a>
|
||||
</div>
|
||||
<div v-else class="image-upload-item">
|
||||
<YoutubeOutlined />
|
||||
<a class="image-upload-close" @click="onDeleteItem(index)">
|
||||
<CloseOutlined />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<a-button
|
||||
@click="openEdit"
|
||||
@@ -44,10 +44,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
||||
import { PlusOutlined, CloseOutlined, YoutubeOutlined } from '@ant-design/icons-vue';
|
||||
import { ref } from 'vue';
|
||||
import SelectData from './components/select-data.vue';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
import { isImage } from "@/utils/common";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@@ -97,7 +97,6 @@ export function openSpmUrl(path: string, d?: any, id = 0): void {
|
||||
|
||||
// 跳转页面
|
||||
url.value = `${domain}${path}${spm.value}${token.value}`;
|
||||
console.log(url.value, 'domain>>>>');
|
||||
window.open(`${url.value}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, htmlToText, uuid } from 'ele-admin-pro';
|
||||
import { addArticle, updateArticle } from "@/api/cms/article";
|
||||
import { addArticle, getArticle, updateArticle } from "@/api/cms/article";
|
||||
import { Article } from '@/api/cms/article/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -137,6 +137,8 @@
|
||||
import { listArticleCategory } from "@/api/cms/category";
|
||||
import { Navigation } from "@/api/cms/navigation/model";
|
||||
import SourceSelect from "@/views/cms/article/dictionary/source-select.vue";
|
||||
import { getCmsArticleContent } from "@/api/cms/cmsArticleContent";
|
||||
import { isImage } from "@/utils/common";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -175,7 +177,6 @@
|
||||
const active = ref('base');
|
||||
|
||||
const spec = ref<SpecValue[]>([]);
|
||||
const showSpecForm = ref(false);
|
||||
const files = ref<ItemType[]>([]);
|
||||
const category = ref<string[]>([]);
|
||||
const takeaway = ref<ArticleCategory[]>([]);
|
||||
@@ -453,16 +454,24 @@
|
||||
category.value = [];
|
||||
files.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if (props.data.image) {
|
||||
// 文章详情
|
||||
getArticle(Number(props.data?.articleId)).then(data => {
|
||||
|
||||
assignObject(form, data);
|
||||
|
||||
if (data.content){
|
||||
content.value = data.content;
|
||||
}
|
||||
|
||||
if (data.image) {
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
url: data.image,
|
||||
status: 'done'
|
||||
});
|
||||
}
|
||||
if(props.data.files){
|
||||
const arr = JSON.parse(props.data.files)
|
||||
if(data.files){
|
||||
const arr = JSON.parse(data.files)
|
||||
arr.map((url:string) => {
|
||||
files.value.push({
|
||||
uid: uuid(),
|
||||
@@ -472,6 +481,19 @@
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 外卖文章分类
|
||||
listArticleCategory({merchantId: props.merchantId}).then(list => {
|
||||
takeaway.value = list
|
||||
})
|
||||
|
||||
|
||||
// assignObject(form, props.data);
|
||||
|
||||
|
||||
// 文章分类
|
||||
// if(props.data.categoryParent){
|
||||
// category.value.push(props.data.categoryParent);
|
||||
@@ -479,13 +501,6 @@
|
||||
// if(props.data.categoryChildren){
|
||||
// category.value.push(props.data.categoryChildren);
|
||||
// }
|
||||
if (props.data.content){
|
||||
content.value = props.data.content;
|
||||
}
|
||||
// 外卖文章分类
|
||||
listArticleCategory({merchantId: props.merchantId}).then(list => {
|
||||
takeaway.value = list
|
||||
})
|
||||
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
<a-tag v-if="record.type === 1">实物文章</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="80" />
|
||||
<a-image v-if="isImage(record.image)" :src="record.image" :width="80" />
|
||||
<span v-else class="text-gray-400">[文件]</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'salePrice'">
|
||||
¥{{ formatNumber(record.salePrice) }}
|
||||
@@ -67,7 +68,8 @@
|
||||
:color="record.status == 0 ? 'green' : 'red'"
|
||||
class="cursor-pointer"
|
||||
@click="onUpdate(record)"
|
||||
>{{ record.statusText }}</a-tag
|
||||
>{{ record.statusText }}
|
||||
</a-tag
|
||||
>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
@@ -99,28 +101,28 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, watch } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { createVNode, ref, watch } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import type { EleProTable } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import ArticleEdit from './components/articleEdit.vue';
|
||||
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import Search from "./components/search.vue";
|
||||
import ArticleEdit from "./components/articleEdit.vue";
|
||||
import {
|
||||
pageArticle,
|
||||
removeArticle,
|
||||
removeBatchArticle
|
||||
} from '@/api/cms/article';
|
||||
import type { Article, ArticleParam } from '@/api/cms/article/model';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
import router from '@/router';
|
||||
import { toTreeData } from 'ele-admin-pro';
|
||||
import { openSpmUrl } from '@/utils/common';
|
||||
import { listNavigation } from '@/api/cms/navigation';
|
||||
import { Navigation } from '@/api/cms/navigation/model';
|
||||
} from "@/api/cms/article";
|
||||
import type { Article, ArticleParam } from "@/api/cms/article/model";
|
||||
import { formatNumber } from "ele-admin-pro/es";
|
||||
import router from "@/router";
|
||||
import { toTreeData } from "ele-admin-pro";
|
||||
import { isImage, openSpmUrl } from "@/utils/common";
|
||||
import { listNavigation } from "@/api/cms/navigation";
|
||||
import { Navigation } from "@/api/cms/navigation/model";
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -158,91 +160,91 @@
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'articleId',
|
||||
key: 'articleId',
|
||||
align: 'center',
|
||||
title: "ID",
|
||||
dataIndex: "articleId",
|
||||
key: "articleId",
|
||||
align: "center",
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '封面图',
|
||||
dataIndex: 'image',
|
||||
key: 'image',
|
||||
title: "封面图",
|
||||
dataIndex: "image",
|
||||
key: "image",
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: '文章标题',
|
||||
dataIndex: 'title',
|
||||
key: 'title'
|
||||
title: "文章标题",
|
||||
dataIndex: "title",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: '栏目名称',
|
||||
dataIndex: 'categoryName',
|
||||
key: 'categoryName',
|
||||
title: "栏目名称",
|
||||
dataIndex: "categoryName",
|
||||
key: "categoryName",
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: '所属栏目',
|
||||
dataIndex: 'categoryId',
|
||||
key: 'categoryId',
|
||||
align: 'center',
|
||||
title: "所属栏目",
|
||||
dataIndex: "categoryId",
|
||||
key: "categoryId",
|
||||
align: "center",
|
||||
hideInTable: true
|
||||
},
|
||||
{
|
||||
title: '实际阅读量',
|
||||
dataIndex: 'actualViews',
|
||||
key: 'actualViews',
|
||||
title: "实际阅读量",
|
||||
dataIndex: "actualViews",
|
||||
key: "actualViews",
|
||||
sorter: true,
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: '虚拟阅读量',
|
||||
dataIndex: 'virtualViews',
|
||||
key: 'virtualViews',
|
||||
title: "虚拟阅读量",
|
||||
dataIndex: "virtualViews",
|
||||
key: "virtualViews",
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: '推荐',
|
||||
dataIndex: 'recommend',
|
||||
key: 'recommend',
|
||||
title: "推荐",
|
||||
dataIndex: "recommend",
|
||||
key: "recommend",
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
align: "center",
|
||||
hideInTable: true
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
title: "状态",
|
||||
dataIndex: "status",
|
||||
key: "status",
|
||||
sorter: true,
|
||||
width: 120,
|
||||
align: 'center'
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
title: "排序号",
|
||||
dataIndex: "sortNumber",
|
||||
key: "sortNumber",
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
align: "center",
|
||||
hideInTable: true
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
title: "创建时间",
|
||||
dataIndex: "createTime",
|
||||
key: "createTime",
|
||||
align: "center",
|
||||
width: 180,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
fixed: "right",
|
||||
align: "center",
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
@@ -277,7 +279,7 @@
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: Article) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeArticle(row.articleId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -293,16 +295,16 @@
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
message.error("请至少选择一条数据");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeBatchArticle(selection.value.map((d) => d.articleId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
@@ -338,13 +340,13 @@
|
||||
data: res?.map((d) => {
|
||||
d.value = d.navigationId;
|
||||
d.label = d.title;
|
||||
if (d.model != 'article') {
|
||||
if (d.model != "article") {
|
||||
d.disabled = true;
|
||||
}
|
||||
return d;
|
||||
}),
|
||||
idField: 'navigationId',
|
||||
parentIdField: 'parentId'
|
||||
idField: "navigationId",
|
||||
parentIdField: "parentId"
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -365,6 +367,6 @@
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'ArticleV2'
|
||||
name: "ArticleV2"
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -53,15 +53,10 @@
|
||||
<span class="cursor-pointer" v-if="isDirectory(record)"></span>
|
||||
<span
|
||||
v-else
|
||||
@click="openSpmUrl(record.path, record, record.navigationId)"
|
||||
@click="openSpmUrl(`https://${record.tenantId}.wsdns.cn${record.path}`, record, record.navigationId)"
|
||||
class="ele-text-placeholder cursor-pointer"
|
||||
>{{ record.path }}</span
|
||||
>
|
||||
<!-- <span-->
|
||||
<!-- class="ele-text-placeholder cursor-pointer"-->
|
||||
<!-- @click="openSpmUrl(record.path, record, record.navigationId)"-->
|
||||
<!-- >{{ record.path }}</span-->
|
||||
<!-- >-->
|
||||
</template>
|
||||
<template v-if="column.key === 'component'">
|
||||
<template v-if="!isDirectory(record)">
|
||||
|
||||
@@ -147,6 +147,8 @@
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
import { checkExistence } from '@/api/cms/domain';
|
||||
import { updateCmsWebsite } from '@/api/cms/cmsWebsite';
|
||||
import { updateCmsDomain } from '@/api/cms/cmsDomain';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -318,12 +320,8 @@
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
tenantId: localStorage.getItem('TenantId')
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateWebsite : addWebsite;
|
||||
saveOrUpdate(formData)
|
||||
saveOrUpdate(form)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
@@ -333,6 +331,10 @@
|
||||
} else {
|
||||
localStorage.setItem('Domain', `${form.websiteCode}.wsdns.cn`);
|
||||
}
|
||||
updateCmsDomain({
|
||||
websiteId: form.websiteId,
|
||||
domain: `${form.websiteCode}.wsdns.cn`
|
||||
});
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:footer="null"
|
||||
@ok="save"
|
||||
>
|
||||
<a-card class="order-card" :bordered="false">
|
||||
<a-card class="order-card" :bordered="false" v-if="form">
|
||||
<a-descriptions title="基本信息" :column="3">
|
||||
<a-descriptions-item
|
||||
label="订单号"
|
||||
@@ -139,10 +139,24 @@
|
||||
<a-card class="order-card" :bordered="false">
|
||||
<a-spin :spinning="loading">
|
||||
<a-table
|
||||
:data-source="form.orderInfoList"
|
||||
v-if="form.orderInfo && form.orderInfo.length > 0"
|
||||
:data-source="form.orderInfo"
|
||||
:columns="columns"
|
||||
:pagination="false"
|
||||
/>
|
||||
<a-table
|
||||
v-if="form.orderGoods && form.orderGoods.length > 0"
|
||||
:data-source="form.orderGoods"
|
||||
:columns="columnsGoods"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'goodsName'">
|
||||
<a-avatar :src="record.image" :size="40" />
|
||||
<span style="margin-left: 8px">{{ record.goodsName }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</ele-modal>
|
||||
@@ -150,7 +164,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { Order } from '@/api/shop/order/model';
|
||||
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
@@ -160,6 +174,8 @@
|
||||
CoffeeOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { pageOrderInfo } from '@/api/shop/orderInfo';
|
||||
import { pageOrderGoods } from '@/api/shop/orderGoods';
|
||||
import record from "@/views/cms/design/record/index.vue";
|
||||
|
||||
const useForm = Form.useForm;
|
||||
|
||||
@@ -230,12 +246,12 @@
|
||||
payPrice: undefined,
|
||||
price: undefined,
|
||||
money: undefined,
|
||||
payType: undefined,
|
||||
refundMoney: undefined,
|
||||
coachPrice: undefined,
|
||||
coachId: undefined,
|
||||
payType: undefined,
|
||||
payStatus: undefined,
|
||||
orderStatus: undefined,
|
||||
payStatus: undefined,
|
||||
couponType: undefined,
|
||||
couponDesc: undefined,
|
||||
qrcode: undefined,
|
||||
@@ -250,14 +266,11 @@
|
||||
isSettled: undefined,
|
||||
version: undefined,
|
||||
userId: undefined,
|
||||
deleted: undefined,
|
||||
tenantId: undefined,
|
||||
updateTime: undefined,
|
||||
createTime: undefined,
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100,
|
||||
orderInfoList: []
|
||||
orderGoods: [],
|
||||
orderInfo: []
|
||||
});
|
||||
|
||||
// 请求状态
|
||||
@@ -292,6 +305,28 @@
|
||||
}
|
||||
]);
|
||||
|
||||
const columnsGoods = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '商品名称',
|
||||
dataIndex: 'goodsName',
|
||||
key: 'goodsName'
|
||||
},
|
||||
{
|
||||
title: '商品规格',
|
||||
dataIndex: 'spec'
|
||||
},
|
||||
{
|
||||
title: '购买数量',
|
||||
dataIndex: 'totalNum',
|
||||
key: 'totalNum'
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'price',
|
||||
customRender: ({ text }) => '¥' + text
|
||||
}
|
||||
]);
|
||||
|
||||
/* 制作步骤条 */
|
||||
const loadSteps = (order) => {
|
||||
steps.value = [];
|
||||
@@ -368,8 +403,12 @@
|
||||
if (props.data) {
|
||||
loading.value = true;
|
||||
assignObject(form, props.data);
|
||||
pageOrderGoods({ orderId: form.orderId }).then((res) => {
|
||||
form.orderGoods = res?.list;
|
||||
loading.value = false;
|
||||
});
|
||||
pageOrderInfo({ oid: form.orderId }).then((res) => {
|
||||
form.orderInfoList = res?.list;
|
||||
form.orderInfo = res?.list;
|
||||
loading.value = false;
|
||||
});
|
||||
loadSteps(props.data);
|
||||
|
||||
Reference in New Issue
Block a user