From a742b56413b0bf76ae887bd5de12e4e83021cc45 Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 21 May 2025 11:33:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8D=95=E5=85=83=E6=A0=BC=E7=AE=A1?= =?UTF-8?q?=E7=90=86):=20=E6=96=B0=E5=A2=9E=E4=B8=BB=E6=9D=BFID=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=B9=B6=E4=BC=98=E5=8C=96=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在单元格管理和编辑功能中,新增了主板ID字段,并调整了表单布局以提升用户体验。同时,将单元格表单从对话框改为抽屉式布局,便于操作和查看。 --- src/api/cabinet/cabinet-cell.ts | 4 + .../cabinet/cabinet-cell/cell-edit-modal.vue | 84 ++++++++++--------- .../cabinet/cabinet-cell/cell-form-modal.vue | 80 +++++++++--------- src/views/cabinet/cabinet-cell/index.vue | 9 +- .../cabinet/smart-cabinet-card/detail.vue | 32 ++++++- src/views/user/ab98/detail.vue | 2 +- src/views/user/qy/detail.vue | 2 +- 7 files changed, 128 insertions(+), 85 deletions(-) diff --git a/src/api/cabinet/cabinet-cell.ts b/src/api/cabinet/cabinet-cell.ts index 7a10763..cc11ee6 100644 --- a/src/api/cabinet/cabinet-cell.ts +++ b/src/api/cabinet/cabinet-cell.ts @@ -44,6 +44,10 @@ export interface AddCabinetCellCommand { cellNo: number; /** 针脚序号 */ pinNo: number; + /** + * 关联主板ID + */ + mainboardId: number; /** 格口类型(1小格 2中格 3大格 4超大格) */ cellType: number; /** 使用状态(1空闲 2已占用) */ diff --git a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue index 7fbe37d..7537c76 100644 --- a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue +++ b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue @@ -9,6 +9,7 @@ import type { FormRules } from 'element-plus'; export interface FormDTO { cellId?: number; cabinetId: number; + mainboardId: number; cellNo: number; pinNo: number; cellType: number; @@ -27,11 +28,12 @@ const props = defineProps({ } }); -const emit = defineEmits(["update:visible", "refresh"]); +const emit = defineEmits(["update:modelValue", "refresh"]); const formRef = ref(); const formData = reactive({ cabinetId: null, + mainboardId: null, cellNo: null, pinNo: null, cellType: 1, @@ -44,6 +46,10 @@ const rules = reactive({ { required: true, message: "柜体ID必填", trigger: "blur" }, { type: 'number', message: '必须为数字类型' } ], + mainboardId: [ + { required: true, message: "主板ID必填", trigger: "blur" }, + { type: 'number', message: '必须为数字类型' } + ], cellNo: [ { required: true, message: "单元格号必填", trigger: "blur" }, { type: 'number', message: '必须为数字类型' } @@ -77,7 +83,7 @@ const handleConfirm = async () => { const closeDialog = () => { formRef.value.resetFields(); - emit("update:visible", false); + emit('update:modelValue', false); }; watch(() => props.row, (val) => { @@ -88,49 +94,49 @@ watch(() => props.row, (val) => { \ No newline at end of file diff --git a/src/views/cabinet/cabinet-cell/cell-form-modal.vue b/src/views/cabinet/cabinet-cell/cell-form-modal.vue index 4d26b22..4a92242 100644 --- a/src/views/cabinet/cabinet-cell/cell-form-modal.vue +++ b/src/views/cabinet/cabinet-cell/cell-form-modal.vue @@ -8,6 +8,7 @@ import type { FormRules } from 'element-plus'; export interface FormDTO { cabinetId: number; + mainboardId: number; cellNo: number; pinNo: number; cellType: number; @@ -28,11 +29,12 @@ const props = defineProps({ (window as any).cellProps = props; -const emit = defineEmits(["update:visible", "refresh"]); +const emit = defineEmits(["update:modelValue", "refresh"]); const formRef = ref(); const formData = reactive({ cabinetId: props.initialCabinetId, + mainboardId: null, cellNo: null, pinNo: null, cellType: 1, @@ -42,6 +44,10 @@ const formData = reactive({ const rules = reactive({ cabinetId: [], + mainboardId: [ + { required: true, message: "主板ID必填", trigger: "blur" }, + { type: 'number', message: '必须为数字类型' } + ], cellNo: [ { required: true, message: "单元格号必填", trigger: "blur" }, { type: 'number', message: '必须为数字类型' } @@ -76,52 +82,50 @@ const handleConfirm = async () => { const closeDialog = () => { formRef.value.resetFields(); - emit("update:visible", false); + emit("update:modelValue", false); }; \ No newline at end of file diff --git a/src/views/cabinet/cabinet-cell/index.vue b/src/views/cabinet/cabinet-cell/index.vue index 3ac7a02..212a70f 100644 --- a/src/views/cabinet/cabinet-cell/index.vue +++ b/src/views/cabinet/cabinet-cell/index.vue @@ -279,9 +279,12 @@ const switchCellType = (cellType: number) => { :page-sizes="[10, 20, 50]" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" @size-change="onSizeChange" @current-change="onCurrentChange" /> - - + + + + + + diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index f0f54fc..46ef045 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -16,6 +16,8 @@ import Delete from "@iconify-icons/ep/delete"; import AddFill from "@iconify-icons/ri/add-circle-line"; import Search from "@iconify-icons/ep/search"; import Refresh from "@iconify-icons/ep/refresh"; +import CellFormModal from "@/views/cabinet/cabinet-cell/cell-form-modal.vue"; +import CellEditModal from "@/views/cabinet/cabinet-cell/cell-edit-modal.vue"; import { getGoodsInfo } from "@/api/shop/goods"; import { CabinetMainboardDTO, deleteMainboard, getMainboardList, updateMainboard } from "@/api/cabinet/mainboards"; @@ -25,6 +27,7 @@ defineOptions({ const router = useRouter(); const route = useRoute(); +const currentCell = ref(); const cabinetInfo = ref({ cabinetName: "", cabinetType: 0, @@ -53,6 +56,8 @@ const cellPagination = ref({ }); const goodsConfigVisible = ref(false); const currentCellId = ref(); +const cellFormVisible = ref(false); +const cellEditVisible = ref(false); function handleConfigure(row: CabinetCellDTO) { currentCellId.value = row.cellId; @@ -109,6 +114,11 @@ async function handleClearGoods(row: CabinetCellDTO) { } } +function handleEditCell(row: CabinetCellDTO) { + currentCell.value = row; + cellEditVisible.value = true; +} + async function fetchCabinetDetail() { try { loading.value = true; @@ -286,13 +296,19 @@ onMounted(() => {
+
+ + 新增格口 + +
+ @@ -325,6 +341,10 @@ onMounted(() => { 配置商品 + + + 编辑格口 + 配置库存 @@ -370,6 +390,12 @@ onMounted(() => { + + + + + +
@@ -418,7 +444,7 @@ onMounted(() => { } .tab-header { - margin-bottom: 20px; + margin-bottom: 0px; } } \ No newline at end of file diff --git a/src/views/user/ab98/detail.vue b/src/views/user/ab98/detail.vue index 927b99a..abf0617 100644 --- a/src/views/user/ab98/detail.vue +++ b/src/views/user/ab98/detail.vue @@ -214,7 +214,7 @@ onMounted(() => { } .tab-header { - margin-bottom: 20px; + margin-bottom: 0px; } .order-item { diff --git a/src/views/user/qy/detail.vue b/src/views/user/qy/detail.vue index 46c74aa..0076755 100644 --- a/src/views/user/qy/detail.vue +++ b/src/views/user/qy/detail.vue @@ -222,7 +222,7 @@ async function handleModifyBalance(row: QyUserDTO) { } .tab-header { - margin-bottom: 20px; + margin-bottom: 0px; } } \ No newline at end of file