index.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table :columns="columns" ref="yuntable" @render="onTableRender" toolbar="refresh,del" :auth="{
  4. del:{:$auth->check('app\\admin\\controller\\goods\\ImportList','del')},
  5. }" :extend="extend">
  6. </yun-table>
  7. </el-card>
  8. </template>
  9. <script>
  10. import table from "@components/Table.js";
  11. export default {
  12. components: {
  13. 'YunTable': table
  14. },
  15. data: {
  16. extend: {
  17. index_url: 'goods/import_list/index',
  18. del_url: 'goods/import_list/del',
  19. multi_url: 'goods/import_list/multi',
  20. },
  21. columns: [
  22. {
  23. checkbox: true, selectable: function (row, index) {
  24. //可以根据业务需求返回false让某些行不可选中
  25. return true;
  26. }
  27. },
  28. { field: "id", title: "ID", operate: false },
  29. { field: "shop_id", title: "店铺ID" },
  30. {
  31. field: 'type_id', title: ('打单平台'), operate: "select", searchList: { 1: '风速', 2: '聚水潭', 0: '无' }, formatter: function (data, row) {
  32. let tag = Yunqi.formatter.tag;
  33. if (row.type_id == 1) {
  34. tag.value = '风速';
  35. tag.type = 'success';
  36. } else if (row.type_id == 2) {
  37. tag.value = '聚水潭';
  38. tag.type = 'primary';
  39. } else {
  40. tag.value = '无';
  41. tag.type = 'info';
  42. }
  43. return tag;
  44. }
  45. },
  46. { field: "trade_from", title: "平台" },
  47. { field: "province", title: "省份", operate: false },
  48. { field: "city", title: "城市", operate: false },
  49. { field: "company_name", title: "快递名称", operate: false },
  50. { field: "waybill_no", title: "快递单号" },
  51. { field: "goods_title", title: "产品名称", width: 300, align: 'left' },
  52. { field: "goods_info", title: "商品信息", width: 300, align: 'left' },
  53. { field: "sku_id", title: "规格id" },
  54. { field: "num", title: "件数", operate: false },
  55. { field: "price", title: "实付价格", operate: false },
  56. { field: "pack_specs_id", title: "打包规格id", operate: false },
  57. { field: "labor_cost_money", title: "工价", operate: false },
  58. { field: "one_surcharge_money", title: "单层保温金额", operate: false },
  59. { field: "two_surcharge_money", title: "双层保温金额", operate: false },
  60. // {field:"weight",title:"重量(斤)",operate: false},
  61. { field: "consign_time", title: "发货时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  62. // {field:"user_id",title:"录入人",operate: false},
  63. { field: "createtime", title: "创建时间", operate: false, formatter: Yunqi.formatter.datetime },
  64. { field: "updatetime", title: "修改时间", operate: false, formatter: Yunqi.formatter.datetime },
  65. { field: "status",fixed: 'right', title: "状态", operate: "select", searchList: { 1: "无店铺", 2: "无Sku", 3: "正常" }, formatter: Yunqi.formatter.tags },
  66. {
  67. field: 'operate',
  68. fixed: 'right',
  69. title: __('操作'),
  70. width: 150,
  71. action: {
  72. shops: {
  73. tooltip: true,
  74. icon: 'fa fa-certificate',
  75. type: 'success',
  76. text: __('关联店铺'),
  77. method: 'shops',
  78. visible: function (row, index) {
  79. return row.status == 1;
  80. }
  81. },
  82. specs: {
  83. tooltip: true,
  84. icon: 'fa fa-list',
  85. type: 'info',
  86. text: __('关联规格'),
  87. method: 'specs',
  88. visible: function (row, index) {
  89. return row.status == 2;
  90. }
  91. },
  92. // del: true
  93. }
  94. }
  95. ]
  96. },
  97. methods: {
  98. shops: function (row) {
  99. let that = this;
  100. Yunqi.api.open({
  101. url: 'goods/import_list/shops?ids=' + row.shop_id,
  102. width: 1000,
  103. title: __('关联店铺'),
  104. icon: 'fa fa-list',
  105. close: function (r) {
  106. that.$refs.yuntable.reload();
  107. }
  108. });
  109. },
  110. specs: function (row) {
  111. let that = this;
  112. Yunqi.api.open({
  113. url: 'goods/import_list/specs?ids=' + row.id,
  114. width: 1000,
  115. title: __('关联规格'),
  116. icon: 'fa fa-list',
  117. close: function (r) {
  118. if (r) {
  119. that.$refs.yuntable.reload();
  120. }
  121. }
  122. })
  123. },
  124. }
  125. }
  126. </script>
  127. <style>
  128. </style>