truckDriverReceiveRan.vue 12 KB

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