truckDriverReceiveFu.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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&orderType=5&orderStatus=4&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
  62. }else if(val == "first"){
  63. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
  64. }else if(val == "second"){
  65. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&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&orderType=5&orderStatus=4&i="+new Date()+"&carrierSSOId=" + null;
  70. }else if(val == "first"){
  71. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i="+new Date()+"&carrierSSOId=" + null;
  72. }else if(val == "second"){
  73. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&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&orderType=5&orderStatus=4&carrierSSOId=" + getCookie("userId");
  82. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + getCookie("userId");
  83. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + getCookie("userId");
  84. } else {
  85. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + null;
  86. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + null;
  87. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + null;
  88. }
  89. },
  90. methods: {
  91. getRequestUrl(){
  92. //判断是否是承运商
  93. if (getCookie("orgCode") == "chengyunshang") {
  94. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  95. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  96. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
  97. } else {
  98. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + null +"&i="+new Date();
  99. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + null +"&i="+new Date();
  100. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + null +"&i="+new Date();
  101. }
  102. },
  103. onclick() {
  104. if (getCookie("orgCode") == "chengyunshang") {
  105. if(this.activeName == "option"){
  106. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  107. }else if (this.activeName == "first") {
  108. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  109. } else if (this.activeName == "second") {
  110. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
  111. }
  112. }else{
  113. if(this.activeName == "option"){
  114. this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  115. }else if (this.activeName == "first") {
  116. this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  117. } else if (this.activeName == "second") {
  118. this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
  119. }
  120. }
  121. },
  122. clickClose(){
  123. console.log(this.list)
  124. if(this.list.length == 0){
  125. this.$message.warning('请选择订单之后在关闭')
  126. }else{
  127. this.axios.post('/api/v1/oms/deleteOrders',{list:this.list}).then((res)=>{
  128. if(res.data.code == "200"){
  129. this.$message.success('关闭成功')
  130. this.getRequestUrl()
  131. }
  132. })
  133. }
  134. },
  135. selectionChange(selection){
  136. this.list = [],
  137. selection.forEach(e => {
  138. this.list.push(e.orderId)
  139. });
  140. }
  141. },
  142. };
  143. </script>
  144. <style lang='scss'>
  145. .homeworkPath {
  146. .top {
  147. padding: 40px;
  148. .input {
  149. width: 250px;
  150. margin-right: 10px;
  151. }
  152. }
  153. }
  154. </style>