purchase.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. ref="crud"
  7. @refresh-change="refreshChange"
  8. @selection-change="selectionChange"
  9. @search-change="searchChange"
  10. :page.sync="page"
  11. @on-load="onLoad">
  12. </avue-crud>
  13. <div style="margin-left: 90%">
  14. <span slot="footer" class="dialog-footer" >
  15. <el-button @click="closeFun()">取 消</el-button>
  16. <el-button type="primary" @click="importProMent" :disabled="selectPromentList.length == 0">导入</el-button>
  17. </span>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import option from './config/purchase.json'
  23. import {getItemListByConditions} from "@/api/importTrade/purchase";
  24. export default {
  25. name: "index",
  26. props: {
  27. itemId: {
  28. type: String
  29. },
  30. closeFun: {
  31. type: Function
  32. }
  33. },
  34. data(){
  35. return {
  36. option:option,
  37. loading:false,
  38. data:[],
  39. selectPromentList:[],
  40. page: {
  41. pageSize: 10,
  42. pagerCount: 5,
  43. total: 0,
  44. },
  45. }
  46. },
  47. created() {
  48. },
  49. methods:{
  50. refreshChange(){
  51. this.onLoad(this.page);
  52. },
  53. searchChange(params,done){
  54. this.onLoad(this.page, params);
  55. done()
  56. },
  57. selectionChange(row){
  58. this.selectPromentList = row
  59. },
  60. onLoad(page, params = {}){
  61. this.loading = true;
  62. if (params.promentDate != undefined) {
  63. params.startDate = params.promentDate[0]+ " " + "00:00:00";
  64. params.endDate = params.promentDate[1] + " " + "23:59:59";
  65. this.$delete(params,'promentDate')
  66. }
  67. params.tradeType = "JK"
  68. getItemListByConditions(page.currentPage, page.pageSize,params).then(res=>{
  69. this.data = res.data.data.records
  70. this.page.total = res.data.data.total
  71. }).finally(()=>{
  72. this.loading = false;
  73. })
  74. },
  75. importProMent(){
  76. this.$emit('importProMent',this.selectPromentList);
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped>
  82. </style>