diff --git a/client/src/views/supervision/record.vue b/client/src/views/supervision/record.vue index 236a026..ff7e035 100644 --- a/client/src/views/supervision/record.vue +++ b/client/src/views/supervision/record.vue @@ -121,8 +121,48 @@ - - - + - + @@ -190,7 +256,9 @@ v-bind:key="item.id" @click="chosedept(item)" > - {{index+1}}-{{ item.name }} + {{ index + 1 }}-{{ item.name }} @@ -199,10 +267,10 @@ shadow="never" style="height: 600px; overflow-y: auto; overflow-x: auto" > -
- 当前选择 - {{nowdept.name}} -
+
+ 当前选择 + {{ nowdept.name }} +
- {{ scope.row.up_user }}/{{ scope.row.up_date }} - + - + @@ -302,7 +397,12 @@ > - + { this.contents = res.data; this.listLoading = true; - this.nowcontent = {id:this.contents[0].id, name:this.contents[0].name} + this.nowcontent = { + id: this.contents[0].id, + name: this.contents[0].name, + }; getRecordList({ pageoff: true, content: this.contents[0].id, @@ -404,11 +507,11 @@ export default { }); }, chosecontent(item) { - this.nowcontent = item + this.nowcontent = item; var data = { pageoff: true, task: this.task.id, - content:item.id + content: item.id, }; this.listLoading = true; getRecordList(data).then((res) => { @@ -417,11 +520,11 @@ export default { }); }, chosedept(item) { - this.nowdept = item + this.nowdept = item; var data = { pageoff: true, task: this.task.id, - belong_dept:item.id + belong_dept: item.id, }; this.listLoading = true; getRecordList(data).then((res) => { @@ -429,17 +532,17 @@ export default { this.recordList2 = res.data; }); }, - handleRecord(data){ + handleRecord(data) { this.data = data; this.drawer = true; }, handleDo(data) { this.drawer = false; - this.gettask() - if(this.activeName == 'contenttab'){ - this.chosecontent(this.nowcontent) - }else if(this.activeName == 'depttab'){ - this.chosedept(this.nowdept) + this.gettask(); + if (this.activeName == "contenttab") { + this.chosecontent(this.nowcontent); + } else if (this.activeName == "depttab") { + this.chosedept(this.nowdept); } }, }, diff --git a/server/apps/supervision/views.py b/server/apps/supervision/views.py index 6809e82..ad01b68 100644 --- a/server/apps/supervision/views.py +++ b/server/apps/supervision/views.py @@ -154,11 +154,10 @@ class RecordViewSet(RbacFilterSet, PageOrNot, CreateUpdateCustomMixin, ModelView obj = self.get_object() if obj.state in ['待整改','待上报']: if 'files' in request.data and len(request.data['files'])==0: - if request.data.get('noteb', None): - if request.data.get('is_yes', True): - return Response('请选择不适用', status=status.HTTP_400_BAD_REQUEST) + if request.data.get('noteb', None) and request.data.get('is_yes', True): + pass else: - return Response('请上传文件或填写备注', status=status.HTTP_400_BAD_REQUEST) + return Response('请上传文件或选择不适用并填写上报说明', status=status.HTTP_400_BAD_REQUEST) obj.is_yes = request.data.get('is_yes') obj.files.clear() obj.files.add(*request.data['files'])