truckDriverReceiveFu.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <!-- 辅料运输派单 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input
  6. placeholder="请输入内容"
  7. class="input"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <span class="text">下发时间:</span>
  13. <el-date-picker
  14. v-model="startTime"
  15. type="datetime"
  16. placeholder="选择日期"
  17. >
  18. </el-date-picker>
  19. <span class="text">至</span>
  20. <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
  21. </el-date-picker>
  22. <el-button type="primary" class="btn" @click="onclick">
  23. <i class="el-icon-search"></i>查询
  24. </el-button>
  25. <el-button
  26. type="primary"
  27. class="btn"
  28. @click="clickClose"
  29. v-if="activeName == 'option'"
  30. >
  31. <i class="el-icon-close"></i>关闭
  32. </el-button>
  33. </div>
  34. <el-tabs v-model="activeName">
  35. <el-tab-pane label="未接收" name="option">
  36. <dilTable v-bind.sync="option" @selection-change="selectionChange">
  37. </dilTable>
  38. </el-tab-pane>
  39. <el-tab-pane label="已接收" name="first">
  40. <dilTable v-bind.sync="option1"> </dilTable>
  41. </el-tab-pane>
  42. <el-tab-pane label="已拒绝" name="second">
  43. <dilTable v-bind.sync="option2"> </dilTable>
  44. </el-tab-pane>
  45. </el-tabs>
  46. </div>
  47. </template>
  48. <script>
  49. import { getCookie } from "@/utils/util.js";
  50. import { sjTime } from "@/utils/sharedJsFile";
  51. export default {
  52. name: "inplantTMS",
  53. data() {
  54. return {
  55. startTime: null,
  56. endTime: null,
  57. input: "",
  58. Time: "",
  59. activeName: "option",
  60. option: {
  61. // 表格请求数据的地址
  62. requestUrl: "",
  63. selectionType: "select",
  64. },
  65. option1: {
  66. // 表格请求数据的地址
  67. requestUrl: "",
  68. },
  69. option2: {
  70. // 表格请求数据的地址
  71. requestUrl: "",
  72. },
  73. list: [],
  74. };
  75. },
  76. watch: {
  77. activeName(val) {
  78. if (getCookie("orgCode") == "chengyunshang") {
  79. if (val == "option") {
  80. this.option.requestUrl =
  81. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&i=" +
  82. new Date() +
  83. "&carrierSSOId=" +
  84. getCookie("userId");
  85. } else if (val == "first") {
  86. this.option1.requestUrl =
  87. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i=" +
  88. new Date() +
  89. "&carrierSSOId=" +
  90. getCookie("userId");
  91. } else if (val == "second") {
  92. this.option1.requestUrl =
  93. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i=" +
  94. new Date() +
  95. "&carrierSSOId=" +
  96. getCookie("userId");
  97. }
  98. } else {
  99. if (val == "option") {
  100. this.option.requestUrl =
  101. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&i=" +
  102. new Date() +
  103. "&carrierSSOId=" +
  104. null;
  105. } else if (val == "first") {
  106. this.option1.requestUrl =
  107. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i=" +
  108. new Date() +
  109. "&carrierSSOId=" +
  110. null;
  111. } else if (val == "second") {
  112. this.option1.requestUrl =
  113. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i=" +
  114. new Date() +
  115. "&carrierSSOId=" +
  116. null;
  117. }
  118. }
  119. },
  120. },
  121. created() {
  122. //判断是否是承运商
  123. if (getCookie("orgCode") == "chengyunshang") {
  124. this.option.requestUrl =
  125. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
  126. getCookie("userId");
  127. this.option1.requestUrl =
  128. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
  129. getCookie("userId");
  130. this.option2.requestUrl =
  131. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
  132. getCookie("userId");
  133. } else {
  134. this.option.requestUrl =
  135. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
  136. null;
  137. this.option1.requestUrl =
  138. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
  139. null;
  140. this.option2.requestUrl =
  141. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
  142. null;
  143. }
  144. },
  145. methods: {
  146. getRequestUrl() {
  147. //判断是否是承运商
  148. if (getCookie("orgCode") == "chengyunshang") {
  149. this.option.requestUrl =
  150. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
  151. getCookie("userId") +
  152. "&i=" +
  153. new Date();
  154. this.option1.requestUrl =
  155. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
  156. getCookie("userId") +
  157. "&i=" +
  158. new Date();
  159. this.option2.requestUrl =
  160. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
  161. getCookie("userId") +
  162. "&i=" +
  163. new Date();
  164. } else {
  165. this.option.requestUrl =
  166. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" +
  167. null +
  168. "&i=" +
  169. new Date();
  170. this.option1.requestUrl =
  171. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" +
  172. null +
  173. "&i=" +
  174. new Date();
  175. this.option2.requestUrl =
  176. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" +
  177. null +
  178. "&i=" +
  179. new Date();
  180. }
  181. },
  182. onclick() {
  183. if (getCookie("orgCode") == "chengyunshang") {
  184. if (this.activeName == "option") {
  185. this.option.requestUrl =
  186. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" +
  187. this.input +
  188. "&i=" +
  189. new Date() +
  190. "&carrierSSOId=" +
  191. getCookie("userId");
  192. } else if (this.activeName == "first") {
  193. this.option1.requestUrl =
  194. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
  195. this.input +
  196. "&i=" +
  197. new Date() +
  198. "&carrierSSOId=" +
  199. getCookie("userId");
  200. } else if (this.activeName == "second") {
  201. this.option2.requestUrl =
  202. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
  203. this.input +
  204. "&i=" +
  205. new Date() +
  206. "&carrierSSOId=" +
  207. getCookie("userId");
  208. }
  209. } else {
  210. let startTime = null;
  211. let endTime = null;
  212. if (this.startTime) {
  213. startTime = sjTime(this.startTime);
  214. }
  215. if (this.endTime) {
  216. endTime = sjTime(this.endTime);
  217. }
  218. if (startTime && endTime) {
  219. if (startTime < endTime) {
  220. if (this.activeName == "option") {
  221. this.option.requestUrl =
  222. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" +
  223. this.input +
  224. "&i=" +
  225. new Date() +
  226. "&carrierSSOId=" +
  227. null +
  228. "&startTime=" +
  229. startTime +
  230. "&endTime=" +
  231. endTime;
  232. } else if (this.activeName == "first") {
  233. this.option1.requestUrl =
  234. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
  235. this.input +
  236. "&i=" +
  237. new Date() +
  238. "&carrierSSOId=" +
  239. null +
  240. "&startTime=" +
  241. startTime +
  242. "&endTime=" +
  243. endTime;
  244. } else if (this.activeName == "second") {
  245. this.option2.requestUrl =
  246. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
  247. this.input +
  248. "&i=" +
  249. new Date() +
  250. "&carrierSSOId=" +
  251. null +
  252. "&startTime=" +
  253. startTime +
  254. "&endTime=" +
  255. endTime;
  256. }
  257. }
  258. } else {
  259. if (this.activeName == "option") {
  260. this.option.requestUrl =
  261. "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" +
  262. this.input +
  263. "&i=" +
  264. new Date() +
  265. "&carrierSSOId=" +
  266. null;
  267. } else if (this.activeName == "first") {
  268. this.option1.requestUrl =
  269. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" +
  270. this.input +
  271. "&i=" +
  272. new Date() +
  273. "&carrierSSOId=" +
  274. null;
  275. } else if (this.activeName == "second") {
  276. this.option2.requestUrl =
  277. "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" +
  278. this.input +
  279. "&i=" +
  280. new Date() +
  281. "&carrierSSOId=" +
  282. null;
  283. }
  284. }
  285. }
  286. },
  287. clickClose() {
  288. console.log(this.list);
  289. if (this.list.length == 0) {
  290. this.$message.warning("请选择订单之后在关闭");
  291. } else {
  292. this.axios
  293. .post("/api/v1/oms/deleteOrders", { list: this.list })
  294. .then((res) => {
  295. if (res.data.code == "200") {
  296. this.$message.success("关闭成功");
  297. this.getRequestUrl();
  298. }
  299. });
  300. }
  301. },
  302. selectionChange(selection) {
  303. (this.list = []),
  304. selection.forEach((e) => {
  305. this.list.push(e.orderId);
  306. });
  307. },
  308. },
  309. };
  310. </script>
  311. <style lang='scss'>
  312. .homeworkPath {
  313. .top {
  314. padding: 40px;
  315. .input {
  316. width: 250px;
  317. margin-right: 10px;
  318. }
  319. }
  320. }
  321. </style>