Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
fa45796edd
2 files changed
+41
-40
No files matched your search
@@ -21,10 +21,7 @@
|
|||||||
border
|
border
|
||||||
:cell-style="tableStyle.cellStyle"
|
:cell-style="tableStyle.cellStyle"
|
||||||
:header-cell-style="tableStyle.headerCellStyle"
|
:header-cell-style="tableStyle.headerCellStyle"
|
||||||
@selection-change="selectionChangHandle"
|
|
||||||
@sort-change="sortChangeHandle"
|
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="40" align="center" />
|
|
||||||
<el-table-column type="index" label="#" width="80" />
|
<el-table-column type="index" label="#" width="80" />
|
||||||
<el-table-column prop="name" width="120" label="商品名" />
|
<el-table-column prop="name" width="120" label="商品名" />
|
||||||
<el-table-column prop="pic" width="120" label="商品图片">
|
<el-table-column prop="pic" width="120" label="商品图片">
|
||||||
@@ -76,15 +73,14 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="150">
|
<el-table-column label="操作" fixed="right" width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button text type="primary" @click="confirmPutaway">点击上架</el-button>
|
<el-button text type="primary" @click="confirmPutaway(row)">点击上架</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">关闭</el-button>
|
||||||
<el-button type="primary" @click="onConfirm" :disabled="loading">确认上架</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -96,45 +92,45 @@ import { useDict } from "/@/hooks/dict"
|
|||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
import { useMessage } from "/@/hooks/message"
|
import { useMessage } from "/@/hooks/message"
|
||||||
|
|
||||||
|
const emit = defineEmits(["refreshDoor"])
|
||||||
|
|
||||||
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
const selectObjs = ref([]) as any
|
|
||||||
const multiple = ref(false)
|
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
pageList: hardSpu.pageJoin,
|
pageList: hardSpu.pageJoin,
|
||||||
})
|
})
|
||||||
|
const curPos = reactive<{
|
||||||
|
hardId: string
|
||||||
|
floorIndex: number | undefined
|
||||||
|
posIndex: number | undefined
|
||||||
|
}>({ hardId: "", floorIndex: undefined, posIndex: undefined })
|
||||||
|
|
||||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, tableStyle } = useTable(state)
|
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
|
||||||
|
|
||||||
// 多选事件
|
|
||||||
const selectionChangHandle = (objs: { id: string }[]) => {
|
|
||||||
selectObjs.value = objs.map(({ id }) => id)
|
|
||||||
multiple.value = !objs.length
|
|
||||||
}
|
|
||||||
|
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
// 清空搜索条件
|
|
||||||
queryRef.value?.resetFields()
|
queryRef.value?.resetFields()
|
||||||
// 清空多选
|
|
||||||
selectObjs.value = []
|
|
||||||
getDataList()
|
getDataList()
|
||||||
}
|
}
|
||||||
|
|
||||||
const openDialog = async (id: string) => {
|
const openDialog = (hardId: string, floorIndex: number, posIndex: number) => {
|
||||||
if (!id) return useMessage().error("设备id不存在")
|
if (!hardId) return useMessage().error("设备id不存在")
|
||||||
visible.value = true
|
|
||||||
resetQuery()
|
resetQuery()
|
||||||
|
|
||||||
|
curPos.hardId = hardId
|
||||||
|
curPos.floorIndex = floorIndex
|
||||||
|
curPos.posIndex = posIndex
|
||||||
|
|
||||||
|
visible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确认上架
|
// 确认上架
|
||||||
const confirmPutaway = async () => {}
|
const confirmPutaway = (row: any) => {
|
||||||
|
emit("refreshDoor", row, curPos)
|
||||||
// 确认选择
|
visible.value = false
|
||||||
const onConfirm = async () => {}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openDialog,
|
openDialog,
|
||||||
|
|||||||
@@ -52,18 +52,19 @@
|
|||||||
|
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="114514-1">
|
<el-tab-pane label="114514-1">
|
||||||
<div v-for="(item, index) in new Array(6).fill('某层')" :key="index">
|
<div v-for="(floorItem, floorIndex) in state.doorGoods" :key="floorIndex">
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<div class="text-black flex items-center">
|
<div class="text-black flex items-center">
|
||||||
<div class="text-center w-24 text-lg font-bold">第 {{ index + 1 }} 层:</div>
|
<div class="text-center w-24 text-lg font-bold">第 {{ floorIndex + 1 }} 层:</div>
|
||||||
<div class="flex flex-wrap">
|
<div class="flex flex-wrap">
|
||||||
<div
|
<div class="flex flex-col items-center justify-start" v-for="(item, posIndex) in floorItem" :key="posIndex">
|
||||||
class="bg-blue-50 w-20 h-20 border border-black mx-4 my-2 flex items-center justify-center cursor-pointer rounded"
|
<div
|
||||||
v-for="(item, index) in new Array(10).fill('某品')"
|
class="bg-blue-50 w-20 h-20 border border-black mx-4 my-1 flex items-center justify-center cursor-pointer rounded-lg"
|
||||||
:key="index"
|
@click="clickPutaway(floorIndex, posIndex)"
|
||||||
@click="clickPutaway"
|
>
|
||||||
>
|
<span>点击上架</span>
|
||||||
点击上架
|
</div>
|
||||||
|
<div class="h-10">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,17 +81,17 @@
|
|||||||
<volume-setting ref="volumeSettingRef" @refreshVolume="refreshVolume" />
|
<volume-setting ref="volumeSettingRef" @refreshVolume="refreshVolume" />
|
||||||
|
|
||||||
<!-- 商品上架 -->
|
<!-- 商品上架 -->
|
||||||
<goods-putaway ref="goodsPutawayRef" />
|
<goods-putaway ref="goodsPutawayRef" @refreshDoor="refreshDoor" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="systemHardDoorManager">
|
<script setup lang="ts" name="hardDoorManager">
|
||||||
import { onMounted, ref } from "vue"
|
import { onMounted, ref } from "vue"
|
||||||
import { useMessage } from "/@/hooks/message"
|
import { useMessage } from "/@/hooks/message"
|
||||||
import { displayPrice } from "/@/utils/formatMoney"
|
import { displayPrice } from "/@/utils/formatMoney"
|
||||||
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
|
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
|
||||||
|
|
||||||
const InfoSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
|
const InfoSetting = defineAsyncComponent(() => import("./info-setting.vue"))
|
||||||
const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
|
const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
|
||||||
const GoodsPutaway = defineAsyncComponent(() => import("./goods-putaway.vue"))
|
const GoodsPutaway = defineAsyncComponent(() => import("./goods-putaway.vue"))
|
||||||
|
|
||||||
@@ -101,6 +102,7 @@ const state = reactive<any>({
|
|||||||
mediaVolume: "",
|
mediaVolume: "",
|
||||||
systemVolume: "",
|
systemVolume: "",
|
||||||
queryForm: {},
|
queryForm: {},
|
||||||
|
doorGoods: new Array(6).fill([]).map(() => new Array(10).fill({})),
|
||||||
})
|
})
|
||||||
const infoSettingRef = ref()
|
const infoSettingRef = ref()
|
||||||
const volumeSettingRef = ref()
|
const volumeSettingRef = ref()
|
||||||
@@ -145,11 +147,14 @@ const refreshVolume = (data: { hardId: string; mediaVolume: number; systemVolume
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 点击上架
|
// 点击上架
|
||||||
const clickPutaway = () => {
|
const clickPutaway = (floorIndex: number, posIndex: number) => {
|
||||||
if (goodsPutawayRef.value) {
|
if (goodsPutawayRef.value) {
|
||||||
goodsPutawayRef.value.openDialog(doorSettingData.value.hardId)
|
goodsPutawayRef.value.openDialog(doorSettingData.value.hardId, floorIndex, posIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const refreshDoor = (row: any, curPos: { hardId: string; floorIndex: number; posIndex: number }) => {
|
||||||
|
state.doorGoods[curPos.floorIndex][curPos.posIndex] = row
|
||||||
|
}
|
||||||
|
|
||||||
const doRefresh = async () => {
|
const doRefresh = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user