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