Commit 89fdcb2b by Jaxon

feat(采购审核): 新增经理审核功能及相关页面组件

- 添加经理审核状态常量定义及API接口
- 创建经理审核页面、批量审核页面和路由配置
- 扩展审核和驳回弹窗组件以支持经理审核流程
- 实现经理审核列表查询、批量审核和驳回功能
1 parent d188bc4c
......@@ -178,6 +178,11 @@ export function operatorBatchAudit(data) {
data.method = `dj.api.smarcarlife.operatorreview.operatorBatchAudit.json`;
return request(data);
}
// 批量经理审核
export function managerBatchAudit(data) {
data.method = `dj.api.smarcarlife.managerreview.managerAudit.json`;
return request(data);
}
// 运营驳回
export function operatorreviewOperatorReject(data) {
......@@ -215,6 +220,19 @@ export function businessreviewBusinessAudit(data) {
return request(data);
}
// 经理审核
export function managerreviewManagerAudit(data) {
data.method = `${path}managerreview.managerAudit`;
return request(data);
}
// 经理驳回
export function managerReviewReject(data) {
data.method = `${path}managerreview.managerReject`;
return request(data);
}
// 批量商务审核
export function businessBatchAudit(data) {
data.method = `dj.api.smarcarlife.businessreview.businessBatchAudit.json`;
......@@ -322,3 +340,9 @@ export function downloadDeliveryPdf(data) {
data.method = "dj.api.smarcarlife.warehousedeliver.detail.pdf.batch.async";
return request(data, "post");
}
// 经理审核分页查询
export function getManagerReviewPageApi(data) {
data.method = `dj.api.smarcarlife.managerreview.page`;
return request(data);
}
......@@ -517,6 +517,31 @@ export const routerName = {
component: _import("purchase/directorReview"),
},
909080301: {
path: "/directorReview/singleCheck",
name: "singleCheck",
meta: {
title: "审核",
authId: "909080301",
parentId: "90908",
cache: false,
activePath: "/directorReview",
},
component: _import("purchase/singleReview"),
},
909080401: {
path: "/directorReview/singleReject",
name: "singleReject",
meta: {
title: "驳回",
authId: "909080401",
parentId: "90908",
cache: false,
activePath: "/directorReview",
},
component: _import("purchase/singleReview"),
},
90909: {
path: "/managerReview",
name: "managerReview",
......@@ -536,6 +561,23 @@ export const routerName = {
type: "primary",
handle: "handleExport",
},
{
authId: "9090905",
parentId: "90909",
label: "批量审核",
category: "Button",
type: "primary",
handle: "handleBatchCheck",
addRoutePath: [
{
authId: "909090501",
name: "批量审核",
parentId: "90909",
},
],
},
{
authId: "9090902",
parentId: "90909",
......@@ -553,13 +595,6 @@ export const routerName = {
},
},
handle: "handleCheck",
addRoutePath: [
{
authId: "909080301",
name: "审核",
parentId: "90908",
},
],
},
{
authId: "9090904",
......@@ -572,40 +607,20 @@ export const routerName = {
},
},
handle: "handleReject",
addRoutePath: [
{
authId: "909090401",
name: "驳回",
parentId: "90909",
},
],
},
],
component: _import("purchase/directorReview"),
},
909080301: {
path: "/directorReview/singleCheck",
name: "singleCheck",
meta: {
title: "审核",
authId: "909080301",
parentId: "90908",
cache: false,
activePath: "/directorReview",
},
component: _import("purchase/singleReview"),
component: _import("purchase/managerReview"),
},
909080401: {
path: "/directorReview/singleReject",
name: "singleReject",
909090501: {
path: "/managerReview/batchReview",
name: "managerReviewBatchReview",
meta: {
title: "驳回",
authId: "909080401",
parentId: "90908",
title: "批量审核",
authId: "909090501",
parentId: "90909",
cache: false,
activePath: "/directorReview",
activePath: "/managerReview",
},
component: _import("purchase/singleReview"),
component: _import("purchase/managerReviewBatchReview"),
},
};
......@@ -209,7 +209,7 @@
</span>
<span
class="span-txt-two"
v-if="[4, 6, 7, 9].includes(item.status)"
v-if="[4, 6, 7, 9,11].includes(item.status)"
>驳回原因:
<el-tooltip
class="item"
......@@ -256,12 +256,30 @@ import { getShippingEntityInfoAll } from "@api/serviceManage"
import { deepClone, Util } from "@/common/util"
import { baseConfig } from "@/main"
import stockDetailDialog from "@/views/stockManage/components/stockDetailDialog.vue"
import { isFunction } from 'lodash-es'
export default {
name: "CheckDialog",
components: {
stockDetailDialog
},
props: {
fromPage: {
type: String,
default: "procurementReview"
},
checkVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: () => ({})
},
customSubmitApi:{
type:[Boolean,Function],
default: false
},
},
data() {
return {
stockDetailDialogVisible: false,
......@@ -318,7 +336,9 @@ export default {
6: "redSp",
7: "redSp",
8: "greenSp",
9: "redSp"
9: "redSp",
10: 'greenSp',
11: 'redSp'
},
examineStatus: 1,
statusForShow: {
......@@ -328,12 +348,15 @@ export default {
6: { text: "商务审核", status: "驳回" },
7: { text: "采购驳回", status: "驳回" },
8: { text: "总监审核", status: "通过" },
9: { text: "总监审核", status: "驳回" }
9: { text: "总监审核", status: "驳回" },
10: { text: '经理通过', status: '通过' },
11: { text: '经理驳回', status: '驳回' }
},
rejectedForShow: {
1: { rejectedStatus: "采购商户" },
2: { rejectedStatus: "运营审核" },
3: { rejectedStatus: "商务审核" }
3: { rejectedStatus: "商务审核" },
6: { rejectedStatus: "经理审核" },
},
baseConfig,
detailInfo: {
......@@ -421,21 +444,6 @@ export default {
}
}
},
props: {
fromPage: {
type: String,
default: "procurementReview"
},
checkVisible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: () => ({})
}
},
computed: {
visible: {
get() {
......@@ -578,11 +586,13 @@ export default {
params.sendOutMerchantId = infoForm.sendOutMerchantId
params.remark = infoForm.remark
params.orderCode = this.paramsObj.orderCode
const _api =
let _api =
this.fromPage == "procurementBusiness"
? businessreviewBusinessAudit
: operatorreviewOperatorAudit
: operatorreviewOperatorAudit;
if(this.customSubmitApi && isFunction(this.customSubmitApi)){
_api = this.customSubmitApi;
}
_api(params).then((res) => {
this.notice.okTips("操作成功")
this.visible = true
......
......@@ -320,7 +320,9 @@ export default {
6: "redSp",
7: "redSp",
8: "greenSp",
9: "redSp"
9: "redSp",
10: 'greenSp',
11: 'redSp'
},
examineStatus: 1,
statusForShow: {
......@@ -330,12 +332,15 @@ export default {
6: { text: "商务审核", status: "驳回" },
7: { text: "采购驳回", status: "驳回" },
8: { text: "总监审核", status: "通过" },
9: { text: "总监审核", status: "驳回" }
9: { text: "总监审核", status: "驳回" },
10: { text: '经理通过', status: '通过' },
11: { text: '经理驳回', status: '驳回' }
},
rejectedForShow: {
1: { rejectedStatus: "采购商户" },
2: { rejectedStatus: "运营审核" },
3: { rejectedStatus: "商务审核" }
3: { rejectedStatus: "商务审核" },
6: { rejectedStatus: "经理审核" },
},
baseConfig,
detailInfo: {
......@@ -440,7 +445,11 @@ export default {
filterRejectList: {
type: Array,
default: () => [1, 2, 3]
}
},
customSubmitApi:{
type:[Boolean,Function],
default: false
},
},
computed: {
visible: {
......@@ -530,11 +539,13 @@ export default {
params.rejectNode = infoForm.rejectNode
params.rejectCause = infoForm.rejectCause
params.orderCode = this.paramsObj.orderCode
const _api =
let _api =
this.paramsObj.type == "operator"
? operatorreviewOperatorReject
: businessreviewBusinessReject
if(this.customSubmitApi && isFunction(this.customSubmitApi)){
_api = this.customSubmitApi;
}
// purchaseOrderReject(params).then(res => {
_api(params).then((res) => {
this.notice.okTips("驳回成功")
......
......@@ -179,6 +179,58 @@ export const business_statusOptions_table = [
},
];
// 经理审核筛选条件
export const manager_status_options = [
{
id: 2,
label: "待审核",
},
{
id: 5,
label: "已审核",
},
{
id: 6,
label: "已驳回",
},
];
// 经理审核列表展示
export const manager_status_options_table = [
{
id: 2,
label: "待审核",
},
{
id: 5,
label: "已审核",
},
{
id: 8,
label: "已审核",
},
{
id: 10,
label: "已审核",
},
{
id: 6,
label: "已驳回",
},
{
id: 7,
label: "已驳回",
},
{
id: 9,
label: "已驳回",
},
{
id: 11,
label: "已驳回",
},
];
// 总监审核筛选条件
export const director_statusOptions = [
{
......@@ -213,10 +265,6 @@ export const director_statusOptions_table = [
label: "已驳回",
},
{
id: 8,
label: "已审核",
},
{
id: 9,
label: "已驳回",
},
......@@ -320,4 +368,8 @@ export const rejectNodeOptions = [
id: 1,
label: "采购商户",
},
{
id: 6,
label: "经理审核",
},
];
<!-- 采购审核-总监审核 -->
<!-- 采购审核-经理审核 -->
<template>
<d2-container class="container">
<template #header>
......@@ -23,7 +23,13 @@
</template>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" :show-btn-ids="['9090801']" />
<span>
<auth-button category="Button" :show-btn-ids="['9090905']" />
</span>
<span style="margin-left:12px">
<auth-button category="Button" :show-btn-ids="['9090901']" />
</span>
</d2-table-header>
<d2-table ref="purchasementReviewTable"
:search-form="tableSearchForm"
......@@ -43,12 +49,14 @@
<CheckDialog v-if="checkVisible"
:check-visible="checkVisible"
:params-obj="paramsObj"
:custom-submit-api="reviewApi"
@dialogClose="dialogClose">
</CheckDialog>
<RejectDialog v-if="rejectVisible"
:reject-visible="rejectVisible"
:params-obj="paramsObj"
:filter-reject-list="[1]"
:filter-reject-list="[1,2]"
:custom-submit-api="rejectApi"
@dialogClose="dialogClose">
</RejectDialog>
</d2-container>
......@@ -56,13 +64,16 @@
<script>
import { mapActions, mapState } from "vuex";
import { directorReviewPage, getMerchantList, getPurchaseOrderList, operatorreviewOperatorAudit, purchaseOrderCancelOrCheck } from "@/api/purchaseShopping.js";
import { getManagerReviewPageApi, getMerchantList } from "@/api/purchaseShopping.js";
import { deepClone, Util } from "@/common/util";
import CheckDialog from "./components/CheckDialog";
import orderDeatilDialog from "./components/orderDetailDialog";
import rejectDialog from "./components/rejectDialog";
import { defaultDeliveryStatusOptions, defaultPutStatusOptions, director_statusOptions, director_statusOptions_table, purchasingPatternOptions } from "./constant";
import { defaultDeliveryStatusOptions, defaultPutStatusOptions, manager_status_options, manager_status_options_table, purchasingPatternOptions } from "./constant";
import {
managerreviewManagerAudit,
managerReviewReject,
} from "@/api/purchaseShopping.js"
export default {
name: "PurchaseOrder",
components: {
......@@ -72,6 +83,8 @@ export default {
},
data() {
return {
reviewApi:managerreviewManagerAudit,
rejectApi:managerReviewReject,
searchForm: {
status: "",
deliveryStatus: "",
......@@ -111,7 +124,7 @@ export default {
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "director_statusOptions",
optionsName: "manager_status_options",
},
{
label: "发货状态",
......@@ -139,12 +152,14 @@ export default {
maxlength: 50,
},
],
getListApi: directorReviewPage,
getListApi: getManagerReviewPageApi,
// 表格参数
tableParams: {
btnId: new Date().getTime() + Number.parseInt(Math.random() * 1000),
listName: "list",
tableOption: true,
mutiSelectUniqueKey: "id",
mutiSelectName: "list",
tableColumns: [
{
label: "订单编号",
......@@ -215,16 +230,21 @@ export default {
label: "订单状态",
prop: "status",
formatter: (cellValue) => {
return director_statusOptions_table.find(item => item.id == cellValue.status)?.label || "-";
return manager_status_options_table.find(item => item.id == cellValue.status)?.label || "-";
},
className: (cellValue) => {
return {
// 2 待审核
2: "yellowSpot",
// 5 8 10已审核
5: "greenSpot",
8: "greenSpot",
10: "greenSpot",
// 6 7 9 11已驳回
6: "redSpot",
7: "redSpot",
8: "greenSpot",
9: "redSpot",
11: "redSpot",
}[cellValue.status];
},
},
......@@ -237,10 +257,10 @@ export default {
checkVisible: false,
// 基本数据
baseData: {
director_statusOptions: [],
manager_status_options: [],
defaultDeliveryStatusOptions: [],
defaultPutStatusOptions: [],
director_statusOptions_table: [],
manager_status_options_table: [],
},
paramsObj: {},
};
......@@ -270,11 +290,11 @@ export default {
label: "全部",
};
this.baseData = {
director_statusOptions: deepClone(director_statusOptions),
manager_status_options: deepClone(manager_status_options),
defaultDeliveryStatusOptions: deepClone(defaultDeliveryStatusOptions),
defaultPutStatusOptions: deepClone(defaultPutStatusOptions),
purchasingPatternOptions: deepClone(purchasingPatternOptions),
director_statusOptions_table: deepClone(director_statusOptions_table),
manager_status_options_table: deepClone(manager_status_options_table),
};
this.showFormData.forEach((item, index) => {
if (item.type === "select" && this.baseData[item.optionsName]) {
......@@ -314,9 +334,9 @@ export default {
delete this.tableSearchForm.placeOrderTimeStr;
if (this.tableSearchForm.statuses) {
if (this.tableSearchForm.statuses == 5) {
this.tableSearchForm.statuses = [5, 8];
this.tableSearchForm.statuses = [5, 8, 10];
} else if (this.tableSearchForm.statuses == 6) {
this.tableSearchForm.statuses = [6, 7, 9];
this.tableSearchForm.statuses = [6, 7, 9, 11];
} else {
this.tableSearchForm.statuses = [this.tableSearchForm.statuses];
}
......@@ -344,12 +364,11 @@ export default {
delete params[key];
}
}
params.method = "dj.api.life.directorreview.exportExcel.async";
params.method = "dj.api.life.managerreview.exportExcel.async";
const list = [
...this.dowloadList,
{
// name: '采购审核',
name: "运营审核",
name: "经理审核",
exportParam: JSON.stringify(params),
status: "waiting",
timeid: new Date().getTime(),
......@@ -357,19 +376,45 @@ export default {
];
this.actionSetDownloadList({ list, type: "dowloadList" });
},
// 审核
handleCheck(row) {
// this.checkVisible = !this.checkVisible
// this.paramsObj = row
// 批量审核
handleBatchCheck() {
let selectedData = this.$refs?.purchasementReviewTable?.mutiSelectArr[this.tableParams.mutiSelectName] || [];
if (selectedData.length == 0) {
this.$message({
message: "请选择要批量审核的订单",
type: "warning",
});
return true;
}
console.log(selectedData, "selectedData");
let list = [];
selectedData.forEach((item) => {
list.push({
orderCode: item.orderCode,
merchantId: item.merchantId,
merchantName: item.merchantName,
totalPrice: item.totalPrice,
orderTime: item.orderTime,
sendOutMerchantId: item.sendOutMerchantId,
sendOutMerchantName: item.sendOutMerchantName,
remark: "",
});
});
this.$router.push({
path: "/directorReview/singleCheck",
name: "managerReviewBatchReview",
query: {
fromPage: "directorReview",
pageType: "check",
paramsObj: row,
fromPage: "procurementReview",
list,
},
});
},
// 审核
handleCheck(row) {
this.checkVisible = !this.checkVisible;
this.paramsObj = row;
},
// 查看详情
handleDetail(row) {
this.paramsObj = {
......@@ -381,19 +426,11 @@ export default {
},
// 驳回
handleReject(row) {
// this.paramsObj = {
// orderCode: row.orderCode,
// type: 'operator'
// }
// this.rejectVisible = true
this.$router.push({
path: "/directorReview/singleReject",
query: {
fromPage: "directorReview",
pageType: "reject",
paramsObj: row,
},
});
this.paramsObj = {
orderCode: row.orderCode,
type: "operator",
};
this.rejectVisible = true;
},
dialogClose(obj) {
this[obj.attrName] = !this[obj.attrName];
......
<template>
<d2-container v-loading="loading">
<div v-for="(item, index) in selectList"
:key="index"
class="edit-page edit-tmpl"
style="padding: 20px">
<glsx-combi-form :ref="`editFormRef${index}`"
class="edit-form-container"
label-width="150px"
default-width="414px"
:form-ref="editChildRef"
:form-obj="item"
:form-data="editFormData"
:form-rules="formRules">
</glsx-combi-form>
</div>
<div class="footer">
<el-button type="primary"
:loading="loading"
@click="handleConfirm">
确定
</el-button>
<el-button @click="handleCancel">
取消
</el-button>
</div>
</d2-container>
</template>
<script>
import { getShippingEntityInfoAll } from "@api/serviceManage";
import {
managerBatchAudit,
} from "@/api/purchaseShopping.js";
import { deepClone, Util } from "@/common/util";
export default {
name: "BatchReview",
data() {
const editItemStyle = {
width: "50%",
marginRight: "0px",
};
const lineItemStyle = {
width: "100%",
marginRight: "0px",
};
return {
loading: false,
editChildRef: "editChildRef",
formRules: {
sendOutMerchantId: [
{ required: true, message: "请选择发货主体", trigger: "change" },
],
},
selectList: [],
editFormData: [
{
label: "订单编号",
name: "orderCode",
type: "showTxt",
style: editItemStyle,
},
{
label: "下单门店",
name: "merchantName",
type: "showTxt",
style: editItemStyle,
},
{
label: "订单总价/元",
name: "totalPrice",
type: "showTxt",
style: editItemStyle,
formatter: (cellValue) => {
return "¥" + cellValue.totalPrice;
},
},
{
label: "下单时间",
name: "orderTime",
type: "showTxt",
style: editItemStyle,
formatter: (cellValue) => {
return cellValue.orderTime ? Util.dateFormate(cellValue.orderTime, "YYYY-MM-DD HH:mm:ss") : "--";
},
},
{
label: "运营审核时间",
name: "operatorReviewDate",
type: "showTxt",
isHide: true,
style: editItemStyle,
formatter: (cellValue) => {
return cellValue.operatorReviewDate ? Util.dateFormate(cellValue.operatorReviewDate, "YYYY-MM-DD HH:mm:ss") : "--";
},
},
{
label: "发货主体",
name: "sendOutMerchantId",
isHide: true,
style: lineItemStyle,
type: "select",
optionList: [],
optionId: "shippingEntityId",
optionLabel: "shippingEntity",
optionsName: "shippingEntityList",
},
{
label: "备注",
name: "remark",
type: "input",
placeholder: "请输入",
style: lineItemStyle,
inputType: "textarea",
maxlength: "200",
rows: 4,
showLimit: true,
},
],
baseData: {
shippingEntityList: [],
},
};
},
mounted() {
this.fromPage = this.$route.query.fromPage || "procurementReview";
this.selectList = deepClone(this.$route.query.list || "[]");
this.showOrHideAttr("editFormData", "发货主体", this.fromPage == "procurementBusiness");
this.showOrHideAttr("editFormData", "运营审核时间", this.fromPage == "procurementReview");
this.getShippingEntityInfoAll();
},
methods: {
showOrHideAttr(formName, label, isHide) {
const idx = this[formName].findIndex(item => item.label == label);
this[formName][idx].isHide = isHide;
},
getShippingEntityInfoAll() {
// 获取发货主体数据
getShippingEntityInfoAll({}).then((res) => {
this.baseData.shippingEntityList = res || [];
this.getOptionsList("editFormData", false);
});
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
let item = this[formName].find(k => k.name == refreshSigle);
let index = this[formName].findIndex(k => k.name == refreshSigle);
this.$set(this[formName][index], "optionList", deepClone(this.baseData[item.optionsName]));
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== "全部") {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
} else {
this[formName].forEach((item, index) => {
if (["select", "radio"].includes(item.type) && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], "optionList", deepClone(this.baseData[item.optionsName]));
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== "全部") {
const temp = {};
temp[this[formName][index].optionId] = "";
temp[this[formName][index].optionLabel] = "全部";
this[formName][index].optionList.unshift(temp);
}
}
});
}
},
handleConfirm() {
if (this.loading) {
return true;
}
const _api = managerBatchAudit;
this.loading = true;
const params = {
json: JSON.stringify({ auditList: this.selectList }),
};
_api(params).then((res) => {
this.notice.okTips("批量审核成功");
this.handleCancel();
}).finally(() => {
this.loading = false;
});
},
// 取消按钮返回列表页
handleCancel() {
this.$router.push({
name: "managerReview",
});
},
},
};
</script>
<style lang="scss" scoped>
.edit-page.edit-tmpl {
margin: 0 20px 20px;
background: #ffffff;
.title {
height: 50px;
line-height: 50px;
padding: 0 20px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
font-weight: 600;
color: #333333;
}
}
::v-deep .el-form-item--small .el-form-item__label,
::v-deep .el-form-item--small .el-form-item__content {
line-height: 20px;
}
.edit-tmpl {
.add-mer-btn {
margin-left: 12px;
}
}
.footer {
text-align: center;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!