index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="pageIndexClass">
  3. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
  4. highlight-current-row @get-list="getList">
  5. <template #code="{ item }">
  6. <div v-if="Number(item.sumPayMoney) > Number(item.amount)" style="cursor: pointer; color: #f54a45" @click="handleClickCode(item)">
  7. {{ item.code }}
  8. </div>
  9. <div v-else style="cursor: pointer; color: #409eff" @click="handleClickCode(item)">
  10. {{ item.code }}
  11. </div>
  12. </template>
  13. </byTable>
  14. </div>
  15. </template>
  16. <script setup>
  17. import byTable from "@/components/byTable/index";
  18. const { proxy } = getCurrentInstance();
  19. const payStatus = ref([
  20. {
  21. label: "未付款",
  22. value: 0,
  23. },
  24. {
  25. label: "部分付款",
  26. value: 10,
  27. },
  28. {
  29. label: "已付款",
  30. value: 20,
  31. },
  32. ]);
  33. const sourceList = ref({
  34. data: [],
  35. pagination: {
  36. total: 0,
  37. pageNum: 1,
  38. pageSize: 10,
  39. keyword: "",
  40. status: "",
  41. payStatus: "",
  42. },
  43. });
  44. const loading = ref(false);
  45. const selectConfig = computed(() => {
  46. return [];
  47. });
  48. const config = computed(() => {
  49. return [
  50. {
  51. attrs: {
  52. label: "订单类型",
  53. prop: "a",
  54. width: 130,
  55. },
  56. },
  57. {
  58. attrs: {
  59. label: "订单号",
  60. prop: "code",
  61. width: 180,
  62. },
  63. },
  64. {
  65. attrs: {
  66. label: "业务公司",
  67. prop: "b",
  68. width: 140,
  69. },
  70. },
  71. {
  72. attrs: {
  73. label: "业务部门",
  74. prop: "c",
  75. width: 140,
  76. },
  77. },
  78. {
  79. attrs: {
  80. label: "工厂",
  81. prop: "userName",
  82. width: 140,
  83. },
  84. },
  85. {
  86. attrs: {
  87. label: "订单归属",
  88. prop: "d",
  89. width: 140,
  90. },
  91. },
  92. {
  93. attrs: {
  94. label: "订单金额",
  95. prop: "amount",
  96. width: 140,
  97. },
  98. },
  99. {
  100. attrs: {
  101. label: "下单时间",
  102. prop: "createTime",
  103. width: 160,
  104. },
  105. },
  106. {
  107. attrs: {
  108. label: "交期",
  109. prop: "e",
  110. width: 140,
  111. },
  112. },
  113. {
  114. attrs: {
  115. label: "完工入库时间",
  116. prop: "createTime",
  117. width: 160,
  118. },
  119. },
  120. {
  121. attrs: {
  122. label: "出货时间",
  123. prop: "f",
  124. width: 140,
  125. },
  126. },
  127. {
  128. attrs: {
  129. label: "出货间隔时间",
  130. prop: "g",
  131. width: 140,
  132. },
  133. },
  134. {
  135. attrs: {
  136. label: "出货不及时率",
  137. prop: "h",
  138. width: 140,
  139. },
  140. },
  141. ];
  142. });
  143. const getList = async (req) => {
  144. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  145. loading.value = true;
  146. proxy.post("/ehsdPurchase/page", sourceList.value.pagination).then((res) => {
  147. console.log(res);
  148. sourceList.value.data = res.rows.map((x) => ({
  149. ...x,
  150. a: "常规订单",
  151. b: "三梵实业",
  152. c: "业务部",
  153. d: "三梵体育",
  154. e: "2024-02-15",
  155. f: "2024-02-14",
  156. g: "10",
  157. h: "10%",
  158. }));
  159. sourceList.value.pagination.total = res.total;
  160. setTimeout(() => {
  161. loading.value = false;
  162. }, 200);
  163. });
  164. };
  165. getList();
  166. </script>
  167. <style lang="scss" scoped>
  168. </style>