mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
feat:项目编辑,项目的开始时间不能选择开始时间之后的时间。
This commit is contained in:
@@ -97,7 +97,23 @@
|
|||||||
<div class="inname">项目时间</div>
|
<div class="inname">项目时间</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in">
|
<div v-if="projectInfo.projectId" class="in">
|
||||||
|
<a-range-picker
|
||||||
|
separator="至"
|
||||||
|
:show-time="{ format: 'HH:mm' }"
|
||||||
|
:placeholder="[' 开始时间', ' 结束时间']"
|
||||||
|
:disabled-date="disabledDate1"
|
||||||
|
v-model:value="projectInfo.rangeTime"
|
||||||
|
style="width: 100%; height: 40px; border-radius: 5px"
|
||||||
|
:allowClear="false"
|
||||||
|
valueFormat="YYYY-MM-DD HH:mm"
|
||||||
|
@change="timeChange"
|
||||||
|
@ok="clickOk"
|
||||||
|
@openChange="panelOpen"
|
||||||
|
:disabled="viewDetail ? true : false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else class="in">
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
separator="至"
|
separator="至"
|
||||||
:show-time="{ format: 'HH:mm' }"
|
:show-time="{ format: 'HH:mm' }"
|
||||||
@@ -292,6 +308,7 @@ import { message } from "ant-design-vue";
|
|||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import * as api from "../../api/index";
|
import * as api from "../../api/index";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
|
import * as moment from "moment";
|
||||||
// import ProjectClass from "@/components/project/ProjectClass";
|
// import ProjectClass from "@/components/project/ProjectClass";
|
||||||
import TrainClass from "@/components/project/TrainClass";
|
import TrainClass from "@/components/project/TrainClass";
|
||||||
import OrgClass from "@/components/project/OrgClass";
|
import OrgClass from "@/components/project/OrgClass";
|
||||||
@@ -335,6 +352,8 @@ export default {
|
|||||||
courseSyncFlag: true,
|
courseSyncFlag: true,
|
||||||
auditDescription: "",
|
auditDescription: "",
|
||||||
ptojectType: "",
|
ptojectType: "",
|
||||||
|
changeCondition: false,
|
||||||
|
clickNum: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 封面图选择
|
// 封面图选择
|
||||||
@@ -382,6 +401,14 @@ export default {
|
|||||||
state.projectInfo.beginTime,
|
state.projectInfo.beginTime,
|
||||||
state.projectInfo.endTime,
|
state.projectInfo.endTime,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
state.projectInfo.rangeTime1 = [
|
||||||
|
state.projectInfo.beginTime,
|
||||||
|
state.projectInfo.endTime,
|
||||||
|
];
|
||||||
|
|
||||||
|
state.projectInfo.edits = true;
|
||||||
|
|
||||||
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
||||||
if (Number(state.projectInfo.status) === -5) {
|
if (Number(state.projectInfo.status) === -5) {
|
||||||
let obj = {
|
let obj = {
|
||||||
@@ -523,6 +550,35 @@ export default {
|
|||||||
state.projectInfo.sourceBelongFullName = orgName;
|
state.projectInfo.sourceBelongFullName = orgName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clickOk = (e) => {
|
||||||
|
state.clickNum = state.clickNum + 1
|
||||||
|
if(state.clickNum==2) {
|
||||||
|
state.clickNum = 0
|
||||||
|
state.changeCondition = false;
|
||||||
|
}else{
|
||||||
|
state.changeCondition = true;
|
||||||
|
}
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
const panelOpen = (e) => {
|
||||||
|
console.log(e)
|
||||||
|
if(!e){
|
||||||
|
state.clickNum = 0
|
||||||
|
state.changeCondition = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const disabledDate1 = (current) => {
|
||||||
|
// return current && current < dayjs().startOf("day");
|
||||||
|
console.log(state.projectInfo.rangeTime1)
|
||||||
|
if(state.changeCondition){
|
||||||
|
return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss");
|
||||||
|
}else{
|
||||||
|
return current && current > moment(state.projectInfo.rangeTime1[0]).endOf("YYYY-MM-DD HH:mm:ss")
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const disabledDate = (current) => {
|
const disabledDate = (current) => {
|
||||||
return current && current < dayjs().startOf("day");
|
return current && current < dayjs().startOf("day");
|
||||||
};
|
};
|
||||||
@@ -530,6 +586,9 @@ export default {
|
|||||||
return {
|
return {
|
||||||
...toRefs(state),
|
...toRefs(state),
|
||||||
disabledDate,
|
disabledDate,
|
||||||
|
disabledDate1,
|
||||||
|
clickOk,
|
||||||
|
panelOpen,
|
||||||
managerChange,
|
managerChange,
|
||||||
timeChange,
|
timeChange,
|
||||||
classificationChange,
|
classificationChange,
|
||||||
|
|||||||
Reference in New Issue
Block a user