|
@@ -0,0 +1,444 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="客户项目" prop="fCorpid">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.fCorpid"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ placeholder="请选择货权方"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(dict, index) in fMblnoOptions"
|
|
|
+ :key="index.fId"
|
|
|
+ :label="dict.fName"
|
|
|
+ :value="dict.fId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="物资类别" prop="fMblno">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.fMblno"
|
|
|
+ placeholder="请输入提单号"
|
|
|
+ clearable
|
|
|
+ style="width: 200px"
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="年" prop="fToCorpid">
|
|
|
+ <el-date-picker
|
|
|
+ @change="choseYear"
|
|
|
+ v-model="queryParams.fToCorpid"
|
|
|
+ type="year"
|
|
|
+ format="yyyy"
|
|
|
+ value-format="yyyy"
|
|
|
+ placeholder="选择年">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="开始月" prop="fProductName">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.fProductName"
|
|
|
+ type="month"
|
|
|
+ format="MM"
|
|
|
+ value-format="MM"
|
|
|
+ placeholder="选择月">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束月" prop="fMarks">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.fProductName"
|
|
|
+ type="month"
|
|
|
+ format="MM"
|
|
|
+ value-format="MM"
|
|
|
+ placeholder="选择月">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <div class="tabSetting">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['warehouseBusiness:profit:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <div style="margin: 0 12px">
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ size="mini"
|
|
|
+ circle
|
|
|
+ @click="showSetting = !showSetting"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
|
|
|
+ <div>配置排序列数据(拖动调整顺序)</div>
|
|
|
+ <div style="margin-left: 17px">
|
|
|
+ <el-checkbox
|
|
|
+ v-model="allCheck"
|
|
|
+ label="全选"
|
|
|
+ @change="allChecked"
|
|
|
+ ></el-checkbox>
|
|
|
+ </div>
|
|
|
+ <div style="padding: 4px; display: flex; justify-content: center">
|
|
|
+ <draggable
|
|
|
+ v-model="setRowList"
|
|
|
+ group="site"
|
|
|
+ animation="300"
|
|
|
+ @start="onStart"
|
|
|
+ @end="onEnd"
|
|
|
+ handle=".indraggable"
|
|
|
+ >
|
|
|
+ <transition-group>
|
|
|
+ <div
|
|
|
+ v-for="item in setRowList"
|
|
|
+ :key="item.surface"
|
|
|
+ class="listStyle"
|
|
|
+ >
|
|
|
+ <div style="width: 500px" class="indraggable">
|
|
|
+ <div class="progress" :style="{ width: item.width + 'px' }">
|
|
|
+ <el-checkbox
|
|
|
+ :label="item.name"
|
|
|
+ v-model="item.checked"
|
|
|
+ :true-label="0"
|
|
|
+ :false-label="1"
|
|
|
+ >{{ item.name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-input-number
|
|
|
+ v-model.number="item.width"
|
|
|
+ controls-position="right"
|
|
|
+ :min="1"
|
|
|
+ :max="500"
|
|
|
+ size="mini"
|
|
|
+ ></el-input-number>
|
|
|
+ </div>
|
|
|
+ </transition-group>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="showSetting = false">取 消</el-button>
|
|
|
+ <el-button @click="delRow" type="danger">重 置</el-button>
|
|
|
+ <el-button type="primary" @click="save()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-table v-loading="loading" :data="receivableList" show-summary :summary-method="getSum">
|
|
|
+ <!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
+ <el-table-column type="index" label="行号" align="center" width="100"/>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in getRowList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :width="item.width"
|
|
|
+ :prop="item.label"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ sortable
|
|
|
+ :fixed="item.fixed"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ :page-sizes="[50,100, 200, 500, 1000]"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ listpayable,
|
|
|
+ listWhgenleg,
|
|
|
+ getWhgenleg,
|
|
|
+ delWhgenleg,
|
|
|
+ addWhgenleg,
|
|
|
+ updateWhgenleg,
|
|
|
+ exportWhgenleg
|
|
|
+} from '@/api/reportManagement/profit'
|
|
|
+import { listWarehouse } from '@/api/basicdata/warehouse'
|
|
|
+import { listArea } from '@/api/basicdata/area'
|
|
|
+import { listGoods } from '@/api/basicdata/goods'
|
|
|
+import { listCorps } from '@/api/basicdata/corps'
|
|
|
+import { listFees } from '@/api/basicdata/fees'
|
|
|
+import { addSet, select, resetModule } from "@/api/system/set";
|
|
|
+import Cookies from "js-cookie";
|
|
|
+import draggable from "vuedraggable";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'generalLedgerDr',
|
|
|
+ components: {draggable},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ //费用名称
|
|
|
+ fWbuOptions:[],
|
|
|
+ businessInTypeOption:[],
|
|
|
+ businessOutTypeOption:[],
|
|
|
+ businessTransTypeOption:[],
|
|
|
+ businessTypeOption: [],
|
|
|
+ // 货权方(客户数据)
|
|
|
+ fMblnoOptions: [],
|
|
|
+ // 贸易方式(数据字典),对应t_trademodels 字典
|
|
|
+ fTrademodeidOptions: [],
|
|
|
+ // 货物
|
|
|
+ goodsOptions: [],
|
|
|
+ // 仓库(仓库数据)
|
|
|
+ warehouseOptions: [],
|
|
|
+ kqhouseOptions: [],
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 库存总账表格数据
|
|
|
+ receivableList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: '',
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 50,
|
|
|
+ fCorpid: null,
|
|
|
+ fMblno: null,
|
|
|
+ timeExamine: null,
|
|
|
+ fToCorpid: null,
|
|
|
+ fProductName: null,
|
|
|
+ fMarks: null,
|
|
|
+ fReconciliation: null,
|
|
|
+ fBillstatus: null,
|
|
|
+ fBusinessType:null,
|
|
|
+ fFeeid:null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ showSetting: false,
|
|
|
+ drag: false,
|
|
|
+ setRowList: [],
|
|
|
+ getRowList: [],
|
|
|
+ tableDate: [
|
|
|
+ {
|
|
|
+ surface: "1",
|
|
|
+ label: "fName",
|
|
|
+ name: "客户名称",
|
|
|
+ checked: 0,
|
|
|
+ width: 300,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "2",
|
|
|
+ label: "fFeesName",
|
|
|
+ name: "收入",
|
|
|
+ checked: 0,
|
|
|
+ width: 300,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "3",
|
|
|
+ label: "fMblno",
|
|
|
+ name: "支出",
|
|
|
+ checked: 0,
|
|
|
+ width: 300,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "4",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "利润",
|
|
|
+ checked: 0,
|
|
|
+ width: 300,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ allCheck: false,
|
|
|
+ data:null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ // this.data = new Date().getUTCFullYear()
|
|
|
+ console.log(this.data)
|
|
|
+ this.queryParams.fToCorpid = JSON.stringify(new Date().getUTCFullYear())
|
|
|
+ console.log(this.queryParams)
|
|
|
+ this.setRowList = this.tableDate;
|
|
|
+ this.getRowList = this.tableDate;
|
|
|
+ this.getList()
|
|
|
+ this.getRow();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ choseYear(){
|
|
|
+ console.log(this.queryParams.fToCorpid)
|
|
|
+ },
|
|
|
+ //列设置全选
|
|
|
+ allChecked() {
|
|
|
+ if (this.allCheck == true) {
|
|
|
+ this.setRowList.map((e) => {
|
|
|
+ return (e.checked = 0);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.setRowList.map((e) => {
|
|
|
+ return (e.checked = 1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询列数据
|
|
|
+ getRow() {
|
|
|
+ let that = this;
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ };
|
|
|
+ select(this.data).then((res) => {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ this.getRowList = res.data.filter((e) => e.checked == 0);
|
|
|
+ this.setRowList = res.data;
|
|
|
+ this.setRowList = this.setRowList.reduce((res, item) => {
|
|
|
+ res.push({
|
|
|
+ surface: item.surface,
|
|
|
+ label: item.label,
|
|
|
+ name: item.name,
|
|
|
+ checked: item.checked,
|
|
|
+ width: item.width,
|
|
|
+ fixed: item.fixed,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ }, []);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ delRow() {
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ };
|
|
|
+ resetModule(this.data).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.setRowList = this.tableDate;
|
|
|
+ this.getRowList = this.tableDate;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //保存列设置
|
|
|
+ save() {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ sysTableSetList: this.setRowList,
|
|
|
+ };
|
|
|
+ addSet(this.data).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.getRowList = this.setRowList.filter((e) => e.checked == 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //开始拖拽事件
|
|
|
+ onStart() {
|
|
|
+ this.drag = true;
|
|
|
+ },
|
|
|
+ //拖拽结束事件
|
|
|
+ onEnd() {
|
|
|
+ this.drag = false;
|
|
|
+ },
|
|
|
+ getSum(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '总计'
|
|
|
+ } else if (index === 7 || index === 8 || index === 9) {
|
|
|
+ const values = data.map(item => Number(item[column.property]))
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr
|
|
|
+ } else {
|
|
|
+ return prev
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return sums
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 查询库存总账列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true
|
|
|
+ this.getDicts('approval_process').then((response) => {
|
|
|
+ this.options = response.data
|
|
|
+ })
|
|
|
+ listpayable(this.queryParams).then(response => {
|
|
|
+ this.receivableList = response.rows
|
|
|
+ this.total = response.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams
|
|
|
+ this.$confirm('是否确认导出所有利润总账数据项?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(function() {
|
|
|
+ return exportWhgenleg(queryParams)
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.tabSetting {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+.listStyle {
|
|
|
+ display: flex;
|
|
|
+ border-top: 1px solid #dcdfe6;
|
|
|
+ border-left: 1px solid #dcdfe6;
|
|
|
+ border-right: 1px solid #dcdfe6;
|
|
|
+}
|
|
|
+.listStyle:last-child {
|
|
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
+}
|
|
|
+.progress {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 2px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.05);
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+</style>
|