修改审核
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:id="form.versions"
|
||||
:status="form.status"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
@ -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>
|
||||
@ -43,13 +37,14 @@
|
||||
</el-form>
|
||||
<el-table :data="tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" default-expand-all border>
|
||||
<el-table-column prop="num" label="编号" />
|
||||
<el-table-column prop="name" label="工程或费用名称" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="unit" label="单位" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<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>
|
||||
@ -98,11 +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 { getKnowledgeDocument } from '@/api/design/technicalStandard';
|
||||
import { getConstructionValue } from '@/api/out/constructionValue';
|
||||
import { workScheduleListDetail } from '@/api/progress/plan';
|
||||
import { sheetList } from '@/api/contract';
|
||||
import { getApproval, getTableList } from '@/api/tender';
|
||||
import { obtainAllVersionNumbers, sheetList, getTableList, updatePrice, importExcelFile, getVersionDetail } from '@/api/tender/index';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
@ -126,21 +117,16 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_bLimitEquipmentList',
|
||||
label: '招标一览审批'
|
||||
label: '招采工程量清单审核'
|
||||
}
|
||||
];
|
||||
const sheets = ref([]);
|
||||
const queryForm = ref({
|
||||
versions: '',
|
||||
sheet: ''
|
||||
});
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const tableData = ref([]);
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
@ -149,15 +135,14 @@ const submitFormData = ref<StartProcessBo>({
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
versions: undefined,
|
||||
sheet: undefined,
|
||||
type: undefined,
|
||||
status: undefined
|
||||
versions: '',
|
||||
sheet: '',
|
||||
status: '',
|
||||
id: ''
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
tableData: [],
|
||||
rules: {}
|
||||
});
|
||||
|
||||
@ -166,57 +151,61 @@ const handleClose = () => {
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
const { form, rules, tableData } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
// const reset = () => {
|
||||
// form.value = { ...initFormData };
|
||||
// leaveFormRef.value?.resetFields();
|
||||
// };
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = async () => {
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(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) {
|
||||
queryForm.value.sheet = res.data[0];
|
||||
} else {
|
||||
queryForm.value.sheet = '';
|
||||
}
|
||||
try {
|
||||
const res = await getTableList(form.value);
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
getApproval(form.value.versions).then((res) => {
|
||||
form.value.status = res.data.status;
|
||||
});
|
||||
if (routeParams.value.type === 'approval') {
|
||||
form.value.id = routeParams.value.id;
|
||||
} else {
|
||||
form.value.id = routeParams.value.id + '_' + routeParams.value.activeTab;
|
||||
}
|
||||
const res = await getVersionDetail(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 getTableList({
|
||||
projectId: currentProject.value?.id,
|
||||
versions: form.value.versions,
|
||||
sheet: form.value.sheet,
|
||||
type: '2'
|
||||
});
|
||||
if (res.code == 200) {
|
||||
tableData.value = res.data;
|
||||
}
|
||||
};
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
@ -231,7 +220,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 使用的流程变量
|
||||
@ -285,20 +274,11 @@ const submit = async (status, data) => {
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
console.log(routeParams.value);
|
||||
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
if (routeParams.value.type === 'approval') {
|
||||
form.value.versions = routeParams.value.id.split('_')[0];
|
||||
form.value.type = routeParams.value.id.split('_')[1];
|
||||
} else {
|
||||
form.value.versions = routeParams.value.id;
|
||||
form.value.type = routeParams.value.activeTab;
|
||||
}
|
||||
getInfo();
|
||||
console.log('routeParams.value', routeParams.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user