|
@@ -40,6 +40,10 @@
|
|
|
<el-form-item :label="$t(`areaManages.createdArea.project`)" class="capacity-box">
|
|
|
<el-select v-model="formArea.capacityvalue" :placeholder="$t(`areaManages.createdArea.projecthint`)">
|
|
|
<el-option v-for="item in formArea.options" :key="item.id" :label="item.name + '——' + item.standardName" :value="item.id">
|
|
|
+ <el-tag class="reminder" effect="dark" style="float: left" size="small" v-if="item.id ==='02944f32-f534-3397-ea56-e6f1fc6c3714' || item.id==='69e3d413-50a1-4f5e-844a-e0f7c9622ea3'">标准</el-tag>
|
|
|
+ <el-tag class="reminder" type="info" effect="dark" style="float: left" size="small" v-else-if="(item.id !=='02944f32-f534-3397-ea56-e6f1fc6c3714' || item.id !=='69e3d413-50a1-4f5e-844a-e0f7c9622ea3') && item.id !=='bde5c011-2ae4-461a-b46c-5483ba72ae45'">普通</el-tag>
|
|
|
+ <el-tag class="reminder" type="success" effect="dark" style="float: left" size="small" v-else-if="item.id ==='bde5c011-2ae4-461a-b46c-5483ba72ae45'">完整</el-tag>
|
|
|
+ <span>{{ item.name}}</span>——<span>{{item.standardName}}</span>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -150,7 +154,7 @@
|
|
|
</p>
|
|
|
<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-input v-model="item.name" :placeholder="$t(`schoolManages.createSchools.schoolinfo.name`)" @blur="verifySchooldata('name')">
|
|
|
+ <el-input v-model="item.name" :placeholder="$t(`schoolManages.createSchools.schoolinfo.name`)">
|
|
|
</el-input>
|
|
|
<p class="repetition-hint" v-if="repetition.name">该学校名称已存在,请检查学校名称</p>
|
|
|
</el-form-item>
|
|
@@ -179,6 +183,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="预设管理员" class="scholl-admin" prop="presupposeAdmin">
|
|
|
<el-input v-model="item.presupposeAdmin" placeholder="输入醍摩豆账号或手机号,预设学校管理员" />
|
|
|
+ <p class="repetition-hint" v-if="repetition.admin">该管理员用户不存在,请检查</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="归属学区ID" class="scholl-admin belong">
|
|
|
<!-- <el-input v-model="item.areaIdcreated" placeholder="" /> -->
|
|
@@ -186,6 +191,7 @@
|
|
|
<el-option v-for="item in createdAreds" :key="item.id" :label="item.id ? item.name+ '——' + item.institution:item.name" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
+ <p class="repetition-hint" v-if="repetition.area">该学区数据异常,请检查</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属位置" class="school-location">
|
|
|
<!-- <elui-china-area-dht :leave="3" @change="onChange(item.value,item.num)" placeholder="请选择地区" v-model="item.value"></elui-china-area-dht> -->
|
|
@@ -233,8 +239,8 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="confirmarea">
|
|
|
- <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 type="primary" @click="verifyBase()" v-if="verifyForstate.state ===false">数据核验</el-button>
|
|
|
+ <el-button type="success" @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="resetForm()">重置</el-button>
|
|
|
</div>
|
|
@@ -273,7 +279,7 @@
|
|
|
<template #default="scope">
|
|
|
<div v-if="scope.row.source !=='BI'">
|
|
|
<div class="bringbox">
|
|
|
- <el-button size="small" @click="formOperate">
|
|
|
+ <el-button size="small" @click="formOperate(scope.row)">
|
|
|
<svg class="lockicon-bring" aria-hidden="true">
|
|
|
<use xlink:href="#icon-daoru"></use>
|
|
|
</svg>
|
|
@@ -381,6 +387,7 @@
|
|
|
<el-table-column prop="period" label="学段类型" align="center" />
|
|
|
<el-table-column prop="admin" label="预设管理员" align="center" />
|
|
|
<el-table-column prop="areaId" label="所属学区ID" align="center" />
|
|
|
+ <el-table-column prop="id" label="简码" align="center" v-if="codeShow" />
|
|
|
<el-table-column prop="size" :label="$t(`schoolManages.createSchools.schoolinfo.spacesize`)" align="center" />
|
|
|
<el-table-column prop="region" :label="$t(`schoolManages.createSchools.schoolinfo.nation`)" align="center" />
|
|
|
<el-table-column prop="province" :label="$t(`areaManages.selector.provinceName`)" align="center" />
|
|
@@ -417,6 +424,16 @@
|
|
|
</svg>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="回传情况" align="center" v-if="backstatus">
|
|
|
+ <template #default="scope">
|
|
|
+ <svg class="resultIcon" aria-hidden="true" v-if="scope.row.backstate ==='add'">
|
|
|
+ <use xlink:href="#icon-tijiaochenggong"></use>
|
|
|
+ </svg>
|
|
|
+ <svg class="resultIcon" aria-hidden="true" v-else>
|
|
|
+ <use xlink:href="#icon-shibai"></use>
|
|
|
+ </svg>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<div class="batchs-btn">
|
|
|
<el-button type="primary" size="medium" @click="quantity()" :loading="createdSchoolLoading" v-if="batchCreatedSchool===false && batchTablesArr && verifyState">
|
|
@@ -429,7 +446,7 @@
|
|
|
<!-- {{ $t(`schoolManages.createSchools.batchBtn`) }} -->
|
|
|
数据验证
|
|
|
</el-button>
|
|
|
- <el-button type="primary" size="medium" @click="batchList=false,batchCreatedSchool=false,batchData=[]" v-else-if="batchCreatedSchool===true">
|
|
|
+ <el-button type="primary" size="medium" @click="batchList=false,batchCreatedSchool=false,batchData=[],backstatus=false,codeShow=false" v-else-if="batchCreatedSchool===true">
|
|
|
确认
|
|
|
</el-button>
|
|
|
<span v-if="batchCreatedSchool===false && batchTablesArr && verifyState===false" class="error-int">请完善表格,重新提交</span>
|
|
@@ -457,7 +474,7 @@
|
|
|
<script>
|
|
|
import { reactive, getCurrentInstance, toRefs, ref, onMounted, watch, nextTick } from 'vue'
|
|
|
import { EluiChinaAreaDht } from 'elui-china-area-dht'
|
|
|
-import { ElMessage, ElLoading } from 'element-plus'
|
|
|
+import { ElMessage, ElLoading, } from 'element-plus'
|
|
|
import { Search, StarFilled } from '@element-plus/icons'
|
|
|
import { useStore } from 'vuex'
|
|
|
import * as excel from '../../until/excel.js'
|
|
@@ -601,7 +618,7 @@ export default {
|
|
|
let schoolregionParams = ref({
|
|
|
label: 'name', //这里可以配置你们后端返回的属性
|
|
|
value: 'code',
|
|
|
- checkStrictly: false,
|
|
|
+ checkStrictly: true,
|
|
|
})
|
|
|
let loadingCreatedArea = ref(false)
|
|
|
//批量创建学校显示结果状态
|
|
@@ -610,10 +627,14 @@ export default {
|
|
|
let allSchool = ref([])
|
|
|
let batchTablesArr = ref(true)
|
|
|
let verifyState = ref(true)
|
|
|
+ let codeShow = ref(false)
|
|
|
+ let backstatus = ref(false)
|
|
|
//本地数据验证需要数据
|
|
|
let repetition = ref({
|
|
|
name: false,
|
|
|
code: false,
|
|
|
+ admin: false,
|
|
|
+ area: false,
|
|
|
})
|
|
|
let loadingSchool = ref(true)
|
|
|
let loadingTexts = ref('正在加载相关数据,请稍等')
|
|
@@ -730,6 +751,9 @@ export default {
|
|
|
console.log(res, '微能力点')
|
|
|
createdAreds.value.push({ id: '', name: '暂不选择', institution: '无' })
|
|
|
res.state === 200 ? ((formArea.value.options = res.areas), (res.areas.forEach((item) => { createdAreds.value.push(item) })), store.commit('getPoint', res.areas)) : ElMessage.error('获取微能力点方案失败,API异常')
|
|
|
+ formArea.value.options.map((item, index) => {
|
|
|
+ item.id === 'bde5c011-2ae4-461a-b46c-5483ba72ae45' ? formArea.value.options.unshift(formArea.value.options.splice(index, 1)[0]) : ''
|
|
|
+ })
|
|
|
console.log(t(`areaManages.createdArea.notAreaname`))
|
|
|
})
|
|
|
}
|
|
@@ -1009,8 +1033,14 @@ export default {
|
|
|
}
|
|
|
//批量创校 数据验证
|
|
|
function verifyData () {
|
|
|
+ const loadingverify = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在验证数据内容,请稍后...',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
+ })
|
|
|
let batchDatas = batchData.value
|
|
|
let schoolData = batchData.value
|
|
|
+ let presentData = []
|
|
|
let scName = []; let scAdmin = []; let scAreaid = []
|
|
|
batchDatas.forEach((item) => {
|
|
|
item.name ? scName.push(item.name.toString()) : ''
|
|
@@ -1019,17 +1049,23 @@ export default {
|
|
|
if (item.admin.includes(',')) {
|
|
|
let adminA = item.admin.split(',')
|
|
|
scAdmin = scAdmin.concat(adminA)
|
|
|
+ item.admin = scAdmin
|
|
|
} else if (item.admin.includes(',')) {
|
|
|
let adminA = item.admin.split(',')
|
|
|
scAdmin = scAdmin.concat(adminA)
|
|
|
+ item.admin = scAdmin
|
|
|
} else {
|
|
|
scAdmin.push(item.admin.toString())
|
|
|
+ item.admin = scAdmin
|
|
|
}
|
|
|
+ scAdmin = []
|
|
|
+ presentData.push(item)
|
|
|
})
|
|
|
+ console.log(scAdmin, batchDatas, '处理结果')
|
|
|
for (let i in schoolData) {
|
|
|
- console.log(schoolData)
|
|
|
- let ids = MathRand()
|
|
|
- schoolData[i].id = ids
|
|
|
+ // console.log(schoolData)
|
|
|
+ // let ids = MathRand()
|
|
|
+ // schoolData[i].id = ids
|
|
|
if (schoolData[i].name === '' || schoolData[i].name === undefined) {
|
|
|
// createdSchoolLoading.value = false
|
|
|
ElMessage.error('请完善创建学校名称')
|
|
@@ -1048,37 +1084,57 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- let data = { scNames: scName, accounts: scAdmin, areaIds: scAreaid }
|
|
|
+ let data = { checkScs: presentData }
|
|
|
+ console.log(data, '提交的数据')
|
|
|
proxy.$api.verifyContent(data).then((res) => {
|
|
|
console.log(res, '数据验证的结果')
|
|
|
- res.state === 200 ? (batchTablesArr.value = true, batchDatas.forEach((item) => { item.dataState = true })) : ''
|
|
|
+ res.state === 200 ? (batchDatas.forEach((item) => { item.dataState = true }), batchVerify(presentData, loadingverify), codeShow.value = true) : ''
|
|
|
+ if (res.state === 200) {
|
|
|
+ //处理简码
|
|
|
+ res.createScInfo.forEach((items) => {
|
|
|
+ let name = items.name
|
|
|
+ let code = items.id
|
|
|
+ for (let c in batchDatas) {
|
|
|
+ batchDatas[c].name === name ? batchDatas[c].id = code : ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (res.state === 201) {
|
|
|
+ codeShow.value = false
|
|
|
batchTablesArr.value = true; verifyState.value = false
|
|
|
batchDatas.forEach((item) => { item.dataState = true })
|
|
|
if (res.existScNames.length !== 0) {
|
|
|
+ console.log('进入学校重复的')
|
|
|
for (let i in res.existScNames) {
|
|
|
- let name = res.existScNames[i]
|
|
|
+ let name = res.existScNames[i].name
|
|
|
for (let n in batchDatas) {
|
|
|
batchDatas[n].name === name ? (batchDatas[n].abnormaltext = '该学校名称已存在', batchDatas[n].class = 'anomaly', batchDatas[n].dataState = false) : ''
|
|
|
}
|
|
|
}
|
|
|
- } else if (res.noAccounts.length !== 0) {
|
|
|
+ }
|
|
|
+ if (res.noAccounts.length !== 0) {
|
|
|
+ console.log('进入管理员不存在的')
|
|
|
for (let i in res.noAccounts) {
|
|
|
- let admins = res.noAccounts[i]
|
|
|
+ let admins = res.noAccounts[i].name
|
|
|
for (let n in batchDatas) {
|
|
|
- batchDatas[n].admin === admins ? (batchDatas[n].abnormaltext = '当前创建管理员用户不存在', batchDatas[n].class = 'anomaly', batchDatas[n].dataState = false) : ''
|
|
|
+ batchDatas[n].name === admins ? (batchDatas[n].abnormaltext = batchDatas[n].abnormaltext ? batchDatas[n].abnormaltext + ',' + '当前创建管理员用户不存在' : '当前创建管理员用户不存在', batchDatas[n].class = 'anomaly', batchDatas[n].dataState = false) : ''
|
|
|
}
|
|
|
}
|
|
|
- } else if (res.noAreaIds.length !== 0) {
|
|
|
+ }
|
|
|
+ if (res.noAreaIds.length !== 0) {
|
|
|
+ console.log('进入学区不存在的')
|
|
|
for (let i in res.noAreaIds) {
|
|
|
- let areaIdx = res.noAreaIds[i]
|
|
|
+ let areaIdx = res.noAreaIds[i].name
|
|
|
for (let n in batchDatas) {
|
|
|
- batchDatas[n].areaId == areaIdx ? (batchDatas[n].abnormaltext = '创建学校所归属学区ID异常', batchDatas[n].class = 'anomaly', batchDatas[n].dataState = false) : ''
|
|
|
+ batchDatas[n].areaId == areaIdx ? (batchDatas[n].abnormaltext = batchDatas[n].abnormaltext ? batchDatas[n].abnormaltext + ',' + '创建学校所归属学区ID异常' : '创建学校所归属学区ID异常', batchDatas[n].class = 'anomaly', batchDatas[n].dataState = false) : ''
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ console.log(batchDatas, '返回后处理的数据')
|
|
|
+ loadingverify.close()
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
+ loadingverify.close()
|
|
|
ElMessage.error('API异常,数据验证失败')
|
|
|
})
|
|
|
}
|
|
@@ -1094,7 +1150,7 @@ export default {
|
|
|
} else if (schoolData[n].admin.includes(',')) {
|
|
|
schoolData[n].admin = schoolData[n].admin.split(",")
|
|
|
} else {
|
|
|
- schoolData[n].admin = [schoolData[n].admin]
|
|
|
+ schoolData[n].admin = schoolData[n].admin
|
|
|
}
|
|
|
}
|
|
|
console.log(schoolData, '处理ID后')
|
|
@@ -1103,13 +1159,14 @@ export default {
|
|
|
proxy.$api.createdSchools(datas).then((res) => {
|
|
|
console.log(res, '批量创校的返回')
|
|
|
if (res.state === 200) {
|
|
|
+ codeShow.value = true
|
|
|
batchData.value.forEach((y) => { y.state = true })
|
|
|
batchCreatedSchool.value = true
|
|
|
ElMessage.success(proxy.$t(`commonMsg.batchCreatedSuccess`))
|
|
|
// batchList.value = false;
|
|
|
// batchData.value = [];
|
|
|
- ElMessage.success('批量创建成功')
|
|
|
- router.push({ path: '/home/schoolmanage' })
|
|
|
+ ElMessage.success('批量创建成功'), batchSuccessback(batchData.value)
|
|
|
+ // router.push({ path: '/home/schoolmanage' })
|
|
|
} else if (res.state === 201) {
|
|
|
console.log(batchData.value, '值!!!')
|
|
|
for (let i in batchData.value) {
|
|
@@ -1149,7 +1206,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
function tableRowClassName (row) {
|
|
|
- console.log(row.row, 'TABLE变化')
|
|
|
+ // console.log(row.row, 'TABLE变化')
|
|
|
// if (row.row.zyl >= 80) {
|
|
|
// return 'warm-row';
|
|
|
// }
|
|
@@ -1270,7 +1327,7 @@ export default {
|
|
|
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 : ''
|
|
|
+ resultName.length > 0 ? repetition.value.name = true : ''
|
|
|
console.log(resultName, resultCode, '检查结果')
|
|
|
resultName.length === 0 ? repetition.value.name = false : ''
|
|
|
resultCode.length === 0 ? repetition.value.code = false : ''
|
|
@@ -1288,18 +1345,79 @@ export default {
|
|
|
searchLoading.value = false
|
|
|
}
|
|
|
//表单操作
|
|
|
- function formOperate () {
|
|
|
- console.log('123456')
|
|
|
+ function formOperate (value) {
|
|
|
+ console.log(value)
|
|
|
+ //向表单赋值
|
|
|
+ schoolForm.value[0].name = value.name
|
|
|
+ schoolForm.value[0].code = value.code
|
|
|
+ let periodList = []
|
|
|
+ if (value.period !== null) {
|
|
|
+ value.period.includes('21') ? periodList.push('小学') : ''
|
|
|
+ value.period.includes('31') ? periodList.push('初中') : ''
|
|
|
+ value.period.includes('34') ? periodList.push('高中') : ''
|
|
|
+ value.period.includes('41') ? periodList.push('大学') : ''
|
|
|
+ }
|
|
|
+ schoolForm.value[0].radio1 = periodList
|
|
|
+ let locationCode = []
|
|
|
+ value.provinceId ? locationCode.push(value.provinceId) : ''
|
|
|
+ value.cityId ? locationCode.push(value.cityId) : ''
|
|
|
+ // locationCode.push('510104')
|
|
|
+ provinceOptions.value.provinceValue = locationCode
|
|
|
+ console.log(provinceOptions, '位置')
|
|
|
+ schoolForm.value[0].address = value.address
|
|
|
}
|
|
|
- //学校创建前,数据验证(BB向)
|
|
|
- function verifydataForbb () {
|
|
|
- // loadingTexts.value = '正在验证数据有效性,请稍等...'
|
|
|
- // loadingSchool.value = true
|
|
|
+ //创校数据验证 本服务器端
|
|
|
+ function verifyBase () {
|
|
|
+ console.log(schoolForm.value)
|
|
|
const verifySchool = ElLoading.service({
|
|
|
lock: true,
|
|
|
text: '数据验证中,请稍后...',
|
|
|
background: 'rgba(0, 0, 0, 0.6)',
|
|
|
})
|
|
|
+ let schoolData = schoolForm.value
|
|
|
+ let adminList = []
|
|
|
+ if (schoolData[0].presupposeAdmin.includes(',')) {
|
|
|
+ adminList = schoolData[0].presupposeAdmin.split(',')
|
|
|
+ } else if (schoolData[0].presupposeAdmin.includes(',')) {
|
|
|
+ adminList = schoolData[0].presupposeAdmin.split(',')
|
|
|
+ } else {
|
|
|
+ adminList.push(schoolData[0].presupposeAdmin)
|
|
|
+ }
|
|
|
+ let schoolonly = {
|
|
|
+ name: schoolData[0].name,
|
|
|
+ admin: adminList,
|
|
|
+ period: schoolData[0].radio1,
|
|
|
+ size: schoolData[0].pitchSpace,
|
|
|
+ region: '中国',
|
|
|
+ province: schoolData[0].schoolLocation.province,
|
|
|
+ city: schoolData[0].schoolLocation.city,
|
|
|
+ dist: schoolData[0].schoolLocation.area,
|
|
|
+ address: schoolData[0].address,
|
|
|
+ areaId: schoolData[0].areaIdcreated,
|
|
|
+ type: Number(schoolData[0].type),
|
|
|
+ }
|
|
|
+ let datas = { checkScs: [schoolonly] }
|
|
|
+ console.log(datas)
|
|
|
+ proxy.$api.verifyContent(datas).then((res) => {
|
|
|
+ console.log(res, '返回内容')
|
|
|
+ res.state === 200 ? (verifydataForbb(verifySchool), ElMessage({ showClose: false, message: '已通过数据,点击下方按钮进行创校操作', type: 'success', duration: 4000 })) : ''
|
|
|
+ if (res.state === 201) {
|
|
|
+ res.existScNames.length !== 0 ? repetition.value.name = true : ''
|
|
|
+ res.noAccounts.length !== 0 ? repetition.value.admin = true : ''
|
|
|
+ res.noAreaIds.length !== 0 ? repetition.value.area = true : ''
|
|
|
+ verifyForstate.value.state = false, verifyForstate.value.pass = false
|
|
|
+ ElMessage({ showClose: false, message: '数据存在异常,请检查表单内容', type: 'error', duration: 4000 })
|
|
|
+ }
|
|
|
+ verifySchool.close()
|
|
|
+ }).catch((error) => {
|
|
|
+ ElMessage.error('API异常,数据核验失败')
|
|
|
+ verifySchool.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //学校创建前,数据验证(BB向)
|
|
|
+ function verifydataForbb (loadingV) {
|
|
|
+ // loadingTexts.value = '正在验证数据有效性,请稍等...'
|
|
|
+ // loadingSchool.value = true
|
|
|
// let site=siteValue === 'cn' ? "CN":siteValue ==='international' ?
|
|
|
let verifyData = []
|
|
|
let users = JSON.parse(localStorage.getItem('userData'))
|
|
@@ -1330,12 +1448,25 @@ export default {
|
|
|
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)
|
|
|
+ res.length == 0 ? (verifyForstate.value.state = true, verifyForstate.value.pass = true, ElMessage.success('数据已通过核验,可执行创校')) : (verifyForstate.value.state = false, verifyForstate.value.pass = false, ElMessage.error('数据未通过核验,请检查表单内容'))
|
|
|
}).catch((error) => {
|
|
|
ElMessage.error('API异常,数据核验失败')
|
|
|
})
|
|
|
console.log(verifyData, '准备核验的数据')
|
|
|
- verifySchool.close()
|
|
|
+ loadingV.close()
|
|
|
+ }
|
|
|
+ //批量创建学校 数据验证BB
|
|
|
+ function batchVerify (value, lodingverify) {
|
|
|
+ let scArr = value
|
|
|
+ let snameList = []; let scodeList = []; let shortArr = [];
|
|
|
+ scArr.forEach((item) => { snameList.push(item.name); scodeList.push(item.id); shortArr.push(item.id) })
|
|
|
+ let data = { regionId: "CN", nameList: snameList, codeList: scodeList, shortCodeList: shortArr }
|
|
|
+ proxy.$api.verifyDatainbb(data).then((res) => {
|
|
|
+ res.length == 0 ? (ElMessage.success('数据已通过核验,可执行创校'), batchTablesArr.value = true) : (ElMessage.error('数据未通过核验,请检查表单内容'), batchTablesArr.value = true, verifyState.value = false)
|
|
|
+ }).catch((error) => {
|
|
|
+ ElMessage.error('API异常,批量数据核验失败')
|
|
|
+ })
|
|
|
+ lodingverify.close()
|
|
|
}
|
|
|
//学校创建成功后,数据回报给BB
|
|
|
function backTobb (value, loadingDom) {
|
|
@@ -1398,6 +1529,81 @@ export default {
|
|
|
ElMessage.error('API异常,数据回报失败')
|
|
|
})
|
|
|
loadingDom.close()
|
|
|
+ router.push('/home/schoolmanage')
|
|
|
+ }
|
|
|
+ //批量创校成功后,数据回报BB
|
|
|
+ function batchSuccessback (data) {
|
|
|
+ console.log(data, '准备回报数据')
|
|
|
+ let schoolObj = data
|
|
|
+ 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' },
|
|
|
+ ]
|
|
|
+ for (let i in schoolObj) {
|
|
|
+ console.log(schoolObj[i])
|
|
|
+ //取出学段
|
|
|
+ schoolObj[i].backPeriod = '';
|
|
|
+ schoolObj[i].provinceCode = ''
|
|
|
+ schoolObj[i].cityCode = ''
|
|
|
+ let periodValue = []
|
|
|
+ let phaseName = schoolObj[i].period
|
|
|
+ //按照BB向 处理学段里面的值
|
|
|
+ for (let x in phaseName) {
|
|
|
+ let names = phaseName[x]
|
|
|
+ for (let d in periodData) {
|
|
|
+ periodData[d].label === names ? periodValue.push(periodData[d].value) : ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //赋值给新学段内容
|
|
|
+ schoolObj[i].backPeriod = periodValue
|
|
|
+ //处理省 市 编码
|
|
|
+ for (let p in regionsJosn) {
|
|
|
+ if (regionsJosn[p].name === schoolObj[i].province) {
|
|
|
+ schoolObj[i].provinceCode = regionsJosn[p].code
|
|
|
+ let childrenData = regionsJosn[p].children
|
|
|
+ for (let c in childrenData) {
|
|
|
+ childrenData[c].name === schoolObj[i].city ? schoolObj[i].cityCode = childrenData[c].code : ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(schoolObj, '处理数据后的内容')
|
|
|
+ let submitData = []
|
|
|
+ schoolObj.forEach((item) => {
|
|
|
+ submitData.push({
|
|
|
+ code: item.id,
|
|
|
+ name: item.name,
|
|
|
+ regionId: "CN",
|
|
|
+ regionName: "中国",
|
|
|
+ provinceId: item.provinceCode,
|
|
|
+ provinceName: item.province,
|
|
|
+ cityId: item.cityCode,
|
|
|
+ cityName: item.city,
|
|
|
+ address: item.address,
|
|
|
+ lang: "zh-cn",
|
|
|
+ shortCode: item.id,
|
|
|
+ period: item.backPeriod,
|
|
|
+ source: "BI"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(submitData, '即将回报的数据')
|
|
|
+ proxy.$api.successBack(submitData).then((res) => {
|
|
|
+ console.log(res, '回报APi返回')
|
|
|
+ if (res.length !== 0) {
|
|
|
+ backstatus.value = true
|
|
|
+ res.forEach((item) => {
|
|
|
+ for (let i in batchData.value) {
|
|
|
+ batchData.value[i].name = item.name ? batchData.value[i].backstate = item.status : ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ ElMessage.error('API异常,数据回报失败')
|
|
|
+ })
|
|
|
}
|
|
|
getAllschool()
|
|
|
getCapacitys()
|
|
@@ -1475,7 +1681,12 @@ export default {
|
|
|
verifyForstate,
|
|
|
siteValue,
|
|
|
backTobb,
|
|
|
- loadingTexts
|
|
|
+ loadingTexts,
|
|
|
+ batchVerify,
|
|
|
+ verifyBase,
|
|
|
+ batchSuccessback,
|
|
|
+ codeShow,
|
|
|
+ backstatus
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@@ -1896,6 +2107,10 @@ export default {
|
|
|
font-size: 12px;
|
|
|
margin-left: 1%;
|
|
|
}
|
|
|
+.reminder {
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
</style>
|
|
|
<style>
|
|
|
.areabox .el-form {
|