Commit b13106f6 by wuqian

入库单查询

parent 57115abd
......@@ -9,6 +9,7 @@ import {
ILocation,
AnyObject,
InterProductList,
ExportInWarehouseInfo
} from '@/types/api/warehouse'
export interface LogListData {
createTime: string
......@@ -80,7 +81,7 @@ export interface WarehouseInventory {
occupyInventory: string
inventoryStart: string
inventoryEnd: string
productNumber: string
productNo: string
freezeInventory: string
inventory: string
usableInventoryStart: string
......@@ -313,6 +314,12 @@ export function InRecordBatchCheckPrintApi(ids: string) {
},
)
}
export function warehouseInRecordInventory(data: ExportInWarehouseInfo) {
return axios.post<never, BasePaginationData<never>>(
'factory/warehouseInRecord/inventory',
data,
)
}
export function warehouseInRecordListPageApi(
data: warehouseSearchForm,
currentPage: number,
......
......@@ -3,11 +3,11 @@ export type AnyObject = {
}
export interface warehouseSearchForm {
billStatus?: string
batchNumber?: string
createTimeEnd?: string
createTimeStart?: string
orderNumber?: string
sku?: string
inNo?: string
outNo?: string
warehouseSku?: string
warehouseId?: number | string
id?: number
}
......@@ -56,6 +56,11 @@ export interface InterWarehousePage extends InterWarehouseBase {}
export interface InterWarehouseDetail extends InterWarehouseBase {
productList: InterProductList[]
}
export interface ExportInWarehouseInfo extends warehouseSearchForm {
total?: number
idList?: string | number[]
showDetail?: boolean
}
export interface InterWarehouseTree {
id?: number
code?: string | null
......
......@@ -63,35 +63,27 @@
value-format="YYYY-MM-DD HH:mm:ss"
/>
</ElFormItem>
<ElFormItem label="单号">
<ElFormItem label="出库单号">
<ElInput
v-model="searchForm.orderNumber"
v-model.trim="searchForm.outNo"
clearable
placeholder="请输入出库单号"
style="width: 160px"
/>
</ElFormItem>
<ElFormItem label="交货单号">
<ElInput
v-model="searchForm.batchNumber"
clearable
placeholder="请输入交货单号"
style="width: 160px"
/>
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="SKU">
<ElInput
v-model="searchForm.sku"
v-model.trim="searchForm.warehouseSku"
clearable
placeholder="请输入SKU"
style="width: 160px"
/>
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="ID">
<ElFormItem style="margin-right: 10px" label="出库单ID">
<ElInput
v-model="searchForm.id"
v-model.trim="searchForm.id"
clearable
placeholder="请输入ID"
placeholder="请输入出库单ID"
style="width: 160px"
/>
</ElFormItem>
......@@ -439,7 +431,7 @@
label-width="90px"
>
<ElFormItem label="出库单号" prop="account">
<ElInput v-model="editForm.outNo" clearable disabled />
<ElInput v-model.trim="editForm.outNo" clearable disabled />
</ElFormItem>
<ElFormItem label="工厂:" prop="factoryCode">
<span>{{ editForm.factoryCode }}</span>
......@@ -463,7 +455,7 @@
</ElFormItem>
<ElFormItem label="备注" prop="remark" style="width: 45%">
<ElInput
v-model="editForm.remark"
v-model.trim="editForm.remark"
placeholder="请输入备注"
clearable
/>
......@@ -571,7 +563,7 @@
prop="remark"
>
<template #default="{ row }">
<ElInput v-model="row.remark" clearable size="small" />
<ElInput v-model.trim="row.remark" clearable size="small" />
</template>
</ElTableColumn>
</ElTable>
......
......@@ -65,7 +65,7 @@
</ElFormItem>
<ElFormItem label="入库单号">
<ElInput
v-model="searchForm.orderNumber"
v-model.trim="searchForm.inNo"
clearable
placeholder="请输入入库单号"
style="width: 160px"
......@@ -73,7 +73,7 @@
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="SKU">
<ElInput
v-model="searchForm.sku"
v-model="searchForm.warehouseSku"
clearable
placeholder="请输入SKU"
style="width: 160px"
......@@ -81,7 +81,7 @@
</ElFormItem>
<ElFormItem style="margin-right: 10px" label="入库单ID">
<ElInput
v-model="searchForm.id"
v-model.trim="searchForm.id"
clearable
placeholder="请输入入库单ID"
style="width: 160px"
......@@ -468,7 +468,7 @@
label-width="90px"
>
<ElFormItem label="入库单号" prop="account">
<ElInput v-model="editForm.inNo" clearable disabled />
<ElInput v-model.trim="editForm.inNo" clearable disabled />
</ElFormItem>
<ElFormItem label="工厂:" prop="factoryCode">
<span>{{ editForm.factoryCode }}</span>
......@@ -492,7 +492,7 @@
</ElFormItem>
<ElFormItem label="备注" prop="remark" style="width: 45%">
<ElInput
v-model="editForm.remark"
v-model.trim="editForm.remark"
placeholder="请输入备注"
clearable
/>
......@@ -598,7 +598,7 @@
prop="remark"
>
<template #default="{ row }">
<ElInput v-model="row.remark" clearable size="small" />
<ElInput v-model.trim="row.remark" clearable size="small" />
</template>
</ElTableColumn>
</ElTable>
......@@ -829,6 +829,7 @@ import {
warehouseInfo,
InRecordBatchCheckPrintApi,
factoryWarehouseInventoryPrint,
warehouseInRecordInventory,
} from '@/api/warehouse'
import { filePath } from '@/api/axios.ts'
import BigNumber from 'bignumber.js'
......@@ -1002,7 +1003,7 @@ const {
},
page,
pageSize,
).then((res) => res.data) as never,
).then((res) => res.data),
})
const setCostPrice = (item: InterProductList) => {
......@@ -1047,8 +1048,6 @@ const printProductTag = async () => {
} catch (e) {
console.error(e)
}
console.log(selections.value, '@', printData.value)
}
async function handlePrintProductTag() {
const flag = printData.value.every(
......@@ -1125,106 +1124,42 @@ const exportForm = ref({
const handleExport = () => {
exportVisible.value = true
}
const submitExportForm = () => {
if (exportForm.value.resource === '') {
return ElMessage.error('请选择导出类型')
}
// let purchaseIds = [],
// otherIds = [],
// total = 0,
// params = {}
// if (exportForm.value.resource === 0) {
// purchaseIds = userData.value
// .filter((el) => el.dataType === 0)
// .map((el) => el.id)
// .join(',')
// otherIds = userData.value
// .filter((el) => el.dataType === 1)
// .map((el) => el.id)
// .join(',')
// } else if (exportForm.value.resource === 1) {
// purchaseIds = selections.value
// .filter((el) => el.dataType === 0)
// .map((el) => el.id)
// .join(',')
// otherIds = selections.value
// .filter((el) => el.dataType === 1)
// .map((el) => el.id)
// .join(',')
// } else {
// purchaseIds = ''
// otherIds = ''
// // total = this.paginationOptions.total
// }
// params = {
// purchaseIds,
// otherIds,
// total,
// }
// if (exportForm.value.resource !== 2) {
// delete params.total
// } else {
// // params.billStatus = this.billStatus
// // params.type = this.treeType || ''
// // params.otherStatus = this.otherStatus
// if (
// this.treeLabel.indexOf(this.$t('待入库')) !== -1 ||
// this.treeLabel.indexOf(this.$t('已入库')) !== -1
// ) {
// params.purchaseAll = true
// params.otherAll = true
// }
// if (
// this.treeLabel.indexOf(this.$t('采购')) !== -1 ||
// this.treeLabel.indexOf(this.$t('生产')) !== -1
// ) {
// params.purchaseAll = true
// }
// if (this.treeLabel.indexOf(this.$t('其他')) !== -1) {
// params.otherAll = true
// }
// if (this.treeLabel.indexOf(this.$t('归档')) !== -1) {
// params.purchaseAll = true
// }
// if (this.treeLabel.indexOf(this.$t('作废')) !== -1) {
// params.purchaseAll = true
// params.otherAll = true
// }
// }
// const loading = this.$loading({
// background: 'rgba(0, 0, 0, 0.3)',
// })
// Axios.post(
// window.apiHostSetting.VUE_APP_API_URL +
// 'api/purchaseStoreBill/exportPurchaseExcel',
// {
// includeSku: exportForm.value.delivery,
// ...params,
// ...this.searchForm,
// },
// {
// headers: {
// 'jwt-token': localStorage.getItem('token'),
// },
// },
// )
// .then((res) => {
// console.log(filePath)
// window.open(filePath + res.data.message)
// exportVisible.value = false
// })
// .finally(() => {
// loading.close()
// })
// try {
// const res = await exportOrder({
// ids: selection.value.map((el) => el.id),
// status: statusCode.value,
// })
// window.open(filePath + res.message)
// } catch (e) {
// // showError(e)
// }
const submitExportForm = async () => {
if (exportForm.value.resource === '') {
return ElMessage.error('请选择导出类型')
}
let purchaseIds = ''
let exportTotal: number | undefined = undefined
const params: AnyObject = {}
const resourceType = Number(exportForm.value.resource)
if (resourceType === 0) {
purchaseIds = tableData.value
.map((el: InterWarehousePage) => el.id)
.join(',')
} else if (resourceType === 1) {
purchaseIds = selections.value
.map((el: InterWarehousePage) => el.id)
.join(',')
} else if (resourceType === 2) {
purchaseIds = ''
exportTotal = total.value
params.billStatus = nodeCode.value == 'all' ? 'all' : nodeCode.value
}
params.idList = purchaseIds
if (exportTotal !== undefined) {
params.total = exportTotal
}
try {
const res = await warehouseInRecordInventory({
showDetail: exportForm.value.delivery,
...params,
...searchForm.value,
})
window.open(filePath + res.message, '_blank')
exportVisible.value = false
} catch (e) {
exportVisible.value = false
}
}
const getWarehouseList = async () => {
try {
......
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