invoicing_goods.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. @extends('layouts.base')
  2. @section('content')
  3. @section('title', trans('配置开票商品'))
  4. @include('Yunshop\Invoice::admin.mixins')
  5. <style scoped>
  6. .set .vue-title-yz-modular,.search-box{
  7. display: flex;
  8. flex-wrap: wrap;
  9. }
  10. .set .vue-title-yz-box{
  11. width: calc(100% - 100px);
  12. }
  13. .search-item{
  14. width: 240px;
  15. margin: 10px;
  16. }
  17. .el-table td,.el-table th.is-leaf{
  18. text-align: center;
  19. }
  20. .el-icon-edit{
  21. margin-right: 10px;
  22. }
  23. .el-icon-edit,.el-icon-delete-solid{
  24. font-size: 18px;
  25. color: #848484;
  26. }
  27. </style>
  28. <div class="all">
  29. <div id="app">
  30. <div class="set">
  31. <div class="vue-title-yz-modular">
  32. <div class="vue-title-yz-box">
  33. <div class="vue-title-yz-green"></div>
  34. <div class="vue-title-yz-text">配置开票商品</div>
  35. </div>
  36. <div style="width: 100px;">
  37. <el-button type="primary" @click="edit">配置商品</el-button>
  38. </div>
  39. <div class="search-box">
  40. <el-input v-model="search.code" placeholder="税收分类编码" class="search-item" @keyup.enter.native="searchVal"></el-input>
  41. <el-input v-model="search.name" placeholder="发票内容" class="search-item" @keyup.enter.native="searchVal"></el-input>
  42. <el-button type="primary" style="margin: 10px;" icon="el-icon-search" @click="searchVal">搜索</el-button>
  43. </div>
  44. </div>
  45. </div>
  46. <box-item text="开票商品列表">
  47. <el-table :data="tableData" style="width: 100%" v-loading="tableLoading">
  48. <el-table-column prop="code" label="税收分类编码"></el-table-column>
  49. <el-table-column prop="name" label="发票内容"></el-table-column>
  50. <el-table-column prop="goods_count" label="关联商品数量"></el-table-column>
  51. <el-table-column prop="tax_rate" label="税率">
  52. <template slot-scope="scope">[[scope.row.tax_rate + "%"]]</template>
  53. </el-table-column>
  54. <el-table-column label="操作">
  55. <template slot-scope="scope">
  56. <i class="el-icon-edit" @click="edit(scope.row)"></i>
  57. <i class="el-icon-delete-solid" @click="del(scope.row.id)"></i>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. </box-item>
  62. <div class="fixed" v-if="tableTotal>0">
  63. <div class="fixed_box">
  64. <!-- :page-sizes="tablePageSizes" layout="total, sizes, prev, pager, next, jumper" -->
  65. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="tablePage" :page-size="tablePageSize"
  66. layout="total, prev, pager, next, jumper" :total="tableTotal" >
  67. </el-pagination>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <script>
  73. const vm = new Vue({
  74. mixins:[tableMixins],
  75. data(){
  76. return {
  77. tableUrl:"{!!yzWebFullUrl('plugin.invoice.admin.invoicing-goods.get-list')!!}",
  78. search:{
  79. code:"",
  80. name:""
  81. },
  82. tableData:[]
  83. }
  84. },
  85. methods:{
  86. // tableUrl(){
  87. // return "{!!yzWebFullUrl('plugin.invoice.admin.invoicing-log.get-data')!!}"
  88. // },
  89. del(id){
  90. this.$confirm('确定要删除此条数据吗', '提示', {
  91. confirmButtonText: '确定',
  92. cancelButtonText: '取消',
  93. type: 'warning'
  94. }).then(() => {
  95. this.deleteData(id)
  96. }).catch(()=>{})
  97. },
  98. deleteData(id){
  99. this.$http.post("{!!yzWebFullUrl('plugin.invoice.admin.invoicing-goods.destory')!!}",{id}).then(({data:{result,msg="",data}})=>{
  100. if(result==1){
  101. this.$message.success(msg)
  102. this.last_page = "";
  103. this.tablePage = 1;
  104. this.getTableData();
  105. }
  106. else this.$message.error(msg)
  107. })
  108. },
  109. edit(row){
  110. let json = row.id?`&id=${row.id}`:"";
  111. window.location.href = `{!! yzWebFullUrl('plugin.invoice.admin.invoicing-goods.edit') !!}` + json;
  112. }
  113. }
  114. })
  115. </script>
  116. @endsection('content')