123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <template>
- <!-- 辅料运输派单 -->
- <div class="homeworkPath">
- <div class="top">
- <el-input
- placeholder="请输入内容"
- class="input"
- v-model="input"
- clearable
- >
- </el-input>
- <el-button type="primary" class="btn" @click="onclick">
- <i class="el-icon-search"></i>查询
- </el-button>
- <el-button type="primary" class="btn" @click="clickClose" v-if="activeName == 'option'">
- <i class="el-icon-close"></i>关闭
- </el-button>
- </div>
- <el-tabs v-model="activeName">
- <el-tab-pane label="未接收" name="option">
- <dilTable v-bind.sync="option" @selection-change="selectionChange"> </dilTable>
- </el-tab-pane>
- <el-tab-pane label="已接收" name="first">
- <dilTable v-bind.sync="option1"> </dilTable>
- </el-tab-pane>
- <el-tab-pane label="已拒绝" name="second">
- <dilTable v-bind.sync="option2"> </dilTable>
- </el-tab-pane>
- </el-tabs>
- </div>
- </template>
- <script>
- import { getCookie } from "@/utils/util.js";
- export default {
- name: "inplantTMS",
- data() {
- return {
- input: "",
- Time: "",
- activeName: "option",
- option: {
- // 表格请求数据的地址
- requestUrl:"",
- selectionType: "select",
- },
- option1: {
- // 表格请求数据的地址
- requestUrl:"",
- },
- option2: {
- // 表格请求数据的地址
- requestUrl:"",
- },
- list:[],
- };
- },
- watch:{
- activeName(val){
- if (getCookie("orgCode") == "chengyunshang") {
- if(val == "option"){
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
- }else if(val == "first"){
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
- }else if(val == "second"){
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i="+new Date()+"&carrierSSOId=" + getCookie("userId");
- }
- }else{
- if(val == "option"){
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&i="+new Date()+"&carrierSSOId=" + null;
- }else if(val == "first"){
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&i="+new Date()+"&carrierSSOId=" + null;
- }else if(val == "second"){
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&i="+new Date()+"&carrierSSOId=" + null;
- }
- }
-
- }
- },
- created() {
- //判断是否是承运商
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + getCookie("userId");
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + getCookie("userId");
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + getCookie("userId");
- } else {
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + null;
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + null;
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + null;
- }
- },
- methods: {
- getRequestUrl(){
- //判断是否是承运商
- if (getCookie("orgCode") == "chengyunshang") {
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + getCookie("userId") +"&i="+new Date();
- } else {
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&carrierSSOId=" + null +"&i="+new Date();
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&carrierSSOId=" + null +"&i="+new Date();
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&carrierSSOId=" + null +"&i="+new Date();
- }
- },
- onclick() {
- if (getCookie("orgCode") == "chengyunshang") {
- if(this.activeName == "option"){
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
- }else if (this.activeName == "first") {
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
- } else if (this.activeName == "second") {
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + getCookie("userId");
- }
- }else{
- if(this.activeName == "option"){
- this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
- }else if (this.activeName == "first") {
- this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
- } else if (this.activeName == "second") {
- this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&orderType=5&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
- }
- }
-
- },
- clickClose(){
- console.log(this.list)
- if(this.list.length == 0){
- this.$message.warning('请选择订单之后在关闭')
- }else{
- this.axios.post('/api/v1/oms/deleteOrders',{list:this.list}).then((res)=>{
- if(res.data.code == "200"){
- this.$message.success('关闭成功')
- this.getRequestUrl()
- }
- })
- }
- },
- selectionChange(selection){
- this.list = [],
- selection.forEach(e => {
- this.list.push(e.orderId)
- });
- }
- },
- };
- </script>
- <style lang='scss'>
- .homeworkPath {
- .top {
- padding: 40px;
- .input {
- width: 250px;
- margin-right: 10px;
- }
- }
- }
- </style>
|