index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <el-card class="box-card">
  3. <byTable
  4. :hidePagination="true"
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :searchConfig="searchConfig"
  10. highlight-current-row
  11. :action-list="[
  12. {
  13. text: '导出Excel',
  14. action: () => deriveExcel(),
  15. },
  16. ]"
  17. @get-list="getList"
  18. @clickReset="clickReset">
  19. <template #skuPrice>
  20. <el-table-column label="裸垫" prop="skuSpecUnitPrice" align="center" width="80" />
  21. <el-table-column label="激光logo" prop="skuSpecUnitPriceLogo" align="center" width="100" />
  22. <el-table-column label="激光体位线" prop="skuSpecUnitPriceLine" align="center" width="110" />
  23. </template>
  24. <template #priceComposition>
  25. <el-table-column label="主材" prop="bomSpecUnitPrice" align="center" width="80" />
  26. <el-table-column label="包材配件" prop="packagingMaterialCost" align="center" width="90" />
  27. <el-table-column label="激光logo" prop="logoProcessingFee" align="center" width="100" />
  28. <el-table-column label="激光体位线" prop="lineProcessingFee" align="center" width="110" />
  29. <el-table-column label="代发费" prop="issueFee" align="center" width="80" />
  30. <el-table-column label="快递包材费" prop="deliveryMaterialsFee" align="center" width="100" />
  31. <el-table-column label="包装人工费" prop="packingLabor" align="center" width="100" />
  32. <el-table-column label="管理费" prop="managementFee" align="center" width="80" />
  33. </template>
  34. </byTable>
  35. </el-card>
  36. </template>
  37. <script setup>
  38. import byTable from "/src/components/byTable/index";
  39. import { ElMessageBox } from "element-plus";
  40. const { proxy } = getCurrentInstance();
  41. const sourceList = ref({
  42. data: [],
  43. pagination: {
  44. total: 0,
  45. skuSpecCode: "",
  46. skuSpecName: "",
  47. },
  48. });
  49. const loading = ref(false);
  50. const searchConfig = computed(() => {
  51. return [
  52. {
  53. type: "input",
  54. prop: "skuSpecCode",
  55. label: "SKU品号",
  56. },
  57. {
  58. type: "input",
  59. prop: "skuSpecName",
  60. label: "SKU品名",
  61. },
  62. ];
  63. });
  64. const config = computed(() => {
  65. return [
  66. {
  67. attrs: {
  68. label: "品牌",
  69. prop: "brand",
  70. width: 100,
  71. },
  72. },
  73. {
  74. attrs: {
  75. label: "SKU品号",
  76. prop: "skuSpecCode",
  77. width: 140,
  78. },
  79. },
  80. {
  81. attrs: {
  82. label: "SKU品名",
  83. prop: "skuSpecName",
  84. "min-width": 220,
  85. },
  86. },
  87. {
  88. attrs: {
  89. label: "SKU单价(含税)",
  90. slot: "skuPrice",
  91. align: "center",
  92. },
  93. },
  94. {
  95. attrs: {
  96. label: "价格组成",
  97. slot: "priceComposition",
  98. align: "center",
  99. },
  100. },
  101. ];
  102. });
  103. const getList = async (req, status) => {
  104. if (status) {
  105. sourceList.value.pagination = {
  106. pageNum: sourceList.value.pagination.pageNum,
  107. pageSize: sourceList.value.pagination.pageSize,
  108. };
  109. } else {
  110. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  111. }
  112. loading.value = true;
  113. proxy.post("/skuSpecQuotationBoard/getSkuSpecQuotationList", sourceList.value.pagination).then((res) => {
  114. sourceList.value.data = res;
  115. setTimeout(() => {
  116. loading.value = false;
  117. }, 200);
  118. });
  119. };
  120. getList();
  121. const clickReset = () => {
  122. getList("", true);
  123. };
  124. const deriveExcel = () => {
  125. ElMessageBox.confirm("你是否确认此操作", "提示", {
  126. confirmButtonText: "确定",
  127. cancelButtonText: "取消",
  128. type: "warning",
  129. })
  130. .then(() => {
  131. proxy.postFile("/skuSpecQuotationBoard/exportExcel", sourceList.value.pagination).then((res) => {
  132. proxy.downloadFile(res, "SKU报价看板.xlsx");
  133. });
  134. })
  135. .catch(() => {});
  136. };
  137. </script>
  138. <style lang="scss" scoped></style>