canUseInvioceItem.vue 4.0 KB

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