From bde49e291a6ea73c39d69b37a70db70e60e38339 Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 3 Jul 2024 16:35:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=97=A5=E5=B8=B8=E7=9B=91=E7=9D=A3?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=97=AE=E9=A2=98=20=E5=92=8C=E8=80=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/exam/index.vue | 10 +++----- client/src/views/exam/testPaper.vue | 3 --- client/src/views/supervisionNew/mytask.vue | 29 ++++++++++------------ server/apps/information/serializers.py | 3 +++ 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/client/src/views/exam/index.vue b/client/src/views/exam/index.vue index ec60138..db4e268 100644 --- a/client/src/views/exam/index.vue +++ b/client/src/views/exam/index.vue @@ -23,7 +23,7 @@ fit v-loading="listLoading" highlight-current-row - max-height="600" + max-height="700" row-key="id" default-expand-all > @@ -32,8 +32,7 @@ @@ -239,10 +238,7 @@ data() { return { selects:[], - exam: { - id: "", - name: "", - }, + exam: defaultexam, // has_certificate:'true', courseOptions:[], depOptions:[], diff --git a/client/src/views/exam/testPaper.vue b/client/src/views/exam/testPaper.vue index 052538c..07f0d3d 100644 --- a/client/src/views/exam/testPaper.vue +++ b/client/src/views/exam/testPaper.vue @@ -33,9 +33,6 @@ - diff --git a/client/src/views/supervisionNew/mytask.vue b/client/src/views/supervisionNew/mytask.vue index 4f9a08a..933733e 100644 --- a/client/src/views/supervisionNew/mytask.vue +++ b/client/src/views/supervisionNew/mytask.vue @@ -89,14 +89,12 @@ - @@ -795,12 +793,18 @@ import saveoinDialog from "./oinspect_form.vue"; import FileSaver from "file-saver"; import * as XLSX from "xlsx"; + import user from "@/store/modules/user"; const defaulttask = { year: "", cycle: "", type: 10, }; + const listQuery = { + page: 1, + belong_dept:null, + page_size: 20, + }; export default { components:{Pagination,savercDialog,saveptDialog, saveriskDialog,savecomDialog,saveoinDialog}, @@ -837,11 +841,7 @@ results:[], count:0, }, - listQuery:{ - page: 1, - belong_dept:null, - page_size: 20, - }, + listQuery:listQuery, rc2ListQuery:{ page: 1, page_size: 20, @@ -954,7 +954,6 @@ type: "warning", }).then(() => { let ids = this.sels.map((item) => item.id); - console.log("ids",ids); this.deleteItems(type, ids); this.getList()}); } @@ -1008,8 +1007,6 @@ }, getList(){ this.listLoading = true; - this.dataList.results =[]; - this.dataList.count =0; getMyTask2Do(this.listQuery).then((response) => { if (response.data) { this.dataList = response.data; diff --git a/server/apps/information/serializers.py b/server/apps/information/serializers.py index 5b608b8..59158ce 100644 --- a/server/apps/information/serializers.py +++ b/server/apps/information/serializers.py @@ -41,6 +41,9 @@ class Qualification2Serializer(serializers.ModelSerializer): fields = ["id","name","company_name","quali_type","org","org_date","expiration_date","number","scope"] def create(self, validated_data): + data = Organization.objects.filter(name = validated_data.get("company_name")) + if not data: + raise serializers.ValidationError("公司名称不存在") validated_data["belong_dept_id"] = Organization.objects.filter(name = validated_data.get("company_name")).first().id return super().create(validated_data)