物流新增待办的需求时间的逻辑
This commit is contained in:
@@ -146,6 +146,8 @@
|
||||
},
|
||||
endTime: {
|
||||
remarkText: endTimeRemark,
|
||||
'disabled-date': disabledEndDateFun,
|
||||
'disabled-hours': disabledEndHoursFun,
|
||||
},
|
||||
attachments: {
|
||||
remarkText: attachmentRemark,
|
||||
@@ -228,6 +230,7 @@ import { getAttachmentsRemark, getDemandHideKeys } from '@/tenants/lyric/views/t
|
||||
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
|
||||
import { FILE_TYPE } from '@/utils/enum/file';
|
||||
import { jumpPage } from '@/utils/common';
|
||||
import dayjs from 'dayjs';
|
||||
// import emitter from '@/utils/eventBus';
|
||||
|
||||
// const env = import.meta.env;
|
||||
@@ -654,7 +657,7 @@ const simulationTypeList = ref(commonStore.getDictData('SIMULATION_TYPE').A);
|
||||
const simulationType = ref(simulationTypeList.value[0].value);
|
||||
|
||||
const attachmentRemark = ref('');
|
||||
const endTimeRemark = ref('【需求时间】请参考发图时间与客户评审时间');
|
||||
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
|
||||
const simTypeTipText = ref(`
|
||||
流体仿真:(结构风速、除尘、氮气保护等分析)
|
||||
结构仿真:(结构受力、变形、校核、应力、支反力、扭矩等分析)
|
||||
@@ -986,6 +989,34 @@ const loadTableForm = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const disabledEndDateFun = (time: any) => {
|
||||
if (simulationType.value.includes('物流')) {
|
||||
return new Date().getTime() + 2 * 24 * 60 * 60 * 1000 > time.getTime();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const disabledEndHoursFun = () => {
|
||||
// 物流仿真只能选择三天后的时间,精确到小时
|
||||
if (simulationType.value.includes('物流')) {
|
||||
const currentTime = new Date(editFormInfo.value.endTime).getTime();
|
||||
if (
|
||||
new Date().getTime() + 2 * 24 * 60 * 60 * 1000 <= currentTime &&
|
||||
new Date().getTime() + 3 * 24 * 60 * 60 * 1000 >= currentTime
|
||||
) {
|
||||
const hour = dayjs(new Date()).get('hour');
|
||||
const num = [];
|
||||
for (let index = 0; index < 24; index++) {
|
||||
if (hour > index) {
|
||||
num.push(index);
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
return [];
|
||||
};
|
||||
|
||||
// const searchChange = async (val: any) => {
|
||||
// const optionList = await getPhaseList(nodeType, nodeId);
|
||||
// tableFormRef.value.setOptionsFun(nextKey, optionList);
|
||||
|
||||
Reference in New Issue
Block a user