index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div>
  3. <div class="flex-align-center flex-between mt-10">
  4. <el-input style="width:200px" size="small" suffix-icon="el-icon-search" v-model="params.content.where.condition" placeholder="产品名称,编号" @keyup.enter.native="listData(params.content.pageNumber = 1)" @clear="listData(params.content.pageNumber = 1)" clearable></el-input>
  5. <el-button type="primary" size="small" :disabled="tableSelectData.length === 0" @click="onConfirm">添加选中发货单</el-button>
  6. </div>
  7. <el-table
  8. :data="tableData"
  9. style="width: 100%"
  10. size="mini"
  11. @selection-change="selectionChange"
  12. border>
  13. <el-table-column
  14. type="selection"
  15. width="55">
  16. </el-table-column>
  17. <el-table-column
  18. prop="billno"
  19. label="发货单号">
  20. </el-table-column>
  21. <el-table-column
  22. prop="sonum"
  23. label="订单号">
  24. </el-table-column>
  25. <el-table-column
  26. prop="enterprisename"
  27. label="企业名称">
  28. </el-table-column>
  29. <el-table-column
  30. prop="recheckby"
  31. label="收货人">
  32. </el-table-column>
  33. <el-table-column
  34. prop="contactsphonenumber"
  35. label="收货人联系电话">
  36. </el-table-column>
  37. <el-table-column
  38. prop="province"
  39. label="省市县">
  40. <template slot-scope="scope" v-if="scope.row.province">
  41. {{`${scope.row.province}-${scope.row.city}-${scope.row.county}`}}
  42. </template>
  43. </el-table-column>
  44. <el-table-column
  45. prop="address"
  46. label="地址">
  47. </el-table-column>
  48. </el-table>
  49. <div style="margin-top:16px;text-align:right">
  50. <el-pagination
  51. background
  52. small
  53. @size-change="handleSizeChange"
  54. @current-change="handleCurrentChange"
  55. :current-page="currentPage"
  56. :page-size="params.content.pageSize"
  57. layout="total, prev, pager, next, jumper"
  58. :total="total">
  59. </el-pagination>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. export default {
  65. props:['data','paytype'],
  66. data() {
  67. return {
  68. tableSelectData:[],
  69. tableData: [],
  70. total:0,
  71. currentPage:0,
  72. params:{
  73. "id":20221122133504,
  74. "content": {
  75. "pageNumber": 1,
  76. "pageSize": 20,
  77. "sa_logisticsid":0,
  78. "freightstatus":'',
  79. "sys_enterpriseid":'',
  80. "where": {
  81. "condition": ""
  82. }
  83. }
  84. }
  85. }
  86. },
  87. methods:{
  88. async listData () {
  89. this.params.content.sa_logisticsid = this.$route.query.id?this.$route.query.id:0
  90. this.params.content.sys_enterpriseid = this.data.sys_enterpriseid
  91. this.params.content.paytype = this.params.content.freightstatus = this.paytype
  92. const res = await this.$api.requested(this.params)
  93. this.tableData = res.data
  94. this.total = res.total
  95. this.currentPage = res.pageNumber
  96. },
  97. handleSizeChange(val) {
  98. // console.log(`每页 ${val} 条`);
  99. this.params.content.pageSize = val
  100. this.listData()
  101. },
  102. handleCurrentChange(val) {
  103. // console.log(`当前页: ${val}`);
  104. this.params.content.pageNumber = val
  105. this.listData()
  106. },
  107. selectionChange (val) {
  108. this.tableSelectData = val
  109. },
  110. onConfirm () {
  111. this.$emit('onConfirm',this.tableSelectData)
  112. },
  113. clearSelection () {
  114. this.$refs.multipleTable.clearSelection();
  115. }
  116. }
  117. }
  118. </script>