saleOrderSteelCarrier.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <!-- 销售订单页面 -->
  3. <div class="salePlan">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="refresh">
  10. <i class="el-icon-refresh"></i>刷新
  11. </el-button>
  12. </div>
  13. <div class="table">
  14. <mergeRowTable v-bind.sync="option4" ref="table">
  15. <el-table-column fixed="right" label="操作" width="100">
  16. <template slot-scope="scope">
  17. <el-button
  18. @click="steelSendClick(scope.row.saleOrderId)"
  19. type="text"
  20. size="small"
  21. >钢材派车</el-button
  22. >
  23. </template>
  24. </el-table-column>
  25. </mergeRowTable>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import { getCookie } from "@/utils/util.js";
  31. export default {
  32. name: "saleOrder",
  33. data() {
  34. return {
  35. activeName: "four",
  36. drawer: false,
  37. input: "",
  38. index: "",
  39. carrierId: null,
  40. carrierName: null,
  41. option4: {
  42. // 表格请求数据的地址
  43. requestUrl: "",
  44. comparison: "saleNumber",
  45. columnIndexs: [0, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  46. },
  47. mapList: [],
  48. mapItemList: [],
  49. //(销售公司已审批)
  50. tableData: []
  51. };
  52. },
  53. created() {
  54. this.initUrl();
  55. },
  56. methods: {
  57. initUrl() {
  58. if (getCookie("orgCode") == "chengyunshang") {
  59. this.option4.requestUrl =
  60. "/api/v1/ams/getSaleOrderListToCarrier?apiId=467&carrierSsoId=" +
  61. getCookie("userId");
  62. } else {
  63. this.option4.requestUrl =
  64. "/api/v1/ams/getSaleOrderListToCarrier?apiId=467&carrierSsoId=" +
  65. null;
  66. }
  67. },
  68. refresh() {
  69. this.$router.go(0);
  70. },
  71. handleClick(tab, event) {
  72. console.log(tab, event);
  73. },
  74. onclick() {
  75. if (getCookie("orgCode") == "chengyunshang") {
  76. if (this.activeName == "four") {
  77. this.option4.requestUrl =
  78. "/api/v1/ams/getSaleOrderListToCarrier?apiId=467&carrierSsoId=" +
  79. getCookie("userId") +
  80. "&con=" +
  81. this.input;
  82. }
  83. } else {
  84. if (this.activeName == "four") {
  85. this.option4.requestUrl =
  86. "/api/v1/ams/getSaleOrderListToCarrier?apiId=467&con=" +
  87. this.input +
  88. "&carrierSsoId=" +
  89. "";
  90. }
  91. }
  92. },
  93. seeclick(saleOrderId) {
  94. this.$router.push("/saleOrderDetail/" + saleOrderId);
  95. },
  96. steelSendClick(saleOrderId) {
  97. this.$router.push("/addSaleOrderSteelSendCarrier/" + saleOrderId);
  98. },
  99. // -------查看物资详情 (已审批)
  100. detailclick(row) {
  101. // 记录重复点击次数
  102. if (this.oldRow === row) {
  103. this.oldRowCount += 1;
  104. }
  105. // 切换当前详情表
  106. this.$refs.table.toggleRowExpansion(row);
  107. // 打开前关闭上一个详情表
  108. if (this.oldRow != "") {
  109. if (this.oldRow != row) {
  110. if (this.oldRowCount % 2 === 1) {
  111. this.$refs.table.toggleRowExpansion(this.oldRow);
  112. } else {
  113. this.oldRowCount = 1;
  114. }
  115. } else {
  116. this.oldRow = null;
  117. return;
  118. }
  119. }
  120. // 重置上一个点击对象
  121. this.oldRow = row;
  122. // 根据销售订单id查询物资信息
  123. this.axios
  124. .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" + row.saleOrderId)
  125. .then(res => {
  126. this.tableData = res.data.data;
  127. });
  128. }
  129. }
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .salePlan {
  134. .top {
  135. margin-left: 20px;
  136. margin-top: 20px;
  137. .el-input {
  138. width: 20%;
  139. margin-right: 1.25rem;
  140. }
  141. }
  142. .table {
  143. margin-left: 20px;
  144. margin-top: 20px;
  145. }
  146. }
  147. </style>