| | |
| | | <template v-slot:table-wrap> |
| | | <ul style="margin-bottom: 30px;width: 100%;display: flex;align-items: center;justify-content: space-between;"> |
| | | <li style="font-size: 18px;font-weight: bold;">申请开票</li> |
| | | <li><el-button type="primary" @click="apply">提交开票</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column type="selection" fixed="left" width="55"></el-table-column> |
| | | <el-table-column label="序号" width="80px"> |
| | | <template slot-scope="scope"> |
| | | <span>{{scope.$index + 1}}</span> |
| | |
| | | <el-table-column label="操作" min-width="180px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.entrustmentHistory.open('开票历史', row)">开票历史</el-button> |
| | | <el-button type="text" @click="$refs.directInvoicingApplication.open('开票申请', row)">申请开票</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- 申请 --> |
| | | <entrustedInvoicingApplication ref="entrustedInvoicingApplication" @success="handlePageChange" /> |
| | | <directInvoicingApplication ref="directInvoicingApplication" @success="handlePageChange" /> |
| | | <!-- 开票历史 --> |
| | | <entrustmentHistory ref="entrustmentHistory" @success="handlePageChange" /> |
| | | </TableLayout> |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import entrustedInvoicingApplication from '@/components/enterprise/entrustedInvoicingApplication' |
| | | import directInvoicingApplication from '@/components/enterprise/directInvoicingApplication' |
| | | import entrustmentHistory from '@/components/enterprise/entrustmentHistory' |
| | | export default { |
| | | name: 'directInvoicing', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, entrustedInvoicingApplication, entrustmentHistory }, |
| | | components: { TableLayout, Pagination, directInvoicingApplication, entrustmentHistory }, |
| | | data () { |
| | | return { |
| | | searchForm: { |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | apply() { |
| | | if (this.tableData.selectedRows.length === 0) { |
| | | this.$message.warning('至少选择一项内容') |
| | | return |
| | | } |
| | | for (let i = 0; i < this.tableData.selectedRows.length; i++) { |
| | | if (this.tableData.selectedRows[i].currentFee - this.tableData.selectedRows[i].taxesMoney === 0) { |
| | | this.$message.warning(`第${i + 1}项可开票金额为0,不能进行开票!`) |
| | | return |
| | | } |
| | | } |
| | | let obj = {} |
| | | obj.list = JSON.parse(JSON.stringify(this.tableData.selectedRows)) |
| | | obj.list.forEach(item => { |
| | | item.totalPrice = item.currentFee - item.taxesMoney |
| | | }) |
| | | console.log(obj.list) |
| | | this.$refs.entrustedInvoicingApplication.open('申请开票', obj) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |