| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <search-table @search="reload"></search-table>
- <!-- 数据表格 -->
- <div>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- height="calc(100vh - 375px)"
- full-height="calc(100vh - 116px)"
- tool-class="ele-toolbar-form"
- :selection.sync="selection"
- :page-size="20"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- show-summary
- :summary-method="getSummaries"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- v-if="$hasPermission('eom:finpayable:push')"
- size="small"
- type="primary"
- class="ele-btn-icon"
- @click="allPushBtn"
- :disabled="selection?.length === 0"
- >
- 批量推送
- </el-button>
- </template>
- <!-- 操作 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- v-if="canAddInvoice(row)"
- :underline="false"
- icon="el-icon-plus"
- @click="openEdit(row)"
- >
- 新增发票
- </el-link>
- <el-link
- type="primary"
- v-if="[2].includes(row.approvalStatus)"
- :underline="false"
- icon="el-icon-plus"
- @click="handleCollection(row, 'update')"
- >
- 付款
- </el-link>
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-plus"
- @click="sub(row)"
- v-if="[0, 3].includes(row.approvalStatus)"
- >
- 提交
- </el-link>
- </template>
- <!-- 收款信息 -->
- <template v-slot:code="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleDetail(row, 'view')"
- >
- {{ row.code }}
- </el-link>
- </template>
- <!-- 开票信息 -->
- <template v-slot:invoiceCode="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="handleInvoiceDetail(row, 'view')"
- >
- {{ row.invoiceCode }}
- </el-link>
- </template>
- </ele-pro-table>
- </div>
- </el-card>
- <!-- 付款信息-->
- <payment-dialog
- ref="collectionDialogRef"
- v-if="paymentDialogFlag"
- :payment-dialog-flag.sync="paymentDialogFlag"
- @reload="reload"
- ></payment-dialog>
- <detail-dialog
- ref="detailDialogRef"
- v-if="detailDialogFlag"
- :detail-dialog-flag.sync="detailDialogFlag"
- ></detail-dialog>
- <!--开票详情-->
- <invoice-detail-dialog
- ref="invoiceDetailDialogRef"
- v-if="invoiceDetailDialogFlag"
- :detailDialogFlag.sync="invoiceDetailDialogFlag"
- ></invoice-detail-dialog>
- <process-submit-dialog
- api-fun-name="fininvoiceapplyStatusAPI"
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- isCloseRefresh="false"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="reload"
- ></process-submit-dialog>
- <!-- 开票 -->
- <addOrEditDialogNew
- ref="addOrEditDialogNewRef"
- :add-or-edit-dialog-flag.sync="addOrEditDialogNewFlag"
- v-if="addOrEditDialogNewFlag"
- :isEditType="false"
- @reload="reload"
- />
- </div>
- </template>
- <script>
- import { getSummaries } from '@/utils/util.js';
- import { reviewStatus } from '@/enum/dict';
- import dictMixins from '@/mixins/dictMixins';
- import { finPayablePageListAPI, purchasePayableBill } from '@/api/financialManage/payableManage';
- import paymentDialog from './components/paymentDialog.vue';
- import searchTable from './searchTable.vue';
- import detailDialog from './components/detailDialog.vue';
- import invoiceDetailDialog from '../invoiceManage/components/detailDialog.vue';
- import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
- import tabMixins from '@/mixins/tableColumnsMixin';
- import { shippingModeOp, transactionMethodsOp, paymentTypeOp, paymentType, invoiceStatusOp } from '@/enum/dict.js';
- import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
- export default {
- mixins: [dictMixins, tabMixins],
- components: {
- searchTable,
- paymentDialog,
- detailDialog,
- invoiceDetailDialog,
- processSubmitDialog,
- addOrEditDialogNew
- },
- data() {
- return {
- // 加载状态
- loading: false,
- paymentDialogFlag: false,
- detailDialogFlag: false,
- invoiceDetailDialogFlag: false,
- processSubmitDialogFlag: false,
- shippingModeOp,
- invoiceStatusOp,
- transactionMethodsOp,
- paymentTypeOp,
- selection: [],
- addOrEditDialogNewFlag: false,
- paymentType,
- statusList: [
- {
- label: '未付款',
- value: 0
- },
- {
- label: '部分付款',
- value: 1
- },
- {
- label: '已付全款',
- value: 2
- }
- ],
- cacheKeyUrl: 'eos-7a7a5e23-payableManage',
- columnsVersion: 1
- };
- },
- computed: {
- canAddInvoice() {
- return function(row) {
- if (!row) return false;
- return [2].includes(row.approvalStatus) && row.transactionMode == 2 && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
- };
- },
- columns() {
- // 当columnsVersion变化时会重新计算,用作更新列配置
- const version = this.columnsVersion;
- return [
- {
- width: 45,
- type: 'selection',
- columnKey: 'selection',
- align: 'center'
- },
- {
- width: 60,
- label: '序号',
- type: 'index',
- columnKey: 'index',
- align: 'center'
- },
- {
- minWidth: 150,
- prop: 'code',
- label: '应付编码',
- align: 'center',
- slot: 'code',
- showOverflowTooltip: true
- },
- {
- minWidth: 160,
- prop: 'receiptPlanOrderNo',
- label: '付款计划编码',
- align: 'center',
- slot: 'receiptPlanOrderNo',
- showOverflowTooltip: true
- },
- {
- minWidth: 160,
- prop: 'saleOrderNo',
- label: '订单编码',
- align: 'center',
- slot: 'saleOrderNo',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'contractCode',
- label: '合同编码',
- align: 'center',
- slot: 'contractCode',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'contractNo',
- label: '合同编号',
- align: 'center',
- slot: 'contractNo',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'contractName',
- label: '合同名称',
- align: 'center',
- slot: 'contractName',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'invoiceCode',
- label: '关联发票编码',
- slot: 'invoiceCode',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'invoiceNos',
- label: '发票号',
- align: 'center',
- slot: 'invoiceNos',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'customerNo',
- label: '客户编码',
- align: 'center',
- slot: 'customerNo',
- showOverflowTooltip: true
- },
- {
- minWidth: 150,
- prop: 'contactName',
- label: '客户名称',
- align: 'center',
- slot: 'contactName',
- showOverflowTooltip: true
- },
- {
- minWidth: 130,
- prop: 'paymentTypeName',
- label: '款项类型',
- align: 'center',
- slot: 'paymentTypeName',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'orderAmount',
- label: '订单总额',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'payableTotalPrice',
- label: '应付金额',
- align: 'center',
- slot: 'payableTotalPrice',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'paidTotalPrice',
- label: '已付金额',
- align: 'center',
- slot: 'paidTotalPrice',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'unpaidTotalPrice',
- label: '未付金额',
- align: 'center',
- slot: 'unpaidTotalPrice',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'invoiceAmount',
- label: '已开票金额',
- align: 'center',
- slot: 'invoiceAmount',
- showOverflowTooltip: true
- },
- {
- minWidth: 100,
- prop: 'unInvoiceAmount',
- label: '未开票金额',
- align: 'center',
- slot: 'unInvoiceAmount',
- showOverflowTooltip: true
- },
- {
- minWidth: 140,
- prop: 'payableDate',
- label: '实际付款日期',
- slot: 'payableDate',
- align: 'center',
- showOverflowTooltip: true
- },
-
- {
- minWidth: 120,
- prop: 'createUserName',
- label: '创建人',
- align: 'center',
- slot: 'createUserName',
- showOverflowTooltip: true
- },
- {
- minWidth: 120,
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- slot: 'createTime',
- showOverflowTooltip: true
- },
- {
- minWidth: 120,
- prop: 'accountingSubjectName',
- label: '会计科目',
- align: 'center',
- slot: 'accountingSubjectName',
- showOverflowTooltip: true
- },
- {
- prop: 'transactionMode',
- label: '交易方式',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 200,
- formatter: (row) => {
- return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
- }
- },
- {
- prop: 'invoiceStatus',
- label: '开票状态',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100,
- formatter: (_row, _column, cellValue) => {
- return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
- }
- },
- {
- minWidth: 100,
- prop: 'status',
- label: '付款状态',
- align: 'center',
- slot: 'status',
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return this.paymentType.find((item) => item.value == cellValue)
- .label;
- }
- },
- {
- minWidth: 130,
- prop: 'remark',
- label: '来源备注',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'externalId',
- label: '是否推送',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 120,
- formatter: (_row, _column, cellValue) => {
- return _row.externalId? '已推送' : '未推送';
- }
- },
- {
- minWidth: 100,
- prop: 'approvalStatus',
- label: '审核状态',
- align: 'center',
- slot: 'approvalStatus',
- formatter: (_row, _column, cellValue) => {
- return reviewStatus[_row.approvalStatus];
- }
- },
-
- {
- columnKey: 'action',
- label: '操作',
- width: 150,
- align: 'center',
- resizable: false,
- slot: 'action',
- showOverflowTooltip: true,
- fixed: 'right'
- }
- ];
- }
- },
- created() {},
- methods: {
- getSummaries(param) {
- return getSummaries(
- param,
- ['payableTotalPrice', 'paidTotalPrice', 'unpaidTotalPrice', 'invoiceAmount', 'unInvoiceAmount'],
- ' '
- );
- },
- //新增发票
- openEdit(row) {
- this.addOrEditDialogNewFlag = true;
- this.$nextTick(() => {
- this.$refs.addOrEditDialogNewRef.createInvoice1([row], '2', 4);
- });
- // this.$refs.addOrEditDialogNewRef.$refs.form &&
- // this.$refs.addOrEditDialogNewRef.$refs.form.clearValidate();
- },
- allPushBtn() {
- const dataId = this.selection.map((v) => v.id);
- purchasePayableBill(dataId).then((res) => {
- this.$message.success('推送成功!');
- this.reload();
- });
- },
- handleCollection(row = {}, type) {
- this.paymentDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.collectionDialogRef.init(row, type);
- });
- },
- handleDetail(row = {}, type) {
- this.detailDialogFlag = true;
- this.$nextTick(() => {
- this.$refs.detailDialogRef.init(row.id);
- });
- },
- handleInvoiceDetail(row = {}, type) {
- this.invoiceDetailDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- id: row.invoiceId
- };
- this.$refs.invoiceDetailDialogRef.init(params, type);
- });
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return finPayablePageListAPI({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- sub(res) {
- this.processSubmitDialogFlag = true;
- let params = {
- businessId: res.id,
- businessKey: 'fin_payable_approve',
- formCreateUserId: res.createUserId,
- variables: {
- businessCode: res.code,
- businessName: res.contactName,
- businessType: '应付'
- }
- };
- this.$nextTick(() => {
- this.$refs.processSubmitDialogRef.init(params);
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- :deep(.el-link--inner) {
- margin-left: 0px !important;
- }
- .sys-organization-list {
- height: calc(100vh - 264px);
- box-sizing: border-box;
- border-width: 1px;
- border-style: solid;
- overflow: auto;
- }
- .sys-organization-list :deep(.el-tree-node__content) {
- height: 40px;
- & > .el-tree-node__expand-icon {
- margin-left: 10px;
- }
- }
- </style>
|