Commit 9c3117625e0c2d7b0f4102893ebfbb51192c1e3e
1 parent
e5777926
工作办理测试中
Showing
28 changed files
with
2384 additions
and
3 deletions
src/api/contract/contractApplyAuditOrdersApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 查询合同任务列表 | ||
| 4 | +export function queryContractTask(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/contract/queryContractTask', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve(res) | ||
| 13 | + }).catch(error => { | ||
| 14 | + reject(error) | ||
| 15 | + }) | ||
| 16 | + }) | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +// 合同审批 | ||
| 20 | +export function needAuditContract(data) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/contract/needAuditContract', | ||
| 24 | + method: 'post', | ||
| 25 | + data | ||
| 26 | + }).then(response => { | ||
| 27 | + const res = response.data | ||
| 28 | + resolve(res) | ||
| 29 | + }).catch(error => { | ||
| 30 | + reject(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +// 查询工作流下一节点 | ||
| 36 | +export function listWorkflowNextNode(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/workflow.listWorkflowNextNode', | ||
| 40 | + method: 'get', | ||
| 41 | + params | ||
| 42 | + }).then(response => { | ||
| 43 | + const res = response.data | ||
| 44 | + resolve(res) | ||
| 45 | + }).catch(error => { | ||
| 46 | + reject(error) | ||
| 47 | + }) | ||
| 48 | + }) | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +// 查询工作流步骤人员 | ||
| 52 | +export function listWorkflowStepStaffs(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/workflow.listWorkflowStepStaffs', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 查询员工信息 | ||
| 68 | +export function queryStaffInfos(params) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/query.staff.infos', | ||
| 72 | + method: 'get', | ||
| 73 | + params | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +// 查询组织树 | ||
| 84 | +export function listOrgTree(params) { | ||
| 85 | + return new Promise((resolve, reject) => { | ||
| 86 | + request({ | ||
| 87 | + url: '/org.listOrgTree', | ||
| 88 | + method: 'get', | ||
| 89 | + params | ||
| 90 | + }).then(response => { | ||
| 91 | + const res = response.data | ||
| 92 | + resolve(res) | ||
| 93 | + }).catch(error => { | ||
| 94 | + reject(error) | ||
| 95 | + }) | ||
| 96 | + }) | ||
| 97 | +} | ||
| 0 | \ No newline at end of file | 98 | \ No newline at end of file |
src/api/resource/allocationStorehouseAuditOrdersApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 3 | + | ||
| 4 | +// 获取调拨仓库审核订单列表 | ||
| 5 | +export function listAllocationStoreAuditOrders(params) { | ||
| 6 | + return new Promise((resolve, reject) => { | ||
| 7 | + request({ | ||
| 8 | + url: '/resourceStore.listAllocationStoreAuditOrders', | ||
| 9 | + method: 'get', | ||
| 10 | + params: { | ||
| 11 | + ...params, | ||
| 12 | + communityId: getCommunityId() | ||
| 13 | + } | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +// 获取工作流步骤员工 | ||
| 24 | +export function listWorkflowStepStaffs(params) { | ||
| 25 | + return new Promise((resolve, reject) => { | ||
| 26 | + request({ | ||
| 27 | + url: '/workflow.listWorkflowStepStaffs', | ||
| 28 | + method: 'get', | ||
| 29 | + params | ||
| 30 | + }).then(response => { | ||
| 31 | + const res = response.data | ||
| 32 | + resolve(res) | ||
| 33 | + }).catch(error => { | ||
| 34 | + reject(error) | ||
| 35 | + }) | ||
| 36 | + }) | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +// 审核订单信息 | ||
| 40 | +export function auditOrderInfo(data) { | ||
| 41 | + return new Promise((resolve, reject) => { | ||
| 42 | + request({ | ||
| 43 | + url: '/resourceStore.auditAllocationStoreAuditOrder', | ||
| 44 | + method: 'post', | ||
| 45 | + data | ||
| 46 | + }).then(response => { | ||
| 47 | + const res = response.data | ||
| 48 | + resolve(res) | ||
| 49 | + }).catch(error => { | ||
| 50 | + reject(error) | ||
| 51 | + }) | ||
| 52 | + }) | ||
| 53 | +} | ||
| 0 | \ No newline at end of file | 54 | \ No newline at end of file |
src/api/resource/allocationStorehouseEnterApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取调拨入库列表 | ||
| 4 | +export function listAllocationStorehouses(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/resourceStore.listAllocationStorehouses', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve(res) | ||
| 13 | + }).catch(error => { | ||
| 14 | + reject(error) | ||
| 15 | + }) | ||
| 16 | + }) | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +// 提交调拨入库 | ||
| 20 | +export function allocationStoreEnter(data) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/resourceStore.allocationStoreEnter', | ||
| 24 | + method: 'post', | ||
| 25 | + data | ||
| 26 | + }).then(response => { | ||
| 27 | + const res = response.data | ||
| 28 | + resolve(res) | ||
| 29 | + }).catch(error => { | ||
| 30 | + reject(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | +} | ||
| 0 | \ No newline at end of file | 34 | \ No newline at end of file |
src/api/resource/contractChangeAuditOrdersApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 查询合同变更任务列表 | ||
| 4 | +export function queryContractChangeTask(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/contract/queryContractChangeTask', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve(res) | ||
| 13 | + }).catch(error => { | ||
| 14 | + reject(error) | ||
| 15 | + }) | ||
| 16 | + }) | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +// 审批合同变更计划 | ||
| 20 | +export function needAuditContractPlan(data) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/contract/needAuditContractPlan', | ||
| 24 | + method: 'post', | ||
| 25 | + data | ||
| 26 | + }).then(response => { | ||
| 27 | + const res = response.data | ||
| 28 | + resolve(res) | ||
| 29 | + }).catch(error => { | ||
| 30 | + reject(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +// 查询组织树 | ||
| 36 | +export function listOrgTree(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/org.listOrgTree', | ||
| 40 | + method: 'get', | ||
| 41 | + params | ||
| 42 | + }).then(response => { | ||
| 43 | + const res = response.data | ||
| 44 | + resolve(res) | ||
| 45 | + }).catch(error => { | ||
| 46 | + reject(error) | ||
| 47 | + }) | ||
| 48 | + }) | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +// 查询员工信息 | ||
| 52 | +export function queryStaffInfos(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/query.staff.infos', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 查询工作流下一节点 | ||
| 68 | +export function listWorkflowNextNode(params) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/workflow.listWorkflowNextNode', | ||
| 72 | + method: 'get', | ||
| 73 | + params | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 0 | \ No newline at end of file | 82 | \ No newline at end of file |
src/api/resource/editAllocationStorehouseApplyApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +// 获取调拨申请列表 | ||
| 4 | +export function listAllocationStorehouseApply(params) { | ||
| 5 | + return new Promise((resolve, reject) => { | ||
| 6 | + request({ | ||
| 7 | + url: '/resourceStore.listAllocationStorehouseApplys', | ||
| 8 | + method: 'get', | ||
| 9 | + params | ||
| 10 | + }).then(response => { | ||
| 11 | + const res = response.data | ||
| 12 | + resolve(res) | ||
| 13 | + }).catch(error => { | ||
| 14 | + reject(error) | ||
| 15 | + }) | ||
| 16 | + }) | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +// 获取调拨物品列表 | ||
| 20 | +export function listAllocationStorehouses(params) { | ||
| 21 | + return new Promise((resolve, reject) => { | ||
| 22 | + request({ | ||
| 23 | + url: '/resourceStore.listAllocationStorehouses', | ||
| 24 | + method: 'get', | ||
| 25 | + params | ||
| 26 | + }).then(response => { | ||
| 27 | + const res = response.data | ||
| 28 | + resolve(res) | ||
| 29 | + }).catch(error => { | ||
| 30 | + reject(error) | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +// 获取仓库列表 | ||
| 36 | +export function listStorehouses(params) { | ||
| 37 | + return new Promise((resolve, reject) => { | ||
| 38 | + request({ | ||
| 39 | + url: '/resourceStore.listStorehouses', | ||
| 40 | + method: 'get', | ||
| 41 | + params | ||
| 42 | + }).then(response => { | ||
| 43 | + const res = response.data | ||
| 44 | + resolve(res) | ||
| 45 | + }).catch(error => { | ||
| 46 | + reject(error) | ||
| 47 | + }) | ||
| 48 | + }) | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +// 获取物品列表 | ||
| 52 | +export function listResourceStores(params) { | ||
| 53 | + return new Promise((resolve, reject) => { | ||
| 54 | + request({ | ||
| 55 | + url: '/resourceStore.listResourceStores', | ||
| 56 | + method: 'get', | ||
| 57 | + params | ||
| 58 | + }).then(response => { | ||
| 59 | + const res = response.data | ||
| 60 | + resolve(res) | ||
| 61 | + }).catch(error => { | ||
| 62 | + reject(error) | ||
| 63 | + }) | ||
| 64 | + }) | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +// 获取物品类型列表 | ||
| 68 | +export function listResourceStoreTypes(params) { | ||
| 69 | + return new Promise((resolve, reject) => { | ||
| 70 | + request({ | ||
| 71 | + url: '/resourceStoreType.listResourceStoreTypes', | ||
| 72 | + method: 'get', | ||
| 73 | + params | ||
| 74 | + }).then(response => { | ||
| 75 | + const res = response.data | ||
| 76 | + resolve(res) | ||
| 77 | + }).catch(error => { | ||
| 78 | + reject(error) | ||
| 79 | + }) | ||
| 80 | + }) | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +// 更新调拨申请 | ||
| 84 | +export function updateAllocationStorehouse(data) { | ||
| 85 | + return new Promise((resolve, reject) => { | ||
| 86 | + request({ | ||
| 87 | + url: '/resourceStore.updateAllocationStorehouse', | ||
| 88 | + method: 'post', | ||
| 89 | + data | ||
| 90 | + }).then(response => { | ||
| 91 | + const res = response.data | ||
| 92 | + resolve(res) | ||
| 93 | + }).catch(error => { | ||
| 94 | + reject(error) | ||
| 95 | + }) | ||
| 96 | + }) | ||
| 97 | +} | ||
| 0 | \ No newline at end of file | 98 | \ No newline at end of file |
src/api/resource/myItemOutAuditOrdersApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 获取待审核订单列表 | ||
| 5 | + * @param {Object} params 查询参数 | ||
| 6 | + * @returns {Promise} 返回Promise对象 | ||
| 7 | + */ | ||
| 8 | +export function getCollectionAuditOrder(params) { | ||
| 9 | + return new Promise((resolve, reject) => { | ||
| 10 | + request({ | ||
| 11 | + url: '/collection/getCollectionAuditOrder', | ||
| 12 | + method: 'get', | ||
| 13 | + params | ||
| 14 | + }).then(response => { | ||
| 15 | + const res = response.data | ||
| 16 | + resolve(res) | ||
| 17 | + }).catch(error => { | ||
| 18 | + reject(error) | ||
| 19 | + }) | ||
| 20 | + }) | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
src/api/resource/resourceOutManageApi.js
0 → 100644
| 1 | +import request from '@/utils/request' | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * Get purchase apply list | ||
| 5 | + * @param {Object} params | ||
| 6 | + * @param {number} params.page - Page number | ||
| 7 | + * @param {number} params.row - Page size | ||
| 8 | + * @param {string} params.applyOrderId - Apply order ID | ||
| 9 | + * @param {string} params.resOrderType - Resource order type | ||
| 10 | + * @returns {Promise} | ||
| 11 | + */ | ||
| 12 | +export function listPurchaseApplys(params) { | ||
| 13 | + return new Promise((resolve, reject) => { | ||
| 14 | + request({ | ||
| 15 | + url: '/purchaseApply.listPurchaseApplys', | ||
| 16 | + method: 'get', | ||
| 17 | + params | ||
| 18 | + }).then(response => { | ||
| 19 | + resolve(response.data) | ||
| 20 | + }).catch(error => { | ||
| 21 | + reject(error) | ||
| 22 | + }) | ||
| 23 | + }) | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +/** | ||
| 27 | + * Submit resource out | ||
| 28 | + * @param {Object} data - Resource out data | ||
| 29 | + * @param {string} data.applyOrderId - Apply order ID | ||
| 30 | + * @param {string} data.taskId - Task ID | ||
| 31 | + * @param {string} data.resOrderType - Resource order type | ||
| 32 | + * @param {Array} data.purchaseApplyDetailVo - Purchase apply details | ||
| 33 | + * @returns {Promise} | ||
| 34 | + */ | ||
| 35 | +export function submitResourceOut(data) { | ||
| 36 | + return new Promise((resolve, reject) => { | ||
| 37 | + request({ | ||
| 38 | + url: '/collection/resourceOut', | ||
| 39 | + method: 'post', | ||
| 40 | + data | ||
| 41 | + }).then(response => { | ||
| 42 | + resolve(response.data) | ||
| 43 | + }).catch(error => { | ||
| 44 | + reject(error) | ||
| 45 | + }) | ||
| 46 | + }) | ||
| 47 | +} | ||
| 0 | \ No newline at end of file | 48 | \ No newline at end of file |
src/components/contract/flowAudit.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-row> | ||
| 3 | + <el-col :span="24"> | ||
| 4 | + <el-card> | ||
| 5 | + <div slot="header" class="clearfix"> | ||
| 6 | + <h5>{{ $t('flowAudit.auditInfo') }}</h5> | ||
| 7 | + </div> | ||
| 8 | + <div class="ibox-content"> | ||
| 9 | + <el-form label-width="120px"> | ||
| 10 | + <el-form-item :label="$t('flowAudit.auditStatus')"> | ||
| 11 | + <el-select v-model="flowAuditInfo.state" :placeholder="$t('flowAudit.pleaseAudit')" style="width:100%"> | ||
| 12 | + <el-option :label="$t('flowAudit.agree')" value="1100" /> | ||
| 13 | + <el-option :label="$t('flowAudit.reject')" value="1200" /> | ||
| 14 | + </el-select> | ||
| 15 | + </el-form-item> | ||
| 16 | + <el-form-item :label="$t('flowAudit.reason')"> | ||
| 17 | + <el-input v-model="flowAuditInfo.remark" type="textarea" :placeholder="$t('flowAudit.requiredReason')" | ||
| 18 | + :rows="4" /> | ||
| 19 | + </el-form-item> | ||
| 20 | + <el-form-item v-if="flowAuditInfo.state === '1100' && flowAuditInfo.assignee === '-2'" | ||
| 21 | + :label="$t('flowAudit.staff')"> | ||
| 22 | + <el-col :span="18"> | ||
| 23 | + <el-input v-model="flowAuditInfo.staffName" :placeholder="$t('flowAudit.selectNextHandler')" disabled /> | ||
| 24 | + </el-col> | ||
| 25 | + <el-col :span="6"> | ||
| 26 | + <el-button @click="chooseStaff"> | ||
| 27 | + {{ $t('flowAudit.select') }} | ||
| 28 | + </el-button> | ||
| 29 | + </el-col> | ||
| 30 | + </el-form-item> | ||
| 31 | + <el-form-item> | ||
| 32 | + <el-button type="primary" class="float-right" @click="_flowAuditSubmit"> | ||
| 33 | + <i class="el-icon-check" /> {{ $t('common.submit') }} | ||
| 34 | + </el-button> | ||
| 35 | + <el-button type="warning" class="float-right" style="margin-right:20px;" @click="_goBack"> | ||
| 36 | + <i class="el-icon-close" /> {{ $t('common.cancel') }} | ||
| 37 | + </el-button> | ||
| 38 | + </el-form-item> | ||
| 39 | + </el-form> | ||
| 40 | + </div> | ||
| 41 | + </el-card> | ||
| 42 | + </el-col> | ||
| 43 | + <select-staff ref="selectStaff" /> | ||
| 44 | + </el-row> | ||
| 45 | +</template> | ||
| 46 | + | ||
| 47 | +<script> | ||
| 48 | +import { listWorkflowNextNode } from '@/api/contract/contractApplyAuditOrdersApi' | ||
| 49 | +import SelectStaff from '@/components/staff/SelectStaff' | ||
| 50 | + | ||
| 51 | +export default { | ||
| 52 | + name: 'FlowAudit', | ||
| 53 | + components: { | ||
| 54 | + SelectStaff | ||
| 55 | + }, | ||
| 56 | + props: { | ||
| 57 | + callBackListener: { | ||
| 58 | + type: String, | ||
| 59 | + default: '' | ||
| 60 | + }, | ||
| 61 | + callBackFunction: { | ||
| 62 | + type: String, | ||
| 63 | + default: '' | ||
| 64 | + } | ||
| 65 | + }, | ||
| 66 | + data() { | ||
| 67 | + return { | ||
| 68 | + flowAuditInfo: { | ||
| 69 | + state: '', | ||
| 70 | + remark: '', | ||
| 71 | + taskId: '', | ||
| 72 | + startUserId: '', | ||
| 73 | + assignee: '', | ||
| 74 | + staffId: '', | ||
| 75 | + staffName: '' | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + }, | ||
| 79 | + watch: { | ||
| 80 | + 'flowAuditInfo.state': { | ||
| 81 | + handler(val) { | ||
| 82 | + if (val && this.flowAuditInfo.state === '1100') { | ||
| 83 | + this.flowAuditInfo.remark = this.$t('flowAudit.agree') | ||
| 84 | + this._listWorkflow() | ||
| 85 | + } else { | ||
| 86 | + this.flowAuditInfo.remark = '' | ||
| 87 | + } | ||
| 88 | + }, | ||
| 89 | + deep: true | ||
| 90 | + } | ||
| 91 | + }, | ||
| 92 | + methods: { | ||
| 93 | + open(auditOrder) { | ||
| 94 | + Object.assign(this.flowAuditInfo, auditOrder) | ||
| 95 | + this.flowAuditInfo.state = '' | ||
| 96 | + }, | ||
| 97 | + flowAuditValidate() { | ||
| 98 | + if (!this.flowAuditInfo.state) { | ||
| 99 | + this.$message.error(this.$t('flowAudit.auditStatusRequired')) | ||
| 100 | + return false | ||
| 101 | + } | ||
| 102 | + if (!this.flowAuditInfo.remark) { | ||
| 103 | + this.$message.error(this.$t('flowAudit.reasonRequired')) | ||
| 104 | + return false | ||
| 105 | + } | ||
| 106 | + if (this.flowAuditInfo.remark.length > 200) { | ||
| 107 | + this.$message.error(this.$t('flowAudit.reasonMaxLength')) | ||
| 108 | + return false | ||
| 109 | + } | ||
| 110 | + return true | ||
| 111 | + }, | ||
| 112 | + async _flowAuditSubmit() { | ||
| 113 | + if (!this.flowAuditValidate()) return | ||
| 114 | + | ||
| 115 | + if (this.flowAuditInfo.assignee === '-2' && !this.flowAuditInfo.staffId) { | ||
| 116 | + this.$message.error(this.$t('flowAudit.selectNextHandler')) | ||
| 117 | + return | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + if (this.callBackListener) { | ||
| 121 | + const _flowAuditInfo = { | ||
| 122 | + state: this.flowAuditInfo.state, | ||
| 123 | + remark: this.flowAuditInfo.state === '1200' | ||
| 124 | + ? `${this.$t('flowAudit.reject')}:${this.flowAuditInfo.remark}` | ||
| 125 | + : this.flowAuditInfo.remark, | ||
| 126 | + nextUserId: this.flowAuditInfo.staffId | ||
| 127 | + } | ||
| 128 | + this.$emit(this.callBackFunction, _flowAuditInfo) | ||
| 129 | + this.clearAddBasePrivilegeInfo() | ||
| 130 | + } | ||
| 131 | + }, | ||
| 132 | + clearAddBasePrivilegeInfo() { | ||
| 133 | + this.flowAuditInfo = { | ||
| 134 | + state: '', | ||
| 135 | + remark: '', | ||
| 136 | + taskId: '', | ||
| 137 | + startUserId: '', | ||
| 138 | + assignee: '', | ||
| 139 | + staffId: '', | ||
| 140 | + staffName: '' | ||
| 141 | + } | ||
| 142 | + }, | ||
| 143 | + async _listWorkflow() { | ||
| 144 | + if (this.flowAuditInfo.state !== '1100') return | ||
| 145 | + | ||
| 146 | + try { | ||
| 147 | + const params = { | ||
| 148 | + taskId: this.flowAuditInfo.taskId, | ||
| 149 | + startUserId: this.flowAuditInfo.startUserId | ||
| 150 | + } | ||
| 151 | + const { data } = await listWorkflowNextNode(params) | ||
| 152 | + if (data && data.length > 0) { | ||
| 153 | + this.flowAuditInfo.assignee = data[0].assignee | ||
| 154 | + } | ||
| 155 | + } catch (error) { | ||
| 156 | + console.error('请求失败:', error) | ||
| 157 | + } | ||
| 158 | + }, | ||
| 159 | + chooseStaff() { | ||
| 160 | + this.$refs.selectStaff.open(this.flowAuditInfo) | ||
| 161 | + }, | ||
| 162 | + _goBack() { | ||
| 163 | + this.$emit(this.callBackListener, 'list', {}) | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | +} | ||
| 167 | +</script> | ||
| 168 | + | ||
| 169 | +<style scoped> | ||
| 170 | +.float-right { | ||
| 171 | + float: right; | ||
| 172 | +} | ||
| 173 | +</style> | ||
| 0 | \ No newline at end of file | 174 | \ No newline at end of file |
src/i18n/contractI18n.js
| @@ -10,6 +10,8 @@ import { messages as contractChangeDetailMessages } from '../views/contract/cont | @@ -10,6 +10,8 @@ import { messages as contractChangeDetailMessages } from '../views/contract/cont | ||
| 10 | import { messages as expirationContractManageMessages } from '../views/contract/expirationContractManageLang' | 10 | import { messages as expirationContractManageMessages } from '../views/contract/expirationContractManageLang' |
| 11 | import { messages as contractDetailMessages } from '../views/contract/contractDetailLang.js' | 11 | import { messages as contractDetailMessages } from '../views/contract/contractDetailLang.js' |
| 12 | import { messages as contractChangeDetailsMessages } from '../views/contract/contractChangeDetailsLang' | 12 | import { messages as contractChangeDetailsMessages } from '../views/contract/contractChangeDetailsLang' |
| 13 | +import { messages as contractApplyAuditOrdersMessages } from '../views/contract/contractApplyAuditOrdersLang' | ||
| 14 | +import { messages as contractChangeAuditOrdersMessages } from '../views/contract/contractChangeAuditOrdersLang.js' | ||
| 13 | 15 | ||
| 14 | export const messages ={ | 16 | export const messages ={ |
| 15 | en:{ | 17 | en:{ |
| @@ -25,6 +27,8 @@ export const messages ={ | @@ -25,6 +27,8 @@ export const messages ={ | ||
| 25 | ...expirationContractManageMessages.en, | 27 | ...expirationContractManageMessages.en, |
| 26 | ...contractDetailMessages.en, | 28 | ...contractDetailMessages.en, |
| 27 | ...contractChangeDetailsMessages.en, | 29 | ...contractChangeDetailsMessages.en, |
| 30 | + ...contractApplyAuditOrdersMessages.en, | ||
| 31 | + ...contractChangeAuditOrdersMessages.en, | ||
| 28 | }, | 32 | }, |
| 29 | zh:{ | 33 | zh:{ |
| 30 | ...contractTypeManageMessages.zh, | 34 | ...contractTypeManageMessages.zh, |
| @@ -39,5 +43,7 @@ export const messages ={ | @@ -39,5 +43,7 @@ export const messages ={ | ||
| 39 | ...expirationContractManageMessages.zh, | 43 | ...expirationContractManageMessages.zh, |
| 40 | ...contractDetailMessages.zh, | 44 | ...contractDetailMessages.zh, |
| 41 | ...contractChangeDetailsMessages.zh, | 45 | ...contractChangeDetailsMessages.zh, |
| 46 | + ...contractApplyAuditOrdersMessages.zh, | ||
| 47 | + ...contractChangeAuditOrdersMessages.zh, | ||
| 42 | } | 48 | } |
| 43 | } | 49 | } |
| 44 | \ No newline at end of file | 50 | \ No newline at end of file |
src/i18n/resourceI18n.js
| @@ -34,6 +34,12 @@ import { messages as myAuditOrdersMessages } from '../views/resource/myAuditOrde | @@ -34,6 +34,12 @@ import { messages as myAuditOrdersMessages } from '../views/resource/myAuditOrde | ||
| 34 | import { messages as resourceEnterManageMessages } from '../views/resource/resourceEnterManageLang' | 34 | import { messages as resourceEnterManageMessages } from '../views/resource/resourceEnterManageLang' |
| 35 | import { messages as editPurchaseApplyMessages } from '../views/resource/editPurchaseApplyLang' | 35 | import { messages as editPurchaseApplyMessages } from '../views/resource/editPurchaseApplyLang' |
| 36 | 36 | ||
| 37 | +import { messages as myItemOutAuditOrdersMessages } from '../views/resource/myItemOutAuditOrdersLang' | ||
| 38 | +import { messages as resourceOutManageMessages } from '../views/resource/resourceOutManageLang' | ||
| 39 | +import { messages as allocationStorehouseAuditOrdersMessages } from '../views/resource/allocationStorehouseAuditOrdersLang' | ||
| 40 | +import { messages as editAllocationStorehouseApplyMessages } from '../views/resource/editAllocationStorehouseApplyLang' | ||
| 41 | +import { messages as allocationStorehouseEnterMessages } from '../views/resource/allocationStorehouseEnterLang' | ||
| 42 | + | ||
| 37 | export const messages = { | 43 | export const messages = { |
| 38 | en: { | 44 | en: { |
| 39 | ...resourceAuditFlowMessages.en, | 45 | ...resourceAuditFlowMessages.en, |
| @@ -70,6 +76,11 @@ export const messages = { | @@ -70,6 +76,11 @@ export const messages = { | ||
| 70 | ...myAuditOrdersMessages.en, | 76 | ...myAuditOrdersMessages.en, |
| 71 | ...resourceEnterManageMessages.en, | 77 | ...resourceEnterManageMessages.en, |
| 72 | ...editPurchaseApplyMessages.en, | 78 | ...editPurchaseApplyMessages.en, |
| 79 | + ...myItemOutAuditOrdersMessages.en, | ||
| 80 | + ...resourceOutManageMessages.en, | ||
| 81 | + ...allocationStorehouseAuditOrdersMessages.en, | ||
| 82 | + ...editAllocationStorehouseApplyMessages.en, | ||
| 83 | + ...allocationStorehouseEnterMessages.en, | ||
| 73 | }, | 84 | }, |
| 74 | zh: { | 85 | zh: { |
| 75 | ...resourceAuditFlowMessages.zh, | 86 | ...resourceAuditFlowMessages.zh, |
| @@ -106,5 +117,10 @@ export const messages = { | @@ -106,5 +117,10 @@ export const messages = { | ||
| 106 | ...myAuditOrdersMessages.zh, | 117 | ...myAuditOrdersMessages.zh, |
| 107 | ...resourceEnterManageMessages.zh, | 118 | ...resourceEnterManageMessages.zh, |
| 108 | ...editPurchaseApplyMessages.zh, | 119 | ...editPurchaseApplyMessages.zh, |
| 120 | + ...myItemOutAuditOrdersMessages.zh, | ||
| 121 | + ...resourceOutManageMessages.zh, | ||
| 122 | + ...allocationStorehouseAuditOrdersMessages.zh, | ||
| 123 | + ...editAllocationStorehouseApplyMessages.zh, | ||
| 124 | + ...allocationStorehouseEnterMessages.zh, | ||
| 109 | } | 125 | } |
| 110 | } | 126 | } |
| 111 | \ No newline at end of file | 127 | \ No newline at end of file |
src/router/contractRouter.js
| @@ -54,4 +54,14 @@ export default [ | @@ -54,4 +54,14 @@ export default [ | ||
| 54 | name: '/views/contract/contractChangeDetails', | 54 | name: '/views/contract/contractChangeDetails', |
| 55 | component: () => import('@/views/contract/contractChangeDetailsList.vue') | 55 | component: () => import('@/views/contract/contractChangeDetailsList.vue') |
| 56 | }, | 56 | }, |
| 57 | + { | ||
| 58 | + path: '/pages/admin/contractApplyAuditOrders', | ||
| 59 | + name: '/pages/admin/contractApplyAuditOrders', | ||
| 60 | + component: () => import('@/views/contract/contractApplyAuditOrdersList.vue') | ||
| 61 | + }, | ||
| 62 | + { | ||
| 63 | + path: '/pages/admin/contractChangeAuditOrders', | ||
| 64 | + name: '/pages/admin/contractChangeAuditOrders', | ||
| 65 | + component: () => import('@/views/contract/contractChangeAuditOrdersList.vue') | ||
| 66 | + }, | ||
| 57 | ] | 67 | ] |
| 58 | \ No newline at end of file | 68 | \ No newline at end of file |
src/router/resourceRouter.js
| @@ -160,5 +160,30 @@ export default [ | @@ -160,5 +160,30 @@ export default [ | ||
| 160 | name: '/pages/resource/editPurchaseApply', | 160 | name: '/pages/resource/editPurchaseApply', |
| 161 | component: () => import('@/views/resource/editPurchaseApplyList.vue') | 161 | component: () => import('@/views/resource/editPurchaseApplyList.vue') |
| 162 | }, | 162 | }, |
| 163 | + { | ||
| 164 | + path: '/pages/admin/myItemOutAuditOrders', | ||
| 165 | + name: '/pages/admin/myItemOutAuditOrders', | ||
| 166 | + component: () => import('@/views/resource/myItemOutAuditOrdersList.vue') | ||
| 167 | + }, | ||
| 168 | + { | ||
| 169 | + path: '/pages/admin/resourceOutManage', | ||
| 170 | + name: '/pages/admin/resourceOutManage', | ||
| 171 | + component: () => import('@/views/resource/resourceOutManageList.vue') | ||
| 172 | + }, | ||
| 173 | + { | ||
| 174 | + path: '/pages/admin/allocationStorehouseAuditOrders', | ||
| 175 | + name: '/pages/admin/allocationStorehouseAuditOrders', | ||
| 176 | + component: () => import('@/views/resource/allocationStorehouseAuditOrdersList.vue') | ||
| 177 | + }, | ||
| 178 | + { | ||
| 179 | + path: '/pages/resource/editAllocationStorehouseApply', | ||
| 180 | + name: '/pages/resource/editAllocationStorehouseApply', | ||
| 181 | + component: () => import('@/views/resource/editAllocationStorehouseApplyList.vue') | ||
| 182 | + }, | ||
| 183 | + { | ||
| 184 | + path:'/pages/resource/allocationStorehouseEnter', | ||
| 185 | + name:'/pages/resource/allocationStorehouseEnter', | ||
| 186 | + component: () => import('@/views/resource/allocationStorehouseEnterList.vue') | ||
| 187 | + }, | ||
| 163 | 188 | ||
| 164 | ] | 189 | ] |
| 165 | \ No newline at end of file | 190 | \ No newline at end of file |
src/views/contract/contractApplyAuditOrdersLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + contractApplyAuditOrders: { | ||
| 4 | + draftPendingList: 'Draft Pending List', | ||
| 5 | + contractCode: 'Contract Code', | ||
| 6 | + contractName: 'Contract Name', | ||
| 7 | + contractType: 'Contract Type', | ||
| 8 | + contractStatus: 'Contract Status', | ||
| 9 | + createTime: 'Create Time', | ||
| 10 | + operation: 'Operation', | ||
| 11 | + view: 'View', | ||
| 12 | + audit: 'Audit', | ||
| 13 | + finish: 'Finish', | ||
| 14 | + processEnd: 'Process End' | ||
| 15 | + }, | ||
| 16 | + flowAudit: { | ||
| 17 | + auditInfo: 'Audit Information', | ||
| 18 | + auditStatus: 'Audit Status', | ||
| 19 | + pleaseAudit: 'Please Audit', | ||
| 20 | + agree: 'Agree', | ||
| 21 | + reject: 'Reject', | ||
| 22 | + reason: 'Reason', | ||
| 23 | + requiredReason: 'Required, please fill in the reason', | ||
| 24 | + staff: 'Staff', | ||
| 25 | + selectNextHandler: 'Required, please select next handler', | ||
| 26 | + select: 'Select', | ||
| 27 | + auditStatusRequired: 'Audit status cannot be empty', | ||
| 28 | + reasonRequired: 'Reason content cannot be empty', | ||
| 29 | + reasonMaxLength: 'Reason content cannot exceed 200 characters' | ||
| 30 | + }, | ||
| 31 | + }, | ||
| 32 | + zh: { | ||
| 33 | + contractApplyAuditOrders: { | ||
| 34 | + draftPendingList: '起草待办单', | ||
| 35 | + contractCode: '合同编号', | ||
| 36 | + contractName: '合同名称', | ||
| 37 | + contractType: '合同类型', | ||
| 38 | + contractStatus: '合同状态', | ||
| 39 | + createTime: '创建时间', | ||
| 40 | + operation: '操作', | ||
| 41 | + view: '查看', | ||
| 42 | + audit: '审批', | ||
| 43 | + finish: '结束', | ||
| 44 | + processEnd: '处理结束' | ||
| 45 | + }, | ||
| 46 | + flowAudit: { | ||
| 47 | + auditInfo: '审核信息', | ||
| 48 | + auditStatus: '审核状态', | ||
| 49 | + pleaseAudit: '请审核', | ||
| 50 | + agree: '同意', | ||
| 51 | + reject: '拒绝', | ||
| 52 | + reason: '原因', | ||
| 53 | + requiredReason: '必填,请填写原因', | ||
| 54 | + staff: '员工', | ||
| 55 | + selectNextHandler: '必填,请选择下一处理人', | ||
| 56 | + select: '选择', | ||
| 57 | + auditStatusRequired: '审核状态不能为空', | ||
| 58 | + reasonRequired: '原因内容不能为空', | ||
| 59 | + reasonMaxLength: '原因内容不能超过200字' | ||
| 60 | + }, | ||
| 61 | + } | ||
| 62 | +} | ||
| 0 | \ No newline at end of file | 63 | \ No newline at end of file |
src/views/contract/contractApplyAuditOrdersList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight ecommerce padding"> | ||
| 3 | + <el-row v-if="contractApplyAuditOrdersInfo.audit === '1'"> | ||
| 4 | + <el-col :span="24"> | ||
| 5 | + <el-card> | ||
| 6 | + <div slot="header" class="flex justify-between"> | ||
| 7 | + <div>{{ $t('contractApplyAuditOrders.draftPendingList') }}</div> | ||
| 8 | + </div> | ||
| 9 | + <div class=""> | ||
| 10 | + <el-table :data="contractApplyAuditOrdersInfo.contractApplyAuditOrders" style="width: 100%" border stripe> | ||
| 11 | + <el-table-column prop="contractCode" :label="$t('contractApplyAuditOrders.contractCode')" | ||
| 12 | + align="center" /> | ||
| 13 | + <el-table-column prop="contractName" :label="$t('contractApplyAuditOrders.contractName')" | ||
| 14 | + align="center" /> | ||
| 15 | + <el-table-column prop="contractTypeName" :label="$t('contractApplyAuditOrders.contractType')" | ||
| 16 | + align="center" /> | ||
| 17 | + <el-table-column prop="stateName" :label="$t('contractApplyAuditOrders.contractStatus')" align="center" /> | ||
| 18 | + <el-table-column prop="signingTime" :label="$t('contractApplyAuditOrders.createTime')" align="center" /> | ||
| 19 | + <el-table-column :label="$t('contractApplyAuditOrders.operation')" align="center" width="200"> | ||
| 20 | + <template slot-scope="scope"> | ||
| 21 | + <el-button size="mini" type="primary" @click="_openDetailContractApplyModel(scope.row)"> | ||
| 22 | + {{ $t('contractApplyAuditOrders.view') }} | ||
| 23 | + </el-button> | ||
| 24 | + <el-button v-if="scope.row.hasAudit && !scope.row.hasEnd" size="mini" type="success" | ||
| 25 | + @click="_openAuditOrderModel(scope.row)"> | ||
| 26 | + {{ $t('contractApplyAuditOrders.audit') }} | ||
| 27 | + </el-button> | ||
| 28 | + <el-button v-if="scope.row.hasEnd" size="mini" type="warning" @click="_finishAuditOrder(scope.row)"> | ||
| 29 | + {{ $t('contractApplyAuditOrders.finish') }} | ||
| 30 | + </el-button> | ||
| 31 | + </template> | ||
| 32 | + </el-table-column> | ||
| 33 | + </el-table> | ||
| 34 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 35 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 36 | + @current-change="handleCurrentChange" /> | ||
| 37 | + </div> | ||
| 38 | + </el-card> | ||
| 39 | + </el-col> | ||
| 40 | + </el-row> | ||
| 41 | + <flow-audit v-else ref="flowAudit" :call-back-listener="'contractApplyAuditOrders'" | ||
| 42 | + :call-back-function="'notifyAudit'" /> | ||
| 43 | + </div> | ||
| 44 | +</template> | ||
| 45 | + | ||
| 46 | +<script> | ||
| 47 | +import { queryContractTask, needAuditContract,listWorkflowStepStaffs } from '@/api/contract/contractApplyAuditOrdersApi' | ||
| 48 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 49 | +import FlowAudit from '@/components/contract/flowAudit' | ||
| 50 | + | ||
| 51 | +export default { | ||
| 52 | + name: 'ContractApplyAuditOrdersList', | ||
| 53 | + components: { | ||
| 54 | + FlowAudit | ||
| 55 | + }, | ||
| 56 | + data() { | ||
| 57 | + return { | ||
| 58 | + contractApplyAuditOrdersInfo: { | ||
| 59 | + contractApplyAuditOrders: [], | ||
| 60 | + total: 0, | ||
| 61 | + records: 1, | ||
| 62 | + currentUserId: '', | ||
| 63 | + conditions: { | ||
| 64 | + AuditOrdersId: '', | ||
| 65 | + userName: '', | ||
| 66 | + auditLink: '' | ||
| 67 | + }, | ||
| 68 | + orderInfo: {}, | ||
| 69 | + procure: false, | ||
| 70 | + audit: '1' | ||
| 71 | + }, | ||
| 72 | + page: { | ||
| 73 | + current: 1, | ||
| 74 | + size: 10, | ||
| 75 | + total: 0 | ||
| 76 | + }, | ||
| 77 | + communityId: '' | ||
| 78 | + } | ||
| 79 | + }, | ||
| 80 | + created() { | ||
| 81 | + this.communityId = getCommunityId() | ||
| 82 | + this.contractApplyAuditOrdersInfo.currentUserId = this.$store.getters.userId | ||
| 83 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 84 | + this._loadStepStaff() | ||
| 85 | + }, | ||
| 86 | + methods: { | ||
| 87 | + async _listAuditOrders(page, rows) { | ||
| 88 | + try { | ||
| 89 | + this.contractApplyAuditOrdersInfo.audit = '1' | ||
| 90 | + const params = { | ||
| 91 | + page: page, | ||
| 92 | + row: rows, | ||
| 93 | + ...this.contractApplyAuditOrdersInfo.conditions | ||
| 94 | + } | ||
| 95 | + const { data, total, records } = await queryContractTask(params) | ||
| 96 | + this.contractApplyAuditOrdersInfo.contractApplyAuditOrders = data | ||
| 97 | + this.contractApplyAuditOrdersInfo.total = total | ||
| 98 | + this.contractApplyAuditOrdersInfo.records = records | ||
| 99 | + this.page.total = total | ||
| 100 | + } catch (error) { | ||
| 101 | + console.error('请求失败:', error) | ||
| 102 | + } | ||
| 103 | + }, | ||
| 104 | + _openAuditOrderModel(auditOrder) { | ||
| 105 | + this.contractApplyAuditOrdersInfo.orderInfo = auditOrder | ||
| 106 | + this.contractApplyAuditOrdersInfo.audit = '2' | ||
| 107 | + this.$refs.flowAudit.open(auditOrder) | ||
| 108 | + }, | ||
| 109 | + _openDetailContractApplyModel(auditOrder) { | ||
| 110 | + this.$router.push(`/views/contract/contractApplyDetail?contractId=${auditOrder.contractId}`) | ||
| 111 | + }, | ||
| 112 | + async _auditOrderInfo(auditInfo) { | ||
| 113 | + try { | ||
| 114 | + auditInfo.taskId = this.contractApplyAuditOrdersInfo.orderInfo.taskId | ||
| 115 | + auditInfo.contractId = this.contractApplyAuditOrdersInfo.orderInfo.contractId | ||
| 116 | + await needAuditContract(auditInfo) | ||
| 117 | + this.$message.success(this.$t('common.handleSuccess')) | ||
| 118 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 119 | + } catch (error) { | ||
| 120 | + this.$message.error(this.$t('common.handleFailed') + error.message) | ||
| 121 | + } | ||
| 122 | + }, | ||
| 123 | + async _finishAuditOrder(auditOrder) { | ||
| 124 | + try { | ||
| 125 | + const auditInfo = { | ||
| 126 | + taskId: auditOrder.taskId, | ||
| 127 | + contractId: auditOrder.contractId, | ||
| 128 | + state: '1200', | ||
| 129 | + remark: this.$t('contractApplyAuditOrders.processEnd') | ||
| 130 | + } | ||
| 131 | + await needAuditContract(auditInfo) | ||
| 132 | + this.$message.success(this.$t('common.handleSuccess')) | ||
| 133 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 134 | + } catch (error) { | ||
| 135 | + this.$message.error(this.$t('common.handleFailed') + error.message) | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + async _loadStepStaff() { | ||
| 139 | + try { | ||
| 140 | + const params = { | ||
| 141 | + page: 1, | ||
| 142 | + row: 1, | ||
| 143 | + staffId: this.contractApplyAuditOrdersInfo.currentUserId, | ||
| 144 | + staffRole: '2002' | ||
| 145 | + } | ||
| 146 | + const { data } = await listWorkflowStepStaffs(params) | ||
| 147 | + if (data.length > 0) { | ||
| 148 | + this.contractApplyAuditOrdersInfo.procure = true | ||
| 149 | + } | ||
| 150 | + } catch (error) { | ||
| 151 | + console.error('请求失败:', error) | ||
| 152 | + } | ||
| 153 | + }, | ||
| 154 | + handleSizeChange(val) { | ||
| 155 | + this.page.size = val | ||
| 156 | + this._listAuditOrders(this.page.current, val) | ||
| 157 | + }, | ||
| 158 | + handleCurrentChange(val) { | ||
| 159 | + this.page.current = val | ||
| 160 | + this._listAuditOrders(val, this.page.size) | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | +} | ||
| 164 | +</script> | ||
| 165 | + | ||
| 166 | +<style scoped> | ||
| 167 | +.ibox-content { | ||
| 168 | + padding: 15px 20px 20px 20px; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +.clearfix { | ||
| 172 | + display: flex; | ||
| 173 | + justify-content: space-between; | ||
| 174 | + align-items: center; | ||
| 175 | +} | ||
| 176 | +</style> | ||
| 0 | \ No newline at end of file | 177 | \ No newline at end of file |
src/views/contract/contractChangeAuditOrdersLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + contractChangeAuditOrders: { | ||
| 4 | + title: 'Change To-do List', | ||
| 5 | + contractCode: 'Contract Number', | ||
| 6 | + contractName: 'Contract Name', | ||
| 7 | + contractType: 'Contract Type', | ||
| 8 | + contractStatus: 'Contract Status', | ||
| 9 | + createTime: 'Create Time', | ||
| 10 | + operation: 'Operation', | ||
| 11 | + view: 'View', | ||
| 12 | + audit: 'Audit', | ||
| 13 | + finish: 'Finish', | ||
| 14 | + processEnd: 'Process End' | ||
| 15 | + }, | ||
| 16 | + }, | ||
| 17 | + zh: { | ||
| 18 | + contractChangeAuditOrders: { | ||
| 19 | + title: '变更待办单', | ||
| 20 | + contractCode: '合同编号', | ||
| 21 | + contractName: '合同名称', | ||
| 22 | + contractType: '合同类型', | ||
| 23 | + contractStatus: '合同状态', | ||
| 24 | + createTime: '创建时间', | ||
| 25 | + operation: '操作', | ||
| 26 | + view: '查看', | ||
| 27 | + audit: '审批', | ||
| 28 | + finish: '结束', | ||
| 29 | + processEnd: '处理结束' | ||
| 30 | + }, | ||
| 31 | + } | ||
| 32 | +} | ||
| 0 | \ No newline at end of file | 33 | \ No newline at end of file |
src/views/contract/contractChangeAuditOrdersList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight ecommerce padding"> | ||
| 3 | + <el-row v-if="contractChangeAuditOrdersInfo.audit === '1'"> | ||
| 4 | + <el-col :span="24"> | ||
| 5 | + <el-card> | ||
| 6 | + <div slot="header" class="flex justify-between"> | ||
| 7 | + <div>{{ $t('contractChangeAuditOrders.title') }}</div> | ||
| 8 | + </div> | ||
| 9 | + <div class=""> | ||
| 10 | + <el-table :data="contractChangeAuditOrdersInfo.contractChangeAuditOrders" border style="width: 100%"> | ||
| 11 | + <el-table-column prop="contractCode" :label="$t('contractChangeAuditOrders.contractCode')" | ||
| 12 | + align="center" /> | ||
| 13 | + <el-table-column prop="contractName" :label="$t('contractChangeAuditOrders.contractName')" | ||
| 14 | + align="center" /> | ||
| 15 | + <el-table-column prop="contractTypeName" :label="$t('contractChangeAuditOrders.contractType')" | ||
| 16 | + align="center" /> | ||
| 17 | + <el-table-column prop="stateName" :label="$t('contractChangeAuditOrders.contractStatus')" | ||
| 18 | + align="center" /> | ||
| 19 | + <el-table-column prop="createTime" :label="$t('contractChangeAuditOrders.createTime')" align="center" /> | ||
| 20 | + <el-table-column :label="$t('contractChangeAuditOrders.operation')" align="center"> | ||
| 21 | + <template slot-scope="scope"> | ||
| 22 | + <el-button-group> | ||
| 23 | + <el-button size="mini" @click="_viewChangeDetail(scope.row)"> | ||
| 24 | + {{ $t('contractChangeAuditOrders.view') }} | ||
| 25 | + </el-button> | ||
| 26 | + <el-button v-if="scope.row.hasAudit && !scope.row.hasEnd" size="mini" type="primary" | ||
| 27 | + @click="_openAuditOrderModel(scope.row)"> | ||
| 28 | + {{ $t('contractChangeAuditOrders.audit') }} | ||
| 29 | + </el-button> | ||
| 30 | + <el-button v-if="scope.row.hasEnd" size="mini" type="warning" @click="_finishAuditOrder(scope.row)"> | ||
| 31 | + {{ $t('contractChangeAuditOrders.finish') }} | ||
| 32 | + </el-button> | ||
| 33 | + </el-button-group> | ||
| 34 | + </template> | ||
| 35 | + </el-table-column> | ||
| 36 | + </el-table> | ||
| 37 | + <el-pagination :current-page.sync="page.current" :page-sizes="[10, 20, 30, 50]" :page-size="page.size" | ||
| 38 | + :total="page.total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 39 | + @current-change="handleCurrentChange" /> | ||
| 40 | + </div> | ||
| 41 | + </el-card> | ||
| 42 | + </el-col> | ||
| 43 | + </el-row> | ||
| 44 | + <flow-audit v-else ref="flowAudit" :call-back-listener="'contractChangeAuditOrders'" | ||
| 45 | + :call-back-function="'notifyAudit'" /> | ||
| 46 | + </div> | ||
| 47 | +</template> | ||
| 48 | + | ||
| 49 | +<script> | ||
| 50 | +import { queryContractChangeTask, needAuditContractPlan } from '@/api/resource/contractChangeAuditOrdersApi' | ||
| 51 | +import FlowAudit from '@/components/contract/flowAudit' | ||
| 52 | + | ||
| 53 | +export default { | ||
| 54 | + name: 'ContractChangeAuditOrdersList', | ||
| 55 | + components: { | ||
| 56 | + FlowAudit | ||
| 57 | + }, | ||
| 58 | + data() { | ||
| 59 | + return { | ||
| 60 | + contractChangeAuditOrdersInfo: { | ||
| 61 | + contractChangeAuditOrders: [], | ||
| 62 | + total: 0, | ||
| 63 | + records: 1, | ||
| 64 | + moreCondition: false, | ||
| 65 | + userName: '', | ||
| 66 | + currentUserId: '', | ||
| 67 | + conditions: { | ||
| 68 | + planId: '', | ||
| 69 | + userName: '', | ||
| 70 | + auditLink: '' | ||
| 71 | + }, | ||
| 72 | + orderInfo: '', | ||
| 73 | + procure: false, | ||
| 74 | + audit: '1' | ||
| 75 | + }, | ||
| 76 | + page: { | ||
| 77 | + current: 1, | ||
| 78 | + size: 10, | ||
| 79 | + total: 0 | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + }, | ||
| 83 | + created() { | ||
| 84 | + this.currentUserId = this.$store.getters.userId | ||
| 85 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 86 | + }, | ||
| 87 | + methods: { | ||
| 88 | + async _listAuditOrders(page, rows) { | ||
| 89 | + this.contractChangeAuditOrdersInfo.audit = '1' | ||
| 90 | + this.contractChangeAuditOrdersInfo.conditions.page = page | ||
| 91 | + this.contractChangeAuditOrdersInfo.conditions.row = rows | ||
| 92 | + | ||
| 93 | + try { | ||
| 94 | + const { data, total } = await queryContractChangeTask(this.contractChangeAuditOrdersInfo.conditions) | ||
| 95 | + this.contractChangeAuditOrdersInfo.contractChangeAuditOrders = data | ||
| 96 | + this.contractChangeAuditOrdersInfo.total = total | ||
| 97 | + this.page.total = total | ||
| 98 | + } catch (error) { | ||
| 99 | + console.error('请求失败:', error) | ||
| 100 | + } | ||
| 101 | + }, | ||
| 102 | + _openAuditOrderModel(auditOrder) { | ||
| 103 | + this.contractChangeAuditOrdersInfo.orderInfo = auditOrder | ||
| 104 | + this.contractChangeAuditOrdersInfo.audit = '2' | ||
| 105 | + auditOrder.startUserId = auditOrder.changePerson | ||
| 106 | + this.$refs.flowAudit.open(auditOrder) | ||
| 107 | + }, | ||
| 108 | + async _auditOrderInfo(auditInfo) { | ||
| 109 | + auditInfo.taskId = this.contractChangeAuditOrdersInfo.orderInfo.taskId | ||
| 110 | + auditInfo.planId = this.contractChangeAuditOrdersInfo.orderInfo.planId | ||
| 111 | + auditInfo.contractId = this.contractChangeAuditOrdersInfo.orderInfo.contractId | ||
| 112 | + | ||
| 113 | + try { | ||
| 114 | + await needAuditContractPlan(auditInfo) | ||
| 115 | + this.$message.success(this.$t('common.handleSuccess')) | ||
| 116 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 117 | + } catch (error) { | ||
| 118 | + this.$message.error(this.$t('common.handleFailed') + error.message) | ||
| 119 | + } | ||
| 120 | + }, | ||
| 121 | + async _finishAuditOrder(auditOrder) { | ||
| 122 | + const auditInfo = { | ||
| 123 | + taskId: auditOrder.taskId, | ||
| 124 | + planId: auditOrder.planId, | ||
| 125 | + state: '1200', | ||
| 126 | + remark: this.$t('contractChangeAuditOrders.processEnd'), | ||
| 127 | + contractId: auditOrder.contractId | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + try { | ||
| 131 | + await needAuditContractPlan(auditInfo) | ||
| 132 | + this.$message.success(this.$t('common.handleSuccess')) | ||
| 133 | + this._listAuditOrders(this.page.current, this.page.size) | ||
| 134 | + } catch (error) { | ||
| 135 | + this.$message.error(this.$t('common.handleFailed') + error.message) | ||
| 136 | + } | ||
| 137 | + }, | ||
| 138 | + _viewChangeDetail(plan) { | ||
| 139 | + this.$router.push({ | ||
| 140 | + path: '/views/contract/contractChangeDetails', | ||
| 141 | + query: { planId: plan.planId } | ||
| 142 | + }) | ||
| 143 | + }, | ||
| 144 | + handleSizeChange(val) { | ||
| 145 | + this.page.size = val | ||
| 146 | + this._listAuditOrders(this.page.current, val) | ||
| 147 | + }, | ||
| 148 | + handleCurrentChange(val) { | ||
| 149 | + this.page.current = val | ||
| 150 | + this._listAuditOrders(val, this.page.size) | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | +} | ||
| 154 | +</script> | ||
| 155 | + | ||
| 156 | +<style scoped> | ||
| 157 | +.ibox-content { | ||
| 158 | + padding: 15px 20px 20px 20px; | ||
| 159 | +} | ||
| 160 | + | ||
| 161 | +.el-pagination { | ||
| 162 | + margin-top: 15px; | ||
| 163 | +} | ||
| 164 | +</style> | ||
| 0 | \ No newline at end of file | 165 | \ No newline at end of file |
src/views/oa/newOaWorkflowDoingList.vue
| @@ -120,10 +120,10 @@ export default { | @@ -120,10 +120,10 @@ export default { | ||
| 120 | this.$router.push(url) | 120 | this.$router.push(url) |
| 121 | }, | 121 | }, |
| 122 | _toGoA(item) { | 122 | _toGoA(item) { |
| 123 | - this.$router.push(`/form.html#/pages/property/newOaWorkflow?flowId=${item.flowId}&switchValue=newOaWorkflowUndo`) | 123 | + this.$router.push(`/views/oa/newOaWorkflow?flowId=${item.flowId}&switchValue=newOaWorkflowUndo`) |
| 124 | }, | 124 | }, |
| 125 | _toGoB(item) { | 125 | _toGoB(item) { |
| 126 | - this.$router.push(`/form.html#/pages/property/newOaWorkflow?flowId=${item.flowId}&switchValue=newOaWorkflowFinish`) | 126 | + this.$router.push(`/views/oa/newOaWorkflow?flowId=${item.flowId}&switchValue=newOaWorkflowFinish`) |
| 127 | }, | 127 | }, |
| 128 | async _listNewOaWorkflows() { | 128 | async _listNewOaWorkflows() { |
| 129 | try { | 129 | try { |
src/views/resource/allocationStorehouseAuditOrdersLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationStorehouseAuditOrders: { | ||
| 4 | + title: 'Pending Orders', | ||
| 5 | + back: 'Back', | ||
| 6 | + refresh: 'Refresh', | ||
| 7 | + scheduleNo: 'Schedule No', | ||
| 8 | + allocationCount: 'Allocation Count', | ||
| 9 | + applicant: 'Applicant', | ||
| 10 | + status: 'Status', | ||
| 11 | + time: 'Time', | ||
| 12 | + operation: 'Operation', | ||
| 13 | + view: 'View', | ||
| 14 | + edit: 'Edit', | ||
| 15 | + allocation: 'Allocation', | ||
| 16 | + approve: 'Approve' | ||
| 17 | + } | ||
| 18 | + }, | ||
| 19 | + zh: { | ||
| 20 | + allocationStorehouseAuditOrders: { | ||
| 21 | + title: '待办单', | ||
| 22 | + back: '返回', | ||
| 23 | + refresh: '刷新', | ||
| 24 | + scheduleNo: '调度编号', | ||
| 25 | + allocationCount: '调拨数量', | ||
| 26 | + applicant: '申请人', | ||
| 27 | + status: '状态', | ||
| 28 | + time: '时间', | ||
| 29 | + operation: '操作', | ||
| 30 | + view: '查看', | ||
| 31 | + edit: '修改', | ||
| 32 | + allocation: '调拨', | ||
| 33 | + approve: '审批' | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | +} | ||
| 0 | \ No newline at end of file | 37 | \ No newline at end of file |
src/views/resource/allocationStorehouseAuditOrdersList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="allocation-storehouse-audit-orders-container animated fadeInRight"> | ||
| 3 | + <el-row> | ||
| 4 | + <el-col :span="24"> | ||
| 5 | + <el-card class="box-card"> | ||
| 6 | + <div slot="header" class="clearfix"> | ||
| 7 | + <span>{{ $t('allocationStorehouseAuditOrders.title') }}</span> | ||
| 8 | + <div class="card-header-actions"> | ||
| 9 | + <el-button type="primary" size="small" @click="goBack"> | ||
| 10 | + <i class="el-icon-close"></i> | ||
| 11 | + {{ $t('allocationStorehouseAuditOrders.back') }} | ||
| 12 | + </el-button> | ||
| 13 | + <el-button type="primary" size="small" @click="queryAuditOrders"> | ||
| 14 | + <i class="el-icon-refresh"></i> | ||
| 15 | + {{ $t('allocationStorehouseAuditOrders.refresh') }} | ||
| 16 | + </el-button> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <el-table :data="allocationStorehouseAuditOrdersInfo.auditOrders" border style="width: 100%" | ||
| 21 | + v-loading="loading"> | ||
| 22 | + <el-table-column prop="applyId" :label="$t('allocationStorehouseAuditOrders.scheduleNo')" align="center" /> | ||
| 23 | + <el-table-column prop="applyCount" :label="$t('allocationStorehouseAuditOrders.allocationCount')" | ||
| 24 | + align="center" /> | ||
| 25 | + <el-table-column prop="startUserName" :label="$t('allocationStorehouseAuditOrders.applicant')" | ||
| 26 | + align="center" /> | ||
| 27 | + <el-table-column prop="stateName" :label="$t('allocationStorehouseAuditOrders.status')" align="center" /> | ||
| 28 | + <el-table-column prop="createTime" :label="$t('allocationStorehouseAuditOrders.time')" align="center" /> | ||
| 29 | + <el-table-column :label="$t('allocationStorehouseAuditOrders.operation')" align="center" width="250"> | ||
| 30 | + <template slot-scope="scope"> | ||
| 31 | + <el-button-group> | ||
| 32 | + <el-button size="mini" @click="toDetail(scope.row)"> | ||
| 33 | + {{ $t('allocationStorehouseAuditOrders.view') }} | ||
| 34 | + </el-button> | ||
| 35 | + <el-button size="mini" | ||
| 36 | + v-if="scope.row.startUserId === allocationStorehouseAuditOrdersInfo.currentUserId" | ||
| 37 | + @click="openEditPurchaseModel(scope.row)"> | ||
| 38 | + {{ $t('allocationStorehouseAuditOrders.edit') }} | ||
| 39 | + </el-button> | ||
| 40 | + <el-button size="mini" v-if="scope.row.curTaskName === '仓库管理员'" | ||
| 41 | + @click="allocationStorehouseEnter(scope.row)"> | ||
| 42 | + {{ $t('allocationStorehouseAuditOrders.allocation') }} | ||
| 43 | + </el-button> | ||
| 44 | + <el-button size="mini" v-else @click="openAuditOrderModel(scope.row)"> | ||
| 45 | + {{ $t('allocationStorehouseAuditOrders.approve') }} | ||
| 46 | + </el-button> | ||
| 47 | + </el-button-group> | ||
| 48 | + </template> | ||
| 49 | + </el-table-column> | ||
| 50 | + </el-table> | ||
| 51 | + | ||
| 52 | + <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" | ||
| 53 | + :current-page="pagination.currentPage" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.pageSize" | ||
| 54 | + layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" class="pagination"> | ||
| 55 | + </el-pagination> | ||
| 56 | + </el-card> | ||
| 57 | + </el-col> | ||
| 58 | + </el-row> | ||
| 59 | + </div> | ||
| 60 | +</template> | ||
| 61 | + | ||
| 62 | +<script> | ||
| 63 | +import { listAllocationStoreAuditOrders, listWorkflowStepStaffs } from '@/api/resource/allocationStorehouseAuditOrdersApi' | ||
| 64 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 65 | + | ||
| 66 | +export default { | ||
| 67 | + name: 'AllocationStorehouseAuditOrdersList', | ||
| 68 | + data() { | ||
| 69 | + return { | ||
| 70 | + loading: false, | ||
| 71 | + communityId: '', | ||
| 72 | + allocationStorehouseAuditOrdersInfo: { | ||
| 73 | + auditOrders: [], | ||
| 74 | + currentUserId: '', | ||
| 75 | + conditions: { | ||
| 76 | + AuditOrdersId: '', | ||
| 77 | + userName: '', | ||
| 78 | + auditLink: '', | ||
| 79 | + page: 1, | ||
| 80 | + row: 10 | ||
| 81 | + }, | ||
| 82 | + procure: false, | ||
| 83 | + audit: '1' | ||
| 84 | + }, | ||
| 85 | + pagination: { | ||
| 86 | + currentPage: 1, | ||
| 87 | + pageSize: 10, | ||
| 88 | + total: 0 | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + }, | ||
| 92 | + created() { | ||
| 93 | + this.communityId = getCommunityId() | ||
| 94 | + this.allocationStorehouseAuditOrdersInfo.currentUserId = this.$store.getters.userId | ||
| 95 | + this.listAuditOrders() | ||
| 96 | + this.loadStepStaff() | ||
| 97 | + }, | ||
| 98 | + methods: { | ||
| 99 | + async listAuditOrders() { | ||
| 100 | + this.loading = true | ||
| 101 | + try { | ||
| 102 | + const params = { | ||
| 103 | + ...this.allocationStorehouseAuditOrdersInfo.conditions, | ||
| 104 | + communityId: this.communityId | ||
| 105 | + } | ||
| 106 | + const res = await listAllocationStoreAuditOrders(params) | ||
| 107 | + this.allocationStorehouseAuditOrdersInfo.auditOrders = res.data | ||
| 108 | + this.pagination.total = res.total | ||
| 109 | + } catch (error) { | ||
| 110 | + console.error('获取审核订单列表失败:', error) | ||
| 111 | + } finally { | ||
| 112 | + this.loading = false | ||
| 113 | + } | ||
| 114 | + }, | ||
| 115 | + async loadStepStaff() { | ||
| 116 | + try { | ||
| 117 | + const params = { | ||
| 118 | + page: 1, | ||
| 119 | + row: 1, | ||
| 120 | + staffId: this.allocationStorehouseAuditOrdersInfo.currentUserId, | ||
| 121 | + staffRole: '3003', | ||
| 122 | + requestType: 'allocationHandle' | ||
| 123 | + } | ||
| 124 | + const res = await listWorkflowStepStaffs(params) | ||
| 125 | + if (res.data.length > 0) { | ||
| 126 | + this.allocationStorehouseAuditOrdersInfo.procure = true | ||
| 127 | + } | ||
| 128 | + } catch (error) { | ||
| 129 | + console.error('获取步骤员工失败:', error) | ||
| 130 | + } | ||
| 131 | + }, | ||
| 132 | + queryAuditOrders() { | ||
| 133 | + this.pagination.currentPage = 1 | ||
| 134 | + this.listAuditOrders() | ||
| 135 | + }, | ||
| 136 | + openAuditOrderModel(auditOrder) { | ||
| 137 | + this.$router.push({ | ||
| 138 | + path: '/pages/common/allocationStorehouseDetail', | ||
| 139 | + query: { | ||
| 140 | + applyId: auditOrder.applyId, | ||
| 141 | + action: 'audit', | ||
| 142 | + taskId: auditOrder.taskId | ||
| 143 | + } | ||
| 144 | + }) | ||
| 145 | + }, | ||
| 146 | + openEditPurchaseModel(auditOrder) { | ||
| 147 | + this.$router.push({ | ||
| 148 | + path: '/pages/resource/editAllocationStorehouseApply', | ||
| 149 | + query: { applyId: auditOrder.applyId } | ||
| 150 | + }) | ||
| 151 | + }, | ||
| 152 | + allocationStorehouseEnter(auditOrder) { | ||
| 153 | + this.$router.push({ | ||
| 154 | + path: '/pages/resource/allocationStorehouseEnter', | ||
| 155 | + query: { | ||
| 156 | + applyId: auditOrder.applyId, | ||
| 157 | + taskId: auditOrder.taskId | ||
| 158 | + } | ||
| 159 | + }) | ||
| 160 | + }, | ||
| 161 | + toDetail(item) { | ||
| 162 | + this.$router.push({ | ||
| 163 | + path: '/pages/common/allocationStorehouseDetail', | ||
| 164 | + query: { applyId: item.applyId } | ||
| 165 | + }) | ||
| 166 | + }, | ||
| 167 | + goBack() { | ||
| 168 | + this.$router.go(-1) | ||
| 169 | + }, | ||
| 170 | + handleSizeChange(val) { | ||
| 171 | + this.pagination.pageSize = val | ||
| 172 | + this.allocationStorehouseAuditOrdersInfo.conditions.row = val | ||
| 173 | + this.listAuditOrders() | ||
| 174 | + }, | ||
| 175 | + handleCurrentChange(val) { | ||
| 176 | + this.pagination.currentPage = val | ||
| 177 | + this.allocationStorehouseAuditOrdersInfo.conditions.page = val | ||
| 178 | + this.listAuditOrders() | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | +} | ||
| 182 | +</script> | ||
| 183 | + | ||
| 184 | +<style lang="scss" scoped> | ||
| 185 | +.allocation-storehouse-audit-orders-container { | ||
| 186 | + padding: 20px; | ||
| 187 | + | ||
| 188 | + .box-card { | ||
| 189 | + margin-bottom: 20px; | ||
| 190 | + | ||
| 191 | + .clearfix { | ||
| 192 | + display: flex; | ||
| 193 | + justify-content: space-between; | ||
| 194 | + align-items: center; | ||
| 195 | + } | ||
| 196 | + | ||
| 197 | + .card-header-actions { | ||
| 198 | + display: flex; | ||
| 199 | + gap: 10px; | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + .pagination { | ||
| 204 | + margin-top: 20px; | ||
| 205 | + text-align: right; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + .el-button-group { | ||
| 209 | + display: flex; | ||
| 210 | + flex-wrap: wrap; | ||
| 211 | + gap: 5px; | ||
| 212 | + } | ||
| 213 | +} | ||
| 214 | +</style> | ||
| 0 | \ No newline at end of file | 215 | \ No newline at end of file |
src/views/resource/allocationStorehouseEnterLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + allocationStorehouseEnter: { | ||
| 4 | + title: 'Allocation Warehouse Entry', | ||
| 5 | + applyId: 'Apply ID: ', | ||
| 6 | + resourceType: 'Resource Type', | ||
| 7 | + resourceName: 'Resource Name', | ||
| 8 | + specification: 'Specification', | ||
| 9 | + resourceCode: 'Resource Code', | ||
| 10 | + fixedResource: 'Fixed Resource', | ||
| 11 | + transferredWarehouse: 'Transferred Warehouse', | ||
| 12 | + returnPerson: 'Return Person', | ||
| 13 | + originalWarehouse: 'Original Warehouse', | ||
| 14 | + targetWarehouse: 'Target Warehouse', | ||
| 15 | + originalStock: 'Original Stock', | ||
| 16 | + transferQuantity: 'Transfer Quantity', | ||
| 17 | + actualQuantity: 'Actual Quantity', | ||
| 18 | + quantityPlaceholder: 'Required, please enter the transfer quantity', | ||
| 19 | + submit: 'Submit', | ||
| 20 | + fetchError: 'Failed to fetch allocation data', | ||
| 21 | + selectItemsWarning: 'Please select items to transfer', | ||
| 22 | + quantityWarning: 'Please enter valid quantity for all selected items', | ||
| 23 | + submitSuccess: 'Operation successful', | ||
| 24 | + submitError: 'Operation failed' | ||
| 25 | + } | ||
| 26 | + }, | ||
| 27 | + zh: { | ||
| 28 | + allocationStorehouseEnter: { | ||
| 29 | + title: '调拨入库', | ||
| 30 | + applyId: '单号:', | ||
| 31 | + resourceType: '物品类型', | ||
| 32 | + resourceName: '物品名称', | ||
| 33 | + specification: '物品规格', | ||
| 34 | + resourceCode: '物品编码', | ||
| 35 | + fixedResource: '固定物品', | ||
| 36 | + transferredWarehouse: '被调仓库', | ||
| 37 | + returnPerson: '退还人', | ||
| 38 | + originalWarehouse: '原仓库', | ||
| 39 | + targetWarehouse: '目标仓库', | ||
| 40 | + originalStock: '原库存', | ||
| 41 | + transferQuantity: '调拨数量', | ||
| 42 | + actualQuantity: '实际数量', | ||
| 43 | + quantityPlaceholder: '必填,请填写调拨数量', | ||
| 44 | + submit: '提交', | ||
| 45 | + fetchError: '获取调拨数据失败', | ||
| 46 | + selectItemsWarning: '请选择调拨物品', | ||
| 47 | + quantityWarning: '请为所有选中物品填写有效数量', | ||
| 48 | + submitSuccess: '操作成功', | ||
| 49 | + submitError: '操作失败' | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | +} | ||
| 0 | \ No newline at end of file | 53 | \ No newline at end of file |
src/views/resource/allocationStorehouseEnterList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="allocation-storehouse-enter-container"> | ||
| 3 | + <el-card> | ||
| 4 | + <div slot="header" class="flex justify-between"> | ||
| 5 | + <span>{{ $t('allocationStorehouseEnter.title') }}</span> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <el-row :gutter="20"> | ||
| 9 | + <el-col :span="24"> | ||
| 10 | + <el-card> | ||
| 11 | + <div slot="header"> | ||
| 12 | + <h5> | ||
| 13 | + <span>{{ $t('allocationStorehouseEnter.applyId') }}</span>{{ allocationStorehouseEnterInfo.applyId }} | ||
| 14 | + </h5> | ||
| 15 | + </div> | ||
| 16 | + | ||
| 17 | + <el-table :data="allocationStorehouseEnterInfo.resourceStores" border style="width: 100%" | ||
| 18 | + v-loading="loading"> | ||
| 19 | + <el-table-column type="selection" width="55" align="center" @selection-change="handleSelectionChange"> | ||
| 20 | + </el-table-column> | ||
| 21 | + <el-table-column prop="parentRstName" :label="$t('allocationStorehouseEnter.resourceType')" | ||
| 22 | + align="center"> | ||
| 23 | + <template slot-scope="scope"> | ||
| 24 | + {{ scope.row.parentRstName }} > {{ scope.row.rstName }} | ||
| 25 | + </template> | ||
| 26 | + </el-table-column> | ||
| 27 | + <el-table-column prop="resName" :label="$t('allocationStorehouseEnter.resourceName')" | ||
| 28 | + align="center"></el-table-column> | ||
| 29 | + <el-table-column prop="specName" :label="$t('allocationStorehouseEnter.specification')" align="center"> | ||
| 30 | + <template slot-scope="scope"> | ||
| 31 | + {{ scope.row.specName || '-' }} | ||
| 32 | + </template> | ||
| 33 | + </el-table-column> | ||
| 34 | + <el-table-column prop="resCode" :label="$t('allocationStorehouseEnter.resourceCode')" | ||
| 35 | + align="center"></el-table-column> | ||
| 36 | + <el-table-column prop="isFixedName" :label="$t('allocationStorehouseEnter.fixedResource')" | ||
| 37 | + align="center"></el-table-column> | ||
| 38 | + <el-table-column | ||
| 39 | + :label="allocationStorehouseEnterInfo.applyType == '10000' || allocationStorehouseEnterInfo.applyType == '30000' ? $t('allocationStorehouseEnter.transferredWarehouse') : $t('allocationStorehouseEnter.returnPerson')" | ||
| 40 | + align="center"> | ||
| 41 | + <template slot-scope="scope"> | ||
| 42 | + {{ allocationStorehouseEnterInfo.applyType == '10000' || allocationStorehouseEnterInfo.applyType == | ||
| 43 | + '30000' ? scope.row.shaName : allocationStorehouseEnterInfo.startUserName }} | ||
| 44 | + </template> | ||
| 45 | + </el-table-column> | ||
| 46 | + <el-table-column prop="shaName" :label="$t('allocationStorehouseEnter.originalWarehouse')" | ||
| 47 | + align="center"></el-table-column> | ||
| 48 | + <el-table-column prop="shzName" :label="$t('allocationStorehouseEnter.targetWarehouse')" | ||
| 49 | + align="center"></el-table-column> | ||
| 50 | + <el-table-column | ||
| 51 | + :label="$t('allocationStorehouseEnter.originalStock') + '(' + (allocationStorehouseEnterInfo.applyType == '30000' ? $t('allocationStorehouseEnter.targetWarehouse') : $t('allocationStorehouseEnter.transferredWarehouse')) + ')'" | ||
| 52 | + align="center"> | ||
| 53 | + <template slot-scope="scope"> | ||
| 54 | + {{ scope.row.originalStock }}{{ scope.row.unitCodeName }} | ||
| 55 | + </template> | ||
| 56 | + </el-table-column> | ||
| 57 | + <el-table-column prop="stock" :label="$t('allocationStorehouseEnter.transferQuantity')" align="center"> | ||
| 58 | + <template slot-scope="scope"> | ||
| 59 | + {{ scope.row.stock }}{{ scope.row.applyType == 20000 ? scope.row.miniUnitCodeName : | ||
| 60 | + scope.row.unitCodeName }} | ||
| 61 | + </template> | ||
| 62 | + </el-table-column> | ||
| 63 | + <el-table-column :label="$t('allocationStorehouseEnter.actualQuantity')" align="center"> | ||
| 64 | + <template slot-scope="scope"> | ||
| 65 | + <el-input v-model.number="scope.row.quantity" type="number" | ||
| 66 | + :placeholder="$t('allocationStorehouseEnter.quantityPlaceholder')" style="width: 150px"></el-input> | ||
| 67 | + </template> | ||
| 68 | + </el-table-column> | ||
| 69 | + </el-table> | ||
| 70 | + </el-card> | ||
| 71 | + </el-col> | ||
| 72 | + </el-row> | ||
| 73 | + | ||
| 74 | + <el-row :gutter="20" style="margin-top: 20px"> | ||
| 75 | + <el-col :span="24" style="text-align: right"> | ||
| 76 | + <el-button type="primary" @click="handleSubmit"> | ||
| 77 | + <i class="el-icon-check"></i> | ||
| 78 | + {{ $t('allocationStorehouseEnter.submit') }} | ||
| 79 | + </el-button> | ||
| 80 | + </el-col> | ||
| 81 | + </el-row> | ||
| 82 | + </el-card> | ||
| 83 | + </div> | ||
| 84 | +</template> | ||
| 85 | + | ||
| 86 | +<script> | ||
| 87 | +import { listAllocationStorehouses, allocationStoreEnter } from '@/api/resource/allocationStorehouseEnterApi' | ||
| 88 | + | ||
| 89 | +export default { | ||
| 90 | + name: 'AllocationStorehouseEnterList', | ||
| 91 | + data() { | ||
| 92 | + return { | ||
| 93 | + loading: false, | ||
| 94 | + allocationStorehouseEnterInfo: { | ||
| 95 | + resourceStores: [], | ||
| 96 | + applyId: '', | ||
| 97 | + taskId: '', | ||
| 98 | + selectResIds: [] | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + }, | ||
| 102 | + created() { | ||
| 103 | + this.allocationStorehouseEnterInfo.applyId = this.$route.query.applyId | ||
| 104 | + this.allocationStorehouseEnterInfo.taskId = this.$route.query.taskId | ||
| 105 | + this.listAllocationStorehouseApply() | ||
| 106 | + }, | ||
| 107 | + methods: { | ||
| 108 | + async listAllocationStorehouseApply() { | ||
| 109 | + try { | ||
| 110 | + this.loading = true | ||
| 111 | + const params = { | ||
| 112 | + page: 1, | ||
| 113 | + row: 100, | ||
| 114 | + applyId: this.allocationStorehouseEnterInfo.applyId | ||
| 115 | + } | ||
| 116 | + const { data } = await listAllocationStorehouses(params) | ||
| 117 | + this.allocationStorehouseEnterInfo.resourceStores = data | ||
| 118 | + } catch (error) { | ||
| 119 | + this.$message.error(this.$t('allocationStorehouseEnter.fetchError')) | ||
| 120 | + } finally { | ||
| 121 | + this.loading = false | ||
| 122 | + } | ||
| 123 | + }, | ||
| 124 | + handleSelectionChange(val) { | ||
| 125 | + this.allocationStorehouseEnterInfo.selectResIds = val.map(item => item.resId) | ||
| 126 | + }, | ||
| 127 | + async handleSubmit() { | ||
| 128 | + // Validation | ||
| 129 | + const selectedItems = this.allocationStorehouseEnterInfo.resourceStores.filter(item => | ||
| 130 | + this.allocationStorehouseEnterInfo.selectResIds.includes(item.resId) | ||
| 131 | + ) | ||
| 132 | + | ||
| 133 | + if (selectedItems.length === 0) { | ||
| 134 | + this.$message.warning(this.$t('allocationStorehouseEnter.selectItemsWarning')) | ||
| 135 | + return | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + let hasError = false | ||
| 139 | + selectedItems.forEach(item => { | ||
| 140 | + if (!item.quantity || parseFloat(item.quantity) <= 0) { | ||
| 141 | + hasError = true | ||
| 142 | + return | ||
| 143 | + } | ||
| 144 | + item.quantity = parseFloat(item.quantity) | ||
| 145 | + }) | ||
| 146 | + | ||
| 147 | + if (hasError) { | ||
| 148 | + this.$message.warning(this.$t('allocationStorehouseEnter.quantityWarning')) | ||
| 149 | + return | ||
| 150 | + } | ||
| 151 | + | ||
| 152 | + this.allocationStorehouseEnterInfo.resourceStores = selectedItems | ||
| 153 | + | ||
| 154 | + try { | ||
| 155 | + await allocationStoreEnter(this.allocationStorehouseEnterInfo) | ||
| 156 | + this.$message.success(this.$t('allocationStorehouseEnter.submitSuccess')) | ||
| 157 | + this.$router.go(-1) | ||
| 158 | + } catch (error) { | ||
| 159 | + this.$message.error(error.message || this.$t('allocationStorehouseEnter.submitError')) | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | +} | ||
| 164 | +</script> | ||
| 165 | + | ||
| 166 | +<style lang="scss" scoped> | ||
| 167 | +.allocation-storehouse-enter-container { | ||
| 168 | + padding: 20px; | ||
| 169 | + | ||
| 170 | + .el-card { | ||
| 171 | + margin-bottom: 20px; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + .clearfix { | ||
| 175 | + | ||
| 176 | + &:before, | ||
| 177 | + &:after { | ||
| 178 | + display: table; | ||
| 179 | + content: ""; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + &:after { | ||
| 183 | + clear: both; | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | +} | ||
| 187 | +</style> | ||
| 0 | \ No newline at end of file | 188 | \ No newline at end of file |
src/views/resource/editAllocationStorehouseApplyLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + editAllocationStorehouseApply: { | ||
| 4 | + title: 'Allocation Application', | ||
| 5 | + back: 'Back', | ||
| 6 | + applyRemark: 'Application Description', | ||
| 7 | + remarkPlaceholder: 'Required, please fill in the application description', | ||
| 8 | + purchaseItems: 'Purchase Items', | ||
| 9 | + select: 'Select', | ||
| 10 | + resourceType: 'Resource Type', | ||
| 11 | + resourceName: 'Resource Name', | ||
| 12 | + specification: 'Specification', | ||
| 13 | + isFixed: 'Fixed Resource', | ||
| 14 | + sourceWarehouse: 'Source Warehouse', | ||
| 15 | + referencePrice: 'Reference Price', | ||
| 16 | + selectPrice: 'Select Price', | ||
| 17 | + stock: 'Stock', | ||
| 18 | + targetWarehouse: 'Target Warehouse', | ||
| 19 | + selectTargetWarehouse: 'Required, select target warehouse', | ||
| 20 | + allocationQuantity: 'Allocation Quantity', | ||
| 21 | + allocationQuantityPlaceholder: 'Required, fill in allocation quantity', | ||
| 22 | + operation: 'Operation', | ||
| 23 | + cancelAllocation: 'Cancel Allocation', | ||
| 24 | + submit: 'Submit', | ||
| 25 | + noPurchaseItems: 'No purchase items selected', | ||
| 26 | + updateSuccess: 'Update successful', | ||
| 27 | + updateFailed: 'Update failed' | ||
| 28 | + } | ||
| 29 | + }, | ||
| 30 | + zh: { | ||
| 31 | + editAllocationStorehouseApply: { | ||
| 32 | + title: '调拨申请', | ||
| 33 | + back: '返回', | ||
| 34 | + applyRemark: '申请说明', | ||
| 35 | + remarkPlaceholder: '必填,请填写申请说明', | ||
| 36 | + purchaseItems: '采购物品', | ||
| 37 | + select: '选择', | ||
| 38 | + resourceType: '物品类型', | ||
| 39 | + resourceName: '物品名称', | ||
| 40 | + specification: '物品规格', | ||
| 41 | + isFixed: '固定物品', | ||
| 42 | + sourceWarehouse: '源仓库', | ||
| 43 | + referencePrice: '参考价格', | ||
| 44 | + selectPrice: '请选择价格', | ||
| 45 | + stock: '库存', | ||
| 46 | + targetWarehouse: '目标仓库', | ||
| 47 | + selectTargetWarehouse: '必填,请选择目标仓库', | ||
| 48 | + allocationQuantity: '调拨数量', | ||
| 49 | + allocationQuantityPlaceholder: '必填,请填写调拨数量', | ||
| 50 | + operation: '操作', | ||
| 51 | + cancelAllocation: '取消调拨', | ||
| 52 | + submit: '提交', | ||
| 53 | + noPurchaseItems: '未选择采购物品', | ||
| 54 | + updateSuccess: '修改成功', | ||
| 55 | + updateFailed: '修改失败' | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | +} | ||
| 0 | \ No newline at end of file | 59 | \ No newline at end of file |
src/views/resource/editAllocationStorehouseApplyList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="edit-allocation-storehouse-apply-container"> | ||
| 3 | + <el-card class="box-card"> | ||
| 4 | + <div slot="header" class="flex justify-between"> | ||
| 5 | + <span>{{ $t('editAllocationStorehouseApply.title') }}</span> | ||
| 6 | + <div class="card-header-right"> | ||
| 7 | + <el-button type="primary" size="small" @click="goBack"> | ||
| 8 | + <i class="el-icon-close"></i> | ||
| 9 | + {{ $t('editAllocationStorehouseApply.back') }} | ||
| 10 | + </el-button> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + | ||
| 14 | + <el-row :gutter="20"> | ||
| 15 | + <el-col :span="24"> | ||
| 16 | + <el-form label-width="120px"> | ||
| 17 | + <el-form-item :label="$t('editAllocationStorehouseApply.applyRemark')"> | ||
| 18 | + <el-input type="textarea" :placeholder="$t('editAllocationStorehouseApply.remarkPlaceholder')" | ||
| 19 | + v-model="formData.remark" :rows="3"></el-input> | ||
| 20 | + </el-form-item> | ||
| 21 | + </el-form> | ||
| 22 | + </el-col> | ||
| 23 | + </el-row> | ||
| 24 | + </el-card> | ||
| 25 | + | ||
| 26 | + <el-card class="box-card" style="margin-top: 20px;"> | ||
| 27 | + <div slot="header" class="clearfix"> | ||
| 28 | + <span>{{ $t('editAllocationStorehouseApply.purchaseItems') }}</span> | ||
| 29 | + <div class="card-header-right"> | ||
| 30 | + <el-button type="primary" size="small" style="margin-right: 10px;" @click="openChooseResourceStoreDialog"> | ||
| 31 | + <i class="el-icon-search"></i> | ||
| 32 | + {{ $t('editAllocationStorehouseApply.select') }} | ||
| 33 | + </el-button> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + | ||
| 37 | + <el-table :data="formData.resourceStores" border style="width: 100%" v-loading="loading"> | ||
| 38 | + <el-table-column prop="resourceType" :label="$t('editAllocationStorehouseApply.resourceType')" align="center"> | ||
| 39 | + <template slot-scope="scope"> | ||
| 40 | + {{ scope.row.parentRstName || '-' }} > {{ scope.row.rstName || '-' }} | ||
| 41 | + </template> | ||
| 42 | + </el-table-column> | ||
| 43 | + <el-table-column prop="resourceName" :label="$t('editAllocationStorehouseApply.resourceName')" align="center"> | ||
| 44 | + <template slot-scope="scope"> | ||
| 45 | + {{ scope.row.resName }}({{ scope.row.resCode }}) | ||
| 46 | + </template> | ||
| 47 | + </el-table-column> | ||
| 48 | + <el-table-column prop="specification" :label="$t('editAllocationStorehouseApply.specification')" align="center"> | ||
| 49 | + <template slot-scope="scope"> | ||
| 50 | + {{ scope.row.rssName || '-' }} | ||
| 51 | + </template> | ||
| 52 | + </el-table-column> | ||
| 53 | + <el-table-column prop="isFixed" :label="$t('editAllocationStorehouseApply.isFixed')" align="center"> | ||
| 54 | + <template slot-scope="scope"> | ||
| 55 | + {{ scope.row.isFixedName }} | ||
| 56 | + </template> | ||
| 57 | + </el-table-column> | ||
| 58 | + <el-table-column prop="sourceWarehouse" :label="$t('editAllocationStorehouseApply.sourceWarehouse')" | ||
| 59 | + align="center"> | ||
| 60 | + <template slot-scope="scope"> | ||
| 61 | + {{ scope.row.shaName }} | ||
| 62 | + </template> | ||
| 63 | + </el-table-column> | ||
| 64 | + <el-table-column prop="referencePrice" :label="$t('editAllocationStorehouseApply.referencePrice')" | ||
| 65 | + align="center"> | ||
| 66 | + <template slot-scope="scope"> | ||
| 67 | + <el-select v-model="scope.row.timesId" @change="handleTimesChange($event, scope.$index)" | ||
| 68 | + style="width: 100%"> | ||
| 69 | + <el-option :label="$t('editAllocationStorehouseApply.selectPrice')" value=""></el-option> | ||
| 70 | + <el-option v-for="time in scope.row.times" :key="time.timesId" :label="time.price" | ||
| 71 | + :value="time.timesId"></el-option> | ||
| 72 | + </el-select> | ||
| 73 | + </template> | ||
| 74 | + </el-table-column> | ||
| 75 | + <el-table-column prop="stock" :label="$t('editAllocationStorehouseApply.stock')" align="center"> | ||
| 76 | + <template slot-scope="scope"> | ||
| 77 | + {{ getTimesStock(scope.row) }}{{ scope.row.unitCodeName }} | ||
| 78 | + </template> | ||
| 79 | + </el-table-column> | ||
| 80 | + <el-table-column prop="targetWarehouse" :label="$t('editAllocationStorehouseApply.targetWarehouse')" | ||
| 81 | + align="center"> | ||
| 82 | + <template slot-scope="scope"> | ||
| 83 | + <el-select v-model="scope.row.shzId" style="width: 100%"> | ||
| 84 | + <el-option :label="$t('editAllocationStorehouseApply.selectTargetWarehouse')" value=""></el-option> | ||
| 85 | + <template v-for="(item, index) in storehouses"> | ||
| 86 | + <el-option :key="index" :label="item.shName" :value="item.shId" | ||
| 87 | + v-if="item.shId != scope.row.shId"></el-option> | ||
| 88 | + </template> | ||
| 89 | + </el-select> | ||
| 90 | + </template> | ||
| 91 | + </el-table-column> | ||
| 92 | + <el-table-column prop="allocationQuantity" :label="$t('editAllocationStorehouseApply.allocationQuantity')" | ||
| 93 | + align="center"> | ||
| 94 | + <template slot-scope="scope"> | ||
| 95 | + <el-input-number v-model="scope.row.curStock" :min="0" | ||
| 96 | + :placeholder="$t('editAllocationStorehouseApply.allocationQuantityPlaceholder')" | ||
| 97 | + style="width: 120px"></el-input-number> | ||
| 98 | + {{ scope.row.unitCodeName }} | ||
| 99 | + </template> | ||
| 100 | + </el-table-column> | ||
| 101 | + <el-table-column :label="$t('editAllocationStorehouseApply.operation')" align="center" width="150"> | ||
| 102 | + <template slot-scope="scope"> | ||
| 103 | + <el-button type="danger" size="mini" @click="handleDeleteResourceStore(scope.row)"> | ||
| 104 | + {{ $t('editAllocationStorehouseApply.cancelAllocation') }} | ||
| 105 | + </el-button> | ||
| 106 | + </template> | ||
| 107 | + </el-table-column> | ||
| 108 | + </el-table> | ||
| 109 | + </el-card> | ||
| 110 | + | ||
| 111 | + <el-row :gutter="20" style="margin-top: 20px;"> | ||
| 112 | + <el-col :span="24" style="text-align: right;"> | ||
| 113 | + <el-button type="primary" @click="handleSubmit"> | ||
| 114 | + {{ $t('editAllocationStorehouseApply.submit') }} | ||
| 115 | + </el-button> | ||
| 116 | + </el-col> | ||
| 117 | + </el-row> | ||
| 118 | + | ||
| 119 | + <choose-resource-store ref="chooseResourceStoreDialog" | ||
| 120 | + @chooseResourceStore="handleChooseResourceStore"></choose-resource-store> | ||
| 121 | + </div> | ||
| 122 | +</template> | ||
| 123 | + | ||
| 124 | +<script> | ||
| 125 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 126 | +import { | ||
| 127 | + listAllocationStorehouseApply, | ||
| 128 | + listAllocationStorehouses, | ||
| 129 | + listStorehouses, | ||
| 130 | + updateAllocationStorehouse | ||
| 131 | +} from '@/api/resource/editAllocationStorehouseApplyApi' | ||
| 132 | +import ChooseResourceStore from '@/components/resource/chooseResourceStore' | ||
| 133 | + | ||
| 134 | +export default { | ||
| 135 | + name: 'EditAllocationStorehouseApplyList', | ||
| 136 | + components: { | ||
| 137 | + ChooseResourceStore | ||
| 138 | + }, | ||
| 139 | + data() { | ||
| 140 | + return { | ||
| 141 | + loading: false, | ||
| 142 | + communityId: '', | ||
| 143 | + formData: { | ||
| 144 | + resourceStores: [], | ||
| 145 | + remark: '', | ||
| 146 | + applyId: '', | ||
| 147 | + shId: '' | ||
| 148 | + }, | ||
| 149 | + storehouses: [] | ||
| 150 | + } | ||
| 151 | + }, | ||
| 152 | + created() { | ||
| 153 | + this.communityId = getCommunityId() | ||
| 154 | + this.formData.applyId = this.$route.query.applyId | ||
| 155 | + this.initData() | ||
| 156 | + }, | ||
| 157 | + methods: { | ||
| 158 | + async initData() { | ||
| 159 | + try { | ||
| 160 | + this.loading = true | ||
| 161 | + await Promise.all([ | ||
| 162 | + this.getAllocationStorehouseApply(), | ||
| 163 | + this.getAllocationStorehouses(), | ||
| 164 | + this.getStorehouses() | ||
| 165 | + ]) | ||
| 166 | + } catch (error) { | ||
| 167 | + console.error('初始化数据失败:', error) | ||
| 168 | + } finally { | ||
| 169 | + this.loading = false | ||
| 170 | + } | ||
| 171 | + }, | ||
| 172 | + async getAllocationStorehouseApply() { | ||
| 173 | + try { | ||
| 174 | + const params = { | ||
| 175 | + page: 1, | ||
| 176 | + row: 1, | ||
| 177 | + applyId: this.formData.applyId | ||
| 178 | + } | ||
| 179 | + const { data } = await listAllocationStorehouseApply(params) | ||
| 180 | + const applyData = data[0] | ||
| 181 | + Object.assign(this.formData, applyData) | ||
| 182 | + } catch (error) { | ||
| 183 | + console.error('获取调拨申请失败:', error) | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + async getAllocationStorehouses() { | ||
| 187 | + try { | ||
| 188 | + const params = { | ||
| 189 | + page: 1, | ||
| 190 | + row: 100, | ||
| 191 | + applyId: this.formData.applyId | ||
| 192 | + } | ||
| 193 | + const { data } = await listAllocationStorehouses(params) | ||
| 194 | + data.forEach(item => { | ||
| 195 | + item.shzId = item.shIdz | ||
| 196 | + item.shId = item.shIda | ||
| 197 | + this.formData.shId = item.shIda | ||
| 198 | + item.curStock = item.stock | ||
| 199 | + }) | ||
| 200 | + this.formData.resourceStores = data | ||
| 201 | + } catch (error) { | ||
| 202 | + console.error('获取调拨物品失败:', error) | ||
| 203 | + } | ||
| 204 | + }, | ||
| 205 | + async getStorehouses() { | ||
| 206 | + try { | ||
| 207 | + const params = { | ||
| 208 | + page: 1, | ||
| 209 | + row: 100, | ||
| 210 | + communityId: this.communityId | ||
| 211 | + } | ||
| 212 | + const { data } = await listStorehouses(params) | ||
| 213 | + this.storehouses = data | ||
| 214 | + } catch (error) { | ||
| 215 | + console.error('获取仓库列表失败:', error) | ||
| 216 | + } | ||
| 217 | + }, | ||
| 218 | + handleTimesChange(value, index) { | ||
| 219 | + const times = this.formData.resourceStores[index].times | ||
| 220 | + times.forEach(item => { | ||
| 221 | + if (item.timesId === value) { | ||
| 222 | + this.formData.resourceStores[index].selectedStock = item.stock | ||
| 223 | + } | ||
| 224 | + }) | ||
| 225 | + }, | ||
| 226 | + getTimesStock(resourceStore) { | ||
| 227 | + if (!resourceStore.timesId || !resourceStore.times) { | ||
| 228 | + return "-" | ||
| 229 | + } | ||
| 230 | + let stock = 0 | ||
| 231 | + resourceStore.times.forEach(item => { | ||
| 232 | + if (item.timesId === resourceStore.timesId) { | ||
| 233 | + stock = item.stock | ||
| 234 | + } | ||
| 235 | + }) | ||
| 236 | + return stock | ||
| 237 | + }, | ||
| 238 | + openChooseResourceStoreDialog() { | ||
| 239 | + this.$refs.chooseResourceStoreDialog.open({ | ||
| 240 | + resOrderType: '20000', | ||
| 241 | + shId: this.formData.shId | ||
| 242 | + }) | ||
| 243 | + }, | ||
| 244 | + handleChooseResourceStore(resourceStores) { | ||
| 245 | + const oldList = this.formData.resourceStores | ||
| 246 | + // 过滤重复选择的商品 | ||
| 247 | + const newItems = resourceStores.filter(newItem => { | ||
| 248 | + return !oldList.some(oldItem => oldItem.resId === newItem.resId) | ||
| 249 | + }) | ||
| 250 | + // 设置新选择的商品默认值 | ||
| 251 | + newItems.forEach(item => { | ||
| 252 | + item.shaName = item.shName | ||
| 253 | + item.shzId = '' | ||
| 254 | + item.timesId = '' | ||
| 255 | + item.curStock = '0' | ||
| 256 | + }) | ||
| 257 | + // 合并已有商品和新添加商品 | ||
| 258 | + this.formData.resourceStores = [...oldList, ...newItems] | ||
| 259 | + }, | ||
| 260 | + handleDeleteResourceStore(resourceStore) { | ||
| 261 | + this.formData.resourceStores = this.formData.resourceStores.filter( | ||
| 262 | + item => item.resId !== resourceStore.resId | ||
| 263 | + ) | ||
| 264 | + this.$refs.chooseResourceStoreDialog.removeSelectItem(resourceStore.resId) | ||
| 265 | + }, | ||
| 266 | + async handleSubmit() { | ||
| 267 | + if (!this.formData.resourceStores || this.formData.resourceStores.length === 0) { | ||
| 268 | + this.$message.warning(this.$t('editAllocationStorehouseApply.noPurchaseItems')) | ||
| 269 | + return | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + try { | ||
| 273 | + this.loading = true | ||
| 274 | + const response = await updateAllocationStorehouse(this.formData) | ||
| 275 | + if (response.code === 0) { | ||
| 276 | + this.$message.success(this.$t('editAllocationStorehouseApply.updateSuccess')) | ||
| 277 | + this.$router.go(-1) | ||
| 278 | + } else { | ||
| 279 | + this.$message.error(response.msg) | ||
| 280 | + } | ||
| 281 | + } catch (error) { | ||
| 282 | + console.error('提交调拨申请失败:', error) | ||
| 283 | + this.$message.error(this.$t('editAllocationStorehouseApply.updateFailed')) | ||
| 284 | + } finally { | ||
| 285 | + this.loading = false | ||
| 286 | + } | ||
| 287 | + }, | ||
| 288 | + goBack() { | ||
| 289 | + this.$router.go(-1) | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | +} | ||
| 293 | +</script> | ||
| 294 | + | ||
| 295 | +<style lang="scss" scoped> | ||
| 296 | +.edit-allocation-storehouse-apply-container { | ||
| 297 | + padding: 20px; | ||
| 298 | + | ||
| 299 | + .box-card { | ||
| 300 | + margin-bottom: 20px; | ||
| 301 | + | ||
| 302 | + .clearfix { | ||
| 303 | + display: flex; | ||
| 304 | + justify-content: space-between; | ||
| 305 | + align-items: center; | ||
| 306 | + } | ||
| 307 | + } | ||
| 308 | + | ||
| 309 | + .el-table { | ||
| 310 | + margin-top: 20px; | ||
| 311 | + } | ||
| 312 | +} | ||
| 313 | +</style> | ||
| 0 | \ No newline at end of file | 314 | \ No newline at end of file |
src/views/resource/myAuditOrdersList.vue
| @@ -104,7 +104,7 @@ export default { | @@ -104,7 +104,7 @@ export default { | ||
| 104 | this._loadStepStaff() | 104 | this._loadStepStaff() |
| 105 | }, | 105 | }, |
| 106 | _initEvent() { | 106 | _initEvent() { |
| 107 | - | 107 | + |
| 108 | }, | 108 | }, |
| 109 | async _listAuditOrders(_page, _rows) { | 109 | async _listAuditOrders(_page, _rows) { |
| 110 | this.auditOrdersInfo.audit = '1' | 110 | this.auditOrdersInfo.audit = '1' |
src/views/resource/myItemOutAuditOrdersLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + myItemOutAuditOrders: { | ||
| 4 | + title: 'Pending Orders', | ||
| 5 | + back: 'Back', | ||
| 6 | + refresh: 'Refresh', | ||
| 7 | + orderNo: 'Order No', | ||
| 8 | + orderType: 'Order Type', | ||
| 9 | + orderStatus: 'Order Status', | ||
| 10 | + applicant: 'Applicant', | ||
| 11 | + createTime: 'Create Time', | ||
| 12 | + operation: 'Operation', | ||
| 13 | + view: 'View', | ||
| 14 | + edit: 'Edit', | ||
| 15 | + itemDistribution: 'Item Distribution', | ||
| 16 | + audit: 'Audit' | ||
| 17 | + } | ||
| 18 | + }, | ||
| 19 | + zh: { | ||
| 20 | + myItemOutAuditOrders: { | ||
| 21 | + title: '待办单', | ||
| 22 | + back: '返回', | ||
| 23 | + refresh: '刷新', | ||
| 24 | + orderNo: '订单号', | ||
| 25 | + orderType: '订单类型', | ||
| 26 | + orderStatus: '订单状态', | ||
| 27 | + applicant: '申请人', | ||
| 28 | + createTime: '创建时间', | ||
| 29 | + operation: '操作', | ||
| 30 | + view: '查看', | ||
| 31 | + edit: '修改', | ||
| 32 | + itemDistribution: '物品发放', | ||
| 33 | + audit: '审批' | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | +} | ||
| 0 | \ No newline at end of file | 37 | \ No newline at end of file |
src/views/resource/myItemOutAuditOrdersList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="animated fadeInRight ecommerce padding"> | ||
| 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('myItemOutAuditOrders.title') }}</div> | ||
| 8 | + <div class="ibox-tools"> | ||
| 9 | + <el-button type="primary" size="small" @click="goBack"> | ||
| 10 | + <i class="el-icon-close"></i> | ||
| 11 | + {{ $t('myItemOutAuditOrders.back') }} | ||
| 12 | + </el-button> | ||
| 13 | + <el-button type="primary" size="small" @click="_queryAuditOrdersMethod"> | ||
| 14 | + <i class="el-icon-refresh"></i> | ||
| 15 | + {{ $t('myItemOutAuditOrders.refresh') }} | ||
| 16 | + </el-button> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + <div class=""> | ||
| 20 | + <el-table :data="auditOrdersInfo.auditOrders" style="width: 100%" border stripe> | ||
| 21 | + <el-table-column prop="applyOrderId" :label="$t('myItemOutAuditOrders.orderNo')" align="center" /> | ||
| 22 | + <el-table-column prop="resOrderTypeName" :label="$t('myItemOutAuditOrders.orderType')" align="center" /> | ||
| 23 | + <el-table-column prop="stateName" :label="$t('myItemOutAuditOrders.orderStatus')" align="center" /> | ||
| 24 | + <el-table-column prop="userName" :label="$t('myItemOutAuditOrders.applicant')" align="center" /> | ||
| 25 | + <el-table-column prop="createTime" :label="$t('myItemOutAuditOrders.createTime')" align="center" /> | ||
| 26 | + <el-table-column :label="$t('myItemOutAuditOrders.operation')" align="center" width="300"> | ||
| 27 | + <template slot-scope="scope"> | ||
| 28 | + <el-button-group> | ||
| 29 | + <el-button size="mini" @click="_openDetailPurchaseApplyModel(scope.row)"> | ||
| 30 | + {{ $t('myItemOutAuditOrders.view') }} | ||
| 31 | + </el-button> | ||
| 32 | + <el-button v-if="scope.row.createUserId === auditOrdersInfo.currentUserId" size="mini" | ||
| 33 | + @click="_openEditPurchaseModel(scope.row)"> | ||
| 34 | + {{ $t('myItemOutAuditOrders.edit') }} | ||
| 35 | + </el-button> | ||
| 36 | + <el-button v-if="scope.row.curTaskName === '仓库管理员'" size="mini" | ||
| 37 | + @click="_distributionOrder(scope.row)"> | ||
| 38 | + {{ $t('myItemOutAuditOrders.itemDistribution') }} | ||
| 39 | + </el-button> | ||
| 40 | + <el-button v-else size="mini" @click="_openAuditOrderModel(scope.row)"> | ||
| 41 | + {{ $t('myItemOutAuditOrders.audit') }} | ||
| 42 | + </el-button> | ||
| 43 | + </el-button-group> | ||
| 44 | + </template> | ||
| 45 | + </el-table-column> | ||
| 46 | + </el-table> | ||
| 47 | + <el-pagination :current-page.sync="currentPage" :page-size="pageSize" :total="total" | ||
| 48 | + layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" | ||
| 49 | + @current-change="handleCurrentChange" /> | ||
| 50 | + </div> | ||
| 51 | + </el-card> | ||
| 52 | + </el-col> | ||
| 53 | + </el-row> | ||
| 54 | + </div> | ||
| 55 | +</template> | ||
| 56 | + | ||
| 57 | +<script> | ||
| 58 | +import { getCollectionAuditOrder } from '@/api/resource/myItemOutAuditOrdersApi' | ||
| 59 | +import { getCommunityId } from '@/api/community/communityApi' | ||
| 60 | + | ||
| 61 | +export default { | ||
| 62 | + name: 'MyItemOutAuditOrdersList', | ||
| 63 | + data() { | ||
| 64 | + return { | ||
| 65 | + DEFAULT_PAGE: 1, | ||
| 66 | + DEFAULT_ROWS: 10, | ||
| 67 | + currentPage: 1, | ||
| 68 | + pageSize: 10, | ||
| 69 | + total: 0, | ||
| 70 | + auditOrdersInfo: { | ||
| 71 | + auditOrders: [], | ||
| 72 | + total: 0, | ||
| 73 | + records: 1, | ||
| 74 | + moreCondition: false, | ||
| 75 | + userName: '', | ||
| 76 | + currentUserId: '', | ||
| 77 | + conditions: { | ||
| 78 | + AuditOrdersId: '', | ||
| 79 | + userName: '', | ||
| 80 | + auditLink: '', | ||
| 81 | + page: 1, | ||
| 82 | + row: 10 | ||
| 83 | + }, | ||
| 84 | + orderInfo: '', | ||
| 85 | + procure: false, | ||
| 86 | + audit: '1' | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + }, | ||
| 90 | + created() { | ||
| 91 | + this.auditOrdersInfo.currentUserId = this.$store.getters.userId | ||
| 92 | + this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS) | ||
| 93 | + }, | ||
| 94 | + methods: { | ||
| 95 | + async _listAuditOrders(page, rows) { | ||
| 96 | + this.auditOrdersInfo.audit = '1' | ||
| 97 | + this.auditOrdersInfo.conditions.page = page | ||
| 98 | + this.auditOrdersInfo.conditions.row = rows | ||
| 99 | + const params = { | ||
| 100 | + ...this.auditOrdersInfo.conditions, | ||
| 101 | + communityId: getCommunityId() | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + try { | ||
| 105 | + const { data, total } = await getCollectionAuditOrder(params) | ||
| 106 | + this.auditOrdersInfo.total = total | ||
| 107 | + this.auditOrdersInfo.records = total | ||
| 108 | + this.auditOrdersInfo.auditOrders = data | ||
| 109 | + this.total = total | ||
| 110 | + } catch (error) { | ||
| 111 | + console.error('请求失败:', error) | ||
| 112 | + } | ||
| 113 | + }, | ||
| 114 | + _openAuditOrderModel(auditOrder) { | ||
| 115 | + this.$router.push({ | ||
| 116 | + path: '/views/resource/purchaseApplyDetail', | ||
| 117 | + query: { | ||
| 118 | + applyOrderId: auditOrder.applyOrderId, | ||
| 119 | + resOrderType: auditOrder.resOrderType, | ||
| 120 | + action: 'audit', | ||
| 121 | + taskId: auditOrder.taskId | ||
| 122 | + } | ||
| 123 | + }) | ||
| 124 | + }, | ||
| 125 | + _queryAuditOrdersMethod() { | ||
| 126 | + this._listAuditOrders(this.DEFAULT_PAGE, this.DEFAULT_ROWS) | ||
| 127 | + }, | ||
| 128 | + _openDetailPurchaseApplyModel(purchaseApply) { | ||
| 129 | + this.$router.push({ | ||
| 130 | + path: '/views/resource/purchaseApplyDetaill', | ||
| 131 | + query: { | ||
| 132 | + applyOrderId: purchaseApply.applyOrderId, | ||
| 133 | + resOrderType: purchaseApply.resOrderType | ||
| 134 | + } | ||
| 135 | + }) | ||
| 136 | + }, | ||
| 137 | + _openEditPurchaseModel(purchaseApply) { | ||
| 138 | + this.$router.push({ | ||
| 139 | + path: '/pages/resource/editPurchaseApply', | ||
| 140 | + query: { | ||
| 141 | + applyOrderId: purchaseApply.applyOrderId, | ||
| 142 | + resOrderType: purchaseApply.resOrderType | ||
| 143 | + } | ||
| 144 | + }) | ||
| 145 | + }, | ||
| 146 | + _distributionOrder(purchaseApply) { | ||
| 147 | + this.$router.push({ | ||
| 148 | + path: '/pages/common/resourceOutManage', | ||
| 149 | + query: { | ||
| 150 | + applyOrderId: purchaseApply.applyOrderId, | ||
| 151 | + resOrderType: purchaseApply.resOrderType, | ||
| 152 | + taskId: purchaseApply.taskId | ||
| 153 | + } | ||
| 154 | + }) | ||
| 155 | + }, | ||
| 156 | + goBack() { | ||
| 157 | + this.$router.go(-1) | ||
| 158 | + }, | ||
| 159 | + handleSizeChange(val) { | ||
| 160 | + this.pageSize = val | ||
| 161 | + this._listAuditOrders(this.currentPage, val) | ||
| 162 | + }, | ||
| 163 | + handleCurrentChange(val) { | ||
| 164 | + this.currentPage = val | ||
| 165 | + this._listAuditOrders(val, this.pageSize) | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | +} | ||
| 169 | +</script> | ||
| 170 | + | ||
| 171 | +<style scoped> | ||
| 172 | +.ibox-tools { | ||
| 173 | + float: right; | ||
| 174 | +} | ||
| 175 | + | ||
| 176 | +.clearfix:before, | ||
| 177 | +.clearfix:after { | ||
| 178 | + display: table; | ||
| 179 | + content: ""; | ||
| 180 | +} | ||
| 181 | + | ||
| 182 | +.clearfix:after { | ||
| 183 | + clear: both; | ||
| 184 | +} | ||
| 185 | + | ||
| 186 | +.box-card { | ||
| 187 | + margin-bottom: 20px; | ||
| 188 | +} | ||
| 189 | + | ||
| 190 | +.el-pagination { | ||
| 191 | + margin-top: 15px; | ||
| 192 | + text-align: right; | ||
| 193 | +} | ||
| 194 | +</style> | ||
| 0 | \ No newline at end of file | 195 | \ No newline at end of file |
src/views/resource/resourceOutManageLang.js
0 → 100644
| 1 | +export const messages = { | ||
| 2 | + en: { | ||
| 3 | + resourceOutManage: { | ||
| 4 | + orderId: 'Order ID', | ||
| 5 | + itemType: 'Item Type', | ||
| 6 | + itemName: 'Item Name', | ||
| 7 | + itemSpec: 'Item Specification', | ||
| 8 | + itemCode: 'Item Code', | ||
| 9 | + itemStock: 'Stock', | ||
| 10 | + applyQuantity: 'Apply Quantity', | ||
| 11 | + issueQuantity: 'Issue Quantity', | ||
| 12 | + issueQuantityPlaceholder: 'Required, please enter issue quantity', | ||
| 13 | + remark: 'Remark', | ||
| 14 | + remarkPlaceholder: 'Optional, please enter remark', | ||
| 15 | + submit: 'Submit', | ||
| 16 | + quantityRequired: 'Please enter issue quantity', | ||
| 17 | + insufficientStock: 'Insufficient stock', | ||
| 18 | + submitSuccess: 'Submit success', | ||
| 19 | + submitError: 'Submit failed', | ||
| 20 | + fetchError: 'Failed to fetch data' | ||
| 21 | + } | ||
| 22 | + }, | ||
| 23 | + zh: { | ||
| 24 | + resourceOutManage: { | ||
| 25 | + orderId: '单号', | ||
| 26 | + itemType: '物品类型', | ||
| 27 | + itemName: '物品名称', | ||
| 28 | + itemSpec: '物品规格', | ||
| 29 | + itemCode: '物品编码', | ||
| 30 | + itemStock: '物品库存', | ||
| 31 | + applyQuantity: '申请数量', | ||
| 32 | + issueQuantity: '发放数量', | ||
| 33 | + issueQuantityPlaceholder: '必填,请填写发放数量', | ||
| 34 | + remark: '备注', | ||
| 35 | + remarkPlaceholder: '可填,请填写备注', | ||
| 36 | + submit: '提交', | ||
| 37 | + quantityRequired: '请填写发放数量', | ||
| 38 | + insufficientStock: '库存不足', | ||
| 39 | + submitSuccess: '提交成功', | ||
| 40 | + submitError: '提交失败', | ||
| 41 | + fetchError: '获取数据失败' | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | +} | ||
| 0 | \ No newline at end of file | 45 | \ No newline at end of file |
src/views/resource/resourceOutManageList.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <div class="resource-out-manage-container"> | ||
| 3 | + <el-card class="box-card"> | ||
| 4 | + <div slot="header" class="flex justify-between"> | ||
| 5 | + <span>{{ $t('resourceOutManage.orderId') }}:{{ resourceOutManageInfo.applyOrderId }}</span> | ||
| 6 | + </div> | ||
| 7 | + <el-row> | ||
| 8 | + <el-col :span="24"> | ||
| 9 | + <el-table :data="resourceOutManageInfo.purchaseApplyDetailVo" border style="width: 100%" v-loading="loading"> | ||
| 10 | + <el-table-column prop="rstName" :label="$t('resourceOutManage.itemType')" align="center" width="180"> | ||
| 11 | + <template slot-scope="scope"> | ||
| 12 | + {{ scope.row.rstName || '-' }} | ||
| 13 | + </template> | ||
| 14 | + </el-table-column> | ||
| 15 | + <el-table-column prop="resName" :label="$t('resourceOutManage.itemName')" align="center" width="180" /> | ||
| 16 | + <el-table-column prop="specName" :label="$t('resourceOutManage.itemSpec')" align="center" width="180"> | ||
| 17 | + <template slot-scope="scope"> | ||
| 18 | + {{ scope.row.specName || '-' }} | ||
| 19 | + </template> | ||
| 20 | + </el-table-column> | ||
| 21 | + <el-table-column prop="resCode" :label="$t('resourceOutManage.itemCode')" align="center" width="180" /> | ||
| 22 | + <el-table-column prop="stock" :label="$t('resourceOutManage.itemStock')" align="center" width="120" /> | ||
| 23 | + <el-table-column prop="quantity" :label="$t('resourceOutManage.applyQuantity')" align="center" | ||
| 24 | + width="120" /> | ||
| 25 | + <el-table-column :label="$t('resourceOutManage.issueQuantity')" align="center" width="200"> | ||
| 26 | + <template slot-scope="scope"> | ||
| 27 | + <el-input v-model.number="scope.row.purchaseQuantity" type="number" | ||
| 28 | + :placeholder="$t('resourceOutManage.issueQuantityPlaceholder')" clearable /> | ||
| 29 | + </template> | ||
| 30 | + </el-table-column> | ||
| 31 | + <el-table-column :label="$t('resourceOutManage.remark')" align="center" width="200"> | ||
| 32 | + <template slot-scope="scope"> | ||
| 33 | + <el-input v-model="scope.row.purchaseRemark" type="text" | ||
| 34 | + :placeholder="$t('resourceOutManage.remarkPlaceholder')" clearable /> | ||
| 35 | + </template> | ||
| 36 | + </el-table-column> | ||
| 37 | + </el-table> | ||
| 38 | + </el-col> | ||
| 39 | + </el-row> | ||
| 40 | + | ||
| 41 | + <el-row class="footer-row"> | ||
| 42 | + <el-col :span="24" class="text-right"> | ||
| 43 | + <el-button type="primary" @click="handleSubmit"> | ||
| 44 | + {{ $t('resourceOutManage.submit') }} | ||
| 45 | + </el-button> | ||
| 46 | + </el-col> | ||
| 47 | + </el-row> | ||
| 48 | + </el-card> | ||
| 49 | + </div> | ||
| 50 | +</template> | ||
| 51 | + | ||
| 52 | +<script> | ||
| 53 | +import { listPurchaseApplys, submitResourceOut } from '@/api/resource/resourceOutManageApi' | ||
| 54 | + | ||
| 55 | +export default { | ||
| 56 | + name: 'ResourceOutManageList', | ||
| 57 | + data() { | ||
| 58 | + return { | ||
| 59 | + loading: false, | ||
| 60 | + resourceOutManageInfo: { | ||
| 61 | + purchaseApplyDetailVo: [], | ||
| 62 | + applyOrderId: '', | ||
| 63 | + taskId: '', | ||
| 64 | + resOrderType: '' | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + }, | ||
| 68 | + created() { | ||
| 69 | + this.resourceOutManageInfo.applyOrderId = this.$route.query.applyOrderId | ||
| 70 | + this.resourceOutManageInfo.resOrderType = this.$route.query.resOrderType | ||
| 71 | + this.resourceOutManageInfo.taskId = this.$route.query.taskId | ||
| 72 | + this.getList() | ||
| 73 | + }, | ||
| 74 | + methods: { | ||
| 75 | + async getList() { | ||
| 76 | + try { | ||
| 77 | + this.loading = true | ||
| 78 | + const params = { | ||
| 79 | + page: 1, | ||
| 80 | + row: 10, | ||
| 81 | + applyOrderId: this.resourceOutManageInfo.applyOrderId, | ||
| 82 | + resOrderType: this.resourceOutManageInfo.resOrderType | ||
| 83 | + } | ||
| 84 | + const { data } = await listPurchaseApplys(params) | ||
| 85 | + const purchaseApply = data.purchaseApplys[0] | ||
| 86 | + this.resourceOutManageInfo = { | ||
| 87 | + ...this.resourceOutManageInfo, | ||
| 88 | + ...purchaseApply | ||
| 89 | + } | ||
| 90 | + this.resourceOutManageInfo.purchaseApplyDetailVo.forEach(item => { | ||
| 91 | + item.purchaseQuantity = '' | ||
| 92 | + item.price = '' | ||
| 93 | + item.purchaseRemark = '' | ||
| 94 | + }) | ||
| 95 | + } catch (error) { | ||
| 96 | + console.error('Failed to fetch purchase apply list:', error) | ||
| 97 | + this.$message.error(this.$t('resourceOutManage.fetchError')) | ||
| 98 | + } finally { | ||
| 99 | + this.loading = false | ||
| 100 | + } | ||
| 101 | + }, | ||
| 102 | + async handleSubmit() { | ||
| 103 | + try { | ||
| 104 | + // Validate form | ||
| 105 | + let isValid = true | ||
| 106 | + this.resourceOutManageInfo.purchaseApplyDetailVo.forEach(item => { | ||
| 107 | + if (!item.purchaseQuantity || parseFloat(item.purchaseQuantity) <= 0) { | ||
| 108 | + this.$message.error(this.$t('resourceOutManage.quantityRequired')) | ||
| 109 | + isValid = false | ||
| 110 | + return | ||
| 111 | + } | ||
| 112 | + item.purchaseQuantity = parseFloat(item.purchaseQuantity) | ||
| 113 | + if (item.purchaseQuantity > parseFloat(item.stock)) { | ||
| 114 | + this.$message.error(this.$t('resourceOutManage.insufficientStock')) | ||
| 115 | + isValid = false | ||
| 116 | + return | ||
| 117 | + } | ||
| 118 | + }) | ||
| 119 | + | ||
| 120 | + if (!isValid) return | ||
| 121 | + | ||
| 122 | + const response = await submitResourceOut(this.resourceOutManageInfo) | ||
| 123 | + if (response.code === 0) { | ||
| 124 | + this.$message.success(this.$t('resourceOutManage.submitSuccess')) | ||
| 125 | + this.$router.go(-1) | ||
| 126 | + } else { | ||
| 127 | + this.$message.error(response.msg) | ||
| 128 | + } | ||
| 129 | + } catch (error) { | ||
| 130 | + console.error('Failed to submit resource out:', error) | ||
| 131 | + this.$message.error(this.$t('resourceOutManage.submitError')) | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | +} | ||
| 136 | +</script> | ||
| 137 | + | ||
| 138 | +<style lang="scss" scoped> | ||
| 139 | +.resource-out-manage-container { | ||
| 140 | + padding: 20px; | ||
| 141 | + | ||
| 142 | + .box-card { | ||
| 143 | + margin-bottom: 20px; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + .footer-row { | ||
| 147 | + margin-top: 20px; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + .text-right { | ||
| 151 | + text-align: right; | ||
| 152 | + } | ||
| 153 | +} | ||
| 154 | +</style> | ||
| 0 | \ No newline at end of file | 155 | \ No newline at end of file |