|
@@ -148,7 +148,7 @@
|
|
|
|
|
|
<u-datetime-picker :show="timeShow" v-model="timeValue" mode="datetime" :closeOnClickOverlay="true" @cancel="timeShow = false" @confirm="timeConfirm"></u-datetime-picker>
|
|
|
|
|
|
- <u-modal :show="modalShow" title="" :confirmText="'确定'" :cancelText="'取消'" :zoom="false" :showCancelButton="true" @confirm="modalConfirm" @cancel="modalShow = false">
|
|
|
+ <u-modal :show="modalShow" title="" :confirmText="'确定'" :cancelText="'取消'" :zoom="false" :showCancelButton="true" @confirm="modalConfirm" @cancel="modalShow = false" :picker-options="pickerOptions">
|
|
|
<view class="slot-content" style="max-height: 45vh; overflow: scroll !important;">
|
|
|
<view v-if="projectsList.length > 0" >
|
|
|
<scroll-view scroll-y style="height: 100%; max-height: 300px;">
|
|
@@ -188,7 +188,7 @@
|
|
|
</u-checkbox-group> -->
|
|
|
</view>
|
|
|
|
|
|
- <view v-else>请联系项目管理人员给您分配项目后重试!</view>
|
|
|
+ <view v-else>暂未添加项目,请点击确定前往“项目列表”,成为项目成员。</view>
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
</template>
|
|
@@ -207,6 +207,7 @@ import { systemStores } from "@/store/modules/index";
|
|
|
/*----------------------------------公共方法引入-----------------------------------*/
|
|
|
import { storageSystem } from "@/utils/storage"; // 公共方法引用
|
|
|
import config from "@/config";
|
|
|
+import dayjs from "dayjs";
|
|
|
/*----------------------------------公共变量-----------------------------------*/
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const systemStore = systemStores();
|
|
@@ -217,7 +218,6 @@ const props = defineProps({
|
|
|
},
|
|
|
});
|
|
|
/*----------------------------------变量声明-----------------------------------*/
|
|
|
-
|
|
|
const modal = reactive({
|
|
|
timeShow: false,
|
|
|
timeValue: Number(new Date()),
|
|
@@ -247,6 +247,9 @@ const reportFile1 = ref([]); //附件
|
|
|
const { timeShow, timeValue, modalShow } = toRefs(modal);
|
|
|
const { form, projectsCheck, projectsList, userList, userDate, saveTime } = toRefs(state);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+const disabledDate = (time) => time > Date.now();
|
|
|
/**
|
|
|
* @初始化
|
|
|
*/
|
|
@@ -258,8 +261,16 @@ function init() {
|
|
|
|
|
|
/** 时间选择器确定按钮点击事件 */
|
|
|
function timeConfirm(e) {
|
|
|
- state.form.timingTime = proxy.$time.getFormatterDate(e.value);
|
|
|
- modal.timeShow = false;
|
|
|
+ const currentTime = dayjs().unix() * 1000; //当前时间戳
|
|
|
+ const tomorrowZeroPoint = dayjs(dayjs().add(1, 'day').format('YYYY-MM-DD') + " 00:00:00").valueOf(); //第二日零点时间戳
|
|
|
+ if(e.value < tomorrowZeroPoint && e.value > currentTime){
|
|
|
+ state.form.timingTime = proxy.$time.getFormatterDate(e.value);
|
|
|
+ modal.timeShow = false;
|
|
|
+ }else if(e.value > tomorrowZeroPoint){
|
|
|
+ proxy.$modal.msg("请选择当天时间!");
|
|
|
+ }else if(e.value < currentTime){
|
|
|
+ proxy.$modal.msg("选择时间要大约当前时间!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 开关按钮change事件 */
|
|
@@ -310,28 +321,33 @@ function realTimeSaving() {
|
|
|
|
|
|
/** 弹窗确定 */
|
|
|
function modalConfirm() {
|
|
|
- var newWorkContents = JSON.parse(JSON.stringify(state.form.workContents));
|
|
|
- state.form.workContents = [];
|
|
|
-
|
|
|
- state.projectsCheck.forEach((e) => {
|
|
|
- state.form.workContents.push({
|
|
|
- projectId: e,
|
|
|
- projectName: proxy.$common.mapping("projectName", "id", e, state.projectsList),
|
|
|
- workTime: "",
|
|
|
- workContent: "",
|
|
|
+ if(projectsList.value.length){
|
|
|
+ var newWorkContents = JSON.parse(JSON.stringify(state.form.workContents));
|
|
|
+ state.form.workContents = [];
|
|
|
+
|
|
|
+ state.projectsCheck.forEach((e) => {
|
|
|
+ state.form.workContents.push({
|
|
|
+ projectId: e,
|
|
|
+ projectName: proxy.$common.mapping("projectName", "id", e, state.projectsList),
|
|
|
+ workTime: "",
|
|
|
+ workContent: "",
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
-
|
|
|
- newWorkContents.forEach((e) => {
|
|
|
- state.form.workContents.forEach((f) => {
|
|
|
- if (e.projectId == f.projectId) {
|
|
|
- f.workTime = e.workTime;
|
|
|
- f.workContent = e.workContent;
|
|
|
- }
|
|
|
+
|
|
|
+ newWorkContents.forEach((e) => {
|
|
|
+ state.form.workContents.forEach((f) => {
|
|
|
+ if (e.projectId == f.projectId) {
|
|
|
+ f.workTime = e.workTime;
|
|
|
+ f.workContent = e.workContent;
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ modal.modalShow = false;
|
|
|
+ }else{
|
|
|
+ modal.modalShow = false;
|
|
|
+ proxy.$tab.redirectTo("/pages/business/common/projectMange/list/index");
|
|
|
+ }
|
|
|
|
|
|
- modal.modalShow = false;
|
|
|
// realTimeSaving();
|
|
|
}
|
|
|
|