小牛集卡web 客户端
chenwei
8 days ago 2621fec0d7ce1db0a2302c6c1ac0f08b36ae8a63
港口达下单的完善
1 files added
5 files modified
453 ■■■■ changed files
src/components/agopage/comment/AddBox.vue 112 ●●●● patch | view | raw | blame | history
src/components/agopage/comment/BoxType.vue 43 ●●●● patch | view | raw | blame | history
src/components/agopage/comment/CarSharing.vue 59 ●●●● patch | view | raw | blame | history
src/components/agopage/comment/GoodsClassify.vue 111 ●●●●● patch | view | raw | blame | history
src/components/agopage/home/Harbour.vue 122 ●●●●● patch | view | raw | blame | history
src/views/agomiddle/InquiryCenter.vue 6 ●●●● patch | view | raw | blame | history
src/components/agopage/comment/AddBox.vue
@@ -2,11 +2,17 @@
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="常规箱子" name="first">
        <div class="show-box" v-for="(item, index) in allData.ContainerList" :key="index">
          <div class="box">
        <div
          class="show-box"
          v-for="(item, index) in commonBox"
          :key="index"
          @click="generalBox(item)"
        >
          <div class="box"  :class="{generalactive:item.CntrId==generalActive}">
            <i class="iconfont icon-jizhuangxiang_container"></i>
            <span>{{item.CntrName}}</span>
            <span>{{item.CntrSubtitle}}</span>
            <span>{{ item.CntrName }}</span>
            <span>{{ item.CntrSubtitle }}</span>
          </div>
          <!-- <div class="switch">
            <el-switch v-model="value1" active-text="拼车"> </el-switch>
@@ -14,11 +20,16 @@
        </div>
      </el-tab-pane>
      <el-tab-pane label="特种箱" name="second">
        <div class="show-box" v-for="(sitem, sindex) in allData.SpecialContainerList" :key="sindex">
          <div class="box">
        <div
          class="show-box"
          v-for="(sitem, sindex) in allData.SpecialContainerList"
          :key="sindex"
          @click="specialBox(sitem)"
        >
          <div class="box" :class="{generalactive:sitem.CntrId==generalActive}">
            <i class="iconfont icon-jizhuangxiang_container"></i>
            <span>{{sitem.CntrName}}</span>
            <span>{{sitem.CntrSubtitle}}</span>
            <span>{{ sitem.CntrName }}</span>
            <span>{{ sitem.CntrSubtitle }}</span>
          </div>
          <!-- <div class="switch">
            <el-switch v-model="value1" active-text="拼车"> </el-switch>
@@ -26,7 +37,7 @@
        </div>
      </el-tab-pane>
      <div class="btn">
        <button>添 加</button>
        <button @click="addBox">添 加</button>
      </div>
    </el-tabs>
  </div>
@@ -35,24 +46,79 @@
export default {
  data() {
    return {
      activeName: "second",
      activeName: "first",
      value1: true,
      allData:{}
      allData: {},
      commonBox: [],
      generalActive:""
    };
  },
  created(){
  created() {
    this.getBoxList();
  },
  methods: {
    generalBox(item){
      if(this.generalActive==""){
           this.generalActive = item.CntrId;
      }else if(this.generalActive==item.CntrId){
        this.generalActive="";
      }else{
        this.generalActive = item.CntrId;
      }
        console.log(this.generalActive);
    },
     specialBox(item){
      if(this.generalActive==""){
           this.generalActive = item.CntrId;
      }else if(this.generalActive==item.CntrId){
        this.generalActive="";
      }else{
        this.generalActive = item.CntrId;
      }
       console.log(this.generalActive);
    },
    addBox(){
      if(this.generalActive==""){
        this.$message({message:"请选择箱子",type:"warning"})
      }else{
        this.addNewBox({cnterId:this.generalActive});
      }
    },
    async addNewBox(model){
           await this.$axios.post("/api/Order/AddSingeContainner",this.$qs.stringify(model)).then(res=>{
             console.log(res);
             //弹窗里面是属于二级
             this.$parent.$parent.getTempOrder();
             this.$emit("newbox",false);
           }).catch(err=>{
             this.$message.error("添加箱子出错啦!");
             console.log(err)
           })
    },
    //请求箱型列表
    async getBoxList(){
      await this.$axios.get("/api/HomePage/GetOrderForm").then(res=>{
            this.allData = res.data;
      }).catch(err=>{
    async getBoxList() {
      await this.$axios
        .get("/api/HomePage/GetOrderForm")
        .then((res) => {
          var general = res.data.ContainerList;
          for (var j = 0; j < general.length; j++) {
            if (general[j].CnterNub != 0) {
              this.commonBox.push(general[j]);
            }
          }
          this.allData = res.data;
        })
        .catch((err) => {
          console.log(err);
      })
        });
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
  },
@@ -84,17 +150,21 @@
.btn {
  text-align: center;
}
.btn button{
.btn button {
  cursor: pointer;
  border: none;
  outline: none;
  padding: 6px 15px;
  background-color: #F59A23;
  background-color: #f59a23;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
}
.btn button:hover{
    background-color: #f3a641;
.btn button:hover {
  background-color: #f3a641;
}
.generalactive{
  background-color: #f59a23;
  color: #fff;
}
</style>
src/components/agopage/comment/BoxType.vue
@@ -453,6 +453,7 @@
    orderall: {
      handler(val) {
        this.orderType = val.OrderType;
        this.pollArr =[];
        for (var i = 0; i < val.tempOrderForms.length; i++) {
       
          val.tempOrderForms[i].isNumDisable = false;
@@ -483,6 +484,11 @@
          } else {
            val.tempOrderForms[i].tempOrder.IsCarPooling = true;
          }
          // //刷新后还没返回价格的
          // if( val.tempOrderForms[i].tempOrder.IsInquiryAllowed==2){
          //   this.pollArr.push(val.tempOrderForms[i].tempOrder.TempOrderID)
          // }
        }
        this.tempOrderForms = val.tempOrderForms;
      },
@@ -621,6 +627,10 @@
        type: "warning",
      })
        .then(() => {
          if(this.tempOrderForms.length==1){
            this.$message.error("请保持至少一条数据");
            return;
          }
          this.$axios
            .post(
              "/api/Order/DeleteSingeTmpOrder",
@@ -639,9 +649,29 @@
    },
    //询价
    enquiry(id, item,index) {
      this.tempOrderForms[index].tempOrder.IsInquiryAllowed = 2;
      item.orderData.TempOrderID = id;
      this.getEnquiry(item.orderData);
              this.tempOrderForms[index].tempOrder.IsInquiryAllowed = 2;
            this.getEnquiry(item.orderData);
      // //判断普通箱子的询价和特殊箱子的询价所要传的内容
      // if(item.tempOrder.Container.CntrType==2){
      //     var isNull = false
      //     for(let key in item.orderData){
      //         if(item.orderData[key]==""){
      //           isNull = true;
      //         }
      //     }
      //     if(isNull){
      //         this.$message.error("请填写信息");
      //     }else{
      //        this.tempOrderForms[index].tempOrder.IsInquiryAllowed = 2;
      //       this.getEnquiry(item.orderData);
      //     }
      // }else{
      //    this.tempOrderForms[index].tempOrder.IsInquiryAllowed = 2;
      //      this.getEnquiry(item.orderData);
      // }
    },
    //定时器轮询价格
    async getPolling(model) {
@@ -650,14 +680,15 @@
        .then((res) => {
          // this.pollData = res.data;
          // 是否返回询价的接口
          if(res.data.length>0 &&this.tempOrderForms.length>0){
            for(var i=0,j=0;i<res.data.length,j<this.tempOrderForms.length;i++,j++){
                if(res.data[i].TempOrderID==this.tempOrderForms[j].tempOrder.TempOrderID){
          if(res.data.length>0 && this.pollArr.length>0){
            for(var i=0;i<res.data.length;i++){
              for(var j=0;j<this.tempOrderForms.length;j++){
                    if(res.data[i].TempOrderID==this.tempOrderForms[j].tempOrder.TempOrderID){
                  this.tempOrderForms[j].tempOrder.BaseMoney = res.data[i].OdiqMoney;
                  this.tempOrderForms[j].tempOrder.IsInquiryAllowed = 0;
                   this.pollArr.splice(i, 1);
                  console.log("拿到返回询价的值",res.data[i].TempOrderID);
                }
              }
            }
          }
        })
src/components/agopage/comment/CarSharing.vue
@@ -9,11 +9,11 @@
      </div>
    </div>
    <div class="oprator">
      <div>
        <span>配拖箱:</span>
        <div>
      <div class="box-content">
        <div class="title">配拖箱:</div>
        <div class="box">
          <i class="iconfont icon-jizhuangxiang_container"></i>
          <span>20GP</span>
          <div>20GP</div>
        </div>
      </div>
      <el-button plain size="mini">合并整车</el-button>
@@ -21,17 +21,17 @@
    </div>
    <div class="car-pool-show">
      <div>
        <div>
        <div class="one">
          <el-tag effect="dark" type="warning" size="mini">车</el-tag>
        </div>
        <div>
        <div class="two">
          <el-checkbox></el-checkbox>
        </div>
      </div>
      <div>
        <div>
          <div>提箱地</div>
          <div>
        <div class="one">
          <div >提箱地</div>
          <div >
            <el-select v-model="value" placeholder="请选择">
              <el-option
                v-for="item in options"
@@ -43,7 +43,7 @@
            </el-select>
          </div>
        </div>
        <div>
        <div class="two">
          <el-select v-model="value" placeholder="请选择">
            <el-option
              v-for="item in options"
@@ -56,14 +56,14 @@
        </div>
      </div>
      <div class="three">
        <div>
        <div class="one">
          <div>装卸地</div>
          <div>
            <span>重庆市渝北区龙溪镇国宾城12栋</span>
            <i class="el-icon-caret-bottom"></i>
          </div>
        </div>
        <div>
        <div class="two">
          <el-date-picker
            v-model="value1"
            type="daterange"
@@ -75,8 +75,8 @@
        </div>
      </div>
      <div class="four">
          <div></div>
          <div>
          <div class="one"></div>
          <div class="two">
              <span>数量:1</span>
              <el-button icon="el-icon-close" size="mini" title="删除"></el-button>
              <el-button icon="el-icon-document-copy" size="mini" title="复制"></el-button>
@@ -101,7 +101,38 @@
    display: flex;
  justify-content: space-between;
}
.oprator,.box-content,.box-content .box{
  display: flex;
  align-items: center;
}
.oprator{
  width: 40%;
  justify-content: space-between;
}
.box-content .box{
  border: 1px solid #c3c3c3;
  padding: 3px 6px;
  border-radius: 3px;
}
.box-content .title{
  font-weight: bold;
}
.title{
    display: flex;
    justify-content: space-between;
}
.one,.two{
  display: flex;
  flex-direction: column;
align-items: center;
justify-content: center;
  height: 70px;
}
.four{
  .two{
    flex-direction: inherit;
  }
}
</style>
src/components/agopage/comment/GoodsClassify.vue
New file
@@ -0,0 +1,111 @@
<template>
  <div class="form-input">
    <div
      class="product"
      v-for="(item, indexp) in productData"
      :key="indexp"
      @click="selProeuct(item,indexp)"
    >
      <div>{{ item.GoodsTypeName }}</div>
      <div class="child-classify" v-if="item.isShow">
          <div v-for="(citem,cindex) in item.GoodsBaseList" :key="cindex" @click="selecProdcut(citem)" class="single-pro">
              {{citem}}
          </div>
      </div>
    </div>
    <div class="pro-input">
      <el-input
        placeholder="输入物品"
        v-model="productVal"
        @blur="proInput"
        clearable
      ></el-input>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
       productVal:"",
      productData: [
        {
          GoodsTypeName: "常用分类1",
          isShow:false,
          GoodsBaseList: ["汽车类", "测试类"],
        },
        {
            isShow:false,
          GoodsTypeName: "常用分类2",
          GoodsBaseList: ["钢材类"],
        },
      ],
    };
  },
  props:["goodslist"],
  methods:{
    proInput(){
      this.$emit("acceptgoods",this.productVal);
    },
      selProeuct(item,index){
          //只能显示一个让其选择
           item.isShow = !item.isShow;
        //   if(!(item.isShow)){
        // for(var i =0;i<this.productData.length;i++){
        //     if(i!=index){
        //         this.productData[i].isShow=false;
        //     }else{
        //         item.isShow = !item.isShow;
        //     }
        //   }
        //   }
      },
      selecProdcut(item){
          this.productVal = item;
          this.$emit("acceptgoods",item);
          // console.log(item)
      },
  }
};
</script>
<style lang="less" scoped>
.child-classify,.product{
    width: 110px;
   text-align: center;
   border-radius: 3px;
   border: 1px solid #e4e4e4;
}
.child-classify{
    position:absolute;
    background-color: #fff;
}
.single-pro:hover{
    background-color: #e6a23c;
  color: #fff;
}
.product {
  margin-right: 30px;
  margin-bottom: 10px;
  cursor: pointer;
}
.form-input {
  display: flex;
  flex-wrap: wrap;
}
.pro-input {
  /deep/.el-input {
    width: 110px;
  }
}
</style>
src/components/agopage/home/Harbour.vue
@@ -21,49 +21,10 @@
                <span>提箱地 : </span>
              </div>
            </template>
            <div class="form-input">
              <div class="tibox-adres">
                <el-input
                  @focus="tiFocus"
                  readonly
                  v-model="playBox"
                ></el-input>
                <div class="select-tibox" v-if="isTShow">
                  <div v-if="pickPlaceList.length == 0">暂 无 数 据</div>
                  <el-tabs v-model="submitForm.CityId" @tab-click="handleClick">
                    <el-tab-pane
                      v-for="item in pickPlaceList"
                      :key="item.CityId"
                      :label="item.CityName"
                      :name="item.CityId"
                    >
                      <el-radio-group v-model="radio" @change="selectPort">
                        <el-radio
                          @change="boxRadio"
                          v-for="ritem in item.PortList"
                          :key="ritem.PortId"
                          :label="ritem"
                          >{{ ritem.PortName }}</el-radio
                        >
                      </el-radio-group>
                    </el-tab-pane>
                  </el-tabs>
                </div>
              </div>
              <div class="suffix-txt">
                <div v-for="(item, pindex) in pickPlaceList" :key="pindex">
                  <div
                    class="shortcut"
                    v-for="(shortcut, sindex) in item.PortList"
                    :key="sindex"
                    @click="shortCut(item, shortcut)"
                  >
                    <span v-if="sindex < 3">{{ shortcut.PortName }}</span>
                  </div>
                </div>
              </div>
            </div>
               <box-adress
              :boxaddress="pickPlaceList"
              @acceptreturn="acceptPickAdress"
            ></box-adress>
          </el-form-item>
          <el-form-item>
            <template slot="label">
@@ -230,22 +191,7 @@
              </div>
            </template>
            <div class="form-input">
              <div
                class="product"
                v-for="(item, indexp) in productData"
                :key="indexp"
                :class="{ activebox: activeProduct == item }"
                @click="selProeuct(item)"
              >
                {{ item.GoodsTypeName }}
              </div>
              <div class="pro-input">
                <el-input
                  placeholder="输入物品"
                  v-model="productVal"
                  @focus="proInput"
                ></el-input>
              </div>
                <goods-classify :goodslist="productData" @acceptgoods="acceptProduct"></goods-classify>
            </div>
          </el-form-item>
        </el-form>
@@ -293,6 +239,7 @@
</template>
<script>
import BoxAdress from "../comment/BoxAdress";
import GoodsClassify from"../comment/GoodsClassify.vue";
export default {
  data() {
    return {
@@ -315,9 +262,6 @@
        // OnlyInput:""
      },
      timeUrgent: false,
      value1: "",
      radio1: "",
      value4: "",
      productData: [],
      factory: [],
@@ -335,8 +279,6 @@
      isSpecial: false,
      pickPlaceList: [],
      retrunPlaceList: [],
      activeProduct: "",
      productVal: "",
      isSelect: "",
      urgentBeginTime:"",
      urgentEndTime:"",
@@ -358,7 +300,7 @@
      },
    };
  },
  components: { BoxAdress },
  components: { BoxAdress,GoodsClassify },
  props: ["alldata"],
  watch: {
    alldata(val) {
@@ -367,7 +309,12 @@
        val.ContainerList[i].select = false;
        val.ContainerList[i].pinche = false;
      }
      this.boxType = val.ContainerList;
      // 剔除那个单箱
      for(var j =0;j<val.ContainerList.length;j++){
         if(val.ContainerList[j].CnterNub!=0){
             this.boxType.push(val.ContainerList[j]);
          }
      }
      val.SpecialContainerList.forEach((item) => {
        item.select = false;
        item.pinche = false;
@@ -386,11 +333,16 @@
        this.searchSpecial(val);
    },
  },
  mounted() {
  },
  methods: {
    //接收物品组件传来的值
    acceptProduct(e){
        this.submitForm.TransportGoods = e;
    },
    acceptPickAdress(e){
      this.submitForm.PickPlace = e;
    },
    //接收还箱地址
    acceptReturnAdress(e) {
      this.submitForm.ReturnPlace = e;
    },
@@ -475,34 +427,33 @@
      }
    },
    inquiryOrder() {
      if (this.activeProduct == "") {
        this.submitForm.TransportGoods = this.productVal;
      }
      // this.submitForm.ArriveTime = this.value1;
       this.submitForm.TempOrderContainerList=[];
      this.getForBox(this.boxType);
      this.getForBox(this.SpecialContainerList);
      var judge = false;
      for(var key in this.submitForm){
        if(this.submitForm[key]==""||this.submitForm[key].length==0){
             judge = true;
        }
      }
      if(judge){
         this.$message.error("请先完善下单信息");
         return;
      }
      console.log(this.submitForm);
      this.$axios
        .post("/api/Order/SaveTempOrder", this.$qs.stringify(this.submitForm))
        .then((res) => {
          console.log(res);
          console.log(this.value4);
          this.$router.push("/inquiry");
        })
        .catch((err) => {
          this.$message.error("请先登录!")
          console.log(err);
        });
    },
    //选中物品
    selProeuct(content) {
      this.productVal = "";
      this.activeProduct = content;
      this.submitForm.TransportGoods = content;
    },
    //输入物品
    proInput() {
      this.activeProduct = "";
    },
    // urgentChange(val) {
    //   if (val) {
    //      let year = this.urgentEndTime.slice(0,10)
@@ -514,6 +465,7 @@
    selAdress(content) {
      this.submitForm.OrderAddressLongitude = content.ComLongitude;
      this.submitForm.OrderAddressLatitude = content.ComLatitude;
      this.submitForm.OrderAddress =  content.ComAdress;
      this.mapVal = content.ComAdress;
      this.usualAdrDialog = false;
    },
src/views/agomiddle/InquiryCenter.vue
@@ -79,7 +79,7 @@
    </div>
    <el-dialog title="新增箱子" :visible.sync="addBoxDialog" width="300px">
      <add-box></add-box>
      <add-box @newbox="acceptNewBox"></add-box>
    </el-dialog>
    <!-- 下单的弹窗 -->
    <el-dialog
@@ -277,6 +277,10 @@
    this.getTempOrder();
  },
  methods: {
    //接收添加新箱子传过来的值
    acceptNewBox(e){
        this.addBoxDialog = e;
    },
    orderSure() {
      console.log(this.allOrder);
      this.portOrderSave.CityId = "5dc90c98-475e-4529-bb3a-c3010a82b0e1";