diff --git a/client/src/api/task.js b/client/src/api/task.js
index 3fdae9e..4948c2d 100644
--- a/client/src/api/task.js
+++ b/client/src/api/task.js
@@ -89,4 +89,11 @@ export function gettaskdeptall(id) {
url: `/supervision/task/${id}/deptall/`,
method: 'get'
})
+}
+export function getmytasklist(query) {
+ return request({
+ url: '/supervision/task/self/',
+ method: 'get',
+ params: query
+ })
}
\ No newline at end of file
diff --git a/client/src/router/index.js b/client/src/router/index.js
index 7a1b386..ff24581 100644
--- a/client/src/router/index.js
+++ b/client/src/router/index.js
@@ -130,6 +130,12 @@ export const asyncRoutes = [
component: () => import('@/views/supervision/task.vue'),
meta: { title: '报送任务', perms: ['task_view'] }
},
+ {
+ path: 'mytask',
+ name: 'myTask',
+ component: () => import('@/views/supervision/mytask.vue'),
+ meta: { title: '我的报送任务', perms: ['record_view'] }
+ },
{
path: 'record',
name: 'Record',
diff --git a/client/src/views/supervision/mytask.vue b/client/src/views/supervision/mytask.vue
new file mode 100644
index 0000000..490970b
--- /dev/null
+++ b/client/src/views/supervision/mytask.vue
@@ -0,0 +1,100 @@
+
+
+
+
+ 我的报送任务
+
+
+
+
+ {{ scope.row.task_.name }}
+
+
+
+ {{ scope.row.task_.state }}
+ {{
+ scope.row.task_.state
+ }}
+ {{ scope.row.task_.state }}
+
+
+
+ {{ scope.row.task_.end_date }}
+
+
+ {{ scope.row.up_rate }}%
+
+
+ {{ scope.row.confirm_rate }}%
+
+
+
+
+
+ 记录详情
+
+
+
+
+
+
diff --git a/client/src/views/supervision/mytaskrecord.vue b/client/src/views/supervision/mytaskrecord.vue
new file mode 100644
index 0000000..69ec441
--- /dev/null
+++ b/client/src/views/supervision/mytaskrecord.vue
@@ -0,0 +1,320 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.task_.name }}
+ 主动报送
+
+
+
+ {{ scope.row.content_name }}
+
+
+ {{ scope.row.note }}
+
+
+
+ 是
+ 否
+
+
+
+ {{ scope.row.up_user_.name }}/{{ scope.row.up_date }}
+
+
+ {{ scope.row.noteb }}
+
+
+
+ {{
+ scope.row.state
+ }}
+ {{ scope.row.state }}
+ {{
+ scope.row.state
+ }}
+ {{
+ scope.row.state
+ }}
+
+
+
+
+ 有
+ {{ scope.row.files.length }}
+ 个文件
+
+ {{
+ item.name
+ }}
+
+
+
+
+
+ 编辑
+ 报送
+ 确认
+ 驳回
+ 查看
+ 删除
+
+
+
+
+
+
+
+
+
+
+
diff --git a/client/src/views/supervision/recorddo.vue b/client/src/views/supervision/recorddo.vue
index 779293b..f79d3f7 100644
--- a/client/src/views/supervision/recorddo.vue
+++ b/client/src/views/supervision/recorddo.vue
@@ -203,7 +203,7 @@ export default {
if (this.data.action == "update") {
updateRecord(this.record.id, this.record).then((res) => {
this.$message.success("成功");
- this.$emit("handleDo");
+ this.$emit("handleDo",true);
});
} else if (this.data.action == "up") {
var files = [];
@@ -213,25 +213,20 @@ export default {
this.record.files = files;
upRecord(this.record.id, this.record).then((res) => {
this.$message.success("成功");
- this.$emit("handleDo");
+ this.$emit("handleDo",true);
});
} else if (this.data.action == "reject") {
rejectRecord(this.record.id, this.record).then((res) => {
this.$message.success("成功");
- this.$emit("handleDo");
+ this.$emit("handleDo",true);
});
} else if (this.data.action == "confirm") {
confirmRecord(this.record.id).then((res) => {
this.$message.success("成功");
- this.$emit("handleDo");
+ this.$emit("handleDo",true);
});
- } else if (this.data.action == "confirm") {
- confirmRecord(this.record.id).then((res) => {
- this.$message.success("成功");
- this.$emit("handleDo");
- });
- } else if (this.data.action == "view") {
- this.$emit("handleDo");
+ } else if (this.data.action == "view") {
+ this.$emit("handleDo",false);
} else if (this.data.action == "delete") {
this.$confirm("确认删除?", "警告", {
type: "error",
@@ -239,7 +234,7 @@ export default {
.then(async () => {
await deleteRecord(this.record.id);
this.$message.success("成功");
- this.$emit("handleDo");
+ this.$emit("handleDo",true);
})
.catch((err) => {
console.error(err);
diff --git a/server/apps/supervision/serializers.py b/server/apps/supervision/serializers.py
index e822291..0bf159f 100644
--- a/server/apps/supervision/serializers.py
+++ b/server/apps/supervision/serializers.py
@@ -64,8 +64,14 @@ class TaksDetailSerializer(serializers.ModelSerializer):
fields = '__all__'
class TaskDeptSerializer(serializers.ModelSerializer):
+ task_ = TaskListSerializer(source='task', read_only=True)
dept_ = OrganizationSimpleSerializer(source='dept', read_only=True)
class Meta:
model = TaskDept
- fields = '__all__'
\ No newline at end of file
+ fields = '__all__'
+
+ @staticmethod
+ def setup_eager_loading(queryset):
+ queryset = queryset.select_related('task', 'dept')
+ return queryset
\ No newline at end of file
diff --git a/server/apps/supervision/views.py b/server/apps/supervision/views.py
index 6e9d116..b409e34 100644
--- a/server/apps/supervision/views.py
+++ b/server/apps/supervision/views.py
@@ -159,6 +159,16 @@ class TaskViewSet(CreateUpdateCustomMixin, ModelViewSet):
obj = self.get_object()
serializer = TaskDeptSerializer(TaskDept.objects.filter(task=obj).order_by('dept__sort'), many=True)
return Response(serializer.data)
+
+ @action(methods=['get'], detail=False, perms_map = {'get':'*'})
+ def self(self, request, *args, **kwargs):
+ """
+ 我的报送任务
+ """
+ queryset = TaskDept.objects.filter(dept=request.user.dept).exclude(task__state='待发布').order_by('-create_time')
+ serializer = TaskDeptSerializer(queryset, many=True)
+ return Response(serializer.data)
+
@action(methods=['put'], detail=True, perms_map = {'put':'task_close'})
def close(self, request, *args, **kwargs):