canUseInvioceItem.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div>
  3. <el-button v-if="tool.checkAuth($route.name,'editBlueInvioce')" :disabled="status !== '新建'" size="small" type="primary" @click="onShow">添加开票明细行</el-button>
  4. <el-dialog title="选择开票明细行" :visible.sync="dialogTableVisible" append-to-body>
  5. <el-table :data="list" size="mini" border>
  6. <el-table-column prop="sonum" label="订单号" width="150"></el-table-column>
  7. <!-- <el-table-column prop="type" label="订单类型" width="90"></el-table-column>
  8. <el-table-column prop="checkdate" label="审核日期" width="150"></el-table-column> -->
  9. <el-table-column prop="itemno" label="产品编码" width="150"></el-table-column>
  10. <el-table-column prop="itemname" label="产品名称" width="150"></el-table-column>
  11. <el-table-column prop="price" label="订单单价" width="90"></el-table-column>
  12. <el-table-column prop="invoiceaqty" label="本次开票数量" width="120"></el-table-column>
  13. <el-table-column prop="invoiceamount" label="本次开票金额" width="120"></el-table-column>
  14. <el-table-column prop="remarks" label="备注" min-width="150"></el-table-column>
  15. <el-table-column label="操作" width="90" fixed="right">
  16. <template slot-scope="scope">
  17. <el-button size="small" type="text" @click="addRow(scope.row)">添 加</el-button>
  18. </template>
  19. </el-table-column>
  20. </el-table>
  21. <div class="container" style="text-align:right">
  22. <el-pagination
  23. background
  24. small
  25. @size-change="handleSizeChange"
  26. @current-change="handleCurrentChange"
  27. :current-page="currentPage"
  28. :page-sizes="[20, 50, 100, 200]"
  29. layout="total,sizes, prev, pager, next, jumper"
  30. :total="total">
  31. </el-pagination>
  32. </div>
  33. </el-dialog>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. props:['sa_invoicebillid','status'],
  39. data () {
  40. return {
  41. dialogTableVisible:false,
  42. param:{
  43. "id": 20221228093803,
  44. "content": {
  45. "pageNumber":1,
  46. "pageSize":20,
  47. "sa_invoiceapplyid":this.$route.query.id,
  48. "where":{
  49. "condition":""
  50. }
  51. }
  52. },
  53. list:[],
  54. total:0,
  55. currentPage:0
  56. }
  57. },
  58. methods:{
  59. onShow () {
  60. this.dialogTableVisible = true
  61. this.listData()
  62. },
  63. async listData () {
  64. const res = await this.$api.requested(this.param)
  65. this.list = res.data
  66. this.total = res.total
  67. this.currentPage = res.pageNumber
  68. },
  69. handleSizeChange(val) {
  70. // console.log(`每页 ${val} 条`);
  71. this.param.content.pageSize = val
  72. this.listData()
  73. },
  74. handleCurrentChange(val) {
  75. // console.log(`当前页: ${val}`);
  76. this.param.content.pageNumber = val
  77. this.listData()
  78. },
  79. // 添加明细
  80. async addRow (row) {
  81. row.taxrate = 0.13
  82. row.sa_invoicebill_itemid = 0
  83. const res = await this.$api.requested({
  84. "id": "20221227152903",
  85. "content": {
  86. "sa_invoicebillid":this.sa_invoicebillid,
  87. "sa_invoiceapplyid":this.$route.query.id,
  88. "iteminfos":[row]
  89. }
  90. })
  91. this.tool.showMessage(res,()=>{
  92. this.listData()
  93. this.$emit('onSuccess')
  94. })
  95. }
  96. },
  97. mounted () {
  98. this.listData()
  99. }
  100. }
  101. </script>
  102. <style>
  103. </style>