feat: 完成巡检任务
This commit is contained in:
@@ -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');
|
||||
|
@@ -131,7 +131,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
export const modalSchema: (isReadonly: boolean) => FormSchema[] = (isReadonly) => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
@@ -167,7 +167,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
placeholder: !values.starTime?'请先选择开始时间':`请选择结束时间(结束时间不能早于开始时间)`,
|
||||
disabled: !values.starTime, // 没选开始时间时禁用
|
||||
disabled: isReadonly || !values.starTime, // 没选开始时间时禁用
|
||||
disabledDate: (current:any) => {
|
||||
if (!values.starTime) return false;
|
||||
// 只允许选择大于等于开始时间的日期
|
||||
|
Reference in New Issue
Block a user