Commit 0c104424 by wuqian

出库单

parent 1d3cd6dc
......@@ -444,6 +444,14 @@ export function warehouseOutRecordExport(data: ExportInWarehouseInfo) {
data,
)
}
export function OutRecordBatchCheckPrintApi(ids: string) {
return axios.get<never, BaseRespData<never[]>>(
'factory/warehouseOutRecord/batchCheckPrint',
{
params: { ids },
},
)
}
export function getOutRecordStatusTree() {
return axios.get<never, BaseRespData<InterWarehouseTree[]>>(
'factory/warehouseOutRecord/status_tree',
......
......@@ -699,7 +699,7 @@
>
<el-form :model="exportForm" label-width="80px">
<el-form-item label="" prop="resource">
<el-radio-group v-model="exportForm.resource">
<el-radio-group v-model="exportForm.resource" @change="isAllExport">
<el-radio :label="0">导出本页</el-radio>
<el-radio :label="1">导出选中</el-radio>
<el-radio :label="2">全部</el-radio>
......@@ -717,7 +717,7 @@
</template>
</ElDialog>
<el-dialog v-model="showPrintDialog" title="打印参数设置">
<el-table height="400px" :data="selections" border>
<el-table height="400px" :data="printData" border>
<el-table-column
width="60"
align="center"
......@@ -736,13 +736,13 @@
></el-table-column>
<el-table-column
align="center"
prop="locationCode"
prop="locationName"
label="库位编码"
></el-table-column>
<el-table-column
align="center"
prop="productNo"
label="货号 "
prop="supplierItemNo"
label="货号"
></el-table-column>
<el-table-column align="center" prop="number" label="打印数量">
<template #default="{ row }">
......@@ -814,8 +814,9 @@ import {
LogListData,
warehouseInfo,
warehouseOutRecordExport,
factoryWarehouseInventoryPrint,
OutRecordBatchCheckPrintApi,
} from '@/api/warehouse'
// factoryWarehouseInventoryPrint,
import { filePath } from '@/api/axios.ts'
import BigNumber from 'bignumber.js'
import { ref, onMounted, watch, nextTick } from 'vue'
......@@ -964,6 +965,11 @@ const logList = ref<LogListData[]>([])
const rules = {
warehouseId: [{ required: true, message: '请选择仓库', trigger: 'change' }],
}
const isAllExport = () => {
if (exportForm.value.resource === 2) {
ElMessage.warning('最多支持5000条!')
}
}
const nodeCode = ref<string>(
sessionStorage.getItem('InRecord_NodeCode') || 'all',
)
......@@ -1016,35 +1022,52 @@ const getTreeNum = async () => {
}
}
const showPrintDialog = ref(false)
// const printProductTag = async () => {
// if (!selections.value.length) {
// return ElMessage.warning('请选择要操作的数据')
// }
// showPrintDialog.value = true
// selections.value.forEach((el:InterWarehousePage) => {
// el.number = ''
// })
// }
const printData = ref([])
const printProductTag = async () => {
if (!selections.value.length) {
return ElMessage.warning('请选择要操作的数据')
}
const str = selections.value.map((el: InterWarehousePage) => el.id).join(',')
try {
const res = await OutRecordBatchCheckPrintApi(str)
if (res.code === 200) {
printData.value = res.data
showPrintDialog.value = true
} else {
ElMessage.error(res.message)
}
} catch (e) {
console.error(e)
}
}
async function handlePrintProductTag() {
// const flag = selections.value.every((el:InterWarehousePage) => el.number && el.number != '0')
// if (!flag) {
// return ElMessage.warning('打印数量需大于0')
// }
// const list = selections.value.map((item:InterWarehousePage) => {
// return {
// skuName: item.skuName,
// warehouseSku: item.warehouseSku,
// supplierItemNo: item.productNumber,
// number: item.number,
// locationName: item.locationCode,
// }
// })
// const res = await factoryWarehouseInventoryPrint({
// list,
// code: 'PT002',
// })
// showPrintDialog.value = false
// window.open(filePath + res.message, '_blank')
const flag = printData.value.every(
(el: InterWarehousePage) => el.number && el.number != '0',
)
if (!flag) {
return ElMessage.warning('打印数量需大于0')
}
const list = printData.value.map(
({
skuName = '',
warehouseSku = '',
supplierItemNo = '',
number = '',
locationName = '',
}) => ({
skuName,
warehouseSku,
supplierItemNo,
number,
locationName,
}),
)
const res = await factoryWarehouseInventoryPrint({
list,
code: 'PT002',
})
showPrintDialog.value = false
window.open(filePath + res.message, '_blank')
}
const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => {
if (!editForm.value.warehouseId) {
......@@ -1258,7 +1281,7 @@ const skudblclick = (val: InterskuList) => {
const {
locationCode = '',
price = null,
productNumber = '',
productNo = '',
warehouseSku = '',
skuName = '',
image = '',
......@@ -1272,7 +1295,7 @@ const skudblclick = (val: InterskuList) => {
skuImage: image,
warehouseSku,
skuName,
productNo: productNumber,
productNo,
locationCode: locationCode ?? '', // 确保空值处理
locationId: locationId ?? null, // 确保空值处理
costPrice: price,
......
......@@ -735,7 +735,7 @@
>
<el-form :model="exportForm" label-width="80px">
<el-form-item label="" prop="resource">
<el-radio-group v-model="exportForm.resource">
<el-radio-group v-model="exportForm.resource" @change="isAllExport">
<el-radio :label="0">导出本页</el-radio>
<el-radio :label="1">导出选中</el-radio>
<el-radio :label="2">全部</el-radio>
......@@ -1000,6 +1000,11 @@ const logList = ref<LogListData[]>([])
const rules = {
warehouseId: [{ required: true, message: '请选择仓库', trigger: 'change' }],
}
const isAllExport = () => {
if (exportForm.value.resource === 2) {
ElMessage.warning('最多支持5000条!')
}
}
const nodeCode = ref<string>(
sessionStorage.getItem('InRecord_NodeCode') || 'all',
)
......@@ -1611,7 +1616,7 @@ const importDialogVisible = ref(false)
const importedFileUrl = ref('')
const importData = async () => {
importDialogVisible.value = true
importedFileUrl.value=''
importedFileUrl.value = ''
}
const handleBatchDelete = async () => {
if (!selections.value.length) {
......
......@@ -112,18 +112,16 @@ const submitExportForm = async () => {
return ElMessage.error('请选择导出类型')
}
exportLoading.value = true
let purchaseIds = ''
let purchaseIds = []
let exportTotal: number | undefined = undefined
const params: AnyObject = {}
const resourceType = Number(exportForm.value.resource)
if (resourceType === 0) {
purchaseIds = leftData.value.map((el: WarehouseWarning) => el.id).join(',')
purchaseIds = leftData.value.map((el: WarehouseWarning) => el.id)
} else if (resourceType === 1) {
purchaseIds = selections.value
.map((el: WarehouseWarning) => el.id)
.join(',')
purchaseIds = selections.value.map((el: WarehouseWarning) => el.id)
} else if (resourceType === 2) {
purchaseIds = ''
purchaseIds = []
exportTotal = pagination.value.total
}
params.idList = purchaseIds
......
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