|
@@ -0,0 +1,477 @@
|
|
|
+<template>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud :option="option"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="data"
|
|
|
+ :page.sync="page"
|
|
|
+ :search.sync="query"
|
|
|
+ :permission="permissionList"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ v-model="form"
|
|
|
+ ref="crud"
|
|
|
+ id="out-table"
|
|
|
+ :header-cell-class-name="headerClassName"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="searchReset"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 330)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 330)"
|
|
|
+ @on-load="onLoad">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="danger"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ plain
|
|
|
+ v-if="permission.fingenlegcalc_delete"
|
|
|
+ @click="handleDelete">删 除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{disabled,size}" slot="isForeignSearch">
|
|
|
+ <el-checkbox v-model="query.isForeign" :true-label="1" :false-label="0" ></el-checkbox>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{disabled,size}" slot="isQuantitySearch">
|
|
|
+ <el-checkbox v-model="query.isQuantity" :true-label="1" :false-label="0" ></el-checkbox>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {fingenlegcalcList, fingenlegcalcDetail, fingenlegcalcSubmit, fingenlegcalcRemove} from "@/api/iosBasicData/fingenlegcalc";
|
|
|
+ import {mapGetters} from "vuex";
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ query: {},
|
|
|
+ loading: true,
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ selectionList: [],
|
|
|
+ option:{},
|
|
|
+ optionBack: {
|
|
|
+ height:'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ viewBtn: true,
|
|
|
+ selection: true,
|
|
|
+ dialogClickModal: false,
|
|
|
+ menu:false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "年",
|
|
|
+ prop: "accyear",
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "月",
|
|
|
+ prop: "accmonth",
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "科目代码",
|
|
|
+ prop: "accCode",
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "科目全称",
|
|
|
+ prop: "fullName",
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "方向",
|
|
|
+ prop: "dc",
|
|
|
+ type: 'select',
|
|
|
+ dicData:[
|
|
|
+ {
|
|
|
+ label:'借方',
|
|
|
+ value:'D'
|
|
|
+ },{
|
|
|
+ label:'贷方',
|
|
|
+ value:'C'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "摘要",
|
|
|
+ prop: "descr",
|
|
|
+ overHidden:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "币种",
|
|
|
+ prop: "curCode",
|
|
|
+ hide:true,
|
|
|
+ search:true,
|
|
|
+ dicData:[
|
|
|
+ {
|
|
|
+ label:'CNY',
|
|
|
+ value:'CNY'
|
|
|
+ },{
|
|
|
+ label:'USD',
|
|
|
+ value:'USD'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否外币",
|
|
|
+ prop: "isForeign",
|
|
|
+ hide:true,
|
|
|
+ search:true,
|
|
|
+ searchslot:true,
|
|
|
+ searchSpan:3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否数量",
|
|
|
+ prop: "isQuantity",
|
|
|
+ hide:true,
|
|
|
+ search:true,
|
|
|
+ searchslot:true,
|
|
|
+ searchSpan:3,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "预算金额(原币)",
|
|
|
+ prop: "amountBudget",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "预算金额(CNY)",
|
|
|
+ prop: "amountBudgetLoc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算客户中文名称",
|
|
|
+ prop: "corpCnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算客户英文名称",
|
|
|
+ prop: "corpEnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算部门",
|
|
|
+ prop: "deptName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算职员",
|
|
|
+ prop: "emplName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算项目类别",
|
|
|
+ prop: "itemClassify",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "核算项目",
|
|
|
+ prop: "itemName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初本币借方金额(CNY)",
|
|
|
+ prop: "amountOpenDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初本币贷方金额(CNY)",
|
|
|
+ prop: "amountOpenCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初本币余额(CNY)",
|
|
|
+ prop: "amountOpenBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "上期本币余额(CNY)",
|
|
|
+ prop: "amountLastBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期本币借方金额(CNY)",
|
|
|
+ prop: "amountDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期本币贷方金额(CNY)",
|
|
|
+ prop: "amountCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年本币借方金额(CNY)",
|
|
|
+ prop: "amountYearDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年本币贷方金额(CNY)",
|
|
|
+ prop: "amountYearCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期本币余额(CNY)",
|
|
|
+ prop: "amountBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初外币借方金额",
|
|
|
+ prop: "amountOpenDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初外币贷方金额",
|
|
|
+ prop: "amountOpenCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初外币期初余额",
|
|
|
+ prop: "amountOpenUsdBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "上期外币余额(USD)",
|
|
|
+ prop: "amountLastBlcUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期外币借方金额",
|
|
|
+ prop: "amountDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期外币贷方金额",
|
|
|
+ prop: "amountCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年外币借方金额(USD)",
|
|
|
+ prop: "amountYearDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年外币贷方金额(USD)",
|
|
|
+ prop: "amountYearCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期外币期初余额",
|
|
|
+ prop: "amountUsdBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初数量借方金额",
|
|
|
+ prop: "quantityOpenDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初数量贷方金额",
|
|
|
+ prop: "quantityOpenCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "期初数量期初余额",
|
|
|
+ prop: "quantityOpenBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "上期数量余额",
|
|
|
+ prop: "quantityLastBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期数量借方金额",
|
|
|
+ prop: "quantityDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期数量贷方金额",
|
|
|
+ prop: "quantityCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年数量借方金额",
|
|
|
+ prop: "quantityYearDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本年数量贷方金额",
|
|
|
+ prop: "quantityYearCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本期数量期初余额",
|
|
|
+ prop: "quantityBlc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ data: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["permission"]),
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ addBtn: this.vaildData(this.permission.fingenlegcalc_add, false),
|
|
|
+ viewBtn: this.vaildData(this.permission.fingenlegcalc_view, false),
|
|
|
+ delBtn: this.vaildData(this.permission.fingenlegcalc_delete, false),
|
|
|
+ editBtn: this.vaildData(this.permission.fingenlegcalc_edit, false)
|
|
|
+ };
|
|
|
+ },
|
|
|
+ ids() {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(330), this.optionBack);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ rowSave(row, done, loading) {
|
|
|
+ fingenlegcalcSubmit(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ window.console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowUpdate(row, index, done, loading) {
|
|
|
+ fingenlegcalcSubmit(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return fingenlegcalcRemove(row.id);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleDelete() {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return fingenlegcalcRemove(this.ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (["edit", "view"].includes(type)) {
|
|
|
+ fingenlegcalcDetail(this.form.id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.query = {};
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.query = params;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ currentChange(currentPage){
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ sizeChange(pageSize){
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ fingenlegcalcList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.data = data.records;
|
|
|
+ this.loading = false;
|
|
|
+ this.selectionClear();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 更改表格颜色
|
|
|
+ headerClassName(tab){
|
|
|
+ //颜色间隔
|
|
|
+ let back = ""
|
|
|
+ if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
|
+ if (tab.columnIndex % 2 === 0) {
|
|
|
+ back = "back-one"
|
|
|
+ } else if (tab.columnIndex % 2 === 1) {
|
|
|
+ back = "back-two"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return back;
|
|
|
+ },
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+::v-deep#out-table .back-one {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+::v-deep#out-table .back-two {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|