<template>
? <div class="simple">
? ? <power v-model="btnListData"></power>
? ? <div>
? ? ? <el-row :gutter="10" class="formWrap">
? ? ? ? <div style="margin-left:25px;" class="formTitle">查詢條件</div>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel110">賬套</div>
? ? ? ? ? <el-select v-model="condition.ledgerCode" @change="changeEffectItem()">
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in ledgerList"
? ? ? ? ? ? ? :label="item.name"
? ? ? ? ? ? ? :value="item.code"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ? @click.native="getItemId(item)"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel6">公司段</div>
? ? ? ? ? <el-input
? ? ? ? ? ? v-model.trim="condition.company"
? ? ? ? ? ? @click.native="syndiCate()"
? ? ? ? ? ? icon="search"
? ? ? ? ? ? readonly
? ? ? ? ? ? class="chooseInput"
? ? ? ? ? ></el-input>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel110">成本中心類型</div>
? ? ? ? ? <el-select v-model="condition.costType"? @click.native="isOpenCostType()">
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in costTypeOption"
? ? ? ? ? ? ? :label="item.segment3Type"
? ? ? ? ? ? ? :value="item.segment3Type"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel110">狀態(tài)</div>
? ? ? ? ? <el-select placeholder="全部" v-model="condition.status">
? ? ? ? ? ? <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-row>
? ? ? <el-row :gutter="10" class="formWrap">
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel6">經(jīng)濟(jì)事項一級</div>
? ? ? ? ? <el-input
? ? ? ? ? ? v-model.trim="condition.economicItemOne"
? ? ? ? ? ? @click.native="openEconomicDialog()"
? ? ? ? ? ? icon="search"
? ? ? ? ? ? readonly
? ? ? ? ? ? class="chooseInput"
? ? ? ? ? ></el-input>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel110">經(jīng)濟(jì)事項二級</div>
? ? ? ? ? <el-select v-model="condition.economicItemTwo" @click.native="isOpenTwo()">
? ? ? ? ? ? <el-option
? ? ? ? ? ? ? v-for="(item,index) in economicTwoList"
? ? ? ? ? ? ? :label="item.name"
? ? ? ? ? ? ? :value="item.id"
? ? ? ? ? ? ? :key="index"
? ? ? ? ? ? ></el-option>
? ? ? ? ? </el-select>
? ? ? ? </el-col>
? ? ? ? <el-col class="form-item" :span="6">
? ? ? ? ? <div class="inputLabel110">核算科目編碼/名稱</div>
? ? ? ? ? ? <el-input
? ? ? ? ? ? ? v-model.trim="condition.check"
? ? ? ? ? ? ? @click.native="openSubject()"
? ? ? ? ? ? ? icon="search"
? ? ? ? ? ? ? readonly
? ? ? ? ? ? ? class="chooseInput"
? ? ? ? ? ? ></el-input>
? ? ? ? </el-col>
? ? ? </el-row>
? ? ? <div class="footerButtonGroup">
? ? ? ? <el-button @click="clearAll">重置</el-button>
? ? ? ? <el-button v-if="$hasPower(btnListData)('ECONOMI_CHECK_QUERY')" type="primary" @click="search">查詢</el-button>
? ? ? </div>
? ? ? <div class="tabWrap">
? ? ? ? <div class="tableTitle">
? ? ? ? ? <font>查詢結(jié)果</font>
? ? ? ? ? <div class="toolButton" style="min-width:360px">
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_ADD')" class="toolButtonItem" @click="addEcono">
? ? ? ? ? ? ? <img src="@/icons/icon_add.png" style="margin-bottom:-3px"> 新增
? ? ? ? ? ? </span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_EDIET')" class="toolButtonItem" @click="edit">
? ? ? ? ? ? ? <img src="@/icons/icon_edit01.png" style="margin-bottom:-3px"> 編輯
? ? ? ? ? ? </span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_START')"? class="toolButtonItem" @click="enable">
? ? ? ? ? ? ? <img src="@/icons/icon_start01.png" style="margin-bottom:-3px"> 啟用
? ? ? ? ? ? </span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_STOP')" class="toolButtonItem" @click="disable">
? ? ? ? ? ? ? <img src="@/icons/icon_stop01.png" style="margin-bottom:-3px"> 禁用
? ? ? ? ? ? </span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_IN')" class="toolButtonItem" @click="getIn">
? ? ? ? ? ? ? <img src="@/icons/icon_export.png" style="margin-bottom:-3px"> 導(dǎo)入
? ? ? ? ? ? </span>
? ? ? ? ? ? <span v-if="$hasPower(btnListData)('ECONOMI_CHECK_OUT')" class="toolButtonItem" @click="getOut">
? ? ? ? ? ? ? <img src="@/icons/icon_daochu.png" style="margin-bottom:-3px"> 導(dǎo)出
? ? ? ? ? ? </span>
? ? ? ? ? </div>
? ? ? ? </div>
? ? ? ? <el-table
? ? ? ? ? :data="tableData"
? ? ? ? ? @select="selectItem"
? ? ? ? ? @select-all="selectItemAll"
? ? ? ? ? border
? ? ? ? ? style="width:100%"
? ? ? ? >
? ? ? ? ? <el-table-column type="selection" header-align="center" min-width="45"></el-table-column>
? ? ? ? ? <el-table-column label="序號" width="65" align="center" type="index"></el-table-column>
? ? ? ? ? <el-table-column label="賬套" prop="ledgerName" align="center" show-overflow-tooltip></el-table-column>
? ? ? ? ? <el-table-column label="公司段" prop="segment1Name" align="center" show-overflow-tooltip></el-table-column>
? ? ? ? ? <el-table-column label="成本中心類型" prop="segment3Type" align="center" show-overflow-tooltip></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="經(jīng)濟(jì)事項一級"
? ? ? ? ? ? width="100"
? ? ? ? ? ? prop="economic1Name"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="經(jīng)濟(jì)事項二級"
? ? ? ? ? ? width="100"
? ? ? ? ? ? prop="economic2Name"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="是否關(guān)聯(lián)方"
? ? ? ? ? ? width="100"
? ? ? ? ? ? prop="isRelatedPartyMean"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="核算科目編碼/名稱"
? ? ? ? ? ? width="130"
? ? ? ? ? ? prop="segment5Name"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column label="狀態(tài)" align="center" width="100">
? ? ? ? ? ? <template slot-scope="scope">
? ? ? ? ? ? ? <span v-if="scope.row.status==1" class="color">{{scope.row.statusMean}}</span>
? ? ? ? ? ? ? <span v-else>{{scope.row.statusMean}}</span>
? ? ? ? ? ? </template>
? ? ? ? ? </el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="創(chuàng)建人"
? ? ? ? ? ? prop="createdBy"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="創(chuàng)建時間"
? ? ? ? ? ? prop="createdDate"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="更新人"
? ? ? ? ? ? prop="updatedBy"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? ? <el-table-column
? ? ? ? ? ? label="更新時間"
? ? ? ? ? ? prop="updatedDate"
? ? ? ? ? ? align="center"
? ? ? ? ? ? :show-overflow-tooltip="true"
? ? ? ? ? ></el-table-column>
? ? ? ? </el-table>
? ? ? </div>
? ? ? <div class="myPaginationBox">
? ? ? ? <p>
? ? ? ? ? 共{{ (mainData.total / condition.pageSize) === 0 ? 0 : Math.ceil(mainData.total / condition.pageSize) }}頁/
? ? ? ? ? <b>{{mainData.total}}</b>條數(shù)據(jù)
? ? ? ? </p>
? ? ? ? <el-pagination
? ? ? ? ? @size-change="handleSizeChange"
? ? ? ? ? @current-change="handleCurrentChange"
? ? ? ? ? :page-sizes="[10,20,50,100]"
? ? ? ? ? :page-size="mainData.pageSize"
? ? ? ? ? layout="sizes, prev, pager, next, jumper"
? ? ? ? ? :total="mainData.total"
? ? ? ? ></el-pagination>
? ? ? </div>
? ? ? <el-dialog
? ? ? ? :visible.sync="addEditDialog"
? ? ? ? title="經(jīng)濟(jì)事項與核算科目匹配"
? ? ? ? :close-on-click-modal="false"
? ? ? ? custom-class="commonDialog3"
? ? ? >
? ? ? ? <div v-if="addEditDialog">
? ? ? ? ? <AddEdit @saveAE="saveAE" @closeAE="closeAE" :editData="forItem"></AddEdit>
? ? ? ? </div>
? ? ? </el-dialog>
? ? ? <el-dialog
? ? ? ? title="導(dǎo)入excel文件管理"
? ? ? ? custom-class="dialogFile"
? ? ? ? :modal-append-to-body="false"
? ? ? ? :visible.sync="fileDialog"
? ? ? ? size
? ? ? >
? ? ? ? <div v-if="fileDialog">
? ? ? ? ? <FileDialog @closeImportFile="closeImportFile" @cancelImportFile="cancelImportFile"></FileDialog>
? ? ? ? </div>
? ? ? </el-dialog>
? ? ? <el-dialog
? ? ? ? :visible.sync="companyDialog"
? ? ? ? custom-class="commonDialog"
? ? ? ? :modal-append-to-body="false"
? ? ? ? title="公司段"
? ? ? ? :close-on-click-modal="false"
? ? ? ? :close-on-press-escape="false"
? ? ? >
? ? ? ? <div v-if="companyDialog">
? ? ? ? ? <SegmentCompany
? ? ? ? ? ? :ledgerCode="condition.ledgerCode"
? ? ? ? ? ? @saveCompanyData="saveCompanyData"
? ? ? ? ? ? @closeCompany="closeCompany"
? ? ? ? ? ></SegmentCompany>
? ? ? ? </div>
? ? ? </el-dialog>
? ? ? <el-dialog
? ? ? ? :visible.sync="subjectDialog"
? ? ? ? custom-class="commonDialog"
? ? ? ? :modal-append-to-body="false"
? ? ? ? title="核算科目編碼/名稱"
? ? ? ? :close-on-click-modal="false"
? ? ? ? :close-on-press-escape="false"
? ? ? >
? ? ? ? <div v-if="subjectDialog">
? ? ? ? ? <Subject
? ? ? ? ? ? :ledgerCode="condition.ledgerCode"
? ? ? ? ? ? @saveSubjectData="saveSubjectData"
? ? ? ? ? ? @closeSubject="closeSubject"
? ? ? ? ? ></Subject>
? ? ? ? </div>
? ? ? </el-dialog>
? ? ? <el-dialog
? ? ? ? :visible.sync="economicDialog"
? ? ? ? custom-class="commonDialog"
? ? ? ? :modal-append-to-body="false"
? ? ? ? title="經(jīng)濟(jì)事項一級"
? ? ? ? :close-on-click-modal="false"
? ? ? ? :close-on-press-escape="false"
? ? ? >
? ? ? ? <div v-if="economicDialog">
? ? ? ? ? <TableCommon @closeEconomic="closeEconomic" @saveEconomicData="saveEconomicData"></TableCommon>
? ? ? ? </div>
? ? ? </el-dialog>
? ? </div>
? </div>
</template>
<style src="../../css/common.css"></style>
<style>
</style>
<!-- <script src="./ledger.js"></script> -->
<script>
import SegmentCompany from "./segmentCompany.vue";
import Subject from "./Subject.vue";
import AddEdit from "./addEdit.vue";
import FileDialog from "./fileDialog.vue";
import TableCommon from "./commonTable.vue";
import {
? tipMsg,
? justOne,
? downLoadFile,
} from "../../js/common.js";
export default {
? components: {
? ? AddEdit, // 新增/編輯
? ? FileDialog, //導(dǎo)入彈窗
? ? TableCommon, //經(jīng)濟(jì)事項一級彈窗
? ? SegmentCompany,
? ? Subject
? },
? data() {
? ? return {
? ? ? uploadUrl: "",
? ? ? condition: {
? ? ? ? ledgerCode: "",
? ? ? ? ledgerId: "", //賬套id
? ? ? ? company: "",
? ? ? ? companyId: "",
? ? ? ? costType: "",
? ? ? ? costId: "",
? ? ? ? status: "",
? ? ? ? economicItemOne: "",
? ? ? ? economicItemOneId:'',
? ? ? ? economicItemOneCode:'',
? ? ? ? economicItemTwo: "",
? ? ? ? check: "",//核算科目
? ? ? ? checkId: "",//核算id
? ? ? ? pageNum: 1,
? ? ? ? pageSize: 10
? ? ? },
? ? ? // nodeIdListcheck: [], //公司段用
? ? ? btnListData:'',
? ? ? multipleSelection: [], // 當(dāng)前頁選中的數(shù)據(jù)
? ? ? multipleSelectionAll: [], // 所有選中的數(shù)據(jù)包含跨頁數(shù)據(jù)
? ? ? editData: "", //編輯數(shù)據(jù)
? ? ? forItem: [], //選擇的item
? ? ? idList: [], //id集合
? ? ? tableData: [],
? ? ? IdKey: "id", //設(shè)定行數(shù)據(jù)key
? ? ? ledgerList: [], //賬套list
? ? ? checkOption: [], //預(yù)算科目option
? ? ? costTypeOption: [], //成本中心類型option
? ? ? economicTwoList: [], //經(jīng)濟(jì)事項二級的列表
? ? ? companyDialog: false, //公司段彈窗
? ? ? subjectDialog: false, //科目彈窗
? ? ? economicDialog: false, //經(jīng)濟(jì)事項彈窗開關(guān)
? ? ? addEditDialog: false, //新增編輯彈窗開關(guān)
? ? ? fileDialog: false, //導(dǎo)入彈窗
? ? ? managementCaliberId: "", //管理口徑id
? ? ? mainData: {
? ? ? ? total: 0
? ? ? }
? ? };
? },
? created() {
? ? //this.URL = `${this.$root.loadUrl}/mdm-service`;? //部署環(huán)境
? ? this.uploadUrl = `${this.$root.loadUrl}`; //后臺鏈接測試環(huán)境
? ? this.getledger();
? },
? mounted() {
? ? this.search();
? },
? methods: {
? ? getledger() {
? ? ? let url = `${this.$root.loadUrl}/ledger/queryLedger`;
? ? ? this.$Http.post(url, {}).then(rsp => {
? ? ? ? if (rsp.body.code == "000000") {
? ? ? ? ? this.ledgerList = rsp.body.data;
? ? ? ? }
? ? ? });
? ? },
? ? //更新相關(guān)聯(lián)動項
? ? changeEffectItem() {
? ? ? this.condition.company = "";
? ? ? this.condition.costType = "";
? ? ? this.condition.check = "";
? ? ? let params = { ledgerCode: this.condition.ledgerCode };
? ? ? let url2 = `${this.$root.loadUrl}/economicAccountRelation/querySegment3Type`;
? ? ? this.$Http.post(url2, params).then(rsp => {
? ? ? ? if (rsp.body.code == "000000") {
? ? ? ? ? this.costTypeOption = rsp.body.data;
? ? ? ? }
? ? ? });
? ? },
? ? getItemId(item) {
? ? ? this.condition.ledgerId = item.id;
? ? },
? ? getEconomicTwoList() {
? ? ? console.log("2級");
? ? ? let url = `${
? ? ? ? this.$root.loadUrl
? ? ? }/economicAccountRelation/queryEconomicEvent`;
? ? ? let params = {
? ? ? ? pcode: this.condition.economicItemOneCode,
? ? ? ? managementCaliberId: this.managementCaliberId
? ? ? };
? ? ? this.$Http.post(url, params).then(rsp => {
? ? ? ? if (rsp.body.code == "000000") {
? ? ? ? ? this.economicTwoList = rsp.body.data.list;
? ? ? ? }
? ? ? });
? ? },
? ? //選中一條數(shù)據(jù)
? ? selectItem(val) {
? ? ? console.log(val);
? ? ? this.multipleSelection = val;
? ? ? let aList = [];
? ? ? this.forItem = val;
? ? ? val.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;
? ? },
? ? //選中多條數(shù)據(jù)
? ? selectItemAll(val) {
? ? ? this.multipleSelection = val;
? ? ? let aList = [];
? ? ? this.forItem = val;
? ? ? val.forEach(it => {
? ? ? ? aList.push(it.id);
? ? ? });
? ? ? setTimeout(this.idListckeck(aList), 100);
? ? },
? ? //打開公司段數(shù)據(jù)
? ? syndiCate() {
? ? ? if (
? ? ? ? this.condition.ledgerCode == "" ||
? ? ? ? this.condition.ledgerCode == undefined
? ? ? ) {
? ? ? ? this.$message({ type: "warning", message: "請先選擇賬套" });
? ? ? ? return;
? ? ? } else {
? ? ? ? this.companyDialog = true;
? ? ? }
? ? },
? ? //公司段保存
? ? saveCompanyData(val) {
? ? ? var arrId = "";
? ? ? var arrName = "";
? ? ? val.ids.forEach(item => {
? ? ? ? arrId += item + ",";
? ? ? });
? ? ? val.names.forEach(item => {
? ? ? ? arrName += item + ",";
? ? ? });
? ? ? // this.condition.delegationContent=arrId.slice(0,arrId.length-1);
? ? ? this.condition.companyId = arrId.slice(0, arrId.length - 1);
? ? ? this.condition.company = arrName.slice(0, arrName.length - 1);
? ? ? this.companyDialog = false;
? ? },
? ? closeCompany() {
? ? ? this.companyDialog = false;
? ? },
? ? ? ? //打開科目數(shù)據(jù)
? ? openSubject() {
? ? ? if (
? ? ? ? this.condition.ledgerCode == "" ||
? ? ? ? this.condition.ledgerCode == undefined
? ? ? ) {
? ? ? ? this.$message({ type: "warning", message: "請先選擇賬套" });
? ? ? ? return;
? ? ? } else {
? ? ? ? this.subjectDialog = true;
? ? ? }
? ? },
? ? //科目保存
? ? saveSubjectData(val) {
? ? ? var arrId = "";
? ? ? var arrName = "";
? ? ? val.ids.forEach(item => {
? ? ? ? arrId += item + ",";
? ? ? });
? ? ? val.names.forEach(item => {
? ? ? ? arrName += item + ",";
? ? ? });
? ? ? // this.condition.delegationContent=arrId.slice(0,arrId.length-1);
? ? ? this.condition.checkId = arrId.slice(0, arrId.length - 1);
? ? ? this.condition.check = arrName.slice(0, arrName.length - 1);
? ? ? this.subjectDialog = false;
? ? },
? ? closeSubject() {
? ? ? this.subjectDialog = false;
? ? },
? ? clearAll() {
? ? ? for (var prop in this.condition) {
? ? ? ? this.condition[prop] = "";
? ? ? }
? ? ? this.condition.pageNum = 1;
? ? ? this.condition.pageSize = 10;
? ? },
? ? search() {
? ? ? // 分頁查詢數(shù)據(jù)方法,在成功返回數(shù)據(jù)方法里調(diào)用setSelectRow方法,使每次分頁查詢都能勾選中
? ? ? let params = {
? ? ? ? economic1: this.condition.economicItemOneId, //經(jīng)濟(jì)事項一級id
? ? ? ? economic2: this.condition.economicItemTwo, //經(jīng)濟(jì)事項二級id
? ? ? ? ledgerId: this.condition.ledgerId, //賬套id
? ? ? ? segment1: this.condition.companyId, //公司id
? ? ? ? segment3Type: this.condition.costType, //部分3,成本中心類型
? ? ? ? segment5: this.condition.checkId, //核算科目id
? ? ? ? status: this.condition.status,
? ? ? ? pageNum: this.condition.pageNum, //第幾頁
? ? ? ? pageSize: this.condition.pageSize
? ? ? };
? ? ? this.$Http
? ? ? ? .post(this.uploadUrl + "/economicAccountRelation/listPage", params)
? ? ? ? .then(data => {
? ? ? ? ? var result = data.body;
? ? ? ? ? if (result.code == "000000") {
? ? ? ? ? ? this.tableData = result.data.list;
? ? ? ? ? ? this.mainData = result.data;
? ? ? ? ? } else {
? ? ? ? ? ? this.$message({
? ? ? ? ? ? ? showClose: true,
? ? ? ? ? ? ? message: result.message,
? ? ? ? ? ? ? type: "error",
? ? ? ? ? ? ? duration: 5000
? ? ? ? ? ? });
? ? ? ? ? }
? ? ? ? });
? ? },
? ? // //選中一條數(shù)據(jù)
? ? // handleSelectionChange(val) {
? ? //? // table組件選中事件,記得加上@selection-change="handleSelectionChange"
? ? //? this.multipleSelection = val;
? ? // },
? ? handleCurrentChange(val) {
? ? ? this.condition.pageNum = val;
? ? ? this.search();
? ? },
? ? handleSizeChange(val) {
? ? ? this.condition.pageSize = val;
? ? ? this.search();
? ? },
? ? //經(jīng)濟(jì)事項一級彈窗
? ? openEconomicDialog() {
? ? ? this.condition.economicItemTwo = "";
? ? ? this.economicDialog = true;
? ? },
? ? //經(jīng)濟(jì)事項二級
? ? isOpenTwo() {
? ? ? if (
? ? ? ? this.condition.economicItemOne == "" ||
? ? ? ? this.condition.economicItemOne == undefined
? ? ? ) {
? ? ? ? this.$message({ type: "warning", message: "請先選擇一級經(jīng)濟(jì)事項" });
? ? ? ? return;
? ? ? }
? ? },
? ? //成本中心類型提示
? ? isOpenCostType() {
? ? ? if (
? ? ? ? this.condition.ledgerCode == "" ||
? ? ? ? this.condition.ledgerCode == undefined
? ? ? ) {
? ? ? ? this.$message({ type: "warning", message: "請先選擇賬套" });
? ? ? ? return;
? ? ? }
? ? },
? ? //預(yù)算科目
? ? isOpenCheck() {
? ? ? if (
? ? ? ? this.condition.ledgerCode == "" ||
? ? ? ? this.condition.ledgerCode == undefined
? ? ? ) {
? ? ? ? this.$message({ type: "warning", message: "請先選擇賬套" });
? ? ? ? return;
? ? ? }
? ? },
? ? //關(guān)閉經(jīng)濟(jì)事項對話框
? ? closeEconomic() {
? ? ? this.economicDialog = false;
? ? },
? ? //經(jīng)濟(jì)對話框的保存
? ? saveEconomicData(val) {
? ? ? this.economicDialog = false;
? ? ? this.condition.economicItemOne = val.name; //
? ? ? this.condition.economicItemOneId = val.id; //傳入經(jīng)濟(jì)項目一級id
? ? ? this.condition.economicItemOneCode = val.code; //傳入經(jīng)濟(jì)項目一級code
? ? ? this.managementCaliberId = val.managementCaliberId; //傳入經(jīng)濟(jì)項目一級id
? ? ? this.getEconomicTwoList();
? ? },
? ? //新增
? ? addEcono() {
? ? ? this.forItem = [];
? ? ? this.addEditDialog = true;
? ? },
? ? //編輯
? ? edit() {
? ? ? if (this.forItem.length == 1) {
? ? ? ? this.addEditDialog = true;
? ? ? } else if (this.forItem.length == 0) {
? ? ? ? tipMsg("請先選擇一條數(shù)據(jù)!", "warning");
? ? ? } else {
? ? ? ? tipMsg("不能選擇多條,只能選擇一條!", "warning");
? ? ? }
? ? },
? ? //保存新增/編輯
? ? saveAE() {
? ? ? this.addEditDialog = false;
? ? ? this.search();
? ? },
? ? //關(guān)閉新增/編輯彈窗
? ? closeAE() {
? ? ? this.addEditDialog = false;
? ? },
? ? // //檢查狀態(tài)
? ? // checkStatus(staVal, act, mean) {
? ? //? for (var i = 0; i < this.forItem.length; i++) {
? ? //? ? if (this.forItem[i].status == staVal) {
? ? //? ? ? tipMsg("不能" + act + mean + "數(shù)據(jù)", "warning");
? ? //? ? ? return false;
? ? //? ? }
? ? //? }
? ? //? return true;
? ? // },
? ? //啟用
? ? enable() {
? ? ? ? let sData = {
? ? ? ? ? idList: JSON.parse(JSON.stringify(this.idList)),
? ? ? ? ? status: 1
? ? ? ? };
? ? ? ? let params = new FormData();
? ? ? ? this.$Http
? ? ? ? ? .post(
? ? ? ? ? ? this.uploadUrl + "/economicAccountRelation/updateStatusBatch",
? ? ? ? ? ? sData,
? ? ? ? ? ? {
? ? ? ? ? ? ? headers: {
? ? ? ? ? ? ? ? "Content-Type": "multipart/form-data" //hearder 很重要,Content-Type 要寫對
? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? )
? ? ? ? ? .then(data => {
? ? ? ? ? ? var result = data.body;
? ? ? ? ? ? if (result.code == "000000") {
? ? ? ? ? ? ? this.idList = [];
? ? ? ? ? ? ? this.forItem = [];
? ? ? ? ? ? ? tipMsg(result.message, "success");
? ? ? ? ? ? ? this.search();
? ? ? ? ? ? } else {
? ? ? ? ? ? ? tipMsg(result.message, "error");
? ? ? ? ? ? }
? ? ? ? ? });
? ? },
? ? //禁用
? ? disable() {
? ? ? //form-data post請求
? ? ? let sData = {
? ? ? ? idList: JSON.parse(JSON.stringify(this.idList)),
? ? ? ? status: 0
? ? ? };
? ? ? let params = new FormData();
? ? ? // params.append('appName', this.search.appName);//這里是要傳的參數(shù)
? ? ? // for( let it in sData){
? ? ? //? ? params.append(it,sData[it])
? ? ? // }
? ? ? this.$Http
? ? ? ? .post(
? ? ? ? ? this.uploadUrl + "/economicAccountRelation/updateStatusBatch",
? ? ? ? ? sData,
? ? ? ? ? {
? ? ? ? ? ? headers: {
? ? ? ? ? ? ? "Content-Type": "multipart/form-data" //hearder 很重要,Content-Type 要寫對
? ? ? ? ? ? }
? ? ? ? ? }
? ? ? ? )
? ? ? ? .then(data => {
? ? ? ? ? var result = data.body;
? ? ? ? ? if (result.code == "000000") {
? ? ? ? ? ? this.idList = [];
? ? ? ? ? ? this.forItem = [];
? ? ? ? ? ? tipMsg(result.message, "success");
? ? ? ? ? ? this.search();
? ? ? ? ? } else {
? ? ? ? ? ? tipMsg(result.message, "error");
? ? ? ? ? }
? ? ? ? });
? ? },
? ? getIn() {
? ? ? this.fileDialog = true;
? ? ? console.log(this.multipleSelectionAll, "all");
? ? },
? ? cancelImportFile() {
? ? ? this.fileDialog = false;
? ? },
? ? closeImportFile() {
? ? ? this.fileDialog = false;
? ? },
? ? getOut() {
? ? ? ? ? var option = {
? ? ? ? ? url: this.uploadUrl + '/economicAccountRelation/export',
? ? ? ? ? data: {
? ? ? ? ? ? requestData: {
? ? ? ? ? ? ? "economic1": this.condition.economicItemOneId,
? ? ? ? ? ? ? "economic2": this.condition.economicItemTwo,
? ? ? ? ? ? ? "ledgerId": this.condition.ledgerId,
? ? ? ? ? ? ? "segment1": this.condition.companyId,
? ? ? ? ? ? ? "segment3Type": this.condition.costId,
? ? ? ? ? ? ? "segment5": this.condition.checkId,
? ? ? ? ? ? ? "status": this.condition.status,
? ? ? ? ? ? ? "pageNum": this.condition.pageNum,
? ? ? ? ? ? ? "pageSize": this.condition.pageSize
? ? ? ? ? ? }
? ? ? ? ? },
? ? ? ? ? method: 'post'
? ? ? ? };
? ? ? ? downLoadFile(option);
? ? }
? }
};
</script>