复制任务
This commit is contained in:
parent
e47dcb9305
commit
301ce54771
@ -26,7 +26,7 @@
|
|||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="200" align="center">
|
<el-table-column label="操作" width="250" align="center">
|
||||||
<template slot-scope="scope" name="opt">
|
<template slot-scope="scope" name="opt">
|
||||||
<slot v-bind:index="scope.$index">
|
<slot v-bind:index="scope.$index">
|
||||||
</slot>
|
</slot>
|
||||||
|
|||||||
@ -69,6 +69,12 @@
|
|||||||
<el-button type="primary" icon="el-icon-edit" @click="edit(index)" size="mini"
|
<el-button type="primary" icon="el-icon-edit" @click="edit(index)" size="mini"
|
||||||
plain circle></el-button>
|
plain circle></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<el-tooltip class="item" effect="dark"
|
||||||
|
content="复制"
|
||||||
|
placement="top">
|
||||||
|
<el-button type="success" icon="el-icon-document-copy" @click="copyTask(index)" size="mini"
|
||||||
|
plain circle></el-button>
|
||||||
|
</el-tooltip>
|
||||||
<el-tooltip class="item" effect="dark"
|
<el-tooltip class="item" effect="dark"
|
||||||
content="删除"
|
content="删除"
|
||||||
placement="top">
|
placement="top">
|
||||||
@ -283,6 +289,33 @@ export default {
|
|||||||
this.isEdit = true;
|
this.isEdit = true;
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
|
copyTask(index) {
|
||||||
|
MessageBox.confirm("是否复制此任务?", "提示", {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "info",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.formData = {...this.tableData[index]};
|
||||||
|
delete this.formData.id;
|
||||||
|
this.isEdit = false;
|
||||||
|
taskApi.saveTask(this.formData, this.isEdit, (response) => {
|
||||||
|
if (response.data.code === 200) {
|
||||||
|
Message.success("复制成功!");
|
||||||
|
this.queryPageable({
|
||||||
|
index: this.pageIndex - 1,
|
||||||
|
size: 10,
|
||||||
|
dataBody: this.setQueryDataBody()
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Message.error("复制失败!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.clearForm();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
})
|
||||||
|
},
|
||||||
enable(index, flag) {
|
enable(index, flag) {
|
||||||
this.formData = {...this.tableData[index]};
|
this.formData = {...this.tableData[index]};
|
||||||
// this.formData.carrierType = this.formData.carrierType.toString();
|
// this.formData.carrierType = this.formData.carrierType.toString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user