v1.9 优化采购相关功能

This commit is contained in:
wuxw 2025-11-04 10:57:39 +08:00
parent a2e5ee0148
commit efd035348a
5 changed files with 267 additions and 20 deletions

View File

@ -52,7 +52,7 @@ export default {
this.$emit('success')
} catch (error) {
console.error('删除物品失败:', error)
this.$message.error(this.$t('resourceStoreManage.deleteFailed'))
this.$message.error(error)
}
}
}

View File

@ -1,17 +1,17 @@
<template>
<el-dialog
id="deleteResourceStoreTypeModel"
:title="$t('deleteResourceStoreType.confirmTitle')"
:title="$t('common.delete')"
:visible.sync="visible"
width="30%"
:before-close="handleClose"
>
<div style="text-align: center;">
<span>{{ $t('deleteResourceStoreType.confirmMessage') }}</span>
<span>{{ $t('common.confirmDelete') }}</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">{{ $t('deleteResourceStoreType.cancel') }}</el-button>
<el-button type="primary" @click="deleteResourceStoreType">{{ $t('deleteResourceStoreType.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="deleteResourceStoreType">{{ $t('common.confirm') }}</el-button>
</span>
</el-dialog>
</template>

View File

@ -748,6 +748,11 @@ const routes = [
name: '/views/fee/printOweFee',
component: () => import('@/views/fee/printOweFeeList.vue')
},
{
path: '/pages/property/printPurchaseApply',
name: '/views/resource/printPurchaseApply',
component: () => import('@/views/resource/printPurchaseApply.vue')
},
]
const router = new VueRouter({

View File

@ -0,0 +1,232 @@
<template>
<div class="print-purchase-apply">
<div class="content-wrapper">
<!-- 申请单信息 -->
<div class="row info-row">
<div class="col-sm-4">
<span>{{ $t('purchaseApplyDetail.applyNo') }}{{ printPurchaseApplyInfo.applyOrderId }}</span>
</div>
<div class="col-sm-4">
<span>{{ $t('purchaseApplyDetail.applicant') }}{{ printPurchaseApplyInfo.endUserName }}</span>
</div>
<div class="col-sm-4">
<span>{{ $t('purchaseApplyDetail.contactPhone') }}{{ printPurchaseApplyInfo.endUserTel }}</span>
</div>
</div>
<!-- 采购明细表格 -->
<table class="table table-bordered margin-top">
<thead>
<tr>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.serialNumber') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.itemName') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.itemCode') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.purchasePrice') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.applyQuantity') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.purchaseQuantity') }}</th>
<th scope="col" class="text-center">{{ $t('purchaseApplyDetail.remark') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in printPurchaseApplyInfo.purchaseApplyDetailVo" :key="index">
<th scope="row" class="text-center">{{ index + 1 }}</th>
<td class="text-center">{{ item.resName }}</td>
<td class="text-center">{{ item.resCode }}</td>
<td class="text-center">{{ item.purchasePrice }}</td>
<td class="text-center">{{ item.quantity }}</td>
<td class="text-center">{{ item.purchaseQuantity ? item.purchaseQuantity : '-' }}</td>
<td class="text-center">{{ item.remark }}</td>
</tr>
<tr>
<th scope="row" class="text-center">{{ $t('purchaseApplyDetail.remark') }}</th>
<td colspan="4">{{ printPurchaseApplyInfo.description }}</td>
<td class="text-center">{{ $t('purchaseApplyDetail.actualPurchaseTotalPrice') }}</td>
<td>{{ printPurchaseApplyInfo.purchaseTotalPrice }}</td>
</tr>
<tr height="60px">
<td colspan="2" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.manufacturerSignature') }}</td>
<td colspan="2"></td>
<td colspan="3" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.time') }}</td>
</tr>
<tr height="60px">
<td colspan="2" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.purchaserSignature') }}</td>
<td colspan="2"></td>
<td colspan="3" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.time') }}</td>
</tr>
</tbody>
</table>
<!-- 操作按钮 -->
<div id="print-btn" class="button-wrapper">
<el-button type="warning" @click="closePage" style="margin-right:20px;">
{{ $t('purchaseApplyDetail.cancel') }}
</el-button>
<el-button type="primary" @click="printPurchaseApplyDiv">
<i class="el-icon-printer"></i> {{ $t('purchaseApplyDetail.print') }}
</el-button>
</div>
</div>
</div>
</template>
<script>
import { listPurchaseApplys } from '@/api/resource/purchaseApplyManageApi'
import { messages } from './purchaseApplyDetailLang'
export default {
name: 'PrintPurchaseApply',
i18n: {
messages
},
data() {
return {
printPurchaseApplyInfo: {
applyOrderId: '',
endUserName: '',
endUserTel: '',
description: '',
purchaseTotalPrice: '',
purchaseApplyDetailVo: []
},
printFlag: '0'
}
},
created() {
this.initPrintPurchaseApplyDateInfo()
},
methods: {
//
initPrintPurchaseApplyDateInfo() {
const applyOrderId = this.$route.query.applyOrderId
const resOrderType = this.$route.query.resOrderType
if (!applyOrderId) {
this.$message.error('缺少申请单号参数')
return
}
const params = {
page: 1,
row: 1,
applyOrderId: applyOrderId,
resOrderType: resOrderType
}
listPurchaseApplys(params).then(res => {
if (res.purchaseApplys && res.purchaseApplys.length > 0) {
this.printPurchaseApplyInfo = res.purchaseApplys[0]
} else {
this.$message.error('未找到采购申请信息')
}
}).catch(error => {
console.error('获取采购申请信息失败:', error)
this.$message.error('获取采购申请信息失败')
})
},
//
printPurchaseApplyDiv() {
this.printFlag = '1'
const printBtn = document.getElementById('print-btn')
if (printBtn) {
printBtn.style.display = 'none'
}
window.print()
//
setTimeout(() => {
window.opener = null
window.close()
}, 100)
},
//
closePage() {
window.opener = null
window.close()
}
}
}
</script>
<style scoped>
.print-purchase-apply {
padding: 20px;
background: #fff;
}
.content-wrapper {
margin: 0 auto;
}
.info-row {
margin-bottom: 20px;
display: flex;
justify-content: space-between;
}
.col-sm-4 {
flex: 1;
padding: 0 10px;
}
.col-sm-4 span {
font-size: 14px;
color: #333;
}
.margin-top {
margin-top: 20px;
}
/* 原生表格样式 */
.table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
.table-bordered {
border: 1px solid #ddd;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd;
padding: 8px;
}
.table thead th {
background-color: #f5f7fa;
font-weight: bold;
color: #333;
}
.text-center {
text-align: center;
}
.button-wrapper {
text-align: right;
margin-top: 30px;
padding: 20px 0;
}
/* 打印样式 */
@media print {
.print-purchase-apply {
padding: 0;
}
#print-btn {
display: none !important;
}
.table-bordered th,
.table-bordered td {
page-break-inside: avoid;
}
}
</style>

View File

@ -45,7 +45,12 @@ export const messages = {
status: 'Status',
handleTime: 'Handle Time',
timeConsuming: 'Time Consuming',
opinion: 'Opinion'
opinion: 'Opinion',
cancel: 'Cancel',
time: 'Time',
manufacturerSignature: 'Manufacturer Signature',
purchaserSignature: 'Purchaser Signature',
remark: 'Remark'
},
auditDiv: {
workOrderProcessing: 'Work Order Processing',
@ -113,7 +118,12 @@ export const messages = {
status: '状态',
handleTime: '处理时间',
timeConsuming: '耗时',
opinion: '意见'
opinion: '意见',
cancel: '取消',
time: '时间',
manufacturerSignature: '厂家签字',
purchaserSignature: '采购人员签字',
remark: '备注'
},
auditDiv: {
workOrderProcessing: '工单办理',