Commit 4bf76094 by zhuzhequan

工厂端仓库

parent ba93e883
...@@ -32,6 +32,17 @@ export interface factoryWarehouseInfo { ...@@ -32,6 +32,17 @@ export interface factoryWarehouseInfo {
warehouseId?: string warehouseId?: string
locationName?: string locationName?: string
remark?: string remark?: string
idList?: string | number[]
}
export interface ExportFactoryWarehouseInfo {
pageSize?: number
currentPage?: number
total?: number
warehouseId?: string
locationName?: string
remark?: string
idList?: string | number[]
} }
export interface WarehouseInventory { export interface WarehouseInventory {
...@@ -136,6 +147,12 @@ export function getFactoryLocation(data: factoryWarehouseInfo) { ...@@ -136,6 +147,12 @@ export function getFactoryLocation(data: factoryWarehouseInfo) {
data, data,
) )
} }
export function exportWarehouseInfo(data: ExportFactoryWarehouseInfo) {
return axios.post<never, BasePaginationData<positionInfo>>(
'factoryWarehouseInventory/inventory',
data,
)
}
export function getFactoryWarehouseInfo(data: factoryWarehouseInfo) { export function getFactoryWarehouseInfo(data: factoryWarehouseInfo) {
return axios.post<never, BasePaginationData<warehouseInfo>>( return axios.post<never, BasePaginationData<warehouseInfo>>(
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
getWarehouseInventoryInfo, getWarehouseInventoryInfo,
factoryLogWarehouseLog, factoryLogWarehouseLog,
LogListData, LogListData,
WarehouseWarning, factoryWarehouseInventoryPrint, WarehouseWarning, factoryWarehouseInventoryPrint, exportWarehouseInfo,
} from '@/api/warehouse.ts' } from '@/api/warehouse.ts'
import { ref } from 'vue' import { ref } from 'vue'
import SplitDiv from '@/components/splitDiv/splitDiv.vue' import SplitDiv from '@/components/splitDiv/splitDiv.vue'
...@@ -37,6 +37,7 @@ const pagination = ref<factoryWarehouseInfo>({ ...@@ -37,6 +37,7 @@ const pagination = ref<factoryWarehouseInfo>({
total: 0, total: 0,
}) })
const showPrintDialog = ref(false) const showPrintDialog = ref(false)
const exportLoading = ref(false)
const clickItem = (row: WarehouseWarning) => { const clickItem = (row: WarehouseWarning) => {
if (!row) return if (!row) return
getDetail(row.id) getDetail(row.id)
...@@ -76,6 +77,28 @@ async function handlePrintProductTag() { ...@@ -76,6 +77,28 @@ async function handlePrintProductTag() {
window.open(filePath + res.message, '_blank') window.open(filePath + res.message, '_blank')
} }
async function exportData() {
if(!selections.value.length) {
return ElMessage.warning('请选择数据')
}
exportLoading.value = true
const ids: number[] = []
selections.value.forEach(el => {
if (el.id) ids.push(Number(el.id))
})
try {
const res = await exportWarehouseInfo({
...searchForm.value,
idList: ids,
})
window.open(filePath + res.message, '_blank')
exportLoading.value = false
}catch (e) {
exportLoading.value = false
}
}
async function printProductTag() { async function printProductTag() {
if (!selections.value.length) { if (!selections.value.length) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
...@@ -191,7 +214,9 @@ getWarehouse() ...@@ -191,7 +214,9 @@ getWarehouse()
<el-form-item style="margin-top: 5px"> <el-form-item style="margin-top: 5px">
<el-button type="primary" @click="printProductTag">打印商品SKU标签</el-button> <el-button type="primary" @click="printProductTag">打印商品SKU标签</el-button>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 5px">
<el-button :loading="exportLoading" type="success" @click="exportData">导出</el-button>
</el-form-item>
</el-form> </el-form>
</el-card> </el-card>
</template> </template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment