修改审核

This commit is contained in:
ljx
2025-08-25 20:15:09 +08:00
parent fceb454b2a
commit 5f42c21467
11 changed files with 674 additions and 181 deletions

View File

@ -16,26 +16,20 @@
<!-- 表单区域 -->
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
<h3 class="text-lg font-semibold text-gray-800">限价审核</h3>
<h3 class="text-lg font-semibold text-gray-800">限价审核</h3>
</div>
<div class="p-6">
<el-form
ref="leaveFormRef"
v-loading="loading"
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
:model="form"
:rules="rules"
label-width="100px"
class="space-y-4"
>
<el-form ref="leaveFormRef" v-loading="loading" :model="form" :rules="rules" label-width="100px" class="space-y-4">
<div class="grid grid-cols-1 gap-4">
<el-row>
<el-col :span="12">
<el-form-item label="版本号" prop="formNo">
<el-input disabled v-model="form.versions" placeholder="请输入文件名称" />
<el-input :disabled="true" v-model="form.versions" placeholder="请输入文件名称" />
</el-form-item>
<el-form-item label="表名" prop="formNo">
<el-input disabled v-model="form.sheet" placeholder="请输入文件名称" />
<el-form-item label="表名" prop="sheet">
<el-select v-model="form.sheet" placeholder="选择表名" @change="changeSheet">
<el-option v-for="item in sheets" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
</el-col>
</el-row>
@ -50,7 +44,7 @@
<el-table-column prop="unitPrice" label="单价" align="center" />
<el-table-column prop="price" label="总价" align="center">
<template #default="scope">
{{ scope.row.price }}
{{ scope.row.price != 0 ? Number(scope.row.price).toFixed(2) : null }}
</template>
</el-table-column>
</el-table>
@ -99,7 +93,7 @@ import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
const { proxy } = getCurrentInstance() as any;
import { useUserStoreHook } from '@/store/modules/user';
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
import { listBillofquantitiesLimitList } from '@/api/contract/index';
import { listBillofquantitiesLimitList, getVersionDetails, sheetList } from '@/api/contract/index';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
@ -143,7 +137,8 @@ const taskVariables = ref<Record<string, any>>({});
const initFormData = {
versions: '',
sheet: '',
status: ''
status: '',
id: ''
};
const data = reactive({
form: { ...initFormData },
@ -169,21 +164,47 @@ const getInfo = () => {
loading.value = true;
buttonLoading.value = false;
nextTick(async () => {
const res = await listBillofquantitiesLimitList({
projectId: routeParams.value?.id,
versions: routeParams.value.versions,
sheet: routeParams.value.sheet
});
console.log('res.data', res.data);
Object.assign(form.value, routeParams.value);
console.log('form', form.value);
tableData.value = res.data;
console.log('tableData', tableData.value);
const res = await getVersionDetails(routeParams.value.id);
console.log(res);
Object.assign(form.value, res.data);
loading.value = false;
buttonLoading.value = false;
getSheetName();
});
};
const sheets = ref([]);
//获取表名
const getSheetName = async () => {
try {
const params = {
projectId: currentProject.value?.id,
versions: form.value.versions
};
const res = await sheetList(params);
if (res.code == 200) {
sheets.value = res.data;
if (res.data.length > 0) {
form.value.sheet = res.data[0];
}
getListTable();
}
} catch (error) {}
};
//选择表名
const changeSheet = () => {
getListTable();
};
//获取列表
const getListTable = async () => {
const res = await listBillofquantitiesLimitList({
projectId: currentProject.value?.id,
versions: form.value.versions,
sheet: form.value.sheet
});
if (res.code == 200) {
tableData.value = res.data;
}
};
/** 提交按钮 */
const submitForm = (status1: string) => {
status.value = status1;
@ -198,7 +219,7 @@ const submitFlow = async () => {
const handleStartWorkFlow = async (data: any) => {
try {
submitFormData.value.flowCode = flowCode.value;
submitFormData.value.businessId = data.versions + '_xianjiayilan';
submitFormData.value.businessId = data.id;
//流程变量
taskVariables.value = {
// leave4/5 使用的流程变量
@ -216,7 +237,7 @@ const handleStartWorkFlow = async (data: any) => {
};
//审批记录
const handleApprovalRecord = () => {
approvalRecordRef.value.init(form.value.versions);
approvalRecordRef.value.init(form.value.id);
};
//提交回调
const submitCallback = async () => {
@ -255,7 +276,6 @@ onMounted(() => {
reset();
loading.value = false;
console.log(routeParams.value);
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
getInfo();
console.log('routeParams.value', routeParams.value);