添加路由

This commit is contained in:
TimSpan 2025-05-15 16:18:56 +08:00
parent 36403c0355
commit 9e15ac71a9
10 changed files with 1545 additions and 219 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

File diff suppressed because one or more lines are too long

View File

@ -233,7 +233,45 @@ export const getPages = (): Promise<any> => {
}, },
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
} },
{
btnList: [],
children: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "LineMdAccount",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: true,
},
label: "是",
value: 0,
},
link: "",
name: "采购订单",
orderIndex: null,
parentId: "190734246592119193611",
path: "/personnelManagement/purchaseOrder",
redirect: "",
remark: "",
snowFlakeId: "190734430797981696211",
status: null,
type: {
extData: null,
label: "菜单",
value: "menu",
},
updateBy: null,
updateTime: null,
},
], ],
createBy: null, createBy: null,
createTime: null, createTime: null,
@ -394,7 +432,7 @@ export const getPages = (): Promise<any> => {
}, },
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
} },
], ],
createBy: null, createBy: null,
createTime: null, createTime: null,
@ -431,6 +469,122 @@ export const getPages = (): Promise<any> => {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
}, },
{
btnList: [],
children: [
{
btnList: [],
children: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "EosIconsRoleBinding",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
link: "",
name: "入库管理",
orderIndex: null,
parentId: "19047955670751027203123",
path: "/INandOUTManagement/InManagement",
redirect: "",
remark: "",
snowFlakeId: "190481257366081126431231",
status: null,
type: {
extData: null,
label: "菜单",
value: "menu",
},
updateBy: null,
updateTime: null,
},
{
btnList: [],
children: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "EosIconsRoleBinding",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
link: "",
name: "出库管理",
orderIndex: null,
parentId: "19047955670751027203123",
path: "/INandOUTManagement/OutManagement",
redirect: "",
remark: "",
snowFlakeId: "190481257366081154631231",
status: null,
type: {
extData: null,
label: "菜单",
value: "menu",
},
updateBy: null,
updateTime: null,
},
],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "LineMdCogFilledLoop",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
link: "",
name: "出入库管理",
orderIndex: null,
parentId: "0",
path: "/INandOUTManagement",
redirect: "/INandOUTManagement",
remark: "",
snowFlakeId: "19047955670751027203123",
status: null,
type: {
extData: null,
label: "目录",
value: "dir",
},
updateBy: null,
updateTime: null,
},
{ {
btnList: [], btnList: [],
children: [ children: [
@ -623,7 +777,7 @@ export const getPages = (): Promise<any> => {
}, },
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
} },
], ],
createBy: null, createBy: null,
createTime: null, createTime: null,
@ -734,6 +888,119 @@ export const getPages = (): Promise<any> => {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
}, },
{
btnList: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "LineMdAccount",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: true,
},
label: "是",
value: 0,
},
link: "",
name: "投诉与评价",
orderIndex: null,
parentId: "0",
path: "/ComplaintsAndEvaluations",
redirect: "",
remark: "",
snowFlakeId: "3123123123123123123",
status: null,
type: {
extData: null,
label: "目录",
value: "menu",
},
updateBy: null,
updateTime: null,
},
{
btnList: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "LineMdAccount",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: true,
},
label: "是",
value: 0,
},
link: "",
name: "智能预警中心",
orderIndex: null,
parentId: "0",
path: "/IntelligentEarlyWarningCenter",
redirect: "",
remark: "",
snowFlakeId: "78936789123689123678912",
status: null,
type: {
extData: null,
label: "目录",
value: "menu",
},
updateBy: null,
updateTime: null,
},
{
btnList: [],
createBy: null,
createTime: null,
deleteFlag: null,
icon: "LineMdAccount",
isFull: {
extData: {
boolVal: false,
},
label: "否",
value: 1,
},
isKeepAlive: {
extData: {
boolVal: true,
},
label: "是",
value: 0,
},
link: "",
name: "结算管理",
orderIndex: null,
parentId: "0",
path: "/SettlementManagement",
redirect: "",
remark: "",
snowFlakeId: "8975894375893467836",
status: null,
type: {
extData: null,
label: "目录",
value: "menu",
},
updateBy: null,
updateTime: null,
},
{ {
btnList: [], btnList: [],
createBy: null, createBy: null,
@ -770,7 +1037,7 @@ export const getPages = (): Promise<any> => {
}, },
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
} },
], ],
message: "操作成功!", message: "操作成功!",
}); });

View File

@ -0,0 +1,4 @@
<template>
<div>投诉与评价</div>
</template>
<script setup></script>

View File

@ -0,0 +1,4 @@
<template>
<div>入库管理</div>
</template>
<script setup></script>

View File

@ -0,0 +1,4 @@
<template>
<div>出库管理</div>
</template>
<script setup></script>

View File

@ -0,0 +1,4 @@
<template>
<div>智能预警中心</div>
</template>
<script setup></script>

View File

@ -0,0 +1,4 @@
<template>
<div>结算管理</div>
</template>
<script setup></script>

View File

@ -1,11 +1,29 @@
<template> <template>
<div class="departmentStructure"> <div class="departmentStructure">
<TablePro ref="tableRef" :request-api="reqApi" :search-form-options="searchFormOptions" :columns="columns" <TablePro
ref="tableRef"
:request-api="reqApi"
:search-form-options="searchFormOptions"
:columns="columns"
:single-line="false" :single-line="false"
:isPageTable="true"> :isPageTable="true"
>
<template #headerExtra> <template #headerExtra>
<n-button strong secondary type="primary" @click="addDepartmentStructure"> 添加库存</n-button> <n-button
<n-button strong secondary type="primary" > 导入</n-button> strong
secondary
type="primary"
@click="addDepartmentStructure"
>
添加库存
</n-button>
<n-button
strong
secondary
type="primary"
>
导入
</n-button>
</template> </template>
</TablePro> </TablePro>
</div> </div>
@ -14,9 +32,15 @@
import { NButton, useModal, type FormInst } from "naive-ui"; import { NButton, useModal, type FormInst } from "naive-ui";
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import type { modelDefaultValue } from "@/views/personnelManagement/departmentStructure/index.ts"; import type { modelDefaultValue } from "@/views/personnelManagement/departmentStructure/index.ts";
import { TablePro, type TableProProps, FormPro, type FormItemOptions, type TableProInst } from "@/components"; import {
TablePro,
type TableProProps,
FormPro,
type FormItemOptions,
type TableProInst,
} from "@/components";
type TableType = TableProProps<any, any> type TableType = TableProProps<any, any>;
import api from "@/axios"; import api from "@/axios";
const modal = useModal(); const modal = useModal();
@ -32,6 +56,7 @@
records: [ records: [
{ {
commodity: "金煌芒果", commodity: "金煌芒果",
price: "19元",
specifications: "无", specifications: "无",
brand: "无", brand: "无",
units: "斤", units: "斤",
@ -39,21 +64,23 @@
inventory: 99, inventory: 99,
maxNumber: 99, maxNumber: 99,
warningValue: 10, warningValue: 10,
replenishment: "否" replenishment: "否",
}, },
{ {
commodity: "大红薯", commodity: "大红薯",
specifications: "无", specifications: "无",
price: "19元",
brand: "无", brand: "无",
units: "斤", units: "斤",
commodityType: "蔬菜豆制品", commodityType: "蔬菜豆制品",
inventory: 99, inventory: 99,
maxNumber: 99, maxNumber: 99,
warningValue: 10, warningValue: 10,
replenishment: "是" replenishment: "是",
}, },
{ {
commodity: "紫叶生菜", commodity: "紫叶生菜",
price: "19元",
specifications: "无", specifications: "无",
brand: "无", brand: "无",
units: "斤", units: "斤",
@ -61,9 +88,11 @@
inventory: 99, inventory: 99,
maxNumber: 99, maxNumber: 99,
warningValue: 10, warningValue: 10,
replenishment: "否" replenishment: "否",
}, { },
{
commodity: "芥菜", commodity: "芥菜",
price: "19元",
specifications: "无", specifications: "无",
brand: "无", brand: "无",
units: "斤", units: "斤",
@ -71,20 +100,20 @@
inventory: 99, inventory: 99,
maxNumber: 99, maxNumber: 99,
warningValue: 10, warningValue: 10,
replenishment: "是" replenishment: "是",
} },
], ],
size: "5", size: "5",
total: "10", total: "10",
}, },
success: "成功" success: "成功",
}); });
}); });
}; };
const searchFormOptions = reactive<TableType["searchFormOptions"]>({ const searchFormOptions = reactive<TableType["searchFormOptions"]>({
name: { name: {
type: "input", type: "input",
label: "名称" label: "名称",
}, },
type: { type: {
type: "select", type: "select",
@ -92,104 +121,115 @@
options: [ options: [
{ {
value: "蔬菜豆制品", value: "蔬菜豆制品",
label: "蔬菜豆制品" label: "蔬菜豆制品",
}, },
{ {
value: "肉类", value: "肉类",
label: "肉类" label: "肉类",
}, },
{ {
value: "禽类", value: "禽类",
label: "禽类" label: "禽类",
}, },
{ {
value: "烧腊类", value: "烧腊类",
label: "烧腊类" label: "烧腊类",
}, },
{ {
value: "水产冻货", value: "水产冻货",
label: "水产冻货" label: "水产冻货",
}, },
{ {
value: "豆品蛋类", value: "豆品蛋类",
label: "豆品蛋类" label: "豆品蛋类",
}, },
{ {
value: "米油杂粮", value: "米油杂粮",
label: "米油杂粮" label: "米油杂粮",
}, },
{ {
value: "调料干货", value: "调料干货",
label: "调料干货" label: "调料干货",
}, },
{ {
value: "厨房用品", value: "厨房用品",
label: "厨房用品" label: "厨房用品",
}, },
{ {
value: "饮品", value: "饮品",
label: "饮品" label: "饮品",
} },
] ],
}, },
goods: { goods: {
type: "select", type: "select",
label: "是否急需补货", label: "是否急需补货",
options: [{ options: [
{
value: "否", value: "否",
label: "否" label: "否",
}, { },
{
value: "是", value: "是",
label: "是" label: "是",
}], },
} ],
},
}); });
const columns = ref<TableType["columns"]>([ const columns = ref<TableType["columns"]>([
{ {
key: "commodity", key: "commodity",
title: "商品名称", title: "商品名称",
width: 150 width: 150,
},
{
key: "price",
title: "采购价格",
width: 150,
render: (value) => {
return <span>{`${value.price}/${value.units}`}</span>;
},
}, },
{ {
key: "specifications", key: "specifications",
title: "规格", title: "规格",
width: 150 width: 50,
}, },
{ {
key: "brand", key: "brand",
title: "品牌", title: "品牌",
width: 150 width: 150,
}, },
{ {
key: "units", key: "units",
title: "单位", title: "单位",
width: 150 width: 50,
}, },
{ {
key: "commodityType", key: "commodityType",
title: "商品类型", title: "商品类型",
width: 150 width: 150,
}, },
{ {
key: "inventory", key: "inventory",
title: "库存", title: "库存",
width: 150 width: 150,
}, },
{ {
key: "maxNumber", key: "maxNumber",
title: "最大数量", title: "最大数量",
width: 150 width: 150,
}, },
{ {
key: "warningValue", key: "warningValue",
title: "警戒值", title: "警戒值",
width: 150 width: 150,
}, },
{ {
key: "replenishment", key: "replenishment",
title: "急需补货", title: "急需补货",
width: 150 width: 150,
}, },
{ {
key: "", key: "",
@ -201,43 +241,48 @@
strong strong
secondary secondary
style={{ marginLeft: "10px" }} style={{ marginLeft: "10px" }}
type='warning' type="warning"
onClick={() => { onClick={() => {
console.log(value,'000'); console.log(value, "000");
title.value = `修改库存` title.value = `修改库存`;
userValue.value.commodity = value.commodity userValue.value.commodity = value.commodity;
userValue.value.brand = value.brand userValue.value.brand = value.brand;
userValue.value.warningValue = value.warningValue userValue.value.warningValue = value.warningValue;
userValue.value.units = value.units userValue.value.units = value.units;
userValue.value.inventory = value.inventory userValue.value.inventory = value.inventory;
userValue.value.maxNumber = value.maxNumber userValue.value.maxNumber = value.maxNumber;
userValue.value.specifications = value.specifications userValue.value.specifications = value.specifications;
userValue.value.commodityType = value.commodityType userValue.value.commodityType = value.commodityType;
modalRef.value = modal.create({ modalRef.value = modal.create({
title: title.value, title: title.value,
preset: 'card', preset: "card",
style: { style: {
width: '600px', width: "600px",
}, },
content: () => ( content: () => (
<> <>
<FormPro labelWidth='100' ref={form} v-model:value={userValue.value} form-item-options={formOptionsUser} /> <FormPro
labelWidth="100"
ref={form}
v-model:value={userValue.value}
form-item-options={formOptionsUser}
/>
</> </>
), ),
footer: () => ( footer: () => (
<div <div
style={{ style={{
display: 'flex', display: "flex",
justifyContent: 'flex-end', justifyContent: "flex-end",
}} }}
> >
<n-button <n-button
loading={loading.value} loading={loading.value}
style={{ marginRight: '10px' }} style={{ marginRight: "10px" }}
type='primary' type="primary"
onClick={() => { onClick={() => {
resetModelValue() resetModelValue();
// addUserOrUpdate(value.snowFlakeId) // addUserOrUpdate(value.snowFlakeId)
}} }}
> >
@ -245,8 +290,8 @@
</n-button> </n-button>
<n-button <n-button
onClick={() => { onClick={() => {
modalRef.value.destroy() modalRef.value.destroy();
resetModelValue() resetModelValue();
}} }}
> >
取消 取消
@ -254,22 +299,25 @@
</div> </div>
), ),
onAfterLeave: () => { onAfterLeave: () => {
resetModelValue() resetModelValue();
}, },
}) });
}} }}
>编辑</n-button> >
<n-button type="error" style={{ margin: "0 10px" }}> 编辑
</n-button>
<n-button
type="error"
style={{ margin: "0 10px" }}
>
删除 删除
</n-button> </n-button>
</div> </div>
); );
} },
} },
]); ]);
const userDefaultValue: modelDefaultValue = { const userDefaultValue: modelDefaultValue = {
// snowFlakeId: "", // snowFlakeId: "",
commodity: "", commodity: "",
@ -279,121 +327,120 @@
commodityType: "", commodityType: "",
inventory: "", inventory: "",
maxNumber: "", maxNumber: "",
warningValue: "" warningValue: "",
// replenishment:'' // replenishment:''
}; };
const userValue = ref<modelDefaultValue>({ const userValue = ref<modelDefaultValue>({
...userDefaultValue ...userDefaultValue,
}); });
const resetModelValue = () => { const resetModelValue = () => {
userValue.value = { ...userDefaultValue }; userValue.value = { ...userDefaultValue };
title.value = '新增库存' title.value = "新增库存";
}; };
const addUserOrUpdate = () => { const addUserOrUpdate = () => {
form.value?.validate().then(() => { form.value?.validate().then(() => {
// loading.value = true // loading.value = true
});
}) };
}
const formOptionsUser = reactive<FormItemOptions<any>>({ const formOptionsUser = reactive<FormItemOptions<any>>({
// form // form
commodity: { commodity: {
type: 'input', type: "input",
label: '商品名称', label: "商品名称",
required: true, required: true,
}, },
specifications: { specifications: {
type: 'input', type: "input",
label: '规格要求', label: "规格要求",
}, },
brand: { brand: {
type:'input', type: "input",
label: '品牌', label: "品牌",
}, },
units: { units: {
type:'select', type: "select",
label: '单位', label: "单位",
required: true, required: true,
options: [ options: [
{ {
value: 0, value: 0,
label:'个' label: "个",
}, },
{ {
value: 1, value: 1,
label:'斤' label: "斤",
}, },
{ {
value: 2, value: 2,
label:'袋' label: "袋",
}, },
] ],
}, },
inventory: { inventory: {
type:'inputNumber', type: "inputNumber",
label: '库存数量', label: "库存数量",
required: true, required: true,
}, },
maxNumber: { maxNumber: {
type:'inputNumber', type: "inputNumber",
label:'最大数量', label: "最大数量",
required: true, required: true,
}, },
warningValue: { warningValue: {
type:'inputNumber', type: "inputNumber",
label:'警戒值', label: "警戒值",
required: true, required: true,
}, },
commodityType: { commodityType: {
type:'radioGroup', type: "radioGroup",
label:' 采购类型', label: " 采购类型",
required: true, required: true,
options: [ options: [
{ {
value: 0, value: 0,
label: "蔬菜豆制品" label: "蔬菜豆制品",
}, },
{ {
value: 1, value: 1,
label: "肉类" label: "肉类",
}, },
{ {
value: 2, value: 2,
label: "禽类" label: "禽类",
}, },
{ {
value: 3, value: 3,
label: "烧腊类" label: "烧腊类",
}, },
{ {
value: 4, value: 4,
label: "水产冻货" label: "水产冻货",
}, },
{ {
value: 5, value: 5,
label: "豆品蛋类" label: "豆品蛋类",
}, },
{ {
value: 6, value: 6,
label: "米油杂粮" label: "米油杂粮",
}, },
{ {
value: 7, value: 7,
label: "调料干货" label: "调料干货",
}, },
{ {
value: 8, value: 8,
label: "厨房用品" label: "厨房用品",
}, },
{ {
value: 9, value: 9,
label: "饮品" label: "饮品",
} },
] ],
} },
}); });
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const modalRef = ref(); const modalRef = ref();
@ -403,34 +450,39 @@
title: title.value, title: title.value,
preset: "card", preset: "card",
style: { style: {
width: "600px" width: "600px",
}, },
content: () => ( content: () => (
<> <>
<FormPro labelWidth="100" ref={form} v-model:value={userValue.value} form-item-options={formOptionsUser}></FormPro> <FormPro
labelWidth="100"
ref={form}
v-model:value={userValue.value}
form-item-options={formOptionsUser}
></FormPro>
</> </>
), ),
footer: () => ( footer: () => (
<div <div
style={{ style={{
display: 'flex', display: "flex",
justifyContent: 'flex-end', justifyContent: "flex-end",
}} }}
> >
<n-button <n-button
loading={loading.value} loading={loading.value}
style={{ marginRight: '10px' }} style={{ marginRight: "10px" }}
type='primary' type="primary"
onClick={() => { onClick={() => {
addUserOrUpdate() addUserOrUpdate();
}} }}
> >
确认 确认
</n-button> </n-button>
<n-button <n-button
onClick={() => { onClick={() => {
modalRef.value.destroy() modalRef.value.destroy();
resetModelValue() resetModelValue();
}} }}
> >
取消 取消
@ -438,13 +490,12 @@
</div> </div>
), ),
onAfterLeave: () => { onAfterLeave: () => {
resetModelValue() resetModelValue();
}, },
}); });
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.departmentStructure { .departmentStructure {
} }
</style> </style>

View File

@ -0,0 +1,4 @@
<template>
<div>采购订单下发</div>
</template>
<script setup></script>