index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 departmentList = ref([]);
  42. const sourceList = ref({
  43. data: [],
  44. pagination: {
  45. total: 0,
  46. departmentId: "100",
  47. skuSpecCode: "",
  48. skuSpecName: "",
  49. },
  50. });
  51. const loading = ref(false);
  52. const searchConfig = computed(() => {
  53. return [
  54. {
  55. type: "select",
  56. prop: "departmentId",
  57. data: departmentList.value,
  58. label: "事业部",
  59. },
  60. {
  61. type: "input",
  62. prop: "skuSpecCode",
  63. label: "SKU品号",
  64. },
  65. {
  66. type: "input",
  67. prop: "skuSpecName",
  68. label: "SKU品名",
  69. },
  70. ];
  71. });
  72. const config = computed(() => {
  73. return [
  74. {
  75. attrs: {
  76. label: "品牌",
  77. prop: "brand",
  78. width: 100,
  79. },
  80. },
  81. {
  82. attrs: {
  83. label: "SKU品号",
  84. prop: "skuSpecCode",
  85. width: 140,
  86. },
  87. },
  88. {
  89. attrs: {
  90. label: "SKU品名",
  91. prop: "skuSpecName",
  92. "min-width": 220,
  93. },
  94. },
  95. {
  96. attrs: {
  97. label: "SKU单价(含税)",
  98. slot: "skuPrice",
  99. align: "center",
  100. },
  101. },
  102. {
  103. attrs: {
  104. label: "价格组成",
  105. slot: "priceComposition",
  106. align: "center",
  107. },
  108. },
  109. ];
  110. });
  111. const getDemandData = () => {
  112. proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  113. if (res.rows && res.rows.length > 0) {
  114. departmentList.value = departmentList.value.concat(
  115. res.rows.map((item) => {
  116. return {
  117. dictKey: item.id,
  118. dictValue: item.name,
  119. };
  120. })
  121. );
  122. }
  123. });
  124. };
  125. getDemandData();
  126. const getList = async (req, status) => {
  127. if (status) {
  128. sourceList.value.pagination = {
  129. pageNum: sourceList.value.pagination.pageNum,
  130. pageSize: sourceList.value.pagination.pageSize,
  131. departmentId: "100",
  132. };
  133. } else {
  134. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  135. }
  136. loading.value = true;
  137. proxy.post("/skuSpecQuotationBoard/getSkuSpecQuotationList", sourceList.value.pagination).then((res) => {
  138. sourceList.value.data = res;
  139. setTimeout(() => {
  140. loading.value = false;
  141. }, 200);
  142. });
  143. };
  144. getList();
  145. const clickReset = () => {
  146. getList("", true);
  147. };
  148. const deriveExcel = () => {
  149. ElMessageBox.confirm("你是否确认此操作", "提示", {
  150. confirmButtonText: "确定",
  151. cancelButtonText: "取消",
  152. type: "warning",
  153. })
  154. .then(() => {
  155. proxy.postFile("/skuSpecQuotationBoard/exportExcel", sourceList.value.pagination).then((res) => {
  156. proxy.downloadFile(res, "SKU报价看板.xlsx");
  157. });
  158. })
  159. .catch(() => {});
  160. };
  161. </script>
  162. <style lang="scss" scoped></style>