Commit 0c104424 by wuqian

出库单

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