Commit 66eb78ed749dbe9d01c4ea2182657a78a6e771e4
1 parent
1d73dc48
开发采购功能
Showing
20 changed files
with
2593 additions
and
10 deletions
src/api/resource/resourceAuditFlowApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取审批流程列表 | ||
| 5 | +export function listResourceAuditFlow(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + const communityId = getCommunityId() | ||
| 8 | + request({ | ||
| 9 | + url: '/resourceStore.listResourceAuditFlow', | ||
| 10 | + method: 'get', | ||
| 11 | + params: { | ||
| 12 | + ...params, | ||
| 13 | + communityId | ||
| 14 | + } | ||
| 15 | + }).then(response => { | ||
| 16 | + const res = response.data | ||
| 17 | + if (res.code === 0) { | ||
| 18 | + resolve(res) | ||
| 19 | + } else { | ||
| 20 | + reject(new Error(res.msg || '获取审批流程列表失败')) | ||
| 21 | + } | ||
| 22 | + }).catch(error => { | ||
| 23 | + reject(error) | ||
| 24 | + }) | ||
| 25 | + }) | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +// 添加审批流程 | ||
| 29 | +export function saveResourceAuditFlow(data) { | ||
| 30 | + return new Promise((resolve, reject) => { | ||
| 31 | + const communityId = getCommunityId() | ||
| 32 | + request({ | ||
| 33 | + url: '/resourceStore.saveResourceAuditFlow', | ||
| 34 | + method: 'post', | ||
| 35 | + data: { | ||
| 36 | + ...data, | ||
| 37 | + communityId | ||
| 38 | + } | ||
| 39 | + }).then(response => { | ||
| 40 | + const res = response.data | ||
| 41 | + if (res.code === 0) { | ||
| 42 | + resolve(res) | ||
| 43 | + } else { | ||
| 44 | + reject(new Error(res.msg || '添加审批流程失败')) | ||
| 45 | + } | ||
| 46 | + }).catch(error => { | ||
| 47 | + reject(error) | ||
| 48 | + }) | ||
| 49 | + }) | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +// 更新审批流程 | ||
| 53 | +export function updateResourceAuditFlow(data) { | ||
| 54 | + return new Promise((resolve, reject) => { | ||
| 55 | + const communityId = getCommunityId() | ||
| 56 | + request({ | ||
| 57 | + url: '/resourceStore.updateResourceAuditFlow', | ||
| 58 | + method: 'post', | ||
| 59 | + data: { | ||
| 60 | + ...data, | ||
| 61 | + communityId | ||
| 62 | + } | ||
| 63 | + }).then(response => { | ||
| 64 | + const res = response.data | ||
| 65 | + if (res.code === 0) { | ||
| 66 | + resolve(res) | ||
| 67 | + } else { | ||
| 68 | + reject(new Error(res.msg || '更新审批流程失败')) | ||
| 69 | + } | ||
| 70 | + }).catch(error => { | ||
| 71 | + reject(error) | ||
| 72 | + }) | ||
| 73 | + }) | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +// 删除审批流程 | ||
| 77 | +export function deleteResourceAuditFlow(data) { | ||
| 78 | + return new Promise((resolve, reject) => { | ||
| 79 | + const communityId = getCommunityId() | ||
| 80 | + request({ | ||
| 81 | + url: '/resourceStore.deleteResourceAuditFlow', | ||
| 82 | + method: 'post', | ||
| 83 | + data: { | ||
| 84 | + ...data, | ||
| 85 | + communityId | ||
| 86 | + } | ||
| 87 | + }).then(response => { | ||
| 88 | + const res = response.data | ||
| 89 | + if (res.code === 0) { | ||
| 90 | + resolve(res) | ||
| 91 | + } else { | ||
| 92 | + reject(new Error(res.msg || '删除审批流程失败')) | ||
| 93 | + } | ||
| 94 | + }).catch(error => { | ||
| 95 | + reject(error) | ||
| 96 | + }) | ||
| 97 | + }) | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +// 部署流程 | ||
| 101 | +export function deployWorkflow(data) { | ||
| 102 | + return new Promise((resolve, reject) => { | ||
| 103 | + request({ | ||
| 104 | + url: '/workflow/deployModel', | ||
| 105 | + method: 'post', | ||
| 106 | + data | ||
| 107 | + }).then(response => { | ||
| 108 | + const res = response.data | ||
| 109 | + if (res.code === 0) { | ||
| 110 | + resolve(res) | ||
| 111 | + } else { | ||
| 112 | + reject(new Error(res.msg || '部署流程失败')) | ||
| 113 | + } | ||
| 114 | + }).catch(error => { | ||
| 115 | + reject(error) | ||
| 116 | + }) | ||
| 117 | + }) | ||
| 118 | +} | ||
| 0 | \ No newline at end of file | 119 | \ No newline at end of file |
src/api/resource/resourceStoreSpecificationManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 查询规格列表 | ||
| 5 | +export function listResourceStoreSpecifications(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + params.communityId = getCommunityId() | ||
| 8 | + request({ | ||
| 9 | + url: '/resourceStore.listResourceStoreSpecifications', | ||
| 10 | + method: 'get', | ||
| 11 | + params | ||
| 12 | + }).then(response => { | ||
| 13 | + const res = response.data | ||
| 14 | + if (res.code === 0) { | ||
| 15 | + resolve(res) | ||
| 16 | + } else { | ||
| 17 | + reject(new Error(res.msg || 'Query specification list failed')) | ||
| 18 | + } | ||
| 19 | + }).catch(error => { | ||
| 20 | + reject(error) | ||
| 21 | + }) | ||
| 22 | + }) | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +// 添加规格 | ||
| 26 | +export function saveResourceStoreSpecification(data) { | ||
| 27 | + return new Promise((resolve, reject) => { | ||
| 28 | + data.communityId = getCommunityId() | ||
| 29 | + request({ | ||
| 30 | + url: '/resourceStore.saveResourceStoreSpecification', | ||
| 31 | + method: 'post', | ||
| 32 | + data | ||
| 33 | + }).then(response => { | ||
| 34 | + const res = response.data | ||
| 35 | + if (res.code === 0) { | ||
| 36 | + resolve(res) | ||
| 37 | + } else { | ||
| 38 | + reject(new Error(res.msg || 'Add specification failed')) | ||
| 39 | + } | ||
| 40 | + }).catch(error => { | ||
| 41 | + reject(error) | ||
| 42 | + }) | ||
| 43 | + }) | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +// 更新规格 | ||
| 47 | +export function updateResourceStoreSpecification(data) { | ||
| 48 | + return new Promise((resolve, reject) => { | ||
| 49 | + data.communityId = getCommunityId() | ||
| 50 | + request({ | ||
| 51 | + url: '/resourceStore.updateResourceStoreSpecification', | ||
| 52 | + method: 'post', | ||
| 53 | + data | ||
| 54 | + }).then(response => { | ||
| 55 | + const res = response.data | ||
| 56 | + if (res.code === 0) { | ||
| 57 | + resolve(res) | ||
| 58 | + } else { | ||
| 59 | + reject(new Error(res.msg || 'Update specification failed')) | ||
| 60 | + } | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 删除规格 | ||
| 68 | +export function deleteResourceStoreSpecification(rssId) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/resourceStore.deleteResourceStoreSpecification', | ||
| 72 | + method: 'post', | ||
| 73 | + data: { | ||
| 74 | + rssId, | ||
| 75 | + communityId: getCommunityId() | ||
| 76 | + } | ||
| 77 | + }).then(response => { | ||
| 78 | + const res = response.data | ||
| 79 | + if (res.code === 0) { | ||
| 80 | + resolve(res) | ||
| 81 | + } else { | ||
| 82 | + reject(new Error(res.msg || 'Delete specification failed')) | ||
| 83 | + } | ||
| 84 | + }).catch(error => { | ||
| 85 | + reject(error) | ||
| 86 | + }) | ||
| 87 | + }) | ||
| 88 | +} | ||
| 89 | + | ||
| 90 | +// 查询物品类型列表 | ||
| 91 | +export function listResourceStoreTypes(params) { | ||
| 92 | + return new Promise((resolve, reject) => { | ||
| 93 | + params.communityId = getCommunityId() | ||
| 94 | + request({ | ||
| 95 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 96 | + method: 'get', | ||
| 97 | + params | ||
| 98 | + }).then(response => { | ||
| 99 | + const res = response.data | ||
| 100 | + if (res.code === 0) { | ||
| 101 | + resolve(res) | ||
| 102 | + } else { | ||
| 103 | + reject(new Error(res.msg || 'Query item types failed')) | ||
| 104 | + } | ||
| 105 | + }).catch(error => { | ||
| 106 | + reject(error) | ||
| 107 | + }) | ||
| 108 | + }) | ||
| 109 | +} | ||
| 0 | \ No newline at end of file | 110 | \ No newline at end of file |
src/api/resource/storehouseManageApi.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 | + const baseParams = { | ||
| 8 | + communityId: getCommunityId() | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + request({ | ||
| 12 | + url: '/resourceStore.listStorehouses', | ||
| 13 | + method: 'get', | ||
| 14 | + params: { ...baseParams, ...params } | ||
| 15 | + }).then(response => { | ||
| 16 | + const res = response.data | ||
| 17 | + if (res.code === 0) { | ||
| 18 | + resolve({ | ||
| 19 | + data: res.data, | ||
| 20 | + total: res.total, | ||
| 21 | + records: res.records | ||
| 22 | + }) | ||
| 23 | + } else { | ||
| 24 | + reject(new Error(res.msg || 'Failed to get warehouse list')) | ||
| 25 | + } | ||
| 26 | + }).catch(error => { | ||
| 27 | + reject(error) | ||
| 28 | + }) | ||
| 29 | + }) | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +// 添加仓库 | ||
| 33 | +export function saveStorehouse(data) { | ||
| 34 | + return new Promise((resolve, reject) => { | ||
| 35 | + request({ | ||
| 36 | + url: '/resourceStore.saveStorehouse', | ||
| 37 | + method: 'post', | ||
| 38 | + data: { | ||
| 39 | + ...data, | ||
| 40 | + communityId: getCommunityId() | ||
| 41 | + } | ||
| 42 | + }).then(response => { | ||
| 43 | + const res = response.data | ||
| 44 | + if (res.code === 0) { | ||
| 45 | + resolve(res) | ||
| 46 | + } else { | ||
| 47 | + reject(new Error(res.msg || 'Failed to add warehouse')) | ||
| 48 | + } | ||
| 49 | + }).catch(error => { | ||
| 50 | + reject(error) | ||
| 51 | + }) | ||
| 52 | + }) | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +// 更新仓库 | ||
| 56 | +export function updateStorehouse(data) { | ||
| 57 | + return new Promise((resolve, reject) => { | ||
| 58 | + request({ | ||
| 59 | + url: '/resourceStore.updateStorehouse', | ||
| 60 | + method: 'post', | ||
| 61 | + data: { | ||
| 62 | + ...data, | ||
| 63 | + communityId: getCommunityId() | ||
| 64 | + } | ||
| 65 | + }).then(response => { | ||
| 66 | + const res = response.data | ||
| 67 | + if (res.code === 0) { | ||
| 68 | + resolve(res) | ||
| 69 | + } else { | ||
| 70 | + reject(new Error(res.msg || 'Failed to update warehouse')) | ||
| 71 | + } | ||
| 72 | + }).catch(error => { | ||
| 73 | + reject(error) | ||
| 74 | + }) | ||
| 75 | + }) | ||
| 76 | +} | ||
| 77 | + | ||
| 78 | +// 删除仓库 | ||
| 79 | +export function deleteStorehouse(data) { | ||
| 80 | + return new Promise((resolve, reject) => { | ||
| 81 | + request({ | ||
| 82 | + url: '/resourceStore.deleteStorehouse', | ||
| 83 | + method: 'post', | ||
| 84 | + data: { | ||
| 85 | + ...data, | ||
| 86 | + communityId: getCommunityId() | ||
| 87 | + } | ||
| 88 | + }).then(response => { | ||
| 89 | + const res = response.data | ||
| 90 | + if (res.code === 0) { | ||
| 91 | + resolve(res) | ||
| 92 | + } else { | ||
| 93 | + reject(new Error(res.msg || 'Failed to delete warehouse')) | ||
| 94 | + } | ||
| 95 | + }).catch(error => { | ||
| 96 | + reject(error) | ||
| 97 | + }) | ||
| 98 | + }) | ||
| 99 | +} | ||
| 100 | + | ||
| 101 | +// 获取审核流程列表 | ||
| 102 | +export function listResourceAuditFlow(params) { | ||
| 103 | + return new Promise((resolve, reject) => { | ||
| 104 | + const baseParams = { | ||
| 105 | + communityId: getCommunityId(), | ||
| 106 | + page: 1, | ||
| 107 | + row: 100 | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + request({ | ||
| 111 | + url: '/resourceStore.listResourceAuditFlow', | ||
| 112 | + method: 'get', | ||
| 113 | + params: { ...baseParams, ...params } | ||
| 114 | + }).then(response => { | ||
| 115 | + const res = response.data | ||
| 116 | + if (res.code === 0) { | ||
| 117 | + resolve({ | ||
| 118 | + data: res.data, | ||
| 119 | + total: res.total, | ||
| 120 | + records: res.records | ||
| 121 | + }) | ||
| 122 | + } else { | ||
| 123 | + reject(new Error(res.msg || 'Failed to get audit flow list')) | ||
| 124 | + } | ||
| 125 | + }).catch(error => { | ||
| 126 | + reject(error) | ||
| 127 | + }) | ||
| 128 | + }) | ||
| 129 | +} | ||
| 0 | \ No newline at end of file | 130 | \ No newline at end of file |
src/components/resource/AddResourceAuditFlow.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceAuditFlow.addTitle')" | ||
| 4 | + :visible.sync="dialogVisible" | ||
| 5 | + width="600px" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||
| 9 | + <el-form-item | ||
| 10 | + :label="$t('resourceAuditFlow.flowName')" | ||
| 11 | + prop="flowName" | ||
| 12 | + :label-width="formLabelWidth" | ||
| 13 | + > | ||
| 14 | + <el-input | ||
| 15 | + v-model="form.flowName" | ||
| 16 | + :placeholder="$t('resourceAuditFlow.flowNamePlaceholder')" | ||
| 17 | + /> | ||
| 18 | + </el-form-item> | ||
| 19 | + | ||
| 20 | + <el-form-item | ||
| 21 | + :label="$t('resourceAuditFlow.flowType')" | ||
| 22 | + prop="auditType" | ||
| 23 | + :label-width="formLabelWidth" | ||
| 24 | + > | ||
| 25 | + <el-select | ||
| 26 | + v-model="form.auditType" | ||
| 27 | + :placeholder="$t('resourceAuditFlow.flowTypePlaceholder')" | ||
| 28 | + style="width:100%" | ||
| 29 | + > | ||
| 30 | + <el-option | ||
| 31 | + :label="$t('resourceAuditFlow.purchaseFlow')" | ||
| 32 | + value="10001" | ||
| 33 | + /> | ||
| 34 | + <el-option | ||
| 35 | + :label="$t('resourceAuditFlow.receiveFlow')" | ||
| 36 | + value="10002" | ||
| 37 | + /> | ||
| 38 | + <el-option | ||
| 39 | + :label="$t('resourceAuditFlow.transferFlow')" | ||
| 40 | + value="10003" | ||
| 41 | + /> | ||
| 42 | + </el-select> | ||
| 43 | + </el-form-item> | ||
| 44 | + | ||
| 45 | + <el-form-item | ||
| 46 | + :label="$t('resourceAuditFlow.remark')" | ||
| 47 | + prop="remark" | ||
| 48 | + :label-width="formLabelWidth" | ||
| 49 | + > | ||
| 50 | + <el-input | ||
| 51 | + v-model="form.remark" | ||
| 52 | + type="textarea" | ||
| 53 | + :rows="3" | ||
| 54 | + :placeholder="$t('resourceAuditFlow.remarkPlaceholder')" | ||
| 55 | + /> | ||
| 56 | + </el-form-item> | ||
| 57 | + </el-form> | ||
| 58 | + | ||
| 59 | + <div slot="footer" class="dialog-footer"> | ||
| 60 | + <el-button @click="dialogVisible = false"> | ||
| 61 | + {{ $t('resourceAuditFlow.cancel') }} | ||
| 62 | + </el-button> | ||
| 63 | + <el-button type="primary" @click="handleSubmit"> | ||
| 64 | + {{ $t('resourceAuditFlow.save') }} | ||
| 65 | + </el-button> | ||
| 66 | + </div> | ||
| 67 | + </el-dialog> | ||
| 68 | +</template> | ||
| 69 | + | ||
| 70 | +<script> | ||
| 71 | +import { saveResourceAuditFlow } from '@/api/resource/resourceAuditFlowApi' | ||
| 72 | + | ||
| 73 | +export default { | ||
| 74 | + name: 'AddResourceAuditFlow', | ||
| 75 | + data() { | ||
| 76 | + return { | ||
| 77 | + dialogVisible: false, | ||
| 78 | + formLabelWidth: '120px', | ||
| 79 | + form: { | ||
| 80 | + flowName: '', | ||
| 81 | + auditType: '', | ||
| 82 | + remark: '' | ||
| 83 | + }, | ||
| 84 | + rules: { | ||
| 85 | + flowName: [ | ||
| 86 | + { required: true, message: this.$t('resourceAuditFlow.flowNameRequired'), trigger: 'blur' }, | ||
| 87 | + { max: 30, message: this.$t('resourceAuditFlow.maxLength30'), trigger: 'blur' } | ||
| 88 | + ], | ||
| 89 | + auditType: [ | ||
| 90 | + { required: true, message: this.$t('resourceAuditFlow.flowTypeRequired'), trigger: 'change' } | ||
| 91 | + ], | ||
| 92 | + remark: [ | ||
| 93 | + { max: 512, message: this.$t('resourceAuditFlow.maxLength512'), trigger: 'blur' } | ||
| 94 | + ] | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + }, | ||
| 98 | + methods: { | ||
| 99 | + open() { | ||
| 100 | + this.dialogVisible = true | ||
| 101 | + }, | ||
| 102 | + handleClose() { | ||
| 103 | + this.$refs.form.resetFields() | ||
| 104 | + this.form = { | ||
| 105 | + flowName: '', | ||
| 106 | + auditType: '', | ||
| 107 | + remark: '' | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + handleSubmit() { | ||
| 111 | + this.$refs.form.validate(async (valid) => { | ||
| 112 | + if (valid) { | ||
| 113 | + try { | ||
| 114 | + const res = await saveResourceAuditFlow(this.form) | ||
| 115 | + if (res.code === 0) { | ||
| 116 | + this.$message.success(this.$t('common.addSuccess')) | ||
| 117 | + this.dialogVisible = false | ||
| 118 | + this.$emit('success') | ||
| 119 | + } else { | ||
| 120 | + this.$message.error(res.msg || this.$t('common.addFailed')) | ||
| 121 | + } | ||
| 122 | + } catch (error) { | ||
| 123 | + console.error('添加审批流程失败:', error) | ||
| 124 | + this.$message.error(this.$t('common.addFailed')) | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + }) | ||
| 128 | + } | ||
| 129 | + } | ||
| 130 | +} | ||
| 131 | +</script> | ||
| 0 | \ No newline at end of file | 132 | \ No newline at end of file |
src/components/resource/AddStorehouse.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog :title="$t('storehouseManage.buttons.add')" :visible.sync="visible" width="50%" @close="close"> | ||
| 3 | + <el-form :model="form" label-width="150px" :rules="rules" ref="form"> | ||
| 4 | + <el-form-item :label="$t('storehouseManage.table.shName')" prop="shName"> | ||
| 5 | + <el-input v-model="form.shName" :placeholder="$t('storehouseManage.placeholders.shName')" /> | ||
| 6 | + </el-form-item> | ||
| 7 | + | ||
| 8 | + <el-form-item :label="$t('storehouseManage.table.isShow')" prop="isShow"> | ||
| 9 | + <el-select v-model="form.isShow" style="width:100%"> | ||
| 10 | + <el-option :label="$t('storehouseManage.options.yes')" value="true" /> | ||
| 11 | + <el-option :label="$t('storehouseManage.options.no')" value="false" /> | ||
| 12 | + </el-select> | ||
| 13 | + </el-form-item> | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + <el-form-item :label="$t('storehouseManage.table.allowPurchase')" prop="allowPurchase"> | ||
| 17 | + <el-select v-model="form.allowPurchase" style="width:100%"> | ||
| 18 | + <el-option :label="$t('storehouseManage.options.yes')" value="ON" /> | ||
| 19 | + <el-option :label="$t('storehouseManage.options.no')" value="OFF" /> | ||
| 20 | + </el-select> | ||
| 21 | + </el-form-item> | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + <el-form-item :label="$t('storehouseManage.table.allowUse')" prop="allowUse"> | ||
| 25 | + <el-select v-model="form.allowUse" style="width:100%"> | ||
| 26 | + <el-option :label="$t('storehouseManage.options.yes')" value="ON" /> | ||
| 27 | + <el-option :label="$t('storehouseManage.options.no')" value="OFF" /> | ||
| 28 | + </el-select> | ||
| 29 | + </el-form-item> | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + <el-form-item :label="$t('storehouseManage.table.purchaseSwitch')" prop="purchaseSwitch"> | ||
| 33 | + <el-col :span="11"> | ||
| 34 | + <el-select v-model="form.purchaseSwitch" style="width:100%"> | ||
| 35 | + <el-option label="审核" value="ON" /> | ||
| 36 | + <el-option label="不审核" value="OFF" /> | ||
| 37 | + </el-select> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="11" :offset="2" v-if="form.purchaseSwitch === 'ON'"> | ||
| 40 | + <el-form-item prop="purchaseRafId"> | ||
| 41 | + <el-select v-model="form.purchaseRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 42 | + style="width:100%"> | ||
| 43 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 44 | + :label="item.flowName" :value="item.rafId" /> | ||
| 45 | + </el-select> | ||
| 46 | + </el-form-item> | ||
| 47 | + </el-col> | ||
| 48 | + </el-form-item> | ||
| 49 | + <el-form-item :label="$t('storehouseManage.table.useSwitch')" prop="useSwitch"> | ||
| 50 | + <el-col :span="11"> | ||
| 51 | + <el-select v-model="form.useSwitch" style="width:100%"> | ||
| 52 | + <el-option label="审核" value="ON" /> | ||
| 53 | + <el-option label="不审核" value="OFF" /> | ||
| 54 | + </el-select> | ||
| 55 | + </el-col> | ||
| 56 | + <el-col :span="11" :offset="2" v-if="form.useSwitch === 'ON'"> | ||
| 57 | + <el-form-item prop="useRafId"> | ||
| 58 | + <el-select v-model="form.useRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 59 | + style="width:100%"> | ||
| 60 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 61 | + :label="item.flowName" :value="item.rafId" /> | ||
| 62 | + </el-select> | ||
| 63 | + </el-form-item> | ||
| 64 | + </el-col> | ||
| 65 | + </el-form-item> | ||
| 66 | + <el-form-item :label="$t('storehouseManage.table.allocationSwitch')" prop="allocationSwitch"> | ||
| 67 | + <el-col :span="11"> | ||
| 68 | + <el-select v-model="form.allocationSwitch" style="width:100%"> | ||
| 69 | + <el-option label="审核" value="ON" /> | ||
| 70 | + <el-option label="不审核" value="OFF" /> | ||
| 71 | + </el-select> | ||
| 72 | + </el-col> | ||
| 73 | + <el-col :span="11" :offset="2" v-if="form.allocationSwitch === 'ON'"> | ||
| 74 | + <el-form-item prop="allocationRafId"> | ||
| 75 | + <el-select v-model="form.allocationRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 76 | + style="width:100%"> | ||
| 77 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 78 | + :label="item.flowName" :value="item.rafId" /> | ||
| 79 | + </el-select> | ||
| 80 | + </el-form-item> | ||
| 81 | + </el-col> | ||
| 82 | + </el-form-item> | ||
| 83 | + <!-- 其他字段类似处理 --> | ||
| 84 | + | ||
| 85 | + <el-form-item :label="$t('storehouseManage.table.shDesc')"> | ||
| 86 | + <el-input v-model="form.shDesc" type="textarea" :rows="3" | ||
| 87 | + :placeholder="$t('storehouseManage.placeholders.shDesc')" /> | ||
| 88 | + </el-form-item> | ||
| 89 | + </el-form> | ||
| 90 | + | ||
| 91 | + <div slot="footer"> | ||
| 92 | + <el-button @click="close">{{ $t('common.cancel') }}</el-button> | ||
| 93 | + <el-button type="primary" @click="saveStorehouseInfo"> | ||
| 94 | + {{ $t('common.save') }} | ||
| 95 | + </el-button> | ||
| 96 | + </div> | ||
| 97 | + </el-dialog> | ||
| 98 | +</template> | ||
| 99 | + | ||
| 100 | +<script> | ||
| 101 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 102 | +import { saveStorehouse, listResourceAuditFlow } from '@/api/resource/storehouseManageApi' | ||
| 103 | + | ||
| 104 | +export default { | ||
| 105 | + name: 'AddStorehouse', | ||
| 106 | + data() { | ||
| 107 | + return { | ||
| 108 | + visible: false, | ||
| 109 | + form: { | ||
| 110 | + shName: '', | ||
| 111 | + isShow: 'true', | ||
| 112 | + allowPurchase: 'ON', | ||
| 113 | + allowUse: 'ON', | ||
| 114 | + purchaseSwitch: 'OFF', | ||
| 115 | + purchaseRafId: '', | ||
| 116 | + useSwitch: 'OFF', | ||
| 117 | + useRafId: '', | ||
| 118 | + allocationSwitch: 'OFF', | ||
| 119 | + allocationRafId: '', | ||
| 120 | + shDesc: '', | ||
| 121 | + communityId: getCommunityId() | ||
| 122 | + }, | ||
| 123 | + flows: [], | ||
| 124 | + rules: { | ||
| 125 | + shName: [ | ||
| 126 | + { required: true, message: this.$t('storehouseManage.messages.shNameRequired'), trigger: 'blur' }, | ||
| 127 | + { max: 64, message: this.$t('storehouseManage.messages.shNameMaxLength'), trigger: 'blur' } | ||
| 128 | + ], | ||
| 129 | + isShow: [ | ||
| 130 | + { required: true, message: this.$t('storehouseManage.messages.isShowRequired'), trigger: 'change' } | ||
| 131 | + ] | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + }, | ||
| 135 | + methods: { | ||
| 136 | + open() { | ||
| 137 | + this.visible = true | ||
| 138 | + this.listResourceAuditFlows() | ||
| 139 | + }, | ||
| 140 | + close() { | ||
| 141 | + this.visible = false | ||
| 142 | + this.resetForm() | ||
| 143 | + }, | ||
| 144 | + resetForm() { | ||
| 145 | + this.form = { | ||
| 146 | + shName: '', | ||
| 147 | + isShow: 'true', | ||
| 148 | + allowPurchase: 'ON', | ||
| 149 | + allowUse: 'ON', | ||
| 150 | + purchaseSwitch: 'OFF', | ||
| 151 | + purchaseRafId: '', | ||
| 152 | + useSwitch: 'OFF', | ||
| 153 | + useRafId: '', | ||
| 154 | + allocationSwitch: 'OFF', | ||
| 155 | + allocationRafId: '', | ||
| 156 | + shDesc: '', | ||
| 157 | + communityId: getCommunityId() | ||
| 158 | + } | ||
| 159 | + this.$refs.form.resetFields() | ||
| 160 | + }, | ||
| 161 | + async listResourceAuditFlows() { | ||
| 162 | + try { | ||
| 163 | + const params = { | ||
| 164 | + page: 1, | ||
| 165 | + row: 100, | ||
| 166 | + communityId: getCommunityId() | ||
| 167 | + } | ||
| 168 | + const response = await listResourceAuditFlow(params) | ||
| 169 | + this.flows = response.data | ||
| 170 | + } catch (error) { | ||
| 171 | + this.$message.error(this.$t('storehouseManage.messages.flowFetchError')) | ||
| 172 | + } | ||
| 173 | + }, | ||
| 174 | + async saveStorehouseInfo() { | ||
| 175 | + try { | ||
| 176 | + await this.$refs.form.validate() | ||
| 177 | + await saveStorehouse(this.form) | ||
| 178 | + this.$emit('success') | ||
| 179 | + this.close() | ||
| 180 | + this.$message.success(this.$t('storehouseManage.messages.addSuccess')) | ||
| 181 | + } catch (error) { | ||
| 182 | + if (error.message) { | ||
| 183 | + this.$message.error(error.message) | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | + } | ||
| 188 | +} | ||
| 189 | +</script> | ||
| 0 | \ No newline at end of file | 190 | \ No newline at end of file |
src/components/resource/DeleteResourceAuditFlow.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceAuditFlow.confirmTitle')" | ||
| 4 | + :visible.sync="dialogVisible" | ||
| 5 | + width="500px" | ||
| 6 | + > | ||
| 7 | + <div class="delete-content"> | ||
| 8 | + <p>{{ $t('resourceAuditFlow.confirmDelete') }}</p> | ||
| 9 | + </div> | ||
| 10 | + | ||
| 11 | + <div slot="footer" class="dialog-footer"> | ||
| 12 | + <el-button @click="dialogVisible = false"> | ||
| 13 | + {{ $t('resourceAuditFlow.cancel') }} | ||
| 14 | + </el-button> | ||
| 15 | + <el-button type="danger" @click="handleConfirm"> | ||
| 16 | + {{ $t('resourceAuditFlow.confirmDeleteBtn') }} | ||
| 17 | + </el-button> | ||
| 18 | + </div> | ||
| 19 | + </el-dialog> | ||
| 20 | +</template> | ||
| 21 | + | ||
| 22 | +<script> | ||
| 23 | +import { deleteResourceAuditFlow } from '@/api/resource/resourceAuditFlowApi' | ||
| 24 | + | ||
| 25 | +export default { | ||
| 26 | + name: 'DeleteResourceAuditFlow', | ||
| 27 | + data() { | ||
| 28 | + return { | ||
| 29 | + dialogVisible: false, | ||
| 30 | + currentRow: null | ||
| 31 | + } | ||
| 32 | + }, | ||
| 33 | + methods: { | ||
| 34 | + open(row) { | ||
| 35 | + this.currentRow = { ...row } | ||
| 36 | + this.dialogVisible = true | ||
| 37 | + }, | ||
| 38 | + async handleConfirm() { | ||
| 39 | + if (!this.currentRow) return | ||
| 40 | + | ||
| 41 | + try { | ||
| 42 | + const res = await deleteResourceAuditFlow({ | ||
| 43 | + rafId: this.currentRow.rafId | ||
| 44 | + }) | ||
| 45 | + | ||
| 46 | + if (res.code === 0) { | ||
| 47 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 48 | + this.dialogVisible = false | ||
| 49 | + this.$emit('success') | ||
| 50 | + } else { | ||
| 51 | + this.$message.error(res.msg || this.$t('common.deleteFailed')) | ||
| 52 | + } | ||
| 53 | + } catch (error) { | ||
| 54 | + console.error('删除审批流程失败:', error) | ||
| 55 | + this.$message.error(this.$t('common.deleteFailed')) | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | +</script> | ||
| 61 | + | ||
| 62 | +<style scoped> | ||
| 63 | +.delete-content { | ||
| 64 | + text-align: center; | ||
| 65 | + font-size: 16px; | ||
| 66 | + padding: 20px 0; | ||
| 67 | +} | ||
| 68 | +</style> | ||
| 0 | \ No newline at end of file | 69 | \ No newline at end of file |
src/components/resource/DeleteStorehouse.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('common.delete')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%" | ||
| 6 | + > | ||
| 7 | + <p>{{ $t('common.deleteConfirm') }}</p> | ||
| 8 | + <div slot="footer"> | ||
| 9 | + <el-button @click="visible = false"> | ||
| 10 | + {{ $t('common.cancel') }} | ||
| 11 | + </el-button> | ||
| 12 | + <el-button type="primary" @click="deleteStorehouse"> | ||
| 13 | + {{ $t('common.delete') }} | ||
| 14 | + </el-button> | ||
| 15 | + </div> | ||
| 16 | + </el-dialog> | ||
| 17 | +</template> | ||
| 18 | + | ||
| 19 | +<script> | ||
| 20 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 21 | +import { deleteStorehouse } from '@/api/resource/storehouseManageApi' | ||
| 22 | + | ||
| 23 | +export default { | ||
| 24 | + name: 'DeleteStorehouse', | ||
| 25 | + data() { | ||
| 26 | + return { | ||
| 27 | + visible: false, | ||
| 28 | + storehouse: {} | ||
| 29 | + } | ||
| 30 | + }, | ||
| 31 | + methods: { | ||
| 32 | + open(row) { | ||
| 33 | + this.storehouse = { ...row } | ||
| 34 | + this.visible = true | ||
| 35 | + }, | ||
| 36 | + close() { | ||
| 37 | + this.visible = false | ||
| 38 | + }, | ||
| 39 | + async deleteStorehouse() { | ||
| 40 | + try { | ||
| 41 | + const params = { | ||
| 42 | + ...this.storehouse, | ||
| 43 | + communityId: getCommunityId() | ||
| 44 | + } | ||
| 45 | + await deleteStorehouse(params) | ||
| 46 | + this.$emit('success') | ||
| 47 | + this.close() | ||
| 48 | + this.$message.success(this.$t('storehouseManage.messages.deleteSuccess')) | ||
| 49 | + } catch (error) { | ||
| 50 | + this.$message.error(error.message || this.$t('storehouseManage.messages.deleteError')) | ||
| 51 | + } | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | +} | ||
| 55 | +</script> | ||
| 0 | \ No newline at end of file | 56 | \ No newline at end of file |
src/components/resource/EditResourceAuditFlow.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceAuditFlow.editTitle')" | ||
| 4 | + :visible.sync="dialogVisible" | ||
| 5 | + width="600px" | ||
| 6 | + @close="handleClose" | ||
| 7 | + > | ||
| 8 | + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> | ||
| 9 | + <el-form-item | ||
| 10 | + :label="$t('resourceAuditFlow.flowName')" | ||
| 11 | + prop="flowName" | ||
| 12 | + :label-width="formLabelWidth" | ||
| 13 | + > | ||
| 14 | + <el-input | ||
| 15 | + v-model="form.flowName" | ||
| 16 | + :placeholder="$t('resourceAuditFlow.flowNamePlaceholder')" | ||
| 17 | + /> | ||
| 18 | + </el-form-item> | ||
| 19 | + | ||
| 20 | + <el-form-item | ||
| 21 | + :label="$t('resourceAuditFlow.flowType')" | ||
| 22 | + prop="auditType" | ||
| 23 | + :label-width="formLabelWidth" | ||
| 24 | + > | ||
| 25 | + <el-select | ||
| 26 | + v-model="form.auditType" | ||
| 27 | + :placeholder="$t('resourceAuditFlow.flowTypePlaceholder')" | ||
| 28 | + style="width:100%" | ||
| 29 | + > | ||
| 30 | + <el-option | ||
| 31 | + :label="$t('resourceAuditFlow.purchaseFlow')" | ||
| 32 | + value="10001" | ||
| 33 | + /> | ||
| 34 | + <el-option | ||
| 35 | + :label="$t('resourceAuditFlow.receiveFlow')" | ||
| 36 | + value="10002" | ||
| 37 | + /> | ||
| 38 | + <el-option | ||
| 39 | + :label="$t('resourceAuditFlow.transferFlow')" | ||
| 40 | + value="10003" | ||
| 41 | + /> | ||
| 42 | + </el-select> | ||
| 43 | + </el-form-item> | ||
| 44 | + | ||
| 45 | + <el-form-item | ||
| 46 | + :label="$t('resourceAuditFlow.remark')" | ||
| 47 | + prop="remark" | ||
| 48 | + :label-width="formLabelWidth" | ||
| 49 | + > | ||
| 50 | + <el-input | ||
| 51 | + v-model="form.remark" | ||
| 52 | + type="textarea" | ||
| 53 | + :rows="3" | ||
| 54 | + :placeholder="$t('resourceAuditFlow.remarkPlaceholder')" | ||
| 55 | + /> | ||
| 56 | + </el-form-item> | ||
| 57 | + </el-form> | ||
| 58 | + | ||
| 59 | + <div slot="footer" class="dialog-footer"> | ||
| 60 | + <el-button @click="dialogVisible = false"> | ||
| 61 | + {{ $t('resourceAuditFlow.cancel') }} | ||
| 62 | + </el-button> | ||
| 63 | + <el-button type="primary" @click="handleSubmit"> | ||
| 64 | + {{ $t('resourceAuditFlow.save') }} | ||
| 65 | + </el-button> | ||
| 66 | + </div> | ||
| 67 | + </el-dialog> | ||
| 68 | +</template> | ||
| 69 | + | ||
| 70 | +<script> | ||
| 71 | +import { updateResourceAuditFlow } from '@/api/resource/resourceAuditFlowApi' | ||
| 72 | + | ||
| 73 | +export default { | ||
| 74 | + name: 'EditResourceAuditFlow', | ||
| 75 | + data() { | ||
| 76 | + return { | ||
| 77 | + dialogVisible: false, | ||
| 78 | + formLabelWidth: '120px', | ||
| 79 | + form: { | ||
| 80 | + rafId: '', | ||
| 81 | + flowName: '', | ||
| 82 | + auditType: '', | ||
| 83 | + remark: '' | ||
| 84 | + }, | ||
| 85 | + rules: { | ||
| 86 | + flowName: [ | ||
| 87 | + { required: true, message: this.$t('resourceAuditFlow.flowNameRequired'), trigger: 'blur' }, | ||
| 88 | + { max: 30, message: this.$t('resourceAuditFlow.maxLength30'), trigger: 'blur' } | ||
| 89 | + ], | ||
| 90 | + auditType: [ | ||
| 91 | + { required: true, message: this.$t('resourceAuditFlow.flowTypeRequired'), trigger: 'change' } | ||
| 92 | + ], | ||
| 93 | + remark: [ | ||
| 94 | + { max: 512, message: this.$t('resourceAuditFlow.maxLength512'), trigger: 'blur' } | ||
| 95 | + ] | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + }, | ||
| 99 | + methods: { | ||
| 100 | + open(row) { | ||
| 101 | + this.form = { | ||
| 102 | + rafId: row.rafId, | ||
| 103 | + flowName: row.flowName, | ||
| 104 | + auditType: row.auditType, | ||
| 105 | + remark: row.remark | ||
| 106 | + } | ||
| 107 | + this.dialogVisible = true | ||
| 108 | + }, | ||
| 109 | + handleClose() { | ||
| 110 | + this.$refs.form.resetFields() | ||
| 111 | + this.form = { | ||
| 112 | + rafId: '', | ||
| 113 | + flowName: '', | ||
| 114 | + auditType: '', | ||
| 115 | + remark: '' | ||
| 116 | + } | ||
| 117 | + }, | ||
| 118 | + handleSubmit() { | ||
| 119 | + this.$refs.form.validate(async (valid) => { | ||
| 120 | + if (valid) { | ||
| 121 | + try { | ||
| 122 | + const res = await updateResourceAuditFlow(this.form) | ||
| 123 | + if (res.code === 0) { | ||
| 124 | + this.$message.success(this.$t('common.updateSuccess')) | ||
| 125 | + this.dialogVisible = false | ||
| 126 | + this.$emit('success') | ||
| 127 | + } else { | ||
| 128 | + this.$message.error(res.msg || this.$t('common.updateFailed')) | ||
| 129 | + } | ||
| 130 | + } catch (error) { | ||
| 131 | + console.error('更新审批流程失败:', error) | ||
| 132 | + this.$message.error(this.$t('common.updateFailed')) | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + }) | ||
| 136 | + } | ||
| 137 | + } | ||
| 138 | +} | ||
| 139 | +</script> | ||
| 0 | \ No newline at end of file | 140 | \ No newline at end of file |
src/components/resource/EditStorehouse.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('storehouseManage.buttons.edit')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="close" | ||
| 7 | + > | ||
| 8 | + <el-form :model="form" label-width="150px" :rules="rules" ref="form"> | ||
| 9 | + <el-form-item :label="$t('storehouseManage.table.shName')" prop="shName"> | ||
| 10 | + <el-input | ||
| 11 | + v-model="form.shName" | ||
| 12 | + :placeholder="$t('storehouseManage.placeholders.shName')" | ||
| 13 | + /> | ||
| 14 | + </el-form-item> | ||
| 15 | + <el-form-item :label="$t('storehouseManage.table.isShow')" prop="isShow"> | ||
| 16 | + <el-select v-model="form.isShow" style="width:100%"> | ||
| 17 | + <el-option :label="$t('storehouseManage.options.yes')" value="true" /> | ||
| 18 | + <el-option :label="$t('storehouseManage.options.no')" value="false" /> | ||
| 19 | + </el-select> | ||
| 20 | + </el-form-item> | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + <el-form-item :label="$t('storehouseManage.table.allowPurchase')" prop="allowPurchase"> | ||
| 24 | + <el-select v-model="form.allowPurchase" style="width:100%"> | ||
| 25 | + <el-option :label="$t('storehouseManage.options.yes')" value="ON" /> | ||
| 26 | + <el-option :label="$t('storehouseManage.options.no')" value="OFF" /> | ||
| 27 | + </el-select> | ||
| 28 | + </el-form-item> | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + <el-form-item :label="$t('storehouseManage.table.allowUse')" prop="allowUse"> | ||
| 32 | + <el-select v-model="form.allowUse" style="width:100%"> | ||
| 33 | + <el-option :label="$t('storehouseManage.options.yes')" value="ON" /> | ||
| 34 | + <el-option :label="$t('storehouseManage.options.no')" value="OFF" /> | ||
| 35 | + </el-select> | ||
| 36 | + </el-form-item> | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + <el-form-item :label="$t('storehouseManage.table.purchaseSwitch')" prop="purchaseSwitch"> | ||
| 40 | + <el-col :span="11"> | ||
| 41 | + <el-select v-model="form.purchaseSwitch" style="width:100%"> | ||
| 42 | + <el-option label="审核" value="ON" /> | ||
| 43 | + <el-option label="不审核" value="OFF" /> | ||
| 44 | + </el-select> | ||
| 45 | + </el-col> | ||
| 46 | + <el-col :span="11" :offset="2" v-if="form.purchaseSwitch === 'ON'"> | ||
| 47 | + <el-form-item prop="purchaseRafId"> | ||
| 48 | + <el-select v-model="form.purchaseRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 49 | + style="width:100%"> | ||
| 50 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 51 | + :label="item.flowName" :value="item.rafId" /> | ||
| 52 | + </el-select> | ||
| 53 | + </el-form-item> | ||
| 54 | + </el-col> | ||
| 55 | + </el-form-item> | ||
| 56 | + <!-- 其他字段类似AddStorehouse组件 --> | ||
| 57 | + <el-form-item :label="$t('storehouseManage.table.useSwitch')" prop="useSwitch"> | ||
| 58 | + <el-col :span="11"> | ||
| 59 | + <el-select v-model="form.useSwitch" style="width:100%"> | ||
| 60 | + <el-option label="审核" value="ON" /> | ||
| 61 | + <el-option label="不审核" value="OFF" /> | ||
| 62 | + </el-select> | ||
| 63 | + </el-col> | ||
| 64 | + <el-col :span="11" :offset="2" v-if="form.useSwitch === 'ON'"> | ||
| 65 | + <el-form-item prop="useRafId"> | ||
| 66 | + <el-select v-model="form.useRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 67 | + style="width:100%"> | ||
| 68 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 69 | + :label="item.flowName" :value="item.rafId" /> | ||
| 70 | + </el-select> | ||
| 71 | + </el-form-item> | ||
| 72 | + </el-col> | ||
| 73 | + </el-form-item> | ||
| 74 | + <el-form-item :label="$t('storehouseManage.table.allocationSwitch')" prop="allocationSwitch"> | ||
| 75 | + <el-col :span="11"> | ||
| 76 | + <el-select v-model="form.allocationSwitch" style="width:100%"> | ||
| 77 | + <el-option label="审核" value="ON" /> | ||
| 78 | + <el-option label="不审核" value="OFF" /> | ||
| 79 | + </el-select> | ||
| 80 | + </el-col> | ||
| 81 | + <el-col :span="11" :offset="2" v-if="form.allocationSwitch === 'ON'"> | ||
| 82 | + <el-form-item prop="allocationRafId"> | ||
| 83 | + <el-select v-model="form.allocationRafId" :placeholder="$t('storehouseManage.placeholders.selectFlow')" | ||
| 84 | + style="width:100%"> | ||
| 85 | + <el-option v-for="item in flows.filter(f => f.auditType === '10001')" :key="item.rafId" | ||
| 86 | + :label="item.flowName" :value="item.rafId" /> | ||
| 87 | + </el-select> | ||
| 88 | + </el-form-item> | ||
| 89 | + </el-col> | ||
| 90 | + </el-form-item> | ||
| 91 | + </el-form> | ||
| 92 | + | ||
| 93 | + <div slot="footer"> | ||
| 94 | + <el-button @click="close">{{ $t('common.cancel') }}</el-button> | ||
| 95 | + <el-button type="primary" @click="editStorehouse"> | ||
| 96 | + {{ $t('common.save') }} | ||
| 97 | + </el-button> | ||
| 98 | + </div> | ||
| 99 | + </el-dialog> | ||
| 100 | +</template> | ||
| 101 | + | ||
| 102 | +<script> | ||
| 103 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 104 | +import { updateStorehouse, listResourceAuditFlow } from '@/api/resource/storehouseManageApi' | ||
| 105 | + | ||
| 106 | +export default { | ||
| 107 | + name: 'EditStorehouse', | ||
| 108 | + data() { | ||
| 109 | + return { | ||
| 110 | + visible: false, | ||
| 111 | + form: { | ||
| 112 | + shId: '', | ||
| 113 | + shName: '', | ||
| 114 | + isShow: '', | ||
| 115 | + allowPurchase: 'ON', | ||
| 116 | + allowUse: 'ON', | ||
| 117 | + purchaseSwitch: '', | ||
| 118 | + purchaseRafId: '', | ||
| 119 | + useSwitch: '', | ||
| 120 | + useRafId: '', | ||
| 121 | + allocationSwitch: '', | ||
| 122 | + allocationRafId: '', | ||
| 123 | + shDesc: '', | ||
| 124 | + communityId: getCommunityId() | ||
| 125 | + }, | ||
| 126 | + flows: [], | ||
| 127 | + rules: { | ||
| 128 | + shName: [ | ||
| 129 | + { required: true, message: this.$t('storehouseManage.messages.shNameRequired'), trigger: 'blur' }, | ||
| 130 | + { max: 64, message: this.$t('storehouseManage.messages.shNameMaxLength'), trigger: 'blur' } | ||
| 131 | + ], | ||
| 132 | + isShow: [ | ||
| 133 | + { required: true, message: this.$t('storehouseManage.messages.isShowRequired'), trigger: 'change' } | ||
| 134 | + ], | ||
| 135 | + shId: [ | ||
| 136 | + { required: true, message: this.$t('storehouseManage.messages.shIdRequired'), trigger: 'blur' } | ||
| 137 | + ] | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + }, | ||
| 141 | + methods: { | ||
| 142 | + open(row) { | ||
| 143 | + this.form = { ...row } | ||
| 144 | + this.visible = true | ||
| 145 | + this.listResourceAuditFlows() | ||
| 146 | + }, | ||
| 147 | + close() { | ||
| 148 | + this.visible = false | ||
| 149 | + this.$refs.form.resetFields() | ||
| 150 | + }, | ||
| 151 | + async listResourceAuditFlows() { | ||
| 152 | + try { | ||
| 153 | + const params = { | ||
| 154 | + page: 1, | ||
| 155 | + row: 100, | ||
| 156 | + communityId: getCommunityId() | ||
| 157 | + } | ||
| 158 | + const response = await listResourceAuditFlow(params) | ||
| 159 | + this.flows = response.data | ||
| 160 | + } catch (error) { | ||
| 161 | + this.$message.error(this.$t('storehouseManage.messages.flowFetchError')) | ||
| 162 | + } | ||
| 163 | + }, | ||
| 164 | + async editStorehouse() { | ||
| 165 | + try { | ||
| 166 | + await this.$refs.form.validate() | ||
| 167 | + await updateStorehouse(this.form) | ||
| 168 | + this.$emit('success') | ||
| 169 | + this.close() | ||
| 170 | + this.$message.success(this.$t('storehouseManage.messages.updateSuccess')) | ||
| 171 | + } catch (error) { | ||
| 172 | + if (error.message) { | ||
| 173 | + this.$message.error(error.message) | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | +} | ||
| 179 | +</script> | ||
| 0 | \ No newline at end of file | 180 | \ No newline at end of file |
src/components/resource/addResourceStoreSpecification.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceStoreSpecificationManage.addSpec')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose"> | ||
| 7 | + <el-form | ||
| 8 | + :model="form" | ||
| 9 | + :rules="rules" | ||
| 10 | + ref="formRef" | ||
| 11 | + label-width="120px"> | ||
| 12 | + <el-form-item | ||
| 13 | + :label="$t('resourceStoreSpecificationManage.specName')" | ||
| 14 | + prop="specName"> | ||
| 15 | + <el-input | ||
| 16 | + v-model="form.specName" | ||
| 17 | + :placeholder="$t('resourceStoreSpecificationManage.specNamePlaceholder')"> | ||
| 18 | + </el-input> | ||
| 19 | + </el-form-item> | ||
| 20 | + | ||
| 21 | + <el-form-item | ||
| 22 | + :label="$t('resourceStoreSpecificationManage.itemType')" | ||
| 23 | + prop="parentRstId" | ||
| 24 | + class="item-type-form-item"> | ||
| 25 | + <el-col :span="11"> | ||
| 26 | + <el-select | ||
| 27 | + v-model="form.parentRstId" | ||
| 28 | + :placeholder="$t('resourceStoreSpecificationManage.selectItemType')" | ||
| 29 | + @change="handleParentTypeChange" | ||
| 30 | + style="width:100%"> | ||
| 31 | + <el-option | ||
| 32 | + v-for="item in resourceStoreTypes" | ||
| 33 | + :key="item.rstId" | ||
| 34 | + :label="item.name" | ||
| 35 | + :value="item.rstId"> | ||
| 36 | + </el-option> | ||
| 37 | + </el-select> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="11" :offset="2"> | ||
| 40 | + <el-select | ||
| 41 | + v-model="form.rstId" | ||
| 42 | + :placeholder="$t('resourceStoreSpecificationManage.selectSubCategory')" | ||
| 43 | + style="width:100%"> | ||
| 44 | + <el-option | ||
| 45 | + v-for="item in sonResourceStoreTypes" | ||
| 46 | + :key="item.rstId" | ||
| 47 | + :label="item.name" | ||
| 48 | + :value="item.rstId"> | ||
| 49 | + </el-option> | ||
| 50 | + </el-select> | ||
| 51 | + </el-col> | ||
| 52 | + </el-form-item> | ||
| 53 | + | ||
| 54 | + <el-form-item | ||
| 55 | + :label="$t('resourceStoreSpecificationManage.description')" | ||
| 56 | + prop="description"> | ||
| 57 | + <el-input | ||
| 58 | + type="textarea" | ||
| 59 | + v-model="form.description" | ||
| 60 | + :placeholder="$t('resourceStoreSpecificationManage.descriptionPlaceholder')" | ||
| 61 | + :rows="3"> | ||
| 62 | + </el-input> | ||
| 63 | + </el-form-item> | ||
| 64 | + </el-form> | ||
| 65 | + | ||
| 66 | + <div slot="footer" class="dialog-footer"> | ||
| 67 | + <el-button @click="visible = false"> | ||
| 68 | + {{ $t('resourceStoreSpecificationManage.cancel') }} | ||
| 69 | + </el-button> | ||
| 70 | + <el-button type="primary" @click="submitForm"> | ||
| 71 | + {{ $t('resourceStoreSpecificationManage.save') }} | ||
| 72 | + </el-button> | ||
| 73 | + </div> | ||
| 74 | + </el-dialog> | ||
| 75 | +</template> | ||
| 76 | + | ||
| 77 | +<script> | ||
| 78 | +import { saveResourceStoreSpecification, listResourceStoreTypes } from '@/api/resource/resourceStoreSpecificationManageApi' | ||
| 79 | + | ||
| 80 | +export default { | ||
| 81 | + name: 'AddResourceStoreSpecification', | ||
| 82 | + data() { | ||
| 83 | + return { | ||
| 84 | + visible: false, | ||
| 85 | + form: { | ||
| 86 | + specName: '', | ||
| 87 | + parentRstId: '', | ||
| 88 | + rstId: '', | ||
| 89 | + description: '' | ||
| 90 | + }, | ||
| 91 | + resourceStoreTypes: [], | ||
| 92 | + sonResourceStoreTypes: [], | ||
| 93 | + rules: { | ||
| 94 | + specName: [ | ||
| 95 | + { required: true, message: this.$t('common.requiredField'), trigger: 'blur' }, | ||
| 96 | + { max: 255, message: this.$t('common.maxLength', { num: 255 }), trigger: 'blur' } | ||
| 97 | + ], | ||
| 98 | + parentRstId: [ | ||
| 99 | + { required: true, message: this.$t('common.requiredField'), trigger: 'change' } | ||
| 100 | + ], | ||
| 101 | + rstId: [ | ||
| 102 | + { required: true, message: this.$t('common.requiredField'), trigger: 'change' } | ||
| 103 | + ], | ||
| 104 | + description: [ | ||
| 105 | + { max: 512, message: this.$t('common.maxLength', { num: 512 }), trigger: 'blur' } | ||
| 106 | + ] | ||
| 107 | + } | ||
| 108 | + } | ||
| 109 | + }, | ||
| 110 | + methods: { | ||
| 111 | + open() { | ||
| 112 | + this.visible = true | ||
| 113 | + this.getResourceStoreTypes() | ||
| 114 | + }, | ||
| 115 | + | ||
| 116 | + async getResourceStoreTypes() { | ||
| 117 | + try { | ||
| 118 | + const params = { | ||
| 119 | + page: 1, | ||
| 120 | + row: 100, | ||
| 121 | + parentId: '0' | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + const res = await listResourceStoreTypes(params) | ||
| 125 | + this.resourceStoreTypes = res.data | ||
| 126 | + } catch (error) { | ||
| 127 | + console.error('Failed to get item types:', error) | ||
| 128 | + } | ||
| 129 | + }, | ||
| 130 | + | ||
| 131 | + async getResourceStoreSonTypes(parentRstId) { | ||
| 132 | + try { | ||
| 133 | + const params = { | ||
| 134 | + page: 1, | ||
| 135 | + row: 100, | ||
| 136 | + rstId: parentRstId, | ||
| 137 | + flag: "0" | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + const res = await listResourceStoreTypes(params) | ||
| 141 | + this.sonResourceStoreTypes = res.data | ||
| 142 | + } catch (error) { | ||
| 143 | + console.error('Failed to get sub item types:', error) | ||
| 144 | + } | ||
| 145 | + }, | ||
| 146 | + | ||
| 147 | + handleParentTypeChange(val) { | ||
| 148 | + this.form.rstId = '' | ||
| 149 | + if (!val) { | ||
| 150 | + this.sonResourceStoreTypes = [] | ||
| 151 | + return | ||
| 152 | + } | ||
| 153 | + this.getResourceStoreSonTypes(val) | ||
| 154 | + }, | ||
| 155 | + | ||
| 156 | + submitForm() { | ||
| 157 | + this.$refs.formRef.validate(async valid => { | ||
| 158 | + if (valid) { | ||
| 159 | + try { | ||
| 160 | + await saveResourceStoreSpecification(this.form) | ||
| 161 | + this.$message.success(this.$t('common.saveSuccess')) | ||
| 162 | + this.visible = false | ||
| 163 | + this.$emit('success') | ||
| 164 | + } catch (error) { | ||
| 165 | + console.error('Failed to add specification:', error) | ||
| 166 | + this.$message.error(this.$t('common.saveFailed')) | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + }) | ||
| 170 | + }, | ||
| 171 | + | ||
| 172 | + handleClose() { | ||
| 173 | + this.$refs.formRef.resetFields() | ||
| 174 | + this.form = { | ||
| 175 | + specName: '', | ||
| 176 | + parentRstId: '', | ||
| 177 | + rstId: '', | ||
| 178 | + description: '' | ||
| 179 | + } | ||
| 180 | + this.sonResourceStoreTypes = [] | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | +} | ||
| 184 | +</script> | ||
| 185 | + | ||
| 186 | +<style scoped> | ||
| 187 | +.item-type-form-item { | ||
| 188 | + margin-bottom: 22px; | ||
| 189 | +} | ||
| 190 | +</style> | ||
| 0 | \ No newline at end of file | 191 | \ No newline at end of file |
src/components/resource/deleteResourceStoreSpecification.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceStoreSpecificationManage.confirmDeleteTitle')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="30%"> | ||
| 6 | + <div style="text-align: center; margin-bottom: 20px;"> | ||
| 7 | + <p>{{ $t('resourceStoreSpecificationManage.confirmDeleteMsg') }}</p> | ||
| 8 | + </div> | ||
| 9 | + <div slot="footer" class="dialog-footer"> | ||
| 10 | + <el-button @click="visible = false"> | ||
| 11 | + {{ $t('resourceStoreSpecificationManage.cancelDelete') }} | ||
| 12 | + </el-button> | ||
| 13 | + <el-button type="danger" @click="confirmDelete"> | ||
| 14 | + {{ $t('resourceStoreSpecificationManage.confirmDelete') }} | ||
| 15 | + </el-button> | ||
| 16 | + </div> | ||
| 17 | + </el-dialog> | ||
| 18 | +</template> | ||
| 19 | + | ||
| 20 | +<script> | ||
| 21 | +import { deleteResourceStoreSpecification } from '@/api/resource/resourceStoreSpecificationManageApi' | ||
| 22 | + | ||
| 23 | +export default { | ||
| 24 | + name: 'DeleteResourceStoreSpecification', | ||
| 25 | + data() { | ||
| 26 | + return { | ||
| 27 | + visible: false, | ||
| 28 | + rssId: '' | ||
| 29 | + } | ||
| 30 | + }, | ||
| 31 | + methods: { | ||
| 32 | + open(row) { | ||
| 33 | + this.rssId = row.rssId | ||
| 34 | + this.visible = true | ||
| 35 | + }, | ||
| 36 | + | ||
| 37 | + async confirmDelete() { | ||
| 38 | + try { | ||
| 39 | + await deleteResourceStoreSpecification(this.rssId) | ||
| 40 | + this.$message.success(this.$t('common.deleteSuccess')) | ||
| 41 | + this.visible = false | ||
| 42 | + this.$emit('success') | ||
| 43 | + } catch (error) { | ||
| 44 | + console.error('Failed to delete specification:', error) | ||
| 45 | + this.$message.error(this.$t('common.deleteFailed')) | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + } | ||
| 49 | +} | ||
| 50 | +</script> | ||
| 0 | \ No newline at end of file | 51 | \ No newline at end of file |
src/components/resource/editResourceStoreSpecification.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + :title="$t('resourceStoreSpecificationManage.editItemSpec')" | ||
| 4 | + :visible.sync="visible" | ||
| 5 | + width="50%" | ||
| 6 | + @close="handleClose"> | ||
| 7 | + <el-form | ||
| 8 | + :model="form" | ||
| 9 | + :rules="rules" | ||
| 10 | + ref="formRef" | ||
| 11 | + label-width="120px"> | ||
| 12 | + <el-form-item | ||
| 13 | + :label="$t('resourceStoreSpecificationManage.specName')" | ||
| 14 | + prop="specName"> | ||
| 15 | + <el-input | ||
| 16 | + v-model="form.specName" | ||
| 17 | + :placeholder="$t('resourceStoreSpecificationManage.specNamePlaceholder')"> | ||
| 18 | + </el-input> | ||
| 19 | + </el-form-item> | ||
| 20 | + | ||
| 21 | + <el-form-item | ||
| 22 | + :label="$t('resourceStoreSpecificationManage.itemType')" | ||
| 23 | + prop="parentRstId" | ||
| 24 | + class="item-type-form-item"> | ||
| 25 | + <el-col :span="11"> | ||
| 26 | + <el-select | ||
| 27 | + v-model="form.parentRstId" | ||
| 28 | + :placeholder="$t('resourceStoreSpecificationManage.selectItemType')" | ||
| 29 | + @change="handleParentTypeChange" | ||
| 30 | + style="width:100%"> | ||
| 31 | + <el-option | ||
| 32 | + v-for="item in resourceStoreTypes" | ||
| 33 | + :key="item.rstId" | ||
| 34 | + :label="item.name" | ||
| 35 | + :value="item.rstId"> | ||
| 36 | + </el-option> | ||
| 37 | + </el-select> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="11" :offset="2"> | ||
| 40 | + <el-select | ||
| 41 | + v-model="form.rstId" | ||
| 42 | + :placeholder="$t('resourceStoreSpecificationManage.selectSubCategory')" | ||
| 43 | + style="width:100%"> | ||
| 44 | + <el-option | ||
| 45 | + v-for="item in sonResourceStoreTypes" | ||
| 46 | + :key="item.rstId" | ||
| 47 | + :label="item.name" | ||
| 48 | + :value="item.rstId"> | ||
| 49 | + </el-option> | ||
| 50 | + </el-select> | ||
| 51 | + </el-col> | ||
| 52 | + </el-form-item> | ||
| 53 | + | ||
| 54 | + <el-form-item | ||
| 55 | + :label="$t('resourceStoreSpecificationManage.description')" | ||
| 56 | + prop="description"> | ||
| 57 | + <el-input | ||
| 58 | + type="textarea" | ||
| 59 | + v-model="form.description" | ||
| 60 | + :placeholder="$t('resourceStoreSpecificationManage.descriptionPlaceholder')" | ||
| 61 | + :rows="3"> | ||
| 62 | + </el-input> | ||
| 63 | + </el-form-item> | ||
| 64 | + </el-form> | ||
| 65 | + | ||
| 66 | + <div slot="footer" class="dialog-footer"> | ||
| 67 | + <el-button @click="visible = false"> | ||
| 68 | + {{ $t('resourceStoreSpecificationManage.cancel') }} | ||
| 69 | + </el-button> | ||
| 70 | + <el-button type="primary" @click="submitForm"> | ||
| 71 | + {{ $t('resourceStoreSpecificationManage.save') }} | ||
| 72 | + </el-button> | ||
| 73 | + </div> | ||
| 74 | + </el-dialog> | ||
| 75 | +</template> | ||
| 76 | + | ||
| 77 | +<script> | ||
| 78 | +import { updateResourceStoreSpecification, listResourceStoreTypes } from '@/api/resource/resourceStoreSpecificationManageApi' | ||
| 79 | + | ||
| 80 | +export default { | ||
| 81 | + name: 'EditResourceStoreSpecification', | ||
| 82 | + data() { | ||
| 83 | + return { | ||
| 84 | + visible: false, | ||
| 85 | + form: { | ||
| 86 | + rssId: '', | ||
| 87 | + specName: '', | ||
| 88 | + parentRstId: '', | ||
| 89 | + rstId: '', | ||
| 90 | + description: '' | ||
| 91 | + }, | ||
| 92 | + resourceStoreTypes: [], | ||
| 93 | + sonResourceStoreTypes: [], | ||
| 94 | + rules: { | ||
| 95 | + specName: [ | ||
| 96 | + { required: true, message: this.$t('common.requiredField'), trigger: 'blur' }, | ||
| 97 | + { max: 255, message: this.$t('common.maxLength', { num: 255 }), trigger: 'blur' } | ||
| 98 | + ], | ||
| 99 | + parentRstId: [ | ||
| 100 | + { required: true, message: this.$t('common.requiredField'), trigger: 'change' } | ||
| 101 | + ], | ||
| 102 | + rstId: [ | ||
| 103 | + { required: true, message: this.$t('common.requiredField'), trigger: 'change' } | ||
| 104 | + ], | ||
| 105 | + description: [ | ||
| 106 | + { max: 512, message: this.$t('common.maxLength', { num: 512 }), trigger: 'blur' } | ||
| 107 | + ] | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + }, | ||
| 111 | + methods: { | ||
| 112 | + open(row) { | ||
| 113 | + this.form = { | ||
| 114 | + rssId: row.rssId, | ||
| 115 | + specName: row.specName, | ||
| 116 | + parentRstId: row.parentRstId, | ||
| 117 | + rstId: row.rstId, | ||
| 118 | + description: row.description | ||
| 119 | + } | ||
| 120 | + this.visible = true | ||
| 121 | + this.getResourceStoreTypes() | ||
| 122 | + this.getResourceStoreSonTypes(row.parentRstId) | ||
| 123 | + }, | ||
| 124 | + | ||
| 125 | + async getResourceStoreTypes() { | ||
| 126 | + try { | ||
| 127 | + const params = { | ||
| 128 | + page: 1, | ||
| 129 | + row: 100, | ||
| 130 | + parentId: '0' | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + const res = await listResourceStoreTypes(params) | ||
| 134 | + this.resourceStoreTypes = res.data | ||
| 135 | + } catch (error) { | ||
| 136 | + console.error('Failed to get item types:', error) | ||
| 137 | + } | ||
| 138 | + }, | ||
| 139 | + | ||
| 140 | + async getResourceStoreSonTypes(parentRstId) { | ||
| 141 | + try { | ||
| 142 | + const params = { | ||
| 143 | + page: 1, | ||
| 144 | + row: 100, | ||
| 145 | + rstId: parentRstId, | ||
| 146 | + flag: "0" | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + const res = await listResourceStoreTypes(params) | ||
| 150 | + this.sonResourceStoreTypes = res.data | ||
| 151 | + } catch (error) { | ||
| 152 | + console.error('Failed to get sub item types:', error) | ||
| 153 | + } | ||
| 154 | + }, | ||
| 155 | + | ||
| 156 | + handleParentTypeChange(val) { | ||
| 157 | + this.form.rstId = '' | ||
| 158 | + if (!val) { | ||
| 159 | + this.sonResourceStoreTypes = [] | ||
| 160 | + return | ||
| 161 | + } | ||
| 162 | + this.getResourceStoreSonTypes(val) | ||
| 163 | + }, | ||
| 164 | + | ||
| 165 | + submitForm() { | ||
| 166 | + this.$refs.formRef.validate(async valid => { | ||
| 167 | + if (valid) { | ||
| 168 | + try { | ||
| 169 | + await updateResourceStoreSpecification(this.form) | ||
| 170 | + this.$message.success(this.$t('common.updateSuccess')) | ||
| 171 | + this.visible = false | ||
| 172 | + this.$emit('success') | ||
| 173 | + } catch (error) { | ||
| 174 | + console.error('Failed to update specification:', error) | ||
| 175 | + this.$message.error(this.$t('common.updateFailed')) | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + }) | ||
| 179 | + }, | ||
| 180 | + | ||
| 181 | + handleClose() { | ||
| 182 | + this.$refs.formRef.resetFields() | ||
| 183 | + this.form = { | ||
| 184 | + rssId: '', | ||
| 185 | + specName: '', | ||
| 186 | + parentRstId: '', | ||
| 187 | + rstId: '', | ||
| 188 | + description: '' | ||
| 189 | + } | ||
| 190 | + this.sonResourceStoreTypes = [] | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | +} | ||
| 194 | +</script> | ||
| 195 | + | ||
| 196 | +<style scoped> | ||
| 197 | +.item-type-form-item { | ||
| 198 | + margin-bottom: 22px; | ||
| 199 | +} | ||
| 200 | +</style> | ||
| 0 | \ No newline at end of file | 201 | \ No newline at end of file |
src/i18n/index.js
| @@ -176,6 +176,9 @@ import { messages as inspectionPlanMessages } from '../views/inspection/inspecti | @@ -176,6 +176,9 @@ import { messages as inspectionPlanMessages } from '../views/inspection/inspecti | ||
| 176 | import { messages as addInspectionPlanMessages } from '../views/inspection/addInspectionPlanLang' | 176 | import { messages as addInspectionPlanMessages } from '../views/inspection/addInspectionPlanLang' |
| 177 | import { messages as inspectionTaskMessages } from '../views/inspection/inspectionTaskLang' | 177 | import { messages as inspectionTaskMessages } from '../views/inspection/inspectionTaskLang' |
| 178 | import { messages as inspectionTaskDetailsMessages } from '../views/inspection/inspectionTaskDetailsLang' | 178 | import { messages as inspectionTaskDetailsMessages } from '../views/inspection/inspectionTaskDetailsLang' |
| 179 | +import { messages as resourceAuditFlowMessages } from '../views/resource/resourceAuditFlowLang' | ||
| 180 | +import { messages as storehouseManageMessages } from '../views/resource/storehouseManageLang' | ||
| 181 | +import { messages as resourceStoreSpecificationManageMessages } from '../views/resource/resourceStoreSpecificationManageLang' | ||
| 179 | 182 | ||
| 180 | Vue.use(VueI18n) | 183 | Vue.use(VueI18n) |
| 181 | 184 | ||
| @@ -356,6 +359,9 @@ const messages = { | @@ -356,6 +359,9 @@ const messages = { | ||
| 356 | ...addInspectionPlanMessages.en, | 359 | ...addInspectionPlanMessages.en, |
| 357 | ...inspectionTaskMessages.en, | 360 | ...inspectionTaskMessages.en, |
| 358 | ...inspectionTaskDetailsMessages.en, | 361 | ...inspectionTaskDetailsMessages.en, |
| 362 | + ...resourceAuditFlowMessages.en, | ||
| 363 | + ...storehouseManageMessages.en, | ||
| 364 | + ...resourceStoreSpecificationManageMessages.en, | ||
| 359 | }, | 365 | }, |
| 360 | zh: { | 366 | zh: { |
| 361 | ...loginMessages.zh, | 367 | ...loginMessages.zh, |
| @@ -532,6 +538,9 @@ const messages = { | @@ -532,6 +538,9 @@ const messages = { | ||
| 532 | ...addInspectionPlanMessages.zh, | 538 | ...addInspectionPlanMessages.zh, |
| 533 | ...inspectionTaskMessages.zh, | 539 | ...inspectionTaskMessages.zh, |
| 534 | ...inspectionTaskDetailsMessages.zh, | 540 | ...inspectionTaskDetailsMessages.zh, |
| 541 | + ...resourceAuditFlowMessages.zh, | ||
| 542 | + ...storehouseManageMessages.zh, | ||
| 543 | + ...resourceStoreSpecificationManageMessages.zh, | ||
| 535 | } | 544 | } |
| 536 | } | 545 | } |
| 537 | 546 |
src/router/index.js
| @@ -857,20 +857,35 @@ const routes = [ | @@ -857,20 +857,35 @@ const routes = [ | ||
| 857 | component: () => import('@/views/inspection/inspectionPlanList.vue') | 857 | component: () => import('@/views/inspection/inspectionPlanList.vue') |
| 858 | }, | 858 | }, |
| 859 | { | 859 | { |
| 860 | - path:'/views/inspection/addInspectionPlan', | ||
| 861 | - name:'/views/inspection/addInspectionPlan', | 860 | + path: '/views/inspection/addInspectionPlan', |
| 861 | + name: '/views/inspection/addInspectionPlan', | ||
| 862 | component: () => import('@/views/inspection/addInspectionPlanList.vue') | 862 | component: () => import('@/views/inspection/addInspectionPlanList.vue') |
| 863 | + }, | ||
| 864 | + { | ||
| 865 | + path: '/pages/inspection/inspectionTask', | ||
| 866 | + name: '/pages/inspection/inspectionTask', | ||
| 867 | + component: () => import('@/views/inspection/InspectionTaskList.vue') | ||
| 868 | + }, | ||
| 869 | + { | ||
| 870 | + path: '/pages/property/inspectionTaskDetails', | ||
| 871 | + name: '/pages/property/inspectionTaskDetails', | ||
| 872 | + component: () => import('@/views/inspection/inspectionTaskDetailsList.vue') | ||
| 873 | + }, | ||
| 874 | + { | ||
| 875 | + path: '/pages/resource/resourceAuditFlow', | ||
| 876 | + name: '/pages/resource/resourceAuditFlow', | ||
| 877 | + component: () => import('@/views/resource/resourceAuditFlowList.vue') | ||
| 878 | + }, | ||
| 879 | + { | ||
| 880 | + path:'/pages/property/storehouseManage', | ||
| 881 | + name:'/pages/property/storehouseManage', | ||
| 882 | + component: () => import('@/views/resource/storehouseManageList.vue') | ||
| 863 | }, | 883 | }, |
| 864 | { | 884 | { |
| 865 | - path:'/pages/inspection/inspectionTask', | ||
| 866 | - name:'/pages/inspection/inspectionTask', | ||
| 867 | - component: () => import('@/views/inspection/InspectionTaskList.vue') | 885 | + path:'/pages/common/resourceStoreSpecificationManage', |
| 886 | + name:'/pages/common/resourceStoreSpecificationManage', | ||
| 887 | + component: () => import('@/views/resource/resourceStoreSpecificationManageList.vue') | ||
| 868 | }, | 888 | }, |
| 869 | - { | ||
| 870 | - path:'/pages/property/inspectionTaskDetails', | ||
| 871 | - name:'/pages/property/inspectionTaskDetails', | ||
| 872 | - component: () => import('@/views/inspection/inspectionTaskDetailsList.vue') | ||
| 873 | - }, | ||
| 874 | // 其他子路由可以在这里添加 | 889 | // 其他子路由可以在这里添加 |
| 875 | ] | 890 | ] |
| 876 | }, | 891 | }, |
src/views/resource/resourceAuditFlowLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + resourceAuditFlow: { | ||
| 4 | + searchTitle: 'Search Conditions', | ||
| 5 | + flowNamePlaceholder: 'Please enter flow name', | ||
| 6 | + flowTypePlaceholder: 'Please select flow type', | ||
| 7 | + query: 'Search', | ||
| 8 | + reset: 'Reset', | ||
| 9 | + listTitle: 'Approval Flow', | ||
| 10 | + add: 'Add', | ||
| 11 | + flowId: 'ID', | ||
| 12 | + flowName: 'Flow Name', | ||
| 13 | + flowType: 'Flow Type', | ||
| 14 | + flowStatus: 'Flow Status', | ||
| 15 | + createTime: 'Create Time', | ||
| 16 | + remark: 'Remark', | ||
| 17 | + operations: 'Operations', | ||
| 18 | + setFlow: 'Set Flow', | ||
| 19 | + deployFlow: 'Deploy Flow', | ||
| 20 | + edit: 'Edit', | ||
| 21 | + delete: 'Delete', | ||
| 22 | + purchaseFlow: 'Purchase Flow', | ||
| 23 | + receiveFlow: 'Receive Flow', | ||
| 24 | + transferFlow: 'Transfer Flow', | ||
| 25 | + deployed: 'Deployed', | ||
| 26 | + notDeployed: 'Not Deployed', | ||
| 27 | + flowConfigTips: [ | ||
| 28 | + 'Flow configuration instructions:', | ||
| 29 | + '1. The last step must be the warehouse manager, and the name must be "Warehouse Manager"', | ||
| 30 | + '2. The flow must have two or more steps' | ||
| 31 | + ], | ||
| 32 | + confirmTitle: 'Confirm Operation', | ||
| 33 | + confirmDelete: 'Are you sure to delete this approval flow?', | ||
| 34 | + cancel: 'Cancel', | ||
| 35 | + confirmDeleteBtn: 'Confirm Delete', | ||
| 36 | + addTitle: 'Add Approval Flow', | ||
| 37 | + editTitle: 'Edit Approval Flow', | ||
| 38 | + flowNameRequired: 'Flow name is required', | ||
| 39 | + flowTypeRequired: 'Flow type is required', | ||
| 40 | + remarkPlaceholder: 'Optional, max 512 characters', | ||
| 41 | + save: 'Save', | ||
| 42 | + requiredField: 'Required', | ||
| 43 | + maxLength30: 'Max 30 characters', | ||
| 44 | + maxLength12: 'Max 12 characters', | ||
| 45 | + maxLength512: 'Max 512 characters' | ||
| 46 | + } | ||
| 47 | + }, | ||
| 48 | + zh: { | ||
| 49 | + resourceAuditFlow: { | ||
| 50 | + searchTitle: '查询条件', | ||
| 51 | + flowNamePlaceholder: '请输入流程名称', | ||
| 52 | + flowTypePlaceholder: '请选择流程类型', | ||
| 53 | + query: '查询', | ||
| 54 | + reset: '重置', | ||
| 55 | + listTitle: '审批流程', | ||
| 56 | + add: '添加', | ||
| 57 | + flowId: '编号', | ||
| 58 | + flowName: '流程名称', | ||
| 59 | + flowType: '流程类型', | ||
| 60 | + flowStatus: '流程状态', | ||
| 61 | + createTime: '创建时间', | ||
| 62 | + remark: '备注', | ||
| 63 | + operations: '操作', | ||
| 64 | + setFlow: '设置流程', | ||
| 65 | + deployFlow: '部署流程', | ||
| 66 | + edit: '修改', | ||
| 67 | + delete: '删除', | ||
| 68 | + purchaseFlow: '采购流程', | ||
| 69 | + receiveFlow: '领用流程', | ||
| 70 | + transferFlow: '调拨流程', | ||
| 71 | + deployed: '已部署', | ||
| 72 | + notDeployed: '待部署', | ||
| 73 | + flowConfigTips: [ | ||
| 74 | + '流程配置说明:', | ||
| 75 | + '1、最后一步必须为仓库管理员,名字也必须要叫做仓库管理员', | ||
| 76 | + '2、流程必须为两步或者两步以上' | ||
| 77 | + ], | ||
| 78 | + confirmTitle: '请确认您的操作', | ||
| 79 | + confirmDelete: '确定删除审批流程?', | ||
| 80 | + cancel: '点错了', | ||
| 81 | + confirmDeleteBtn: '确认删除', | ||
| 82 | + addTitle: '添加审批流程', | ||
| 83 | + editTitle: '修改审批流程', | ||
| 84 | + flowNameRequired: '流程名称不能为空', | ||
| 85 | + flowTypeRequired: '流程类型不能为空', | ||
| 86 | + remarkPlaceholder: '选填,最多512个字符', | ||
| 87 | + save: '保存', | ||
| 88 | + requiredField: '必填项', | ||
| 89 | + maxLength30: '不能超过30个字符', | ||
| 90 | + maxLength12: '不能超过12个字符', | ||
| 91 | + maxLength512: '不能超过512个字符' | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | +} | ||
| 0 | \ No newline at end of file | 95 | \ No newline at end of file |
src/views/resource/resourceAuditFlowList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="resource-audit-flow-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-card"> | ||
| 5 | + <div slot="header" class="text-left"> | ||
| 6 | + <span>{{ $t('resourceAuditFlow.searchTitle') }}</span> | ||
| 7 | + </div> | ||
| 8 | + <el-row :gutter="20"> | ||
| 9 | + <el-col :span="6"> | ||
| 10 | + <el-input v-model="searchForm.flowName" :placeholder="$t('resourceAuditFlow.flowNamePlaceholder')" clearable /> | ||
| 11 | + </el-col> | ||
| 12 | + <el-col :span="6"> | ||
| 13 | + <el-select v-model="searchForm.auditType" :placeholder="$t('resourceAuditFlow.flowTypePlaceholder')" | ||
| 14 | + style="width:100%" clearable> | ||
| 15 | + <el-option label="请选择流程类型" value="" /> | ||
| 16 | + <el-option :label="$t('resourceAuditFlow.purchaseFlow')" value="10001" /> | ||
| 17 | + <el-option :label="$t('resourceAuditFlow.receiveFlow')" value="10002" /> | ||
| 18 | + <el-option :label="$t('resourceAuditFlow.transferFlow')" value="10003" /> | ||
| 19 | + </el-select> | ||
| 20 | + </el-col> | ||
| 21 | + <el-col :span="6"> | ||
| 22 | + <el-button type="primary" @click="handleQuery"> | ||
| 23 | + <i class="el-icon-search"></i> | ||
| 24 | + {{ $t('resourceAuditFlow.query') }} | ||
| 25 | + </el-button> | ||
| 26 | + <el-button @click="handleReset"> | ||
| 27 | + <i class="el-icon-refresh"></i> | ||
| 28 | + {{ $t('resourceAuditFlow.reset') }} | ||
| 29 | + </el-button> | ||
| 30 | + </el-col> | ||
| 31 | + </el-row> | ||
| 32 | + </el-card> | ||
| 33 | + | ||
| 34 | + <!-- 审批流程列表 --> | ||
| 35 | + <el-card class="list-card"> | ||
| 36 | + <div slot="header" class="list-header"> | ||
| 37 | + <span>{{ $t('resourceAuditFlow.listTitle') }}</span> | ||
| 38 | + <el-button type="primary" size="small" @click="openAddModal"> | ||
| 39 | + <i class="el-icon-plus"></i> | ||
| 40 | + {{ $t('resourceAuditFlow.add') }} | ||
| 41 | + </el-button> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <el-table v-loading="loading" :data="tableData" border style="width: 100%"> | ||
| 45 | + <el-table-column prop="rafId" :label="$t('resourceAuditFlow.flowId')" align="center" width="80" /> | ||
| 46 | + <el-table-column :label="$t('resourceAuditFlow.flowName')" align="center"> | ||
| 47 | + <template slot-scope="scope"> | ||
| 48 | + {{ scope.row.flowName }} (<a href="javascript:void(0)" @click="settingFlow(scope.row)">{{ | ||
| 49 | + $t('resourceAuditFlow.setFlow') }}</a>) | ||
| 50 | + </template> | ||
| 51 | + </el-table-column> | ||
| 52 | + <el-table-column :label="$t('resourceAuditFlow.flowType')" align="center" width="120"> | ||
| 53 | + <template slot-scope="scope"> | ||
| 54 | + <span v-if="scope.row.auditType === '10001'">{{ $t('resourceAuditFlow.purchaseFlow') }}</span> | ||
| 55 | + <span v-else-if="scope.row.auditType === '10002'">{{ $t('resourceAuditFlow.receiveFlow') }}</span> | ||
| 56 | + <span v-else>{{ $t('resourceAuditFlow.transferFlow') }}</span> | ||
| 57 | + </template> | ||
| 58 | + </el-table-column> | ||
| 59 | + <el-table-column :label="$t('resourceAuditFlow.flowStatus')" align="center" width="100"> | ||
| 60 | + <template slot-scope="scope"> | ||
| 61 | + {{ scope.row.state === 'C' ? $t('resourceAuditFlow.deployed') : $t('resourceAuditFlow.notDeployed') }} | ||
| 62 | + </template> | ||
| 63 | + </el-table-column> | ||
| 64 | + <el-table-column prop="createTime" :label="$t('resourceAuditFlow.createTime')" align="center" width="180" /> | ||
| 65 | + <el-table-column prop="remark" :label="$t('resourceAuditFlow.remark')" align="center" width="200"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + {{ scope.row.remark || '-' }} | ||
| 68 | + </template> | ||
| 69 | + </el-table-column> | ||
| 70 | + <el-table-column :label="$t('resourceAuditFlow.operations')" align="center" fixed="right" width="280"> | ||
| 71 | + <template slot-scope="scope"> | ||
| 72 | + <el-button v-if="scope.row.state === 'W'" size="mini" type="primary" @click="openDeployWorkflow(scope.row)"> | ||
| 73 | + {{ $t('resourceAuditFlow.deployFlow') }} | ||
| 74 | + </el-button> | ||
| 75 | + <el-button size="mini" type="primary" @click="openEditModal(scope.row)"> | ||
| 76 | + {{ $t('resourceAuditFlow.edit') }} | ||
| 77 | + </el-button> | ||
| 78 | + <el-button size="mini" type="danger" @click="openDeleteModal(scope.row)"> | ||
| 79 | + {{ $t('resourceAuditFlow.delete') }} | ||
| 80 | + </el-button> | ||
| 81 | + </template> | ||
| 82 | + </el-table-column> | ||
| 83 | + </el-table> | ||
| 84 | + | ||
| 85 | + <el-row class="pagination-wrapper"> | ||
| 86 | + <el-col :span="14" class="flow-tips text-left"> | ||
| 87 | + <div v-for="(tip, index) in $t('resourceAuditFlow.flowConfigTips')" :key="index"> | ||
| 88 | + {{ tip }} | ||
| 89 | + </div> | ||
| 90 | + </el-col> | ||
| 91 | + <el-col :span="10" class="pagination-container"> | ||
| 92 | + <el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size" | ||
| 93 | + :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 94 | + @current-change="handleCurrentChange" /> | ||
| 95 | + </el-col> | ||
| 96 | + </el-row> | ||
| 97 | + </el-card> | ||
| 98 | + | ||
| 99 | + <!-- 子组件 --> | ||
| 100 | + <add-resource-audit-flow ref="addModal" @success="fetchData" /> | ||
| 101 | + <edit-resource-audit-flow ref="editModal" @success="fetchData" /> | ||
| 102 | + <delete-resource-audit-flow ref="deleteModal" @success="fetchData" /> | ||
| 103 | + </div> | ||
| 104 | +</template> | ||
| 105 | + | ||
| 106 | +<script> | ||
| 107 | +import { listResourceAuditFlow,deployWorkflow } from '@/api/resource/resourceAuditFlowApi' | ||
| 108 | +import AddResourceAuditFlow from '@/components/resource/AddResourceAuditFlow' | ||
| 109 | +import EditResourceAuditFlow from '@/components/resource/EditResourceAuditFlow' | ||
| 110 | +import DeleteResourceAuditFlow from '@/components/resource/DeleteResourceAuditFlow' | ||
| 111 | + | ||
| 112 | +export default { | ||
| 113 | + name: 'ResourceAuditFlowList', | ||
| 114 | + components: { | ||
| 115 | + AddResourceAuditFlow, | ||
| 116 | + EditResourceAuditFlow, | ||
| 117 | + DeleteResourceAuditFlow | ||
| 118 | + }, | ||
| 119 | + data() { | ||
| 120 | + return { | ||
| 121 | + loading: false, | ||
| 122 | + searchForm: { | ||
| 123 | + flowName: '', | ||
| 124 | + auditType: '' | ||
| 125 | + }, | ||
| 126 | + tableData: [], | ||
| 127 | + pagination: { | ||
| 128 | + current: 1, | ||
| 129 | + size: 10, | ||
| 130 | + total: 0 | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + }, | ||
| 134 | + created() { | ||
| 135 | + this.fetchData() | ||
| 136 | + }, | ||
| 137 | + methods: { | ||
| 138 | + async fetchData() { | ||
| 139 | + try { | ||
| 140 | + this.loading = true | ||
| 141 | + const params = { | ||
| 142 | + page: this.pagination.current, | ||
| 143 | + row: this.pagination.size, | ||
| 144 | + ...this.searchForm | ||
| 145 | + } | ||
| 146 | + const res = await listResourceAuditFlow(params) | ||
| 147 | + if (res.code === 0) { | ||
| 148 | + this.tableData = res.data | ||
| 149 | + this.pagination.total = res.total | ||
| 150 | + } | ||
| 151 | + } catch (error) { | ||
| 152 | + console.error('获取审批流程列表失败:', error) | ||
| 153 | + } finally { | ||
| 154 | + this.loading = false | ||
| 155 | + } | ||
| 156 | + }, | ||
| 157 | + handleQuery() { | ||
| 158 | + this.pagination.current = 1 | ||
| 159 | + this.fetchData() | ||
| 160 | + }, | ||
| 161 | + handleReset() { | ||
| 162 | + this.searchForm = { | ||
| 163 | + flowName: '', | ||
| 164 | + auditType: '' | ||
| 165 | + } | ||
| 166 | + this.pagination.current = 1 | ||
| 167 | + this.fetchData() | ||
| 168 | + }, | ||
| 169 | + handleSizeChange(size) { | ||
| 170 | + this.pagination.size = size | ||
| 171 | + this.fetchData() | ||
| 172 | + }, | ||
| 173 | + handleCurrentChange(current) { | ||
| 174 | + this.pagination.current = current | ||
| 175 | + this.fetchData() | ||
| 176 | + }, | ||
| 177 | + settingFlow(row) { | ||
| 178 | + window.open(`/bpmnjs/index.html?flowId=${row.flowId}&modelId=${row.modelId}`) | ||
| 179 | + }, | ||
| 180 | + async openDeployWorkflow(row) { | ||
| 181 | + try { | ||
| 182 | + this.loading = true | ||
| 183 | + const res = await deployWorkflow({ modelId: row.modelId }) | ||
| 184 | + if (res.code === 0) { | ||
| 185 | + this.$message.success(this.$t('resourceAuditFlow.deploySuccess')) | ||
| 186 | + this.fetchData() | ||
| 187 | + } else { | ||
| 188 | + this.$message.error(res.msg || this.$t('resourceAuditFlow.deployFailed')) | ||
| 189 | + } | ||
| 190 | + } catch (error) { | ||
| 191 | + console.error('部署流程失败:', error) | ||
| 192 | + this.$message.error(this.$t('resourceAuditFlow.deployFailed')) | ||
| 193 | + } finally { | ||
| 194 | + this.loading = false | ||
| 195 | + } | ||
| 196 | + }, | ||
| 197 | + openAddModal() { | ||
| 198 | + this.$refs.addModal.open() | ||
| 199 | + }, | ||
| 200 | + openEditModal(row) { | ||
| 201 | + this.$refs.editModal.open(row) | ||
| 202 | + }, | ||
| 203 | + openDeleteModal(row) { | ||
| 204 | + this.$refs.deleteModal.open(row) | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | +} | ||
| 208 | +</script> | ||
| 209 | + | ||
| 210 | +<style lang="scss" scoped> | ||
| 211 | +.resource-audit-flow-container { | ||
| 212 | + padding: 20px; | ||
| 213 | + | ||
| 214 | + .search-card { | ||
| 215 | + margin-bottom: 20px; | ||
| 216 | + | ||
| 217 | + .el-row { | ||
| 218 | + margin-bottom: -10px; | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + .el-col { | ||
| 222 | + margin-bottom: 10px; | ||
| 223 | + } | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + .list-card { | ||
| 227 | + .list-header { | ||
| 228 | + display: flex; | ||
| 229 | + justify-content: space-between; | ||
| 230 | + align-items: center; | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + .pagination-wrapper { | ||
| 234 | + margin-top: 20px; | ||
| 235 | + display: flex; | ||
| 236 | + align-items: center; | ||
| 237 | + | ||
| 238 | + .flow-tips { | ||
| 239 | + font-size: 12px; | ||
| 240 | + color: #999; | ||
| 241 | + line-height: 1.5; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + .pagination-container { | ||
| 245 | + display: flex; | ||
| 246 | + justify-content: flex-end; | ||
| 247 | + } | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | +} | ||
| 251 | +</style> | ||
| 0 | \ No newline at end of file | 252 | \ No newline at end of file |
src/views/resource/resourceStoreSpecificationManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + resourceStoreSpecificationManage: { | ||
| 4 | + queryConditions: 'Query Conditions', | ||
| 5 | + more: 'More', | ||
| 6 | + hide: 'Hide', | ||
| 7 | + selectItemType: 'Select Item Type', | ||
| 8 | + selectSubCategory: 'Select Sub-category', | ||
| 9 | + specNamePlaceholder: 'Enter Specification Name', | ||
| 10 | + specIdPlaceholder: 'Enter Specification ID', | ||
| 11 | + query: 'Query', | ||
| 12 | + reset: 'Reset', | ||
| 13 | + itemSpecifications: 'Item Specifications', | ||
| 14 | + add: 'Add', | ||
| 15 | + specId: 'Specification ID', | ||
| 16 | + typeName: 'Type Name', | ||
| 17 | + specName: 'Specification Name', | ||
| 18 | + description: 'Description', | ||
| 19 | + operation: 'Operation', | ||
| 20 | + edit: 'Edit', | ||
| 21 | + delete: 'Delete', | ||
| 22 | + addSpec: 'Add Specification', | ||
| 23 | + itemType: 'Item Type', | ||
| 24 | + descriptionPlaceholder: 'Description (optional)', | ||
| 25 | + save: 'Save', | ||
| 26 | + cancel: 'Cancel', | ||
| 27 | + editItemSpec: 'Edit Item Specification', | ||
| 28 | + confirmDeleteTitle: 'Confirm Operation', | ||
| 29 | + confirmDeleteMsg: 'Confirm to delete this specification?', | ||
| 30 | + cancelDelete: 'Cancel', | ||
| 31 | + confirmDelete: 'Confirm Delete' | ||
| 32 | + } | ||
| 33 | + }, | ||
| 34 | + zh: { | ||
| 35 | + resourceStoreSpecificationManage: { | ||
| 36 | + queryConditions: '查询条件', | ||
| 37 | + more: '更多', | ||
| 38 | + hide: '隐藏', | ||
| 39 | + selectItemType: '请选择物品类型', | ||
| 40 | + selectSubCategory: '请选择二级分类', | ||
| 41 | + specNamePlaceholder: '请输入规格名称', | ||
| 42 | + specIdPlaceholder: '请输入规格编号', | ||
| 43 | + query: '查询', | ||
| 44 | + reset: '重置', | ||
| 45 | + itemSpecifications: '物品规格', | ||
| 46 | + add: '添加', | ||
| 47 | + specId: '规格编号', | ||
| 48 | + typeName: '类型名称', | ||
| 49 | + specName: '规格名称', | ||
| 50 | + description: '描述', | ||
| 51 | + operation: '操作', | ||
| 52 | + edit: '修改', | ||
| 53 | + delete: '删除', | ||
| 54 | + addSpec: '添加规格', | ||
| 55 | + itemType: '商品类型', | ||
| 56 | + descriptionPlaceholder: '选填,请填写描述', | ||
| 57 | + save: '保存', | ||
| 58 | + cancel: '取消', | ||
| 59 | + editItemSpec: '修改物品规格', | ||
| 60 | + confirmDeleteTitle: '请确认您的操作', | ||
| 61 | + confirmDeleteMsg: '确定删除物品规格', | ||
| 62 | + cancelDelete: '点错了', | ||
| 63 | + confirmDelete: '确认删除' | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | +} | ||
| 0 | \ No newline at end of file | 67 | \ No newline at end of file |
src/views/resource/resourceStoreSpecificationManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="specification-manage-container"> | ||
| 3 | + <!-- 查询条件 --> | ||
| 4 | + <el-card class="search-card"> | ||
| 5 | + <div slot="header" class="flex justify-between"> | ||
| 6 | + <span>{{ $t('resourceStoreSpecificationManage.queryConditions') }}</span> | ||
| 7 | + <el-button type="text" style="float: right; padding: 3px 0" @click="toggleMoreCondition"> | ||
| 8 | + {{ moreCondition ? $t('resourceStoreSpecificationManage.hide') : $t('resourceStoreSpecificationManage.more') }} | ||
| 9 | + </el-button> | ||
| 10 | + </div> | ||
| 11 | + <el-form :model="conditions" label-width="0"> | ||
| 12 | + <el-row :gutter="20"> | ||
| 13 | + <el-col :span="6"> | ||
| 14 | + <el-form-item> | ||
| 15 | + <el-select v-model="conditions.parentRstId" | ||
| 16 | + :placeholder="$t('resourceStoreSpecificationManage.selectItemType')" @change="handleParentTypeChange" | ||
| 17 | + style="width:100%"> | ||
| 18 | + <el-option v-for="item in resourceStoreTypes" :key="item.rstId" :label="item.name" :value="item.rstId"> | ||
| 19 | + </el-option> | ||
| 20 | + </el-select> | ||
| 21 | + </el-form-item> | ||
| 22 | + </el-col> | ||
| 23 | + <el-col :span="6"> | ||
| 24 | + <el-form-item> | ||
| 25 | + <el-select v-model="conditions.rstId" | ||
| 26 | + :placeholder="$t('resourceStoreSpecificationManage.selectSubCategory')" style="width:100%"> | ||
| 27 | + <el-option v-for="item in resourceStoreSonTypes" :key="item.rstId" :label="item.name" :value="item.rstId"> | ||
| 28 | + </el-option> | ||
| 29 | + </el-select> | ||
| 30 | + </el-form-item> | ||
| 31 | + </el-col> | ||
| 32 | + <el-col :span="6"> | ||
| 33 | + <el-form-item> | ||
| 34 | + <el-input v-model="conditions.specName" | ||
| 35 | + :placeholder="$t('resourceStoreSpecificationManage.specNamePlaceholder')"> | ||
| 36 | + </el-input> | ||
| 37 | + </el-form-item> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="6"> | ||
| 40 | + <el-button type="primary" @click="queryResourceStoreSpecification"> | ||
| 41 | + <i class="el-icon-search"></i> | ||
| 42 | + {{ $t('resourceStoreSpecificationManage.query') }} | ||
| 43 | + </el-button> | ||
| 44 | + <el-button @click="resetResourceStoreSpecification"> | ||
| 45 | + <i class="el-icon-refresh"></i> | ||
| 46 | + {{ $t('resourceStoreSpecificationManage.reset') }} | ||
| 47 | + </el-button> | ||
| 48 | + </el-col> | ||
| 49 | + </el-row> | ||
| 50 | + | ||
| 51 | + <el-row v-show="moreCondition" :gutter="20"> | ||
| 52 | + <el-col :span="6"> | ||
| 53 | + <el-form-item> | ||
| 54 | + <el-input v-model="conditions.rssId" | ||
| 55 | + :placeholder="$t('resourceStoreSpecificationManage.specIdPlaceholder')"> | ||
| 56 | + </el-input> | ||
| 57 | + </el-form-item> | ||
| 58 | + </el-col> | ||
| 59 | + </el-row> | ||
| 60 | + </el-form> | ||
| 61 | + </el-card> | ||
| 62 | + | ||
| 63 | + <!-- 规格列表 --> | ||
| 64 | + <el-card class="list-card"> | ||
| 65 | + <div slot="header" class="flex justify-between"> | ||
| 66 | + <span>{{ $t('resourceStoreSpecificationManage.itemSpecifications') }}</span> | ||
| 67 | + <el-button type="primary" size="small" style="float: right;" @click="openAddModal"> | ||
| 68 | + <i class="el-icon-plus"></i> | ||
| 69 | + {{ $t('resourceStoreSpecificationManage.add') }} | ||
| 70 | + </el-button> | ||
| 71 | + </div> | ||
| 72 | + | ||
| 73 | + <el-table :data="resourceStoreSpecifications" border v-loading="loading"> | ||
| 74 | + <el-table-column prop="rssId" :label="$t('resourceStoreSpecificationManage.specId')" align="center"> | ||
| 75 | + </el-table-column> | ||
| 76 | + <el-table-column :label="$t('resourceStoreSpecificationManage.typeName')" align="center"> | ||
| 77 | + <template slot-scope="scope"> | ||
| 78 | + {{ scope.row.parentRstName }}{{ scope.row.rstName ? ' > ' + scope.row.rstName : '' }} | ||
| 79 | + </template> | ||
| 80 | + </el-table-column> | ||
| 81 | + <el-table-column prop="specName" :label="$t('resourceStoreSpecificationManage.specName')" align="center"> | ||
| 82 | + </el-table-column> | ||
| 83 | + <el-table-column prop="description" :label="$t('resourceStoreSpecificationManage.description')" align="center"> | ||
| 84 | + </el-table-column> | ||
| 85 | + <el-table-column :label="$t('resourceStoreSpecificationManage.operation')" align="center" width="200"> | ||
| 86 | + <template slot-scope="scope"> | ||
| 87 | + <el-button type="primary" size="mini" @click="openEditModal(scope.row)"> | ||
| 88 | + {{ $t('resourceStoreSpecificationManage.edit') }} | ||
| 89 | + </el-button> | ||
| 90 | + <el-button type="danger" size="mini" @click="openDeleteModal(scope.row)"> | ||
| 91 | + {{ $t('resourceStoreSpecificationManage.delete') }} | ||
| 92 | + </el-button> | ||
| 93 | + </template> | ||
| 94 | + </el-table-column> | ||
| 95 | + </el-table> | ||
| 96 | + | ||
| 97 | + <el-pagination class="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 98 | + :current-page="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 99 | + layout="total, sizes, prev, pager, next, jumper" :total="page.total"> | ||
| 100 | + </el-pagination> | ||
| 101 | + </el-card> | ||
| 102 | + | ||
| 103 | + <!-- 子组件 --> | ||
| 104 | + <add-resource-store-specification ref="addModal" @success="handleSuccess"></add-resource-store-specification> | ||
| 105 | + <edit-resource-store-specification ref="editModal" @success="handleSuccess"></edit-resource-store-specification> | ||
| 106 | + <delete-resource-store-specification ref="deleteModal" @success="handleSuccess"></delete-resource-store-specification> | ||
| 107 | + </div> | ||
| 108 | +</template> | ||
| 109 | + | ||
| 110 | +<script> | ||
| 111 | +import { listResourceStoreSpecifications, listResourceStoreTypes } from '@/api/resource/resourceStoreSpecificationManageApi' | ||
| 112 | +import AddResourceStoreSpecification from '@/components/resource/addResourceStoreSpecification' | ||
| 113 | +import EditResourceStoreSpecification from '@/components/resource/editResourceStoreSpecification' | ||
| 114 | +import DeleteResourceStoreSpecification from '@/components/resource/deleteResourceStoreSpecification' | ||
| 115 | + | ||
| 116 | +export default { | ||
| 117 | + name: 'ResourceStoreSpecificationManageList', | ||
| 118 | + data() { | ||
| 119 | + return { | ||
| 120 | + loading: false, | ||
| 121 | + moreCondition: false, | ||
| 122 | + conditions: { | ||
| 123 | + specName: '', | ||
| 124 | + parentRstId: '', | ||
| 125 | + rstId: '', | ||
| 126 | + rssId: '' | ||
| 127 | + }, | ||
| 128 | + resourceStoreSpecifications: [], | ||
| 129 | + resourceStoreTypes: [], | ||
| 130 | + resourceStoreSonTypes: [], | ||
| 131 | + page: { | ||
| 132 | + current: 1, | ||
| 133 | + size: 10, | ||
| 134 | + total: 0 | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + components: { | ||
| 139 | + AddResourceStoreSpecification, | ||
| 140 | + EditResourceStoreSpecification, | ||
| 141 | + DeleteResourceStoreSpecification | ||
| 142 | + }, | ||
| 143 | + created() { | ||
| 144 | + this.getList() | ||
| 145 | + this.getResourceStoreTypes() | ||
| 146 | + }, | ||
| 147 | + methods: { | ||
| 148 | + async getList() { | ||
| 149 | + this.loading = true | ||
| 150 | + try { | ||
| 151 | + const params = { | ||
| 152 | + ...this.conditions, | ||
| 153 | + page: this.page.current, | ||
| 154 | + row: this.page.size | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + const res = await listResourceStoreSpecifications(params) | ||
| 158 | + this.resourceStoreSpecifications = res.data | ||
| 159 | + this.page.total = res.total | ||
| 160 | + } catch (error) { | ||
| 161 | + console.error('Failed to get specification list:', error) | ||
| 162 | + this.$message.error(this.$t('common.queryFailed')) | ||
| 163 | + } finally { | ||
| 164 | + this.loading = false | ||
| 165 | + } | ||
| 166 | + }, | ||
| 167 | + | ||
| 168 | + async getResourceStoreTypes() { | ||
| 169 | + try { | ||
| 170 | + const params = { | ||
| 171 | + page: 1, | ||
| 172 | + row: 100, | ||
| 173 | + parentId: '0' | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + const res = await listResourceStoreTypes(params) | ||
| 177 | + this.resourceStoreTypes = res.data | ||
| 178 | + } catch (error) { | ||
| 179 | + console.error('Failed to get item types:', error) | ||
| 180 | + } | ||
| 181 | + }, | ||
| 182 | + | ||
| 183 | + async getResourceStoreSonTypes(parentRstId) { | ||
| 184 | + try { | ||
| 185 | + const params = { | ||
| 186 | + page: 1, | ||
| 187 | + row: 100, | ||
| 188 | + rstId: parentRstId, | ||
| 189 | + flag: "0" | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + const res = await listResourceStoreTypes(params) | ||
| 193 | + this.resourceStoreSonTypes = res.data | ||
| 194 | + } catch (error) { | ||
| 195 | + console.error('Failed to get sub item types:', error) | ||
| 196 | + } | ||
| 197 | + }, | ||
| 198 | + | ||
| 199 | + handleParentTypeChange(val) { | ||
| 200 | + this.conditions.rstId = '' | ||
| 201 | + if (!val) { | ||
| 202 | + this.resourceStoreSonTypes = [] | ||
| 203 | + return | ||
| 204 | + } | ||
| 205 | + this.getResourceStoreSonTypes(val) | ||
| 206 | + }, | ||
| 207 | + | ||
| 208 | + toggleMoreCondition() { | ||
| 209 | + this.moreCondition = !this.moreCondition | ||
| 210 | + }, | ||
| 211 | + | ||
| 212 | + queryResourceStoreSpecification() { | ||
| 213 | + this.page.current = 1 | ||
| 214 | + this.getList() | ||
| 215 | + }, | ||
| 216 | + | ||
| 217 | + resetResourceStoreSpecification() { | ||
| 218 | + this.conditions = { | ||
| 219 | + specName: '', | ||
| 220 | + parentRstId: '', | ||
| 221 | + rstId: '', | ||
| 222 | + rssId: '' | ||
| 223 | + } | ||
| 224 | + this.resourceStoreSonTypes = [] | ||
| 225 | + this.page.current = 1 | ||
| 226 | + this.getList() | ||
| 227 | + }, | ||
| 228 | + | ||
| 229 | + openAddModal() { | ||
| 230 | + this.$refs.addModal.open() | ||
| 231 | + }, | ||
| 232 | + | ||
| 233 | + openEditModal(row) { | ||
| 234 | + this.$refs.editModal.open(row) | ||
| 235 | + }, | ||
| 236 | + | ||
| 237 | + openDeleteModal(row) { | ||
| 238 | + this.$refs.deleteModal.open(row) | ||
| 239 | + }, | ||
| 240 | + | ||
| 241 | + handleSuccess() { | ||
| 242 | + this.getList() | ||
| 243 | + }, | ||
| 244 | + | ||
| 245 | + handleSizeChange(size) { | ||
| 246 | + this.page.size = size | ||
| 247 | + this.getList() | ||
| 248 | + }, | ||
| 249 | + | ||
| 250 | + handleCurrentChange(current) { | ||
| 251 | + this.page.current = current | ||
| 252 | + this.getList() | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | +} | ||
| 256 | +</script> | ||
| 257 | + | ||
| 258 | +<style lang="scss" scoped> | ||
| 259 | +.specification-manage-container { | ||
| 260 | + padding: 20px; | ||
| 261 | + | ||
| 262 | + .search-card { | ||
| 263 | + margin-bottom: 20px; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + .list-card { | ||
| 267 | + margin-bottom: 20px; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + .pagination { | ||
| 271 | + margin-top: 20px; | ||
| 272 | + text-align: right; | ||
| 273 | + } | ||
| 274 | +} | ||
| 275 | +</style> | ||
| 0 | \ No newline at end of file | 276 | \ No newline at end of file |
src/views/resource/storehouseManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + storehouseManage: { | ||
| 4 | + searchTitle: 'Query Conditions', | ||
| 5 | + listTitle: 'Warehouse Information', | ||
| 6 | + placeholders: { | ||
| 7 | + shName: 'Please enter warehouse name', | ||
| 8 | + shId: 'Please enter warehouse ID', | ||
| 9 | + isShow: 'Please select whether it is open to the public' | ||
| 10 | + }, | ||
| 11 | + options: { | ||
| 12 | + all: 'All', | ||
| 13 | + yes: 'Yes', | ||
| 14 | + no: 'No', | ||
| 15 | + noAudit: 'No audit' | ||
| 16 | + }, | ||
| 17 | + buttons: { | ||
| 18 | + search: 'Search', | ||
| 19 | + reset: 'Reset', | ||
| 20 | + add: 'Add', | ||
| 21 | + edit: 'Edit', | ||
| 22 | + delete: 'Delete', | ||
| 23 | + detail: 'Details' | ||
| 24 | + }, | ||
| 25 | + table: { | ||
| 26 | + shId: 'Warehouse ID', | ||
| 27 | + shName: 'Warehouse Name', | ||
| 28 | + isShow: 'Open to Public', | ||
| 29 | + allowPurchase: 'Allow Purchase', | ||
| 30 | + allowUse: 'Allow Use', | ||
| 31 | + purchaseSwitch: 'Purchase Audit', | ||
| 32 | + useSwitch: 'Use Audit', | ||
| 33 | + allocationSwitch: 'Allocation Audit', | ||
| 34 | + createTime: 'Creation Time', | ||
| 35 | + shDesc: 'Description', | ||
| 36 | + operations: 'Operations' | ||
| 37 | + }, | ||
| 38 | + messages: { | ||
| 39 | + fetchError: 'Failed to fetch warehouse data' | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + }, | ||
| 43 | + zh: { | ||
| 44 | + storehouseManage: { | ||
| 45 | + searchTitle: '查询条件', | ||
| 46 | + listTitle: '仓库信息', | ||
| 47 | + placeholders: { | ||
| 48 | + shName: '请输入仓库名称', | ||
| 49 | + shId: '请输入仓库编号', | ||
| 50 | + isShow: '请选择是否对外开放' | ||
| 51 | + }, | ||
| 52 | + options: { | ||
| 53 | + all: '全部', | ||
| 54 | + yes: '是', | ||
| 55 | + no: '否', | ||
| 56 | + noAudit: '不审核' | ||
| 57 | + }, | ||
| 58 | + buttons: { | ||
| 59 | + search: '查询', | ||
| 60 | + reset: '重置', | ||
| 61 | + add: '添加', | ||
| 62 | + edit: '修改', | ||
| 63 | + delete: '删除', | ||
| 64 | + detail: '详情' | ||
| 65 | + }, | ||
| 66 | + table: { | ||
| 67 | + shId: '仓库编号', | ||
| 68 | + shName: '仓库名称', | ||
| 69 | + isShow: '对外开放', | ||
| 70 | + allowPurchase: '允许采购', | ||
| 71 | + allowUse: '允许领用', | ||
| 72 | + purchaseSwitch: '采购审核', | ||
| 73 | + useSwitch: '领用审核', | ||
| 74 | + allocationSwitch: '调拨审核', | ||
| 75 | + createTime: '创建时间', | ||
| 76 | + shDesc: '描述', | ||
| 77 | + operations: '操作' | ||
| 78 | + }, | ||
| 79 | + messages: { | ||
| 80 | + fetchError: '获取仓库数据失败' | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | +} | ||
| 0 | \ No newline at end of file | 85 | \ No newline at end of file |
src/views/resource/storehouseManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="storehouse-manage-container"> | ||
| 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('storehouseManage.searchTitle') }}</div> | ||
| 8 | + </div> | ||
| 9 | + <el-form :model="conditions" label-width="auto" class="search-form"> | ||
| 10 | + <el-row :gutter="20"> | ||
| 11 | + <el-col :span="6"> | ||
| 12 | + <el-form-item> | ||
| 13 | + <el-input v-model="conditions.shName" :placeholder="$t('storehouseManage.placeholders.shName')" /> | ||
| 14 | + </el-form-item> | ||
| 15 | + </el-col> | ||
| 16 | + <el-col :span="6"> | ||
| 17 | + <el-form-item> | ||
| 18 | + <el-select v-model="conditions.isShow" :placeholder="$t('storehouseManage.placeholders.isShow')" | ||
| 19 | + style="width:100%"> | ||
| 20 | + <el-option :label="$t('storehouseManage.options.all')" value=""></el-option> | ||
| 21 | + <el-option :label="$t('storehouseManage.options.yes')" value="true"></el-option> | ||
| 22 | + <el-option :label="$t('storehouseManage.options.no')" value="false"></el-option> | ||
| 23 | + </el-select> | ||
| 24 | + </el-form-item> | ||
| 25 | + </el-col> | ||
| 26 | + <el-col :span="6"> | ||
| 27 | + <el-form-item> | ||
| 28 | + <el-input v-model="conditions.shId" :placeholder="$t('storehouseManage.placeholders.shId')" /> | ||
| 29 | + </el-form-item> | ||
| 30 | + </el-col> | ||
| 31 | + <el-col :span="6"> | ||
| 32 | + <el-form-item> | ||
| 33 | + <el-button type="primary" @click="queryStorehouseMethod"> | ||
| 34 | + <i class="el-icon-search"></i> | ||
| 35 | + {{ $t('storehouseManage.buttons.search') }} | ||
| 36 | + </el-button> | ||
| 37 | + <el-button @click="resetStorehouseMethod"> | ||
| 38 | + <i class="el-icon-refresh"></i> | ||
| 39 | + {{ $t('storehouseManage.buttons.reset') }} | ||
| 40 | + </el-button> | ||
| 41 | + </el-form-item> | ||
| 42 | + </el-col> | ||
| 43 | + </el-row> | ||
| 44 | + </el-form> | ||
| 45 | + </el-card> | ||
| 46 | + </el-col> | ||
| 47 | + </el-row> | ||
| 48 | + | ||
| 49 | + <el-row class="margin-top"> | ||
| 50 | + <el-col :span="24"> | ||
| 51 | + <el-card class="box-card"> | ||
| 52 | + <div slot="header" class="flex justify-between"> | ||
| 53 | + <div>{{ $t('storehouseManage.listTitle') }}</div> | ||
| 54 | + <div style="float: right;"> | ||
| 55 | + <el-button type="primary" size="small" @click="openAddStorehouseModal" | ||
| 56 | + v-if="hasPrivilege('502021101638940007')"> | ||
| 57 | + <i class="el-icon-plus"></i> | ||
| 58 | + {{ $t('storehouseManage.buttons.add') }} | ||
| 59 | + </el-button> | ||
| 60 | + </div> | ||
| 61 | + </div> | ||
| 62 | + <el-table :data="storehouses" border style="width:100%"> | ||
| 63 | + <el-table-column prop="shId" :label="$t('storehouseManage.table.shId')" align="center" /> | ||
| 64 | + <el-table-column prop="shName" :label="$t('storehouseManage.table.shName')" align="center" /> | ||
| 65 | + <el-table-column :label="$t('storehouseManage.table.isShow')" align="center"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + {{ scope.row.isShow === 'true' ? $t('storehouseManage.options.yes') : $t('storehouseManage.options.no') }} | ||
| 68 | + </template> | ||
| 69 | + </el-table-column> | ||
| 70 | + <el-table-column :label="$t('storehouseManage.table.allowPurchase')" align="center"> | ||
| 71 | + <template slot-scope="scope"> | ||
| 72 | + {{ scope.row.allowPurchase === 'ON' ? $t('storehouseManage.options.yes') : | ||
| 73 | + $t('storehouseManage.options.no') }} | ||
| 74 | + </template> | ||
| 75 | + </el-table-column> | ||
| 76 | + <el-table-column :label="$t('storehouseManage.table.allowUse')" align="center"> | ||
| 77 | + <template slot-scope="scope"> | ||
| 78 | + {{ scope.row.allowUse === 'ON' ? $t('storehouseManage.options.yes') : $t('storehouseManage.options.no') }} | ||
| 79 | + </template> | ||
| 80 | + </el-table-column> | ||
| 81 | + <el-table-column :label="$t('storehouseManage.table.purchaseSwitch')" align="center"> | ||
| 82 | + <template slot-scope="scope"> | ||
| 83 | + {{ scope.row.purchaseSwitch === 'ON' ? scope.row.purchaseFlowName : $t('storehouseManage.options.noAudit') | ||
| 84 | + }} | ||
| 85 | + </template> | ||
| 86 | + </el-table-column> | ||
| 87 | + <el-table-column :label="$t('storehouseManage.table.useSwitch')" align="center"> | ||
| 88 | + <template slot-scope="scope"> | ||
| 89 | + {{ scope.row.useSwitch === 'ON' ? scope.row.useFlowName : $t('storehouseManage.options.noAudit') }} | ||
| 90 | + </template> | ||
| 91 | + </el-table-column> | ||
| 92 | + <el-table-column :label="$t('storehouseManage.table.allocationSwitch')" align="center"> | ||
| 93 | + <template slot-scope="scope"> | ||
| 94 | + {{ scope.row.allocationSwitch === 'ON' ? scope.row.allocationFlowName : | ||
| 95 | + $t('storehouseManage.options.noAudit') }} | ||
| 96 | + </template> | ||
| 97 | + </el-table-column> | ||
| 98 | + <el-table-column prop="createTime" :label="$t('storehouseManage.table.createTime')" align="center" /> | ||
| 99 | + <el-table-column :label="$t('storehouseManage.table.shDesc')" align="center"> | ||
| 100 | + <template slot-scope="scope"> | ||
| 101 | + {{ scope.row.shDesc && scope.row.shDesc !== '-1' ? scope.row.shDesc : '--' }} | ||
| 102 | + </template> | ||
| 103 | + </el-table-column> | ||
| 104 | + <el-table-column :label="$t('storehouseManage.table.operations')" align="center" fixed="right" width="250"> | ||
| 105 | + <template slot-scope="scope"> | ||
| 106 | + <el-button v-if="hasPrivilege('502021101197710001')" size="mini" type="primary" | ||
| 107 | + @click="openEditStorehouseModel(scope.row)"> | ||
| 108 | + {{ $t('storehouseManage.buttons.edit') }} | ||
| 109 | + </el-button> | ||
| 110 | + <el-button v-if="hasPrivilege('502021122129210001')" size="mini" type="danger" | ||
| 111 | + @click="openDeleteStorehouseModel(scope.row)"> | ||
| 112 | + {{ $t('storehouseManage.buttons.delete') }} | ||
| 113 | + </el-button> | ||
| 114 | + <el-button size="mini" @click="openDetailStorehouseModel(scope.row)"> | ||
| 115 | + {{ $t('storehouseManage.buttons.detail') }} | ||
| 116 | + </el-button> | ||
| 117 | + </template> | ||
| 118 | + </el-table-column> | ||
| 119 | + </el-table> | ||
| 120 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" | ||
| 121 | + :page-sizes="[10, 20, 30, 50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" | ||
| 122 | + :total="total" class="pagination"> | ||
| 123 | + </el-pagination> | ||
| 124 | + </el-card> | ||
| 125 | + </el-col> | ||
| 126 | + </el-row> | ||
| 127 | + | ||
| 128 | + <!-- 组件 --> | ||
| 129 | + <add-storehouse ref="addStorehouse" @success="listStorehouses" /> | ||
| 130 | + <edit-storehouse ref="editStorehouse" @success="listStorehouses" /> | ||
| 131 | + <delete-storehouse ref="deleteStorehouse" @success="listStorehouses" /> | ||
| 132 | + </div> | ||
| 133 | +</template> | ||
| 134 | + | ||
| 135 | +<script> | ||
| 136 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 137 | +import { listStorehouses } from '@/api/resource/storehouseManageApi' | ||
| 138 | +import AddStorehouse from '@/components/resource/AddStorehouse' | ||
| 139 | +import EditStorehouse from '@/components/resource/EditStorehouse' | ||
| 140 | +import DeleteStorehouse from '@/components/resource/DeleteStorehouse' | ||
| 141 | + | ||
| 142 | +export default { | ||
| 143 | + name: 'StorehouseManageList', | ||
| 144 | + components: { | ||
| 145 | + AddStorehouse, | ||
| 146 | + EditStorehouse, | ||
| 147 | + DeleteStorehouse | ||
| 148 | + }, | ||
| 149 | + data() { | ||
| 150 | + return { | ||
| 151 | + currentPage: 1, | ||
| 152 | + pageSize: 10, | ||
| 153 | + total: 0, | ||
| 154 | + conditions: { | ||
| 155 | + shName: '', | ||
| 156 | + isShow: '', | ||
| 157 | + shId: '', | ||
| 158 | + communityId: '' | ||
| 159 | + }, | ||
| 160 | + storehouses: [] | ||
| 161 | + } | ||
| 162 | + }, | ||
| 163 | + created() { | ||
| 164 | + this.conditions.communityId = getCommunityId() | ||
| 165 | + this.listStorehouses() | ||
| 166 | + }, | ||
| 167 | + methods: { | ||
| 168 | + async listStorehouses() { | ||
| 169 | + try { | ||
| 170 | + const params = { | ||
| 171 | + page: this.currentPage, | ||
| 172 | + row: this.pageSize, | ||
| 173 | + ...this.conditions | ||
| 174 | + } | ||
| 175 | + const response = await listStorehouses(params) | ||
| 176 | + this.storehouses = response.data | ||
| 177 | + this.total = response.total | ||
| 178 | + } catch (error) { | ||
| 179 | + this.$message.error(this.$t('storehouseManage.messages.fetchError')) | ||
| 180 | + } | ||
| 181 | + }, | ||
| 182 | + queryStorehouseMethod() { | ||
| 183 | + this.currentPage = 1 | ||
| 184 | + this.listStorehouses() | ||
| 185 | + }, | ||
| 186 | + resetStorehouseMethod() { | ||
| 187 | + this.conditions = { | ||
| 188 | + shName: '', | ||
| 189 | + isShow: '', | ||
| 190 | + shId: '', | ||
| 191 | + communityId: getCommunityId() | ||
| 192 | + } | ||
| 193 | + this.queryStorehouseMethod() | ||
| 194 | + }, | ||
| 195 | + handleSizeChange(size) { | ||
| 196 | + this.pageSize = size | ||
| 197 | + this.listStorehouses() | ||
| 198 | + }, | ||
| 199 | + handleCurrentChange(page) { | ||
| 200 | + this.currentPage = page | ||
| 201 | + this.listStorehouses() | ||
| 202 | + }, | ||
| 203 | + openAddStorehouseModal() { | ||
| 204 | + this.$refs.addStorehouse.open() | ||
| 205 | + }, | ||
| 206 | + openEditStorehouseModel(row) { | ||
| 207 | + this.$refs.editStorehouse.open(row) | ||
| 208 | + }, | ||
| 209 | + openDeleteStorehouseModel(row) { | ||
| 210 | + this.$refs.deleteStorehouse.open(row) | ||
| 211 | + }, | ||
| 212 | + openDetailStorehouseModel(row) { | ||
| 213 | + this.$router.push(`/pages/common/resourceStoreManage?shId=${row.shId}&flag=1`) | ||
| 214 | + }, | ||
| 215 | + } | ||
| 216 | +} | ||
| 217 | +</script> | ||
| 218 | + | ||
| 219 | +<style scoped> | ||
| 220 | +.storehouse-manage-container { | ||
| 221 | + padding: 20px; | ||
| 222 | +} | ||
| 223 | + | ||
| 224 | +.search-form { | ||
| 225 | + margin-bottom: -20px; | ||
| 226 | +} | ||
| 227 | + | ||
| 228 | +.pagination { | ||
| 229 | + margin-top: 20px; | ||
| 230 | + text-align: right; | ||
| 231 | +} | ||
| 232 | +</style> | ||
| 0 | \ No newline at end of file | 233 | \ No newline at end of file |