saleOrderSteelCar.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. <el-dialog
  14. title="承运商信息"
  15. :visible.sync="dialogTableVisible"
  16. :before-close="handleClose"
  17. >
  18. <el-input style="width: 250px" v-model="carrierText"></el-input>
  19. <el-button type="primary" @click="getCarrier">查询</el-button>
  20. <dilTable
  21. v-bind.sync="carrierOption"
  22. @radio-change="currentRadioChange1"
  23. ></dilTable>
  24. <span slot="footer" class="dialog-footer">
  25. <el-button @click="dialogTableVisible = false">取 消</el-button>
  26. <el-button type="primary" @click="updateTruckCapacity()"
  27. >确 定</el-button
  28. >
  29. </span>
  30. </el-dialog>
  31. <div class="table">
  32. <el-tabs v-model="activeName" @tab-click="handleClick">
  33. <!-- 未授权 -->
  34. <el-tab-pane label="未授权" name="four">
  35. <mergeRowTable v-bind.sync="option4" ref="table">
  36. <el-table-column fixed="right" label="操作" width="180">
  37. <template slot-scope="scope">
  38. <el-button
  39. @click="empowerCarrierClick(scope.row.saleOrderMaterialId)"
  40. type="text"
  41. size="small"
  42. >授权承运商</el-button
  43. >
  44. <el-button
  45. @click="steelSendClick(scope.row.saleOrderMaterialId)"
  46. type="text"
  47. size="small"
  48. >钢材派车</el-button
  49. >
  50. </template>
  51. </el-table-column>
  52. </mergeRowTable>
  53. </el-tab-pane>
  54. <!-- 未派车 -->
  55. <el-tab-pane label="未派车" name="five">
  56. <mergeRowTable v-bind.sync="option0" ref="table0">
  57. <el-table-column fixed="right" label="操作" width="160">
  58. <template slot-scope="scope">
  59. <el-button
  60. @click="updateCarrier(scope)"
  61. type="text"
  62. size="small"
  63. >修改承运商授权</el-button
  64. >
  65. </template>
  66. </el-table-column>
  67. </mergeRowTable>
  68. </el-tab-pane>
  69. <!-- 已派车 -->
  70. <el-tab-pane label="已派车" name="first">
  71. <mergeRowTable v-bind.sync="option" ref="table3"> </mergeRowTable>
  72. </el-tab-pane>
  73. </el-tabs>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. export default {
  79. name: "saleOrder",
  80. data() {
  81. return {
  82. carrierText: null,
  83. dialogTableVisible: false,
  84. activeName: "four",
  85. drawer: false,
  86. input: "",
  87. index: "",
  88. carrierId: null,
  89. carrierName: null,
  90. option: {
  91. // 表格请求数据的地址
  92. requestUrl: "/api/v1/ams/getHaveCarTruckNoList?apiId=466",
  93. comparison: "saleOrderMaterialId",
  94. columnIndexs: [0, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  95. },
  96. option2: {
  97. // 表格请求数据的地址
  98. requestUrl: "/api/v1/ams/getSaleOrderReportedes?apiId=408"
  99. },
  100. option3: {
  101. // 表格请求数据的地址
  102. requestUrl: "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409"
  103. },
  104. option4: {
  105. // 表格请求数据的地址
  106. requestUrl: "/api/v1/ams/getSteelTruckNoList?apiId=411",
  107. comparison: "saleOrderMaterialId",
  108. columnIndexs: [0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15]
  109. },
  110. option0: {
  111. // 表格请求数据的地址
  112. requestUrl: "/api/v1/ams/getNoCarTruckNoList?apiId=466",
  113. comparison: "saleOrderMaterialId",
  114. columnIndexs: [0, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, 14, 15]
  115. },
  116. carrierOption: {
  117. requestUrl: "/api/v1/uc/getCarrierListByLike?apiId=412",
  118. selectionType: "radio"
  119. },
  120. mapList: [],
  121. mapItemList: []
  122. };
  123. },
  124. methods: {
  125. getRequestUrl() {
  126. this.option.requestUrl =
  127. "/api/v1/ams/getHaveCarTruckNoList?apiId=466&i=" + new Date();
  128. this.option4.requestUrl =
  129. "/api/v1/ams/getSteelTruckNoList?apiId=411&i=" + new Date();
  130. this.option0.requestUrl =
  131. "/api/v1/ams/getNoCarTruckNoList?apiId=466&i=" + new Date();
  132. },
  133. handleClose() {},
  134. updateCarrier(scope) {
  135. // console.log(scope.row);
  136. this.saleOrderMaterialId = scope.row.saleOrderMaterialId;
  137. this.dialogTableVisible = true;
  138. },
  139. currentRadioChange1(row) {
  140. console.log(row);
  141. this.carrierId = row.carrierId;
  142. },
  143. getCarrier() {
  144. this.carrierOption.requestUrl =
  145. "/api/v1/uc/getCarrierListByLike?apiId=412&index=" + this.carrierText;
  146. },
  147. //修改承运商授权
  148. updateTruckCapacity() {
  149. let map = {
  150. carrierId: this.carrierId,
  151. saleOrderMaterialId: this.saleOrderMaterialId
  152. };
  153. this.axios.post("/api/v1/ams/updateTruckNoCarrier", map).then(res => {
  154. if (res.data.code == "200") {
  155. this.$message.success("修改授权成功");
  156. this.getRequestUrl();
  157. this.dialogTableVisible = false;
  158. }
  159. });
  160. },
  161. refresh() {
  162. this.getRequestUrl();
  163. },
  164. handleClick(tab, event) {
  165. console.log(tab, event);
  166. },
  167. onclick() {
  168. if (this.activeName == "four") {
  169. this.option4.requestUrl =
  170. "/api/v1/ams/getSteelTruckNoList?apiId=411&con=" + this.input;
  171. // console.log("aaaa" + this.input);
  172. } else if (this.activeName == "five") {
  173. this.option0.requestUrl =
  174. "/api/v1/ams/getNoCarTruckNoList?apiId=466&con=" + this.input;
  175. } else if (this.activeName == "first") {
  176. this.option.requestUrl =
  177. "/api/v1/ams/getHaveCarTruckNoList?apiId=466&con=" + this.input;
  178. }
  179. },
  180. seeclick(saleOrderId) {
  181. this.$router.push("/saleOrderDetail/" + saleOrderId);
  182. },
  183. empowerCarrierClick(saleOrderMaterialId) {
  184. this.$router.push("/saleOrderSteelEmpower/" + saleOrderMaterialId);
  185. },
  186. steelSendClick(saleOrderMaterialId) {
  187. this.$router.push("/addSaleOrderSteelSend/" + saleOrderMaterialId);
  188. },
  189. // -------查看物资详情 (已审批)
  190. detailclick(row) {
  191. // 记录重复点击次数
  192. if (this.oldRow === row) {
  193. this.oldRowCount += 1;
  194. }
  195. // 切换当前详情表
  196. this.$refs.table.toggleRowExpansion(row);
  197. // 打开前关闭上一个详情表
  198. if (this.oldRow != "") {
  199. if (this.oldRow != row) {
  200. if (this.oldRowCount % 2 === 1) {
  201. this.$refs.table.toggleRowExpansion(this.oldRow);
  202. } else {
  203. this.oldRowCount = 1;
  204. }
  205. } else {
  206. this.oldRow = null;
  207. return;
  208. }
  209. }
  210. // 重置上一个点击对象
  211. this.oldRow = row;
  212. // 根据销售订单id查询物资信息
  213. this.axios
  214. .post(
  215. "/api/v1/ams/getTruckNoMaterialList?saleOrderMaterialId=" +
  216. row.saleOrderMaterialId
  217. )
  218. .then(res => {
  219. this.tableData = res.data.data;
  220. });
  221. },
  222. // -------查看物资详情 (已派车)
  223. detailclick3(row) {
  224. // 记录重复点击次数
  225. if (this.oldRow3 === row) {
  226. this.oldRowCount3 += 1;
  227. }
  228. // 切换当前详情表
  229. this.$refs.table3.toggleRowExpansion(row);
  230. // 打开前关闭上一个详情表
  231. if (this.oldRow3 != "") {
  232. if (this.oldRow3 != row) {
  233. if (this.oldRowCount3 % 2 === 1) {
  234. this.$refs.table3.toggleRowExpansion(this.oldRow3);
  235. } else {
  236. this.oldRowCount3 = 1;
  237. }
  238. } else {
  239. this.oldRow3 = null;
  240. return;
  241. }
  242. }
  243. // 重置上一个点击对象
  244. this.oldRow3 = row;
  245. // 根据销售订单id查询物资信息
  246. this.axios
  247. .post(
  248. "/api/v1/ams/getTruckNoMaterialList?saleOrderMaterialId=" +
  249. row.saleOrderMaterialId
  250. )
  251. .then(res => {
  252. this.tableData3 = res.data.data;
  253. });
  254. },
  255. // -------查看物资详情 (未派车)
  256. detailclick0(row) {
  257. // 记录重复点击次数
  258. if (this.oldRow0 === row) {
  259. this.oldRowCount0 += 1;
  260. }
  261. // 切换当前详情表
  262. this.$refs.table0.toggleRowExpansion(row);
  263. // 打开前关闭上一个详情表
  264. if (this.oldRow0 != "") {
  265. if (this.oldRow0 != row) {
  266. if (this.oldRowCount0 % 2 === 1) {
  267. this.$refs.table0.toggleRowExpansion(this.oldRow0);
  268. } else {
  269. this.oldRowCount0 = 1;
  270. }
  271. } else {
  272. this.oldRow0 = null;
  273. return;
  274. }
  275. }
  276. // 重置上一个点击对象
  277. this.oldRow0 = row;
  278. // 根据销售订单id查询物资信息
  279. this.axios
  280. .post(
  281. "/api/v1/ams/getTruckNoMaterialList?saleOrderMaterialId=" +
  282. row.saleOrderMaterialId
  283. )
  284. .then(res => {
  285. this.tableData0 = res.data.data;
  286. });
  287. }
  288. }
  289. };
  290. </script>
  291. <style lang="scss" scoped>
  292. .salePlan {
  293. .top {
  294. margin-left: 20px;
  295. margin-top: 20px;
  296. .el-input {
  297. width: 20%;
  298. margin-right: 1.25rem;
  299. }
  300. }
  301. .table {
  302. margin-left: 20px;
  303. margin-top: 20px;
  304. }
  305. }
  306. </style>