truckDriverReceiveRan.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. <el-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. <el-button type="primary" class="btn" @click="clickClose" v-if="activeName == 'option'">
  16. <i class="el-icon-close"></i>关闭
  17. </el-button>
  18. </div>
  19. <el-tabs v-model="activeName">
  20. <el-tab-pane label="未接收" name="option">
  21. <dilTable v-bind.sync="option" @selection-change="selectionChange"> </dilTable>
  22. </el-tab-pane>
  23. <el-tab-pane label="已接收" name="first">
  24. <dilTable v-bind.sync="option1"> </dilTable>
  25. </el-tab-pane>
  26. <el-tab-pane label="已拒绝" name="second">
  27. <dilTable v-bind.sync="option2"> </dilTable>
  28. </el-tab-pane>
  29. </el-tabs>
  30. </div>
  31. </template>
  32. <script>
  33. import { getCookie } from "@/utils/util.js";
  34. export default {
  35. name: "inplantTMS",
  36. data() {
  37. return {
  38. input: "",
  39. Time: "",
  40. activeName: "option",
  41. option: {
  42. // 表格请求数据的地址
  43. requestUrl:"",
  44. selectionType: "select",
  45. },
  46. option1: {
  47. // 表格请求数据的地址
  48. requestUrl:"",
  49. },
  50. option2: {
  51. // 表格请求数据的地址
  52. requestUrl:"",
  53. },
  54. list:[],
  55. };
  56. },
  57. watch:{
  58. activeName(val){
  59. if (getCookie("orgCode") == "chengyunshang") {
  60. if(val == "option"){
  61. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
  62. }else if(val == "first"){
  63. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
  64. }else if(val == "second"){
  65. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
  66. }
  67. }else{
  68. if(val == "option"){
  69. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i="+new Date()+"&carrierSSOId=" + null;
  70. }else if(val == "first"){
  71. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i="+new Date()+"&carrierSSOId=" + null;
  72. }else if(val == "second"){
  73. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i="+new Date()+"&carrierSSOId=" + null;
  74. }
  75. }
  76. }
  77. },
  78. created() {
  79. //判断是否是承运商
  80. if (getCookie("orgCode") == "chengyunshang") {
  81. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + getCookie("userId");
  82. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + getCookie("userId");
  83. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + getCookie("userId");
  84. } else {
  85. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + null;
  86. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + null;
  87. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + null;
  88. }
  89. },
  90. methods: {
  91. getRequestUrl(){
  92. if (getCookie("orgCode") == "chengyunshang") {
  93. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  94. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  95. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  96. } else {
  97. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + null +"&i="+new Date();
  98. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + null +"&i="+new Date();
  99. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + null +"&i="+new Date();
  100. }
  101. },
  102. onclick() {
  103. if (getCookie("orgCode") == "chengyunshang") {
  104. if(this.activeName == "option"){
  105. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  106. }else if (this.activeName == "first") {
  107. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  108. } else if (this.activeName == "second") {
  109. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  110. }
  111. }else{
  112. if(this.activeName == "option"){
  113. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  114. }else if (this.activeName == "first") {
  115. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  116. } else if (this.activeName == "second") {
  117. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  118. }
  119. }
  120. },
  121. clickClose(){
  122. console.log(this.list)
  123. if(this.list.length == 0){
  124. this.$message.warning('请选择订单之后在关闭')
  125. }else{
  126. this.axios.post('/api/v1/oms/deleteOrders',{list:this.list}).then((res)=>{
  127. if(res.data.code == "200"){
  128. this.$message.success('关闭成功')
  129. this.getRequestUrl()
  130. }
  131. })
  132. }
  133. },
  134. selectionChange(selection){
  135. this.list = [],
  136. selection.forEach(e => {
  137. this.list.push(e.orderId)
  138. });
  139. }
  140. },
  141. };
  142. </script>
  143. <style lang='scss'>
  144. .homeworkPath {
  145. .top {
  146. padding: 40px;
  147. .input {
  148. width: 250px;
  149. margin-right: 10px;
  150. }
  151. }
  152. }
  153. </style>