order-out-table.vue 7.0 KB

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