|
@@ -220,14 +220,15 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div class="confirmarea">
|
|
<div class="confirmarea">
|
|
- <el-button type="primary" @click="createdSchool()" :loading="createdSchoolLoading">{{ $t(`schoolManages.createSchools.submit`) }}</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="verifydataForbb()" v-if="verifyForstate.state ===false">数据核验</el-button>
|
|
|
|
+ <el-button type="primary" @click="createdSchool()" :loading="createdSchoolLoading" v-else-if="verifyForstate.state===true && verifyForstate.pass===true ">{{ $t(`schoolManages.createSchools.submit`) }}</el-button>
|
|
<!-- <el-button @click="closeandreturn('close', 'school')">重置</el-button> -->
|
|
<!-- <el-button @click="closeandreturn('close', 'school')">重置</el-button> -->
|
|
<el-button @click="resetForm()">重置</el-button>
|
|
<el-button @click="resetForm()">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--查询BB数据-->
|
|
<!--查询BB数据-->
|
|
<div class="searchbox">
|
|
<div class="searchbox">
|
|
- <el-input v-model="searchSchoolvalue" placeholder="搜索学校名称/简码 检验是否重复" size="small" @focus="searchboxState=true" @blur="searchboxState=false">
|
|
|
|
|
|
+ <el-input v-model="searchSchoolvalue" placeholder="搜索学校名称/简码 检验是否重复" size="small" @focus="searchboxState=true">
|
|
<template #prefix>
|
|
<template #prefix>
|
|
<el-icon class="el-input__icon">
|
|
<el-icon class="el-input__icon">
|
|
<search />
|
|
<search />
|
|
@@ -236,7 +237,7 @@
|
|
</el-input>
|
|
</el-input>
|
|
<div class="result-table" v-show="searchboxState">
|
|
<div class="result-table" v-show="searchboxState">
|
|
<div class="result-data" v-if="resultschool.length !==0">
|
|
<div class="result-data" v-if="resultschool.length !==0">
|
|
- <el-table :data="resultschool" style="width: 100%">
|
|
|
|
|
|
+ <el-table :data="resultschool" style="width: 100%" height="498" v-loading="searchLoading" element-loading-text="数据加载中...">
|
|
<!-- <el-table-column label="校徽">
|
|
<!-- <el-table-column label="校徽">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-image style="width: 30px; height: 30px" src="https://teammodeltest.blob.core.chinacloudapi.cn/0-public/school/00a0c125-c8ae-4d77-bb38-dcf4ca5a5b32.png" fit="fill"></el-image>
|
|
<el-image style="width: 30px; height: 30px" src="https://teammodeltest.blob.core.chinacloudapi.cn/0-public/school/00a0c125-c8ae-4d77-bb38-dcf4ca5a5b32.png" fit="fill"></el-image>
|
|
@@ -251,14 +252,32 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="IES5已建校" align="center">
|
|
<el-table-column label="IES5已建校" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <div v-if="scope.row.source !=='BI'">否</div>
|
|
|
|
- <div v-else>是</div>
|
|
|
|
|
|
+ <div v-if="scope.row.source !=='BI'" style="color:#909399">否</div>
|
|
|
|
+ <div v-else style="color:#409EFF">是</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="150px">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <div v-if="scope.row.source !=='BI'">快捷选填本校信息</div>
|
|
|
|
- <div v-else>数据异常回报</div>
|
|
|
|
|
|
+ <div v-if="scope.row.source !=='BI'">
|
|
|
|
+ <div class="bringbox">
|
|
|
|
+ <el-button size="small" @click="formOperate">
|
|
|
|
+ <svg class="lockicon-bring" aria-hidden="true">
|
|
|
|
+ <use xlink:href="#icon-daoru"></use>
|
|
|
|
+ </svg>
|
|
|
|
+ <div class="bringtext">快捷选填本校信息</div>
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else>
|
|
|
|
+ <div class="bringbox">
|
|
|
|
+ <el-button size="small">
|
|
|
|
+ <svg class="lockicon-bring" aria-hidden="true">
|
|
|
|
+ <use xlink:href="#icon-jinggao"></use>
|
|
|
|
+ </svg>
|
|
|
|
+ <div class="bringtext errortext">数据异常回报</div>
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -268,6 +287,9 @@
|
|
<div class="notdatas-text">暂无相关搜索数据</div>
|
|
<div class="notdatas-text">暂无相关搜索数据</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="search-close" v-show="searchboxState">
|
|
|
|
+ <el-button size="small" @click="searchboxState=false">关闭</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<!--查询BB end数据-->
|
|
<!--查询BB end数据-->
|
|
</div>
|
|
</div>
|
|
@@ -431,6 +453,8 @@ import router from '@/router/index.js'
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { FLIPPED_ALIAS_KEYS } from '@babel/types'
|
|
import { FLIPPED_ALIAS_KEYS } from '@babel/types'
|
|
|
|
+import option_cn from '@/static/regions/region_cn.json'
|
|
|
|
+import option_gl from '@/static/regions/region_gl.json'
|
|
const chinaData = new EluiChinaAreaDht.ChinaArea().chinaAreaflat
|
|
const chinaData = new EluiChinaAreaDht.ChinaArea().chinaAreaflat
|
|
const areaData = {
|
|
const areaData = {
|
|
areaselect: {
|
|
areaselect: {
|
|
@@ -477,6 +501,7 @@ const schoolAssets = {
|
|
export default {
|
|
export default {
|
|
components: { EluiChinaAreaDht, Search, StarFilled },
|
|
components: { EluiChinaAreaDht, Search, StarFilled },
|
|
setup () {
|
|
setup () {
|
|
|
|
+ const siteValue = window.location.host === 'localhost:5001' ? 'cn' : window.location.host === 'bi.teammodel.cn' ? 'cn' : window.location.host === 'bitest.teammodel.cn' ? 'cn' : 'international'
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const labelPosition = 'right'
|
|
const labelPosition = 'right'
|
|
let { proxy } = getCurrentInstance()
|
|
let { proxy } = getCurrentInstance()
|
|
@@ -587,6 +612,12 @@ export default {
|
|
// },
|
|
// },
|
|
])
|
|
])
|
|
let searchSchoolvalue = ref('')
|
|
let searchSchoolvalue = ref('')
|
|
|
|
+ let searchLoading = ref(false)
|
|
|
|
+ //数据核验状态 (对接BB)
|
|
|
|
+ let verifyForstate = ref({
|
|
|
|
+ state: false,
|
|
|
|
+ pass: false,
|
|
|
|
+ })
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
formArea.value = JSON.parse(JSON.stringify(areaData))
|
|
formArea.value = JSON.parse(JSON.stringify(areaData))
|
|
console.log(formArea, '初步的数据')
|
|
console.log(formArea, '初步的数据')
|
|
@@ -818,7 +849,7 @@ export default {
|
|
}
|
|
}
|
|
datas.push({
|
|
datas.push({
|
|
name: schoolForm.value[i].name,
|
|
name: schoolForm.value[i].name,
|
|
- admin: adminArr ? adminArr : schoolForm.value[i].presupposeAdmin,
|
|
|
|
|
|
+ admin: adminArr ? [adminArr] : [schoolForm.value[i].presupposeAdmin],
|
|
period: schoolForm.value[i].radio1,
|
|
period: schoolForm.value[i].radio1,
|
|
size: parseInt(schoolForm.value[i].pitchSpace),
|
|
size: parseInt(schoolForm.value[i].pitchSpace),
|
|
region: '中国',
|
|
region: '中国',
|
|
@@ -835,7 +866,7 @@ export default {
|
|
console.log(parameter, '创建学校最后的数据格式')
|
|
console.log(parameter, '创建学校最后的数据格式')
|
|
proxy.$api.createdSchools(parameter).then((res) => {
|
|
proxy.$api.createdSchools(parameter).then((res) => {
|
|
loadingCreatedschool.close()
|
|
loadingCreatedschool.close()
|
|
- res.state === 200 ? (ElMessage.success(proxy.$t(`commonMsg.schoolCreatedSuccess`)), router.push({ path: '/home/schoolmanage' }))
|
|
|
|
|
|
+ res.state === 200 ? (ElMessage.success(proxy.$t(`commonMsg.schoolCreatedSuccess`)), backTobb(datas))
|
|
: res.state === 201 ? res.schools.length !== 0 ? ElMessage.info(proxy.$t(`commonMsg.schoolExist`))
|
|
: res.state === 201 ? res.schools.length !== 0 ? ElMessage.info(proxy.$t(`commonMsg.schoolExist`))
|
|
: res.userScs.length !== 0 ? ElMessage.info('请完善学校管理员信息')
|
|
: res.userScs.length !== 0 ? ElMessage.info('请完善学校管理员信息')
|
|
: res.cutArea.length !== 0 ? ElMessage.error('已有学区,开启研修计划,无法进行归属学区')
|
|
: res.cutArea.length !== 0 ? ElMessage.error('已有学区,开启研修计划,无法进行归属学区')
|
|
@@ -1229,6 +1260,7 @@ export default {
|
|
}
|
|
}
|
|
//搜索学校(bb数据)
|
|
//搜索学校(bb数据)
|
|
function verifyInbb () {
|
|
function verifyInbb () {
|
|
|
|
+ searchLoading.value = true
|
|
let data = { regionId: "CN" }
|
|
let data = { regionId: "CN" }
|
|
proxy.$api.verifyDatainbb(data).then((res) => {
|
|
proxy.$api.verifyDatainbb(data).then((res) => {
|
|
console.log(res, '成功返回')
|
|
console.log(res, '成功返回')
|
|
@@ -1236,6 +1268,81 @@ export default {
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
ElMessage.error('API异常,搜索学校失败')
|
|
ElMessage.error('API异常,搜索学校失败')
|
|
})
|
|
})
|
|
|
|
+ searchLoading.value = false
|
|
|
|
+ }
|
|
|
|
+ //表单操作
|
|
|
|
+ function formOperate () {
|
|
|
|
+ console.log('123456')
|
|
|
|
+ }
|
|
|
|
+ //学校创建前,数据验证(BB向)
|
|
|
|
+ function verifydataForbb () {
|
|
|
|
+ // let site=siteValue === 'cn' ? "CN":siteValue ==='international' ?
|
|
|
|
+ let verifyData = []
|
|
|
|
+ let users = JSON.parse(localStorage.getItem('userData'))
|
|
|
|
+ console.log(schoolForm.value)
|
|
|
|
+ for (let i in schoolForm.value) {
|
|
|
|
+ console.log(schoolForm.value[i].presupposeAdmin)
|
|
|
|
+ let adminArr = ''
|
|
|
|
+ if (schoolForm.value[i].presupposeAdmin.includes(',')) {
|
|
|
|
+ adminArr = schoolForm.value[i].presupposeAdmin.split(',')
|
|
|
|
+ } else if (schoolForm.value[i].presupposeAdmin.includes(',')) {
|
|
|
|
+ adminArr = schoolForm.value[i].presupposeAdmin.split(',')
|
|
|
|
+ }
|
|
|
|
+ verifyData.push({
|
|
|
|
+ name: schoolForm.value[i].name,
|
|
|
|
+ admin: adminArr ? adminArr : schoolForm.value[i].presupposeAdmin,
|
|
|
|
+ period: schoolForm.value[i].radio1,
|
|
|
|
+ size: parseInt(schoolForm.value[i].pitchSpace),
|
|
|
|
+ region: '中国',
|
|
|
|
+ province: schoolForm.value[i].schoolLocation.province,
|
|
|
|
+ city: schoolForm.value[i].schoolLocation.city,
|
|
|
|
+ dist: schoolForm.value[i].schoolLocation.area,
|
|
|
|
+ address: schoolForm.value[i].address,
|
|
|
|
+ type: schoolForm.value[i].type,
|
|
|
|
+ areaId: schoolForm.value[i].areaIdcreated,
|
|
|
|
+ code: schoolForm.value[i].code,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ let datas = { regionId: "CN", name: verifyData[0].name, nameFuzzy: false, shortCode: verifyData[0].code, shortCodeFuzzy: false }
|
|
|
|
+ proxy.$api.verifyDatainbb(datas).then((res) => {
|
|
|
|
+ console.log(res.length, '核验数据')
|
|
|
|
+ res.length == 0 ? (verifyForstate.value.state = true, verifyForstate.value.pass = true, ElMessage.success('数据已通过核验,可执行创校')) : (verifyForstate.value.state = false, verifyForstate.value.pass = false)
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ ElMessage.error('API异常,数据核验失败')
|
|
|
|
+ })
|
|
|
|
+ console.log(verifyData, '准备核验的数据')
|
|
|
|
+ }
|
|
|
|
+ //学校创建成功后,数据回报给BB
|
|
|
|
+ function backTobb (value) {
|
|
|
|
+ console.log(value, '即将回报的学校')
|
|
|
|
+ let regionsJosn = siteValue === 'cn' ? option_cn : option_gl
|
|
|
|
+ let periodData = [
|
|
|
|
+ { label: '小学', value: '21' },
|
|
|
|
+ { label: '初中', value: '31' },
|
|
|
|
+ { label: '高中', value: '34' },
|
|
|
|
+ { label: '职高', value: '36' },
|
|
|
|
+ { label: '大学', value: '41' },
|
|
|
|
+ ]
|
|
|
|
+ //省 关键字剔除
|
|
|
|
+ let textNums = value[0].province.indexOf('省') !== -1 ? value[0].province.indexOf('省') : value[0].province.indexOf('自治区') !== -1 ? value[0].province.indexOf('自治区') : value[0].province.indexOf('市') !== -1 ? value[0].province.indexOf('市') : value[0].province.indexOf('特别行政区') !== -1 ? value[0].province.indexOf('特别行政区') : ''
|
|
|
|
+ let provinceText = value[0].province.substr(0, textNums)
|
|
|
|
+ let provinceCodes = ''
|
|
|
|
+ //市 关键字剔除
|
|
|
|
+ let cityNums = value[0].city.indexOf('市') !== -1 && value[0].city !== '直辖市' ? value[0].city.indexOf('市') : value[0].city.indexOf('县') !== -1 ? value[0].city.indexOf('县') : value[0].city.indexOf('自治州') !== -1 ? value[0].city.indexOf('自治州') : value[0].city.indexOf('直辖市') !== -1 ? value[0].city.length : ''
|
|
|
|
+ let cityText = value[0].city.substr(0, cityNums)
|
|
|
|
+ let cityCodes = ''
|
|
|
|
+ //区 关键字剔除
|
|
|
|
+ let distNums = value[0].dist.indexOf('区') !== -1 && value[0].dist.length > 2 ? value[0].dist.indexOf('区') : value[0].dist.indexOf('县') !== -1 ? value[0].dist.indexOf('县') : value[0].dist.indexOf('市') !== -1 ? value[0].dist.indexOf('市') : value[0].dist.indexOf('直辖市') !== -1 || value[0].dist.indexOf('天府新区') !== -1 ? value[0].dist.length : ''
|
|
|
|
+ let distText = value[0].dist.substr(0, distNums)
|
|
|
|
+ let childrenData = []
|
|
|
|
+ for (let i in regionsJosn) {
|
|
|
|
+ regionsJosn[i].name === value[0].province ? (provinceCodes = regionsJosn[i].code, childrenData = regionsJosn[i].children) : ''
|
|
|
|
+ for (let c in childrenData) {
|
|
|
|
+ childrenData[c].name === value[0].city ? cityCodes = childrenData[c].code : ''
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(provinceText, cityText, distText, provinceCodes, cityCodes)
|
|
|
|
+
|
|
}
|
|
}
|
|
getAllschool()
|
|
getAllschool()
|
|
getCapacitys()
|
|
getCapacitys()
|
|
@@ -1306,7 +1413,13 @@ export default {
|
|
searchboxState,
|
|
searchboxState,
|
|
resultschool,
|
|
resultschool,
|
|
searchSchoolvalue,
|
|
searchSchoolvalue,
|
|
- verifyInbb
|
|
|
|
|
|
+ verifyInbb,
|
|
|
|
+ formOperate,
|
|
|
|
+ searchLoading,
|
|
|
|
+ verifydataForbb,
|
|
|
|
+ verifyForstate,
|
|
|
|
+ siteValue,
|
|
|
|
+ backTobb
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -1661,17 +1774,21 @@ export default {
|
|
}
|
|
}
|
|
.result-table {
|
|
.result-table {
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
+ height: 100%;
|
|
background-color: #ececec;
|
|
background-color: #ececec;
|
|
border: 1px solid #ececec;
|
|
border: 1px solid #ececec;
|
|
border-radius: 0px 0px 3px 3px;
|
|
border-radius: 0px 0px 3px 3px;
|
|
|
|
+ overflow: auto;
|
|
}
|
|
}
|
|
.noisdata {
|
|
.noisdata {
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
+ height: 100%;
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
.notdatas {
|
|
.notdatas {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
+ background-size: contain;
|
|
}
|
|
}
|
|
.notdatas-text {
|
|
.notdatas-text {
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -1681,6 +1798,30 @@ export default {
|
|
text-align: center;
|
|
text-align: center;
|
|
color: #bdc3c7;
|
|
color: #bdc3c7;
|
|
}
|
|
}
|
|
|
|
+.bringbox {
|
|
|
|
+ width: 100%;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+}
|
|
|
|
+.lockicon-bring {
|
|
|
|
+ width: 1.8em;
|
|
|
|
+ height: 1.8em;
|
|
|
|
+ vertical-align: -0.4em;
|
|
|
|
+ fill: currentColor;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ /* margin-right: 25px;
|
|
|
|
+ margin-left: 0px; */
|
|
|
|
+}
|
|
|
|
+.bringtext {
|
|
|
|
+ font-size: 10px;
|
|
|
|
+ color: #409eff;
|
|
|
|
+}
|
|
|
|
+.search-close {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
|
|
+.errortext {
|
|
|
|
+ color: #f56c6c;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style>
|
|
<style>
|
|
.areabox .el-form {
|
|
.areabox .el-form {
|
|
@@ -1763,4 +1904,7 @@ export default {
|
|
.el-table .success-row {
|
|
.el-table .success-row {
|
|
background: rgba(85, 239, 196, 0.4);
|
|
background: rgba(85, 239, 196, 0.4);
|
|
}
|
|
}
|
|
|
|
+.bringbox button {
|
|
|
|
+ padding: 5px 8px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|