| | |
| | | <script> |
| | | import ShowDelConfirm from "@/components/showDelConfirm/index.vue"; |
| | | import ApprovalDialog from "./components/approvalDialog.vue"; |
| | | import { getProposalList } from "./service"; |
| | | import { getProposalList, upAndDown, deleteById } from "./service"; |
| | | |
| | | export default { |
| | | name: "ProjectList", |
| | |
| | | createBy: "", |
| | | createTime: [], |
| | | auditPersonName: "", |
| | | auditStatus: 1, |
| | | auditStatus: '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | startTime: "", |
| | |
| | | }, |
| | | computed: { |
| | | isProcessEngineer() { |
| | | return false; |
| | | // 这里需要根据实际的用户角色判断逻辑来修改 |
| | | return this.$store.state.user.role === 'processEngineer'; |
| | | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}'); |
| | | return userInfo.roleType === 3; // 3是工艺工程师 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | createBy: "", |
| | | createTime: [], |
| | | auditPersonName: "", |
| | | auditStatus: this.currentType === "draft" ? -1 : 1, |
| | | auditStatus: this.currentType === "draft" ? -1 : '', |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | startTime: "", |
| | | endTime: "", |
| | | }; |
| | | this.getTableData(); |
| | | }, |
| | | handleSearch() { |
| | | if (this.form.createTime && this.form.createTime.length === 2) { |
| | |
| | | this.changeStatus = true; |
| | | }, |
| | | handleEdit(row) { |
| | | // 实现编辑逻辑 |
| | | console.log("编辑数据:", row); |
| | | this.$router.push({ |
| | | path: "/dataManagement/addPlan", |
| | | query: { |
| | | id: row.id |
| | | } |
| | | }); |
| | | }, |
| | | handleDelete(row) { |
| | | this.currentOperationType = "delete"; |
| | |
| | | handleChangeStatusConfirm() { |
| | | if (this.currentOperationType === "revoke") { |
| | | // 处理撤销审批逻辑 |
| | | console.log("撤销审批数据:", this.currentOperationRow); |
| | | // TODO: 调用撤销审批接口 |
| | | upAndDown({ |
| | | id: this.currentOperationRow.id, |
| | | status: 4 // 已撤销状态 |
| | | }).then(() => { |
| | | this.$message.success("撤销审批成功"); |
| | | } else if (this.currentOperationType === "delete") { |
| | | // 处理删除逻辑 |
| | | console.log("删除数据:", this.currentOperationRow); |
| | | // TODO: 调用删除接口 |
| | | this.$message.success("删除成功"); |
| | | } |
| | | this.changeStatus = false; |
| | | this.getTableData(); |
| | | }).catch(error => { |
| | | this.$message.error("撤销审批失败"); |
| | | }); |
| | | } else if (this.currentOperationType === "delete") { |
| | | // 处理删除逻辑 |
| | | deleteById({ |
| | | id: this.currentOperationRow.id |
| | | }).then(() => { |
| | | this.$message.success("删除成功"); |
| | | this.changeStatus = false; |
| | | this.getTableData(); |
| | | }).catch(error => { |
| | | this.$message.error("删除失败"); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }; |