index.html 9.8 KB

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