child-list.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="outOrderTable">
  3. <el-table
  4. ref="addrForm"
  5. :data="tableData"
  6. border
  7. :size="'mini'"
  8. style="width: 100%"
  9. row-key="key"
  10. @selection-change="handleSelectionChange"
  11. >
  12. <!-- <el-table-column type="selection" width="42"> </el-table-column> -->
  13. <el-table-column
  14. show-overflow-tooltip
  15. prop="outChildCode"
  16. label="发货工单编号"
  17. width="160"
  18. />
  19. <el-table-column
  20. show-overflow-tooltip
  21. prop="outCode"
  22. label="发货单编号"
  23. width="160"
  24. />
  25. <el-table-column
  26. show-overflow-tooltip
  27. prop="orderCode"
  28. label="确认单编号"
  29. width="160"
  30. />
  31. <el-table-column show-overflow-tooltip prop="send_status" label="状态" width="105">
  32. <template slot-scope="scope">
  33. <el-tag
  34. :size="tablebtnSize"
  35. :type="scope.row.status == '0' ? 'warning' : ''"
  36. v-text="
  37. (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
  38. '--'
  39. "
  40. ></el-tag>
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. show-overflow-tooltip
  45. prop="num"
  46. label="发货数量"
  47. width="80"
  48. />
  49. <el-table-column show-overflow-tooltip prop="post_code" label="物流单号" min-width="160" />
  50. <el-table-column show-overflow-tooltip prop="post_name" label="物流公司" min-width="160" />
  51. <el-table-column show-overflow-tooltip prop="wsm_name" label="仓库名称" min-width="160" />
  52. <el-table-column show-overflow-tooltip prop="wsm_code" label="仓库编号" min-width="160" />
  53. <el-table-column show-overflow-tooltip prop="addtime" label="下单时间" width="140" />
  54. <el-table-column show-overflow-tooltip prop="apply_name" label="申请人" width="110" />
  55. <el-table-column label="操作">
  56. <template slot-scope="scope">
  57. <el-tooltip
  58. effect="dark"
  59. content="查看"
  60. placement="top"
  61. v-if="powers.some((i) => i == '007')"
  62. >
  63. <i
  64. class="el-icon-view tb-icon"
  65. @click="routeGoto('supplierDeliveryWorkOrderDetail', { id: scope.row.outChildCode })"
  66. ></i>
  67. </el-tooltip>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <div
  72. v-if="tableData && tableData.length > 0"
  73. class="Pagination"
  74. style="text-align: right; margin-top: 10px"
  75. >
  76. <el-pagination
  77. :current-page="parmValue.page"
  78. :page-size="parmValue.size"
  79. :size="'mini'"
  80. layout="total, prev, pager, next, jumper"
  81. :total="pageInfo.total"
  82. @size-change="page_size_change"
  83. @current-change="page_curr_change"
  84. />
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import mixinPage from "@/mixins/elPaginationHandle";
  90. import resToken from "@/mixins/resToken";
  91. import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
  92. import { mapGetters } from "vuex";
  93. export default {
  94. name: "salesOrderDetail",
  95. mixins: [mixinPage, resToken],
  96. props: ["newTime", "id", "sitem"],
  97. watch: {
  98. newTime: function (val) {
  99. if (val) {
  100. this.initForm();
  101. }
  102. },
  103. },
  104. computed: {
  105. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  106. powers() {
  107. const tran =
  108. this.$store.getters.btnList.find(
  109. (item) => item.menu_route == "supplierDeliveryWorkOrder"
  110. ) || {};
  111. const { action } = tran ?? {};
  112. return action ?? [];
  113. }
  114. },
  115. data() {
  116. return {
  117. orderCode: "",
  118. outCode: "",
  119. addr_res: 0,
  120. batch_num: 0,
  121. addrmodel: false,
  122. // 状态
  123. statusOptions: [
  124. { id: "1", label: "待发货" },
  125. { id: "2", label: "发货完成" },
  126. { id: "3", label: "已收货" },
  127. { id: "4", label: "已全部退货" },
  128. ],
  129. showGoodsModel: false,
  130. stock_code: "",
  131. tableData: [],
  132. loading: false,
  133. queryId: "",
  134. status: "",
  135. showModel: null,
  136. modelId: "",
  137. modelItem: null,
  138. s_sitem: null,
  139. returnId: "",
  140. returnItem: null,
  141. returnModel: false,
  142. wsend_num: "",
  143. orderCode: "",
  144. returnAllId: "",
  145. returnAllSitem: null,
  146. returnAllShowModel: false,
  147. parmValue: {},
  148. pageInfo: {
  149. size: 15,
  150. curr: 1,
  151. total: 0,
  152. },
  153. multipleSelection: [],
  154. resModel: null,
  155. };
  156. },
  157. watch:{
  158. sitem:{
  159. handler(){
  160. if(!this.sitem) return
  161. this.initForm();
  162. },
  163. immediate:true
  164. }
  165. },
  166. methods: {
  167. handleSelectionChange(val) {
  168. this.multipleSelection = val;
  169. },
  170. closeModel() {
  171. this.modelId = "";
  172. this.modelShowModel = false;
  173. },
  174. refresh() {
  175. this.$emit("refresh");
  176. this.modelId = "";
  177. this.modelShowModel = false;
  178. },
  179. async initForm() {
  180. this.status = "";
  181. this.queryId = this.$route.query.id;
  182. // this.rulesThis = this.rules;
  183. this.resetForm();
  184. },
  185. async resetForm() {
  186. // 重置
  187. await this.$nextTick(async () => {
  188. await this.searchList();
  189. });
  190. },
  191. // 列表搜索
  192. async searchList() {
  193. const { code, data } = await asyncRequest.child_list({outCode: this.sitem.outCode});
  194. if (code === 0) {
  195. this.tableData = data;
  196. } else if (code >= 100 && code <= 104) {
  197. await this.logout();
  198. } else {
  199. this.tableData = [];
  200. this.pageInfo.total = 0;
  201. }
  202. this.loading = false;
  203. },
  204. },
  205. };
  206. </script>
  207. <style lang="scss" scoped></style>