This commit is contained in:
2025-08-21 18:38:42 +08:00
5 changed files with 142 additions and 113 deletions

View File

@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台
VITE_APP_ENV = 'development'
# 开发环境
VITE_APP_BASE_API = 'http://192.168.110.213:8899'
VITE_APP_BASE_API = 'http://192.168.110.149:8899'
# 无人机接口地址

View File

@ -53,3 +53,18 @@ export const sheetList = (query) => {
params: query
});
};
//获取sheet
export const obtainAllVersionNumbers = (query) => {
return request({
url: '/bidding/biddingLimitList/obtainAllVersionNumbers',
method: 'get',
params: query
});
};
//获取sheet
export const getVersionDetail = (id) => {
return request({
url: '/bidding/biddingLimitList/getVersionDetail/' + id,
method: 'get'
});
};

View File

@ -11,9 +11,7 @@
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false">
关闭
</el-button>
<el-button type="primary" @click="dialogVisible = false"> 关闭 </el-button>
</div>
</template>
</el-dialog>
@ -25,28 +23,26 @@
</div>
</template>
</el-dialog>
</template>
<script setup>
const { proxy } = getCurrentInstance();
const dialogVisible = defineModel();
const props = defineProps(['fileList'])
const viewFileVisible = ref(false)
const fileUrl = ref('')
const props = defineProps(['fileList']);
const viewFileVisible = ref(false);
const fileUrl = ref('');
const downloadFile = async (data) => {
// 这里可以添加下载文件的逻辑
await proxy?.download(data.fileUrl, {}, data.fileName);
proxy?.$message({
message: '下载成功',
type: 'success'
});
await proxy?.downloadFile(data.fileUrl, data.fileName);
// proxy?.$message({
// message: '下载成功',
// type: 'success'
// });
};
const viewFile = (data) => {
// 这里可以添加查看文件的逻辑
fileUrl.value = data.fileUrl;
viewFileVisible.value = true;
}
};
const adjustIframe = () => {
const iframe = document.querySelector('iframe');
if (iframe) {

View File

@ -3,6 +3,11 @@
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<el-card shadow="always">
<el-form :model="queryForm" :inline="true">
<el-form-item label="版本号" prop="versions">
<el-select v-model="queryForm.versions" placeholder="选择版本号" @change="changeVersions">
<el-option v-for="item in options" :key="item.id" :label="item.versions" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="表名" prop="sheet">
<el-select v-model="queryForm.sheet" placeholder="选择表名" @change="changeSheet">
<el-option v-for="item in sheets" :key="item" :label="item" :value="item" />
@ -28,7 +33,24 @@
<el-button type="primary" @click="handleExport()" v-hasPermi="['bidding:biddingLimitList:export']">导出excel</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Edit" @click="handleAudit" v-hasPermi="['desibiddinggn:biddingLimitList:query']">审核</el-button>
<el-button
type="primary"
v-if="versionObj.status == 'draft' || versionObj.status == 'back'"
icon="Edit"
@click="handleAudit"
v-hasPermi="['desibiddinggn:biddingLimitList:query']"
>审核</el-button
>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="view"
@click="handleViewInfo"
v-hasPermi="['desibiddinggn:biddingLimitList:query']"
v-if="versionObj.status != 'draft'"
>查看流程</el-button
>
</el-form-item>
</el-form>
</el-card>
@ -75,8 +97,7 @@
<script setup lang="ts">
import { useUserStoreHook } from '@/store/modules/user';
import { obtainAllVersionNumbers } from '@/api/contract/index';
import { BiddingImportExcelFile, getTreeLimit, biddingLimitListUpdate, sheetList } from '@/api/bidding/biddingLimit';
import { BiddingImportExcelFile, getTreeLimit, biddingLimitListUpdate, sheetList, obtainAllVersionNumbers } from '@/api/bidding/biddingLimit';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userStore = useUserStoreHook();
@ -90,7 +111,8 @@ const options = ref<any[]>([]);
const sheets = ref<any[]>([]);
const tableData = ref<any[]>([]);
const isExpandAll = ref(true);
const versionObj = ref({});
const versionMap = new Map();
//获取版本号
const getVersionNums = async () => {
try {
@ -99,15 +121,19 @@ const getVersionNums = async () => {
pageSize: 1000,
pageNum: 1
};
const res = await obtainAllVersionNumbers(params);
if (res.code == 200) {
options.value = res.data;
if (res.data.length > 0) {
queryForm.value.versions = res.data[0];
res.data.forEach((item: any) => {
versionMap.set(item.versions, item);
});
queryForm.value.versions = res.data[0].versions;
versionObj.value = res.data[0];
getSheetName();
} else {
queryForm.value.versions = '';
versionObj.value = {};
}
}
} catch (error) {
@ -115,7 +141,7 @@ const getVersionNums = async () => {
}
};
//选择版本号
const changeVersions = () => {
const changeVersions = (val) => {
getSheetName();
};
@ -127,8 +153,8 @@ const changeSheet = () => {
//获取表名
const getSheetName = async () => {
const params = {
projectId: currentProject.value?.id
// versions: queryForm.value.versions
projectId: currentProject.value?.id,
versions: queryForm.value.versions
};
const res = await sheetList(params);
if (res.code == 200) {
@ -151,7 +177,11 @@ const getTableData = async () => {
const res = await getTreeLimit(params);
loading.value = false;
if (res.code == 200) {
if (res.data && res.data.length > 0) {
tableData.value = [res.data[0]];
} else {
tableData.value = [];
}
}
};
//修改单价
@ -214,6 +244,7 @@ const listeningProject = watch(
() => currentProject.value?.id,
(nid, oid) => {
getVersionNums();
// getSheetName();
}
);
const handleExport = () => {
@ -227,24 +258,39 @@ const handleExport = () => {
);
};
// 审核
const handleAudit = (row: any) => {
console.log(11111);
// proxy.$tab.closePage(proxy.$route);
// proxy.$router.push({
// path: `/approval/biddingLimit/indexEdit`,
// query: {
// id: row.id,
// type: 'add'
// }
// });
const handleAudit = () => {
proxy.$tab.closePage(proxy.$route);
let id = versionMap.get(queryForm.value.versions).id;
proxy.$router.push({
path: `/approval/biddingLimit/indexEdit`,
query: {
id,
type: 'add',
sheets: sheets.value,
versions: versionObj.value
}
});
};
// 查看审核
const handleViewInfo = () => {
proxy.$tab.closePage(proxy.$route);
let id = versionMap.get(queryForm.value.versions).id;
proxy.$router.push({
path: `/approval/biddingLimit/indexEdit`,
query: {
id,
type: 'view',
sheets: sheets.value,
versions: versionObj.value
}
});
};
onUnmounted(() => {
listeningProject();
});
onMounted(() => {
getSheetName();
getVersionNums();
// getSheetName();
});
</script>

View File

@ -19,17 +19,10 @@
<h3 class="text-lg font-semibold text-gray-800">成本核算清单</h3>
</div>
<div class="p-6">
<el-form
ref="leaveFormRef"
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
:model="form"
:rules="rules"
label-width="100px"
class="space-y-4"
>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<el-form-item label="表格文件" prop="fileId" class="mb-2 md:col-span-2">
<input type="text" :value="form.fileId" class="w-full" readonly />
<el-form ref="leaveFormRef" disabled :model="form" :rules="rules" label-width="100px" class="space-y-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4" v-for="item in sheets" :key="item">
<el-form-item label="表格文件">
<span style="color: #8d8d8d">{{ item }}</span>
</el-form-item>
</div>
</el-form>
@ -77,8 +70,7 @@ import ApprovalButton from '@/components/Process/approvalButton.vue';
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { useUserStoreHook } from '@/store/modules/user';
import { getDrawing } from '@/api/design/drawing';
import { updateDesignChange, getDesignChange } from '@/api/design/designChange';
import { getVersionDetail } from '@/api/bidding/biddingLimit';
// 获取用户 store
const userStore = useUserStoreHook();
@ -107,7 +99,8 @@ const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
//按钮组件
const approvalButtonRef = ref<InstanceType<typeof ApprovalButton>>();
const sheets = ref([]);
const versions = ref({});
const leaveFormRef = ref<ElFormInstance>();
const dialog = reactive({
visible: false,
@ -135,18 +128,6 @@ const initFormData = {
};
const data = reactive({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value?.id,
fileName: undefined,
fileType: undefined,
fileSuffix: undefined,
fileStatus: undefined,
originalName: undefined,
newest: undefined,
params: {}
},
rules: {}
});
@ -168,7 +149,7 @@ const getInfo = () => {
loading.value = true;
buttonLoading.value = false;
nextTick(async () => {
const res = await getDesignChange(routeParams.value.id);
const res = await getVersionDetail(routeParams.value.id);
Object.assign(form.value, res.data);
loading.value = false;
buttonLoading.value = false;
@ -178,19 +159,8 @@ const getInfo = () => {
/** 提交按钮 */
const submitForm = (status1: string) => {
status.value = status1;
leaveFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
var res;
// if (form.value.id) {
res = await updateDesignChange({ ...form.value, id: routeParams.value.id }).finally(() => (buttonLoading.value = false));
// }
if (res.code == 200) {
dialog.visible = false;
submit(status.value, res.data);
}
}
});
submit(status.value, form.value);
};
const submitFlow = async () => {
@ -228,8 +198,7 @@ const submitCallback = async () => {
};
//审批
const approvalVerifyOpen = async () => {
submitVerifyRef.value.openDialog(routeParams.value.taskId, true, routeParams.value.businessId);
// submitVerifyRef.value.openDialog(routeParams.value.taskId);
submitVerifyRef.value.openDialog(routeParams.value.taskId);
};
// 图纸上传成功之后 开始提交
const submit = async (status, data) => {
@ -256,8 +225,11 @@ const submit = async (status, data) => {
onMounted(() => {
nextTick(async () => {
routeParams.value = proxy.$route.query;
reset();
routeParams.value = proxy.$route.query;
sheets.value = routeParams.value.sheets;
versions.value = routeParams.value.versions;
Object.assign(form.value, versions.value);
loading.value = false;
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
getInfo();