index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table
  4. :columns="columns"
  5. ref="yuntable"
  6. @render="onTableRender"
  7. toolbar="refresh,del"
  8. :auth="{
  9. add:{:$auth->check('app\\admin\\controller\\goods\\FengsuShip','add')},
  10. edit:{:$auth->check('app\\admin\\controller\\goods\\FengsuShip','edit')},
  11. del:{:$auth->check('app\\admin\\controller\\goods\\FengsuShip','del')},
  12. multi:{:$auth->check('app\\admin\\controller\\goods\\FengsuShip','multi')},
  13. }"
  14. :extend="extend">
  15. </yun-table>
  16. </el-card>
  17. </template>
  18. <script>
  19. import table from "@components/Table.js";
  20. export default{
  21. components:{
  22. 'YunTable':table
  23. },
  24. data:{
  25. extend:{
  26. index_url: 'goods/fengsu_ship/index',
  27. del_url: 'goods/fengsu_ship/del',
  28. multi_url: 'goods/fengsu_ship/multi',
  29. },
  30. columns:[
  31. {checkbox: true,selectable:function (row,index){
  32. //可以根据业务需求返回false让某些行不可选中
  33. return true;
  34. }},
  35. {field:"id",title:"ID",operate:false},
  36. {field:"shop_id",title:"店铺ID"},
  37. {field:"trade_from",title:"平台"},
  38. {field:"province",title:"省份",operate: false},
  39. {field:"city",title:"城市",operate: false},
  40. {field:"company_name",title:"快递名称"},
  41. {field:"waybill_no",title:"快递单号"},
  42. {field:"goods_title",title:"产品名称"},
  43. {field:"sku_id",title:"规格id"},
  44. {field:"num",title:"件数",operate: false},
  45. {field:"price",title:"实付价格",operate: false},
  46. {field:"consign_time",title:"发货时间",operate:"daterange",formatter:Yunqi.formatter.datetime},
  47. {field:"status",title:"状态",operate:"select",searchList:{1:"无店铺", 2:"无Sku", 3:"正常"},formatter:Yunqi.formatter.tags},
  48. {field:"user_id",title:"录入人",operate: false},
  49. {field:"createtime",title:"创建时间",operate: false,formatter:Yunqi.formatter.datetime},
  50. {field:"updatetime",title:"修改时间",visible:false,operate: false,formatter:Yunqi.formatter.datetime},
  51. {
  52. field: 'operate',
  53. title: __('操作'),
  54. width:150,
  55. action:{
  56. shops:{
  57. tooltip:true,
  58. icon:'fa fa-certificate',
  59. type:'success',
  60. text:__('关联店铺'),
  61. method:'shops',
  62. visible:function(row,index){
  63. return row.status == 1;
  64. }
  65. },
  66. specs:{
  67. tooltip:true,
  68. icon:'fa fa-list',
  69. type:'info',
  70. text:__('关联规格'),
  71. method:'specs',
  72. // visible:function(row,index){
  73. // return row.status == 2;
  74. // }
  75. },
  76. del:true
  77. }
  78. }
  79. ]
  80. },
  81. //页面加载完成时执行
  82. onLoad:function(query){
  83. console.log(query);
  84. },
  85. //页面初始显示或在框架内显示时执行
  86. onShow:function(){
  87. },
  88. //页面在框架内隐藏时执行
  89. onHide:function(){
  90. },
  91. //页面在框架内关闭时执行
  92. onUnload:function(){
  93. },
  94. methods: {
  95. shops:function (row){
  96. Yunqi.api.open({
  97. url:'goods/fengsu_ship/shops?ids='+row.id,
  98. width:1000,
  99. title:__('关联店铺'),
  100. icon:'fa fa-list'
  101. });
  102. },
  103. specs:function (row){
  104. Yunqi.api.open({
  105. url:'goods/fengsu_ship/specs?ids='+row.id,
  106. width:1000,
  107. title:__('关联规格'),
  108. icon:'fa fa-list'
  109. });
  110. },
  111. onTableRender:function(list){
  112. //表格渲染完成后执行
  113. /**
  114. * table常用方法
  115. * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
  116. * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
  117. * this.$refs.yuntable.submit();//返回第一页,重新获取数据
  118. * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
  119. * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
  120. */
  121. }
  122. }
  123. }
  124. </script>
  125. <style>
  126. </style>