Commit fc7cb95093e4cdf09d09509e77e2db28b387a794
1 parent
1cad66ad
开发完成采购功能
Showing
44 changed files
with
6786 additions
and
77 deletions
src/api/resource/addItemOutApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 物品领用提交 | ||
| 5 | +export function goodsCollection(data) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/collection/goodsCollection', | ||
| 9 | + method: 'post', | ||
| 10 | + data: { | ||
| 11 | + ...data, | ||
| 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 listStorehouses(params = {}) { | ||
| 24 | + return new Promise((resolve, reject) => { | ||
| 25 | + const defaultParams = { | ||
| 26 | + page: 1, | ||
| 27 | + row: 100, | ||
| 28 | + communityId: getCommunityId(), | ||
| 29 | + allowUse: 'ON' | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + request({ | ||
| 33 | + url: '/resourceStore.listStorehouses', | ||
| 34 | + method: 'get', | ||
| 35 | + params: {...defaultParams, ...params} | ||
| 36 | + }).then(response => { | ||
| 37 | + resolve(response.data) | ||
| 38 | + }).catch(error => { | ||
| 39 | + reject(error) | ||
| 40 | + }) | ||
| 41 | + }) | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +// 获取物品类型列表 | ||
| 45 | +export function listResourceStoreTypes(params = {}) { | ||
| 46 | + return new Promise((resolve, reject) => { | ||
| 47 | + const defaultParams = { | ||
| 48 | + page: 1, | ||
| 49 | + row: 100, | ||
| 50 | + communityId: getCommunityId(), | ||
| 51 | + parentId: params.parentId || '0' | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + request({ | ||
| 55 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 56 | + method: 'get', | ||
| 57 | + params: {...defaultParams, ...params} | ||
| 58 | + }).then(response => { | ||
| 59 | + resolve(response.data) | ||
| 60 | + }).catch(error => { | ||
| 61 | + reject(error) | ||
| 62 | + }) | ||
| 63 | + }) | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +// 获取物品列表 | ||
| 67 | +export function listResourceStores(params = {}) { | ||
| 68 | + return new Promise((resolve, reject) => { | ||
| 69 | + const defaultParams = { | ||
| 70 | + page: 1, | ||
| 71 | + row: 10, | ||
| 72 | + communityId: getCommunityId(), | ||
| 73 | + ...params | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + request({ | ||
| 77 | + url: '/resourceStore.listResourceStores', | ||
| 78 | + method: 'get', | ||
| 79 | + params: defaultParams | ||
| 80 | + }).then(response => { | ||
| 81 | + resolve(response.data) | ||
| 82 | + }).catch(error => { | ||
| 83 | + reject(error) | ||
| 84 | + }) | ||
| 85 | + }) | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +// 获取组织树 | ||
| 89 | +export function listOrgTree(params = {}) { | ||
| 90 | + return new Promise((resolve, reject) => { | ||
| 91 | + request({ | ||
| 92 | + url: '/org.listOrgTree', | ||
| 93 | + method: 'get', | ||
| 94 | + params: { | ||
| 95 | + communityId: getCommunityId(), | ||
| 96 | + ...params | ||
| 97 | + } | ||
| 98 | + }).then(response => { | ||
| 99 | + resolve(response.data) | ||
| 100 | + }).catch(error => { | ||
| 101 | + reject(error) | ||
| 102 | + }) | ||
| 103 | + }) | ||
| 104 | +} | ||
| 105 | + | ||
| 106 | +// 获取员工信息列表 | ||
| 107 | +export function listStaffInfos(params = {}) { | ||
| 108 | + return new Promise((resolve, reject) => { | ||
| 109 | + const defaultParams = { | ||
| 110 | + page: 1, | ||
| 111 | + rows: 50, | ||
| 112 | + ...params | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + request({ | ||
| 116 | + url: '/query.staff.infos', | ||
| 117 | + method: 'get', | ||
| 118 | + params: defaultParams | ||
| 119 | + }).then(response => { | ||
| 120 | + resolve(response.data) | ||
| 121 | + }).catch(error => { | ||
| 122 | + reject(error) | ||
| 123 | + }) | ||
| 124 | + }) | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | +// 获取流程审批人 | ||
| 128 | +export function queryFirstAuditStaff(params = {}) { | ||
| 129 | + return new Promise((resolve, reject) => { | ||
| 130 | + request({ | ||
| 131 | + url: '/oaWorkflow.queryFirstAuditStaff', | ||
| 132 | + method: 'get', | ||
| 133 | + params: { | ||
| 134 | + communityId: getCommunityId(), | ||
| 135 | + ...params | ||
| 136 | + } | ||
| 137 | + }).then(response => { | ||
| 138 | + resolve(response.data) | ||
| 139 | + }).catch(error => { | ||
| 140 | + reject(error) | ||
| 141 | + }) | ||
| 142 | + }) | ||
| 143 | +} | ||
| 0 | \ No newline at end of file | 144 | \ No newline at end of file |
src/api/resource/allocationStorehouseApplyApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取仓库列表 | ||
| 5 | +export function listStorehouses(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/resourceStore.listStorehouses', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: params.communityId || getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 获取物品列表 | ||
| 24 | +export function listResourceStores(params) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/resourceStore.listResourceStores', | ||
| 28 | + method: 'get', | ||
| 29 | + params: { | ||
| 30 | + ...params, | ||
| 31 | + communityId: params.communityId || getCommunityId() | ||
| 32 | + } | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + resolve(res) | ||
| 36 | + }).catch(error => { | ||
| 37 | + reject(error) | ||
| 38 | + }) | ||
| 39 | + }) | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +// 获取物品类型列表 | ||
| 43 | +export function listResourceStoreTypes(params) { | ||
| 44 | + return new Promise((resolve, reject) => { | ||
| 45 | + request({ | ||
| 46 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 47 | + method: 'get', | ||
| 48 | + params: { | ||
| 49 | + ...params, | ||
| 50 | + communityId: params.communityId || getCommunityId() | ||
| 51 | + } | ||
| 52 | + }).then(response => { | ||
| 53 | + const res = response.data | ||
| 54 | + resolve(res) | ||
| 55 | + }).catch(error => { | ||
| 56 | + reject(error) | ||
| 57 | + }) | ||
| 58 | + }) | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +// 保存调拨申请 | ||
| 62 | +export function saveAllocationStorehouse(data) { | ||
| 63 | + return new Promise((resolve, reject) => { | ||
| 64 | + request({ | ||
| 65 | + url: '/resourceStore.saveAllocationStorehouse', | ||
| 66 | + method: 'post', | ||
| 67 | + data: { | ||
| 68 | + ...data, | ||
| 69 | + communityId: data.communityId || getCommunityId() | ||
| 70 | + } | ||
| 71 | + }).then(response => { | ||
| 72 | + const res = response.data | ||
| 73 | + resolve(res) | ||
| 74 | + }).catch(error => { | ||
| 75 | + reject(error) | ||
| 76 | + }) | ||
| 77 | + }) | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +// 获取审批人信息 | ||
| 81 | +export function queryFirstAuditStaff(params) { | ||
| 82 | + return new Promise((resolve, reject) => { | ||
| 83 | + request({ | ||
| 84 | + url: '/oaWorkflow.queryFirstAuditStaff', | ||
| 85 | + method: 'get', | ||
| 86 | + params: { | ||
| 87 | + ...params, | ||
| 88 | + communityId: params.communityId || getCommunityId() | ||
| 89 | + } | ||
| 90 | + }).then(response => { | ||
| 91 | + const res = response.data | ||
| 92 | + resolve(res) | ||
| 93 | + }).catch(error => { | ||
| 94 | + reject(error) | ||
| 95 | + }) | ||
| 96 | + }) | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +// 获取员工信息 | ||
| 100 | +export function queryStaffInfos(params) { | ||
| 101 | + return new Promise((resolve, reject) => { | ||
| 102 | + request({ | ||
| 103 | + url: '/query.staff.infos', | ||
| 104 | + method: 'get', | ||
| 105 | + params: { | ||
| 106 | + ...params, | ||
| 107 | + communityId: params.communityId || getCommunityId() | ||
| 108 | + } | ||
| 109 | + }).then(response => { | ||
| 110 | + const res = response.data | ||
| 111 | + resolve(res) | ||
| 112 | + }).catch(error => { | ||
| 113 | + reject(error) | ||
| 114 | + }) | ||
| 115 | + }) | ||
| 116 | +} | ||
| 117 | + | ||
| 118 | +// 获取组织树 | ||
| 119 | +export function listOrgTree(params) { | ||
| 120 | + return new Promise((resolve, reject) => { | ||
| 121 | + request({ | ||
| 122 | + url: '/org.listOrgTree', | ||
| 123 | + method: 'get', | ||
| 124 | + params: { | ||
| 125 | + ...params, | ||
| 126 | + communityId: params.communityId || getCommunityId() | ||
| 127 | + } | ||
| 128 | + }).then(response => { | ||
| 129 | + const res = response.data | ||
| 130 | + resolve(res) | ||
| 131 | + }).catch(error => { | ||
| 132 | + reject(error) | ||
| 133 | + }) | ||
| 134 | + }) | ||
| 135 | +} | ||
| 0 | \ No newline at end of file | 136 | \ No newline at end of file |
src/api/resource/allocationStorehouseDetailedApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取调拨明细列表 | ||
| 4 | +export function listAllocationStorehouses(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/resourceStore.listAllocationStorehouses', | ||
| 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 listStorehouses(params) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/resourceStore.listStorehouses', | ||
| 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 listResourceStoreSpecifications(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 导出数据 | ||
| 68 | +export function exportData(params) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/export.exportData', | ||
| 72 | + method: 'get', | ||
| 73 | + params | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
src/api/resource/allocationStorehouseManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取调拨记录列表 | ||
| 5 | +export function listAllocationStorehouseApplys(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/resourceStore.listAllocationStorehouseApplys', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: params.communityId || getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 获取仓库列表 | ||
| 24 | +export function listStorehouses(params) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/resourceStore.listStorehouses', | ||
| 28 | + method: 'get', | ||
| 29 | + params: { | ||
| 30 | + ...params, | ||
| 31 | + communityId: params.communityId || getCommunityId() | ||
| 32 | + } | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + resolve(res) | ||
| 36 | + }).catch(error => { | ||
| 37 | + reject(error) | ||
| 38 | + }) | ||
| 39 | + }) | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +// 保存调拨申请 | ||
| 43 | +export function saveAllocationStorehouse(data) { | ||
| 44 | + return new Promise((resolve, reject) => { | ||
| 45 | + request({ | ||
| 46 | + url: '/resourceStore.saveAllocationStorehouse', | ||
| 47 | + method: 'post', | ||
| 48 | + data: { | ||
| 49 | + ...data, | ||
| 50 | + communityId: data.communityId || getCommunityId() | ||
| 51 | + } | ||
| 52 | + }).then(response => { | ||
| 53 | + const res = response.data | ||
| 54 | + resolve(res) | ||
| 55 | + }).catch(error => { | ||
| 56 | + reject(error) | ||
| 57 | + }) | ||
| 58 | + }) | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +// 删除调拨记录 | ||
| 62 | +export function deleteAllocationStorehouse(data) { | ||
| 63 | + return new Promise((resolve, reject) => { | ||
| 64 | + request({ | ||
| 65 | + url: '/resourceStore.deleteAllocationStorehouse', | ||
| 66 | + method: 'post', | ||
| 67 | + data: { | ||
| 68 | + ...data, | ||
| 69 | + communityId: data.communityId || getCommunityId() | ||
| 70 | + } | ||
| 71 | + }).then(response => { | ||
| 72 | + const res = response.data | ||
| 73 | + resolve(res) | ||
| 74 | + }).catch(error => { | ||
| 75 | + reject(error) | ||
| 76 | + }) | ||
| 77 | + }) | ||
| 78 | +} | ||
| 79 | + | ||
| 80 | +// 获取流程图 | ||
| 81 | +export function listRunWorkflowImage(params) { | ||
| 82 | + return new Promise((resolve, reject) => { | ||
| 83 | + request({ | ||
| 84 | + url: '/workflow.listRunWorkflowImage', | ||
| 85 | + method: 'get', | ||
| 86 | + params: { | ||
| 87 | + ...params, | ||
| 88 | + communityId: params.communityId || getCommunityId() | ||
| 89 | + } | ||
| 90 | + }).then(response => { | ||
| 91 | + const res = response.data | ||
| 92 | + resolve(res) | ||
| 93 | + }).catch(error => { | ||
| 94 | + reject(error) | ||
| 95 | + }) | ||
| 96 | + }) | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +// 导出数据 | ||
| 100 | +export function exportData(params) { | ||
| 101 | + return new Promise((resolve, reject) => { | ||
| 102 | + request({ | ||
| 103 | + url: '/export.exportData', | ||
| 104 | + method: 'get', | ||
| 105 | + params: { | ||
| 106 | + ...params, | ||
| 107 | + communityId: params.communityId || getCommunityId() | ||
| 108 | + } | ||
| 109 | + }).then(response => { | ||
| 110 | + const res = response.data | ||
| 111 | + resolve(res) | ||
| 112 | + }).catch(error => { | ||
| 113 | + reject(error) | ||
| 114 | + }) | ||
| 115 | + }) | ||
| 116 | +} | ||
| 0 | \ No newline at end of file | 117 | \ No newline at end of file |
src/api/resource/allocationUserStorehouseManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取转赠记录列表 | ||
| 5 | +export function listAllocationUserStorehouses(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + params.communityId = getCommunityId() | ||
| 8 | + request({ | ||
| 9 | + url: '/resourceStore.listAllocationUserStorehouses', | ||
| 10 | + method: 'get', | ||
| 11 | + params | ||
| 12 | + }).then(response => { | ||
| 13 | + const res = response.data | ||
| 14 | + resolve(res) | ||
| 15 | + }).catch(error => { | ||
| 16 | + reject(error) | ||
| 17 | + }) | ||
| 18 | + }) | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +// 获取物品类型列表 | ||
| 22 | +export function listResourceStoreTypes(params) { | ||
| 23 | + return new Promise((resolve, reject) => { | ||
| 24 | + params.communityId = getCommunityId() | ||
| 25 | + request({ | ||
| 26 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 27 | + method: 'get', | ||
| 28 | + params | ||
| 29 | + }).then(response => { | ||
| 30 | + const res = response.data | ||
| 31 | + resolve(res) | ||
| 32 | + }).catch(error => { | ||
| 33 | + reject(error) | ||
| 34 | + }) | ||
| 35 | + }) | ||
| 36 | +} | ||
| 37 | + | ||
| 38 | +// 获取物品规格列表 | ||
| 39 | +export function listResourceStoreSpecifications(params) { | ||
| 40 | + return new Promise((resolve, reject) => { | ||
| 41 | + params.communityId = getCommunityId() | ||
| 42 | + request({ | ||
| 43 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 44 | + method: 'get', | ||
| 45 | + params | ||
| 46 | + }).then(response => { | ||
| 47 | + const res = response.data | ||
| 48 | + resolve(res) | ||
| 49 | + }).catch(error => { | ||
| 50 | + reject(error) | ||
| 51 | + }) | ||
| 52 | + }) | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +// 导出数据 | ||
| 56 | +export function exportData(params) { | ||
| 57 | + return new Promise((resolve, reject) => { | ||
| 58 | + params.communityId = getCommunityId() | ||
| 59 | + request({ | ||
| 60 | + url: '/export.exportData', | ||
| 61 | + method: 'get', | ||
| 62 | + params | ||
| 63 | + }).then(response => { | ||
| 64 | + const res = response.data | ||
| 65 | + resolve(res) | ||
| 66 | + }).catch(error => { | ||
| 67 | + reject(error) | ||
| 68 | + }) | ||
| 69 | + }) | ||
| 70 | +} | ||
| 0 | \ No newline at end of file | 71 | \ No newline at end of file |
src/api/resource/assetInventoryManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取资产盘点列表 | ||
| 4 | +export function listAssetInventory(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 deleteAssetInventory(data) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/assetInventory.deleteAssetInventory', | ||
| 24 | + method: 'post', | ||
| 25 | + data | ||
| 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 | +} | ||
| 50 | + | ||
| 51 | +// 获取仓库列表 | ||
| 52 | +export function listStorehouses(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/resourceStore.listStorehouses', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 导出资产盘点 | ||
| 68 | +export function exportAssetInventory(params) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/export.exportData', | ||
| 72 | + method: 'get', | ||
| 73 | + params | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
src/api/resource/itemOutManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取物品领用列表 | ||
| 5 | +export function listPurchaseApplys(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/purchaseApply.listPurchaseApplys', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve({ | ||
| 17 | + data: res.purchaseApplys, | ||
| 18 | + total: res.total | ||
| 19 | + }) | ||
| 20 | + }).catch(error => { | ||
| 21 | + reject(error) | ||
| 22 | + }) | ||
| 23 | + }) | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +// 删除物品领用申请 | ||
| 27 | +export function deletePurchaseApply(data) { | ||
| 28 | + return new Promise((resolve, reject) => { | ||
| 29 | + request({ | ||
| 30 | + url: '/purchaseApply.deletePurchaseApply', | ||
| 31 | + method: 'post', | ||
| 32 | + data: { | ||
| 33 | + ...data, | ||
| 34 | + communityId: getCommunityId() | ||
| 35 | + } | ||
| 36 | + }).then(response => { | ||
| 37 | + const res = response.data | ||
| 38 | + resolve(res) | ||
| 39 | + }).catch(error => { | ||
| 40 | + reject(error) | ||
| 41 | + }) | ||
| 42 | + }) | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +// 导出数据 | ||
| 46 | +export function exportData(params) { | ||
| 47 | + return new Promise((resolve, reject) => { | ||
| 48 | + request({ | ||
| 49 | + url: '/export.exportData', | ||
| 50 | + method: 'get', | ||
| 51 | + params: { | ||
| 52 | + ...params, | ||
| 53 | + communityId: getCommunityId() | ||
| 54 | + } | ||
| 55 | + }).then(response => { | ||
| 56 | + const res = response.data | ||
| 57 | + resolve(res) | ||
| 58 | + }).catch(error => { | ||
| 59 | + reject(error) | ||
| 60 | + }) | ||
| 61 | + }) | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | +// 获取工作流图片 | ||
| 65 | +export function listRunWorkflowImage(params) { | ||
| 66 | + return new Promise((resolve, reject) => { | ||
| 67 | + request({ | ||
| 68 | + url: '/workflow.listRunWorkflowImage', | ||
| 69 | + method: 'get', | ||
| 70 | + params: { | ||
| 71 | + ...params, | ||
| 72 | + communityId: getCommunityId() | ||
| 73 | + } | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
src/api/resource/myResourceStoreManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取用户物品列表 | ||
| 4 | +export function listUserStorehouses(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/resourceStore.listUserStorehouses', | ||
| 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 listResourceStoreTypes(params) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 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 listResourceStoreSpecifications(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 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 exportData(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/export.exportData', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 0 | \ No newline at end of file | 66 | \ No newline at end of file |
src/api/resource/purchaseApplyDetailManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取采购申请明细列表 | ||
| 5 | +export function listPurchaseApplyDetails(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + params.params.communityId = getCommunityId() | ||
| 8 | + request({ | ||
| 9 | + url: '/purchaseApplyDetail.listPurchaseApplyDetails', | ||
| 10 | + method: 'get', | ||
| 11 | + params: params.params | ||
| 12 | + }).then(response => { | ||
| 13 | + const res = response.data | ||
| 14 | + resolve({ | ||
| 15 | + data: res.purchaseApplyDetails, | ||
| 16 | + total: res.total | ||
| 17 | + }) | ||
| 18 | + }).catch(error => { | ||
| 19 | + reject(error) | ||
| 20 | + }) | ||
| 21 | + }) | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +// 获取物品类型列表 | ||
| 25 | +export function listResourceStoreTypes(params) { | ||
| 26 | + return new Promise((resolve, reject) => { | ||
| 27 | + params.params.communityId = getCommunityId() | ||
| 28 | + request({ | ||
| 29 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 30 | + method: 'get', | ||
| 31 | + params: params.params | ||
| 32 | + }).then(response => { | ||
| 33 | + const res = response.data | ||
| 34 | + resolve({ | ||
| 35 | + data: res.data | ||
| 36 | + }) | ||
| 37 | + }).catch(error => { | ||
| 38 | + reject(error) | ||
| 39 | + }) | ||
| 40 | + }) | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +// 获取物品规格列表 | ||
| 44 | +export function listResourceStoreSpecifications(params) { | ||
| 45 | + return new Promise((resolve, reject) => { | ||
| 46 | + params.params.communityId = getCommunityId() | ||
| 47 | + request({ | ||
| 48 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 49 | + method: 'get', | ||
| 50 | + params: params.params | ||
| 51 | + }).then(response => { | ||
| 52 | + const res = response.data | ||
| 53 | + resolve({ | ||
| 54 | + data: res.data | ||
| 55 | + }) | ||
| 56 | + }).catch(error => { | ||
| 57 | + reject(error) | ||
| 58 | + }) | ||
| 59 | + }) | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +// 获取供应商列表 | ||
| 63 | +export function listResourceSuppliers(params) { | ||
| 64 | + return new Promise((resolve, reject) => { | ||
| 65 | + params.params.communityId = getCommunityId() | ||
| 66 | + request({ | ||
| 67 | + url: '/resourceSupplier.listResourceSuppliers', | ||
| 68 | + method: 'get', | ||
| 69 | + params: params.params | ||
| 70 | + }).then(response => { | ||
| 71 | + const res = response.data | ||
| 72 | + resolve({ | ||
| 73 | + data: res.data | ||
| 74 | + }) | ||
| 75 | + }).catch(error => { | ||
| 76 | + reject(error) | ||
| 77 | + }) | ||
| 78 | + }) | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | +// 获取仓库列表 | ||
| 82 | +export function listStorehouses(params) { | ||
| 83 | + return new Promise((resolve, reject) => { | ||
| 84 | + params.params.communityId = getCommunityId() | ||
| 85 | + request({ | ||
| 86 | + url: '/resourceStore.listStorehouses', | ||
| 87 | + method: 'get', | ||
| 88 | + params: params.params | ||
| 89 | + }).then(response => { | ||
| 90 | + const res = response.data | ||
| 91 | + resolve({ | ||
| 92 | + data: res.data | ||
| 93 | + }) | ||
| 94 | + }).catch(error => { | ||
| 95 | + reject(error) | ||
| 96 | + }) | ||
| 97 | + }) | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +// 导出数据 | ||
| 101 | +export function exportData(params) { | ||
| 102 | + return new Promise((resolve, reject) => { | ||
| 103 | + params.params.communityId = getCommunityId() | ||
| 104 | + request({ | ||
| 105 | + url: '/export.exportData', | ||
| 106 | + method: 'get', | ||
| 107 | + params: params.params | ||
| 108 | + }).then(response => { | ||
| 109 | + const res = response.data | ||
| 110 | + resolve(res) | ||
| 111 | + }).catch(error => { | ||
| 112 | + reject(error) | ||
| 113 | + }) | ||
| 114 | + }) | ||
| 115 | +} | ||
| 0 | \ No newline at end of file | 116 | \ No newline at end of file |
src/api/resource/resourceStoreUseRecordManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取物品使用记录列表 | ||
| 4 | +export function listResourceStoreUseRecords(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/resourceStore.listResourceStoreUseRecords', | ||
| 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 listResourceStoreTypes(params) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 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 listResourceStoreSpecifications(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 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 exportData(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/export.exportData', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 0 | \ No newline at end of file | 66 | \ No newline at end of file |
src/components/car/searchOwner.vue
| @@ -139,7 +139,7 @@ export default { | @@ -139,7 +139,7 @@ export default { | ||
| 139 | const params = { | 139 | const params = { |
| 140 | page: page, | 140 | page: page, |
| 141 | row: size, | 141 | row: size, |
| 142 | - communityId: this.$store.getters.communityId, | 142 | + communityId: this.getCommunityId(), |
| 143 | name: this.searchInfo._currentOwnerName.trim(), | 143 | name: this.searchInfo._currentOwnerName.trim(), |
| 144 | roomName: this.searchInfo.roomName.trim(), | 144 | roomName: this.searchInfo.roomName.trim(), |
| 145 | ownerTypeCd: this.searchInfo.ownerTypeCd | 145 | ownerTypeCd: this.searchInfo.ownerTypeCd |
src/components/fee/FeeConfigDetailDiscount.vue
| @@ -103,7 +103,7 @@ export default { | @@ -103,7 +103,7 @@ export default { | ||
| 103 | try { | 103 | try { |
| 104 | await deletePayFeeConfigDiscount({ | 104 | await deletePayFeeConfigDiscount({ |
| 105 | configDiscountId: this.currentDiscount.configDiscountId, | 105 | configDiscountId: this.currentDiscount.configDiscountId, |
| 106 | - communityId: this.$store.getters.communityId | 106 | + communityId: this.getCommunityId() |
| 107 | }) | 107 | }) |
| 108 | this.$message.success(this.$t('feeConfigDetail.deleteSuccess')) | 108 | this.$message.success(this.$t('feeConfigDetail.deleteSuccess')) |
| 109 | this.loadData() | 109 | this.loadData() |
src/components/resource/allocationStorehouse.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog :title="$t('allocationStorehouse.title')" :visible.sync="visible" width="60%" @close="handleClose"> | ||
| 3 | + <el-form :model="form" :rules="rules" ref="form" label-width="120px"> | ||
| 4 | + <el-form-item :label="$t('allocationStorehouse.sourceWarehouse')" prop="shIda"> | ||
| 5 | + <el-select v-model="form.shIda" :placeholder="$t('allocationStorehouse.requiredSourceWarehouse')" | ||
| 6 | + style="width:100%" @change="handleSourceWarehouseChange"> | ||
| 7 | + <template v-for="item in storehouses"> | ||
| 8 | + <el-option :key="item.shId" :label="item.shName" :value="item.shId" v-if="item.shId !== form.shIdz" /> | ||
| 9 | + </template> | ||
| 10 | + </el-select> | ||
| 11 | + </el-form-item> | ||
| 12 | + | ||
| 13 | + <el-form-item :label="$t('allocationStorehouse.itemName')" prop="resName"> | ||
| 14 | + <el-input v-model="form.resName" :placeholder="$t('allocationStorehouse.requiredItemName')" /> | ||
| 15 | + </el-form-item> | ||
| 16 | + | ||
| 17 | + <el-form-item :label="$t('allocationStorehouse.stock')"> | ||
| 18 | + <el-input v-model="form.curStock" disabled :placeholder="$t('allocationStorehouse.requiredStock')" /> | ||
| 19 | + </el-form-item> | ||
| 20 | + | ||
| 21 | + <el-form-item :label="$t('allocationStorehouse.targetWarehouse')" prop="shIdz"> | ||
| 22 | + <el-select v-model="form.shIdz" :placeholder="$t('allocationStorehouse.requiredTargetWarehouse')" | ||
| 23 | + style="width:100%" @change="handleTargetWarehouseChange"> | ||
| 24 | + <template v-for="item in storehouses"> | ||
| 25 | + <el-option :key="item.shId" :label="item.shName" :value="item.shId" v-if="item.shId !== form.shIda" /> | ||
| 26 | + </template> | ||
| 27 | + </el-select> | ||
| 28 | + </el-form-item> | ||
| 29 | + | ||
| 30 | + <el-form-item :label="$t('allocationStorehouse.allocationCount')" prop="stock"> | ||
| 31 | + <el-input v-model="form.stock" type="number" :placeholder="$t('allocationStorehouse.requiredAllocationCount')" /> | ||
| 32 | + </el-form-item> | ||
| 33 | + | ||
| 34 | + <el-form-item :label="$t('allocationStorehouse.remark')" prop="remark"> | ||
| 35 | + <el-input type="textarea" :rows="3" v-model="form.remark" | ||
| 36 | + :placeholder="$t('allocationStorehouse.requiredRemark')" /> | ||
| 37 | + </el-form-item> | ||
| 38 | + </el-form> | ||
| 39 | + | ||
| 40 | + <span slot="footer" class="dialog-footer"> | ||
| 41 | + <el-button @click="visible = false">{{ $t('common.cancel') }}</el-button> | ||
| 42 | + <el-button type="primary" @click="handleSubmit">{{ $t('common.save') }}</el-button> | ||
| 43 | + </span> | ||
| 44 | + </el-dialog> | ||
| 45 | +</template> | ||
| 46 | + | ||
| 47 | +<script> | ||
| 48 | +import { listStorehouses } from '@/api/resource/allocationStorehouseManageApi' | ||
| 49 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 50 | + | ||
| 51 | +export default { | ||
| 52 | + name: 'AllocationStorehouse', | ||
| 53 | + data() { | ||
| 54 | + return { | ||
| 55 | + visible: false, | ||
| 56 | + storehouses: [], | ||
| 57 | + form: { | ||
| 58 | + resId: '', | ||
| 59 | + resName: '', | ||
| 60 | + resCode: '', | ||
| 61 | + remark: '', | ||
| 62 | + stock: 0, | ||
| 63 | + curStock: 0, | ||
| 64 | + shIdz: '', | ||
| 65 | + shIda: '', | ||
| 66 | + shName: '', | ||
| 67 | + communityId: getCommunityId() | ||
| 68 | + }, | ||
| 69 | + rules: { | ||
| 70 | + shIda: [ | ||
| 71 | + { required: true, message: this.$t('allocationStorehouse.requiredSourceWarehouse'), trigger: 'blur' } | ||
| 72 | + ], | ||
| 73 | + resName: [ | ||
| 74 | + { required: true, message: this.$t('allocationStorehouse.requiredItemName'), trigger: 'blur' } | ||
| 75 | + ], | ||
| 76 | + shIdz: [ | ||
| 77 | + { required: true, message: this.$t('allocationStorehouse.requiredTargetWarehouse'), trigger: 'blur' } | ||
| 78 | + ], | ||
| 79 | + stock: [ | ||
| 80 | + { required: true, message: this.$t('allocationStorehouse.requiredAllocationCount'), trigger: 'blur' }, | ||
| 81 | + { type: 'number', min: 1, message: this.$t('allocationStorehouse.positiveNumber'), trigger: 'blur' } | ||
| 82 | + ], | ||
| 83 | + remark: [ | ||
| 84 | + { required: true, message: this.$t('allocationStorehouse.requiredRemark'), trigger: 'blur' }, | ||
| 85 | + { max: 512, message: this.$t('allocationStorehouse.remarkTooLong'), trigger: 'blur' } | ||
| 86 | + ] | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + }, | ||
| 90 | + methods: { | ||
| 91 | + open() { | ||
| 92 | + this.visible = true | ||
| 93 | + this.getStorehouses() | ||
| 94 | + }, | ||
| 95 | + async getStorehouses() { | ||
| 96 | + try { | ||
| 97 | + const res = await listStorehouses({ | ||
| 98 | + page: 1, | ||
| 99 | + row: 100, | ||
| 100 | + communityId: this.form.communityId | ||
| 101 | + }) | ||
| 102 | + this.storehouses = res.data | ||
| 103 | + } catch (error) { | ||
| 104 | + console.error('获取仓库列表失败:', error) | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + handleSourceWarehouseChange(val) { | ||
| 108 | + const warehouse = this.storehouses.find(item => item.shId === val) | ||
| 109 | + if (warehouse) { | ||
| 110 | + this.form.shName = warehouse.shName | ||
| 111 | + } | ||
| 112 | + }, | ||
| 113 | + handleTargetWarehouseChange(val) { | ||
| 114 | + const warehouse = this.storehouses.find(item => item.shId === val) | ||
| 115 | + if (warehouse) { | ||
| 116 | + this.form.shName = warehouse.shName | ||
| 117 | + } | ||
| 118 | + }, | ||
| 119 | + handleSubmit() { | ||
| 120 | + this.$refs.form.validate(valid => { | ||
| 121 | + if (valid) { | ||
| 122 | + this.$emit('submit', this.form) | ||
| 123 | + this.visible = false | ||
| 124 | + } | ||
| 125 | + }) | ||
| 126 | + }, | ||
| 127 | + handleClose() { | ||
| 128 | + this.$refs.form.resetFields() | ||
| 129 | + this.form = { | ||
| 130 | + resId: '', | ||
| 131 | + resName: '', | ||
| 132 | + resCode: '', | ||
| 133 | + remark: '', | ||
| 134 | + stock: 0, | ||
| 135 | + curStock: 0, | ||
| 136 | + shIdz: '', | ||
| 137 | + shIda: '', | ||
| 138 | + shName: '', | ||
| 139 | + communityId: getCommunityId() | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | +} | ||
| 144 | +</script> | ||
| 145 | + | ||
| 146 | +<style scoped> | ||
| 147 | +.el-select { | ||
| 148 | + width: 100%; | ||
| 149 | +} | ||
| 150 | +</style> | ||
| 0 | \ No newline at end of file | 151 | \ No newline at end of file |
src/components/resource/cancelAssetInventory.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('assetInventoryManage.cancel.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('assetInventoryManage.cancel.confirmText') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="handleClose">{{ $t('common.cancel') }}</el-button> | ||
| 13 | + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script> | ||
| 19 | +import { updateAssetInventory } from '@/api/resource/assetInventoryManageApi' | ||
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 21 | + | ||
| 22 | +export default { | ||
| 23 | + name: 'CancelAssetInventory', | ||
| 24 | + data() { | ||
| 25 | + return { | ||
| 26 | + visible: false, | ||
| 27 | + currentData: null | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + methods: { | ||
| 31 | + open(data) { | ||
| 32 | + this.currentData = data | ||
| 33 | + this.visible = true | ||
| 34 | + }, | ||
| 35 | + async handleConfirm() { | ||
| 36 | + try { | ||
| 37 | + const communityId = await getCommunityId() | ||
| 38 | + const params = { | ||
| 39 | + aiId: this.currentData.aiId, | ||
| 40 | + shId: this.currentData.shId, | ||
| 41 | + state: '1000', | ||
| 42 | + communityId | ||
| 43 | + } | ||
| 44 | + await updateAssetInventory(params) | ||
| 45 | + this.$message.success(this.$t('assetInventoryManage.cancel.success')) | ||
| 46 | + this.$emit('success') | ||
| 47 | + this.handleClose() | ||
| 48 | + } catch (error) { | ||
| 49 | + console.error('取消失败:', error) | ||
| 50 | + this.$message.error(this.$t('assetInventoryManage.cancel.failed')) | ||
| 51 | + } | ||
| 52 | + }, | ||
| 53 | + handleClose() { | ||
| 54 | + this.visible = false | ||
| 55 | + this.currentData = null | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | +} | ||
| 59 | +</script> | ||
| 0 | \ No newline at end of file | 60 | \ No newline at end of file |
src/components/resource/chooseResourceStore.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog :title="$t('chooseResourceStore.title')" :visible.sync="visible" width="80%" :close-on-click-modal="false"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4"> | ||
| 5 | + <el-select v-model="form.shId" :disabled="true" style="width:100%"> | ||
| 6 | + <el-option :value="''" :label="$t('chooseResourceStore.selectWarehouse')"></el-option> | ||
| 7 | + <el-option v-for="(item, index) in storehouses" :key="index" :label="item.shName" | ||
| 8 | + :value="item.shId"></el-option> | ||
| 9 | + </el-select> | ||
| 10 | + </el-col> | ||
| 11 | + | ||
| 12 | + <el-col :span="4"> | ||
| 13 | + <el-select v-model="form.parentRstId" @change="listResourceStoreSonTypes" style="width:100%"> | ||
| 14 | + <el-option :value="''" :label="$t('chooseResourceStore.selectItemType')"></el-option> | ||
| 15 | + <el-option v-for="(item, index) in resourceStoreTypes" :key="index" :label="item.name" | ||
| 16 | + :value="item.rstId"></el-option> | ||
| 17 | + </el-select> | ||
| 18 | + </el-col> | ||
| 19 | + <el-col :span="4"> | ||
| 20 | + <el-input v-model="form._currentResourceStoreName" :placeholder="$t('chooseResourceStore.inputItemName')" | ||
| 21 | + style="width:100%"></el-input> | ||
| 22 | + </el-col> | ||
| 23 | + <el-col :span="4"> | ||
| 24 | + <el-select v-model="form.rstId" style="width:100%"> | ||
| 25 | + <el-option :value="''" :label="$t('chooseResourceStore.selectSubType')"></el-option> | ||
| 26 | + <el-option v-for="(item, index) in resourceStoreSonTypes" :key="index" :label="item.name" | ||
| 27 | + :value="item.rstId"></el-option> | ||
| 28 | + </el-select> | ||
| 29 | + </el-col> | ||
| 30 | + <el-col :span="4"> | ||
| 31 | + <el-button type="primary" @click="queryResourceStores" style="margin-left:10px"> | ||
| 32 | + <i class="el-icon-search"></i> | ||
| 33 | + {{ $t('common.search') }} | ||
| 34 | + </el-button> | ||
| 35 | + <el-button @click="resetResourceStores"> | ||
| 36 | + <i class="el-icon-refresh"></i> | ||
| 37 | + {{ $t('common.reset') }} | ||
| 38 | + </el-button> | ||
| 39 | + </el-col> | ||
| 40 | + </el-row> | ||
| 41 | + | ||
| 42 | + <div style="margin-top:15px"> | ||
| 43 | + <el-table :data="resourceStores" border style="width:100%"> | ||
| 44 | + <el-table-column width="50"> | ||
| 45 | + <template slot-scope="scope"> | ||
| 46 | + <el-checkbox v-model="selectResourceStores" :label="scope.row.resId"></el-checkbox> | ||
| 47 | + </template> | ||
| 48 | + </el-table-column> | ||
| 49 | + | ||
| 50 | + <el-table-column prop="shName" :label="$t('chooseResourceStore.warehouseName')" align="center"></el-table-column> | ||
| 51 | + | ||
| 52 | + <el-table-column prop="type" :label="$t('chooseResourceStore.itemType')" align="center"> | ||
| 53 | + <template slot-scope="scope"> | ||
| 54 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | ||
| 55 | + </template> | ||
| 56 | + </el-table-column> | ||
| 57 | + | ||
| 58 | + <el-table-column prop="resName" :label="$t('chooseResourceStore.itemName')" align="center"></el-table-column> | ||
| 59 | + | ||
| 60 | + <el-table-column prop="rssName" :label="$t('chooseResourceStore.itemSpec')" align="center"> | ||
| 61 | + <template slot-scope="scope"> | ||
| 62 | + {{ scope.row.rssName || '-' }} | ||
| 63 | + </template> | ||
| 64 | + </el-table-column> | ||
| 65 | + | ||
| 66 | + <el-table-column prop="resCode" :label="$t('chooseResourceStore.itemCode')" align="center"></el-table-column> | ||
| 67 | + | ||
| 68 | + <el-table-column prop="isFixedName" :label="$t('chooseResourceStore.isFixedItem')" | ||
| 69 | + align="center"></el-table-column> | ||
| 70 | + | ||
| 71 | + <el-table-column prop="stock" :label="$t('chooseResourceStore.itemStock')" align="center"> | ||
| 72 | + <template slot-scope="scope"> | ||
| 73 | + {{ scope.row.stock }}{{ scope.row.unitCodeName }} | ||
| 74 | + </template> | ||
| 75 | + </el-table-column> | ||
| 76 | + </el-table> | ||
| 77 | + | ||
| 78 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 79 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 80 | + @current-change="handleCurrentChange" style="margin-top:20px"></el-pagination> | ||
| 81 | + | ||
| 82 | + <div style="margin-top:20px;text-align:right"> | ||
| 83 | + <el-button type="primary" @click="submitChoose"> | ||
| 84 | + <i class="el-icon-check"></i> | ||
| 85 | + {{ $t('common.submit') }} | ||
| 86 | + </el-button> | ||
| 87 | + <el-button @click="visible = false"> | ||
| 88 | + <i class="el-icon-close"></i> | ||
| 89 | + {{ $t('common.cancel') }} | ||
| 90 | + </el-button> | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | + </el-dialog> | ||
| 94 | +</template> | ||
| 95 | + | ||
| 96 | +<script> | ||
| 97 | +import { | ||
| 98 | + listResourceStores, | ||
| 99 | + listStorehouses, | ||
| 100 | + listResourceStoreTypes | ||
| 101 | +} from '@/api/resource/allocationStorehouseApplyApi' | ||
| 102 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 103 | + | ||
| 104 | +export default { | ||
| 105 | + name: 'ChooseResourceStore', | ||
| 106 | + props: { | ||
| 107 | + emitChooseResourceStore: String, | ||
| 108 | + emitLoadData: String | ||
| 109 | + }, | ||
| 110 | + data() { | ||
| 111 | + return { | ||
| 112 | + visible: false, | ||
| 113 | + form: { | ||
| 114 | + resourceStores: [], | ||
| 115 | + selectResourceStores: [], | ||
| 116 | + _currentResourceStoreName: '', | ||
| 117 | + parentRstId: '', | ||
| 118 | + rstId: '', | ||
| 119 | + shId: '', | ||
| 120 | + newShId: '', | ||
| 121 | + storehouses: [], | ||
| 122 | + resourceStoreTypes: [], | ||
| 123 | + resourceStoreSonTypes: [], | ||
| 124 | + name: '', | ||
| 125 | + resOrderType: '', | ||
| 126 | + isAllocation: false | ||
| 127 | + }, | ||
| 128 | + resourceStores: [], | ||
| 129 | + storehouses: [], | ||
| 130 | + resourceStoreTypes: [], | ||
| 131 | + resourceStoreSonTypes: [], | ||
| 132 | + selectResourceStores: [], | ||
| 133 | + page: { | ||
| 134 | + current: 1, | ||
| 135 | + size: 10, | ||
| 136 | + total: 0 | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + }, | ||
| 140 | + watch: { | ||
| 141 | + selectResourceStores(newVal) { | ||
| 142 | + if (newVal.length === this.resourceStores.length) { | ||
| 143 | + this.$nextTick(() => { | ||
| 144 | + document.querySelector('#quan').checked = true | ||
| 145 | + }) | ||
| 146 | + } else { | ||
| 147 | + document.querySelector('#quan').checked = false | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + }, | ||
| 151 | + methods: { | ||
| 152 | + open(params) { | ||
| 153 | + this.form = { | ||
| 154 | + ...this.form, | ||
| 155 | + resOrderType: params.resOrderType, | ||
| 156 | + shId: params.shId, | ||
| 157 | + newShId: params.shId, | ||
| 158 | + isAllocation: params.isAllocation | ||
| 159 | + } | ||
| 160 | + this.visible = true | ||
| 161 | + this.listStorehouses() | ||
| 162 | + this.listResourceStoreTypes() | ||
| 163 | + this.loadResourceStores(1, 10, '') | ||
| 164 | + }, | ||
| 165 | + async listStorehouses() { | ||
| 166 | + try { | ||
| 167 | + const params = { | ||
| 168 | + page: 1, | ||
| 169 | + row: 100, | ||
| 170 | + flag: "1", | ||
| 171 | + communityId: getCommunityId() | ||
| 172 | + } | ||
| 173 | + const res = await listStorehouses(params) | ||
| 174 | + this.storehouses = res.data | ||
| 175 | + this.form.storehouses = res.data | ||
| 176 | + } catch (error) { | ||
| 177 | + console.error(error) | ||
| 178 | + } | ||
| 179 | + }, | ||
| 180 | + async listResourceStoreTypes() { | ||
| 181 | + try { | ||
| 182 | + const params = { | ||
| 183 | + page: 1, | ||
| 184 | + row: 100, | ||
| 185 | + communityId: getCommunityId(), | ||
| 186 | + parentId: '0' | ||
| 187 | + } | ||
| 188 | + const res = await listResourceStoreTypes(params) | ||
| 189 | + this.resourceStoreTypes = res.data | ||
| 190 | + } catch (error) { | ||
| 191 | + console.error(error) | ||
| 192 | + } | ||
| 193 | + }, | ||
| 194 | + async listResourceStoreSonTypes() { | ||
| 195 | + this.form.rstId = '' | ||
| 196 | + if (!this.form.parentRstId) return | ||
| 197 | + | ||
| 198 | + try { | ||
| 199 | + const params = { | ||
| 200 | + page: 1, | ||
| 201 | + row: 100, | ||
| 202 | + communityId: getCommunityId(), | ||
| 203 | + parentId: this.form.parentRstId | ||
| 204 | + } | ||
| 205 | + const res = await listResourceStoreTypes(params) | ||
| 206 | + this.resourceStoreSonTypes = res.data | ||
| 207 | + } catch (error) { | ||
| 208 | + console.error(error) | ||
| 209 | + } | ||
| 210 | + }, | ||
| 211 | + async loadResourceStores(page, size, name) { | ||
| 212 | + console.log(name) | ||
| 213 | + try { | ||
| 214 | + const params = { | ||
| 215 | + page, | ||
| 216 | + row: size, | ||
| 217 | + isShow: true, | ||
| 218 | + communityId: getCommunityId(), | ||
| 219 | + resOrderType: this.form.resOrderType, | ||
| 220 | + resName: this.form._currentResourceStoreName, | ||
| 221 | + parentRstId: this.form.parentRstId, | ||
| 222 | + rstId: this.form.rstId, | ||
| 223 | + shId: this.form.shId | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + if (this.form.shId) { | ||
| 227 | + params.communityId = '' | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + const res = await listResourceStores(params) | ||
| 231 | + this.resourceStores = res.resourceStores | ||
| 232 | + this.page.total = res.records | ||
| 233 | + } catch (error) { | ||
| 234 | + console.error(error) | ||
| 235 | + } | ||
| 236 | + }, | ||
| 237 | + queryResourceStores() { | ||
| 238 | + this.loadResourceStores(1, 10, this.form._currentResourceStoreName) | ||
| 239 | + }, | ||
| 240 | + resetResourceStores() { | ||
| 241 | + this.form.shId = this.form.newShId | ||
| 242 | + this.form.parentRstId = "" | ||
| 243 | + this.form.rstId = "" | ||
| 244 | + this.form._currentResourceStoreName = "" | ||
| 245 | + this.loadResourceStores(1, 10, '') | ||
| 246 | + }, | ||
| 247 | + handleSizeChange(val) { | ||
| 248 | + this.page.size = val | ||
| 249 | + this.loadResourceStores(this.page.current, val, '') | ||
| 250 | + }, | ||
| 251 | + handleCurrentChange(val) { | ||
| 252 | + this.page.current = val | ||
| 253 | + this.loadResourceStores(val, this.page.size, '') | ||
| 254 | + }, | ||
| 255 | + submitChoose() { | ||
| 256 | + if (this.selectResourceStores.length < 1) { | ||
| 257 | + this.$message.warning(this.$t('chooseResourceStore.selectItemFirst')) | ||
| 258 | + return | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + const selectedItems = this.resourceStores.filter(item => | ||
| 262 | + this.selectResourceStores.includes(item.resId) | ||
| 263 | + ) | ||
| 264 | + | ||
| 265 | + this.$emit('choose', selectedItems) | ||
| 266 | + this.visible = false | ||
| 267 | + this.selectResourceStores = [] | ||
| 268 | + }, | ||
| 269 | + removeSelectedItem(resId) { | ||
| 270 | + this.selectResourceStores = this.selectResourceStores.filter(id => id !== resId) | ||
| 271 | + } | ||
| 272 | + } | ||
| 273 | +} | ||
| 274 | +</script> | ||
| 275 | + | ||
| 276 | +<style scoped> | ||
| 277 | +.el-checkbox { | ||
| 278 | + margin-left: 10px; | ||
| 279 | +} | ||
| 280 | +</style> | ||
| 0 | \ No newline at end of file | 281 | \ No newline at end of file |
src/components/resource/deleteAssetInventory.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('assetInventoryManage.delete.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('assetInventoryManage.delete.confirmText') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="handleClose">{{ $t('common.cancel') }}</el-button> | ||
| 13 | + <el-button type="primary" @click="handleConfirm">{{ $t('common.confirm') }}</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script> | ||
| 19 | +import { deleteAssetInventory } from '@/api/resource/assetInventoryManageApi' | ||
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 21 | + | ||
| 22 | +export default { | ||
| 23 | + name: 'DeleteAssetInventory', | ||
| 24 | + data() { | ||
| 25 | + return { | ||
| 26 | + visible: false, | ||
| 27 | + currentData: null | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + methods: { | ||
| 31 | + open(data) { | ||
| 32 | + this.currentData = data | ||
| 33 | + this.visible = true | ||
| 34 | + }, | ||
| 35 | + async handleConfirm() { | ||
| 36 | + try { | ||
| 37 | + const communityId = await getCommunityId() | ||
| 38 | + const params = { | ||
| 39 | + ...this.currentData, | ||
| 40 | + communityId | ||
| 41 | + } | ||
| 42 | + await deleteAssetInventory(params) | ||
| 43 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 44 | + this.$emit('success') | ||
| 45 | + this.handleClose() | ||
| 46 | + } catch (error) { | ||
| 47 | + console.error('删除失败:', error) | ||
| 48 | + this.$message.error(this.$t('common.deleteFailed')) | ||
| 49 | + } | ||
| 50 | + }, | ||
| 51 | + handleClose() { | ||
| 52 | + this.visible = false | ||
| 53 | + this.currentData = null | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | +} | ||
| 57 | +</script> | ||
| 0 | \ No newline at end of file | 58 | \ No newline at end of file |
src/components/resource/deleteItemOut.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('deleteItemOut.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + :before-close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('deleteItemOut.confirmText') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="handleClose">{{ $t('common.cancel') }}</el-button> | ||
| 13 | + <el-button type="primary" @click="confirmDelete">{{ $t('common.confirm') }}</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script> | ||
| 19 | +import { deletePurchaseApply } from '@/api/resource/itemOutManageApi' | ||
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 21 | + | ||
| 22 | +export default { | ||
| 23 | + name: 'DeleteItemOut', | ||
| 24 | + data() { | ||
| 25 | + return { | ||
| 26 | + visible: false, | ||
| 27 | + currentItem: null | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + methods: { | ||
| 31 | + open(item) { | ||
| 32 | + this.currentItem = item | ||
| 33 | + this.visible = true | ||
| 34 | + }, | ||
| 35 | + handleClose() { | ||
| 36 | + this.visible = false | ||
| 37 | + }, | ||
| 38 | + async confirmDelete() { | ||
| 39 | + try { | ||
| 40 | + const params = { | ||
| 41 | + ...this.currentItem, | ||
| 42 | + communityId: getCommunityId() | ||
| 43 | + } | ||
| 44 | + await deletePurchaseApply(params) | ||
| 45 | + this.$message.success(this.$t('deleteItemOut.deleteSuccess')) | ||
| 46 | + this.$emit('success') | ||
| 47 | + this.handleClose() | ||
| 48 | + } catch (error) { | ||
| 49 | + console.error('删除失败:', error) | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | +} | ||
| 54 | +</script> | ||
| 55 | + | ||
| 56 | +<style scoped> | ||
| 57 | +.text-center { | ||
| 58 | + text-align: center; | ||
| 59 | +} | ||
| 60 | +</style> | ||
| 0 | \ No newline at end of file | 61 | \ No newline at end of file |
src/components/resource/deleteStorehouseManage.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('deleteStorehouseManage.title')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <div class="text-center"> | ||
| 9 | + <p>{{ $t('deleteStorehouseManage.confirmCancel') }}</p> | ||
| 10 | + </div> | ||
| 11 | + <span slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="visible = false">{{ $t('deleteStorehouseManage.cancel') }}</el-button> | ||
| 13 | + <el-button type="primary" @click="handleConfirm">{{ $t('deleteStorehouseManage.confirm') }}</el-button> | ||
| 14 | + </span> | ||
| 15 | + </el-dialog> | ||
| 16 | +</template> | ||
| 17 | + | ||
| 18 | +<script> | ||
| 19 | +import { deleteAllocationStorehouse } from '@/api/resource/allocationStorehouseManageApi' | ||
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 21 | + | ||
| 22 | +export default { | ||
| 23 | + name: 'DeleteStorehouseManage', | ||
| 24 | + data() { | ||
| 25 | + return { | ||
| 26 | + visible: false, | ||
| 27 | + currentData: null | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + methods: { | ||
| 31 | + open(data) { | ||
| 32 | + this.currentData = data | ||
| 33 | + this.visible = true | ||
| 34 | + }, | ||
| 35 | + async handleConfirm() { | ||
| 36 | + try { | ||
| 37 | + const params = { | ||
| 38 | + ...this.currentData, | ||
| 39 | + communityId: getCommunityId() | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + const res = await deleteAllocationStorehouse(params) | ||
| 43 | + if (res.code === 0) { | ||
| 44 | + this.$message.success(res.msg) | ||
| 45 | + this.$emit('success') | ||
| 46 | + this.visible = false | ||
| 47 | + } else { | ||
| 48 | + this.$message.error(res.msg) | ||
| 49 | + } | ||
| 50 | + } catch (error) { | ||
| 51 | + console.error('取消调拨失败:', error) | ||
| 52 | + this.$message.error(this.$t('deleteStorehouseManage.deleteError')) | ||
| 53 | + } | ||
| 54 | + }, | ||
| 55 | + handleClose() { | ||
| 56 | + this.currentData = null | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | +</script> | ||
| 61 | + | ||
| 62 | +<style scoped> | ||
| 63 | +.text-center { | ||
| 64 | + text-align: center; | ||
| 65 | + font-size: 16px; | ||
| 66 | + margin: 20px 0; | ||
| 67 | +} | ||
| 68 | +</style> | ||
| 0 | \ No newline at end of file | 69 | \ No newline at end of file |
src/components/resource/orgTreeShow.vue deleted
| 1 | -<template> | ||
| 2 | - <div class="org-tree-container"> | ||
| 3 | - <el-tree | ||
| 4 | - ref="orgTree" | ||
| 5 | - :data="orgTreeShowInfo.orgs" | ||
| 6 | - :props="defaultProps" | ||
| 7 | - node-key="id" | ||
| 8 | - default-expand-all | ||
| 9 | - highlight-current | ||
| 10 | - @node-click="handleNodeClick" | ||
| 11 | - ></el-tree> | ||
| 12 | - </div> | ||
| 13 | -</template> | ||
| 14 | - | ||
| 15 | -<script> | ||
| 16 | -export default { | ||
| 17 | - name: 'OrgTreeShow', | ||
| 18 | - props: { | ||
| 19 | - callBackListener: { | ||
| 20 | - type: String, | ||
| 21 | - default: '' | ||
| 22 | - } | ||
| 23 | - }, | ||
| 24 | - data() { | ||
| 25 | - return { | ||
| 26 | - orgTreeShowInfo: { | ||
| 27 | - orgs: [], | ||
| 28 | - orgId: '', | ||
| 29 | - curOrg: {} | ||
| 30 | - }, | ||
| 31 | - defaultProps: { | ||
| 32 | - children: 'children', | ||
| 33 | - label: 'text' | ||
| 34 | - } | ||
| 35 | - } | ||
| 36 | - }, | ||
| 37 | - created() { | ||
| 38 | - this._loadOrgsShow() | ||
| 39 | - }, | ||
| 40 | - methods: { | ||
| 41 | - refreshTree() { | ||
| 42 | - this._loadOrgsShow() | ||
| 43 | - }, | ||
| 44 | - async _loadOrgsShow() { | ||
| 45 | - try { | ||
| 46 | - const res = await this.$http.get('/org.listOrgTree', { | ||
| 47 | - params: { | ||
| 48 | - communityId: this.$store.getters.communityId | ||
| 49 | - } | ||
| 50 | - }) | ||
| 51 | - this.orgTreeShowInfo.orgs = res.data.data | ||
| 52 | - } catch (error) { | ||
| 53 | - console.error('请求失败:', error) | ||
| 54 | - } | ||
| 55 | - }, | ||
| 56 | - handleNodeClick(data) { | ||
| 57 | - this.orgTreeShowInfo.curOrg = data | ||
| 58 | - this.orgTreeShowInfo.curOrg.orgId = data.id | ||
| 59 | - this.$emit('switchOrg', { | ||
| 60 | - orgId: data.id, | ||
| 61 | - orgName: data.text | ||
| 62 | - }) | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | -} | ||
| 66 | -</script> | ||
| 67 | - | ||
| 68 | -<style scoped> | ||
| 69 | -.org-tree-container { | ||
| 70 | - padding: 10px; | ||
| 71 | -} | ||
| 72 | -</style> | ||
| 73 | \ No newline at end of file | 0 | \ No newline at end of file |
src/components/resource/selectStaff.vue
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | </template> | 47 | </template> |
| 48 | 48 | ||
| 49 | <script> | 49 | <script> |
| 50 | -import OrgTreeShow from './orgTreeShow' | 50 | +import OrgTreeShow from '@/components/org/OrgTreeShow' |
| 51 | import { queryStaffInfos } from '@/api/resource/addPurchaseApplyApi' | 51 | import { queryStaffInfos } from '@/api/resource/addPurchaseApplyApi' |
| 52 | 52 | ||
| 53 | export default { | 53 | export default { |
src/components/work/visitOwnerRepair.vue
| @@ -86,7 +86,7 @@ export default { | @@ -86,7 +86,7 @@ export default { | ||
| 86 | repairId: repairPool.repairId, | 86 | repairId: repairPool.repairId, |
| 87 | visitType: '', | 87 | visitType: '', |
| 88 | context: '', | 88 | context: '', |
| 89 | - communityId: this.$store.getters.communityId | 89 | + communityId: this.getCommunityId() |
| 90 | } | 90 | } |
| 91 | this.visible = true | 91 | this.visible = true |
| 92 | }, | 92 | }, |
src/i18n/index.js
| @@ -187,6 +187,16 @@ import { messages as purchaseApplyManageMessages } from '../views/resource/purch | @@ -187,6 +187,16 @@ import { messages as purchaseApplyManageMessages } from '../views/resource/purch | ||
| 187 | import { messages as addPurchaseApplyMessages } from '../views/resource/addPurchaseApplyLang' | 187 | import { messages as addPurchaseApplyMessages } from '../views/resource/addPurchaseApplyLang' |
| 188 | import { messages as urgentPurchaseApplyStepMessages } from '../views/resource/urgentPurchaseApplyStepLang' | 188 | import { messages as urgentPurchaseApplyStepMessages } from '../views/resource/urgentPurchaseApplyStepLang' |
| 189 | import { messages as purchaseApplyDetailMessages } from '../views/resource/purchaseApplyDetailLang' | 189 | import { messages as purchaseApplyDetailMessages } from '../views/resource/purchaseApplyDetailLang' |
| 190 | +import { messages as itemOutManageMessages } from '../views/resource/itemOutManageLang' | ||
| 191 | +import { messages as addItemOutMessages } from '../views/resource/addItemOutLang' | ||
| 192 | +import { messages as purchaseApplyDetailManageMessages } from '../views/resource/purchaseApplyDetailManageLang' | ||
| 193 | +import { messages as allocationStorehouseManageMessages } from '../views/resource/allocationStorehouseManageLang' | ||
| 194 | +import { messages as allocationStorehouseApplyMessages } from '../views/resource/allocationStorehouseApplyLang' | ||
| 195 | +import { messages as allocationStorehouseDetailedMessages } from '../views/resource/allocationStorehouseDetailedLang' | ||
| 196 | +import { messages as assetInventoryManageMessages } from '../views/resource/assetInventoryManageLang' | ||
| 197 | +import { messages as myResourceStoreManageMessages } from '../views/resource/myResourceStoreManageLang' | ||
| 198 | +import { messages as allocationUserStorehouseManageMessages } from '../views/resource/allocationUserStorehouseManageLang' | ||
| 199 | +import { messages as resourceStoreUseRecordManageMessages } from '../views/resource/resourceStoreUseRecordManageLang' | ||
| 190 | 200 | ||
| 191 | Vue.use(VueI18n) | 201 | Vue.use(VueI18n) |
| 192 | 202 | ||
| @@ -378,6 +388,16 @@ const messages = { | @@ -378,6 +388,16 @@ const messages = { | ||
| 378 | ...addPurchaseApplyMessages.en, | 388 | ...addPurchaseApplyMessages.en, |
| 379 | ...urgentPurchaseApplyStepMessages.en, | 389 | ...urgentPurchaseApplyStepMessages.en, |
| 380 | ...purchaseApplyDetailMessages.en, | 390 | ...purchaseApplyDetailMessages.en, |
| 391 | + ...itemOutManageMessages.en, | ||
| 392 | + ...addItemOutMessages.en, | ||
| 393 | + ...purchaseApplyDetailManageMessages.en, | ||
| 394 | + ...allocationStorehouseManageMessages.en, | ||
| 395 | + ...allocationStorehouseApplyMessages.en, | ||
| 396 | + ...allocationStorehouseDetailedMessages.en, | ||
| 397 | + ...assetInventoryManageMessages.en, | ||
| 398 | + ...myResourceStoreManageMessages.en, | ||
| 399 | + ...allocationUserStorehouseManageMessages.en, | ||
| 400 | + ...resourceStoreUseRecordManageMessages.en, | ||
| 381 | }, | 401 | }, |
| 382 | zh: { | 402 | zh: { |
| 383 | ...loginMessages.zh, | 403 | ...loginMessages.zh, |
| @@ -565,6 +585,16 @@ const messages = { | @@ -565,6 +585,16 @@ const messages = { | ||
| 565 | ...addPurchaseApplyMessages.zh, | 585 | ...addPurchaseApplyMessages.zh, |
| 566 | ...urgentPurchaseApplyStepMessages.zh, | 586 | ...urgentPurchaseApplyStepMessages.zh, |
| 567 | ...purchaseApplyDetailMessages.zh, | 587 | ...purchaseApplyDetailMessages.zh, |
| 588 | + ...itemOutManageMessages.zh, | ||
| 589 | + ...addItemOutMessages.zh, | ||
| 590 | + ...purchaseApplyDetailManageMessages.zh, | ||
| 591 | + ...allocationStorehouseManageMessages.zh, | ||
| 592 | + ...allocationStorehouseApplyMessages.zh, | ||
| 593 | + ...allocationStorehouseDetailedMessages.zh, | ||
| 594 | + ...assetInventoryManageMessages.zh, | ||
| 595 | + ...myResourceStoreManageMessages.zh, | ||
| 596 | + ...allocationUserStorehouseManageMessages.zh, | ||
| 597 | + ...resourceStoreUseRecordManageMessages.zh, | ||
| 568 | } | 598 | } |
| 569 | } | 599 | } |
| 570 | 600 |
src/router/index.js
| @@ -926,6 +926,56 @@ const routes = [ | @@ -926,6 +926,56 @@ const routes = [ | ||
| 926 | name: '/views/resource/purchaseApplyDetail', | 926 | name: '/views/resource/purchaseApplyDetail', |
| 927 | component: () => import('@/views/resource/purchaseApplyDetailList.vue') | 927 | component: () => import('@/views/resource/purchaseApplyDetailList.vue') |
| 928 | }, | 928 | }, |
| 929 | + { | ||
| 930 | + path: '/pages/common/itemOutManage', | ||
| 931 | + name: '/pages/common/itemOutManage', | ||
| 932 | + component: () => import('@/views/resource/itemOutManageList.vue') | ||
| 933 | + }, | ||
| 934 | + { | ||
| 935 | + path: '/views/resource/addItemOut', | ||
| 936 | + name: '/views/resource/addItemOut', | ||
| 937 | + component: () => import('@/views/resource/addItemOutList.vue') | ||
| 938 | + }, | ||
| 939 | + { | ||
| 940 | + path: '/pages/common/purchaseApplyDetailManage', | ||
| 941 | + name: '/pages/common/purchaseApplyDetailManage', | ||
| 942 | + component: () => import('@/views/resource/purchaseApplyDetailManageList.vue') | ||
| 943 | + }, | ||
| 944 | + { | ||
| 945 | + path: '/pages/common/allocationStorehouseManage', | ||
| 946 | + name: '/pages/common/allocationStorehouseManage', | ||
| 947 | + component: () => import('@/views/resource/allocationStorehouseManageList.vue') | ||
| 948 | + }, | ||
| 949 | + { | ||
| 950 | + path: '/pages/common/allocationStorehouseApply', | ||
| 951 | + name: '/pages/common/allocationStorehouseApply', | ||
| 952 | + component: () => import('@/views/resource/allocationStorehouseApplyList.vue') | ||
| 953 | + }, | ||
| 954 | + { | ||
| 955 | + path: '/pages/common/allocationStorehouseDetailed', | ||
| 956 | + name: '/pages/common/allocationStorehouseDetailed', | ||
| 957 | + component: () => import('@/views/resource/allocationStorehouseDetailedList.vue') | ||
| 958 | + }, | ||
| 959 | + { | ||
| 960 | + path: '/pages/property/assetInventoryManage', | ||
| 961 | + name: '/pages/property/assetInventoryManage', | ||
| 962 | + component: () => import('@/views/resource/assetInventoryManageList.vue') | ||
| 963 | + }, | ||
| 964 | + { | ||
| 965 | + path: '/pages/common/myResourceStoreManage', | ||
| 966 | + name: '/pages/common/myResourceStoreManage', | ||
| 967 | + component: () => import('@/views/resource/myResourceStoreManageList.vue') | ||
| 968 | + }, | ||
| 969 | + { | ||
| 970 | + path: '/pages/common/allocationUserStorehouseManage', | ||
| 971 | + name: '/pages/common/allocationUserStorehouseManage', | ||
| 972 | + component: () => import('@/views/resource/allocationUserStorehouseManageList.vue') | ||
| 973 | + }, | ||
| 974 | + { | ||
| 975 | + path: '/pages/common/resourceStoreUseRecordManage', | ||
| 976 | + name: '/pages/common/resourceStoreUseRecordManage', | ||
| 977 | + component: () => import('@/views/resource/resourceStoreUseRecordManageList.vue') | ||
| 978 | + }, | ||
| 929 | // 其他子路由可以在这里添加 | 979 | // 其他子路由可以在这里添加 |
| 930 | ] | 980 | ] |
| 931 | }, | 981 | }, |
src/views/resource/addItemOutLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + addItemOut: { | ||
| 4 | + recipient: 'Recipient', | ||
| 5 | + return: 'Return', | ||
| 6 | + warehouse: 'Warehouse', | ||
| 7 | + warehousePlaceholder: 'Required, please select a warehouse', | ||
| 8 | + contactPlaceholder: 'Required, please enter contact name', | ||
| 9 | + phonePlaceholder: 'Required, please enter contact phone', | ||
| 10 | + notePlaceholder: 'Required, please enter application note', | ||
| 11 | + itemInfo: 'Item Information', | ||
| 12 | + selectItem: 'Select Item', | ||
| 13 | + itemType: 'Item Type', | ||
| 14 | + itemName: 'Item Name (Code)', | ||
| 15 | + itemSpec: 'Item Specification', | ||
| 16 | + price: 'Price', | ||
| 17 | + stock: 'Stock', | ||
| 18 | + applyQuantity: 'Apply Quantity', | ||
| 19 | + remark: 'Remark', | ||
| 20 | + operation: 'Operation', | ||
| 21 | + selectPrice: 'Please select price', | ||
| 22 | + quantityPlaceholder: 'Required, please enter quantity', | ||
| 23 | + remarkPlaceholder: 'Optional, please enter remark', | ||
| 24 | + remove: 'Remove', | ||
| 25 | + approver: 'Approver', | ||
| 26 | + approverPlaceholder: 'Required, please select approver', | ||
| 27 | + select: 'Select', | ||
| 28 | + submit: 'Submit', | ||
| 29 | + warehouseRequired: 'Please select a warehouse', | ||
| 30 | + contactRequired: 'Please enter contact name', | ||
| 31 | + phoneRequired: 'Please enter contact phone', | ||
| 32 | + noteRequired: 'Please enter application note', | ||
| 33 | + itemRequired: 'Please select at least one item', | ||
| 34 | + sameWarehouseRequired: 'Items must be from the same warehouse', | ||
| 35 | + insufficientStock: 'Insufficient stock', | ||
| 36 | + submitSuccess: 'Submitted successfully', | ||
| 37 | + submitFailed: 'Submission failed', | ||
| 38 | + submitError: 'Error occurred during submission', | ||
| 39 | + selectRecipient: 'Select Recipient', | ||
| 40 | + contactPhone: 'Contact Phone', | ||
| 41 | + applicationNote: 'Application Note' | ||
| 42 | + }, | ||
| 43 | + chooseResourceStore2: { | ||
| 44 | + title: 'Select Items (Collection/Purchase/Direct Outbound)', | ||
| 45 | + warehouse: 'Warehouse', | ||
| 46 | + warehousePlaceholder: 'Please select warehouse', | ||
| 47 | + itemType: 'Item Type', | ||
| 48 | + itemTypePlaceholder: 'Please select item type', | ||
| 49 | + subType: 'Sub Type', | ||
| 50 | + subTypePlaceholder: 'Please select sub type', | ||
| 51 | + itemName: 'Item Name', | ||
| 52 | + itemNamePlaceholder: 'Enter item name', | ||
| 53 | + search: 'Search', | ||
| 54 | + reset: 'Reset', | ||
| 55 | + submit: 'Submit', | ||
| 56 | + cancel: 'Cancel', | ||
| 57 | + selectItemWarning: 'Please select at least one item', | ||
| 58 | + fetchWarehouseError: 'Failed to fetch warehouses', | ||
| 59 | + fetchItemTypeError: 'Failed to fetch item types', | ||
| 60 | + fetchSubItemTypeError: 'Failed to fetch sub item types', | ||
| 61 | + fetchItemListError: 'Failed to fetch item list', | ||
| 62 | + itemCode: 'Item Code', | ||
| 63 | + fixedItem: 'Fixed Item', | ||
| 64 | + stock: 'Stock' | ||
| 65 | + }, | ||
| 66 | + selectStaff: { | ||
| 67 | + title: 'Select Staff', | ||
| 68 | + orgInfo: 'Organization Information', | ||
| 69 | + staffInfo: 'Staff Information', | ||
| 70 | + submitter: 'Submitter', | ||
| 71 | + dynamicAssign: 'Dynamic Assignment', | ||
| 72 | + confirm: 'Confirm', | ||
| 73 | + cancel: 'Cancel', | ||
| 74 | + selectStaffWarning: 'Please select a staff member', | ||
| 75 | + fetchOrgError: 'Failed to fetch organization data', | ||
| 76 | + fetchStaffError: 'Failed to fetch staff data' | ||
| 77 | + } | ||
| 78 | + }, | ||
| 79 | + zh: { | ||
| 80 | + addItemOut: { | ||
| 81 | + recipient: '领用人', | ||
| 82 | + return: '返回', | ||
| 83 | + warehouse: '仓库', | ||
| 84 | + warehousePlaceholder: '必填,请选择仓库', | ||
| 85 | + contactPlaceholder: '必填,请填写联系人', | ||
| 86 | + phonePlaceholder: '必填,请填写联系电话', | ||
| 87 | + notePlaceholder: '必填,请填写申请说明', | ||
| 88 | + itemInfo: '物品信息', | ||
| 89 | + selectItem: '选择物品', | ||
| 90 | + itemType: '物品类型', | ||
| 91 | + itemName: '物品名称(编码)', | ||
| 92 | + itemSpec: '物品规格', | ||
| 93 | + price: '价格', | ||
| 94 | + stock: '物品库存', | ||
| 95 | + applyQuantity: '申请数量', | ||
| 96 | + remark: '备注', | ||
| 97 | + operation: '操作', | ||
| 98 | + selectPrice: '请选择价格', | ||
| 99 | + quantityPlaceholder: '必填,请填写申请数量', | ||
| 100 | + remarkPlaceholder: '选填,请填写备注', | ||
| 101 | + remove: '移除', | ||
| 102 | + approver: '审批人', | ||
| 103 | + approverPlaceholder: '必填,请选择审批人', | ||
| 104 | + select: '选择', | ||
| 105 | + submit: '提交', | ||
| 106 | + warehouseRequired: '请选择仓库', | ||
| 107 | + contactRequired: '请填写联系人', | ||
| 108 | + phoneRequired: '请填写联系电话', | ||
| 109 | + noteRequired: '请填写申请说明', | ||
| 110 | + itemRequired: '请至少选择一个物品', | ||
| 111 | + sameWarehouseRequired: '领用商品需来自同一仓库', | ||
| 112 | + insufficientStock: '库存不够', | ||
| 113 | + submitSuccess: '操作成功', | ||
| 114 | + submitFailed: '操作失败', | ||
| 115 | + submitError: '提交过程中发生错误', | ||
| 116 | + selectRecipient: '选择领用人', | ||
| 117 | + contactPhone: '联系电话', | ||
| 118 | + applicationNote: '申请说明' | ||
| 119 | + }, | ||
| 120 | + chooseResourceStore2: { | ||
| 121 | + title: '【物品领用/采购申请/直接出库】选择物品', | ||
| 122 | + warehouse: '仓库', | ||
| 123 | + warehousePlaceholder: '请选择仓库', | ||
| 124 | + itemType: '物品类型', | ||
| 125 | + itemTypePlaceholder: '请选择物品类型', | ||
| 126 | + subType: '二级分类', | ||
| 127 | + subTypePlaceholder: '请选择二级分类', | ||
| 128 | + itemName: '物品名称', | ||
| 129 | + itemNamePlaceholder: '输入物品管理名称', | ||
| 130 | + search: '查询', | ||
| 131 | + reset: '重置', | ||
| 132 | + submit: '提交', | ||
| 133 | + cancel: '取消', | ||
| 134 | + selectItemWarning: '请选择需要采购的物品', | ||
| 135 | + fetchWarehouseError: '获取仓库列表失败', | ||
| 136 | + fetchItemTypeError: '获取物品类型失败', | ||
| 137 | + fetchSubItemTypeError: '获取二级分类失败', | ||
| 138 | + fetchItemListError: '获取物品列表失败', | ||
| 139 | + itemCode: '物品编码', | ||
| 140 | + fixedItem: '固定物品', | ||
| 141 | + stock: '物品库存' | ||
| 142 | + }, | ||
| 143 | + selectStaff: { | ||
| 144 | + title: '选择员工', | ||
| 145 | + orgInfo: '组织信息', | ||
| 146 | + staffInfo: '员工信息', | ||
| 147 | + submitter: '提交者', | ||
| 148 | + dynamicAssign: '动态指定', | ||
| 149 | + confirm: '确定', | ||
| 150 | + cancel: '取消', | ||
| 151 | + selectStaffWarning: '请选择员工', | ||
| 152 | + fetchOrgError: '获取组织数据失败', | ||
| 153 | + fetchStaffError: '获取员工数据失败' | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | +} | ||
| 0 | \ No newline at end of file | 157 | \ No newline at end of file |
src/views/resource/addItemOutList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div> | ||
| 3 | + <el-row> | ||
| 4 | + <el-col :span="24"> | ||
| 5 | + <el-card class="box-card"> | ||
| 6 | + <div slot="header" class="flex justify-between"> | ||
| 7 | + <div>{{ $t('addItemOut.recipient') }}</div> | ||
| 8 | + <div class="ibox-tools"> | ||
| 9 | + <el-button type="primary" size="small" @click="goBack"> | ||
| 10 | + <i class="el-icon-close"></i> | ||
| 11 | + {{ $t('addItemOut.return') }} | ||
| 12 | + </el-button> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + <div class=""> | ||
| 16 | + <el-form :model="addItemOutInfo" label-position="right" label-width="120px"> | ||
| 17 | + <el-form-item :label="$t('addItemOut.warehouse')"> | ||
| 18 | + <el-select v-model="addItemOutInfo.shId" @change="_computeFlow" style="width:100%" | ||
| 19 | + :placeholder="$t('addItemOut.warehousePlaceholder')"> | ||
| 20 | + <el-option v-for="(item, index) in addItemOutInfo.storehouses" :key="index" :label="item.shName" | ||
| 21 | + :value="item.shId"></el-option> | ||
| 22 | + </el-select> | ||
| 23 | + </el-form-item> | ||
| 24 | + | ||
| 25 | + <el-form-item :label="$t('addItemOut.recipient')"> | ||
| 26 | + <el-row> | ||
| 27 | + <el-col :span="addItemOutInfo.canChooseEndUserOrNot ? 18 : 24"> | ||
| 28 | + <el-input :placeholder="$t('addItemOut.contactPlaceholder')" | ||
| 29 | + v-model.trim="addItemOutInfo.endUserInfo.staffName" style="width:100%"></el-input> | ||
| 30 | + </el-col> | ||
| 31 | + <el-col :span="6" v-if="addItemOutInfo.canChooseEndUserOrNot"> | ||
| 32 | + <el-button type="primary" @click="chooseEndUser"> | ||
| 33 | + <i class="el-icon-search"></i> {{ $t('addItemOut.selectRecipient') }} | ||
| 34 | + </el-button> | ||
| 35 | + </el-col> | ||
| 36 | + </el-row> | ||
| 37 | + </el-form-item> | ||
| 38 | + | ||
| 39 | + <el-form-item :label="$t('addItemOut.contactPhone')"> | ||
| 40 | + <el-input :placeholder="$t('addItemOut.phonePlaceholder')" | ||
| 41 | + v-model.trim="addItemOutInfo.endUserInfo.staffTel" style="width:100%"></el-input> | ||
| 42 | + </el-form-item> | ||
| 43 | + | ||
| 44 | + <el-form-item :label="$t('addItemOut.applicationNote')"> | ||
| 45 | + <el-input type="textarea" :placeholder="$t('addItemOut.notePlaceholder')" | ||
| 46 | + v-model.trim="addItemOutInfo.description" style="width:100%"></el-input> | ||
| 47 | + </el-form-item> | ||
| 48 | + </el-form> | ||
| 49 | + </div> | ||
| 50 | + </el-card> | ||
| 51 | + </el-col> | ||
| 52 | + </el-row> | ||
| 53 | + | ||
| 54 | + <!-- 选择物品 --> | ||
| 55 | + <el-row> | ||
| 56 | + <el-col :span="24"> | ||
| 57 | + <el-card class="box-card"> | ||
| 58 | + <div slot="header" class="flex justify-between"> | ||
| 59 | + <div>{{ $t('addItemOut.itemInfo') }}</div> | ||
| 60 | + <div class="ibox-tools"> | ||
| 61 | + <el-button type="primary" size="small" style="margin-right:10px;" | ||
| 62 | + @click="_openSelectResourceStoreInfoModel"> | ||
| 63 | + <i class="el-icon-plus"></i> | ||
| 64 | + {{ $t('addItemOut.selectItem') }} | ||
| 65 | + </el-button> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + <div class="ibox-content"> | ||
| 69 | + <el-table :data="addItemOutInfo.resourceStores" border style="width:100%"> | ||
| 70 | + <el-table-column prop="parentRstName" :label="$t('addItemOut.itemType')" align="center"> | ||
| 71 | + <template slot-scope="scope"> | ||
| 72 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | ||
| 73 | + </template> | ||
| 74 | + </el-table-column> | ||
| 75 | + | ||
| 76 | + <el-table-column prop="resName" :label="$t('addItemOut.itemName')" align="center"> | ||
| 77 | + <template slot-scope="scope"> | ||
| 78 | + {{ scope.row.resName }}({{ scope.row.resCode }}) | ||
| 79 | + </template> | ||
| 80 | + </el-table-column> | ||
| 81 | + | ||
| 82 | + <el-table-column prop="rssName" :label="$t('addItemOut.itemSpec')" align="center"> | ||
| 83 | + <template slot-scope="scope"> | ||
| 84 | + {{ scope.row.rssName || '-' }} | ||
| 85 | + </template> | ||
| 86 | + </el-table-column> | ||
| 87 | + | ||
| 88 | + <el-table-column :label="$t('addItemOut.price')" align="center"> | ||
| 89 | + <template slot-scope="scope"> | ||
| 90 | + <el-select v-model="scope.row.timesId" @change="_changeTimesId($event, scope.$index)" | ||
| 91 | + style="width:100%"> | ||
| 92 | + <el-option :label="$t('addItemOut.selectPrice')" value=""></el-option> | ||
| 93 | + <el-option v-for="time in scope.row.times" :key="time.timesId" :label="time.price" | ||
| 94 | + :value="time.timesId"></el-option> | ||
| 95 | + </el-select> | ||
| 96 | + </template> | ||
| 97 | + </el-table-column> | ||
| 98 | + | ||
| 99 | + <el-table-column :label="$t('addItemOut.stock')" align="center"> | ||
| 100 | + <template slot-scope="scope"> | ||
| 101 | + {{ _getTimesStock(scope.row) }}{{ scope.row.unitCodeName }} | ||
| 102 | + </template> | ||
| 103 | + </el-table-column> | ||
| 104 | + | ||
| 105 | + <el-table-column :label="$t('addItemOut.applyQuantity')" align="center"> | ||
| 106 | + <template slot-scope="scope"> | ||
| 107 | + <el-input v-model.trim="scope.row.quantity" type="number" | ||
| 108 | + :placeholder="$t('addItemOut.quantityPlaceholder')" | ||
| 109 | + style="width:70%;display:inline-block;"></el-input> | ||
| 110 | + {{ scope.row.unitCodeName }} | ||
| 111 | + </template> | ||
| 112 | + </el-table-column> | ||
| 113 | + | ||
| 114 | + <el-table-column :label="$t('addItemOut.remark')" align="center"> | ||
| 115 | + <template slot-scope="scope"> | ||
| 116 | + <el-input v-model.trim="scope.row.remark" type="text" | ||
| 117 | + :placeholder="$t('addItemOut.remarkPlaceholder')"></el-input> | ||
| 118 | + </template> | ||
| 119 | + </el-table-column> | ||
| 120 | + | ||
| 121 | + <el-table-column :label="$t('addItemOut.operation')" align="center"> | ||
| 122 | + <template slot-scope="scope"> | ||
| 123 | + <el-button type="danger" size="small" @click="_removeSelectResourceStoreItem(scope.row.resId)"> | ||
| 124 | + <i class="el-icon-delete"></i> | ||
| 125 | + {{ $t('addItemOut.remove') }} | ||
| 126 | + </el-button> | ||
| 127 | + </template> | ||
| 128 | + </el-table-column> | ||
| 129 | + </el-table> | ||
| 130 | + </div> | ||
| 131 | + </el-card> | ||
| 132 | + </el-col> | ||
| 133 | + </el-row> | ||
| 134 | + | ||
| 135 | + <!-- 审批人 --> | ||
| 136 | + <el-row v-if="addItemOutInfo.audit.assignee === '-2'"> | ||
| 137 | + <el-col :span="24"> | ||
| 138 | + <el-card class="box-card"> | ||
| 139 | + <div slot="header" class="clearfix"> | ||
| 140 | + <h5>{{ $t('addItemOut.approver') }}</h5> | ||
| 141 | + </div> | ||
| 142 | + <div class="ibox-content"> | ||
| 143 | + <el-form :model="addItemOutInfo" label-position="right" label-width="120px"> | ||
| 144 | + <el-form-item :label="$t('addItemOut.approver')"> | ||
| 145 | + <el-row :gutter="20"> | ||
| 146 | + <el-col :span="18"> | ||
| 147 | + <el-input :placeholder="$t('addItemOut.approverPlaceholder')" v-model="addItemOutInfo.audit.staffName" | ||
| 148 | + disabled></el-input> | ||
| 149 | + </el-col> | ||
| 150 | + <el-col :span="6"> | ||
| 151 | + <el-button type="primary" @click="chooseStaff"> | ||
| 152 | + <i class="el-icon-search"></i> {{ $t('addItemOut.select') }} | ||
| 153 | + </el-button> | ||
| 154 | + </el-col> | ||
| 155 | + </el-row> | ||
| 156 | + </el-form-item> | ||
| 157 | + </el-form> | ||
| 158 | + </div> | ||
| 159 | + </el-card> | ||
| 160 | + </el-col> | ||
| 161 | + </el-row> | ||
| 162 | + | ||
| 163 | + <el-row> | ||
| 164 | + <el-col :span="22" :offset="2" style="margin-bottom:20px; text-align:right"> | ||
| 165 | + <el-button type="primary" @click="_finishStep"> | ||
| 166 | + {{ $t('addItemOut.submit') }} | ||
| 167 | + </el-button> | ||
| 168 | + </el-col> | ||
| 169 | + </el-row> | ||
| 170 | + | ||
| 171 | + <choose-resource-store2 ref="chooseResourceStore2" | ||
| 172 | + @setSelectResourceStores="handleSetSelectResourceStores"></choose-resource-store2> | ||
| 173 | + | ||
| 174 | + <select-staff ref="selectStaff"></select-staff> | ||
| 175 | + </div> | ||
| 176 | +</template> | ||
| 177 | + | ||
| 178 | +<script> | ||
| 179 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 180 | +import ChooseResourceStore2 from '@/components/resource/chooseResourceStore2' | ||
| 181 | +import SelectStaff from '@/components/resource/selectStaff' | ||
| 182 | +import { goodsCollection, listStorehouses } from '@/api/resource/addItemOutApi' | ||
| 183 | +import { getUserName, getUserTel } from '@/api/user/userApi' | ||
| 184 | + | ||
| 185 | +export default { | ||
| 186 | + name: 'AddItemOutList', | ||
| 187 | + components: { | ||
| 188 | + ChooseResourceStore2, | ||
| 189 | + SelectStaff, | ||
| 190 | + }, | ||
| 191 | + data() { | ||
| 192 | + return { | ||
| 193 | + addItemOutInfo: { | ||
| 194 | + resourceStores: [], | ||
| 195 | + resourceSuppliers: [], | ||
| 196 | + audit: { | ||
| 197 | + assignee: '', | ||
| 198 | + staffId: '', | ||
| 199 | + staffName: '', | ||
| 200 | + taskId: '' | ||
| 201 | + }, | ||
| 202 | + endUserInfo: { | ||
| 203 | + assignee: '', | ||
| 204 | + staffId: '', | ||
| 205 | + staffName: '', | ||
| 206 | + taskId: '', | ||
| 207 | + staffTel: '' | ||
| 208 | + }, | ||
| 209 | + description: '', | ||
| 210 | + endUserName: '', | ||
| 211 | + endUserTel: '', | ||
| 212 | + acceptStaffId: '', | ||
| 213 | + file: '', | ||
| 214 | + resOrderType: '20000', | ||
| 215 | + staffId: '', | ||
| 216 | + staffName: '', | ||
| 217 | + communityId: '', | ||
| 218 | + shId: '', | ||
| 219 | + storehouses: [], | ||
| 220 | + flowId: '', | ||
| 221 | + canChooseEndUserOrNot: false, | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + }, | ||
| 225 | + created() { | ||
| 226 | + this.communityId = getCommunityId() | ||
| 227 | + this.addItemOutInfo.communityId = this.communityId | ||
| 228 | + this._reset() | ||
| 229 | + this.initPage() | ||
| 230 | + }, | ||
| 231 | + mounted() { | ||
| 232 | + }, | ||
| 233 | + beforeDestroy() { | ||
| 234 | + }, | ||
| 235 | + methods: { | ||
| 236 | + _reset() { | ||
| 237 | + this.addItemOutInfo = { | ||
| 238 | + resourceStores: [], | ||
| 239 | + resourceSuppliers: [], | ||
| 240 | + audit: { | ||
| 241 | + assignee: '', | ||
| 242 | + staffId: '', | ||
| 243 | + staffName: '', | ||
| 244 | + taskId: '' | ||
| 245 | + }, | ||
| 246 | + endUserInfo: { | ||
| 247 | + assignee: '', | ||
| 248 | + staffId: '', | ||
| 249 | + staffName: '', | ||
| 250 | + taskId: '', | ||
| 251 | + staffTel: '' | ||
| 252 | + }, | ||
| 253 | + description: '', | ||
| 254 | + endUserName: '', | ||
| 255 | + endUserTel: '', | ||
| 256 | + acceptStaffId: '', | ||
| 257 | + file: '', | ||
| 258 | + resOrderType: '20000', | ||
| 259 | + staffId: '', | ||
| 260 | + staffName: '', | ||
| 261 | + communityId: this.communityId, | ||
| 262 | + shId: '', | ||
| 263 | + storehouses: [], | ||
| 264 | + flowId: '', | ||
| 265 | + canChooseEndUserOrNot: false, | ||
| 266 | + } | ||
| 267 | + }, | ||
| 268 | + initPage() { | ||
| 269 | + const from = this.$route.query.from | ||
| 270 | + if (from === 'resourceStore') { | ||
| 271 | + this.addItemOutInfo.canChooseEndUserOrNot = true | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + this.addItemOutInfo.endUserInfo.staffName = getUserName() || '' | ||
| 275 | + this.addItemOutInfo.endUserInfo.staffTel = getUserTel() || '' | ||
| 276 | + | ||
| 277 | + this._loadResourceSuppliers() | ||
| 278 | + this._listPurchaseStorehouses() | ||
| 279 | + }, | ||
| 280 | + goBack() { | ||
| 281 | + this.$router.go(-1) | ||
| 282 | + }, | ||
| 283 | + _resourcesFromSameHouse(resourcesList) { | ||
| 284 | + if (!resourcesList || resourcesList.length < 2) return true | ||
| 285 | + | ||
| 286 | + let lastHouse = '' | ||
| 287 | + for (let i = 0; i < resourcesList.length; i++) { | ||
| 288 | + if (!lastHouse) { | ||
| 289 | + lastHouse = resourcesList[i].shId | ||
| 290 | + continue | ||
| 291 | + } | ||
| 292 | + if (lastHouse !== resourcesList[i].shId) { | ||
| 293 | + return false | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + return true | ||
| 297 | + }, | ||
| 298 | + _openSelectResourceStoreInfoModel() { | ||
| 299 | + if (!this.addItemOutInfo.shId) { | ||
| 300 | + this.$message.error(this.$t('addItemOut.warehouseRequired')) | ||
| 301 | + return | ||
| 302 | + } | ||
| 303 | + if (!this.addItemOutInfo.endUserInfo.staffName) { | ||
| 304 | + this.$message.error(this.$t('addItemOut.contactRequired')) | ||
| 305 | + return | ||
| 306 | + } | ||
| 307 | + if (!this.addItemOutInfo.endUserInfo.staffTel) { | ||
| 308 | + this.$message.error(this.$t('addItemOut.phoneRequired')) | ||
| 309 | + return | ||
| 310 | + } | ||
| 311 | + if (!this.addItemOutInfo.description) { | ||
| 312 | + this.$message.error(this.$t('addItemOut.noteRequired')) | ||
| 313 | + return | ||
| 314 | + } | ||
| 315 | + | ||
| 316 | + this.$refs.chooseResourceStore2.open({ | ||
| 317 | + shId: this.addItemOutInfo.shId | ||
| 318 | + }) | ||
| 319 | + }, | ||
| 320 | + async _finishStep() { | ||
| 321 | + const resourceStores = this.addItemOutInfo.resourceStores | ||
| 322 | + if (!resourceStores || resourceStores.length === 0) { | ||
| 323 | + this.$message.error(this.$t('addItemOut.itemRequired')) | ||
| 324 | + return | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + if (!this._resourcesFromSameHouse(resourceStores)) { | ||
| 328 | + this.$message.error(this.$t('addItemOut.sameWarehouseRequired')) | ||
| 329 | + return | ||
| 330 | + } | ||
| 331 | + | ||
| 332 | + let validate = true | ||
| 333 | + resourceStores.forEach(item => { | ||
| 334 | + const selectedStock = item.selectedStock || 0 | ||
| 335 | + const quantity = parseFloat(item.quantity) || 0 | ||
| 336 | + | ||
| 337 | + if (quantity > selectedStock) { | ||
| 338 | + validate = false | ||
| 339 | + } | ||
| 340 | + }) | ||
| 341 | + | ||
| 342 | + if (!validate) { | ||
| 343 | + this.$message.error(this.$t('addItemOut.insufficientStock')) | ||
| 344 | + return | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + this.addItemOutInfo.endUserName = this.addItemOutInfo.endUserInfo.staffName | ||
| 348 | + this.addItemOutInfo.endUserTel = this.addItemOutInfo.endUserInfo.staffTel | ||
| 349 | + this.addItemOutInfo.acceptStaffId = this.addItemOutInfo.endUserInfo.staffId | ||
| 350 | + | ||
| 351 | + if (this.addItemOutInfo.canChooseEndUserOrNot) { | ||
| 352 | + this.addItemOutInfo.useSwitch = "OFF" | ||
| 353 | + } | ||
| 354 | + | ||
| 355 | + try { | ||
| 356 | + const res = await goodsCollection(this.addItemOutInfo) | ||
| 357 | + if (res.code === 0) { | ||
| 358 | + this.$message.success(this.$t('addItemOut.submitSuccess')) | ||
| 359 | + this.goBack() | ||
| 360 | + } else { | ||
| 361 | + this.$message.error(res.msg || this.$t('addItemOut.submitFailed')) | ||
| 362 | + } | ||
| 363 | + } catch (error) { | ||
| 364 | + this.$message.error(this.$t('addItemOut.submitError')) | ||
| 365 | + console.error(error) | ||
| 366 | + } | ||
| 367 | + }, | ||
| 368 | + _loadResourceSuppliers() { | ||
| 369 | + // 实际调用API的方法 | ||
| 370 | + // 这里保留占位,实际实现需要调用API | ||
| 371 | + }, | ||
| 372 | + async _listPurchaseStorehouses() { | ||
| 373 | + try { | ||
| 374 | + const res = await listStorehouses({ | ||
| 375 | + page: 1, | ||
| 376 | + row: 100, | ||
| 377 | + communityId: "", | ||
| 378 | + allowPurchase: 'ON' | ||
| 379 | + }) | ||
| 380 | + this.addItemOutInfo.storehouses = res.data | ||
| 381 | + } catch (error) { | ||
| 382 | + console.error('请求失败:', error) | ||
| 383 | + } | ||
| 384 | + }, | ||
| 385 | + _removeSelectResourceStoreItem(resId) { | ||
| 386 | + this.addItemOutInfo.resourceStores = this.addItemOutInfo.resourceStores.filter( | ||
| 387 | + item => item.resId !== resId | ||
| 388 | + ) | ||
| 389 | + }, | ||
| 390 | + _changeTimesId(value, index) { | ||
| 391 | + const times = this.addItemOutInfo.resourceStores[index].times | ||
| 392 | + times.forEach(item => { | ||
| 393 | + if (item.timesId === value) { | ||
| 394 | + this.addItemOutInfo.resourceStores[index].selectedStock = item.stock | ||
| 395 | + } | ||
| 396 | + }) | ||
| 397 | + }, | ||
| 398 | + _getTimesStock(resourceStore) { | ||
| 399 | + if (!resourceStore.timesId) return "-" | ||
| 400 | + | ||
| 401 | + let stock = 0 | ||
| 402 | + resourceStore.times.forEach(item => { | ||
| 403 | + if (item.timesId === resourceStore.timesId) { | ||
| 404 | + stock = item.stock | ||
| 405 | + } | ||
| 406 | + }) | ||
| 407 | + | ||
| 408 | + if (!resourceStore.quantity) { | ||
| 409 | + resourceStore.quantity = '' | ||
| 410 | + } | ||
| 411 | + | ||
| 412 | + return stock | ||
| 413 | + }, | ||
| 414 | + _loadStaffOrg(flowId) { | ||
| 415 | + // 实际调用API的方法 | ||
| 416 | + // 这里保留占位,实际实现需要调用API | ||
| 417 | + console.log(flowId) | ||
| 418 | + }, | ||
| 419 | + chooseStaff() { | ||
| 420 | + this.$refs.selectStaff.open(this.addItemOutInfo.audit) | ||
| 421 | + }, | ||
| 422 | + chooseEndUser() { | ||
| 423 | + this.$refs.selectStaff.open(this.addItemOutInfo.endUserInfo) | ||
| 424 | + }, | ||
| 425 | + _computeFlow() { | ||
| 426 | + this.addItemOutInfo.resourceStores = [] | ||
| 427 | + const storehouse = this.addItemOutInfo.storehouses.find( | ||
| 428 | + item => item.shId === this.addItemOutInfo.shId | ||
| 429 | + ) | ||
| 430 | + | ||
| 431 | + if (storehouse) { | ||
| 432 | + this.addItemOutInfo.flowId = storehouse.useFlowId | ||
| 433 | + this._loadStaffOrg(storehouse.useFlowId) | ||
| 434 | + } | ||
| 435 | + }, | ||
| 436 | + handleSetSelectResourceStores(resourceStores) { | ||
| 437 | + const oldList = this.addItemOutInfo.resourceStores | ||
| 438 | + const newList = [...resourceStores] | ||
| 439 | + | ||
| 440 | + newList.forEach((newItem, newIndex) => { | ||
| 441 | + newItem.rsId = '' | ||
| 442 | + newItem.timesId = '' | ||
| 443 | + if (newItem.times && newItem.times.length > 0) { | ||
| 444 | + newItem.timesId = newItem.times[0].timesId | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + oldList.forEach(oldItem => { | ||
| 448 | + if (oldItem.resId === newItem.resId && newItem.times && newItem.times.length < 2) { | ||
| 449 | + delete newList[newIndex] | ||
| 450 | + } | ||
| 451 | + }) | ||
| 452 | + }) | ||
| 453 | + | ||
| 454 | + const filteredList = newList.filter(item => item['resId']) | ||
| 455 | + this.addItemOutInfo.resourceStores = [...oldList, ...filteredList] | ||
| 456 | + } | ||
| 457 | + } | ||
| 458 | +} | ||
| 459 | +</script> | ||
| 460 | + | ||
| 461 | +<style scoped> | ||
| 462 | +.box-card { | ||
| 463 | + margin-bottom: 20px; | ||
| 464 | +} | ||
| 465 | + | ||
| 466 | +.ibox-title { | ||
| 467 | + display: flex; | ||
| 468 | + justify-content: space-between; | ||
| 469 | + align-items: center; | ||
| 470 | +} | ||
| 471 | + | ||
| 472 | +.ibox-tools { | ||
| 473 | + position: relative; | ||
| 474 | + top: 10px; | ||
| 475 | +} | ||
| 476 | + | ||
| 477 | +.clearfix:before, | ||
| 478 | +.clearfix:after { | ||
| 479 | + display: table; | ||
| 480 | + content: ""; | ||
| 481 | +} | ||
| 482 | + | ||
| 483 | +.clearfix:after { | ||
| 484 | + clear: both; | ||
| 485 | +} | ||
| 486 | +</style> | ||
| 0 | \ No newline at end of file | 487 | \ No newline at end of file |
src/views/resource/allocationStorehouseApplyLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationStorehouseApply: { | ||
| 4 | + title: 'Allocation Application', | ||
| 5 | + back: 'Back', | ||
| 6 | + warehouse: 'Warehouse', | ||
| 7 | + warehousePlaceholder: 'Required, please select warehouse', | ||
| 8 | + remark: 'Application Description', | ||
| 9 | + remarkPlaceholder: 'Required, please fill in application description', | ||
| 10 | + itemsTitle: 'Allocation Items', | ||
| 11 | + selectItems: 'Select Items', | ||
| 12 | + itemType: 'Item Type', | ||
| 13 | + itemName: 'Item Name', | ||
| 14 | + itemSpec: 'Item Specification', | ||
| 15 | + fixedItem: 'Fixed Item', | ||
| 16 | + sourceWarehouse: 'Source Warehouse', | ||
| 17 | + referencePrice: 'Reference Price', | ||
| 18 | + selectPrice: 'Please select price', | ||
| 19 | + stock: 'Stock', | ||
| 20 | + targetWarehouse: 'Target Warehouse', | ||
| 21 | + selectTargetWarehouse: 'Required, please select target warehouse', | ||
| 22 | + transferQuantity: 'Allocation Quantity', | ||
| 23 | + operation: 'Operation', | ||
| 24 | + cancelTransfer: 'Cancel Allocation', | ||
| 25 | + approverTitle: 'Approver', | ||
| 26 | + approver: 'Approver', | ||
| 27 | + selectApprover: 'Required, please select approver', | ||
| 28 | + select: 'Select', | ||
| 29 | + submit: 'Submit', | ||
| 30 | + selectWarehouseFirst: 'Please select warehouse first', | ||
| 31 | + fillRemarkFirst: 'Please fill in application description first', | ||
| 32 | + remarkRequired: 'Application description is required', | ||
| 33 | + selectItemsFirst: 'Please select items first', | ||
| 34 | + sameWarehouseRequired: 'Allocation items must come from the same warehouse', | ||
| 35 | + selectPriceFirst: 'Please select price first', | ||
| 36 | + stockNotEnough: 'Insufficient stock', | ||
| 37 | + selectTargetWarehouseFirst: 'Please select target warehouse first', | ||
| 38 | + fillQuantityFirst: 'Please fill in allocation quantity first', | ||
| 39 | + submitSuccess: 'Allocation application submitted successfully' | ||
| 40 | + }, | ||
| 41 | + chooseResourceStore: { | ||
| 42 | + title: 'Select Items for Allocation', | ||
| 43 | + selectWarehouse: 'Please select warehouse', | ||
| 44 | + selectItemType: 'Please select item type', | ||
| 45 | + selectSubType: 'Please select sub type', | ||
| 46 | + inputItemName: 'Enter item management name', | ||
| 47 | + warehouseName: 'Warehouse Name', | ||
| 48 | + itemType: 'Item Type', | ||
| 49 | + itemName: 'Item Name', | ||
| 50 | + itemSpec: 'Item Specification', | ||
| 51 | + itemCode: 'Item Code', | ||
| 52 | + isFixedItem: 'Is Fixed Item', | ||
| 53 | + itemStock: 'Item Stock', | ||
| 54 | + selectItemFirst: 'Please select items first' | ||
| 55 | + }, | ||
| 56 | + selectStaff: { | ||
| 57 | + title: 'Select Staff', | ||
| 58 | + orgInfo: 'Organization Information', | ||
| 59 | + staffInfo: 'Staff Information', | ||
| 60 | + submitter: 'Submitter', | ||
| 61 | + dynamicAssign: 'Dynamic Assignment' | ||
| 62 | + } | ||
| 63 | + }, | ||
| 64 | + zh: { | ||
| 65 | + allocationStorehouseApply: { | ||
| 66 | + title: '调拨申请', | ||
| 67 | + back: '返回', | ||
| 68 | + warehouse: '仓库', | ||
| 69 | + warehousePlaceholder: '必填,请选择仓库', | ||
| 70 | + remark: '申请说明', | ||
| 71 | + remarkPlaceholder: '必填,请填写申请说明', | ||
| 72 | + itemsTitle: '调拨物品', | ||
| 73 | + selectItems: '选择物品', | ||
| 74 | + itemType: '物品类型', | ||
| 75 | + itemName: '物品名称', | ||
| 76 | + itemSpec: '物品规格', | ||
| 77 | + fixedItem: '固定物品', | ||
| 78 | + sourceWarehouse: '源仓库', | ||
| 79 | + referencePrice: '参考价格', | ||
| 80 | + selectPrice: '请选择价格', | ||
| 81 | + stock: '库存', | ||
| 82 | + targetWarehouse: '目标仓库', | ||
| 83 | + selectTargetWarehouse: '必填,请选择目标仓库', | ||
| 84 | + transferQuantity: '调拨数量', | ||
| 85 | + operation: '操作', | ||
| 86 | + cancelTransfer: '取消调拨', | ||
| 87 | + approverTitle: '审批人', | ||
| 88 | + approver: '审批人', | ||
| 89 | + selectApprover: '必填,请选择审批人', | ||
| 90 | + select: '选择', | ||
| 91 | + submit: '提交', | ||
| 92 | + selectWarehouseFirst: '请先选择仓库', | ||
| 93 | + fillRemarkFirst: '请先填写申请说明', | ||
| 94 | + remarkRequired: '申请说明不能为空', | ||
| 95 | + selectItemsFirst: '请先选择物品', | ||
| 96 | + sameWarehouseRequired: '调拨商品需来自同一仓库', | ||
| 97 | + selectPriceFirst: '请先选择价格', | ||
| 98 | + stockNotEnough: '库存不足', | ||
| 99 | + selectTargetWarehouseFirst: '请先选择目标仓库', | ||
| 100 | + fillQuantityFirst: '请先填写调拨数量', | ||
| 101 | + submitSuccess: '调拨申请提交成功' | ||
| 102 | + }, | ||
| 103 | + chooseResourceStore: { | ||
| 104 | + title: '【调拨申请】选择物品', | ||
| 105 | + selectWarehouse: '请选择仓库', | ||
| 106 | + selectItemType: '请选择物品类型', | ||
| 107 | + selectSubType: '请选择二级分类', | ||
| 108 | + inputItemName: '输入物品管理名称', | ||
| 109 | + warehouseName: '仓库名称', | ||
| 110 | + itemType: '物品类型', | ||
| 111 | + itemName: '物品名称', | ||
| 112 | + itemSpec: '物品规格', | ||
| 113 | + itemCode: '物品编码', | ||
| 114 | + isFixedItem: '是否是固定物品', | ||
| 115 | + itemStock: '物品库存', | ||
| 116 | + selectItemFirst: '请先选择物品' | ||
| 117 | + }, | ||
| 118 | + selectStaff: { | ||
| 119 | + title: '选择员工', | ||
| 120 | + orgInfo: '组织信息', | ||
| 121 | + staffInfo: '员工信息', | ||
| 122 | + submitter: '提交者', | ||
| 123 | + dynamicAssign: '动态指定' | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | +} | ||
| 0 | \ No newline at end of file | 127 | \ No newline at end of file |
src/views/resource/allocationStorehouseApplyList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="allocation-storehouse-apply-container"> | ||
| 3 | + <el-card class="box-card"> | ||
| 4 | + <div slot="header" class="flex justify-between"> | ||
| 5 | + <span>{{ $t('allocationStorehouseApply.title') }}</span> | ||
| 6 | + <el-button type="primary" size="small" class="float-right" @click="goBack"> | ||
| 7 | + <i class="el-icon-close"></i> | ||
| 8 | + {{ $t('allocationStorehouseApply.back') }} | ||
| 9 | + </el-button> | ||
| 10 | + </div> | ||
| 11 | + | ||
| 12 | + <el-form label-width="120px"> | ||
| 13 | + <el-row :gutter="20"> | ||
| 14 | + <el-col :span="24"> | ||
| 15 | + <el-form-item :label="$t('allocationStorehouseApply.warehouse')"> | ||
| 16 | + <el-select v-model="form.shId" :placeholder="$t('allocationStorehouseApply.warehousePlaceholder')" | ||
| 17 | + @change="computeFlow" style="width:100%"> | ||
| 18 | + <el-option v-for="item in storehouses" :key="item.shId" :label="item.shName" :value="item.shId"> | ||
| 19 | + </el-option> | ||
| 20 | + </el-select> | ||
| 21 | + </el-form-item> | ||
| 22 | + </el-col> | ||
| 23 | + | ||
| 24 | + <el-col :span="24"> | ||
| 25 | + <el-form-item :label="$t('allocationStorehouseApply.remark')"> | ||
| 26 | + <el-input type="textarea" v-model="form.remark" | ||
| 27 | + :placeholder="$t('allocationStorehouseApply.remarkPlaceholder')" :rows="3"></el-input> | ||
| 28 | + </el-form-item> | ||
| 29 | + </el-col> | ||
| 30 | + </el-row> | ||
| 31 | + </el-form> | ||
| 32 | + </el-card> | ||
| 33 | + | ||
| 34 | + <el-card class="box-card margin-top"> | ||
| 35 | + <div slot="header" class="flex justify-between"> | ||
| 36 | + <span>{{ $t('allocationStorehouseApply.itemsTitle') }}</span> | ||
| 37 | + <el-button type="primary" size="small" class="float-right" @click="openChooseResourceDialog"> | ||
| 38 | + <i class="el-icon-search"></i> | ||
| 39 | + {{ $t('allocationStorehouseApply.selectItems') }} | ||
| 40 | + </el-button> | ||
| 41 | + </div> | ||
| 42 | + | ||
| 43 | + <el-table :data="resourceStores" border style="width: 100%"> | ||
| 44 | + <el-table-column prop="type" :label="$t('allocationStorehouseApply.itemType')" align="center"> | ||
| 45 | + <template slot-scope="scope"> | ||
| 46 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | ||
| 47 | + </template> | ||
| 48 | + </el-table-column> | ||
| 49 | + | ||
| 50 | + <el-table-column prop="name" :label="$t('allocationStorehouseApply.itemName')" align="center"> | ||
| 51 | + <template slot-scope="scope"> | ||
| 52 | + {{ scope.row.resName }}({{ scope.row.resCode }}) | ||
| 53 | + </template> | ||
| 54 | + </el-table-column> | ||
| 55 | + | ||
| 56 | + <el-table-column prop="spec" :label="$t('allocationStorehouseApply.itemSpec')" align="center"> | ||
| 57 | + <template slot-scope="scope"> | ||
| 58 | + {{ scope.row.rssName || '-' }} | ||
| 59 | + </template> | ||
| 60 | + </el-table-column> | ||
| 61 | + | ||
| 62 | + <el-table-column prop="isFixed" :label="$t('allocationStorehouseApply.fixedItem')" align="center"> | ||
| 63 | + <template slot-scope="scope"> | ||
| 64 | + {{ scope.row.isFixedName }} | ||
| 65 | + </template> | ||
| 66 | + </el-table-column> | ||
| 67 | + | ||
| 68 | + <el-table-column prop="sourceWarehouse" :label="$t('allocationStorehouseApply.sourceWarehouse')" align="center"> | ||
| 69 | + <template slot-scope="scope"> | ||
| 70 | + {{ scope.row.shaName }} | ||
| 71 | + </template> | ||
| 72 | + </el-table-column> | ||
| 73 | + | ||
| 74 | + <el-table-column prop="price" :label="$t('allocationStorehouseApply.referencePrice')" align="center"> | ||
| 75 | + <template slot-scope="scope"> | ||
| 76 | + <el-select v-model="scope.row.timesId" @change="changeTimesId($event, scope.$index)" style="width:100%"> | ||
| 77 | + <el-option :value="''" :label="$t('allocationStorehouseApply.selectPrice')"></el-option> | ||
| 78 | + <el-option v-for="time in scope.row.times" :key="time.timesId" :label="time.price" | ||
| 79 | + :value="time.timesId"></el-option> | ||
| 80 | + </el-select> | ||
| 81 | + </template> | ||
| 82 | + </el-table-column> | ||
| 83 | + | ||
| 84 | + <el-table-column prop="stock" :label="$t('allocationStorehouseApply.stock')" align="center"> | ||
| 85 | + <template slot-scope="scope"> | ||
| 86 | + {{ getTimesStock(scope.row) }}{{ scope.row.unitCodeName }} | ||
| 87 | + </template> | ||
| 88 | + </el-table-column> | ||
| 89 | + | ||
| 90 | + <el-table-column prop="targetWarehouse" :label="$t('allocationStorehouseApply.targetWarehouse')" align="center"> | ||
| 91 | + <template slot-scope="scope"> | ||
| 92 | + <el-select v-model="scope.row.shzId" style="width:100%"> | ||
| 93 | + <el-option :value="''" :label="$t('allocationStorehouseApply.selectTargetWarehouse')"></el-option> | ||
| 94 | + <template v-for="item in storehouses"> | ||
| 95 | + <el-option :key="item.shId" :label="item.shName" :value="item.shId" | ||
| 96 | + v-if="item.shId != scope.row.shId && item.communityId == communityId"></el-option> | ||
| 97 | + </template> | ||
| 98 | + </el-select> | ||
| 99 | + </template> | ||
| 100 | + </el-table-column> | ||
| 101 | + | ||
| 102 | + <el-table-column prop="quantity" :label="$t('allocationStorehouseApply.transferQuantity')" align="center"> | ||
| 103 | + <template slot-scope="scope"> | ||
| 104 | + <el-input-number v-model="scope.row.curStock" :min="0" :precision="0" | ||
| 105 | + controls-position="right"></el-input-number> | ||
| 106 | + {{ scope.row.unitCodeName }} | ||
| 107 | + </template> | ||
| 108 | + </el-table-column> | ||
| 109 | + | ||
| 110 | + <el-table-column prop="operation" :label="$t('allocationStorehouseApply.operation')" align="center" width="150"> | ||
| 111 | + <template slot-scope="scope"> | ||
| 112 | + <el-button type="danger" size="mini" @click="removeItem(scope.row)"> | ||
| 113 | + {{ $t('allocationStorehouseApply.cancelTransfer') }} | ||
| 114 | + </el-button> | ||
| 115 | + </template> | ||
| 116 | + </el-table-column> | ||
| 117 | + </el-table> | ||
| 118 | + </el-card> | ||
| 119 | + | ||
| 120 | + <el-card class="box-card margin-top" v-if="form.audit.assignee === '-2'"> | ||
| 121 | + <div slot="header" class="clearfix"> | ||
| 122 | + <span>{{ $t('allocationStorehouseApply.approverTitle') }}</span> | ||
| 123 | + </div> | ||
| 124 | + | ||
| 125 | + <el-form label-width="120px"> | ||
| 126 | + <el-row :gutter="20"> | ||
| 127 | + <el-col :span="24"> | ||
| 128 | + <el-form-item :label="$t('allocationStorehouseApply.approver')"> | ||
| 129 | + <el-input v-model="form.audit.staffName" :placeholder="$t('allocationStorehouseApply.selectApprover')" | ||
| 130 | + disabled></el-input> | ||
| 131 | + <el-button type="primary" class="margin-top" @click="chooseStaff"> | ||
| 132 | + <i class="el-icon-search"></i> | ||
| 133 | + {{ $t('allocationStorehouseApply.select') }} | ||
| 134 | + </el-button> | ||
| 135 | + </el-form-item> | ||
| 136 | + </el-col> | ||
| 137 | + </el-row> | ||
| 138 | + </el-form> | ||
| 139 | + </el-card> | ||
| 140 | + | ||
| 141 | + <div class="submit-wrapper"> | ||
| 142 | + <el-button type="primary" @click="submitApply"> | ||
| 143 | + {{ $t('allocationStorehouseApply.submit') }} | ||
| 144 | + </el-button> | ||
| 145 | + </div> | ||
| 146 | + | ||
| 147 | + <choose-resource-store ref="chooseResourceStore" @choose="handleChooseResource" /> | ||
| 148 | + | ||
| 149 | + <select-staff ref="selectStaff" @select="handleSelectStaff" /> | ||
| 150 | + </div> | ||
| 151 | +</template> | ||
| 152 | + | ||
| 153 | +<script> | ||
| 154 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 155 | +import ChooseResourceStore from '@/components/resource/chooseResourceStore' | ||
| 156 | +import SelectStaff from '@/components/resource/selectStaff' | ||
| 157 | +import { | ||
| 158 | + listStorehouses, | ||
| 159 | + saveAllocationStorehouse, | ||
| 160 | + queryFirstAuditStaff | ||
| 161 | +} from '@/api/resource/allocationStorehouseApplyApi' | ||
| 162 | + | ||
| 163 | +export default { | ||
| 164 | + name: 'AllocationStorehouseApplyList', | ||
| 165 | + components: { | ||
| 166 | + ChooseResourceStore, | ||
| 167 | + SelectStaff | ||
| 168 | + }, | ||
| 169 | + data() { | ||
| 170 | + return { | ||
| 171 | + communityId: '', | ||
| 172 | + form: { | ||
| 173 | + resourceStores: [], | ||
| 174 | + storehouses: [], | ||
| 175 | + remark: '', | ||
| 176 | + communityId: '', | ||
| 177 | + shId: '', | ||
| 178 | + flowId: '', | ||
| 179 | + audit: { | ||
| 180 | + assignee: '', | ||
| 181 | + staffId: '', | ||
| 182 | + staffName: '', | ||
| 183 | + taskId: '' | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + storehouses: [], | ||
| 187 | + resourceStores: [] | ||
| 188 | + } | ||
| 189 | + }, | ||
| 190 | + created() { | ||
| 191 | + this.communityId = getCommunityId() | ||
| 192 | + this.form.communityId = this.communityId | ||
| 193 | + this.loadStorehouses() | ||
| 194 | + }, | ||
| 195 | + methods: { | ||
| 196 | + async loadStorehouses() { | ||
| 197 | + try { | ||
| 198 | + const params = { | ||
| 199 | + page: 1, | ||
| 200 | + row: 100, | ||
| 201 | + flag: "1", | ||
| 202 | + communityId: this.communityId | ||
| 203 | + } | ||
| 204 | + const res = await listStorehouses(params) | ||
| 205 | + this.storehouses = res.data | ||
| 206 | + this.form.storehouses = res.data | ||
| 207 | + } catch (error) { | ||
| 208 | + console.error(error) | ||
| 209 | + } | ||
| 210 | + }, | ||
| 211 | + openChooseResourceDialog() { | ||
| 212 | + if (!this.form.shId) { | ||
| 213 | + this.$message.error(this.$t('allocationStorehouseApply.selectWarehouseFirst')) | ||
| 214 | + return | ||
| 215 | + } | ||
| 216 | + if (!this.form.remark) { | ||
| 217 | + this.$message.error(this.$t('allocationStorehouseApply.fillRemarkFirst')) | ||
| 218 | + return | ||
| 219 | + } | ||
| 220 | + this.$refs.chooseResourceStore.open({ | ||
| 221 | + resOrderType: '20000', | ||
| 222 | + shId: this.form.shId, | ||
| 223 | + isAllocation: true | ||
| 224 | + }) | ||
| 225 | + }, | ||
| 226 | + handleChooseResource(resources) { | ||
| 227 | + const oldList = this.resourceStores | ||
| 228 | + // 过滤重复选择的商品 | ||
| 229 | + const newResources = resources.filter(newItem => { | ||
| 230 | + return !oldList.some(oldItem => oldItem.resId === newItem.resId) | ||
| 231 | + }) | ||
| 232 | + | ||
| 233 | + // 设置默认值 | ||
| 234 | + newResources.forEach(item => { | ||
| 235 | + item.shaName = item.shName | ||
| 236 | + item.shzId = '' | ||
| 237 | + item.curStock = 0 | ||
| 238 | + if (item.times && item.times.length > 0) { | ||
| 239 | + item.timesId = item.times[0].timesId | ||
| 240 | + } | ||
| 241 | + }) | ||
| 242 | + | ||
| 243 | + this.resourceStores = [...newResources, ...oldList] | ||
| 244 | + this.form.resourceStores = this.resourceStores | ||
| 245 | + }, | ||
| 246 | + removeItem(item) { | ||
| 247 | + this.resourceStores = this.resourceStores.filter(i => i.resId !== item.resId) | ||
| 248 | + this.form.resourceStores = this.resourceStores | ||
| 249 | + this.$refs.chooseResourceStore.removeSelectedItem(item.resId) | ||
| 250 | + }, | ||
| 251 | + changeTimesId(value, index) { | ||
| 252 | + const times = this.resourceStores[index].times | ||
| 253 | + times.forEach(item => { | ||
| 254 | + if (item.timesId === value) { | ||
| 255 | + this.resourceStores[index].selectedStock = item.stock | ||
| 256 | + } | ||
| 257 | + }) | ||
| 258 | + }, | ||
| 259 | + getTimesStock(item) { | ||
| 260 | + if (!item.timesId) return "-" | ||
| 261 | + let stock = 0 | ||
| 262 | + item.times.forEach(time => { | ||
| 263 | + if (time.timesId === item.timesId) { | ||
| 264 | + stock = time.stock | ||
| 265 | + } | ||
| 266 | + }) | ||
| 267 | + return stock | ||
| 268 | + }, | ||
| 269 | + computeFlow() { | ||
| 270 | + // 清空已选择的商品 | ||
| 271 | + this.resourceStores = [] | ||
| 272 | + this.form.resourceStores = [] | ||
| 273 | + | ||
| 274 | + const storehouse = this.storehouses.find(item => item.shId === this.form.shId) | ||
| 275 | + if (!storehouse) return | ||
| 276 | + | ||
| 277 | + this.form.flowId = storehouse.allocationFlowId | ||
| 278 | + if (!this.form.flowId) return | ||
| 279 | + | ||
| 280 | + this.loadStaffOrg(this.form.flowId) | ||
| 281 | + }, | ||
| 282 | + async loadStaffOrg(flowId) { | ||
| 283 | + try { | ||
| 284 | + const params = { | ||
| 285 | + communityId: this.communityId, | ||
| 286 | + flowId: flowId | ||
| 287 | + } | ||
| 288 | + const res = await queryFirstAuditStaff(params) | ||
| 289 | + if (res.code !== 0) return | ||
| 290 | + | ||
| 291 | + const data = res.data[0] | ||
| 292 | + Object.assign(this.form.audit, data) | ||
| 293 | + if (!data.assignee.startsWith('-')) { | ||
| 294 | + this.form.audit.staffId = data.assignee | ||
| 295 | + } | ||
| 296 | + } catch (error) { | ||
| 297 | + console.error(error) | ||
| 298 | + } | ||
| 299 | + }, | ||
| 300 | + chooseStaff() { | ||
| 301 | + this.$refs.selectStaff.open(this.form.audit) | ||
| 302 | + }, | ||
| 303 | + handleSelectStaff(staff) { | ||
| 304 | + this.form.audit.staffId = staff.userId | ||
| 305 | + this.form.audit.staffName = staff.userName | ||
| 306 | + }, | ||
| 307 | + async submitApply() { | ||
| 308 | + // 验证数据 | ||
| 309 | + if (!this.form.remark) { | ||
| 310 | + this.$message.error(this.$t('allocationStorehouseApply.remarkRequired')) | ||
| 311 | + return | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + if (this.resourceStores.length === 0) { | ||
| 315 | + this.$message.error(this.$t('allocationStorehouseApply.selectItemsFirst')) | ||
| 316 | + return | ||
| 317 | + } | ||
| 318 | + | ||
| 319 | + if (!this.resourcesFromSameHouse(this.resourceStores)) { | ||
| 320 | + this.$message.error(this.$t('allocationStorehouseApply.sameWarehouseRequired')) | ||
| 321 | + return | ||
| 322 | + } | ||
| 323 | + | ||
| 324 | + let isValid = true | ||
| 325 | + this.resourceStores.forEach(item => { | ||
| 326 | + if (!item.timesId) { | ||
| 327 | + this.$message.error(`${item.resName}${this.$t('allocationStorehouseApply.selectPriceFirst')}`) | ||
| 328 | + isValid = false | ||
| 329 | + return | ||
| 330 | + } | ||
| 331 | + | ||
| 332 | + item.curStock = parseFloat(item.curStock) | ||
| 333 | + if (item.curStock > parseFloat(item.selectedStock)) { | ||
| 334 | + this.$message.error(`${item.resName}${this.$t('allocationStorehouseApply.stockNotEnough')}`) | ||
| 335 | + isValid = false | ||
| 336 | + return | ||
| 337 | + } | ||
| 338 | + | ||
| 339 | + if (!item.shzId) { | ||
| 340 | + this.$message.error(this.$t('allocationStorehouseApply.selectTargetWarehouseFirst')) | ||
| 341 | + isValid = false | ||
| 342 | + return | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + if (item.curStock <= 0) { | ||
| 346 | + this.$message.error(this.$t('allocationStorehouseApply.fillQuantityFirst')) | ||
| 347 | + isValid = false | ||
| 348 | + return | ||
| 349 | + } | ||
| 350 | + }) | ||
| 351 | + | ||
| 352 | + if (!isValid) return | ||
| 353 | + | ||
| 354 | + try { | ||
| 355 | + const res = await saveAllocationStorehouse(this.form) | ||
| 356 | + if (res.code === 0) { | ||
| 357 | + this.$message.success(this.$t('allocationStorehouseApply.submitSuccess')) | ||
| 358 | + this.goBack() | ||
| 359 | + } else { | ||
| 360 | + this.$message.error(res.msg) | ||
| 361 | + } | ||
| 362 | + } catch (error) { | ||
| 363 | + console.error(error) | ||
| 364 | + this.$message.error(this.$t('allocationStorehouseApply.submitFailed')) | ||
| 365 | + } | ||
| 366 | + }, | ||
| 367 | + resourcesFromSameHouse(resources) { | ||
| 368 | + if (!resources || resources.length < 2) return true | ||
| 369 | + | ||
| 370 | + const firstShId = resources[0].shId | ||
| 371 | + return resources.every(item => item.shId === firstShId) | ||
| 372 | + }, | ||
| 373 | + goBack() { | ||
| 374 | + this.$router.go(-1) | ||
| 375 | + } | ||
| 376 | + } | ||
| 377 | +} | ||
| 378 | +</script> | ||
| 379 | + | ||
| 380 | +<style lang="scss" scoped> | ||
| 381 | +.allocation-storehouse-apply-container { | ||
| 382 | + padding: 20px; | ||
| 383 | + | ||
| 384 | + .box-card { | ||
| 385 | + margin-bottom: 20px; | ||
| 386 | + } | ||
| 387 | + | ||
| 388 | + .margin-top { | ||
| 389 | + margin-top: 20px; | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + .float-right { | ||
| 393 | + float: right; | ||
| 394 | + } | ||
| 395 | + | ||
| 396 | + .submit-wrapper { | ||
| 397 | + text-align: right; | ||
| 398 | + margin-top: 20px; | ||
| 399 | + } | ||
| 400 | +} | ||
| 401 | +</style> | ||
| 0 | \ No newline at end of file | 402 | \ No newline at end of file |
src/views/resource/allocationStorehouseDetailedLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationStorehouseDetailed: { | ||
| 4 | + queryCondition: 'Query Condition', | ||
| 5 | + allocationDetail: 'Allocation Detail', | ||
| 6 | + query: 'Query', | ||
| 7 | + reset: 'Reset', | ||
| 8 | + more: 'More', | ||
| 9 | + hide: 'Hide', | ||
| 10 | + export: 'Export', | ||
| 11 | + all: 'All', | ||
| 12 | + resIdPlaceholder: 'Please input resource ID', | ||
| 13 | + resNamePlaceholder: 'Please input resource name', | ||
| 14 | + resTypePlaceholder: 'Please select resource type', | ||
| 15 | + secondTypePlaceholder: 'Please select secondary type', | ||
| 16 | + specPlaceholder: 'Please select specification', | ||
| 17 | + applyIdPlaceholder: 'Please input allocation ID', | ||
| 18 | + sourceStorePlaceholder: 'Required, please select source storehouse', | ||
| 19 | + targetStorePlaceholder: 'Required, please select target storehouse', | ||
| 20 | + startTimePlaceholder: 'Please select start time', | ||
| 21 | + endTimePlaceholder: 'Please select end time', | ||
| 22 | + statePlaceholder: 'Please select allocation state', | ||
| 23 | + exportSuccess: 'Export success', | ||
| 24 | + exportError: 'Export failed', | ||
| 25 | + table: { | ||
| 26 | + applyId: 'Allocation ID', | ||
| 27 | + resId: 'Resource ID', | ||
| 28 | + resType: 'Resource Type', | ||
| 29 | + resName: 'Resource Name', | ||
| 30 | + specName: 'Specification', | ||
| 31 | + isFixedName: 'Fixed Resource', | ||
| 32 | + originalStock: 'Original Stock', | ||
| 33 | + stock: 'Allocation Quantity', | ||
| 34 | + shaName: 'Source Storehouse', | ||
| 35 | + shzName: 'Target Storehouse', | ||
| 36 | + startUserName: 'Applicant', | ||
| 37 | + remark: 'Allocation Remark', | ||
| 38 | + state: 'Status', | ||
| 39 | + createTime: 'Time' | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + }, | ||
| 43 | + zh: { | ||
| 44 | + allocationStorehouseDetailed: { | ||
| 45 | + queryCondition: '查询条件', | ||
| 46 | + allocationDetail: '调拨明细', | ||
| 47 | + query: '查询', | ||
| 48 | + reset: '重置', | ||
| 49 | + more: '更多', | ||
| 50 | + hide: '隐藏', | ||
| 51 | + export: '导出', | ||
| 52 | + all: '全部', | ||
| 53 | + resIdPlaceholder: '请输入物品ID', | ||
| 54 | + resNamePlaceholder: '请输入物品名称', | ||
| 55 | + resTypePlaceholder: '请选择物品类型', | ||
| 56 | + secondTypePlaceholder: '请选择二级分类', | ||
| 57 | + specPlaceholder: '请选择物品规格', | ||
| 58 | + applyIdPlaceholder: '请输入调拨申请ID', | ||
| 59 | + sourceStorePlaceholder: '必填,请选择源仓库', | ||
| 60 | + targetStorePlaceholder: '必填,请选择目标仓库', | ||
| 61 | + startTimePlaceholder: '请选择开始时间', | ||
| 62 | + endTimePlaceholder: '请选择结束时间', | ||
| 63 | + statePlaceholder: '请选择调拨状态', | ||
| 64 | + exportSuccess: '导出成功', | ||
| 65 | + exportError: '导出失败', | ||
| 66 | + table: { | ||
| 67 | + applyId: '调拨单号', | ||
| 68 | + resId: '物品ID', | ||
| 69 | + resType: '物品类型', | ||
| 70 | + resName: '物品名称', | ||
| 71 | + specName: '物品规格', | ||
| 72 | + isFixedName: '固定物品', | ||
| 73 | + originalStock: '被调仓库原库存', | ||
| 74 | + stock: '调拨数量', | ||
| 75 | + shaName: '被调仓库', | ||
| 76 | + shzName: '目标仓库', | ||
| 77 | + startUserName: '申请人', | ||
| 78 | + remark: '调拨备注', | ||
| 79 | + state: '状态', | ||
| 80 | + createTime: '时间' | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | +} | ||
| 0 | \ No newline at end of file | 85 | \ No newline at end of file |
src/views/resource/allocationStorehouseDetailedList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight ecommerce"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4" > | ||
| 5 | + <div class="border-radius"> | ||
| 6 | + <div class="margin-xs-r treeview attendance-staff"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li v-for="(item, index) in allocationStorehousesInfo.applyTypes" :key="index" | ||
| 9 | + class="list-group-item node-orgTree" | ||
| 10 | + :class="{ 'vc-node-selected': allocationStorehousesInfo.conditions.applyType == item.statusCd }" | ||
| 11 | + @click="swatchApplyType(item)"> | ||
| 12 | + {{ item.name }} | ||
| 13 | + </li> | ||
| 14 | + </ul> | ||
| 15 | + </div> | ||
| 16 | + </div> | ||
| 17 | + </el-col> | ||
| 18 | + <el-col :span="20"> | ||
| 19 | + <el-card class="box-card"> | ||
| 20 | + <div slot="header" class="flex justify-between"> | ||
| 21 | + <span>{{ $t('allocationStorehouseDetailed.queryCondition') }}</span> | ||
| 22 | + <div class="ibox-tools" > | ||
| 23 | + <el-button type="text" style="margin-right:10px;" @click="_moreCondition()"> | ||
| 24 | + {{ allocationStorehousesInfo.moreCondition == true ? $t('allocationStorehouseDetailed.hide') : | ||
| 25 | + $t('allocationStorehouseDetailed.more') }} | ||
| 26 | + </el-button> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + <el-row :gutter="20"> | ||
| 30 | + <el-col :span="4"> | ||
| 31 | + <el-input v-model.trim="allocationStorehousesInfo.conditions.resId" | ||
| 32 | + :placeholder="$t('allocationStorehouseDetailed.resIdPlaceholder')" clearable /> | ||
| 33 | + </el-col> | ||
| 34 | + <el-col :span="4"> | ||
| 35 | + <el-input v-model.trim="allocationStorehousesInfo.conditions.resName" | ||
| 36 | + :placeholder="$t('allocationStorehouseDetailed.resNamePlaceholder')" clearable /> | ||
| 37 | + </el-col> | ||
| 38 | + <el-col :span="4"> | ||
| 39 | + <el-select v-model="allocationStorehousesInfo.conditions.parentRstId" | ||
| 40 | + :placeholder="$t('allocationStorehouseDetailed.resTypePlaceholder')" style="width:100%" | ||
| 41 | + @change="_listResourceStoreSonTypes"> | ||
| 42 | + <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreTypes" :key="index" | ||
| 43 | + :label="item.name" :value="item.rstId" /> | ||
| 44 | + </el-select> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="4"> | ||
| 47 | + <el-select v-model="allocationStorehousesInfo.conditions.rstId" | ||
| 48 | + :placeholder="$t('allocationStorehouseDetailed.secondTypePlaceholder')" style="width:100%" | ||
| 49 | + @change="_listResourceStoreSpecifications"> | ||
| 50 | + <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreSonTypes" :key="index" | ||
| 51 | + :label="item.name" :value="item.rstId" /> | ||
| 52 | + </el-select> | ||
| 53 | + </el-col> | ||
| 54 | + <el-col :span="4"> | ||
| 55 | + <el-select v-model="allocationStorehousesInfo.conditions.rssId" | ||
| 56 | + :placeholder="$t('allocationStorehouseDetailed.specPlaceholder')" style="width:100%"> | ||
| 57 | + <el-option v-for="(item, index) in allocationStorehousesInfo.resourceStoreSpecifications" :key="index" | ||
| 58 | + :label="item.specName" :value="item.rssId" /> | ||
| 59 | + </el-select> | ||
| 60 | + </el-col> | ||
| 61 | + <el-col :span="4"> | ||
| 62 | + <el-button type="primary" @click="_queryAllocationStorehouseMethod()"> | ||
| 63 | + <i class="el-icon-search"></i> | ||
| 64 | + {{ $t('allocationStorehouseDetailed.query') }} | ||
| 65 | + </el-button> | ||
| 66 | + <el-button type="primary" @click="_resetAllocationStorehouseMethod()"> | ||
| 67 | + <i class="el-icon-refresh"></i> | ||
| 68 | + {{ $t('allocationStorehouseDetailed.reset') }} | ||
| 69 | + </el-button> | ||
| 70 | + </el-col> | ||
| 71 | + </el-row> | ||
| 72 | + | ||
| 73 | + <el-row v-show="allocationStorehousesInfo.moreCondition == true" :gutter="20"> | ||
| 74 | + <el-col :span="4"> | ||
| 75 | + <el-input v-model.trim="allocationStorehousesInfo.conditions.applyId" | ||
| 76 | + :placeholder="$t('allocationStorehouseDetailed.applyIdPlaceholder')" clearable /> | ||
| 77 | + </el-col> | ||
| 78 | + <el-col :span="4"> | ||
| 79 | + <el-select v-model="allocationStorehousesInfo.conditions.shIda" | ||
| 80 | + :placeholder="$t('allocationStorehouseDetailed.sourceStorePlaceholder')" style="width:100%"> | ||
| 81 | + <el-option v-for="(item, index) in allocationStorehousesInfo.storehouses" :key="index" :label="item.shName" | ||
| 82 | + :value="item.shId" /> | ||
| 83 | + </el-select> | ||
| 84 | + </el-col> | ||
| 85 | + <el-col :span="4"> | ||
| 86 | + <el-select v-model="allocationStorehousesInfo.conditions.shIdz" | ||
| 87 | + :placeholder="$t('allocationStorehouseDetailed.targetStorePlaceholder')" style="width:100%"> | ||
| 88 | + <el-option v-for="(item, index) in allocationStorehousesInfo.storehouses" :key="index" :label="item.shName" | ||
| 89 | + :value="item.shId" /> | ||
| 90 | + </el-select> | ||
| 91 | + </el-col> | ||
| 92 | + <el-col :span="4"> | ||
| 93 | + <el-date-picker v-model="allocationStorehousesInfo.conditions.startTime" type="datetime" | ||
| 94 | + :placeholder="$t('allocationStorehouseDetailed.startTimePlaceholder')" style="width:100%" /> | ||
| 95 | + </el-col> | ||
| 96 | + <el-col :span="4"> | ||
| 97 | + <el-date-picker v-model="allocationStorehousesInfo.conditions.endTime" type="datetime" | ||
| 98 | + :placeholder="$t('allocationStorehouseDetailed.endTimePlaceholder')" style="width:100%" /> | ||
| 99 | + </el-col> | ||
| 100 | + </el-row> | ||
| 101 | + | ||
| 102 | + <el-row v-show="allocationStorehousesInfo.moreCondition == true" :gutter="20"> | ||
| 103 | + <el-col :span="4"> | ||
| 104 | + <el-select v-model="allocationStorehousesInfo.conditions.state" | ||
| 105 | + :placeholder="$t('allocationStorehouseDetailed.statePlaceholder')" style="width:100%"> | ||
| 106 | + <el-option v-for="(item, index) in allocationStorehousesInfo.states" :key="index" :label="item.name" | ||
| 107 | + :value="item.statusCd" /> | ||
| 108 | + </el-select> | ||
| 109 | + </el-col> | ||
| 110 | + </el-row> | ||
| 111 | + </el-card> | ||
| 112 | + | ||
| 113 | + <el-card class="box-card" style="margin-top:20px;"> | ||
| 114 | + <div slot="header" class="flex justify-between"> | ||
| 115 | + <span>{{ $t('allocationStorehouseDetailed.allocationDetail') }}</span> | ||
| 116 | + <div class="ibox-tools" > | ||
| 117 | + <el-button type="primary" size="small" @click="_exportExcel()"> | ||
| 118 | + <i class="el-icon-download"></i> | ||
| 119 | + {{ $t('allocationStorehouseDetailed.export') }} | ||
| 120 | + </el-button> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + <el-table :data="allocationStorehousesInfo.resourceStores" border style="width: 100%"> | ||
| 124 | + <el-table-column prop="applyId" :label="$t('allocationStorehouseDetailed.table.applyId')" align="center" /> | ||
| 125 | + <el-table-column prop="resId" :label="$t('allocationStorehouseDetailed.table.resId')" align="center" /> | ||
| 126 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.resType')" align="center"> | ||
| 127 | + <template slot-scope="scope"> | ||
| 128 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 129 | + </template> | ||
| 130 | + </el-table-column> | ||
| 131 | + <el-table-column prop="resName" :label="$t('allocationStorehouseDetailed.table.resName')" align="center" /> | ||
| 132 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.specName')" align="center"> | ||
| 133 | + <template slot-scope="scope"> | ||
| 134 | + {{ scope.row.specName ? scope.row.specName : '-' }} | ||
| 135 | + </template> | ||
| 136 | + </el-table-column> | ||
| 137 | + <el-table-column prop="isFixedName" :label="$t('allocationStorehouseDetailed.table.isFixedName')" | ||
| 138 | + align="center" /> | ||
| 139 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.originalStock')" align="center"> | ||
| 140 | + <template slot-scope="scope"> | ||
| 141 | + {{ scope.row.originalStock }}{{ scope.row.unitCodeName }} | ||
| 142 | + </template> | ||
| 143 | + </el-table-column> | ||
| 144 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.stock')" align="center"> | ||
| 145 | + <template slot-scope="scope"> | ||
| 146 | + {{ scope.row.stock }}{{ scope.row.applyType == 20000 ? scope.row.miniUnitCodeName : scope.row.unitCodeName }} | ||
| 147 | + </template> | ||
| 148 | + </el-table-column> | ||
| 149 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.shaName')" align="center"> | ||
| 150 | + <template slot-scope="scope"> | ||
| 151 | + {{ scope.row.applyType == '20000' ? scope.row.startUserName : scope.row.shaName }} | ||
| 152 | + </template> | ||
| 153 | + </el-table-column> | ||
| 154 | + <el-table-column prop="shzName" :label="$t('allocationStorehouseDetailed.table.shzName')" align="center" /> | ||
| 155 | + <el-table-column prop="startUserName" :label="$t('allocationStorehouseDetailed.table.startUserName')" | ||
| 156 | + align="center" /> | ||
| 157 | + <el-table-column prop="remark" :label="$t('allocationStorehouseDetailed.table.remark')" align="center" /> | ||
| 158 | + <el-table-column :label="$t('allocationStorehouseDetailed.table.state')" align="center"> | ||
| 159 | + <template slot-scope="scope"> | ||
| 160 | + {{ scope.row.stateName }}({{ scope.row.applyTypeName }}) | ||
| 161 | + </template> | ||
| 162 | + </el-table-column> | ||
| 163 | + <el-table-column prop="createTime" :label="$t('allocationStorehouseDetailed.table.createTime')" | ||
| 164 | + align="center" /> | ||
| 165 | + </el-table> | ||
| 166 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 167 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 168 | + @current-change="handleCurrentChange" /> | ||
| 169 | + </el-card> | ||
| 170 | + </el-col> | ||
| 171 | + </el-row> | ||
| 172 | + </div> | ||
| 173 | +</template> | ||
| 174 | + | ||
| 175 | +<script> | ||
| 176 | +import { listAllocationStorehouses, listStorehouses, listResourceStoreTypes, listResourceStoreSpecifications, exportData } from '@/api/resource/allocationStorehouseDetailedApi' | ||
| 177 | +import { getDict } from '@/api/community/communityApi' | ||
| 178 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 179 | +import {getUserId} from '@/api/user/userApi' | ||
| 180 | + | ||
| 181 | +export default { | ||
| 182 | + name: 'AllocationStorehouseDetailedList', | ||
| 183 | + data() { | ||
| 184 | + return { | ||
| 185 | + allocationStorehousesInfo: { | ||
| 186 | + resourceStores: [], | ||
| 187 | + storehouses: [], | ||
| 188 | + total: 0, | ||
| 189 | + records: 1, | ||
| 190 | + moreCondition: false, | ||
| 191 | + states: [], | ||
| 192 | + applyTypes: [], | ||
| 193 | + conditions: { | ||
| 194 | + asId: '', | ||
| 195 | + applyId: '', | ||
| 196 | + resId: '', | ||
| 197 | + resName: '', | ||
| 198 | + resCode: '', | ||
| 199 | + rssId: '', | ||
| 200 | + parentRstId: '', | ||
| 201 | + rstId: '', | ||
| 202 | + shIda: '', | ||
| 203 | + shIdz: '', | ||
| 204 | + stock: '', | ||
| 205 | + startUserId: '', | ||
| 206 | + state: '', | ||
| 207 | + applyType: '', | ||
| 208 | + startTime: '', | ||
| 209 | + endTime: '', | ||
| 210 | + userId: '', | ||
| 211 | + communityId: '' | ||
| 212 | + }, | ||
| 213 | + resourceStoreTypes: [], | ||
| 214 | + resourceStoreSonTypes: [], | ||
| 215 | + resourceStoreSpecifications: [] | ||
| 216 | + }, | ||
| 217 | + page: { | ||
| 218 | + current: 1, | ||
| 219 | + size: 10, | ||
| 220 | + total: 0 | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + }, | ||
| 224 | + created() { | ||
| 225 | + this.communityId = getCommunityId() | ||
| 226 | + this._initMethod() | ||
| 227 | + }, | ||
| 228 | + methods: { | ||
| 229 | + async _initMethod() { | ||
| 230 | + try { | ||
| 231 | + // 获取字典数据 | ||
| 232 | + const stateData = await getDict('allocation_storehouse_apply', 'state') | ||
| 233 | + const applyTypeData = await getDict('allocation_storehouse_apply', 'apply_type') | ||
| 234 | + | ||
| 235 | + this.allocationStorehousesInfo.states = stateData | ||
| 236 | + this.allocationStorehousesInfo.applyTypes = [{ | ||
| 237 | + statusCd: '', | ||
| 238 | + name: this.$t('allocationStorehouseDetailed.all') | ||
| 239 | + }].concat(applyTypeData) | ||
| 240 | + | ||
| 241 | + this._initAllocationStorehouseDetailedInfo() | ||
| 242 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 243 | + this._listStorehouses() | ||
| 244 | + this._listResourceStoreTypes() | ||
| 245 | + this._listResourceStoreSpecifications() | ||
| 246 | + } catch (error) { | ||
| 247 | + console.error('初始化失败:', error) | ||
| 248 | + } | ||
| 249 | + }, | ||
| 250 | + _initAllocationStorehouseDetailedInfo() { | ||
| 251 | + this.allocationStorehousesInfo.conditions.userId = getUserId() | ||
| 252 | + this.allocationStorehousesInfo.conditions.communityId = this.communityId | ||
| 253 | + }, | ||
| 254 | + async _listAllocationStores(_page, _rows) { | ||
| 255 | + try { | ||
| 256 | + this.allocationStorehousesInfo.conditions.page = _page | ||
| 257 | + this.allocationStorehousesInfo.conditions.row = _rows | ||
| 258 | + const params = { | ||
| 259 | + ...this.allocationStorehousesInfo.conditions, | ||
| 260 | + resId: this.allocationStorehousesInfo.conditions.resId.trim(), | ||
| 261 | + resName: this.allocationStorehousesInfo.conditions.resName.trim(), | ||
| 262 | + applyId: this.allocationStorehousesInfo.conditions.applyId.trim(), | ||
| 263 | + startUserId: this.allocationStorehousesInfo.conditions.startUserId.trim() | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + const { data, total } = await listAllocationStorehouses(params) | ||
| 267 | + this.allocationStorehousesInfo.resourceStores = data | ||
| 268 | + this.allocationStorehousesInfo.total = total | ||
| 269 | + this.page.total = total | ||
| 270 | + } catch (error) { | ||
| 271 | + console.error('获取调拨明细失败:', error) | ||
| 272 | + } | ||
| 273 | + }, | ||
| 274 | + async _listStorehouses() { | ||
| 275 | + try { | ||
| 276 | + const params = { | ||
| 277 | + page: 1, | ||
| 278 | + row: 100, | ||
| 279 | + communityId: this.communityId | ||
| 280 | + } | ||
| 281 | + const { data } = await listStorehouses(params) | ||
| 282 | + this.allocationStorehousesInfo.storehouses = data | ||
| 283 | + } catch (error) { | ||
| 284 | + console.error('获取仓库列表失败:', error) | ||
| 285 | + } | ||
| 286 | + }, | ||
| 287 | + async _listResourceStoreTypes() { | ||
| 288 | + try { | ||
| 289 | + const params = { | ||
| 290 | + page: 1, | ||
| 291 | + row: 100, | ||
| 292 | + communityId: this.communityId, | ||
| 293 | + parentId: '0' | ||
| 294 | + } | ||
| 295 | + const { data } = await listResourceStoreTypes(params) | ||
| 296 | + this.allocationStorehousesInfo.resourceStoreTypes = data | ||
| 297 | + } catch (error) { | ||
| 298 | + console.error('获取物品类型失败:', error) | ||
| 299 | + } | ||
| 300 | + }, | ||
| 301 | + async _listResourceStoreSonTypes() { | ||
| 302 | + try { | ||
| 303 | + this.allocationStorehousesInfo.conditions.rstId = '' | ||
| 304 | + this.allocationStorehousesInfo.resourceStoreSonTypes = [] | ||
| 305 | + | ||
| 306 | + if (!this.allocationStorehousesInfo.conditions.parentRstId) return | ||
| 307 | + | ||
| 308 | + const params = { | ||
| 309 | + page: 1, | ||
| 310 | + row: 100, | ||
| 311 | + communityId: this.communityId, | ||
| 312 | + parentId: this.allocationStorehousesInfo.conditions.parentRstId | ||
| 313 | + } | ||
| 314 | + const { data } = await listResourceStoreTypes(params) | ||
| 315 | + this.allocationStorehousesInfo.resourceStoreSonTypes = data | ||
| 316 | + } catch (error) { | ||
| 317 | + console.error('获取二级分类失败:', error) | ||
| 318 | + } | ||
| 319 | + }, | ||
| 320 | + async _listResourceStoreSpecifications() { | ||
| 321 | + try { | ||
| 322 | + this.allocationStorehousesInfo.resourceStoreSpecifications = [] | ||
| 323 | + this.allocationStorehousesInfo.conditions.rssId = '' | ||
| 324 | + | ||
| 325 | + if (!this.allocationStorehousesInfo.conditions.rstId) return | ||
| 326 | + | ||
| 327 | + const params = { | ||
| 328 | + page: 1, | ||
| 329 | + row: 100, | ||
| 330 | + communityId: this.communityId, | ||
| 331 | + rstId: this.allocationStorehousesInfo.conditions.rstId | ||
| 332 | + } | ||
| 333 | + const { data } = await listResourceStoreSpecifications(params) | ||
| 334 | + this.allocationStorehousesInfo.resourceStoreSpecifications = data | ||
| 335 | + } catch (error) { | ||
| 336 | + console.error('获取物品规格失败:', error) | ||
| 337 | + } | ||
| 338 | + }, | ||
| 339 | + _queryAllocationStorehouseMethod() { | ||
| 340 | + this.page.current = 1 | ||
| 341 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 342 | + }, | ||
| 343 | + _resetAllocationStorehouseMethod() { | ||
| 344 | + this.allocationStorehousesInfo.conditions = { | ||
| 345 | + ...this.allocationStorehousesInfo.conditions, | ||
| 346 | + applyId: "", | ||
| 347 | + shIda: "", | ||
| 348 | + shIdz: "", | ||
| 349 | + startUserId: "", | ||
| 350 | + resId: "", | ||
| 351 | + resName: "", | ||
| 352 | + parentRstId: "", | ||
| 353 | + rstId: "", | ||
| 354 | + rssId: "", | ||
| 355 | + state: "", | ||
| 356 | + applyType: "", | ||
| 357 | + startTime: "", | ||
| 358 | + endTime: "" | ||
| 359 | + } | ||
| 360 | + this.allocationStorehousesInfo.resourceStoreSonTypes = [] | ||
| 361 | + this.allocationStorehousesInfo.resourceStoreSpecifications = [] | ||
| 362 | + this.page.current = 1 | ||
| 363 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 364 | + }, | ||
| 365 | + _moreCondition() { | ||
| 366 | + this.allocationStorehousesInfo.moreCondition = !this.allocationStorehousesInfo.moreCondition | ||
| 367 | + }, | ||
| 368 | + async _exportExcel() { | ||
| 369 | + try { | ||
| 370 | + const params = { | ||
| 371 | + ...this.allocationStorehousesInfo.conditions, | ||
| 372 | + pagePath: 'allocationStorehouseDetailed' | ||
| 373 | + } | ||
| 374 | + await exportData(params) | ||
| 375 | + this.$message.success(this.$t('allocationStorehouseDetailed.exportSuccess')) | ||
| 376 | + // 这里可以添加跳转到下载页面的逻辑 | ||
| 377 | + } catch (error) { | ||
| 378 | + this.$message.error(this.$t('allocationStorehouseDetailed.exportError')) | ||
| 379 | + } | ||
| 380 | + }, | ||
| 381 | + swatchApplyType(item) { | ||
| 382 | + this.allocationStorehousesInfo.conditions.applyType = item.statusCd | ||
| 383 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 384 | + }, | ||
| 385 | + handleSizeChange(val) { | ||
| 386 | + this.page.size = val | ||
| 387 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 388 | + }, | ||
| 389 | + handleCurrentChange(val) { | ||
| 390 | + this.page.current = val | ||
| 391 | + this._listAllocationStores(this.page.current, this.page.size) | ||
| 392 | + } | ||
| 393 | + } | ||
| 394 | +} | ||
| 395 | +</script> | ||
| 396 | + | ||
| 397 | +<style scoped> | ||
| 398 | +.padding-r-0 { | ||
| 399 | + padding-right: 0 !important; | ||
| 400 | +} | ||
| 401 | + | ||
| 402 | +.border-radius { | ||
| 403 | + border-radius: 4px; | ||
| 404 | +} | ||
| 405 | + | ||
| 406 | +.margin-xs-r { | ||
| 407 | + margin-right: 5px; | ||
| 408 | +} | ||
| 409 | + | ||
| 410 | +.list-group { | ||
| 411 | + padding-left: 0; | ||
| 412 | + margin-bottom: 0; | ||
| 413 | +} | ||
| 414 | + | ||
| 415 | +.list-group-item { | ||
| 416 | + position: relative; | ||
| 417 | + display: block; | ||
| 418 | + padding: 10px 15px; | ||
| 419 | + margin-bottom: -1px; | ||
| 420 | + background-color: #fff; | ||
| 421 | + border: 1px solid #ddd; | ||
| 422 | + cursor: pointer; | ||
| 423 | +} | ||
| 424 | + | ||
| 425 | +.list-group-item:hover { | ||
| 426 | + background-color: #f5f5f5; | ||
| 427 | +} | ||
| 428 | + | ||
| 429 | +.vc-node-selected { | ||
| 430 | + background-color: #409EFF; | ||
| 431 | + color: #fff; | ||
| 432 | +} | ||
| 433 | +</style> | ||
| 0 | \ No newline at end of file | 434 | \ No newline at end of file |
src/views/resource/allocationStorehouseManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationStorehouseManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + startUserName: 'Please enter applicant name', | ||
| 7 | + applyType: 'Please select type', | ||
| 8 | + startTime: 'Please select allocation start time', | ||
| 9 | + endTime: 'Please select allocation end time' | ||
| 10 | + }, | ||
| 11 | + list: { | ||
| 12 | + title: 'Allocation Records', | ||
| 13 | + allocation: 'Allocation' | ||
| 14 | + }, | ||
| 15 | + table: { | ||
| 16 | + applyId: 'No.', | ||
| 17 | + applyCount: 'Allocation/Return', | ||
| 18 | + startUserName: 'Applicant', | ||
| 19 | + stateName: 'Status', | ||
| 20 | + applyTypeName: 'Type', | ||
| 21 | + createTime: 'Time' | ||
| 22 | + }, | ||
| 23 | + operation: { | ||
| 24 | + cancel: 'Cancel Allocation', | ||
| 25 | + detail: 'Detail', | ||
| 26 | + flowChart: 'Flow Chart' | ||
| 27 | + } | ||
| 28 | + }, | ||
| 29 | + allocationStorehouse: { | ||
| 30 | + title: 'Apply Allocation', | ||
| 31 | + sourceWarehouse: 'Source Warehouse', | ||
| 32 | + targetWarehouse: 'Target Warehouse', | ||
| 33 | + itemName: 'Item Name', | ||
| 34 | + stock: 'Stock', | ||
| 35 | + allocationCount: 'Allocation Count', | ||
| 36 | + remark: 'Remark', | ||
| 37 | + requiredSourceWarehouse: 'Required, please select source warehouse', | ||
| 38 | + requiredTargetWarehouse: 'Required, please select target warehouse', | ||
| 39 | + requiredItemName: 'Required, please enter item name', | ||
| 40 | + requiredStock: 'Required, please enter stock', | ||
| 41 | + requiredAllocationCount: 'Required, please enter allocation count', | ||
| 42 | + requiredRemark: 'Required, please enter remark', | ||
| 43 | + positiveNumber: 'Must be positive integer', | ||
| 44 | + remarkTooLong: 'Remark is too long' | ||
| 45 | + }, | ||
| 46 | + deleteStorehouseManage: { | ||
| 47 | + title: 'Please confirm your operation', | ||
| 48 | + confirmCancel: 'Confirm to cancel allocation?', | ||
| 49 | + cancel: 'Cancel', | ||
| 50 | + confirm: 'Confirm', | ||
| 51 | + deleteError: 'Failed to cancel allocation' | ||
| 52 | + } | ||
| 53 | + }, | ||
| 54 | + zh: { | ||
| 55 | + allocationStorehouseManage: { | ||
| 56 | + search: { | ||
| 57 | + title: '查询条件', | ||
| 58 | + startUserName: '请输入申请人姓名', | ||
| 59 | + applyType: '请选择类型', | ||
| 60 | + startTime: '请选择调拨开始时间', | ||
| 61 | + endTime: '请选择调拨结束时间' | ||
| 62 | + }, | ||
| 63 | + list: { | ||
| 64 | + title: '调拨记录', | ||
| 65 | + allocation: '调拨' | ||
| 66 | + }, | ||
| 67 | + table: { | ||
| 68 | + applyId: '编号', | ||
| 69 | + applyCount: '调拨/退还', | ||
| 70 | + startUserName: '申请人', | ||
| 71 | + stateName: '状态', | ||
| 72 | + applyTypeName: '类型', | ||
| 73 | + createTime: '时间' | ||
| 74 | + }, | ||
| 75 | + operation: { | ||
| 76 | + cancel: '取消调拨', | ||
| 77 | + detail: '详情', | ||
| 78 | + flowChart: '流程图' | ||
| 79 | + } | ||
| 80 | + }, | ||
| 81 | + allocationStorehouse: { | ||
| 82 | + title: '申请调拨', | ||
| 83 | + sourceWarehouse: '源仓库', | ||
| 84 | + targetWarehouse: '目标仓库', | ||
| 85 | + itemName: '物品名称', | ||
| 86 | + stock: '库存', | ||
| 87 | + allocationCount: '调拨数量', | ||
| 88 | + remark: '备注', | ||
| 89 | + requiredSourceWarehouse: '必填,请选择源仓库', | ||
| 90 | + requiredTargetWarehouse: '必填,请选择目标仓库', | ||
| 91 | + requiredItemName: '必填,请填写物品名称', | ||
| 92 | + requiredStock: '必填,请填写库存', | ||
| 93 | + requiredAllocationCount: '必填,请填写调拨数量', | ||
| 94 | + requiredRemark: '必填,请填写备注', | ||
| 95 | + positiveNumber: '必须为正整数', | ||
| 96 | + remarkTooLong: '备注太长' | ||
| 97 | + }, | ||
| 98 | + deleteStorehouseManage: { | ||
| 99 | + title: '请确认您的操作', | ||
| 100 | + confirmCancel: '确定取消调拨?', | ||
| 101 | + cancel: '点错了', | ||
| 102 | + confirm: '确认取消', | ||
| 103 | + deleteError: '取消调拨失败' | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | +} | ||
| 0 | \ No newline at end of file | 107 | \ No newline at end of file |
src/views/resource/allocationStorehouseManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight ecommerce"> | ||
| 3 | + <el-row> | ||
| 4 | + <el-col :span="4" class="padding-r-0"> | ||
| 5 | + <div class="border-radius"> | ||
| 6 | + <div class="margin-xs-r treeview attendance-staff"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li class="list-group-item node-orgTree" v-for="(item, index) in states" :key="index" | ||
| 9 | + @click="swatchState(item)" :class="{ 'vc-node-selected': conditions.state == item.statusCd }"> | ||
| 10 | + {{ item.name }} | ||
| 11 | + </li> | ||
| 12 | + </ul> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + </el-col> | ||
| 16 | + <el-col :span="20"> | ||
| 17 | + <el-card class="box-card"> | ||
| 18 | + <div slot="header" class="flex justify-between"> | ||
| 19 | + <span>{{ $t('allocationStorehouseManage.search.title') }}</span> | ||
| 20 | + </div> | ||
| 21 | + <el-row :gutter="20"> | ||
| 22 | + <el-col :span="4"> | ||
| 23 | + <el-input v-model.trim="conditions.startUserName" | ||
| 24 | + :placeholder="$t('allocationStorehouseManage.search.startUserName')" clearable /> | ||
| 25 | + </el-col> | ||
| 26 | + <el-col :span="4"> | ||
| 27 | + <el-select v-model="conditions.applyType" :placeholder="$t('allocationStorehouseManage.search.applyType')" | ||
| 28 | + style="width:100%"> | ||
| 29 | + <el-option v-for="(item, index) in applyTypes" :key="index" :label="item.name" :value="item.statusCd" /> | ||
| 30 | + </el-select> | ||
| 31 | + </el-col> | ||
| 32 | + <el-col :span="4"> | ||
| 33 | + <el-date-picker v-model="conditions.startTime" type="datetime" | ||
| 34 | + :placeholder="$t('allocationStorehouseManage.search.startTime')" style="width:100%" /> | ||
| 35 | + </el-col> | ||
| 36 | + <el-col :span="4"> | ||
| 37 | + <el-date-picker v-model="conditions.endTime" type="datetime" | ||
| 38 | + :placeholder="$t('allocationStorehouseManage.search.endTime')" style="width:100%" /> | ||
| 39 | + </el-col> | ||
| 40 | + <el-col :span="4"> | ||
| 41 | + <el-button type="primary" @click="_queryAllocationStorehouseMethod"> | ||
| 42 | + <i class="el-icon-search"></i> | ||
| 43 | + {{ $t('common.search') }} | ||
| 44 | + </el-button> | ||
| 45 | + <el-button @click="_resetAllocationStorehouseMethod"> | ||
| 46 | + <i class="el-icon-refresh"></i> | ||
| 47 | + {{ $t('common.reset') }} | ||
| 48 | + </el-button> | ||
| 49 | + </el-col> | ||
| 50 | + </el-row> | ||
| 51 | + </el-card> | ||
| 52 | + | ||
| 53 | + <el-card class="box-card margin-top"> | ||
| 54 | + <div slot="header" class="flex justify-between"> | ||
| 55 | + <span>{{ $t('allocationStorehouseManage.list.title') }}</span> | ||
| 56 | + <div style="float: right;"> | ||
| 57 | + <el-button type="primary" size="small" @click="_openAllocationStorehouseApplyModal"> | ||
| 58 | + <i class="el-icon-plus"></i> | ||
| 59 | + {{ $t('allocationStorehouseManage.list.allocation') }} | ||
| 60 | + </el-button> | ||
| 61 | + <el-button type="primary" size="small" @click="_exportExcel"> | ||
| 62 | + <i class="el-icon-download"></i> | ||
| 63 | + {{ $t('common.export') }} | ||
| 64 | + </el-button> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + <el-table :data="resourceStores" border style="width: 100%" v-loading="loading"> | ||
| 68 | + <el-table-column prop="applyId" :label="$t('allocationStorehouseManage.table.applyId')" align="center" /> | ||
| 69 | + <el-table-column prop="applyCount" :label="$t('allocationStorehouseManage.table.applyCount')" | ||
| 70 | + align="center" /> | ||
| 71 | + <el-table-column prop="startUserName" :label="$t('allocationStorehouseManage.table.startUserName')" | ||
| 72 | + align="center" /> | ||
| 73 | + <el-table-column prop="stateName" :label="$t('allocationStorehouseManage.table.stateName')" align="center" /> | ||
| 74 | + <el-table-column prop="applyTypeName" :label="$t('allocationStorehouseManage.table.applyTypeName')" | ||
| 75 | + align="center" /> | ||
| 76 | + <el-table-column prop="createTime" :label="$t('allocationStorehouseManage.table.createTime')" | ||
| 77 | + align="center" /> | ||
| 78 | + <el-table-column :label="$t('common.operation')" align="center" width="200"> | ||
| 79 | + <template slot-scope="scope"> | ||
| 80 | + <el-button v-if="scope.row.state == '1200' && currentUserId == scope.row.startUserId" type="text" | ||
| 81 | + size="small" @click="_openDeleteResourceStoreModel(scope.row)"> | ||
| 82 | + {{ $t('allocationStorehouseManage.operation.cancel') }} | ||
| 83 | + </el-button> | ||
| 84 | + <el-button type="text" size="small" @click="_toDetail(scope.row)"> | ||
| 85 | + {{ $t('common.detail') }} | ||
| 86 | + </el-button> | ||
| 87 | + <el-button v-if="scope.row.applyType == '10000'" type="text" size="small" | ||
| 88 | + @click="_openRunWorkflowImage(scope.row)"> | ||
| 89 | + {{ $t('allocationStorehouseManage.operation.flowChart') }} | ||
| 90 | + </el-button> | ||
| 91 | + </template> | ||
| 92 | + </el-table-column> | ||
| 93 | + </el-table> | ||
| 94 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 95 | + :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 96 | + layout="total, sizes, prev, pager, next, jumper" :total="page.total" class="pagination" /> | ||
| 97 | + </el-card> | ||
| 98 | + </el-col> | ||
| 99 | + </el-row> | ||
| 100 | + | ||
| 101 | + <view-image ref="viewImage" /> | ||
| 102 | + <allocation-storehouse ref="allocationStorehouse" /> | ||
| 103 | + <delete-storehouse-manage ref="deleteStorehouseManage" /> | ||
| 104 | + </div> | ||
| 105 | +</template> | ||
| 106 | + | ||
| 107 | +<script> | ||
| 108 | +import { getDict, getCommunityId } from '@/api/community/communityApi' | ||
| 109 | +import { listAllocationStorehouseApplys, listStorehouses, exportData ,listRunWorkflowImage} from '@/api/resource/allocationStorehouseManageApi' | ||
| 110 | +import ViewImage from '@/components/system/viewImage' | ||
| 111 | +import AllocationStorehouse from '@/components/resource/allocationStorehouse' | ||
| 112 | +import DeleteStorehouseManage from '@/components/resource/deleteStorehouseManage' | ||
| 113 | +import { getUserId } from '@/api/user/userApi' | ||
| 114 | + | ||
| 115 | +export default { | ||
| 116 | + name: 'AllocationStorehouseManageList', | ||
| 117 | + components: { | ||
| 118 | + ViewImage, | ||
| 119 | + AllocationStorehouse, | ||
| 120 | + DeleteStorehouseManage | ||
| 121 | + }, | ||
| 122 | + data() { | ||
| 123 | + return { | ||
| 124 | + loading: false, | ||
| 125 | + resourceStores: [], | ||
| 126 | + states: [], | ||
| 127 | + applyTypes: [], | ||
| 128 | + currentUserId: '', | ||
| 129 | + conditions: { | ||
| 130 | + applyId: '', | ||
| 131 | + resId: '', | ||
| 132 | + resName: '', | ||
| 133 | + resCode: '', | ||
| 134 | + shIda: '', | ||
| 135 | + shIdz: '', | ||
| 136 | + startTime: '', | ||
| 137 | + endTime: '', | ||
| 138 | + startUserId: '', | ||
| 139 | + startUserName: '', | ||
| 140 | + state: '', | ||
| 141 | + applyType: '', | ||
| 142 | + userId: '', | ||
| 143 | + communityId: '' | ||
| 144 | + }, | ||
| 145 | + storehouses: [], | ||
| 146 | + page: { | ||
| 147 | + current: 1, | ||
| 148 | + size: 10, | ||
| 149 | + total: 0 | ||
| 150 | + } | ||
| 151 | + } | ||
| 152 | + }, | ||
| 153 | + created() { | ||
| 154 | + this.currentUserId = getUserId() | ||
| 155 | + this.conditions.userId = this.currentUserId | ||
| 156 | + this.conditions.communityId = getCommunityId() | ||
| 157 | + this.initData() | ||
| 158 | + }, | ||
| 159 | + methods: { | ||
| 160 | + async initData() { | ||
| 161 | + try { | ||
| 162 | + // 获取字典数据 | ||
| 163 | + const [states, applyTypes] = await Promise.all([ | ||
| 164 | + getDict('allocation_storehouse_apply', 'state'), | ||
| 165 | + getDict('allocation_storehouse_apply', 'apply_type') | ||
| 166 | + ]) | ||
| 167 | + | ||
| 168 | + this.states = [{ statusCd: '', name: this.$t('common.all') }, ...states] | ||
| 169 | + this.applyTypes = applyTypes | ||
| 170 | + | ||
| 171 | + // 获取仓库列表 | ||
| 172 | + const storehouseRes = await listStorehouses({ | ||
| 173 | + page: 1, | ||
| 174 | + row: 100, | ||
| 175 | + communityId: this.conditions.communityId | ||
| 176 | + }) | ||
| 177 | + this.storehouses = storehouseRes.data | ||
| 178 | + | ||
| 179 | + // 获取调拨记录 | ||
| 180 | + this._listAllocationStorehouses() | ||
| 181 | + } catch (error) { | ||
| 182 | + console.error('初始化数据失败:', error) | ||
| 183 | + } | ||
| 184 | + }, | ||
| 185 | + async _listAllocationStorehouses() { | ||
| 186 | + try { | ||
| 187 | + this.loading = true | ||
| 188 | + const params = { | ||
| 189 | + ...this.conditions, | ||
| 190 | + page: this.page.current, | ||
| 191 | + row: this.page.size | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + const res = await listAllocationStorehouseApplys(params) | ||
| 195 | + this.resourceStores = res.data | ||
| 196 | + this.page.total = res.total | ||
| 197 | + } catch (error) { | ||
| 198 | + console.error('获取调拨记录失败:', error) | ||
| 199 | + } finally { | ||
| 200 | + this.loading = false | ||
| 201 | + } | ||
| 202 | + }, | ||
| 203 | + _queryAllocationStorehouseMethod() { | ||
| 204 | + this.page.current = 1 | ||
| 205 | + this._listAllocationStorehouses() | ||
| 206 | + }, | ||
| 207 | + _resetAllocationStorehouseMethod() { | ||
| 208 | + this.conditions = { | ||
| 209 | + applyId: '', | ||
| 210 | + resId: '', | ||
| 211 | + resName: '', | ||
| 212 | + resCode: '', | ||
| 213 | + shIda: '', | ||
| 214 | + shIdz: '', | ||
| 215 | + startTime: '', | ||
| 216 | + endTime: '', | ||
| 217 | + startUserId: '', | ||
| 218 | + startUserName: '', | ||
| 219 | + state: '', | ||
| 220 | + applyType: '', | ||
| 221 | + userId: this.currentUserId, | ||
| 222 | + communityId: this.conditions.communityId | ||
| 223 | + } | ||
| 224 | + this._listAllocationStorehouses() | ||
| 225 | + }, | ||
| 226 | + _openDeleteResourceStoreModel(row) { | ||
| 227 | + this.$refs.deleteStorehouseManage.open(row) | ||
| 228 | + }, | ||
| 229 | + _toDetail(item) { | ||
| 230 | + this.$router.push({ | ||
| 231 | + path: '/pages/common/allocationStorehouseDetail', | ||
| 232 | + query: { | ||
| 233 | + applyId: item.applyId, | ||
| 234 | + applyType: item.applyType, | ||
| 235 | + applyTypeName: item.applyTypeName | ||
| 236 | + } | ||
| 237 | + }) | ||
| 238 | + }, | ||
| 239 | + _openAllocationStorehouseApplyModal() { | ||
| 240 | + this.$router.push('/pages/common/allocationStorehouseApply') | ||
| 241 | + }, | ||
| 242 | + async _openRunWorkflowImage(purchaseApply) { | ||
| 243 | + try { | ||
| 244 | + const res = await listRunWorkflowImage({ | ||
| 245 | + communityId: this.conditions.communityId, | ||
| 246 | + businessKey: purchaseApply.applyId | ||
| 247 | + }) | ||
| 248 | + | ||
| 249 | + if (res.code !== '0') { | ||
| 250 | + this.$message.error(res.msg) | ||
| 251 | + return | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + this.$refs.viewImage.open({ | ||
| 255 | + url: 'data:image/png;base64,' + res.data | ||
| 256 | + }) | ||
| 257 | + } catch (error) { | ||
| 258 | + console.error('获取流程图失败:', error) | ||
| 259 | + } | ||
| 260 | + }, | ||
| 261 | + async _exportExcel() { | ||
| 262 | + try { | ||
| 263 | + const params = { | ||
| 264 | + ...this.conditions, | ||
| 265 | + pagePath: 'allocationStorehouseManage' | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + const res = await exportData(params) | ||
| 269 | + this.$message.success(res.msg) | ||
| 270 | + | ||
| 271 | + if (res.code === 0) { | ||
| 272 | + this.$router.push({ | ||
| 273 | + path: '/pages/property/downloadTempFile', | ||
| 274 | + query: { tab: this.$t('common.downloadCenter') } | ||
| 275 | + }) | ||
| 276 | + } | ||
| 277 | + } catch (error) { | ||
| 278 | + console.error('导出失败:', error) | ||
| 279 | + } | ||
| 280 | + }, | ||
| 281 | + swatchState(item) { | ||
| 282 | + this.conditions.state = item.statusCd | ||
| 283 | + this._listAllocationStorehouses() | ||
| 284 | + }, | ||
| 285 | + handleSizeChange(val) { | ||
| 286 | + this.page.size = val | ||
| 287 | + this._listAllocationStorehouses() | ||
| 288 | + }, | ||
| 289 | + handleCurrentChange(val) { | ||
| 290 | + this.page.current = val | ||
| 291 | + this._listAllocationStorehouses() | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | +} | ||
| 295 | +</script> | ||
| 296 | + | ||
| 297 | +<style lang="scss" scoped> | ||
| 298 | +.ecommerce { | ||
| 299 | + padding: 20px; | ||
| 300 | +} | ||
| 301 | + | ||
| 302 | +.padding-r-0 { | ||
| 303 | + padding-right: 0 !important; | ||
| 304 | +} | ||
| 305 | + | ||
| 306 | +.border-radius { | ||
| 307 | + border-radius: 4px; | ||
| 308 | +} | ||
| 309 | + | ||
| 310 | +.margin-xs-r { | ||
| 311 | + margin-right: 5px; | ||
| 312 | +} | ||
| 313 | + | ||
| 314 | +.treeview { | ||
| 315 | + background: #fff; | ||
| 316 | + border: 1px solid #e6e6e6; | ||
| 317 | + padding: 10px; | ||
| 318 | +} | ||
| 319 | + | ||
| 320 | +.list-group { | ||
| 321 | + padding-left: 0; | ||
| 322 | + margin-bottom: 0; | ||
| 323 | + | ||
| 324 | + &-item { | ||
| 325 | + position: relative; | ||
| 326 | + display: block; | ||
| 327 | + padding: 10px 15px; | ||
| 328 | + margin-bottom: -1px; | ||
| 329 | + background-color: #fff; | ||
| 330 | + border: 1px solid #e6e6e6; | ||
| 331 | + cursor: pointer; | ||
| 332 | + | ||
| 333 | + &:hover { | ||
| 334 | + background-color: #f5f5f5; | ||
| 335 | + } | ||
| 336 | + } | ||
| 337 | +} | ||
| 338 | + | ||
| 339 | +.node-orgTree { | ||
| 340 | + &.vc-node-selected { | ||
| 341 | + background-color: #409EFF; | ||
| 342 | + color: #fff; | ||
| 343 | + } | ||
| 344 | +} | ||
| 345 | + | ||
| 346 | +.text-center { | ||
| 347 | + text-align: center; | ||
| 348 | +} | ||
| 349 | + | ||
| 350 | +.margin-top { | ||
| 351 | + margin-top: 20px; | ||
| 352 | +} | ||
| 353 | + | ||
| 354 | +.pagination { | ||
| 355 | + margin-top: 20px; | ||
| 356 | + text-align: right; | ||
| 357 | +} | ||
| 358 | +</style> | ||
| 0 | \ No newline at end of file | 359 | \ No newline at end of file |
src/views/resource/allocationUserStorehouseManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationUserStorehouseManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + ausId: 'Please enter allocation ID', | ||
| 7 | + resId: 'Please enter resource ID', | ||
| 8 | + resName: 'Please enter resource name', | ||
| 9 | + parentRstId: 'Please select resource type', | ||
| 10 | + rstId: 'Please select secondary category', | ||
| 11 | + rssId: 'Please select specification', | ||
| 12 | + startUserId: 'Please enter donor ID', | ||
| 13 | + startUserName: 'Please enter donor name', | ||
| 14 | + acceptUserId: 'Please enter recipient ID', | ||
| 15 | + acceptUserName: 'Please enter recipient name', | ||
| 16 | + startTime: 'Please select start time', | ||
| 17 | + endTime: 'Please select end time' | ||
| 18 | + }, | ||
| 19 | + list: { | ||
| 20 | + title: 'Allocation Records' | ||
| 21 | + }, | ||
| 22 | + table: { | ||
| 23 | + ausId: 'Allocation ID', | ||
| 24 | + resId: 'Resource ID', | ||
| 25 | + resType: 'Resource Type', | ||
| 26 | + resName: 'Resource Name', | ||
| 27 | + specName: 'Specification', | ||
| 28 | + isFixedName: 'Fixed Resource', | ||
| 29 | + startUserId: 'Donor ID', | ||
| 30 | + startUserName: 'Donor', | ||
| 31 | + acceptUserId: 'Recipient ID', | ||
| 32 | + acceptUserName: 'Recipient', | ||
| 33 | + stock: 'Original Stock', | ||
| 34 | + giveQuantity: 'Allocation Quantity', | ||
| 35 | + createTime: 'Create Time', | ||
| 36 | + remark: 'Remark' | ||
| 37 | + }, | ||
| 38 | + total: { | ||
| 39 | + subTotal: 'Subtotal', | ||
| 40 | + highTotal: 'Total', | ||
| 41 | + quantity: 'Total Quantity:' | ||
| 42 | + }, | ||
| 43 | + exportSuccess: 'Export started successfully', | ||
| 44 | + exportFailed: 'Export failed' | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + zh: { | ||
| 48 | + allocationUserStorehouseManage: { | ||
| 49 | + search: { | ||
| 50 | + title: '查询条件', | ||
| 51 | + ausId: '请输入转增ID', | ||
| 52 | + resId: '请输入物品资源ID', | ||
| 53 | + resName: '请输入物品名称', | ||
| 54 | + parentRstId: '请选择物品类型', | ||
| 55 | + rstId: '请选择二级分类', | ||
| 56 | + rssId: '请选择物品规格', | ||
| 57 | + startUserId: '请输入转增人ID', | ||
| 58 | + startUserName: '请输入转增人名称', | ||
| 59 | + acceptUserId: '请输入转增对象ID', | ||
| 60 | + acceptUserName: '请输入转增对象名称', | ||
| 61 | + startTime: '请选择开始时间', | ||
| 62 | + endTime: '请选择结束时间' | ||
| 63 | + }, | ||
| 64 | + list: { | ||
| 65 | + title: '转赠记录' | ||
| 66 | + }, | ||
| 67 | + table: { | ||
| 68 | + ausId: '转增ID', | ||
| 69 | + resId: '物品资源ID', | ||
| 70 | + resType: '物品类型', | ||
| 71 | + resName: '物品名称', | ||
| 72 | + specName: '物品规格', | ||
| 73 | + isFixedName: '固定物品', | ||
| 74 | + startUserId: '转赠人ID', | ||
| 75 | + startUserName: '转赠人', | ||
| 76 | + acceptUserId: '转赠对象ID', | ||
| 77 | + acceptUserName: '转赠对象', | ||
| 78 | + stock: '原有库存', | ||
| 79 | + giveQuantity: '转赠数量', | ||
| 80 | + createTime: '创建时间', | ||
| 81 | + remark: '备注' | ||
| 82 | + }, | ||
| 83 | + total: { | ||
| 84 | + subTotal: '小计', | ||
| 85 | + highTotal: '大计', | ||
| 86 | + quantity: '总数量:' | ||
| 87 | + }, | ||
| 88 | + exportSuccess: '导出开始成功', | ||
| 89 | + exportFailed: '导出失败' | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | +} | ||
| 0 | \ No newline at end of file | 93 | \ No newline at end of file |
src/views/resource/allocationUserStorehouseManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="allocation-user-storehouse-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('allocationUserStorehouseManage.search.title') }}</span> | ||
| 7 | + <el-button | ||
| 8 | + style="float: right; padding: 3px 0" | ||
| 9 | + type="text" | ||
| 10 | + @click="toggleMoreCondition" | ||
| 11 | + > | ||
| 12 | + {{ allocationUserStorehouseManageInfo.moreCondition ? $t('common.hide') : $t('common.more') }} | ||
| 13 | + </el-button> | ||
| 14 | + </div> | ||
| 15 | + <el-row :gutter="20"> | ||
| 16 | + <el-col :span="6"> | ||
| 17 | + <el-input | ||
| 18 | + v-model="allocationUserStorehouseManageInfo.conditions.ausId" | ||
| 19 | + :placeholder="$t('allocationUserStorehouseManage.search.ausId')" | ||
| 20 | + clearable | ||
| 21 | + /> | ||
| 22 | + </el-col> | ||
| 23 | + <el-col :span="6"> | ||
| 24 | + <el-input | ||
| 25 | + v-model="allocationUserStorehouseManageInfo.conditions.resId" | ||
| 26 | + :placeholder="$t('allocationUserStorehouseManage.search.resId')" | ||
| 27 | + clearable | ||
| 28 | + /> | ||
| 29 | + </el-col> | ||
| 30 | + <el-col :span="6"> | ||
| 31 | + <el-input | ||
| 32 | + v-model="allocationUserStorehouseManageInfo.conditions.resName" | ||
| 33 | + :placeholder="$t('allocationUserStorehouseManage.search.resName')" | ||
| 34 | + clearable | ||
| 35 | + /> | ||
| 36 | + </el-col> | ||
| 37 | + <el-col :span="6"> | ||
| 38 | + <el-button type="primary" @click="queryAllocationUserStorehouse"> | ||
| 39 | + <i class="el-icon-search"></i> | ||
| 40 | + {{ $t('common.search') }} | ||
| 41 | + </el-button> | ||
| 42 | + <el-button @click="resetAllocationUserStorehouse"> | ||
| 43 | + <i class="el-icon-refresh"></i> | ||
| 44 | + {{ $t('common.reset') }} | ||
| 45 | + </el-button> | ||
| 46 | + </el-col> | ||
| 47 | + </el-row> | ||
| 48 | + | ||
| 49 | + <!-- 更多查询条件 --> | ||
| 50 | + <el-row v-show="allocationUserStorehouseManageInfo.moreCondition" :gutter="20" style="margin-top: 20px;"> | ||
| 51 | + <el-col :span="6"> | ||
| 52 | + <el-select | ||
| 53 | + v-model="allocationUserStorehouseManageInfo.conditions.parentRstId" | ||
| 54 | + :placeholder="$t('allocationUserStorehouseManage.search.parentRstId')" | ||
| 55 | + style="width: 100%" | ||
| 56 | + @change="listResourceStoreSonTypes" | ||
| 57 | + > | ||
| 58 | + <el-option | ||
| 59 | + v-for="item in allocationUserStorehouseManageInfo.resourceStoreTypes" | ||
| 60 | + :key="item.rstId" | ||
| 61 | + :label="item.name" | ||
| 62 | + :value="item.rstId" | ||
| 63 | + /> | ||
| 64 | + </el-select> | ||
| 65 | + </el-col> | ||
| 66 | + <el-col :span="6"> | ||
| 67 | + <el-select | ||
| 68 | + v-model="allocationUserStorehouseManageInfo.conditions.rstId" | ||
| 69 | + :placeholder="$t('allocationUserStorehouseManage.search.rstId')" | ||
| 70 | + style="width: 100%" | ||
| 71 | + @change="listResourceStoreSpecifications" | ||
| 72 | + > | ||
| 73 | + <el-option | ||
| 74 | + v-for="item in allocationUserStorehouseManageInfo.resourceStoreSonTypes" | ||
| 75 | + :key="item.rstId" | ||
| 76 | + :label="item.name" | ||
| 77 | + :value="item.rstId" | ||
| 78 | + /> | ||
| 79 | + </el-select> | ||
| 80 | + </el-col> | ||
| 81 | + <el-col :span="6"> | ||
| 82 | + <el-select | ||
| 83 | + v-model="allocationUserStorehouseManageInfo.conditions.rssId" | ||
| 84 | + :placeholder="$t('allocationUserStorehouseManage.search.rssId')" | ||
| 85 | + style="width: 100%" | ||
| 86 | + > | ||
| 87 | + <el-option | ||
| 88 | + v-for="item in allocationUserStorehouseManageInfo.resourceStoreSpecifications" | ||
| 89 | + :key="item.rssId" | ||
| 90 | + :label="item.specName" | ||
| 91 | + :value="item.rssId" | ||
| 92 | + /> | ||
| 93 | + </el-select> | ||
| 94 | + </el-col> | ||
| 95 | + </el-row> | ||
| 96 | + | ||
| 97 | + <el-row v-show="allocationUserStorehouseManageInfo.moreCondition" :gutter="20" style="margin-top: 20px;"> | ||
| 98 | + <el-col :span="6"> | ||
| 99 | + <el-input | ||
| 100 | + v-model="allocationUserStorehouseManageInfo.conditions.startUserId" | ||
| 101 | + :placeholder="$t('allocationUserStorehouseManage.search.startUserId')" | ||
| 102 | + clearable | ||
| 103 | + /> | ||
| 104 | + </el-col> | ||
| 105 | + <el-col :span="6"> | ||
| 106 | + <el-input | ||
| 107 | + v-model="allocationUserStorehouseManageInfo.conditions.startUserName" | ||
| 108 | + :placeholder="$t('allocationUserStorehouseManage.search.startUserName')" | ||
| 109 | + clearable | ||
| 110 | + /> | ||
| 111 | + </el-col> | ||
| 112 | + <el-col :span="6"> | ||
| 113 | + <el-input | ||
| 114 | + v-model="allocationUserStorehouseManageInfo.conditions.acceptUserId" | ||
| 115 | + :placeholder="$t('allocationUserStorehouseManage.search.acceptUserId')" | ||
| 116 | + clearable | ||
| 117 | + /> | ||
| 118 | + </el-col> | ||
| 119 | + </el-row> | ||
| 120 | + | ||
| 121 | + <el-row v-show="allocationUserStorehouseManageInfo.moreCondition" :gutter="20" style="margin-top: 20px;"> | ||
| 122 | + <el-col :span="6"> | ||
| 123 | + <el-input | ||
| 124 | + v-model="allocationUserStorehouseManageInfo.conditions.acceptUserName" | ||
| 125 | + :placeholder="$t('allocationUserStorehouseManage.search.acceptUserName')" | ||
| 126 | + clearable | ||
| 127 | + /> | ||
| 128 | + </el-col> | ||
| 129 | + <el-col :span="6"> | ||
| 130 | + <el-date-picker | ||
| 131 | + v-model="allocationUserStorehouseManageInfo.conditions.startTime" | ||
| 132 | + type="datetime" | ||
| 133 | + :placeholder="$t('allocationUserStorehouseManage.search.startTime')" | ||
| 134 | + style="width: 100%" | ||
| 135 | + /> | ||
| 136 | + </el-col> | ||
| 137 | + <el-col :span="6"> | ||
| 138 | + <el-date-picker | ||
| 139 | + v-model="allocationUserStorehouseManageInfo.conditions.endTime" | ||
| 140 | + type="datetime" | ||
| 141 | + :placeholder="$t('allocationUserStorehouseManage.search.endTime')" | ||
| 142 | + style="width: 100%" | ||
| 143 | + /> | ||
| 144 | + </el-col> | ||
| 145 | + </el-row> | ||
| 146 | + </el-card> | ||
| 147 | + | ||
| 148 | + <!-- 转赠记录 --> | ||
| 149 | + <el-card class="list-wrapper" style="margin-top: 20px;"> | ||
| 150 | + <div slot="header" class="flex justify-between"> | ||
| 151 | + <span>{{ $t('allocationUserStorehouseManage.list.title') }}</span> | ||
| 152 | + <el-button | ||
| 153 | + style="float: right; padding: 3px 0" | ||
| 154 | + type="text" | ||
| 155 | + @click="exportExcel" | ||
| 156 | + > | ||
| 157 | + <i class="el-icon-download"></i> | ||
| 158 | + {{ $t('common.export') }} | ||
| 159 | + </el-button> | ||
| 160 | + </div> | ||
| 161 | + | ||
| 162 | + <el-table | ||
| 163 | + v-loading="loading" | ||
| 164 | + :data="allocationUserStorehouseManageInfo.allocationUserStorehouses" | ||
| 165 | + border | ||
| 166 | + style="width: 100%" | ||
| 167 | + > | ||
| 168 | + <el-table-column | ||
| 169 | + prop="ausId" | ||
| 170 | + :label="$t('allocationUserStorehouseManage.table.ausId')" | ||
| 171 | + align="center" | ||
| 172 | + /> | ||
| 173 | + <el-table-column | ||
| 174 | + prop="resId" | ||
| 175 | + :label="$t('allocationUserStorehouseManage.table.resId')" | ||
| 176 | + align="center" | ||
| 177 | + /> | ||
| 178 | + <el-table-column | ||
| 179 | + :label="$t('allocationUserStorehouseManage.table.resType')" | ||
| 180 | + align="center" | ||
| 181 | + > | ||
| 182 | + <template slot-scope="scope"> | ||
| 183 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 184 | + </template> | ||
| 185 | + </el-table-column> | ||
| 186 | + <el-table-column | ||
| 187 | + prop="resName" | ||
| 188 | + :label="$t('allocationUserStorehouseManage.table.resName')" | ||
| 189 | + align="center" | ||
| 190 | + /> | ||
| 191 | + <el-table-column | ||
| 192 | + :label="$t('allocationUserStorehouseManage.table.specName')" | ||
| 193 | + align="center" | ||
| 194 | + > | ||
| 195 | + <template slot-scope="scope"> | ||
| 196 | + {{ scope.row.specName || '-' }} | ||
| 197 | + </template> | ||
| 198 | + </el-table-column> | ||
| 199 | + <el-table-column | ||
| 200 | + prop="isFixedName" | ||
| 201 | + :label="$t('allocationUserStorehouseManage.table.isFixedName')" | ||
| 202 | + align="center" | ||
| 203 | + /> | ||
| 204 | + <el-table-column | ||
| 205 | + prop="startUserId" | ||
| 206 | + :label="$t('allocationUserStorehouseManage.table.startUserId')" | ||
| 207 | + align="center" | ||
| 208 | + /> | ||
| 209 | + <el-table-column | ||
| 210 | + prop="startUserName" | ||
| 211 | + :label="$t('allocationUserStorehouseManage.table.startUserName')" | ||
| 212 | + align="center" | ||
| 213 | + /> | ||
| 214 | + <el-table-column | ||
| 215 | + prop="acceptUserId" | ||
| 216 | + :label="$t('allocationUserStorehouseManage.table.acceptUserId')" | ||
| 217 | + align="center" | ||
| 218 | + /> | ||
| 219 | + <el-table-column | ||
| 220 | + prop="acceptUserName" | ||
| 221 | + :label="$t('allocationUserStorehouseManage.table.acceptUserName')" | ||
| 222 | + align="center" | ||
| 223 | + /> | ||
| 224 | + <el-table-column | ||
| 225 | + :label="$t('allocationUserStorehouseManage.table.stock')" | ||
| 226 | + align="center" | ||
| 227 | + > | ||
| 228 | + <template slot-scope="scope"> | ||
| 229 | + {{ scope.row.stock }}{{ scope.row.unitCodeName }} | ||
| 230 | + </template> | ||
| 231 | + </el-table-column> | ||
| 232 | + <el-table-column | ||
| 233 | + :label="$t('allocationUserStorehouseManage.table.giveQuantity')" | ||
| 234 | + align="center" | ||
| 235 | + > | ||
| 236 | + <template slot-scope="scope"> | ||
| 237 | + {{ scope.row.giveQuantity }}{{ scope.row.miniUnitCodeName }} | ||
| 238 | + </template> | ||
| 239 | + </el-table-column> | ||
| 240 | + <el-table-column | ||
| 241 | + prop="createTime" | ||
| 242 | + :label="$t('allocationUserStorehouseManage.table.createTime')" | ||
| 243 | + align="center" | ||
| 244 | + /> | ||
| 245 | + <el-table-column | ||
| 246 | + prop="remark" | ||
| 247 | + :label="$t('allocationUserStorehouseManage.table.remark')" | ||
| 248 | + align="center" | ||
| 249 | + /> | ||
| 250 | + </el-table> | ||
| 251 | + | ||
| 252 | + <!-- 分页 --> | ||
| 253 | + <div class="pagination-wrapper"> | ||
| 254 | + <el-row> | ||
| 255 | + <el-col :span="12"> | ||
| 256 | + <div class="total-info"> | ||
| 257 | + <span class="sub-total"> | ||
| 258 | + <b>{{ $t('allocationUserStorehouseManage.total.subTotal') }}</b> | ||
| 259 | + <span>{{ $t('allocationUserStorehouseManage.total.quantity') }}</span> | ||
| 260 | + {{ allocationUserStorehouseManageInfo.subTotalQuantity }} | ||
| 261 | + </span> | ||
| 262 | + <br> | ||
| 263 | + <span class="high-total"> | ||
| 264 | + <b>{{ $t('allocationUserStorehouseManage.total.highTotal') }}</b> | ||
| 265 | + <span>{{ $t('allocationUserStorehouseManage.total.quantity') }}</span> | ||
| 266 | + {{ allocationUserStorehouseManageInfo.highTotalQuantity }} | ||
| 267 | + </span> | ||
| 268 | + </div> | ||
| 269 | + </el-col> | ||
| 270 | + <el-col :span="12"> | ||
| 271 | + <el-pagination | ||
| 272 | + :current-page.sync="page.current" | ||
| 273 | + :page-sizes="[10, 20, 30, 50]" | ||
| 274 | + :page-size="page.size" | ||
| 275 | + :total="page.total" | ||
| 276 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 277 | + @size-change="handleSizeChange" | ||
| 278 | + @current-change="handleCurrentChange" | ||
| 279 | + /> | ||
| 280 | + </el-col> | ||
| 281 | + </el-row> | ||
| 282 | + </div> | ||
| 283 | + </el-card> | ||
| 284 | + </div> | ||
| 285 | +</template> | ||
| 286 | + | ||
| 287 | +<script> | ||
| 288 | +import { listAllocationUserStorehouses, listResourceStoreTypes, listResourceStoreSpecifications, exportData } from '@/api/resource/allocationUserStorehouseManageApi' | ||
| 289 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 290 | + | ||
| 291 | +export default { | ||
| 292 | + name: 'AllocationUserStorehouseManageList', | ||
| 293 | + data() { | ||
| 294 | + return { | ||
| 295 | + loading: false, | ||
| 296 | + communityId: '', | ||
| 297 | + allocationUserStorehouseManageInfo: { | ||
| 298 | + allocationUserStorehouses: [], | ||
| 299 | + total: 0, | ||
| 300 | + records: 1, | ||
| 301 | + moreCondition: false, | ||
| 302 | + subTotalQuantity: '0', | ||
| 303 | + highTotalQuantity: '0', | ||
| 304 | + conditions: { | ||
| 305 | + resId: '', | ||
| 306 | + resName: '', | ||
| 307 | + acceptUserId: '', | ||
| 308 | + acceptUserName: '', | ||
| 309 | + startUserId: '', | ||
| 310 | + startUserName: '', | ||
| 311 | + parentRstId: '', | ||
| 312 | + rstId: '', | ||
| 313 | + rssId: '', | ||
| 314 | + ausId: '', | ||
| 315 | + startTime: '', | ||
| 316 | + endTime: '', | ||
| 317 | + communityId: '' | ||
| 318 | + }, | ||
| 319 | + resourceStoreTypes: [], | ||
| 320 | + resourceStoreSonTypes: [], | ||
| 321 | + resourceStoreSpecifications: [] | ||
| 322 | + }, | ||
| 323 | + page: { | ||
| 324 | + current: 1, | ||
| 325 | + size: 10, | ||
| 326 | + total: 0 | ||
| 327 | + } | ||
| 328 | + } | ||
| 329 | + }, | ||
| 330 | + created() { | ||
| 331 | + this.communityId = getCommunityId() | ||
| 332 | + this.allocationUserStorehouseManageInfo.conditions.communityId = this.communityId | ||
| 333 | + this.initData() | ||
| 334 | + }, | ||
| 335 | + methods: { | ||
| 336 | + async initData() { | ||
| 337 | + await this.listAllocationUserStorehouses() | ||
| 338 | + await this.listResourceStoreTypes() | ||
| 339 | + }, | ||
| 340 | + async listAllocationUserStorehouses() { | ||
| 341 | + try { | ||
| 342 | + this.loading = true | ||
| 343 | + const params = { | ||
| 344 | + page: this.page.current, | ||
| 345 | + row: this.page.size, | ||
| 346 | + ...this.allocationUserStorehouseManageInfo.conditions | ||
| 347 | + } | ||
| 348 | + const { data, total } = await listAllocationUserStorehouses(params) | ||
| 349 | + this.allocationUserStorehouseManageInfo.allocationUserStorehouses = data | ||
| 350 | + this.page.total = total | ||
| 351 | + if (data.length > 0) { | ||
| 352 | + this.allocationUserStorehouseManageInfo.subTotalQuantity = data[0].subTotalQuantity || '0' | ||
| 353 | + this.allocationUserStorehouseManageInfo.highTotalQuantity = data[0].highTotalQuantity || '0' | ||
| 354 | + } else { | ||
| 355 | + this.allocationUserStorehouseManageInfo.subTotalQuantity = '0' | ||
| 356 | + this.allocationUserStorehouseManageInfo.highTotalQuantity = '0' | ||
| 357 | + } | ||
| 358 | + } catch (error) { | ||
| 359 | + console.error('Failed to fetch allocation user storehouses:', error) | ||
| 360 | + } finally { | ||
| 361 | + this.loading = false | ||
| 362 | + } | ||
| 363 | + }, | ||
| 364 | + async listResourceStoreTypes() { | ||
| 365 | + try { | ||
| 366 | + const params = { | ||
| 367 | + page: 1, | ||
| 368 | + row: 100, | ||
| 369 | + communityId: this.communityId, | ||
| 370 | + parentId: '0' | ||
| 371 | + } | ||
| 372 | + const { data } = await listResourceStoreTypes(params) | ||
| 373 | + this.allocationUserStorehouseManageInfo.resourceStoreTypes = data | ||
| 374 | + } catch (error) { | ||
| 375 | + console.error('Failed to fetch resource store types:', error) | ||
| 376 | + } | ||
| 377 | + }, | ||
| 378 | + async listResourceStoreSonTypes() { | ||
| 379 | + this.allocationUserStorehouseManageInfo.conditions.rstId = '' | ||
| 380 | + this.allocationUserStorehouseManageInfo.resourceStoreSonTypes = [] | ||
| 381 | + if (!this.allocationUserStorehouseManageInfo.conditions.parentRstId) return | ||
| 382 | + | ||
| 383 | + try { | ||
| 384 | + const params = { | ||
| 385 | + page: 1, | ||
| 386 | + row: 100, | ||
| 387 | + communityId: this.communityId, | ||
| 388 | + parentId: this.allocationUserStorehouseManageInfo.conditions.parentRstId | ||
| 389 | + } | ||
| 390 | + const { data } = await listResourceStoreTypes(params) | ||
| 391 | + this.allocationUserStorehouseManageInfo.resourceStoreSonTypes = data | ||
| 392 | + } catch (error) { | ||
| 393 | + console.error('Failed to fetch resource store son types:', error) | ||
| 394 | + } | ||
| 395 | + }, | ||
| 396 | + async listResourceStoreSpecifications() { | ||
| 397 | + this.allocationUserStorehouseManageInfo.resourceStoreSpecifications = [] | ||
| 398 | + this.allocationUserStorehouseManageInfo.conditions.rssId = '' | ||
| 399 | + if (!this.allocationUserStorehouseManageInfo.conditions.rstId) return | ||
| 400 | + | ||
| 401 | + try { | ||
| 402 | + const params = { | ||
| 403 | + page: 1, | ||
| 404 | + row: 100, | ||
| 405 | + communityId: this.communityId, | ||
| 406 | + rstId: this.allocationUserStorehouseManageInfo.conditions.rstId | ||
| 407 | + } | ||
| 408 | + const { data } = await listResourceStoreSpecifications(params) | ||
| 409 | + this.allocationUserStorehouseManageInfo.resourceStoreSpecifications = data | ||
| 410 | + } catch (error) { | ||
| 411 | + console.error('Failed to fetch resource store specifications:', error) | ||
| 412 | + } | ||
| 413 | + }, | ||
| 414 | + queryAllocationUserStorehouse() { | ||
| 415 | + this.page.current = 1 | ||
| 416 | + this.listAllocationUserStorehouses() | ||
| 417 | + }, | ||
| 418 | + resetAllocationUserStorehouse() { | ||
| 419 | + this.allocationUserStorehouseManageInfo.conditions = { | ||
| 420 | + resId: '', | ||
| 421 | + resName: '', | ||
| 422 | + acceptUserId: '', | ||
| 423 | + acceptUserName: '', | ||
| 424 | + startUserId: '', | ||
| 425 | + startUserName: '', | ||
| 426 | + parentRstId: '', | ||
| 427 | + rstId: '', | ||
| 428 | + rssId: '', | ||
| 429 | + ausId: '', | ||
| 430 | + startTime: '', | ||
| 431 | + endTime: '', | ||
| 432 | + communityId: this.communityId | ||
| 433 | + } | ||
| 434 | + this.allocationUserStorehouseManageInfo.resourceStoreSonTypes = [] | ||
| 435 | + this.allocationUserStorehouseManageInfo.resourceStoreSpecifications = [] | ||
| 436 | + this.page.current = 1 | ||
| 437 | + this.listAllocationUserStorehouses() | ||
| 438 | + }, | ||
| 439 | + toggleMoreCondition() { | ||
| 440 | + this.allocationUserStorehouseManageInfo.moreCondition = !this.allocationUserStorehouseManageInfo.moreCondition | ||
| 441 | + }, | ||
| 442 | + async exportExcel() { | ||
| 443 | + try { | ||
| 444 | + const params = { | ||
| 445 | + pagePath: 'allocationUserStorehouseManage', | ||
| 446 | + ...this.allocationUserStorehouseManageInfo.conditions | ||
| 447 | + } | ||
| 448 | + await exportData(params) | ||
| 449 | + this.$message.success(this.$t('allocationUserStorehouseManage.exportSuccess')) | ||
| 450 | + } catch (error) { | ||
| 451 | + console.error('Failed to export:', error) | ||
| 452 | + this.$message.error(this.$t('allocationUserStorehouseManage.exportFailed')) | ||
| 453 | + } | ||
| 454 | + }, | ||
| 455 | + handleSizeChange(val) { | ||
| 456 | + this.page.size = val | ||
| 457 | + this.listAllocationUserStorehouses() | ||
| 458 | + }, | ||
| 459 | + handleCurrentChange(val) { | ||
| 460 | + this.page.current = val | ||
| 461 | + this.listAllocationUserStorehouses() | ||
| 462 | + } | ||
| 463 | + } | ||
| 464 | +} | ||
| 465 | +</script> | ||
| 466 | + | ||
| 467 | +<style lang="scss" scoped> | ||
| 468 | +.allocation-user-storehouse-manage-container { | ||
| 469 | + padding: 20px; | ||
| 470 | + | ||
| 471 | + .search-wrapper { | ||
| 472 | + margin-bottom: 20px; | ||
| 473 | + | ||
| 474 | + .el-row { | ||
| 475 | + margin-bottom: 20px; | ||
| 476 | + } | ||
| 477 | + } | ||
| 478 | + | ||
| 479 | + .list-wrapper { | ||
| 480 | + .pagination-wrapper { | ||
| 481 | + margin-top: 20px; | ||
| 482 | + | ||
| 483 | + .total-info { | ||
| 484 | + padding: 10px 0; | ||
| 485 | + line-height: 2; | ||
| 486 | + | ||
| 487 | + .sub-total, .high-total { | ||
| 488 | + margin-right: 20px; | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + } | ||
| 492 | + } | ||
| 493 | +} | ||
| 494 | +</style> | ||
| 0 | \ No newline at end of file | 495 | \ No newline at end of file |
src/views/resource/assetInventoryManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + assetInventoryManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + staffName: 'Please enter inventory staff', | ||
| 7 | + state: 'Please select status', | ||
| 8 | + startTime: 'Please select start time', | ||
| 9 | + endTime: 'Please select end time' | ||
| 10 | + }, | ||
| 11 | + list: { | ||
| 12 | + title: 'Asset Inventory', | ||
| 13 | + inventory: 'Inventory', | ||
| 14 | + cancelApply: 'Cancel Application', | ||
| 15 | + audit: 'Audit' | ||
| 16 | + }, | ||
| 17 | + table: { | ||
| 18 | + aiId: 'Inventory No', | ||
| 19 | + name: 'Inventory Name', | ||
| 20 | + invTime: 'Inventory Time', | ||
| 21 | + shName: 'Inventory Warehouse', | ||
| 22 | + staffName: 'Inventory Staff', | ||
| 23 | + state: 'Status', | ||
| 24 | + createTime: 'Create Time' | ||
| 25 | + }, | ||
| 26 | + delete: { | ||
| 27 | + title: 'Confirm Operation', | ||
| 28 | + confirmText: 'Are you sure to delete this asset inventory?' | ||
| 29 | + }, | ||
| 30 | + cancel: { | ||
| 31 | + title: 'Confirm Operation', | ||
| 32 | + confirmText: 'Are you sure to cancel this asset inventory?', | ||
| 33 | + success: 'Cancel successfully', | ||
| 34 | + failed: 'Cancel failed' | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + zh: { | ||
| 39 | + assetInventoryManage: { | ||
| 40 | + search: { | ||
| 41 | + title: '查询条件', | ||
| 42 | + staffName: '请输入盘点人', | ||
| 43 | + state: '请选择状态', | ||
| 44 | + startTime: '请选择开始时间', | ||
| 45 | + endTime: '请选择结束时间' | ||
| 46 | + }, | ||
| 47 | + list: { | ||
| 48 | + title: '资产盘点', | ||
| 49 | + inventory: '盘点', | ||
| 50 | + cancelApply: '取消申请', | ||
| 51 | + audit: '审核' | ||
| 52 | + }, | ||
| 53 | + table: { | ||
| 54 | + aiId: '盘点单号', | ||
| 55 | + name: '盘点名称', | ||
| 56 | + invTime: '盘点时间', | ||
| 57 | + shName: '盘点仓库', | ||
| 58 | + staffName: '盘点人', | ||
| 59 | + state: '状态', | ||
| 60 | + createTime: '创建时间' | ||
| 61 | + }, | ||
| 62 | + delete: { | ||
| 63 | + title: '确认操作', | ||
| 64 | + confirmText: '确定删除资产盘点?' | ||
| 65 | + }, | ||
| 66 | + cancel: { | ||
| 67 | + title: '确认操作', | ||
| 68 | + confirmText: '确定取消该次资产盘点?', | ||
| 69 | + success: '取消成功', | ||
| 70 | + failed: '取消失败' | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | +} | ||
| 0 | \ No newline at end of file | 75 | \ No newline at end of file |
src/views/resource/assetInventoryManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="asset-inventory-manage-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="4" class=""> | ||
| 5 | + <el-card class="border-radius"> | ||
| 6 | + <div class=" treeview attendance-staff"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li v-for="(item, index) in assetInventoryManageInfo.storehouses" :key="index" | ||
| 9 | + class="list-group-item node-orgTree" | ||
| 10 | + :class="{ 'vc-node-selected': assetInventoryManageInfo.conditions.shId == item.shId }" | ||
| 11 | + @click="swatchStorehouse(item)"> | ||
| 12 | + {{ item.shName }} | ||
| 13 | + </li> | ||
| 14 | + </ul> | ||
| 15 | + </div> | ||
| 16 | + </el-card> | ||
| 17 | + </el-col> | ||
| 18 | + <el-col :span="20"> | ||
| 19 | + <el-row> | ||
| 20 | + <el-col :span="24"> | ||
| 21 | + <el-card> | ||
| 22 | + <div slot="header" class="flex justify-between"> | ||
| 23 | + <span>{{ $t('assetInventoryManage.search.title') }}</span> | ||
| 24 | + </div> | ||
| 25 | + <el-row :gutter="20"> | ||
| 26 | + <el-col :span="4"> | ||
| 27 | + <el-input v-model.trim="assetInventoryManageInfo.conditions.staffName" | ||
| 28 | + :placeholder="$t('assetInventoryManage.search.staffName')" clearable /> | ||
| 29 | + </el-col> | ||
| 30 | + <el-col :span="4"> | ||
| 31 | + <el-select v-model="assetInventoryManageInfo.conditions.state" | ||
| 32 | + :placeholder="$t('assetInventoryManage.search.state')" style="width:100%"> | ||
| 33 | + <el-option v-for="item in assetInventoryManageInfo.states" :key="item.statusCd" :label="item.name" | ||
| 34 | + :value="item.statusCd" /> | ||
| 35 | + </el-select> | ||
| 36 | + </el-col> | ||
| 37 | + <el-col :span="4"> | ||
| 38 | + <el-date-picker v-model="assetInventoryManageInfo.conditions.startTime" type="datetime" | ||
| 39 | + :placeholder="$t('assetInventoryManage.search.startTime')" style="width:100%" /> | ||
| 40 | + </el-col> | ||
| 41 | + <el-col :span="4"> | ||
| 42 | + <el-date-picker v-model="assetInventoryManageInfo.conditions.endTime" type="datetime" | ||
| 43 | + :placeholder="$t('assetInventoryManage.search.endTime')" style="width:100%" /> | ||
| 44 | + </el-col> | ||
| 45 | + <el-col :span="4"> | ||
| 46 | + <el-button type="primary" @click="_queryAssetInventoryMethod"> | ||
| 47 | + <i class="el-icon-search"></i> | ||
| 48 | + {{ $t('common.search') }} | ||
| 49 | + </el-button> | ||
| 50 | + <el-button @click="_resetAssetInventoryMethod"> | ||
| 51 | + <i class="el-icon-refresh"></i> | ||
| 52 | + {{ $t('common.reset') }} | ||
| 53 | + </el-button> | ||
| 54 | + </el-col> | ||
| 55 | + </el-row> | ||
| 56 | + </el-card> | ||
| 57 | + </el-col> | ||
| 58 | + </el-row> | ||
| 59 | + | ||
| 60 | + <el-row class="margin-top"> | ||
| 61 | + <el-col :span="24"> | ||
| 62 | + <el-card> | ||
| 63 | + <div slot="header" class="flex justify-between"> | ||
| 64 | + <span>{{ $t('assetInventoryManage.list.title') }}</span> | ||
| 65 | + <div style="float: right;"> | ||
| 66 | + <el-button type="primary" size="small" @click="_openAddAssetInventoryModal"> | ||
| 67 | + <i class="el-icon-plus"></i> | ||
| 68 | + {{ $t('assetInventoryManage.list.inventory') }} | ||
| 69 | + </el-button> | ||
| 70 | + <el-button type="primary" size="small" @click="_exportAssetInventoryManage"> | ||
| 71 | + <i class="el-icon-download"></i> | ||
| 72 | + {{ $t('common.export') }} | ||
| 73 | + </el-button> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + <el-table :data="assetInventoryManageInfo.assetInventorys" border style="width: 100%"> | ||
| 77 | + <el-table-column prop="aiId" :label="$t('assetInventoryManage.table.aiId')" align="center" /> | ||
| 78 | + <el-table-column prop="name" :label="$t('assetInventoryManage.table.name')" align="center" /> | ||
| 79 | + <el-table-column prop="invTime" :label="$t('assetInventoryManage.table.invTime')" align="center" /> | ||
| 80 | + <el-table-column prop="shName" :label="$t('assetInventoryManage.table.shName')" align="center" /> | ||
| 81 | + <el-table-column prop="staffName" :label="$t('assetInventoryManage.table.staffName')" align="center" /> | ||
| 82 | + <el-table-column prop="stateName" :label="$t('assetInventoryManage.table.state')" align="center" /> | ||
| 83 | + <el-table-column prop="createTime" :label="$t('assetInventoryManage.table.createTime')" align="center" /> | ||
| 84 | + <el-table-column :label="$t('common.operation')" align="center" width="300"> | ||
| 85 | + <template slot-scope="scope"> | ||
| 86 | + <el-button size="mini" @click="_openInStockAssetInventoryModel(scope.row)"> | ||
| 87 | + {{ $t('common.detail') }} | ||
| 88 | + </el-button> | ||
| 89 | + <el-button | ||
| 90 | + v-if="scope.row.state == '1000' && scope.row.staffId == assetInventoryManageInfo.curStaffId" | ||
| 91 | + size="mini" type="primary" @click="_openEditAssetInventoryModel(scope.row)"> | ||
| 92 | + {{ $t('common.edit') }} | ||
| 93 | + </el-button> | ||
| 94 | + <el-button | ||
| 95 | + v-if="scope.row.state == '2000' && scope.row.staffId == assetInventoryManageInfo.curStaffId" | ||
| 96 | + size="mini" type="warning" @click="_openCancelAssetInventoryModel(scope.row)"> | ||
| 97 | + {{ $t('assetInventoryManage.list.cancelApply') }} | ||
| 98 | + </el-button> | ||
| 99 | + <el-button v-if="scope.row.state == '2000'" size="mini" type="success" | ||
| 100 | + @click="_openAuditAssetInventoryModel(scope.row)"> | ||
| 101 | + {{ $t('assetInventoryManage.list.audit') }} | ||
| 102 | + </el-button> | ||
| 103 | + <el-button | ||
| 104 | + v-if="scope.row.state != '4000' && scope.row.staffId == assetInventoryManageInfo.curStaffId" | ||
| 105 | + size="mini" type="danger" @click="_openDeleteAssetInventoryModel(scope.row)"> | ||
| 106 | + {{ $t('common.delete') }} | ||
| 107 | + </el-button> | ||
| 108 | + </template> | ||
| 109 | + </el-table-column> | ||
| 110 | + </el-table> | ||
| 111 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 112 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 113 | + @current-change="handleCurrentChange" /> | ||
| 114 | + </el-card> | ||
| 115 | + </el-col> | ||
| 116 | + </el-row> | ||
| 117 | + </el-col> | ||
| 118 | + </el-row> | ||
| 119 | + | ||
| 120 | + <delete-asset-inventory ref="deleteAssetInventory" @success="handleSuccess" /> | ||
| 121 | + <cancel-asset-inventory ref="cancelAssetInventory" @success="handleSuccess" /> | ||
| 122 | + </div> | ||
| 123 | +</template> | ||
| 124 | + | ||
| 125 | +<script> | ||
| 126 | +import { getDict } from '@/api/community/communityApi' | ||
| 127 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 128 | +import { listAssetInventory, exportAssetInventory, listStorehouses } from '@/api/resource/assetInventoryManageApi' | ||
| 129 | +import DeleteAssetInventory from '@/components/resource/deleteAssetInventory' | ||
| 130 | +import CancelAssetInventory from '@/components/resource/cancelAssetInventory' | ||
| 131 | +import {getUserId} from '@/api/user/userApi' | ||
| 132 | + | ||
| 133 | +export default { | ||
| 134 | + name: 'AssetInventoryManageList', | ||
| 135 | + components: { | ||
| 136 | + DeleteAssetInventory, | ||
| 137 | + CancelAssetInventory | ||
| 138 | + }, | ||
| 139 | + data() { | ||
| 140 | + return { | ||
| 141 | + assetInventoryManageInfo: { | ||
| 142 | + assetInventorys: [], | ||
| 143 | + storehouses: [], | ||
| 144 | + total: 0, | ||
| 145 | + records: 1, | ||
| 146 | + moreCondition: false, | ||
| 147 | + aiId: '', | ||
| 148 | + states: [], | ||
| 149 | + conditions: { | ||
| 150 | + shId: '', | ||
| 151 | + staffName: '', | ||
| 152 | + state: '', | ||
| 153 | + startTime: '', | ||
| 154 | + endTime: '', | ||
| 155 | + communityId: '' | ||
| 156 | + }, | ||
| 157 | + curStaffId: '' | ||
| 158 | + }, | ||
| 159 | + page: { | ||
| 160 | + current: 1, | ||
| 161 | + size: 10, | ||
| 162 | + total: 0 | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + }, | ||
| 166 | + created() { | ||
| 167 | + this.initData() | ||
| 168 | + }, | ||
| 169 | + methods: { | ||
| 170 | + async initData() { | ||
| 171 | + this.assetInventoryManageInfo.curStaffId = getUserId() | ||
| 172 | + this.assetInventoryManageInfo.conditions.communityId = await getCommunityId() | ||
| 173 | + this._listShopHouses() | ||
| 174 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 175 | + this.getDictData() | ||
| 176 | + }, | ||
| 177 | + async getDictData() { | ||
| 178 | + try { | ||
| 179 | + const data = await getDict('asset_inventory', 'state') | ||
| 180 | + this.assetInventoryManageInfo.states = data | ||
| 181 | + } catch (error) { | ||
| 182 | + console.error('获取字典数据失败:', error) | ||
| 183 | + } | ||
| 184 | + }, | ||
| 185 | + async _listAssetInventorys(page, size) { | ||
| 186 | + try { | ||
| 187 | + const params = { | ||
| 188 | + page: page, | ||
| 189 | + row: size, | ||
| 190 | + ...this.assetInventoryManageInfo.conditions | ||
| 191 | + } | ||
| 192 | + const { data, total } = await listAssetInventory(params) | ||
| 193 | + this.assetInventoryManageInfo.assetInventorys = data | ||
| 194 | + this.page.total = total | ||
| 195 | + } catch (error) { | ||
| 196 | + console.error('获取资产盘点列表失败:', error) | ||
| 197 | + } | ||
| 198 | + }, | ||
| 199 | + async _listShopHouses() { | ||
| 200 | + try { | ||
| 201 | + const params = { | ||
| 202 | + page: 1, | ||
| 203 | + row: 100, | ||
| 204 | + communityId: this.assetInventoryManageInfo.conditions.communityId | ||
| 205 | + } | ||
| 206 | + const { data } = await listStorehouses(params) | ||
| 207 | + this.assetInventoryManageInfo.storehouses = [ | ||
| 208 | + { shName: this.$t('common.all'), shId: '' }, | ||
| 209 | + ...data | ||
| 210 | + ] | ||
| 211 | + } catch (error) { | ||
| 212 | + console.error('获取仓库列表失败:', error) | ||
| 213 | + } | ||
| 214 | + }, | ||
| 215 | + _openAddAssetInventoryModal() { | ||
| 216 | + this.$router.push('/pages/property/assetInventoryIn') | ||
| 217 | + }, | ||
| 218 | + _openEditAssetInventoryModel(assetInventory) { | ||
| 219 | + this.$router.push(`/pages/property/assetInventoryEdit?aiId=${assetInventory.aiId}`) | ||
| 220 | + }, | ||
| 221 | + _openAuditAssetInventoryModel(assetInventory) { | ||
| 222 | + this.$router.push(`/pages/property/assetInventoryAudit?aiId=${assetInventory.aiId}`) | ||
| 223 | + }, | ||
| 224 | + _openInStockAssetInventoryModel(assetInventory) { | ||
| 225 | + this.$router.push(`/pages/property/assetInventoryInStock?aiId=${assetInventory.aiId}`) | ||
| 226 | + }, | ||
| 227 | + _openDeleteAssetInventoryModel(assetInventory) { | ||
| 228 | + this.$refs.deleteAssetInventory.open(assetInventory) | ||
| 229 | + }, | ||
| 230 | + _openCancelAssetInventoryModel(assetInventory) { | ||
| 231 | + this.$refs.cancelAssetInventory.open(assetInventory) | ||
| 232 | + }, | ||
| 233 | + _queryAssetInventoryMethod() { | ||
| 234 | + this.page.current = 1 | ||
| 235 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 236 | + }, | ||
| 237 | + _resetAssetInventoryMethod() { | ||
| 238 | + this.assetInventoryManageInfo.conditions = { | ||
| 239 | + shId: '', | ||
| 240 | + staffName: '', | ||
| 241 | + state: '', | ||
| 242 | + startTime: '', | ||
| 243 | + endTime: '', | ||
| 244 | + communityId: this.assetInventoryManageInfo.conditions.communityId | ||
| 245 | + } | ||
| 246 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 247 | + }, | ||
| 248 | + async _exportAssetInventoryManage() { | ||
| 249 | + try { | ||
| 250 | + const params = { | ||
| 251 | + ...this.assetInventoryManageInfo.conditions, | ||
| 252 | + pagePath: 'assetInventoryManage' | ||
| 253 | + } | ||
| 254 | + await exportAssetInventory(params) | ||
| 255 | + this.$message.success(this.$t('common.exportSuccess')) | ||
| 256 | + this.$router.push('/pages/property/downloadTempFile?tab=下载中心') | ||
| 257 | + } catch (error) { | ||
| 258 | + console.error('导出失败:', error) | ||
| 259 | + this.$message.error(this.$t('common.exportFailed')) | ||
| 260 | + } | ||
| 261 | + }, | ||
| 262 | + swatchStorehouse(item) { | ||
| 263 | + this.assetInventoryManageInfo.conditions.shId = item.shId | ||
| 264 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 265 | + }, | ||
| 266 | + handleSizeChange(val) { | ||
| 267 | + this.page.size = val | ||
| 268 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 269 | + }, | ||
| 270 | + handleCurrentChange(val) { | ||
| 271 | + this.page.current = val | ||
| 272 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 273 | + }, | ||
| 274 | + handleSuccess() { | ||
| 275 | + this._listAssetInventorys(this.page.current, this.page.size) | ||
| 276 | + } | ||
| 277 | + } | ||
| 278 | +} | ||
| 279 | +</script> | ||
| 280 | + | ||
| 281 | +<style lang="scss" scoped> | ||
| 282 | +.asset-inventory-manage-container { | ||
| 283 | + padding: 20px; | ||
| 284 | + | ||
| 285 | + .border-radius { | ||
| 286 | + border-radius: 4px; | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + .margin-xs-r { | ||
| 290 | + margin-right: 5px; | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + .padding-r-0 { | ||
| 294 | + padding-right: 0; | ||
| 295 | + } | ||
| 296 | + | ||
| 297 | + .list-group { | ||
| 298 | + list-style: none; | ||
| 299 | + padding: 0; | ||
| 300 | + | ||
| 301 | + .list-group-item { | ||
| 302 | + padding: 10px 15px; | ||
| 303 | + margin-bottom: -1px; | ||
| 304 | + background-color: #fff; | ||
| 305 | + border: 1px solid #ddd; | ||
| 306 | + cursor: pointer; | ||
| 307 | + | ||
| 308 | + &:hover { | ||
| 309 | + background-color: #f5f5f5; | ||
| 310 | + } | ||
| 311 | + | ||
| 312 | + &.vc-node-selected { | ||
| 313 | + background-color: #409EFF; | ||
| 314 | + color: #fff; | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + } | ||
| 318 | +} | ||
| 319 | +</style> | ||
| 0 | \ No newline at end of file | 320 | \ No newline at end of file |
src/views/resource/itemOutManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + itemOutManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + applyOrderId: 'Please enter order number', | ||
| 7 | + applyUserName: 'Please enter applicant name', | ||
| 8 | + resName: 'Please enter item name', | ||
| 9 | + startTime: 'Please select start time', | ||
| 10 | + endTime: 'Please select end time' | ||
| 11 | + }, | ||
| 12 | + list: { | ||
| 13 | + title: 'Item Outbound Management', | ||
| 14 | + apply: 'Apply for Outbound' | ||
| 15 | + }, | ||
| 16 | + table: { | ||
| 17 | + applyOrderId: 'Order Number', | ||
| 18 | + resourceNames: 'Item', | ||
| 19 | + userName: 'Applicant', | ||
| 20 | + createUserName: 'Operator', | ||
| 21 | + createTime: 'Application Time', | ||
| 22 | + stateName: 'Status', | ||
| 23 | + warehousingWay: 'Outbound Method', | ||
| 24 | + directOut: 'Direct Outbound', | ||
| 25 | + auditOut: 'Audit Outbound', | ||
| 26 | + flowChart: 'Flow Chart', | ||
| 27 | + cancelApply: 'Cancel Application', | ||
| 28 | + operation: 'Operation' | ||
| 29 | + } | ||
| 30 | + }, | ||
| 31 | + deleteItemOut: { | ||
| 32 | + title: 'Confirm Operation', | ||
| 33 | + confirmText: 'Are you sure to cancel the outbound application?', | ||
| 34 | + deleteSuccess: 'Cancel outbound application successfully', | ||
| 35 | + cancelText: 'Cancel', | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + zh: { | ||
| 39 | + itemOutManage: { | ||
| 40 | + search: { | ||
| 41 | + title: '查询条件', | ||
| 42 | + applyOrderId: '请输入单号', | ||
| 43 | + applyUserName: '请填写申请人姓名', | ||
| 44 | + resName: '请填写物品名称', | ||
| 45 | + startTime: '请选择开始时间', | ||
| 46 | + endTime: '请选择结束时间' | ||
| 47 | + }, | ||
| 48 | + list: { | ||
| 49 | + title: '物品领用管理', | ||
| 50 | + apply: '领用申请' | ||
| 51 | + }, | ||
| 52 | + table: { | ||
| 53 | + applyOrderId: '单号', | ||
| 54 | + resourceNames: '物品', | ||
| 55 | + userName: '申请人', | ||
| 56 | + createUserName: '操作人', | ||
| 57 | + createTime: '申请时间', | ||
| 58 | + stateName: '状态', | ||
| 59 | + warehousingWay: '领用方式', | ||
| 60 | + directOut: '直接出库', | ||
| 61 | + auditOut: '审核出库', | ||
| 62 | + flowChart: '流程图', | ||
| 63 | + cancelApply: '取消领用', | ||
| 64 | + operation: '操作' | ||
| 65 | + } | ||
| 66 | + }, | ||
| 67 | + deleteItemOut: { | ||
| 68 | + title: '确认操作', | ||
| 69 | + confirmText: '确定取消领用吗?', | ||
| 70 | + deleteSuccess: '取消领用成功', | ||
| 71 | + cancelText: '点错了', | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | +} | ||
| 0 | \ No newline at end of file | 75 | \ No newline at end of file |
src/views/resource/itemOutManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="item-out-manage-container"> | ||
| 3 | + <el-row class="wrapper"> | ||
| 4 | + <el-col :span="4" class="padding-r-0"> | ||
| 5 | + <div class="border-radius"> | ||
| 6 | + <div class="margin-xs-r treeview attendance-staff"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li v-for="(item, index) in itemOutManageInfo.states" :key="index" class="list-group-item node-orgTree" | ||
| 9 | + :class="{ 'vc-node-selected': itemOutManageInfo.conditions.state === item.statusCd }" | ||
| 10 | + @click="swatchState(item)"> | ||
| 11 | + {{ item.name }} | ||
| 12 | + </li> | ||
| 13 | + </ul> | ||
| 14 | + </div> | ||
| 15 | + </div> | ||
| 16 | + </el-col> | ||
| 17 | + <el-col :span="20"> | ||
| 18 | + <el-card class="box-card"> | ||
| 19 | + <div slot="header" class="flex justify-between"> | ||
| 20 | + <span>{{ $t('itemOutManage.search.title') }}</span> | ||
| 21 | + </div> | ||
| 22 | + <el-row :gutter="20"> | ||
| 23 | + <el-col :span="4"> | ||
| 24 | + <el-input v-model.trim="itemOutManageInfo.conditions.applyOrderId" | ||
| 25 | + :placeholder="$t('itemOutManage.search.applyOrderId')" clearable /> | ||
| 26 | + </el-col> | ||
| 27 | + <el-col :span="4"> | ||
| 28 | + <el-input v-model.trim="itemOutManageInfo.conditions.applyUserName" | ||
| 29 | + :placeholder="$t('itemOutManage.search.applyUserName')" clearable /> | ||
| 30 | + </el-col> | ||
| 31 | + <el-col :span="4"> | ||
| 32 | + <el-input v-model.trim="itemOutManageInfo.conditions.resName" | ||
| 33 | + :placeholder="$t('itemOutManage.search.resName')" clearable /> | ||
| 34 | + </el-col> | ||
| 35 | + <el-col :span="4"> | ||
| 36 | + <el-date-picker v-model="itemOutManageInfo.conditions.startTime" type="datetime" | ||
| 37 | + :placeholder="$t('itemOutManage.search.startTime')" style="width: 100%" /> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="4"> | ||
| 40 | + <el-date-picker v-model="itemOutManageInfo.conditions.endTime" type="datetime" | ||
| 41 | + :placeholder="$t('itemOutManage.search.endTime')" style="width: 100%" | ||
| 42 | + :disabled="!itemOutManageInfo.conditions.startTime" :picker-options="endDateOptions" /> | ||
| 43 | + </el-col> | ||
| 44 | + <el-col :span="4"> | ||
| 45 | + <el-button type="primary" @click="_queryInspectionPlanMethod"> | ||
| 46 | + <i class="el-icon-search"></i> | ||
| 47 | + {{ $t('common.search') }} | ||
| 48 | + </el-button> | ||
| 49 | + <el-button @click="_resetInspectionPlanMethod"> | ||
| 50 | + <i class="el-icon-refresh"></i> | ||
| 51 | + {{ $t('common.reset') }} | ||
| 52 | + </el-button> | ||
| 53 | + </el-col> | ||
| 54 | + </el-row> | ||
| 55 | + </el-card> | ||
| 56 | + | ||
| 57 | + <el-card class="box-card margin-top"> | ||
| 58 | + <div slot="header" class="flex justify-between"> | ||
| 59 | + <span>{{ $t('itemOutManage.list.title') }}</span> | ||
| 60 | + <div style="float: right"> | ||
| 61 | + <el-button type="primary" size="small" @click="_openAddItemOutModal"> | ||
| 62 | + <i class="el-icon-plus"></i> | ||
| 63 | + {{ $t('itemOutManage.list.apply') }} | ||
| 64 | + </el-button> | ||
| 65 | + <el-button type="primary" size="small" @click="_exportExcel"> | ||
| 66 | + <i class="el-icon-download"></i> | ||
| 67 | + {{ $t('common.export') }} | ||
| 68 | + </el-button> | ||
| 69 | + </div> | ||
| 70 | + </div> | ||
| 71 | + <el-table :data="itemOutManageInfo.itemOuts" border style="width: 100%" v-loading="loading"> | ||
| 72 | + <el-table-column prop="applyOrderId" :label="$t('itemOutManage.table.applyOrderId')" align="center" /> | ||
| 73 | + <el-table-column prop="resourceNames" :label="$t('itemOutManage.table.resourceNames')" align="center" /> | ||
| 74 | + <el-table-column prop="userName" :label="$t('itemOutManage.table.userName')" align="center" /> | ||
| 75 | + <el-table-column prop="createUserName" :label="$t('itemOutManage.table.createUserName')" align="center" /> | ||
| 76 | + <el-table-column prop="createTime" :label="$t('itemOutManage.table.createTime')" align="center" /> | ||
| 77 | + <el-table-column prop="stateName" :label="$t('itemOutManage.table.stateName')" align="center" /> | ||
| 78 | + <el-table-column :label="$t('itemOutManage.table.warehousingWay')" align="center"> | ||
| 79 | + <template slot-scope="scope"> | ||
| 80 | + {{ scope.row.warehousingWay === 10000 ? $t('itemOutManage.table.directOut') : | ||
| 81 | + $t('itemOutManage.table.auditOut') }} | ||
| 82 | + </template> | ||
| 83 | + </el-table-column> | ||
| 84 | + <el-table-column :label="$t('common.operation')" align="center" width="220"> | ||
| 85 | + <template slot-scope="scope"> | ||
| 86 | + <el-button size="mini" @click="_openDetailItemOutModel(scope.row)"> | ||
| 87 | + {{ $t('common.view') }} | ||
| 88 | + </el-button> | ||
| 89 | + <el-button v-if="scope.row.warehousingWay !== 10000" size="mini" | ||
| 90 | + @click="_openRunWorkflowImage(scope.row)"> | ||
| 91 | + {{ $t('itemOutManage.table.flowChart') }} | ||
| 92 | + </el-button> | ||
| 93 | + <el-button v-if="scope.row.state === '1000' && itemOutManageInfo.currentUserId === scope.row.createUserId" | ||
| 94 | + size="mini" type="danger" @click="_openDeleteItemOutModel(scope.row)"> | ||
| 95 | + {{ $t('itemOutManage.table.cancelApply') }} | ||
| 96 | + </el-button> | ||
| 97 | + </template> | ||
| 98 | + </el-table-column> | ||
| 99 | + </el-table> | ||
| 100 | + <el-pagination class="pagination" :current-page.sync="pagination.currentPage" :page-sizes="[10, 20, 30, 50]" | ||
| 101 | + :page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" | ||
| 102 | + @size-change="handleSizeChange" @current-change="handleCurrentChange" /> | ||
| 103 | + </el-card> | ||
| 104 | + </el-col> | ||
| 105 | + </el-row> | ||
| 106 | + | ||
| 107 | + <delete-item-out ref="deleteItemOut" @success="handleSuccess" /> | ||
| 108 | + <view-image ref="viewImage" /> | ||
| 109 | + </div> | ||
| 110 | +</template> | ||
| 111 | + | ||
| 112 | +<script> | ||
| 113 | +import { listPurchaseApplys, exportData,listRunWorkflowImage } from '@/api/resource/itemOutManageApi' | ||
| 114 | +import { getDict } from '@/api/community/communityApi' | ||
| 115 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 116 | +import DeleteItemOut from '@/components/resource/deleteItemOut' | ||
| 117 | +import ViewImage from '@/components/system/viewImage' | ||
| 118 | +import {getUserId} from '@/api/user/userApi' | ||
| 119 | + | ||
| 120 | +export default { | ||
| 121 | + name: 'ItemOutManageList', | ||
| 122 | + components: { | ||
| 123 | + DeleteItemOut, | ||
| 124 | + ViewImage | ||
| 125 | + }, | ||
| 126 | + data() { | ||
| 127 | + return { | ||
| 128 | + loading: false, | ||
| 129 | + itemOutManageInfo: { | ||
| 130 | + itemOuts: [], | ||
| 131 | + states: [], | ||
| 132 | + currentUserId: '', | ||
| 133 | + conditions: { | ||
| 134 | + applyOrderId: '', | ||
| 135 | + state: '', | ||
| 136 | + applyUserName: '', | ||
| 137 | + resOrderType: '20000', | ||
| 138 | + resName: '', | ||
| 139 | + startTime: '', | ||
| 140 | + endTime: '', | ||
| 141 | + communityId: '' | ||
| 142 | + } | ||
| 143 | + }, | ||
| 144 | + pagination: { | ||
| 145 | + currentPage: 1, | ||
| 146 | + pageSize: 10, | ||
| 147 | + total: 0 | ||
| 148 | + }, | ||
| 149 | + endDateOptions: { | ||
| 150 | + disabledDate: (time) => { | ||
| 151 | + if (this.itemOutManageInfo.conditions.startTime) { | ||
| 152 | + return time.getTime() < new Date(this.itemOutManageInfo.conditions.startTime).getTime() | ||
| 153 | + } | ||
| 154 | + return false | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + created() { | ||
| 160 | + this.itemOutManageInfo.currentUserId = getUserId() | ||
| 161 | + this.itemOutManageInfo.conditions.communityId = getCommunityId() | ||
| 162 | + this.initData() | ||
| 163 | + }, | ||
| 164 | + methods: { | ||
| 165 | + async initData() { | ||
| 166 | + await this.getDictData() | ||
| 167 | + this._listItemOuts() | ||
| 168 | + }, | ||
| 169 | + async getDictData() { | ||
| 170 | + try { | ||
| 171 | + const data = await getDict('purchase_apply', 'state') | ||
| 172 | + this.itemOutManageInfo.states = [{ statusCd: '', name: this.$t('common.all') }, ...data] | ||
| 173 | + } catch (error) { | ||
| 174 | + console.error('获取字典数据失败:', error) | ||
| 175 | + } | ||
| 176 | + }, | ||
| 177 | + async _listItemOuts() { | ||
| 178 | + this.loading = true | ||
| 179 | + try { | ||
| 180 | + const params = { | ||
| 181 | + page: this.pagination.currentPage, | ||
| 182 | + row: this.pagination.pageSize, | ||
| 183 | + ...this.itemOutManageInfo.conditions | ||
| 184 | + } | ||
| 185 | + const { data, total } = await listPurchaseApplys(params) | ||
| 186 | + this.itemOutManageInfo.itemOuts = data | ||
| 187 | + this.pagination.total = total | ||
| 188 | + } catch (error) { | ||
| 189 | + console.error('获取数据失败:', error) | ||
| 190 | + } finally { | ||
| 191 | + this.loading = false | ||
| 192 | + } | ||
| 193 | + }, | ||
| 194 | + _openAddItemOutModal() { | ||
| 195 | + this.$router.push({ | ||
| 196 | + path: '/views/resource/addItemOut', | ||
| 197 | + query: { resOrderType: this.itemOutManageInfo.conditions.resOrderType } | ||
| 198 | + }) | ||
| 199 | + }, | ||
| 200 | + _openDetailItemOutModel(itemOut) { | ||
| 201 | + this.$router.push({ | ||
| 202 | + path: '/resource/purchaseApplyDetail', | ||
| 203 | + query: { | ||
| 204 | + applyOrderId: itemOut.applyOrderId, | ||
| 205 | + resOrderType: this.itemOutManageInfo.conditions.resOrderType | ||
| 206 | + } | ||
| 207 | + }) | ||
| 208 | + }, | ||
| 209 | + _openDeleteItemOutModel(itemOut) { | ||
| 210 | + this.$refs.deleteItemOut.open(itemOut) | ||
| 211 | + }, | ||
| 212 | + _queryInspectionPlanMethod() { | ||
| 213 | + this.pagination.currentPage = 1 | ||
| 214 | + this._listItemOuts() | ||
| 215 | + }, | ||
| 216 | + _resetInspectionPlanMethod() { | ||
| 217 | + this.itemOutManageInfo.conditions = { | ||
| 218 | + applyOrderId: '', | ||
| 219 | + state: '', | ||
| 220 | + applyUserName: '', | ||
| 221 | + resOrderType: '20000', | ||
| 222 | + resName: '', | ||
| 223 | + startTime: '', | ||
| 224 | + endTime: '', | ||
| 225 | + communityId: getCommunityId() | ||
| 226 | + } | ||
| 227 | + this.pagination.currentPage = 1 | ||
| 228 | + this._listItemOuts() | ||
| 229 | + }, | ||
| 230 | + async _openRunWorkflowImage(itemOut) { | ||
| 231 | + try { | ||
| 232 | + const params = { | ||
| 233 | + businessKey: itemOut.applyOrderId, | ||
| 234 | + communityId: getCommunityId() | ||
| 235 | + } | ||
| 236 | + const { data } = await listRunWorkflowImage(params) | ||
| 237 | + this.$refs.viewImage.open({ url: 'data:image/png;base64,' + data }) | ||
| 238 | + } catch (error) { | ||
| 239 | + console.error('获取流程图失败:', error) | ||
| 240 | + } | ||
| 241 | + }, | ||
| 242 | + async _exportExcel() { | ||
| 243 | + try { | ||
| 244 | + const params = { | ||
| 245 | + ...this.itemOutManageInfo.conditions, | ||
| 246 | + pagePath: 'itemOutManage' | ||
| 247 | + } | ||
| 248 | + await exportData(params) | ||
| 249 | + this.$message.success(this.$t('common.exportSuccess')) | ||
| 250 | + this.$router.push('/resource/downloadTempFile?tab=downloadCenter') | ||
| 251 | + } catch (error) { | ||
| 252 | + console.error('导出失败:', error) | ||
| 253 | + } | ||
| 254 | + }, | ||
| 255 | + swatchState(item) { | ||
| 256 | + this.itemOutManageInfo.conditions.state = item.statusCd | ||
| 257 | + this._listItemOuts() | ||
| 258 | + }, | ||
| 259 | + handleSuccess() { | ||
| 260 | + this._listItemOuts() | ||
| 261 | + }, | ||
| 262 | + handleSizeChange(val) { | ||
| 263 | + this.pagination.pageSize = val | ||
| 264 | + this._listItemOuts() | ||
| 265 | + }, | ||
| 266 | + handleCurrentChange(val) { | ||
| 267 | + this.pagination.currentPage = val | ||
| 268 | + this._listItemOuts() | ||
| 269 | + } | ||
| 270 | + } | ||
| 271 | +} | ||
| 272 | +</script> | ||
| 273 | + | ||
| 274 | +<style lang="scss" scoped> | ||
| 275 | +.item-out-manage-container { | ||
| 276 | + padding: 20px; | ||
| 277 | + | ||
| 278 | + .wrapper { | ||
| 279 | + width: 100%; | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + .border-radius { | ||
| 283 | + border-radius: 4px; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + .margin-xs-r { | ||
| 287 | + margin-right: 5px; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + .list-group { | ||
| 291 | + padding: 0; | ||
| 292 | + margin: 0; | ||
| 293 | + list-style: none; | ||
| 294 | + | ||
| 295 | + .list-group-item { | ||
| 296 | + padding: 10px 15px; | ||
| 297 | + margin-bottom: -1px; | ||
| 298 | + background-color: #fff; | ||
| 299 | + border: 1px solid #ddd; | ||
| 300 | + cursor: pointer; | ||
| 301 | + | ||
| 302 | + &:hover { | ||
| 303 | + background-color: #f5f5f5; | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + &.vc-node-selected { | ||
| 307 | + background-color: #409eff; | ||
| 308 | + color: #fff; | ||
| 309 | + } | ||
| 310 | + } | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + .margin-top { | ||
| 314 | + margin-top: 20px; | ||
| 315 | + } | ||
| 316 | + | ||
| 317 | + .pagination { | ||
| 318 | + margin-top: 20px; | ||
| 319 | + text-align: right; | ||
| 320 | + } | ||
| 321 | +} | ||
| 322 | +</style> | ||
| 0 | \ No newline at end of file | 323 | \ No newline at end of file |
src/views/resource/myResourceStoreManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + myResourceStoreManage: { | ||
| 4 | + queryCondition: 'Query Conditions', | ||
| 5 | + hide: 'Hide', | ||
| 6 | + more: 'More', | ||
| 7 | + enterResId: 'Please enter resource ID', | ||
| 8 | + enterResName: 'Please enter resource name', | ||
| 9 | + enterResCode: 'Please enter resource code', | ||
| 10 | + search: 'Search', | ||
| 11 | + reset: 'Reset', | ||
| 12 | + selectResType: 'Please select resource type', | ||
| 13 | + selectSecondType: 'Please select secondary type', | ||
| 14 | + selectResSpec: 'Please select resource specification', | ||
| 15 | + enterUserId: 'Please enter user ID', | ||
| 16 | + enterUserName: 'Please enter user name', | ||
| 17 | + selectIsFixed: 'Please select fixed status', | ||
| 18 | + myResources: 'My Resources', | ||
| 19 | + return: 'Return', | ||
| 20 | + transfer: 'Transfer', | ||
| 21 | + scrap: 'Scrap', | ||
| 22 | + export: 'Export', | ||
| 23 | + userId: 'User ID', | ||
| 24 | + userName: 'User Name', | ||
| 25 | + resId: 'Resource ID', | ||
| 26 | + resType: 'Resource Type', | ||
| 27 | + resName: 'Resource Name', | ||
| 28 | + resSpec: 'Resource Specification', | ||
| 29 | + resCode: 'Resource Code', | ||
| 30 | + isFixed: 'Is Fixed', | ||
| 31 | + stock: 'Stock', | ||
| 32 | + miniStock: 'Minimum Stock', | ||
| 33 | + miniUnit: 'Minimum Unit', | ||
| 34 | + price: 'Price' | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + zh: { | ||
| 38 | + myResourceStoreManage: { | ||
| 39 | + queryCondition: '查询条件', | ||
| 40 | + hide: '隐藏', | ||
| 41 | + more: '更多', | ||
| 42 | + enterResId: '请输入物品ID', | ||
| 43 | + enterResName: '请输入物品名称', | ||
| 44 | + enterResCode: '请输入物品编码', | ||
| 45 | + search: '查询', | ||
| 46 | + reset: '重置', | ||
| 47 | + selectResType: '请选择物品类型', | ||
| 48 | + selectSecondType: '请选择二级分类', | ||
| 49 | + selectResSpec: '请选择物品规格', | ||
| 50 | + enterUserId: '请输入用户ID', | ||
| 51 | + enterUserName: '请输入用户名称', | ||
| 52 | + selectIsFixed: '请选择物品是否固定', | ||
| 53 | + myResources: '我的物品', | ||
| 54 | + return: '退还', | ||
| 55 | + transfer: '转赠', | ||
| 56 | + scrap: '损耗', | ||
| 57 | + export: '导出', | ||
| 58 | + userId: '用户ID', | ||
| 59 | + userName: '用户名', | ||
| 60 | + resId: '物品ID', | ||
| 61 | + resType: '物品类型', | ||
| 62 | + resName: '物品名称', | ||
| 63 | + resSpec: '物品规格', | ||
| 64 | + resCode: '物品编码', | ||
| 65 | + isFixed: '是否是固定物品', | ||
| 66 | + stock: '物品库存', | ||
| 67 | + miniStock: '最小计量总数', | ||
| 68 | + miniUnit: '最小计量', | ||
| 69 | + price: '收费标准' | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | +} | ||
| 0 | \ No newline at end of file | 73 | \ No newline at end of file |
src/views/resource/myResourceStoreManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight padding"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="24"> | ||
| 5 | + <el-card> | ||
| 6 | + <div slot="header" class="flex justify-between"> | ||
| 7 | + <span>{{ $t('myResourceStoreManage.queryCondition') }}</span> | ||
| 8 | + <div style="float: right;"> | ||
| 9 | + <el-button type="text" @click="_moreCondition"> | ||
| 10 | + {{ myResourceStoreManageInfo.moreCondition ? $t('myResourceStoreManage.hide') : $t('myResourceStoreManage.more') }} | ||
| 11 | + </el-button> | ||
| 12 | + </div> | ||
| 13 | + </div> | ||
| 14 | + <el-row :gutter="20"> | ||
| 15 | + <el-col :span="6"> | ||
| 16 | + <el-input | ||
| 17 | + v-model="myResourceStoreManageInfo.conditions.resId" | ||
| 18 | + :placeholder="$t('myResourceStoreManage.enterResId')" | ||
| 19 | + clearable | ||
| 20 | + /> | ||
| 21 | + </el-col> | ||
| 22 | + <el-col :span="8"> | ||
| 23 | + <el-input | ||
| 24 | + v-model="myResourceStoreManageInfo.conditions.resName" | ||
| 25 | + :placeholder="$t('myResourceStoreManage.enterResName')" | ||
| 26 | + clearable | ||
| 27 | + /> | ||
| 28 | + </el-col> | ||
| 29 | + <el-col :span="6"> | ||
| 30 | + <el-input | ||
| 31 | + v-model="myResourceStoreManageInfo.conditions.resCode" | ||
| 32 | + :placeholder="$t('myResourceStoreManage.enterResCode')" | ||
| 33 | + clearable | ||
| 34 | + /> | ||
| 35 | + </el-col> | ||
| 36 | + <el-col :span="4"> | ||
| 37 | + <el-button type="primary" @click="_queryResourceStoreMethod"> | ||
| 38 | + <i class="el-icon-search"></i> | ||
| 39 | + {{ $t('myResourceStoreManage.search') }} | ||
| 40 | + </el-button> | ||
| 41 | + <el-button @click="_resetResourceStoreMethod"> | ||
| 42 | + <i class="el-icon-refresh"></i> | ||
| 43 | + {{ $t('myResourceStoreManage.reset') }} | ||
| 44 | + </el-button> | ||
| 45 | + </el-col> | ||
| 46 | + </el-row> | ||
| 47 | + | ||
| 48 | + <el-row v-show="myResourceStoreManageInfo.moreCondition" :gutter="20" style="margin-top: 20px;"> | ||
| 49 | + <el-col :span="6"> | ||
| 50 | + <el-select | ||
| 51 | + v-model="myResourceStoreManageInfo.conditions.parentRstId" | ||
| 52 | + :placeholder="$t('myResourceStoreManage.selectResType')" | ||
| 53 | + style="width: 100%;" | ||
| 54 | + @change="_listResourceStoreSonTypes" | ||
| 55 | + > | ||
| 56 | + <el-option | ||
| 57 | + v-for="(item,index) in myResourceStoreManageInfo.resourceStoreTypes" | ||
| 58 | + :key="index" | ||
| 59 | + :label="item.name" | ||
| 60 | + :value="item.rstId" | ||
| 61 | + /> | ||
| 62 | + </el-select> | ||
| 63 | + </el-col> | ||
| 64 | + <el-col :span="8"> | ||
| 65 | + <el-select | ||
| 66 | + v-model="myResourceStoreManageInfo.conditions.rstId" | ||
| 67 | + :placeholder="$t('myResourceStoreManage.selectSecondType')" | ||
| 68 | + style="width: 100%;" | ||
| 69 | + @change="_listResourceStoreSpecifications" | ||
| 70 | + > | ||
| 71 | + <el-option | ||
| 72 | + v-for="(item,index) in myResourceStoreManageInfo.resourceStoreSonTypes" | ||
| 73 | + :key="index" | ||
| 74 | + :label="item.name" | ||
| 75 | + :value="item.rstId" | ||
| 76 | + /> | ||
| 77 | + </el-select> | ||
| 78 | + </el-col> | ||
| 79 | + <el-col :span="6"> | ||
| 80 | + <el-select | ||
| 81 | + v-model="myResourceStoreManageInfo.conditions.rssId" | ||
| 82 | + :placeholder="$t('myResourceStoreManage.selectResSpec')" | ||
| 83 | + style="width: 100%;" | ||
| 84 | + > | ||
| 85 | + <el-option | ||
| 86 | + v-for="(item,index) in myResourceStoreManageInfo.resourceStoreSpecifications" | ||
| 87 | + :key="index" | ||
| 88 | + :label="item.specName" | ||
| 89 | + :value="item.rssId" | ||
| 90 | + /> | ||
| 91 | + </el-select> | ||
| 92 | + </el-col> | ||
| 93 | + </el-row> | ||
| 94 | + | ||
| 95 | + <el-row v-show="myResourceStoreManageInfo.moreCondition" :gutter="20" style="margin-top: 20px;"> | ||
| 96 | + <el-col v-if="hasPrivilege('502021071018550002')" :span="6"> | ||
| 97 | + <el-input | ||
| 98 | + v-model="myResourceStoreManageInfo.conditions.searchUserId" | ||
| 99 | + :placeholder="$t('myResourceStoreManage.enterUserId')" | ||
| 100 | + clearable | ||
| 101 | + /> | ||
| 102 | + </el-col> | ||
| 103 | + <el-col v-if="hasPrivilege('502021071018550002')" :span="8"> | ||
| 104 | + <el-input | ||
| 105 | + v-model="myResourceStoreManageInfo.conditions.searchUserName" | ||
| 106 | + :placeholder="$t('myResourceStoreManage.enterUserName')" | ||
| 107 | + clearable | ||
| 108 | + /> | ||
| 109 | + </el-col> | ||
| 110 | + <el-col :span="6"> | ||
| 111 | + <el-select | ||
| 112 | + v-model="myResourceStoreManageInfo.conditions.isFixed" | ||
| 113 | + :placeholder="$t('myResourceStoreManage.selectIsFixed')" | ||
| 114 | + style="width: 100%;" | ||
| 115 | + > | ||
| 116 | + <el-option | ||
| 117 | + v-for="(item,index) in myResourceStoreManageInfo.isFixeds" | ||
| 118 | + :key="index" | ||
| 119 | + :label="item.name" | ||
| 120 | + :value="item.statusCd" | ||
| 121 | + /> | ||
| 122 | + </el-select> | ||
| 123 | + </el-col> | ||
| 124 | + </el-row> | ||
| 125 | + </el-card> | ||
| 126 | + </el-col> | ||
| 127 | + </el-row> | ||
| 128 | + | ||
| 129 | + <el-row :gutter="20" style="margin-top: 20px;"> | ||
| 130 | + <el-col :span="24"> | ||
| 131 | + <el-card> | ||
| 132 | + <div slot="header" class="flex justify-between"> | ||
| 133 | + <span>{{ $t('myResourceStoreManage.myResources') }}</span> | ||
| 134 | + <div style="float: right;"> | ||
| 135 | + <el-button type="primary" size="small" @click="_jump2ReturnGoodsPage"> | ||
| 136 | + <i class="el-icon-circle-close"></i> | ||
| 137 | + {{ $t('myResourceStoreManage.return') }} | ||
| 138 | + </el-button> | ||
| 139 | + <el-button type="primary" size="small" @click="_jump2TransferGoodsPage"> | ||
| 140 | + <i class="el-icon-share"></i> | ||
| 141 | + {{ $t('myResourceStoreManage.transfer') }} | ||
| 142 | + </el-button> | ||
| 143 | + <el-button type="primary" size="small" @click="_jump2ScrapGoodsPage"> | ||
| 144 | + <i class="el-icon-delete"></i> | ||
| 145 | + {{ $t('myResourceStoreManage.scrap') }} | ||
| 146 | + </el-button> | ||
| 147 | + <el-button type="primary" size="small" @click="_exportMyResourceStore"> | ||
| 148 | + <i class="el-icon-download"></i> | ||
| 149 | + {{ $t('myResourceStoreManage.export') }} | ||
| 150 | + </el-button> | ||
| 151 | + </div> | ||
| 152 | + </div> | ||
| 153 | + <el-table | ||
| 154 | + :data="myResourceStoreManageInfo.resourceStores" | ||
| 155 | + border | ||
| 156 | + style="width: 100%" | ||
| 157 | + > | ||
| 158 | + <el-table-column | ||
| 159 | + v-if="hasPrivilege('502021071018550002')" | ||
| 160 | + prop="userId" | ||
| 161 | + :label="$t('myResourceStoreManage.userId')" | ||
| 162 | + align="center" | ||
| 163 | + /> | ||
| 164 | + <el-table-column | ||
| 165 | + v-if="hasPrivilege('502021071018550002')" | ||
| 166 | + prop="userName" | ||
| 167 | + :label="$t('myResourceStoreManage.userName')" | ||
| 168 | + align="center" | ||
| 169 | + /> | ||
| 170 | + <el-table-column | ||
| 171 | + prop="resId" | ||
| 172 | + :label="$t('myResourceStoreManage.resId')" | ||
| 173 | + align="center" | ||
| 174 | + /> | ||
| 175 | + <el-table-column | ||
| 176 | + :label="$t('myResourceStoreManage.resType')" | ||
| 177 | + align="center" | ||
| 178 | + > | ||
| 179 | + <template slot-scope="scope"> | ||
| 180 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 181 | + </template> | ||
| 182 | + </el-table-column> | ||
| 183 | + <el-table-column | ||
| 184 | + prop="resName" | ||
| 185 | + :label="$t('myResourceStoreManage.resName')" | ||
| 186 | + align="center" | ||
| 187 | + /> | ||
| 188 | + <el-table-column | ||
| 189 | + prop="specName" | ||
| 190 | + :label="$t('myResourceStoreManage.resSpec')" | ||
| 191 | + align="center" | ||
| 192 | + > | ||
| 193 | + <template slot-scope="scope"> | ||
| 194 | + {{ scope.row.specName || '-' }} | ||
| 195 | + </template> | ||
| 196 | + </el-table-column> | ||
| 197 | + <el-table-column | ||
| 198 | + prop="resCode" | ||
| 199 | + :label="$t('myResourceStoreManage.resCode')" | ||
| 200 | + align="center" | ||
| 201 | + /> | ||
| 202 | + <el-table-column | ||
| 203 | + prop="isFixedName" | ||
| 204 | + :label="$t('myResourceStoreManage.isFixed')" | ||
| 205 | + align="center" | ||
| 206 | + /> | ||
| 207 | + <el-table-column | ||
| 208 | + :label="$t('myResourceStoreManage.stock')" | ||
| 209 | + align="center" | ||
| 210 | + > | ||
| 211 | + <template slot-scope="scope"> | ||
| 212 | + {{ scope.row.stock }}{{ scope.row.unitCodeName }} | ||
| 213 | + </template> | ||
| 214 | + </el-table-column> | ||
| 215 | + <el-table-column | ||
| 216 | + :label="$t('myResourceStoreManage.miniStock')" | ||
| 217 | + align="center" | ||
| 218 | + > | ||
| 219 | + <template slot-scope="scope"> | ||
| 220 | + {{ scope.row.miniStock }}{{ scope.row.miniUnitCodeName }} | ||
| 221 | + </template> | ||
| 222 | + </el-table-column> | ||
| 223 | + <el-table-column | ||
| 224 | + :label="$t('myResourceStoreManage.miniUnit')" | ||
| 225 | + align="center" | ||
| 226 | + > | ||
| 227 | + <template slot-scope="scope"> | ||
| 228 | + 1{{ scope.row.unitCodeName }}={{ scope.row.miniUnitStock }}{{ scope.row.miniUnitCodeName }} | ||
| 229 | + </template> | ||
| 230 | + </el-table-column> | ||
| 231 | + <el-table-column | ||
| 232 | + :label="$t('myResourceStoreManage.price')" | ||
| 233 | + align="center" | ||
| 234 | + > | ||
| 235 | + <template slot-scope="scope"> | ||
| 236 | + {{ scope.row.outHighPrice === scope.row.outLowPrice ? '¥' + scope.row.outLowPrice : '¥' + scope.row.outLowPrice + '-¥' + scope.row.outHighPrice }} | ||
| 237 | + </template> | ||
| 238 | + </el-table-column> | ||
| 239 | + </el-table> | ||
| 240 | + | ||
| 241 | + <el-pagination | ||
| 242 | + :current-page.sync="page.current" | ||
| 243 | + :page-sizes="[10, 20, 30, 50]" | ||
| 244 | + :page-size="page.size" | ||
| 245 | + :total="page.total" | ||
| 246 | + layout="total, sizes, prev, pager, next, jumper" | ||
| 247 | + @size-change="handleSizeChange" | ||
| 248 | + @current-change="handleCurrentChange" | ||
| 249 | + /> | ||
| 250 | + </el-card> | ||
| 251 | + </el-col> | ||
| 252 | + </el-row> | ||
| 253 | + </div> | ||
| 254 | +</template> | ||
| 255 | + | ||
| 256 | +<script> | ||
| 257 | +import { listUserStorehouses, listResourceStoreTypes, listResourceStoreSpecifications,exportData } from '@/api/resource/myResourceStoreManageApi' | ||
| 258 | +import { getDict } from '@/api/community/communityApi' | ||
| 259 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 260 | +import { getUserId,getUserName } from '@/api/user/userApi' | ||
| 261 | + | ||
| 262 | + | ||
| 263 | +export default { | ||
| 264 | + name: 'MyResourceStoreManageList', | ||
| 265 | + data() { | ||
| 266 | + return { | ||
| 267 | + myResourceStoreManageInfo: { | ||
| 268 | + resourceStores: [], | ||
| 269 | + total: 0, | ||
| 270 | + records: 1, | ||
| 271 | + moreCondition: false, | ||
| 272 | + isFixeds: [], | ||
| 273 | + conditions: { | ||
| 274 | + resId: '', | ||
| 275 | + resName: '', | ||
| 276 | + resCode: '', | ||
| 277 | + parentRstId: '', | ||
| 278 | + rstId: '', | ||
| 279 | + rssId: '', | ||
| 280 | + searchUserName: '', | ||
| 281 | + searchUserId: '', | ||
| 282 | + isFixed: '', | ||
| 283 | + userId: getUserId(), | ||
| 284 | + userName: getUserName(), | ||
| 285 | + communityId: '' | ||
| 286 | + }, | ||
| 287 | + resourceStoreTypes: [], | ||
| 288 | + resourceStoreSonTypes: [], | ||
| 289 | + resourceStoreSpecifications: [] | ||
| 290 | + }, | ||
| 291 | + page: { | ||
| 292 | + current: 1, | ||
| 293 | + size: 10, | ||
| 294 | + total: 0 | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + }, | ||
| 298 | + created() { | ||
| 299 | + this.myResourceStoreManageInfo.conditions.communityId = getCommunityId() | ||
| 300 | + this._initMethod() | ||
| 301 | + }, | ||
| 302 | + methods: { | ||
| 303 | + async _initMethod() { | ||
| 304 | + await this._listResourceStores(this.page.current, this.page.size) | ||
| 305 | + await this._listResourceStoreTypes() | ||
| 306 | + await this._listResourceStoreSpecifications() | ||
| 307 | + await this.getDictData() | ||
| 308 | + }, | ||
| 309 | + async getDictData() { | ||
| 310 | + try { | ||
| 311 | + const data = await getDict('resource_store', 'is_fixed') | ||
| 312 | + this.myResourceStoreManageInfo.isFixeds = data | ||
| 313 | + } catch (error) { | ||
| 314 | + console.error('获取字典数据失败:', error) | ||
| 315 | + } | ||
| 316 | + }, | ||
| 317 | + async _listResourceStores(page, size) { | ||
| 318 | + try { | ||
| 319 | + const params = { | ||
| 320 | + ...this.myResourceStoreManageInfo.conditions, | ||
| 321 | + page, | ||
| 322 | + row: size | ||
| 323 | + } | ||
| 324 | + const res = await listUserStorehouses(params) | ||
| 325 | + this.myResourceStoreManageInfo.resourceStores = res.data | ||
| 326 | + this.page.total = res.total | ||
| 327 | + } catch (error) { | ||
| 328 | + console.error('获取物品列表失败:', error) | ||
| 329 | + } | ||
| 330 | + }, | ||
| 331 | + _queryResourceStoreMethod() { | ||
| 332 | + this.page.current = 1 | ||
| 333 | + this._listResourceStores(this.page.current, this.page.size) | ||
| 334 | + }, | ||
| 335 | + _resetResourceStoreMethod() { | ||
| 336 | + this.myResourceStoreManageInfo.conditions = { | ||
| 337 | + ...this.myResourceStoreManageInfo.conditions, | ||
| 338 | + resId: '', | ||
| 339 | + resName: '', | ||
| 340 | + resCode: '', | ||
| 341 | + rstId: '', | ||
| 342 | + parentRstId: '', | ||
| 343 | + rssId: '', | ||
| 344 | + searchUserId: '', | ||
| 345 | + searchUserName: '', | ||
| 346 | + isFixed: '' | ||
| 347 | + } | ||
| 348 | + this.myResourceStoreManageInfo.resourceStoreSonTypes = [] | ||
| 349 | + this.myResourceStoreManageInfo.resourceStoreSpecifications = [] | ||
| 350 | + this._listResourceStores(this.page.current, this.page.size) | ||
| 351 | + }, | ||
| 352 | + _moreCondition() { | ||
| 353 | + this.myResourceStoreManageInfo.moreCondition = !this.myResourceStoreManageInfo.moreCondition | ||
| 354 | + }, | ||
| 355 | + async _listResourceStoreTypes() { | ||
| 356 | + try { | ||
| 357 | + const params = { | ||
| 358 | + page: 1, | ||
| 359 | + row: 100, | ||
| 360 | + communityId: this.myResourceStoreManageInfo.conditions.communityId, | ||
| 361 | + parentId: '0' | ||
| 362 | + } | ||
| 363 | + const res = await listResourceStoreTypes(params) | ||
| 364 | + this.myResourceStoreManageInfo.resourceStoreTypes = res.data | ||
| 365 | + } catch (error) { | ||
| 366 | + console.error('获取物品类型失败:', error) | ||
| 367 | + } | ||
| 368 | + }, | ||
| 369 | + async _listResourceStoreSonTypes() { | ||
| 370 | + this.myResourceStoreManageInfo.conditions.rstId = '' | ||
| 371 | + this.myResourceStoreManageInfo.resourceStoreSonTypes = [] | ||
| 372 | + if (!this.myResourceStoreManageInfo.conditions.parentRstId) return | ||
| 373 | + | ||
| 374 | + try { | ||
| 375 | + const params = { | ||
| 376 | + page: 1, | ||
| 377 | + row: 100, | ||
| 378 | + communityId: this.myResourceStoreManageInfo.conditions.communityId, | ||
| 379 | + parentId: this.myResourceStoreManageInfo.conditions.parentRstId | ||
| 380 | + } | ||
| 381 | + const res = await listResourceStoreTypes(params) | ||
| 382 | + this.myResourceStoreManageInfo.resourceStoreSonTypes = res.data | ||
| 383 | + } catch (error) { | ||
| 384 | + console.error('获取二级分类失败:', error) | ||
| 385 | + } | ||
| 386 | + }, | ||
| 387 | + async _listResourceStoreSpecifications() { | ||
| 388 | + this.myResourceStoreManageInfo.resourceStoreSpecifications = [] | ||
| 389 | + this.myResourceStoreManageInfo.conditions.rssId = '' | ||
| 390 | + if (!this.myResourceStoreManageInfo.conditions.rstId) return | ||
| 391 | + | ||
| 392 | + try { | ||
| 393 | + const params = { | ||
| 394 | + page: 1, | ||
| 395 | + row: 100, | ||
| 396 | + communityId: this.myResourceStoreManageInfo.conditions.communityId, | ||
| 397 | + rstId: this.myResourceStoreManageInfo.conditions.rstId | ||
| 398 | + } | ||
| 399 | + const res = await listResourceStoreSpecifications(params) | ||
| 400 | + this.myResourceStoreManageInfo.resourceStoreSpecifications = res.data | ||
| 401 | + } catch (error) { | ||
| 402 | + console.error('获取物品规格失败:', error) | ||
| 403 | + } | ||
| 404 | + }, | ||
| 405 | + _jump2TransferGoodsPage() { | ||
| 406 | + this.$router.push('/pages/common/transferGoodsManage') | ||
| 407 | + }, | ||
| 408 | + _jump2ScrapGoodsPage() { | ||
| 409 | + this.$router.push('/pages/common/scrapGoodsStep') | ||
| 410 | + }, | ||
| 411 | + _jump2ReturnGoodsPage() { | ||
| 412 | + this.$router.push('/pages/common/returnStorehouseApplyManage') | ||
| 413 | + }, | ||
| 414 | + async _exportMyResourceStore() { | ||
| 415 | + try { | ||
| 416 | + const params = { | ||
| 417 | + ...this.myResourceStoreManageInfo.conditions, | ||
| 418 | + pagePath: 'myResourceStoreManage' | ||
| 419 | + } | ||
| 420 | + const res = await exportData(params) | ||
| 421 | + this.$message.success(res.msg) | ||
| 422 | + if (res.code === 0) { | ||
| 423 | + this.$router.push('/pages/property/downloadTempFile?tab=下载中心') | ||
| 424 | + } | ||
| 425 | + } catch (error) { | ||
| 426 | + console.error('导出失败:', error) | ||
| 427 | + } | ||
| 428 | + }, | ||
| 429 | + handleSizeChange(val) { | ||
| 430 | + this.page.size = val | ||
| 431 | + this._listResourceStores(this.page.current, this.page.size) | ||
| 432 | + }, | ||
| 433 | + handleCurrentChange(val) { | ||
| 434 | + this.page.current = val | ||
| 435 | + this._listResourceStores(this.page.current, this.page.size) | ||
| 436 | + }, | ||
| 437 | + } | ||
| 438 | +} | ||
| 439 | +</script> | ||
| 440 | + | ||
| 441 | +<style scoped> | ||
| 442 | +.animated { | ||
| 443 | + animation-duration: 0.5s; | ||
| 444 | +} | ||
| 445 | +</style> | ||
| 0 | \ No newline at end of file | 446 | \ No newline at end of file |
src/views/resource/purchaseApplyDetailManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + purchaseApplyDetailManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + applyOrderId: 'Please enter application order number', | ||
| 7 | + state: 'Please select status', | ||
| 8 | + name: 'Please enter applicant name', | ||
| 9 | + endUserName: 'Please enter end user name', | ||
| 10 | + resName: 'Please enter item name', | ||
| 11 | + warehousingWay: 'Please select purchase method', | ||
| 12 | + startTime: 'Please select creation start time', | ||
| 13 | + endTime: 'Please select creation end time', | ||
| 14 | + parentRstId: 'Please select item type', | ||
| 15 | + rstId: 'Please select secondary category', | ||
| 16 | + rssId: 'Please select item specification', | ||
| 17 | + rsId: 'Please select supplier', | ||
| 18 | + shId: 'Please select warehouse', | ||
| 19 | + hide: 'Hide', | ||
| 20 | + more: 'More' | ||
| 21 | + }, | ||
| 22 | + list: { | ||
| 23 | + title: 'Inbound/Outbound Details' | ||
| 24 | + }, | ||
| 25 | + table: { | ||
| 26 | + applyOrderId: 'Application Order No.', | ||
| 27 | + userName: 'Applicant', | ||
| 28 | + endUserName: 'End User', | ||
| 29 | + resOrderTypeName: 'Inbound/Outbound Type', | ||
| 30 | + rstName: 'Item Type', | ||
| 31 | + resName: 'Item Name', | ||
| 32 | + specName: 'Item Specification', | ||
| 33 | + isFixedName: 'Fixed Item', | ||
| 34 | + supplierName: 'Supplier', | ||
| 35 | + shName: 'Item Warehouse', | ||
| 36 | + warehousingWayName: 'Purchase/Outbound Method', | ||
| 37 | + quantity: 'Application Quantity', | ||
| 38 | + purchaseQuantity: 'Purchase/Outbound Quantity', | ||
| 39 | + price: 'Purchase Price', | ||
| 40 | + totalApplyPrice: 'Total Price', | ||
| 41 | + remark: 'Application Remarks', | ||
| 42 | + stateName: 'Status', | ||
| 43 | + createTime: 'Creation Time' | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + }, | ||
| 47 | + zh: { | ||
| 48 | + purchaseApplyDetailManage: { | ||
| 49 | + search: { | ||
| 50 | + title: '查询条件', | ||
| 51 | + applyOrderId: '请填写申请单号', | ||
| 52 | + state: '请选择状态', | ||
| 53 | + name: '请填写申请人姓名', | ||
| 54 | + endUserName: '请填写使用人姓名', | ||
| 55 | + resName: '请填写物品名称', | ||
| 56 | + warehousingWay: '请选择采购方式', | ||
| 57 | + startTime: '请选择创建开始时间', | ||
| 58 | + endTime: '请选择创建结束时间', | ||
| 59 | + parentRstId: '请选择物品类型', | ||
| 60 | + rstId: '请选择二级分类', | ||
| 61 | + rssId: '请选择物品规格', | ||
| 62 | + rsId: '请选择供应商', | ||
| 63 | + shId: '请选择仓库', | ||
| 64 | + hide: '隐藏', | ||
| 65 | + more: '更多' | ||
| 66 | + }, | ||
| 67 | + list: { | ||
| 68 | + title: '出入库明细' | ||
| 69 | + }, | ||
| 70 | + table: { | ||
| 71 | + applyOrderId: '申请单号', | ||
| 72 | + userName: '申请人', | ||
| 73 | + endUserName: '使用人', | ||
| 74 | + resOrderTypeName: '出入库类型', | ||
| 75 | + rstName: '物品类型', | ||
| 76 | + resName: '物品名称', | ||
| 77 | + specName: '物品规格', | ||
| 78 | + isFixedName: '固定物品', | ||
| 79 | + supplierName: '供应商', | ||
| 80 | + shName: '物品仓库', | ||
| 81 | + warehousingWayName: '采购/出库方式', | ||
| 82 | + quantity: '申请数量', | ||
| 83 | + purchaseQuantity: '采购/出库数量', | ||
| 84 | + price: '采购价格', | ||
| 85 | + totalApplyPrice: '总价', | ||
| 86 | + remark: '申请备注', | ||
| 87 | + stateName: '状态', | ||
| 88 | + createTime: '创建时间' | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + } | ||
| 92 | +} | ||
| 0 | \ No newline at end of file | 93 | \ No newline at end of file |
src/views/resource/purchaseApplyDetailManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="purchase-apply-detail-manage-container"> | ||
| 3 | + <el-row :gutter="20"> | ||
| 4 | + <el-col :span="2"> | ||
| 5 | + <div class="border-radius"> | ||
| 6 | + <div class="margin-xs-r treeview attendance-staff"> | ||
| 7 | + <ul class="list-group text-center border-radius"> | ||
| 8 | + <li v-for="(item, index) in resOrderTypes" :key="index" class="list-group-item node-orgTree" | ||
| 9 | + :class="{ 'vc-node-selected': conditions.resOrderType == item.statusCd }" @click="swatchResOrderTypes(item)"> | ||
| 10 | + {{ item.name }} | ||
| 11 | + </li> | ||
| 12 | + </ul> | ||
| 13 | + </div> | ||
| 14 | + </div> | ||
| 15 | + </el-col> | ||
| 16 | + <el-col :span="22"> | ||
| 17 | + <el-card class="box-card"> | ||
| 18 | + <div slot="header" class="flex justify-between"> | ||
| 19 | + <span>{{ $t('purchaseApplyDetailManage.search.title') }}</span> | ||
| 20 | + <div style="float: right;"> | ||
| 21 | + <el-button type="text" @click="_moreCondition()"> | ||
| 22 | + {{ moreCondition ? $t('purchaseApplyDetailManage.search.hide') : | ||
| 23 | + $t('purchaseApplyDetailManage.search.more') }} | ||
| 24 | + </el-button> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + <el-row :gutter="20"> | ||
| 28 | + <el-col :span="4"> | ||
| 29 | + <el-input v-model.trim="conditions.applyOrderId" | ||
| 30 | + :placeholder="$t('purchaseApplyDetailManage.search.applyOrderId')" clearable /> | ||
| 31 | + </el-col> | ||
| 32 | + <el-col :span="4"> | ||
| 33 | + <el-select v-model="conditions.state" :placeholder="$t('purchaseApplyDetailManage.search.state')" | ||
| 34 | + style="width:100%" clearable> | ||
| 35 | + <el-option v-for="(item, index) in states" :key="index" :label="item.name" :value="item.statusCd" /> | ||
| 36 | + </el-select> | ||
| 37 | + </el-col> | ||
| 38 | + <el-col :span="4"> | ||
| 39 | + <el-input v-model.trim="conditions.name" :placeholder="$t('purchaseApplyDetailManage.search.name')" | ||
| 40 | + clearable /> | ||
| 41 | + </el-col> | ||
| 42 | + <el-col :span="4"> | ||
| 43 | + <el-input v-model.trim="conditions.endUserName" | ||
| 44 | + :placeholder="$t('purchaseApplyDetailManage.search.endUserName')" clearable /> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="4"> | ||
| 47 | + <el-input v-model.trim="conditions.resName" :placeholder="$t('purchaseApplyDetailManage.search.resName')" | ||
| 48 | + clearable /> | ||
| 49 | + </el-col> | ||
| 50 | + <el-col :span="4"> | ||
| 51 | + <el-button type="primary" @click="_queryInspectionPlanMethod()"> | ||
| 52 | + <i class="el-icon-search" /> | ||
| 53 | + {{ $t('common.search') }} | ||
| 54 | + </el-button> | ||
| 55 | + <el-button type="primary" @click="_resetInspectionPlanMethod()"> | ||
| 56 | + <i class="el-icon-refresh" /> | ||
| 57 | + {{ $t('common.reset') }} | ||
| 58 | + </el-button> | ||
| 59 | + </el-col> | ||
| 60 | + </el-row> | ||
| 61 | + <el-row v-show="moreCondition" :gutter="20"> | ||
| 62 | + <el-col :span="4"> | ||
| 63 | + <el-select v-model="conditions.warehousingWay" | ||
| 64 | + :placeholder="$t('purchaseApplyDetailManage.search.warehousingWay')" style="width:100%" clearable> | ||
| 65 | + <el-option v-for="(item, index) in warehousingWays" :key="index" :label="item.name" | ||
| 66 | + :value="item.statusCd" /> | ||
| 67 | + </el-select> | ||
| 68 | + </el-col> | ||
| 69 | + <el-col :span="4"> | ||
| 70 | + <el-date-picker v-model="conditions.startTime" type="datetime" | ||
| 71 | + :placeholder="$t('purchaseApplyDetailManage.search.startTime')" style="width:100%" /> | ||
| 72 | + </el-col> | ||
| 73 | + <el-col :span="4"> | ||
| 74 | + <el-date-picker v-model="conditions.endTime" type="datetime" | ||
| 75 | + :placeholder="$t('purchaseApplyDetailManage.search.endTime')" style="width:100%" /> | ||
| 76 | + </el-col> | ||
| 77 | + <el-col :span="4"> | ||
| 78 | + <el-select v-model="conditions.parentRstId" | ||
| 79 | + :placeholder="$t('purchaseApplyDetailManage.search.parentRstId')" style="width:100%" clearable | ||
| 80 | + @change="_listResourceStoreSonTypes"> | ||
| 81 | + <el-option v-for="(item, index) in resourceStoreTypes" :key="index" :label="item.name" | ||
| 82 | + :value="item.rstId" /> | ||
| 83 | + </el-select> | ||
| 84 | + </el-col> | ||
| 85 | + <el-col :span="4"> | ||
| 86 | + <el-select v-model="conditions.rstId" :placeholder="$t('purchaseApplyDetailManage.search.rstId')" | ||
| 87 | + style="width:100%" clearable @change="_listResourceStoreSpecifications"> | ||
| 88 | + <el-option v-for="(item, index) in resourceStoreSonTypes" :key="index" :label="item.name" | ||
| 89 | + :value="item.rstId" /> | ||
| 90 | + </el-select> | ||
| 91 | + </el-col> | ||
| 92 | + </el-row> | ||
| 93 | + <el-row v-show="moreCondition" :gutter="20"> | ||
| 94 | + <el-col :span="4"> | ||
| 95 | + <el-select v-model="conditions.rssId" :placeholder="$t('purchaseApplyDetailManage.search.rssId')" | ||
| 96 | + style="width:100%" clearable> | ||
| 97 | + <el-option v-for="(item, index) in resourceStoreSpecifications" :key="index" :label="item.specName" | ||
| 98 | + :value="item.rssId" /> | ||
| 99 | + </el-select> | ||
| 100 | + </el-col> | ||
| 101 | + <el-col :span="4"> | ||
| 102 | + <el-select v-model="conditions.rsId" :placeholder="$t('purchaseApplyDetailManage.search.rsId')" | ||
| 103 | + style="width:100%" clearable> | ||
| 104 | + <el-option v-for="(item, index) in resourceSuppliers" :key="index" :label="item.supplierName" | ||
| 105 | + :value="item.rsId" /> | ||
| 106 | + </el-select> | ||
| 107 | + </el-col> | ||
| 108 | + <el-col :span="4"> | ||
| 109 | + <el-select v-model="conditions.shId" :placeholder="$t('purchaseApplyDetailManage.search.shId')" | ||
| 110 | + style="width:100%" clearable> | ||
| 111 | + <el-option v-for="(item, index) in storehouses" :key="index" :label="item.shName" :value="item.shId" /> | ||
| 112 | + </el-select> | ||
| 113 | + </el-col> | ||
| 114 | + </el-row> | ||
| 115 | + </el-card> | ||
| 116 | + | ||
| 117 | + <el-card class="box-card"> | ||
| 118 | + <div slot="header" class="flex justify-between"> | ||
| 119 | + <span>{{ $t('purchaseApplyDetailManage.list.title') }}</span> | ||
| 120 | + <div style="float: right;"> | ||
| 121 | + <el-button type="primary" @click="_exportExcel()"> | ||
| 122 | + <i class="el-icon-download" /> | ||
| 123 | + {{ $t('common.export') }} | ||
| 124 | + </el-button> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + <el-table :data="purchaseApplyDetails" border style="width: 100%"> | ||
| 128 | + <el-table-column prop="applyOrderId" :label="$t('purchaseApplyDetailManage.table.applyOrderId')" | ||
| 129 | + align="center" /> | ||
| 130 | + <el-table-column prop="userName" :label="$t('purchaseApplyDetailManage.table.userName')" align="center" /> | ||
| 131 | + <el-table-column prop="endUserName" :label="$t('purchaseApplyDetailManage.table.endUserName')" | ||
| 132 | + align="center" /> | ||
| 133 | + <el-table-column prop="resOrderTypeName" :label="$t('purchaseApplyDetailManage.table.resOrderTypeName')" | ||
| 134 | + align="center" /> | ||
| 135 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.rstName')" align="center"> | ||
| 136 | + <template slot-scope="scope"> | ||
| 137 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 138 | + </template> | ||
| 139 | + </el-table-column> | ||
| 140 | + <el-table-column prop="resName" :label="$t('purchaseApplyDetailManage.table.resName')" align="center" /> | ||
| 141 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.specName')" align="center"> | ||
| 142 | + <template slot-scope="scope"> | ||
| 143 | + {{ scope.row.specName || '--' }} | ||
| 144 | + </template> | ||
| 145 | + </el-table-column> | ||
| 146 | + <el-table-column prop="isFixedName" :label="$t('purchaseApplyDetailManage.table.isFixedName')" | ||
| 147 | + align="center" /> | ||
| 148 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.supplierName')" align="center"> | ||
| 149 | + <template slot-scope="scope"> | ||
| 150 | + {{ scope.row.supplierName || '--' }} | ||
| 151 | + </template> | ||
| 152 | + </el-table-column> | ||
| 153 | + <el-table-column prop="shName" :label="$t('purchaseApplyDetailManage.table.shName')" align="center" /> | ||
| 154 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.warehousingWayName')" align="center"> | ||
| 155 | + <template slot-scope="scope"> | ||
| 156 | + {{ scope.row.warehousingWayName }}{{ scope.row.resOrderTypeName }} | ||
| 157 | + </template> | ||
| 158 | + </el-table-column> | ||
| 159 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.quantity')" align="center"> | ||
| 160 | + <template slot-scope="scope"> | ||
| 161 | + {{ scope.row.quantity }}{{ scope.row.unitCodeName || '' }} | ||
| 162 | + </template> | ||
| 163 | + </el-table-column> | ||
| 164 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.purchaseQuantity')" align="center"> | ||
| 165 | + <template slot-scope="scope"> | ||
| 166 | + {{ scope.row.purchaseQuantity ? | ||
| 167 | + scope.row.purchaseQuantity + scope.row.unitCodeName : '--' }} | ||
| 168 | + </template> | ||
| 169 | + </el-table-column> | ||
| 170 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.price')" align="center"> | ||
| 171 | + <template slot-scope="scope"> | ||
| 172 | + ¥{{ scope.row.price ? scope.row.price : '0.00' }} | ||
| 173 | + </template> | ||
| 174 | + </el-table-column> | ||
| 175 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.totalApplyPrice')" align="center"> | ||
| 176 | + <template slot-scope="scope"> | ||
| 177 | + ¥{{ scope.row.totalApplyPrice }} | ||
| 178 | + </template> | ||
| 179 | + </el-table-column> | ||
| 180 | + <el-table-column :label="$t('purchaseApplyDetailManage.table.remark')" align="center"> | ||
| 181 | + <template slot-scope="scope"> | ||
| 182 | + {{ scope.row.remark }} | ||
| 183 | + <el-popover v-if="scope.row.purchaseRemark" placement="top-start" width="200" trigger="hover"> | ||
| 184 | + <div>{{ scope.row.purchaseRemark }}</div> | ||
| 185 | + <i slot="reference" class="el-icon-info" style="cursor:pointer" /> | ||
| 186 | + </el-popover> | ||
| 187 | + </template> | ||
| 188 | + </el-table-column> | ||
| 189 | + <el-table-column prop="stateName" :label="$t('purchaseApplyDetailManage.table.stateName')" align="center" /> | ||
| 190 | + <el-table-column prop="createTime" :label="$t('purchaseApplyDetailManage.table.createTime')" align="center" /> | ||
| 191 | + </el-table> | ||
| 192 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 193 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 194 | + @current-change="handleCurrentChange" /> | ||
| 195 | + </el-card> | ||
| 196 | + </el-col> | ||
| 197 | + </el-row> | ||
| 198 | + <view-image ref="viewImage" /> | ||
| 199 | + </div> | ||
| 200 | +</template> | ||
| 201 | + | ||
| 202 | +<script> | ||
| 203 | +import { listPurchaseApplyDetails, exportData,listResourceSuppliers,listResourceStoreTypes,listResourceStoreSpecifications,listStorehouses } from '@/api/resource/purchaseApplyDetailManageApi' | ||
| 204 | +import { getDict } from '@/api/community/communityApi' | ||
| 205 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 206 | +import ViewImage from '@/components/system/viewImage' | ||
| 207 | + | ||
| 208 | +export default { | ||
| 209 | + name: 'PurchaseApplyDetailManageList', | ||
| 210 | + components: { | ||
| 211 | + ViewImage | ||
| 212 | + }, | ||
| 213 | + data() { | ||
| 214 | + return { | ||
| 215 | + purchaseApplyDetails: [], | ||
| 216 | + total: 0, | ||
| 217 | + records: 1, | ||
| 218 | + moreCondition: false, | ||
| 219 | + states: [], | ||
| 220 | + warehousingWays: [], | ||
| 221 | + resOrderTypes: [], | ||
| 222 | + resourceSuppliers: [], | ||
| 223 | + storehouses: [], | ||
| 224 | + conditions: { | ||
| 225 | + applyOrderId: '', | ||
| 226 | + state: '', | ||
| 227 | + userId: '', | ||
| 228 | + name: '', | ||
| 229 | + resOrderType: '', | ||
| 230 | + endUserName: '', | ||
| 231 | + resName: '', | ||
| 232 | + rsId: '', | ||
| 233 | + rssId: '', | ||
| 234 | + parentRstId: '', | ||
| 235 | + rstId: '', | ||
| 236 | + warehousingWay: '', | ||
| 237 | + startTime: '', | ||
| 238 | + endTime: '', | ||
| 239 | + shId: '', | ||
| 240 | + shName: '', | ||
| 241 | + communityId: '' | ||
| 242 | + }, | ||
| 243 | + resourceStoreTypes: [], | ||
| 244 | + resourceStoreSonTypes: [], | ||
| 245 | + resourceStoreSpecifications: [], | ||
| 246 | + page: { | ||
| 247 | + current: 1, | ||
| 248 | + size: 10, | ||
| 249 | + total: 0 | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + }, | ||
| 253 | + created() { | ||
| 254 | + this.communityId = getCommunityId() | ||
| 255 | + this.conditions.communityId = this.communityId | ||
| 256 | + this._initData() | ||
| 257 | + }, | ||
| 258 | + methods: { | ||
| 259 | + async _initData() { | ||
| 260 | + await this._queryStorehouses() | ||
| 261 | + await this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 262 | + await this.getDictData() | ||
| 263 | + await this._listResourceStoreTypes() | ||
| 264 | + await this._listResourceStoreSpecifications() | ||
| 265 | + }, | ||
| 266 | + async getDictData() { | ||
| 267 | + try { | ||
| 268 | + const stateData = await getDict('purchase_apply', 'state') | ||
| 269 | + this.states = stateData | ||
| 270 | + const warehousingWayData = await getDict('purchase_apply', 'warehousing_way') | ||
| 271 | + this.warehousingWays = warehousingWayData | ||
| 272 | + const resOrderTypeData = await getDict('purchase_apply', 'res_order_type') | ||
| 273 | + this.resOrderTypes = [{ statusCd: '', name: this.$t('common.all') }].concat(resOrderTypeData) | ||
| 274 | + } catch (error) { | ||
| 275 | + console.error('获取字典数据失败:', error) | ||
| 276 | + } | ||
| 277 | + }, | ||
| 278 | + async _listPurchaseApplyDetails(page, size) { | ||
| 279 | + try { | ||
| 280 | + this.conditions.page = page | ||
| 281 | + this.conditions.row = size | ||
| 282 | + const params = { | ||
| 283 | + params: this.conditions | ||
| 284 | + } | ||
| 285 | + const { data, total } = await listPurchaseApplyDetails(params) | ||
| 286 | + this.purchaseApplyDetails = data.map(item => { | ||
| 287 | + item.purchaseQuantity = item.purchaseQuantity ? item.purchaseQuantity : 0 | ||
| 288 | + item.price = item.price ? item.price : 0 | ||
| 289 | + item.totalApplyPrice = (item.purchaseQuantity * item.price).toFixed(2) | ||
| 290 | + return item | ||
| 291 | + }) | ||
| 292 | + this.page.total = total | ||
| 293 | + } catch (error) { | ||
| 294 | + console.error('获取采购申请明细列表失败:', error) | ||
| 295 | + } | ||
| 296 | + }, | ||
| 297 | + async _listResourceSupplier() { | ||
| 298 | + try { | ||
| 299 | + const params = { | ||
| 300 | + params: { | ||
| 301 | + page: 1, | ||
| 302 | + row: 100, | ||
| 303 | + communityId: this.communityId | ||
| 304 | + } | ||
| 305 | + } | ||
| 306 | + const { data } = await listResourceSuppliers(params) | ||
| 307 | + this.resourceSuppliers = data | ||
| 308 | + } catch (error) { | ||
| 309 | + console.error('获取供应商列表失败:', error) | ||
| 310 | + } | ||
| 311 | + }, | ||
| 312 | + _openDetailPurchaseApplyDetailModel(purchaseApplyDetail) { | ||
| 313 | + this.$router.push(`/pages/common/purchaseApplyDetail?applyOrderId=${purchaseApplyDetail.applyOrderId}&resOrderType=10000`) | ||
| 314 | + }, | ||
| 315 | + _queryInspectionPlanMethod() { | ||
| 316 | + this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 317 | + }, | ||
| 318 | + _resetInspectionPlanMethod() { | ||
| 319 | + this.conditions = { | ||
| 320 | + applyOrderId: '', | ||
| 321 | + state: '', | ||
| 322 | + userId: '', | ||
| 323 | + name: '', | ||
| 324 | + resOrderType: '', | ||
| 325 | + endUserName: '', | ||
| 326 | + resName: '', | ||
| 327 | + rsId: '', | ||
| 328 | + rssId: '', | ||
| 329 | + parentRstId: '', | ||
| 330 | + rstId: '', | ||
| 331 | + warehousingWay: '', | ||
| 332 | + startTime: '', | ||
| 333 | + endTime: '', | ||
| 334 | + shId: '', | ||
| 335 | + shName: '', | ||
| 336 | + communityId: this.communityId | ||
| 337 | + } | ||
| 338 | + this.resourceStoreSonTypes = [] | ||
| 339 | + this.resourceStoreSpecifications = [] | ||
| 340 | + this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 341 | + }, | ||
| 342 | + _moreCondition() { | ||
| 343 | + this.moreCondition = !this.moreCondition | ||
| 344 | + }, | ||
| 345 | + async _listResourceStoreTypes() { | ||
| 346 | + try { | ||
| 347 | + const params = { | ||
| 348 | + params: { | ||
| 349 | + page: 1, | ||
| 350 | + row: 100, | ||
| 351 | + communityId: this.communityId, | ||
| 352 | + parentId: '0' | ||
| 353 | + } | ||
| 354 | + } | ||
| 355 | + const { data } = await listResourceStoreTypes(params) | ||
| 356 | + this.resourceStoreTypes = data | ||
| 357 | + } catch (error) { | ||
| 358 | + console.error('获取物品类型列表失败:', error) | ||
| 359 | + } | ||
| 360 | + }, | ||
| 361 | + async _listResourceStoreSonTypes() { | ||
| 362 | + this.conditions.rstId = '' | ||
| 363 | + this.resourceStoreSonTypes = [] | ||
| 364 | + if (!this.conditions.parentRstId) return | ||
| 365 | + | ||
| 366 | + try { | ||
| 367 | + const params = { | ||
| 368 | + params: { | ||
| 369 | + page: 1, | ||
| 370 | + row: 100, | ||
| 371 | + communityId: this.communityId, | ||
| 372 | + parentId: this.conditions.parentRstId | ||
| 373 | + } | ||
| 374 | + } | ||
| 375 | + const { data } = await listResourceStoreTypes(params) | ||
| 376 | + this.resourceStoreSonTypes = data | ||
| 377 | + } catch (error) { | ||
| 378 | + console.error('获取二级分类列表失败:', error) | ||
| 379 | + } | ||
| 380 | + }, | ||
| 381 | + async _listResourceStoreSpecifications() { | ||
| 382 | + this.conditions.rssId = '' | ||
| 383 | + this.resourceStoreSpecifications = [] | ||
| 384 | + if (!this.conditions.rstId) return | ||
| 385 | + | ||
| 386 | + try { | ||
| 387 | + const params = { | ||
| 388 | + params: { | ||
| 389 | + page: 1, | ||
| 390 | + row: 100, | ||
| 391 | + communityId: this.communityId, | ||
| 392 | + rstId: this.conditions.rstId | ||
| 393 | + } | ||
| 394 | + } | ||
| 395 | + const { data } = await listResourceStoreSpecifications(params) | ||
| 396 | + this.resourceStoreSpecifications = data | ||
| 397 | + } catch (error) { | ||
| 398 | + console.error('获取物品规格列表失败:', error) | ||
| 399 | + } | ||
| 400 | + }, | ||
| 401 | + async _queryStorehouses() { | ||
| 402 | + try { | ||
| 403 | + const params = { | ||
| 404 | + params: { | ||
| 405 | + page: 1, | ||
| 406 | + row: 50, | ||
| 407 | + communityId: this.communityId | ||
| 408 | + } | ||
| 409 | + } | ||
| 410 | + const { data } = await listStorehouses(params) | ||
| 411 | + this.storehouses = data | ||
| 412 | + } catch (error) { | ||
| 413 | + console.error('获取仓库列表失败:', error) | ||
| 414 | + } | ||
| 415 | + }, | ||
| 416 | + _viewPurchaseApplyDetail(item) { | ||
| 417 | + this.$refs.viewImage.open({ | ||
| 418 | + data: { | ||
| 419 | + "备注": item.purchaseRemark | ||
| 420 | + } | ||
| 421 | + }) | ||
| 422 | + }, | ||
| 423 | + async _exportExcel() { | ||
| 424 | + try { | ||
| 425 | + this.conditions.communityId = this.communityId | ||
| 426 | + this.conditions.pagePath = 'purchaseApplyDetailManage' | ||
| 427 | + const params = { | ||
| 428 | + params: this.conditions | ||
| 429 | + } | ||
| 430 | + const { code, msg } = await exportData(params) | ||
| 431 | + this.$message.success(msg) | ||
| 432 | + if (code === 0) { | ||
| 433 | + this.$router.push('/pages/property/downloadTempFile?tab=下载中心') | ||
| 434 | + } | ||
| 435 | + } catch (error) { | ||
| 436 | + console.error('导出失败:', error) | ||
| 437 | + } | ||
| 438 | + }, | ||
| 439 | + swatchResOrderTypes(item) { | ||
| 440 | + this.conditions.resOrderType = item.statusCd | ||
| 441 | + this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 442 | + }, | ||
| 443 | + handleSizeChange(val) { | ||
| 444 | + this.page.size = val | ||
| 445 | + this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 446 | + }, | ||
| 447 | + handleCurrentChange(val) { | ||
| 448 | + this.page.current = val | ||
| 449 | + this._listPurchaseApplyDetails(this.page.current, this.page.size) | ||
| 450 | + } | ||
| 451 | + } | ||
| 452 | +} | ||
| 453 | +</script> | ||
| 454 | + | ||
| 455 | +<style lang="scss" scoped> | ||
| 456 | +.purchase-apply-detail-manage-container { | ||
| 457 | + padding: 20px; | ||
| 458 | + | ||
| 459 | + .border-radius { | ||
| 460 | + border-radius: 4px; | ||
| 461 | + border: 1px solid #ebeef5; | ||
| 462 | + background-color: #fff; | ||
| 463 | + overflow: hidden; | ||
| 464 | + | ||
| 465 | + .list-group { | ||
| 466 | + padding: 0; | ||
| 467 | + margin: 0; | ||
| 468 | + list-style: none; | ||
| 469 | + | ||
| 470 | + .list-group-item { | ||
| 471 | + padding: 12px 15px; | ||
| 472 | + border-bottom: 1px solid #ebeef5; | ||
| 473 | + cursor: pointer; | ||
| 474 | + | ||
| 475 | + &:hover { | ||
| 476 | + background-color: #f5f7fa; | ||
| 477 | + } | ||
| 478 | + | ||
| 479 | + &.vc-node-selected { | ||
| 480 | + background-color: #409eff; | ||
| 481 | + color: #fff; | ||
| 482 | + } | ||
| 483 | + } | ||
| 484 | + } | ||
| 485 | + } | ||
| 486 | + | ||
| 487 | + .box-card { | ||
| 488 | + margin-bottom: 20px; | ||
| 489 | + } | ||
| 490 | +} | ||
| 491 | +</style> | ||
| 0 | \ No newline at end of file | 492 | \ No newline at end of file |
src/views/resource/resourceStoreUseRecordManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + resourceStoreUseRecordManage: { | ||
| 4 | + search: { | ||
| 5 | + title: 'Search Conditions', | ||
| 6 | + rsurId: 'Please enter use record ID', | ||
| 7 | + repairId: 'Please enter repair order code', | ||
| 8 | + resId: 'Please enter resource ID', | ||
| 9 | + createUserId: 'Please enter user ID', | ||
| 10 | + createUserName: 'Please enter username', | ||
| 11 | + resName: 'Please enter resource name', | ||
| 12 | + parentRstId: 'Please select resource type', | ||
| 13 | + rstId: 'Please select secondary category', | ||
| 14 | + rssId: 'Please select resource specification', | ||
| 15 | + state: 'Please select usage type', | ||
| 16 | + startTime: 'Please select start time', | ||
| 17 | + endTime: 'Please select end time' | ||
| 18 | + }, | ||
| 19 | + list: { | ||
| 20 | + title: 'Usage Records' | ||
| 21 | + }, | ||
| 22 | + table: { | ||
| 23 | + rsurId: 'Usage Record ID', | ||
| 24 | + repairId: 'Repair Order Code', | ||
| 25 | + resId: 'Resource ID', | ||
| 26 | + resourceType: 'Resource Type', | ||
| 27 | + resourceStoreName: 'Resource Name', | ||
| 28 | + specName: 'Specification', | ||
| 29 | + isFixedName: 'Fixed Resource', | ||
| 30 | + stateName: 'Usage Type', | ||
| 31 | + quantity: 'Quantity', | ||
| 32 | + unitPrice: 'Price', | ||
| 33 | + createUserId: 'User ID', | ||
| 34 | + createUserName: 'User', | ||
| 35 | + createTime: 'Create Time', | ||
| 36 | + remark: 'Remark' | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + }, | ||
| 40 | + zh: { | ||
| 41 | + resourceStoreUseRecordManage: { | ||
| 42 | + search: { | ||
| 43 | + title: '查询条件', | ||
| 44 | + rsurId: '请输入使用记录ID', | ||
| 45 | + repairId: '请输入维修工单编码', | ||
| 46 | + resId: '请输入物品资源编号', | ||
| 47 | + createUserId: '请输入物品使用人ID', | ||
| 48 | + createUserName: '请输入用户名', | ||
| 49 | + resName: '请输入物品名称', | ||
| 50 | + parentRstId: '请选择物品类型', | ||
| 51 | + rstId: '请选择二级分类', | ||
| 52 | + rssId: '请选择物品规格', | ||
| 53 | + state: '请选择物品使用类型', | ||
| 54 | + startTime: '请选择开始时间', | ||
| 55 | + endTime: '请选择结束时间' | ||
| 56 | + }, | ||
| 57 | + list: { | ||
| 58 | + title: '使用记录' | ||
| 59 | + }, | ||
| 60 | + table: { | ||
| 61 | + rsurId: '使用记录ID', | ||
| 62 | + repairId: '维修工单编号', | ||
| 63 | + resId: '物品编号', | ||
| 64 | + resourceType: '物品类型', | ||
| 65 | + resourceStoreName: '物品名称', | ||
| 66 | + specName: '物品规格', | ||
| 67 | + isFixedName: '固定物品', | ||
| 68 | + stateName: '使用类型', | ||
| 69 | + quantity: '使用数量', | ||
| 70 | + unitPrice: '物品价格', | ||
| 71 | + createUserId: '使用人ID', | ||
| 72 | + createUserName: '使用人', | ||
| 73 | + createTime: '创建时间', | ||
| 74 | + remark: '备注' | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
src/views/resource/resourceStoreUseRecordManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="resource-store-use-record-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-wrapper"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('resourceStoreUseRecordManage.search.title') }}</span> | ||
| 7 | + <el-button style="float: right; padding: 3px 0" type="text" @click="_moreCondition()"> | ||
| 8 | + {{ resourceStoreUseRecordManageInfo.moreCondition ? $t('common.hide') : $t('common.more') }} | ||
| 9 | + </el-button> | ||
| 10 | + </div> | ||
| 11 | + <el-row :gutter="20"> | ||
| 12 | + <el-col :span="6"> | ||
| 13 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.rsurId" | ||
| 14 | + :placeholder="$t('resourceStoreUseRecordManage.search.rsurId')" clearable /> | ||
| 15 | + </el-col> | ||
| 16 | + <el-col :span="8"> | ||
| 17 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.repairId" | ||
| 18 | + :placeholder="$t('resourceStoreUseRecordManage.search.repairId')" clearable /> | ||
| 19 | + </el-col> | ||
| 20 | + <el-col :span="6"> | ||
| 21 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.resId" | ||
| 22 | + :placeholder="$t('resourceStoreUseRecordManage.search.resId')" clearable /> | ||
| 23 | + </el-col> | ||
| 24 | + <el-col :span="4"> | ||
| 25 | + <el-button type="primary" @click="_queryResourceStoreUseRecordMethod()"> | ||
| 26 | + <i class="el-icon-search"></i> | ||
| 27 | + {{ $t('common.search') }} | ||
| 28 | + </el-button> | ||
| 29 | + <el-button @click="_resetResourceStoreUseRecordMethod()"> | ||
| 30 | + <i class="el-icon-refresh"></i> | ||
| 31 | + {{ $t('common.reset') }} | ||
| 32 | + </el-button> | ||
| 33 | + </el-col> | ||
| 34 | + </el-row> | ||
| 35 | + | ||
| 36 | + <!-- 更多查询条件 --> | ||
| 37 | + <div v-show="resourceStoreUseRecordManageInfo.moreCondition"> | ||
| 38 | + <el-row :gutter="20" class="mt-20"> | ||
| 39 | + <el-col :span="6"> | ||
| 40 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.createUserId" | ||
| 41 | + :placeholder="$t('resourceStoreUseRecordManage.search.createUserId')" clearable /> | ||
| 42 | + </el-col> | ||
| 43 | + <el-col :span="8"> | ||
| 44 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.createUserName" | ||
| 45 | + :placeholder="$t('resourceStoreUseRecordManage.search.createUserName')" clearable /> | ||
| 46 | + </el-col> | ||
| 47 | + <el-col :span="6"> | ||
| 48 | + <el-input v-model="resourceStoreUseRecordManageInfo.conditions.resName" | ||
| 49 | + :placeholder="$t('resourceStoreUseRecordManage.search.resName')" clearable /> | ||
| 50 | + </el-col> | ||
| 51 | + </el-row> | ||
| 52 | + | ||
| 53 | + <el-row :gutter="20" class="mt-20"> | ||
| 54 | + <el-col :span="6"> | ||
| 55 | + <el-select v-model="resourceStoreUseRecordManageInfo.conditions.parentRstId" | ||
| 56 | + :placeholder="$t('resourceStoreUseRecordManage.search.parentRstId')" style="width:100%" | ||
| 57 | + @change="_listResourceStoreSonTypes"> | ||
| 58 | + <el-option v-for="item in resourceStoreUseRecordManageInfo.resourceStoreTypes" :key="item.rstId" | ||
| 59 | + :label="item.name" :value="item.rstId" /> | ||
| 60 | + </el-select> | ||
| 61 | + </el-col> | ||
| 62 | + <el-col :span="8"> | ||
| 63 | + <el-select v-model="resourceStoreUseRecordManageInfo.conditions.rstId" | ||
| 64 | + :placeholder="$t('resourceStoreUseRecordManage.search.rstId')" style="width:100%" | ||
| 65 | + @change="_listResourceStoreSpecifications"> | ||
| 66 | + <el-option v-for="item in resourceStoreUseRecordManageInfo.resourceStoreSonTypes" :key="item.rstId" | ||
| 67 | + :label="item.name" :value="item.rstId" /> | ||
| 68 | + </el-select> | ||
| 69 | + </el-col> | ||
| 70 | + <el-col :span="6"> | ||
| 71 | + <el-select v-model="resourceStoreUseRecordManageInfo.conditions.rssId" | ||
| 72 | + :placeholder="$t('resourceStoreUseRecordManage.search.rssId')" style="width:100%"> | ||
| 73 | + <el-option v-for="item in resourceStoreUseRecordManageInfo.resourceStoreSpecifications" :key="item.rssId" | ||
| 74 | + :label="item.specName" :value="item.rssId" /> | ||
| 75 | + </el-select> | ||
| 76 | + </el-col> | ||
| 77 | + </el-row> | ||
| 78 | + | ||
| 79 | + <el-row :gutter="20" class="mt-20"> | ||
| 80 | + <el-col :span="6"> | ||
| 81 | + <el-select v-model="resourceStoreUseRecordManageInfo.conditions.state" | ||
| 82 | + :placeholder="$t('resourceStoreUseRecordManage.search.state')" style="width:100%"> | ||
| 83 | + <el-option v-for="item in resourceStoreUseRecordManageInfo.states" :key="item.statusCd" :label="item.name" | ||
| 84 | + :value="item.statusCd" /> | ||
| 85 | + </el-select> | ||
| 86 | + </el-col> | ||
| 87 | + <el-col :span="8"> | ||
| 88 | + <el-date-picker v-model="resourceStoreUseRecordManageInfo.conditions.startTime" type="datetime" | ||
| 89 | + :placeholder="$t('resourceStoreUseRecordManage.search.startTime')" style="width:100%" /> | ||
| 90 | + </el-col> | ||
| 91 | + <el-col :span="6"> | ||
| 92 | + <el-date-picker v-model="resourceStoreUseRecordManageInfo.conditions.endTime" type="datetime" | ||
| 93 | + :placeholder="$t('resourceStoreUseRecordManage.search.endTime')" style="width:100%" /> | ||
| 94 | + </el-col> | ||
| 95 | + </el-row> | ||
| 96 | + </div> | ||
| 97 | + </el-card> | ||
| 98 | + | ||
| 99 | + <!-- 使用记录列表 --> | ||
| 100 | + <el-card class="list-wrapper mt-20"> | ||
| 101 | + <div slot="header" class="flex justify-between"> | ||
| 102 | + <span>{{ $t('resourceStoreUseRecordManage.list.title') }}</span> | ||
| 103 | + <el-button style="float: right; padding: 3px 0" type="text" @click="_exportExcel()"> | ||
| 104 | + <i class="el-icon-download"></i> | ||
| 105 | + {{ $t('common.export') }} | ||
| 106 | + </el-button> | ||
| 107 | + </div> | ||
| 108 | + | ||
| 109 | + <el-table v-loading="loading" :data="resourceStoreUseRecordManageInfo.resourceStoreUseRecords" border | ||
| 110 | + style="width: 100%"> | ||
| 111 | + <el-table-column prop="rsurId" :label="$t('resourceStoreUseRecordManage.table.rsurId')" align="center" /> | ||
| 112 | + <el-table-column prop="repairId" :label="$t('resourceStoreUseRecordManage.table.repairId')" align="center" /> | ||
| 113 | + <el-table-column prop="resId" :label="$t('resourceStoreUseRecordManage.table.resId')" align="center" /> | ||
| 114 | + <el-table-column :label="$t('resourceStoreUseRecordManage.table.resourceType')" align="center"> | ||
| 115 | + <template slot-scope="scope"> | ||
| 116 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 117 | + </template> | ||
| 118 | + </el-table-column> | ||
| 119 | + <el-table-column :label="$t('resourceStoreUseRecordManage.table.resourceStoreName')" align="center"> | ||
| 120 | + <template slot-scope="scope"> | ||
| 121 | + {{ scope.row.resourceStoreName || '-' }} | ||
| 122 | + </template> | ||
| 123 | + </el-table-column> | ||
| 124 | + <el-table-column :label="$t('resourceStoreUseRecordManage.table.specName')" align="center"> | ||
| 125 | + <template slot-scope="scope"> | ||
| 126 | + {{ scope.row.specName || '-' }} | ||
| 127 | + </template> | ||
| 128 | + </el-table-column> | ||
| 129 | + <el-table-column prop="isFixedName" :label="$t('resourceStoreUseRecordManage.table.isFixedName')" | ||
| 130 | + align="center" /> | ||
| 131 | + <el-table-column prop="stateName" :label="$t('resourceStoreUseRecordManage.table.stateName')" align="center" /> | ||
| 132 | + <el-table-column :label="$t('resourceStoreUseRecordManage.table.quantity')" align="center"> | ||
| 133 | + <template slot-scope="scope"> | ||
| 134 | + {{ scope.row.quantity }}{{ scope.row.miniUnitCodeName }} | ||
| 135 | + </template> | ||
| 136 | + </el-table-column> | ||
| 137 | + <el-table-column :label="$t('resourceStoreUseRecordManage.table.unitPrice')" align="center"> | ||
| 138 | + <template slot-scope="scope"> | ||
| 139 | + {{ scope.row.unitPrice || '-' }} | ||
| 140 | + </template> | ||
| 141 | + </el-table-column> | ||
| 142 | + <el-table-column prop="createUserId" :label="$t('resourceStoreUseRecordManage.table.createUserId')" | ||
| 143 | + align="center" /> | ||
| 144 | + <el-table-column prop="createUserName" :label="$t('resourceStoreUseRecordManage.table.createUserName')" | ||
| 145 | + align="center" /> | ||
| 146 | + <el-table-column prop="createTime" :label="$t('resourceStoreUseRecordManage.table.createTime')" align="center" /> | ||
| 147 | + <el-table-column prop="remark" :label="$t('resourceStoreUseRecordManage.table.remark')" align="center" /> | ||
| 148 | + </el-table> | ||
| 149 | + | ||
| 150 | + <el-pagination class="mt-20" :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 151 | + layout="total, sizes, prev, pager, next, jumper" :total="resourceStoreUseRecordManageInfo.total" | ||
| 152 | + @size-change="handleSizeChange" @current-change="handleCurrentChange" /> | ||
| 153 | + </el-card> | ||
| 154 | + </div> | ||
| 155 | +</template> | ||
| 156 | + | ||
| 157 | +<script> | ||
| 158 | +import { listResourceStoreUseRecords, listResourceStoreTypes, listResourceStoreSpecifications, exportData } from '@/api/resource/resourceStoreUseRecordManageApi' | ||
| 159 | +import { getDict } from '@/api/community/communityApi' | ||
| 160 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 161 | + | ||
| 162 | +export default { | ||
| 163 | + name: 'ResourceStoreUseRecordManageList', | ||
| 164 | + data() { | ||
| 165 | + return { | ||
| 166 | + loading: false, | ||
| 167 | + resourceStoreUseRecordManageInfo: { | ||
| 168 | + resourceStoreUseRecords: [], | ||
| 169 | + total: 0, | ||
| 170 | + records: 1, | ||
| 171 | + moreCondition: false, | ||
| 172 | + states: [], | ||
| 173 | + conditions: { | ||
| 174 | + rsurId: '', | ||
| 175 | + repairId: '', | ||
| 176 | + resId: '', | ||
| 177 | + resName: '', | ||
| 178 | + parentRstId: '', | ||
| 179 | + rstId: '', | ||
| 180 | + rssId: '', | ||
| 181 | + createUserId: '', | ||
| 182 | + createUserName: '', | ||
| 183 | + startTime: '', | ||
| 184 | + endTime: '', | ||
| 185 | + state: '', | ||
| 186 | + userId: '', | ||
| 187 | + userName: '', | ||
| 188 | + communityId: '' | ||
| 189 | + }, | ||
| 190 | + resourceStoreTypes: [], | ||
| 191 | + resourceStoreSonTypes: [], | ||
| 192 | + resourceStoreSpecifications: [] | ||
| 193 | + }, | ||
| 194 | + page: { | ||
| 195 | + current: 1, | ||
| 196 | + size: 10 | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + created() { | ||
| 201 | + this.communityId = getCommunityId() | ||
| 202 | + this.resourceStoreUseRecordManageInfo.conditions.communityId = this.communityId | ||
| 203 | + this._initMethod() | ||
| 204 | + }, | ||
| 205 | + methods: { | ||
| 206 | + async _initMethod() { | ||
| 207 | + try { | ||
| 208 | + this.loading = true | ||
| 209 | + await this.getDictData() | ||
| 210 | + await this._listResourceStoreTypes() | ||
| 211 | + await this._listResourceStoreUseRecords() | ||
| 212 | + } catch (error) { | ||
| 213 | + console.error(error) | ||
| 214 | + } finally { | ||
| 215 | + this.loading = false | ||
| 216 | + } | ||
| 217 | + }, | ||
| 218 | + async getDictData() { | ||
| 219 | + try { | ||
| 220 | + const data = await getDict('resource_store_use_record', 'state') | ||
| 221 | + this.resourceStoreUseRecordManageInfo.states = data | ||
| 222 | + } catch (error) { | ||
| 223 | + console.error('获取字典数据失败:', error) | ||
| 224 | + } | ||
| 225 | + }, | ||
| 226 | + async _listResourceStoreUseRecords() { | ||
| 227 | + try { | ||
| 228 | + this.loading = true | ||
| 229 | + const params = { | ||
| 230 | + page: this.page.current, | ||
| 231 | + row: this.page.size, | ||
| 232 | + ...this.resourceStoreUseRecordManageInfo.conditions | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + const { data, total } = await listResourceStoreUseRecords(params) | ||
| 236 | + this.resourceStoreUseRecordManageInfo.resourceStoreUseRecords = data | ||
| 237 | + this.resourceStoreUseRecordManageInfo.total = total | ||
| 238 | + } catch (error) { | ||
| 239 | + console.error(error) | ||
| 240 | + } finally { | ||
| 241 | + this.loading = false | ||
| 242 | + } | ||
| 243 | + }, | ||
| 244 | + async _listResourceStoreTypes() { | ||
| 245 | + try { | ||
| 246 | + const params = { | ||
| 247 | + page: 1, | ||
| 248 | + row: 100, | ||
| 249 | + communityId: this.communityId, | ||
| 250 | + parentId: '0' | ||
| 251 | + } | ||
| 252 | + const { data } = await listResourceStoreTypes(params) | ||
| 253 | + this.resourceStoreUseRecordManageInfo.resourceStoreTypes = data | ||
| 254 | + } catch (error) { | ||
| 255 | + console.error(error) | ||
| 256 | + } | ||
| 257 | + }, | ||
| 258 | + async _listResourceStoreSonTypes() { | ||
| 259 | + try { | ||
| 260 | + this.resourceStoreUseRecordManageInfo.conditions.rstId = '' | ||
| 261 | + this.resourceStoreUseRecordManageInfo.resourceStoreSonTypes = [] | ||
| 262 | + | ||
| 263 | + if (!this.resourceStoreUseRecordManageInfo.conditions.parentRstId) return | ||
| 264 | + | ||
| 265 | + const params = { | ||
| 266 | + page: 1, | ||
| 267 | + row: 100, | ||
| 268 | + communityId: this.communityId, | ||
| 269 | + parentId: this.resourceStoreUseRecordManageInfo.conditions.parentRstId | ||
| 270 | + } | ||
| 271 | + const { data } = await listResourceStoreTypes(params) | ||
| 272 | + this.resourceStoreUseRecordManageInfo.resourceStoreSonTypes = data | ||
| 273 | + } catch (error) { | ||
| 274 | + console.error(error) | ||
| 275 | + } | ||
| 276 | + }, | ||
| 277 | + async _listResourceStoreSpecifications() { | ||
| 278 | + try { | ||
| 279 | + this.resourceStoreUseRecordManageInfo.resourceStoreSpecifications = [] | ||
| 280 | + this.resourceStoreUseRecordManageInfo.conditions.rssId = '' | ||
| 281 | + | ||
| 282 | + if (!this.resourceStoreUseRecordManageInfo.conditions.rstId) return | ||
| 283 | + | ||
| 284 | + const params = { | ||
| 285 | + page: 1, | ||
| 286 | + row: 100, | ||
| 287 | + communityId: this.communityId, | ||
| 288 | + rstId: this.resourceStoreUseRecordManageInfo.conditions.rstId | ||
| 289 | + } | ||
| 290 | + const { data } = await listResourceStoreSpecifications(params) | ||
| 291 | + this.resourceStoreUseRecordManageInfo.resourceStoreSpecifications = data | ||
| 292 | + } catch (error) { | ||
| 293 | + console.error(error) | ||
| 294 | + } | ||
| 295 | + }, | ||
| 296 | + _queryResourceStoreUseRecordMethod() { | ||
| 297 | + this.page.current = 1 | ||
| 298 | + this._listResourceStoreUseRecords() | ||
| 299 | + }, | ||
| 300 | + _resetResourceStoreUseRecordMethod() { | ||
| 301 | + this.resourceStoreUseRecordManageInfo.conditions = { | ||
| 302 | + rsurId: '', | ||
| 303 | + repairId: '', | ||
| 304 | + resId: '', | ||
| 305 | + resName: '', | ||
| 306 | + parentRstId: '', | ||
| 307 | + rstId: '', | ||
| 308 | + rssId: '', | ||
| 309 | + createUserId: '', | ||
| 310 | + createUserName: '', | ||
| 311 | + startTime: '', | ||
| 312 | + endTime: '', | ||
| 313 | + state: '', | ||
| 314 | + userId: this.resourceStoreUseRecordManageInfo.conditions.userId, | ||
| 315 | + userName: this.resourceStoreUseRecordManageInfo.conditions.userName, | ||
| 316 | + communityId: this.communityId | ||
| 317 | + } | ||
| 318 | + this.resourceStoreUseRecordManageInfo.resourceStoreSonTypes = [] | ||
| 319 | + this.resourceStoreUseRecordManageInfo.resourceStoreSpecifications = [] | ||
| 320 | + this.page.current = 1 | ||
| 321 | + this._listResourceStoreUseRecords() | ||
| 322 | + }, | ||
| 323 | + _moreCondition() { | ||
| 324 | + this.resourceStoreUseRecordManageInfo.moreCondition = !this.resourceStoreUseRecordManageInfo.moreCondition | ||
| 325 | + }, | ||
| 326 | + async _exportExcel() { | ||
| 327 | + try { | ||
| 328 | + this.loading = true | ||
| 329 | + const params = { | ||
| 330 | + pagePath: 'resourceStoreUseRecordManage', | ||
| 331 | + ...this.resourceStoreUseRecordManageInfo.conditions | ||
| 332 | + } | ||
| 333 | + await exportData(params) | ||
| 334 | + this.$message.success(this.$t('common.exportSuccess')) | ||
| 335 | + } catch (error) { | ||
| 336 | + console.error(error) | ||
| 337 | + this.$message.error(this.$t('common.exportFailed')) | ||
| 338 | + } finally { | ||
| 339 | + this.loading = false | ||
| 340 | + } | ||
| 341 | + }, | ||
| 342 | + handleSizeChange(val) { | ||
| 343 | + this.page.size = val | ||
| 344 | + this._listResourceStoreUseRecords() | ||
| 345 | + }, | ||
| 346 | + handleCurrentChange(val) { | ||
| 347 | + this.page.current = val | ||
| 348 | + this._listResourceStoreUseRecords() | ||
| 349 | + } | ||
| 350 | + } | ||
| 351 | +} | ||
| 352 | +</script> | ||
| 353 | + | ||
| 354 | +<style lang="scss" scoped> | ||
| 355 | +.resource-store-use-record-manage-container { | ||
| 356 | + padding: 20px; | ||
| 357 | + | ||
| 358 | + .search-wrapper { | ||
| 359 | + margin-bottom: 20px; | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + .mt-20 { | ||
| 363 | + margin-top: 20px; | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + .el-date-editor, | ||
| 367 | + .el-select, | ||
| 368 | + .el-input { | ||
| 369 | + width: 100%; | ||
| 370 | + } | ||
| 371 | +} | ||
| 372 | +</style> | ||
| 0 | \ No newline at end of file | 373 | \ No newline at end of file |
src/views/work/myRepairDispatchManageList.vue
| @@ -244,7 +244,7 @@ export default { | @@ -244,7 +244,7 @@ export default { | ||
| 244 | const params = { | 244 | const params = { |
| 245 | repairId: this.myRepairDispatchInfo.currentRepairId, | 245 | repairId: this.myRepairDispatchInfo.currentRepairId, |
| 246 | context: orderInfo.remark, | 246 | context: orderInfo.remark, |
| 247 | - communityId: this.$store.getters.communityId, | 247 | + communityId: this.getCommunityId(), |
| 248 | state: orderInfo.state === '1100' ? '10002' : '10003' | 248 | state: orderInfo.state === '1100' ? '10002' : '10003' |
| 249 | } | 249 | } |
| 250 | 250 |