| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <div>
- <el-table
- ref="table"
- :data="list"
- style="width: 100%"
- border
- size="mini"
- highlight-current-row
- @selection-change="onSelection"
- @row-click="activeRow">
- <el-table-column
- type="selection"
- align="center">
- </el-table-column>
- <el-table-column
- prop="sa_invoicebillid"
- label="发票ID"
- width="180">
- </el-table-column>
- <el-table-column
- prop="sumtaxincludedamount"
- label="发票金额"
- width="180">
- </el-table-column>
- <el-table-column
- prop="invoiceserialnum"
- label="发票流水号">
- </el-table-column>
- <el-table-column
- prop="invoicecode"
- label="发票代码">
- </el-table-column>
- <el-table-column
- prop="invoiceno"
- label="发票号码">
- </el-table-column>
- <el-table-column
- prop="remarks"
- label="反馈消息">
- </el-table-column>
- <el-table-column
- prop="status"
- label="发票状态">
- </el-table-column>
- <el-table-column
- fixed="right"
- label="操作"
- width="90">
- <template slot-scope="scope">
- <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" @click="editRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">编 辑</el-button>
- <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" @click="deleteRow(scope.row)" type="text" size="mini" :disabled="status !== '新建'">删 除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div class="container" style="text-align:right">
- <el-pagination
- background
- small
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[20, 50, 100, 200]"
- layout="total,sizes, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- <el-dialog title="编辑发票" :visible.sync="dialogFormVisible" width="500px" append-to-body>
- <el-form :model="form" size="small" label-position="right" label-width="100px">
- <el-form-item label="备注">
- <el-input v-model="form.remarks" autocomplete="off" type="textarea" :autosize="{minRows:3}" placeholder="请输入备注"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
- <el-button type="primary" @click="submit" size="small">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- props:['status'],
- data () {
- return {
- dialogFormVisible:false,
- form:{},
- param:{
- "id": "20221223153403",
- "pageNumber":1,
- "pageSize":20,
- "content": {
- "sa_invoiceapplyid":this.$route.query.id,
- "where":{
- "rb":1
- }
- }
- },
- list:[],
- total:0,
- currentPage:0,
- }
- },
- methods:{
- async listData () {
- const res = await this.$api.requested(this.param)
- this.list = res.data
- this.total = res.total
- this.currentPage = res.pageNumber
- if (res.data.length > 0) {
- this.activeRow(res.data[0])
- this.$refs.table.setCurrentRow(this.list[0])
- }
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.param.content.pageSize = val
- this.listData()
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.param.content.pageNumber = val
- this.listData()
- },
- activeRow (row) {
- this.$emit('activeRow',row)
- },
- onSelection (selection) {
- this.$emit('selection',selection)
- },
- async deleteRow (row) {
- const res = await this.$api.requested({
- "id": "20221223160103",
- "content": {
- "sa_invoicebillids":[row.sa_invoicebillid]
- }
- })
- this.tool.showMessage(res,()=>{
- this.listData()
- })
- },
- editRow (row) {
- this.form = Object.assign({},this.form,row)
- this.dialogFormVisible = true
- },
- async submit () {
- const res = await this.$api.requested({
- "id": "20221223154403",
- "content": {
- "sa_invoicebillid":this.form.sa_invoicebillid,
- "remarks":this.form.remarks
- }
- })
- this.tool.showMessage(res,()=>{
- this.listData()
- this.dialogFormVisible = false
- })
- }
- },
- mounted () {
- this.listData()
- }
- }
- </script>
- <style>
- </style>
|