小牛集卡web 客户端
chenwei
2021-06-08 e41faf1640e2e71febf4ba347a301e0c043b6ce9
src/components/agopage/comment/BoxType.vue
@@ -45,10 +45,10 @@
              </div>
              <div class="box" @click="perfectInfo(item, index)">
                <span v-if="item.tempOrder.TempOrderContainer.length != 0"
                  >箱号:{{
                    item.tempOrder.TempOrderContainer[0].ContainerNo
                  }}</span
                <div style="width:100px;overflow:hidden;" v-if="item.tempOrder.TempOrderContainer.length != 0"
                  >提单号:{{
                    item.tempOrder.TempOrderContainer[0].BolCode
                  }}</div
                >
                <span v-else>请点击此处完善信息</span>
                <i class="el-icon-s-unfold"></i>
@@ -121,9 +121,19 @@
              </div>
              <div
                style="text-align: center; color: #d9001b; width: 50px"
                v-if="item.tempOrder.ToTalMoney != null"
                v-if="item.tempOrder.BaseMoney != null&&!(item.tempOrder.IsUrgent)"
              >
                ¥{{ item.tempOrder.ToTalMoney }}
                ¥{{(item.tempOrder.BaseMoney)*(item.tempOrder.ContainerNub)}}
              </div>
              <div
                style="text-align: center; color: #d9001b; width: 50px"
                v-if="item.tempOrder.BaseMoney != null&&item.tempOrder.IsUrgent"
              >
                ¥{{(item.tempOrder.BaseMoney+item.tempOrder.UrgentMoney)*(item.tempOrder.ContainerNub)}}
              </div>
              <div v-if="item.tempOrder.BaseMoney == null"   style="text-align: center; color: #d9001b; width: 50px">
                  ¥0
              </div>
              <div class="money">
                <!-- style="min-width: 42px" -->
@@ -141,14 +151,21 @@
                    size="mini"
                    icon="el-icon-document-copy"
                    title="复制"
                    @click="copyBox(item,index)"
                  >
                  </el-button>
                </div>
                     <el-button  v-if="item.tempOrder.IsInquiryAllowed == 2" type="info" size="mini" disabled>询价中</el-button>
                <div v-if="item.tempOrder.IsInquiryAllowed == 1">
                  <button @click="enquiry(item.tempOrder.TempOrderID, item)">
                  <button @click="enquiry(item.tempOrder.TempOrderID, item,index)">
                    <i class="el-icon-phone-outline"></i> 询 价
                  </button>
                </div>
                <div
                  style="width: 72px"
                  v-if="item.tempOrder.IsInquiryAllowed == 0"
@@ -164,7 +181,7 @@
                <div v-if="item.tempOrder.Container.CntrType == 2">
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'FR'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'FR'
                    "
                    class="two"
                  >
@@ -209,7 +226,7 @@
                  <!-- RF -->
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'RF'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'RF'
                    "
                    class="two"
                  >
@@ -240,7 +257,7 @@
                  <!--OT  -->
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'OT'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'OT'
                    "
                    class="two"
                  >
@@ -263,7 +280,7 @@
                  </div>
                  <!-- 初次之外的样式 -->
                  <div   v-if="
                      (item.tempOrder.Container.CntrName.substring(2) != 'OT'&& item.tempOrder.Container.CntrName.substring(2) != 'FR')&& item.tempOrder.Container.CntrName.substring(2) != 'RF'
                      (item.tempOrder.Container.CntrName.substring(2,4) != 'OT'&& item.tempOrder.Container.CntrName.substring(2,4) != 'FR')&& item.tempOrder.Container.CntrName.substring(2,4) != 'RF'
                    "
                    class="two" >
                        <div class="input-info">
@@ -283,90 +300,90 @@
                 <div v-if="item.tempOrder.Container.CntrType == 2">
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'FR'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'FR'
                    "
                    class="two"
                  >
                    <div class="input-info">
                      <span>货物:</span>
                       <span>{{item.orderData.OdiqGoods}}</span>
                       <span>{{item.orderinqiry.OdiqGoods}}</span>
                    </div>
                    <div class="bulk">
                      <div>
                        <span>长:</span>
                        <span>{{item.orderData.OdiqLong}}</span>
                        <span>{{item.orderinqiry.OdiqLong}}</span>
                      </div>
                      <div>
                        <span>宽:</span>
                        <span>{{item.orderData.OdiqWidth}}</span>
                        <span>{{item.orderinqiry.OdiqWidth}}</span>
                       
                      </div>
                      <div>
                        <span>高:</span>
                        <span>{{item.orderData.OdiqHeight}}</span>
                        <span>{{item.orderinqiry.OdiqHeight}}</span>
                      </div>
                    </div>
                    <div class="input-remark">
                      <span>备注:</span>
                      <span>{{item.orderData.OdiqRemarks}}</span>
                      <span>{{item.orderinqiry.OdiqRemarks}}</span>
                    </div>
                  </div>
                  <!-- RF -->
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'RF'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'RF'
                    "
                    class="two"
                  >
                    <div class="input-info">
                      <span><i class="iconfont icon-wendu1"></i>温度:</span>
                      <span>{{item.orderData.OdiqTemperature}}℃</span>
                      <span>{{item.orderinqiry.OdiqTemperature}}℃</span>
                    </div>
                    <div class="input-info">
                      <span>货物:</span>
                      <span>{{item.orderData.OdiqGoods}}</span>
                      <span>{{item.orderinqiry.OdiqGoods}}</span>
                    </div>
                    <div class="input-remark">
                      <span>备注:</span>
                      <span>{{item.orderData.OdiqRemarks}}</span>
                      <span>{{item.orderinqiry.OdiqRemarks}}</span>
                    </div>
                  </div>
                  <!--OT  -->
                  <div
                    v-if="
                      item.tempOrder.Container.CntrName.substring(2) == 'OT'
                      item.tempOrder.Container.CntrName.substring(2,4) == 'OT'
                    "
                    class="two"
                  >
                    <div class="input-info">
                      <span>货物:</span>
                      <span>{{item.orderData.OdiqGoods}}</span>
                      <span>{{item.orderinqiry.OdiqGoods}}</span>
                    </div>
                    <div class="bulk">
                      <div>
                        <span>高:</span>
                        <span>{{item.orderData.OdiqHeight}}</span>
                        <span>{{item.orderinqiry.OdiqHeight}}</span>
                      </div>
                    </div>
                    <div class="input-remark">
                      <span>备注:</span>
                      <span>{{item.orderData.OdiqRemarks}}</span>
                      <span>{{item.orderinqiry.OdiqRemarks}}</span>
                    </div>
                  </div>
                  <!-- 初次之外的样式 -->
                  <div   v-if="
                      (item.tempOrder.Container.CntrName.substring(2) != 'OT'&& item.tempOrder.Container.CntrName.substring(2) != 'FR')&& item.tempOrder.Container.CntrName.substring(2) != 'RF'
                      (item.tempOrder.Container.CntrName.substring(2,4) != 'OT'&& item.tempOrder.Container.CntrName.substring(2,4) != 'FR')&& item.tempOrder.Container.CntrName.substring(2,4) != 'RF'
                    "
                    class="two" >
                        <div class="input-info">
                      <span>货物:</span>
                      <span>{{item.orderData.OdiqGoods}}</span>
                      <span>{{item.orderinqiry.OdiqGoods}}</span>
                    </div>
                  
                    <div class="input-remark">
                      <span>备注:</span>
                       <span>{{item.orderData.OdiqRemarks}}</span>
                       <span>{{item.orderinqiry.OdiqRemarks}}</span>
                    </div>
                  </div>
                </div>
@@ -387,7 +404,7 @@
        :demo="perfectBoxData"
        :count="boxCount"
        :type="orderType"
        :self="selfOwer"
        @info="acceptInfo"
      ></info-dialog>
    </el-dialog>
@@ -422,7 +439,7 @@
      boxCount: 1,
      begin: {},
      orderType:0, //装卸类型
      selfOwer:false
    };
  },
  props: ["orderall"],
@@ -435,20 +452,9 @@
  watch: {
    orderall: {
      handler(val) {
        console.log("箱子类型里面收到的值",val)
        this.orderType = val.OrderType;
        for (var i = 0; i < val.tempOrderForms.length; i++) {
          // var orderinQiry = {
          //   TempOrderID: "",
          //   OdiqWeight: "",
          //   OdiqTemperature: "",
          //   OdiqLong: "",
          //   OdiqWidth: "",
          //   OdiqHeight: "",
          //   OdiqRemarks: "",
          //   OdiqGoods:""
          // };
          // val.tempOrderForms[i].orderData = orderinQiry;
          val.tempOrderForms[i].isNumDisable = false;
          if (
            val.tempOrderForms[i].tempOrder.IsUrgent == null ||
@@ -464,10 +470,10 @@
            val.tempOrderForms[i].tempOrder.SelfBox == 0
          ) {
            val.tempOrderForms[i].tempOrder.SelfBox = false;
            this.selfOwer = false;
            // this.selfOwer = false;
          } else {
            val.tempOrderForms[i].tempOrder.SelfBox = true;
            this.selfOwer = true;
            // this.selfOwer = true;
          }
          if (
            val.tempOrderForms[i].tempOrder.IsCarPooling == null ||
@@ -483,27 +489,48 @@
      deep: true,
    },
    pollArr(val) {
      //点击询价后该数组就有询价id了,然后进行询价
      if (val.length != 0) {
        console.log(val);
        this.begin = setInterval(() => {
          this.getPolling({ OdiqIds: val });
          if (this.pollData.length != 0) {
            this.pollData.forEach((item, index) => {
              if (this.pollArr.indexOf(item.OdiqId) > -1) {
                this.pollArr.splice(index, 1);
              }
            });
          }
        }, 3000);
          // if (this.pollData.length != 0) {
          //   this.pollData.forEach((item, index) => {
          //     if (this.pollArr.indexOf(item.OdiqId) > -1) { //里面包含此id就进行删除
          //       //已经回复价格了的进行删除
          //       this.pollArr.splice(index, 1);
          //       console.log("询价成功后",this.pollArr)
          //     }
          //   });
          // }
        }, 30000);
      } else {
        console.log(this.pollArr);
        console.log(this.begin);
        clearInterval(this.begin);
      }
    },
  },
  methods: {
    //复制箱子
    copyBox(content,index){
      var model = Object.assign(content)
        this.copySingleBox(model,index)
    },
    //复制箱子的接口
    async copySingleBox(model,index){
      await this.$axios.post("/api/Order/CopySingeContainner",this.$qs.stringify({tempOrderID:model.tempOrder.TempOrderID})).then(res=>{
        console.log(res);
        // model = Object.assign(model)
        this.$parent.getTempOrder();
         this.tempOrderForms.splice(index,0,model);
      }).catch(err=>{
        this.$message.error("复制失败");
        console.log(err)
      })
    },
    perfectInfo(content, index) {
      console.log("箱子信息",content);
      this.boxCount = index;
@@ -565,13 +592,17 @@
          SelfBox: 1,
          TempOrderID: content.tempOrder.TempOrderID,
        });
        this.selfOwer = val;
        // this.selfOwer = val;
      } else {
        this.getSingeTemp({
          SelfBox: 0,
          TempOrderID: content.tempOrder.TempOrderID,
        });
          this.selfOwer = val;
        //取消自备箱的时候清除箱号
        for(var i=0;i<content.tempOrder.TempOrderContainer.length;i++){
        }
          // this.selfOwer = val;
      }
    },
    //调整数量
@@ -600,15 +631,15 @@
              console.log(res);
            })
            .catch((err) => {
              this.$message.error("出错了");
              console.log(err);
            });
        })
        .catch(() => {});
    },
    //询价
    enquiry(id, item) {
      console.log(item);
      console.log(this.tempOrderForms);
    enquiry(id, item,index) {
      this.tempOrderForms[index].tempOrder.IsInquiryAllowed = 2;
      item.orderData.TempOrderID = id;
      this.getEnquiry(item.orderData);
    },
@@ -617,7 +648,18 @@
      await this.$axios
        .post("/api/Order/GetPollingInquiry", this.$qs.stringify(model))
        .then((res) => {
          this.pollData = res.data;
          // 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){
                  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);
                }
            }
          }
        })
        .catch((err) => {
          console.log(err);
@@ -659,8 +701,11 @@
    },
    //调整箱子信息
    acceptInfo(e) {
      console.log("修改箱子信息内容",e)
      console.log("调整箱子",this.tempOrderForms);
      this.infoDialog = false;
      var arr = [];
      //根据more里面的长度,来决定有几个箱子
      if (e.moreBox.length > 1) {
        for (var i = 0; i < e.moreBox.length; i++) {
          arr.push({
@@ -685,15 +730,21 @@
        });
      }
      this.getSingeTemp({ TempOrderID: e.id, TempOrderContainer: arr });
      // 给箱号赋值进行展示
      this.tempOrderForms[e.index].TempOrderContainer[0].ContainerNo =
        e.moreBox[0].ContainerNo;
      // 给提单号赋值进行展示
      var  a = e.index
      if(  this.tempOrderForms[a].tempOrder.TempOrderContainer.length==0){
          this.tempOrderForms[a].tempOrder.TempOrderContainer=(arr);
      }else{
          this.tempOrderForms[a].tempOrder.TempOrderContainer[0].BolCode=
        e.BolCode;
      }
      //禁用数量
      this.tempOrderForms[e.index].isNumDisable = true;
      setTimeout(() => {
        this.getTempOrder();
      }, 200);
      console.log(this.tempOrderForms);
      this.tempOrderForms[a].isNumDisable = true;
      // setTimeout(() => {
      //   this.getTempOrder();
      // }, 200);
      // console.log(this.tempOrderForms);
    },
    handleClose(done) {