设计出图

This commit is contained in:
2025-08-14 02:07:30 +08:00
98 changed files with 641 additions and 403 deletions

View File

@ -63,9 +63,9 @@ export const delConfig = (id: string | number | Array<string | number>) => {
}; };
/** 获取用户列表 */ /** 获取用户列表 */
export const listUser = (query?: any) => { export const listUsers = (query?: any) => {
return request({ return request({
url: '/system/user/list', url: '/message/config/allUsersOfTheDepartment',
method: 'get', method: 'get',
params: query params: query
}); });

View File

@ -33,7 +33,6 @@ export interface ConfigVO {
* 通知人 * 通知人
*/ */
userId: string | number; userId: string | number;
} }
export interface ConfigForm extends BaseEntity { export interface ConfigForm extends BaseEntity {
@ -41,7 +40,10 @@ export interface ConfigForm extends BaseEntity {
* 主键ID * 主键ID
*/ */
id?: string | number; id?: string | number;
/**
* 通知部门
*/
deptId?: string | number;
/** /**
* 项目ID * 项目ID
*/ */
@ -71,11 +73,9 @@ export interface ConfigForm extends BaseEntity {
* 通知人 * 通知人
*/ */
userId?: string | number; userId?: string | number;
} }
export interface ConfigQuery extends PageQuery { export interface ConfigQuery extends PageQuery {
/** /**
* 项目ID * 项目ID
*/ */
@ -106,11 +106,8 @@ export interface ConfigQuery extends PageQuery {
*/ */
userId?: string | number; userId?: string | number;
/** /**
* 日期范围参数 * 日期范围参数
*/ */
params?: any; params?: any;
} }

View File

@ -271,7 +271,7 @@ const getList = async () => {
tableData.value = res.rows; tableData.value = res.rows;
total.value = res.total || 0; total.value = res.total || 0;
// 获取项目班组信息 // 获取项目班组信息
const teamRes = await listProjectTeamForeman(currentProject.value.id); const teamRes = await listProjectTeamForeman(currentProject.value?.id);
teamList.value = teamRes.data; teamList.value = teamRes.data;
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
label: team.teamName, label: team.teamName,
@ -308,7 +308,7 @@ const resetForm = () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -1,4 +1,5 @@
<template> <template>
<<<<<<< HEAD
<div class="billof-quantities"> <div class="billof-quantities">
<!-- tabPosition="left" --> <!-- tabPosition="left" -->
<el-tabs type="border-card" @tab-change="handleTabChange"> <el-tabs type="border-card" @tab-change="handleTabChange">
@ -75,22 +76,119 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
=======
<div class="billof-quantities">
<!-- tabPosition="left" -->
<el-tabs type="border-card" @tab-change="handleTabChange">
<el-tab-pane v-for="(item, index) in work_order_type" :key="item.value" :label="item.label">
<el-card v-if="index < 3" shadow="always">
<el-form :model="state.queryForm" :inline="true">
<el-form-item label="版本号" prop="versions">
<el-select v-model="state.queryForm.versions" placeholder="选择版本号">
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
</el-select>
</el-form-item>
<el-form-item label="表名" prop="sheet">
<el-select v-model="state.queryForm.sheet" placeholder="选择表名" @change="handleChange">
<el-option v-for="item in state.sheets" :key="item" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="openTable(true, index)">一键展开</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="openTable(false, index)">一键收起</el-button>
</el-form-item>
<el-form-item>
<el-upload ref="uploadRef" class="upload-demo" :http-request="importExcel" :show-file-list="false">
<template #trigger>
<el-button type="primary">导入excel</el-button>
</template>
</el-upload>
</el-form-item>
</el-form>
</el-card>
<el-card v-if="index == 3" shadow="always">
<el-form :model="state.queryForm" :inline="true">
<el-form-item label="版本号" prop="versions">
<el-select v-model="state.queryForm.versions" placeholder="选择版本号" @change="handleChangeVersion">
<el-option v-for="item in state.options" :key="item.versions" :label="item.versions" :value="item.versions" />
</el-select>
</el-form-item>
<el-form-item>
<el-upload
ref="uploadRef"
class="upload-demo"
:http-request="importExcel"
style="margin-right: 12px"
v-if="Object.keys(state.versionsData).length === 0 || state.versionsData.status == 'cancel' || state.versionsData.status == 'draft'"
:show-file-list="false"
>
<template #trigger>
<el-button type="primary">导入excel</el-button>
</template>
</el-upload>
<el-button v-if="state.versionsData.status == 'draft'" type="primary" con="edit" @click="clickApprovalSheet()">审核</el-button>
<el-button
v-if="state.versionsData.status == 'warning' || state.versionsData.status == 'finish'"
icon="view"
@click="lookApprovalSheet()"
type="warning"
>查看流程</el-button
>
</el-form-item>
</el-form>
</el-card>
<el-table
v-if="index < 3"
:ref="(el) => (tableRef[index] = el)"
:data="state.tableData"
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)"
row-key="id"
border
:default-expand-all="state.isOpen"
>
<el-table-column prop="num" label="编号" />
<el-table-column prop="name" label="工程或费用名称" />
<el-table-column prop="unit" label="单位" />
<el-table-column prop="quantity" label="数量" />
<el-table-column prop="remark" label="备注" />
</el-table>
<el-table v-if="index == 3" :data="state.tableData" style="width: 100%; margin-bottom: 20px; height: calc(100vh - 305px)" row-key="id" border>
<el-table-column prop="num" 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="remark" label="备注" />
</el-table>
</el-tab-pane>
</el-tabs>
</div>
>>>>>>> 3158dc84f7a6ef4568e1eeaf33df5b4b2fd1768f
</template> </template>
<script setup name="billofQuantities"> <script setup name="billofQuantities">
import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue' import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue';
import { obtainAllVersionNumbers, importExcelFile, obtainTheList, sheetList, detailsMaterialAndEquipmentApproval } from "@/api/design/billofQuantities/index" import {
obtainAllVersionNumbers,
importExcelFile,
obtainTheList,
sheetList,
detailsMaterialAndEquipmentApproval
} from '@/api/design/billofQuantities/index';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
const currentProject = computed(() => userStore.selectedProject); const currentProject = computed(() => userStore.selectedProject);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { work_order_type } = toRefs(proxy?.useDict('work_order_type')); const { work_order_type } = toRefs(proxy?.useDict('work_order_type'));
const tableRef = ref({}) const tableRef = ref({});
console.log(currentProject.value); console.log(currentProject.value);
// tableData // tableData
// 版本号 // 版本号
const state = reactive({ const state = reactive({
<<<<<<< HEAD
work_order_type: 0, work_order_type: 0,
// 版本号 // 版本号
version_num: '', version_num: '',
@ -118,36 +216,67 @@ const state = reactive({
// 版本号 // 版本号
versionsData:{} versionsData:{}
}) })
=======
work_order_type: 0,
// 版本号
version_num: '',
options: [], // 版本号选项
sheets: [], // sheet选项
queryForm: {
projectId: currentProject.value?.id,
versions: '',
sheet: '',
pageSize: 20,
pageNum: 1
},
loading: {
versions: false,
sheets: false,
list: false
},
error: null,
// 前三个
tableData: [],
// 物质设备清单
// tableData_sdsqd: [],
// 展开收起
isOpen: false,
// 版本号
versionsData: {}
});
>>>>>>> 3158dc84f7a6ef4568e1eeaf33df5b4b2fd1768f
// tab切换 // tab切换
const handleTabChange = tab => { const handleTabChange = (tab) => {
state.tableData = []; state.tableData = [];
state.options = []; state.options = [];
state.sheets = []; state.sheets = [];
state.queryForm.sheet = ''; state.queryForm.sheet = '';
state.queryForm.versions = ''; state.queryForm.versions = '';
state.work_order_type = tab state.work_order_type = tab;
if (tab <= 2) { if (tab <= 2) {
getVersionNums()
} else {
getVersionNums(false)
}
}
onMounted(() => {
getVersionNums(); getVersionNums();
}) } else {
getVersionNums(false);
}
};
onMounted(async () => {
await getVersionNums();
openTable(true, state.work_order_type);
});
// 获取版本号 // 获取版本号
async function getVersionNums(isSheet = true) { async function getVersionNums(isSheet = true) {
try { try {
state.loading.versions = true; state.loading.versions = true;
state.error = null; state.error = null;
const res = await obtainAllVersionNumbers({ const res = await obtainAllVersionNumbers({
projectId: currentProject.value?.id, projectId: currentProject.value?.id,
workOrderType: state.work_order_type, workOrderType: state.work_order_type,
pageSize: 1000, pageSize: 1000,
pageNum: 1, pageNum: 1
}); });
<<<<<<< HEAD
const { code, rows } = res || {}; const { code, rows } = res || {};
if (code === 200) { if (code === 200) {
state.options = rows || []; state.options = rows || [];
@ -165,52 +294,68 @@ async function getVersionNums(isSheet = true) {
await handleQueryList(isSheet); await handleQueryList(isSheet);
} }
} }
=======
const { code, rows } = res || {};
if (code === 200) {
state.options = rows || [];
if (state.options.length > 0) {
state.queryForm.versions = state.options[0].versions;
// 等待表名加载完成
console.log(isSheet, state.sheets.length);
if (isSheet) {
await handleSheetName();
>>>>>>> 3158dc84f7a6ef4568e1eeaf33df5b4b2fd1768f
} else { } else {
state.error = `获取版本号失败: 错误码 ${code}`; await handleQueryList(isSheet);
console.error(state.error);
} }
} catch (err) { }
state.error = `获取版本号时发生错误: ${err.message}`; } else {
console.error(state.error, err); state.error = `获取版本号失败: 错误码 ${code}`;
} finally { console.error(state.error);
state.loading.versions = false;
} }
} catch (err) {
state.error = `获取版本号时发生错误: ${err.message}`;
console.error(state.error, err);
} finally {
state.loading.versions = false;
}
} }
// 获取表名 // 获取表名
async function handleSheetName() { async function handleSheetName() {
if (!state.queryForm.versions) { if (!state.queryForm.versions) {
console.warn('版本号不存在,无法获取表名'); console.warn('版本号不存在,无法获取表名');
return; return;
}
try {
state.loading.sheets = true;
state.error = null;
const { data } = await sheetList({
projectId: currentProject.value?.id,
workOrderType: state.work_order_type,
versions: state.queryForm.versions
});
state.sheets = data || [];
if (state.sheets.length > 0) {
state.queryForm.sheet = state.sheets[0];
} }
try { // 获取列表数据
state.loading.sheets = true; await handleQueryList();
state.error = null; } catch (err) {
state.error = `获取表名时发生错误: ${err.message}`;
const { data } = await sheetList({ console.error(state.error, err);
projectId: currentProject.value?.id, } finally {
workOrderType: state.work_order_type, state.loading.sheets = false;
versions: state.queryForm.versions }
});
state.sheets = data || [];
if (state.sheets.length > 0) {
state.queryForm.sheet = state.sheets[0];
}
// 获取列表数据
await handleQueryList();
} catch (err) {
state.error = `获取表名时发生错误: ${err.message}`;
console.error(state.error, err);
} finally {
state.loading.sheets = false;
}
} }
// 获取列表 // 获取列表
async function handleQueryList(isSheet = true) { async function handleQueryList(isSheet = true) {
<<<<<<< HEAD
if (isSheet && !state.queryForm.sheet) { if (isSheet && !state.queryForm.sheet) {
console.warn('表名不存在,无法获取列表数据'); console.warn('表名不存在,无法获取列表数据');
return; return;
@ -233,10 +378,38 @@ async function handleQueryList(isSheet = true) {
console.error(state.error, err); console.error(state.error, err);
} finally { } finally {
state.loading.list = false; state.loading.list = false;
=======
if (isSheet && !state.queryForm.sheet) {
console.warn('表名不存在,无法获取列表数据');
return;
}
try {
state.loading.list = true;
state.error = null;
const result = await obtainTheList(state.queryForm);
if (result?.code === 200) {
if (state.work_order_type == 3) {
state.versionsData = result.data || [];
}
state.tableData = result.data || [];
} else {
state.error = `获取列表数据失败: 错误码 ${result?.code}`;
console.error(state.error);
>>>>>>> 3158dc84f7a6ef4568e1eeaf33df5b4b2fd1768f
} }
} catch (err) {
state.error = `获取列表数据时发生错误: ${err.message}`;
console.error(state.error, err);
} finally {
state.loading.list = false;
}
} }
// 上传excel // 上传excel
function importExcel(options) { function importExcel(options) {
<<<<<<< HEAD
console.log(options); console.log(options);
let formData = new FormData(); let formData = new FormData();
formData.append("file", options.file); formData.append("file", options.file);
@ -253,66 +426,87 @@ function importExcel(options) {
} }
}).finally(() => { }).finally(() => {
state.loading.list = false; state.loading.list = false;
=======
console.log(options);
const loading = ElLoading.service({
lock: true,
text: '正在导入,请稍候...',
background: 'rgba(0, 0, 0, 0.7)'
});
let formData = new FormData();
formData.append('file', options.file);
importExcelFile({ workOrderType: state.work_order_type, projectId: currentProject.value?.id }, formData)
.then((res) => {
const { code } = res;
if (code == 200) {
proxy.$modal.msgSuccess(res.msg || '导入成功');
// 更新列表
getVersionNums(false);
} else {
proxy.$modal.msgError(res.msg || '导入失败');
}
>>>>>>> 3158dc84f7a6ef4568e1eeaf33df5b4b2fd1768f
}) })
.finally(() => {
loading.close();
});
} }
// 切换表名 // 切换表名
function handleChange(sheet) { function handleChange(sheet) {
state.queryForm.sheet = sheet; state.queryForm.sheet = sheet;
handleQueryList(); handleQueryList();
} }
// 切换版本号 // 切换版本号
function handleChangeVersion(versions) { function handleChangeVersion(versions) {
state.queryForm.versions = versions; state.queryForm.versions = versions;
state.versionsData = state.options.find(e => e.versions == versions) state.versionsData = state.options.find((e) => e.versions == versions);
console.log('state.versionsData',state.versionsData); console.log('state.versionsData', state.versionsData);
state.sheets = []; state.sheets = [];
handleQueryList(); handleQueryList();
} }
// 在 openTable 方法中通过索引获取对应的表格实例 // 在 openTable 方法中通过索引获取对应的表格实例
function openTable(flag, index) { function openTable(flag, index) {
nextTick(() => { nextTick(() => {
// 通过索引获取当前标签页的表格实例 // 通过索引获取当前标签页的表格实例
const currentTable = tableRef.value[index] const currentTable = tableRef.value[index];
if (currentTable) { if (currentTable) {
handleArr(state.tableData, flag, currentTable); handleArr(state.tableData, flag, currentTable);
} }
}); });
} }
function handleArr(arr, flag, table) { function handleArr(arr, flag, table) {
arr.forEach((i) => { arr.forEach((i) => {
table.toggleRowExpansion(i, flag); table.toggleRowExpansion(i, flag);
if (i.children) { if (i.children) {
handleArr(i.children, flag, table); handleArr(i.children, flag, table);
} }
}); });
} }
// 审批 // 审批
function clickApprovalSheet(row) { function clickApprovalSheet(row) {
proxy.$tab.closePage(proxy.$route); proxy.$tab.closePage(proxy.$route);
proxy.$router.push({ proxy.$router.push({
path: `/design-management/billofQuantities/indexEdit`, path: `/design-management/billofQuantities/indexEdit`,
query: { query: {
id: state.queryForm.versions, id: state.queryForm.versions,
type: 'update' type: 'update'
}, }
}); });
} }
// 审核流程 // 审核流程
function lookApprovalFlow(row) { function lookApprovalFlow(row) {
proxy.$router.push({ proxy.$router.push({
path: `/design-management/billofQuantities/indexEdit`, path: `/design-management/billofQuantities/indexEdit`,
query: { query: {
id: state.queryForm.versions, id: state.queryForm.versions,
type: 'view' type: 'view'
} }
}); });
} }
</script> </script>
<style> <style>
.billof-quantities { .billof-quantities {
padding: 20px; padding: 20px;
} }
</style> </style>

View File

@ -60,7 +60,7 @@ const props = defineProps({
const uploadParams = computed(() => { const uploadParams = computed(() => {
return { return {
catalogueId: props.catalogueId, catalogueId: props.catalogueId,
projectId: currentProject.value.id projectId: currentProject.value?.id
}; };
}); });

View File

@ -216,7 +216,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -1,7 +1,7 @@
<template> <template>
<el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="版本号" align="center" prop="versionNumber" width="100" /> <!-- <el-table-column label="版本号" align="center" prop="versionNumber" width="100" />
<el-table-column label="文件名称" align="center" prop="fileName"> <el-table-column label="文件名称" align="center" prop="fileName">
<template #default="scope"> <template #default="scope">
<span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span> <span style="color: #409eff" @click="handleView(scope.row)">{{ scope.row.fileName }}</span>
@ -26,7 +26,16 @@
<dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag> <dict-tag :options="wf_business_status" :value="scope.row.status"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" /> <el-table-column label="上传时间" align="center" prop="createTime" /> -->
<el-table-column label="子项名称" align="center" prop="designSubitem" />
<el-table-column label="专业" align="center" prop="specialty">
<template #default="scope">
<dict-tag :options="des_user_major" :value="scope.row.specialty" />
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="principal" />
<el-table-column label="卷册号" align="center" prop="volumeNumber" />
<el-table-column label="资料名称" align="center" prop="fileName" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding " width="240"> <el-table-column label="操作" align="center" class-name="small-padding " width="240">
<template #default="scope"> <template #default="scope">
@ -55,6 +64,9 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue'; import { ref, defineProps, defineEmits } from 'vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { design_state, wf_business_status, des_user_major } = toRefs(proxy?.useDict('design_state', 'wf_business_status', 'des_user_major'));
const props = defineProps({ const props = defineProps({
drawingList: { drawingList: {

View File

@ -38,7 +38,7 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</template> </template>
<el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <!-- <el-tabs type="border-card" v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="过程图纸" name="1"> <el-tab-pane label="过程图纸" name="1">
<DrawingTable <DrawingTable
:drawingList="drawingList" :drawingList="drawingList"
@ -81,7 +81,19 @@
@cancel-process-apply="handleCancelProcessApply" @cancel-process-apply="handleCancelProcessApply"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs> -->
<DrawingTable
:drawingList="drawingList"
:loading="loading"
:drawing_file_type="drawing_file_type"
:wf_business_status="wf_business_status"
@selection-change="handleSelectionChange"
@view="handleView"
@update="handleUpdate"
@delete="handleDelete"
@view-info="handleViewInfo"
@cancel-process-apply="handleCancelProcessApply"
/>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
</div> </div>
@ -118,7 +130,6 @@ const data = reactive({
pageSize: 10, pageSize: 10,
projectId: currentProject.value?.id, projectId: currentProject.value?.id,
fileName: undefined, fileName: undefined,
fileType: 1,
fileSuffix: undefined, fileSuffix: undefined,
fileStatus: undefined, fileStatus: undefined,
originalName: undefined, originalName: undefined,
@ -219,18 +230,12 @@ const handleCancelProcessApply = async (id: string) => {
proxy?.$modal.msgSuccess('撤销成功'); proxy?.$modal.msgSuccess('撤销成功');
}; };
const handleClick = (val) => {
queryParams.value.pageNum = 1;
queryParams.value.fileType = val.props.name;
getList();
};
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -207,8 +207,8 @@ const formData = reactive<FormData>({
professional: '', professional: '',
stage: '', stage: '',
volume: '', volume: '',
projectId: currentProject.value.id || '', projectId: currentProject.value?.id || '',
projectName: currentProject.value.name || '', projectName: currentProject.value?.name || '',
subprojectId: '', subprojectId: '',
subprojectName: '', subprojectName: '',
designer: '', designer: '',
@ -243,7 +243,7 @@ watch(
); );
// 通过项目获取子项目 - 监听项目 id 变化,可自动获取子项目 // 通过项目获取子项目 - 监听项目 id 变化,可自动获取子项目
const getSubProject = async () => { const getSubProject = async () => {
let res = await subProjectListAll(currentProject.value.id); let res = await subProjectListAll(currentProject.value?.id);
subProjectList.value = res.data; subProjectList.value = res.data;
subProjectList.value.forEach((item: any) => { subProjectList.value.forEach((item: any) => {
subProjectMap.set(item.id, item.projectName); subProjectMap.set(item.id, item.projectName);

View File

@ -214,7 +214,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -306,7 +306,7 @@ const onLoad = async () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
getDeptAllUser(userStore.deptId).then(() => { getDeptAllUser(userStore.deptId).then(() => {
byProjectIdAll(); byProjectIdAll();

View File

@ -213,7 +213,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -210,7 +210,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -103,7 +103,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SubcontractForm = { const initFormData: SubcontractForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
subContent: undefined subContent: undefined
}; };
const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({ const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
@ -111,7 +111,7 @@ const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
subContent: undefined, subContent: undefined,
params: {} params: {}
}, },
@ -224,7 +224,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -58,7 +58,7 @@ const ids = ref<string>('');
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
const param = reactive({ const param = reactive({
type: 2, type: 2,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}); });

View File

@ -456,7 +456,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
state.projectId = nid; state.projectId = nid;
state.paramsQuery.projectId = nid; state.paramsQuery.projectId = nid;

View File

@ -77,12 +77,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="图纸文件" align="center" prop="remark"> <el-table-column label="图纸文件" align="center" prop="remark" width="150">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['out:monthPlan:remove']">查看文件</el-button> <el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['out:monthPlan:remove']">查看文件</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="300"> <el-table-column label="操作" align="center" width="200">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -183,6 +183,11 @@
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="size" label="是否变更" align="center">
<template #default="scope">
<el-tag :type="scope.row.type == 1 ? 'success' : 'info'">{{ scope.row.type == 1 ? '否' : '是' }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="size" label="状态" width="170" align="center"> <el-table-column prop="size" label="状态" width="170" align="center">
<template #default="scope"> <template #default="scope">
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag> <el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag>
@ -460,7 +465,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -126,7 +126,7 @@ const dialog = reactive<DialogOption>({
const initFormData: DroneConfigForm = { const initFormData: DroneConfigForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
configName: undefined, configName: undefined,
configUrl: undefined, configUrl: undefined,
dockSocketUrl: undefined, dockSocketUrl: undefined,
@ -141,7 +141,7 @@ const data = reactive<PageData<DroneConfigForm, DroneConfigQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
configName: undefined, configName: undefined,
configUrl: undefined, configUrl: undefined,
params: {} params: {}
@ -249,7 +249,7 @@ const handleExport = () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -108,14 +108,14 @@ const currentProject = computed(() => userStore.selectedProject);
//获取施工人员信息 //获取施工人员信息
const getConstructionUserData = async () => { const getConstructionUserData = async () => {
const res = await getConstructionUserList({ projectId: currentProject.value.id }); const res = await getConstructionUserList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
constructionUserData.value = res.data; constructionUserData.value = res.data;
}; };
//查询大屏机械列表 //查询大屏机械列表
const getMachineryData = async () => { const getMachineryData = async () => {
const res = await getMachineryrList({ projectId: currentProject.value.id }); const res = await getMachineryrList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
machineryOption.value = res.data; machineryOption.value = res.data;
initMachinerycharts(); initMachinerycharts();
@ -123,7 +123,7 @@ const getMachineryData = async () => {
//查询大屏材料信息 //查询大屏材料信息
const getOrderData = async () => { const getOrderData = async () => {
const res = await getMaterialsList({ projectId: currentProject.value.id }); const res = await getMaterialsList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
orderOption.value = res.data; orderOption.value = res.data;
initOrderChart(); initOrderChart();

View File

@ -206,21 +206,21 @@ const classOptions = {
//获取质量信息 //获取质量信息
const getQualityData = async () => { const getQualityData = async () => {
const res = await getQualityList({ projectId: currentProject.value.id }); const res = await getQualityList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
qualityData.value = res.data; qualityData.value = res.data;
}; };
//获取大屏项目新闻列表 //获取大屏项目新闻列表
const getProjectNewsData = async () => { const getProjectNewsData = async () => {
const res = await getprojectNewsList({ projectId: currentProject.value.id }); const res = await getprojectNewsList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
projectNewsData.value = res.data; projectNewsData.value = res.data;
}; };
//查询大屏安全信息 //查询大屏安全信息
const getsafetyInspectionData = async () => { const getsafetyInspectionData = async () => {
const res = await getsafetyInspectionList({ projectId: currentProject.value.id }); const res = await getsafetyInspectionList({ projectId: currentProject.value?.id });
if (res.code !== 200) return; if (res.code !== 200) return;
safetyInspectionData.value = res.data; safetyInspectionData.value = res.data;
}; };

View File

@ -80,12 +80,12 @@ const goHome = () => {
}; };
//获取天气 //获取天气
const getweatherData = async () => { const getweatherData = async () => {
const res = await getweatherList(currentProject.value.id); const res = await getweatherList(currentProject.value?.id);
weatherData.value = res.data; weatherData.value = res.data;
}; };
//获取生产天数 //获取生产天数
const getProductionDays = async () => { const getProductionDays = async () => {
const res = await getSafetyDay(currentProject.value.id); const res = await getSafetyDay(currentProject.value?.id);
safetyDay.value = res.data.safetyDay.toLocaleString(); safetyDay.value = res.data.safetyDay.toLocaleString();
}; };
//获取白天或夜晚 //获取白天或夜晚

View File

@ -144,7 +144,7 @@ const initFormData: MachineryForm = {
id: undefined, id: undefined,
machineryName: undefined, machineryName: undefined,
machineryNumber: undefined, machineryNumber: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
number: undefined, number: undefined,
principal: undefined, principal: undefined,
remark: undefined, remark: undefined,
@ -158,7 +158,7 @@ const data = reactive<PageData<MachineryForm, MachineryQuery>>({
pageSize: 10, pageSize: 10,
machineryName: undefined, machineryName: undefined,
machineryNumber: undefined, machineryNumber: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
number: undefined, number: undefined,
principal: undefined, principal: undefined,
params: {}, params: {},
@ -234,7 +234,7 @@ const submitForm = () => {
machineryFormRef.value?.validate(async (valid: boolean) => { machineryFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateMachinery(form.value).finally(() => (buttonLoading.value = false)); await updateMachinery(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -277,7 +277,7 @@ const handleAddMachineryDetail = (row?: MachineryVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -165,7 +165,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
getDeptAllUser(userStore.deptId).then(() => { getDeptAllUser(userStore.deptId).then(() => {
designUser(); designUser();

View File

@ -206,7 +206,7 @@ const initFormData: any = {
planCode: undefined, planCode: undefined,
matCat: undefined, matCat: undefined,
status: undefined, status: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
}, },
planList: [ planList: [
@ -230,13 +230,13 @@ const data = reactive({
pageSize: 10, pageSize: 10,
planCode: undefined, planCode: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
}, },
mainData: { mainData: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
mrpBaseId: undefined, mrpBaseId: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
} }
}, },
rules: { rules: {
@ -316,7 +316,7 @@ const reset = () => {
const status = form.value.mrpBaseBo.status; const status = form.value.mrpBaseBo.status;
form.value = { ...initFormData, status }; // 重置但保留 form.value = { ...initFormData, status }; // 重置但保留
cailiaoshebeiFormRef.value?.resetFields(); cailiaoshebeiFormRef.value?.resetFields();
form.value.mrpBaseBo.projectId = currentProject.value.id; form.value.mrpBaseBo.projectId = currentProject.value?.id;
form.value.planList = [ form.value.planList = [
{ {
name: undefined, name: undefined,
@ -385,7 +385,7 @@ const submitForm = async () => {
await addCailiaoshebei({ await addCailiaoshebei({
addDataList: cailiaoshebeiList.value, addDataList: cailiaoshebeiList.value,
batchNumber: form.value.batchNumber, batchNumber: form.value.batchNumber,
projectId: currentProject.value.id projectId: currentProject.value?.id
} as any).finally(() => (buttonLoading.value = false)); } as any).finally(() => (buttonLoading.value = false));
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
@ -466,7 +466,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.mainData.projectId = nid; queryParams.value.mainData.projectId = nid;

View File

@ -149,7 +149,7 @@ const initFormData: any = {
planCode: undefined, planCode: undefined,
matCat: undefined, matCat: undefined,
status: undefined, status: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
}, },
planList: [ planList: [

View File

@ -287,7 +287,7 @@ const initFormData: CailiaoshebeiForm = {
plan: undefined, plan: undefined,
realQuantity: undefined, realQuantity: undefined,
approvalDesign: undefined, approvalDesign: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
remark: undefined remark: undefined
}; };
const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
@ -299,7 +299,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
supplierId: undefined, supplierId: undefined,
supplier: undefined, supplier: undefined,
name: undefined, name: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
supply: undefined, supply: undefined,
specification: undefined, specification: undefined,
signalment: undefined, signalment: undefined,
@ -454,7 +454,7 @@ const submitForm = () => {
const addBatch = async () => { const addBatch = async () => {
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
queryParams.value.batchNumber = ''; queryParams.value.batchNumber = '';
await getBatch({ projectId: currentProject.value.id }); await getBatch({ projectId: currentProject.value?.id });
await getBatchList(); await getBatchList();
proxy?.$modal.msgSuccess('新增成功'); proxy?.$modal.msgSuccess('新增成功');
}; };
@ -494,7 +494,7 @@ const handleExport = () => {
const supplierOptions = ref([]); const supplierOptions = ref([]);
const getSupplierList = async () => { const getSupplierList = async () => {
const res = await listContractor({ const res = await listContractor({
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 10000
}); });
@ -522,7 +522,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -134,7 +134,7 @@ const dialog = reactive<DialogOption>({
const initFormData: CompanyForm = { const initFormData: CompanyForm = {
id: undefined, id: undefined,
companyName: undefined, companyName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
status: undefined, status: undefined,
remark: undefined, remark: undefined,
qualification: undefined, qualification: undefined,
@ -147,7 +147,7 @@ const data = reactive<PageData<CompanyForm, CompanyQuery>>({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
companyName: undefined, companyName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
status: undefined, status: undefined,
qualification: undefined, qualification: undefined,
principalPhone: undefined, principalPhone: undefined,
@ -226,7 +226,7 @@ const submitForm = () => {
companyFormRef.value?.validate(async (valid: boolean) => { companyFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateCompany(form.value).finally(() => (buttonLoading.value = false)); await updateCompany(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -261,7 +261,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -177,7 +177,7 @@ const initFormData: MaterialsForm = {
id: undefined, id: undefined,
materialsName: undefined, materialsName: undefined,
companyId: undefined, companyId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
typeSpecificationName: undefined, typeSpecificationName: undefined,
fileOssIdMap: undefined, fileOssIdMap: undefined,
usePart: undefined, usePart: undefined,
@ -193,7 +193,7 @@ const data = reactive<PageData<MaterialsForm, MaterialsQuery>>({
pageSize: 10, pageSize: 10,
materialsName: undefined, materialsName: undefined,
companyId: undefined, companyId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
typeSpecificationName: undefined, typeSpecificationName: undefined,
fileOssIdMap: undefined, fileOssIdMap: undefined,
usePart: undefined, usePart: undefined,
@ -225,7 +225,7 @@ const getCompanyList = async () => {
const companyRes = await listCompany({ const companyRes = await listCompany({
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
companyOptions.value = companyRes.rows.map((company: CompanyVO) => ({ companyOptions.value = companyRes.rows.map((company: CompanyVO) => ({
value: company.id, value: company.id,
@ -295,7 +295,7 @@ const submitForm = () => {
materialsFormRef.value?.validate(async (valid: boolean) => { materialsFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateMaterials({ await updateMaterials({
...form.value, ...form.value,
@ -354,7 +354,7 @@ const handleOssUpdate = (ossId: string, value: string) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -450,7 +450,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -462,7 +462,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -449,7 +449,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -453,7 +453,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -179,7 +179,7 @@ const dialog = reactive<DialogOption>({
const initFormData: MaterialsInventoryForm = { const initFormData: MaterialsInventoryForm = {
id: undefined, id: undefined,
materialsId: undefined, materialsId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
outPut: undefined, outPut: undefined,
number: undefined, number: undefined,
outPutTime: undefined, outPutTime: undefined,
@ -197,7 +197,7 @@ const data = reactive<PageData<MaterialsInventoryForm, MaterialsInventoryQuery>>
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
materialsId: undefined, materialsId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
outPut: undefined, outPut: undefined,
number: undefined, number: undefined,
outPutTime: undefined, outPutTime: undefined,
@ -275,7 +275,7 @@ const submitForm = () => {
materialsInventoryFormRef.value?.validate(async (valid: boolean) => { materialsInventoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateMaterialsInventory(form.value).finally(() => (buttonLoading.value = false)); await updateMaterialsInventory(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -310,7 +310,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -192,7 +192,7 @@ const initFormData: CailiaoshebeiForm = {
unit: undefined, unit: undefined,
plan: undefined, plan: undefined,
realQuantity: undefined, realQuantity: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
remark: undefined remark: undefined
}; };
const data = reactive<PageData<any, any>>({ const data = reactive<PageData<any, any>>({
@ -204,7 +204,7 @@ const data = reactive<PageData<any, any>>({
supplierId: undefined, supplierId: undefined,
supplier: undefined, supplier: undefined,
name: undefined, name: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
supply: undefined, supply: undefined,
specification: undefined, specification: undefined,
signalment: undefined, signalment: undefined,
@ -300,7 +300,7 @@ const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
const handleAdd = () => { const handleAdd = () => {
reset(); reset();
listCailiaoshebei({ listCailiaoshebei({
projectId: currentProject.value.id projectId: currentProject.value?.id
}).then((res) => { }).then((res) => {
cailiaoshebeiAllList.value = res.rows; cailiaoshebeiAllList.value = res.rows;
}); });
@ -327,7 +327,7 @@ const onShare = () => {
console.log(getToken()); console.log(getToken());
// 跳转新的地址 传token // 跳转新的地址 传token
let url = `http://192.168.110.142:7788/indexEquipment?projectId=${encodeURIComponent(currentProject.value.id)}&token=${encodeURIComponent(getToken())}&batchNumber=${encodeURIComponent(form.value.batchNumber)}`; let url = `http://192.168.110.142:7788/indexEquipment?projectId=${encodeURIComponent(currentProject.value?.id)}&token=${encodeURIComponent(getToken())}&batchNumber=${encodeURIComponent(form.value.batchNumber)}`;
window.open(url, '_blank'); window.open(url, '_blank');
}; };
/** 提交按钮 */ /** 提交按钮 */
@ -379,7 +379,7 @@ const submitTransferForm = async () => {
/** 新增批次 */ /** 新增批次 */
const addBatch = async () => { const addBatch = async () => {
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
const res = await getBatch({ projectId: currentProject.value.id }); const res = await getBatch({ projectId: currentProject.value?.id });
console.log('🚀 ~ addBatch ~ res:', res); console.log('🚀 ~ addBatch ~ res:', res);
await getBatchList(); await getBatchList();
@ -410,7 +410,7 @@ const handleDelete = async (row?: CailiaoshebeiVO) => {
const supplierOptions = ref([]); const supplierOptions = ref([]);
const getSupplierList = async () => { const getSupplierList = async () => {
const res = await listContractor({ const res = await listContractor({
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 10000
}); });
@ -424,7 +424,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -230,7 +230,7 @@ const initFormData: CailiaoshebeiForm = {
plan: undefined, plan: undefined,
file: null, // 确保初始化为null file: null, // 确保初始化为null
realQuantity: undefined, realQuantity: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
bo: { bo: {
requiredTime: undefined, requiredTime: undefined,
orderTime: undefined, orderTime: undefined,
@ -252,7 +252,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
supplierId: undefined, supplierId: undefined,
supplier: undefined, supplier: undefined,
name: undefined, name: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
supply: undefined, supply: undefined,
specification: undefined, specification: undefined,
signalment: undefined, signalment: undefined,
@ -436,7 +436,7 @@ const handleChange = (value: number) => {
const supplierOptions = ref([]); const supplierOptions = ref([]);
const getSupplierList = async () => { const getSupplierList = async () => {
const res = await listContractor({ const res = await listContractor({
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 10000
}); });
@ -450,7 +450,7 @@ onMounted(() => {
// 监听项目id刷新数据 // 监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid) => { (nid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -118,7 +118,7 @@ const route = useRoute();
const initFormData: RepertoryDetailsForm = { const initFormData: RepertoryDetailsForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
repertoryId: undefined, repertoryId: undefined,
materialsorderId: undefined, materialsorderId: undefined,
materialCode: undefined, materialCode: undefined,
@ -135,7 +135,7 @@ const data = reactive<PageData<RepertoryDetailsForm, RepertoryDetailsQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
repertoryId: undefined, repertoryId: undefined,
materialsorderId: undefined, materialsorderId: undefined,
materialCode: undefined, materialCode: undefined,
@ -243,7 +243,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -153,7 +153,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -293,7 +293,7 @@ const initFormData: any = {
unit: undefined, unit: undefined,
plan: undefined, plan: undefined,
realQuantity: undefined, realQuantity: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
approvalProject: undefined, approvalProject: undefined,
listOfMaterialInventory: [], listOfMaterialInventory: [],
@ -308,7 +308,7 @@ const data = reactive<PageData<any, any>>({
supplierId: undefined, supplierId: undefined,
supplier: undefined, supplier: undefined,
name: undefined, name: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
supply: undefined, supply: undefined,
specification: undefined, specification: undefined,
signalment: undefined, signalment: undefined,
@ -485,7 +485,7 @@ const handleAudit = async () => {
const supplierOptions = ref([]); const supplierOptions = ref([]);
const getSupplierList = async () => { const getSupplierList = async () => {
const res = await listContractor({ const res = await listContractor({
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10000 pageSize: 10000
}); });
@ -499,7 +499,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -72,9 +72,14 @@
<el-form-item label="跳转路由" prop="route"> <el-form-item label="跳转路由" prop="route">
<el-input v-model="form.route" placeholder="请输入跳转路由" /> <el-input v-model="form.route" placeholder="请输入跳转路由" />
</el-form-item> </el-form-item>
<el-form-item label="通知部门" prop="deptId">
<el-select v-model="form.deptId" placeholder="请选择通知部门" filterable @change="getUser">
<el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
</el-select>
</el-form-item>
<el-form-item label="通知人" prop="userId"> <el-form-item label="通知人" prop="userId">
<el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable> <el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable :disabled="!form.deptId">
<el-option v-for="item in userList" :key="item.id" :label="item.nickName" :value="item.id" /> <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -89,8 +94,9 @@
</template> </template>
<script setup name="Config" lang="ts"> <script setup name="Config" lang="ts">
import { listConfig, getConfig, delConfig, addConfig, updateConfig, listUser } from '@/api/message/config'; import { listConfig, getConfig, delConfig, addConfig, updateConfig, listUsers } from '@/api/message/config';
import { ConfigVO, ConfigQuery, ConfigForm } from '@/api/message/config/types'; import { ConfigVO, ConfigQuery, ConfigForm } from '@/api/message/config/types';
import { listUser } from '@/api/system/user';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -107,6 +113,9 @@ const single = ref(true);
const multiple = ref(true); const multiple = ref(true);
const total = ref(0); const total = ref(0);
const userList = ref([]); const userList = ref([]);
const deptList = ref([]);
const deptId = ref('');
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const configFormRef = ref<ElFormInstance>(); const configFormRef = ref<ElFormInstance>();
@ -117,10 +126,11 @@ const dialog = reactive<DialogOption>({
const initFormData: ConfigForm = { const initFormData: ConfigForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
msgName: undefined, msgName: undefined,
msgContent: undefined, msgContent: undefined,
msgKey: undefined, msgKey: undefined,
deptId: undefined,
route: undefined, route: undefined,
userId: undefined userId: undefined
}; };
@ -129,7 +139,7 @@ const data = reactive<PageData<ConfigForm, ConfigQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
msgName: undefined, msgName: undefined,
msgContent: undefined, msgContent: undefined,
msgKey: undefined, msgKey: undefined,
@ -167,7 +177,7 @@ const cancel = () => {
/** 表单重置 */ /** 表单重置 */
const reset = () => { const reset = () => {
form.value = { ...initFormData }; form.value = { ...initFormData };
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
configFormRef.value?.resetFields(); configFormRef.value?.resetFields();
}; };
@ -245,23 +255,41 @@ const handleExport = () => {
}; };
/** 获取用户列表 */ /** 获取用户列表 */
const getListUser = async () => { const getDept = async () => {
const res = await listUsers({
pageNum: 1,
pageSize: 1000,
projectId: currentProject.value?.id
});
deptId.value = res.data.deptId;
getListDept();
};
const getListDept = async () => {
const res = await listUser({ const res = await listUser({
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
projectId: currentProject.value.id deptId: deptId.value
});
deptList.value = res.rows;
};
const getUser = async () => {
const res = await listUser({
pageNum: 1,
pageSize: 1000,
deptId: form.value.deptId
}); });
userList.value = res.rows; userList.value = res.rows;
}; };
onMounted(() => { onMounted(() => {
getList(); getList();
getListUser(); getDept();
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -89,7 +89,7 @@ const tableData = ref({
param: { param: {
pageNum: 1, pageNum: 1,
pageSize: 4, pageSize: 4,
projectId: currentProject.value.id projectId: currentProject.value?.id
} }
}); });
@ -132,7 +132,7 @@ const getCameraList = async () => {
const res: any = await getCameraListByProjectId({ const res: any = await getCameraListByProjectId({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
let list = res.rows?.list ?? []; let list = res.rows?.list ?? [];
@ -250,7 +250,7 @@ onBeforeUnmount(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
// queryParams.value.projectId = nid; // queryParams.value.projectId = nid;
// form.value.projectId = nid; // form.value.projectId = nid;

View File

@ -337,7 +337,7 @@ const encryptChange = (row: Ys7DeviceVO | any) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
tableData.value.param.projectId = nid; tableData.value.param.projectId = nid;
initTableData(); initTableData();

View File

@ -258,7 +258,7 @@ const handleSelectionChange = (selection: ConstructionValueVO[]) => {
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleAdd = async () => { const handleAdd = async () => {
reset(); reset();
const res = await getProjectSquare(currentProject.value.id); const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) return proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵'); if (res.data.length === 0) return proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
const isFangzhen = res.data.some((item) => item.children && item.children.length); const isFangzhen = res.data.some((item) => item.children && item.children.length);
console.log('🚀 ~ handleAdd ~ isFangzhen:', isFangzhen); console.log('🚀 ~ handleAdd ~ isFangzhen:', isFangzhen);
@ -373,7 +373,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -276,7 +276,7 @@ const handleAudit = async (row?: MonthPlanVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
// const listeningProject = watch( // const listeningProject = watch(
// () => currentProject.value.id, // () => currentProject.value?.id,
// (nid, oid) => { // (nid, oid) => {
// queryParams.value.projectId = nid; // queryParams.value.projectId = nid;
// form.value.projectId = nid; // form.value.projectId = nid;

View File

@ -215,7 +215,7 @@ const handleUpdate = async (row?: MonthPlanVO) => {
/** 提交按钮 */ /** 提交按钮 */
const submitForm = () => { const submitForm = () => {
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
monthPlanFormRef.value?.validate(async (valid: boolean) => { monthPlanFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
@ -255,7 +255,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -188,7 +188,7 @@ const submitFlow = async () => {
const handleStartWorkFlow = async (data: LeaveForm) => { const handleStartWorkFlow = async (data: LeaveForm) => {
try { try {
submitFormData.value.flowCode = flowCode.value; submitFormData.value.flowCode = flowCode.value;
submitFormData.value.businessId = currentProject.value.id + '_' + form.value[0]?.planMonth; submitFormData.value.businessId = currentProject.value?.id + '_' + form.value[0]?.planMonth;
//流程变量 //流程变量
taskVariables.value = { taskVariables.value = {

View File

@ -215,14 +215,13 @@ const handleDelete = async (row?: MonthPlanAuditVO) => {
await getList(); await getList();
}; };
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -62,7 +62,7 @@ const data = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
valueType: '1', valueType: '1',
projectId: currentProject.value.id, projectId: currentProject.value?.id,
month: undefined month: undefined
} }
}); });
@ -111,7 +111,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -65,7 +65,7 @@ const data = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
valueType: '1', valueType: '1',
projectId: currentProject.value.id, projectId: currentProject.value?.id,
month: undefined month: undefined
} }
}); });
@ -119,7 +119,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -62,7 +62,7 @@ const data = reactive({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
month: undefined month: undefined
} }
}); });
@ -111,7 +111,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -60,7 +60,7 @@ const data = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
valueType: undefined, valueType: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
month: undefined month: undefined
} }
}); });
@ -114,7 +114,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -142,7 +142,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SettlementValueOwnerForm = { const initFormData: SettlementValueOwnerForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
settlementValue: undefined, settlementValue: undefined,
valueType: undefined, valueType: undefined,
remark: undefined, remark: undefined,
@ -153,7 +153,7 @@ const data = reactive<PageData<SettlementValueOwnerForm, SettlementValueOwnerQue
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
settlementValue: undefined, settlementValue: undefined,
valueType: undefined, valueType: undefined,
settlementDate: undefined, settlementDate: undefined,
@ -253,14 +253,13 @@ const handleDelete = async (row?: SettlementValueOwnerVO) => {
await getList(); await getList();
}; };
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -179,7 +179,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SettlementValueSubcontractForm = { const initFormData: SettlementValueSubcontractForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
documentCode: undefined, documentCode: undefined,
settlementDescribe: undefined, settlementDescribe: undefined,
valueType: undefined, valueType: undefined,
@ -198,7 +198,7 @@ const data = reactive<PageData<SettlementValueSubcontractForm, SettlementValueSu
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
documentCode: undefined, documentCode: undefined,
settlementDescribe: undefined, settlementDescribe: undefined,
valueType: undefined, valueType: undefined,
@ -235,7 +235,7 @@ const getList = async () => {
//获取分包单位 //获取分包单位
const contractorList = ref<ContractorVO[]>([]); const contractorList = ref<ContractorVO[]>([]);
const getContractorList = async () => { const getContractorList = async () => {
const res = await listContractor({ projectId: currentProject.value.id } as any); const res = await listContractor({ projectId: currentProject.value?.id } as any);
contractorList.value = res.rows; contractorList.value = res.rows;
}; };
@ -321,7 +321,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -106,7 +106,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ValueAllocationForm = { const initFormData: ValueAllocationForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
ownerDesignValue: undefined, ownerDesignValue: undefined,
ownerPurchaseValue: undefined, ownerPurchaseValue: undefined,
ownerConstructionValue: undefined, ownerConstructionValue: undefined,
@ -122,7 +122,7 @@ const data = reactive<PageData<ValueAllocationForm, ValueAllocationQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
ownerDesignValue: undefined, ownerDesignValue: undefined,
ownerPurchaseValue: undefined, ownerPurchaseValue: undefined,
ownerConstructionValue: undefined, ownerConstructionValue: undefined,
@ -250,7 +250,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -198,7 +198,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ConstructionSchedulePlanForm = { const initFormData: ConstructionSchedulePlanForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
parentId: undefined, parentId: undefined,
nodeName: undefined, nodeName: undefined,
projectStructure: undefined, projectStructure: undefined,
@ -213,7 +213,7 @@ const initFormData: ConstructionSchedulePlanForm = {
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({ const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
projectId: currentProject.value.id, projectId: currentProject.value?.id,
parentId: undefined, parentId: undefined,
nodeName: undefined, nodeName: undefined,
status: undefined, status: undefined,
@ -348,7 +348,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -245,7 +245,7 @@ const initFormData: ProgressCategoryForm = {
name: undefined, name: undefined,
matrixId: undefined, matrixId: undefined,
unitType: undefined, unitType: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
}; };
const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
@ -254,7 +254,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
pid: undefined, pid: undefined,
name: undefined, name: undefined,
unitType: undefined, unitType: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
matrixId: undefined, matrixId: undefined,
params: {} params: {}
}, },
@ -272,7 +272,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询进度类别列表 */ /** 查询进度类别列表 */
const getList = async () => { const getList = async () => {
if (!queryParams.value.matrixId) { if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id); const res = await getProjectSquare(currentProject.value?.id);
if (!res.data || res.data.length === 0) { if (!res.data || res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵'); proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else { } else {
@ -424,7 +424,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -161,7 +161,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ProgressCategoryForm = { const initFormData: ProgressCategoryForm = {
id: undefined, id: undefined,
parentId: undefined, parentId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
matrixId: undefined, matrixId: undefined,
matrixName: undefined, matrixName: undefined,
name: undefined, name: undefined,
@ -182,7 +182,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
parentId: undefined, parentId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
matrixId: undefined, matrixId: undefined,
matrixName: undefined, matrixName: undefined,
name: undefined, name: undefined,
@ -217,7 +217,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询分项工程单价列表 */ /** 查询分项工程单价列表 */
const getList = async () => { const getList = async () => {
if (!queryParams.value.matrixId) { if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id); const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) { if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵'); proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else { } else {
@ -367,7 +367,7 @@ onMounted(() => {
}); });
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -309,7 +309,7 @@ const handleDelete = async (row: ProgressCategoryTemplateVO) => {
* 获取子项目列表 * 获取子项目列表
*/ */
const getSubProjectList = async () => { const getSubProjectList = async () => {
const res = await getChildProject(currentProject.value.id); const res = await getChildProject(currentProject.value?.id);
projectSon.value = res.data; projectSon.value = res.data;
queryParams.value.projectId = projectSon.value[0]?.id; queryParams.value.projectId = projectSon.value[0]?.id;
getList(); getList();

View File

@ -97,7 +97,7 @@ const queryParams = ref({
pid: undefined, pid: undefined,
name: undefined, name: undefined,
unitType: undefined, unitType: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
matrixId: undefined, matrixId: undefined,
params: {} params: {}
}); });
@ -382,7 +382,7 @@ const resetMatrix = () => {
/** 查询进度类别列表 */ /** 查询进度类别列表 */
const getList = async () => { const getList = async () => {
if (!queryParams.value.matrixId) { if (!queryParams.value.matrixId) {
const res = await getProjectSquare(currentProject.value.id); const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) { if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵'); proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
} else { } else {
@ -398,7 +398,7 @@ const getList = async () => {
} }
} }
loading.value = true; loading.value = true;
queryParams.value.projectId = currentProject.value.id; queryParams.value.projectId = currentProject.value?.id;
const res = await listProgressCategory(queryParams.value); const res = await listProgressCategory(queryParams.value);
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid'); const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid');
if (data) { if (data) {

View File

@ -247,7 +247,7 @@ const initFormData: AttendanceForm = {
clockRecord: undefined, clockRecord: undefined,
commuter: undefined, commuter: undefined,
dailyWage: undefined, dailyWage: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
lng: undefined, lng: undefined,
lat: undefined, lat: undefined,
remark: undefined, remark: undefined,
@ -263,7 +263,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({
clockDate: undefined, clockDate: undefined,
clockStatus: undefined, clockStatus: undefined,
commuter: undefined, commuter: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
typeOfWork: undefined, typeOfWork: undefined,
teamId: undefined, teamId: undefined,
params: {} params: {}
@ -454,7 +454,7 @@ const init = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -163,7 +163,7 @@ const resetQuery = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -84,7 +84,7 @@ const dialog = reactive<DialogOption>({
}); });
const initFormData: ConstructionBlacklistForm = { const initFormData: ConstructionBlacklistForm = {
projectId: currentProject.value.id, projectId: currentProject.value?.id,
userId: undefined, userId: undefined,
remark: undefined remark: undefined
}; };
@ -94,7 +94,7 @@ const data = reactive<PageData<ConstructionBlacklistForm, ConstructionBlacklistQ
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
userId: undefined, userId: undefined,
userName: undefined, userName: undefined,
sfzNumber: undefined, sfzNumber: undefined,
@ -159,7 +159,7 @@ const handleDelete = async (row?: ConstructionBlacklistVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -577,7 +577,7 @@ const initFormData: ConstructionUserForm = {
nickName: undefined, nickName: undefined,
facePic: undefined, facePic: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
status: undefined, status: undefined,
@ -614,7 +614,7 @@ const data = reactive({
openid: undefined, openid: undefined,
nickName: undefined, nickName: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
notUserRole: 1, notUserRole: 1,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
@ -783,7 +783,7 @@ const getContractorList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({ contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
value: contractor.id, value: contractor.id,
@ -909,7 +909,7 @@ const downloadTemplate = async () => {
text: 'Loading', text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id }); const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value?.id });
loadingInstance.close(); loadingInstance.close();
}; };
@ -959,7 +959,7 @@ const submitForm = () => {
console.log(valid); console.log(valid);
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false)); await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -980,7 +980,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
await addConstructionBlacklist({ await addConstructionBlacklist({
userId: row.id, userId: row.id,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
proxy?.$modal.msgSuccess('加入成功'); proxy?.$modal.msgSuccess('加入成功');
await getList(); await getList();
@ -1054,7 +1054,7 @@ const setSalary = async () => {
const handlePlayCardStatus = async (e) => { const handlePlayCardStatus = async (e) => {
playCardLoding.value = true; playCardLoding.value = true;
const clock = e ? 1 : 0; const clock = e ? 1 : 0;
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock }); await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
proxy?.$modal.msgSuccess('修改成功'); proxy?.$modal.msgSuccess('修改成功');
getList(); getList();
playCardLoding.value = false; playCardLoding.value = false;
@ -1071,7 +1071,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -155,7 +155,7 @@ const initFormData: ContractorForm = {
contractorType: undefined, contractorType: undefined,
fileMap: undefined, fileMap: undefined,
remark: undefined, remark: undefined,
projectId: currentProject.value.id projectId: currentProject.value?.id
}; };
const data = reactive<PageData<ContractorForm, ContractorQuery>>({ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
form: { ...initFormData }, form: { ...initFormData },
@ -170,7 +170,7 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
custodian: undefined, custodian: undefined,
custodianPhone: undefined, custodianPhone: undefined,
contractorType: undefined, contractorType: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
params: {} params: {}
}, },
rules: { rules: {
@ -255,7 +255,7 @@ const handleUpdate = async (row?: ContractorVO) => {
const submitForm = () => { const submitForm = () => {
contractorFormRef.value?.validate(async (valid: boolean) => { contractorFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
buttonLoading.value = true; buttonLoading.value = true;
if (form.value.id) { if (form.value.id) {
await updateContractor(form.value).finally(() => (buttonLoading.value = false)); await updateContractor(form.value).finally(() => (buttonLoading.value = false));
@ -299,7 +299,7 @@ const handleContractorFile = (row?: ContractorVO) => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -181,7 +181,7 @@ const dialogRecord = reactive<DialogOption>({
const initFormData: ContractorMaterialForm = { const initFormData: ContractorMaterialForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
materialName: undefined, materialName: undefined,
materialType: undefined, materialType: undefined,
@ -195,7 +195,7 @@ const data = reactive<PageData<ContractorMaterialForm, ContractorMaterialQuery>>
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
materialName: undefined, materialName: undefined,
materialType: undefined, materialType: undefined,
@ -215,7 +215,7 @@ const getSubList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorList.value = res.rows; contractorList.value = res.rows;
handleQuery(); handleQuery();
@ -307,7 +307,7 @@ const handleDelete = async (row?: ContractorMaterialVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -240,17 +240,17 @@ const initFormData: ContractorToolEntryForm = {
recordNumber: undefined recordNumber: undefined
}; };
const info = ref({ const info = ref({
contractorName:undefined, contractorName: undefined,
toolNumber:undefined, toolNumber: undefined,
toolName:undefined, toolName: undefined,
toolModel:undefined toolModel: undefined
}); });
const data = reactive<PageData<ContractorToolEntryForm, ContractorToolEntryQuery>>({ const data = reactive<PageData<ContractorToolEntryForm, ContractorToolEntryQuery>>({
form: { ...initFormData }, form: { ...initFormData },
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
contractorToolId: undefined, contractorToolId: undefined,
toolNumber: undefined, toolNumber: undefined,
@ -314,7 +314,7 @@ const handleAdd = (type, label) => {
titleLable.value = label; titleLable.value = label;
dialog.visible = true; dialog.visible = true;
form.value.recordType = type; form.value.recordType = type;
dialog.title = '工器具'+(type==1?'进场':'出场'); dialog.title = '工器具' + (type == 1 ? '进场' : '出场');
}; };
/** 修改按钮操作 */ /** 修改按钮操作 */
@ -364,12 +364,11 @@ const getAll = (obj) => {
initFormData.contractorToolId = obj.id; initFormData.contractorToolId = obj.id;
data.form.contractorToolId = obj.id; data.form.contractorToolId = obj.id;
data.queryParams.contractorToolId = obj.id; data.queryParams.contractorToolId = obj.id;
getDetail( obj.id); getDetail(obj.id);
getList(); getList();
}; };
defineExpose({ defineExpose({
getAll getAll
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules } = toRefs(data);
</script> </script>

View File

@ -172,7 +172,7 @@ const dialogLevan = reactive<DialogOption>({
const initFormData: ContractorToolForm = { const initFormData: ContractorToolForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
toolName: undefined, toolName: undefined,
toolType: undefined, toolType: undefined,
@ -186,7 +186,7 @@ const data = reactive<PageData<ContractorToolForm, ContractorToolQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
toolName: undefined, toolName: undefined,
toolType: undefined, toolType: undefined,
@ -210,7 +210,7 @@ const getSubList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorList.value = res.rows; contractorList.value = res.rows;
handleQuery(); handleQuery();
@ -302,7 +302,7 @@ const handleDelete = async (row?: ContractorToolVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -120,7 +120,7 @@ const dialog = reactive<DialogOption>({
const initFormData: EnterRoadForm = { const initFormData: EnterRoadForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
roadCode: undefined, roadCode: undefined,
roadName: undefined, roadName: undefined,
designCreateLength: undefined, designCreateLength: undefined,
@ -134,7 +134,7 @@ const data = reactive<PageData<EnterRoadForm, EnterRoadQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
roadCode: undefined, roadCode: undefined,
roadName: undefined, roadName: undefined,
designCreateLength: undefined, designCreateLength: undefined,
@ -167,7 +167,7 @@ const getListLand = async () => {
const res = await listLandBlock({ const res = await listLandBlock({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
landBlockList.value = res.rows; landBlockList.value = res.rows;
}; };
@ -247,7 +247,7 @@ const handleDelete = async (row?: EnterRoadVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getListLand(); getListLand();

View File

@ -14,7 +14,7 @@
<el-input v-model="queryParams.villageCommittee" placeholder="请输入所属村委会" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.villageCommittee" placeholder="请输入所属村委会" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="设计面积(亩)" prop="designArea"> <el-form-item label="设计面积(亩)" prop="designArea">
<el-input v-model="queryParams.designArea" type="number" placeholder="请输入设计面积" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.designArea" type="number" placeholder="请输入设计面积" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="地块数(块)" prop="blockCount"> <el-form-item label="地块数(块)" prop="blockCount">
<el-input v-model="queryParams.blockCount" type="number" placeholder="请输入地块数" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.blockCount" type="number" placeholder="请输入地块数" clearable @keyup.enter="handleQuery" />
@ -183,7 +183,7 @@ const dialogMatrix = reactive<DialogOption>({
const initFormData: LandBlockForm = { const initFormData: LandBlockForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landCode: undefined, landCode: undefined,
landName: undefined, landName: undefined,
villageCommittee: undefined, villageCommittee: undefined,
@ -200,7 +200,7 @@ const data = reactive({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landCode: undefined, landCode: undefined,
landName: undefined, landName: undefined,
villageCommittee: undefined, villageCommittee: undefined,
@ -305,7 +305,7 @@ const handleDelete = async (row?: LandBlockVO) => {
// 获取方阵列表 // 获取方阵列表
const getfangzhenList = async () => { const getfangzhenList = async () => {
loading.value = true; loading.value = true;
const res = await subMatrix(currentProject.value.id); const res = await subMatrix(currentProject.value?.id);
res.data.forEach((item) => { res.data.forEach((item) => {
item.children.forEach((item2) => { item.children.forEach((item2) => {
item2.matrixId = item2.name + '_' + item2.matrixId; item2.matrixId = item2.name + '_' + item2.matrixId;
@ -380,7 +380,7 @@ const resetMatrix = () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getfangzhenList(); getfangzhenList();

View File

@ -222,7 +222,7 @@ const dialog = reactive<DialogOption>({
const initFormData = { const initFormData = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -248,7 +248,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -372,18 +372,18 @@ const getListLand = async () => {
const res = await listLandBlock({ const res = await listLandBlock({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
landBlockList.value = res.rows; landBlockList.value = res.rows;
}; };
/** 查询进场道路信息列表 */ /** 查询进场道路信息列表 */
const getListRoad = async () => { const getListRoad = async () => {
const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value.id, landBlockId: form.value.landBlockId }); const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value?.id, landBlockId: form.value.landBlockId });
enterRoadList.value = res.rows; enterRoadList.value = res.rows;
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getListLand(); getListLand();

View File

@ -203,7 +203,7 @@ const dialog = reactive<DialogOption>({
const initFormData: LandTransferLedgerForm = { const initFormData: LandTransferLedgerForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -225,7 +225,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -344,18 +344,18 @@ const getListLand = async () => {
const res = await listLandBlock({ const res = await listLandBlock({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
landBlockList.value = res.rows; landBlockList.value = res.rows;
}; };
/** 查询进场道路信息列表 */ /** 查询进场道路信息列表 */
const getListRoad = async () => { const getListRoad = async () => {
const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value.id, landBlockId: form.value.landBlockId }); const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value?.id, landBlockId: form.value.landBlockId });
enterRoadList.value = res.rows; enterRoadList.value = res.rows;
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getListLand(); getListLand();

View File

@ -156,7 +156,7 @@ const dialog = reactive<DialogOption>({
const initFormData: NonTransferLedgerForm = { const initFormData: NonTransferLedgerForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -171,7 +171,7 @@ const data = reactive<PageData<NonTransferLedgerForm, NonTransferLedgerQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -278,13 +278,13 @@ const getListLand = async () => {
const res = await listLandBlock({ const res = await listLandBlock({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
landBlockList.value = res.rows; landBlockList.value = res.rows;
}; };
/** 查询进场道路信息列表 */ /** 查询进场道路信息列表 */
const getListRoad = async () => { const getListRoad = async () => {
const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value.id, landBlockId: form.value.landBlockId }); const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value?.id, landBlockId: form.value.landBlockId });
enterRoadList.value = res.rows; enterRoadList.value = res.rows;
}; };
// 选择地块 // 选择地块
@ -294,7 +294,7 @@ const handleLandBlockChange = (val) => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getListLand(); getListLand();

View File

@ -192,7 +192,7 @@ const dialog = reactive<DialogOption>({
const initFormData = { const initFormData = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -218,7 +218,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
landType: undefined, landType: undefined,
landBlockId: undefined, landBlockId: undefined,
enterRoadId: undefined, enterRoadId: undefined,
@ -342,18 +342,18 @@ const getListLand = async () => {
const res = await listLandBlock({ const res = await listLandBlock({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
landBlockList.value = res.rows; landBlockList.value = res.rows;
}; };
/** 查询进场道路信息列表 */ /** 查询进场道路信息列表 */
const getListRoad = async () => { const getListRoad = async () => {
const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value.id, landBlockId: form.value.landBlockId }); const res = await listEnterRoad({ pageNum: 1, pageSize: 10000, projectId: currentProject.value?.id, landBlockId: form.value.landBlockId });
enterRoadList.value = res.rows; enterRoadList.value = res.rows;
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getListLand(); getListLand();

View File

@ -410,7 +410,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -174,7 +174,7 @@ const props = defineProps<Props>();
// 是否可见 // 是否可见
const visible = ref(false); const visible = ref(false);
const initFormData: ProjectTeamMemberForm = { const initFormData: ProjectTeamMemberForm = {
projectId: currentProject.value.id projectId: currentProject.value?.id
}; };
const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({ const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
form: { ...initFormData }, form: { ...initFormData },
@ -183,7 +183,7 @@ const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
pageSize: 10, pageSize: 10,
orderByColumn: 'createTime', orderByColumn: 'createTime',
isAsc: 'desc', isAsc: 'desc',
projectId: currentProject.value.id projectId: currentProject.value?.id
}, },
rules: { rules: {
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }] id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
@ -263,7 +263,7 @@ const userQueryParams = ref<ConstructionUserQuery>({
pageSize: 10, pageSize: 10,
orderByColumn: 'createTime', orderByColumn: 'createTime',
isAsc: 'desc', isAsc: 'desc',
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
// 获取不在当前班组的成员 // 获取不在当前班组的成员

View File

@ -136,7 +136,7 @@ const dialog = reactive<DialogOption>({
const initFormData: ProjectTeamForm = { const initFormData: ProjectTeamForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
teamName: undefined, teamName: undefined,
isClockIn: undefined, isClockIn: undefined,
remark: undefined, remark: undefined,
@ -149,7 +149,7 @@ const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
pageSize: 10, pageSize: 10,
orderByColumn: 'createTime', orderByColumn: 'createTime',
isAsc: 'desc', isAsc: 'desc',
projectId: currentProject.value.id, projectId: currentProject.value?.id,
teamName: undefined, teamName: undefined,
isClockIn: undefined, isClockIn: undefined,
params: {}, params: {},
@ -232,7 +232,7 @@ const submitForm = () => {
projectTeamFormRef.value?.validate(async (valid: boolean) => { projectTeamFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateProjectTeam(form.value).finally(() => (buttonLoading.value = false)); await updateProjectTeam(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -266,7 +266,7 @@ const handleExport = () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -573,7 +573,7 @@ const initFormData: ConstructionUserForm = {
nickName: undefined, nickName: undefined,
facePic: undefined, facePic: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
status: undefined, status: undefined,
@ -610,7 +610,7 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
openid: undefined, openid: undefined,
nickName: undefined, nickName: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
status: undefined, status: undefined,
@ -778,7 +778,7 @@ const getContractorList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({ contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
value: contractor.id, value: contractor.id,
@ -904,7 +904,7 @@ const downloadTemplate = async () => {
text: 'Loading', text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id }); const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value?.id });
loadingInstance.close(); loadingInstance.close();
}; };
@ -954,7 +954,7 @@ const submitForm = () => {
console.log(valid); console.log(valid);
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false)); await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -975,7 +975,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
await addConstructionBlacklist({ await addConstructionBlacklist({
userId: row.id, userId: row.id,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
proxy?.$modal.msgSuccess('加入成功'); proxy?.$modal.msgSuccess('加入成功');
await getList(); await getList();
@ -1049,7 +1049,7 @@ const setSalary = async () => {
const handlePlayCardStatus = async (e) => { const handlePlayCardStatus = async (e) => {
playCardLoding.value = true; playCardLoding.value = true;
const clock = e ? 1 : 0; const clock = e ? 1 : 0;
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock }); await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
proxy?.$modal.msgSuccess('修改成功'); proxy?.$modal.msgSuccess('修改成功');
getList(); getList();
playCardLoding.value = false; playCardLoding.value = false;
@ -1066,7 +1066,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -364,7 +364,7 @@ const submitAudit = async () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -573,7 +573,7 @@ const initFormData: ConstructionUserForm = {
nickName: undefined, nickName: undefined,
facePic: undefined, facePic: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
status: undefined, status: undefined,
@ -610,7 +610,7 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
openid: undefined, openid: undefined,
nickName: undefined, nickName: undefined,
userName: undefined, userName: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
teamId: undefined, teamId: undefined,
status: undefined, status: undefined,
@ -778,7 +778,7 @@ const getContractorList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({ contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
value: contractor.id, value: contractor.id,
@ -904,7 +904,7 @@ const downloadTemplate = async () => {
text: 'Loading', text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id }); const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value?.id });
loadingInstance.close(); loadingInstance.close();
}; };
@ -954,7 +954,7 @@ const submitForm = () => {
console.log(valid); console.log(valid);
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false)); await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -975,7 +975,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false)); await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
await addConstructionBlacklist({ await addConstructionBlacklist({
userId: row.id, userId: row.id,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
proxy?.$modal.msgSuccess('加入成功'); proxy?.$modal.msgSuccess('加入成功');
await getList(); await getList();
@ -1049,7 +1049,7 @@ const setSalary = async () => {
const handlePlayCardStatus = async (e) => { const handlePlayCardStatus = async (e) => {
playCardLoding.value = true; playCardLoding.value = true;
const clock = e ? 1 : 0; const clock = e ? 1 : 0;
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock }); await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
proxy?.$modal.msgSuccess('修改成功'); proxy?.$modal.msgSuccess('修改成功');
getList(); getList();
playCardLoding.value = false; playCardLoding.value = false;
@ -1066,7 +1066,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -157,7 +157,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SubcontractForm = { const initFormData: SubcontractForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
contractFileId: undefined, contractFileId: undefined,
contractNumber: undefined, contractNumber: undefined,
@ -172,7 +172,7 @@ const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
contractorId: undefined, contractorId: undefined,
contractNumber: undefined, contractNumber: undefined,
contractName: undefined, contractName: undefined,
@ -205,7 +205,7 @@ const getSubList = async () => {
const res = await listContractor({ const res = await listContractor({
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
projectId: currentProject.value.id projectId: currentProject.value?.id
}); });
contractorList.value = res.rows; contractorList.value = res.rows;
@ -289,7 +289,7 @@ const handleDelete = async (row?: SubcontractVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -176,7 +176,7 @@ const dialog = reactive<DialogOption>({
const initFormData: WorkWageForm = { const initFormData: WorkWageForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
workType: undefined, workType: undefined,
isSpecialType: undefined, isSpecialType: undefined,
wageCalculationType: undefined, wageCalculationType: undefined,
@ -189,7 +189,7 @@ const data = reactive<PageData<WorkWageForm, WorkWageQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
workType: undefined, workType: undefined,
isSpecialType: undefined, isSpecialType: undefined,
wageCalculationType: undefined, wageCalculationType: undefined,
@ -266,7 +266,7 @@ const submitForm = () => {
workWageFormRef.value?.validate(async (valid: boolean) => { workWageFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateWorkWage(form.value).finally(() => (buttonLoading.value = false)); await updateWorkWage(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -301,7 +301,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -217,7 +217,7 @@ const handleDetail = async (row?: WorkerDailyReportVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -70,7 +70,7 @@ const ids = ref<string>('');
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
const param = reactive({ const param = reactive({
type: 2, type: 2,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}); });

View File

@ -133,7 +133,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QualityConstructionLogForm = { const initFormData: QualityConstructionLogForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
happenDate: undefined, happenDate: undefined,
productionStatus: undefined, productionStatus: undefined,
technologyQuality: undefined, technologyQuality: undefined,
@ -145,7 +145,7 @@ const data = reactive<PageData<QualityConstructionLogForm, QualityConstructionLo
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
happenDate: undefined, happenDate: undefined,
params: {} params: {}
}, },
@ -251,7 +251,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -261,7 +261,7 @@ const getList = async () => {
qualityInspectionList.value = res.rows; qualityInspectionList.value = res.rows;
total.value = res.total; total.value = res.total;
// 获取项目班组信息 // 获取项目班组信息
const teamRes = await listProjectTeamForeman(currentProject.value.id); const teamRes = await listProjectTeamForeman(currentProject.value?.id);
teamList.value = teamRes.data; teamList.value = teamRes.data;
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
label: team.teamName, label: team.teamName,
@ -372,7 +372,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -60,7 +60,7 @@ export default defineComponent({
tableData: [], tableData: [],
param: { param: {
type: 2, type: 2,
projectId: currentProject.value.id projectId: currentProject.value?.id
}, },
total: 0, total: 0,
ids: [] //所选择的文件 ids: [] //所选择的文件

View File

@ -128,7 +128,7 @@ export default defineComponent({
fileList: [], fileList: [],
activeName: 'first', activeName: 'first',
breadcrumbList: [{ id: 0, fileName: '目录' }], //菜单列表 breadcrumbList: [{ id: 0, fileName: '目录' }], //菜单列表
projectId: currentProject.value.id, projectId: currentProject.value?.id,
parentPid: '0', //父级的id 默认为0 parentPid: '0', //父级的id 默认为0
fileType: 0, //文件 或压缩文件 fileType: 0, //文件 或压缩文件
list: [ list: [
@ -202,7 +202,7 @@ export default defineComponent({
text: '正在查询文件……', text: '正在查询文件……',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
documentCompletionTreeStructure({ projectId: currentProject.value.id, pid: state.parentPid }).then((res: any) => { documentCompletionTreeStructure({ projectId: currentProject.value?.id, pid: state.parentPid }).then((res: any) => {
loading.close(); loading.close();
if (res.code == 200) { if (res.code == 200) {
state.fileList = res.data || []; state.fileList = res.data || [];

View File

@ -56,7 +56,7 @@ const ids = ref<string>('');
const tableData = ref<any[]>([]); const tableData = ref<any[]>([]);
const param = reactive({ const param = reactive({
type: 2, type: 2,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}); });
@ -67,7 +67,7 @@ const getDocumentDataList = () => {
loading.value = true; loading.value = true;
tableData.value = []; tableData.value = [];
value.value = '2'; value.value = '2';
param.projectId = currentProject.value.id; param.projectId = currentProject.value?.id;
documentDataAllList(param).then((res: any) => { documentDataAllList(param).then((res: any) => {
tableData.value = res.rows ?? []; tableData.value = res.rows ?? [];
total.value = res.total; total.value = res.total;

View File

@ -453,7 +453,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
state.projectId = nid; state.projectId = nid;
state.paramsQuery.projectId = nid; state.paramsQuery.projectId = nid;

View File

@ -125,7 +125,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionUserAnswerForm = { const initFormData: QuestionUserAnswerForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
userId: undefined, userId: undefined,
bankId: undefined, bankId: undefined,
answer: undefined, answer: undefined,
@ -145,7 +145,7 @@ const data = reactive<PageData<QuestionUserAnswerForm, QuestionUserAnswerQuery>>
userId: undefined, userId: undefined,
examType: undefined, examType: undefined,
teamId: undefined, teamId: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
userName: undefined, userName: undefined,
params: {} params: {}
}, },
@ -221,7 +221,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
// const fileWatch = watch( // const fileWatch = watch(
// () => filePath.value, // () => filePath.value,
// (nid, oid) => { // (nid, oid) => {
// uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value.id }).then((res) => { // uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value?.id }).then((res) => {
// console.log(res); // console.log(res);
// }); // });
// } // }
@ -229,7 +229,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -111,7 +111,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionsCategoryForm = { const initFormData: QuestionsCategoryForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
categoryName: undefined categoryName: undefined
}; };
const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({ const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
@ -119,7 +119,7 @@ const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
categoryName: undefined, categoryName: undefined,
params: {} params: {}
}, },
@ -194,7 +194,7 @@ const submitForm = () => {
questionsCategoryFormRef.value?.validate(async (valid: boolean) => { questionsCategoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false)); await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -218,7 +218,7 @@ const handleDelete = async (row?: QuestionsCategoryVO) => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionsConfigForm = { const initFormData: QuestionsConfigForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
singleChoice: undefined, singleChoice: undefined,
singleScore: undefined, singleScore: undefined,
multipleChoice: undefined, multipleChoice: undefined,
@ -181,7 +181,7 @@ const data = reactive<PageData<QuestionsConfigForm, QuestionsConfigQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
singleChoice: undefined, singleChoice: undefined,
singleScore: undefined, singleScore: undefined,
multipleChoice: undefined, multipleChoice: undefined,

View File

@ -270,7 +270,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
getList(); getList();

View File

@ -217,7 +217,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyInspectionForm = { const initFormData: SafetyInspectionForm = {
id: undefined, id: undefined,
pid: undefined, pid: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
checkType: undefined, checkType: undefined,
violationType: undefined, violationType: undefined,
inspectionResult: undefined, inspectionResult: undefined,
@ -247,7 +247,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
pageSize: 10, pageSize: 10,
id: undefined, id: undefined,
pid: undefined, pid: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
checkType: undefined, checkType: undefined,
violationType: undefined, violationType: undefined,
inspectionResult: undefined, inspectionResult: undefined,
@ -286,7 +286,7 @@ const getList = async () => {
safetyInspectionList.value = res.rows; safetyInspectionList.value = res.rows;
total.value = res.total; total.value = res.total;
// 获取项目班组信息 // 获取项目班组信息
const teamRes = await listProjectTeamForeman(currentProject.value.id); const teamRes = await listProjectTeamForeman(currentProject.value?.id);
teamList.value = teamRes.data; teamList.value = teamRes.data;
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
label: team.teamName, label: team.teamName,
@ -367,7 +367,7 @@ const submitForm = () => {
safetyInspectionFormRef.value?.validate(async (valid: boolean) => { safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false)); await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -402,7 +402,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyLogForm = { const initFormData: SafetyLogForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
dateOfOccurrence: undefined, dateOfOccurrence: undefined,
airTemperatureMax: undefined, airTemperatureMax: undefined,
airTemperatureMin: undefined, airTemperatureMin: undefined,
@ -188,7 +188,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
dateOfOccurrence: undefined, dateOfOccurrence: undefined,
airTemperatureMax: undefined, airTemperatureMax: undefined,
airTemperatureMin: undefined, airTemperatureMin: undefined,
@ -284,7 +284,7 @@ const submitForm = () => {
safetyLogFormRef.value?.validate(async (valid: boolean) => { safetyLogFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false)); await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -319,7 +319,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -142,7 +142,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyWeeklyReportForm = { const initFormData: SafetyWeeklyReportForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
week: undefined, week: undefined,
scope: undefined, scope: undefined,
scopeEnd: undefined, scopeEnd: undefined,
@ -155,7 +155,7 @@ const data = reactive<PageData<SafetyWeeklyReportForm, SafetyWeeklyReportQuery>>
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
week: undefined, week: undefined,
scopeDate: undefined, scopeDate: undefined,
remark: undefined, remark: undefined,
@ -231,7 +231,7 @@ const submitForm = () => {
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => { safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
buttonLoading.value = true; buttonLoading.value = true;
form.value.projectId = currentProject.value.id; form.value.projectId = currentProject.value?.id;
if (form.value.id) { if (form.value.id) {
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false)); await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
} else { } else {
@ -266,7 +266,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -135,7 +135,7 @@ const dialog = reactive<DialogOption>({
const initFormData: TeamMeetingForm = { const initFormData: TeamMeetingForm = {
id: undefined, id: undefined,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
teamId: undefined, teamId: undefined,
contractorId: undefined, contractorId: undefined,
meetingDate: undefined, meetingDate: undefined,
@ -150,7 +150,7 @@ const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
projectId: currentProject.value.id, projectId: currentProject.value?.id,
teamId: undefined, teamId: undefined,
contractorId: undefined, contractorId: undefined,
meetingDate: undefined, meetingDate: undefined,
@ -272,7 +272,7 @@ const handleExport = () => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;

View File

@ -267,7 +267,7 @@ onMounted(() => {
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
state.tableData.param.projectId = nid; state.tableData.param.projectId = nid;
initTableData(); initTableData();

View File

@ -493,7 +493,7 @@ const handleSubmit = async () => {
defFormRef.value.validate(async (valid: boolean) => { defFormRef.value.validate(async (valid: boolean) => {
if (valid) { if (valid) {
loading.value = true; loading.value = true;
form.value.flowCode = currentProject.value.id + '_' + form.value.flowCode; form.value.flowCode = currentProject.value?.id + '_' + form.value.flowCode;
if (form.value.id) { if (form.value.id) {
await edit(form.value).finally(() => (loading.value = false)); await edit(form.value).finally(() => (loading.value = false));
} else { } else {
@ -531,7 +531,7 @@ const handleExportDef = () => {
}; };
//监听项目id刷新数据 //监听项目id刷新数据
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid; queryParams.value.projectId = nid;
form.value.projectId = nid; form.value.projectId = nid;