KindergartenUI/src/views/assembly/kindergarten.vue
2022-08-31 15:29:30 +08:00

321 lines
8.6 KiB
Vue

<template>
<div class="app-container">
<el-form
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="所属幼儿园" prop="categoryName">
<el-button
@click="kindergartenshow = true"
v-if="kindergartenName == '请选择幼儿园'"
style="width: 250px; text-align: left; height: 32px; color: #c0c4cc"
>{{ kindergartenName }}</el-button
>
<el-button
@click="kindergartenshow = true"
style="width: 250px; text-align: left; height: 32px"
v-else
>{{ kindergartenName }}</el-button
>
</el-form-item>
<el-form-item label="所属批次" prop="categoryName">
<el-button
@click="batchCodeshowclick"
style="width: 250px; text-align: left; height: 32px; color: #c0c4cc"
v-if="batchCode == '请选择批次'"
>{{ batchCode }}</el-button
>
<el-button
@click="batchCodeshowclick"
style="width: 250px; text-align: left; height: 32px"
v-else
>{{ batchCode }}</el-button
>
</el-form-item>
</el-form>
<!-- //批次 -->
<el-dialog
width="590px"
title="选择批次"
:visible.sync="batchCodeshow"
append-to-body
style="margin-top: 20px"
:before-close="batchCodecancel"
>
<el-table
:data="testScorelist"
align="center"
style="margin-top: 0px"
@cell-dblclick="batchCodeclick"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 20px; height: 20px"
v-if="batchCodeId == scope.row.id"
circle
@click="batchCodeclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="batchCodeclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="batchCode"
label="批次编号"
width="200"
align="center"
/>
<el-table-column
property="batchName"
label="批次名称"
width="200"
align="center"
/>
</el-table>
<pagination
v-show="total4 > 0"
:total="total4"
:page.sync="testqueryParams.pageNum"
:limit.sync="testqueryParams.pageSize"
@pagination="testScore"
/>
</el-dialog>
<!-- //幼儿园 -->
<el-dialog
width="850px"
title="选择所属幼儿园"
:visible.sync="kindergartenshow"
append-to-body
:before-close="kindergartencancel"
>
<el-table :data="kindergartenList" @cell-dblclick="kindergartenNameclick">
<el-table-column label="请选择" width="70" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
v-if="kindergartenId == scope.row.id"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="kindergartenNameclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="kindergartenName"
label="幼儿园名字"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="kindergartenAddress"
label="幼儿园地址"
width="150"
align="center"
>
</el-table-column>
<el-table-column
label="幼儿园所在组织"
align="center"
prop="organizeName"
width="150"
>
</el-table-column>
<el-table-column
property="contacts"
label="联系人"
width="150"
align="center"
>
</el-table-column>
<el-table-column
property="phone"
label="联系电话"
width="150"
align="center"
>
</el-table-column>
</el-table>
<pagination
v-show="total1 > 0"
:total="total1"
:page.sync="kqueryParams.pageNum"
:limit.sync="kqueryParams.pageSize"
@pagination="getList"
/>
</el-dialog>
</div>
</template>
<script>
import {
listKindergartenInfo,
tKindergartenInfo,
} from "@/api/system/kindergartenInfo";
import { getRoleInfo, testScoreBatch } from "@/api/system/quality";
export default {
name: "",
components: {},
data() {
return {
total1: 0,
total4: 0,
//遮罩层
kindergartenshow: false,
batchCodeshow: false,
// 显示搜索条件
showSearch: true,
// 表单参数
form: {},
//幼儿园查询参数
kqueryParams: {
pageNum: 1,
pageSize: 10,
organizeId: null,
kindergartenName: null,
kindergartenAddress: null,
kindergartenType: null,
phone: null,
contacts: null,
},
//幼儿园list
kindergartenList: [],
//幼儿园名字
kindergartenName: "请选择幼儿园",
//幼儿园ID
kindergartenId: "",
//批次名称
batchCode: "请选择批次",
//批次ID
batchCodeId: "",
//批次list
testScorelist: [],
//批次编号
testqueryParams: {
pageNum: 1,
pageSize: 10,
},
};
},
mounted() {},
created() {
this.getList();
this.onshow();
},
methods: {
onshow() {
if (localStorage.getItem("kindergartenName") == null) {
this.kindergartenName = "请选择幼儿园";
} else {
this.kindergartenName = localStorage.getItem("kindergartenName");
}
if (localStorage.getItem("batchCode2") == null) {
this.batchCode = "请选择批次";
} else {
this.batchCode = localStorage.getItem("batchCode2");
}
this.batchCode = localStorage.getItem("batchCode2");
this.kindergartenId = localStorage.getItem("kindergartenId");
this.$emit("kinbatlist", this.kindergartenId, this.batchCode, 0);
},
//幼儿园左侧点击
kindergartenNameclick(row) {
this.kindergartenName = row.kindergartenName;
this.kindergartenId = row.id;
this.kindergartenshow = false;
localStorage.setItem("kindergartenName", this.kindergartenName);
localStorage.setItem("kindergartenId", this.kindergartenId);
this.$emit("kinbatlist", this.kindergartenId, this.batchCode, 1);
},
//点击批次左边
batchCodeclick(row) {
this.batchCodeId = row.id;
this.batchCode = row.batchCode;
this.batchCodeshow = false;
localStorage.setItem("batchCode2", this.batchCode);
if (this.kindergartenId != "") {
this.$emit("kinbatlist", this.kindergartenId, this.batchCode, 2);
}
},
//点击批次
batchCodeshowclick() {
this.testScore();
this.batchCodeshow = true;
},
//批次
testScore() {
testScoreBatch(this.testqueryParams).then((res) => {
this.testScorelist = res.rows;
this.total4 = res.total;
});
},
//批次关闭
batchCodecancel() {
this.batchCodeshow = false;
},
//幼儿园关闭
kindergartencancel() {
this.kindergartenshow = false;
},
getList() {
tKindergartenInfo(this.kindergartenType).then((res) => {
this.type = res.data[0];
this.type2 = res.data[1];
});
//用户权限
// this.analysisqueryParams.kindergartenId = res.data.kindergartenId;
getRoleInfo().then((res) => {
var user = res.data.roleKeys;
console.log(user);
if (user.includes("enchou")) {
return;
} else if (user.includes("teacher")) {
return;
} else if (user.includes("parent")) {
return;
}
});
//获取幼儿园list
listKindergartenInfo(this.kqueryParams).then((response) => {
this.kindergartenList = response.rows;
this.total1 = response.total;
// console.log(this.kindergartenList);
});
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
},
};
</script>
<style scoped='scss'>
::v-deep .el-card__header {
border: none;
}
</style>