提交 664c9a46 authored 作者: 袁伟伟's avatar 袁伟伟

feat: 批量订单发货单

上级 f0aea502
......@@ -13,11 +13,11 @@ VITE_PUBLIC_PATH=/
VITE_DROP_CONSOLE=false
# Basic interface address SPA
VITE_GLOB_API_URL=http://42.192.95.9:10083
#VITE_GLOB_API_URL=http://192.168.101.69:8087
VITE_GLOB_API_URL=http://192.168.101.69:8087
#VITE_GLOB_API_URL=http://42.192.95.9:10083
# File upload address, optional
VITE_GLOB_UPLOAD_URL=http://192.168.101.69:8087/v1/sys/upload
VITE_GLOB_UPLOAD_URL=http://42.192.95.9:10083/v1/sys/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
......@@ -162,9 +162,5 @@
</div>
</div>
<script type="module" src="/src/main.ts"></script>
<script src="/src/assets/lib/easeljs.min.js"></script>
<script src="/src/assets/lib/eventemitter2.js"></script>
<script src="/src/assets/lib/roslib.min.js"></script>
<script src="/src/assets/lib/ros2d.js"></script>
</body>
</html>
......@@ -5,6 +5,7 @@
*/
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
import { BatchOrderDetail } from './batchOrderDetail';
export interface BatchOrderParams extends BasePageParams {
/**
......@@ -130,6 +131,7 @@ export interface BatchOrderParams extends BasePageParams {
}
export interface BatchOrder {
batchOrderId: number | undefined;
/**
* ID系统自动生成
*/
......@@ -138,6 +140,7 @@ export interface BatchOrder {
* ID系统自动生成
*/
batchOrderDetailList?: Array<BatchOrderDetail>;
batchWorkOrderDetailList?: Array<BatchOrderDetail>;
/**
* 经销商id
*/
......
......@@ -83,6 +83,9 @@ export interface BatchOrderDetailParams extends BasePageParams {
}
export interface BatchOrderDetail {
batchWorkOrderDetailProductDetailList: any;
uuid: string;
batchOrderDetailProductDetailList: any;
/**
* ID系统自动生成
*/
......
......@@ -5,6 +5,7 @@
*/
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
import { BatchOrder } from './batchOrder';
import { OperationOrder } from './operationOrder';
export interface BatchWorkOrderParams extends BasePageParams {
......
......@@ -5,6 +5,8 @@
*/
import { BasePageParams, PageResult, ApiResponse } from './baseModel';
import { BatchOrder } from './batchOrder';
import { BatchOrderDetail } from './batchOrderDetail';
import { Hospital } from './hospital';
export interface OperationOrderParams extends BasePageParams {
......@@ -275,6 +277,7 @@ export interface OperationOrder {
* update_time
*/
updateTime?: Date;
batchOrderDetailList: BatchOrderDetail[];
}
export type OperationOrderPageResult = PageResult<OperationOrder>;
......
......@@ -13,26 +13,24 @@ import {
BatchWorkOrderPageResponse,
BatchWorkOrderResponse,
} from '../model/batchWorkOrder';
import { BatchOrder } from '../model/batchOrder';
const baseApi = '/v1/order/batch-work-order';
/**
* 新增
*/
export const add = (entity: BatchWorkOrder) =>
defHttp.post<BatchWorkOrder>({ url: `${baseApi}/`, data: entity });
export const add = (entity: BatchWorkOrder) => defHttp.post<BatchWorkOrder>({ url: `${baseApi}/`, data: entity });
/**
* 更新
*/
export const update = (entity: BatchWorkOrder) =>
defHttp.put<BatchWorkOrder>({ url: `${baseApi}/`, data: entity });
export const update = (entity: BatchWorkOrder) => defHttp.put<BatchWorkOrder>({ url: `${baseApi}/`, data: entity });
/**
* 删除
*/
export const remove = (id: any) =>
defHttp.delete<Number>({ url: `${baseApi}/${id}` });
export const remove = (id: any) => defHttp.delete<Number>({ url: `${baseApi}/${id}` });
/**
* 分页查询
......@@ -49,14 +47,12 @@ export const all = (params?: BatchWorkOrderParams) =>
/**
* 通过主键查询
*/
export const getById = (id: any) =>
defHttp.get<BatchWorkOrder>({ url: `${baseApi}/${id}` });
export const getById = (id: any) => defHttp.get<BatchWorkOrder>({ url: `${baseApi}/${id}` });
/**
* 单个查询
*/
export const getOne = (params?: BatchWorkOrderParams) =>
defHttp.get<BatchWorkOrder>({ url: `${baseApi}/one`, params });
export const getOne = (params?: BatchWorkOrderParams) => defHttp.get<BatchWorkOrder>({ url: `${baseApi}/one`, params });
/**
* 批量删除
......@@ -79,7 +75,9 @@ export const batchUpdate = (entityList: Array<BatchWorkOrder>) =>
/**
* 查询数量
*/
export const count = (params?: BatchWorkOrderParams) =>
defHttp.get<Number>({ url: `${baseApi}/count`, params });
export const count = (params?: BatchWorkOrderParams) => defHttp.get<Number>({ url: `${baseApi}/count`, params });
/**
* 新建发货单
*/
export const addInvoice = (data?: any) => defHttp.post({ url: `${baseApi}/create/send/order`, data });
......@@ -77,13 +77,15 @@ const getCartList = (productList) => {
item.cartProductDetailList.forEach((product) => {
product.uuid = item.goodsId + '-' + product.id;
product.type = item.goods.goodsType;
product.goodsType = item.goods.goodsType;
if (item.goodsType === 'KIT') {
product.basicQuantity = product.quantity / item.quantity;
}
product.name = item.goods.name;
});
});
productList.value = res;
console.log(res);
});
};
......
......@@ -23,6 +23,21 @@
rowKey="uuid"
:scroll="{ y: 450 }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'total'">
{{ record.goodsId ? '' : record.price * record.quantity }}
</template>
<template v-if="column.key === 'price'">
{{ record.goodsId ? '' : record.price }}
</template>
<template v-if="column.key === 'quantity'">
{{ record.goodsId ? '' : record.quantity }}
</template>
<template v-if="column.key === 'goodsType'">
<span v-if="record.goodsType === 'PRODUCT'">产品</span>
<span v-else-if="record.goodsType === 'KIT'">套件</span>
</template>
</template>
</a-table>
<div class="btnWrap">
<a-button
......@@ -90,8 +105,10 @@
return BatchOrderApi.getById(id.value).then((res: BatchOrder) => {
res.batchOrderDetailList?.forEach((item) => {
item.uuid = item.goodsId + '';
item.batchOrderDetailProductDetailList.forEach((el) => {
el.uuid = item.goodsId + '-' + el.id;
el.goodsType = item.goodsType;
});
});
productList.value = res.batchOrderDetailList;
......
......@@ -109,12 +109,12 @@ export const schema = {
},
{
field: 'distributorName',
label: '供应商名称',
label: '经销商',
defaultValue: undefined,
form: {
componentProps: {
allowClear: true,
placeholder: '供应商名称',
placeholder: '经销商',
},
colProps,
component: 'Input',
......@@ -418,7 +418,7 @@ const tableFields = [
'createTime',
];
const descriptionFields = [
'id',
// 'id',
'orderSn',
'exWarehouse',
'distributorName',
......@@ -489,54 +489,54 @@ export const detailColumns = [
dataIndex: 'thirdProductId',
key: 'thirdProductId',
},
{
title: '标识名称',
dataIndex: 'thirdProductId10',
key: 'thirdProductId10',
},
// {
// title: '标识名称',
// dataIndex: 'thirdProductId10',
// key: 'thirdProductId10',
// },
{
title: '产品名称',
dataIndex: 'name',
key: 'name',
},
{
title: '规格型号',
dataIndex: 'thirdProductId8',
key: 'thirdProductId8',
},
{
title: '单位',
dataIndex: 'thirdProductId7',
key: 'thirdProductId7',
},
// {
// title: '规格型号',
// dataIndex: 'thirdProductId8',
// key: 'thirdProductId8',
// },
// {
// title: '单位',
// dataIndex: 'thirdProductId7',
// key: 'thirdProductId7',
// },
{
title: '类型',
dataIndex: 'thirdProductId6',
key: 'thirdProductId6',
dataIndex: 'goodsType',
key: 'goodsType',
},
{
title: '订购数量',
dataIndex: 'quantity',
key: 'thirdProductId5',
},
{
title: '取消数量',
dataIndex: 'thirdProductId4',
key: 'thirdProductId4',
},
{
title: '发货数量',
dataIndex: 'thirdProductId3',
key: 'thirdProductId3',
key: 'quantity',
},
// {
// title: '取消数量',
// dataIndex: 'thirdProductId4',
// key: 'thirdProductId4',
// },
// {
// title: '发货数量',
// dataIndex: 'thirdProductId3',
// key: 'thirdProductId3',
// },
{
title: '单价',
dataIndex: 'thirdProductId2',
key: 'thirdProductId2',
dataIndex: 'price',
key: 'price',
},
{
title: '行总价',
dataIndex: 'thirdProductId1',
key: 'thirdProductId1',
title: '总价',
key: 'total',
},
];
<template>
<Card :bordered="false">
<Card :bordered="false" :loading="isLoading">
<Descriptions bordered :column="3">
<Descriptions.Item label="发货单号">
{{ id }}
</Descriptions.Item>
<Descriptions.Item
v-for="p in displayProps"
:key="p.title"
......@@ -8,52 +11,126 @@
:span="['avatar'].includes(p.name) ? 3 : 1"
>
<span v-if="p.key === 'avatar'">
<img :src="p.value" style="width: 120px; height: 120px" />
<ImagePreview :imageList="[p.value]" style="width: 120px" />
</span>
<template v-else>
{{ p.value }}
</template>
</Descriptions.Item>
</Descriptions>
<a-table
:dataSource="productList"
:columns="detailColumns"
:pagination="false"
childrenColumnName="batchWorkOrderDetailProductDetailList"
rowKey="uuid"
:scroll="{ y: 450 }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'total'">
{{ record.goodsId ? '' : record.price * record.quantity }}
</template>
<template v-if="column.key === 'price'">
{{ record.goodsId ? '' : record.price }}
</template>
<template v-if="column.key === 'ordered'">
{{ record.goodsId ? '' : record.ordered }}
</template>
<template v-if="column.key === 'quantity'">
{{ record.goodsId ? '' : record.quantity }}
</template>
<template v-if="column.key === 'goodsType'">
<span v-if="record.goodsType === 'PRODUCT'">产品</span>
<span v-else-if="record.goodsType === 'KIT'">套件</span>
</template>
</template>
</a-table>
</Card>
</template>
<script lang="ts" setup name="DeviceDetail">
import { onMounted, computed, ref, reactive } from 'vue';
import { useRoute } from 'vue-router';
<script lang="ts" setup>
import { onMounted, computed, ref } from 'vue';
import { Card, Descriptions } from 'ant-design-vue';
import { ComputedRef } from '@vue/reactivity';
import { Descriptions, Card } from 'ant-design-vue';
import { descriptionColumns } from './schema';
import { useAsyncState } from '@vueuse/core';
import * as BatchWorkOrderApi from '/@/api/order/batchWorkOrderApi';
import { Device } from '/@/api/model/device';
import { useRoute, useRouter } from 'vue-router';
import { descriptionColumns } from '/@/views/order/batch-order/schema';
import * as BatchOrderApi from '/@/api/order/batchOrderApi';
import { detailColumns } from '/@/views/order/batch-work-order/schema';
import { BatchOrderDetail } from '/@/api/model/batchOrderDetail';
import { BatchWorkOrder } from '/@/api/model/batchWorkOrder';
const route = useRoute();
const id = ref(route.params?.id);
let data = reactive({
detail: {},
isOver: false,
});
const getDetail = () => {
BatchWorkOrderApi.getById(id.value).then((res: Device) => {
data.isOver = true;
data.detail = res;
});
};
const batchOrderId = ref(route.query?.order);
onMounted(() => {
getDetail();
});
const {
state: detail,
isReady: isDetailReady,
isLoading,
execute,
} = useAsyncState(
() => {
return BatchOrderApi.getById(batchOrderId.value).then((res: BatchOrder) => {
return res;
});
},
null,
{
immediate: false,
},
);
const displayProps: ComputedRef<Array<any>> = computed(() => {
if (!data.isOver) return {};
if (!isDetailReady.value) return {};
const display: any = descriptionColumns.map(({ title, dataIndex = '', customRender }) => ({
key: dataIndex,
title,
value: customRender
? customRender({ text: data.detail[dataIndex], record: data.detail })
: data.detail[dataIndex],
? customRender({ text: detail.value[dataIndex], record: detail.value })
: detail.value[dataIndex],
}));
return display;
});
const productList = ref<BatchOrderDetail[] | undefined>();
const getOrderWorkDetail = () => {
BatchWorkOrderApi.getById(id.value)
.then((res: BatchWorkOrder) => {
const thirdProductId = {};
res.batchOrder?.batchOrderDetailList.forEach((item) => {
item.batchOrderDetailProductDetailList.forEach((el) => {
thirdProductId[el.thirdProductId] = el.quantity;
});
});
res.batchWorkOrderDetailList?.forEach((item) => {
item.uuid = item.goodsId + '';
item.batchWorkOrderDetailProductDetailList.forEach((el) => {
el.uuid = item.goodsId + '-' + el.id;
el.ordered = thirdProductId[el.thirdProductId];
el.goodsType = item.goodsType;
});
});
productList.value = res.batchWorkOrderDetailList;
console.log(res);
})
.finally(() => {
// tableLoading.value = false
});
};
onMounted(() => {
execute();
getOrderWorkDetail();
});
</script>
<style scoped></style>
<style scoped>
.ant-table-wrapper {
margin-top: 20px;
}
</style>
<template>
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="600px" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicDrawer>
</template>
<script lang="ts" setup name="BatchWorkOrderDrawer">
import { defineEmits, ref, computed, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './schema';
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
import * as BatchWorkOrderApi from '/@/api/order/batchWorkOrderApi';
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const entityId = ref(0);
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
labelWidth: 120,
schemas: formSchema,
showActionButtonGroup: false,
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
await resetFields();
setDrawerProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
entityId.value = data?.record?.id;
if (unref(isUpdate)) {
await setFieldsValue({
...data.record,
batchOrderId: { label: data.record.batch_orderName, value: data.record.batchOrderId },
});
}
});
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
async function handleSubmit() {
try {
const values = await validate();
setDrawerProps({ confirmLoading: true });
const {
batchOrderId,
...rest
} = values;
const action = !unref(isUpdate) ? BatchWorkOrderApi.add : BatchWorkOrderApi.update;
const data = !unref(isUpdate)
? {
...rest,
batchOrderId: batchOrderId.value,
batch_orderName: batchOrderId.label,
}
: Object.assign({},
{
...rest,
id: unref(entityId),
batchOrderId: batchOrderId.value,
batch_orderName: batchOrderId.label,
},
);
await action(data);
closeDrawer();
emit('success');
} finally {
setDrawerProps({ confirmLoading: false });
}
}
</script>
<template>
<a-modal
v-model:visible="visible"
:title="props.editId ? '编辑' : '新增'"
@ok="handleOk"
@cancel="handleCancel"
class="myModal"
width="1200px"
:confirm-loading="okLoading"
>
<div class="wrap">
<a-form
:model="formData"
name="basic"
ref="formRef"
layout="inline"
:label-col="{ span: 8 }"
:wrapper-col="{ span: 16 }"
autocomplete="off"
class="ant-row"
>
<a-form-item label="经销商" name="changeDistributorId">
<a-select
ref="select"
v-model:value="formData.changeDistributorId"
style="width: 200px"
@change="handleChangeDistributor"
>
<a-select-option :value="item.id" v-for="item in distributorList">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="订单" name="changeOrderId">
<a-select
ref="select"
v-model:value="formData.changeOrderId"
style="width: 200px"
@change="handleChangeOrder"
>
<a-select-option :value="item.id" v-for="item in orderList">{{ item.orderSn }}</a-select-option>
</a-select>
</a-form-item>
</a-form>
</div>
<a-table
:dataSource="productList"
:columns="detailColumns"
:pagination="false"
childrenColumnName="batchOrderDetailProductDetailList"
rowKey="uuid"
:scroll="{ y: 450 }"
:loading="tableLoading"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'total'">
{{ record.goodsId ? '' : record.price * record.quantity }}
</template>
<template v-if="column.key === 'price'">
{{ record.goodsId ? '' : record.price }}
</template>
<template v-if="column.key === 'ordered'">
{{ record.goodsId ? '' : record.ordered }}
</template>
<template v-if="column.key === 'quantity'">
<a-input-number v-model:value="record.quantity" :min="0" v-if="!record.goodsId" />
<span v-else></span>
</template>
<template v-if="column.key === 'goodsType'">
<span v-if="record.goodsType === 'PRODUCT'">产品</span>
<span v-else-if="record.goodsType === 'KIT'">套件</span>
</template>
</template>
</a-table>
</a-modal>
</template>
<script lang="ts" setup>
import { defineExpose, ref, reactive, defineEmits, watch, defineProps, onMounted } from 'vue';
import { detailColumns } from '/@/views/order/batch-work-order/schema';
import * as BatchOrderApi from '/@/api/order/batchOrderApi';
import * as DistributorApi from '/@/api/system/distributorApi';
import * as BatchWorkOrderApi from '/@/api/order/batchWorkOrderApi';
import lodash from 'lodash';
import { message } from 'ant-design-vue';
import { BatchOrder } from '/@/api/model/batchOrder';
import { Distributor } from '/@/api/model/distributor';
import { BatchOrderDetail } from '/@/api/model/batchOrderDetail';
const props = defineProps(['editId']);
const emits = defineEmits(['handleSuccess', 'update:editId']);
const visible = ref<boolean>(false);
const okLoading = ref(false);
const tableLoading = ref(false);
const handleOk = () => {
const orderClone = lodash.cloneDeep(order.value);
if (orderClone) {
orderClone.batchWorkOrderDetailList = orderClone.batchOrderDetailList;
orderClone.batchOrderId = orderClone.id;
orderClone.status = 'DELIVERED';
delete orderClone.batchOrderDetailList;
delete orderClone.id;
orderClone.batchWorkOrderDetailList?.forEach((item) => {
item.batchWorkOrderDetailProductDetailList = item.batchOrderDetailProductDetailList;
delete item.batchOrderDetailProductDetailList;
item.batchWorkOrderDetailProductDetailList.forEach((el) => {
el.batchWorkOrderDetailId = el.batchOrderDetailId;
delete el.batchOrderDetailId;
});
});
okLoading.value = true;
BatchWorkOrderApi.addInvoice(orderClone)
.then(() => {
message.success('新建成功');
handleCancel();
})
.finally(() => {
okLoading.value = false;
});
} else {
message.warning('请选择订单');
}
};
const handleCancel = () => {
distributorList.value = [];
orderList.value = [];
productList.value = [];
formData.changeDistributorId = formData.changeOrderId = '';
visible.value = false;
};
const open = () => {
visible.value = true;
getDistributorList();
};
const distributorList = ref<Distributor[] | []>([]);
const orderList = ref<BatchOrder[] | []>([]);
const productList = ref<BatchOrderDetail[] | undefined>();
const order = ref<BatchOrder>();
const formData = reactive({
changeDistributorId: '',
changeOrderId: '',
});
const getDistributorList = () => {
DistributorApi.all().then((res) => {
distributorList.value = res;
});
};
const handleChangeDistributor = (id: number) => {
BatchOrderApi.search({ pageNum: 1, pageSize: 99, distributorId: id, status: 'PASSED' }).then((res) => {
orderList.value = res.records;
});
};
const handleChangeOrder = (id: number) => {
tableLoading.value = true;
BatchOrderApi.getById(id)
.then((res: BatchOrder) => {
res.batchOrderDetailList?.forEach((item) => {
item.uuid = item.goodsId + '';
item.batchOrderDetailProductDetailList.forEach((el) => {
el.uuid = item.goodsId + '-' + el.id;
el.ordered = el.quantity;
el.goodsType = item.goodsType;
});
});
order.value = res;
productList.value = res.batchOrderDetailList;
})
.finally(() => {
tableLoading.value = false;
});
};
defineExpose({ open });
</script>
<style lang="less" scoped>
.wrap {
margin-bottom: 10px;
}
</style>
<template>
<div class="nav">
<ul>
<li>产品线</li>
<!-- <li>产品线</li> -->
<template v-for="(item, index) in navList">
<li v-if="index !== 4">|</li>
<li
class="title"
:class="{ active: navActiveKey === item.id || navId === item.id }"
@click="handleChangeNav(item.id)"
>{{ item.name }}</li
>
<li v-if="index !== navList.length - 1">|</li>
</template>
</ul>
</div>
......@@ -56,16 +56,25 @@
background: #f7f9fa;
text-align: center;
border-radius: 10px;
height: 50px;
overflow-x: auto;
overflow-y: hidden;
margin-bottom: 15px;
ul {
height: 50px;
padding: 5px;
padding: 5px 15px;
// width: 1200px;
display: flex;
justify-content: space-between;
li {
font-size: 20px;
height: 40px;
line-height: 40px;
display: inline-block;
// display: inline-block;
margin: 0 15px;
flex-shrink: 0;
}
.active {
......
......@@ -7,17 +7,20 @@
size="large"
@search="onSearch"
/>
<div class="shoppingCart" @click="handleGoShoppingCart">
<div class="shoppingCart" @click="handleGoShoppingCart" title="购物车">
<a-badge :count="shoppingCartNum">
<ShoppingCartOutlined />
</a-badge>
</div>
<div class="close" title="关闭商城" @click="handleClose">
<CloseCircleOutlined />
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, defineProps, onMounted, watch } from 'vue';
import { ShoppingCartOutlined } from '@ant-design/icons-vue';
import { ShoppingCartOutlined, CloseCircleOutlined } from '@ant-design/icons-vue';
import { useGo } from '/@/hooks/web/usePage';
import * as CartApi from '/@/api/order/cartApi';
import { useShoppingStoreWithOut } from '/@/store/modules/store';
......@@ -37,6 +40,10 @@
});
};
const handleClose = () => {
go('/main/dashboard', true);
};
watch(
() => shoppingStore.shoppingCartRefresh,
() => {
......@@ -67,7 +74,7 @@
height: 40px;
text-align: center;
position: absolute;
right: 20px;
right: 80px;
top: 0;
line-height: 40px;
font-size: 30px;
......@@ -84,5 +91,22 @@
font-size: 30px;
}
}
.close {
width: 40px;
height: 40px;
text-align: center;
position: absolute;
right: 20px;
top: 0;
line-height: 40px;
font-size: 25px;
cursor: pointer;
&:hover {
background: #eee;
border-radius: 50%;
}
}
}
</style>
......@@ -32,6 +32,9 @@
<p class="title">产品明细列表</p>
<a-table :dataSource="productList" :columns="columns" :pagination="false">
<template #bodyCell="{ column, record }">
<!-- <template v-if="column.key === 'name'">
{{ goodsInfo?.name }}
</template> -->
<template v-if="column.key === 'quantity'">
<a-input-number v-model:value="record.quantity" :min="0" :disabled="isKIT" />
</template>
......@@ -101,11 +104,13 @@
if (isPRODUCT.value) {
res.productList.forEach((item) => {
item.quantity = 0;
item.type = '产品';
});
} else if (isKIT.value) {
res.productList.forEach((item) => {
item.basicQuantity = item.quantity;
item.quantity = 0;
item.type = '套件';
});
}
......
......@@ -4,30 +4,30 @@ export const columns = [
dataIndex: 'thirdProductId',
key: 'thirdProductId',
},
{
title: '名称',
dataIndex: 'age',
key: 'age',
},
{
title: '描述信息',
dataIndex: 'address',
key: 'address',
},
{
title: '型号',
dataIndex: 'address1',
key: 'address1',
},
{
title: '包装',
dataIndex: 'address2',
key: 'address2',
},
// {
// title: '名称',
// dataIndex: 'name',
// key: 'name',
// },
// {
// title: '描述信息',
// dataIndex: 'address',
// key: 'address',
// },
// {
// title: '型号',
// dataIndex: 'address1',
// key: 'address1',
// },
// {
// title: '包装',
// dataIndex: 'address2',
// key: 'address2',
// },
{
title: '类型',
dataIndex: 'address2',
key: 'address2',
dataIndex: 'type',
key: 'type',
},
{
title: '数量',
......
......@@ -14,7 +14,7 @@
</a-tab-pane>
</a-tabs>
</div>
<dir class="wrap">
<div class="wrap">
<Nav v-model:navList="navList" v-model:navActiveKey="navActiveKey" />
<div class="bannerWrap">
<div class="banner">
......@@ -67,7 +67,7 @@
</div>
</div>
</div>
</dir>
</div>
</div>
<div class="lineList">
<div class="line" v-for="item in 3" :key="item">
......@@ -132,17 +132,22 @@
const init = (changeId?: number) => {
let idx = 0;
let findId = changeId ? changeId : id;
if (id || changeId) {
if (!findId) {
findId = localStorage.getItem('navActiveKey');
}
if (findId) {
idx = navList.value.findIndex((item) => {
return item.id === toNumber(findId);
});
if (idx === -1) idx = 0;
} else {
}
if (navList.value.length > 0) {
tabList.value = navList.value[idx]?.children;
navActiveKey.value = navList.value[idx]?.id;
activeTabKey.value = navList.value[idx]?.children[0]?.id;
tabList.value = navList.value[idx]?.children || [];
activeTabKey.value = tabList.value[0]?.id || undefined;
localStorage.setItem('navActiveKey', navActiveKey.value);
}
};
......
......@@ -28,6 +28,9 @@
<span v-if="record.goodsType === 'PRODUCT'">产品</span>
<span v-else-if="record.goodsType === 'KIT'">套件</span>
</template>
<template v-if="column.key === 'name'">
<span v-if="!record.name"> {{ record.goods.name }}</span>
</template>
<template v-if="column.key === 'quantity'">
<a-input-number
v-model:value="record.quantity"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论