MrShi
2024-03-08 d2bc6e096f0806b78ea92d4b90a21d3627d406c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
    <TableLayout>
        <!-- 表格和分页 -->
        <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"
            >
                <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>
                    </template>
                </el-table-column>
                <el-table-column prop="statusInfo" label="状态">
                  <template slot-scope="{row}">
                    <span :class="'apply-status'+row.status" >{{row.statusInfo}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="solutionsName" label="保险方案"></el-table-column>
                <el-table-column prop="code" label="保单号"></el-table-column>
<!--                <el-table-column label="已产生费用(元)">-->
<!--                    <template slot-scope="{row}">-->
<!--                        <span>{{row.currentFee}}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column label="已开票费用(元)">-->
<!--                    <template slot-scope="{row}">-->
<!--                        <span>{{row.taxesMoney}}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column prop="fee" label="未开票费用(元)">-->
<!--                    <template slot-scope="{row}">-->
<!--                        <span>{{row.currentFee - row.taxesMoney}}</span>-->
<!--                    </template>-->
<!--                </el-table-column>-->
                <el-table-column prop="taxesLast" label="上次开票时间"></el-table-column>
                <el-table-column prop="startTime" label="投保生效日期"></el-table-column>
                <el-table-column prop="endTime" label="投保失效日期"></el-table-column>
                <el-table-column label="操作" min-width="180px">
                    <template slot-scope="{row}">
                        <el-button type="text" @click="$refs.entrustmentHistory.open('开票历史', {...row, determine: 1})">开票历史</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
                @current-change="handlePageChange"
                :pagination="tableData.pagination"
            >
            </pagination>
        </template>
        <!--   申请    -->
        <entrustedInvoicingApplication ref="entrustedInvoicingApplication" @success="handlePageChange" />
        <!--    开票历史    -->
        <entrustmentHistory ref="entrustmentHistory" @success="handlePageChange" />
    </TableLayout>
</template>
 
<script>
    import BaseTable from '@/components/base/BaseTable'
    import TableLayout from '@/layouts/TableLayout'
    import Pagination from '@/components/common/Pagination'
    import entrustedInvoicingApplication from '@/components/enterprise/entrustedInvoicingApplication'
    import entrustmentHistory from '@/components/enterprise/entrustmentHistory'
    export default {
        name: 'entrustedInvoicing',
        extends: BaseTable,
        components: { TableLayout, Pagination, entrustedInvoicingApplication, entrustmentHistory },
        data () {
            return {
                searchForm: {
                    type: 1,
                    status: '5,7'
                }
            }
        },
        created () {
            this.config({
                module: '投保申请信息表',
                api: '/business/insuranceApply',
                'field.id': 'id',
                'field.main': 'id'
            })
            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>
 
<style lang="scss" scoped>
    .form {
        width: 100%;
        display: flex;
        flex-direction: column;
        .form_item {
            width: 100%;
            display: flex;
            align-items: center;
            margin-bottom: 20px;
            &:last-child {
                margin-bottom: 0 !important;
            }
            .form_item_label {
                width: 100px;
                flex-shrink: 0;
                font-size: 14px;
                color: black;
            }
            .form_item_val {
                flex: 1;
                min-height: 35px;
                display: flex;
                align-items: center;
                input {
                    width: 100%;
                    height: 100%;
                    font-size: 14px;
                    color: black;
                    padding: 5px 10px;
                    outline: none;
                    box-sizing: border-box;
                    border: 1px solid #ececec;
                }
            }
        }
    }
</style>