1.1.3 合同订单待办查看权限改为项目经理与合同激活创建人,添加项目经理筛选。

dev
yinq 4 weeks ago
parent 832a591422
commit 171148e2ee

@ -15,6 +15,19 @@ export const listContractOrder = (query?: ProjectInfoQuery): AxiosPromise<Projec
});
};
/**
*
* @param query
* @returns {*}
*/
export const listContractOrderTodo = (query?: ProjectInfoQuery): AxiosPromise<ProjectInfoVO[]> => {
return request({
url: '/oa/erp/contractOrder/todoList',
method: 'get',
params: query
});
};
/**
*
* @param data

@ -16,6 +16,11 @@
<el-form-item label="合同名称" prop="contractName">
<el-input v-model="queryParams.contractName" placeholder="请输入合同名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="项目经理" prop="managerId">
<el-select v-model="queryParams.managerId" placeholder="请选择项目经理" clearable filterable>
<el-option v-for="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
</el-select>
</el-form-item>
<el-form-item label="订单状态" prop="projectStatus">
<el-select v-model="queryParams.projectStatus" placeholder="请选择订单状态" clearable>
<el-option v-for="dict in project_status" :key="dict.value" :label="dict.label" :value="dict.value" />
@ -39,14 +44,13 @@
<el-card shadow="never">
<el-table v-loading="loading" border :data="tableList" class="data-table">
<el-table-column label="序号" type="index" align="center" width="70" />
<el-table-column label="有无合同" align="center" prop="contractFlag" width="110">
<template #default="scope">
<dict-tag :options="contract_flag" :value="scope.row.contractFlag" />
</template>
</el-table-column>
<el-table-column label="订单编号" align="center" prop="projectCode" width="160" show-overflow-tooltip />
<el-table-column label="订单名称" align="center" prop="projectName" width="200">
<template #default="scope">
<el-link type="primary" underline @click="handleOrderLedger(scope.row)">
@ -54,78 +58,58 @@
</el-link>
</template>
</el-table-column>
<el-table-column label="合同编号" align="center" prop="contractCode" width="160" />
<el-table-column label="合同名称" align="center" prop="contractName" width="220" show-overflow-tooltip />
<el-table-column label="业务方向" align="center" prop="businessDirection" width="120">
<template #default="scope">
<dict-tag :options="business_direction" :value="scope.row.businessDirection" />
</template>
</el-table-column>
<el-table-column label="订单类别" align="center" prop="projectCategory" width="150">
<template #default="scope">
<dict-tag :options="project_category" :value="scope.row.projectCategory" />
</template>
</el-table-column>
<el-table-column label="备件标识" align="center" prop="spareFlag" width="120">
<template #default="scope">
<dict-tag :options="spare_flag" :value="scope.row.spareFlag" />
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" prop="paymentMethod" width="120" />
<el-table-column label="部门" align="center" prop="deptName" width="120" />
<el-table-column label="项目经理" align="center" prop="managerName" width="110" />
<el-table-column label="部门负责人" align="center" prop="chargeName" width="120" />
<el-table-column label="分管副总" align="center" prop="deputyName" width="110" />
<el-table-column label="金额" align="center" prop="amount" width="120">
<template #default="scope">
{{ scope.row.amount != null ? formatNumber(scope.row.amount) : '-' }}
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="projectStatus" width="120">
<template #default="scope">
<dict-tag :options="project_status" :value="scope.row.projectStatus" />
</template>
</el-table-column>
<el-table-column label="流程状态" align="center" prop="flowStatus" width="120">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.flowStatus" />
</template>
</el-table-column>
<el-table-column label="采购状态" align="center" prop="orderPurchaseStatus" width="120">
<template #default="scope">
<dict-tag :options="order_purchase_status" :value="scope.row.orderPurchaseStatus" />
</template>
</el-table-column>
<el-table-column label="发货状态" align="center" prop="orderDeliveryStatus" width="120">
<template #default="scope">
<dict-tag :options="order_delivery_status" :value="scope.row.orderDeliveryStatus" />
</template>
</el-table-column>
<el-table-column label="开票状态" align="center" prop="orderInvoiceStatus" width="120">
<template #default="scope">
<dict-tag :options="order_invoice_status" :value="scope.row.orderInvoiceStatus" />
</template>
</el-table-column>
<el-table-column label="回款百分比" align="center" prop="orderPaymentRate" width="130">
<template #default="scope">
{{ scope.row.orderPaymentRate != null ? scope.row.orderPaymentRate : 0 }}%
</template>
</el-table-column>
<el-table-column label="备件标识" align="center" prop="spareFlag" width="120">
<template #default="scope">
<dict-tag :options="spare_flag" :value="scope.row.spareFlag" />
</template>
</el-table-column>
<el-table-column label="付款方式" align="center" prop="paymentMethod" width="120" />
<el-table-column label="部门" align="center" prop="deptName" width="120" />
<el-table-column label="部门负责人" align="center" prop="chargeName" width="120" />
<el-table-column label="分管副总" align="center" prop="deputyName" width="110" />
<el-table-column label="金额" align="center" prop="amount" width="120">
<template #default="scope">
{{ scope.row.amount != null ? formatNumber(scope.row.amount) : '-' }}
</template>
</el-table-column>
<el-table-column label="订单状态" align="center" prop="projectStatus" width="120">
<template #default="scope">
<dict-tag :options="project_status" :value="scope.row.projectStatus" />
</template>
</el-table-column>
<el-table-column label="流程状态" align="center" prop="flowStatus" width="120">
<template #default="scope">
<dict-tag :options="wf_business_status" :value="scope.row.flowStatus" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" min-width="160" show-overflow-tooltip />
<el-table-column label="激活标识" align="center" prop="activeFlag" width="120">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag" />
@ -144,7 +128,6 @@
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
</template>
@ -152,15 +135,15 @@
<script setup lang="ts" name="ContractOrderTodoIndex">
import { reactive, ref, getCurrentInstance, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { listContractOrder } from '@/api/oa/erp/contractOrder';
import { listContractOrderTodo } from '@/api/oa/erp/contractOrder';
import { ProjectInfoVO, ProjectInfoQuery } from '@/api/oa/erp/projectInfo/types';
import type { FormInstance } from 'element-plus';
import { useUserStore } from '@/store/modules/user';
import { getUserList } from '@/api/system/user';
import { UserQuery, UserVO } from '@/api/system/user/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const router = useRouter();
const userStore = useUserStore();
const {
business_direction,
@ -182,27 +165,19 @@ const todoType = ref<TodoType>('purchase');
const loading = ref(true);
const tableList = ref<ProjectInfoVO[]>([]);
const total = ref(0);
const allList = ref<ProjectInfoVO[]>([]);
const todoCounts = reactive({
purchase: 0,
shipping: 0,
invoice: 0,
payment: 0
});
const showSearch = ref(true);
const queryFormRef = ref<FormInstance>();
const userList = ref<UserVO[]>([]);
const queryParams = reactive<any>({
pageNum: 1,
pageSize: 10,
// 仿 contractOrderIndex
projectCode: undefined,
projectName: undefined,
contractCode: undefined,
contractName: undefined,
managerId: undefined,
projectStatus: undefined
} as ProjectInfoQuery);
@ -211,8 +186,6 @@ const formatNumber = (num: number) => {
return Number(num).toFixed(2);
};
const getCurrentUserId = () => String(userStore.userId ?? '').trim();
/** 字典:采购 4=已采购;发货 3=已发货;开票 3=已开票。待办 = 未完成态(不等于完成值,空值视为未完成) */
const norm = (v: unknown) => (v === null || v === undefined ? '' : String(v).trim());
@ -230,18 +203,32 @@ const getTodoFilteredList = (type: TodoType, source: ProjectInfoVO[]) => {
return source.filter((item) => Number(item.orderPaymentRate ?? 0) < 100);
};
const applyCurrentTodoPage = () => {
const currentList = getTodoFilteredList(todoType.value, allList.value);
total.value = currentList.length;
const start = (queryParams.pageNum - 1) * queryParams.pageSize;
tableList.value = currentList.slice(start, start + queryParams.pageSize);
};
const todoListMap = ref<Record<TodoType, ProjectInfoVO[]>>({
purchase: [],
shipping: [],
invoice: [],
payment: []
});
const applyTodoCounts = () => {
todoCounts.purchase = getTodoFilteredList('purchase', allList.value).length;
todoCounts.shipping = getTodoFilteredList('shipping', allList.value).length;
todoCounts.invoice = getTodoFilteredList('invoice', allList.value).length;
todoCounts.payment = getTodoFilteredList('payment', allList.value).length;
const todoCounts = reactive({
purchase: 0,
shipping: 0,
invoice: 0,
payment: 0
});
const applyTodoData = () => {
todoListMap.value = {
purchase: getTodoFilteredList('purchase', allList.value),
shipping: getTodoFilteredList('shipping', allList.value),
invoice: getTodoFilteredList('invoice', allList.value),
payment: getTodoFilteredList('payment', allList.value)
};
todoCounts.purchase = todoListMap.value.purchase.length;
todoCounts.shipping = todoListMap.value.shipping.length;
todoCounts.invoice = todoListMap.value.invoice.length;
todoCounts.payment = todoListMap.value.payment.length;
tableList.value = todoListMap.value[todoType.value] || [];
};
const getEditPathByCategory = () => {
@ -283,36 +270,27 @@ const handleUpdate = (row?: ProjectInfoVO) => {
};
const refreshAllList = async () => {
const userId = getCurrentUserId();
const res: any = await listContractOrder({
pageNum: 1,
pageSize: 9999,
// LongSpring Long Number()
createBy: userId || undefined,
const res: any = await listContractOrderTodo({
projectCode: queryParams.projectCode,
projectName: queryParams.projectName,
contractCode: queryParams.contractCode,
contractName: queryParams.contractName,
managerId: queryParams.managerId,
projectStatus: queryParams.projectStatus
} as ProjectInfoQuery);
const rows: ProjectInfoVO[] = res.rows || [];
/**
* 合同订单列表 VOErpProjectInfoVo历史上未包含 createBy接口有数据时前端若再按 createBy 过滤会全部被剔除
* 已传 createBy 时由后端过滤直接使用 rows未登录用户 ID 时列表为空
*/
if (userId) {
allList.value = rows;
} else {
allList.value = [];
}
allList.value = res.data || [];
};
const loadUserList = async () => {
const res = await getUserList({} as UserQuery);
userList.value = res.data || [];
};
const getList = async () => {
loading.value = true;
try {
await refreshAllList();
applyTodoCounts();
applyCurrentTodoPage();
applyTodoData();
} finally {
loading.value = false;
}
@ -320,12 +298,10 @@ const getList = async () => {
const handleTodo = async (type: TodoType) => {
todoType.value = type;
queryParams.pageNum = 1;
applyCurrentTodoPage();
tableList.value = todoListMap.value[todoType.value] || [];
};
const handleQuery = () => {
queryParams.pageNum = 1;
getList();
};
@ -335,6 +311,7 @@ const resetQuery = () => {
};
onMounted(() => {
loadUserList();
getList();
});
</script>

Loading…
Cancel
Save