index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table :columns="columns" ref="yuntable" @render="onTableRender" toolbar="refresh,settlement" :auth="{}"
  4. :extend="extend" :total-arr="totalArr" :is-showtotal="true" @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. {
  40. field: "id",
  41. title: "ID",
  42. operate: false
  43. },
  44. {
  45. field: "shop_id",
  46. title: "店铺ID"
  47. },
  48. {
  49. field: 'type_id',
  50. title: ('打单平台'),
  51. operate: "select",
  52. searchList: {
  53. 1: '风速',
  54. 2: '聚水潭'
  55. },
  56. formatter: function(data, row) {
  57. let tag = Yunqi.formatter.tag;
  58. if (row.type_id == 1) {
  59. tag.value = '风速';
  60. tag.type = 'success';
  61. } else if (row.type_id == 2) {
  62. tag.value = '聚水潭';
  63. tag.type = 'primary';
  64. }
  65. return tag;
  66. }
  67. },
  68. // { field: "trade_from", title: "平台" },
  69. {
  70. field: 'trade_from',
  71. title: __('平台'),
  72. operate: "select",
  73. searchList:Yunqi.data.trade_from_item_list
  74. },
  75. {
  76. field: "province",
  77. title: "省份",
  78. operate: false
  79. },
  80. {
  81. field: "city",
  82. title: "城市",
  83. operate: false
  84. },
  85. {
  86. field: "company_name",
  87. title: "快递名称",
  88. operate: false
  89. },
  90. {
  91. field: "waybill_no",
  92. title: "快递单号"
  93. },
  94. {
  95. field: "order_status",
  96. fixed: 'right',
  97. title: "订单状态",
  98. operate: "select",
  99. searchList: {
  100. 'Sent': "正常",
  101. 'OuterSent': "外部已发货",
  102. 'SentCancelled': "已退款(聚水潭)",
  103. 'TRADE_CLOSED': "已退款(风速)"
  104. },
  105. formatter: function(data, row) {
  106. let tag = Yunqi.formatter.tag;
  107. if (row.order_status == 'OuterSent') {
  108. tag.value = '外部已发货';
  109. tag.type = 'warning';
  110. } else if (row.order_status == 'SentCancelled') {
  111. tag.value = '已退款';
  112. tag.type = 'danger';
  113. } else if (row.order_status == 'TRADE_CLOSED') {
  114. tag.value = '已退款';
  115. tag.type = 'danger';
  116. } else {
  117. tag.value = '正常';
  118. tag.type = 'success';
  119. }
  120. return tag;
  121. }
  122. },
  123. {
  124. field: "goods_title",
  125. title: "产品名称",
  126. width: 300,
  127. align: 'left'
  128. },
  129. {
  130. field: "goods_info",
  131. title: "商品信息",
  132. width: 300,
  133. align: 'left'
  134. },
  135. {
  136. field: "sku_id",
  137. title: "规格id"
  138. },
  139. {
  140. field: "num",
  141. title: "件数",
  142. operate: false
  143. },
  144. {
  145. field: "price",
  146. title: "实付价格",
  147. operate: false
  148. },
  149. {
  150. field: "specs_name",
  151. title: "打包规格",
  152. operate: false
  153. },
  154. {
  155. field: "pack_specs_id",
  156. title: "打包规格id",
  157. operate: false
  158. },
  159. {
  160. field: "labor_cost_money",
  161. title: "工价",
  162. operate: false
  163. },
  164. {
  165. field: "one_surcharge_money",
  166. title: "单层保温金额",
  167. operate: false
  168. },
  169. {
  170. field: "two_surcharge_money",
  171. title: "双层保温金额",
  172. operate: false
  173. },
  174. // {field:"weight",title:"重量(斤)",operate: false},
  175. {
  176. field: "consign_time",
  177. title: "发货时间",
  178. operate: "daterange",
  179. formatter: Yunqi.formatter.datetime,
  180. sortable: true
  181. },
  182. // {field:"user_id",title:"录入人",operate: false},
  183. {
  184. field: "createtime",
  185. title: "创建时间",
  186. operate: false,
  187. formatter: Yunqi.formatter.datetime
  188. },
  189. {
  190. field: "updatetime",
  191. title: "修改时间",
  192. operate: false,
  193. formatter: Yunqi.formatter.datetime
  194. },
  195. {
  196. field: "status",
  197. fixed: 'right',
  198. title: "状态",
  199. operate: "select",
  200. searchList: {
  201. 1: "无店铺",
  202. 2: "无Sku",
  203. 3: "正常"
  204. },
  205. formatter: function(data, row) {
  206. let tag = Yunqi.formatter.tag;
  207. if (row.status == 1) {
  208. tag.value = '无店铺';
  209. tag.type = 'danger';
  210. } else if (row.status == 2) {
  211. tag.value = '无Sku';
  212. tag.type = 'warning';
  213. } else if (row.status == 3) {
  214. tag.value = '正常';
  215. tag.type = 'success';
  216. }
  217. return tag;
  218. }
  219. },
  220. {
  221. field: 'operate',
  222. fixed: 'right',
  223. title: __('操作'),
  224. width: 150,
  225. action: {
  226. shops: {
  227. tooltip: true,
  228. icon: 'fa fa-certificate',
  229. type: 'success',
  230. text: __('关联店铺'),
  231. method: 'shops',
  232. visible: function(row, index) {
  233. return row.status == 1;
  234. }
  235. },
  236. specs: {
  237. tooltip: true,
  238. icon: 'fa fa-list',
  239. type: 'info',
  240. text: __('关联规格'),
  241. method: 'specs',
  242. visible: function(row, index) {
  243. return row.status == 2;
  244. }
  245. },
  246. edit: {
  247. tooltip: true,
  248. icon: 'fa fa-pencil',
  249. type: 'primary',
  250. text: __('修改关联规格,且只能修改当天发货订单'),
  251. method: 'specs',
  252. visible: function(row, index) {
  253. return row.status == 3;
  254. }
  255. },
  256. // del: true
  257. }
  258. }
  259. ],
  260. totalArr: [
  261. ],
  262. },
  263. mounted() {
  264. },
  265. methods: {
  266. handleData(data) {
  267. console.log(data)
  268. this.totalArr = [{
  269. name: "无店铺",
  270. value: data.shops_num
  271. }, {
  272. name: "无Sku",
  273. value: data.specs_num
  274. }]
  275. },
  276. shops: function(row) {
  277. let that = this;
  278. Yunqi.api.open({
  279. url: 'goods/import_list/shops?ids=' + row.shop_id,
  280. width: 1000,
  281. title: __('关联店铺'),
  282. icon: 'fa fa-list',
  283. close: function(r) {
  284. that.$refs.yuntable.reload();
  285. }
  286. });
  287. },
  288. specs: function(row) {
  289. let that = this;
  290. Yunqi.api.open({
  291. url: 'goods/import_list/specs?ids=' + row.id,
  292. width: 1000,
  293. title: __('关联规格'),
  294. icon: 'fa fa-list',
  295. close: function(r) {
  296. if (r) {
  297. that.$refs.yuntable.reload();
  298. }
  299. }
  300. })
  301. },
  302. set_jushuitan: function(row) {
  303. let that = this;
  304. Yunqi.api.open({
  305. url: 'goods/import_list/set_jushuitan',
  306. width: 1000,
  307. title: __('聚水潭同步数据设置'),
  308. icon: 'fa fa-cog',
  309. close: function(r) {
  310. that.$refs.yuntable.reload();
  311. }
  312. });
  313. },
  314. set_fengsu: function(row) {
  315. let that = this;
  316. Yunqi.api.open({
  317. url: 'goods/import_list/set_fengsu',
  318. width: 1000,
  319. title: __('风速同步数据设置'),
  320. icon: 'fa fa-cog',
  321. close: function(r) {
  322. that.$refs.yuntable.reload();
  323. }
  324. });
  325. },
  326. },
  327. onLoad: function(query) {
  328. }
  329. }
  330. </script>
  331. <style>
  332. </style>