123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710 |
- <template>
- <div class="app-container">
- <span>台账</span>
- <el-divider></el-divider>
- <!-- <el-radio-group v-model="mainId" size="">
- <el-radio-button
- v-for="(v, i) in dictList"
- :key="i"
- :label="v.dictCode"
- >{{ v.dictValue }}</el-radio-button
- >
- </el-radio-group>
- <br /><br /> -->
- <el-radio-group v-model="bill" @change="checkFn" size="">
- <el-radio-button label="COMMONLY">货款台账</el-radio-button>
- <el-radio-button label="REBATE">返利台账</el-radio-button>
- </el-radio-group>
- <h1></h1>
- <!-- 筛选条件 -->
- <div>
- <el-form
- ref="searchForm"
- :model="searchForm"
- label-width="100px"
- size="small"
- label-position="left"
- >
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="经销商名称" prop="customerId">
- <el-select
- class="selectStyle"
- v-model="searchForm.customerId"
- placeholder="请选择"
- filterable
- @change="changeFn"
- >
- <el-option
- v-for="(v, i) in customerList"
- :key="i"
- :label="v.name"
- :value="v.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="钱包" prop="customerWalletId">
- <el-select
- class="selectStyle"
- v-model="searchForm.customerWalletId"
- placeholder="请选择"
- filterable
- >
- <el-option
- v-for="(v, i) in walletList"
- :key="i"
- :label="v.customerWalletName"
- :value="v.customerWalletId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="单据号" prop="billNo">
- <el-input
- v-model="searchForm.billNo"
- placeholder="请输入"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="开始时间" prop="startTime">
- <el-date-picker
- class="selectStyle"
- v-model="searchForm.startTime"
- type="datetime"
- placeholder="选择日期时间"
- default-time="00:00:00"
- value-format="yyyy-MM-dd HH:mm:ss"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="结束时间" prop="endTime">
- <el-date-picker
- class="selectStyle"
- v-model="searchForm.endTime"
- type="datetime"
- placeholder="选择日期时间"
- default-time="23:59:59"
- value-format="yyyy-MM-dd HH:mm:ss"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="24" :lg="18">
- <el-form-item label="" class="fr">
- <el-button size="small" @click="resetFn">清空</el-button>
- <el-button size="small" type="primary" @click="searchFn"
- >搜索</el-button
- >
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div v-show="bill == 'COMMONLY'">
- <!-- 列表 -->
- <div class="mymain-container">
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column
- label="序号"
- align="center"
- width="100"
- type="index"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据日期"
- prop="theTime"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据类型"
- prop="billType"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据号"
- prop="billNo"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="钱包"
- prop="walletName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="摘要"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="预付货款"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 1
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="订单占款"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 2
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="支付货款"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 3
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="押金"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 4
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="工程保证金"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 5
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="其他暂扣款"
- prop="flag"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{
- scope.row.flag == 6
- ? scope.row.amountType == "IN"
- ? scope.row.amount
- : scope.row.amountType == "OUT"
- ? -scope.row.amount
- : ""
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="账户余额"
- prop="balanceAmount"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- <div v-show="bill == 'REBATE'">
- <!-- 列表 -->
- <div class="mymain-container">
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column
- label="序号"
- align="center"
- width="100"
- type="index"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="客户编码"
- prop="customerCode"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="客户名称"
- prop="customerName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据日期"
- prop="theTime"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="审核日期"
- prop="examineTime"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据类型"
- prop="billType"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="单据号"
- prop="billNo"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="返利类型"
- prop="walletName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="摘要"
- prop="remark"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="收入"
- prop="amountType"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.amountType == "IN" ? scope.row.amount : "-" }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="支出"
- prop="amountType"
- min-width="160"
- show-overflow-tooltip
- >
- <template slot-scope="scope">
- {{ scope.row.amountType == "OUT" ? scope.row.amount : "-" }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- label="暂扣返利"
- prop="withholdAmount"
- min-width="160"
- show-overflow-tooltip
- >
- <!-- <template slot-scope="scope">
- {{
- scope.row.amountType == "OUT"
- ? scope.row.amount
- : -scope.row.amount
- }}
- </template> -->
- </el-table-column>
- <el-table-column
- align="center"
- label="结存"
- prop="balanceAmount"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import { getWalletCustomerList } from "@/api/finance/change_apply";
- import {
- getStandbookList,
- getDictList,
- getCustomerList,
- } from "@/api/finance/standbook_list";
- import { number } from "echarts";
- export default {
- data() {
- return {
- customerList: [],
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- // dataListRebate: [], // 列表数据
- // dataListLoan: [], // 列表数据
- dataList: [],
- walletList: [],
- // dictList: [],
- customerName: null,
- customerNumber: null,
- searchForm: {
- customerId: "",
- customerWalletId: "",
- billNo: "",
- startTime: "",
- endTime: "",
- }, //搜索表单
- listLoading: false, // 列表加载loading
- bill: "COMMONLY",
- };
- },
- computed: {
- ...mapGetters(["customerId"]),
- },
- created() {
- if (this.$route.query.customerName && this.$route.query.customerNumber) {
- this.getDataList({
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.$route.query.customerName,
- customerNumber: this.$route.query.customerNumber,
- });
- } else {
- this.getDataList({
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- });
- }
- this.getCustomerDataList();
- // this.getWalletList();
- // this.getDataDict();
- },
- methods: {
- //改变经销商
- async changeFn(v) {
- this.searchForm.customerWalletId = "";
- let res = await getWalletCustomerList({ customerId: v });
- this.walletList = res.data;
- },
- //获取经销商列表
- async getCustomerDataList() {
- let res = await getCustomerList({
- pageNum: 1,
- pageSize: -1,
- });
- this.customerList = res.data.records;
- },
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val;
- this.currentPage = 1;
- // this.getDataList({
- // type: this.bill,
- // pageNum: this.currentPage,
- // pageSize: this.pageSize,
- // });
- if (this.$route.query.customerName && this.$route.query.customerNumber) {
- this.getDataList({
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.$route.query.customerName,
- customerNumber: this.$route.query.customerNumber,
- });
- } else {
- this.getDataList({
- ...this.searchForm,
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.customerName,
- customerNumber: this.customerNumber,
- });
- }
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val;
- // this.getDataList({
- // type: this.bill,
- // pageNum: this.currentPage,
- // pageSize: this.pageSize,
- // });
- if (this.$route.query.customerName && this.$route.query.customerNumber) {
- this.getDataList({
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.$route.query.customerName,
- customerNumber: this.$route.query.customerNumber,
- });
- } else {
- this.getDataList({
- ...this.searchForm,
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.customerName,
- customerNumber: this.customerNumber,
- });
- }
- },
- // //获取品类
- // async getDataDict() {
- // const res = await getDictList({ sysDictEnum: "PRODUCT_TYPE" });
- // console.log(res);
- // this.dictList = res.data;
- // },
- //重置
- resetFn() {
- // this.searchForm.customerId = "";
- this.walletList = [];
- this.$refs.searchForm.resetFields();
- },
- //查询
- searchFn() {
- // this.customerName = null;
- // this.customerNumber = null;
- let res = this.customerList.filter((v) => {
- return v.id == this.searchForm.customerId;
- });
- console.log(res);
- // return;
- if (res.length > 0) {
- this.customerName = res[0].name;
- this.customerNumber = res[0].number;
- }
- if (this.$route.query.customerName && this.$route.query.customerNumber) {
- this.getDataList({
- ...this.searchForm,
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- customerName: this.$route.query.customerName,
- customerNumber: this.$route.query.customerNumber,
- });
- } else {
- this.getDataList({
- ...this.searchForm,
- customerName: this.customerName,
- customerNumber: this.customerNumber,
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: this.bill,
- });
- }
- },
- // //钱包数据
- // async getWalletList() {
- // let res = await getWalletCustomerList({
- // customerId: this.customerId,
- // type: this.bill,
- // });
- // this.selectList = res.data;
- // },
- //切换列表
- checkFn(v) {
- // this.getDataList({
- // pageSize: 10,
- // pageNum: 1,
- // type: v,
- // });
- this.pageSize = 10;
- this.currentPage = 1;
- if (this.$route.query.customerName && this.$route.query.customerNumber) {
- this.getDataList({
- ...this.searchForm,
- pageSize: 10,
- pageNum: 1,
- type: v,
- customerName: this.$route.query.customerName,
- customerNumber: this.$route.query.customerNumber,
- });
- } else {
- this.getDataList({
- ...this.searchForm,
- customerName: this.customerName,
- customerNumber: this.customerNumber,
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- type: v,
- });
- }
- // this.getWalletList();
- },
- //
- async getDataList(data) {
- let res;
- if (this.bill == "COMMONLY") {
- res = await getStandbookList(data);
- } else {
- res = await getStandbookList(data);
- }
- this.dataList = res.data.records;
- this.listTotal = res.data.total;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .moneyStyle {
- height: 130px;
- border-radius: 20px;
- padding: 20px 0 0 20px;
- color: #fff;
- span {
- display: block;
- font-size: 20px;
- }
- strong {
- margin-top: 16px;
- display: block;
- font-size: 36px;
- }
- }
- .selectStyle {
- width: 100%;
- }
- .color1 {
- background-color: #6c83d0;
- }
- .color2 {
- background-color: #dfc062;
- }
- .color3 {
- background-color: #dfc062;
- }
- .color4 {
- background-color: #6bcfd7;
- }
- </style>
|