index.html 7.2 KB

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