<template>
? <div class="simple" >
? ? <power v-model="btnListData"></power>
? ? <div>
? ? ? <div style="margin-left:5px;" class="formTitle">查詢條件</div>
? ? ? <el-row :gutter="10" class="formWrap">
? ? ? ? <el-col class="form-item" :span="8">
? ? ? ? ? <div class="inputLabel">一級(jí)經(jīng)濟(jì)事項(xiàng)</div>
? ? ? ? ? <el-select v-model="search.oneEcoItem" @change="getTwoEconoOption()">
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in oneEcoItemOption"
? ? ? ? ? ? ? :label="item.name"
? ? ? ? ? ? ? :value="item.code"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="8">
? ? ? ? ? <div class="inputLabel">二級(jí)經(jīng)濟(jì)事項(xiàng)</div>
? ? ? ? ? <el-select v-model="search.twoEcoItem"? @change="getThreeEconoOption()" >
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in twoEcoItemOption"
? ? ? ? ? ? ? :label="item.name"
? ? ? ? ? ? ? :value="item.code"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="8">
? ? ? ? ? <div class="inputLabel">三級(jí)經(jīng)濟(jì)事項(xiàng)</div>
? ? ? ? ? <el-select v-model="search.threeEcoItem">
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in threeEcoItemOption"
? ? ? ? ? ? ? :label="item.name"
? ? ? ? ? ? ? :value="item.code"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? </el-row>
? ? ? <el-row :gutter="10" class="formWrap">
? ? ? ? <el-col class="form-item" :span="8">
? ? ? ? ? <div class="inputLabel">標(biāo)簽</div>
? ? ? ? ? <el-select placeholder="全部" v-model="search.tag">
? ? ? ? ? ? <el-option label="全部" value="" ></el-option>
? ? ? ? ? ? <el-option label="通用" value="1"></el-option>
? ? ? ? ? ? <el-option label="專用" value="0" ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="8">
? ? ? ? ? <div class="inputLabel">狀態(tài)</div>
? ? ? ? ? <el-select placeholder="全部" v-model="search.statusMean">
? ? ? ? ? ? <el-option label="全部" value="" ></el-option>
? ? ? ? ? ? <el-option label="審批中" value="審批中"></el-option>
? ? ? ? ? ? <el-option label="生效" value="生效" ></el-option>
? ? ? ? ? ? <el-option label="駁回" value="駁回" ></el-option>
? ? ? ? ? ? <el-option label="失效" value="失效" ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? </el-row>
? ? ? <div class="footerButtonGroup">
? ? ? ? <el-button @click="clearAll">重置</el-button>
? ? ? ? <el-button v-if="$hasPower(btnListData)('ECONOMI_ITEM_SEARCH')" type="primary" @click="searchData">查詢</el-button>
? ? ? </div>
? ? ? <div class="tabWrap">
? ? ? ? <div class="tableTitle">
? ? ? ? ? <font>查詢結(jié)果</font>
? ? ? ? ? <div class="fr">
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_ITEM_ADD')" class="toolButtonItem" @click.prevent="addApply"><img src="@/icons/icon_add.png" style="margin-bottom:-3px"> 新增</span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_ITEM_EDITT')" class="toolButtonItem" @click.prevent="editApply"><img src="@/icons/icon_edit01.png" style="margin-bottom:-3px"> 修改</span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_ITEM_ENABLE')" class="toolButtonItem" @click.prevent="enable"><img src="@/icons/icon_start01.png" style="margin-bottom:-3px"> 生效</span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_ITEM_DISABLE')" class="toolButtonItem" @click.prevent="disable"><img src="@/icons/icon_stop01.png" style="margin-bottom:-3px"> 失效</span>
? ? ? ? ? ? <span v-show = 'false' v-if="$hasPower(btnListData)('ECONOMI_ITEM_EXPORT')" class="toolButtonItem" @click.prevent='getOut'><img src="@/icons/icon_daochu.png" style="margin-bottom:-3px"> 導(dǎo)出</span>
? ? ? ? ? </div>
? ? ? ? </div>
? ? ? ? <el-table :data="tableData" @select='tabSelectItem' @select-all='tabSelectItem' border style="width:100%">
? ? ? ? ? <el-table-column type="selection" header-align='center' min-width="45"></el-table-column>
? ? ? ? ? <el-table-column label="序號(hào)" width="65" type="index"></el-table-column>
? ? ? ? ? <el-table-column label="一級(jí)經(jīng)濟(jì)事項(xiàng)編碼" prop="economic1Code" :show-overflow-tooltip="true" min-width='150'></el-table-column>
? ? ? ? ? <el-table-column label="一級(jí)經(jīng)濟(jì)事項(xiàng)名稱" prop="economic1Name" :show-overflow-tooltip="true" min-width='150'></el-table-column>
? ? ? ? ? <el-table-column label="二級(jí)經(jīng)濟(jì)事項(xiàng)編碼" prop="economic2Code" :showOverflowTooltip="true" min-width='150'></el-table-column>
? ? ? ? ? <el-table-column label="二級(jí)經(jīng)濟(jì)事項(xiàng)名稱" prop="economic2Name" min-width='150' showOverflowTooltip></el-table-column>
? ? ? ? ? <el-table-column label="三級(jí)經(jīng)濟(jì)事項(xiàng)編碼" prop="economic3Code" min-width='150' showOverflowTooltip></el-table-column>
? ? ? ? ? <el-table-column label="三級(jí)經(jīng)濟(jì)事項(xiàng)名稱" prop="economic3Name" width='150' showOverflowTooltip></el-table-column>
? ? ? ? ? <el-table-column label="狀態(tài)" align="center" width="100" showOverflowTooltip>
? ? ? ? ? ? <template slot-scope="scope">
? ? ? ? ? ? ? <span v-if="scope.row.statusMean=='審批中'" class="color">{{scope.row.statusMean}}</span>
? ? ? ? ? ? ? <span v-else>{{scope.row.statusMean}}</span>
? ? ? ? ? ? </template>
? ? ? ? ? </el-table-column>
? ? ? ? ? <el-table-column label="標(biāo)簽" prop="tagMean" width='100' showOverflowTooltip></el-table-column>
? ? ? ? ? <el-table-column label="管理口徑" prop="managementCaliberName" width='100' showOverflowTooltip></el-table-column>
? ? ? ? ? <el-table-column label="釋義" prop="comment" width='100' showOverflowTooltip></el-table-column>
? ? ? ? </el-table>
? ? ? </div>
? ? ? <div class="myPaginationBox">
? ? ? ? <p>共{{ (dataTotal / search.pageSize) === 0 ? 0 : Math.ceil(dataTotal / search.pageSize) }}頁/<b>{{dataTotal}}</b>條數(shù)據(jù)</p>
? ? ? ? <el-pagination @size-change="handleSizeChange" @current-change="handlepageNumChange" :page-sizes="[5, 10, 20, 30]" :page-size="search.pageSize"
? ? ? ? ? :current-page="search.pageNum" layout="sizes, prev, pager, next, jumper" :total="dataTotal">
? ? ? ? </el-pagination>
? ? ? </div>
? ? </div>
? ? <el-dialog :visible.sync="dialogAddEdit" size='full' :modal='false' :close-on-click-modal='false' :close-on-press-escape='false'>
? ? ? <div v-if="dialogAddEdit">
? ? ? ? <AddEditEcono @saveAddEdit='saveAddEdit' @closeAddEditdialog='closeAddEditdialog' :sendAEData='sendAEData'></AddEditEcono>
? ? ? </div>
? ? </el-dialog>
? </div>
</template>
<style>
? @import "../../css/common.css";
</style>
<style>
? .color {
? ? color: #FF7000;
? }
? #data_picker .el-date-editor.el-input{
? ? ? ? width: calc(100% - 110px)!important;
? ? }
</style>
<script type="text/javascript">
? 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: '',//標(biāo)簽
? ? ? ? ? statusMean: '',
? ? ? ? ? pageNum: 1,
? ? ? ? ? pageSize: 10
? ? ? ? },
? ? ? ? num: '',
? ? ? ? idList: [], //選擇的id集合容器
? ? ? ? tagList: [], //選擇的tag集合容器
? ? ? ? oneEcoItemOption: [], //一級(jí)經(jīng)濟(jì)事項(xiàng)集合
? ? ? ? twoEcoItemOption: [], //二級(jí)經(jīng)濟(jì)事項(xiàng)集合
? ? ? ? threeEcoItemOption: [], //三級(jí)級(jí)經(jīng)濟(jì)事項(xiàng)集合
? ? ? ? forItem: [],
? ? ? ? tableData: [],
? ? ? ? dataTotal: 0,
? ? ? ? dialogAddEdit: false,? //新增編輯頁面?
? ? ? ? tableTitle: '',
? ? ? ? sendAEData: {},? //發(fā)送給新增和編輯對(duì)話框的參數(shù)。
? ? ? }
? ? },
? ? 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: '',//標(biāo)簽
? ? ? ? ? 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('請(qǐng)選擇一條數(shù)據(jù)', "warning");
? ? ? ? ? return;
? ? ? ? }
? ? ? ? if (this.idList.length !=1) {
? ? ? ? ? tipMsg('只能編輯一條數(shù)據(jù)', "warning");
? ? ? ? ? return;
? ? ? ? }
? ? ? ? if (this.forItem[0].statusMean!="生效") {
? ? ? ? ? tipMsg('只能對(duì)生效數(shù)據(jù)進(jìn)行編輯。', "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;
? ? ? ? ? ? }
? ? ? ? ? })
? ? ? },
? ? ? //
? ? //失效校驗(yàn)
? ? disablecheckMust(){
? ? ? for(var i=0; i<this.forItem.length;i++){
? ? ? ? if(this.forItem[i].statusMean != "生效"){
? ? ? ? ? tipMsg('勾選不對(duì),只能對(duì)生效的數(shù)據(jù)進(jìn)行失效操作!', "warning");
? ? ? ? ? return false
? ? ? ? }
? ? ? }
? ? ? return true;
? ? },
? ? //生效校驗(yàn)
? ? enablecheckMust(){
? ? ? for(var i=0; i<this.forItem.length;i++){
? ? ? ? if(this.forItem[i].statusMean != "失效"){
? ? ? ? ? tipMsg('勾選不對(duì),只能對(duì)失效的數(shù)據(jù)進(jìn)行生效操作!', "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; //傳入數(shù)據(jù)中心,以備后用。
? ? ? ? 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;
? ? ? },
? ? ? //導(dǎo)出
? ? ? getOut() {
? ? ? },
? ? ? //每頁大小
? ? ? handleSizeChange(val) {
? ? ? ? this.search.pageSize = val;
? ? ? ? this.searchData()
? ? ? },
? ? ? //頁數(shù)選擇
? ? ? handlepageNumChange(val) {
? ? ? ? this.search.pageNum = val;
? ? ? ? this.searchData()
? ? ? },
? ? ? //關(guān)閉新增編輯彈窗
? ? ? closeAddEditdialog() {
? ? ? ? this.forItem = [];
? ? ? ? this.idList = [];
? ? ? ? this.searchData()
? ? ? ? this.dialogAddEdit = false;
? ? ? },
? ? ? //保存成功后 重新搜索
? ? ? saveAddEdit() {
? ? ? ? this.forItem = [];
? ? ? ? this.idList = [];
? ? ? ? this.searchData()
? ? ? },
? ? }
? }
</script>