删除任务内相关内容
This commit is contained in:
parent
0de9bf7f2d
commit
ae345f232d
|
|
@ -104,3 +104,10 @@ export function confirmTaskdept(id) {
|
||||||
method: 'put'
|
method: 'put'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deleteTaskdept(id) {
|
||||||
|
return request({
|
||||||
|
url: `/supervision/taskdept/${id}/`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -141,6 +141,15 @@
|
||||||
@click="handleConfirmDept(scope)"
|
@click="handleConfirmDept(scope)"
|
||||||
>确认</el-link
|
>确认</el-link
|
||||||
>
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="
|
||||||
|
checkPermission(['task_update'])
|
||||||
|
"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="handleDeleteDept(scope)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -328,7 +337,7 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { gettask, inittask, gettaskdeptall, starttask, appendtask, confirmTaskdept } from "@/api/task";
|
import { gettask, inittask, gettaskdeptall, starttask, appendtask, confirmTaskdept, deleteTaskdept } from "@/api/task";
|
||||||
import { getRecordList, updateRecords } from "@/api/record";
|
import { getRecordList, updateRecords } from "@/api/record";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
import taskinit from "@/views/supervision/taskinit";
|
import taskinit from "@/views/supervision/taskinit";
|
||||||
|
|
@ -467,6 +476,11 @@ export default {
|
||||||
this.gettaskdeptall()
|
this.gettaskdeptall()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleDeleteDept(scope){
|
||||||
|
deleteTaskdept(scope.row.id).then(res=>{
|
||||||
|
this.gettaskdeptall()
|
||||||
|
})
|
||||||
|
},
|
||||||
handleUp2(){
|
handleUp2(){
|
||||||
if (this.selectRecords.length) {
|
if (this.selectRecords.length) {
|
||||||
this.$prompt('请输入备注内容', '提示').then(({ value }) => {
|
this.$prompt('请输入备注内容', '提示').then(({ value }) => {
|
||||||
|
|
|
||||||
|
|
@ -354,3 +354,12 @@ class TaskDeptViewSet(ModelViewSet):
|
||||||
obj.save()
|
obj.save()
|
||||||
return Response(status=status.HTTP_200_OK)
|
return Response(status=status.HTTP_200_OK)
|
||||||
return Response('报送未完成', status=status.HTTP_400_BAD_REQUEST)
|
return Response('报送未完成', status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
def destroy(self, request, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
删除
|
||||||
|
"""
|
||||||
|
obj = self.get_object()
|
||||||
|
Record.objects.filter(task=obj.task, belong_dept=obj.dept).delete() # 删除相应上报记录
|
||||||
|
obj.delete()
|
||||||
|
return Response()
|
||||||
Loading…
Reference in New Issue