index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. @changeRadioGroup="changeRadioGroup">
  13. <template #code="{ item }">
  14. <div>
  15. <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
  16. </div>
  17. </template>
  18. <template #address="{ item }">
  19. <div>{{ item.province }}, {{ item.city }}, {{ item.county }}, {{ item.detailedAddress }}</div>
  20. </template>
  21. </byTable>
  22. </el-card>
  23. </template>
  24. <script setup>
  25. import byTable from "/src/components/byTable/index";
  26. import { getNearDays } from "/src/utils/util";
  27. const { proxy } = getCurrentInstance();
  28. const sourceList = ref({
  29. data: [],
  30. pagination: {
  31. total: 0,
  32. pageNum: 1,
  33. pageSize: 10,
  34. orderCode: "",
  35. orderWlnCode: "",
  36. skuSpecCode: "",
  37. skuSpecName: "",
  38. bomSpecCode: "",
  39. bomSpecName: "",
  40. productionWorkOrderCode: "",
  41. beginTime: "",
  42. endTime: "",
  43. type: 3,
  44. },
  45. });
  46. const loading = ref(false);
  47. const searchConfig = computed(() => {
  48. return [
  49. {
  50. type: "input",
  51. prop: "orderCode",
  52. label: "订单号",
  53. },
  54. {
  55. type: "input",
  56. prop: "orderWlnCode",
  57. label: "万里牛单号",
  58. },
  59. {
  60. type: "input",
  61. prop: "skuSpecCode",
  62. label: "SKU品号",
  63. },
  64. {
  65. type: "input",
  66. prop: "skuSpecName",
  67. label: "SKU品名",
  68. },
  69. {
  70. type: "input",
  71. prop: "bomSpecCode",
  72. label: "BOM品号",
  73. },
  74. {
  75. type: "input",
  76. prop: "bomSpecName",
  77. label: "BOM品名",
  78. },
  79. {
  80. type: "input",
  81. prop: "productionWorkOrderCode",
  82. label: "工单号",
  83. },
  84. {
  85. type: "radio-group",
  86. prop: "type",
  87. label: "交期",
  88. data: [
  89. {
  90. dictKey: 1,
  91. dictValue: "近3天",
  92. },
  93. {
  94. dictKey: 3,
  95. dictValue: "近7天",
  96. },
  97. {
  98. dictKey: 15,
  99. dictValue: "近31天",
  100. },
  101. ],
  102. },
  103. {
  104. type: "date",
  105. propList: ["beginTime", "endTime"],
  106. label: "日期",
  107. },
  108. ];
  109. });
  110. const config = computed(() => {
  111. return [
  112. {
  113. attrs: {
  114. label: "订单号",
  115. prop: "orderCode",
  116. width: 180,
  117. },
  118. },
  119. {
  120. attrs: {
  121. label: "万里牛单号",
  122. prop: "orderWlnCode",
  123. width: 150,
  124. },
  125. },
  126. {
  127. attrs: {
  128. label: "SKU品号",
  129. prop: "skuSpecCode",
  130. width: 140,
  131. },
  132. },
  133. {
  134. attrs: {
  135. label: "SKU品名",
  136. prop: "skuSpecName",
  137. 'min-width': 220,
  138. },
  139. },
  140. {
  141. attrs: {
  142. label: "BOM品号",
  143. prop: "bomSpecCode",
  144. width: 140,
  145. },
  146. },
  147. {
  148. attrs: {
  149. label: "BOM品名",
  150. prop: "bomSpecName",
  151. 'min-width': 280,
  152. },
  153. },
  154. {
  155. attrs: {
  156. label: "生产状态",
  157. prop: "status",
  158. width: 100,
  159. },
  160. render(val) {
  161. if (val == 0) {
  162. return "待投产";
  163. }
  164. },
  165. },
  166. // {
  167. // attrs: {
  168. // label: "工艺路线",
  169. // prop: "departmentName",
  170. // width: 120,
  171. // },
  172. // },
  173. // {
  174. // attrs: {
  175. // label: "投产时间",
  176. // prop: "departmentName",
  177. // width: 160,
  178. // align: "center",
  179. // fixed: "right",
  180. // },
  181. // },
  182. {
  183. attrs: {
  184. label: "完成时间",
  185. prop: "completeTime",
  186. width: 160,
  187. align: "center",
  188. fixed: "right",
  189. },
  190. },
  191. // {
  192. // attrs: {
  193. // label: "生产用时",
  194. // prop: "departmentName",
  195. // width: 160,
  196. // align: "center",
  197. // fixed: "right",
  198. // },
  199. // },
  200. ];
  201. });
  202. const getList = async (req, status) => {
  203. if (status) {
  204. sourceList.value.pagination = {
  205. pageNum: sourceList.value.pagination.pageNum,
  206. pageSize: sourceList.value.pagination.pageSize,
  207. type: 3,
  208. beginTime: getNearDays(3).beginTime,
  209. endTime: getNearDays(3).endTime,
  210. };
  211. } else {
  212. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  213. }
  214. loading.value = true;
  215. proxy.post("/productionWorkOrder/page", sourceList.value.pagination).then((res) => {
  216. sourceList.value.data = res.rows;
  217. sourceList.value.pagination.total = res.total;
  218. setTimeout(() => {
  219. loading.value = false;
  220. }, 200);
  221. });
  222. };
  223. getList({ beginTime: getNearDays(3).beginTime, endTime: getNearDays(3).endTime });
  224. const clickReset = () => {
  225. getList("", true);
  226. };
  227. const changeRadioGroup = () => {
  228. getList({ beginTime: getNearDays(sourceList.value.pagination.type).beginTime, endTime: getNearDays(sourceList.value.pagination.type).endTime });
  229. };
  230. const clickCode = (row) => {
  231. proxy.$router.replace({
  232. path: "/addOrder",
  233. query: {
  234. detailId: row.id,
  235. text: "订单详情",
  236. random: proxy.random(),
  237. orderInquiry: true,
  238. },
  239. });
  240. };
  241. </script>
  242. <style lang="scss" scoped>
  243. :deep(.el-dialog) {
  244. margin-top: 10px !important;
  245. margin-bottom: 10px !important;
  246. }
  247. </style>