consignee_address.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div>
  3. <use-table ref="tbl"></use-table>
  4. <div class="container use-table">
  5. <el-table :data="tableDatas" highlight-current-row>
  6. <el-table-column property="address" label="收货地址" align="center"></el-table-column>
  7. <el-table-column property="addr_detail" label="详细收货地址" align="center"></el-table-column>
  8. <el-table-column property="mobile" label="收货人手机号" align="center"></el-table-column>
  9. <el-table-column property="consignee" label="收货人名称" align="center"></el-table-column>
  10. <el-table-column property="remark" label="备注" align="center"></el-table-column>
  11. <el-table-column property="create_time" label="创建时间" align="center"></el-table-column>
  12. </el-table>
  13. <el-pagination
  14. :current-page="req.page"
  15. :page-sizes="[10, 20, 30, 50, 100]"
  16. :page-size="req.rows"
  17. layout="total, sizes, prev, pager, next, jumper"
  18. :total="tableTotal"
  19. @size-change="sizeChange"
  20. @current-change="currentChange"
  21. ></el-pagination>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. const __name = 'usemall-member-address';
  27. export default {
  28. data() {
  29. return {
  30. dataId: '',
  31. req: {
  32. page: 1,
  33. rows: 10,
  34. orderby: 'sort asc'
  35. },
  36. tblHeight: 0,
  37. tableDatas: [],
  38. tableTotal: 0
  39. };
  40. },
  41. methods: {
  42. async loadData() {
  43. await this.$db[__name].where({ create_uid: this.dataId }).totable(this.req).then(res => {
  44. if (res.code == 200) {
  45. res.datas.rows.forEach((row, idx) => {
  46. row.create_time = new Date(row.create_time).format();
  47. });
  48. this.tableDatas = res.datas.rows;
  49. this.tableTotal = res.datas.total;
  50. }
  51. });
  52. },
  53. sizeChange(size) {
  54. this.req.rows = size;
  55. this.loadData();
  56. },
  57. currentChange(current) {
  58. this.req.page = current;
  59. this.loadData();
  60. }
  61. },
  62. created() {
  63. this.dataId = this.$route.query.id || '';
  64. this.loadData();
  65. },
  66. updated() {
  67. if (!this.tblHeight) {
  68. this.tblHeight = this.$refs.tbl.tblHeight;
  69. }
  70. }
  71. };
  72. </script>
  73. <style></style>