添加任务后继续添加

This commit is contained in:
kuaifan 2021-12-20 18:52:24 +08:00
parent 6faf7e71ba
commit 40e8e47398
3 changed files with 28 additions and 13 deletions

View File

@ -297,6 +297,7 @@
<div slot="footer">
<Button type="default" @click="addShow=false">{{$L('取消')}}</Button>
<Button type="primary" :loading="addLoad > 0" @click="onAddTask">{{$L('添加')}}</Button>
<Button type="primary" :loading="addLoad > 0" @click="onAddTask(true)">{{$L('添加并继续')}}</Button>
</div>
</Modal>
@ -638,14 +639,14 @@ export default {
});
},
onAddTask() {
onAddTask(again) {
this.addLoad++;
this.$refs.add.onAdd((success) => {
this.addLoad--;
if (success) {
if (success && again !== true) {
this.addShow = false;
}
})
}, again)
},
addTopShow(id, show) {

View File

@ -125,6 +125,8 @@ export default {
data() {
return {
addData: {
name: "",
content: "",
owner: 0,
column_id: 0,
times: [],
@ -283,7 +285,7 @@ export default {
setData(data) {
this.addData = Object.assign({}, this.addData, data);
},
onAdd(callback) {
onAdd(callback, again) {
if (!this.addData.name) {
$A.messageError("任务描述不能为空");
callback(false)
@ -293,15 +295,25 @@ export default {
project_id: this.projectId
})).then(({msg}) => {
$A.messageSuccess(msg);
this.addData = {
owner: 0,
column_id: 0,
times: [],
subtasks: [],
p_level: 0,
p_name: '',
p_color: '',
};
if (again === true) {
this.addData = Object.assign({}, this.addData, {
name: "",
content: "",
subtasks: [],
});
} else {
this.addData = {
name: "",
content: "",
owner: 0,
column_id: 0,
times: [],
subtasks: [],
p_level: 0,
p_name: '',
p_color: '',
};
}
callback(true)
}).catch(({msg}) => {
$A.modalError(msg);

View File

@ -103,6 +103,7 @@ export default {
data() {
return {
addData: {
name: "",
owner: 0,
column_id: 0,
times: [],
@ -206,6 +207,7 @@ export default {
this.loadIng--;
this.active = false;
this.addData = {
name: "",
owner: 0,
column_id: 0,
times: [],