canUseInvioceItem.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div>
  3. <el-button v-if="tool.checkAuth($route.name,'editRedInvioce')" :disabled="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="goodscode" label="产品编码" width="150"></el-table-column>
  19. <el-table-column prop="goodsname" 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="num" label="本次开票数量" width="120"></el-table-column>
  26. <el-table-column prop="taxincludedamount" label="本次开票金额" width="120">
  27. <template slot-scope="scope">
  28. {{tool.formatAmount(scope.row.taxincludedamount,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": 2024052409322604,
  61. "content": {
  62. "pageNumber":1,
  63. "pageSize":20,
  64. "sa_invoicebillid":'',
  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. this.param.content.sa_invoicebillid = this.sa_invoicebillid
  82. const res = await this.$api.requested(this.param)
  83. this.list = res.data
  84. this.total = res.total
  85. this.currentPage = res.pageNumber
  86. },
  87. handleSizeChange(val) {
  88. // console.log(`每页 ${val} 条`);
  89. this.param.content.pageSize = val
  90. this.listData()
  91. },
  92. handleCurrentChange(val) {
  93. // console.log(`当前页: ${val}`);
  94. this.param.content.pageNumber = val
  95. this.listData()
  96. },
  97. // 添加明细
  98. async addRow (row) {
  99. row.invoiceamount = row.taxincludedamount
  100. row.invoiceaqty = row.num
  101. const res = await this.$api.requested({
  102. "id": "20230228090903",
  103. "content": {
  104. "sa_invoicebillid":this.sa_invoicebillid,
  105. "sa_invoiceapplyid":this.$route.query.id,
  106. "iteminfos":[{
  107. "sa_invoicebill_itemid": row.sa_invoicebill_itemid,
  108. "sa_invoiceapply_orderid":row.sa_invoiceapply_orderid,
  109. "itemno": row.goodscode,
  110. "itemname": row.goodsname,
  111. "spec": row.spectype,
  112. "price": row.price,
  113. "invoiceaqty": row.num,
  114. "invoiceamount": row.taxincludedamount,
  115. "taxrate":row.taxrate,
  116. "unit":row.unit
  117. }]
  118. }
  119. })
  120. this.tool.showMessage(res,()=>{
  121. this.listData()
  122. this.$emit('onSuccess')
  123. })
  124. }
  125. },
  126. mounted () {
  127. this.listData()
  128. }
  129. }
  130. </script>
  131. <style>
  132. </style>