fix:日常监督分页问题 和考试

This commit is contained in:
zty 2024-07-03 16:35:14 +08:00
parent b528d02580
commit bde49e291a
4 changed files with 19 additions and 26 deletions

View File

@ -23,7 +23,7 @@
fit fit
v-loading="listLoading" v-loading="listLoading"
highlight-current-row highlight-current-row
max-height="600" max-height="700"
row-key="id" row-key="id"
default-expand-all default-expand-all
> >
@ -32,8 +32,7 @@
</el-table-column> </el-table-column>
<el-table-column label="考试试卷"> <el-table-column label="考试试卷">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.paper_.name }} <span v-if="scope.row.paper_">{{scope.row.paper_.name }}</span>
<!-- <text v-if="scope.row.paper_">{{scope.row.paper_.name }}</text> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="考试地点"> <el-table-column label="考试地点">
@ -239,10 +238,7 @@
data() { data() {
return { return {
selects:[], selects:[],
exam: { exam: defaultexam,
id: "",
name: "",
},
// has_certificate:'true', // has_certificate:'true',
courseOptions:[], courseOptions:[],
depOptions:[], depOptions:[],

View File

@ -33,9 +33,6 @@
<el-table-column align="left" label="名称"> <el-table-column align="left" label="名称">
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="left" label="工作类别">
<template slot-scope="scope">{{ scope.row.workscope_name }}</template>
</el-table-column> -->
<el-table-column align="left" label="总分"> <el-table-column align="left" label="总分">
<template slot-scope="scope">{{ scope.row.total_score }}</template> <template slot-scope="scope">{{ scope.row.total_score }}</template>
</el-table-column> </el-table-column>

View File

@ -89,14 +89,12 @@
<el-table-column label="应提交" prop="count_all" align="center"></el-table-column> <el-table-column label="应提交" prop="count_all" align="center"></el-table-column>
<el-table-column label="已提交" prop="count_up" align="center"></el-table-column> <el-table-column label="已提交" prop="count_up" align="center"></el-table-column>
</el-table> </el-table>
<pagination <pagination
style="position:absolute;bottom:10px" v-show="dataList.count > 0"
v-show="dataList.count > 0" :total="dataList.count"
:background = false :page.sync="listQuery.page"
:total="dataList.count" :limit.sync="listQuery.page_size"
:page.sync="listQuery.page" @pagination="getList"
:limit.sync="listQuery.page_size"
@pagination="getList"
/> />
</el-card> </el-card>
</el-col> </el-col>
@ -795,12 +793,18 @@
import saveoinDialog from "./oinspect_form.vue"; import saveoinDialog from "./oinspect_form.vue";
import FileSaver from "file-saver"; import FileSaver from "file-saver";
import * as XLSX from "xlsx"; import * as XLSX from "xlsx";
import user from "@/store/modules/user"; import user from "@/store/modules/user";
const defaulttask = { const defaulttask = {
year: "", year: "",
cycle: "", cycle: "",
type: 10, type: 10,
}; };
const listQuery = {
page: 1,
belong_dept:null,
page_size: 20,
};
export default { export default {
components:{Pagination,savercDialog,saveptDialog, components:{Pagination,savercDialog,saveptDialog,
saveriskDialog,savecomDialog,saveoinDialog}, saveriskDialog,savecomDialog,saveoinDialog},
@ -837,11 +841,7 @@
results:[], results:[],
count:0, count:0,
}, },
listQuery:{ listQuery:listQuery,
page: 1,
belong_dept:null,
page_size: 20,
},
rc2ListQuery:{ rc2ListQuery:{
page: 1, page: 1,
page_size: 20, page_size: 20,
@ -954,7 +954,6 @@
type: "warning", type: "warning",
}).then(() => { }).then(() => {
let ids = this.sels.map((item) => item.id); let ids = this.sels.map((item) => item.id);
console.log("ids",ids);
this.deleteItems(type, ids); this.deleteItems(type, ids);
this.getList()}); this.getList()});
} }
@ -1008,8 +1007,6 @@
}, },
getList(){ getList(){
this.listLoading = true; this.listLoading = true;
this.dataList.results =[];
this.dataList.count =0;
getMyTask2Do(this.listQuery).then((response) => { getMyTask2Do(this.listQuery).then((response) => {
if (response.data) { if (response.data) {
this.dataList = response.data; this.dataList = response.data;

View File

@ -41,6 +41,9 @@ class Qualification2Serializer(serializers.ModelSerializer):
fields = ["id","name","company_name","quali_type","org","org_date","expiration_date","number","scope"] fields = ["id","name","company_name","quali_type","org","org_date","expiration_date","number","scope"]
def create(self, validated_data): 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 validated_data["belong_dept_id"] = Organization.objects.filter(name = validated_data.get("company_name")).first().id
return super().create(validated_data) return super().create(validated_data)