洋浦学校 导入功能开发

init
gongdi 3 years ago
parent 64f3c0b0c6
commit 948c5c443d

@ -16,6 +16,9 @@
<div id="fileNameId" class="file-name-style"></div>
</div>
</div>
<div class="tips-style">
"注意:导入成功后将覆盖已有数据"
</div>
<div id="tipsId" class="tips-style" style="display:none">
{{"*"+tips}}
</div>

@ -1488,5 +1488,30 @@ const InterfaceConfig = {
isTestLogin: true,
},
/*
* 导入体质监测模板数据覆盖原数据java
* "file":" 必填 Excel文件xls、xlsx"
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
"importPhysicalData":{
url: 'intellioa/java/center/importPhysicalData',
method: 'post',
isTestLogin: true,
},
/*
* 导入近视眼监控模板数据覆盖原数据java
* "file":" 必填 Excel文件xls、xlsx"
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
"importVisionData":{
url: 'intellioa/java/center/importVisionData',
method: 'post',
isTestLogin: true,
},
};
export default InterfaceConfig;

@ -55,6 +55,7 @@
} from 'ant-design-vue';
import InterConfig from '../interConfig';
export default{
name: "physicalInfo",
props: {
monitorId: {
type: String,
@ -64,7 +65,6 @@
data(){
return {
pageLoading: false,
locale,
stageName: "",
gradeName: "",
className: "",

@ -53,6 +53,7 @@
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input, Pagination} from 'ant-design-vue';
import PhysicalInfo from './physicalInfo.vue';
import ImportExcel from '../../../../../../components/common/importExcel/importExcel.vue';
import axios from 'axios';
const tableColumn = [
{
dataIndex: 'index',
@ -205,7 +206,33 @@
},
//
startImport:function (file) {
var formDatas = new FormData();
formDatas.append("file", file);
this.showImport = false;
this.loading = true;
let url = this.BaseConfig._action_path+"/dsideal_yy/ypt/intellioa/java/center/importPhysicalData?" +
"person_id="+this.BaseConfig.userInfo.person_id+
"&identity_id="+this.BaseConfig.userInfo.identity_id+
"&bureau_id="+this.BaseConfig.person_info_my.bureau_id;
axios.post(url,formDatas).then((res)=>{
this.loading = false;
let resData = res.data;
if(resData.code === 200){
Modal.success({
title: "导入成功",
content: "",
centered: true
});
this.getPhysicalList();
}else {
let errtips = resData.msg;
Modal.error({
title: "导入失败",
content: errtips,
centered: true
});
}
})
},
//
cancelImport:function () {

@ -54,11 +54,6 @@
TimePicker
} from 'ant-design-vue';
import InterConfig from '../interConfig';
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
import moment from 'moment';
import ATextarea from "ant-design-vue/es/input/TextArea";
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import SelectStudent from '../../../../../../components/common/selectPeople/SelectStudent';
export default{
props: {
monitorId: {
@ -69,7 +64,6 @@
data(){
return {
pageLoading: false,
locale,
stageName: "",
gradeName: "",
className: "",

@ -17,7 +17,9 @@
@click="search"/>
</div>
<div>
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
<a-button type="default" @click="toDownload" class="add-button-style">下载模板</a-button>
<a-button type="primary" @click="toImport" class="add-button-style" style="margin-right: 0.2rem">导入</a-button>
<a-button type="primary" @click="toAdd" class="add-button-style" style="margin-right: 0.2rem">新增</a-button>
<a-button type="danger" @click="toClear" class="add-button-style" style="margin-right: 0.5rem">清空</a-button>
</div>
</div>
@ -40,6 +42,7 @@
@cancel="handleCancel">
{{isClear?'是否确定删除全部信息?':'是否确定删除此条信息?'}}
</a-modal>
<import-excel :show="showImport" @cancel="cancelImport" @submitData="startImport"/>
<template v-if="pageType === 1">
<VisionInfo @cancel="cancel" :monitorId="monitorId"/>
</template>
@ -49,6 +52,8 @@
import InterConfig from '../interConfig';
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input, Pagination} from 'ant-design-vue';
import VisionInfo from './visionInfo.vue';
import ImportExcel from '../../../../../../components/common/importExcel/importExcel.vue';
import axios from 'axios';
const tableColumn = [
{
dataIndex: 'index',
@ -120,6 +125,7 @@
totalPage: 0,
totalNum: 0,
isClear:false,//false true
showImport:false,//
}
},
created(){
@ -188,6 +194,50 @@
this.isClear = true;
this.visible = true;
},
//
toDownload:function () {
//window.location.href = window.location.protocol + "//" + window.location.host + "/dsideal_yy/pro_integration/reactProject/screenAdaptation/template/centerStudentPhysicalTemplate.xls";
//BaseConfig._action_path
window.location.href = window.location.protocol + "//" + "10.10.14.199"+ "/dsideal_yy/pro_integration/reactProject/screenAdaptation/template/centerStudentVisionTemplate.xls"
},
//
toImport:function () {
this.showImport = true;
},
//
startImport:function (file) {
var formDatas = new FormData();
formDatas.append("file", file);
this.showImport = false;
this.loading = true;
let url = this.BaseConfig._action_path+"/dsideal_yy/ypt/intellioa/java/center/importVisionData?" +
"person_id="+this.BaseConfig.userInfo.person_id+
"&identity_id="+this.BaseConfig.userInfo.identity_id+
"&bureau_id="+this.BaseConfig.person_info_my.bureau_id;
axios.post(url,formDatas).then((res)=>{
this.loading = false;
let resData = res.data;
if(resData.code === 200){
Modal.success({
title: "导入成功",
content: "",
centered: true
});
this.getVisionList();
}else {
let errtips = resData.msg;
Modal.error({
title: "导入失败",
content: errtips,
centered: true
});
}
})
},
//
cancelImport:function () {
this.showImport = false;
},
//
handleOk: function () {
let param = {
@ -238,7 +288,8 @@
AIcon: Icon,
AInput: Input,
APagination: Pagination,
VisionInfo
VisionInfo,
ImportExcel
}
}
</script>

Loading…
Cancel
Save