123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- v-show="showSearch"
- label-width="100px"
- size="mini"
- >
- <el-row>
- <el-col :xs="12" :sm="6">
- <el-form-item label="提单号" prop="fMblno">
- <el-input
- v-model="queryParams.fMblno"
- placeholder="请输入提单号"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="客户名称" prop="fCorpid">
- <el-select
- v-model="queryParams.fCorpid"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in fMblnoOptions"
- :key="index.fId"
- :label="item.fName"
- :value="item.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="业务日期" prop="fBsdateList">
- <el-date-picker
- type="daterange"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- clearable
- unlink-panels
- style="width: 100%"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- v-model="queryParams.fBsdateList"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="审核日期" prop="fReviewDateList">
- <el-date-picker
- type="daterange"
- value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']"
- clearable
- unlink-panels
- style="width: 100%"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- v-model="queryParams.fReviewDateList"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-collapse-transition>
- <div v-show="show">
- <el-row>
- <el-col :xs="12" :sm="6">
- <el-form-item label="收/付" prop="fDc">
- <el-select
- v-model="queryParams.fDc"
- clearable
- filterable
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- label="收"
- value="D"
- ></el-option>
- <el-option
- label="付"
- value="C"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="费用状态" prop="fBillstatus">
- <el-select
- v-model="queryParams.fBillstatus"
- clearable
- filterable
- placeholder="请选择费用状态"
- style="width: 100%"
- >
- <el-option
- label="录入"
- value="1"
- ></el-option>
- <el-option
- label="暂存"
- value="2"
- ></el-option>
- <el-option
- label="审批驳回"
- value="3"
- ></el-option>
- <el-option
- label="提交审核"
- value="4"
- ></el-option>
- <el-option
- label="审核中"
- value="5"
- ></el-option>
- <el-option
- label="审核通过"
- value="6"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="费用名称">
- <el-select
- v-model="queryParams.fFeeids"
- clearable
- filterable
- multiple
- collapse-tags
- placeholder="请选择费用名称"
- style="width: 100%"
- >
- <el-option
- v-for="(dict, index) in fNameOptions"
- :key="dict.fId"
- :label="dict.fName"
- :value="dict.fId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="结算方式">
- <el-select
- v-model="queryParams.fStltypeid"
- clearable
- filterable
- placeholder="请选择结算方式"
- style="width: 100%"
- >
- <el-option
- v-for="(item, index) in fStltypeOptions"
- :key="index.dictValue"
- :label="item.dictLabel"
- :value="item.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :xs="12" :sm="6">
- <el-form-item label="结算状态">
- <el-select
- v-model="queryParams.fStalmountStatus"
- filterable
- clearable
- placeholder="请选择结算状态"
- style="width: 100%"
- @clear="queryParams.fStalmountStatus = null"
- >
- <el-option label="已结算" :value="1"/>
- <el-option label="未结算" :value="2"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="对账状态">
- <el-select
- v-model="queryParams.feesStatus"
- filterable
- clearable
- placeholder="请选择对账状态"
- style="width: 100%"
- @clear="queryParams.feesStatus = null"
- >
- <el-option label="已对账" :value="1"/>
- <el-option label="未对账" :value="2"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="12" :sm="6">
- <el-form-item label="发票状态">
- <el-select
- v-model="queryParams.fInvnosStatus"
- filterable
- clearable
- placeholder="请选择发票状态"
- style="width: 100%"
- @clear="queryParams.fInvnosStatus = null"
- >
- <el-option label="已开票" :value="1"/>
- <el-option label="未开票" :value="2"/>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="发货方">
- <el-select
- v-model="queryParams.fShipper"
- clearable
- filterable
- placeholder="请输入关键词"
- style="width: 100%"
- allow-create
- default-first-option
- >
- <el-option
- v-for="(item, index) in fMblnoOptions"
- :key="index.fId"
- :label="item.fCname"
- :value="item.fCname"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-collapse-transition>
- </el-form>
- <el-row :gutter="10" style="padding-bottom: 10px">
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- >导出</el-button>
- <el-button
- type="primary"
- icon="el-icon-download"
- size="mini"
- @click="handleSubItemExport"
- >导出分项</el-button>
- </el-col>
- <div class="tabSetting">
- <div style="margin-right: 20px">
- <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-button
- v-show="show"
- @click="show = !show"
- icon="el-icon-arrow-up"
- size="mini"
- >展开</el-button
- >
- <el-button
- v-show="!show"
- @click="show = !show"
- icon="el-icon-arrow-down"
- size="mini"
- >展开</el-button
- >
- </div>
- <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="dataList"
- style="width: 100%"
- ref="table"
- :height="tableHeight"
- stripe
- show-summary
- :summary-method="getSum"
- >
- <el-table-column
- type="index"
- width="50">
- </el-table-column>
- <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"
- >
- <template slot-scope="scope">
- <span v-if="item.label == 'fDc'">
- {{ scope.row.fDc == 'D'? '收': '付' }}
- </span>
- <span v-else-if="item.label == 'fFeeunitid'">
- {{ scope.row.fFeeunitid | fFeeUnitFormat(fFeetUnitOptions) }}
- </span>
- <span v-else-if="item.label == 'fBilltype'">
- {{ scope.row.fBilltype | billTypeFormat(billTypeList) }}
- </span>
- <span v-else-if="item.label == 'fStltypeid'">
- {{ scope.row.fStltypeid | fStltypeFormat(fStltypeOptions) }}
- </span>
- <span v-else>{{ scope.row[item.label] }}</span>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </template>
- <script>
- import Cookies from "js-cookie";
- import draggable from "vuedraggable";
- import { addSet, resetModule, select } from '@/api/system/set';
- import {listCorps} from "@/api/basicdata/corps";
- import { getList, exportList, exportSubItemList } from '@/api/finance/query'
- import {listFees} from "@/api/basicdata/fees";
- export default {
- name: "index",
- components: {
- draggable,
- },
- data() {
- return {
- // 表格高度
- tableHeight: 0,
- // 总条数
- total: 0,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fDc: "D",
- },
- showSearch: true,
- // 搜索展开/隐藏
- show: false,
- // 自定义列弹窗显示
- showSetting: false,
- //自定义列宽
- allCheck: false,
- setRowList: [],
- getRowList: [],
- drag: false,
- tableDate: [
- {
- surface: "1",
- label: "corpName",
- name: "客户名称",
- checked: 0,
- width: 140,
- },
- {
- surface: "2",
- label: "fMblno",
- name: "提单号",
- checked: 0,
- width: 180,
- }, {
- surface: "3",
- label: "fBsdate",
- name: "业务日期",
- checked: 0,
- width: 100,
- },{
- surface: "4",
- label: "fReviewDate",
- name: "审核日期",
- checked: 0,
- width: 100,
- },{
- surface: "5",
- label: "feeName",
- name: "费用名称",
- checked: 0,
- width: 100,
- },
- {
- surface: "6",
- label: "fBillstatusName",
- name: "费用状态",
- checked: 0,
- width: 100,
- },{
- surface: "6",
- label: "fDc",
- name: "收/付",
- checked: 0,
- width: 100,
- },
- {
- surface: "7",
- label: "fAmount",
- name: "金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "8",
- label: "fStlamount",
- name: "结算金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "9",
- label: "fStlamountDate",
- name: "结算日期",
- checked: 0,
- width: 100,
- },
- {
- surface: "10",
- label: "fInvamount",
- name: "开票金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "11",
- label: "fInvnos",
- name: "发票号",
- checked: 0,
- width: 100,
- },
- {
- surface: "12",
- label: "fAccamount",
- name: "对账金额",
- checked: 0,
- width: 100,
- },
- {
- surface: "13",
- label: "fAccamountDate",
- name: "对账日期",
- checked: 0,
- width: 100,
- },
- {
- surface: "14",
- label: "fStatementNo",
- name: "对账单号",
- checked: 0,
- width: 100,
- },
- {
- surface: "15",
- label: "fFeeunitid",
- name: "计价单位",
- checked: 0,
- width: 100,
- },
- {
- surface: "16",
- label: "fQty",
- name: "数量",
- checked: 0,
- width: 100,
- },
- {
- surface: "17",
- label: "fUnitprice",
- name: "单价",
- checked: 0,
- width: 100,
- },
- {
- surface: "18",
- label: "fBilltype",
- name: "业务类型",
- checked: 0,
- width: 100,
- },
- {
- surface: "18",
- label: "fStltypeid",
- name: "结算方式",
- checked: 0,
- width: 100,
- },
- {
- surface: "19",
- label: "fProductName",
- name: "货物名称",
- checked: 0,
- width: 100,
- },
- {
- surface: "20",
- label: "fShipper",
- name: "发货方(货主)",
- checked: 0,
- width: 130,
- },
- {
- surface: "20",
- label: "remark",
- name: "备注",
- checked: 0,
- width: 100,
- },
- ],
- // 计价单位
- fFeetUnitOptions: [],
- fMblnoOptions: [],
- loading: false,
- dataList: [],
- billTypeList: [],
- fNameOptions:[],
- fStltypeOptions: [],
- fCorpOptions: [],
- }
- },
- created() {
- this.setRowList = this.tableDate;
- this.getRowList = this.tableDate;
- this.getRow()
- this.getList()
- listCorps({type: 1}).then((response) => {
- this.fMblnoOptions = response.rows;
- });
- listFees().then((response) => {
- this.fNameOptions = response.rows;
- });
- this.getDicts("data_unitfees").then((response) => {
- this.fFeetUnitOptions = response.data;
- });
- this.getDicts("data_billtype_type").then((response) => {
- this.billTypeList = response.data;
- });
- this.getDicts("data_stltype_type").then((response) => {
- this.fStltypeOptions = response.data;
- });
- },
- mounted() {
- this.$nextTick(() => {
- let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
- this.tableHeight = windowHeight - 280;
- // 监听浏览器高度变化,改变表格高度
- window.onresize = () => {
- this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
- }
- })
- },
- updated() {
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- })
- },
- filters: {
- fFeeUnitFormat(row, fFeetUnitOptions) {
- let name;
- fFeetUnitOptions.map((e) => {
- if (row == e.dictValue) {
- name = e.dictLabel;
- }
- });
- return name;
- },
- billTypeFormat(row, billTypeList) {
- let type;
- billTypeList.map((e) => {
- if (row == e.dictValue) {
- type = e.dictLabel;
- }
- });
- return type;
- },
- fStltypeFormat(row, fStltypeOptions) {
- let name;
- fStltypeOptions.map(e => {
- if (row == e.dictValue) {
- name = e.dictLabel
- }
- });
- return name;
- },
- },
- methods: {
- getList() {
- this.loading = true
- getList(this.queryParams).then(res => {
- this.dataList = res.rows
- this.total = res.total
- this.loading = false;
- })
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.queryParams.pageSize = 10;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.queryParams = {
- pageNum: 1,
- pageSize: 10,
- fDc: "D",
- }
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 导出
- handleExport() {
- this.$confirm("是否确认导出所有账单明细数据项?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- return exportList(this.queryParams)
- }).then(res => {
- this.download(res.msg)
- })
- },
- // 分项导出
- handleSubItemExport(){
- this.$confirm("是否确认导出分项所有账单明细数据项?","警告",{
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(()=> {
- return exportSubItemList(this.queryParams)
- }).then(res => {
- this.download(res.msg)
- })
- },
- // 表格合计
- getSum(param) {
- const { columns, data } = param;
- const sums = [];
- var values = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = "合计";
- return;
- }
- if (column.property === "fAmount") {
- values = data.map((item) => Number(item["fAmount"]));
- }
- if (column.property === "fStlamount") {
- values = data.map((item) => Number(item["fStlamount"]));
- }
- if (column.property === "fInvamount") {
- values = data.map((item) => Number(item["fInvamount"]));
- }
- if (column.property === "fAccamount") {
- values = data.map((item) => Number(item.fAccamount));
- }
- if (column.property === "fQty") {
- values = data.map((item) => Number(item.fQty));
- }
- if (
- column.property === "fAmount" ||
- column.property === "fStlamount" ||
- column.property === "fInvamount" ||
- column.property === "fAccamount" ||
- column.property === "fQty"
- ) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- if (column.property === "fAmount") {
- sums[index] = (sums[index]).toFixed(2);
- }
- if (column.property === "fStlamount") {
- sums[index] = (sums[index]).toFixed(2);
- }
- if (column.property === "fInvamount") {
- sums[index] = (sums[index]).toFixed(2);
- }
- if (column.property === "fAccamount") {
- sums[index] = (sums[index]).toFixed(2);
- }
- if (column.property === "fQty") {
- sums[index] = sums[index];
- }
- }
- });
- return sums;
- },
- //列设置全选
- allChecked() {
- if (this.allCheck == true) {
- this.setRowList.map((e) => {
- return (e.checked = 0);
- });
- } else {
- this.setRowList.map((e) => {
- return (e.checked = 1);
- });
- }
- },
- //开始拖拽事件
- onStart() {
- this.drag = true;
- },
- //拖拽结束事件
- onEnd() {
- this.drag = false;
- },
- //重置列表
- delRow() {
- this.data = {
- tableName: "财务查询",
- userId: Cookies.get("userName"),
- };
- resetModule(this.data).then((res) => {
- if (res.code == 200) {
- this.showSetting = false;
- this.setRowList = this.tableDate;
- console.log(this.setRowList)
- this.getRowList = this.tableDate;
- }
- });
- },
- //保存列设置
- save() {
- this.showSetting = false;
- this.data = {
- tableName: "财务查询",
- userId: Cookies.get("userName"),
- sysTableSetList: this.setRowList,
- };
- addSet(this.data).then((res) => {
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
- });
- },
- //查询列数据
- 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;
- }, []);
- }
- });
- },
- },
- }
- </script>
- <style scoped>
- </style>
|