This commit is contained in:
Teo
2025-08-14 01:58:00 +08:00
parent 606722f19e
commit 3158dc84f7
99 changed files with 620 additions and 554 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -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();

View File

@ -14,7 +14,7 @@
<el-input v-model="queryParams.villageCommittee" placeholder="请输入所属村委会" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="设计面积(亩)" prop="designArea">
<el-input v-model="queryParams.designArea" type="number" placeholder="请输入设计面积" clearable @keyup.enter="handleQuery" />
<el-input v-model="queryParams.designArea" type="number" placeholder="请输入设计面积" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="地块数(块)" prop="blockCount">
<el-input v-model="queryParams.blockCount" type="number" placeholder="请输入地块数" clearable @keyup.enter="handleQuery" />
@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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;

View File

@ -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
});
// 获取不在当前班组的成员

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;