index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <van-nav-bar :title="'入库多货明细'" left-text="" left-arrow @click-left="onClickLeft">
  3. <!-- <template #right> 添加 </template> -->
  4. </van-nav-bar>
  5. <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
  6. <van-pull-refresh v-model="loading" @refresh="onRefresh">
  7. <div class="list">
  8. <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="onLoad" style="margin-bottom: 60px">
  9. <commonList :data="listData" @onClick="toDtl" :config="listConfig" :showMore="false">
  10. <template #businessType="{row}">
  11. <div style="width:100%">
  12. {{dictValueLabel(row.businessType,businessType)}}
  13. </div>
  14. </template>
  15. <template #logistics="{row}">
  16. <div style="width:100%">
  17. {{ row.logisticsCompanyName }} (
  18. <span style="cursor: pointer; color: #409eff"> {{ row.logisticsCode }} </span>
  19. )
  20. </div>
  21. </template>
  22. <template #processingMethod="{row}">
  23. <div style="width:100%">
  24. <span> {{dictValueLabel(row.processingMethod,statusData)}}</span>
  25. </div>
  26. </template>
  27. </commonList>
  28. <div></div>
  29. </van-list>
  30. </div>
  31. </van-pull-refresh>
  32. </template>
  33. <script setup>
  34. import { ref, getCurrentInstance, onMounted } from "vue";
  35. import commonList from "@/components/common-list.vue";
  36. import { useRoute } from "vue-router";
  37. import { showSuccessToast, showConfirmDialog } from "vant";
  38. const loading = ref(false);
  39. const router = useRoute();
  40. const req = ref({
  41. pageNum: 1,
  42. keyword: null,
  43. });
  44. const finished = ref(false);
  45. const proxy = getCurrentInstance().proxy;
  46. const listData = ref([]);
  47. const listConfig = ref([
  48. {
  49. label: "入库单",
  50. prop: "businessCode",
  51. },
  52. {
  53. type: "slot",
  54. slotName: "logistics",
  55. label: "物流/快递信息",
  56. },
  57. {
  58. label: "物品编码",
  59. prop: "productCustomCode",
  60. },
  61. {
  62. label: "物品名称",
  63. prop: "productName",
  64. },
  65. {
  66. label: "物品规格",
  67. prop: "productSpec",
  68. },
  69. {
  70. label: "数量",
  71. prop: "quantity",
  72. },
  73. {
  74. type: "slot",
  75. slotName: "processingMethod",
  76. label: "处理结果",
  77. },
  78. ]);
  79. const onRefresh = () => {
  80. req.value.pageNum = 1;
  81. finished.value = false;
  82. getList("refresh");
  83. };
  84. const onLoad = () => {
  85. getList();
  86. };
  87. const onClickLeft = () => proxy.$router.push("/main/working");
  88. const onClickRight = () => {
  89. proxy.$router.push("/main/manualInboundAdd");
  90. };
  91. const toDtl = (row) => {
  92. return;
  93. proxy.$router.push({
  94. path: "waitInboundAdd",
  95. query: {
  96. id: row.id,
  97. },
  98. });
  99. };
  100. const businessType = ref([
  101. { label: "线边回仓", value: "1" },
  102. { label: "完工入库", value: "2" },
  103. { label: "采购到货", value: "3" },
  104. { label: "退货出库", value: "4" },
  105. ]);
  106. const statusData = ref([
  107. {
  108. label: "未处理",
  109. value: "0",
  110. },
  111. {
  112. label: "退货",
  113. value: "10",
  114. },
  115. {
  116. label: "入库",
  117. value: "20",
  118. },
  119. {
  120. label: "申购",
  121. value: "30",
  122. },
  123. ]);
  124. const getList = (type) => {
  125. loading.value = true;
  126. proxy
  127. .post("/excessGoodsDetails/page", req.value)
  128. .then((res) => {
  129. // res.data.rows = res.data.rows.map((x) => ({
  130. // ...x,
  131. // ...JSON.parse(x.victoriatouristJson),
  132. // }));
  133. listData.value =
  134. type === "refresh"
  135. ? res.data.rows
  136. : listData.value.concat(res.data.rows);
  137. if (req.value.pageNum * 10 >= res.data.total) {
  138. finished.value = true;
  139. }
  140. req.value.pageNum++;
  141. loading.value = false;
  142. })
  143. .catch((err) => {
  144. loading.value = false;
  145. });
  146. };
  147. getList();
  148. const handleEndInbound = (row) => {
  149. showConfirmDialog({
  150. title: "提示",
  151. message: `您确定结束入库吗?`,
  152. })
  153. .then(() => {
  154. proxy
  155. .post("/stockWait/endInStock", {
  156. id: row.id,
  157. })
  158. .then((res) => {
  159. showSuccessToast("操作成功");
  160. onRefresh();
  161. });
  162. })
  163. .catch(() => {
  164. return;
  165. });
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. .list {
  170. min-height: 70vh;
  171. }
  172. .aa {
  173. background: #fa9841;
  174. border-radius: 2px;
  175. color: #fff;
  176. padding: 4px;
  177. }
  178. </style>