Commit 79e52c9267696149a79253c3b83960a2c01bda17
1 parent
c8004a7b
采购盘点功能开发完成
Showing
18 changed files
with
1971 additions
and
1 deletions
src/api/resource/assetInventoryAuditApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取盘点详情 | |
| 4 | +export function getAssetInventoryDetail(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/assetInventory.listAssetInventory', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 获取盘点商品详情 | |
| 20 | +export function getAssetInventoryProduct(params) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/assetInventoryDetail.listAssetInventoryWholeDetail', | |
| 24 | + method: 'get', | |
| 25 | + params | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 34 | + | |
| 35 | +// 更新盘点状态 | |
| 36 | +export function updateAssetInventory(data) { | |
| 37 | + return new Promise((resolve, reject) => { | |
| 38 | + request({ | |
| 39 | + url: '/assetInventory.updateAssetInventory', | |
| 40 | + method: 'post', | |
| 41 | + data | |
| 42 | + }).then(response => { | |
| 43 | + const res = response.data | |
| 44 | + resolve(res) | |
| 45 | + }).catch(error => { | |
| 46 | + reject(error) | |
| 47 | + }) | |
| 48 | + }) | |
| 49 | +} | |
| 0 | 50 | \ No newline at end of file | ... | ... |
src/api/resource/assetInventoryEditApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 3 | + | |
| 4 | +// 获取盘点详情 | |
| 5 | +export function getAssetInventoryDetail(params) { | |
| 6 | + return new Promise((resolve, reject) => { | |
| 7 | + request({ | |
| 8 | + url: '/assetInventory.listAssetInventory', | |
| 9 | + method: 'get', | |
| 10 | + params: { | |
| 11 | + ...params, | |
| 12 | + communityId: getCommunityId() | |
| 13 | + } | |
| 14 | + }).then(response => { | |
| 15 | + resolve(response.data) | |
| 16 | + }).catch(error => { | |
| 17 | + reject(error) | |
| 18 | + }) | |
| 19 | + }) | |
| 20 | +} | |
| 21 | + | |
| 22 | +// 获取盘点商品列表 | |
| 23 | +export function listAssetInventoryWholeDetail(params) { | |
| 24 | + return new Promise((resolve, reject) => { | |
| 25 | + request({ | |
| 26 | + url: '/assetInventoryDetail.listAssetInventoryWholeDetail', | |
| 27 | + method: 'get', | |
| 28 | + params: { | |
| 29 | + ...params, | |
| 30 | + communityId: getCommunityId() | |
| 31 | + } | |
| 32 | + }).then(response => { | |
| 33 | + resolve(response.data) | |
| 34 | + }).catch(error => { | |
| 35 | + reject(error) | |
| 36 | + }) | |
| 37 | + }) | |
| 38 | +} | |
| 39 | + | |
| 40 | +// 更新盘点信息 | |
| 41 | +export function updateAssetInventory(data) { | |
| 42 | + return new Promise((resolve, reject) => { | |
| 43 | + request({ | |
| 44 | + url: '/assetInventory.updateAssetInventory', | |
| 45 | + method: 'post', | |
| 46 | + data: { | |
| 47 | + ...data, | |
| 48 | + communityId: getCommunityId() | |
| 49 | + } | |
| 50 | + }).then(response => { | |
| 51 | + resolve(response.data) | |
| 52 | + }).catch(error => { | |
| 53 | + reject(error) | |
| 54 | + }) | |
| 55 | + }) | |
| 56 | +} | |
| 57 | + | |
| 58 | +// 获取物品列表 | |
| 59 | +export function listResourceStores(params) { | |
| 60 | + return new Promise((resolve, reject) => { | |
| 61 | + request({ | |
| 62 | + url: '/resourceStore.listResourceStores', | |
| 63 | + method: 'get', | |
| 64 | + params: { | |
| 65 | + ...params, | |
| 66 | + communityId: getCommunityId() | |
| 67 | + } | |
| 68 | + }).then(response => { | |
| 69 | + resolve(response.data) | |
| 70 | + }).catch(error => { | |
| 71 | + reject(error) | |
| 72 | + }) | |
| 73 | + }) | |
| 74 | +} | |
| 75 | + | |
| 76 | +// 获取仓库列表 | |
| 77 | +export function listStorehouses(params) { | |
| 78 | + return new Promise((resolve, reject) => { | |
| 79 | + request({ | |
| 80 | + url: '/resourceStore.listStorehouses', | |
| 81 | + method: 'get', | |
| 82 | + params: { | |
| 83 | + ...params, | |
| 84 | + communityId: getCommunityId() | |
| 85 | + } | |
| 86 | + }).then(response => { | |
| 87 | + resolve(response.data) | |
| 88 | + }).catch(error => { | |
| 89 | + reject(error) | |
| 90 | + }) | |
| 91 | + }) | |
| 92 | +} | |
| 93 | + | |
| 94 | +// 获取物品类型列表 | |
| 95 | +export function listResourceStoreTypes(params) { | |
| 96 | + return new Promise((resolve, reject) => { | |
| 97 | + request({ | |
| 98 | + url: '/resourceStoreType.listResourceStoreTypes', | |
| 99 | + method: 'get', | |
| 100 | + params: { | |
| 101 | + ...params, | |
| 102 | + communityId: getCommunityId() | |
| 103 | + } | |
| 104 | + }).then(response => { | |
| 105 | + resolve(response.data) | |
| 106 | + }).catch(error => { | |
| 107 | + reject(error) | |
| 108 | + }) | |
| 109 | + }) | |
| 110 | +} | |
| 0 | 111 | \ No newline at end of file | ... | ... |
src/api/resource/assetInventoryInApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取仓库列表 | |
| 4 | +export function listStorehouses(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/resourceStore.listStorehouses', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 获取物品列表 | |
| 20 | +export function listResourceStores(params) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/resourceStore.listResourceStores', | |
| 24 | + method: 'get', | |
| 25 | + params | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 34 | + | |
| 35 | +// 获取物品类型列表 | |
| 36 | +export function listResourceStoreTypes(params) { | |
| 37 | + return new Promise((resolve, reject) => { | |
| 38 | + request({ | |
| 39 | + url: '/resourceStoreType.listResourceStoreTypes', | |
| 40 | + method: 'get', | |
| 41 | + params | |
| 42 | + }).then(response => { | |
| 43 | + const res = response.data | |
| 44 | + resolve(res) | |
| 45 | + }).catch(error => { | |
| 46 | + reject(error) | |
| 47 | + }) | |
| 48 | + }) | |
| 49 | +} | |
| 50 | + | |
| 51 | +// 保存资产盘点 | |
| 52 | +export function saveAssetInventory(data) { | |
| 53 | + return new Promise((resolve, reject) => { | |
| 54 | + request({ | |
| 55 | + url: '/assetInventory.saveAssetInventory', | |
| 56 | + method: 'post', | |
| 57 | + data | |
| 58 | + }).then(response => { | |
| 59 | + const res = response.data | |
| 60 | + resolve(res) | |
| 61 | + }).catch(error => { | |
| 62 | + reject(error) | |
| 63 | + }) | |
| 64 | + }) | |
| 65 | +} | |
| 0 | 66 | \ No newline at end of file | ... | ... |
src/api/resource/assetInventoryInStockApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取盘点信息列表 | |
| 4 | +export function getAssetInventoryList(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/assetInventory.listAssetInventory', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 获取盘点商品详情列表 | |
| 20 | +export function listAssetInventoryWholeDetail(params) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/assetInventoryDetail.listAssetInventoryWholeDetail', | |
| 24 | + method: 'get', | |
| 25 | + params | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/api/resource/printAssetInventoryInStockApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获取盘点单列表 | |
| 4 | +export function getAssetInventoryList(params) { | |
| 5 | + return new Promise((resolve, reject) => { | |
| 6 | + request({ | |
| 7 | + url: '/assetInventory.listAssetInventory', | |
| 8 | + method: 'get', | |
| 9 | + params | |
| 10 | + }).then(response => { | |
| 11 | + const res = response.data | |
| 12 | + resolve(res) | |
| 13 | + }).catch(error => { | |
| 14 | + reject(error) | |
| 15 | + }) | |
| 16 | + }) | |
| 17 | +} | |
| 18 | + | |
| 19 | +// 获取盘点单详情列表 | |
| 20 | +export function getAssetInventoryDetailList(params) { | |
| 21 | + return new Promise((resolve, reject) => { | |
| 22 | + request({ | |
| 23 | + url: '/assetInventoryDetail.listAssetInventoryWholeDetail', | |
| 24 | + method: 'get', | |
| 25 | + params | |
| 26 | + }).then(response => { | |
| 27 | + const res = response.data | |
| 28 | + resolve(res) | |
| 29 | + }).catch(error => { | |
| 30 | + reject(error) | |
| 31 | + }) | |
| 32 | + }) | |
| 33 | +} | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/i18n/resourceI18n.js
| ... | ... | @@ -22,7 +22,11 @@ import { messages as printEquipmentAccountLabelMessages } from '../views/resourc |
| 22 | 22 | import { messages as resourceDetailMessages } from '../views/resource/resourceDetailLang' |
| 23 | 23 | import { messages as allocationStorehouseDetailMessages } from '../views/resource/allocationStorehouseDetailLang' |
| 24 | 24 | import { messages as printAllocationStorehouseMessages } from '../views/resource/printAllocationStorehouseLang' |
| 25 | - | |
| 25 | +import { messages as assetInventoryInMessages } from '../views/resource/assetInventoryInLang' | |
| 26 | +import { messages as assetInventoryInStockMessages } from '../views/resource/assetInventoryInStockLang' | |
| 27 | +import { messages as assetInventoryEditMessages } from '../views/resource/assetInventoryEditLang' | |
| 28 | +import { messages as assetInventoryAuditMessages } from '../views/resource/assetInventoryAuditLang' | |
| 29 | +import { messages as printAssetInventoryInStockMessages } from '../views/resource/printAssetInventoryInStockLang' | |
| 26 | 30 | |
| 27 | 31 | export const messages = { |
| 28 | 32 | en: { |
| ... | ... | @@ -49,6 +53,11 @@ export const messages = { |
| 49 | 53 | ...resourceDetailMessages.en, |
| 50 | 54 | ...allocationStorehouseDetailMessages.en, |
| 51 | 55 | ...printAllocationStorehouseMessages.en, |
| 56 | + ...assetInventoryInMessages.en, | |
| 57 | + ...assetInventoryInStockMessages.en, | |
| 58 | + ...assetInventoryEditMessages.en, | |
| 59 | + ...assetInventoryAuditMessages.en, | |
| 60 | + ...printAssetInventoryInStockMessages.en, | |
| 52 | 61 | }, |
| 53 | 62 | zh: { |
| 54 | 63 | ...resourceAuditFlowMessages.zh, |
| ... | ... | @@ -74,5 +83,10 @@ export const messages = { |
| 74 | 83 | ...resourceDetailMessages.zh, |
| 75 | 84 | ...allocationStorehouseDetailMessages.zh, |
| 76 | 85 | ...printAllocationStorehouseMessages.zh, |
| 86 | + ...assetInventoryInMessages.zh, | |
| 87 | + ...assetInventoryInStockMessages.zh, | |
| 88 | + ...assetInventoryEditMessages.zh, | |
| 89 | + ...assetInventoryAuditMessages.zh, | |
| 90 | + ...printAssetInventoryInStockMessages.zh, | |
| 77 | 91 | } |
| 78 | 92 | } |
| 79 | 93 | \ No newline at end of file | ... | ... |
src/router/index.js
| ... | ... | @@ -719,6 +719,11 @@ const routes = [ |
| 719 | 719 | name:'/pages/property/printAllocationStorehouse', |
| 720 | 720 | component: () => import('@/views/resource/printAllocationStorehouseList.vue') |
| 721 | 721 | }, |
| 722 | + { | |
| 723 | + path:'/pages/property/printAssetInventoryInStock', | |
| 724 | + name:'/pages/property/printAssetInventoryInStock', | |
| 725 | + component: () => import('@/views/resource/printAssetInventoryInStockList.vue') | |
| 726 | + }, | |
| 722 | 727 | ] |
| 723 | 728 | |
| 724 | 729 | const router = new VueRouter({ | ... | ... |
src/router/resourceRouter.js
| ... | ... | @@ -110,5 +110,25 @@ export default [ |
| 110 | 110 | name: '/pages/common/allocationStorehouseDetail', |
| 111 | 111 | component: () => import('@/views/resource/allocationStorehouseDetailList.vue') |
| 112 | 112 | }, |
| 113 | + { | |
| 114 | + path: '/pages/property/assetInventoryIn', | |
| 115 | + name: '/pages/property/assetInventoryIn', | |
| 116 | + component: () => import('@/views/resource/assetInventoryInList.vue') | |
| 117 | + }, | |
| 118 | + { | |
| 119 | + path: '/pages/property/assetInventoryInStock', | |
| 120 | + name: '/pages/property/assetInventoryInStock', | |
| 121 | + component: () => import('@/views/resource/assetInventoryInStockList.vue') | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + path: '/pages/property/assetInventoryEdit', | |
| 125 | + name: '/pages/property/assetInventoryEdit', | |
| 126 | + component: () => import('@/views/resource/assetInventoryEditList.vue') | |
| 127 | + }, | |
| 128 | + { | |
| 129 | + path: '/pages/property/assetInventoryAudit', | |
| 130 | + name: '/pages/property/assetInventoryAudit', | |
| 131 | + component: () => import('@/views/resource/assetInventoryAuditList.vue') | |
| 132 | + }, | |
| 113 | 133 | |
| 114 | 134 | ] |
| 115 | 135 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryAuditLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + assetInventoryAudit: { | |
| 4 | + inventoryInfo: 'Inventory Information', | |
| 5 | + inventoryProducts: 'Inventory Products', | |
| 6 | + auditOpinion: 'Audit Opinion', | |
| 7 | + inventoryName: 'Inventory Name', | |
| 8 | + inventoryPerson: 'Inventory Person', | |
| 9 | + warehouse: 'Warehouse', | |
| 10 | + inventoryDate: 'Inventory Date', | |
| 11 | + remark: 'Remark', | |
| 12 | + productType: 'Product Type', | |
| 13 | + productName: 'Product Name', | |
| 14 | + specification: 'Specification', | |
| 15 | + productCode: 'Product Code', | |
| 16 | + isFixed: 'Is Fixed', | |
| 17 | + referencePrice: 'Reference Price', | |
| 18 | + originalStock: 'Original Stock', | |
| 19 | + afterInventory: 'After Inventory', | |
| 20 | + opinionPlaceholder: 'Required, please enter audit opinion', | |
| 21 | + opinionRequired: 'Audit opinion cannot be empty', | |
| 22 | + approve: 'Approve', | |
| 23 | + reject: 'Reject' | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + zh: { | |
| 27 | + assetInventoryAudit: { | |
| 28 | + inventoryInfo: '盘点信息', | |
| 29 | + inventoryProducts: '盘点商品', | |
| 30 | + auditOpinion: '审核意见', | |
| 31 | + inventoryName: '盘点名称', | |
| 32 | + inventoryPerson: '盘点人', | |
| 33 | + warehouse: '选择仓库', | |
| 34 | + inventoryDate: '盘点日期', | |
| 35 | + remark: '盘点说明', | |
| 36 | + productType: '物品类型', | |
| 37 | + productName: '物品名称', | |
| 38 | + specification: '物品规格', | |
| 39 | + productCode: '物品编码', | |
| 40 | + isFixed: '是否是固定物品', | |
| 41 | + referencePrice: '参考价格', | |
| 42 | + originalStock: '原有库存', | |
| 43 | + afterInventory: '盘点后数量', | |
| 44 | + opinionPlaceholder: '必填,请输入审核意见', | |
| 45 | + opinionRequired: '审核意见不能为空', | |
| 46 | + approve: '审核通过', | |
| 47 | + reject: '审核不通过' | |
| 48 | + } | |
| 49 | + } | |
| 50 | +} | |
| 0 | 51 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryAuditList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="asset-inventory-audit-container"> | |
| 3 | + <el-card class="box-card"> | |
| 4 | + <div slot="header" class="clearfix"> | |
| 5 | + <span>{{ $t('assetInventoryAudit.inventoryInfo') }}</span> | |
| 6 | + <div style="float: right;"> | |
| 7 | + <el-button type="primary" size="small" @click="_goBack()"> | |
| 8 | + <i class="el-icon-close"></i>{{ $t('common.back') }} | |
| 9 | + </el-button> | |
| 10 | + </div> | |
| 11 | + </div> | |
| 12 | + <el-row> | |
| 13 | + <el-col :span="24"> | |
| 14 | + <el-form label-width="120px" class="text-left"> | |
| 15 | + <el-row> | |
| 16 | + <el-col :span="12"> | |
| 17 | + <el-form-item :label="$t('assetInventoryAudit.inventoryName')"> | |
| 18 | + <span>{{ assetInventoryAuditInfo.name }}</span> | |
| 19 | + </el-form-item> | |
| 20 | + </el-col> | |
| 21 | + <el-col :span="12"> | |
| 22 | + <el-form-item :label="$t('assetInventoryAudit.inventoryPerson')"> | |
| 23 | + <span>{{ assetInventoryAuditInfo.staffName }}</span> | |
| 24 | + </el-form-item> | |
| 25 | + </el-col> | |
| 26 | + </el-row> | |
| 27 | + <el-row> | |
| 28 | + <el-col :span="12"> | |
| 29 | + <el-form-item :label="$t('assetInventoryAudit.warehouse')"> | |
| 30 | + <span>{{ assetInventoryAuditInfo.shName }}</span> | |
| 31 | + </el-form-item> | |
| 32 | + </el-col> | |
| 33 | + <el-col :span="12"> | |
| 34 | + <el-form-item :label="$t('assetInventoryAudit.inventoryDate')"> | |
| 35 | + <span>{{ assetInventoryAuditInfo.invTime }}</span> | |
| 36 | + </el-form-item> | |
| 37 | + </el-col> | |
| 38 | + </el-row> | |
| 39 | + <el-row> | |
| 40 | + <el-col :span="24"> | |
| 41 | + <el-form-item :label="$t('assetInventoryAudit.remark')"> | |
| 42 | + <span>{{ assetInventoryAuditInfo.remark }}</span> | |
| 43 | + </el-form-item> | |
| 44 | + </el-col> | |
| 45 | + </el-row> | |
| 46 | + </el-form> | |
| 47 | + </el-col> | |
| 48 | + </el-row> | |
| 49 | + </el-card> | |
| 50 | + | |
| 51 | + <el-card class="box-card" style="margin-top: 20px;"> | |
| 52 | + <div slot="header" class="clearfix"> | |
| 53 | + <span>{{ $t('assetInventoryAudit.inventoryProducts') }}</span> | |
| 54 | + </div> | |
| 55 | + <el-table :data="assetInventoryAuditInfo.resourceStores" border style="width: 100%"> | |
| 56 | + <el-table-column prop="parentRstName" :label="$t('assetInventoryAudit.productType')" align="center"> | |
| 57 | + <template slot-scope="scope"> | |
| 58 | + {{ scope.row.parentRstName ? scope.row.parentRstName : '-' }} > | |
| 59 | + {{ scope.row.rstName ? scope.row.rstName : '-' }} | |
| 60 | + </template> | |
| 61 | + </el-table-column> | |
| 62 | + <el-table-column prop="resName" :label="$t('assetInventoryAudit.productName')" align="center"> | |
| 63 | + </el-table-column> | |
| 64 | + <el-table-column prop="rssName" :label="$t('assetInventoryAudit.specification')" align="center"> | |
| 65 | + <template slot-scope="scope"> | |
| 66 | + {{ scope.row.rssName ? scope.row.rssName : '-' }} | |
| 67 | + </template> | |
| 68 | + </el-table-column> | |
| 69 | + <el-table-column prop="resCode" :label="$t('assetInventoryAudit.productCode')" align="center"> | |
| 70 | + </el-table-column> | |
| 71 | + <el-table-column prop="isFixedName" :label="$t('assetInventoryAudit.isFixed')" align="center"> | |
| 72 | + </el-table-column> | |
| 73 | + <el-table-column prop="price" :label="$t('assetInventoryAudit.referencePrice')" align="center"> | |
| 74 | + </el-table-column> | |
| 75 | + <el-table-column prop="originalStock" :label="$t('assetInventoryAudit.originalStock')" align="center"> | |
| 76 | + <template slot-scope="scope"> | |
| 77 | + {{ scope.row.originalStock }}{{ scope.row.unitCodeName }} | |
| 78 | + </template> | |
| 79 | + </el-table-column> | |
| 80 | + <el-table-column prop="quantity" :label="$t('assetInventoryAudit.afterInventory')" align="center"> | |
| 81 | + <template slot-scope="scope"> | |
| 82 | + {{ scope.row.quantity }}{{ scope.row.unitCodeName }} | |
| 83 | + </template> | |
| 84 | + </el-table-column> | |
| 85 | + <el-table-column prop="remark" :label="$t('assetInventoryAudit.remark')" align="center"> | |
| 86 | + </el-table-column> | |
| 87 | + </el-table> | |
| 88 | + </el-card> | |
| 89 | + | |
| 90 | + <el-card class="box-card" style="margin-top: 20px;"> | |
| 91 | + <div slot="header" class="clearfix"> | |
| 92 | + <span>{{ $t('assetInventoryAudit.auditOpinion') }}</span> | |
| 93 | + </div> | |
| 94 | + <el-input type="textarea" :rows="4" v-model="assetInventoryAuditInfo.opinion" | |
| 95 | + :placeholder="$t('assetInventoryAudit.opinionPlaceholder')" maxlength="250" show-word-limit> | |
| 96 | + </el-input> | |
| 97 | + <div style="margin-top: 20px; text-align: center;"> | |
| 98 | + <el-button type="primary" @click="_doAssetInventory('4000')"> | |
| 99 | + <i class="el-icon-check"></i>{{ $t('assetInventoryAudit.approve') }} | |
| 100 | + </el-button> | |
| 101 | + <el-button type="warning" style="margin-left: 20px;" @click="_doAssetInventory('3000')"> | |
| 102 | + <i class="el-icon-close"></i>{{ $t('assetInventoryAudit.reject') }} | |
| 103 | + </el-button> | |
| 104 | + </div> | |
| 105 | + </el-card> | |
| 106 | + </div> | |
| 107 | +</template> | |
| 108 | + | |
| 109 | +<script> | |
| 110 | +import { getAssetInventoryDetail, updateAssetInventory ,getAssetInventoryProduct} from '@/api/resource/assetInventoryAuditApi' | |
| 111 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 112 | + | |
| 113 | +export default { | |
| 114 | + name: 'AssetInventoryAuditList', | |
| 115 | + data() { | |
| 116 | + return { | |
| 117 | + assetInventoryAuditInfo: { | |
| 118 | + aiId: '', | |
| 119 | + shId: '', | |
| 120 | + shName: '', | |
| 121 | + name: '', | |
| 122 | + staffName: '', | |
| 123 | + invTime: '', | |
| 124 | + shopHouses: [], | |
| 125 | + resourceStores: [], | |
| 126 | + state: '2000', | |
| 127 | + remark: '', | |
| 128 | + opinion: '', | |
| 129 | + communityId: getCommunityId() | |
| 130 | + } | |
| 131 | + } | |
| 132 | + }, | |
| 133 | + created() { | |
| 134 | + this.assetInventoryAuditInfo.aiId = this.$route.query.aiId | |
| 135 | + this._queryAssetInventory() | |
| 136 | + this.queryAssetInventoryProduct() | |
| 137 | + }, | |
| 138 | + methods: { | |
| 139 | + async _doAssetInventory(state) { | |
| 140 | + if (!this.assetInventoryAuditInfo.opinion) { | |
| 141 | + this.$message.error(this.$t('assetInventoryAudit.opinionRequired')) | |
| 142 | + return | |
| 143 | + } | |
| 144 | + this.assetInventoryAuditInfo.state = state | |
| 145 | + try { | |
| 146 | + const res = await updateAssetInventory(this.assetInventoryAuditInfo) | |
| 147 | + if (res.code === 0) { | |
| 148 | + this.$message.success(res.msg) | |
| 149 | + this._goBack() | |
| 150 | + } else { | |
| 151 | + this.$message.error(res.msg) | |
| 152 | + } | |
| 153 | + } catch (error) { | |
| 154 | + this.$message.error(this.$t('common.requestFailed')) | |
| 155 | + } | |
| 156 | + }, | |
| 157 | + _goBack() { | |
| 158 | + this.$router.go(-1) | |
| 159 | + }, | |
| 160 | + async _queryAssetInventory() { | |
| 161 | + try { | |
| 162 | + const params = { | |
| 163 | + page: 1, | |
| 164 | + row: 1, | |
| 165 | + aiId: this.assetInventoryAuditInfo.aiId, | |
| 166 | + shopId: this.assetInventoryAuditInfo.communityId | |
| 167 | + } | |
| 168 | + const res = await getAssetInventoryDetail(params) | |
| 169 | + if (res.data && res.data.length > 0) { | |
| 170 | + Object.assign(this.assetInventoryAuditInfo, res.data[0]) | |
| 171 | + } | |
| 172 | + } catch (error) { | |
| 173 | + console.error('请求失败:', error) | |
| 174 | + } | |
| 175 | + }, | |
| 176 | + async queryAssetInventoryProduct() { | |
| 177 | + try { | |
| 178 | + const params = { | |
| 179 | + page: 1, | |
| 180 | + row: 100, | |
| 181 | + applyOrderId: this.assetInventoryAuditInfo.aiId | |
| 182 | + } | |
| 183 | + const res = await getAssetInventoryProduct(params) | |
| 184 | + if (res.data) { | |
| 185 | + res.data.forEach(item => { | |
| 186 | + this._computeData(item) | |
| 187 | + }) | |
| 188 | + this.assetInventoryAuditInfo.resourceStores = res.data | |
| 189 | + } | |
| 190 | + } catch (error) { | |
| 191 | + console.error('请求失败:', error) | |
| 192 | + } | |
| 193 | + }, | |
| 194 | + _computeData(item) { | |
| 195 | + item.invProfit = parseInt(item.invQuantity) - parseInt(item.quantity) | |
| 196 | + if (item.invProfit < 0) { | |
| 197 | + item.invProfit = 0 | |
| 198 | + } | |
| 199 | + item.invLoss = parseInt(item.quantity) - parseInt(item.invQuantity) | |
| 200 | + if (item.invLoss < 0) { | |
| 201 | + item.invLoss = 0 | |
| 202 | + } | |
| 203 | + item.invProfitMoney = item.invProfit * parseFloat(item.price) | |
| 204 | + item.invLossMoney = item.invLoss * parseFloat(item.price) | |
| 205 | + } | |
| 206 | + } | |
| 207 | +} | |
| 208 | +</script> | |
| 209 | + | |
| 210 | +<style lang="scss" scoped> | |
| 211 | +.asset-inventory-audit-container { | |
| 212 | + padding: 20px; | |
| 213 | + | |
| 214 | + .box-card { | |
| 215 | + margin-bottom: 20px; | |
| 216 | + | |
| 217 | + .clearfix { | |
| 218 | + display: flex; | |
| 219 | + justify-content: space-between; | |
| 220 | + align-items: center; | |
| 221 | + } | |
| 222 | + } | |
| 223 | + | |
| 224 | + .el-form-item { | |
| 225 | + margin-bottom: 0; | |
| 226 | + | |
| 227 | + span { | |
| 228 | + display: inline-block; | |
| 229 | + padding: 0 10px; | |
| 230 | + } | |
| 231 | + } | |
| 232 | +} | |
| 233 | +</style> | |
| 0 | 234 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryEditLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + assetInventoryEdit: { | |
| 4 | + title: 'Inventory Edit', | |
| 5 | + inventoryInfo: 'Inventory Information', | |
| 6 | + inventoryName: 'Inventory Name', | |
| 7 | + inventoryPerson: 'Inventory Person', | |
| 8 | + warehouse: 'Warehouse', | |
| 9 | + inventoryDate: 'Inventory Date', | |
| 10 | + remark: 'Remark', | |
| 11 | + inventoryProducts: 'Inventory Products', | |
| 12 | + products: 'Products', | |
| 13 | + productType: 'Product Type', | |
| 14 | + productName: 'Product Name', | |
| 15 | + specification: 'Specification', | |
| 16 | + productCode: 'Product Code', | |
| 17 | + isFixed: 'Is Fixed', | |
| 18 | + referencePrice: 'Reference Price', | |
| 19 | + stock: 'Stock', | |
| 20 | + afterInventoryQty: 'After Inventory Qty', | |
| 21 | + requiredQty: 'Required Qty', | |
| 22 | + optionalRemark: 'Optional Remark', | |
| 23 | + selectPrice: 'Select Price', | |
| 24 | + selectWarehouseFirst: 'Please select warehouse first', | |
| 25 | + selectProductsFirst: 'Please select products first', | |
| 26 | + fillQty: 'Please fill quantity', | |
| 27 | + submitError: 'Submit failed', | |
| 28 | + fetchError: 'Failed to get inventory info', | |
| 29 | + fetchProductError: 'Failed to get product list' | |
| 30 | + } | |
| 31 | + }, | |
| 32 | + zh: { | |
| 33 | + assetInventoryEdit: { | |
| 34 | + title: '盘点编辑', | |
| 35 | + inventoryInfo: '盘点信息', | |
| 36 | + inventoryName: '盘点名称', | |
| 37 | + inventoryPerson: '盘点人', | |
| 38 | + warehouse: '选择仓库', | |
| 39 | + inventoryDate: '盘点日期', | |
| 40 | + remark: '盘点说明', | |
| 41 | + inventoryProducts: '盘点商品', | |
| 42 | + products: '商品', | |
| 43 | + productType: '物品类型', | |
| 44 | + productName: '物品名称', | |
| 45 | + specification: '物品规格', | |
| 46 | + productCode: '物品编码', | |
| 47 | + isFixed: '是否是固定物品', | |
| 48 | + referencePrice: '参考价格', | |
| 49 | + stock: '物品库存', | |
| 50 | + afterInventoryQty: '盘点后数量', | |
| 51 | + requiredQty: '必填,请填盘点后数量', | |
| 52 | + optionalRemark: '选填,请填写备注', | |
| 53 | + selectPrice: '请选择价格', | |
| 54 | + selectWarehouseFirst: '请先选择仓库', | |
| 55 | + selectProductsFirst: '请选择商品', | |
| 56 | + fillQty: '请填写数量', | |
| 57 | + submitError: '提交失败', | |
| 58 | + fetchError: '获取盘点信息失败', | |
| 59 | + fetchProductError: '获取商品列表失败' | |
| 60 | + } | |
| 61 | + } | |
| 62 | +} | |
| 0 | 63 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryEditList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="asset-inventory-edit-container"> | |
| 3 | + | |
| 4 | + | |
| 5 | + <el-row :gutter="20"> | |
| 6 | + <el-col :span="24"> | |
| 7 | + <el-card> | |
| 8 | + <div slot="header" class="flex justify-between"> | |
| 9 | + <span>{{ $t('assetInventoryEdit.inventoryInfo') }}</span> | |
| 10 | + <div class="card-header-right"> | |
| 11 | + <el-button type="primary" size="small" @click="_goBack"> | |
| 12 | + <i class="el-icon-close"></i>{{ $t('common.back') }} | |
| 13 | + </el-button> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + <el-form label-width="120px"> | |
| 17 | + <el-row> | |
| 18 | + <el-col :span="12"> | |
| 19 | + <el-form-item :label="$t('assetInventoryEdit.inventoryName')"> | |
| 20 | + <el-input v-model="assetInventoryEditInfo.name" disabled></el-input> | |
| 21 | + </el-form-item> | |
| 22 | + </el-col> | |
| 23 | + <el-col :span="12"> | |
| 24 | + <el-form-item :label="$t('assetInventoryEdit.inventoryPerson')"> | |
| 25 | + <el-input v-model="assetInventoryEditInfo.staffName" disabled></el-input> | |
| 26 | + </el-form-item> | |
| 27 | + </el-col> | |
| 28 | + </el-row> | |
| 29 | + <el-row> | |
| 30 | + <el-col :span="12"> | |
| 31 | + <el-form-item :label="$t('assetInventoryEdit.warehouse')"> | |
| 32 | + <el-input v-model="assetInventoryEditInfo.shName" disabled></el-input> | |
| 33 | + </el-form-item> | |
| 34 | + </el-col> | |
| 35 | + <el-col :span="12"> | |
| 36 | + <el-form-item :label="$t('assetInventoryEdit.inventoryDate')"> | |
| 37 | + <el-input v-model="assetInventoryEditInfo.invTime" disabled></el-input> | |
| 38 | + </el-form-item> | |
| 39 | + </el-col> | |
| 40 | + </el-row> | |
| 41 | + <el-row> | |
| 42 | + <el-col :span="24"> | |
| 43 | + <el-form-item :label="$t('assetInventoryEdit.remark')"> | |
| 44 | + <el-input type="textarea" v-model="assetInventoryEditInfo.remark" disabled></el-input> | |
| 45 | + </el-form-item> | |
| 46 | + </el-col> | |
| 47 | + </el-row> | |
| 48 | + </el-form> | |
| 49 | + </el-card> | |
| 50 | + </el-col> | |
| 51 | + </el-row> | |
| 52 | + | |
| 53 | + <el-row :gutter="20" style="margin-top: 20px;"> | |
| 54 | + <el-col :span="24"> | |
| 55 | + <el-card> | |
| 56 | + <div slot="header" class="flex justify-between"> | |
| 57 | + <span>{{ $t('assetInventoryEdit.inventoryProducts') }}</span> | |
| 58 | + <div class="card-header-right"> | |
| 59 | + <el-button type="primary" size="small" @click="_openChooseProductModal"> | |
| 60 | + <i class="el-icon-plus"></i>{{ $t('common.select') }}{{ $t('assetInventoryEdit.products') }} | |
| 61 | + </el-button> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + | |
| 65 | + <el-table :data="assetInventoryEditInfo.resourceStores" border style="width: 100%"> | |
| 66 | + <el-table-column prop="parentRstName" :label="$t('assetInventoryEdit.productType')" align="center"> | |
| 67 | + <template slot-scope="scope"> | |
| 68 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | |
| 69 | + </template> | |
| 70 | + </el-table-column> | |
| 71 | + <el-table-column prop="resName" :label="$t('assetInventoryEdit.productName')" align="center"></el-table-column> | |
| 72 | + <el-table-column prop="rssName" :label="$t('assetInventoryEdit.specification')" align="center"> | |
| 73 | + <template slot-scope="scope"> | |
| 74 | + {{ scope.row.rssName || '-' }} | |
| 75 | + </template> | |
| 76 | + </el-table-column> | |
| 77 | + <el-table-column prop="resCode" :label="$t('assetInventoryEdit.productCode')" align="center"></el-table-column> | |
| 78 | + <el-table-column prop="isFixedName" :label="$t('assetInventoryEdit.isFixed')" align="center"></el-table-column> | |
| 79 | + <el-table-column :label="$t('assetInventoryEdit.referencePrice')" align="center"> | |
| 80 | + <template slot-scope="scope"> | |
| 81 | + <el-select | |
| 82 | + v-model="scope.row.timesId" | |
| 83 | + @change="_changeTimesId($event, scope.$index)" | |
| 84 | + style="width: 100%" | |
| 85 | + > | |
| 86 | + <el-option :value="''" :label="$t('assetInventoryEdit.selectPrice')"></el-option> | |
| 87 | + <el-option | |
| 88 | + v-for="time in scope.row.times" | |
| 89 | + :key="time.timesId" | |
| 90 | + :value="time.timesId" | |
| 91 | + :label="time.price" | |
| 92 | + ></el-option> | |
| 93 | + </el-select> | |
| 94 | + </template> | |
| 95 | + </el-table-column> | |
| 96 | + <el-table-column :label="$t('assetInventoryEdit.stock')" align="center"> | |
| 97 | + <template slot-scope="scope"> | |
| 98 | + {{ _getTimesStock(scope.row) }}{{ scope.row.unitCodeName }} | |
| 99 | + </template> | |
| 100 | + </el-table-column> | |
| 101 | + <el-table-column :label="$t('assetInventoryEdit.afterInventoryQty')" align="center"> | |
| 102 | + <template slot-scope="scope"> | |
| 103 | + <el-input-number | |
| 104 | + v-model="scope.row.quantity" | |
| 105 | + :placeholder="$t('assetInventoryEdit.requiredQty')" | |
| 106 | + controls-position="right" | |
| 107 | + :min="1" | |
| 108 | + style="width: 80%" | |
| 109 | + ></el-input-number> | |
| 110 | + <span style="margin-left: 5px">{{ scope.row.unitCodeName }}</span> | |
| 111 | + </template> | |
| 112 | + </el-table-column> | |
| 113 | + <el-table-column :label="$t('assetInventoryEdit.remark')" align="center"> | |
| 114 | + <template slot-scope="scope"> | |
| 115 | + <el-input | |
| 116 | + v-model="scope.row.remark" | |
| 117 | + :placeholder="$t('assetInventoryEdit.optionalRemark')" | |
| 118 | + ></el-input> | |
| 119 | + </template> | |
| 120 | + </el-table-column> | |
| 121 | + <el-table-column :label="$t('common.operation')" align="center" width="120"> | |
| 122 | + <template slot-scope="scope"> | |
| 123 | + <el-button | |
| 124 | + type="danger" | |
| 125 | + size="mini" | |
| 126 | + @click="_removeSelectResourceStoreItem(scope.row.resId)" | |
| 127 | + > | |
| 128 | + <i class="el-icon-delete"></i>{{ $t('common.delete') }} | |
| 129 | + </el-button> | |
| 130 | + </template> | |
| 131 | + </el-table-column> | |
| 132 | + </el-table> | |
| 133 | + </el-card> | |
| 134 | + </el-col> | |
| 135 | + </el-row> | |
| 136 | + | |
| 137 | + <el-row style="margin-top: 20px;"> | |
| 138 | + <el-col :span="24" style="text-align: right"> | |
| 139 | + <el-button type="warning" @click="_goBack"> | |
| 140 | + <i class="el-icon-close"></i>{{ $t('common.cancel') }} | |
| 141 | + </el-button> | |
| 142 | + <el-button type="primary" @click="_doAssetInventory"> | |
| 143 | + <i class="el-icon-check"></i>{{ $t('common.submit') }} | |
| 144 | + </el-button> | |
| 145 | + </el-col> | |
| 146 | + </el-row> | |
| 147 | + | |
| 148 | + <choose-resource-store2 | |
| 149 | + ref="chooseResourceStore2" | |
| 150 | + @setSelectResourceStores="handleSelectResourceStores" | |
| 151 | + ></choose-resource-store2> | |
| 152 | + | |
| 153 | + </div> | |
| 154 | +</template> | |
| 155 | + | |
| 156 | +<script> | |
| 157 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 158 | +import { | |
| 159 | + getAssetInventoryDetail, | |
| 160 | + updateAssetInventory, | |
| 161 | + listAssetInventoryWholeDetail | |
| 162 | +} from '@/api/resource/assetInventoryEditApi' | |
| 163 | +import ChooseResourceStore2 from '@/components/resource/chooseResourceStore2' | |
| 164 | + | |
| 165 | +export default { | |
| 166 | + name: 'AssetInventoryEditList', | |
| 167 | + components: { | |
| 168 | + ChooseResourceStore2 | |
| 169 | + }, | |
| 170 | + data() { | |
| 171 | + return { | |
| 172 | + assetInventoryEditInfo: { | |
| 173 | + aiId: '', | |
| 174 | + shId: '', | |
| 175 | + shName: '', | |
| 176 | + name: '', | |
| 177 | + staffName: '', | |
| 178 | + invTime: '', | |
| 179 | + shopHouses: [], | |
| 180 | + resourceStores: [], | |
| 181 | + state: '2000', | |
| 182 | + remark: '', | |
| 183 | + communityId: '' | |
| 184 | + } | |
| 185 | + } | |
| 186 | + }, | |
| 187 | + created() { | |
| 188 | + this.communityId = getCommunityId() | |
| 189 | + this.assetInventoryEditInfo.aiId = this.$route.query.aiId | |
| 190 | + this._queryAssetInventory() | |
| 191 | + this.queryAssetInventoryProduct() | |
| 192 | + }, | |
| 193 | + methods: { | |
| 194 | + async _queryAssetInventory() { | |
| 195 | + try { | |
| 196 | + const params = { | |
| 197 | + page: 1, | |
| 198 | + row: 1, | |
| 199 | + aiId: this.assetInventoryEditInfo.aiId, | |
| 200 | + shopId: this.communityId | |
| 201 | + } | |
| 202 | + const { data } = await getAssetInventoryDetail(params) | |
| 203 | + Object.assign(this.assetInventoryEditInfo, data[0]) | |
| 204 | + } catch (error) { | |
| 205 | + this.$message.error(this.$t('assetInventoryEdit.fetchError')) | |
| 206 | + } | |
| 207 | + }, | |
| 208 | + async queryAssetInventoryProduct() { | |
| 209 | + try { | |
| 210 | + const params = { | |
| 211 | + page: 1, | |
| 212 | + row: 100, | |
| 213 | + applyOrderId: this.assetInventoryEditInfo.aiId | |
| 214 | + } | |
| 215 | + const { data } = await listAssetInventoryWholeDetail(params) | |
| 216 | + data.forEach(item => { | |
| 217 | + this._computeData(item) | |
| 218 | + }) | |
| 219 | + this.assetInventoryEditInfo.resourceStores = data | |
| 220 | + } catch (error) { | |
| 221 | + this.$message.error(this.$t('assetInventoryEdit.fetchProductError')) | |
| 222 | + } | |
| 223 | + }, | |
| 224 | + _computeData(item) { | |
| 225 | + item.invProfit = parseInt(item.invQuantity) - parseInt(item.quantity) | |
| 226 | + if (item.invProfit < 0) item.invProfit = 0 | |
| 227 | + | |
| 228 | + item.invLoss = parseInt(item.quantity) - parseInt(item.invQuantity) | |
| 229 | + if (item.invLoss < 0) item.invLoss = 0 | |
| 230 | + | |
| 231 | + item.invProfitMoney = item.invProfit * parseFloat(item.price) | |
| 232 | + item.invLossMoney = item.invLoss * parseFloat(item.price) | |
| 233 | + }, | |
| 234 | + _openChooseProductModal() { | |
| 235 | + if (!this.assetInventoryEditInfo.shId) { | |
| 236 | + this.$message.warning(this.$t('assetInventoryEdit.selectWarehouseFirst')) | |
| 237 | + return | |
| 238 | + } | |
| 239 | + this.$refs.chooseResourceStore2.open({ | |
| 240 | + shId: this.assetInventoryEditInfo.shId, | |
| 241 | + unEditFlag: true | |
| 242 | + }) | |
| 243 | + }, | |
| 244 | + handleSelectResourceStores(resourceStores) { | |
| 245 | + const oldList = this.assetInventoryEditInfo.resourceStores | |
| 246 | + // 过滤重复选择的商品 | |
| 247 | + const newItems = resourceStores.filter(newItem => | |
| 248 | + !oldList.some(oldItem => oldItem.resId === newItem.resId) | |
| 249 | + ) | |
| 250 | + // 合并已有商品和新添加商品 | |
| 251 | + this.assetInventoryEditInfo.resourceStores = [...newItems, ...oldList] | |
| 252 | + }, | |
| 253 | + _removeSelectResourceStoreItem(resId) { | |
| 254 | + this.assetInventoryEditInfo.resourceStores = this.assetInventoryEditInfo.resourceStores.filter( | |
| 255 | + item => item.resId !== resId | |
| 256 | + ) | |
| 257 | + this.$refs.chooseResourceStore2.removeSelectItem(resId) | |
| 258 | + }, | |
| 259 | + _changeTimesId(value, index) { | |
| 260 | + const times = this.assetInventoryEditInfo.resourceStores[index].times | |
| 261 | + const selectedTime = times.find(item => item.timesId === value) | |
| 262 | + if (selectedTime) { | |
| 263 | + this.assetInventoryEditInfo.resourceStores[index].selectedStock = selectedTime.stock | |
| 264 | + } | |
| 265 | + }, | |
| 266 | + _getTimesStock(resourceStore) { | |
| 267 | + if (!resourceStore.timesId) return "-" | |
| 268 | + const selectedTime = resourceStore.times.find(item => item.timesId === resourceStore.timesId) | |
| 269 | + return selectedTime ? selectedTime.stock : 0 | |
| 270 | + }, | |
| 271 | + async _doAssetInventory() { | |
| 272 | + const products = this.assetInventoryEditInfo.resourceStores | |
| 273 | + this.assetInventoryEditInfo.state = "2000" | |
| 274 | + | |
| 275 | + if (products.length < 1) { | |
| 276 | + this.$message.warning(this.$t('assetInventoryEdit.selectProductsFirst')) | |
| 277 | + return | |
| 278 | + } | |
| 279 | + | |
| 280 | + for (const product of products) { | |
| 281 | + if (!product.quantity || parseInt(product.quantity) <= 0) { | |
| 282 | + this.$message.warning(this.$t('assetInventoryEdit.fillQty')) | |
| 283 | + return | |
| 284 | + } | |
| 285 | + if (!product.timesId) { | |
| 286 | + this.$message.warning(`${product.resName},${this.$t('assetInventoryEdit.selectPrice')}`) | |
| 287 | + return | |
| 288 | + } | |
| 289 | + } | |
| 290 | + | |
| 291 | + try { | |
| 292 | + const { msg } = await updateAssetInventory(this.assetInventoryEditInfo) | |
| 293 | + this.$message.success(msg) | |
| 294 | + this.$router.go(-1) | |
| 295 | + } catch (error) { | |
| 296 | + this.$message.error(error.message || this.$t('assetInventoryEdit.submitError')) | |
| 297 | + } | |
| 298 | + }, | |
| 299 | + _goBack() { | |
| 300 | + this.$router.go(-1) | |
| 301 | + } | |
| 302 | + } | |
| 303 | +} | |
| 304 | +</script> | |
| 305 | + | |
| 306 | +<style lang="scss" scoped> | |
| 307 | +.asset-inventory-edit-container { | |
| 308 | + padding: 20px; | |
| 309 | + | |
| 310 | + .box-card { | |
| 311 | + margin-bottom: 20px; | |
| 312 | + } | |
| 313 | + | |
| 314 | + .card-header-right { | |
| 315 | + float: right; | |
| 316 | + } | |
| 317 | + | |
| 318 | + .el-form-item { | |
| 319 | + margin-bottom: 0; | |
| 320 | + } | |
| 321 | +} | |
| 322 | +</style> | |
| 0 | 323 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryInLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + assetInventory: { | |
| 4 | + title: 'Asset Inventory', | |
| 5 | + name: 'Inventory Name', | |
| 6 | + namePlaceholder: 'Required, please enter inventory name', | |
| 7 | + staffName: 'Inventory Staff', | |
| 8 | + staffNamePlaceholder: 'Required, please enter inventory staff name', | |
| 9 | + storehouse: 'Storehouse', | |
| 10 | + storehousePlaceholder: 'Please select storehouse', | |
| 11 | + invTime: 'Inventory Time', | |
| 12 | + invTimePlaceholder: 'Required, please select inventory time', | |
| 13 | + remark: 'Remark', | |
| 14 | + remarkPlaceholder: 'Required, please enter remark', | |
| 15 | + itemInfo: 'Item Information', | |
| 16 | + selectItem: 'Select Items', | |
| 17 | + itemType: 'Item Type', | |
| 18 | + itemName: 'Item Name', | |
| 19 | + itemSpec: 'Item Specification', | |
| 20 | + itemCode: 'Item Code', | |
| 21 | + isFixed: 'Is Fixed', | |
| 22 | + referencePrice: 'Reference Price', | |
| 23 | + selectPrice: 'Please select price', | |
| 24 | + stock: 'Stock', | |
| 25 | + afterQuantity: 'After Quantity', | |
| 26 | + afterQuantityPlaceholder: 'Required, please enter quantity after inventory', | |
| 27 | + operation: 'Operation', | |
| 28 | + remove: 'Remove', | |
| 29 | + cancel: 'Cancel', | |
| 30 | + submit: 'Submit', | |
| 31 | + validateError: 'Please complete all required fields', | |
| 32 | + selectItemError: 'Please select at least one item', | |
| 33 | + selectPriceError: 'Please select price for all items', | |
| 34 | + quantityError: 'Please enter valid quantity for all items', | |
| 35 | + nameRequired: 'Inventory name is required', | |
| 36 | + staffNameRequired: 'Inventory staff is required', | |
| 37 | + storehouseRequired: 'Storehouse is required', | |
| 38 | + invTimeRequired: 'Inventory time is required', | |
| 39 | + remarkRequired: 'Remark is required', | |
| 40 | + selectStorehouseFirst: 'Please select storehouse first', | |
| 41 | + saveError: 'Failed to save inventory' | |
| 42 | + }, | |
| 43 | + | |
| 44 | + }, | |
| 45 | + zh: { | |
| 46 | + assetInventory: { | |
| 47 | + title: '资产盘点', | |
| 48 | + name: '盘点名称', | |
| 49 | + namePlaceholder: '必填,请填写盘点名称', | |
| 50 | + staffName: '盘点人', | |
| 51 | + staffNamePlaceholder: '必填,请填写盘点人', | |
| 52 | + storehouse: '选择仓库', | |
| 53 | + storehousePlaceholder: '请选择仓库', | |
| 54 | + invTime: '盘点日期', | |
| 55 | + invTimePlaceholder: '必填,请填写盘点日期', | |
| 56 | + remark: '盘点说明', | |
| 57 | + remarkPlaceholder: '必填,请填写盘点说明', | |
| 58 | + itemInfo: '物品信息', | |
| 59 | + selectItem: '选择物品', | |
| 60 | + itemType: '物品类型', | |
| 61 | + itemName: '物品名称', | |
| 62 | + itemSpec: '物品规格', | |
| 63 | + itemCode: '物品编码', | |
| 64 | + isFixed: '是否是固定物品', | |
| 65 | + referencePrice: '参考价格', | |
| 66 | + selectPrice: '请选择价格', | |
| 67 | + stock: '物品库存', | |
| 68 | + afterQuantity: '盘点后数量', | |
| 69 | + afterQuantityPlaceholder: '必填,请填盘点后数量', | |
| 70 | + operation: '操作', | |
| 71 | + remove: '移除', | |
| 72 | + cancel: '取消', | |
| 73 | + submit: '提交', | |
| 74 | + validateError: '请完成所有必填项', | |
| 75 | + selectItemError: '请至少选择一件物品', | |
| 76 | + selectPriceError: '请为所有物品选择价格', | |
| 77 | + quantityError: '请为所有物品输入有效数量', | |
| 78 | + nameRequired: '盘点名称不能为空', | |
| 79 | + staffNameRequired: '盘点人不能为空', | |
| 80 | + storehouseRequired: '请选择仓库', | |
| 81 | + invTimeRequired: '盘点日期不能为空', | |
| 82 | + remarkRequired: '盘点说明不能为空', | |
| 83 | + selectStorehouseFirst: '请先选择仓库', | |
| 84 | + saveError: '保存盘点失败' | |
| 85 | + }, | |
| 86 | + | |
| 87 | + } | |
| 88 | +} | |
| 0 | 89 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryInList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="asset-inventory-container"> | |
| 3 | + <el-card class="box-card"> | |
| 4 | + <div slot="header" class="flex justify-between"> | |
| 5 | + <span>{{ $t('assetInventory.title') }}</span> | |
| 6 | + </div> | |
| 7 | + | |
| 8 | + <el-row :gutter="20"> | |
| 9 | + <el-col :span="24"> | |
| 10 | + | |
| 11 | + <el-form :model="assetInventoryInInfo" label-width="120px"> | |
| 12 | + <el-row :gutter="20"> | |
| 13 | + <el-col :span="12"> | |
| 14 | + <el-form-item :label="$t('assetInventory.name')" prop="name"> | |
| 15 | + <el-input v-model="assetInventoryInInfo.name" :placeholder="$t('assetInventory.namePlaceholder')" /> | |
| 16 | + </el-form-item> | |
| 17 | + </el-col> | |
| 18 | + <el-col :span="12"> | |
| 19 | + <el-form-item :label="$t('assetInventory.staffName')" prop="staffName"> | |
| 20 | + <el-input v-model="assetInventoryInInfo.staffName" | |
| 21 | + :placeholder="$t('assetInventory.staffNamePlaceholder')" /> | |
| 22 | + </el-form-item> | |
| 23 | + </el-col> | |
| 24 | + </el-row> | |
| 25 | + | |
| 26 | + <el-row :gutter="20"> | |
| 27 | + <el-col :span="12"> | |
| 28 | + <el-form-item :label="$t('assetInventory.storehouse')" prop="shId"> | |
| 29 | + <el-select v-model="assetInventoryInInfo.shId" | |
| 30 | + :placeholder="$t('assetInventory.storehousePlaceholder')" style="width:100%" | |
| 31 | + @change="selectResourceStores"> | |
| 32 | + <el-option v-for="item in assetInventoryInInfo.storehouses" :key="item.shId" :label="item.shName" | |
| 33 | + :value="item.shId" /> | |
| 34 | + </el-select> | |
| 35 | + </el-form-item> | |
| 36 | + </el-col> | |
| 37 | + <el-col :span="12"> | |
| 38 | + <el-form-item :label="$t('assetInventory.invTime')" prop="invTime"> | |
| 39 | + <el-date-picker v-model="assetInventoryInInfo.invTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" | |
| 40 | + :placeholder="$t('assetInventory.invTimePlaceholder')" style="width:100%" /> | |
| 41 | + </el-form-item> | |
| 42 | + </el-col> | |
| 43 | + </el-row> | |
| 44 | + | |
| 45 | + <el-row> | |
| 46 | + <el-col :span="24"> | |
| 47 | + <el-form-item :label="$t('assetInventory.remark')" prop="remark"> | |
| 48 | + <el-input v-model="assetInventoryInInfo.remark" type="textarea" :rows="3" | |
| 49 | + :placeholder="$t('assetInventory.remarkPlaceholder')" maxlength="250" /> | |
| 50 | + </el-form-item> | |
| 51 | + </el-col> | |
| 52 | + </el-row> | |
| 53 | + </el-form> | |
| 54 | + | |
| 55 | + </el-col> | |
| 56 | + </el-row> | |
| 57 | + </el-card> | |
| 58 | + <el-row :gutter="20" style="margin-top:20px"> | |
| 59 | + <el-col :span="24"> | |
| 60 | + <el-card> | |
| 61 | + <div slot="header" class="flex justify-between"> | |
| 62 | + <span>{{ $t('assetInventory.itemInfo') }}</span> | |
| 63 | + <el-button v-if="assetInventoryInInfo.index != 2" type="primary" size="small" style="float:right" | |
| 64 | + @click="_openSelectResourceStoreInfoModel"> | |
| 65 | + <i class="el-icon-search"></i> | |
| 66 | + {{ $t('assetInventory.selectItem') }} | |
| 67 | + </el-button> | |
| 68 | + </div> | |
| 69 | + | |
| 70 | + <el-table :data="assetInventoryInInfo.resourceStores" border style="width:100%"> | |
| 71 | + <el-table-column :label="$t('assetInventory.itemType')" align="center"> | |
| 72 | + <template slot-scope="scope"> | |
| 73 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | |
| 74 | + </template> | |
| 75 | + </el-table-column> | |
| 76 | + <el-table-column prop="resName" :label="$t('assetInventory.itemName')" align="center" /> | |
| 77 | + <el-table-column prop="rssName" :label="$t('assetInventory.itemSpec')" align="center"> | |
| 78 | + <template slot-scope="scope"> | |
| 79 | + {{ scope.row.rssName || '-' }} | |
| 80 | + </template> | |
| 81 | + </el-table-column> | |
| 82 | + <el-table-column prop="resCode" :label="$t('assetInventory.itemCode')" align="center" /> | |
| 83 | + <el-table-column prop="isFixedName" :label="$t('assetInventory.isFixed')" align="center" /> | |
| 84 | + <el-table-column :label="$t('assetInventory.referencePrice')" align="center"> | |
| 85 | + <template slot-scope="scope"> | |
| 86 | + <el-select v-model="scope.row.timesId" style="width:100%" | |
| 87 | + @change="_changeTimesId($event, scope.$index)"> | |
| 88 | + <el-option value="" :label="$t('assetInventory.selectPrice')" /> | |
| 89 | + <el-option v-for="time in scope.row.times" :key="time.timesId" :label="time.price" | |
| 90 | + :value="time.timesId" /> | |
| 91 | + </el-select> | |
| 92 | + </template> | |
| 93 | + </el-table-column> | |
| 94 | + <el-table-column :label="$t('assetInventory.stock')" align="center"> | |
| 95 | + <template slot-scope="scope"> | |
| 96 | + {{ _getTimesStock(scope.row) }}{{ scope.row.unitCodeName }} | |
| 97 | + </template> | |
| 98 | + </el-table-column> | |
| 99 | + <el-table-column :label="$t('assetInventory.afterQuantity')" align="center"> | |
| 100 | + <template slot-scope="scope"> | |
| 101 | + <el-input-number v-model="scope.row.quantity" | |
| 102 | + :placeholder="$t('assetInventory.afterQuantityPlaceholder')" style="width:70%" :min="1" /> | |
| 103 | + <span style="margin-left:5px">{{ scope.row.unitCodeName }}</span> | |
| 104 | + </template> | |
| 105 | + </el-table-column> | |
| 106 | + <el-table-column :label="$t('assetInventory.remark')" align="center"> | |
| 107 | + <template slot-scope="scope"> | |
| 108 | + <el-input v-model="scope.row.remark" :placeholder="$t('assetInventory.itemRemarkPlaceholder')" /> | |
| 109 | + </template> | |
| 110 | + </el-table-column> | |
| 111 | + <el-table-column :label="$t('assetInventory.operation')" align="center" width="120"> | |
| 112 | + <template slot-scope="scope"> | |
| 113 | + <el-button type="danger" size="mini" @click="_removeSelectResourceStoreItem(scope.row.resId)"> | |
| 114 | + <i class="el-icon-delete"></i> | |
| 115 | + {{ $t('assetInventory.remove') }} | |
| 116 | + </el-button> | |
| 117 | + </template> | |
| 118 | + </el-table-column> | |
| 119 | + </el-table> | |
| 120 | + </el-card> | |
| 121 | + </el-col> | |
| 122 | + </el-row> | |
| 123 | + | |
| 124 | + <el-row style="margin-top:20px"> | |
| 125 | + <el-col :span="24" style="text-align:right"> | |
| 126 | + <el-button type="warning" style="margin-right:20px" @click="_goBack"> | |
| 127 | + <i class="el-icon-close"></i> | |
| 128 | + {{ $t('assetInventory.cancel') }} | |
| 129 | + </el-button> | |
| 130 | + <el-button type="primary" @click="_doAssetInventory"> | |
| 131 | + <i class="el-icon-check"></i> | |
| 132 | + {{ $t('assetInventory.submit') }} | |
| 133 | + </el-button> | |
| 134 | + </el-col> | |
| 135 | + </el-row> | |
| 136 | + | |
| 137 | + <choose-resource-store2 ref="chooseResourceStore2" @setSelectResourceStores="handleSetSelectResourceStores" /> | |
| 138 | + | |
| 139 | + </div> | |
| 140 | +</template> | |
| 141 | + | |
| 142 | +<script> | |
| 143 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 144 | +import ChooseResourceStore2 from '@/components/resource/chooseResourceStore2' | |
| 145 | +import { saveAssetInventory, listStorehouses } from '@/api/resource/assetInventoryInApi' | |
| 146 | + | |
| 147 | +export default { | |
| 148 | + name: 'AssetInventoryInList', | |
| 149 | + components: { | |
| 150 | + ChooseResourceStore2 | |
| 151 | + }, | |
| 152 | + data() { | |
| 153 | + return { | |
| 154 | + assetInventoryInInfo: { | |
| 155 | + resourceStores: [], | |
| 156 | + shId: '', | |
| 157 | + shName: '', | |
| 158 | + invTime: '', | |
| 159 | + name: '', | |
| 160 | + staffName: '', | |
| 161 | + storehouses: [], | |
| 162 | + remark: '', | |
| 163 | + state: '2000', | |
| 164 | + communityId: '' | |
| 165 | + } | |
| 166 | + } | |
| 167 | + }, | |
| 168 | + created() { | |
| 169 | + this.assetInventoryInInfo.communityId = getCommunityId() | |
| 170 | + this._listShopHouses() | |
| 171 | + }, | |
| 172 | + methods: { | |
| 173 | + async _listShopHouses() { | |
| 174 | + try { | |
| 175 | + const params = { | |
| 176 | + page: 1, | |
| 177 | + row: 100, | |
| 178 | + communityId: this.assetInventoryInInfo.communityId | |
| 179 | + } | |
| 180 | + const { data } = await listStorehouses(params) | |
| 181 | + this.assetInventoryInInfo.storehouses = data | |
| 182 | + } catch (error) { | |
| 183 | + console.error('Failed to fetch storehouses:', error) | |
| 184 | + } | |
| 185 | + }, | |
| 186 | + async _doAssetInventory() { | |
| 187 | + if (!this.doAssetInventoryValidate()) { | |
| 188 | + this.$message.error(this.$t('assetInventory.validateError')) | |
| 189 | + return | |
| 190 | + } | |
| 191 | + | |
| 192 | + if (this.assetInventoryInInfo.resourceStores.length < 1) { | |
| 193 | + this.$message.error(this.$t('assetInventory.selectItemError')) | |
| 194 | + return | |
| 195 | + } | |
| 196 | + | |
| 197 | + for (const item of this.assetInventoryInInfo.resourceStores) { | |
| 198 | + if (!item.timesId) { | |
| 199 | + this.$message.error(this.$t('assetInventory.selectPriceError')) | |
| 200 | + return | |
| 201 | + } | |
| 202 | + if (!item.quantity || parseInt(item.quantity) <= 0) { | |
| 203 | + this.$message.error(this.$t('assetInventory.quantityError')) | |
| 204 | + return | |
| 205 | + } | |
| 206 | + } | |
| 207 | + | |
| 208 | + try { | |
| 209 | + const res = await saveAssetInventory(this.assetInventoryInInfo) | |
| 210 | + if (res.code === 0) { | |
| 211 | + this.$message.success(res.msg) | |
| 212 | + this._goBack() | |
| 213 | + } else { | |
| 214 | + this.$message.error(res.msg) | |
| 215 | + } | |
| 216 | + } catch (error) { | |
| 217 | + console.error('Failed to save asset inventory:', error) | |
| 218 | + this.$message.error(this.$t('assetInventory.saveError')) | |
| 219 | + } | |
| 220 | + }, | |
| 221 | + doAssetInventoryValidate() { | |
| 222 | + const requiredFields = [ | |
| 223 | + { field: 'name', message: this.$t('assetInventory.nameRequired') }, | |
| 224 | + { field: 'staffName', message: this.$t('assetInventory.staffNameRequired') }, | |
| 225 | + { field: 'shId', message: this.$t('assetInventory.storehouseRequired') }, | |
| 226 | + { field: 'invTime', message: this.$t('assetInventory.invTimeRequired') }, | |
| 227 | + { field: 'remark', message: this.$t('assetInventory.remarkRequired') } | |
| 228 | + ] | |
| 229 | + | |
| 230 | + for (const { field, message } of requiredFields) { | |
| 231 | + if (!this.assetInventoryInInfo[field]) { | |
| 232 | + this.$message.error(message) | |
| 233 | + return false | |
| 234 | + } | |
| 235 | + } | |
| 236 | + return true | |
| 237 | + }, | |
| 238 | + _goBack() { | |
| 239 | + this.$router.go(-1) | |
| 240 | + }, | |
| 241 | + _openSelectResourceStoreInfoModel() { | |
| 242 | + if (!this.assetInventoryInInfo.shId) { | |
| 243 | + this.$message.error(this.$t('assetInventory.selectStorehouseFirst')) | |
| 244 | + return | |
| 245 | + } | |
| 246 | + this.$refs.chooseResourceStore2.open({ | |
| 247 | + shId: this.assetInventoryInInfo.shId, | |
| 248 | + unEditFlag: true | |
| 249 | + }) | |
| 250 | + }, | |
| 251 | + handleSetSelectResourceStores(resourceStores) { | |
| 252 | + const oldList = this.assetInventoryInInfo.resourceStores | |
| 253 | + const newList = resourceStores.filter(newItem => | |
| 254 | + !oldList.some(oldItem => oldItem.resId === newItem.resId) | |
| 255 | + ) | |
| 256 | + this.assetInventoryInInfo.resourceStores = [...newList, ...oldList] | |
| 257 | + }, | |
| 258 | + selectResourceStores() { | |
| 259 | + this.assetInventoryInInfo.resourceStores = [] | |
| 260 | + const store = this.assetInventoryInInfo.storehouses.find( | |
| 261 | + item => item.shId === this.assetInventoryInInfo.shId | |
| 262 | + ) | |
| 263 | + if (store) { | |
| 264 | + this.assetInventoryInInfo.shName = store.shName | |
| 265 | + } | |
| 266 | + }, | |
| 267 | + _removeSelectResourceStoreItem(resId) { | |
| 268 | + this.assetInventoryInInfo.resourceStores = this.assetInventoryInInfo.resourceStores.filter( | |
| 269 | + item => item.resId !== resId | |
| 270 | + ) | |
| 271 | + this.$refs.chooseResourceStore2.removeSelectItem(resId) | |
| 272 | + }, | |
| 273 | + _changeTimesId(value, index) { | |
| 274 | + const times = this.assetInventoryInInfo.resourceStores[index].times | |
| 275 | + const selectedTime = times.find(item => item.timesId === value) | |
| 276 | + if (selectedTime) { | |
| 277 | + this.assetInventoryInInfo.resourceStores[index].selectedStock = selectedTime.stock | |
| 278 | + } | |
| 279 | + }, | |
| 280 | + _getTimesStock(resourceStore) { | |
| 281 | + if (!resourceStore.timesId) return "-" | |
| 282 | + const time = resourceStore.times.find(item => item.timesId === resourceStore.timesId) | |
| 283 | + return time ? time.stock : 0 | |
| 284 | + } | |
| 285 | + } | |
| 286 | +} | |
| 287 | +</script> | |
| 288 | + | |
| 289 | +<style lang="scss" scoped> | |
| 290 | +.asset-inventory-container { | |
| 291 | + padding: 20px; | |
| 292 | + | |
| 293 | + .box-card { | |
| 294 | + margin-bottom: 20px; | |
| 295 | + } | |
| 296 | + | |
| 297 | + .el-row { | |
| 298 | + margin-bottom: 20px; | |
| 299 | + | |
| 300 | + &:last-child { | |
| 301 | + margin-bottom: 0; | |
| 302 | + } | |
| 303 | + } | |
| 304 | + | |
| 305 | + .clearfix { | |
| 306 | + font-weight: bold; | |
| 307 | + font-size: 16px; | |
| 308 | + } | |
| 309 | +} | |
| 310 | +</style> | |
| 0 | 311 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryInStockLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + assetInventoryInStock: { | |
| 4 | + title: 'Inventory Information', | |
| 5 | + print: 'Print', | |
| 6 | + back: 'Back', | |
| 7 | + inventoryName: 'Inventory Name', | |
| 8 | + inventoryPerson: 'Inventory Person', | |
| 9 | + warehouse: 'Warehouse', | |
| 10 | + inventoryDate: 'Inventory Date', | |
| 11 | + remark: 'Remark', | |
| 12 | + status: 'Status', | |
| 13 | + inventoryItems: 'Inventory Items', | |
| 14 | + warehouseName: 'Warehouse Name', | |
| 15 | + itemType: 'Item Type', | |
| 16 | + itemName: 'Item Name', | |
| 17 | + specification: 'Specification', | |
| 18 | + itemCode: 'Item Code', | |
| 19 | + isFixedItem: 'Is Fixed Item', | |
| 20 | + batchPrice: 'Batch Price', | |
| 21 | + originalStock: 'Original Stock', | |
| 22 | + inventoryQuantity: 'Inventory Quantity', | |
| 23 | + auditInfo: 'Audit Information', | |
| 24 | + auditor: 'Auditor', | |
| 25 | + contactNumber: 'Contact Number', | |
| 26 | + auditTime: 'Audit Time', | |
| 27 | + auditOpinion: 'Audit Opinion' | |
| 28 | + } | |
| 29 | + }, | |
| 30 | + zh: { | |
| 31 | + assetInventoryInStock: { | |
| 32 | + title: '盘点信息', | |
| 33 | + print: '打印', | |
| 34 | + back: '返回', | |
| 35 | + inventoryName: '盘点名称', | |
| 36 | + inventoryPerson: '盘点人', | |
| 37 | + warehouse: '选择仓库', | |
| 38 | + inventoryDate: '盘点日期', | |
| 39 | + remark: '盘点说明', | |
| 40 | + status: '审核状态', | |
| 41 | + inventoryItems: '盘点商品', | |
| 42 | + warehouseName: '仓库名称', | |
| 43 | + itemType: '物品类型', | |
| 44 | + itemName: '物品名称', | |
| 45 | + specification: '物品规格', | |
| 46 | + itemCode: '物品编码', | |
| 47 | + isFixedItem: '是否是固定物品', | |
| 48 | + batchPrice: '批次价格', | |
| 49 | + originalStock: '原有库存', | |
| 50 | + inventoryQuantity: '盘点后数量', | |
| 51 | + auditInfo: '审核信息', | |
| 52 | + auditor: '审核人', | |
| 53 | + contactNumber: '联系电话', | |
| 54 | + auditTime: '审核时间', | |
| 55 | + auditOpinion: '审核意见' | |
| 56 | + } | |
| 57 | + } | |
| 58 | +} | |
| 0 | 59 | \ No newline at end of file | ... | ... |
src/views/resource/assetInventoryInStockList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="asset-inventory-in-stock-container"> | |
| 3 | + <el-row> | |
| 4 | + <el-col :span="24"> | |
| 5 | + <el-card> | |
| 6 | + <div slot="header" class="flex justify-between"> | |
| 7 | + <span>{{ $t('assetInventoryInStock.title') }}</span> | |
| 8 | + <div class="card-header-actions"> | |
| 9 | + <el-button type="primary" size="small" @click="_printAssetInventoryInStock"> | |
| 10 | + <i class="el-icon-printer"></i> {{ $t('assetInventoryInStock.print') }} | |
| 11 | + </el-button> | |
| 12 | + <el-button type="primary" size="small" @click="_goBack"> | |
| 13 | + <i class="el-icon-close"></i> {{ $t('assetInventoryInStock.back') }} | |
| 14 | + </el-button> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + | |
| 18 | + <el-row> | |
| 19 | + <el-col :span="24"> | |
| 20 | + <el-form label-width="120px"> | |
| 21 | + <el-row> | |
| 22 | + <el-col :span="12"> | |
| 23 | + <el-form-item :label="$t('assetInventoryInStock.inventoryName')"> | |
| 24 | + <el-input v-model="assetInventoryInStockInfo.name" readonly></el-input> | |
| 25 | + </el-form-item> | |
| 26 | + </el-col> | |
| 27 | + <el-col :span="12"> | |
| 28 | + <el-form-item :label="$t('assetInventoryInStock.inventoryPerson')"> | |
| 29 | + <el-input v-model="assetInventoryInStockInfo.staffName" readonly></el-input> | |
| 30 | + </el-form-item> | |
| 31 | + </el-col> | |
| 32 | + </el-row> | |
| 33 | + | |
| 34 | + <el-row> | |
| 35 | + <el-col :span="12"> | |
| 36 | + <el-form-item :label="$t('assetInventoryInStock.warehouse')"> | |
| 37 | + <el-input v-model="assetInventoryInStockInfo.shName" readonly></el-input> | |
| 38 | + </el-form-item> | |
| 39 | + </el-col> | |
| 40 | + <el-col :span="12"> | |
| 41 | + <el-form-item :label="$t('assetInventoryInStock.inventoryDate')"> | |
| 42 | + <el-input v-model="assetInventoryInStockInfo.invTime" readonly></el-input> | |
| 43 | + </el-form-item> | |
| 44 | + </el-col> | |
| 45 | + </el-row> | |
| 46 | + | |
| 47 | + <el-row> | |
| 48 | + <el-col :span="24"> | |
| 49 | + <el-form-item :label="$t('assetInventoryInStock.remark')"> | |
| 50 | + <el-input type="textarea" v-model="assetInventoryInStockInfo.remark" readonly></el-input> | |
| 51 | + </el-form-item> | |
| 52 | + </el-col> | |
| 53 | + </el-row> | |
| 54 | + | |
| 55 | + <el-row> | |
| 56 | + <el-col :span="24"> | |
| 57 | + <el-form-item :label="$t('assetInventoryInStock.status')"> | |
| 58 | + <el-input v-model="assetInventoryInStockInfo.stateName" readonly></el-input> | |
| 59 | + </el-form-item> | |
| 60 | + </el-col> | |
| 61 | + </el-row> | |
| 62 | + </el-form> | |
| 63 | + </el-col> | |
| 64 | + </el-row> | |
| 65 | + </el-card> | |
| 66 | + </el-col> | |
| 67 | + </el-row> | |
| 68 | + | |
| 69 | + <el-row class="mt-20"> | |
| 70 | + <el-col :span="24"> | |
| 71 | + <el-card> | |
| 72 | + <div slot="header" class="flex justify-between"> | |
| 73 | + <span>{{ $t('assetInventoryInStock.inventoryItems') }}</span> | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + <el-table :data="assetInventoryInStockInfo.storehouses" border style="width: 100%"> | |
| 77 | + <el-table-column prop="shName" :label="$t('assetInventoryInStock.warehouseName')" align="center"></el-table-column> | |
| 78 | + <el-table-column :label="$t('assetInventoryInStock.itemType')" align="center"> | |
| 79 | + <template slot-scope="scope"> | |
| 80 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | |
| 81 | + </template> | |
| 82 | + </el-table-column> | |
| 83 | + <el-table-column prop="resName" :label="$t('assetInventoryInStock.itemName')" align="center"></el-table-column> | |
| 84 | + <el-table-column prop="specName" :label="$t('assetInventoryInStock.specification')" align="center"> | |
| 85 | + <template slot-scope="scope"> | |
| 86 | + {{ scope.row.specName || '-' }} | |
| 87 | + </template> | |
| 88 | + </el-table-column> | |
| 89 | + <el-table-column prop="resCode" :label="$t('assetInventoryInStock.itemCode')" align="center"></el-table-column> | |
| 90 | + <el-table-column prop="isFixedName" :label="$t('assetInventoryInStock.isFixedItem')" align="center"></el-table-column> | |
| 91 | + <el-table-column prop="timesPrice" :label="$t('assetInventoryInStock.batchPrice')" align="center"></el-table-column> | |
| 92 | + <el-table-column :label="$t('assetInventoryInStock.originalStock')" align="center"> | |
| 93 | + <template slot-scope="scope"> | |
| 94 | + {{ scope.row.originalStock }}{{ scope.row.unitCodeName }} | |
| 95 | + </template> | |
| 96 | + </el-table-column> | |
| 97 | + <el-table-column :label="$t('assetInventoryInStock.inventoryQuantity')" align="center"> | |
| 98 | + <template slot-scope="scope"> | |
| 99 | + {{ scope.row.quantity }}{{ scope.row.unitCodeName }} | |
| 100 | + </template> | |
| 101 | + </el-table-column> | |
| 102 | + <el-table-column prop="remark" :label="$t('assetInventoryInStock.remark')" align="center"></el-table-column> | |
| 103 | + </el-table> | |
| 104 | + </el-card> | |
| 105 | + </el-col> | |
| 106 | + </el-row> | |
| 107 | + | |
| 108 | + <el-row v-if="assetInventoryInStockInfo.state === '3000' || assetInventoryInStockInfo.state === '4000'" class="mt-20"> | |
| 109 | + <el-col :span="24"> | |
| 110 | + <el-card> | |
| 111 | + <div slot="header" class="clearfix"> | |
| 112 | + <span>{{ $t('assetInventoryInStock.auditInfo') }}</span> | |
| 113 | + </div> | |
| 114 | + | |
| 115 | + <el-form label-width="120px"> | |
| 116 | + <el-row> | |
| 117 | + <el-col :span="12"> | |
| 118 | + <el-form-item :label="$t('assetInventoryInStock.auditor')"> | |
| 119 | + <el-input v-model="assetInventoryInStockInfo.auditName" readonly></el-input> | |
| 120 | + </el-form-item> | |
| 121 | + </el-col> | |
| 122 | + <el-col :span="12"> | |
| 123 | + <el-form-item :label="$t('assetInventoryInStock.contactNumber')"> | |
| 124 | + <el-input v-model="assetInventoryInStockInfo.auditTel" readonly></el-input> | |
| 125 | + </el-form-item> | |
| 126 | + </el-col> | |
| 127 | + </el-row> | |
| 128 | + | |
| 129 | + <el-row> | |
| 130 | + <el-col :span="12"> | |
| 131 | + <el-form-item :label="$t('assetInventoryInStock.auditTime')"> | |
| 132 | + <el-input v-model="assetInventoryInStockInfo.auditTime" readonly></el-input> | |
| 133 | + </el-form-item> | |
| 134 | + </el-col> | |
| 135 | + <el-col :span="12"> | |
| 136 | + <el-form-item :label="$t('assetInventoryInStock.auditOpinion')"> | |
| 137 | + <el-input v-model="assetInventoryInStockInfo.opinion" readonly></el-input> | |
| 138 | + </el-form-item> | |
| 139 | + </el-col> | |
| 140 | + </el-row> | |
| 141 | + </el-form> | |
| 142 | + </el-card> | |
| 143 | + </el-col> | |
| 144 | + </el-row> | |
| 145 | + </div> | |
| 146 | +</template> | |
| 147 | + | |
| 148 | +<script> | |
| 149 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 150 | +import { getAssetInventoryList, listAssetInventoryWholeDetail } from '@/api/resource/assetInventoryInStockApi' | |
| 151 | + | |
| 152 | +export default { | |
| 153 | + name: 'AssetInventoryInStockList', | |
| 154 | + data() { | |
| 155 | + return { | |
| 156 | + assetInventoryInStockInfo: { | |
| 157 | + aiId: '', | |
| 158 | + shId: '', | |
| 159 | + shName: '', | |
| 160 | + name: '', | |
| 161 | + staffName: '', | |
| 162 | + invTime: '', | |
| 163 | + storehouses: [], | |
| 164 | + remark: '', | |
| 165 | + stateName: '', | |
| 166 | + opinion: '', | |
| 167 | + auditId: '', | |
| 168 | + auditName: '', | |
| 169 | + auditTel: '', | |
| 170 | + auditTime: '', | |
| 171 | + state: '', | |
| 172 | + communityId: '' | |
| 173 | + } | |
| 174 | + } | |
| 175 | + }, | |
| 176 | + created() { | |
| 177 | + this.communityId = getCommunityId() | |
| 178 | + this.assetInventoryInStockInfo.aiId = this.$route.query.aiId | |
| 179 | + this._queryAssetInventory() | |
| 180 | + this.queryAssetInventoryProduct() | |
| 181 | + }, | |
| 182 | + methods: { | |
| 183 | + _goBack() { | |
| 184 | + this.$router.go(-1) | |
| 185 | + }, | |
| 186 | + async _queryAssetInventory() { | |
| 187 | + try { | |
| 188 | + const params = { | |
| 189 | + page: 1, | |
| 190 | + row: 1, | |
| 191 | + aiId: this.assetInventoryInStockInfo.aiId, | |
| 192 | + communityId: this.communityId | |
| 193 | + } | |
| 194 | + const { data } = await getAssetInventoryList(params) | |
| 195 | + if (data && data.length > 0) { | |
| 196 | + Object.assign(this.assetInventoryInStockInfo, data[0]) | |
| 197 | + } | |
| 198 | + } catch (error) { | |
| 199 | + console.error('Failed to fetch asset inventory:', error) | |
| 200 | + } | |
| 201 | + }, | |
| 202 | + async queryAssetInventoryProduct() { | |
| 203 | + try { | |
| 204 | + const params = { | |
| 205 | + page: 1, | |
| 206 | + row: 100, | |
| 207 | + applyOrderId: this.assetInventoryInStockInfo.aiId, | |
| 208 | + communityId: this.communityId | |
| 209 | + } | |
| 210 | + const { data } = await listAssetInventoryWholeDetail(params) | |
| 211 | + data.forEach(item => this._computeData(item)) | |
| 212 | + this.assetInventoryInStockInfo.storehouses = data | |
| 213 | + } catch (error) { | |
| 214 | + console.error('Failed to fetch inventory products:', error) | |
| 215 | + } | |
| 216 | + }, | |
| 217 | + _computeData(item) { | |
| 218 | + item.invProfit = parseInt(item.invQuantity) - parseInt(item.quantity) | |
| 219 | + if (item.invProfit < 0) item.invProfit = 0 | |
| 220 | + | |
| 221 | + item.invLoss = parseInt(item.quantity) - parseInt(item.invQuantity) | |
| 222 | + if (item.invLoss < 0) item.invLoss = 0 | |
| 223 | + | |
| 224 | + item.invProfitMoney = item.invProfit * parseFloat(item.price) | |
| 225 | + item.invLossMoney = item.invLoss * parseFloat(item.price) | |
| 226 | + }, | |
| 227 | + _printAssetInventoryInStock() { | |
| 228 | + window.open(`/print.html#/pages/property/printAssetInventoryInStock?aiId=${this.assetInventoryInStockInfo.aiId}`) | |
| 229 | + } | |
| 230 | + } | |
| 231 | +} | |
| 232 | +</script> | |
| 233 | + | |
| 234 | +<style lang="scss" scoped> | |
| 235 | +.asset-inventory-in-stock-container { | |
| 236 | + padding: 20px; | |
| 237 | + | |
| 238 | + .mt-20 { | |
| 239 | + margin-top: 20px; | |
| 240 | + } | |
| 241 | + | |
| 242 | + .card-header-actions { | |
| 243 | + float: right; | |
| 244 | + } | |
| 245 | + | |
| 246 | + .el-form-item { | |
| 247 | + margin-bottom: 0; | |
| 248 | + } | |
| 249 | +} | |
| 250 | +</style> | |
| 0 | 251 | \ No newline at end of file | ... | ... |
src/views/resource/printAssetInventoryInStockLang.js
0 → 100644
| 1 | +export const messages = { | |
| 2 | + en: { | |
| 3 | + printAssetInventoryInStock: { | |
| 4 | + inventoryName: 'Inventory Name', | |
| 5 | + inventoryPerson: 'Inventory Person', | |
| 6 | + warehouse: 'Warehouse', | |
| 7 | + inventoryDate: 'Inventory Date', | |
| 8 | + warehouseName: 'Warehouse Name', | |
| 9 | + itemType: 'Item Type', | |
| 10 | + itemName: 'Item Name', | |
| 11 | + specification: 'Specification', | |
| 12 | + itemCode: 'Item Code', | |
| 13 | + isFixed: 'Is Fixed', | |
| 14 | + batchPrice: 'Batch Price', | |
| 15 | + originalStock: 'Original Stock', | |
| 16 | + afterInventory: 'After Inventory', | |
| 17 | + remark: 'Remark', | |
| 18 | + warehouseManagerSign: 'Warehouse Manager Sign', | |
| 19 | + transferPersonSign: 'Transfer Person Sign', | |
| 20 | + time: 'Time' | |
| 21 | + } | |
| 22 | + }, | |
| 23 | + zh: { | |
| 24 | + printAssetInventoryInStock: { | |
| 25 | + inventoryName: '盘点名称', | |
| 26 | + inventoryPerson: '盘点人', | |
| 27 | + warehouse: '选择仓库', | |
| 28 | + inventoryDate: '盘点日期', | |
| 29 | + warehouseName: '仓库名称', | |
| 30 | + itemType: '物品类型', | |
| 31 | + itemName: '物品名称', | |
| 32 | + specification: '物品规格', | |
| 33 | + itemCode: '物品编码', | |
| 34 | + isFixed: '是否是固定物品', | |
| 35 | + batchPrice: '批次价格', | |
| 36 | + originalStock: '原有库存', | |
| 37 | + afterInventory: '盘点后数量', | |
| 38 | + remark: '备注', | |
| 39 | + warehouseManagerSign: '仓库管理员签字', | |
| 40 | + transferPersonSign: '调拨人员签字', | |
| 41 | + time: '时间' | |
| 42 | + } | |
| 43 | + } | |
| 44 | +} | |
| 0 | 45 | \ No newline at end of file | ... | ... |
src/views/resource/printAssetInventoryInStockList.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="print-asset-inventory-container"> | |
| 3 | + | |
| 4 | + <el-row :gutter="20"> | |
| 5 | + <el-col :span="6"> | |
| 6 | + <span> | |
| 7 | + <span>{{ $t('printAssetInventoryInStock.inventoryName') }}</span>: | |
| 8 | + {{ printAssetInventoryInStockInfo.conditions.name }} | |
| 9 | + </span> | |
| 10 | + </el-col> | |
| 11 | + <el-col :span="6"> | |
| 12 | + <span> | |
| 13 | + <span>{{ $t('printAssetInventoryInStock.inventoryPerson') }}</span>: | |
| 14 | + {{ printAssetInventoryInStockInfo.conditions.staffName }} | |
| 15 | + </span> | |
| 16 | + </el-col> | |
| 17 | + <el-col :span="6"> | |
| 18 | + <span> | |
| 19 | + <span>{{ $t('printAssetInventoryInStock.warehouse') }}</span>: | |
| 20 | + {{ printAssetInventoryInStockInfo.conditions.shName }} | |
| 21 | + </span> | |
| 22 | + </el-col> | |
| 23 | + <el-col :span="6"> | |
| 24 | + <span> | |
| 25 | + <span>{{ $t('printAssetInventoryInStock.inventoryDate') }}</span>: | |
| 26 | + {{ printAssetInventoryInStockInfo.conditions.invTime }} | |
| 27 | + </span> | |
| 28 | + </el-col> | |
| 29 | + </el-row> | |
| 30 | + | |
| 31 | + <table class="table table-bordered margin-top"> | |
| 32 | + <thead> | |
| 33 | + <tr> | |
| 34 | + <th scope="col" class="text-center"> | |
| 35 | + {{ $t('printAssetInventoryInStock.warehouseName') }} | |
| 36 | + </th> | |
| 37 | + <th scope="col" class="text-center"> | |
| 38 | + {{ $t('printAssetInventoryInStock.itemType') }} | |
| 39 | + </th> | |
| 40 | + <th scope="col" class="text-center"> | |
| 41 | + {{ $t('printAssetInventoryInStock.itemName') }} | |
| 42 | + </th> | |
| 43 | + <th scope="col" class="text-center"> | |
| 44 | + {{ $t('printAssetInventoryInStock.specification') }} | |
| 45 | + </th> | |
| 46 | + <th scope="col" class="text-center"> | |
| 47 | + {{ $t('printAssetInventoryInStock.itemCode') }} | |
| 48 | + </th> | |
| 49 | + <th scope="col" class="text-center"> | |
| 50 | + {{ $t('printAssetInventoryInStock.isFixed') }} | |
| 51 | + </th> | |
| 52 | + <th scope="col" class="text-center"> | |
| 53 | + {{ $t('printAssetInventoryInStock.batchPrice') }} | |
| 54 | + </th> | |
| 55 | + <th scope="col" class="text-center"> | |
| 56 | + {{ $t('printAssetInventoryInStock.originalStock') }} | |
| 57 | + </th> | |
| 58 | + <th scope="col" class="text-center"> | |
| 59 | + {{ $t('printAssetInventoryInStock.afterInventory') }} | |
| 60 | + </th> | |
| 61 | + <th scope="col" class="text-center"> | |
| 62 | + {{ $t('printAssetInventoryInStock.remark') }} | |
| 63 | + </th> | |
| 64 | + </tr> | |
| 65 | + </thead> | |
| 66 | + <tbody> | |
| 67 | + <tr v-for="(item, index) in printAssetInventoryInStockInfo.storehouses" :key="index"> | |
| 68 | + <td class="text-center">{{ item.shName }}</td> | |
| 69 | + <td class="text-center"> | |
| 70 | + {{ item.parentRstName ? item.parentRstName : '-' }} > {{ item.rstName ? item.rstName : '-' }} | |
| 71 | + </td> | |
| 72 | + <td class="text-center">{{ item.resName }}</td> | |
| 73 | + <td class="text-center">{{ item.specName ? item.specName : '-' }}</td> | |
| 74 | + <td class="text-center">{{ item.resCode }}</td> | |
| 75 | + <td class="text-center">{{ item.isFixedName }}</td> | |
| 76 | + <td class="text-center">{{ item.timesPrice }}</td> | |
| 77 | + <td class="text-center">{{ item.originalStock }}{{ item.unitCodeName }}</td> | |
| 78 | + <td class="text-center">{{ item.quantity }}{{ item.unitCodeName }}</td> | |
| 79 | + <td class="text-center">{{ item.remark }}</td> | |
| 80 | + </tr> | |
| 81 | + <tr> | |
| 82 | + <th scope="row" class="text-center"> | |
| 83 | + {{ $t('printAssetInventoryInStock.remark') }} | |
| 84 | + </th> | |
| 85 | + <td colspan="9" style="text-align:center"> | |
| 86 | + {{ printAssetInventoryInStockInfo.conditions.remark }} | |
| 87 | + </td> | |
| 88 | + </tr> | |
| 89 | + <tr height="60px"> | |
| 90 | + <td colspan="2" class="text-center" style="vertical-align:middle;"> | |
| 91 | + {{ $t('printAssetInventoryInStock.warehouseManagerSign') }} | |
| 92 | + </td> | |
| 93 | + <td colspan="2"></td> | |
| 94 | + <td class="text-center" style="vertical-align:middle;"> | |
| 95 | + {{ $t('printAssetInventoryInStock.time') }} | |
| 96 | + </td> | |
| 97 | + <td colspan="5"></td> | |
| 98 | + </tr> | |
| 99 | + <tr height="60px"> | |
| 100 | + <td colspan="2" class="text-center" style="vertical-align:middle;"> | |
| 101 | + {{ $t('printAssetInventoryInStock.transferPersonSign') }} | |
| 102 | + </td> | |
| 103 | + <td colspan="2"></td> | |
| 104 | + <td class="text-center" style="vertical-align:middle;"> | |
| 105 | + {{ $t('printAssetInventoryInStock.time') }} | |
| 106 | + </td> | |
| 107 | + <td colspan="5"></td> | |
| 108 | + </tr> | |
| 109 | + </tbody> | |
| 110 | + </table> | |
| 111 | + | |
| 112 | + <div id="print-btn"> | |
| 113 | + <el-button type="primary" class="float-right" @click="_printAssetInventoryInStockDiv()"> | |
| 114 | + <i class="el-icon-printer"></i> {{ $t('common.print') }} | |
| 115 | + </el-button> | |
| 116 | + <el-button type="warning" class="float-right" style="margin-right:20px;" @click="_closePage()"> | |
| 117 | + {{ $t('common.cancel') }} | |
| 118 | + </el-button> | |
| 119 | + </div> | |
| 120 | + | |
| 121 | + </div> | |
| 122 | +</template> | |
| 123 | + | |
| 124 | +<script> | |
| 125 | +import { getAssetInventoryList, getAssetInventoryDetailList } from '@/api/resource/printAssetInventoryInStockApi' | |
| 126 | +import { getCommunityId } from '@/api/community/communityApi' | |
| 127 | + | |
| 128 | +export default { | |
| 129 | + name: 'PrintAssetInventoryInStockList', | |
| 130 | + data() { | |
| 131 | + return { | |
| 132 | + printAssetInventoryInStockInfo: { | |
| 133 | + storehouses: [], | |
| 134 | + conditions: {} | |
| 135 | + }, | |
| 136 | + printFlag: '0', | |
| 137 | + communityId: '' | |
| 138 | + } | |
| 139 | + }, | |
| 140 | + created() { | |
| 141 | + this.communityId = getCommunityId() | |
| 142 | + this._initPrintAssetInventoryInStockInfo() | |
| 143 | + this._listPrintAssetInventoryInStock(1, 100) | |
| 144 | + }, | |
| 145 | + methods: { | |
| 146 | + async _initPrintAssetInventoryInStockInfo() { | |
| 147 | + try { | |
| 148 | + const aiId = this.$route.query.aiId | |
| 149 | + const params = { | |
| 150 | + page: 1, | |
| 151 | + row: 1, | |
| 152 | + applyId: aiId, | |
| 153 | + communityId: this.communityId | |
| 154 | + } | |
| 155 | + const { data } = await getAssetInventoryList(params) | |
| 156 | + this.printAssetInventoryInStockInfo.conditions = data[0] | |
| 157 | + } catch (error) { | |
| 158 | + console.error('请求失败:', error) | |
| 159 | + } | |
| 160 | + }, | |
| 161 | + async _listPrintAssetInventoryInStock(page, rows) { | |
| 162 | + try { | |
| 163 | + const aiId = this.$route.query.aiId | |
| 164 | + const params = { | |
| 165 | + page: page, | |
| 166 | + row: rows, | |
| 167 | + applyOrderId: aiId, | |
| 168 | + communityId: this.communityId | |
| 169 | + } | |
| 170 | + const { data } = await getAssetInventoryDetailList(params) | |
| 171 | + this.printAssetInventoryInStockInfo.storehouses = data | |
| 172 | + } catch (error) { | |
| 173 | + console.error('请求失败:', error) | |
| 174 | + } | |
| 175 | + }, | |
| 176 | + _printAssetInventoryInStockDiv() { | |
| 177 | + this.printFlag = '1' | |
| 178 | + document.getElementById("print-btn").style.display = "none" | |
| 179 | + window.print() | |
| 180 | + window.opener = null | |
| 181 | + window.close() | |
| 182 | + }, | |
| 183 | + _closePage() { | |
| 184 | + window.opener = null | |
| 185 | + window.close() | |
| 186 | + } | |
| 187 | + } | |
| 188 | +} | |
| 189 | +</script> | |
| 190 | + | |
| 191 | +<style scoped> | |
| 192 | +.print-asset-inventory-container { | |
| 193 | + padding: 20px; | |
| 194 | +} | |
| 195 | + | |
| 196 | +.table { | |
| 197 | + width: 100%; | |
| 198 | + margin-top: 20px; | |
| 199 | + border-collapse: collapse; | |
| 200 | +} | |
| 201 | + | |
| 202 | +.table th, | |
| 203 | +.table td { | |
| 204 | + border: 1px solid #ebeef5; | |
| 205 | + padding: 12px 15px; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.text-center { | |
| 209 | + text-align: center; | |
| 210 | +} | |
| 211 | + | |
| 212 | +.margin-top { | |
| 213 | + margin-top: 20px; | |
| 214 | +} | |
| 215 | + | |
| 216 | +.float-right { | |
| 217 | + float: right; | |
| 218 | +} | |
| 219 | + | |
| 220 | +#print-btn { | |
| 221 | + margin-top: 20px; | |
| 222 | + overflow: hidden; | |
| 223 | +} | |
| 224 | +</style> | |
| 0 | 225 | \ No newline at end of file | ... | ... |