feat(heli): 回滚入库管理打印功能
This commit is contained in:
parent
0beec72e20
commit
29d7dc1d5f
@ -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>
|
||||||
@ -45,8 +45,8 @@ v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_IN_TYPE)" :key="dict.val
|
|||||||
<el-form-item prop="industry" label="单据状态">
|
<el-form-item prop="industry" label="单据状态">
|
||||||
<el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-700px" disabled>
|
<el-select v-model="formData.status" placeholder="下拉选择" clearable class="!w-700px" disabled>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :key="dict.value"
|
v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_STATUS)" :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>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -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>
|
||||||
@ -135,11 +135,11 @@ v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @c
|
|||||||
<el-col>
|
<el-col>
|
||||||
<el-card class="hl-incard">
|
<el-card class="hl-incard">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-button class="hl-addbutton" type="primary" size="large" @click="openMatForm"
|
<el-button class="hl-addbutton" type="primary" size="large" @click="openMatForm"
|
||||||
: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 />
|
||||||
@ -147,9 +147,9 @@ ref="matSubFormRef" :model="formData.matItemDOList" :rules="subFormRules"
|
|||||||
<template #header> <span class="hl-table_header">*</span> 物料编码</template>
|
<template #header> <span class="hl-table_header">*</span> 物料编码</template>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-form-item :prop="`${scope.$index}.matCode`" :rules="subFormRules.matCode" class="mb-0px!">
|
<el-form-item :prop="`${scope.$index}.matCode`" :rules="subFormRules.matCode" class="mb-0px!">
|
||||||
<el-input class="!w-265px" placeholder="物料编码" :disabled="true || ctrView || ctrSave" v-model="scope.row.matCode" readonly>
|
<el-input class="!w-265px" placeholder="物料编码" :disabled="true || ctrView || ctrSave" v-model="scope.row.matCode" readonly>
|
||||||
<!-- <template #append ><el-button @click="openMatForm" > <Icon icon="ep:search" class="mr-5px" /> </el-button></template> -->
|
<!-- <template #append ><el-button @click="openMatForm" > <Icon icon="ep:search" class="mr-5px" /> </el-button></template> -->
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -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,8 +218,8 @@ 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>
|
||||||
</template>
|
</template>
|
||||||
@ -230,8 +230,8 @@ 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>
|
||||||
</template>
|
</template>
|
||||||
@ -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";
|
||||||
|
|
||||||
@ -516,11 +606,11 @@ const openMatForm = () => {
|
|||||||
// }
|
// }
|
||||||
// formData.value.whId
|
// formData.value.whId
|
||||||
console.log(formData.value.headerId)
|
console.log(formData.value.headerId)
|
||||||
if (formData.value.stockInType==1&&formData.value.headerNo!=null&&formData.value.headerNo!=undefined&&formData.value.headerNo!=''){
|
if (formData.value.stockInType==1&&formData.value.headerNo!=null&&formData.value.headerNo!=undefined&&formData.value.headerNo!=''){
|
||||||
matOpenFormRef1.value.open(formData.value.whId,'in',formData.value.headerId)
|
matOpenFormRef1.value.open(formData.value.whId,'in',formData.value.headerId)
|
||||||
}else {
|
}else {
|
||||||
matOpenFormRef.value.open(formData.value.whId,'in')
|
matOpenFormRef.value.open(formData.value.whId,'in')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const openPnForm = () => {
|
const openPnForm = () => {
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -599,8 +776,8 @@ const handleClick = (event) => {
|
|||||||
openProjectPurchaseorderDialog()
|
openProjectPurchaseorderDialog()
|
||||||
}
|
}
|
||||||
const getList = async (arrMat) => {
|
const getList = async (arrMat) => {
|
||||||
let flag=true
|
let flag=true
|
||||||
let whName=''
|
let whName=''
|
||||||
for (let i = 0; i < whList.value.length; i++) {
|
for (let i = 0; i < whList.value.length; i++) {
|
||||||
if (whList.value[i].id==formData.value.whId){
|
if (whList.value[i].id==formData.value.whId){
|
||||||
whName=whList.value[i].whName
|
whName=whList.value[i].whName
|
||||||
@ -642,21 +819,21 @@ const getList = async (arrMat) => {
|
|||||||
// if (row.pnlist.length == 1) {
|
// if (row.pnlist.length == 1) {
|
||||||
// row.pnId = row.pnlist[0].id
|
// row.pnId = row.pnlist[0].id
|
||||||
// }else
|
// }else
|
||||||
if (pnList.value.length == 0) {
|
if (pnList.value.length == 0) {
|
||||||
flag=false
|
flag=false
|
||||||
}
|
}
|
||||||
if (noList.value.length!=0){
|
if (noList.value.length!=0){
|
||||||
var filter = noList.value.filter((no)=>no.materialId==row.matId);
|
var filter = noList.value.filter((no)=>no.materialId==row.matId);
|
||||||
if (filter&&filter.length!=0){
|
if (filter&&filter.length!=0){
|
||||||
row.price=filter[0].unitPrice
|
row.price=filter[0].unitPrice
|
||||||
row.storageOkQty=filter[0].purchaseAmount
|
row.storageOkQty=filter[0].purchaseAmount
|
||||||
}else {
|
|
||||||
row.price=''
|
|
||||||
}
|
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
row.price=''
|
row.price=''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
row.price=''
|
||||||
|
}
|
||||||
if (flag){
|
if (flag){
|
||||||
formData.value.matItemDOList.push(row)
|
formData.value.matItemDOList.push(row)
|
||||||
}
|
}
|
||||||
@ -726,14 +903,14 @@ const getList1 = async (arrMat) => {
|
|||||||
}
|
}
|
||||||
const getProject = async (pro,scope) => {
|
const getProject = async (pro,scope) => {
|
||||||
formData.value.matItemDOList.forEach(
|
formData.value.matItemDOList.forEach(
|
||||||
(item) =>{
|
(item) =>{
|
||||||
|
|
||||||
if(item.matId == scope.row.matId && item.whId == scope.row.whId && item.rgId == scope.row.rgId && item.pnId == scope.row.pnId){
|
if(item.matId == scope.row.matId && item.whId == scope.row.whId && item.rgId == scope.row.rgId && item.pnId == scope.row.pnId){
|
||||||
item.projectNo = pro.projectSubId
|
item.projectNo = pro.projectSubId
|
||||||
item.projectSubName = pro.projectSubName
|
item.projectSubName = pro.projectSubName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteMatCodes = ref([])
|
const deleteMatCodes = ref([])
|
||||||
@ -870,7 +1047,7 @@ const failedAttachments = ref<UploadUserFile[]>([])
|
|||||||
const failedAttachmentsName = ref()
|
const failedAttachmentsName = ref()
|
||||||
|
|
||||||
const openProjectPurchaseorderDialog = () => {
|
const openProjectPurchaseorderDialog = () => {
|
||||||
projectPurchaseorderDialog.value?.open()
|
projectPurchaseorderDialog.value?.open()
|
||||||
}
|
}
|
||||||
const refreshAttachments = (files, type) => {
|
const refreshAttachments = (files, type) => {
|
||||||
formData.value.attachments = formData.value.attachments.filter((value) => value.id)
|
formData.value.attachments = formData.value.attachments.filter((value) => value.id)
|
||||||
@ -933,7 +1110,7 @@ const handleDeleteAttachment = async (index, type) => {
|
|||||||
// 下载文件
|
// 下载文件
|
||||||
const downloadAttachment = async (name, url) => {
|
const downloadAttachment = async (name, url) => {
|
||||||
if (url) {
|
if (url) {
|
||||||
const baseUrl = import.meta.env.VITE_BASE_URL;
|
const baseUrl = import.meta.env.VITE_BASE_URL;
|
||||||
url =baseUrl+'/admin-api/'+ url.split('/admin-api/')[1]; const data = await downloadFile(url)
|
url =baseUrl+'/admin-api/'+ url.split('/admin-api/')[1]; const data = await downloadFile(url)
|
||||||
download.any(data, name)
|
download.any(data, name)
|
||||||
}
|
}
|
||||||
@ -1176,7 +1353,7 @@ onMounted(async () => {
|
|||||||
supplierList.value = await SupplierApi.getSimpList()
|
supplierList.value = await SupplierApi.getSimpList()
|
||||||
|
|
||||||
if (whList.value.length==1){
|
if (whList.value.length==1){
|
||||||
formData.value.whId = whList.value[0].id;
|
formData.value.whId = whList.value[0].id;
|
||||||
const dataRgList = await RgApi.getSimpList()
|
const dataRgList = await RgApi.getSimpList()
|
||||||
rgList.value = dataRgList.filter((rg) => rg.wh_id == formData.value.whId)
|
rgList.value = dataRgList.filter((rg) => rg.wh_id == formData.value.whId)
|
||||||
// 获得库区列表
|
// 获得库区列表
|
||||||
@ -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>
|
||||||
|
|||||||
@ -38,14 +38,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物料名称" prop="matName">
|
<el-form-item label="物料名称" prop="matName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.matName"
|
v-model="queryParams.matName"
|
||||||
placeholder="物料名称"
|
placeholder="物料名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="入库类型" prop="stockInType">
|
<el-form-item label="入库类型" prop="stockInType">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.stockInType"
|
v-model="queryParams.stockInType"
|
||||||
@ -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)">
|
||||||
@ -219,8 +214,6 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</el-card>
|
|
||||||
<PrintRef ref="printRef" />
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -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: { // 这里应该是headers而不是header
|
headers: {
|
||||||
|
// 这里应该是headers而不是header
|
||||||
'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>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user