Commit efd035348a87cb57fde1baae932b9892be404b23

Authored by wuxw
1 parent a2e5ee01

v1.9 优化采购相关功能

src/components/resource/deleteResourceStore.vue
@@ -52,7 +52,7 @@ export default { @@ -52,7 +52,7 @@ export default {
52 this.$emit('success') 52 this.$emit('success')
53 } catch (error) { 53 } catch (error) {
54 console.error('删除物品失败:', error) 54 console.error('删除物品失败:', error)
55 - this.$message.error(this.$t('resourceStoreManage.deleteFailed')) 55 + this.$message.error(error)
56 } 56 }
57 } 57 }
58 } 58 }
src/components/resource/deleteResourceStoreType.vue
1 <template> 1 <template>
2 <el-dialog 2 <el-dialog
3 id="deleteResourceStoreTypeModel" 3 id="deleteResourceStoreTypeModel"
4 - :title="$t('deleteResourceStoreType.confirmTitle')" 4 + :title="$t('common.delete')"
5 :visible.sync="visible" 5 :visible.sync="visible"
6 width="30%" 6 width="30%"
7 :before-close="handleClose" 7 :before-close="handleClose"
8 > 8 >
9 <div style="text-align: center;"> 9 <div style="text-align: center;">
10 - <span>{{ $t('deleteResourceStoreType.confirmMessage') }}</span> 10 + <span>{{ $t('common.confirmDelete') }}</span>
11 </div> 11 </div>
12 <span slot="footer" class="dialog-footer"> 12 <span slot="footer" class="dialog-footer">
13 - <el-button @click="handleClose">{{ $t('deleteResourceStoreType.cancel') }}</el-button>  
14 - <el-button type="primary" @click="deleteResourceStoreType">{{ $t('deleteResourceStoreType.confirm') }}</el-button> 13 + <el-button @click="handleClose">{{ $t('common.cancel') }}</el-button>
  14 + <el-button type="primary" @click="deleteResourceStoreType">{{ $t('common.confirm') }}</el-button>
15 </span> 15 </span>
16 </el-dialog> 16 </el-dialog>
17 </template> 17 </template>
src/router/index.js
@@ -734,20 +734,25 @@ const routes = [ @@ -734,20 +734,25 @@ const routes = [
734 component: () => import('@/views/report/printCommonReportTableList.vue') 734 component: () => import('@/views/report/printCommonReportTableList.vue')
735 }, 735 },
736 { 736 {
737 - path:'/pages/property/printAllocationStorehouse',  
738 - name:'/pages/property/printAllocationStorehouse', 737 + path: '/pages/property/printAllocationStorehouse',
  738 + name: '/pages/property/printAllocationStorehouse',
739 component: () => import('@/views/resource/printAllocationStorehouseList.vue') 739 component: () => import('@/views/resource/printAllocationStorehouseList.vue')
740 - },  
741 - {  
742 - path:'/pages/property/printAssetInventoryInStock',  
743 - name:'/pages/property/printAssetInventoryInStock',  
744 - component: () => import('@/views/resource/printAssetInventoryInStockList.vue')  
745 - },  
746 - {  
747 - path: '/views/fee/printOweFee',  
748 - name: '/views/fee/printOweFee',  
749 - component: () => import('@/views/fee/printOweFeeList.vue')  
750 - }, 740 + },
  741 + {
  742 + path: '/pages/property/printAssetInventoryInStock',
  743 + name: '/pages/property/printAssetInventoryInStock',
  744 + component: () => import('@/views/resource/printAssetInventoryInStockList.vue')
  745 + },
  746 + {
  747 + path: '/views/fee/printOweFee',
  748 + name: '/views/fee/printOweFee',
  749 + component: () => import('@/views/fee/printOweFeeList.vue')
  750 + },
  751 + {
  752 + path: '/pages/property/printPurchaseApply',
  753 + name: '/views/resource/printPurchaseApply',
  754 + component: () => import('@/views/resource/printPurchaseApply.vue')
  755 + },
751 ] 756 ]
752 757
753 const router = new VueRouter({ 758 const router = new VueRouter({
src/views/resource/printPurchaseApply.vue 0 → 100644
  1 +<template>
  2 + <div class="print-purchase-apply">
  3 + <div class="content-wrapper">
  4 + <!-- 申请单信息 -->
  5 + <div class="row info-row">
  6 + <div class="col-sm-4">
  7 + <span>{{ $t('purchaseApplyDetail.applyNo') }}{{ printPurchaseApplyInfo.applyOrderId }}</span>
  8 + </div>
  9 + <div class="col-sm-4">
  10 + <span>{{ $t('purchaseApplyDetail.applicant') }}{{ printPurchaseApplyInfo.endUserName }}</span>
  11 + </div>
  12 + <div class="col-sm-4">
  13 + <span>{{ $t('purchaseApplyDetail.contactPhone') }}{{ printPurchaseApplyInfo.endUserTel }}</span>
  14 + </div>
  15 + </div>
  16 +
  17 + <!-- 采购明细表格 -->
  18 + <table class="table table-bordered margin-top">
  19 + <thead>
  20 + <tr>
  21 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.serialNumber') }}</th>
  22 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.itemName') }}</th>
  23 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.itemCode') }}</th>
  24 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.purchasePrice') }}</th>
  25 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.applyQuantity') }}</th>
  26 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.purchaseQuantity') }}</th>
  27 + <th scope="col" class="text-center">{{ $t('purchaseApplyDetail.remark') }}</th>
  28 + </tr>
  29 + </thead>
  30 + <tbody>
  31 + <tr v-for="(item, index) in printPurchaseApplyInfo.purchaseApplyDetailVo" :key="index">
  32 + <th scope="row" class="text-center">{{ index + 1 }}</th>
  33 + <td class="text-center">{{ item.resName }}</td>
  34 + <td class="text-center">{{ item.resCode }}</td>
  35 + <td class="text-center">{{ item.purchasePrice }}</td>
  36 + <td class="text-center">{{ item.quantity }}</td>
  37 + <td class="text-center">{{ item.purchaseQuantity ? item.purchaseQuantity : '-' }}</td>
  38 + <td class="text-center">{{ item.remark }}</td>
  39 + </tr>
  40 + <tr>
  41 + <th scope="row" class="text-center">{{ $t('purchaseApplyDetail.remark') }}</th>
  42 + <td colspan="4">{{ printPurchaseApplyInfo.description }}</td>
  43 + <td class="text-center">{{ $t('purchaseApplyDetail.actualPurchaseTotalPrice') }}</td>
  44 + <td>{{ printPurchaseApplyInfo.purchaseTotalPrice }}</td>
  45 + </tr>
  46 + <tr height="60px">
  47 + <td colspan="2" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.manufacturerSignature') }}</td>
  48 + <td colspan="2"></td>
  49 + <td colspan="3" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.time') }}</td>
  50 + </tr>
  51 + <tr height="60px">
  52 + <td colspan="2" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.purchaserSignature') }}</td>
  53 + <td colspan="2"></td>
  54 + <td colspan="3" class="text-center" style="vertical-align:middle;">{{ $t('purchaseApplyDetail.time') }}</td>
  55 + </tr>
  56 + </tbody>
  57 + </table>
  58 +
  59 + <!-- 操作按钮 -->
  60 + <div id="print-btn" class="button-wrapper">
  61 + <el-button type="warning" @click="closePage" style="margin-right:20px;">
  62 + {{ $t('purchaseApplyDetail.cancel') }}
  63 + </el-button>
  64 + <el-button type="primary" @click="printPurchaseApplyDiv">
  65 + <i class="el-icon-printer"></i> {{ $t('purchaseApplyDetail.print') }}
  66 + </el-button>
  67 + </div>
  68 + </div>
  69 + </div>
  70 +</template>
  71 +
  72 +<script>
  73 +import { listPurchaseApplys } from '@/api/resource/purchaseApplyManageApi'
  74 +import { messages } from './purchaseApplyDetailLang'
  75 +
  76 +export default {
  77 + name: 'PrintPurchaseApply',
  78 + i18n: {
  79 + messages
  80 + },
  81 + data() {
  82 + return {
  83 + printPurchaseApplyInfo: {
  84 + applyOrderId: '',
  85 + endUserName: '',
  86 + endUserTel: '',
  87 + description: '',
  88 + purchaseTotalPrice: '',
  89 + purchaseApplyDetailVo: []
  90 + },
  91 + printFlag: '0'
  92 + }
  93 + },
  94 + created() {
  95 + this.initPrintPurchaseApplyDateInfo()
  96 + },
  97 + methods: {
  98 + // 初始化采购申请数据
  99 + initPrintPurchaseApplyDateInfo() {
  100 + const applyOrderId = this.$route.query.applyOrderId
  101 + const resOrderType = this.$route.query.resOrderType
  102 +
  103 + if (!applyOrderId) {
  104 + this.$message.error('缺少申请单号参数')
  105 + return
  106 + }
  107 +
  108 + const params = {
  109 + page: 1,
  110 + row: 1,
  111 + applyOrderId: applyOrderId,
  112 + resOrderType: resOrderType
  113 + }
  114 +
  115 + listPurchaseApplys(params).then(res => {
  116 + if (res.purchaseApplys && res.purchaseApplys.length > 0) {
  117 + this.printPurchaseApplyInfo = res.purchaseApplys[0]
  118 + } else {
  119 + this.$message.error('未找到采购申请信息')
  120 + }
  121 + }).catch(error => {
  122 + console.error('获取采购申请信息失败:', error)
  123 + this.$message.error('获取采购申请信息失败')
  124 + })
  125 + },
  126 +
  127 + // 打印
  128 + printPurchaseApplyDiv() {
  129 + this.printFlag = '1'
  130 + const printBtn = document.getElementById('print-btn')
  131 + if (printBtn) {
  132 + printBtn.style.display = 'none'
  133 + }
  134 +
  135 + window.print()
  136 +
  137 + // 打印后关闭窗口
  138 + setTimeout(() => {
  139 + window.opener = null
  140 + window.close()
  141 + }, 100)
  142 + },
  143 +
  144 + // 关闭页面
  145 + closePage() {
  146 + window.opener = null
  147 + window.close()
  148 + }
  149 + }
  150 +}
  151 +</script>
  152 +
  153 +<style scoped>
  154 +.print-purchase-apply {
  155 + padding: 20px;
  156 + background: #fff;
  157 +}
  158 +
  159 +.content-wrapper {
  160 + margin: 0 auto;
  161 +}
  162 +
  163 +.info-row {
  164 + margin-bottom: 20px;
  165 + display: flex;
  166 + justify-content: space-between;
  167 +}
  168 +
  169 +.col-sm-4 {
  170 + flex: 1;
  171 + padding: 0 10px;
  172 +}
  173 +
  174 +.col-sm-4 span {
  175 + font-size: 14px;
  176 + color: #333;
  177 +}
  178 +
  179 +.margin-top {
  180 + margin-top: 20px;
  181 +}
  182 +
  183 +/* 原生表格样式 */
  184 +.table {
  185 + width: 100%;
  186 + border-collapse: collapse;
  187 + margin-bottom: 20px;
  188 +}
  189 +
  190 +.table-bordered {
  191 + border: 1px solid #ddd;
  192 +}
  193 +
  194 +.table-bordered th,
  195 +.table-bordered td {
  196 + border: 1px solid #ddd;
  197 + padding: 8px;
  198 +}
  199 +
  200 +.table thead th {
  201 + background-color: #f5f7fa;
  202 + font-weight: bold;
  203 + color: #333;
  204 +}
  205 +
  206 +.text-center {
  207 + text-align: center;
  208 +}
  209 +
  210 +.button-wrapper {
  211 + text-align: right;
  212 + margin-top: 30px;
  213 + padding: 20px 0;
  214 +}
  215 +
  216 +/* 打印样式 */
  217 +@media print {
  218 + .print-purchase-apply {
  219 + padding: 0;
  220 + }
  221 +
  222 + #print-btn {
  223 + display: none !important;
  224 + }
  225 +
  226 + .table-bordered th,
  227 + .table-bordered td {
  228 + page-break-inside: avoid;
  229 + }
  230 +}
  231 +</style>
  232 +
src/views/resource/purchaseApplyDetailLang.js
@@ -45,7 +45,12 @@ export const messages = { @@ -45,7 +45,12 @@ export const messages = {
45 status: 'Status', 45 status: 'Status',
46 handleTime: 'Handle Time', 46 handleTime: 'Handle Time',
47 timeConsuming: 'Time Consuming', 47 timeConsuming: 'Time Consuming',
48 - opinion: 'Opinion' 48 + opinion: 'Opinion',
  49 + cancel: 'Cancel',
  50 + time: 'Time',
  51 + manufacturerSignature: 'Manufacturer Signature',
  52 + purchaserSignature: 'Purchaser Signature',
  53 + remark: 'Remark'
49 }, 54 },
50 auditDiv: { 55 auditDiv: {
51 workOrderProcessing: 'Work Order Processing', 56 workOrderProcessing: 'Work Order Processing',
@@ -113,7 +118,12 @@ export const messages = { @@ -113,7 +118,12 @@ export const messages = {
113 status: '状态', 118 status: '状态',
114 handleTime: '处理时间', 119 handleTime: '处理时间',
115 timeConsuming: '耗时', 120 timeConsuming: '耗时',
116 - opinion: '意见' 121 + opinion: '意见',
  122 + cancel: '取消',
  123 + time: '时间',
  124 + manufacturerSignature: '厂家签字',
  125 + purchaserSignature: '采购人员签字',
  126 + remark: '备注'
117 }, 127 },
118 auditDiv: { 128 auditDiv: {
119 workOrderProcessing: '工单办理', 129 workOrderProcessing: '工单办理',