设计出图
This commit is contained in:
@ -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({
|
||||
url: '/system/user/list',
|
||||
url: '/message/config/allUsersOfTheDepartment',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
|
@ -33,7 +33,6 @@ export interface ConfigVO {
|
||||
* 通知人
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface ConfigForm extends BaseEntity {
|
||||
@ -41,7 +40,10 @@ export interface ConfigForm extends BaseEntity {
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 通知部门
|
||||
*/
|
||||
deptId?: string | number;
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ -71,11 +73,9 @@ export interface ConfigForm extends BaseEntity {
|
||||
* 通知人
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface ConfigQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ -111,6 +111,3 @@ export interface ConfigQuery extends PageQuery {
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -271,7 +271,7 @@ const getList = async () => {
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total || 0;
|
||||
// 获取项目班组信息
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value.id);
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
||||
teamList.value = teamRes.data;
|
||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.teamName,
|
||||
@ -308,7 +308,7 @@ const resetForm = () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<<<<<<< HEAD
|
||||
<div class="billof-quantities">
|
||||
<!-- tabPosition="left" -->
|
||||
<el-tabs type="border-card" @tab-change="handleTabChange">
|
||||
@ -75,22 +76,119 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</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>
|
||||
|
||||
<script setup name="billofQuantities">
|
||||
import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue'
|
||||
import { obtainAllVersionNumbers, importExcelFile, obtainTheList, sheetList, detailsMaterialAndEquipmentApproval } from "@/api/design/billofQuantities/index"
|
||||
import { ref, reactive, onMounted, computed, toRefs, getCurrentInstance, nextTick } from 'vue';
|
||||
import {
|
||||
obtainAllVersionNumbers,
|
||||
importExcelFile,
|
||||
obtainTheList,
|
||||
sheetList,
|
||||
detailsMaterialAndEquipmentApproval
|
||||
} from '@/api/design/billofQuantities/index';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const userStore = useUserStoreHook();
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { work_order_type } = toRefs(proxy?.useDict('work_order_type'));
|
||||
const tableRef = ref({})
|
||||
const tableRef = ref({});
|
||||
console.log(currentProject.value);
|
||||
|
||||
// tableData
|
||||
// 版本号
|
||||
const state = reactive({
|
||||
<<<<<<< HEAD
|
||||
work_order_type: 0,
|
||||
// 版本号
|
||||
version_num: '',
|
||||
@ -118,23 +216,53 @@ const state = reactive({
|
||||
// 版本号
|
||||
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切换
|
||||
const handleTabChange = tab => {
|
||||
const handleTabChange = (tab) => {
|
||||
state.tableData = [];
|
||||
state.options = [];
|
||||
state.sheets = [];
|
||||
state.queryForm.sheet = '';
|
||||
state.queryForm.versions = '';
|
||||
state.work_order_type = tab
|
||||
state.work_order_type = tab;
|
||||
if (tab <= 2) {
|
||||
getVersionNums()
|
||||
} else {
|
||||
getVersionNums(false)
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getVersionNums();
|
||||
})
|
||||
} else {
|
||||
getVersionNums(false);
|
||||
}
|
||||
};
|
||||
onMounted(async () => {
|
||||
await getVersionNums();
|
||||
openTable(true, state.work_order_type);
|
||||
});
|
||||
// 获取版本号
|
||||
async function getVersionNums(isSheet = true) {
|
||||
try {
|
||||
@ -145,9 +273,10 @@ async function getVersionNums(isSheet = true) {
|
||||
projectId: currentProject.value?.id,
|
||||
workOrderType: state.work_order_type,
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
pageNum: 1
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
const { code, rows } = res || {};
|
||||
if (code === 200) {
|
||||
state.options = rows || [];
|
||||
@ -165,6 +294,21 @@ async function getVersionNums(isSheet = true) {
|
||||
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 {
|
||||
await handleQueryList(isSheet);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
state.error = `获取版本号失败: 错误码 ${code}`;
|
||||
console.error(state.error);
|
||||
@ -211,6 +355,7 @@ async function handleSheetName() {
|
||||
|
||||
// 获取列表
|
||||
async function handleQueryList(isSheet = true) {
|
||||
<<<<<<< HEAD
|
||||
if (isSheet && !state.queryForm.sheet) {
|
||||
console.warn('表名不存在,无法获取列表数据');
|
||||
return;
|
||||
@ -233,10 +378,38 @@ async function handleQueryList(isSheet = true) {
|
||||
console.error(state.error, err);
|
||||
} finally {
|
||||
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
|
||||
function importExcel(options) {
|
||||
<<<<<<< HEAD
|
||||
console.log(options);
|
||||
let formData = new FormData();
|
||||
formData.append("file", options.file);
|
||||
@ -253,7 +426,30 @@ function importExcel(options) {
|
||||
}
|
||||
}).finally(() => {
|
||||
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) {
|
||||
@ -263,7 +459,7 @@ function handleChange(sheet) {
|
||||
// 切换版本号
|
||||
function handleChangeVersion(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);
|
||||
state.sheets = [];
|
||||
handleQueryList();
|
||||
@ -272,7 +468,7 @@ function handleChangeVersion(versions) {
|
||||
function openTable(flag, index) {
|
||||
nextTick(() => {
|
||||
// 通过索引获取当前标签页的表格实例
|
||||
const currentTable = tableRef.value[index]
|
||||
const currentTable = tableRef.value[index];
|
||||
if (currentTable) {
|
||||
handleArr(state.tableData, flag, currentTable);
|
||||
}
|
||||
@ -287,7 +483,6 @@ function handleArr(arr, flag, table) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
function clickApprovalSheet(row) {
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
@ -296,7 +491,7 @@ function clickApprovalSheet(row) {
|
||||
query: {
|
||||
id: state.queryForm.versions,
|
||||
type: 'update'
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
// 审核流程
|
||||
@ -309,7 +504,6 @@ function lookApprovalFlow(row) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.billof-quantities {
|
||||
|
@ -60,7 +60,7 @@ const props = defineProps({
|
||||
const uploadParams = computed(() => {
|
||||
return {
|
||||
catalogueId: props.catalogueId,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -216,7 +216,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-table v-loading="loading" :data="drawingList" @selection-change="handleSelectionChange">
|
||||
<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">
|
||||
<template #default="scope">
|
||||
<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>
|
||||
</template>
|
||||
</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" class-name="small-padding " width="240">
|
||||
<template #default="scope">
|
||||
@ -55,6 +64,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
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({
|
||||
drawingList: {
|
||||
|
@ -38,7 +38,7 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</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">
|
||||
<DrawingTable
|
||||
:drawingList="drawingList"
|
||||
@ -81,7 +81,19 @@
|
||||
@cancel-process-apply="handleCancelProcessApply"
|
||||
/>
|
||||
</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" />
|
||||
</el-card>
|
||||
</div>
|
||||
@ -118,7 +130,6 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
fileName: undefined,
|
||||
fileType: 1,
|
||||
fileSuffix: undefined,
|
||||
fileStatus: undefined,
|
||||
originalName: undefined,
|
||||
@ -219,18 +230,12 @@ const handleCancelProcessApply = async (id: string) => {
|
||||
proxy?.$modal.msgSuccess('撤销成功');
|
||||
};
|
||||
|
||||
const handleClick = (val) => {
|
||||
queryParams.value.pageNum = 1;
|
||||
queryParams.value.fileType = val.props.name;
|
||||
getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -207,8 +207,8 @@ const formData = reactive<FormData>({
|
||||
professional: '',
|
||||
stage: '',
|
||||
volume: '',
|
||||
projectId: currentProject.value.id || '',
|
||||
projectName: currentProject.value.name || '',
|
||||
projectId: currentProject.value?.id || '',
|
||||
projectName: currentProject.value?.name || '',
|
||||
subprojectId: '',
|
||||
subprojectName: '',
|
||||
designer: '',
|
||||
@ -243,7 +243,7 @@ watch(
|
||||
);
|
||||
// 通过项目获取子项目 - 监听项目 id 变化,可自动获取子项目
|
||||
const getSubProject = async () => {
|
||||
let res = await subProjectListAll(currentProject.value.id);
|
||||
let res = await subProjectListAll(currentProject.value?.id);
|
||||
subProjectList.value = res.data;
|
||||
subProjectList.value.forEach((item: any) => {
|
||||
subProjectMap.set(item.id, item.projectName);
|
||||
|
@ -214,7 +214,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -306,7 +306,7 @@ const onLoad = async () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
byProjectIdAll();
|
||||
|
@ -213,7 +213,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -210,7 +210,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -103,7 +103,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SubcontractForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
subContent: undefined
|
||||
};
|
||||
const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
|
||||
@ -111,7 +111,7 @@ const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
subContent: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -224,7 +224,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -58,7 +58,7 @@ const ids = ref<string>('');
|
||||
const tableData = ref<any[]>([]);
|
||||
const param = reactive({
|
||||
type: 2,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
@ -456,7 +456,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
state.projectId = nid;
|
||||
state.paramsQuery.projectId = nid;
|
||||
|
@ -77,12 +77,12 @@
|
||||
</template>
|
||||
</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" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['out:monthPlan:remove']">查看文件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="300">
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
@ -183,6 +183,11 @@
|
||||
</el-link>
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.status == 1 ? 'success' : 'info'">{{ scope.row.status == 1 ? '使用中' : '已作废' }}</el-tag>
|
||||
@ -460,7 +465,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -126,7 +126,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: DroneConfigForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
configName: undefined,
|
||||
configUrl: undefined,
|
||||
dockSocketUrl: undefined,
|
||||
@ -141,7 +141,7 @@ const data = reactive<PageData<DroneConfigForm, DroneConfigQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
configName: undefined,
|
||||
configUrl: undefined,
|
||||
params: {}
|
||||
@ -249,7 +249,7 @@ const handleExport = () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -108,14 +108,14 @@ const currentProject = computed(() => userStore.selectedProject);
|
||||
|
||||
//获取施工人员信息
|
||||
const getConstructionUserData = async () => {
|
||||
const res = await getConstructionUserList({ projectId: currentProject.value.id });
|
||||
const res = await getConstructionUserList({ projectId: currentProject.value?.id });
|
||||
if (res.code !== 200) return;
|
||||
constructionUserData.value = res.data;
|
||||
};
|
||||
|
||||
//查询大屏机械列表
|
||||
const getMachineryData = async () => {
|
||||
const res = await getMachineryrList({ projectId: currentProject.value.id });
|
||||
const res = await getMachineryrList({ projectId: currentProject.value?.id });
|
||||
if (res.code !== 200) return;
|
||||
machineryOption.value = res.data;
|
||||
initMachinerycharts();
|
||||
@ -123,7 +123,7 @@ const getMachineryData = 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;
|
||||
orderOption.value = res.data;
|
||||
initOrderChart();
|
||||
|
@ -206,21 +206,21 @@ const classOptions = {
|
||||
|
||||
//获取质量信息
|
||||
const getQualityData = async () => {
|
||||
const res = await getQualityList({ projectId: currentProject.value.id });
|
||||
const res = await getQualityList({ projectId: currentProject.value?.id });
|
||||
if (res.code !== 200) return;
|
||||
qualityData.value = res.data;
|
||||
};
|
||||
|
||||
//获取大屏项目新闻列表
|
||||
const getProjectNewsData = async () => {
|
||||
const res = await getprojectNewsList({ projectId: currentProject.value.id });
|
||||
const res = await getprojectNewsList({ projectId: currentProject.value?.id });
|
||||
if (res.code !== 200) return;
|
||||
projectNewsData.value = res.data;
|
||||
};
|
||||
|
||||
//查询大屏安全信息
|
||||
const getsafetyInspectionData = async () => {
|
||||
const res = await getsafetyInspectionList({ projectId: currentProject.value.id });
|
||||
const res = await getsafetyInspectionList({ projectId: currentProject.value?.id });
|
||||
if (res.code !== 200) return;
|
||||
safetyInspectionData.value = res.data;
|
||||
};
|
||||
|
@ -80,12 +80,12 @@ const goHome = () => {
|
||||
};
|
||||
//获取天气
|
||||
const getweatherData = async () => {
|
||||
const res = await getweatherList(currentProject.value.id);
|
||||
const res = await getweatherList(currentProject.value?.id);
|
||||
weatherData.value = res.data;
|
||||
};
|
||||
//获取生产天数
|
||||
const getProductionDays = async () => {
|
||||
const res = await getSafetyDay(currentProject.value.id);
|
||||
const res = await getSafetyDay(currentProject.value?.id);
|
||||
safetyDay.value = res.data.safetyDay.toLocaleString();
|
||||
};
|
||||
//获取白天或夜晚
|
||||
|
@ -144,7 +144,7 @@ const initFormData: MachineryForm = {
|
||||
id: undefined,
|
||||
machineryName: undefined,
|
||||
machineryNumber: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
number: undefined,
|
||||
principal: undefined,
|
||||
remark: undefined,
|
||||
@ -158,7 +158,7 @@ const data = reactive<PageData<MachineryForm, MachineryQuery>>({
|
||||
pageSize: 10,
|
||||
machineryName: undefined,
|
||||
machineryNumber: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
number: undefined,
|
||||
principal: undefined,
|
||||
params: {},
|
||||
@ -234,7 +234,7 @@ const submitForm = () => {
|
||||
machineryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateMachinery(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -277,7 +277,7 @@ const handleAddMachineryDetail = (row?: MachineryVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -165,7 +165,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
getDeptAllUser(userStore.deptId).then(() => {
|
||||
designUser();
|
||||
|
@ -206,7 +206,7 @@ const initFormData: any = {
|
||||
planCode: undefined,
|
||||
matCat: undefined,
|
||||
status: undefined,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
},
|
||||
|
||||
planList: [
|
||||
@ -230,13 +230,13 @@ const data = reactive({
|
||||
pageSize: 10,
|
||||
planCode: undefined,
|
||||
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
},
|
||||
mainData: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
mrpBaseId: undefined,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
@ -316,7 +316,7 @@ const reset = () => {
|
||||
const status = form.value.mrpBaseBo.status;
|
||||
form.value = { ...initFormData, status }; // 重置但保留
|
||||
cailiaoshebeiFormRef.value?.resetFields();
|
||||
form.value.mrpBaseBo.projectId = currentProject.value.id;
|
||||
form.value.mrpBaseBo.projectId = currentProject.value?.id;
|
||||
form.value.planList = [
|
||||
{
|
||||
name: undefined,
|
||||
@ -385,7 +385,7 @@ const submitForm = async () => {
|
||||
await addCailiaoshebei({
|
||||
addDataList: cailiaoshebeiList.value,
|
||||
batchNumber: form.value.batchNumber,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
} as any).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
@ -466,7 +466,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.mainData.projectId = nid;
|
||||
|
||||
|
@ -149,7 +149,7 @@ const initFormData: any = {
|
||||
planCode: undefined,
|
||||
matCat: undefined,
|
||||
status: undefined,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
},
|
||||
|
||||
planList: [
|
||||
|
@ -287,7 +287,7 @@ const initFormData: CailiaoshebeiForm = {
|
||||
plan: undefined,
|
||||
realQuantity: undefined,
|
||||
approvalDesign: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
||||
@ -299,7 +299,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
supply: undefined,
|
||||
specification: undefined,
|
||||
signalment: undefined,
|
||||
@ -454,7 +454,7 @@ const submitForm = () => {
|
||||
const addBatch = async () => {
|
||||
await proxy?.$modal.confirm('是否确认新增批次?').finally(() => (loading.value = false));
|
||||
queryParams.value.batchNumber = '';
|
||||
await getBatch({ projectId: currentProject.value.id });
|
||||
await getBatch({ projectId: currentProject.value?.id });
|
||||
await getBatchList();
|
||||
proxy?.$modal.msgSuccess('新增成功');
|
||||
};
|
||||
@ -494,7 +494,7 @@ const handleExport = () => {
|
||||
const supplierOptions = ref([]);
|
||||
const getSupplierList = async () => {
|
||||
const res = await listContractor({
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
});
|
||||
@ -522,7 +522,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -134,7 +134,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: CompanyForm = {
|
||||
id: undefined,
|
||||
companyName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
qualification: undefined,
|
||||
@ -147,7 +147,7 @@ const data = reactive<PageData<CompanyForm, CompanyQuery>>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
companyName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
status: undefined,
|
||||
qualification: undefined,
|
||||
principalPhone: undefined,
|
||||
@ -226,7 +226,7 @@ const submitForm = () => {
|
||||
companyFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateCompany(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -261,7 +261,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -177,7 +177,7 @@ const initFormData: MaterialsForm = {
|
||||
id: undefined,
|
||||
materialsName: undefined,
|
||||
companyId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
typeSpecificationName: undefined,
|
||||
fileOssIdMap: undefined,
|
||||
usePart: undefined,
|
||||
@ -193,7 +193,7 @@ const data = reactive<PageData<MaterialsForm, MaterialsQuery>>({
|
||||
pageSize: 10,
|
||||
materialsName: undefined,
|
||||
companyId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
typeSpecificationName: undefined,
|
||||
fileOssIdMap: undefined,
|
||||
usePart: undefined,
|
||||
@ -225,7 +225,7 @@ const getCompanyList = async () => {
|
||||
const companyRes = await listCompany({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
companyOptions.value = companyRes.rows.map((company: CompanyVO) => ({
|
||||
value: company.id,
|
||||
@ -295,7 +295,7 @@ const submitForm = () => {
|
||||
materialsFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateMaterials({
|
||||
...form.value,
|
||||
@ -354,7 +354,7 @@ const handleOssUpdate = (ossId: string, value: string) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -450,7 +450,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -462,7 +462,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -449,7 +449,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -453,7 +453,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -179,7 +179,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: MaterialsInventoryForm = {
|
||||
id: undefined,
|
||||
materialsId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
outPut: undefined,
|
||||
number: undefined,
|
||||
outPutTime: undefined,
|
||||
@ -197,7 +197,7 @@ const data = reactive<PageData<MaterialsInventoryForm, MaterialsInventoryQuery>>
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
materialsId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
outPut: undefined,
|
||||
number: undefined,
|
||||
outPutTime: undefined,
|
||||
@ -275,7 +275,7 @@ const submitForm = () => {
|
||||
materialsInventoryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateMaterialsInventory(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -310,7 +310,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -192,7 +192,7 @@ const initFormData: CailiaoshebeiForm = {
|
||||
unit: undefined,
|
||||
plan: undefined,
|
||||
realQuantity: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
remark: undefined
|
||||
};
|
||||
const data = reactive<PageData<any, any>>({
|
||||
@ -204,7 +204,7 @@ const data = reactive<PageData<any, any>>({
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
supply: undefined,
|
||||
specification: undefined,
|
||||
signalment: undefined,
|
||||
@ -300,7 +300,7 @@ const handleSelectionChange = (selection: CailiaoshebeiVO[]) => {
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
listCailiaoshebei({
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
}).then((res) => {
|
||||
cailiaoshebeiAllList.value = res.rows;
|
||||
});
|
||||
@ -327,7 +327,7 @@ const onShare = () => {
|
||||
console.log(getToken());
|
||||
|
||||
// 跳转新的地址 传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');
|
||||
};
|
||||
/** 提交按钮 */
|
||||
@ -379,7 +379,7 @@ const submitTransferForm = async () => {
|
||||
/** 新增批次 */
|
||||
const addBatch = async () => {
|
||||
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);
|
||||
await getBatchList();
|
||||
|
||||
@ -410,7 +410,7 @@ const handleDelete = async (row?: CailiaoshebeiVO) => {
|
||||
const supplierOptions = ref([]);
|
||||
const getSupplierList = async () => {
|
||||
const res = await listContractor({
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
});
|
||||
@ -424,7 +424,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -230,7 +230,7 @@ const initFormData: CailiaoshebeiForm = {
|
||||
plan: undefined,
|
||||
file: null, // 确保初始化为null
|
||||
realQuantity: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
bo: {
|
||||
requiredTime: undefined,
|
||||
orderTime: undefined,
|
||||
@ -252,7 +252,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
supply: undefined,
|
||||
specification: undefined,
|
||||
signalment: undefined,
|
||||
@ -436,7 +436,7 @@ const handleChange = (value: number) => {
|
||||
const supplierOptions = ref([]);
|
||||
const getSupplierList = async () => {
|
||||
const res = await listContractor({
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
});
|
||||
@ -450,7 +450,7 @@ onMounted(() => {
|
||||
|
||||
// 监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -118,7 +118,7 @@ const route = useRoute();
|
||||
|
||||
const initFormData: RepertoryDetailsForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
repertoryId: undefined,
|
||||
materialsorderId: undefined,
|
||||
materialCode: undefined,
|
||||
@ -135,7 +135,7 @@ const data = reactive<PageData<RepertoryDetailsForm, RepertoryDetailsQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
repertoryId: undefined,
|
||||
materialsorderId: undefined,
|
||||
materialCode: undefined,
|
||||
@ -243,7 +243,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -153,7 +153,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -293,7 +293,7 @@ const initFormData: any = {
|
||||
unit: undefined,
|
||||
plan: undefined,
|
||||
realQuantity: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
approvalProject: undefined,
|
||||
|
||||
listOfMaterialInventory: [],
|
||||
@ -308,7 +308,7 @@ const data = reactive<PageData<any, any>>({
|
||||
supplierId: undefined,
|
||||
supplier: undefined,
|
||||
name: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
supply: undefined,
|
||||
specification: undefined,
|
||||
signalment: undefined,
|
||||
@ -485,7 +485,7 @@ const handleAudit = async () => {
|
||||
const supplierOptions = ref([]);
|
||||
const getSupplierList = async () => {
|
||||
const res = await listContractor({
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10000
|
||||
});
|
||||
@ -499,7 +499,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -72,9 +72,14 @@
|
||||
<el-form-item label="跳转路由" prop="route">
|
||||
<el-input v-model="form.route" placeholder="请输入跳转路由" />
|
||||
</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-select v-model="form.userId" placeholder="请选择通知人" multiple filterable>
|
||||
<el-option v-for="item in userList" :key="item.id" :label="item.nickName" :value="item.id" />
|
||||
<el-select v-model="form.userId" placeholder="请选择通知人" multiple filterable :disabled="!form.deptId">
|
||||
<el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -89,8 +94,9 @@
|
||||
</template>
|
||||
|
||||
<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 { listUser } from '@/api/system/user';
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@ -107,6 +113,9 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const userList = ref([]);
|
||||
const deptList = ref([]);
|
||||
|
||||
const deptId = ref('');
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const configFormRef = ref<ElFormInstance>();
|
||||
|
||||
@ -117,10 +126,11 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ConfigForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
msgName: undefined,
|
||||
msgContent: undefined,
|
||||
msgKey: undefined,
|
||||
deptId: undefined,
|
||||
route: undefined,
|
||||
userId: undefined
|
||||
};
|
||||
@ -129,7 +139,7 @@ const data = reactive<PageData<ConfigForm, ConfigQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
msgName: undefined,
|
||||
msgContent: undefined,
|
||||
msgKey: undefined,
|
||||
@ -167,7 +177,7 @@ const cancel = () => {
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
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({
|
||||
pageNum: 1,
|
||||
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;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getListUser();
|
||||
getDept();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -89,7 +89,7 @@ const tableData = ref({
|
||||
param: {
|
||||
pageNum: 1,
|
||||
pageSize: 4,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
}
|
||||
});
|
||||
|
||||
@ -132,7 +132,7 @@ const getCameraList = async () => {
|
||||
const res: any = await getCameraListByProjectId({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
|
||||
let list = res.rows?.list ?? [];
|
||||
@ -250,7 +250,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
// queryParams.value.projectId = nid;
|
||||
// form.value.projectId = nid;
|
||||
|
@ -337,7 +337,7 @@ const encryptChange = (row: Ys7DeviceVO | any) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
tableData.value.param.projectId = nid;
|
||||
initTableData();
|
||||
|
@ -258,7 +258,7 @@ const handleSelectionChange = (selection: ConstructionValueVO[]) => {
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
const res = await getProjectSquare(currentProject.value.id);
|
||||
const res = await getProjectSquare(currentProject.value?.id);
|
||||
if (res.data.length === 0) return proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
const isFangzhen = res.data.some((item) => item.children && item.children.length);
|
||||
console.log('🚀 ~ handleAdd ~ isFangzhen:', isFangzhen);
|
||||
@ -373,7 +373,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -276,7 +276,7 @@ const handleAudit = async (row?: MonthPlanVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
// const listeningProject = watch(
|
||||
// () => currentProject.value.id,
|
||||
// () => currentProject.value?.id,
|
||||
// (nid, oid) => {
|
||||
// queryParams.value.projectId = nid;
|
||||
// form.value.projectId = nid;
|
||||
|
@ -215,7 +215,7 @@ const handleUpdate = async (row?: MonthPlanVO) => {
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
monthPlanFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
@ -255,7 +255,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -188,7 +188,7 @@ const submitFlow = async () => {
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
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 = {
|
||||
|
@ -215,14 +215,13 @@ const handleDelete = async (row?: MonthPlanAuditVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -62,7 +62,7 @@ const data = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
valueType: '1',
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
month: undefined
|
||||
}
|
||||
});
|
||||
@ -111,7 +111,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -65,7 +65,7 @@ const data = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
valueType: '1',
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
month: undefined
|
||||
}
|
||||
});
|
||||
@ -119,7 +119,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -62,7 +62,7 @@ const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
month: undefined
|
||||
}
|
||||
});
|
||||
@ -111,7 +111,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -60,7 +60,7 @@ const data = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
valueType: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
month: undefined
|
||||
}
|
||||
});
|
||||
@ -114,7 +114,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -142,7 +142,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SettlementValueOwnerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
settlementValue: undefined,
|
||||
valueType: undefined,
|
||||
remark: undefined,
|
||||
@ -153,7 +153,7 @@ const data = reactive<PageData<SettlementValueOwnerForm, SettlementValueOwnerQue
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
settlementValue: undefined,
|
||||
valueType: undefined,
|
||||
settlementDate: undefined,
|
||||
@ -253,14 +253,13 @@ const handleDelete = async (row?: SettlementValueOwnerVO) => {
|
||||
await getList();
|
||||
};
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -179,7 +179,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SettlementValueSubcontractForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
documentCode: undefined,
|
||||
settlementDescribe: undefined,
|
||||
valueType: undefined,
|
||||
@ -198,7 +198,7 @@ const data = reactive<PageData<SettlementValueSubcontractForm, SettlementValueSu
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
documentCode: undefined,
|
||||
settlementDescribe: undefined,
|
||||
valueType: undefined,
|
||||
@ -235,7 +235,7 @@ const getList = async () => {
|
||||
//获取分包单位
|
||||
const contractorList = ref<ContractorVO[]>([]);
|
||||
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;
|
||||
};
|
||||
|
||||
@ -321,7 +321,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -106,7 +106,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ValueAllocationForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
ownerDesignValue: undefined,
|
||||
ownerPurchaseValue: undefined,
|
||||
ownerConstructionValue: undefined,
|
||||
@ -122,7 +122,7 @@ const data = reactive<PageData<ValueAllocationForm, ValueAllocationQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
ownerDesignValue: undefined,
|
||||
ownerPurchaseValue: undefined,
|
||||
ownerConstructionValue: undefined,
|
||||
@ -250,7 +250,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -198,7 +198,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ConstructionSchedulePlanForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
parentId: undefined,
|
||||
nodeName: undefined,
|
||||
projectStructure: undefined,
|
||||
@ -213,7 +213,7 @@ const initFormData: ConstructionSchedulePlanForm = {
|
||||
const data = reactive<PageData<ConstructionSchedulePlanForm, ConstructionSchedulePlanQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
parentId: undefined,
|
||||
nodeName: undefined,
|
||||
status: undefined,
|
||||
@ -348,7 +348,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -245,7 +245,7 @@ const initFormData: ProgressCategoryForm = {
|
||||
name: undefined,
|
||||
matrixId: undefined,
|
||||
unitType: undefined,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
};
|
||||
|
||||
const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
|
||||
@ -254,7 +254,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
|
||||
pid: undefined,
|
||||
name: undefined,
|
||||
unitType: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -272,7 +272,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询进度类别列表 */
|
||||
const getList = async () => {
|
||||
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) {
|
||||
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
} else {
|
||||
@ -424,7 +424,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -161,7 +161,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: ProgressCategoryForm = {
|
||||
id: undefined,
|
||||
parentId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
matrixName: undefined,
|
||||
name: undefined,
|
||||
@ -182,7 +182,7 @@ const data = reactive<PageData<ProgressCategoryForm, ProgressCategoryQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
parentId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
matrixName: undefined,
|
||||
name: undefined,
|
||||
@ -217,7 +217,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 查询分项工程单价列表 */
|
||||
const getList = async () => {
|
||||
if (!queryParams.value.matrixId) {
|
||||
const res = await getProjectSquare(currentProject.value.id);
|
||||
const res = await getProjectSquare(currentProject.value?.id);
|
||||
if (res.data.length === 0) {
|
||||
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
} else {
|
||||
@ -367,7 +367,7 @@ onMounted(() => {
|
||||
});
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -309,7 +309,7 @@ const handleDelete = async (row: ProgressCategoryTemplateVO) => {
|
||||
* 获取子项目列表
|
||||
*/
|
||||
const getSubProjectList = async () => {
|
||||
const res = await getChildProject(currentProject.value.id);
|
||||
const res = await getChildProject(currentProject.value?.id);
|
||||
projectSon.value = res.data;
|
||||
queryParams.value.projectId = projectSon.value[0]?.id;
|
||||
getList();
|
||||
|
@ -97,7 +97,7 @@ const queryParams = ref({
|
||||
pid: undefined,
|
||||
name: undefined,
|
||||
unitType: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
params: {}
|
||||
});
|
||||
@ -382,7 +382,7 @@ const resetMatrix = () => {
|
||||
/** 查询进度类别列表 */
|
||||
const getList = async () => {
|
||||
if (!queryParams.value.matrixId) {
|
||||
const res = await getProjectSquare(currentProject.value.id);
|
||||
const res = await getProjectSquare(currentProject.value?.id);
|
||||
if (res.data.length === 0) {
|
||||
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
} else {
|
||||
@ -398,7 +398,7 @@ const getList = async () => {
|
||||
}
|
||||
}
|
||||
loading.value = true;
|
||||
queryParams.value.projectId = currentProject.value.id;
|
||||
queryParams.value.projectId = currentProject.value?.id;
|
||||
const res = await listProgressCategory(queryParams.value);
|
||||
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid');
|
||||
if (data) {
|
||||
|
@ -247,7 +247,7 @@ const initFormData: AttendanceForm = {
|
||||
clockRecord: undefined,
|
||||
commuter: undefined,
|
||||
dailyWage: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
lng: undefined,
|
||||
lat: undefined,
|
||||
remark: undefined,
|
||||
@ -263,7 +263,7 @@ const data = reactive<PageData<AttendanceForm, AttendanceQuery>>({
|
||||
clockDate: undefined,
|
||||
clockStatus: undefined,
|
||||
commuter: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
typeOfWork: undefined,
|
||||
teamId: undefined,
|
||||
params: {}
|
||||
@ -454,7 +454,7 @@ const init = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -163,7 +163,7 @@ const resetQuery = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -84,7 +84,7 @@ const dialog = reactive<DialogOption>({
|
||||
});
|
||||
|
||||
const initFormData: ConstructionBlacklistForm = {
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
userId: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
@ -94,7 +94,7 @@ const data = reactive<PageData<ConstructionBlacklistForm, ConstructionBlacklistQ
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
userId: undefined,
|
||||
userName: undefined,
|
||||
sfzNumber: undefined,
|
||||
@ -159,7 +159,7 @@ const handleDelete = async (row?: ConstructionBlacklistVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -577,7 +577,7 @@ const initFormData: ConstructionUserForm = {
|
||||
nickName: undefined,
|
||||
facePic: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
@ -614,7 +614,7 @@ const data = reactive({
|
||||
openid: undefined,
|
||||
nickName: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
notUserRole: 1,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
@ -783,7 +783,7 @@ const getContractorList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
|
||||
value: contractor.id,
|
||||
@ -909,7 +909,7 @@ const downloadTemplate = async () => {
|
||||
text: 'Loading',
|
||||
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();
|
||||
};
|
||||
|
||||
@ -959,7 +959,7 @@ const submitForm = () => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -980,7 +980,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||
await addConstructionBlacklist({
|
||||
userId: row.id,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
proxy?.$modal.msgSuccess('加入成功');
|
||||
await getList();
|
||||
@ -1054,7 +1054,7 @@ const setSalary = async () => {
|
||||
const handlePlayCardStatus = async (e) => {
|
||||
playCardLoding.value = true;
|
||||
const clock = e ? 1 : 0;
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock });
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
@ -1071,7 +1071,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -155,7 +155,7 @@ const initFormData: ContractorForm = {
|
||||
contractorType: undefined,
|
||||
fileMap: undefined,
|
||||
remark: undefined,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
};
|
||||
const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -170,7 +170,7 @@ const data = reactive<PageData<ContractorForm, ContractorQuery>>({
|
||||
custodian: undefined,
|
||||
custodianPhone: undefined,
|
||||
contractorType: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
@ -255,7 +255,7 @@ const handleUpdate = async (row?: ContractorVO) => {
|
||||
const submitForm = () => {
|
||||
contractorFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
|
||||
@ -299,7 +299,7 @@ const handleContractorFile = (row?: ContractorVO) => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -181,7 +181,7 @@ const dialogRecord = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ContractorMaterialForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
materialName: undefined,
|
||||
materialType: undefined,
|
||||
@ -195,7 +195,7 @@ const data = reactive<PageData<ContractorMaterialForm, ContractorMaterialQuery>>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
materialName: undefined,
|
||||
materialType: undefined,
|
||||
@ -215,7 +215,7 @@ const getSubList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorList.value = res.rows;
|
||||
handleQuery();
|
||||
@ -307,7 +307,7 @@ const handleDelete = async (row?: ContractorMaterialVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -250,7 +250,7 @@ const data = reactive<PageData<ContractorToolEntryForm, ContractorToolEntryQuery
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
contractorToolId: undefined,
|
||||
toolNumber: undefined,
|
||||
@ -371,5 +371,4 @@ defineExpose({
|
||||
getAll
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
</script>
|
||||
|
@ -172,7 +172,7 @@ const dialogLevan = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ContractorToolForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
toolName: undefined,
|
||||
toolType: undefined,
|
||||
@ -186,7 +186,7 @@ const data = reactive<PageData<ContractorToolForm, ContractorToolQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
toolName: undefined,
|
||||
toolType: undefined,
|
||||
@ -210,7 +210,7 @@ const getSubList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorList.value = res.rows;
|
||||
handleQuery();
|
||||
@ -302,7 +302,7 @@ const handleDelete = async (row?: ContractorToolVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -120,7 +120,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: EnterRoadForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
roadCode: undefined,
|
||||
roadName: undefined,
|
||||
designCreateLength: undefined,
|
||||
@ -134,7 +134,7 @@ const data = reactive<PageData<EnterRoadForm, EnterRoadQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
roadCode: undefined,
|
||||
roadName: undefined,
|
||||
designCreateLength: undefined,
|
||||
@ -167,7 +167,7 @@ const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
};
|
||||
@ -247,7 +247,7 @@ const handleDelete = async (row?: EnterRoadVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getListLand();
|
||||
|
@ -183,7 +183,7 @@ const dialogMatrix = reactive<DialogOption>({
|
||||
|
||||
const initFormData: LandBlockForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landCode: undefined,
|
||||
landName: undefined,
|
||||
villageCommittee: undefined,
|
||||
@ -200,7 +200,7 @@ const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landCode: undefined,
|
||||
landName: undefined,
|
||||
villageCommittee: undefined,
|
||||
@ -305,7 +305,7 @@ const handleDelete = async (row?: LandBlockVO) => {
|
||||
// 获取方阵列表
|
||||
const getfangzhenList = async () => {
|
||||
loading.value = true;
|
||||
const res = await subMatrix(currentProject.value.id);
|
||||
const res = await subMatrix(currentProject.value?.id);
|
||||
res.data.forEach((item) => {
|
||||
item.children.forEach((item2) => {
|
||||
item2.matrixId = item2.name + '_' + item2.matrixId;
|
||||
@ -380,7 +380,7 @@ const resetMatrix = () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getfangzhenList();
|
||||
|
@ -222,7 +222,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -248,7 +248,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -372,18 +372,18 @@ const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
};
|
||||
/** 查询进场道路信息列表 */
|
||||
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;
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getListLand();
|
||||
|
@ -203,7 +203,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: LandTransferLedgerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -225,7 +225,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -344,18 +344,18 @@ const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
};
|
||||
/** 查询进场道路信息列表 */
|
||||
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;
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getListLand();
|
||||
|
@ -156,7 +156,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: NonTransferLedgerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -171,7 +171,7 @@ const data = reactive<PageData<NonTransferLedgerForm, NonTransferLedgerQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -278,13 +278,13 @@ const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
};
|
||||
/** 查询进场道路信息列表 */
|
||||
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;
|
||||
};
|
||||
// 选择地块
|
||||
@ -294,7 +294,7 @@ const handleLandBlockChange = (val) => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getListLand();
|
||||
|
@ -192,7 +192,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -218,7 +218,7 @@ const data = reactive<PageData<LandTransferLedgerForm, LandTransferLedgerQuery>>
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
landType: undefined,
|
||||
landBlockId: undefined,
|
||||
enterRoadId: undefined,
|
||||
@ -342,18 +342,18 @@ const getListLand = async () => {
|
||||
const res = await listLandBlock({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
landBlockList.value = res.rows;
|
||||
};
|
||||
/** 查询进场道路信息列表 */
|
||||
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;
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getListLand();
|
||||
|
@ -410,7 +410,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -174,7 +174,7 @@ const props = defineProps<Props>();
|
||||
// 是否可见
|
||||
const visible = ref(false);
|
||||
const initFormData: ProjectTeamMemberForm = {
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
};
|
||||
const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
|
||||
form: { ...initFormData },
|
||||
@ -183,7 +183,7 @@ const data = reactive<PageData<ProjectTeamMemberForm, ProjectTeamMemberQuery>>({
|
||||
pageSize: 10,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc',
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }]
|
||||
@ -263,7 +263,7 @@ const userQueryParams = ref<ConstructionUserQuery>({
|
||||
pageSize: 10,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc',
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
|
||||
// 获取不在当前班组的成员
|
||||
|
@ -136,7 +136,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ProjectTeamForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
remark: undefined,
|
||||
@ -149,7 +149,7 @@ const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({
|
||||
pageSize: 10,
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc',
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
teamName: undefined,
|
||||
isClockIn: undefined,
|
||||
params: {},
|
||||
@ -232,7 +232,7 @@ const submitForm = () => {
|
||||
projectTeamFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateProjectTeam(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -266,7 +266,7 @@ const handleExport = () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -573,7 +573,7 @@ const initFormData: ConstructionUserForm = {
|
||||
nickName: undefined,
|
||||
facePic: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
@ -610,7 +610,7 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
|
||||
openid: undefined,
|
||||
nickName: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
@ -778,7 +778,7 @@ const getContractorList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
|
||||
value: contractor.id,
|
||||
@ -904,7 +904,7 @@ const downloadTemplate = async () => {
|
||||
text: 'Loading',
|
||||
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();
|
||||
};
|
||||
|
||||
@ -954,7 +954,7 @@ const submitForm = () => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -975,7 +975,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||
await addConstructionBlacklist({
|
||||
userId: row.id,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
proxy?.$modal.msgSuccess('加入成功');
|
||||
await getList();
|
||||
@ -1049,7 +1049,7 @@ const setSalary = async () => {
|
||||
const handlePlayCardStatus = async (e) => {
|
||||
playCardLoding.value = true;
|
||||
const clock = e ? 1 : 0;
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock });
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
@ -1066,7 +1066,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -364,7 +364,7 @@ const submitAudit = async () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -573,7 +573,7 @@ const initFormData: ConstructionUserForm = {
|
||||
nickName: undefined,
|
||||
facePic: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
@ -610,7 +610,7 @@ const data = reactive<PageData<ConstructionUserForm, ConstructionUserQuery>>({
|
||||
openid: undefined,
|
||||
nickName: undefined,
|
||||
userName: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
teamId: undefined,
|
||||
status: undefined,
|
||||
@ -778,7 +778,7 @@ const getContractorList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorOpt.value = res.rows.map((contractor: ContractorVO) => ({
|
||||
value: contractor.id,
|
||||
@ -904,7 +904,7 @@ const downloadTemplate = async () => {
|
||||
text: 'Loading',
|
||||
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();
|
||||
};
|
||||
|
||||
@ -954,7 +954,7 @@ const submitForm = () => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -975,7 +975,7 @@ const handleJoinBlacklist = async (row?: ConstructionUserVO) => {
|
||||
await proxy?.$modal.confirm('确认要将该员工加入黑名单吗?').finally(() => (loading.value = false));
|
||||
await addConstructionBlacklist({
|
||||
userId: row.id,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
proxy?.$modal.msgSuccess('加入成功');
|
||||
await getList();
|
||||
@ -1049,7 +1049,7 @@ const setSalary = async () => {
|
||||
const handlePlayCardStatus = async (e) => {
|
||||
playCardLoding.value = true;
|
||||
const clock = e ? 1 : 0;
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock });
|
||||
await updateConstructionUserPlayCardStatus({ projectId: currentProject.value?.id, clock });
|
||||
proxy?.$modal.msgSuccess('修改成功');
|
||||
getList();
|
||||
playCardLoding.value = false;
|
||||
@ -1066,7 +1066,7 @@ const handleClockStatus = async (row: ConstructionUserVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -157,7 +157,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SubcontractForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
contractFileId: undefined,
|
||||
contractNumber: undefined,
|
||||
@ -172,7 +172,7 @@ const data = reactive<PageData<SubcontractForm, SubcontractQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
contractorId: undefined,
|
||||
contractNumber: undefined,
|
||||
contractName: undefined,
|
||||
@ -205,7 +205,7 @@ const getSubList = async () => {
|
||||
const res = await listContractor({
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
contractorList.value = res.rows;
|
||||
|
||||
@ -289,7 +289,7 @@ const handleDelete = async (row?: SubcontractVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -176,7 +176,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: WorkWageForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
workType: undefined,
|
||||
isSpecialType: undefined,
|
||||
wageCalculationType: undefined,
|
||||
@ -189,7 +189,7 @@ const data = reactive<PageData<WorkWageForm, WorkWageQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
workType: undefined,
|
||||
isSpecialType: undefined,
|
||||
wageCalculationType: undefined,
|
||||
@ -266,7 +266,7 @@ const submitForm = () => {
|
||||
workWageFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateWorkWage(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -301,7 +301,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -217,7 +217,7 @@ const handleDetail = async (row?: WorkerDailyReportVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -70,7 +70,7 @@ const ids = ref<string>('');
|
||||
const tableData = ref<any[]>([]);
|
||||
const param = reactive({
|
||||
type: 2,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
|
@ -133,7 +133,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: QualityConstructionLogForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
happenDate: undefined,
|
||||
productionStatus: undefined,
|
||||
technologyQuality: undefined,
|
||||
@ -145,7 +145,7 @@ const data = reactive<PageData<QualityConstructionLogForm, QualityConstructionLo
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
happenDate: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -251,7 +251,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -261,7 +261,7 @@ const getList = async () => {
|
||||
qualityInspectionList.value = res.rows;
|
||||
total.value = res.total;
|
||||
// 获取项目班组信息
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value.id);
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
||||
teamList.value = teamRes.data;
|
||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.teamName,
|
||||
@ -372,7 +372,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -60,7 +60,7 @@ export default defineComponent({
|
||||
tableData: [],
|
||||
param: {
|
||||
type: 2,
|
||||
projectId: currentProject.value.id
|
||||
projectId: currentProject.value?.id
|
||||
},
|
||||
total: 0,
|
||||
ids: [] //所选择的文件
|
||||
|
@ -128,7 +128,7 @@ export default defineComponent({
|
||||
fileList: [],
|
||||
activeName: 'first',
|
||||
breadcrumbList: [{ id: 0, fileName: '目录' }], //菜单列表
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
parentPid: '0', //父级的id 默认为0
|
||||
fileType: 0, //文件 或压缩文件
|
||||
list: [
|
||||
@ -202,7 +202,7 @@ export default defineComponent({
|
||||
text: '正在查询文件……',
|
||||
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();
|
||||
if (res.code == 200) {
|
||||
state.fileList = res.data || [];
|
||||
|
@ -56,7 +56,7 @@ const ids = ref<string>('');
|
||||
const tableData = ref<any[]>([]);
|
||||
const param = reactive({
|
||||
type: 2,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
@ -67,7 +67,7 @@ const getDocumentDataList = () => {
|
||||
loading.value = true;
|
||||
tableData.value = [];
|
||||
value.value = '2';
|
||||
param.projectId = currentProject.value.id;
|
||||
param.projectId = currentProject.value?.id;
|
||||
documentDataAllList(param).then((res: any) => {
|
||||
tableData.value = res.rows ?? [];
|
||||
total.value = res.total;
|
||||
|
@ -453,7 +453,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
state.projectId = nid;
|
||||
state.paramsQuery.projectId = nid;
|
||||
|
@ -125,7 +125,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: QuestionUserAnswerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
userId: undefined,
|
||||
bankId: undefined,
|
||||
answer: undefined,
|
||||
@ -145,7 +145,7 @@ const data = reactive<PageData<QuestionUserAnswerForm, QuestionUserAnswerQuery>>
|
||||
userId: undefined,
|
||||
examType: undefined,
|
||||
teamId: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
userName: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -221,7 +221,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
|
||||
// const fileWatch = watch(
|
||||
// () => filePath.value,
|
||||
// (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);
|
||||
// });
|
||||
// }
|
||||
@ -229,7 +229,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -111,7 +111,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: QuestionsCategoryForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
categoryName: undefined
|
||||
};
|
||||
const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
|
||||
@ -119,7 +119,7 @@ const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
categoryName: undefined,
|
||||
params: {}
|
||||
},
|
||||
@ -194,7 +194,7 @@ const submitForm = () => {
|
||||
questionsCategoryFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -218,7 +218,7 @@ const handleDelete = async (row?: QuestionsCategoryVO) => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: QuestionsConfigForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
singleChoice: undefined,
|
||||
singleScore: undefined,
|
||||
multipleChoice: undefined,
|
||||
@ -181,7 +181,7 @@ const data = reactive<PageData<QuestionsConfigForm, QuestionsConfigQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
singleChoice: undefined,
|
||||
singleScore: undefined,
|
||||
multipleChoice: undefined,
|
||||
|
@ -270,7 +270,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
getList();
|
||||
|
@ -217,7 +217,7 @@ const dialog = reactive<DialogOption>({
|
||||
const initFormData: SafetyInspectionForm = {
|
||||
id: undefined,
|
||||
pid: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
checkType: undefined,
|
||||
violationType: undefined,
|
||||
inspectionResult: undefined,
|
||||
@ -247,7 +247,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
pid: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
checkType: undefined,
|
||||
violationType: undefined,
|
||||
inspectionResult: undefined,
|
||||
@ -286,7 +286,7 @@ const getList = async () => {
|
||||
safetyInspectionList.value = res.rows;
|
||||
total.value = res.total;
|
||||
// 获取项目班组信息
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value.id);
|
||||
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
|
||||
teamList.value = teamRes.data;
|
||||
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
|
||||
label: team.teamName,
|
||||
@ -367,7 +367,7 @@ const submitForm = () => {
|
||||
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -402,7 +402,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SafetyLogForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
dateOfOccurrence: undefined,
|
||||
airTemperatureMax: undefined,
|
||||
airTemperatureMin: undefined,
|
||||
@ -188,7 +188,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
dateOfOccurrence: undefined,
|
||||
airTemperatureMax: undefined,
|
||||
airTemperatureMin: undefined,
|
||||
@ -284,7 +284,7 @@ const submitForm = () => {
|
||||
safetyLogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -319,7 +319,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -142,7 +142,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: SafetyWeeklyReportForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
week: undefined,
|
||||
scope: undefined,
|
||||
scopeEnd: undefined,
|
||||
@ -155,7 +155,7 @@ const data = reactive<PageData<SafetyWeeklyReportForm, SafetyWeeklyReportQuery>>
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
week: undefined,
|
||||
scopeDate: undefined,
|
||||
remark: undefined,
|
||||
@ -231,7 +231,7 @@ const submitForm = () => {
|
||||
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.projectId = currentProject.value.id;
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
if (form.value.id) {
|
||||
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
@ -266,7 +266,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -135,7 +135,7 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: TeamMeetingForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
teamId: undefined,
|
||||
contractorId: undefined,
|
||||
meetingDate: undefined,
|
||||
@ -150,7 +150,7 @@ const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value.id,
|
||||
projectId: currentProject.value?.id,
|
||||
teamId: undefined,
|
||||
contractorId: undefined,
|
||||
meetingDate: undefined,
|
||||
@ -272,7 +272,7 @@ const handleExport = () => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
@ -267,7 +267,7 @@ onMounted(() => {
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
state.tableData.param.projectId = nid;
|
||||
initTableData();
|
||||
|
@ -493,7 +493,7 @@ const handleSubmit = async () => {
|
||||
defFormRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
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) {
|
||||
await edit(form.value).finally(() => (loading.value = false));
|
||||
} else {
|
||||
@ -531,7 +531,7 @@ const handleExportDef = () => {
|
||||
};
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value.id,
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
|
Reference in New Issue
Block a user