Commit 85dfb431 by 罗承锋

Merge remote-tracking branch 'origin/master'

parents a5753517 44a61137
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop/';
//报表
let reportList = (params) => postAction(prefix + "networkPlace/list",params);
let reportDownload = (params) => downFilePost(prefix + "networkPlace/reportDownload",params);
let excelMBOut = (params) => downFilePost(prefix + "networkPlace/excelMBOut",params);
// 编辑
let modifyData = (params) => postAction(prefix + "networkPlace/updateData" , params);
//新增
let insertData = (params) => postAction(prefix + "networkPlace/insertData" , params);
//删除
let deleteId = (params) => postAction(prefix + "networkPlace/deleteId" , params);
export {
excelMBOut,
reportList,
reportDownload,
modifyData,
insertData,
deleteId
}
...@@ -18,7 +18,7 @@ let insert= (params) => postAction(prefix + "/school/schoolManagement/insert" , ...@@ -18,7 +18,7 @@ let insert= (params) => postAction(prefix + "/school/schoolManagement/insert" ,
let hidestatus= (params) => postAction(prefix + "/school/schoolManagement/hidestatus" , params); let hidestatus= (params) => postAction(prefix + "/school/schoolManagement/hidestatus" , params);
// 下载学校模板 // 下载学校模板
let excelMBOut = (params) => postAction(prefix + "/school/schoolManagement/excelMBOut" , params); let excelMBOut = (params) => downFilePost(prefix + "/school/schoolManagement/excelMBOut" , params);
// 下载学校列表 // 下载学校列表
let reportDownload = (params) => downFilePost(prefix + "/school/schoolManagement/excelOut",params); let reportDownload = (params) => downFilePost(prefix + "/school/schoolManagement/excelOut",params);
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="4" :sm="12" style="height:35px">
<a-form-item label="网点编码:">
<a-input placeholder="网点编码" v-model="queryParam.networkCode"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="12" style="height:35px">
<a-form-item label="网点名:">
<a-input placeholder="网点名" v-model="queryParam.networkName"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="12" style="height:35px">
<a-form-item label="学校:">
<a-input placeholder="学校" v-model="queryParam.schoolName"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="12" style="height:35px">
<a-form-item label="县份:">
<a-input placeholder="县份" v-model="queryParam.areaName"></a-input>
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="4" :sm="24">
<a-button @click="search()" type="primary">查询</a-button>
<a-divider type="vertical"/>
<a-button @click="add()" type="primary">添加</a-button>
<a-divider type="vertical"/>
<a-button @click="imp">批量导入</a-button>
<a-divider type="vertical"/>
<a-button v-show="!callback" @click="handleSubmit">导出</a-button>
<a-button v-show="callback" style="margin-left: 10px">
导出中
<a-spin style="margin-left: 5px" size="small"/>
</a-button>
</a-col>
</span>
</a-row>
</a-form>
<a-modal
title="批量导入"
:visible="impXXModal"
@ok="impOk"
@cancel="impCancel"
html-type="submit"
width="400px"
>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p style="text-align:center">{{ importTile }}</p>
</a-col>
</a-row>
<import-btn :url="importUrl" :responseFun="doPush">
<a-tooltip placement="topLeft" title="导入文件" arrowPointAtCenter>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p>
选择文件:
<a-button type="primary">选择文件</a-button>
</p>
</a-col>
</a-row>
</a-tooltip>
</import-btn>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p v-show="yrymXXmoBan">
模板下载:
<a-button type="primary" @click="downloadXXMoBan">学校导出模板</a-button>
</p>
</a-col>
</a-row>
<a-row :gutter="24" :v-show="yrymXXmoBan">
<a-col :md="24" :sm="12">
<p>说明:</p>
<p>1.批量导入请严格按照模版进行导入;</p>
</a-col>
</a-row>
</a-modal>
</div>
<!--编辑----弹框-->
<a-modal :title="titleName" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="840px">
<a-form :form="Formtable">
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="网点编码">
<a-input placeholder="网点编码" v-decorator="[ 'networkCode', {rules: [{ required: true, message: '网点编码不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="网点名">
<a-input placeholder="网点名" v-decorator="[ 'networkName', {rules: [{ required: true, message: '网点名不能为空!' ,whitespace:true}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="县份">
<a-select placeholder="请选择" v-decorator="[ 'areaName', {rules: [{ required: true, message: '县分不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in subNameList" :key="data" :value="data">
{{ data}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="学校">
<a-select placeholder="请选择" v-decorator="[ 'schoolName', {rules: [{ required: true, message: '学校不能为空!' ,whitespace:true}]} ]">
<a-select-option key="">请选择</a-select-option>
<a-select-option v-for="data in schoolNameList" :key="data" :value="data">
{{ data}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="前置开始时间">
<a-date-picker placeholder="前置开始时间" v-decorator="[ 'springStartTime']" style="width:300px" format="YYYY-MM-DD"/>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="开学时间">
<a-date-picker placeholder="前置开始时间" v-decorator="[ 'springEndTime']" style="width:300px" format="YYYY-MM-DD"/>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="充值大于50奖励">
<a-input placeholder="充值大于50奖励" v-decorator="[ 'greaterFifty']"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 6}" :wrapperCol="{span: 8, offset: 1}" label="充值大于100奖励">
<a-input placeholder="充值大于100奖励" v-decorator="[ 'greaterHundred' ]"></a-input>
</a-form-item>
</a-form>
</a-modal>
<!--列表-->
<s-table
:columns="columns"
:data="rowdata"
bordered
ref="table"
size="small"
class="flex-filling"
:locale="emptyText"
>
<template slot="operation" slot-scope="text,record">
<a @click="modifyfunction(record)" v-if="isEdit">编辑</a>
<a-divider type="vertical" v-if="isDelete"/>
<a-popconfirm title="是否要删除此行?" @confirm="deleteId(record.id)" v-if="isDelete">
<a>删除</a>
</a-popconfirm>
</template>
</s-table>
</div>
</template>
<script>
import STable from "@/components/table";
import {excelMBOut,reportList, reportDownload,insertData, modifyData,deleteId} from "../../../api/school-center/networkPlace/networkPlaceAPI";
import {cloneObject, exportFile} from "@/utils/util";
import moment from "moment";
import {TreeSelect} from "ant-design-vue";
export default {
name: "NetworkPlace",
components: {
STable,
TreeSelect,
},
data() {
return {
isEdit:true,
isDelete:true,
yrymXXmoBan: false,
impXXModal:false,
importUrl: "",
importTile: "",
emptyText: {emptyText: '暂无数据'},
callback: false,
// form
Formtable: this.$form.createForm(this, {name: 'Formtable'}),
titleName:"",
queryParam: {
networkCode: "",
networkName: "",
areaName:"",
schoolName:"",
},
modifyvisible: false,
modifyForm: {
id:"",
networkCode: "",
networkName: "",
areaName:"",
schoolName:"",
springStartTime:"",
springEndTime:"",
greaterFifty:"",
greaterHundred:""
},
subNameList: [],
schoolNameList: [],
columns: [
{title: "网点编码", dataIndex: "networkCode", width: 120},
{title: "网点名", dataIndex: "networkName", width: 250},
{title: "学校", dataIndex: "schoolName", width: 130},
{title: "县分", dataIndex: "areaName", width: 50},
{title: "前置开始时间", dataIndex: "springStartTime", width: 100,
customRender: function (text, record, index) {
//text:当前行的值,record: 当前行的数据, index:索引
if (text == null) {
return "";
}
return moment(text).format("YYYY-MM-DD");
},
},
{title: "开学时间", dataIndex: "springEndTime", width: 100,
customRender: function (text, record, index) {
//text:当前行的值,record: 当前行的数据, index:索引
if (text == null) {
return "";
}
return moment(text).format("YYYY-MM-DD");
},
},
{title: "充值大于50奖励", dataIndex: "greaterFifty", width: 100},
{title: "充值大于100奖励", dataIndex: "greaterHundred", width: 100},
{
dataIndex: "operation",
width: 100,
title: "操作",
scopedSlots: {customRender: "operation"},
fixed: "right"
}
],
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
};
let obj = cloneObject(this.queryParam);
//表示
return reportList(Object.assign(params, obj)).then(res => {
let data = {};
if (res.state !== "success") {
this.$message.error("查询失败!", 5);
this.emptyText.emptyText = '查询失败!'
data = {
data: [],
pageSize: parameter.pageSize,
pageNo: 1,
totalCount: 0
};
} else {
data = {
data: res.data.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
};
if (this.subNameList.length==0){
res.data.records[0].subNameList.forEach((key)=>{
this.subNameList.push(key.subNameList)
})
res.data.records[0].schoolNameList.forEach((key)=>{
this.schoolNameList.push(key.schoolNameList)
})
}
}
return data;
});
}
};
},
methods: {
moment,
search() {
this.$refs.table.refresh({search: true});
},
handleSubmit() {
this.callback = true;
let today = new Date();
today.setTime(today.getTime());
let s2 = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate();
exportFile(
reportDownload(this.queryParam),
"网点清单报表" + s2 + ".xlsx",
this.downloadstatu
);
},
// 执行上传
doPush(res) {
if (!res || !res.response) {
this.$message.error("上传文件出错!", 10);
return false;
}
const response = res.response;
if (response.state !== "success") {
this.$message.error(response.msg ? response.msg : "上传文件出错!", 10);
return false;
}
this.$message.success("上传成功!" + response.data, 5);
this.impXXModal = false;
},
add(){
this.titleName="添加"
this.more = 6;
this.modifyForm.id = "";
this.modifyForm.networkCode = "";
this.modifyForm.networkName = "";
this.modifyForm.schoolName = "";
this.modifyForm.areaName = "";
this.modifyForm.springStartTime = "";
this.modifyForm.springEndTime = "";
this.modifyForm.greaterFifty = "";
this.modifyForm.greaterHundred = "";
this.modifyvisible=true;
},
modifyfunction(data){
// 清空编辑选中内容
this.more = 6;
//初始化
this.titleName="编辑学校"
this.modifyForm.id=data.id
setTimeout(()=>{
this.Formtable.setFieldsValue({
networkName: data.networkName,
networkCode: data.networkCode,
schoolName:data.schoolName,
areaName:data.areaName,
springStartTime:data.springStartTime == undefined ? "" : moment(new Date(data.springStartTime)).format("YYYY-MM-DD"),
springEndTime:data.springEndTime == undefined ? "" : moment(new Date(data.springEndTime)).format("YYYY-MM-DD"),
greaterFifty: data.greaterFifty,
greaterHundred:data.greaterHundred,
})
},50);
this.modifyvisible=true;
},
deleteId(id){
let params = {};
params.id = id;
deleteId(params).then(res => {
if(res.state == 'success'){
this.$message.info("删除成功",2);
}else{
this.$message.info("删除失败",2);
}
this.search();
});
},
//提交表单
createfunctionOk(){
this.Formtable.validateFields(['networkCode','networkName','schoolName','areaName', 'springStartTime',"springEndTime","greaterFifty", 'greaterHundred'], {force: true}, (err, values)=>{
if (!err){
this.modifyForm.networkCode = values.networkCode;
this.modifyForm.networkName = values.networkName;
this.modifyForm.schoolName = values.schoolName;
this.modifyForm.areaName = values.areaName;
this.modifyForm.greaterFifty = values.greaterFifty;
this.modifyForm.greaterHundred = values.greaterHundred;
this.modifyForm.springStartTime = values.springStartTime;
this.modifyForm.springEndTime = values.springEndTime;
for (let key in this.modifyForm) {
if (this.modifyForm[key]==undefined){
this.modifyForm[key]=""
}
}
this.modifyForm.springStartTime = this.modifyForm.springStartTime == "" ? "" : moment(new Date(this.modifyForm.springStartTime)).format("YYYY-MM-DD");
this.modifyForm.springEndTime = this.modifyForm.springEndTime == "" ? "" : moment(new Date(this.modifyForm.springEndTime)).format("YYYY-MM-DD");
//插入数据
if (this.modifyForm.id==""){
insertData(this.modifyForm).then(res=>{
if (res.state=="success") {
this.$message.success(res.data ? res.data : '添加成功!', 5);
this.search();
this.modifyvisible=false
return null;
}
this.$message.error(res.data ? res.data : res.message, 5);
})
return null;
}
//修改数据
modifyData(this.modifyForm).then(res=>{
if (res.state=="success") {
this.$message.success(res.data ? res.data : '修改成功!', 5);
this.search();
this.modifyvisible=false;
return null;
}
this.$message.error(res.data ? res.data : res.message, 5);
})
}
})
},
createfunctionCancel(){
this.Formtable.setFieldsValue({
networkName: "",
networkCode: "",
areaName:"",
schoolName:"",
springStartTime:"",
springEndTime:"",
greaterFifty: "",
greaterHundred: "",
})
this.modifyForm.id=""
this.modifyvisible=false;
},
downloadstatu() {
this.callback = false;
},
downloadXXMoBan:function (){
exportFile(excelMBOut(), "网点清单模板.xlsx");
},
impOk() {
},
impCancel() {
this.impXXModal = false;
this.clearmodel();
},
imp(){
this.handleSubmit1();
},
clearmodel() {
this.importTile = "";
this.yrymXXmoBan = false;
this.importUrl = "";
},
handleSubmit1() {
this.importTile = "网点批量导入";
this.yrymXXmoBan = true;
this.importUrl = "manager/ciop/networkPlace/importDate";
this.impXXModal = true;
},
},
};
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -580,7 +580,6 @@ ...@@ -580,7 +580,6 @@
}, },
// 执行上传 // 执行上传
doPush(res) { doPush(res) {
debugger
if (!res || !res.response) { if (!res || !res.response) {
this.$message.error("上传文件出错!", 10); this.$message.error("上传文件出错!", 10);
return false; return false;
...@@ -593,9 +592,7 @@ ...@@ -593,9 +592,7 @@
this.$message.success("上传成功!" + response.data, 5); this.$message.success("上传成功!" + response.data, 5);
this.impXXModal = false; this.impXXModal = false;
}, },
downloadXXMoBan:function (){
exportFile(excelMBOut(), "学校列表模板.xlsx");
},
add(){ add(){
this.titleName="添加" this.titleName="添加"
this.isShowMore = true; this.isShowMore = true;
...@@ -906,6 +903,9 @@ ...@@ -906,6 +903,9 @@
this.downloadstatu this.downloadstatu
); );
}, },
downloadXXMoBan:function (){
exportFile(excelMBOut(), "学校列表模板.xlsx");
},
downloadstatu() { downloadstatu() {
this.callback = false; this.callback = false;
}, },
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
批量不通过 批量不通过
</a-button> </a-button>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-button @click="excelOut()" type="primary">导出所有数据</a-button> <a-button @click="excelOut()" type="primary">导出数据</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
...@@ -428,7 +428,7 @@ ...@@ -428,7 +428,7 @@
if(this.tempstate == '是'){ if(this.tempstate == '是'){
this.Formtable.auditState = 2 this.Formtable.auditState = 2
}else if(this.tempstate == '否'){ }else if(this.tempstate == '否'){
this.Formtable.auditState == 3 this.Formtable.auditState = 3
}else if(this.tempstate == '无效'){ }else if(this.tempstate == '无效'){
this.Formtable.auditState = 4 this.Formtable.auditState = 4
} }
......
...@@ -454,7 +454,6 @@ ...@@ -454,7 +454,6 @@
}, },
watch : { watch : {
treeModelValue(data) { treeModelValue(data) {
console.log(data);
} }
}, },
methods:{ methods:{
...@@ -476,7 +475,6 @@ ...@@ -476,7 +475,6 @@
grade: data.grade, grade: data.grade,
ysm: data.ysm, ysm: data.ysm,
}) })
console.log(data.schools);
if (data.schools == undefined) { if (data.schools == undefined) {
this.treeModelValue = []; this.treeModelValue = [];
}else{ }else{
...@@ -511,8 +509,6 @@ ...@@ -511,8 +509,6 @@
this.modifyForm.password = values.password this.modifyForm.password = values.password
const subNames = []; const subNames = [];
const schools = []; const schools = [];
console.log(this.treeModelValue);
console.log(this.subNames);
out : for(let i = 0; i < this.treeModelValue.length; ++i) { out : for(let i = 0; i < this.treeModelValue.length; ++i) {
for(let j = 0; j < this.subNames.length; ++j) { for(let j = 0; j < this.subNames.length; ++j) {
if (this.treeModelValue[i] == this.subNames[j].value) { if (this.treeModelValue[i] == this.subNames[j].value) {
...@@ -522,8 +518,6 @@ ...@@ -522,8 +518,6 @@
} }
schools.push(this.treeModelValue[i]); schools.push(this.treeModelValue[i]);
} }
console.log(this.modifyForm);
console.log(this.xzUserList);
if(this.modifyForm.parentId == undefined){ if(this.modifyForm.parentId == undefined){
this.modifyForm.parentId = '' this.modifyForm.parentId = ''
this.modifyForm.parentIds = '' this.modifyForm.parentIds = ''
...@@ -852,7 +846,6 @@ ...@@ -852,7 +846,6 @@
changeDongjie(event,id){ changeDongjie(event,id){
if(event){ if(event){
unlockUser({userId:id}).then(res =>{ unlockUser({userId:id}).then(res =>{
console.log(res);
if(res.state == 'success'){ if(res.state == 'success'){
notification.success({ message: '系统提示', description: '解冻成功'}) notification.success({ message: '系统提示', description: '解冻成功'})
}else{ }else{
...@@ -861,7 +854,6 @@ ...@@ -861,7 +854,6 @@
}); });
}else{ }else{
lockUser({userId:id}).then(res =>{ lockUser({userId:id}).then(res =>{
console.log(res);
if(res.state == 'success'){ if(res.state == 'success'){
notification.success({ message: '系统提示', description: '冻结成功'}) notification.success({ message: '系统提示', description: '冻结成功'})
}else{ }else{
...@@ -935,7 +927,6 @@ ...@@ -935,7 +927,6 @@
}); });
}) })
this.treeData[i].children = temp; this.treeData[i].children = temp;
console.log(this.treeData);
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment