index.html 7.3 KB

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