index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <el-card class="box-card">
  3. <byTable
  4. :source="sourceList.data"
  5. :pagination="sourceList.pagination"
  6. :config="config"
  7. :loading="loading"
  8. :searchConfig="searchConfig"
  9. highlight-current-row
  10. @get-list="getList"
  11. @clickReset="clickReset">
  12. </byTable>
  13. </el-card>
  14. </template>
  15. <script setup name="Draft-design-management">
  16. import byTable from "/src/components/byTable/index";
  17. const { proxy } = getCurrentInstance();
  18. const statusList = ref([
  19. {
  20. dictKey: 0,
  21. dictValue: "待制作",
  22. },
  23. {
  24. dictKey: 1,
  25. dictValue: "待确认",
  26. },
  27. {
  28. dictKey: 2,
  29. dictValue: "已驳回",
  30. },
  31. {
  32. dictKey: 3,
  33. dictValue: "已确认",
  34. },
  35. ]);
  36. const sourceList = ref({
  37. data: [],
  38. pagination: {
  39. total: 0,
  40. pageNum: 1,
  41. pageSize: 10,
  42. status: "",
  43. },
  44. });
  45. const loading = ref(false);
  46. const searchConfig = computed(() => {
  47. return [
  48. {
  49. type: "select",
  50. prop: "status",
  51. label: "图稿状态",
  52. data: statusList.value,
  53. },
  54. ];
  55. });
  56. const config = computed(() => {
  57. return [
  58. {
  59. attrs: {
  60. label: "订单号",
  61. prop: "orderCode",
  62. },
  63. },
  64. {
  65. attrs: {
  66. label: "图稿状态",
  67. prop: "status",
  68. },
  69. render(val) {
  70. return proxy.dictKeyValue(val, statusList.value);
  71. },
  72. },
  73. {
  74. attrs: {
  75. label: "SKU品号",
  76. prop: "skuSpecCode",
  77. },
  78. },
  79. {
  80. attrs: {
  81. label: "主材品号",
  82. prop: "bomSpecCode",
  83. },
  84. },
  85. {
  86. attrs: {
  87. label: "下单时间",
  88. prop: "orderCreateTime",
  89. },
  90. },
  91. {
  92. attrs: {
  93. label: "图稿确认时间",
  94. prop: "artworkConfirmTime",
  95. },
  96. },
  97. {
  98. attrs: {
  99. label: "操作",
  100. width: 120,
  101. align: "center",
  102. fixed: "right",
  103. },
  104. renderHTML(row) {
  105. return [
  106. {
  107. attrs: {
  108. label: "详情",
  109. type: "primary",
  110. text: true,
  111. },
  112. el: "button",
  113. click() {
  114. clickDetail(row);
  115. },
  116. },
  117. ];
  118. },
  119. },
  120. ];
  121. });
  122. const getList = async (req, status) => {
  123. if (status) {
  124. sourceList.value.pagination = {
  125. pageNum: sourceList.value.pagination.pageNum,
  126. pageSize: sourceList.value.pagination.pageSize,
  127. };
  128. } else {
  129. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  130. }
  131. loading.value = true;
  132. proxy.post("/orderSkuArtworkMake/page", sourceList.value.pagination).then((res) => {
  133. sourceList.value.data = res.rows;
  134. sourceList.value.pagination.total = res.total;
  135. setTimeout(() => {
  136. loading.value = false;
  137. }, 200);
  138. });
  139. };
  140. getList();
  141. const clickReset = () => {
  142. getList("", true);
  143. };
  144. const clickDetail = (row) => {
  145. proxy.$router.replace({
  146. path: "/draft-design-drawing",
  147. query: {
  148. id: row.id,
  149. random: proxy.random(),
  150. },
  151. });
  152. };
  153. </script>
  154. <style lang="scss" scoped>
  155. ::v-deep(.el-input-number .el-input__inner) {
  156. text-align: left;
  157. }
  158. </style>