Merge remote-tracking branch 'origin/main'

This commit is contained in:
z 2026-04-09 09:10:08 +08:00
commit b36d42af05
4 changed files with 403 additions and 236 deletions

View File

@ -29,10 +29,10 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="stockInType" label="入库类型"> <el-form-item prop="stockInType" label="入库类型">
<el-select <el-select
v-model="formData.stockInType" clearable style="width: 100%" @change="handleStockType" v-model="formData.stockInType" clearable style="width: 100%" @change="handleStockType"
:disabled="ctrView || ctrSave"> :disabled="ctrView || ctrSave">
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value" v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -61,8 +61,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.val
@click="openProjectPurchaseorderDialog" /></template> @click="openProjectPurchaseorderDialog" /></template>
</el-input> </el-input>
</div> </div>
<!-- <el-input v-model="formData.headerNo" class="!w-700px"--> <!-- <el-input v-model="formData.headerNo" class="!w-700px"-->
<!-- v-bind:disabled="ctrView || ctrSave || enableHeadNo" />--> <!-- v-bind:disabled="ctrView || ctrSave || enableHeadNo" />-->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -73,7 +73,7 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.val
<el-form-item label="单据日期" prop="createTime"> <el-form-item label="单据日期" prop="createTime">
<!-- {{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm:ss') }} --> <!-- {{ formatDate(formData.createTime, 'YYYY-MM-DD HH:mm:ss') }} -->
<el-date-picker <el-date-picker
v-model="formData.createTime" value-format="x" placeholder="单据日期" disabled v-model="formData.createTime" value-format="x" placeholder="单据日期" disabled
class="!w-400px" /> class="!w-400px" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -82,7 +82,7 @@ v-model="formData.createTime" value-format="x" placeholder="单据日期" disabl
<el-col :span="24"> <el-col :span="24">
<el-form-item prop="whId" label="入库仓库"> <el-form-item prop="whId" label="入库仓库">
<el-select <el-select
v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh" v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @change="handleWh"
:disabled="ctrView || ctrSave"> :disabled="ctrView || ctrSave">
<el-option v-for="dict in whList" :key="dict.id" :label="dict.whName" :value="dict.id" /> <el-option v-for="dict in whList" :key="dict.id" :label="dict.whName" :value="dict.id" />
</el-select> </el-select>
@ -139,7 +139,7 @@ v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @c
:disabled="ctrView || ctrSave">新增</el-button> :disabled="ctrView || ctrSave">新增</el-button>
<el-button @click="openPnForm" type="success" v-if="btnSave" size="large">新增物料</el-button></el-col> <el-button @click="openPnForm" type="success" v-if="btnSave" size="large">新增物料</el-button></el-col>
<el-form <el-form
ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules" ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules"
v-loading="subFormLoading" label-width="0"> v-loading="subFormLoading" label-width="0">
<el-table :data="formData.matItemDOList" class="hl-table"> <el-table :data="formData.matItemDOList" class="hl-table">
<el-table-column type="index" label="序号" min-width="80" align="center" fixed /> <el-table-column type="index" label="序号" min-width="80" align="center" fixed />
@ -177,7 +177,7 @@ ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules"
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.rgId`" :rules="subFormRules.rgId" class="mb-0px!">
<el-select <el-select
v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)" v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(scope)"
:disabled="ctrView || ctrSave"> :disabled="ctrView || ctrSave">
<el-option v-for="dict in rgList" :key="dict.id" :label="dict.rg_name" :value="dict.id" /> <el-option v-for="dict in rgList" :key="dict.id" :label="dict.rg_name" :value="dict.id" />
</el-select> </el-select>
@ -191,10 +191,10 @@ v-model="scope.row.rgId" placeholder="" style="width: 100%" @change="handleRg(sc
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`${scope.$index}.pnId`" :rules="subFormRules.pnId" class="mb-0px!"> <el-form-item :prop="`${scope.$index}.pnId`" :rules="subFormRules.pnId" class="mb-0px!">
<el-select <el-select
v-model="scope.row.pnId" placeholder="" style="width: 100%" v-model="scope.row.pnId" placeholder="" style="width: 100%"
:disabled="ctrView || ctrSave"> :disabled="ctrView || ctrSave">
<el-option <el-option
v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name" v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
:value="dict.id" /> :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -206,7 +206,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item
:prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty" :prop="`${scope.$index}.storageOkQty`" :rules="subFormRules.storageOkQty"
class="mb-0px!"> class="mb-0px!">
<el-input v-model="scope.row.storageOkQty" :disabled="ctrView || ctrSave" /> <el-input v-model="scope.row.storageOkQty" :disabled="ctrView || ctrSave" />
</el-form-item> </el-form-item>
@ -218,7 +218,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item
:prop="`${scope.$index}.price`" :rules="subFormRules.price" :prop="`${scope.$index}.price`" :rules="subFormRules.price"
class="mb-0px!"> class="mb-0px!">
<el-input v-model="scope.row.price" :disabled="ctrView || ctrSave" /> <el-input v-model="scope.row.price" :disabled="ctrView || ctrSave" />
</el-form-item> </el-form-item>
@ -230,7 +230,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item
:prop="`${scope.$index}.price`" :prop="`${scope.$index}.price`"
class="mb-0px!"> class="mb-0px!">
<el-input v-model="scope.row.price" :disabled="ctrView || ctrSave" /> <el-input v-model="scope.row.price" :disabled="ctrView || ctrSave" />
</el-form-item> </el-form-item>
@ -261,7 +261,7 @@ v-for="dict in scope.row.pnlist" :key="dict.id" :label="dict.pn_name"
<template #default="scope"> <template #default="scope">
<el-button <el-button
link type="danger" @click.prevent="handleDelete2(scope.$index)" link type="danger" @click.prevent="handleDelete2(scope.$index)"
:disabled="ctrView || ctrDelete"> :disabled="ctrView || ctrDelete">
删除 删除
</el-button> </el-button>
@ -284,7 +284,7 @@ link type="danger" @click.prevent="handleDelete2(scope.$index)"
<el-card class="hl-incard"> <el-card class="hl-incard">
<el-col> <el-col>
<el-upload <el-upload
ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{ ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :headers="{
Authorization: 'Bearer ' + getAccessToken(), Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId() 'tenant-id': getTenantId()
}" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange" }" name="files" :show-file-list="false" :auto-upload="false" :data="matUploadData" :on-change="matUploadChange"
@ -296,7 +296,7 @@ ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :hea
</el-upload> </el-upload>
</el-col> </el-col>
<el-table <el-table
:data="formData.attachments" class="hl-table" v-loading.fullscreen.lock="uploading" :data="formData.attachments" class="hl-table" v-loading.fullscreen.lock="uploading"
element-loading-text="附件上传中..." element-loading-background="rgba(122, 122, 122, 0.6)"> element-loading-text="附件上传中..." element-loading-background="rgba(122, 122, 122, 0.6)">
<el-table-column prop="name" label="文件名称" align="center"> <el-table-column prop="name" label="文件名称" align="center">
<!-- <template #default="scope"> <!-- <template #default="scope">
@ -310,12 +310,12 @@ ref="matUploadRef" :file-list="matUploadFiles" multiple :action="uploadUrl" :hea
<template #default="scope"> <template #default="scope">
<el-button <el-button
link type="danger" size="small" :disabled="ctrView || ctrDelete" link type="danger" size="small" :disabled="ctrView || ctrDelete"
@click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)"> @click="handleDeleteAttachment(scope.$index, scope.row.businessFileType)">
删除 删除
</el-button> </el-button>
<el-button <el-button
link type="primary" size="small" :disabled="ctrView || ctrDelete" link type="primary" size="small" :disabled="ctrView || ctrDelete"
@click="downloadAttachment(scope.row.name, scope.row.url)"> @click="downloadAttachment(scope.row.name, scope.row.url)">
下载 下载
</el-button> </el-button>
@ -335,7 +335,7 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<el-button @click="isPrint()" type="primary" size="large" :loading="printLoading" > </el-button> <el-button @click="isPrint()" type="primary" size="large" :loading="printLoading" > </el-button>
<el-button @click="submitForm" type="success" v-if="btnSave&&formData.status ==1" size="large"> </el-button> <el-button @click="submitForm" type="success" v-if="btnSave&&formData.status ==1" size="large"> </el-button>
<el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large"> </el-button> <el-button @click="handleStatus(2)" type="primary" v-if="btnSave" size="large"> </el-button>
<!-- <el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 2" size="large"> </el-button>--> <!-- <el-button @click="handleStatus(3)" type="danger" v-if="btnCancel&&formData.status != 2" size="large"> </el-button>-->
<el-button @click="handleDelete" type="danger" v-if="btnCancel&&formData.status ==1" size="large"> </el-button> <el-button @click="handleDelete" type="danger" v-if="btnCancel&&formData.status ==1" size="large"> </el-button>
</template> </template>
@ -378,9 +378,9 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
</el-row> </el-row>
</el-card> </el-card>
</el-form> </el-form>
<!-- <div class="hl-footer text-center">--> <!-- <div class="hl-footer text-center">-->
<!-- --> <!-- -->
<!-- </div>--> <!-- </div>-->
</el-card> </el-card>
<!-- 表单弹窗物料列表 --> <!-- 表单弹窗物料列表 -->
<materials ref="matOpenFormRef" @success="getList" /> <materials ref="matOpenFormRef" @success="getList" />
@ -390,7 +390,98 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete"
<purchaseorderDialog ref="projectPurchaseorderDialog" @success="handleSelectedProjectPurchaseorder" /> <purchaseorderDialog ref="projectPurchaseorderDialog" @success="handleSelectedProjectPurchaseorder" />
<!-- 表单弹窗新增物料 --> <!-- 表单弹窗新增物料 -->
<MaterialForm ref="materialOpenFormRef" @success="getList" /> <MaterialForm ref="materialOpenFormRef" @success="getList" />
<PrintRef ref="printFormRef" /> <el-dialog v-model="printDialogVisible" width="80%" title="入库单打印" :close-on-click-modal="false">
<div id="printArea" class="print-content">
<div class="print-header">
<div class="order-info">
<div style="display: flex;">
<span style="width: 210px;">编号{{ printData.stockNo}}</span>
<span style="margin-left:20px; width: 170px;">入库日期{{ formatDate(printData.createTime) }}</span>
<span style="margin-left:20px;width: 250px">供应商{{ printData.supplierName }}</span>
</div>
<!-- <div style="display: flex;">
<span style="margin-left:20px;width: 110px">联系人{{ printData.contactName }}</span>
<span style="margin-left:20px;width: 150px">电话{{ printData.contactMobile }}</span>
</div> -->
</div>
</div>
<table class="print-table">
<colgroup>
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
<col style="width: 10%;" />
</colgroup>
<thead>
<tr>
<th>序号</th>
<th>物料号</th>
<th>零件名称</th>
<th>规格</th>
<th>单位</th>
<th>入库数量</th>
<th>单价()</th>
<th>小计()</th>
<th>项目名称</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in 17" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ printData.storageMatDOList[index]?.matCode || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.matName ? limitTo20Chars(printData.storageMatDOList[index].matName) : '' }}</td>
<td>{{ printData.storageMatDOList[index]?.mtSpec || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.matUnit || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.storageOkQty || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.unitPrice || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.totalPrice || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.projectName || '' }}</td>
<td>{{ printData.storageMatDOList[index]?.description || '' }}</td>
</tr>
<!-- <tr>
<td colspan="9"></td>
<td style="font-weight: bold;">合计</td>
<td style="font-weight: bold;">{{ printData.estimatedPriceSum }}</td>
</tr> -->
</tbody>
</table>
<div class="order-info" style="margin-top: 10px;border-bottom: 1px solid #ccc;padding-bottom: 10px;">
<div style="display: flex;width: 40%;">
<span >经手人:{{ printData.userName }}</span>
</div>
<div style="display: flex;width: 20%;justify-content: center;">
<!-- <span style="margin-left:20px;width: 150px">审核{{ printData.auditorName }}</span> -->
<!-- <span style="margin-left:20px;width: 120px">仓库签字:</span> -->
</div>
<div style="display: flex; width: 40%;justify-content: right;">
<span style="margin-left:20px;width: 150px">仓库签字:{{ printData.signature }}</span>
<span style="margin-left:20px;width: 150px">日期:{{ printData.date }}</span>
<!-- <span style="margin-left:20px;width: 150px">接收人{{ printData.username }}</span> -->
<!-- <span style="margin-left:20px;width: 150px">电话{{ printData.userMobile }}</span> -->
</div>
</div>
</div>
<template #footer>
<el-button @click="printDialogVisible = false">关闭</el-button>
<el-button type="primary" @click="doPrint">打印</el-button>
</template>
</el-dialog>
</template> </template>
@ -421,7 +512,6 @@ import projects from './subproject.vue'
import {Search} from "@element-plus/icons-vue"; import {Search} from "@element-plus/icons-vue";
import purchaseorderDialog from '@/views/heli/outsourcestock/purchaseorderDialog.vue' import purchaseorderDialog from '@/views/heli/outsourcestock/purchaseorderDialog.vue'
import MaterialForm from '@/views/heli/material/MaterialForm.vue' import MaterialForm from '@/views/heli/material/MaterialForm.vue'
import PrintRef from './print.vue'
import * as StorageinApi from "@/api/heli/storagein"; import * as StorageinApi from "@/api/heli/storagein";
import * as storageInventoryApi from "@/api/heli/storageinventory"; import * as storageInventoryApi from "@/api/heli/storageinventory";
@ -538,33 +628,120 @@ function formatDate(val) {
} }
const printLoading = ref(false) const printLoading = ref(false)
const printFormRef = ref() //
const printDialogVisible = ref(false)
const printData = ref({})
function openPrintDialog(data) {
printData.value = data
printDialogVisible.value = true
}
const isPrint = async () => { const isPrint = async () => {
printLoading.value = true
printLoading.value = true printLoading.value = true
try { try {
const newVar = await StorageApi.isPrint(query.id) var newVar = await StorageApi.isPrint(query.id);
const data = newVar.storageMatDOList?.map((item, idx) => ({ console.log(newVar)
编号: idx + 1, openPrintDialog(newVar)
物料号: item.matCode || '',
零件名称: item.matName ? (item.matName.length > 20 ? item.matName.slice(0, 20) : item.matName) : '',
规格: item.mtSpec || '',
单位: item.matUnit || '',
入库数量: item.storageOkQty || '',
单价: item.unitPrice || '',
小计: item.totalPrice || '',
项目名称: item.projectName || '',
备注: item.description || ''
})) || []
// 17
const emptyRow = { 编号: '', 物料号: '', 零件名称: '', 规格: '', 单位: '', 入库数量: '', 单价: '', 小计: '', 项目名称: '', 备注: '' }
while (data.length < 17) {
data.push({ ...emptyRow, 编号: data.length + 1 })
}
printFormRef.value?.open(data, '', 'detail')
} finally { } finally {
printLoading.value = false printLoading.value = false
} }
}
function doPrint() {
//
const printContent = document.getElementById('printArea')
if (!printContent) return
const iframe = document.createElement('iframe')
iframe.style.position = 'absolute'
iframe.style.width = '0'
iframe.style.height = '0'
iframe.style.border = 'none'
document.body.appendChild(iframe)
const doc = iframe.contentWindow?.document
doc?.open()
doc?.write(`
<!DOCTYPE html>
<html>
<head>
<title >入库单</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 10px;
font-size: 12px;
}
.print-content {
width: 100%;
padding-top: 15px;
}
.order-info {
justify-content: space-between;
display: flex;
flex-wrap: wrap;
align-items: center;
}
.stamp-info {
margin-top: 10px;
}
.stamp-info span{
font-size: 15px !important;
}
.order-info span{
font-size: 15px !important;
}
.print-table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
.print-table th, .print-table td {
border: 1px solid #ddd;
padding: 5px;
text-align: center;
height: 20px; /* 设置固定高度 */
line-height: 20px; /* 垂直居中 */
}
.print-table th {
background-color: #f5f5f5;
}
@media print {
body { margin: 0; }
.print-content {
width: 100%;
margin: 0;
padding: 10px;
}
}
</style>
</head>
<body>
${printContent.innerHTML}
</body>
</html>
`)
doc?.close()
iframe.onload = () => {
iframe.contentWindow?.focus()
iframe.contentWindow?.print()
setTimeout(() => document.body.removeChild(iframe), 1000)
}
}
function limitTo20Chars(input) {
if (typeof input !== 'string') return '';
return input.length > 20 ? input.slice(0, 20) : input;
} }
@ -1267,4 +1444,77 @@ a {
color: #409eff; color: #409eff;
text-decoration: none; text-decoration: none;
} }
/* 打印样式 */
@media print {
/* 隐藏所有非打印内容 */
body * {
visibility: hidden;
}
/* 只显示打印区域 */
#printArea, #printArea * {
visibility: visible;
}
/* 打印区域定位 */
#printArea {
position: absolute;
left: 0;
top: 0;
width: 100%;
}
/* 隐藏弹窗相关元素 */
.el-dialog, .el-dialog__wrapper, .el-dialog__header, .el-dialog__footer {
display: none !important;
}
}
.order-info {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
.order-info span {
font-size: 15px !important;
margin-right: 10px !important;
}
.stamp-info {
margin-top: 10px;
}
.stamp-info span{
font-size: 15px !important;
}
.print-table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
border: 1px solid #ccc;
}
.print-table th,
.print-table td {
border: 1px solid #ccc;
padding: 6px 8px;
text-align: center;
font-size: 13px !important;
height: 30px; /* 设置固定高度 */
line-height: 30px; /* 垂直居中 */
}
.print-table th {
background-color: #f5f7fa;
color: #303133;
font-weight: 600;
font-size: 13px !important;
}
</style> </style>

View File

@ -91,12 +91,7 @@
<el-button type="primary" plain @click="openDetail('create')"> <el-button type="primary" plain @click="openDetail('create')">
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button>
<el-button <el-button type="success" plain @click="handleExport" :loading="exportLoading">
type="success"
plain
@click="handleExport"
:loading="exportLoading"
>
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -104,34 +99,23 @@
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<el-card class="hl-card-info">
<template #header>
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">订单明细</span>
<!-- <el-button style="margin-left: 20px" @click="isPrint" type="primary" size="large">打印</el-button>-->
<!-- <el-button-->
<!-- style="margin-left: 20px"-->
<!-- type="success"-->
<!-- plain-->
<!-- @click="handleExport"-->
<!-- :loading="exportLoading"-->
<!-- >-->
<!-- <Icon icon="ep:download" class="mr-5px" /> 导出EXCEL-->
<!-- </el-button>-->
</template>
<ContentWrap> <ContentWrap>
<el-table <el-table
v-loading="loading" :data="list" class="hl-table" v-loading="loading"
ref="multipleTableRef" :data="list"
@selection-change="handleSelectionChange" :row-class-name="tableRowClassName"> :show-overflow-tooltip="true"
<el-table-column type="selection" width="70" fixed="left" /> :stripe="true"
<el-table-column type="index" width="70" fixed label="序号" align="center" /> class="hl-table"
>
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
<el-table-column type="index" width="100" fixed label="序号" align="center" />
<el-table-column label="入库单号" align="center" prop="stockNo" min-width="210" fixed /> <el-table-column label="入库单号" align="center" prop="stockNo" min-width="210" fixed />
<!-- <template #default="scope">--> <!-- <template #default="scope">-->
<!-- <el-button text type="primary" @click="openDetail('review',scope.row.id)">--> <!-- <el-button text type="primary" @click="openDetail('review',scope.row.id)">-->
<!-- {{scope.row.stockNo}}--> <!-- {{scope.row.stockNo}}-->
<!-- </el-button>--> <!-- </el-button>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="入库类型" align="center" prop="stockInType" min-width="120"> <el-table-column label="入库类型" align="center" prop="stockInType" min-width="120">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_TYPE" :value="scope.row.stockInType" /> <dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_TYPE" :value="scope.row.stockInType" />
@ -143,7 +127,7 @@
{{ warehouseList.find((tag) => tag.id === scope.row.whId)?.whName }} {{ warehouseList.find((tag) => tag.id === scope.row.whId)?.whName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="即入即出" align="center" prop="inOutFlag" min-width="100" > <el-table-column label="即入即出" align="center" prop="inOutFlag" min-width="90">
<template #default="scope"> <template #default="scope">
<el-tag :type="scope.row.inOutFlag ? 'success' : 'info'"> <el-tag :type="scope.row.inOutFlag ? 'success' : 'info'">
{{ scope.row.inOutFlag ? '是' : '否' }} {{ scope.row.inOutFlag ? '是' : '否' }}
@ -176,26 +160,37 @@
:formatter="dateFormatter" :formatter="dateFormatter"
min-width="240" min-width="240"
/> />
<!-- <el-table-column label="作废人" align="center" prop="cancel" min-width="120">--> <!-- <el-table-column label="作废人" align="center" prop="cancel" min-width="120">-->
<!-- <template #default="scope">--> <!-- <template #default="scope">-->
<!-- {{ userList.find((user) => user.id == scope.row.cancel)?.nickname }}--> <!-- {{ userList.find((user) => user.id == scope.row.cancel)?.nickname }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- label="作废时间"--> <!-- label="作废时间"-->
<!-- align="center"--> <!-- align="center"-->
<!-- prop="cancelTime"--> <!-- prop="cancelTime"-->
<!-- :formatter="dateFormatter"--> <!-- :formatter="dateFormatter"-->
<!-- min-width="240"--> <!-- min-width="240"-->
<!-- />--> <!-- />-->
<el-table-column label="单据状态" align="center" prop="status" min-width="120" fixed="right"> <el-table-column
label="单据状态"
align="center"
prop="status"
min-width="120"
fixed="right"
>
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.HELI_STORAGE_IN_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" min-width="180" fixed="right"> <el-table-column label="操作" align="center" min-width="180" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="openDetail('update', scope.row.id)" v-if="scope.row.status != 3&&scope.row.status!=4"> <el-button
link
type="primary"
@click="openDetail('update', scope.row.id)"
v-if="scope.row.status != 3 && scope.row.status != 4"
>
编辑 编辑
</el-button> </el-button>
<el-button link type="primary" @click="openDetail('review', scope.row.id)"> <el-button link type="primary" @click="openDetail('review', scope.row.id)">
@ -220,8 +215,6 @@
/> />
</ContentWrap> </ContentWrap>
</el-card> </el-card>
<PrintRef ref="printRef" />
</el-card>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -231,11 +224,8 @@ import * as StorageApi from '@/api/heli/storage'
import * as WarehouseApi from '@/api/heli/warehouse' import * as WarehouseApi from '@/api/heli/warehouse'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import routeParamsCache from '@/utils/routeParamsCache' import routeParamsCache from '@/utils/routeParamsCache'
import axios from "axios"; import axios from 'axios'
import {getAccessToken, getTenantId} from "@/utils/auth"; import { getAccessToken, getTenantId } from '@/utils/auth'
import {ElButton, ElTable} from "element-plus";
import PrintRef from "./print.vue"
import * as PurchaseOrderApi from "@/api/heli/purchaseorder";
defineOptions({ name: 'Storage' }) defineOptions({ name: 'Storage' })
const message = useMessage() // const message = useMessage() //
@ -297,33 +287,10 @@ const resetQuery = () => {
queryFormRef.value.resetFields() queryFormRef.value.resetFields()
handleQuery() handleQuery()
} }
const multipleTableRef: any = ref<InstanceType<typeof ElTable>>()
const multipleSelection: any = ref([])
const handleSelectionChange = (val: PurchaseOrderApi.PurchaseOrderVO[]) => {
// isSelected false
list.value.forEach(row => {
row.isSelected = false;
});
// isSelected true
val.forEach(selectedRow => {
//
const targetRow = list.value.find(row => row.id === selectedRow.id);
if (targetRow) {
targetRow.isSelected = true;
}
});
multipleSelection.value = val
}
const tableRowClassName = ({ row }) => {
return row.isSelected ? 'selected-row' : '';
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
if (!queryParams.stockNo){ if (!queryParams.stockNo) {
message.error("请输入入库单号") message.error('请输入入库单号')
return return
} }
@ -332,16 +299,17 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
loading.value = true; loading.value = true
// ID // ID
const baseUrl = import.meta.env.VITE_BASE_URL; const baseUrl = import.meta.env.VITE_BASE_URL
// 使axios // 使axios
const response = await axios({ const response = await axios({
url: baseUrl+'/admin-api/heli/storage/export-excel-new', url: baseUrl + '/admin-api/heli/storage/export-excel-new',
method: 'get', method: 'get',
headers: { // headersheader headers: {
// headersheader
'tenant-id': getTenantId(), 'tenant-id': getTenantId(),
'Authorization': getAccessToken() Authorization: getAccessToken()
}, },
params: { params: {
stockNo: queryParams.stockNo ? queryParams.stockNo : undefined stockNo: queryParams.stockNo ? queryParams.stockNo : undefined
@ -349,7 +317,6 @@ const handleExport = async () => {
responseType: 'blob' // blob responseType: 'blob' // blob
}) })
// //
const url = window.URL.createObjectURL(new Blob([response.data])) const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement('a') const link = document.createElement('a')
@ -361,12 +328,11 @@ const handleExport = async () => {
// //
document.body.removeChild(link) document.body.removeChild(link)
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url)
} catch (error) { } catch (error) {
console.error('导出失败:', error) console.error('导出失败:', error)
message.error('导出失败,请重试') message.error('导出失败,请重试')
} finally { } finally {
loading.value = false; loading.value = false
exportLoading.value = false exportLoading.value = false
// ID // ID
queryParams.ids = [] queryParams.ids = []
@ -382,51 +348,14 @@ const openDetail = (active: string, id?: number) => {
router.push({ path: '/inventory/storagedetail', query: { type: active, id: id } }) router.push({ path: '/inventory/storagedetail', query: { type: active, id: id } })
} }
const printRef = ref<InstanceType<typeof PrintRef>>()
const isPrint = async () => {
function formatDate(val) {
if (!val) return ''
const date = new Date(val)
return date.toLocaleDateString()
}
try {
const list = multipleSelection.value|| []; //
if(list.length==0){
message.warning("请选择入库单信息");
return;
}
//
//createTime brief projectSubCode blueprintNo boomName compositionName matSpec purchaseAmount unitPrice estimatedPrice requireTime
const data = list?.map((item,idx) => ({
编号: idx + 1,
入库单号: item.stockNo,
入库类型: getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE).find(d => d.value === item.stockInType)?.label || item.stockInType,
上游单号: item.headerNo,
入库仓库: warehouseList.value.find(w => w.id === item.whId)?.whName || item.whId,
即入即出: item.inOutFlag ? '是' : '否',
单据状态: getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_STATUS).find(d => d.value === item.status)?.label || item.status,
创建时间: formatDate(item.createTime),
提交时间: formatDate(item.keeperTime),
})) || [];
console.log(data)
// openPrintDialog(newVar)
printRef.value?.open(data,"")
} finally {
}
}
/** 初始化 **/ /** 初始化 **/
const route = useRoute() const route = useRoute()
const routeValue = ref('') const routeValue = ref('')
onMounted(async () => { onMounted(async () => {
let params = routeParamsCache.get(route.path); let params = routeParamsCache.get(route.path)
routeValue.value = route.path routeValue.value = route.path
if (params ) { if (params) {
Object.assign(queryParams, params); Object.assign(queryParams, params)
} }
const queryParamsWarehouse = reactive({ const queryParamsWarehouse = reactive({
pageNo: 1, pageNo: 1,
@ -446,21 +375,15 @@ onMounted(async () => {
await getList() await getList()
}) })
onBeforeUnmount(() => { onBeforeUnmount(() => {
const plainParams = JSON.parse(JSON.stringify(queryParams)); const plainParams = JSON.parse(JSON.stringify(queryParams))
routeParamsCache.set(routeValue.value, plainParams); routeParamsCache.set(routeValue.value, plainParams)
}); })
window.addEventListener('beforeunload', () => { window.addEventListener('beforeunload', () => {
const plainParams = JSON.parse(JSON.stringify(queryParams)); const plainParams = JSON.parse(JSON.stringify(queryParams))
routeParamsCache.set(routeValue.value, plainParams); routeParamsCache.set(routeValue.value, plainParams)
}); })
onActivated(() => { onActivated(() => {
getList() getList()
}) })
</script> </script>
<style>
.selected-row {
background-color: #ffe6cc !important;
}
</style>

View File

@ -154,12 +154,6 @@
<el-tag v-else type="success">其他</el-tag> <el-tag v-else type="success">其他</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="单据编号"
align="center"
prop="xzdStockNo"
min-width="130"
/>
<el-table-column label="物料编码" align="center" prop="matCode" min-width="200"> <el-table-column label="物料编码" align="center" prop="matCode" min-width="200">
<template #default="scope"> <template #default="scope">
@ -206,7 +200,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料名称" align="center" prop="matName" min-width="190" /> <el-table-column label="物料名称" align="center" prop="matName" min-width="210" />
<el-table-column label="单价" align="center" prop="price" min-width="120" /> <el-table-column label="单价" align="center" prop="price" min-width="120" />
<el-table-column label="供应商简称" align="center" prop="brief" min-width="200" /> <el-table-column label="供应商简称" align="center" prop="brief" min-width="200" />
<el-table-column label="数量" align="center" prop="storageOkQty" min-width="140" /> <el-table-column label="数量" align="center" prop="storageOkQty" min-width="140" />
@ -232,6 +226,7 @@
:formatter="dateFormatter1" :formatter="dateFormatter1"
min-width="170" min-width="170"
/> />
<el-table-column label="单据编号" align="center" prop="xzdStockNo" min-width="130" />
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination
@ -243,7 +238,6 @@
</ContentWrap> </ContentWrap>
</el-card> </el-card>
<MaterialForm ref="materialOpenFormRef" @success="getList" /> <MaterialForm ref="materialOpenFormRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -258,7 +252,7 @@ import { ref } from 'vue'
import { HeliStockTypeDict, HeliStorageStatusDict } from '@/api/heli/wmsstorage' import { HeliStockTypeDict, HeliStorageStatusDict } from '@/api/heli/wmsstorage'
import { HeliStorageIsExportDict } from '@/api/heli/xzdstoragelog' import { HeliStorageIsExportDict } from '@/api/heli/xzdstoragelog'
import { dateFormatter, dateFormatter1 } from '@/utils/formatTime' import { dateFormatter, dateFormatter1 } from '@/utils/formatTime'
import MaterialForm from "@/views/heli/material/MaterialForm.vue"; import MaterialForm from '@/views/heli/material/MaterialForm.vue'
defineOptions({ name: 'Xzdstoragelog' }) defineOptions({ name: 'Xzdstoragelog' })
@ -316,7 +310,7 @@ const getList = async () => {
const materialOpenFormRef = ref() const materialOpenFormRef = ref()
const openPnForm = () => { const openPnForm = () => {
materialOpenFormRef.value.open("create") materialOpenFormRef.value.open('create')
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */