feat(approve): 实现采购单审批功能并优化已审批列表
- 新增通用审批接口 approveTask 用于处理审批操作 - 重构采购单审批界面,将审批操作拆分为多级对话框 - 实现已审批采购单列表页面,支持搜索和查看详情 - 在后端增加已审批订单查询接口及相应服务层逻辑 - 更新采购单实体类,添加审批相关字段如 taskId、todoApproveTime - 调整前端页面样式与交互逻辑,提升用户体验 - 修复部分审批状态判断逻辑以确保准确性 - 完善审批历史记录展示功能,增强可追溯性dev_1.0.0
parent
491344f1d6
commit
3a099795c2
|
|
@ -16,4 +16,13 @@ export function listCompletedFlows(data) {
|
|||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
// 通用审批
|
||||
export function approveTask(data) {
|
||||
return request({
|
||||
url: '/flow/todo/approve',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,3 +76,12 @@ export function delPurchaseorder(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已审批采购单主表列表
|
||||
export function listApprovedPurchaseorder(query) {
|
||||
return request({
|
||||
url: '/sip/purchaseorder/approved/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.approve-layout {
|
||||
max-height: 100vh;
|
||||
|
||||
background-color: #F8F5F0;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
<!-- 审批详情主对话框 -->
|
||||
<el-dialog title="采购单审批" :visible.sync="detailDialogVisible" width="80%" append-to-body>
|
||||
<div v-loading="detailLoading" style="max-height: 70vh; overflow-y: auto; padding: 20px;">
|
||||
<ApproveLayout title="采购单详情" :style="{ 'max-height': '90vh' }" >
|
||||
<ApproveLayout title="采购单详情" >
|
||||
<purchase-order-detail-view ref="detailViewOnly" :order-data="form" >
|
||||
</purchase-order-detail-view>
|
||||
<template #footer>
|
||||
|
|
@ -78,29 +78,26 @@
|
|||
<div v-if="!approveLogs || approveLogs.length === 0">暂无流转过程数据。</div>
|
||||
</div>
|
||||
|
||||
<el-divider content-position="left">审批操作</el-divider>
|
||||
<el-form ref="opinionForm" :model="opinionForm" :rules="opinionRules" label-width="100px">
|
||||
<el-form-item label="审批意见" prop="approveOpinion">
|
||||
<el-input v-model="opinionForm.approveOpinion" type="textarea" :rows="4" placeholder="请输入审批意见"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="showConfirmDialog('approve')">同意</el-button>
|
||||
<el-button type="danger" @click="showConfirmDialog('reject')">驳回</el-button>
|
||||
<el-button @click="detailDialogVisible = false">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审批确认对话框 (二级) -->
|
||||
<el-dialog :title="confirmDialogTitle" :visible.sync="confirmDialogVisible" width="50%" append-to-body>
|
||||
<div v-loading="confirmDetailLoading">
|
||||
<p v-if="confirmDetailData">确认提交对 **{{ confirmDetailData.applyUserName }}** 发起的 **{{ confirmDetailData.taskName }}** 的审批吗?</p>
|
||||
<el-empty v-else description="暂无审批详情数据"></el-empty>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="confirmDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitApproval">确 定</el-button>
|
||||
<el-button type="primary" @click="openOpinionDialog('approve')">同意</el-button>
|
||||
<el-button type="danger" @click="openOpinionDialog('reject')">驳回</el-button>
|
||||
<el-button @click="detailDialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<!-- 审批意见对话框 (三级) -->
|
||||
<el-dialog :title="confirmDialogTitle" :visible.sync="opinionDialogVisible" width="30%" append-to-body>
|
||||
<el-form ref="opinionForm" :model="opinionForm" :rules="opinionRules" label-width="100px">
|
||||
<el-form-item label="审批意见" prop="approveOpinion">
|
||||
<el-input v-model="opinionForm.approveOpinion" type="textarea" :rows="4" placeholder="请输入审批意见"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="opinionDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="showConfirmDialog()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
|
@ -110,7 +107,7 @@
|
|||
import { listApprovePurchaseorder, getPurchaseorder } from "@/api/sip/purchaseorder";
|
||||
import { listAllVendor } from "@/api/base/vendor";
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
import { getTodoDetail, listCompletedFlows } from "@/api/flow";
|
||||
import { getTodoDetail, listCompletedFlows, approveTask } from "@/api/flow";
|
||||
import PurchaseOrderDetailView from "@/views/purchaseorder/components/PurchaseOrderDetailView.vue";
|
||||
import ApproveLayout from "@/views/approve/ApproveLayout.vue";
|
||||
|
||||
|
|
@ -156,13 +153,10 @@ export default {
|
|||
opinionRules: {
|
||||
approveOpinion: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
||||
},
|
||||
// 确认对话框数据
|
||||
confirmDialogVisible: false,
|
||||
confirmDialogTitle: '',
|
||||
confirmDetailLoading: false,
|
||||
confirmDetailData: null,
|
||||
currentApproveType: '',
|
||||
currentOrderId: null,
|
||||
// 审批意见对话框数据
|
||||
opinionDialogVisible: false,
|
||||
processKey: null,
|
||||
taskId: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -197,14 +191,30 @@ export default {
|
|||
handleApprove(row) {
|
||||
this.resetDetailForm();
|
||||
this.currentOrderId = row.id;
|
||||
this.processKey=row.processKey
|
||||
this.taskId=row.taskId
|
||||
this.detailLoading = true;
|
||||
this.detailDialogVisible = true;
|
||||
getPurchaseorder(this.currentOrderId).then(response => {
|
||||
this.form = response.data;
|
||||
|
||||
this.handleVendorChange(this.form.vendorId);
|
||||
this.loadApproveHistory(this.currentOrderId); // 加载流转日志
|
||||
this.detailLoading = false;
|
||||
// // 获取 processKey 和 taskId
|
||||
// getTodoDetail({ businessKey: this.form.purchaseNo, processKeyList: ['purchase_order_online'] }).then(res => {
|
||||
// if (res.data) {
|
||||
// this.processKey = res.data.processKey;
|
||||
// this.taskId = res.data.taskId;
|
||||
// } else {
|
||||
// this.$modal.msgWarning("未能获取到待办任务详情!");
|
||||
// }
|
||||
// }).catch(error => {
|
||||
// console.error("获取待办任务详情失败: ", error);
|
||||
// this.$modal.msgError("获取待办任务详情失败!");
|
||||
// }).finally(() => {
|
||||
// this.detailLoading = false;
|
||||
// });
|
||||
|
||||
}).catch(error => {
|
||||
console.error("获取采购订单详情失败: ", error);
|
||||
this.$modal.msgError("获取采购订单详情失败!");
|
||||
|
|
@ -241,41 +251,50 @@ export default {
|
|||
this.approveLogs = [];
|
||||
}
|
||||
},
|
||||
// 打开审批意见对话框
|
||||
openOpinionDialog(type) {
|
||||
this.currentApproveType = type;
|
||||
this.confirmDialogTitle = type === 'approve' ? '同意审批' : '驳回审批';
|
||||
this.opinionDialogVisible = true;
|
||||
this.opinionForm.approveOpinion = ''; // Clear previous opinion
|
||||
this.$nextTick(() => {
|
||||
this.$refs.opinionForm.clearValidate(); // Clear previous validation messages
|
||||
});
|
||||
},
|
||||
// 确认对话框方法
|
||||
showConfirmDialog(type) {
|
||||
showConfirmDialog() {
|
||||
this.$refs.opinionForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.currentApproveType = type;
|
||||
this.confirmDialogTitle = type === 'approve' ? '同意审批' : '驳回审批';
|
||||
this.confirmDetailData = null;
|
||||
this.confirmDialogVisible = true;
|
||||
this.confirmDetailLoading = true;
|
||||
|
||||
// 模拟调用 getTodoDetail
|
||||
setTimeout(() => {
|
||||
this.confirmDetailData = {
|
||||
taskName: "采购单审批流程",
|
||||
assigneeName: "当前用户",
|
||||
applyUserName: this.form.ownerName,
|
||||
applyTime: this.form.createTime,
|
||||
remark: "请尽快处理"
|
||||
};
|
||||
this.confirmDetailLoading = false;
|
||||
}, 500);
|
||||
this.opinionDialogVisible = false; // 关闭意见对话框
|
||||
this.submitApproval(); // 直接提交审批
|
||||
}
|
||||
});
|
||||
},
|
||||
submitApproval() {
|
||||
const action = this.currentApproveType === 'approve' ? '审批通过' : '审批驳回';
|
||||
this.$modal.msgSuccess(action);
|
||||
this.confirmDialogVisible = false;
|
||||
this.detailDialogVisible = false;
|
||||
this.getList(); // 刷新列表
|
||||
const approveBtn = this.currentApproveType === 'approve' ? 1 : 0; // 1:通过, 0:驳回
|
||||
const params = {
|
||||
businessKey: this.form.purchaseNo,
|
||||
processKey: this.processKey,
|
||||
taskId: this.taskId,
|
||||
variables: {
|
||||
comment: this.opinionForm.approveOpinion,
|
||||
approveBtn: approveBtn
|
||||
}
|
||||
};
|
||||
|
||||
approveTask(params).then(response => {
|
||||
this.$modal.msgSuccess(this.confirmDialogTitle + "成功");
|
||||
this.detailDialogVisible = false;
|
||||
this.getList(); // 刷新列表
|
||||
}).catch(error => {
|
||||
console.error("审批失败: ", error);
|
||||
this.$modal.msgError("审批失败!" + error.msg || error.message);
|
||||
});
|
||||
},
|
||||
// 通用方法
|
||||
getStatusText(status) {
|
||||
const textMap = { '1': '审批中', '2': '批准', '3': '驳回' };
|
||||
return textMap[String(status)] || '未知';
|
||||
const textMap = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||
return textMap[String(status)] || '提交审批';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,232 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<h2>已审批列表 (待实现)</h2>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<!-- 搜索表单内容 -->
|
||||
<el-form-item label="采购单号" prop="purchaseNo">
|
||||
<el-input v-model="queryParams.purchaseNo" placeholder="请输入采购单号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="制造商名称" prop="vendorName">
|
||||
<el-input v-model="queryParams.vendorName" placeholder="请输入制造商名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇智负责人" prop="ownerName">
|
||||
<el-input v-model="queryParams.ownerName" placeholder="请输入采购方名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交日期">
|
||||
<el-date-picker
|
||||
v-model="dateRangeApplyTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="purchaseorderList">
|
||||
<!-- 表格列定义 -->
|
||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||
<el-table-column label="采购单号" align="center" prop="purchaseNo" />
|
||||
<el-table-column label="制造商名称" align="center" prop="vendorName"/>
|
||||
<el-table-column label="联系人" align="center" prop="vendorUser" />
|
||||
<el-table-column label="含税总金额" align="center" prop="totalAmount" />
|
||||
<el-table-column label="提交日期" align="center" prop="applyTime" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审批日期" align="center" prop="todoApproveTime" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.todoApproveTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇智负责人" align="center" prop="ownerName" />
|
||||
<el-table-column label="审批节点" align="center" prop="approveNode" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.approveNode || '-' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<!-- 审批详情主对话框 (查看模式) -->
|
||||
<el-dialog title="采购单详情" :visible.sync="detailDialogVisible" width="80%" append-to-body>
|
||||
<div v-loading="detailLoading" style="max-height: 70vh; overflow-y: auto; padding: 20px;">
|
||||
<ApproveLayout title="采购单详情" >
|
||||
<purchase-order-detail-view ref="detailViewOnly" :order-data="form" >
|
||||
</purchase-order-detail-view>
|
||||
<template #footer>
|
||||
<span>订单编号: {{ form.purchaseNo }}</span>
|
||||
</template>
|
||||
</ApproveLayout>
|
||||
|
||||
<el-divider content-position="left">流转意见</el-divider>
|
||||
<div class="process-container">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="log in approveLogs" :key="log.id" :timestamp="log.approveTime" placement="top">
|
||||
<el-card>
|
||||
<h4>{{ log.approveOpinion }}</h4>
|
||||
<p><b>操作人:</b> {{ log.approveUserName }} ({{ log.roleName }})</p>
|
||||
<p><b>审批状态:</b> <el-tag size="small">{{ getStatusText(log.approveStatus) }}</el-tag></p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div v-if="!approveLogs || approveLogs.length === 0">暂无流转过程数据。</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPurchaseorder } from "@/api/sip/purchaseorder";
|
||||
import { listAllVendor } from "@/api/base/vendor";
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
import { listCompletedFlows } from "@/api/flow";
|
||||
import PurchaseOrderDetailView from "@/views/purchaseorder/components/PurchaseOrderDetailView.vue";
|
||||
import ApproveLayout from "@/views/approve/ApproveLayout.vue";
|
||||
// 新增的API接口
|
||||
import { listApprovedPurchaseorder } from "@/api/sip/purchaseorder";
|
||||
|
||||
|
||||
export default {
|
||||
name: "PurchaseOrderApprovedList"
|
||||
name: "PurchaseOrderApprovedList",
|
||||
components: {ApproveLayout, PurchaseOrderDetailView},
|
||||
dicts: ['approve_status', 'vendor_confirm_status', 'purchase_status'],
|
||||
data() {
|
||||
return {
|
||||
// 列表页数据
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
purchaseorderList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
purchaseNo: null,
|
||||
buyerName: null,
|
||||
vendorName: null,
|
||||
ownerName: null,
|
||||
approveStatus: '3', // 已审批状态通常为3
|
||||
params:{
|
||||
applyTimeStart: null,
|
||||
applyTimeEnd: null,
|
||||
}
|
||||
},
|
||||
// 时间范围选择器
|
||||
dateRangeApplyTime: [],
|
||||
detailDialogVisible: false,
|
||||
detailLoading: false,
|
||||
productTypeOptions: [],
|
||||
vendorOptions: [],
|
||||
selectedVendor: {},
|
||||
form: {
|
||||
omsPurchaseOrderItemList: []
|
||||
},
|
||||
approveLogs: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getVendorList();
|
||||
getDicts("product_type").then(response => {
|
||||
this.productTypeOptions = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 列表页方法
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params.applyTimeStart = this.dateRangeApplyTime && this.dateRangeApplyTime.length > 0 ? this.dateRangeApplyTime[0] : null;
|
||||
this.queryParams.params.applyTimeEnd = this.dateRangeApplyTime && this.dateRangeApplyTime.length > 0 ? this.dateRangeApplyTime[1] : null;
|
||||
listApprovedPurchaseorder(this.queryParams).then(response => { // Changed API call
|
||||
this.purchaseorderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.dateRangeApplyTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 详情对话框方法 (查看模式)
|
||||
handleView(row) {
|
||||
this.resetDetailForm();
|
||||
this.currentOrderId = row.id;
|
||||
this.detailLoading = true;
|
||||
this.detailDialogVisible = true;
|
||||
getPurchaseorder(this.currentOrderId).then(response => {
|
||||
this.form = response.data;
|
||||
this.handleVendorChange(this.form.vendorId);
|
||||
this.loadApproveHistory(this.currentOrderId); // 加载流转日志
|
||||
this.detailLoading = false;
|
||||
}).catch(error => {
|
||||
console.error("获取采购订单详情失败: ", error);
|
||||
this.$modal.msgError("获取采购订单详情失败!");
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
resetDetailForm() {
|
||||
this.form = { omsPurchaseOrderItemList: [] };
|
||||
this.selectedVendor = {};
|
||||
this.approveLogs = [];
|
||||
},
|
||||
getVendorList() {
|
||||
listAllVendor().then(res => { this.vendorOptions = res.data; });
|
||||
},
|
||||
handleVendorChange(vendorId) {
|
||||
if (vendorId) {
|
||||
this.selectedVendor = this.vendorOptions.find(item => item.vendorId === vendorId) || {};
|
||||
} else {
|
||||
this.selectedVendor = {};
|
||||
}
|
||||
},
|
||||
loadApproveHistory(id) {
|
||||
const purchaseNo = this.form.purchaseNo; // 假设form中包含purchaseNo
|
||||
if (purchaseNo) {
|
||||
listCompletedFlows({ processKeyList: ['purchase_order_online'], businessKey: purchaseNo }).then(response => {
|
||||
this.approveLogs = response.data;
|
||||
}).catch(error => {
|
||||
console.error("获取流转历史失败: ", error);
|
||||
this.$modal.msgError("获取流转历史失败!");
|
||||
});
|
||||
} else {
|
||||
console.warn("缺少 purchaseNo,无法查询流转历史。");
|
||||
this.approveLogs = [];
|
||||
}
|
||||
},
|
||||
// 通用方法
|
||||
getStatusText(status) {
|
||||
const textMap = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||
return textMap[String(status)] || '提交审批';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.process-container {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div style="max-height: 70vh;overflow-y: auto; padding: 20px;">
|
||||
<div style="overflow-y: auto; padding: 20px;">
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<span id="projectNameBox" style="margin-left: 10px;color: black;font-size: 30px">
|
||||
采购订单
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.approveStatus === '0' "
|
||||
v-if="scope.row.approveStatus === '0' || scope.row.approveStatus === '3'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-s-promotion"
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
>删除
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.approveStatus === '1' || scope.row.approveStatus === '3'"
|
||||
v-if="scope.row.approveStatus === '1'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
|
|
@ -188,7 +188,7 @@
|
|||
direction="rtl"
|
||||
size="80%"
|
||||
>
|
||||
<ApproveLayout title="采购单详情" :style="{ 'max-height': '90vh' }" v-if="showDetailDrawer">
|
||||
<ApproveLayout title="采购单详情" v-if="showDetailDrawer">
|
||||
<purchase-order-detail-view ref="detailViewOnly" :order-data="detailOrderData" @close="showDetailDrawer = false"
|
||||
@success="getList" :showHistory="true"
|
||||
@view-history-detail="handleViewHistoryDetailEvent">
|
||||
|
|
@ -206,7 +206,7 @@
|
|||
direction="rtl"
|
||||
size="80%"
|
||||
>
|
||||
<ApproveLayout title="采购单历史详情" :style="{ 'max-height': '90vh' }" v-if="showHistoryDetailDrawer">
|
||||
<ApproveLayout title="采购单历史详情" v-if="showHistoryDetailDrawer">
|
||||
<purchase-order-detail-view ref="historyDetailView" :order-data="historyDetailOrderData" @close="showHistoryDetailDrawer = false">
|
||||
</purchase-order-detail-view>
|
||||
<template #footer>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
{
|
||||
startPage();
|
||||
List<OmsPurchaseOrder> list = omsPurchaseOrderService.selectOmsPurchaseOrderList(omsPurchaseOrder);
|
||||
clearPage();
|
||||
todoService.fillPurchaseOrderApproveNode(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +63,16 @@ public class OmsPurchaseOrderController extends BaseController
|
|||
todoService.fillPurchaseOrderApproveNode(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@RequiresPermissions("sip:purchaseorder:list")
|
||||
@GetMapping("/approved/list")
|
||||
public TableDataInfo listApproved(OmsPurchaseOrder omsPurchaseOrder)
|
||||
{
|
||||
startPage();
|
||||
List<OmsPurchaseOrder> list = omsPurchaseOrderService.listApproved(omsPurchaseOrder);
|
||||
clearPage();
|
||||
todoService.fillPurchaseOrderApproveNode(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出采购单主表列表
|
||||
|
|
|
|||
|
|
@ -92,8 +92,10 @@ public class OmsPurchaseOrder extends BaseEntity
|
|||
private Integer version;
|
||||
private Long approveUser;
|
||||
private Date applyTime;
|
||||
private Date todoApproveTime;
|
||||
private String processKey;
|
||||
private String todoId;
|
||||
private String taskId;
|
||||
|
||||
|
||||
/** 采购单明细表信息 */
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
|
@ -216,6 +217,12 @@ public class TodoServiceImpl implements TodoService {
|
|||
|
||||
@Override
|
||||
public AjaxResult todoApprove(Todo todo) {
|
||||
List<Todo> todoList = this.selectTodoList(todo);
|
||||
String userId = ShiroUtils.getUserId().toString();
|
||||
long count = todoList.stream().filter(item -> userId.equalsIgnoreCase(item.getApproveUser())).count();
|
||||
if (count<=0){
|
||||
return AjaxResult.error("审批失败,当前审批人无权限审批");
|
||||
}
|
||||
complete(todo);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.sip.mapper;
|
|||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.OmsPurchaseOrder;
|
||||
import com.ruoyi.sip.domain.OmsPurchaseOrderItem;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 采购单主表Mapper接口
|
||||
|
|
@ -93,9 +94,10 @@ public interface OmsPurchaseOrderMapper
|
|||
|
||||
void updateOmsPurchaseOrderByCode(OmsPurchaseOrder omsPurchaseOrder);
|
||||
|
||||
List<OmsPurchaseOrder> listApprove(OmsPurchaseOrder omsPurchaseOrder);
|
||||
List<OmsPurchaseOrder> listApprove(@Param("entity") OmsPurchaseOrder omsPurchaseOrder, @Param("tableName") String tableName);
|
||||
|
||||
OmsPurchaseOrder selectByNo(String businessKey);
|
||||
|
||||
List<OmsPurchaseOrder> listByCodeList(List<String> businessKeyList);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,4 +69,6 @@ public interface IOmsPurchaseOrderService
|
|||
public int deleteOmsPurchaseOrderById(Long id);
|
||||
|
||||
List<OmsPurchaseOrder> listApprove(OmsPurchaseOrder omsPurchaseOrder);
|
||||
|
||||
List<OmsPurchaseOrder> listApproved(OmsPurchaseOrder omsPurchaseOrder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -263,7 +263,14 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To
|
|||
|
||||
@Override
|
||||
public List<OmsPurchaseOrder> listApprove(OmsPurchaseOrder omsPurchaseOrder) {
|
||||
return omsPurchaseOrderMapper.listApprove(omsPurchaseOrder);
|
||||
omsPurchaseOrder.setApproveUser(ShiroUtils.getUserId());
|
||||
return omsPurchaseOrderMapper.listApprove(omsPurchaseOrder,"bu_todo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OmsPurchaseOrder> listApproved(OmsPurchaseOrder omsPurchaseOrder) {
|
||||
omsPurchaseOrder.setApproveUser(ShiroUtils.getUserId());
|
||||
return omsPurchaseOrderMapper.listApprove(omsPurchaseOrder,"bu_todo_completed");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -102,26 +102,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
, t1.purchaser_mobile, t1.purchaser_email, t1.warehouse_id, t1.pay_method, t1.owner_id, t1.owner_name, t1.remark, t1.total_amount
|
||||
, t1.status, t1.approve_status, t1.approve_time, t1.approve_node, t1.confirm_status, t1.create_time, t1.update_time, t1.del_flag,t1.version
|
||||
,t2.vendor_name,t2.vendor_user,t2.vendor_phone
|
||||
,t3.apply_time,t3.process_key,t3.todo_id
|
||||
,t3.apply_time,t3.process_key,t3.todo_id,t3.task_id,t3.approve_time as todo_approve_time
|
||||
from oms_purchase_order t1
|
||||
left join oms_vendor_info t2 on t1.vendor_id = t2.vendor_id
|
||||
inner join bu_todo t3 on t3.process_key in ('purchase_order_online') and t3.business_key=t1.purchase_no
|
||||
inner join ${tableName} t3 on (t3.process_key in ('purchase_order_online') and t3.approve_user=#{entity.approveUser} and t3.task_name!='商务' and t3.business_key=t1.purchase_no)
|
||||
<where>
|
||||
<if test="purchaseNo != null and purchaseNo != ''"> and t1.purchase_no = #{purchaseNo}</if>
|
||||
<if test="vendorName != null "> and t2.vendor_name = #{vendorName}</if>
|
||||
<if test="ownerName != null "> and t1.owner_name = #{ownerName}</if>
|
||||
<if test="approveUser != null "> and t3.approve_user = #{approveUser}</if>
|
||||
<if test="params.applyTimeStart != null and params.applyTimeEnd != ''">
|
||||
<if test="entity.purchaseNo != null and entity.purchaseNo != ''"> and t1.purchase_no = #{entity.purchaseNo}</if>
|
||||
<if test="entity.vendorName != null "> and t2.vendor_name = #{entity.vendorName}</if>
|
||||
<if test="entity.ownerName != null "> and t1.owner_name = #{entity.ownerName}</if>
|
||||
<if test="entity.approveUser != null "> and t3.approve_user = #{entity.approveUser}</if>
|
||||
<if test="entity.params.applyTimeStart != null and entity.params.applyTimeEnd != ''">
|
||||
<choose>
|
||||
<when test="params.applyTimeStart != null and params.applyTimeEnd != null">
|
||||
and t3.apply_time between date_format(#{params.applyTimeStart}, '%Y-%m-%d 00:00:00') and
|
||||
date_format(#{params.applyTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
and t3.apply_time between date_format(#{entity.params.applyTimeStart}, '%Y-%m-%d 00:00:00') and
|
||||
date_format(#{entity.params.applyTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
<when test="params.applyTimeStart != null">
|
||||
and t3.apply_time <![CDATA[ >= ]]> date_format(#{params.applyTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
<when test="entity.params.applyTimeStart != null">
|
||||
and t3.apply_time <![CDATA[ >= ]]> date_format(#{entity.params.applyTimeStart}, '%Y-%m-%d 00:00:00')
|
||||
</when>
|
||||
<when test="params.applyTimeEnd != null">
|
||||
and t3.apply_time <![CDATA[ <= ]]> date_format(#{params.applyTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
<when test="entity.params.applyTimeEnd != null">
|
||||
and t3.apply_time <![CDATA[ <= ]]> date_format(#{entity.params.applyTimeEnd}, '%Y-%m-%d 23:59:59')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
|
|
|
|||
Loading…
Reference in New Issue