feat: 完成巡检任务

This commit is contained in:
fyy
2025-07-15 16:12:11 +08:00
parent 1ed923c969
commit bd762452f8
7 changed files with 93 additions and 127 deletions

View File

@@ -67,6 +67,7 @@ const [BasicForm, formApi] = useVbenForm({
class: 'w-full',
disabled: isReadonly.value,
})),
schema: modalSchema(isReadonly.value),
},
// 1. 使用正确的属性名 handleValuesChange
handleValuesChange: async (values, fieldsChanged) => {
@@ -327,6 +328,8 @@ async function handleConfirm() {
return;
}
const data = cloneDeep(await formApi.getValues());
console.log(data);
// 单位数据缓存
if (unitListData.length === 0) {
const res = await resident_unitList();
@@ -340,10 +343,9 @@ async function handleConfirm() {
data.name = cleanObj ? cleanObj.name : data.name || '';
data.unitId = unitObj ? unitObj.id : isUpdate.value ? editUnitId.value : '';
data.sumPeices = Number(totalSumPeices.value)
// data.sumPeices = parseInt(totalSumPeices.value, 10);
// 组装 cleanIds
// data.cleanIds = detailTable.value.map((item: any) => item.id);
data.cleanList = detailTable.value;
if (data.starTime) data.starTime = dayjs(data.starTime).format('YYYY-MM-DD HH:mm:ss');
if (data.endTime) data.endTime = dayjs(data.endTime).format('YYYY-MM-DD HH:mm:ss');
isUpdate.value ? await clean_orderUpdate({...data,id:editCleanOrderId.value}) : await clean_orderAdd(data);
resetInitialized();
emit('reload');