v-for="(item,index) in oneEcoItemOption" :label="item.name" :value="item.code" :key="index" >
v-for="(item,index) in twoEcoItemOption" :label="item.name" :value="item.code" :key="index" >
v-for="(item,index) in threeEcoItemOption" :label="item.name" :value="item.code" :key="index" >
查询结果
新增
修改
生效
失效
导出
{{scope.row.statusMean}}
{{scope.row.statusMean}}
共{{ (dataTotal / search.pageSize) === 0 ? 0 : Math.ceil(dataTotal / search.pageSize) }}页/{{dataTotal}}条数据
:current-page="search.pageNum" layout="sizes, prev, pager, next, jumper" :total="dataTotal">
@import "../../css/common.css";
.color {
color: #FF7000;
}
#data_picker .el-date-editor.el-input{
width: calc(100% - 110px)!important;
}
import AddEditEcono from "./addEditEcono.vue"
import { tipMsg, justOne, downLoadFile } from '../../js/common.js'
export default {
components: {
AddEditEcono,
},
data() {
return {
loadUrl: '',
btnListData:"",
search: {
oneEcoItem: '',
twoEcoItem: '',
threeEcoItem: '',
tag: '',//标签
statusMean: '',
pageNum: 1,
pageSize: 10
},
num: '',
idList: [], //选择的id集合容器
tagList: [], //选择的tag集合容器
oneEcoItemOption: [], //一级经济事项集合
twoEcoItemOption: [], //二级经济事项集合
threeEcoItemOption: [], //三级级经济事项集合
forItem: [],
tableData: [],
dataTotal: 0,
dialogAddEdit: false, //新增编辑页面
tableTitle: '',
sendAEData: {}, //发送给新增和编辑对话框的参数。
}
},
created() {
this.loadUrl = `${this.$root.loadUrl}`;
this.getEconoOption()
},
mounted() {
},
methods: {
getEconoOption() {
let url = `${this.$root.loadUrl}/economicEventsApply/queryConditon`;
let params = {
levelNo:1,
};
this.$Http.post(url, params).then(rsp => {
if (rsp.body.code == "000000") {
this.oneEcoItemOption = rsp.body.data;
}
});
},
getTwoEconoOption() {
this.search.twoEcoItem = ""
this.search.threeEcoItem = ""
let url = `${this.$root.loadUrl}/economicEventsApply/queryConditon`;
let params = {
pCode:this.search.oneEcoItem,
levelNo:2,
};
this.$Http.post(url, params).then(rsp => {
if (rsp.body.code == "000000") {
this.twoEcoItemOption = rsp.body.data;
}
});
},
getThreeEconoOption() {
this.search.threeEcoItem = ""
let url = `${this.$root.loadUrl}/economicEventsApply/queryConditon`;
let params = {
pCode:this.search.twoEcoItem,
levelNo:3,
};
this.$Http.post(url, params).then(rsp => {
if (rsp.body.code == "000000") {
this.threeEcoItemOption = rsp.body.data;
}
});
},
//查询
searchData() {
let params = {
economic1Code:this.search.oneEcoItem,
economic2Code:this.search.twoEcoItem,
economic3Code:this.search.threeEcoItem,
tag:this.search.tag,
statusMean:this.search.statusMean,
pageNum:this.search.pageNum,
pageSize:this.search.pageSize,
}
this.$Http.post(this.loadUrl + '/economicEventsApply/list', params)
.then((res) => {
var result = res.body;
if (result.code == '000000') {
this.tableData = result.data.list;
this.dataTotal = result.data.total;
} else {
tipMsg(result.message, "error");
return;
}
})
},
//重置
clearAll() {
this.search = {
oneEcoItem: "",
twoEcoItem: "",
threeEcoItem: "",
tag: '',//标签
statusMean: '',
pageNum :1,
pageSize :10,
}
this.twoEcoItemOption = [];
this.threeEcoItemOption = [];
this.tableData = [];
this.dataTotal = 0;
},
//新增
addApply() {
this.dialogAddEdit = true;
this.sendAEData.edit = false;
},
//编辑
editApply() {
if (this.idList.length == 0) {
tipMsg('请选择一条数据', "warning");
return;
}
if (this.idList.length !=1) {
tipMsg('只能编辑一条数据', "warning");
return;
}
if (this.forItem[0].statusMean!="生效") {
tipMsg('只能对生效数据进行编辑。', "warning");
return;
}
let params = {
"id":this.idList[0],
"tag":this.forItem[0].tag
}
this.$Http.post(this.loadUrl + '/economicEventsApply/updateDetail', params)
.then((res) => {
var result = res.body;
if (result.code == '000000') {
this.sendAEData = result.data;
this.dialogAddEdit = true;
this.sendAEData.edit = true;
} else {
tipMsg(result.message, "error");
return;
}
})
},
//
//失效校验
disablecheckMust(){
for(var i=0; i if(this.forItem[i].statusMean != "生效"){ tipMsg('勾选不对,只能对生效的数据进行失效操作!', "warning"); return false } } return true; }, //生效校验 enablecheckMust(){ for(var i=0; i if(this.forItem[i].statusMean != "失效"){ tipMsg('勾选不对,只能对失效的数据进行生效操作!', "warning"); return false } } return true; }, //生效 enable() { if (this.enablecheckMust()) { this.$Http.post(this.loadUrl + '/economicEventsApply/toStart', this.idList) .then((res) => { var result = res.body; if (result.code == '000000') { tipMsg('生效成功', "success"); this.idList = []; this.forItem = []; this.searchData(); } else { tipMsg(result.message, "error"); return; } }) } }, //失效 disable() { if (this.disablecheckMust()) { this.$Http.post(this.loadUrl + '/economicEventsApply/toStop', this.idList) .then((res) => { var result = res.body; if (result.code == '000000') { tipMsg('失效成功', "success"); this.idList = []; this.forItem = []; this.searchData(); } else { tipMsg(result.message, "error"); return; } }) } }, tabSelectItem(item) { let aList = []; this.forItem = item; //传入数据中心,以备后用。 item.forEach((it) => { aList.push(it.id); }) setTimeout(this.idListckeck(aList), 100) }, //去重 idListckeck(arr) { this.idList = []; for (var i = 0; i < arr.length; i++) { if (this.idList.indexOf(arr[i]) == -1) { this.idList.push(arr[i]); } } return this.idList; }, //导出 getOut() { }, //每页大小 handleSizeChange(val) { this.search.pageSize = val; this.searchData() }, //页数选择 handlepageNumChange(val) { this.search.pageNum = val; this.searchData() }, //关闭新增编辑弹窗 closeAddEditdialog() { this.forItem = []; this.idList = []; this.searchData() this.dialogAddEdit = false; }, //保存成功后 重新搜索 saveAddEdit() { this.forItem = []; this.idList = []; this.searchData() }, } }