index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. :defaultExpandAll="true"
  11. :table-events="{
  12. select: selectRow,
  13. 'select-all': selectRow,
  14. }"
  15. :action-list="[
  16. {
  17. text: '拆分包裹',
  18. action: () => clickUnpack(),
  19. },
  20. {
  21. text: '合并订单',
  22. action: () => clickMerge(),
  23. },
  24. {
  25. text: '取消合并',
  26. action: () => clickUnMerge(),
  27. },
  28. {
  29. text: '修改收件信息',
  30. action: () => clickModifyInformation(),
  31. },
  32. {
  33. text: '修改快递',
  34. action: () => clickModifiedExpress(),
  35. },
  36. {
  37. text: '打印快递单',
  38. action: () => clickPrint(),
  39. type: 'warning',
  40. },
  41. {
  42. text: '填写线下快递单号',
  43. action: () => clickFillInExpressCode(),
  44. },
  45. ]"
  46. @get-list="getList"
  47. @clickReset="clickReset">
  48. <template #typeExpand="{ item }">
  49. <div v-html="item.remark"></div>
  50. </template>
  51. <template #code="{ item }">
  52. <div>
  53. <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
  54. </div>
  55. </template>
  56. <template #groupOrderCodeList="{ item }">
  57. <div>
  58. <div v-if="item.groupOrderCodeList && item.groupOrderCodeList.length > 0">{{ item.groupOrderCodeList.join(",") }}</div>
  59. </div>
  60. </template>
  61. </byTable>
  62. </el-card>
  63. </template>
  64. <script setup>
  65. import byTable from "/src/components/byTable/index";
  66. const { proxy } = getCurrentInstance();
  67. const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
  68. const sourceList = ref({
  69. data: [],
  70. pagination: {
  71. total: 0,
  72. pageNum: 1,
  73. pageSize: 10,
  74. code: "",
  75. departmentId: "",
  76. expressDeliveryCode: "",
  77. printStatus: "",
  78. beginTime: "",
  79. endTime: "",
  80. },
  81. });
  82. const loading = ref(false);
  83. const searchConfig = computed(() => {
  84. return [
  85. {
  86. type: "input",
  87. prop: "code",
  88. label: "订单号",
  89. },
  90. {
  91. type: "select",
  92. prop: "departmentId",
  93. data: departmentList.value,
  94. label: "事业部",
  95. },
  96. {
  97. type: "input",
  98. prop: "expressDeliveryCode",
  99. label: "快递单号",
  100. },
  101. {
  102. type: "select",
  103. prop: "printStatus",
  104. data: [
  105. {
  106. dictKey: "1",
  107. dictValue: "是",
  108. },
  109. {
  110. dictKey: "0",
  111. dictValue: "否",
  112. },
  113. ],
  114. label: "打印状态",
  115. },
  116. {
  117. type: "date",
  118. propList: ["beginTime", "endTime"],
  119. label: "交期",
  120. },
  121. ];
  122. });
  123. const config = computed(() => {
  124. return [
  125. {
  126. type: "expand",
  127. attrs: {
  128. label: " ",
  129. slot: "typeExpand",
  130. width: 50,
  131. },
  132. },
  133. {
  134. type: "selection",
  135. attrs: {
  136. checkAtt: "isCheck",
  137. },
  138. },
  139. // {
  140. // attrs: {
  141. // label: "日期",
  142. // slot: "backupDateStr",
  143. // width: 220,
  144. // align: "center",
  145. // },
  146. // },
  147. {
  148. attrs: {
  149. label: "主订单号",
  150. slot: "code",
  151. width: 160,
  152. },
  153. },
  154. {
  155. attrs: {
  156. label: "合并订单号",
  157. slot: "groupOrderCodeList",
  158. width: 160,
  159. },
  160. },
  161. {
  162. attrs: {
  163. label: "合并订单号",
  164. slot: "groupOrderCodeList",
  165. width: 160,
  166. },
  167. },
  168. {
  169. attrs: {
  170. label: "快照时间",
  171. prop: "backupDate",
  172. },
  173. },
  174. ];
  175. });
  176. const getDemandData = () => {
  177. proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  178. if (res.rows && res.rows.length > 0) {
  179. departmentList.value = departmentList.value.concat(
  180. res.rows.map((item) => {
  181. return {
  182. dictKey: item.id,
  183. dictValue: item.name,
  184. };
  185. })
  186. );
  187. }
  188. });
  189. };
  190. getDemandData();
  191. const getList = async (req, status) => {
  192. if (status) {
  193. sourceList.value.pagination = {
  194. pageNum: sourceList.value.pagination.pageNum,
  195. pageSize: sourceList.value.pagination.pageSize,
  196. };
  197. } else {
  198. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  199. }
  200. loading.value = true;
  201. proxy.post("/issueBill/page", sourceList.value.pagination).then((res) => {
  202. if (res.rows && res.rows.length > 0) {
  203. sourceList.value.data = res.rows.map((item) => {
  204. return {
  205. ...item,
  206. isCheck: true,
  207. };
  208. });
  209. } else {
  210. sourceList.value.data = [];
  211. }
  212. sourceList.value.pagination.total = res.total;
  213. setTimeout(() => {
  214. loading.value = false;
  215. }, 200);
  216. });
  217. };
  218. getList();
  219. const clickReset = () => {
  220. getList("", true);
  221. };
  222. const selectData = ref([]);
  223. const selectRow = (data) => {
  224. selectData.value = data;
  225. };
  226. const clickCode = (row) => {
  227. proxy.$router.replace({
  228. path: "/order-detail",
  229. query: {
  230. detailId: row.id,
  231. text: "订单详情",
  232. random: proxy.random(),
  233. },
  234. });
  235. };
  236. </script>
  237. <style lang="scss" scoped></style>