order-out-table.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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="outCode"
  16. label="发货申请单号"
  17. width="160"
  18. />
  19. <el-table-column show-overflow-tooltip prop="send_status" label="状态" width="105">
  20. <template slot-scope="scope">
  21. <el-tag
  22. :size="tablebtnSize"
  23. :type="scope.row.status == '0' ? 'warning' : ''"
  24. v-text="
  25. (statusOptions.find((item) => item.id == scope.row.status) || {}).label ||
  26. '--'
  27. "
  28. ></el-tag>
  29. </template>
  30. </el-table-column>
  31. <el-table-column
  32. show-overflow-tooltip
  33. prop="send_num"
  34. label="发货数量"
  35. width="80"
  36. />
  37. <el-table-column show-overflow-tooltip prop="contactor" label="联系人" width="80" />
  38. <el-table-column show-overflow-tooltip prop="mobile" label="联系电话" width="110" />
  39. <el-table-column show-overflow-tooltip prop="addr" label="收货地址" min-width="170">
  40. <template slot-scope="scope">
  41. {{ scope.row.addr_info }}{{ scope.row.addr }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column
  45. show-overflow-tooltip
  46. prop="post_name"
  47. label="物流公司"
  48. width="160"
  49. />
  50. <el-table-column
  51. show-overflow-tooltip
  52. prop="post_code"
  53. label="物流单号"
  54. width="160"
  55. />
  56. <el-table-column
  57. show-overflow-tooltip
  58. prop="sendtime"
  59. label="发货时间"
  60. width="145"
  61. />
  62. </el-table>
  63. <div
  64. v-if="tableData && tableData.length > 0"
  65. class="Pagination"
  66. style="text-align: right; margin-top: 10px"
  67. >
  68. <el-pagination
  69. :current-page="parmValue.page"
  70. :page-size="parmValue.size"
  71. :size="'mini'"
  72. layout="total, prev, pager, next, jumper"
  73. :total="pageInfo.total"
  74. @size-change="page_size_change"
  75. @current-change="page_curr_change"
  76. />
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import mixinPage from "@/mixins/elPaginationHandle";
  82. import resToken from "@/mixins/resToken";
  83. import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
  84. import { mapGetters } from "vuex";
  85. export default {
  86. name: "salesOrderDetail",
  87. mixins: [mixinPage, resToken],
  88. props: ["newTime", "id"],
  89. watch: {
  90. newTime: function (val) {
  91. if (val) {
  92. this.initForm();
  93. }
  94. },
  95. },
  96. computed: {
  97. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  98. powers() {
  99. const tran =
  100. this.$store.getters.btnList.find(
  101. (item) => item.menu_route == "salesOrderDetail"
  102. ) || {};
  103. const { action } = tran ?? {};
  104. return action ?? [];
  105. },
  106. },
  107. data() {
  108. return {
  109. orderCode: "",
  110. outCode: "",
  111. addr_res: 0,
  112. batch_num: 0,
  113. addrmodel: false,
  114. // 状态
  115. statusOptions: [
  116. { id: "0", label: "待公司采购" },
  117. { id: "1", label: "待库管发货" },
  118. { id: "2", label: "已发货待收货" },
  119. { id: "3", label: "已收货" },
  120. { id: "4", label: "已全部退货" },
  121. ],
  122. showGoodsModel: false,
  123. stock_code: "",
  124. tableData: [],
  125. loading: false,
  126. queryId: "",
  127. status: "",
  128. showModel: null,
  129. modelId: "",
  130. modelItem: null,
  131. s_sitem: null,
  132. returnId: "",
  133. returnItem: null,
  134. returnModel: false,
  135. wsend_num: "",
  136. orderCode: "",
  137. returnAllId: "",
  138. returnAllSitem: null,
  139. returnAllShowModel: false,
  140. parmValue: {
  141. order_type: "",
  142. orderCode: "",
  143. apply_name: "", //申请人名称
  144. cgdNo: "",
  145. start: "",
  146. end: "",
  147. // supplierNo: "",
  148. companyNo: "",
  149. good_code: "",
  150. good_name: "",
  151. outCode: "",
  152. status: "",
  153. company_name: "", //申请人部门
  154. page: 1, // 页码
  155. size: 15, // 每页显示条数
  156. },
  157. pageInfo: {
  158. size: 15,
  159. curr: 1,
  160. total: 0,
  161. },
  162. multipleSelection: [],
  163. resModel: null,
  164. };
  165. },
  166. mounted() {
  167. this.initForm();
  168. },
  169. methods: {
  170. handleSelectionChange(val) {
  171. this.multipleSelection = val;
  172. },
  173. closeModel() {
  174. this.modelId = "";
  175. this.modelShowModel = false;
  176. },
  177. refresh() {
  178. this.$emit("refresh");
  179. this.modelId = "";
  180. this.modelShowModel = false;
  181. },
  182. async initForm() {
  183. this.status = "";
  184. this.queryId = this.$route.query.id;
  185. // this.rulesThis = this.rules;
  186. this.resetForm();
  187. },
  188. async resetForm() {
  189. // 重置
  190. await this.$nextTick(async () => {
  191. await this.searchList();
  192. });
  193. },
  194. // 列表搜索
  195. async searchList() {
  196. this.parmValue.orderCode = this.id;
  197. const { code, data, message } = await asyncRequest.orderOut(this.parmValue);
  198. if (code === 0) {
  199. const { list, count } = data;
  200. this.tableData = list;
  201. this.pageInfo.total = Number(count);
  202. this.batch_num = 0;
  203. this.tableData.forEach((v) => {
  204. v.good_class = "";
  205. if (v.can && v.can.length > 0) {
  206. v.can.forEach((x, i) => {
  207. v.good_class += i === 0 ? x.name : "/" + x.name;
  208. });
  209. }
  210. if (v.status + "" === "0" || v.status + "" === "1") {
  211. this.batch_num += parseInt(v.send_num + "");
  212. }
  213. });
  214. } else if (code >= 100 && code <= 104) {
  215. await this.logout();
  216. } else {
  217. this.tableData = [];
  218. this.pageInfo.total = 0;
  219. }
  220. this.loading = false;
  221. },
  222. async page_size_change(e) {
  223. this.parmValue.size = e;
  224. this.pageInfo.size = e;
  225. this.parmValue.page = 1;
  226. this.pageInfo.curr = 1;
  227. await this.searchList();
  228. },
  229. async page_curr_change(e) {
  230. this.parmValue.page = e;
  231. this.pageInfo.curr = e;
  232. await this.searchList();
  233. },
  234. },
  235. };
  236. </script>
  237. <style lang="scss" scoped></style>