index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div>
  3. <el-card class="box-card">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :searchConfig="searchConfig"
  10. highlight-current-row
  11. @get-list="getList"
  12. @clickReset="clickReset"
  13. @changeRadioGroup="changeRadioGroup">
  14. </byTable>
  15. </el-card>
  16. <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="94%">
  17. <el-tabs v-model="activeName" class="demo-tabs">
  18. <el-tab-pane label="SKU对账单" name="sku">
  19. <PrintSKU :idGroupConcat="idGroupConcat" @clickCancel="openPrint = false"></PrintSKU>
  20. </el-tab-pane>
  21. <el-tab-pane label="BOM对账单" name="bom">
  22. <PrintBOM :idGroupConcat="idGroupConcat" @clickCancel="openPrint = false"></PrintBOM>
  23. </el-tab-pane>
  24. <el-tab-pane label="订单对账单" name="order">
  25. <PrintOrder :idGroupConcat="idGroupConcat" :activeName="activeName" @clickCancel="openPrint = false"></PrintOrder>
  26. </el-tab-pane>
  27. </el-tabs>
  28. </el-dialog>
  29. </div>
  30. </template>
  31. <script setup>
  32. import byTable from "/src/components/byTable/index";
  33. import PrintSKU from "/src/views/group/finance/summary/printSKU.vue";
  34. import PrintBOM from "/src/views/group/finance/summary/printBOM.vue";
  35. import PrintOrder from "/src/views/group/finance/summary/printOrder.vue";
  36. const { proxy } = getCurrentInstance();
  37. const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
  38. const sourceList = ref({
  39. data: [],
  40. pagination: {
  41. total: 0,
  42. pageNum: 1,
  43. pageSize: 10,
  44. type: 1,
  45. departmentId: "",
  46. beginTime: "",
  47. endTime: "",
  48. },
  49. });
  50. const loading = ref(false);
  51. const searchConfig = computed(() => {
  52. return [
  53. {
  54. type: "radio-group",
  55. prop: "type",
  56. label: "维度",
  57. data: [
  58. {
  59. dictKey: 1,
  60. dictValue: "月度",
  61. },
  62. {
  63. dictKey: 2,
  64. dictValue: "季度",
  65. },
  66. {
  67. dictKey: 3,
  68. dictValue: "年度",
  69. },
  70. ],
  71. },
  72. {
  73. type: "date",
  74. propList: ["beginTime", "endTime"],
  75. label: "日期",
  76. },
  77. {
  78. type: "select",
  79. prop: "departmentId",
  80. data: departmentList.value,
  81. label: "事业部",
  82. },
  83. ];
  84. });
  85. const config = computed(() => {
  86. return [
  87. {
  88. attrs: {
  89. label: "维度",
  90. prop: "dimensionality",
  91. },
  92. },
  93. {
  94. attrs: {
  95. label: "客户",
  96. prop: "departmentName",
  97. },
  98. },
  99. {
  100. attrs: {
  101. label: "对账金额",
  102. prop: "reconcilingAmount",
  103. align: "right",
  104. },
  105. render(val) {
  106. return proxy.moneyFormat(val);
  107. },
  108. },
  109. {
  110. attrs: {
  111. label: "对账单数量",
  112. prop: "quantityOfStatement",
  113. },
  114. },
  115. {
  116. attrs: {
  117. label: "合同数量",
  118. prop: "orderQuantity",
  119. },
  120. },
  121. {
  122. attrs: {
  123. label: "操作",
  124. width: 80,
  125. align: "center",
  126. fixed: "right",
  127. },
  128. renderHTML(row) {
  129. return [
  130. {
  131. attrs: {
  132. label: "打印",
  133. type: "primary",
  134. text: true,
  135. },
  136. el: "button",
  137. click() {
  138. clickPrint(row);
  139. },
  140. },
  141. ];
  142. },
  143. },
  144. ];
  145. });
  146. const getDemandData = () => {
  147. proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  148. if (res.rows && res.rows.length > 0) {
  149. departmentList.value = departmentList.value;
  150. }
  151. });
  152. };
  153. getDemandData();
  154. const getList = async (req, status) => {
  155. if (status) {
  156. sourceList.value.pagination = {
  157. pageNum: sourceList.value.pagination.pageNum,
  158. pageSize: sourceList.value.pagination.pageSize,
  159. };
  160. } else {
  161. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  162. }
  163. if (sourceList.value.pagination.beginTime || sourceList.value.pagination.endTime) {
  164. sourceList.value.pagination.type = 4;
  165. }
  166. loading.value = true;
  167. proxy.post("/statementOfAccountMerge/page", sourceList.value.pagination).then((res) => {
  168. if (res.rows && res.rows.length > 0) {
  169. sourceList.value.data = res.rows.map((item) => {
  170. return {
  171. ...item,
  172. isCheck: true,
  173. };
  174. });
  175. } else {
  176. sourceList.value.data = [];
  177. }
  178. sourceList.value.pagination.total = res.total;
  179. setTimeout(() => {
  180. loading.value = false;
  181. }, 200);
  182. });
  183. };
  184. getList();
  185. const clickReset = () => {
  186. getList("", true);
  187. };
  188. const changeRadioGroup = () => {
  189. getList({ beginTime: "", endTime: "" });
  190. };
  191. const openPrint = ref(false);
  192. const idGroupConcat = ref("");
  193. const activeName = ref("sku");
  194. const clickPrint = (row) => {
  195. activeName.value = "sku";
  196. idGroupConcat.value = row.idGroupConcat;
  197. openPrint.value = true;
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. :deep(.el-dialog) {
  202. margin-top: 10px !important;
  203. margin-bottom: 10px !important;
  204. }
  205. </style>