|
@@ -126,7 +126,7 @@
|
|
</div>
|
|
</div>
|
|
<!--创区选单end-->
|
|
<!--创区选单end-->
|
|
<!--创校选单-->
|
|
<!--创校选单-->
|
|
- <div class="schoolbox" v-else-if="model == 'schollC'">
|
|
|
|
|
|
+ <div class="schoolbox" v-else-if="model == 'schollC'" >
|
|
<div class="batchCreation">
|
|
<div class="batchCreation">
|
|
<!-- <el-upload class="upload-demo" :before-upload="handleBeforeUpload" :on-exceed="handleExceed"> -->
|
|
<!-- <el-upload class="upload-demo" :before-upload="handleBeforeUpload" :on-exceed="handleExceed"> -->
|
|
<el-button size="small" type="primary" icon="el-icon-document-add" @click="batchDialogState = true">
|
|
<el-button size="small" type="primary" icon="el-icon-document-add" @click="batchDialogState = true">
|
|
@@ -137,7 +137,7 @@
|
|
<div class="backs">
|
|
<div class="backs">
|
|
<el-button size="small" @click="closeandreturn('close', 'school')">返回</el-button>
|
|
<el-button size="small" @click="closeandreturn('close', 'school')">返回</el-button>
|
|
</div>
|
|
</div>
|
|
- <div class="schoolListbox">
|
|
|
|
|
|
+ <div class="schoolListbox" v-loading="loadingSchool" element-loading-text="正在加载相关数据,请稍等...">
|
|
<div class="school-libox" v-for="(item, index) in schoolForm">
|
|
<div class="school-libox" v-for="(item, index) in schoolForm">
|
|
<p class="aera-title school-headertitle">
|
|
<p class="aera-title school-headertitle">
|
|
<div class="created-icon">
|
|
<div class="created-icon">
|
|
@@ -150,8 +150,9 @@
|
|
</p>
|
|
</p>
|
|
<el-form ref="createdSchoolforms" :label-position="labelPosition" :model="item" label-width="120px" :rules="schoolRules">
|
|
<el-form ref="createdSchoolforms" :label-position="labelPosition" :model="item" label-width="120px" :rules="schoolRules">
|
|
<el-form-item :label="$t(`schoolManages.createSchools.schoolinfo.name`)" class="school-name" prop="name">
|
|
<el-form-item :label="$t(`schoolManages.createSchools.schoolinfo.name`)" class="school-name" prop="name">
|
|
- <el-input v-model="item.name" :placeholder="$t(`schoolManages.createSchools.schoolinfo.name`)">
|
|
|
|
|
|
+ <el-input v-model="item.name" :placeholder="$t(`schoolManages.createSchools.schoolinfo.name`)" @blur="verifySchooldata('name')">
|
|
</el-input>
|
|
</el-input>
|
|
|
|
+ <p class="repetition-hint" v-if="repetition.name">该学校名称已存在,请检查学校名称</p>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="学校编码:" class="school-code">
|
|
<!-- <el-form-item label="学校编码:" class="school-code">
|
|
<el-input v-model="item.code" maxlength="6" placeholder='6位字符简码'></el-input>
|
|
<el-input v-model="item.code" maxlength="6" placeholder='6位字符简码'></el-input>
|
|
@@ -198,6 +199,21 @@
|
|
class="spacestitle">G</span> -->
|
|
class="spacestitle">G</span> -->
|
|
<el-slider v-model="item.pitchSpace" :step="100" show-stops show-input :min='0' :max='1000' />
|
|
<el-slider v-model="item.pitchSpace" :step="100" show-stops show-input :min='0' :max='1000' />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item prop="code" class="scholl-admin school-codes" label-width="120px">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span class="span-box">
|
|
|
|
+ <svg class="lockicon" aria-hidden="true">
|
|
|
|
+ <use xlink:href="#icon-xingxing"></use>
|
|
|
|
+ </svg>
|
|
|
|
+ <span>学校简码</span>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ <template #default>
|
|
|
|
+ <div class="school-codes-input"><el-input v-model="item.code" placeholder="填写完成学校信息后自动生成,无需手动填写" disabled /></div>
|
|
|
|
+ <div class="school-name-btn"><el-button @click="getCodes()">生成简码</el-button></div>
|
|
|
|
+ <p class="repetition-hint" v-if="repetition.code">该学校简码已存在,请检查学校信息</p>
|
|
|
|
+ </template>
|
|
|
|
+ </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="createdSchool()" :loading="createdSchoolLoading">{{ $t(`schoolManages.createSchools.submit`) }}</el-button>
|
|
@@ -205,6 +221,33 @@
|
|
<el-button @click="resetForm()">重置</el-button>
|
|
<el-button @click="resetForm()">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!--查询BB数据-->
|
|
|
|
+ <div class="searchbox">
|
|
|
|
+ <el-input v-model="searchSchoolvalue" placeholder="搜索学校名称/简码 检验是否重复" size="small" @focus="searchboxState=true" @blur="searchboxState=false">
|
|
|
|
+ <template #prefix>
|
|
|
|
+ <el-icon class="el-input__icon"><search /></el-icon>
|
|
|
|
+ </template>
|
|
|
|
+ </el-input>
|
|
|
|
+ <div class="result-table" v-show="searchboxState">
|
|
|
|
+ <div class="result-data" v-if="resultschool.length !==0">
|
|
|
|
+ <el-table :data="resultschool" style="width: 100%">
|
|
|
|
+ <el-table-column label="校徽">
|
|
|
|
+ <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>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="name" label="名称" />
|
|
|
|
+ <el-table-column prop="time" label="创建时间" />
|
|
|
|
+ <el-table-column prop="ord" label="创建人" />
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="noisdata" v-else-if="resultschool.length ===0">
|
|
|
|
+ <img src="@/assets/img/not-available.png" class="notdatas"/>
|
|
|
|
+ <div class="notdatas-text">暂无相关搜索数据</div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <!--查询BB end数据-->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--创校选单end-->
|
|
<!--创校选单end-->
|
|
@@ -358,7 +401,7 @@
|
|
import { reactive, getCurrentInstance, toRefs, ref, onMounted, watch, nextTick } from 'vue'
|
|
import { reactive, getCurrentInstance, toRefs, ref, onMounted, watch, nextTick } from 'vue'
|
|
import { EluiChinaAreaDht } from 'elui-china-area-dht'
|
|
import { EluiChinaAreaDht } from 'elui-china-area-dht'
|
|
import { ElMessage, ElLoading } from 'element-plus'
|
|
import { ElMessage, ElLoading } from 'element-plus'
|
|
-import { Search } from '@element-plus/icons'
|
|
|
|
|
|
+import { Search,StarFilled } from '@element-plus/icons'
|
|
import { useStore } from 'vuex'
|
|
import { useStore } from 'vuex'
|
|
import * as excel from '../../until/excel.js'
|
|
import * as excel from '../../until/excel.js'
|
|
import option from '@/static/region.json'
|
|
import option from '@/static/region.json'
|
|
@@ -391,6 +434,7 @@ const schoolAssets = {
|
|
name: '',
|
|
name: '',
|
|
radio1: [],
|
|
radio1: [],
|
|
presupposeAdmin: '',
|
|
presupposeAdmin: '',
|
|
|
|
+ code:'',
|
|
schoolLocation: {
|
|
schoolLocation: {
|
|
province: '',
|
|
province: '',
|
|
provincevalue: '',
|
|
provincevalue: '',
|
|
@@ -409,7 +453,7 @@ const schoolAssets = {
|
|
lang: "1",
|
|
lang: "1",
|
|
}
|
|
}
|
|
export default {
|
|
export default {
|
|
- components: { EluiChinaAreaDht, Search },
|
|
|
|
|
|
+ components: { EluiChinaAreaDht, Search,StarFilled },
|
|
setup () {
|
|
setup () {
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const labelPosition = 'right'
|
|
const labelPosition = 'right'
|
|
@@ -505,6 +549,22 @@ export default {
|
|
let allSchool = ref([])
|
|
let allSchool = ref([])
|
|
let batchTablesArr = ref(true)
|
|
let batchTablesArr = ref(true)
|
|
let verifyState=ref(true)
|
|
let verifyState=ref(true)
|
|
|
|
+ //本地数据验证需要数据
|
|
|
|
+ let repetition=ref({
|
|
|
|
+ name:false,
|
|
|
|
+ code:false,
|
|
|
|
+ })
|
|
|
|
+ let loadingSchool=ref(true)
|
|
|
|
+ //右边查询结果显示
|
|
|
|
+ let searchboxState=ref(false)
|
|
|
|
+ let resultschool=ref([
|
|
|
|
+ // {
|
|
|
|
+ // name: '成都市银都紫藤小学',
|
|
|
|
+ // time: '2019-08-15',
|
|
|
|
+ // ord:'王区管'
|
|
|
|
+ // },
|
|
|
|
+ ])
|
|
|
|
+ let searchSchoolvalue=ref('')
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
formArea.value = JSON.parse(JSON.stringify(areaData))
|
|
formArea.value = JSON.parse(JSON.stringify(areaData))
|
|
console.log(formArea, '初步的数据')
|
|
console.log(formArea, '初步的数据')
|
|
@@ -671,6 +731,7 @@ export default {
|
|
name: '',
|
|
name: '',
|
|
radio1: [],
|
|
radio1: [],
|
|
presupposeAdmin: '',
|
|
presupposeAdmin: '',
|
|
|
|
+ code:'',
|
|
schoolLocation: {
|
|
schoolLocation: {
|
|
province: '',
|
|
province: '',
|
|
provincevalue: '',
|
|
provincevalue: '',
|
|
@@ -1100,12 +1161,29 @@ export default {
|
|
}
|
|
}
|
|
//所有学校列表
|
|
//所有学校列表
|
|
function getAllschool () {
|
|
function getAllschool () {
|
|
- proxy.$api.getSchooldata({}).then((res) => {
|
|
|
|
|
|
+ console.log(loadingSchool.value,'现在的状态')
|
|
|
|
+ proxy.$api.getsimpleSchool({}).then((res) => {
|
|
console.log(res, '获取学校列表')
|
|
console.log(res, '获取学校列表')
|
|
- res.state === 200 ? allSchool.value = res.schoolAssists : ''
|
|
|
|
|
|
+ res.state === 200 ? (allSchool.value = res.scSimple,loadingSchool.value=false) : loadingSchool.value=false
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ ElMessage.error('API异常,学校列表获取失败')
|
|
|
|
+ loadingSchool.value=false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //根据当前填写信息获取code
|
|
|
|
+ function getCodes(){
|
|
|
|
+ console.log(schoolForm.value)
|
|
|
|
+ let schooldata=schoolForm.value
|
|
|
|
+ let param=[{id:'',name:schooldata[0].name,province:schooldata[0].schoolLocation.province,aname:schooldata[0].name,city:schooldata[0].schoolLocation.area,createCount:0}]
|
|
|
|
+ let data={schools:param}
|
|
|
|
+ console.log(data,'提交数据')
|
|
|
|
+ proxy.$api.getSchoolcode(data).then((res)=>{
|
|
|
|
+ console.log(res,'生成的简码')
|
|
|
|
+ res.state === 200 ? (schoolForm.value[0].code=res.createScInfo[0].id,ElMessage.success('简码生成成功')):''
|
|
|
|
+ }).catch((error)=>{
|
|
|
|
+ ElMessage.error('API异常,生成简码失败,请稍后重试')
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
function isRepeat (arr) {
|
|
function isRepeat (arr) {
|
|
var hash = {};
|
|
var hash = {};
|
|
for (var i in arr) {
|
|
for (var i in arr) {
|
|
@@ -1116,10 +1194,28 @@ export default {
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- getCapacitys()
|
|
|
|
|
|
+ //本地数据核验
|
|
|
|
+ function verifySchooldata(param){
|
|
|
|
+ let schoolList=allSchool.value
|
|
|
|
+ let schoolname='';let schoolCode=''
|
|
|
|
+ let resultName=[];let resultCode=[]
|
|
|
|
+ param ==='name' ? (schoolname=schoolForm.value[0].name,resultName=schoolList.filter((item)=>{return item.name===schoolname})):param ==='code' ? (schoolCode=schoolForm.value[0].code,resultCode=schoolList.filter((item)=>{return item.id===schoolCode})):''
|
|
|
|
+ resultName.length >0 ? repetition.value.name=true:resultCode.length >0 ? repetition.value.code=true:''
|
|
|
|
+ console.log(resultName,resultCode,'检查结果')
|
|
|
|
+ resultName.length ===0 ? repetition.value.name=false:''
|
|
|
|
+ resultCode.length ===0 ? repetition.value.code=false:''
|
|
|
|
+ }
|
|
getAllschool()
|
|
getAllschool()
|
|
|
|
+ getCapacitys()
|
|
let a = isRepeat()
|
|
let a = isRepeat()
|
|
console.log(a, '最后的结果')
|
|
console.log(a, '最后的结果')
|
|
|
|
+ watch(schoolForm.value,(newvalue)=>{
|
|
|
|
+ newvalue[0].code ? verifySchooldata('code'): ''
|
|
|
|
+ }, {deep:true} )
|
|
|
|
+ watch(searchSchoolvalue,(newvalues)=>{
|
|
|
|
+ console.log(newvalues,'监听')
|
|
|
|
+ newvalues && resultschool.value.length ===0 ? resultschool.value.push({name: '成都市银都紫藤小学',time: '2019-08-15',ord:'王区管' }):''
|
|
|
|
+ })
|
|
return {
|
|
return {
|
|
model,
|
|
model,
|
|
labelPosition,
|
|
labelPosition,
|
|
@@ -1169,7 +1265,14 @@ export default {
|
|
isRepeat,
|
|
isRepeat,
|
|
createdAreds,
|
|
createdAreds,
|
|
verifyData,
|
|
verifyData,
|
|
- verifyState
|
|
|
|
|
|
+ verifyState,
|
|
|
|
+ getCodes,
|
|
|
|
+ verifySchooldata,
|
|
|
|
+ repetition,
|
|
|
|
+ loadingSchool,
|
|
|
|
+ searchboxState,
|
|
|
|
+ resultschool,
|
|
|
|
+ searchSchoolvalue
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -1264,11 +1367,12 @@ export default {
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
|
|
|
|
-.school-name,
|
|
|
|
.school-location {
|
|
.school-location {
|
|
width: 31%;
|
|
width: 31%;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+.school-name{
|
|
|
|
+ width:31%;
|
|
|
|
+}
|
|
.school-libox {
|
|
.school-libox {
|
|
position: relative;
|
|
position: relative;
|
|
border: 1px solid #ccc;
|
|
border: 1px solid #ccc;
|
|
@@ -1480,6 +1584,69 @@ export default {
|
|
color:red;
|
|
color:red;
|
|
margin-left:1%;
|
|
margin-left:1%;
|
|
}
|
|
}
|
|
|
|
+.school-codes-input,.school-name-btn{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ vertical-align: top;
|
|
|
|
+}
|
|
|
|
+.school-codes{
|
|
|
|
+ width:37%;
|
|
|
|
+}
|
|
|
|
+.school-codes-input{
|
|
|
|
+ width:80%;
|
|
|
|
+}
|
|
|
|
+.school-name-btn{
|
|
|
|
+ width:15%;
|
|
|
|
+ margin-left: 5%;
|
|
|
|
+}
|
|
|
|
+.lockicon {
|
|
|
|
+ width: 1.2em;
|
|
|
|
+ height: 1.2em;
|
|
|
|
+ vertical-align: -0.2em;
|
|
|
|
+ fill: currentColor;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ margin-right: 5px;
|
|
|
|
+}
|
|
|
|
+.repetition-hint{
|
|
|
|
+ font-size:12px;
|
|
|
|
+ color:#f56c6c;
|
|
|
|
+ line-height: 12px;
|
|
|
|
+ margin-bottom: 0px;
|
|
|
|
+ margin-top:2px;
|
|
|
|
+}
|
|
|
|
+.searchbox{
|
|
|
|
+ width:450px;
|
|
|
|
+ height:500px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top:1%;
|
|
|
|
+ right:1%;
|
|
|
|
+ text-align: left;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+}
|
|
|
|
+.schoolListbox{
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+.result-table{
|
|
|
|
+ width:100%;
|
|
|
|
+ background-color: #ececec;
|
|
|
|
+ border:1px solid #ececec;
|
|
|
|
+ border-radius:0px 0px 3px 3px;
|
|
|
|
+}
|
|
|
|
+.noisdata{
|
|
|
|
+ width:100%;
|
|
|
|
+ position: relative;
|
|
|
|
+}
|
|
|
|
+.notdatas{
|
|
|
|
+ width:100%;
|
|
|
|
+ height:100%;
|
|
|
|
+}
|
|
|
|
+.notdatas-text{
|
|
|
|
+ position: absolute;
|
|
|
|
+ bottom:12%;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ width:100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color:#bdc3c7;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style>
|
|
<style>
|
|
.areabox .el-form {
|
|
.areabox .el-form {
|