diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue
index cbe821a7..51c72478 100644
--- a/resources/assets/js/pages/manage/components/TaskAdd.vue
+++ b/resources/assets/js/pages/manage/components/TaskAdd.vue
@@ -52,7 +52,7 @@
v-model="addData.times"
:options="timeOptions"
:placeholder="$L('选择计划范围')"
- format="yyyy-MM-dd HH:mm"
+ format="yyyy/MM/dd HH:mm"
type="datetimerange"
placement="bottom"
@on-change="taskTimeChange(addData.times)"
@@ -72,7 +72,7 @@
:options="timeOptions"
:editable="false"
:placeholder="$L('选择计划范围')"
- format="yyyy-MM-dd HH:mm"
+ format="yyyy/MM/dd HH:mm"
type="datetimerange"
@on-change="taskTimeChange(addData.times)"/>
@@ -104,7 +104,7 @@
:options="timeOptions"
:editable="false"
:placeholder="$L('选择时间')"
- format="yyyy-MM-dd HH:mm"
+ format="yyyy/MM/dd HH:mm"
type="datetimerange"
@on-change="taskTimeChange(item.times)"/>
diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue
index aa4953a9..d0739d45 100644
--- a/resources/assets/js/pages/manage/components/TaskDetail.vue
+++ b/resources/assets/js/pages/manage/components/TaskDetail.vue
@@ -51,7 +51,7 @@
v-model="timeValue"
:open="timeOpen"
:options="timeOptions"
- format="yyyy-MM-dd HH:mm"
+ format="yyyy/MM/dd HH:mm"
type="datetimerange"
class="subtask-time"
@on-open-change="timeChange"
@@ -101,16 +101,32 @@
-
-
-
+ v-model="receiveShow"
+ placement="bottom">
+
+
+
+ {{$L('确认计划时间领取任务')}}
+
+
+
+
+
+
+
+
+
+
+
@@ -265,7 +281,7 @@
v-model="timeValue"
:open="timeOpen"
:options="timeOptions"
- format="yyyy-MM-dd HH:mm"
+ format="yyyy/MM/dd HH:mm"
type="datetimerange"
@on-open-change="timeChange"
@on-clear="timeClear"
@@ -441,6 +457,8 @@ export default {
ownerData: {},
ownerLoad: 0,
+ receiveShow: false,
+
assistForce: false,
assistShow: false,
assistData: {},
@@ -502,7 +520,7 @@ export default {
window.addEventListener('resize', this.innerHeightListener);
//
this.receiveTaskSubscribe = Store.subscribe('receiveTask', () => {
- this.$refs.receive && this.$refs.receive.handleClick();
+ this.receiveShow = true;
});
},
@@ -687,11 +705,17 @@ export default {
this.timeForce = false;
this.assistForce = false;
this.addsubForce = false;
+ this.receiveShow = false;
this.$refs.owner && this.$refs.owner.handleClose();
this.$refs.assist && this.$refs.assist.handleClose();
}
},
immediate: true
+ },
+ receiveShow(val) {
+ if (val) {
+ this.timeValue = this.taskDetail.end_at ? [this.taskDetail.start_at, this.taskDetail.end_at] : [];
+ }
}
},
@@ -867,27 +891,46 @@ export default {
},
onOwner(pick) {
- if (pick === true && this.getOwner.length === 0) {
- this.ownerData.owner_userid = [this.userId];
+ let data = {
+ task_id: this.taskDetail.id,
+ owner: this.ownerData.owner_userid
+ }
+ //
+ if (pick === true) {
+ if (this.getOwner.length > 0) {
+ this.receiveShow = false;
+ $A.messageError("任务已被领取");
+ return;
+ }
+ let times = $A.date2string(this.timeValue, "Y-m-d H:i");
+ if (times[0] && times[1]) {
+ if ($A.rightExists(times[0], '00:00') && $A.rightExists(times[1], '00:00')) {
+ times[1] = times[1].replace("00:00", "23:59");
+ }
+ } else {
+ $A.messageError("请设置计划时间");
+ return;
+ }
+ data.times = times;
+ data.owner = this.ownerData.owner_userid = [this.userId];
}
if ($A.jsonStringify(this.taskDetail.owner_userid) === $A.jsonStringify(this.ownerData.owner_userid)) {
return;
}
- let owner = this.ownerData.owner_userid;
- if ($A.count(owner) == 0) owner = '';
+ //
+ if ($A.count(data.owner) == 0) data.owner = '';
this.ownerLoad++;
- this.$store.dispatch("taskUpdate", {
- task_id: this.taskDetail.id,
- owner: owner,
- }).then(({msg}) => {
+ this.$store.dispatch("taskUpdate", data).then(({msg}) => {
$A.messageSuccess(msg);
this.ownerLoad--;
this.ownerShow = false;
+ this.receiveShow = false;
this.$store.dispatch("getTaskOne", this.taskDetail.id);
}).catch(({msg}) => {
$A.modalError(msg);
this.ownerLoad--;
this.ownerShow = false;
+ this.receiveShow = false;
})
},
diff --git a/resources/assets/sass/pages/components/task-detail.scss b/resources/assets/sass/pages/components/task-detail.scss
index 0f178bbd..ea691001 100644
--- a/resources/assets/sass/pages/components/task-detail.scss
+++ b/resources/assets/sass/pages/components/task-detail.scss
@@ -585,6 +585,31 @@
}
}
+.task-detail-receive {
+ padding: 6px 6px 3px;
+ .receive-title {
+ font-size: 14px;
+ .ivu-icon {
+ font-size: 16px;
+ color: #f90;
+ line-height: 18px;
+ }
+ }
+ .receive-time {
+ margin-top: 10px;
+ .ivu-date-picker {
+ width: 280px;
+ }
+ }
+ .receive-bottom {
+ text-align: right;
+ margin-top: 12px;
+ > button + button {
+ margin-left: 4px;
+ }
+ }
+}
+
.task-detail-delete-file-popover {
max-width: 200px;
.buttons {