saleOrderOODetails.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. //运输派单
  2. <template>
  3. <div class="transportOrder">
  4. <div class="transportOrder_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="back">
  10. <i class="el-icon-back"></i>返回
  11. </el-button>
  12. </div>
  13. <div>
  14. <el-dialog
  15. title="车辆信息"
  16. :visible.sync="dialogTableVisible"
  17. :before-close="handleClose"
  18. >
  19. <el-input style="width:250px" v-model="truckText"></el-input>
  20. <el-button type="primary" @click="getCapacity">查询</el-button>
  21. <dilTable
  22. v-bind.sync="truck"
  23. @radio-change="currentRadioChange1"
  24. ></dilTable>
  25. <span slot="footer" class="dialog-footer">
  26. <el-button @click="dialogTableVisible = false">取 消</el-button>
  27. <el-button type="primary" @click="updateTruckCapacity()"
  28. >确 定</el-button
  29. >
  30. </span>
  31. </el-dialog>
  32. </div>
  33. <div class="table">
  34. <mergeRowTable v-bind.sync="first" ref="table">
  35. <el-table-column fixed="right" label="操作" width="120">
  36. <template slot-scope="scope">
  37. <el-button
  38. @click="updateClick(scope)"
  39. type="text"
  40. size="small"
  41. v-if="
  42. scope.row.carStatus == '未接单' ||
  43. scope.row.carStatus == '未进厂'
  44. "
  45. >
  46. 修改
  47. </el-button>
  48. <el-button
  49. @click="deleteClick(scope)"
  50. type="text"
  51. size="small"
  52. v-if="
  53. scope.row.carStatus == '未接单' ||
  54. scope.row.carStatus == '未进厂'
  55. "
  56. >
  57. 关闭
  58. </el-button>
  59. </template>
  60. </el-table-column>
  61. </mergeRowTable>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import { getCookie } from "@/utils/util.js";
  67. export default {
  68. data() {
  69. return {
  70. carrierUserId: "",
  71. //模态窗的框计算
  72. inputText: null,
  73. //车辆输入框
  74. truckText: null,
  75. //是否弹出对话框
  76. dialogTableVisible: false,
  77. //输入框的值
  78. input: "",
  79. //选项卡的当前选中的值
  80. activeName: "first",
  81. //已下发的表格
  82. first: {
  83. requestUrl: "",
  84. comparison: "orderNumber",
  85. orderNumber: [0, 1]
  86. },
  87. //车辆信息的表格
  88. truck: {
  89. requestUrl: "",
  90. // 控制显示当选列
  91. selectionType: "radio"
  92. },
  93. //当前选中的订单id
  94. selectOrderId: null,
  95. //选中的车辆号
  96. capacityNumber: "",
  97. //选中的运力id
  98. capacityId: null,
  99. //是否关闭模态框
  100. drawer: false,
  101. //模态框从左往右打开
  102. direction: "rtl",
  103. orderId: null,
  104. //区别点击的是添加运力,还是修改
  105. index: null
  106. };
  107. },
  108. created() {
  109. this.truck.requestUrl = "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429";
  110. this.first.requestUrl =
  111. "/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4" +
  112. "&saleOrderId=" +
  113. this.$route.params.saleOrderId;
  114. },
  115. methods: {
  116. onclick() {
  117. this.first.requestUrl =
  118. "/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4" +
  119. "&saleOrderId=" +
  120. this.$route.params.saleOrderId +
  121. "&con=" +
  122. this.input +
  123. "&i=" +
  124. new Date();
  125. },
  126. back() {
  127. this.$router.go(-1);
  128. },
  129. handleClose(done) {
  130. done();
  131. this.$message.info("取消修改运力");
  132. },
  133. getRequestUrl() {
  134. this.first.requestUrl =
  135. "/api/v1/oms/getDriverInfoForSale2?apiId=484&orderStatus=4" +
  136. "&saleOrderId=" +
  137. this.$route.params.saleOrderId +
  138. "&i=" +
  139. new Date();
  140. },
  141. getTruckRequestUrl() {
  142. this.truck.requestUrl =
  143. "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
  144. null +
  145. "&i=" +
  146. new Date();
  147. },
  148. currentRadioChange1(row) {
  149. console.log(row);
  150. this.capacityId = row.capacityId;
  151. },
  152. //删除运输订单
  153. deleteClick(scope) {
  154. this.$confirm("是否删除?", "提示", {
  155. confirmButtonText: "确定",
  156. cancelButtonText: "取消",
  157. type: "warning"
  158. })
  159. .then(() => {
  160. this.axios
  161. .post("/api/v1/oms/closeOmstruckOrder?orderId=" + scope.row.orderId)
  162. .then(res => {
  163. if (res.data.code == 200) {
  164. this.$message({
  165. type: "success",
  166. message: "删除成功!"
  167. });
  168. this.getRequestUrl();
  169. } else {
  170. this.$message({
  171. message: "删除失败",
  172. type: "warning"
  173. });
  174. }
  175. });
  176. })
  177. .catch(() => {
  178. this.$message({
  179. type: "info",
  180. message: "已取消删除"
  181. });
  182. });
  183. },
  184. //修改运输订单
  185. updateClick(scope) {
  186. this.getTruckRequestUrl();
  187. this.orderId = scope.row.orderId;
  188. this.dialogTableVisible = true;
  189. console.log(scope.row.orderId);
  190. },
  191. updateTruckCapacity() {
  192. if (this.capacityId == null) {
  193. this.$message.error("未选中运力");
  194. return;
  195. }
  196. this.axios
  197. .post("/api/v1/oms/updateCapacityId", {
  198. capacityId: this.capacityId,
  199. orderId: this.orderId
  200. })
  201. .then(res => {
  202. if (res.data.code == "200") {
  203. this.$message.success("修改运力成功");
  204. this.getRequestUrl();
  205. this.dialogTableVisible = false;
  206. } else {
  207. this.$message.error("修改运力失败");
  208. }
  209. });
  210. },
  211. handleClick(tab, event) {
  212. this.getRequestUrl();
  213. },
  214. Insert() {
  215. this.$router.push("addOldSporadicOrder");
  216. },
  217. getCapacity() {
  218. if (this.truckText != null) {
  219. if (getCookie("orgCode") == "chengyunshang") {
  220. this.truck.requestUrl =
  221. "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
  222. getCookie("userId") +
  223. "&index=" +
  224. this.truckText;
  225. } else {
  226. this.truck.requestUrl =
  227. "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
  228. null +
  229. "&index=" +
  230. this.truckText;
  231. }
  232. this.truckText = null;
  233. } else {
  234. if (getCookie("orgCode") == "chengyunshang") {
  235. this.truck.requestUrl =
  236. "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
  237. getCookie("userId") +
  238. "&i=" +
  239. new Date();
  240. } else {
  241. this.truck.requestUrl =
  242. "/api/v1/uc/getAllCapacityByCarrierLike?apiId=429&carrierSsoId=" +
  243. null +
  244. "&i=" +
  245. new Date();
  246. }
  247. }
  248. }
  249. }
  250. };
  251. </script>
  252. <style lang="scss">
  253. .transportOrder {
  254. .transportOrder_top {
  255. width: 100%;
  256. height: 100px;
  257. display: flex;
  258. align-items: center;
  259. padding-left: 50px;
  260. .el-input {
  261. width: 20%;
  262. }
  263. }
  264. .drawer_top {
  265. width: 100%;
  266. height: 50px;
  267. padding-left: 20px;
  268. display: flex;
  269. align-items: center;
  270. }
  271. .table {
  272. margin-left: 30px;
  273. margin-top: 10px;
  274. }
  275. }
  276. </style>