Ver código fonte

结算和副产品

zouzhd 3 anos atrás
pai
commit
b040e49c37
33 arquivos alterados com 3121 adições e 1002 exclusões
  1. 2 2
      build/utils.js
  2. 1 1
      config/index.js
  3. 16 15
      src/views/RMS/components/addCapacity.vue
  4. 2 2
      src/views/RMS/components/capacity.vue
  5. 93 3
      src/views/RMS/components/transitRoute.vue
  6. 28 23
      src/views/TMS/components/importedFuel/transportReserveRanAdd.vue
  7. 141 109
      src/views/TMS/components/importedIngredients/transportReserveFu.vue
  8. 407 167
      src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue
  9. 160 46
      src/views/TMS/components/importedIngredients/transportReserveFuEdit.vue
  10. 106 73
      src/views/TMS/components/importedIngredients/truckDriverReceiveFu.vue
  11. 12 35
      src/views/TMS/components/importedIngredients/truckEnfactoryFuResult.vue
  12. 13 153
      src/views/TMS/components/importedIngredients/truckJiMaoFuResult.vue
  13. 15 12
      src/views/TMS/components/importedIngredients/truckJiPiFuResult.vue
  14. 14 24
      src/views/TMS/components/importedIngredients/truckLeaveFactoryFuResult.vue
  15. 15 27
      src/views/TMS/components/importedIngredients/truckQualityFuResult.vue
  16. 12 24
      src/views/TMS/components/importedIngredients/truckReceiptFuResult.vue
  17. 15 27
      src/views/TMS/components/importedIngredients/truckUnloadFuResult.vue
  18. 28 24
      src/views/TMS/components/purchaseChemicalMaterials/transportationReservationAdd.vue
  19. 222 65
      src/views/appoint/components/saleContract/addSaleOrderArrange.vue
  20. 1077 0
      src/views/appoint/components/saleContract/addSaleOrderCoproductSend.vue
  21. 191 58
      src/views/appoint/components/saleContract/addSaleOrderSend.vue
  22. 114 37
      src/views/appoint/components/saleContract/addTransportPrice.vue
  23. 9 0
      src/views/appoint/components/saleContract/saleOrder.vue
  24. 1 1
      src/views/appoint/components/saleContract/saleOrderArrange.vue
  25. 1 48
      src/views/appoint/components/saleContract/transportPrice.vue
  26. 2 0
      src/views/appoint/router/index.js
  27. 6 6
      src/views/sale/components/transportFreight/saleTruckSettlement/addBmsTruckStatement.vue
  28. 6 6
      src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckAudit.vue
  29. 352 6
      src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailOrder.vue
  30. 2 1
      src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckStatement.vue
  31. 2 1
      src/views/sale/components/transport_appointment/directionalDispatch.vue
  32. 4 5
      src/views/sale/components/transport_appointment/openDistribution.vue
  33. 52 1
      src/views/sale/components/transport_order/receiveOrder.vue

+ 2 - 2
build/utils.js

@@ -15,8 +15,8 @@ const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应
 // ['index','appoint','configManager','homepage','inward','queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-let devModules = ['all'];
-// let devModules = ['index','appoint','sale','TMS','statisticalReport','RMS'];
+// let devModules = ['all'];
+let devModules = ['index','appoint','sale','statisticalReport','RMS'];
 // let devModules = ['index','appoint','TMS'];
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;

+ 1 - 1
config/index.js

@@ -66,7 +66,7 @@ let proxyTable = {
   "/api/v1": {
     target: "http://172.16.33.166:8080",
     // target: "http://192.168.1.102:8019",
-    // target: "http://192.168.1.114:8019",
+    // target: "http://192.168.1.108:8019",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"

+ 16 - 15
src/views/RMS/components/addCapacity.vue

@@ -66,7 +66,7 @@ export default {
   created() {
     this.carrierUserId = getCookie("userId");
     this.form1 = this.form1Initialization;
-    console.log(this.carrierUserId, "carrierUserId");
+    // console.log(this.carrierUserId, "carrierUserId");
   },
   mounted() {
     this.axios
@@ -75,7 +75,7 @@ export default {
       )
       .then((res) => {
         if (res.data.code == "200") {
-          console.log(res.data.data);
+          // console.log(res.data.data);
           if (res.data.data) {
             this.state = res.data.data.carrierName;
             this.carrierIds = res.data.data.carrierId;
@@ -95,7 +95,7 @@ export default {
         .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
         .then((res) => {
           if (res.data.code == "200") {
-            console.log(res.data.data);
+            // console.log(res.data.data);
             var restaurants = res.data.data;
             // console.log(restaurants, "restaurants");
             var results = queryString
@@ -141,7 +141,7 @@ export default {
         });
     },
     isVehicleNumber(vehicleNumber) {
-      console.log(vehicleNumber);
+      // console.log(vehicleNumber);
       var result = false;
       if (vehicleNumber.length == 7) {
         var express =
@@ -183,6 +183,7 @@ export default {
         this.$message.error("存在空值!");
         this.addLoading = false;
       } else {
+        //新增SSO运力账号
         var formData = new FormData();
         formData.append("userCode", this.form1.capacityNumber.toUpperCase());
         formData.append("orgCode", "yunli");
@@ -190,21 +191,21 @@ export default {
         formData.append("groupId", "506514577756917769");
         formData.append("companyId", "713710108567277568");
         formData.append("orgId", "924126716337721344");
-        console.log(formData.get("userCode"));
-        console.log(typeof formData);
+        // console.log(formData.get("userCode"));
+        // console.log(typeof formData);
         this.$store
           .dispatch("system/usersManage/addUser", formData)
           .then((res) => {
-            console.log(res);
+            // console.log(res);
             if (res.code === "0") {
-              console.log(res.data.userId);
+              // console.log(res.data.userId);
               this.userId = res.data.userId;
               this.userCode = res.data.userCode;
               RmsCapacity.ssoId = res.data.userId;
               this.axios
                 .post("/api/v1/rms/insertCapacity", RmsCapacity)
                 .then((res) => {
-                  if (res.data.code == "200") {
+                  if (res.data.data == 1) {
                     this.insertRole(this.userId, this.userCode);
                     this.$message.success("添加成功");
                     this.$router.push("capacity");
@@ -215,10 +216,10 @@ export default {
                   }
                 });
             } else {
-              console.log(RmsCapacity, "RmsCapacity");
+              // console.log(RmsCapacity, "RmsCapacity");
               if (res.message == "账号已被注册") {
                 this.$confirm(
-                  "该账号已经绑定承运商, 是否确定进行更改?",
+                  "该账号已经被注册, 是否确定新增承运商绑定关系?",
                   "提示",
                   {
                     confirmButtonText: "确定",
@@ -230,12 +231,12 @@ export default {
                     this.axios
                       .post("/api/v1/rms/insertCapacity", RmsCapacity)
                       .then((res) => {
-                        console.log(res, "res");
-                        if (res.data.code == "200") {
-                          this.$message.success("更改成功");
+                        // console.log(res, "res");
+                        if (res.data.data == 0) {
+                          this.$message.success("新增承运商绑定关系成功!");
                           this.$router.push("capacity");
                         } else {
-                          this.$message.error("请联系管理人员");
+                          this.$message.error("该绑定关系已存在!");
                         }
                       });
                   })

+ 2 - 2
src/views/RMS/components/capacity.vue

@@ -21,7 +21,7 @@
         @func="func"
         :isKuang="isKuang"
       >
-        <el-table-column fixed="right" label="操作" width="100">
+        <!-- <el-table-column fixed="right" label="操作" width="100">
           <template slot-scope="scope">
             <el-button
               type="text"
@@ -38,7 +38,7 @@
               删除
             </el-button>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </dilTable>
     </div>
   </div>

+ 93 - 3
src/views/RMS/components/transitRoute.vue

@@ -13,14 +13,20 @@
       </el-button>
     </div>
     <div class="tab">
-      <dilTable v-bind.sync="option">
+      <dilTable v-bind.sync="option" ref="table">
         <el-table-column label="操作">
           <template slot-scope="scope">
-            <el-button
+            <!-- <el-button
               type="text"
               size="mini"
               @click="transitRouteUpdata(scope.row.lineId)"
               >修改</el-button
+            > -->
+            <el-button
+              size="mini"
+              type="text"
+              @click="transitRouteDetail(scope.row)"
+              >路线详情</el-button
             >
             <el-button
               size="mini"
@@ -30,6 +36,26 @@
             >
           </template>
         </el-table-column>
+
+        <!-- 线路详情抽屉 -->
+        <el-table-column type="expand" width="1">
+          <template slot-scope="props">
+            <el-form label-position="center" inline class="demo-table-expand">
+              <div v-if="false">{{ props }}</div>
+              <div>
+                <el-table :data="tableData" border >
+                  <el-table-column
+                    v-for="(item, i) in tableHead"
+                    :key="i"
+                    :prop="item.prop"
+                    :label="item.label"
+                    :width="item.width"
+                  ></el-table-column>
+                </el-table>
+              </div>
+            </el-form>
+          </template>
+        </el-table-column>
       </dilTable>
     </div>
   </div>
@@ -46,6 +72,33 @@ export default {
         requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249",
       },
       countNumber: 0,
+      //记录旧的row对象
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态
+      oldRowCount: 1,
+      tableHead: [
+        {
+          prop: "enfactoryGatepostName",
+          label: "进门门岗",
+          width: 150,
+        },
+        {
+          prop: "outfactoryGatepostName",
+          label: "出门门岗",
+          width: 150,
+        },
+        {
+          prop: "grossNumber",
+          label: "计毛汽车衡",
+          width: 150,
+        },
+        {
+          prop: "tareNumber",
+          label: "计皮汽车衡",
+          width: 150,
+        },
+      ],
+      tableData: [],
     };
   },
   methods: {
@@ -57,7 +110,7 @@ export default {
             if (res.data.data > 0) {
               this.$message({
                 showClose: true,
-                message: "此路线已经和运输订单关联,不能进行修改!",
+                message: "此路线已经和运输订单关联,不能进行修改!",
                 type: "warning",
               });
             } else {
@@ -106,6 +159,43 @@ export default {
         path: "/transitRouteAdd/0",
       });
     },
+    // -------查看线路详情
+    transitRouteDetail(row) {
+      // 记录重复点击次数
+      if (this.oldRow === row) {
+        this.oldRowCount += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow != "") {
+        if (this.oldRow != row) {
+          if (this.oldRowCount % 2 === 1) {
+            this.$refs.table.toggleRowExpansion(this.oldRow);
+          } else {
+            this.oldRowCount = 1;
+          }
+        } else {
+          this.oldRow = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow = row;
+      this.getMaterial(row.lineId);
+    },
+    // 根据线路id查询物资信息
+    getMaterial(lineId) {
+      this.axios
+        .post("/api/v1/rms/getGateCalculateMes?lineId="+lineId)
+        .then((res) => {
+          var lineInfo = [];
+          if(res.data.data!=null){
+            lineInfo.push(res.data.data);
+          }
+          this.tableData = lineInfo;
+        });
+    },
     //跳转修改界面
     transitRouteUpdata(lineId) {
       this.initialization(lineId, 1);

+ 28 - 23
src/views/TMS/components/importedFuel/transportReserveRanAdd.vue

@@ -2,7 +2,24 @@
   <!-- 新增运输作业页面 -->
   <div id="contractDetails">
     <page-title>运输预约</page-title>
+    <div class="orderType from">
+      <span class="text">订单类别:</span>
+      <el-select
+        class="select"
+        v-model="orderType"
+        placeholder="请选择"
 
+      >
+        <el-option
+          v-for="item in orderTypeList"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+      <span class="span"></span>
+    </div>
     <div class="material from">
       <span class="text">物资:</span>
       <el-input class="input" v-model="materialName" disabled> </el-input>
@@ -34,24 +51,6 @@
       <el-input class="input" v-model="purchaseOrderNo" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(6)">浏览</el-button>
     </div>
-    <div class="orderType from">
-      <span class="text">订单类别:</span>
-      <el-select
-        class="select"
-        v-model="orderType"
-        placeholder="请选择"
-        disabled
-      >
-        <el-option
-          v-for="item in orderTypeList"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-      <span class="span"></span>
-    </div>
     <div class="contractTitle from">
       <dil-form :formId="219" v-model="form1"></dil-form>
     </div>
@@ -368,11 +367,11 @@ export default {
               this.remark = res.data.data.remark;
               this.purchaseOrderId = res.data.data.purchaseOrderId;
               this.purchaseOrderNo = res.data.data.purchaseOrderNo;
-              if (res.data.data.receiveUnitId == 1) {
-                this.orderType = 6;
-              } else {
-                this.orderType = 7;
-              }
+              // if (res.data.data.receiveUnitId == 1) {
+              //   this.orderType = 6;
+              // } else {
+              //   this.orderType = 7;
+              // }
             }
           } else {
             this.$message.error("请求失败");
@@ -567,6 +566,12 @@ export default {
             type: "warning",
           });
           return;
+        } else if (!this.orderType) {
+          this.$message({
+            message: "请选择订单类别!",
+            type: "warning",
+          });
+          return;
         } else if (!this.supplierId) {
           this.$message({
             message: "请选择发货单位!",

+ 141 - 109
src/views/TMS/components/importedIngredients/transportReserveFu.vue

@@ -1,31 +1,65 @@
 <template>
-  <!-- 采购辅料运输预约 -->
+  <!-- 辅料运输预约 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" 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" @click="insertClick" >
+      <el-input
+        class="input"
+        placeholder="请输入内容"
+        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="insertClick">
         <i class="el-icon-plus"></i>新增
       </el-button>
-       <el-button type="primary" @click="sendClick(0)" >
-        <i class="el-icon-bottom"></i>下发
+      <el-button
+        type="primary"
+        class="btn"
+        @click="issue"
+        v-if="activeName == 'first'"
+      >
+        <i class="el-icon-plus"></i>下发
       </el-button>
     </div>
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-         <!-- 未下发 -->
+    <el-tabs v-model="activeName">
+      <!-- 未下发 -->
       <el-tab-pane label="未下发" name="first">
-        <dilTable v-bind.sync="option1" ref="table" @selection-change="selectionChange">
-          <el-table-column fixed="right" align="center" label="操作" width="120">
+        <dilTable
+          v-bind.sync="option1"
+          ref="table"
+          @selection-change="selectionChange"
+        >
+          <el-table-column
+            fixed="right"
+            align="center"
+            label="操作"
+            width="120"
+          >
             <template slot-scope="scope">
-              <el-button @click="sendClick(1,scope.row.orderId)"  type="text" size="small">
+              <el-button
+                @click="sendClick(scope.row.orderId)"
+                type="text"
+                size="small"
+              >
                 下发
               </el-button>
-              <el-button @click="updateClick(scope.row.orderId)" type="text" size="small">
+              <el-button
+                @click="updateClick(scope.row.orderId)"
+                type="text"
+                size="small"
+              >
                 修改
               </el-button>
-              <el-button @click="deleteClick(scope.row.orderId, scope.row.capacityNumber)" type="text" size="small">
+              <el-button
+                @click="
+                  deleteClick(scope.row.orderId, scope.row.capacityNumber)
+                "
+                type="text"
+                size="small"
+              >
                 删除
               </el-button>
             </template>
@@ -34,21 +68,14 @@
       </el-tab-pane>
       <!-- 已下发 -->
       <el-tab-pane label="已下发" name="second">
-        <dilTable v-bind.sync="option2">
-           <el-table-column fixed="right" align="center" label="操作" width="120">
-            <template slot-scope="scope">
-              <el-button @click="CloseClick(scope.row.orderId)"  type="text" size="small">
-               关闭
-              </el-button>
-            </template>
-          </el-table-column>
-        </dilTable>
+        <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() {
@@ -58,72 +85,90 @@ export default {
       activeName: "first",
       option1: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5",
-        // 控制显示多选列
+        requestUrl: "",
         selectionType: "select",
+        mapList: [],
       },
-       option2: {
+      option2: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=4&orderType=5",
+        requestUrl: "",
       },
-      selection:[],
     };
   },
+  created() {
+    //判断是否是承运商
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.option1.requestUrl =
+        "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&carrierSSOId=" +
+        getCookie("userId");
+      this.option2.requestUrl =
+        "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=111&orderType=5&carrierSSOId=" +
+        getCookie("userId");
+    } else {
+      this.option1.requestUrl =
+        "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&carrierSSOId=" +
+        null;
+      this.option2.requestUrl =
+        "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=111&orderType=5&carrierSSOId=" +
+        null;
+    }
+  },
   methods: {
-    //获取选中的订单
-    selectionChange(selection){
-      this.selection = [];
-      selection.forEach(e => {
-       this.selection.push({orderId:e.orderId});
-      });
-    },
     onclick() {
-      if(this.activeName == "first"){
-        this.option1.requestUrl = "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&con=" + this.input;
-      }else{
-        this.option2.requestUrl = "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=4&orderType=5&con=" + this.input;
-      }
+      if (this.activeName == "first") {
+        //判断是否是承运商
+        if (getCookie("orgCode") == "chengyunshang") {
+          this.option1.requestUrl =
+            "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&carrierSSOId=" +
+            getCookie("userId") +
+            "&con=" +
+            this.input;
+        } else {
+          this.option1.requestUrl =
+            "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&carrierSSOId=" +
+            null +
+            "&con=" +
+            this.input;
+        }
+      } else {
+        //判断是否是承运商
+        if (getCookie("orgCode") == "chengyunshang") {
+          this.option1.requestUrl =
+            "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=111&orderType=5&carrierSSOId=" +
+            getCookie("userId") +
+            "&con=" +
+            this.input;
+        } else {
+          this.option1.requestUrl =
+            "/api/v1/oms/getAllTruckOrder?apiId=243&orderStatus=111&orderType=5&carrierSSOId=" +
+            null +
+            "&con=" +
+            this.input;
+        }
+      }
     },
-    handleClick(tab, event) {
-      console.log(tab, event);
+    selectionChange(selection) {
+      this.mapList = selection;
     },
-     // 下发
-    CloseClick(orderId) {
-      this.$confirm("是否关闭", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
-         this.axios
-            .post(
-              "/api/v1/oms/CloseOrder",{
-                orderId: orderId
-              }
-            )
-            .then(() => {
-              this.$router.go(0);
-            })
-        .then(() => {
-          this.$message({
-            type: "success",
-            message: "关闭成功!",
-          });
-          // console.log(this.arr[0].text_prop);
-   
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "取消关闭!",
-          });
+    issue() {
+      let mapvalue = {
+        mapList: this.mapList,
+      };
+      this.axios.post("/api/v1/oms/dispatchOrder", mapvalue).then(() => {
+        this.$message({
+          type: "success",
+          message: "下发成功!",
         });
+        this.option1.requestUrl =
+          "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&i=" +
+          new Date();
+      });
     },
-
-
-    //关闭
-
-    sendClick(index,orderId) {
+    // 下发
+    sendClick(orderId) {
+      let mapvalue = {
+        mapList: [{ orderId: orderId }],
+      };
       this.$confirm("是否下发", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -131,32 +176,15 @@ export default {
         center: true,
       })
         .then(() => {
-          let orderList = [];
-          if(index == 0){
-            if(this.selection.length > 0){
-              orderList=this.selection;
-            }else{
-            this.$message({
-              type: "warning",
-              message: "请选择要下发的订单!",
-            });
-            }
-          }else if(index == 1){
-            orderList.push({orderId:orderId})
-          }
-          this.axios
-            .post(
-              "/api/v1/oms/dispatchOrder",{
-                mapList:orderList
-              }
-            )
-            .then(() => {
-              this.option1.requestUrl = "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&i=0"
-            });
+          this.axios.post("/api/v1/oms/dispatchOrder", mapvalue).then(() => {
             this.$message({
               type: "success",
               message: "下发成功!",
             });
+            this.option1.requestUrl =
+              "/api/v1/oms/getAllTruckOrder?apiId=141&orderStatus=3&orderType=5&i=" +
+              new Date();
+          });
         })
         .catch(() => {
           this.$message({
@@ -179,12 +207,10 @@ export default {
             message: "删除成功!",
           });
           this.axios
-            .post(
-               "/api/v1/oms/deleteOrder",{
-                 orderId: orderId,
-                 capacityNumber: capacityNumber
-              }
-            )
+            .post("/api/v1/oms/deleteOrder", {
+              orderId: orderId,
+              capacityNumber: capacityNumber,
+            })
             .then(() => {
               this.$router.go(0);
             });
@@ -204,14 +230,20 @@ export default {
     updateClick(orderId) {
       this.$router.push("/transportReserveFuEdit/" + orderId);
     },
-
   },
 };
 </script>
 <style lang='scss' scoped>
 .homeworkPath {
-   .top {
-    padding: 1.25rem 1.875rem;
+  .top {
+    padding: 40px;
+    .input {
+      width: 250px;
+      margin-right: 20px;
+    }
+    .btn {
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 407 - 167
src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue

@@ -2,37 +2,54 @@
   <!-- 新增运输作业页面 -->
   <div id="contractDetails">
     <page-title>运输预约</page-title>
-
-    <div class="main">
-      <el-divider content-position="left">新增运输预约</el-divider>
+    <div class="orderType from">
+      <!-- <span class="text">订单类别:</span>
+      <el-select
+        class="select"
+        v-model="orderType"
+        placeholder="请选择"
+      >
+        <el-option
+          v-for="item in orderTypeList"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select> -->
+      <span class="span"></span>
     </div>
-
     <div class="material from">
       <span class="text">物资:</span>
-      <el-input v-model="materialName" disabled> </el-input>
+      <el-input class="input" v-model="materialName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
     </div>
 
     <div class="forwardingUnit from">
       <span class="text">发货单位:</span>
-      <el-input v-model="supplierName" disabled> </el-input>
+      <el-input class="input" v-model="supplierName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
     </div>
     <div class="remark from">
       <span class="text">船名:</span>
-      <el-input v-model="remark" @blur="onBlur"> </el-input>
+      <el-input class="input" v-model="remark" @blur="onBlur"> </el-input>
       <span class="span"></span>
     </div>
     <div class="forwardingUnit from">
       <span class="text">卸货点:</span>
-      <el-input v-model="unloadPointName" disabled> </el-input>
+      <el-input class="input" v-model="unloadPointName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
     </div>
     <div class="lineId from">
       <span class="text">选择路线:</span>
-      <el-input v-model="lineName" disabled> </el-input>
+      <el-input class="input" v-model="lineName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(5)">浏览</el-button>
     </div>
+    <div class="lineId from">
+      <span class="text">采购订单号:</span>
+      <el-input class="input" v-model="purchaseOrderNo" disabled> </el-input>
+      <el-button type="primary" @click="ondrawer(6)">浏览</el-button>
+    </div>
     <div class="contractTitle from">
       <dil-form :formId="219" v-model="form1"></dil-form>
     </div>
@@ -44,25 +61,10 @@
         >
       </div>
     </div>
-    <!-- 车辆表格 -->
-    <div class="switch" v-if="selectionList.length > 0">
-      <el-tooltip placement="top">
-        <div slot="content">下面表格已有数据,不能进行更改!!!</div>
-        <el-switch
-          v-model="value"
-          active-text="重量"
-          inactive-text="件数"
-          disabled
-        >
-        </el-switch>
-      </el-tooltip>
-    </div>
-    <div class="switch" v-else>
-      <el-tooltip placement="top">
-        <div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
-        <el-switch v-model="value" active-text="重量" inactive-text="件数">
-        </el-switch>
-      </el-tooltip>
+    <div class="lineId from">
+      <span class="text">该批车辆是否一车多趟:</span>
+      <el-switch v-model="isMoreTrips" active-text="是" inactive-text="否">
+      </el-switch>
     </div>
     <div class="truckListTable">
       <el-table
@@ -81,22 +83,15 @@
           align="center"
           show-overflow-tooltip
         >
-          <template slot="scope" v-if="item.th_name !== '件数'">
-            <span>{{ item.label }}</span>
-          </template>
           <template slot="scope" v-if="item.th_name !== '重量'">
             <span>{{ item.label }}</span>
           </template>
           <!-- 插入输入框 -->
           <template slot-scope="scope">
             <template v-if="item.slot">
-              <template v-if="item.prop == 'orderMaterialNumber'">
-                <el-input
-                  v-model.number="scope.row.orderMaterialNumber"
-                ></el-input>
-              </template>
               <template v-if="item.prop == 'orderMaterialWeight'">
                 <el-input
+                  style="width: 250px"
                   v-model.number="scope.row.orderMaterialWeight"
                 ></el-input>
               </template>
@@ -117,49 +112,82 @@
       </el-table>
     </div>
     <!-- 模态窗口 -->
-    <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
-      <el-input
-        placeholder="请输入内容"
-        v-model="input"
-        style="margin-top: 0.625rem; margin-left: 1.25rem"
-        clearable
-      ></el-input>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="onclick(a)"
-        style="margin-bottom: 0.9375rem"
-      >
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <div v-show="a == 1">
+    <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
+      <div class="drawer_top">
+        <el-input
+          placeholder="请输入内容"
+          v-model="input"
+          style="margin-top: 10px; margin-right: 10px; width: 250px"
+          clearable
+        ></el-input>
+        <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+      </div>
+      <div class="drawer_table1" v-show="onDrawerNumber == 1">
         <dilTable
           v-bind.sync="frist"
           @radio-change="currentRadioChange1"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth"
+          :shiyHeigth="shiyHeigth"
+          :drawer="drawer"
         ></dilTable>
       </div>
-      <div v-show="a == 2">
+      <div v-show="onDrawerNumber == 2">
         <dilTable
           v-bind.sync="secend"
           @radio-change="currentRadioChange2"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth1"
+          :shiyHeigth="shiyHeigth1"
+          :drawer="drawer"
         ></dilTable>
       </div>
-      <div v-show="a == 3">
+      <div v-show="onDrawerNumber == 3">
         <dilTable
           v-bind.sync="third"
           @selection-change="currentRadioChange3"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth2"
+          :shiyHeigth="shiyHeigth2"
+          :drawer="drawer"
         ></dilTable>
       </div>
-      <div v-show="a == 4">
+      <div v-show="onDrawerNumber == 4">
         <dilTable
           v-bind.sync="unloadPoint"
           @radio-change="currentRadioChange4"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth3"
+          :shiyHeigth="shiyHeigth3"
+          :drawer="drawer"
         ></dilTable>
       </div>
-      <div v-show="a == 5">
+      <div v-show="onDrawerNumber == 5">
         <dilTable
           v-bind.sync="line"
           @radio-change="currentRadioChange5"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth4"
+          :shiyHeigth="shiyHeigth4"
+          :drawer="drawer"
+        ></dilTable>
+      </div>
+      <div v-show="onDrawerNumber == 6">
+        <dilTable
+          v-bind.sync="purchaseOrder"
+          @radio-change="currentRadioChange6"
+          :isKuang="isKuang"
+          @func="func"
+          :isHeigth="isHeigth5"
+          :shiyHeigth="shiyHeigth5"
+          :drawer="drawer"
         ></dilTable>
       </div>
     </el-drawer>
@@ -171,11 +199,45 @@
 </template>
 <script>
 import PageTitle from "@/components/Page/Title";
-
+import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
+      //限定first
+      isHeigth:true,
+      shiyHeigth:140,
+      //限定second
+      isHeigth1:true,
+      shiyHeigth1:140,
+      //限定third
+      isHeigth2:true,
+      shiyHeigth2:140,
+      //限定unloadPoint
+      isHeigth3:true,
+      shiyHeigth3:140,
+      //限定line
+      isHeigth4:true,
+      shiyHeigth4:140,
+      //限定purchaseOrder
+      isHeigth5:true,
+      shiyHeigth5:140,
+      isKuang: false,
+      //采购订单号
+      purchaseOrderNo: "",
+      isMoreTrips: false,
+      //订单类别
+      orderTypeList: [
+        {
+          value: 6,
+          label: "老厂区",
+        },
+        {
+          value: 7,
+          label: "新厂区",
+        },
+      ],
       // 线路名称
       lineName: "",
       //线路id
@@ -197,8 +259,8 @@ export default {
           width: "140",
         },
         {
-          prop: "orderMaterialNumber",
-          label: "件数",
+          prop: "orderMaterialWeight",
+          label: "重量",
           slot: true,
         },
       ],
@@ -222,54 +284,57 @@ export default {
       unloadPointId: "",
       //卸货点名称
       unloadPointName: "",
-      a: 1,
+      //订单类别
+      orderType: 5,
+      onDrawerNumber: 1,
       direction: "rtl",
       input: "",
       frist: {
-        requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
+        requestUrl: "",
         selectionType: "radio",
         mapList1: [],
       },
       secend: {
-        requestUrl:
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
+        requestUrl: "",
         selectionType: "radio",
         mapList2: [],
       },
       third: {
-        requestUrl: "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248",
+        requestUrl: "",
         selectionType: "select",
         mapList3: [],
       },
       unloadPoint: {
-        requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
+        requestUrl: "",
         selectionType: "radio",
       },
       line: {
-        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
+        requestUrl: "",
+        selectionType: "radio",
+      },
+      purchaseOrder: {
+        requestUrl: "",
         selectionType: "radio",
       },
     };
   },
   watch: {
-    value() {
-      if (this.value) {
-        this.tableTop.splice(this.tableTop.length - 1, 1);
-        this.tableTop.push({
-          prop: "orderMaterialWeight",
-          label: "重量",
-          slot: true,
-        });
-      } else {
-        this.tableTop.splice(this.tableTop.length - 1, 1);
-        this.tableTop.push({
-          prop: "orderMaterialNumber",
-          label: "件数",
-          slot: true,
-        });
+    drawer(val) {
+      if (val) {
+        this.input = null;
       }
     },
   },
+  created() {
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.third.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+        getCookie("userId");
+    } else {
+      this.third.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null;
+    }
+  },
   methods: {
     onClick(index) {
       this.selectionList.splice(index, 1);
@@ -297,9 +362,15 @@ export default {
               });
               this.form1 = [];
             } else {
+              console.log();
               this.remark = res.data.data.remark;
               this.purchaseOrderId = res.data.data.purchaseOrderId;
-              this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
+              this.purchaseOrderNo = res.data.data.purchaseOrderNo;
+              // if (res.data.data.receiveUnitId == 1) {
+              //   this.orderType = 6;
+              // } else {
+              //   this.orderType = 7;
+              // }
             }
           } else {
             this.$message.error("请求失败");
@@ -307,44 +378,135 @@ export default {
         });
       }
     },
-    onclick(a) {
-      if (a == 1) {
-        this.frist.requestUrl =
-          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-          this.input;
-      } else if (a == 2) {
-        this.secend.requestUrl =
-          "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
-          this.materialId +
-          "&index=" +
-          this.input;
-      } else if (a == 3) {
-        this.third.requestUrl =
-          "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&index=" +
-          this.input;
-      } else if (a == 4) {
-        this.third.requestUrl =
-          "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.input;
-      } else if (a == 5) {
-        this.option.requestUrl =
-          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+    onclick() {
+      if (this.input) {
+        this.isKuang = true;
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl =
+            "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
+            this.input;
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl =
+            "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
+            this.materialId +
+            "&index=" +
+            this.input;
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl =
+              "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+              getCookie("userId") +
+              "&index=" +
+              this.input;
+          } else {
+            this.third.requestUrl =
+              "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+              null +
+              "&index=" +
+              this.input;
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl =
+            "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.input;
+        } else if (this.onDrawerNumber == 5) {
+          this.line.requestUrl =
+            "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
+        } else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl =
+            "/api/v1/ams/getPurchaseOrderList?apiId=81&sendCompId=" +
+            this.supplierId +
+            "&con=" +
+            this.input +
+            "&i=" +
+            new Date();
+        }
+      } else {
+        if (this.onDrawerNumber == 1) {
+          this.frist.requestUrl =
+            "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&i=" +
+            new Date();
+        } else if (this.onDrawerNumber == 2) {
+          this.secend.requestUrl =
+            "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
+            this.materialId +
+            "&i=" +
+            new Date();
+        } else if (this.onDrawerNumber == 3) {
+          //判断是否是承运商查询车辆
+          if (getCookie("orgCode") == "chengyunshang") {
+            this.third.requestUrl =
+              "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+              getCookie("userId") +
+              "&i=" +
+              new Date();
+          } else {
+            this.third.requestUrl =
+              "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+              null +
+              "&i=" +
+              new Date();
+          }
+        } else if (this.onDrawerNumber == 4) {
+          this.unloadPoint.requestUrl =
+            "/api/v1/uc/getUnloadingMesByLike?apiId=374&i=" + new Date();
+        } else if (this.onDrawerNumber == 5) {
+          this.line.requestUrl =
+            "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
+        } else if (this.onDrawerNumber == 6) {
+          this.purchaseOrder.requestUrl =
+            "/api/v1/ams/getPurchaseOrderList?apiId=81&sendCompId=" +
+            this.supplierId +
+            "&i=" +
+            new Date();
+        }
       }
     },
     ondrawer(num) {
       this.drawer = true;
-      this.a = num;
-      if (num == 2) {
+      this.onDrawerNumber = num;
+      if (num == 1) {
+        this.frist.requestUrl =
+          "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
+          this.input;
+      } else if (num == 2) {
         this.secend.requestUrl =
           "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
           this.materialId;
+      } else if (num == 3) {
+        //判断是否是承运商查询车辆
+        if (getCookie("orgCode") == "chengyunshang") {
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            getCookie("userId") +
+            "&i=" +
+            new Date();
+        } else {
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            null +
+            "&i=" +
+            new Date();
+        }
+      } else if (num == 4) {
+        this.unloadPoint.requestUrl =
+          "/api/v1/uc/getUnloadingMesByLike?apiId=374&i=" + new Date();
+      } else if (num == 5) {
+        this.line.requestUrl =
+          "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=辅料&i=" + new Date();
+      } else if (num == 6) {
+        this.purchaseOrder.requestUrl =
+          "/api/v1/ams/getPurchaseOrderList?apiId=81&sendCompId=" +
+          this.supplierId +
+          "&i=" +
+          new Date();
       }
     },
     // 返回
     onClickCancel() {
-      this.$router.push("/transportReserveFu");
+      this.$router.push("/transportReserveRan");
     },
     currentRadioChange1(selection) {
-      this.input = null;
       this.materialName = selection.materialName;
       this.materialId = selection.materialId;
       this.getPurchaseOrderNo();
@@ -362,10 +524,22 @@ export default {
       this.lineName = selection.lineName;
       this.lineId = selection.lineId;
     },
+    currentRadioChange6(selection) {
+      this.materialName = selection.materialName;
+      this.materialId = selection.materialId;
+      this.supplierId = selection.supplierId;
+      this.supplierName = selection.supplierName;
+      this.purchaseOrderNo = selection.purchaseOrderNo;
+      this.purchaseOrderId = selection.purchaseOrderId;
+    },
     currentRadioChange3(selection) {
       this.selectionList = [];
       this.selectionList = selection;
     },
+    func(res) {
+      console.log(res);
+      this.isKuang = false;
+    },
     // 确认
     onClickConfirm() {
       var state = 0;
@@ -384,31 +558,45 @@ export default {
             message: "请选择物资!",
             type: "warning",
           });
-        } else if (!this.supplierId) {
+          return;
+        } 
+        // else if (!this.orderType) {
+        //   this.$message({
+        //     message: "请选择订单类别!",
+        //     type: "warning",
+        //   });
+        //   return;
+        // }
+         else if (!this.supplierId) {
           this.$message({
             message: "请选择发货单位!",
             type: "warning",
           });
+          return;
         } else if (!this.purchaseOrderId) {
           this.$message({
             message: "没有匹配的采购订单号!",
             type: "warning",
           });
+          return;
         } else if (!this.unloadPointId) {
           this.$message({
             message: "请选择卸货地点!",
             type: "warning",
           });
+          return;
         } else if (!this.lineId) {
           this.$message({
             message: "请选择运输路线!",
             type: "warning",
           });
+          return;
         } else if (!sjTime(this.form1.orderEntryTime)) {
           this.$message({
             message: "请选择预估进厂时间!",
             type: "warning",
           });
+          return;
         }
       }
       if (this.selectionList.length == 0) {
@@ -416,116 +604,159 @@ export default {
           message: "请选择车辆!",
           type: "warning",
         });
-        state = 0;
+        return;
       } else {
         this.selectionList.forEach((e) => {
-          if (e.orderMaterialNumber || e.orderMaterialWeight) {
-            if (
-              isNumber(e.orderMaterialNumber) ||
-              isNumber(e.orderMaterialWeight)
-            ) {
-              if (
-                isIntegerNumber(e.orderMaterialNumber) ||
-                isIntegerNumber(e.orderMaterialWeight)
-              ) {
+          if (e.orderMaterialWeight) {
+            if (isNumber(e.orderMaterialWeight)) {
+              if (isIntegerNumber(e.orderMaterialWeight)) {
                 state = 1;
               } else {
                 this.$message({
-                  message: "件数(重量)只能是整数!",
+                  message: "重量只能是整数!",
                   type: "warning",
                 });
-                state = 0;
+                return;
               }
             } else {
               this.$message({
-                message: "件数(重量)只能是数字!",
+                message: "重量只能是数字!",
                 type: "warning",
               });
-              state = 0;
+              return;
             }
-          } else {
-            this.$message({
-              message: "件数(重量)不能为空!",
-              type: "warning",
-            });
-            state = 0;
           }
         });
       }
+      let map = {
+        materialId: this.materialId,
+        supplierId: this.supplierId,
+        purchaseOrderId: this.purchaseOrderId,
+        unloadPointId: this.unloadPointId,
+        orderEntryTime: sjTime(this.form1.orderEntryTime),
+        driverCapacityIdList: this.selectionList,
+        orderType: this.orderType,
+        lineId: this.lineId,
+        isMoreTrips: this.isMoreTrips,
+      };
 
-      if (state == 1) {
-        let map = {
-          materialId: this.materialId,
-          supplierId: this.supplierId,
-          purchaseOrderId: this.purchaseOrderId,
-          unloadPointId: this.unloadPointId,
-          orderEntryTime: sjTime(this.form1.orderEntryTime),
-          driverCapacityIdList: this.selectionList,
-          orderType: 5,
-          lineId: this.lineId,
-        };
-        console.log(map, map);
-        this.axios.post("/api/v1/oms/addPurOrder", map).then((res) => {
-          if (res.data.code == "200") {
-            this.$message({
-              message: "添加成功!",
-              type: "success",
-            });
-            this.$router.push("/transportReserveFu");
-          }
-        });
-      }
+      this.axios.post("/api/v1/oms/addPurOrder", map).then((res) => {
+        if (res.data.code == "200") {
+          this.$message({
+            message: "添加成功!",
+            type: "success",
+          });
+          this.$router.push("/transportReserveFu");
+        }
+      });
     },
   },
 };
 </script>
-
-<style lang="scss" >
+<style lang="scss">
 .contractDetails {
   width: 100%;
 }
+
+.el-drawer__container ::-webkit-scrollbar {
+  display: none;
+}
 .from {
   display: flex;
   align-items: center;
   justify-content: center;
-  margin-top: 0.3125rem;
-  margin-bottom: 1.25rem;
+  margin-top: 5px;
+  margin-bottom: 20px;
 }
 .remark {
+  display: flex;
+  justify-content: center;
   .text {
     display: inline-block;
-    width: 5.625rem;
+    width: 100px;
     text-align: right;
   }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
 }
 .lineId {
+  display: flex;
+  justify-content: center;
   .text {
     display: inline-block;
-    width: 10rem;
+    width: 170px;
     text-align: right;
   }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
+  .span {
+    display: inline-block;
+    width: 70px;
+    height: 1px;
+  }
 }
 .material {
+  display: flex;
+  justify-content: center;
+  margin-top: 20px;
   .text {
     display: inline-block;
-    width: 10rem;
+    width: 170px;
     text-align: right;
   }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
 }
-.switch {
-  width: 100%;
-  height: 2.5rem;
+.orderType {
   display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  padding-right: 6.875rem;
+  justify-content: center;
+  .text {
+    display: inline-block;
+    width: 110px;
+    text-align: right;
+  }
+  .select {
+    width: 250px;
+  }
+  .span {
+    display: inline-block;
+    width: 30px;
+    height: 10px;
+  }
+}
+.contractTitle {
+  display: flex;
+  justify-content: center;
+  .el-form-item {
+    display: flex;
+    justify-content: center;
+    .el-form-item__label {
+      display: flex;
+      align-items: center;
+    }
+    .el-input {
+      width: 250px;
+    }
+  }
 }
 .forwardingUnit {
+  display: flex;
+  justify-content: center;
   .text {
     display: inline-block;
-    width: 10rem;
+    width: 170px;
     text-align: right;
   }
+  .input {
+    width: 250px;
+    margin-right: 20px;
+  }
 }
 .truckList1 {
   width: 100%;
@@ -533,19 +764,28 @@ export default {
     width: 96%;
     .text {
       display: inline-block;
-      width: 9.375rem;
+      width: 120px;
       text-align: right;
     }
     .truckBtn {
-      width: 17.5rem;
+      width: 250px;
     }
   }
 }
+.drawer_top{
+  margin-top: -50px;
+  width: 100%;height: 60px;
+  display: flex;
+  align-items: center;
+}
+.drawer_table1{
+  width: 100%;height: 500px;
+}
 .button_box {
   display: flex;
   justify-content: center;
   align-items: center;
   width: 100%;
-  height: 6.25rem;
+  height: 100px;
 }
 </style>

+ 160 - 46
src/views/TMS/components/importedIngredients/transportReserveFuEdit.vue

@@ -2,63 +2,152 @@
   <!-- 修改运输预约页面 -->
   <div id="contractDetails">
     <page-title>运输预约</page-title>
-    <div class="main">
-      <span class="text">修改运输预约</span>
-      <span class="a"></span>
-    </div>
     <div class="contractTitle">
-      <div class="form-box">
-        <div class="form-one">
-          <dil-form :formId="258" v-model="form1"></dil-form>
-          <div>
-            <div v-if="form1.orderMaterialNumber">
-              <span>物资件数:</span>
-              <el-input placeholder="请输入内容" v-model="orderMaterialNumber" clearable>
-              </el-input>
-            </div>
-             <div v-if="form1.orderMaterialWeight">
-              <span>物资重量:</span>
-              <el-input placeholder="请输入内容" v-model="orderMaterialWeight" clearable>
-              </el-input>
-            </div>
-          </div>
+      <div class="form-one">
+        <dil-form :formId="220" v-model="form1"> </dil-form>
+      </div>
+      <div class="btn">
+        <div class="btn1">
+          <el-button type="primary" @click="selectTruck">浏览</el-button>
+        </div>
+        <div class="btn1">
+          <el-button type="primary" @click="selectUnloadingPoint"
+            >浏览</el-button
+          >
         </div>
       </div>
     </div>
-    <div class="button-box">
+
+    <div class="button_box">
       <el-button @click="onClickCancel">返回</el-button>
       <el-button type="primary" @click="onClickConfirm">确认</el-button>
     </div>
+
+    <el-drawer
+      :visible.sync="drawer"
+      :direction="direction"
+      size="40%"
+      :wrapperClosable="true"
+      :close-on-press-escape="false"
+      :destroy-on-close="false"
+      :show-close="false"
+      :withHeader="true"
+      modal
+    >
+      <el-input
+        placeholder="请输入内容"
+        v-model="input"
+        style="margin-top: 0.625rem; margin-left: 1.25rem; width: 200px"
+        clearable
+      ></el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="onclick(a)"
+        style="margin-bottom: 0.9375rem"
+      >
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <div v-show="a == 1">
+        <dilTable
+          v-bind.sync="third"
+          @radio-change="currentRadioChange"
+        ></dilTable>
+      </div>
+      <div v-show="a == 2">
+        <dilTable
+          v-bind.sync="unloadPoint"
+          @radio-change="currentRadioChange2"
+        ></dilTable>
+      </div>
+    </el-drawer>
   </div>
 </template>
 
 <script>
 import PageTitle from "@/components/Page/Title";
-
+import { sjTime } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
       form1: {},
-      orderMaterialNumber:'',
-      orderMaterialWeight:'',
+      drawer: false,
+      direction: "rtl",
+      a: null,
+      third: {
+        requestUrl: "",
+        selectionType: "radio",
+      },
+      unloadPoint: {
+        requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
+        selectionType: "radio",
+      },
+      capacityId: null,
+      warehouseId: null,
+      input: null,
+      orderType: null,
     };
   },
+  created() {
+    //判断是否是承运商
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.third.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+        getCookie("userId");
+    } else {
+      this.third.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null;
+    }
+  },
   mounted() {
     this.information();
   },
   methods: {
+    onclick(a) {
+      if (a == 1) {
+        //判断是否是承运商
+        if (getCookie("orgCode") == "chengyunshang") {
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            getCookie("userId") +
+            "&con=" +
+            this.input;
+        } else {
+          this.third.requestUrl =
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+            null +
+            "&con=" +
+            this.input;
+        }
+      } else if (a == 2) {
+        this.unloadPoint.requestUrl =
+          "/api/v1/uc/getUnloadingMesByLike?apiId=374&con=" + this.input;
+      }
+    },
+    selectTruck() {
+      this.a = 1;
+      this.drawer = true;
+    },
+    selectUnloadingPoint() {
+      this.a = 2;
+      this.drawer = true;
+    },
+    currentRadioChange(row) {
+      this.form1.capacityNumber = row.capacityNumber;
+      this.capacityId = row.capacityId;
+    },
+    currentRadioChange2(row) {
+      this.form1.warehouseName = row.warehouseName;
+      this.warehouseId = row.warehouseId;
+    },
     information() {
       this.axios
         .post("/api/v1/oms/selectOrderByOrderId/" + this.$route.params.orderId)
         .then((res) => {
           res.data.data.forEach((e) => {
             this.form1 = e;
-            if(e.orderMaterialNumber){
-              this.orderMaterialNumber = e.orderMaterialNumber;
-            }else if(e.orderMaterialWeight){
-              this.orderMaterialWeight = e.orderMaterialWeight;
-            }
           });
         });
     },
@@ -70,31 +159,56 @@ export default {
     onClickConfirm() {
       let obj = {
         orderId: this.$route.params.orderId,
-        orderMaterialNumber: this.form1.orderMaterialNumber,
+        capacityId: parseInt(this.capacityId),
+        unloadPointId: this.warehouseId,
         orderEntryTime: sjTime(this.form1.orderEntryTime),
-        unloadPointId: this.form1.unloadPointId,
-        orderType: 5,
+        orderType: parseInt(this.form1.orderType),
       };
-
-      if (
-        obj.orderId == null ||
-        obj.orderMaterialNumber == null ||
-        obj.orderEntryTime == null ||
-        obj.unloadPointId == null
-      )
-        this.$message.error("存在空值!");
-      else
-        this.axios.post("/api/v1/oms/updateOrder", obj).then(() => {
+      this.axios.post("/api/v1/oms/updateOrder", obj).then((res) => {
+        if (res.data.code == "200") {
           this.$message({
             type: "success",
             message: "修改成功!",
           });
-          this.$router.go(-1);
-        });
+          this.$router.push("/transportReserveFu");
+        }
+      });
     },
   },
 };
 </script>
-<style lang="scss" scoped>
-// @import "@/styles/appoint/contract/ContractInsert.scss";
-</style>  
+<style lang="scss">
+.contractTitle {
+  display: flex;
+  justify-content: center;
+  margin: 20px;
+  .el-form-item {
+    display: flex;
+    justify-content: center;
+    .el-form-item__label {
+      display: flex;
+      align-items: center;
+      font-size: 14px;
+    }
+    .el-input {
+      width: 250px;
+    }
+  }
+  .btn {
+    margin-left: 20px;
+    padding-top: 105px;
+    .btn1 {
+      margin-bottom: 15px;
+    }
+  }
+}
+.button_box {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  .el-button {
+    width: 80px;
+    margin: 10px;
+  }
+}
+</style>

+ 106 - 73
src/views/TMS/components/importedIngredients/truckDriverReceiveFu.vue

@@ -1,113 +1,146 @@
 <template>
-  <!-- 运输派单 -->
+  <!-- 辅料运输派单 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+      <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" @tab-click="handleClick">
-      <!-- 未接收 -->
-      	<el-tab-pane label="未接收" name="third">
-						<dilTable v-bind.sync="option0">
-              <el-table-column fixed="right" label="操作" width="50">
-        <template slot-scope="scope">
-          <el-button @click="closeOrder(scope.row.orderId)" type="text" size="small">
-            关闭
-          </el-button>
-        </template>
-      </el-table-column>
-						</dilTable>
-					</el-tab-pane>
-      <!-- 未下发 -->
+    <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" ref="table">
-        </dilTable>
+        <dilTable v-bind.sync="option1"> </dilTable>
       </el-tab-pane>
-      <!-- 已下发 -->
       <el-tab-pane label="已拒绝" name="second">
-        <dilTable v-bind.sync="option2">
-        </dilTable>
+        <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: "first",
-       option0: {
+      activeName: "option",
+      option: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4"
+        requestUrl:"",
+        selectionType: "select",
       },
       option1: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5"
+        requestUrl:"",
       },
       option2: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=6"
-      }
+        requestUrl:"",
+      },
+      list:[],
     };
   },
+  watch:{
+    activeName(val){
+      if (getCookie("orgCode") == "chengyunshang") {
+        if(val == "option"){
+          this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i="+new Date()+"&carrierSSOId=" + null;
+        }else if(val == "first"){
+          this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i="+new Date()+"&carrierSSOId=" + null;
+        }else if(val == "second"){
+          this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i="+new Date()+"&carrierSSOId=" + null;
+        }
+      }else{
+        if(val == "option"){
+          this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&i="+new Date()+"&carrierSSOId=" + null;
+        }else if(val == "first"){
+          this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&i="+new Date()+"&carrierSSOId=" + null;
+        }else if(val == "second"){
+          this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&i="+new Date()+"&carrierSSOId=" + null;
+        }
+      }
+      
+    }
+  },
+  created() {
+    //判断是否是承运商
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + getCookie("userId");
+      this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + getCookie("userId");
+      this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + getCookie("userId");
+    } else {
+      this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&carrierSSOId=" + null;
+      this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=5&carrierSSOId=" + null;
+      this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&carrierSSOId=" + null;
+    }
+  },
   methods: {
-    closeOrder(orderId) {
-      this.$confirm("是否关闭", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        center: true,
-      })
-        .then(() => {
-           this.axios
-            .post(
-              "/api/v1/oms/closeOmstruckOrde?orderId="+orderId
-            )
-            .then((res) => {
-           if(res.data.code == '200')
-              // if(res.data.code)
-              this.$router.go(0);
-            });
-          this.$message({
-            type: "success",
-            message: "下发成功!",
-          });
-          // console.log(this.arr[0].text_prop);
-         
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "取消关闭!",
-          });
-        });
-    },
     onclick() {
-       if(this.activeName == "first"){
-        this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=5&con=" + this.input;
-      }else if(this.activeName == "second"){
-        this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=6&con=" + this.input;
-      }else
-      {
-        this.option0.requestUrl="/api/v1/oms/getTransportDispatch?apiId=148&orderType=5&orderStatus=4&con="+this.input;
+    if (getCookie("orgCode") == "chengyunshang") {
+       if(this.activeName == "option"){
+        this.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&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&fuelOrder=1&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&fuelOrder=1&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&fuelOrder=1&orderStatus=4&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
+      }else if (this.activeName == "first") {
+        this.option1.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=5&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
+      } else if (this.activeName == "second") {
+        this.option2.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=241&fuelOrder=1&orderStatus=6&con=" + this.input +"&i="+new Date() + "&carrierSSOId=" + null;
       }
+    }
+      
     },
-    handleClick(tab, event) {
-      console.log(tab, event);
+    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.option.requestUrl = "/api/v1/oms/getTransportDispatch?apiId=148&fuelOrder=1&orderStatus=4&con=" + this.input +"&i="+new Date();
+          }
+        })
+      }
+
     },
+    selectionChange(selection){
+      this.list = [],
+      selection.forEach(e => {
+        this.list.push(e.orderId)
+      });
+    }
   },
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-   .top {
-    padding: 1.25rem 1.875rem;
+  .top {
+    padding: 40px;
+    .input {
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 12 - 35
src/views/TMS/components/importedIngredients/truckEnfactoryFuResult.vue

@@ -1,11 +1,10 @@
 <template>
-  <!-- 辅料进厂作业页面 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+      <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>
     </div>
     <dilTable v-bind.sync="option">
       
@@ -26,22 +25,8 @@ export default {
       },
     };
   },
+
   methods: {
-    querySearch(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString
-        ? restaurants.filter(this.createFilter(queryString))
-        : restaurants;
-      cb(results);
-    },
-    createFilter(queryString) {
-      return (restaurant) => {
-        return (
-          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-          0
-        );
-      };
-    },
     onclick() {
       this.option.requestUrl = "/api/v1/tms/getAllEnFactoryResult?apiId=143&orderType=5&con=" + this.input;
     },
@@ -52,18 +37,6 @@ export default {
     insertClick() {
       this.$router.push("/truckLoadResultAdd/");
     },
-    // deleteclick(scope) {
-    //   let pathId = scope;
-    //   this.axios
-    //     .post("/api/v1/tms/operationPath/operationPathDelete?pathId=" + pathId)
-    //     .then((res) => {
-    //       this.$message({
-    //         message: "删除成功",
-    //         type: "success",
-    //       });
-    //       this.$router.go(0);
-    //     });
-    // },
     deleteClick(resultId) {
       
       this.$confirm("是否删除", "提示", {
@@ -95,10 +68,14 @@ export default {
   },
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 13 - 153
src/views/TMS/components/importedIngredients/truckJiMaoFuResult.vue

@@ -2,85 +2,14 @@
   <!-- 辅料计毛实绩页面 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-           
+      <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>查询      
+        <i class="el-icon-search"></i>查询
       </el-button>
     </div>
     <dilTable v-bind.sync="option">
-      <el-table-column fixed="right" align="center" label="操作" width="120">
-        <template slot-scope="scope">
-          <el-button
-            @click="sendClick(scope.row.orderId)"
-            type="text"
-            size="small"
-            v-if="scope.row.orderStatus == 5"
-          >
-            退货
-          </el-button>
-          <el-button  
-            type="text"
-            size="small"
-            disabled
-            v-else
-          >
-            退货
-          </el-button>
-        </template>
-      </el-table-column>
-    </dilTable>
-
-    <el-dialog
-      title="提示"
-      :visible.sync="dialogVisible"
-      width="30%"
-      :before-close="handleClose"
-      :modal="true"
-      :close-on-click-modal="false"
-    >
-      <div class="text">
-        <span>请选择退货路线</span>
-      </div>
-      <el-input placeholder="请输入内容" v-model="lineName" disabled>
-      </el-input>
-      <el-button type="primary" @click="onLine">浏览</el-button>
-      <div class="returnResult">
-        <span>退货原因:</span>
-      </div>
-      <el-input placeholder="请输入内容" v-model="returnResult">
-      </el-input>
       
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="handleClose">取 消</el-button>
-        <el-button type="primary" @click="outOrder">确 定</el-button>
-      </span>
-    </el-dialog>
-
-    <!-- 模态窗口 -->
-    <el-drawer :visible.sync="drawer" size="50%">
-      <el-input
-        placeholder="请输入内容"
-        v-model="calculationText"
-        style="margin-top: 0.625rem; margin-left: 1.25rem"
-        clearable
-      ></el-input>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="calculation"
-        style="margin-bottom: 0.9375rem"
-      >
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <div>
-        <!-- 模态框——表格 -->
-        <dilTable
-          v-bind.sync="line"
-          @radio-change="currentRadioChange"
-        ></dilTable>
-      </div>
-    </el-drawer>
+    </dilTable>
   </div>
 </template>
 
@@ -89,99 +18,30 @@ export default {
   name: "homeworkPath",
   data() {
     return {
-      returnResult:'',
-      //路线名称
-      lineName: "",
-      //路线id
-      lineId: null,
-      //模态框框计算文本
-      calculationText: "",
-      //是否需要打开模态窗口
-      drawer: false,
-      //是否打开弹窗
-      dialogVisible: false,
-      //订单id
-      orderId: null,
       restaurants: [],
       input: "",
       option: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/tms/getAllJiMaoResult?apiId=102&orderType=5",
       },
-      //模态框表格数据
-      line: {
-        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=4",
-        selectionType: "radio",
-      },
     };
   },
+
   methods: {
-    //模态框单选触发事件
-    currentRadioChange(selection) {
-      this.lineName = selection.lineName;
-      this.lineId = selection.lineId;
-    },
-    //模态框框计算
-    calculation() {
-      this.option.requestUrl =
-        "/api/v1/rms/getAllLineDesk?apiId=249&lineType=4&con=" +
-        this.calculationText;
-    },
-    //弹窗浏览按钮
-    onLine() {
-      this.drawer = true;
-    },
-    //弹窗的确定按钮
-    outOrder() {
-      if(this.lineId && this.returnResult){
-        let map = {
-        returnResult:this.returnResult,
-        orderId: this.orderId,
-        lineId: this.lineId,
-      };
-      this.axios.post("/api/v1/oms/returnOrderCloseOrder", map).then((res) => {
-        console.log(res);
-        this.dialogVisible = false;
-          this.option.requestUrl ="/api/v1/tms/getAllJiMaoResult?apiId=102&orderType=5&i=0";
-      });
-      }else{
-          this.$message({
-          message: '请选择运输路线和退货原因,在确定!',
-          type: 'warning'
-        });
-      }
-    },
-    //弹窗关闭事件
-    handleClose() {
-      this.lineName = null;
-      this.lineId = null;
-      this.orderId = null;
-      this.dialogVisible = false;
-    },
-    //操作列退货按钮
-    sendClick(orderId) {
-      console.log(orderId);
-      this.orderId = orderId;
-      this.dialogVisible = true;
-    },
     onclick() {
-      this.option.requestUrl =
-        "/api/v1/tms/getAllJiMaoResult?apiId=102&orderType=5&con=" + this.input;
+     this.option.requestUrl = "/api/v1/tms/getAllJiMaoResult?apiId=102&orderType=5&con=" + this.input;
     },
-  },
+   }
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
-  }
-  .text {
-    margin-bottom: 0.625rem;
-  }
-  .returnResult {
-    margin-top: 0.625rem;
-    margin-bottom: 0.625rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 15 - 12
src/views/TMS/components/importedIngredients/truckJiPiFuResult.vue

@@ -2,10 +2,9 @@
   <!-- 辅料计皮实绩页面 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-           
+      <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>查询      
+        <i class="el-icon-search"></i>查询
       </el-button>
     </div>
     <dilTable v-bind.sync="option">
@@ -19,27 +18,31 @@ export default {
   name: "homeworkPath",
   data() {
     return {
-      //一览表格框计算文本
+      restaurants: [],
       input: "",
-      //一览表格数据
       option: {
+        // 表格请求数据的地址
         requestUrl: "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5",
       },
     };
   },
+
   methods: {
-    //一览表格框计算
+
     onclick() {
-      this.option.requestUrl =
-        "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5&con=" + this.input;
+     this.option.requestUrl = "/api/v1/tms/getAllJiPiResult?apiId=146&orderType=5&con=" + this.input;
     },
-  },
+   }
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 14 - 24
src/views/TMS/components/importedIngredients/truckLeaveFactoryFuResult.vue

@@ -1,11 +1,11 @@
 <template>
   <!-- 辅料出厂作业页面 -->
   <div class="homeworkPath">
-    <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+   <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>
     </div>
     <dilTable v-bind.sync="option">
       
@@ -26,33 +26,23 @@ export default {
       },
     };
   },
+
   methods: {
-    querySearch(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString
-        ? restaurants.filter(this.createFilter(queryString))
-        : restaurants;
-      cb(results);
-    },
-    createFilter(queryString) {
-      return (restaurant) => {
-        return (
-          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-          0
-        );
-      };
-    },
     
     onclick() {
-      this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=147&orderType=5&con=" + this.input;
+     this.option.requestUrl = "/api/v1/tms/getLeaveFactoryResult?apiId=147&orderType=5&con=" + this.input;
     },
    }
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 15 - 27
src/views/TMS/components/importedIngredients/truckQualityFuResult.vue

@@ -2,10 +2,11 @@
   <!-- 辅料质检作业 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+      <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>
+
     </div>
     
     <dilTable v-bind.sync="option">
@@ -34,39 +35,26 @@ export default {
       },
     };
   },
+
   methods: {
-    querySearch(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString
-        ? restaurants.filter(this.createFilter(queryString))
-        : restaurants;
-      cb(results);
-    },
-    createFilter(queryString) {
-      return (restaurant) => {
-        return (
-          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-          0
-        );
-      };
-    },
     onclick() {
-      this.option.requestUrl = "/api/v1/tms/getQualityResult?apiId=150&orderType=5&con=" + this.input;
-    },
-    btnclick() {
-      this.$router.push("/approveWagonPleaseAdd/");
+         this.option.requestUrl = "/api/v1/tms/getQualityResult?apiId=150&orderType=5&con=" + this.input;
     },
     updateClick(resultId) {
-      this.$router.push("/truckQualityFuResultEdit/" + resultId);
+      this.$router.push("/truckQualityRanLaoResultEdit/" + resultId);
     },
     
   },
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 12 - 24
src/views/TMS/components/importedIngredients/truckReceiptFuResult.vue

@@ -2,10 +2,10 @@
   <!-- 辅料收货作业页面 -->
   <div class="homeworkPath">
     <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+      <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>
     </div>
     <dilTable v-bind.sync="option">
       
@@ -27,32 +27,20 @@ export default {
     };
   },
   methods: {
-    querySearch(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString
-        ? restaurants.filter(this.createFilter(queryString))
-        : restaurants;
-      cb(results);
-    },
-    createFilter(queryString) {
-      return (restaurant) => {
-        return (
-          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-          0
-        );
-      };
-    },
-    
     onclick() {
-     this.option.requestUrl = "/api/v1/tms/getReceiveResult?apiId=149&orderType=5&con=" + this.input;
+      this.option.requestUrl = "/api/v1/tms/getReceiveResult?apiId=149&orderType=5&con=" + this.input;
     },
    }
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 15 - 27
src/views/TMS/components/importedIngredients/truckUnloadFuResult.vue

@@ -1,15 +1,13 @@
 <template>
   <!-- 卸货实绩页面 -->
   <div class="homeworkPath">
-    <div class="top">
-      <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+   <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>
     </div>
-    <dilTable v-bind.sync="option">
-      
-    </dilTable>
+    <dilTable v-bind.sync="option"></dilTable>
   </div>
 </template>
 
@@ -26,32 +24,22 @@ export default {
       },
     };
   },
+ 
   methods: {
-    querySearch(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString
-        ? restaurants.filter(this.createFilter(queryString))
-        : restaurants;
-      cb(results);
-    },
-    createFilter(queryString) {
-      return (restaurant) => {
-        return (
-          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
-          0
-        );
-      };
-    },
     onclick() {
-     this.option.requestUrl = "/api/v1/tms/getUnloadResult?apiId=145&orderType=5&con=" + this.input;
+          this.option.requestUrl = "/api/v1/tms/getUnloadResult?apiId=145&orderType=5&con=" + this.input;
     },
    }
 };
 </script>
-<style lang='scss' scoped>
+<style lang='scss'>
 .homeworkPath {
-  .top {
-    padding: 1.25rem 1.875rem;
+   .top {
+    padding: 40px;
+    .input{
+      width: 250px;
+      margin-right: 10px;
+    }
   }
 }
 </style>

+ 28 - 24
src/views/TMS/components/purchaseChemicalMaterials/transportationReservationAdd.vue

@@ -2,7 +2,23 @@
   <!-- 新增运输作业页面 -->
   <div id="contractDetails">
     <page-title>运输预约</page-title>
-
+    <div class="orderType from">
+      <span class="text">订单类别:</span>
+      <el-select
+        class="select"
+        v-model="orderType"
+        placeholder="请选择"
+      >
+        <el-option
+          v-for="item in orderTypeList"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        >
+        </el-option>
+      </el-select>
+      <span class="span"></span>
+    </div>
     <div class="material from">
       <span class="text">物资:</span>
       <el-input class="input" v-model="materialName" disabled> </el-input>
@@ -34,24 +50,6 @@
       <el-input class="input" v-model="purchaseOrderNo" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(6)">浏览</el-button>
     </div>
-    <div class="orderType from">
-      <span class="text">订单类别:</span>
-      <el-select
-        class="select"
-        v-model="orderType"
-        placeholder="请选择"
-        disabled
-      >
-        <el-option
-          v-for="item in orderTypeList"
-          :key="item.value"
-          :label="item.label"
-          :value="item.value"
-        >
-        </el-option>
-      </el-select>
-      <span class="span"></span>
-    </div>
     <div class="contractTitle from">
       <dil-form :formId="219" v-model="form1"></dil-form>
     </div>
@@ -372,11 +370,11 @@ export default {
               this.remark = res.data.data.remark;
               this.purchaseOrderId = res.data.data.purchaseOrderId;
               this.purchaseOrderNo=res.data.data.purchaseOrderNo;
-              if (res.data.data.receiveUnitId == 1) {
-                this.orderType = 17;
-              } else {
-                this.orderType = 18;
-              }
+              // if (res.data.data.receiveUnitId == 1) {
+              //   this.orderType = 17;
+              // } else {
+              //   this.orderType = 18;
+              // }
             }
           } else {
             this.$message.error("请求失败");
@@ -512,6 +510,12 @@ export default {
             type: "warning",
           });
           return;
+        } else if (!this.orderType) {
+          this.$message({
+            message: "请选择订单类别!",
+            type: "warning",
+          });
+          return;
         } else if (!this.supplierId) {
           this.$message({
             message: "请选择发货单位!",

+ 222 - 65
src/views/appoint/components/saleContract/addSaleOrderArrange.vue

@@ -15,7 +15,7 @@
     <!-- 车序号表格 -->
     <div class="switch" v-if="selectionList.length > 0">
       <el-tooltip placement="top">
-        <div slot="content">下面表格已有数据不能进行更改!!!</div>
+        <div slot="content">下面表格已有数据,不能进行更改!!!</div>
         <el-switch
           v-model="value"
           active-text="件数"
@@ -27,7 +27,7 @@
     </div>
     <div class="switch" v-else>
       <el-tooltip placement="top">
-        <div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
+        <div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
         <el-switch v-model="value" active-text="件数" inactive-text="重量">
         </el-switch>
       </el-tooltip>
@@ -58,6 +58,9 @@
           <template slot="scope" v-if="item.label !== '车序号'">
             <span>{{ item.label }}</span>
           </template>
+          <template slot="scope" v-if="item.label !== '收货地址'">
+            <span>{{ item.label }}</span>
+          </template>
           <template slot="scope" v-if="item.label !== '运输单价'">
             <span>{{ item.label }}</span>
           </template>
@@ -90,6 +93,21 @@
                   @change="updateArragneCxh(scope.row.cxh)"
                 ></el-input>
               </template>
+              <!-- 收货地址 -->
+              <template v-if="item.prop == 'saleShipperAddressName'" >
+                <el-input
+                  style="width: 200px"
+                  v-model="scope.row.saleShipperAddressName"
+                  disabled
+                >
+                </el-input>
+                <el-button
+                  type="primary"
+                  placeholder="()"
+                  @click="select(scope.$index,1)"
+                  >浏览</el-button
+                >
+              </template>
               <!-- 运输单价id -->
               <template v-if="item.prop == 'priceValue'" >
                 <el-input
@@ -100,8 +118,8 @@
                 </el-input>
                 <el-button
                   type="primary"
-                  placeholder="(非必填)"
-                  @click="select(scope.$index,3)"
+                  placeholder="()"
+                  @click="select(scope.$index,2)"
                   >浏览</el-button
                 >
               </template>
@@ -170,44 +188,56 @@
         </el-table-column>
       </el-table>
     </div>
-    <!-- 运输单价的模态框 -->
+    <!-- 运输单价(地址对应)的模态框 -->
     <el-drawer 
       :visible.sync="addressDrawer" 
       :destroy-on-close="false"
       direction="rtl"
-      size="70%"
+      size="40%"
       :wrapperClosable="false"
       modal
       close-on-press-escape
     
     >
-      <el-input
-        placeholder="请输入内容"
-        v-model="addressText"
-        style="margin-top: 10px; margin-left: 20px; width: 250px"
-        clearable
-      >
+      <el-input placeholder="请输入内容" v-model="addressText" style="margin-top: 10px; margin-left: 20px; width: 250px" clearable>
       </el-input>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="selectAddressClick"
-        style="margin-left: 5px"
-      >
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="addAddressClick"
-        style="margin-left: 5px"
-      >
-        <i class="el-icon-check"></i>确定
+      <el-button type="primary" class="btn" @click="selectAddressClick" style="margin-left: 5px">
+         <i class="el-icon-search"></i>查询
       </el-button>
+
+      <!-- 已选中 省市(区)县 -->
+         <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">已选中省市县(区):</label>
+          </el-form-item>
+          <el-form-item>
+              <el-input class="el-form-item__content" v-model="address" placeholder="请输入内容" :disabled="true"></el-input>
+          </el-form-item>
+         </el-form>
+         <!-- 具体收货地址 -->
+         <div v-if="address != null">
+          <el-form :inline="true" style="margin-top: 0.5rem;" >
+
+          <el-form-item label="具体收货地址:">
+            <el-autocomplete
+              class="inline-input"
+              v-model="place"
+              :fetch-suggestions="querySearch1"
+              placeholder="请输入具体收货地址"
+              :trigger-on-focus="false"
+              @select="handleSelect1"
+            >
+            </el-autocomplete>
+          </el-form-item> 
+
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+        </el-form>
+        </div>
+
       <div class="tablecls">
         <!-- 查询所有的运输单价 -->
         <dilTable
-          v-bind.sync="Price"
+          v-bind.sync="Address"
           @radio-change="currentRadioChange2"
         ></dilTable>
       </div>
@@ -226,12 +256,24 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      //已选中 省市县(区)
+      address:null,
+      //具体收货地址
+      place:null,
+      //收货地址id
+      addressId:null,
+      //当前是哪一个浏览按钮触发
+      browseButton:null,
       textInput: "",
       input: "",
       //排车数默认
       arragneCount: 1,
       //初始化车序号
       arragneCxh: 1,
+      //是否自提
+      saleOrderIsselfMention:'',
+      //单价已选数量
+      choosePriceCount: 0,
       option: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId,
@@ -240,18 +282,18 @@ export default {
       },
       //是否打开收货地址的模态框
       addressDrawer:false,
-      //收货地址的表格
+      //地址的框计算输入的值
       addressText:null,
-      //线路表格的框计算输入的值
+      //收货地址的表格
       Address: {
         requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
         selectionType: "radio",
       },
-      //运输单价的表格
-      Price: {
-        requestUrl: "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0",
-        selectionType: "radio",
-      },
+      //运输单价的表格
+      // Price: {
+      //   requestUrl: "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0",
+      //   selectionType: "radio",
+      // },
       table: false,
       selectionList: [],
       selectionList1: [],
@@ -304,18 +346,18 @@ export default {
           width: "230",
           slot: true,
         },
+        {
+          prop: "saleShipperAddressName",
+          label: "收货地址",
+          width: "300",
+          slot: true,
+        },
         {
           prop: "priceValue",
           label: "运输单价",
           width: "300",
           slot: true,
         },
-        // {
-        //   prop: "saleShipperAddressName",
-        //   label: "收货地址",
-        //   width: "300",
-        //   slot: true,
-        // },
         {
           prop: "saleOrderConsignee",
           label: "收货客户",
@@ -367,6 +409,45 @@ export default {
       this.row.index = index;
       this.drawer = true;
     },
+    //收货地址弹出层
+    handleSelect1(item) {
+        console.log("获取所有下拉值!");
+    },
+    //收货地址模态窗口的框计算
+    selectAddressClick(){
+      if(this.addressText){
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con="+this.addressText;
+      }else{
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
+      }
+    },
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb){
+      this.axios
+        .post("/api/v1/ams/getRealAddressByLike?addressId="+this.addressId + "&index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            // console.log(res.data.data);
+            var restaurants = res.data.data;
+            // console.log(restaurants, "restaurants");
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+
     //修改输入框中的车序号,自动获取车序号最大值
     updateArragneCxh(cxh){
       if(this.arragneCxh<cxh){
@@ -395,6 +476,7 @@ export default {
             priceValue:row.priceValue,
             priceId:row.priceId,
             saleShipperAddressId:row.saleShipperAddressId,
+            place:row.place,
             saleShipperAddressName:row.saleShipperAddressName,
           })
 
@@ -439,19 +521,51 @@ export default {
       this.selectionList[this.row.index].saleShipperAddressId = radioList.addressId;
       this.selectionList[this.row.index].saleShipperAddressName = radioList.address;
     },
-    //收货地址模态窗口的框计算
-    selectAddressClick(){
-      this.Address.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
-    },
-    //收货地址模态窗口的点击事件
+    //运输单价模态窗口的点击事件
     addAddressClick(){
       //priceMap
-      this.selectionList[this.addressIndex].priceValue = this.priceMap.priceValue
-      this.selectionList[this.addressIndex].priceId = this.priceMap.priceId
+      // this.selectionList[this.addressIndex].priceValue = this.priceMap.priceValue
+      // this.selectionList[this.addressIndex].priceId = this.priceMap.priceId
+      //获取运输单价和运输单价ID
+      let map = {
+        place: this.place,
+        addressId: this.addressId
+      }
+      this.axios.post('/api/v1/ams/getPriceMap',map)
+      .then((res)=>{
+          if(res.data.data.priceId==-1){
+            if(this.browseButton==1){
+              this.selectionList[this.addressIndex].saleShipperAddressName = this.address+this.place;
+              this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+              this.selectionList[this.addressIndex].place = this.place;
+            }
+            this.selectionList[this.addressIndex].priceValue = '该区域尚未录入任何单价!';
+            this.selectionList[this.addressIndex].priceId = 0;
+            this.addAddressClickNext();
+          }else{
+            //赋值运输单价和运输单价ID
+            if(this.browseButton==1){
+              this.selectionList[this.addressIndex].saleShipperAddressName = this.address+this.place;
+              this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+              this.selectionList[this.addressIndex].place = this.place;
+            }
+            this.selectionList[this.addressIndex].priceValue = res.data.data.priceValue;//this.priceMap.priceValue
+            this.selectionList[this.addressIndex].priceId = res.data.data.priceId;//this.priceMap.priceId
+            this.addAddressClickNext();
+          }
+      });
+    },
+    //运输单价模态窗口的点击事件接续执行方法
+    addAddressClickNext(){
       this.addressDrawer = false;
       let arr = this.selectionList;
       this.selectionList = [];
+      //统计被选中的运输单价数量
+      var count = 0;
       arr.forEach((e)=>{
+        if(e.priceValue){
+          count++;
+        }
         this.selectionList.push({
           //销售订单与物资表主键
             Specification:e.Specification,
@@ -466,19 +580,34 @@ export default {
             priceValue:e.priceValue,
             priceId:e.priceId,
             saleShipperAddressId:e.saleShipperAddressId,
+            place:e.place,
             saleShipperAddressName:e.saleShipperAddressName,
         })
       })
+      //赋值单价已选数量
+      this.choosePriceCount = count;
+      //缩小运价省市县的范围
+      if(this.browseButton==1){
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con="+this.address;
+      }
     },
-    //收货地址点击浏览的事件
-    select(index){
+
+    //收货地址点击浏览的事件---------------------修改点
+    select(index,type){
+      this.browseButton = type;
       this.addressDrawer = true;
-      this.addressIndex = index ;
+      this.addressIndex = index ; 
     },
-    //收货地址模态框单选选中的事件
+    //收货地址模态框单选选中的事件----------------------------修改点
     currentRadioChange2(val){
-      this.priceMap = {};
-      this.priceMap = val;
+      //若具体地址有值,清空值
+      if(this.place!=null){
+        this.place=null;
+      }
+      this.address = val.address;
+      this.addressId = val.addressId;
+      // this.priceMap = {};
+      // this.priceMap = val;
     },
     // 框计算
     onclick() {
@@ -524,6 +653,8 @@ export default {
         };
         this.selectionList.push(addmap);
       });
+      //获取是否自提判断
+      this.saleOrderIsselfMention = this.selectionList1[0].saleOrderIsselfMention;
       this.selectionList1 = [];
       this.table = false;
       //重置销售订单信息
@@ -538,15 +669,17 @@ export default {
     makeSure() {
         //初始化maplist
       var mapList = [];
-      this.selectionList.forEach((item,i) => {
+      this.selectionList.forEach((item) => {
         //初始化mapItem
         var mapItem={
                 //销售订单id
                 saleOrderId : 0,
                 //车序号    
                 truckNo : "",
-                //收货地址id
+                //省市县id
                 shippingAddressId : 0,
+                //具体地址
+                place :null,
                 //截止日期
                 dateOfReceipt :null,
                 //收货方姓名   
@@ -563,6 +696,7 @@ export default {
         mapItem.saleOrderId=this.$route.params.saleOrderId;
         mapItem.truckNo=item.cxh;
         mapItem.shippingAddressId=item.saleShipperAddressId;
+        mapItem.place=item.place;
         mapItem.dateOfReceipt=sjTime(item.saleDateOfReceipt);
         mapItem.orderConsignee=item.saleOrderConsignee;
         mapItem.orderConsigneeTel=item.saleOrderConsigneeTel;
@@ -571,16 +705,39 @@ export default {
         mapItem.priceId=item.priceId;
         mapList.push(mapItem);
       });
-      console.log("mapList",mapList)
+      //校验是否自提,是自提,则运输单价必选,非自提,运输单价为空
+      if(this.saleOrderIsselfMention=='是'){
+        mapList.forEach((e)=>{
+            e.priceId = null;
+        })
+        //发送请求
         this.axios.post("/api/v1/ams/addTruckNo", mapList).then((res) => {
-          if (res.data.code == "200") {
-            this.$router.go(-1);
+        if (res.data.code == "200") {
+          this.$router.go(-1);
+        }
+        this.$message({
+          type: "success",
+          message: "新增车序号成功!",
+        });
+        });  
+      }else{
+        //判断是否全部完成运输单价的选择
+          if(this.choosePriceCount==this.selectionList.length){
+            //发送请求
+            this.axios.post("/api/v1/ams/addTruckNo", mapList).then((res) => {
+            if (res.data.code == "200") {
+              this.$router.go(-1);
+            }
+            this.$message({
+              type: "success",
+              message: "新增车序号成功!",
+            });
+            });
+          }else{
+            this.$message.warning('还有运输单价未被选定!')
           }
-          this.$message({
-            type: "success",
-            message: "新增车序号成功!",
-          });
-        });    
+      }
+          
     },
     // 取消
     cancel() {
@@ -588,7 +745,7 @@ export default {
     },
     //关闭事件
     handleClose(done) {
-      this.$confirm("确认关闭")
+      this.$confirm("确认关闭?")
         .then((_) => {
           done();
         })

+ 1077 - 0
src/views/appoint/components/saleContract/addSaleOrderCoproductSend.vue

@@ -0,0 +1,1077 @@
+<template>
+  <div class="addSaleOrderSend">
+    <page-title>新增销售订单副产品派车</page-title>
+    <!-- 销售订单表的数据 -->
+    <div class="saleOrder">
+      <dilTable
+        v-bind.sync="option"
+        @radio-change="currentRadioChange"
+      ></dilTable>
+    </div>
+    <!-- 表单选择车辆和线路 -->
+    <div class="from">
+      <div class="line">
+        <span class="text">线路</span>
+        <el-input
+          v-model="lineName"
+          placeholder="请选择线路"
+          disabled
+        ></el-input>
+        <el-button type="primary" @click="onClick(1)">浏览</el-button>
+      </div>
+      <div class="sendCar">
+          <span class="text">派车数</span>
+          <el-input v-model="carNumber"></el-input>
+          <span class="text">每车重量</span>
+          <el-input v-model="uniteOrderPlanWeight"></el-input>
+          <span class="text">截止日期</span>
+          <el-date-picker type="date" v-model="uniteSaleDateOfReceipt" style="width:150px"></el-date-picker>
+          <el-button type="primary" @click="AddTruckClick" style="margin-top: 10px;">确定</el-button>
+      </div>
+      <!-- <div class="vehicle">
+        <span class="text">车辆</span>
+        <el-button type="primary" @click="onClick(2)">浏览</el-button>
+        <span class="span"></span>
+      </div> -->
+    </div>
+
+    <!-- 派车表格 -->
+    <div class="selectionTable from">
+      <el-table
+        :data="selectionList"
+        border
+        style="width: 100%"
+        highlight-current-row
+      >
+        <el-table-column type="index" label="序号" width="50">
+        </el-table-column>
+        <el-table-column
+          v-for="(item, i) in tableTop"
+          :key="i"
+          :prop="item.prop"
+          :label="item.label"
+          :width="item.width"
+          align="center"
+          show-overflow-tooltip
+        >
+          <template slot="scope" v-if="item.label !== '车牌号'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '承运商'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '重量'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '运输单价'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '截止日期'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货人'">
+            <span>{{ item.label }}</span>
+          </template>
+          <template slot="scope" v-if="item.label !== '收货客户电话号码'">
+            <span>{{ item.label }}</span>
+          </template>
+          <!-- 插入输入框 -->
+          <template slot-scope="scope">
+            <template v-if="item.slot">
+              <!-- 车牌号 -->
+              <template v-if="item.prop == 'capacityNumber'">
+                <el-autocomplete
+                class="inline-input"
+                v-model="scope.row.capacityNumber"
+                :fetch-suggestions="querySearch"
+                placeholder="(必填)"
+                :trigger-on-focus="false"
+                @select="handleSelect"
+                @blur="checkRelationship(scope.$index)"
+                ></el-autocomplete>
+              </template>
+
+              <!-- 承运商 -->
+              <template v-if="item.prop == 'carrierName'">
+                 <el-select v-model="scope.row.carrierName" placeholder="请选择">
+                  <el-option
+                    v-for="item in carrierNameOptions[scope.$index]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value">
+                  </el-option>
+                </el-select>
+              </template>
+
+              <!-- 物资重量 -->
+              <template v-if="item.prop == 'orderPlanWeight'">
+                <el-input
+                  class="textinput"
+                  @input="onInput"
+                  placeholder="(必填)"
+                  v-model.number="scope.row.orderPlanWeight"
+                ></el-input>
+              </template>
+
+              <!-- 运输单价id -->
+              <template v-if="item.prop == 'priceValue'" >
+                <el-input
+                  style="width: 200px"
+                  v-model="scope.row.priceValue"
+                  disabled
+                >
+                </el-input>
+                <el-button
+                  type="primary"
+                  placeholder="()"
+                  @click="select(scope.$index,3)"
+                  >浏览</el-button
+                >
+              </template>
+              <!-- 截止日期 -->
+              <template v-if="item.prop == 'saleDateOfReceipt'">
+                 <el-date-picker
+                  class="textinput3"
+                  type="date"
+                  v-model.number="scope.row.saleDateOfReceipt"
+                ></el-date-picker>
+              </template>
+              <!-- 收货客户 -->
+              <template v-if="item.prop == 'saleOrderConsignee'">
+                <el-input
+                  class="textinput4"
+                  placeholder="(非必填)"
+                  v-model.number="scope.row.saleOrderConsignee"
+                ></el-input>
+              </template>
+              <!-- 收货客户电话号码 -->
+              <template v-if="item.prop == 'saleOrderConsigneeTel'">
+                <el-input
+                  class="textinput5"
+                  placeholder="(非必填)"
+                  v-model.number="scope.row.saleOrderConsigneeTel"
+                  @input="onInput"
+                ></el-input>
+              </template>
+            </template>
+            <template v-else>
+              <span>{{ scope.row[item.prop] }}</span>
+            </template>
+          </template>
+        </el-table-column>
+        <!-- 操作列 -->
+        <el-table-column fixed="right" label="操作" width="100">
+          <template slot-scope="scope">
+            <el-button
+              @click="copyRow(scope.$index,scope.row)"
+              type="text"
+              size="big"
+            >
+              复制
+            </el-button>
+            <el-button
+              @click="deleteRow(scope.$index)"
+              type="text"
+              icon="el-icon-close"
+              size="big"
+            ></el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <!-- 线路模态框 -->
+    <el-drawer 
+      :visible.sync="drawer" 
+      :destroy-on-close="false"
+      direction="rtl"
+      size="40%"
+      :wrapperClosable="false"
+      @keyup.enter.native="AddClick"
+      modal
+      close-on-press-escape
+    
+    >
+      <el-input
+        placeholder="请输入内容"
+        v-model="lineText"
+        style="margin-top: 10px; margin-left: 20px; width: 250px"
+        @keyup.enter.native="selectClick"
+        clearable
+      >
+      </el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="selectClick"
+        style="margin-left: 5px"
+      >
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="AddClick"
+        style="margin-left: 5px"
+      >
+        <i class="el-icon-check"></i>确定
+      </el-button>
+      <div class="tablecls">
+        <!-- 查询所有的路线 -->
+        <dilTable
+          v-bind.sync="line"
+          @radio-change="currentRadioChange5"
+        ></dilTable>
+      </div>
+    </el-drawer>
+    <!-- 车辆模态框 -->
+    <el-drawer 
+      :visible.sync="truckDrawer" 
+      :destroy-on-close="false"
+      direction="rtl"
+      size="40%"
+      @keyup.enter.native="AddTruckClick"
+      :wrapperClosable="false"
+      modal
+      close-on-press-escape
+    
+    >
+      <el-input
+        placeholder="请输入内容"
+        v-model="truckText"
+        style="margin-top: 10px; margin-left: 20px; width: 250px"
+        @keyup.enter.native="selectTruckClick"
+        clearable
+      >
+      </el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="selectTruckClick"
+        style="margin-left: 5px"
+      >
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="AddTruckClick"
+        style="margin-left: 5px"
+      >
+        <i class="el-icon-check"></i>确定
+      </el-button>
+      <div class="tablecls">
+        <!-- 查询所有的车辆 -->
+        <dilTable
+          v-bind.sync="truck"
+          @selection-change="currentRadioChange1"
+        ></dilTable>
+      </div>
+    </el-drawer>
+    <!-- 运输单价(地址对应)的模态框 -->
+    <el-drawer 
+      :visible.sync="addressDrawer" 
+      :destroy-on-close="false"
+      direction="rtl"
+      size="40%"
+      :wrapperClosable="false"
+      modal
+      close-on-press-escape
+    
+    >
+    
+    <el-input v-model="addresText" placeholder="请输入内容" style="margin-top: 10px; margin-left: 20px; width: 250px"></el-input>
+        <el-button type="primary" @click="selectAddresClick" :loading="selectLineLoading"><i class="el-icon-search"></i>查询</el-button>
+         <!-- 已选中 省市(区)县 -->
+         <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">已选中省市县(区):</label>
+          </el-form-item>
+          <el-form-item>
+              <el-input class="el-form-item__content" v-model="address" placeholder="请输入内容" :disabled="true"></el-input>
+          </el-form-item>
+         </el-form>
+         <!-- 具体收货地址 -->
+         <div v-if="address != null">
+           <el-form :inline="true" style="margin-top: 0.5rem;" >
+
+          <el-form-item label="具体收货地址:">
+            <el-autocomplete
+              class="inline-input"
+              v-model="place"
+              :fetch-suggestions="querySearch1"
+              placeholder="请输入具体收货地址"
+              :trigger-on-focus="false"
+              @select="handleSelect1"
+            >
+            </el-autocomplete>
+          </el-form-item> 
+
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+         </el-form>
+         </div>
+
+      <div class="tablecls">
+        <!-- 查询所有的运输单价 -->
+        <dilTable
+          v-bind.sync="Address"
+          @radio-change="currentRadioChange2"
+        ></dilTable>
+      </div>
+    </el-drawer>
+
+    <div class="button_box">
+      <el-button @click="cancel">取消</el-button>
+      <el-button type="primary" @click="makeSure">确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { getCookie } from "@/utils/util.js";
+import { sjTime,isNumber,isIntegerNumber } from "@/utils/sharedJsFile";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      //已选中 省市县(区)
+      address:null,
+      //具体收货地址
+      place:null,
+      //收货地址id
+      addressId:null,
+      //省市县(区)查询值
+      addresText:null,
+      //加载
+      selectLineLoading:false,
+      //承运商下拉框中的值
+      carrierNameOptions:[],
+      //收货客户注册承运商Id
+      receiveCarrierId:null,
+      //收货客户注册承运商名称
+      receiveCarrierName:null,
+      //统一截止日期
+      uniteSaleDateOfReceipt:null,
+      //统一每车重量
+      uniteOrderPlanWeight:null,
+      //线路名称
+      lineName:null,
+      lineId:null,
+      //派车数
+      carNumber:null,
+      //线路表格单选缓存数据的
+      cacheLine:{
+        ROW_ID : 0,
+        lineDesk : '',
+        lineId : 0,
+        lineName : '',
+        lineNo : '',
+        lineType : '',
+        spellNumber : 0,
+      },
+      //收货客户
+      consigneeCompanyName:'',
+      //是否自提
+      saleOrderIsselfMention:'',
+      //单价已选数量
+      choosePriceCount: 0,
+      //已经选择车辆物资信息
+      selectionList:[],
+      //销售订单物资信息
+      option: {
+        // 表格请求数据的地址
+        requestUrl:"",
+        // 控制显示当选列
+        selectionType: "radio",
+        isPagination: false,
+      },
+      //当前选中的物资id
+      materialId: null,
+      //当前选中的物资名称
+      materialName: null,
+      //选中的线路名称
+      lineName: null,
+      //选中的线路id
+      lineId: null,
+      //是否打开选择线路的模态框
+      drawer:false,
+      //是否打开选择车辆的模态框
+      truckDrawer:false,
+      //是否打开运输单价的模态框
+      addressDrawer:false,
+      //线路的表格
+      line: {
+        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
+        selectionType: "radio",
+      },
+      //车辆的表格
+      truck: {
+        requestUrl: "",
+        selectionType: "select",
+      },
+      //运输单价的表格
+      Address: {
+        requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
+        selectionType: "radio",
+      },
+      addressText:null,
+      //线路表格的框计算输入的值
+      lineText:null,
+      tableTop: [
+        {
+          prop: "capacityNumber",
+          label: "车牌号",
+          width: "130",
+          slot: true,
+        },
+        {
+          prop: "carrierName",
+          label: "承运商",
+          width: "240",
+          slot: true,
+        },
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: "140",
+        },
+        {
+          prop: "lineName",
+          label: "运输线路",
+          width: "220",
+        },
+        {
+          prop: "orderPlanWeight",
+          label: "重量",
+          width: "140",
+          slot: true,
+        },
+        {
+          prop: "saleDateOfReceipt",
+          label: "截止日期",
+          width: "230",
+          slot: true,
+        },
+        {
+          prop: "priceValue",
+          label: "运输单价",
+          width: "300",
+          slot: true,
+        },
+        // {
+        //   prop: "saleShipperAddressName",
+        //   label: "收货地址",
+        //   width: "300",
+        //   slot: true,
+        // },
+        {
+          prop: "saleOrderConsignee",
+          label: "收货人",
+          width: "150",
+          slot: true,
+        },
+        {
+          prop: "saleOrderConsigneeTel",
+          label: "收货客户电话号码",
+          slot: true,
+          width: "150",
+        },
+      ],
+      truckText:null,
+      //当前多选选中的车辆
+      selectTruck:[],
+      //销售订单与物资表主键
+      saleMaterialId:null,
+      //销售订单主键
+      saleOrderId:null,
+      //记录点击的是哪一个收货地址的浏览
+      addressIndex:null,
+      //缓存当前选中的运输单价
+      // priceMap:{},
+    };
+  },
+  created() {
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.truck.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+        getCookie("userId");
+    } else {
+      this.truck.requestUrl =
+        "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null;
+    }
+    this.option.requestUrl = "/api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId;
+  },
+  methods: {
+    onInput(val){
+      if(!isNumber(val)){
+        this.$message.warning('重量/电话号码请输入数字')
+      }
+    },
+    //校验是否为车牌
+    isVehicleNumber(vehicleNumber) {
+      var result = false;
+      if (vehicleNumber.length == 7) {
+        var express =
+          /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
+        result = express.test(vehicleNumber);
+      }
+      return result;
+    },
+    //填充承运商下拉框
+    fillCarrier(capacityId){
+      this.axios
+      .get("/api/v1/uc/getCarrierByCapacityId?capacityId=" + capacityId)
+      .then((res)=>{
+        var carrierNameList = [];
+        carrierNameList = res.data.data;
+        this.carrierNameOptions.push(carrierNameList);
+      });
+    },
+    //绑定车牌号和承运商的关系
+    bindRelationship(mapValue){
+      let RmsCapacity = {
+        capacityTypeId: 1,
+        capacityNumber: mapValue.capacityNumber,
+        capacityCorlor: "黄",
+        capacityOwneris: "否",
+        capacityVip: "否",
+        capacityBlacklist: "否",
+        remark: null,
+        carrierId: mapValue.carrierId,
+        state: mapValue.carrierName,
+      };
+      this.$confirm("该车牌号与承运商未有绑定关系, 是否立即绑定该车牌号和承运商?","提示",{
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+      })
+      .then(() => {
+          this.axios
+            .post("/api/v1/rms/insertCapacity", RmsCapacity)
+            .then((res) => {
+              if (res.data.data == 0) {
+                this.$message.success("该车牌号与承运商绑定关系成功!");
+              } 
+            });
+        })
+        .catch(() => {this.$message({ type: "info", message: "已取消删除",});});
+    },
+    //失焦事件后确定车牌号与承运商是否有绑定关系
+    checkRelationship(index){
+      if(this.selectionList[index].carrierId!=null){
+        //暂存车牌号
+      var capacityNumber1;
+      if(this.isVehicleNumber(this.selectionList[index].capacityNumber)){
+        let mapValue = {
+        capacityNumber:this.selectionList[index].capacityNumber,
+        carrierId:this.selectionList[index].carrierId,
+        carrierName:this.selectionList[index].carrierName
+      }
+      this.axios
+       .post("/api/v1/uc/isInCapacityCarrier", mapValue)
+       .then((res)=>{
+         if(res.data.code=="201"){
+           capacityNumber1 = res.data.data;
+           if(capacityNumber1==null){
+             this.selectionList[index].capacityNumber = null;
+             this.$message.error("该车牌号未注册,请先前往注册!");
+           }else{
+             this.bindRelationship(mapValue);
+           }
+         }
+       });
+      }
+      }
+    },
+    //收货地址弹出层
+    handleSelect1(item) {
+        console.log("获取所有下拉值!");
+    },
+    //车牌号弹出层
+    handleSelect(item) {
+      if(this.receiveCarrierId!=null){
+        let mapValue = {
+          capacityNumber:item.capacityNumber,
+          carrierId:this.receiveCarrierId,
+          carrierName:this.receiveCarrierName
+        }
+        this.axios
+        .post("/api/v1/uc/isInCapacityCarrier", mapValue)
+        .then((res)=>{
+          if(res.data.code=="201"){
+            this.bindRelationship(mapValue);
+          }else{
+            this.fillCarrier(item.capacityId);
+          }
+        });
+      }else{
+        this.fillCarrier(item.capacityId);
+      }
+    },
+    //查询全国省市县
+    selectAddresClick(){
+      if(this.addresText){
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con="+this.addresText;
+      }else{
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
+      }
+    },
+
+    //以下是车牌号边输边查搜索
+    querySearch(queryString, cb){
+      this.axios
+        .post("/api/v1/uc/getCapacityByLike?index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是车牌号边输边查搜索
+
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb){
+      this.axios
+        .post("/api/v1/ams/getRealAddressByLike?addressId="+this.addressId + "&index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+
+    //点击确定按钮的事件
+    makeSure(){
+      let state = false;
+      this.selectionList.forEach((e)=>{
+        if(!isNumber(e.orderPlanWeight)){   //判定重量合法
+          this.$message.error('重量请输入数字')
+        }
+        else if(e.saleOrderConsigneeTel){  //判断电话号码合法
+          if(!isNumber(e.saleOrderConsigneeTel)){
+            this.$message.error('电话号码请输入数字')
+          }else{
+            e.saleOrderConsigneeTel = e.saleOrderConsigneeTel+"",
+            state = true
+          }
+        }
+        else {
+          e.saleOrderConsigneeTel = null,
+          state = true
+        }
+        //其他条件
+        if(e.saleDateOfReceipt){  //转化截止日期格式
+          e.saleDateOfReceipt = sjTime(e.saleDateOfReceipt)
+        }
+        if(isIntegerNumber(e.carrierName)){
+          e.carrierId = e.carrierName
+        }
+      })
+      if(state){
+        //校验是否自提,是自提,则运输单价必选,非自提,运输单价为空
+        if(this.saleOrderIsselfMention=='是'){
+          this.selectionList.forEach((e)=>{
+            e.priceValue = null;
+            e.priceId = null;
+          })
+          this.sendRequest();
+        }else{
+          //判断是否全部完成运输单价的选择
+          if(this.choosePriceCount==this.selectionList.length){
+            this.sendRequest();
+          }else{
+            this.$message.warning('还有运输单价未被选定!')
+          }
+        }
+      }else{
+        this.$message.warning('重量/电话号码请输入数字')
+      }
+    },
+    //发送请求
+    sendRequest(){
+      this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
+          saleOrderId:this.$route.params.saleOrderId,
+          mapList:this.selectionList,
+        }).then((res)=>{
+          if(res.data.code == '200'){
+            this.$message.success('派车成功')
+            this.cancel();
+          }else{
+            //若该销售订单的净重已达到97%!
+            this.$confirm("该销售订单的净重已达到97%! 是否仍然派车", "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning",
+              center: true,
+            })
+            .then(() => {
+              this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
+              saleOrderId:this.$route.params.saleOrderId,
+              sendAgain:1,
+              mapList:this.selectionList,
+              }).then((res)=>{
+                  if(res.data.code == '200'){
+                  this.$message.success('派车成功')
+                  this.cancel();
+                }
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "取消派车!",
+              });
+            });
+
+          }
+        })
+    },
+    //点击取消按钮的事件
+    cancel(){
+      this.$router.push('/saleOrder')
+    },
+    //点击删除按钮删除当前点击的对象
+    deleteRow(index){
+      this.selectionList.splice(index,1)
+    },
+    //复制的方法
+    copyRow(index,row){
+      let arr = [];
+      let crr = [];
+      for(var i = 0 ;i<this.selectionList.length; i++){
+        if(i == index){
+          //表格数复制
+          arr.push(this.selectionList[i]);
+          arr.push({
+            capacityId:row.capacityId,
+            capacityNumber:row.capacityNumber,
+            carrierName:row.carrierName,
+            carrierId:row.carrierId,
+            lineId:row.lineId,
+            lineName:row.lineName,
+            materialId:row.materialId,
+            materialName:row.materialName,
+            orderPlanWeight:row.orderPlanWeight,
+            saleDateOfReceipt:row.saleDateOfReceipt,
+            saleMaterialId:row.saleMaterialId,
+            saleOrderConsignee:row.saleOrderConsignee,
+            saleOrderConsigneeTel:row.saleOrderConsigneeTel,
+            saleShipperAddressId:row.saleShipperAddressId,
+            place:row.place,
+            priceValue:row.priceValue,
+            priceId:row.priceId
+          });
+          //下拉框数据复制
+          crr.push(this.carrierNameOptions[i]);
+          crr.push(this.carrierNameOptions[i]);
+        }else{
+          arr.push(this.selectionList[i]);
+          crr.push(this.carrierNameOptions[i]);
+        }
+      }
+      this.selectionList = [];
+      this.selectionList = arr;
+      this.carrierNameOptions = [];
+      this.carrierNameOptions = crr;
+    },
+    //收货地址模态窗口的框计算
+    selectAddressClick(){
+      this.Address.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
+    },
+
+    //运输单价模态窗口的点击确定事件--------------
+    addAddressClick(){
+      //获取运输单价和运输单价ID
+      let map = {
+        place: this.place,
+        addressId: this.addressId
+      }
+      this.axios.post('/api/v1/ams/getPriceMap',map)
+      .then((res)=>{
+          if(res.data.data.priceId==-1){
+            this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+            this.selectionList[this.addressIndex].place = this.place;
+            this.selectionList[this.addressIndex].priceValue = '该区域尚未录入任何单价!';
+            this.selectionList[this.addressIndex].priceId = 0;
+            this.addAddressClickNext();
+          }else{
+            //赋值运输单价和运输单价ID
+            this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+            this.selectionList[this.addressIndex].place = this.place;
+            this.selectionList[this.addressIndex].priceValue = res.data.data.priceValue;//this.priceMap.priceValue
+            this.selectionList[this.addressIndex].priceId = res.data.data.priceId;//this.priceMap.priceId
+            this.addAddressClickNext();
+          }
+      });
+    },
+    //运输单价模态窗口的点击确定事件接续执行方法
+    addAddressClickNext(){
+      this.addressDrawer = false;
+      let arr = this.selectionList;
+      this.selectionList = [];
+      //统计被选中的运输单价数量
+      var count = 0;
+      arr.forEach((e)=>{
+        if(e.priceValue){
+          count++;
+        }
+        this.selectionList.push({
+          //销售订单与物资表主键
+          capacityId:e.capacityId,
+          capacityNumber:e.capacityNumber,
+          carrierName:e.carrierName,
+          carrierId:e.carrierId,
+          lineId:e.lineId,
+          lineName:e.lineName,
+          materialId:e.materialId,
+          materialName:e.materialName,
+          orderPlanWeight:e.orderPlanWeight,
+          saleDateOfReceipt:e.saleDateOfReceipt,
+          saleMaterialId:e.saleMaterialId,
+          saleOrderConsignee:e.saleOrderConsignee,
+          saleOrderConsigneeTel:e.saleOrderConsigneeTel,
+          saleShipperAddressId:e.saleShipperAddressId,
+          place:e.place,
+          priceValue:e.priceValue,
+          priceId:e.priceId,
+        })
+      })
+      console.log("this.selectionList222",this.selectionList)
+      //赋值单价已选数量
+      this.choosePriceCount = count;
+    },
+
+    //收货地址点击浏览的事件
+    select(index){
+      this.addressDrawer = true;
+      this.addressIndex = index ;
+    },
+    //收货地址模态框单选选中的事件
+    currentRadioChange2(val){
+      //若具体地址有值,清空值
+      if(this.place!=null){
+        this.place=null;
+      }
+      this.address = val.address,
+      this.addressId = val.addressId;
+      // this.priceMap = {};
+      // this.priceMap = val;
+    },
+    //派车数确定事件
+    AddTruckClick(){
+        if(!this.materialId){
+          this.$message.warning('请选择物资后,再点击!')
+        }else if(!this.lineId){
+          this.$message.warning('请选择线路后,再点击!')
+        }else if(!this.carNumber){
+          this.$message.warning('请先输入派车数!')
+        }else if(!this.uniteOrderPlanWeight){
+          this.$message.warning('请先输入每车数量!')
+        }else if(!this.uniteSaleDateOfReceipt){
+          this.$message.warning('请先输入截止日期!')
+        }else{
+          var i=0;
+          //给自提客户,即(承运商)赋值
+          let mapValue = {
+            isSelfMention : this.saleOrderIsselfMention,
+            consigneeName : this.consigneeCompanyName
+          }
+          this.axios.post('/api/v1/uc/getCarrierByConsignee',mapValue)
+          .then((res)=>{
+            if(res.data.data==null){
+              this.receiveCarrierId = null;
+              this.receiveCarrierName = null;
+              this.$message.warning('该收货单位尚未注册为承运商!')
+            }else{
+              this.receiveCarrierId = res.data.data.carrierId;
+              this.receiveCarrierName = res.data.data.carrierName;
+            }
+            //生成下方表单单元格
+            for(i=0;i<this.carNumber;i++){
+            this.selectionList.push({
+            //销售订单与物资表主键
+            saleMaterialId:this.saleMaterialId,
+            capacityId:null,
+            carrierId:this.receiveCarrierId,
+            capacityNumber:null,
+            carrierName:this.receiveCarrierName,
+            materialName:this.materialName,
+            materialId:this.materialId,
+            orderPlanWeight:this.uniteOrderPlanWeight,
+            saleDateOfReceipt:this.uniteSaleDateOfReceipt,
+            lineName:this.lineName,
+            lineId:this.lineId,
+            priceValue:null,
+            priceId:null,
+            saleOrderConsignee:null
+            })
+            }
+          });
+        }   
+    },
+    //车辆模态框框计算
+    selectTruckClick(){
+      if (getCookie("orgCode") == "chengyunshang") {
+        this.truck.requestUrl =
+          "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+          getCookie("userId") + "&index="+this.truckText;
+      } else {
+        this.truck.requestUrl =
+          "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&index="+this.truckText;
+      }
+    },
+    //车辆表格
+    currentRadioChange1(select){
+      this.selectTruck = [];
+      this.selectTruck = select;
+    },
+    //主界面表格单选
+    currentRadioChange(row) {
+      this.consigneeCompanyName = row.consigneeCompanyName;
+      this.saleOrderIsselfMention = row.saleOrderIsselfMention;
+      this.materialId = row.materialId;
+      this.materialName = row.materialName;
+      this.saleMaterialId = row.saleMaterialId;
+      this.saleOrderId = row.saleOrderId;
+    },
+    //线路表格的单选事件
+    currentRadioChange5(row){
+      //存在lineName,赋值,否则初始化
+      if(row.lineName){
+        this.cacheLine = row;
+      }else{
+        this.cacheLine = {
+        ROW_ID : 0,
+        lineDesk : '',
+        lineId : 0,
+        lineName : '',
+        lineNo : '',
+        lineType : '',
+        spellNumber : 0,
+      }
+      } 
+    },
+    onClick(num) {
+      if (num == 1) {
+        this.drawer = true;
+        this.lineText = null;
+      }
+      // else if(num == 2){
+      //   //再度初始化选择车辆表头
+      //   if (getCookie("orgCode") == "chengyunshang") {
+      //     this.truck.requestUrl =
+      //       "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" +
+      //       getCookie("userId") + "&i=" + new Date();
+      //   } else {
+      //     this.truck.requestUrl =
+      //       "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&i=" + new Date();
+      //   }
+      //   //后续操作
+      //   if(!this.materialId){
+      //     this.$message.warning('请选择物资后,再点击')
+      //   }else if(!this.lineId){
+      //     this.$message.warning('请选择线路后,再点击')
+      //   }else{
+      //     this.truckDrawer = true;
+      //     this.truckText = null;
+      //   }
+      // }
+    },
+    //线路表格的框计算
+    selectClick(){
+      this.line.requestUrl = '/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con='+this.lineText;
+    },
+    //线路表格的确定事件
+    AddClick(){
+        if(this.cacheLine.lineName!=''){
+          this.drawer = false;
+          this.lineName = this.cacheLine.lineName +"  "+ this.cacheLine.lineDesk;
+          this.lineId = this.cacheLine.lineId;
+        }
+
+    }
+  },
+};
+</script>
+
+<style lang='scss'>
+.addSaleOrderSend {
+  .from {
+    margin-top: 20px;
+    .line {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      .el-input {
+        width: 350px;
+        margin-left: 10px;
+        margin-right: 10px;
+      }
+    }
+    .sendCar {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      .el-input {
+        width: 70px;
+        margin-left: 10px;
+        margin-right: 10px;
+        margin-top: 10px;
+      }
+    }
+    .vehicle {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      margin-top: 20px;
+      .el-button {
+        width: 250px;
+        margin-left: 10px;
+        margin-right: 10px;
+      }
+      .span {
+        width: 70px;
+      }
+    }
+  }
+  .tablecls{
+    margin-top: 20px;
+  }
+  .button_box{
+    display: flex;
+    justify-content: center;
+    margin: 20px;
+    .el-button{
+      width: 100px;
+      margin-left: 20px;
+    }
+  }
+}
+</style>

+ 191 - 58
src/views/appoint/components/saleContract/addSaleOrderSend.vue

@@ -54,10 +54,10 @@
           <template slot="scope" v-if="item.label !== '截止日期'">
             <span>{{ item.label }}</span>
           </template>
-          <template slot="scope" v-if="item.label !== '收货姓名'">
+          <template slot="scope" v-if="item.label !== '收货'">
             <span>{{ item.label }}</span>
           </template>
-          <template slot="scope" v-if="item.label !== '收货方电话'">
+          <template slot="scope" v-if="item.label !== '收货客户电话号码'">
             <span>{{ item.label }}</span>
           </template>
           <!-- 插入输入框 -->
@@ -83,7 +83,7 @@
                 </el-input>
                 <el-button
                   type="primary"
-                  placeholder="(非必填)"
+                  placeholder="()"
                   @click="select(scope.$index,3)"
                   >浏览</el-button
                 >
@@ -227,44 +227,53 @@
         ></dilTable>
       </div>
     </el-drawer>
-    <!-- 运输单价的模态框 -->
+    <!-- 运输单价(地址对应)的模态框 -->
     <el-drawer 
       :visible.sync="addressDrawer" 
       :destroy-on-close="false"
       direction="rtl"
-      size="70%"
+      size="40%"
       :wrapperClosable="false"
       modal
       close-on-press-escape
     
     >
-      <el-input
-        placeholder="请输入内容"
-        v-model="addressText"
-        style="margin-top: 10px; margin-left: 20px; width: 250px"
-        clearable
-      >
-      </el-input>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="selectAddressClick"
-        style="margin-left: 5px"
-      >
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button
-        type="primary"
-        class="btn"
-        @click="addAddressClick"
-        style="margin-left: 5px"
-      >
-        <i class="el-icon-check"></i>确定
-      </el-button>
+    
+    <el-input v-model="addresText" placeholder="请输入内容" style="margin-top: 10px; margin-left: 20px; width: 250px"></el-input>
+        <el-button type="primary" @click="selectAddresClick" :loading="selectLineLoading"><i class="el-icon-search"></i>查询</el-button>
+         <!-- 已选中 省市(区)县 -->
+         <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">已选中省市县(区):</label>
+          </el-form-item>
+          <el-form-item>
+              <el-input class="el-form-item__content" v-model="address" placeholder="请输入内容" :disabled="true"></el-input>
+          </el-form-item>
+         </el-form>
+         <!-- 具体收货地址 -->
+         <div v-if="address != null">
+           <el-form :inline="true" style="margin-top: 0.5rem;" >
+
+          <el-form-item label="具体收货地址:">
+            <el-autocomplete
+              class="inline-input"
+              v-model="place"
+              :fetch-suggestions="querySearch1"
+              placeholder="请输入具体收货地址"
+              :trigger-on-focus="false"
+              @select="handleSelect1"
+            >
+            </el-autocomplete>
+          </el-form-item> 
+
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+         </el-form>
+         </div>
+
       <div class="tablecls">
         <!-- 查询所有的运输单价 -->
         <dilTable
-          v-bind.sync="Price"
+          v-bind.sync="Address"
           @radio-change="currentRadioChange2"
         ></dilTable>
       </div>
@@ -285,6 +294,16 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      //已选中 省市县(区)
+      address:null,
+      //具体收货地址
+      place:null,
+      //收货地址id
+      addressId:null,
+      //省市县(区)查询值
+      addresText:null,
+      //加载
+      selectLineLoading:false,
       //线路名称
       lineName:null,
       lineId:null,
@@ -298,6 +317,10 @@ export default {
         lineType : '',
         spellNumber : 0,
       },
+      //是否自提
+      saleOrderIsselfMention:'',
+      //单价已选数量
+      choosePriceCount: 0,
       //已经选择车辆物资信息
       selectionList:[],
       //销售订单物资信息
@@ -333,8 +356,8 @@ export default {
         selectionType: "select",
       },
       //运输单价的表格
-      Price: {
-        requestUrl: "/api/v1/ams/getAmsContractTransportPrice1?apiId=109&deleted=0",
+      Address: {
+        requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
         selectionType: "radio",
       },
       addressText:null,
@@ -346,16 +369,16 @@ export default {
           label: "车牌号",
           width: "100",
         },
-        {
-          prop: "materialName",
-          label: "物资名称",
-          width: "140",
-        },
         {
           prop: "carrierName",
           label: "承运商",
           width: "220",
         },
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: "140",
+        },
         {
           prop: "lineName",
           label: "运输线路",
@@ -387,7 +410,7 @@ export default {
         // },
         {
           prop: "saleOrderConsignee",
-          label: "收货客户",
+          label: "收货",
           width: "150",
           slot: true,
         },
@@ -403,10 +426,12 @@ export default {
       selectTruck:[],
       //销售订单与物资表主键
       saleMaterialId:null,
-      //记录点击的市哪一个收货地址的浏览
+      //销售订单主键
+      saleOrderId:null,
+      //记录点击的是哪一个收货地址的浏览
       addressIndex:null,
       //缓存当前选中的运输单价
-      priceMap:{},
+      // priceMap:{},
     };
   },
   created() {
@@ -426,6 +451,44 @@ export default {
         this.$message.warning('重量/电话号码请输入数字')
       }
     },
+    //收货地址弹出层
+    handleSelect1(item) {
+        console.log("获取所有下拉值!");
+    },
+    //查询全国省市县
+    selectAddresClick(){
+      if(this.addresText){
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con="+this.addresText;
+      }else{
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
+      }
+    },
+
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb){
+      this.axios
+        .post("/api/v1/ams/getRealAddressByLike?addressId="+this.addressId + "&index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+
     //点击确定按钮的事件
     makeSure(){
       let state = false;
@@ -448,11 +511,31 @@ export default {
         }
       })
       if(state){
-        this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
+        //校验是否自提,是自提,则运输单价必选,非自提,运输单价为空
+        if(this.saleOrderIsselfMention=='是'){
+          this.selectionList.forEach((e)=>{
+            e.priceValue = null;
+            e.priceId = null;
+          })
+          this.sendRequest();
+        }else{
+          //判断是否全部完成运输单价的选择
+          if(this.choosePriceCount==this.selectionList.length){
+            this.sendRequest();
+          }else{
+            this.$message.warning('还有运输单价未被选定!')
+          }
+        }
+      }else{
+        this.$message.warning('重量/电话号码请输入数字')
+      }
+    },
+    //发送请求
+    sendRequest(){
+      this.axios.post('/api/v1/ams/dispatchTruckOrderBySale',{
           saleOrderId:this.$route.params.saleOrderId,
           mapList:this.selectionList,
         }).then((res)=>{
-          console.log("res",res)
           if(res.data.code == '200'){
             this.$message.success('派车成功')
             this.cancel();
@@ -485,9 +568,6 @@ export default {
 
           }
         })
-      }else{
-        this.$message.warning('重量/电话号码请输入数字')
-      }
     },
     //点击取消按钮的事件
     cancel(){
@@ -507,6 +587,7 @@ export default {
             capacityId:row.capacityId,
             capacityNumber:row.capacityNumber,
             carrierName:row.carrierName,
+            carrierId:row.carrierId,
             lineId:row.lineId,
             lineName:row.lineName,
             materialId:row.materialId,
@@ -516,9 +597,10 @@ export default {
             saleMaterialId:row.saleMaterialId,
             saleOrderConsignee:row.saleOrderConsignee,
             saleOrderConsigneeTel:row.saleOrderConsigneeTel,
+            saleShipperAddressId:row.saleShipperAddressId,
+            place:row.place,
             priceValue:row.priceValue,
-            priceId:row.priceId,
-            saleShippingAddressId:row.saleShippingAddressId,
+            priceId:row.priceId
           }
           )
         }else{
@@ -530,17 +612,45 @@ export default {
     },
     //收货地址模态窗口的框计算
     selectAddressClick(){
-      this.Price.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
+      this.Address.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
     },
-    //运输单价模态窗口的点击事件
+
+    //运输单价模态窗口的点击确定事件--------------
     addAddressClick(){
-      //priceMap
-      this.selectionList[this.addressIndex].priceValue = this.priceMap.priceValue
-      this.selectionList[this.addressIndex].priceId = this.priceMap.priceId
+      //获取运输单价和运输单价ID
+      let map = {
+        place: this.place,
+        addressId: this.addressId
+      }
+      this.axios.post('/api/v1/ams/getPriceMap',map)
+      .then((res)=>{
+          if(res.data.data.priceId==-1){
+            this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+            this.selectionList[this.addressIndex].place = this.place;
+            this.selectionList[this.addressIndex].priceValue = '该区域尚未录入任何单价!';
+            this.selectionList[this.addressIndex].priceId = 0;
+            this.addAddressClickNext();
+          }else{
+            //赋值运输单价和运输单价ID
+            this.selectionList[this.addressIndex].saleShipperAddressId = this.addressId;
+            this.selectionList[this.addressIndex].place = this.place;
+            this.selectionList[this.addressIndex].priceValue = res.data.data.priceValue;//this.priceMap.priceValue
+            this.selectionList[this.addressIndex].priceId = res.data.data.priceId;//this.priceMap.priceId
+            this.addAddressClickNext();
+          }
+      });
+    },
+    //运输单价模态窗口的点击确定事件接续执行方法
+    addAddressClickNext(){
       this.addressDrawer = false;
       let arr = this.selectionList;
       this.selectionList = [];
+      //统计被选中的运输单价数量
+      var count = 0;
       arr.forEach((e)=>{
+        if(e.priceValue){
+          count++;
+        }
         this.selectionList.push({
           //销售订单与物资表主键
           capacityId:e.capacityId,
@@ -556,12 +666,16 @@ export default {
           saleMaterialId:e.saleMaterialId,
           saleOrderConsignee:e.saleOrderConsignee,
           saleOrderConsigneeTel:e.saleOrderConsigneeTel,
+          saleShipperAddressId:e.saleShipperAddressId,
+          place:e.place,
           priceValue:e.priceValue,
           priceId:e.priceId,
-          saleShippingAddressId:e.saleShippingAddressId,
         })
       })
+      //赋值单价已选数量
+      this.choosePriceCount = count;
     },
+
     //收货地址点击浏览的事件
     select(index){
       this.addressDrawer = true;
@@ -569,15 +683,28 @@ export default {
     },
     //收货地址模态框单选选中的事件
     currentRadioChange2(val){
-      this.priceMap = {};
-      this.priceMap = val;
+      //若具体地址有值,清空值
+      if(this.place!=null){
+        this.place=null;
+      }
+      this.address = val.address,
+      this.addressId = val.addressId;
+      // this.priceMap = {};
+      // this.priceMap = val;
     },
     //车辆模态框的确定事件
     AddTruckClick(){
-
       if(this.selectTruck.length>0){
       this.selectTruck.forEach(e => {
-        this.selectionList.push({
+        //通过承运商Id和销售订单Id获取运输单价和运输单价ID以提前赋值
+        let map = {
+          saleOrderId : this.saleOrderId,
+          carrierId: e.carrierId,
+        }
+        this.axios.post('/api/v1/ams/getBenPrice',map)
+        .then((res)=>{
+          //生成下方表单单元格
+          this.selectionList.push({
           //销售订单与物资表主键
           saleMaterialId:this.saleMaterialId,
           capacityId:e.capacityId,
@@ -588,7 +715,11 @@ export default {
           materialId:this.materialId,
           lineName:this.lineName,
           lineId:this.lineId,
-        })
+          priceValue:res.data.data.priceValue,
+          priceId:res.data.data.priceId,
+          saleOrderConsignee:null
+          })
+        });
       });
       this.truckDrawer = false;
       //置空当前多选选中的车辆数据
@@ -614,9 +745,11 @@ export default {
     },
     //主界面表格单选
     currentRadioChange(row) {
+      this.saleOrderIsselfMention = row.saleOrderIsselfMention;
       this.materialId = row.materialId;
       this.materialName = row.materialName;
       this.saleMaterialId = row.saleMaterialId;
+      this.saleOrderId = row.saleOrderId;
     },
     //线路表格的单选事件
     currentRadioChange5(row){
@@ -647,7 +780,7 @@ export default {
             getCookie("userId") + "&i=" + new Date();
         } else {
           this.truck.requestUrl =
-            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&i=" + new Date();;
+            "/api/v1/uc/getAllCapacityByCarrierLike?apiId=248&carrierSsoId=" + null + "&i=" + new Date();
         }
         //后续操作
         if(!this.materialId){

+ 114 - 37
src/views/appoint/components/saleContract/addTransportPrice.vue

@@ -7,7 +7,7 @@
         <dil-form :formId="287" v-model="form1" ref="from1"></dil-form>
       </div> 
       <div class="liulan">
-          <el-button type="primary" class="btn" @click="lineClick">浏览</el-button>
+          <el-button type="primary" class="btn" @click="oilPriceFormulaClick">浏览</el-button>
           <el-button type="primary" class="btn1" @click="addressClick">浏览</el-button>
           <!-- <el-button type="primary" class="btn2">浏览</el-button> -->
       </div>
@@ -36,30 +36,31 @@
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
     </div>
-    <!-- 线路模态框 -->
+    <!-- 油价联动公式模态框 -->
     <el-drawer
-      title="请选择线路"
-      :visible.sync="LineDrawer"
+      title="请选择油价联动公式"
+      :visible.sync="oilPriceFormulaDrawer"
       :direction="direction"
       :before-close="handleClose"
       close-on-press-escape
       modal
       wrapperClosable
-      size="40%"
+      size="70%"
     >
       <div class="selectText">
         <!-- <span></span> -->
         <el-input v-model="LineText" placeholder="请输入内容"></el-input>
         <el-button type="primary" @click="selectLineClick" :loading="selectLineLoading"><i class="el-icon-search"></i>查询</el-button>
+        <el-button type="primary" @click="addoilPriceFormula">确定</el-button>
       </div>
       <div class="LineTable">
         <vue-scroll :ops="ops" style="width:100%;height:100%">
           <dilTable 
-            v-bind.sync="line"
+            v-bind.sync="oilPriceFormula"
             @radio-change="currentRadioChange"
             :isKuang="isKuang"
             :loading="tableLoading"
-            :drawer="LineDrawer"
+            :drawer="oilPriceFormulaDrawer"
             @func="func"
           ></dilTable>
         </vue-scroll>
@@ -80,6 +81,35 @@
         <!-- <span></span> -->
         <el-input v-model="addresText" placeholder="请输入内容"></el-input>
         <el-button type="primary" @click="selectAddresClick" :loading="selectLineLoading"><i class="el-icon-search"></i>查询</el-button>
+         <!-- 已选中 省市(区)县 -->
+         <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">已选中省市县(区):</label>
+          </el-form-item>
+          <el-form-item>
+              <el-input class="el-form-item__content" v-model="address" placeholder="请输入内容" :disabled="true"></el-input>
+          </el-form-item>
+         </el-form>
+         <!-- 具体收货地址 -->
+         <div v-if="address != null">
+           <el-form :inline="true" style="margin-top: 0.5rem;" >
+
+          <el-form-item label="具体收货地址:">
+            <el-autocomplete
+              class="inline-input"
+              v-model="place"
+              :fetch-suggestions="querySearch1"
+              placeholder="请输入具体收货地址"
+              :trigger-on-focus="false"
+              @select="handleSelect1"
+            >
+            </el-autocomplete>
+          </el-form-item> 
+
+          <el-button type="primary" @click="specificAddress">确定</el-button>
+         </el-form>
+         </div>
+         
       </div>
       <div class="LineTable">
         <vue-scroll :ops="ops" style="width:100%;height:100%">
@@ -104,6 +134,10 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      //已选中 省市县(区)
+      address:null,
+      //具体收货地址
+      place:null,
       //承运商名称
       state: null,
       //承运商id
@@ -125,16 +159,18 @@ export default {
       isKuang:false,
       //表格加载状态
       tableLoading:false,
-      //是否打开线路的模态窗口
-      LineDrawer:false,
-      //线路查询条件
+      //公式内容
+      formulaString:null,
+      //油价联动公式Id
+      oilPriceFormulaId:null,
+      //是否打开油价联动公式的模态窗口
+      oilPriceFormulaDrawer:false,
+      //油价联动公式查询条件
       LineText:null,
-      //线路Id
-      lineId:null,
-      //线路模态框查询按钮状态
+      //油价联动公式模态框查询按钮状态
       selectLineLoading:false,
-      //线路模态窗口的数据
-      line:{
+      //油价联动公式模态窗口的数据
+      oilPriceFormula:{
         requestUrl:"",
         selectionType: "radio",
       },
@@ -200,9 +236,9 @@ export default {
       this.selectLineLoading = true;
       this.isKuang = true;
       if(this.LineText){
-        this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con="+this.LineText;
+        this.oilPriceFormula.requestUrl = "api/v1/uc/getOilFormula?apiId=444&con="+this.LineText;
       }else{
-        this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&i=" + new Date();
+        this.oilPriceFormula.requestUrl = "api/v1/uc/getOilFormula?apiId=444&i=" + new Date();
       }
     },
     //承运商弹出层
@@ -210,13 +246,17 @@ export default {
       this.carrierIds = item.carrierId;
       item.carrierName = this.state;
     },
+    //收货地址弹出层
+    handleSelect1(item) {
+        console.log("获取所有下拉值!");
+    },
     //以下是承运商边输边查搜索
     querySearch(queryString, cb) {
       this.axios
         .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
         .then((res) => {
           if (res.data.code == "200") {
-            console.log(res.data.data);
+            // console.log(res.data.data);
             var restaurants = res.data.data;
             // console.log(restaurants, "restaurants");
             var results = queryString
@@ -236,12 +276,41 @@ export default {
       };
     },
     //以上是承运商边输边查搜索
-    currentRadioChange(val){
+
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb){
+      this.axios
+        .post("/api/v1/ams/getRealAddressByLike?addressId="+this.addressId + "&index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            console.log(res.data.data);
+            var restaurants = res.data.data;
+            // console.log(restaurants, "restaurants");
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+    
+    //选定联动公式确定
+    addoilPriceFormula(){
       let mapvalue = {
         shipperId : this.form1.shipperId,
-        lineName:val.lineName,
+        oilPriceFormula:this.formulaString,
+        cargonameId : this.oilPriceFormulaId,
         capacityTypeId : this.form1.capacityTypeId,
-        cargonameId : this.form1.cargonameId,
         priceValue : this.form1.priceValue,
         priceDate : this.form1.priceDate,
         addressName:this.form1.addressName,
@@ -251,29 +320,38 @@ export default {
         oilpriceChangeThreshold : this.form1.oilpriceChangeThreshold
       }
       this.form1 = mapvalue;
-      this.lineId = val.lineId;
+      this.oilPriceFormulaDrawer = false;
+    },
+    currentRadioChange(val){
+      this.formulaString = val.formulaString;
+      this.oilPriceFormulaId = val.formulaId;
     },
     currentRadioChange1(val){
+      this.address = val.address,
+      this.addressId = val.addressId;
+    },
+    //具体地址确定
+    specificAddress(){
       let mapvalue = {
         shipperId : this.form1.shipperId,
-        lineName:this.form1.lineName,
+        oilPriceFormula:this.formulaString,
         capacityTypeId : this.form1.capacityTypeId,
-        cargonameId : this.form1.cargonameId,
+        cargonameId : this.oilPriceFormulaId,
         priceValue : this.form1.priceValue,
         priceDate : this.form1.priceDate,
-        addressName:val.address,
+        addressName:this.address +''+ this.place,
         type : this.form1.type,
         oilpriceBase : this.form1.oilpriceBase,
         oilTypeId : this.form1.oilTypeId,
         oilpriceChangeThreshold : this.form1.oilpriceChangeThreshold
       }
       this.form1 = mapvalue;
-      this.addressId = val.addressId;
+      this.addresDrawer = false;
     },
     //打开线路的模态窗口
-    lineClick(){
-      this.LineDrawer = true;
-      this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3"
+    oilPriceFormulaClick(){
+      this.oilPriceFormulaDrawer = true;
+      this.oilPriceFormula.requestUrl = "/api/v1/uc/getOilFormula?apiId=444"
     },
     addressClick(){
       this.addresDrawer = true;
@@ -281,8 +359,8 @@ export default {
     },
     //模态窗口关闭时调用
     handleClose(){
-      if(this.LineDrawer){
-        this.LineDrawer = false;
+      if(this.oilPriceFormulaDrawer){
+        this.oilPriceFormulaDrawer = false;
         this.LineText = null;
       }
       if(this.addresDrawer){
@@ -291,22 +369,21 @@ export default {
       }
     },
     makeSure() {
-      let amsContractTransportPrice={
+      let mapValue={
         shipperId : this.form1.shipperId,
         carrierId : this.carrierIds,
-        lineId : this.lineId,
+        cargonameId : this.oilPriceFormulaId,
         capacityTypeId : this.form1.capacityTypeId,
-        cargonameId : this.form1.cargonameId,
         priceValue : this.form1.priceValue,
         priceDate : sjTime(this.form1.priceDate),
         addressId : this.addressId,
         type : this.form1.type,
         oilpriceBase : this.form1.oilpriceBase,
         oilTypeId : this.form1.oilTypeId,
-        oilpriceChangeThreshold : this.form1.oilpriceChangeThreshold
+        oilpriceChangeThreshold : this.form1.oilpriceChangeThreshold,
+        place: this.place
       }
-      // console.log("amsContractTransportPrice",amsContractTransportPrice)
-      this.axios.post("/api/v1/ams/addAmsContractTransportPrice", amsContractTransportPrice).then((res) => {
+      this.axios.post("/api/v1/ams/addAmsContractTransportPrice", mapValue).then((res) => {
           if (res.data.code == "200") {
             this.$router.go(-1);
           }

+ 9 - 0
src/views/appoint/components/saleContract/saleOrder.vue

@@ -25,6 +25,12 @@
                 size="small"
                 >派车</el-button
               >
+              <el-button
+                @click="coproductSendClick(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >副产品派车</el-button
+              >
               <el-button
                 @click="addClick(scope.row.saleOrderId)"
                 type="text"
@@ -260,6 +266,9 @@ export default {
     sendClick(saleOrderId){
       this.$router.push("/addSaleOrderSend/" + saleOrderId);
     },
+    coproductSendClick(saleOrderId){
+      this.$router.push("/addSaleOrderCoproductSend/" + saleOrderId);
+    },
     // -------查看物资详情 (已审批)
     detailclick(row) {
       // 记录重复点击次数

+ 1 - 1
src/views/appoint/components/saleContract/saleOrderArrange.vue

@@ -141,7 +141,7 @@ export default {
           .catch(() => {
             this.$message({
               type: "info",
-              message: "取消上传!",
+              message: "取消下发!",
             });
           });
       }

+ 1 - 48
src/views/appoint/components/saleContract/transportPrice.vue

@@ -12,23 +12,10 @@
        <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
     </div>
 
-<el-tabs v-model="activeName" @tab-click="handleClick">
+<el-tabs v-model="activeName">
       <!-- 正在启用 -->
        <el-tab-pane label="正在启用" name="first">
           <dilTable ref="excelDom" v-bind.sync="option" :loading="loading" :isKuang="isKuang" @func="func">
-      <!-- <el-table-column fixed="right" label="操作" width="200">
-        <template slot-scope="scope">
-          <el-button @click="click(scope.row.priceId)" type="text" size="small"
-            >修改</el-button
-          >
-          <el-button
-            type="text"
-            size="small"
-            @click="deleteclick(scope.row.priceId)"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column> -->
         </dilTable>
       </el-tab-pane>
       <!-- 历史启用 -->
@@ -79,40 +66,6 @@ export default {
     btnclick() {
       this.$router.push("/addTransportPrice");
     },
-    // click(priceId) {
-    //   this.$router.push("/editTransportPrice/" + priceId);
-    // },
-    // deleteclick(scope) {
-    //   let priceId = scope;
-    //   this.$confirm("是否删除", "提示", {
-    //     confirmButtonText: "确定",
-    //     cancelButtonText: "取消",
-    //     type: "warning",
-    //     center: true,
-    //   })
-    //     .then(() => {
-    //       this.$message({
-    //         type: "success",
-    //         message: "删除成功!",
-    //       });
-    //       this.axios
-    //         .post(
-    //           "/api/v1/ams/deleteAmsContractTransportPrice1?priceId=" +
-    //             priceId
-    //         )
-    //         .then((res) => {
-    //           if (res.data.code == "200") {
-    //             this.$router.go(0);
-    //           }
-    //         });
-    //     })
-    //     .catch(() => {
-    //       this.$message({
-    //         type: "info",
-    //         message: "取消删除!",
-    //       });
-    //     });
-    // },
   },
   
 };

+ 2 - 0
src/views/appoint/router/index.js

@@ -35,6 +35,7 @@ import addSaleCokeSend from '../components/saleContract/addSaleCokeSend.vue'
 import addSaleOrder from '../components/saleContract/addSaleOrder.vue'
 import addSaleOrderArrange from '../components/saleContract/addSaleOrderArrange.vue'
 import addSaleOrderSend from '../components/saleContract/addSaleOrderSend.vue'
+import addSaleOrderCoproductSend from '../components/saleContract/addSaleOrderCoproductSend.vue'
 import addSalePlan from '../components/saleContract/addSalePlan.vue'
 import addSalePlanDetail from '../components/saleContract/addSalePlanDetail.vue'
 import addTransportPrice from '../components/saleContract/addTransportPrice.vue'
@@ -93,6 +94,7 @@ const constantRouterMap = [
       {path: 'addSaleCokeSend/:saleOrderId', name: 'addSaleCokeSend', meta: {code: 'xtpzgl-jggl'}, component: addSaleCokeSend},
       {path: 'addSaleOrder', name: 'addSaleOrder', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrder},
       {path: 'addSaleOrderArrange/:saleOrderId', name: 'addSaleOrderArrange', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrderArrange},
+      {path: 'addSaleOrderCoproductSend/:saleOrderId', name: 'addSaleOrderCoproductSend', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrderCoproductSend},
       {path: 'addSaleOrderSend/:saleOrderId', name: 'addSaleOrderSend', meta: {code: 'xtpzgl-jggl'}, component: addSaleOrderSend},
       {path: 'addSalePlan', name: 'addSalePlan', meta: {code: 'xtpzgl-yhgl'}, component: addSalePlan},
       {path: 'addSalePlanDetail/:planId', name: 'addSalePlanDetail', meta: {code: 'xtpzgl-yhgl'}, component: addSalePlanDetail},

+ 6 - 6
src/views/sale/components/transportFreight/saleTruckSettlement/addBmsTruckStatement.vue

@@ -42,10 +42,10 @@ export default {
       this.mapList=selection
     },
     onclick() {
-      console.log(1);
+      console.log("查询待定值");
     },
     btnclick() {
-      this.$confirm("是否下发", "提示", {
+      this.$confirm("是否生成账单", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -56,15 +56,15 @@ export default {
             .post("/api/v1/bms/addTruckStatement",this.mapList
 			)
             .then((res) => {
-              if (res.data.code == 200) {
+              if (res.data.code == 0) {
                 this.$message({
                   type: "success",
-                  message: "下发成功!",
+                  message: "生成账单成功!",
                 });     
                 this.$router.go(-1);
               } else {
                 this.$message({
-                  message: "下发失败",
+                  message: "生成账单失败",
                   type: "warning",
                 });
               }
@@ -73,7 +73,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消下发!",
+            message: "取消生成账单!",
           });
         });
       // this.$router.push("/path/addHomeworkPath/");

+ 6 - 6
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckAudit.vue

@@ -47,15 +47,15 @@ export default {
 		      .post("/api/v1/bms/updateBmstruckCheck?statementId="+this.$route.params.statementId+"&status="+"1"+"&person="+"2"
 					)
 		      .then((res) => {
-		        if (res.data.code == 200) {
+		        if (res.data.code == 0) {
 		          this.$message({
 		            type: "success",
-		            message: "稽核成功!",
+		            message: "通过成功!",
 		          });     
 		          this.$router.go(-1);
 		        } else {
 		          this.$message({
-		            message: "稽核失败",
+		            message: "通过失败",
 		            type: "warning",
 		          });
 		        }
@@ -80,15 +80,15 @@ export default {
 		      .post("/api/v1/bms/updateBmstruckCheck?statementId="+this.$route.params.statementId+"&status="+"0"+"&person="+"2"
 					)
 		      .then((res) => {
-		        if (res.data.code == 200) {
+		        if (res.data.code == 0) {
 		          this.$message({
 		            type: "success",
-		            message: "稽核成功!",
+		            message: "不通过成功!",
 		          });     
 		          this.$router.go(-1);
 		        } else {
 		          this.$message({
-		            message: "稽核失败",
+		            message: "不通过失败",
 		            type: "warning",
 		          });
 		        }

+ 352 - 6
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailOrder.vue

@@ -8,30 +8,376 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
-      </dilTable>
+      <el-tabs v-model="activeName">
+        <!-- 未结算 -->
+        <el-tab-pane label="未结算" name="first">
+        <dilTable v-bind.sync="options1">
+            <el-table-column fixed="right" label="操作" width="145">
+                <template slot-scope="scope">
+                  <el-button v-if="ssoId==null" type="text" size="small" @click="priceValueUpdate(scope.row)">修改详单地址</el-button>
+                  <!-- <el-button type="text" size="mini" @click="getclick(scope)">查看</el-button> -->
+                  <el-button type="text" size="mini" @click="addDamage(scope.row)">增加途损</el-button>
+                </template>
+            </el-table-column>
+        </dilTable>
+        </el-tab-pane>
+        <!-- 已结算 -->
+        <el-tab-pane label="已结算" name="second">
+        <dilTable v-bind.sync="options2">
+            <!-- <el-table-column fixed="right" label="操作" width="40">
+                <template slot-scope="scope">
+                  <el-button type="text" size="mini" @click="getclick(scope)">查看</el-button>
+                </template>
+            </el-table-column> -->
+        </dilTable>
+        </el-tab-pane>
+      </el-tabs>
     </div>
+    <!-- 修改详单单价弹出框 -->
+    <el-dialog title="修改详单地址" :visible.sync="dialogFormVisible" append-to-body>
+      <!-- 内层单价选择弹出框 -->
+      <el-dialog
+      width="40%"
+      title="地址筛选"
+      :visible.sync="addressDrawer"
+      append-to-body>
+
+      <el-input v-model="addresText" placeholder="请输入内容" style="margin-top: 10px; margin-left: 20px; width: 250px"></el-input>
+        <el-button type="primary" @click="selectAddresClick" :loading="selectLineLoading"><i class="el-icon-search"></i>查询</el-button>
+         <!-- 已选中 省市(区)县 -->
+         <el-form :inline="true" style="margin-top: 0.5rem;">
+          <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">已选中省市县(区):</label>
+          </el-form-item>
+          <el-form-item>
+              <el-input class="el-form-item__content" v-model="address" placeholder="请输入内容" :disabled="true"></el-input>
+          </el-form-item>
+         </el-form>
+         <!-- 具体收货地址 -->
+         <div v-if="address != null">
+           <el-form :inline="true" style="margin-top: 0.5rem;" >
+
+          <el-form-item label="具体收货地址:">
+            <el-autocomplete
+              class="inline-input"
+              v-model="place"
+              :fetch-suggestions="querySearch1"
+              placeholder="请输入具体收货地址"
+              :trigger-on-focus="false"
+              @select="handleSelect1"
+            >
+            </el-autocomplete>
+          </el-form-item> 
+
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+         </el-form>
+         </div>
+
+      <div class="tablecls">
+        <!-- 查询所有的运输单价 -->
+        <dilTable
+          v-bind.sync="Address"
+          @radio-change="currentRadioChange2"
+        ></dilTable>
+      </div>
+      </el-dialog>
+      <!-- 内层单价选择弹出框 -->
+
+      <el-form>
+        <el-form-item label="原详单地址" :label-width="formLabelWidth">
+          <el-input style="width:250px" v-model="originalAddress" disabled autocomplete="off"></el-input>
+          <label>原单价</label>
+          <el-input style="width:100px" v-model="originalPriceValue" disabled autocomplete="off"></el-input>
+          
+        </el-form-item>
+        <el-form-item label="新详单地址" :label-width="formLabelWidth">
+          <el-input style="width:250px" v-model="newAddress" disabled autocomplete="off"></el-input>
+          <label>现单价</label>
+          <el-input style="width:100px" v-model="newPriceValue" disabled autocomplete="off"></el-input>
+          <el-button type="primary" placeholder="()" @click="select">浏览</el-button>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
+        <el-button type="primary" @click="makeSure">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 增加途损 -->
+      <el-dialog title="*注:途损费计算规则为()" width="30%" :visible.sync="dialogDamage">
+    <el-form>
+      <el-form-item label="请输入途损费" :label-width="formLabelWidth">
+        <el-input v-model="damageFee" autocomplete="off"></el-input>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="dialogDamage = false">取 消</el-button>
+      <el-button type="primary" @click="makeSureAdd">确 定</el-button>
+    </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
   data(){
     return{
+      //已选中 省市县(区)
+      address:null,
+      //具体收货地址
+      place:null,
+      //收货地址id
+      addressId:null,
+      //省市县(区)查询值
+      addresText:null,
+      //途损费
+      damageFee:null,
+      //加载
+      selectLineLoading:false,
       input:"",
-      options:{
+      activeName:"first",
+      ssoId:null,
+      //详单Id
+      detailsId:null,
+      options1:{
         // first请求数据的地址
-        requestUrl: "/api/v1/bms/getTruckDetailsOrderList?apiId=176&orderType=1",
+        requestUrl: "",
       },
+      options2:{
+        // second请求数据的地址
+        requestUrl: "",
+      },
+      //是否打开修改详单地址弹出框
+      dialogFormVisible:false,
+      //是否打开增加途损弹出框
+      dialogDamage:false,
+      //原详单单价
+      originalPriceValue:null,
+      //新详单单价
+      newPriceValue:null,
+      //原详单地址
+      originalAddress:null,
+      //新详单地址
+      newAddress:null,
+      //新单价Id
+      priceId:null,
+      //是否打开运输单价的模态框
+      addressDrawer:false,
+      //运输单价的表格
+      Address: {
+        requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
+        selectionType: "radio",
+      },
+      // addressText:null,
+      //缓存当前选中的运输单价
+      priceMap:{},
+      formLabelWidth: '125px'
     }
   },
+  created(){
+     this.options1GetRequestUrl();
+     this.options2GetRequestUrl();
+  },
   methods:{
+    //已结算数据
+    options1GetRequestUrl(){
+    if(getCookie("orgCode") == "chengyunshang"){
+      this.ssoId=getCookie('userId');
+      this.options1.requestUrl = "/api/v1/bms/getUnFinishedTruckDetailsOrderList?apiId=176&orderType=1&carrierSsoId="+ getCookie('userId');
+    }else{
+      this.options1.requestUrl = "/api/v1/bms/getUnFinishedTruckDetailsOrderList?apiId=176&orderType=1&carrierSsoId=" + this.ssoId;
+    }
+    },
+    //未结算数据
+    options2GetRequestUrl(){
+    if(getCookie("orgCode") == "chengyunshang"){
+      this.options2.requestUrl = "/api/v1/bms/getTruckDetailsOrderList?apiId=176&orderType=2&carrierSsoId="+ getCookie('userId');
+    }else{
+      this.options2.requestUrl = "/api/v1/bms/getTruckDetailsOrderList?apiId=176&orderType=2&carrierSsoId=" + this.ssoId;
+    }
+    },
+    //收货地址弹出层
+    handleSelect1(item) {
+        console.log("获取所有下拉值!");
+    },
+    //查询全国省市县
+    selectAddresClick(){
+      if(this.addresText){
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con="+this.addresText;
+      }else{
+        this.Address.requestUrl = "/api/v1/ams/getAddressDeliveryAddress?apiId=255&i=" + new Date();
+      }
+    },
+    //以下是收货地址边输边查搜索
+    querySearch1(queryString, cb){
+      this.axios
+        .post("/api/v1/ams/getRealAddressByLike?addressId="+this.addressId + "&index=" + queryString)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter1(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    createFilter1(queryString) {
+      return (restaurants) => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    //以上是收货地址边输边查搜索
+
      toInsert() {
       this.$router.push("/insertCheckInventory");
-
+    },
+    // getclick(scope){
+		//   this.$router.push("/getTransportResult/"+scope.row.orderId)
+	  // },
+    //增加途损
+    addDamage(row){
+      this.detailsId = row.detailsId;
+      this.dialogDamage = true;
+    },
+    makeSureAdd(){
+      if(this.damageFee==null){
+        this.$message.error('还未输入途损费!')
+      }else{
+        this.dialogDamage = false;
+        let map = {
+        detailsId: this.detailsId,
+        lossFees: this.damageFee
+        }
+        //是否确定增加途损费!
+      this.$confirm("是否确定增加途损费", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+      .then(() => {
+        //初始化增加途损费对话框中的信息
+        this.damageFee=null,
+        this.axios.post('/api/v1/bms/addLossFeeOfCoke',map).then((res)=>{
+            if(res.data.code == '0'){
+            this.$message.success('增加途损费成功!')
+            //重置未结算详单表单信息
+            this.options1.requestUrl = "/api/v1/bms/getUnFinishedTruckDetailsOrderList?apiId=176&orderType=1&i=" + new Date();
+          }else{
+            this.$message.error('增加途损费失败,请联系管理员!')
+          }
+        });
+      })
+      .catch(() => {
+        this.$message({
+          type: "info",
+          message: "取消修改详单单价!",
+        });
+      });
+      }
+      
     },
     onclick(){
-      this.options.requestUrl = "/api/v1/bms/getTruckDetailsOrderList?apiId=176&orderType=1&con="+this.input;
+      console.log("查询待定值")
+      // this.options.requestUrl = "/api/v1/bms/getTruckDetailsOrderList?apiId=176&orderType=1&con="+this.input;
+    },
+    //修改详单单价
+    priceValueUpdate(row){
+      this.originalAddress = row.realAddress;
+      this.originalPriceValue = row.priceValue;
+      this.detailsId = row.detailsId;
+      this.dialogFormVisible = true
+    },
+    //运输订单点击浏览的事件
+    select(){
+      this.addressDrawer = true;
+    },
+    //运输单价模态窗口的框计算
+    selectAddressClick(){
+      this.Price.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
+    },
+    //运输单价模态窗口的点击事件
+    addAddressClick(){
+      //获取运输单价和运输单价ID
+      let map = {
+        place: this.place,
+        addressId: this.addressId
+      }
+      this.axios.post('/api/v1/ams/getPriceMap',map)
+      .then((res)=>{
+          if(res.data.data.priceId==-1){
+            this.newPriceValue = '未录单价!';
+            this.priceId = null;
+          }else{
+            //赋值运输单价和运输单价ID
+            this.newPriceValue = res.data.data.priceValue;//this.priceMap.priceValue
+            this.priceId = res.data.data.priceId;//this.priceMap.priceId
+          }
+      });
+      //priceMap
+      this.newAddress = this.address+this.place;
+      this.addressDrawer = false;
+    },
+    //运输单价模态框单选选中的事件
+    currentRadioChange2(val){
+      //若具体地址有值,清空值
+      if(this.place!=null){
+        this.place=null;
+      }
+      this.address = val.address,
+      this.addressId = val.addressId;
+      // this.priceMap = {};
+      // this.priceMap = val;
+    },
+    //确认修改详单单价
+    makeSure(){
+      //若没有单价Id
+      if(this.priceId==null){
+        this.$message.error('该区域没有录入单价,不可修改!')
+      }else{
+      this.dialogFormVisible = false;
+      let mapValue = {
+        detailsId: this.detailsId,
+        priceId: this.priceId
+      }
+      //是否确定修改详单地址!
+      this.$confirm("是否确定修改详单地址", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+      .then(() => {
+        //初始化修改详单地址对话框的信息
+        this.newPriceValue=null,
+        this.newAddress=null,
+        this.address=null,
+        this.addresText=null,
+        this.addressId=null,
+        this.priceId=null,
+        this.axios.post('/api/v1/bms/updateDetailsOrder',mapValue).then((res)=>{
+            if(res.data.code == '0'){
+            this.$message.success('修改详单单价成功!')
+            //重置未结算详单表单信息
+            this.options1.requestUrl = "/api/v1/bms/getUnFinishedTruckDetailsOrderList?apiId=176&orderType=1&i=" + new Date();
+          }else{
+            this.$message.error('修改详单单价失败,请联系管理员!')
+          }
+        });
+      })
+      .catch(() => {
+        this.$message({
+          type: "info",
+          message: "取消修改详单单价!",
+        });
+      });
+      }
     }
   }
 }

+ 2 - 1
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckStatement.vue

@@ -57,7 +57,8 @@ export default {
       this.$router.push("/bmsTruckAudit/"+scope.row.statementId)
     },
     onclick(){
-      this.options.requestUrl = "/api/v1/bms/getTruckStatementList?apiId=179&con="+this.input;
+      console.log("查询待定值")
+      // this.options.requestUrl = "/api/v1/bms/getTruckStatementList?apiId=179&con="+this.input;
     }
   }
 }

+ 2 - 1
src/views/sale/components/transport_appointment/directionalDispatch.vue

@@ -263,11 +263,12 @@ export default {
       }
       this.axios.post("/api/v1/ams/addDispatchSaleOrder", map).then((res) => {
           if (res.data.code == "200") {
-            this.$router.go(0);
             this.$message({
             type: "success",
             message: "下发成功!",
           });
+          this.first.requestUrl = "/api/v1/ams/getTruckNoList?apiId=411&issueStatus=1&i=" + new Date();
+          this.table = false;
           }
         });
       }

+ 4 - 5
src/views/sale/components/transport_appointment/openDistribution.vue

@@ -10,11 +10,14 @@
       <el-button type="primary" class="btn" @click="onclick1">
         <i class="el-icon-search"></i>查询
       </el-button>
+      <el-button v-if="activeName=='first'" type="primary" @click="receive">
+        <i></i>批量接收订单
+      </el-button>
     </div>
     <div class="table">
       <el-tabs v-model="activeName" @tab-click="handleClick">
       <!-- 未抢单 -->
-      	<el-tab-pane label="未接收" name="first" >
+      	<el-tab-pane label="未接收" name="first">
 						  <dilTable v-bind.sync="first" ref="table" @selection-change="currentSelectChange">
              <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
@@ -82,10 +85,6 @@
     </el-tabs>
     
     </div>
-
-    <div class="button-box" v-if="activeName=='first'">
-      <el-button type="primary" @click="receive">接收订单</el-button>
-    </div>
   </div>
 </template>
 

+ 52 - 1
src/views/sale/components/transport_order/receiveOrder.vue

@@ -7,6 +7,9 @@
       <el-button type="primary" class="btn" @click="onClick">
         <i class="el-icon-search"></i>查询
       </el-button>
+      <el-button type="primary" class="btn" @click="batchCloseOrder">
+        <i></i>批量关闭订单
+      </el-button>
       <el-button type="primary" @click="refresh">
         <i class="el-icon-refresh"></i>刷新
       </el-button>
@@ -30,7 +33,7 @@
         <el-tabs v-model="activeName">
           <!-- 未接收 -->
           <el-tab-pane label="未接收" name="third">
-            <dilTable v-bind.sync="option3" ref="table2">
+            <dilTable v-bind.sync="option3" @selection-change="selectionChange" ref="table2">
               <el-table-column fixed="right" label="操作" width="180">
                 <template slot-scope="scope">
                   <el-button
@@ -174,6 +177,8 @@ export default {
         requestUrl:
           "/api/v1/oms/getDriverInfoForSale?apiId=226&orderType=2&orderStatus=4&carrierSsoId=" +
           getCookie("userId"),
+        selectionType: "select",
+        mapList: [],
       },
       truck: {
         requestUrl:
@@ -242,6 +247,52 @@ export default {
         this.option3.requestUrl = "/api/v1/oms/getDriverInfoForSale?apiId=226&orderType=2&orderStatus=4&carrierSsoId=" +
           getCookie("userId") + "&t=" + new Date()
     },
+    selectionChange(selection) {
+      this.option3.mapList = selection;
+    },
+    batchCloseOrder(){
+      if (this.option3.mapList.length == 0) {
+        this.$message({
+          type: "warning",
+          message: "请先选择要关闭的订单!",
+        });
+      } else {
+        this.$confirm("是否关闭这些订单", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          center: true,
+        })
+          .then(() => {
+            //初始化maplist
+            var mapList = [];
+            this.option3.mapList.forEach((item) => {
+              //初始化mapItem
+              var mapItem = {
+                //销售订单物资中间表id
+                orderId: 0,
+              };
+              mapItem.orderId = item.orderId;
+              mapList.push(mapItem);
+            });
+            this.$message({
+              type: "success",
+              message: "关闭成功!",
+            });
+            this.axios.post("/api/v1/oms/batchCloseOrder", mapList).then((res) => {
+              if (res.data.code == "200") {
+                this.$router.go(0);
+              }
+            });
+          })
+          .catch(() => {
+            this.$message({
+              type: "info",
+              message: "取消关闭!",
+            });
+          });
+      }
+    },
     refresh(){
       this.$router.go(0);
     },