Bladeren bron

提交仓储

胡半仙 3 jaren geleden
bovenliggende
commit
ce6b2ec514
33 gewijzigde bestanden met toevoegingen van 2967 en 314 verwijderingen
  1. 4 2
      build/utils.js
  2. 5 2
      config/index.js
  3. BIN
      dist.zip
  4. 2 2
      package.json
  5. 1 0
      src/components/DilCommonUI/packages/table/src/table.js
  6. 16 15
      src/views/RMS/components/addCapacity.vue
  7. 2 2
      src/views/RMS/components/capacity.vue
  8. 93 3
      src/views/RMS/components/transitRoute.vue
  9. 67 36
      src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue
  10. 108 0
      src/views/WMS/components/steel/bar1_steel/bar1_steel_outboundStatistics.vue
  11. 1 0
      src/views/WMS/components/steel/steel_inbound.vue
  12. 1 0
      src/views/WMS/components/steel/steel_inboundReal.vue
  13. 38 12
      src/views/WMS/components/steel/steel_outbound.vue
  14. 108 0
      src/views/WMS/components/steel/steel_outboundStatistics.vue
  15. 6 2
      src/views/WMS/router/index.js
  16. 1 1
      src/views/appoint/components/saleContract/addSaleCokeSend.vue
  17. 222 65
      src/views/appoint/components/saleContract/addSaleOrderArrange.vue
  18. 1077 0
      src/views/appoint/components/saleContract/addSaleOrderCoproductSend.vue
  19. 192 59
      src/views/appoint/components/saleContract/addSaleOrderSend.vue
  20. 114 37
      src/views/appoint/components/saleContract/addTransportPrice.vue
  21. 9 0
      src/views/appoint/components/saleContract/saleOrder.vue
  22. 1 1
      src/views/appoint/components/saleContract/saleOrderArrange.vue
  23. 447 0
      src/views/appoint/components/saleContract/saleOrderCoproduct.vue
  24. 1 48
      src/views/appoint/components/saleContract/transportPrice.vue
  25. 4 0
      src/views/appoint/router/index.js
  26. 3 1
      src/views/inward/components/truckAppoint/addRequirement2.vue
  27. 6 6
      src/views/sale/components/transportFreight/saleTruckSettlement/addBmsTruckStatement.vue
  28. 6 6
      src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckAudit.vue
  29. 372 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

+ 4 - 2
build/utils.js

@@ -15,9 +15,11 @@ 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 = ['all']
 // let devModules = ['index','SporadicManage','TMS','statisticalReport','RMS'];
-let devModules = ['index','appoint','WMS','sale'];
+
+// let devModules = ['index','appoint','WMS','sale'];
+
 if (pathSrc.indexOf('node_modules') > -1) {
     devModules = require('../../../cors.js').devModules;
 }

+ 5 - 2
config/index.js

@@ -64,10 +64,12 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    // target: "http://172.16.33.166:8080",
+
+    target: "http://172.16.33.166:8080",
     // target: "http://localhost:8019",
-    target: "http://localhost:8080",
+    // target: "http://localhost:8080",
     // target: "http://192.168.1.114:8019",
+
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"
@@ -75,6 +77,7 @@ let proxyTable = {
   },
   "/views/api/v1": {
     target: "http://172.16.33.166:8080",
+    // target: "http://172.16.33.166:8080",
     // target: "http://192.168.1.115:8080",
     ws: true,
     pathRewrite: {

BIN
dist.zip


+ 2 - 2
package.json

@@ -40,7 +40,7 @@
     "sass-node": "^4.11.2",
     "sass-resources-loader": "^2.2.4",
     "script-loader": "^0.7.2",
-    "socket.io": "2.2.0",
+    "socket.io": "^2.2.0",
     "socket.io-stream": "^0.9.1",
     "sockjs-client": "^1.3.0",
     "uuid": "^3.3.2",
@@ -106,7 +106,7 @@
     "less-loader": "~4.1.0",
     "mocha": "^5.2.0",
     "mocha-webpack": "^1.1.0",
-    "moment": "^2.22.2",
+    "moment": "^2.29.1",
     "nightwatch": "^0.9.12",
     "node-notifier": "^5.1.2",
     "node-sass": "^4.7.2",

+ 1 - 0
src/components/DilCommonUI/packages/table/src/table.js

@@ -190,6 +190,7 @@ export default {
     },
     // 更新请求参数
     setDataRequestQuery(value) {
+      console.log(value);
       let q = this.dataRequestQuery;
       for (const key in value) {
         q[key] = value[key];

+ 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);

+ 67 - 36
src/views/TMS/components/importedIngredients/transportReserveFuAddIngredients.vue

@@ -2,35 +2,33 @@
   <!-- 新增运输作业页面 -->
   <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"
+    <div class="supplieUnit">
+      <el-form
+        :inline="true"
+        class="demo-form-inline"
+        label-width="80px"
         >
-        </el-option>
-      </el-select> -->
-      <span class="span"></span>
+        <el-form-item label="发货单位:">
+         <el-autocomplete
+          class="inline-input"
+          v-model="stateSupplier"
+          :fetch-suggestions="querySearchSupplier"
+          placeholder="请输入发货单位名称"
+          :trigger-on-focus="false"
+          @select="handleSelectSupplier"
+        >
+        <template slot-scope="{ item }">
+          <div class="name">{{ item.supplierName }}</div>
+        </template>
+        </el-autocomplete>
+        </el-form-item>
+     </el-form>
     </div>
     <div class="material from">
       <span class="text">物资:</span>
       <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 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 class="input" v-model="remark" @blur="onBlur"> </el-input>
@@ -62,11 +60,6 @@
         >
       </div>
     </div>
-    <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
         :data="selectionList"
@@ -265,6 +258,10 @@ export default {
           slot: true,
         },
       ],
+      //发货单位名称
+      supplierName: "",
+      stateSupplier:null,
+      restaurantsSupplier:null,
       //车辆表格数据
       selectionList: [],
       // 表单
@@ -343,6 +340,27 @@ export default {
     onBlur() {
       this.getPurchaseOrderNo();
     },
+      //发货单位弹出层
+    handleSelectSupplier(item){
+      this.supplierId = item.supplierId
+      this.supplierName = item.supplierName
+    },
+    //以下是发货单位边输边查搜索
+    querySearchSupplier(queryString, cb) {
+        this.axios.post('/api/v1/uc/getSupplierMesByLike?index='+this.stateSupplier).then((res)=>{
+        if(res.data.code == "200"){    
+          var restaurantsSupplier = res.data.data
+          var results = queryString ? restaurantsSupplier.filter(this.createFilterSupplier(queryString)) :restaurantsSupplier;
+          // 调用 callback 返回建议列表的数据
+          cb(results);
+        }
+      })  
+      },
+    createFilterSupplier(queryString) {
+        return (restaurantsSupplier) => {
+          return (restaurantsSupplier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
+        };
+      },
     getPurchaseOrderNo() {
       let map = {
         materialId: this.materialId,
@@ -385,7 +403,7 @@ export default {
         if (this.onDrawerNumber == 1) {
           this.frist.requestUrl =
             "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-            this.input;
+            this.input + "&supplierId=" + this.supplierId;
         } else if (this.onDrawerNumber == 2) {
           this.secend.requestUrl =
             "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
@@ -426,7 +444,7 @@ export default {
         if (this.onDrawerNumber == 1) {
           this.frist.requestUrl =
             "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&i=" +
-            new Date();
+            new Date() + "&supplierId=" + this.supplierId;
         } else if (this.onDrawerNumber == 2) {
           this.secend.requestUrl =
             "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
@@ -464,12 +482,21 @@ export default {
       }
     },
     ondrawer(num) {
+      if(this.supplierId == null){
+          this.$message.warning("请先选择发货单位")
+          return
+      }
+      console.log(num)
+      if(num != 1 && this.materialId == null){
+          this.$message.warning("请先选择物资")
+          return
+      }
       this.drawer = true;
       this.onDrawerNumber = num;
       if (num == 1) {
-        this.frist.requestUrl =
+          this.frist.requestUrl =
           "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-          this.input;
+          this.input + "&supplierId=" + this.supplierId;   
       } else if (num == 2) {
         this.secend.requestUrl =
           "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
@@ -512,11 +539,6 @@ export default {
       this.materialId = selection.materialId;
       this.getPurchaseOrderNo();
     },
-    currentRadioChange2(selection) {
-      this.supplierName = selection.supplierName;
-      this.supplierId = selection.supplierId;
-      this.getPurchaseOrderNo();
-    },
     currentRadioChange4(selection) {
       this.unloadPointId = selection.warehouseId;
       this.unloadPointName = selection.warehouseName;
@@ -700,6 +722,15 @@ export default {
     height: 1px;
   }
 }
+.supplieUnit {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  margin-top: 20px;
+  .el-input {
+    width: 250px;
+  }
+}
 .material {
   display: flex;
   justify-content: center;

+ 108 - 0
src/views/WMS/components/steel/bar1_steel/bar1_steel_outboundStatistics.vue

@@ -0,0 +1,108 @@
+//出库统计炉号生产数量
+<template>
+  <div class="steel_inbound">
+    <div class="sache">
+      <span>出库时间:</span>
+      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      </el-date-picker>
+      <span>至</span>
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
+      </el-date-picker>
+           <el-input
+        placeholder="请输入炉号"
+        v-model="textInput"
+        clearable>
+      </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button type="primary" @click="refresh">
+        <i class="el-icon-refresh"></i>刷新
+      </el-button> -->
+      <span style="margin-left: 1rem;">总件数:</span>
+      <el-input v-model="totalNumber" :disabled="true" style="width: 150px;"></el-input>
+      <span style="margin-left: 1rem;">总重量:</span>
+      <el-input v-model="totalWeight" :disabled="true" style="width: 150px;"></el-input>
+    </div>
+    <div class="table">
+      <dilTable v-bind.sync="option" @func="func">
+      </dilTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import { sjTime } from "@/utils/sharedJsFile";
+export default {
+  data(){
+    return{
+      textInput:"",
+      startTime: null,
+      endTime: null,
+      totalNumber:0,
+      totalWeight:0,
+      option:{
+        // first请求数据的地址
+        requestUrl: "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+1+"&startTime=null&endTime=null&i=" +new Date()+"&con="+this.textInput,
+      },
+    }
+  },
+  methods:{
+      refresh(){
+      this.$router.go(0);
+    },
+    func(res){
+      console.log(res)
+      var total1 = 0
+      var total2 = 0
+      res.list.forEach(e => {
+        total1 = total1+e.coun
+        total2 = total2+e.theoreticalWeight
+      });
+  
+      this.totalNumber = total1
+      this.totalWeight = total2
+    },
+   onclick() {
+     console.log("textInput",this.textInput);
+      let startTime = null;
+      let endTime = null;
+      if(this.startTime){
+        startTime = sjTime(this.startTime);
+      }
+      if(this.endTime){
+        endTime = sjTime(this.endTime);
+      }
+      if(startTime && endTime){
+        if(startTime < endTime){
+          this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+1+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
+        }else{
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning('开始时间要比结束时间早')
+        }
+      }else{
+        this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+1+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
+      }
+    },
+    selectionChange(selection) {
+      this.options.mapList = selection;
+    },
+  }
+}
+</script>
+
+<style lang="scss" scode>
+.steel_inbound{
+  .sache{
+    height: 5rem;
+    display: flex;
+    align-items: center;
+    padding-left: 1.875rem;
+     .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 1 - 0
src/views/WMS/components/steel/steel_inbound.vue

@@ -70,6 +70,7 @@ export default {
         if (startTime < endTime) {
           // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
           this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+
           // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
           // this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
           // }else{

+ 1 - 0
src/views/WMS/components/steel/steel_inboundReal.vue

@@ -143,6 +143,7 @@ export default {
         if (startTime < endTime) {
           // if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"){
           this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=371&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
+
           // }else if(getCookie("orgCode") == "wuliuchuyunzhongxin"){
           // this.options.requestUrl = "/api/v1/wms/getWmsInboundResults?apiId=371&orderType=13&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date(); 
           // }else{

+ 38 - 12
src/views/WMS/components/steel/steel_outbound.vue

@@ -2,36 +2,62 @@
 <template>
   <div class="steel_outbound">
     <div class="sache">
-      <el-input
-        placeholder="请输入内容"
-        v-model="inputText"
-        clearable>
-      </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
+      
+      <div class="block">
+        <span class="demonstration">选择时间</span>
+        <el-date-picker
+          v-model="queryDate"
+          type="datetimerange"
+          align="right"
+          unlink-panels
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          >
+        </el-date-picker>
+         <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+      </div>
+     
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
+      <dilTable v-bind.sync="options" ref="tab">
       </dilTable>
     </div>
   </div>
 </template>
 
 <script>
+import { sjTime } from "@/utils/sharedJsFile";
+import moment from "moment";
 export default {
   data(){
     return{
+      queryDate:[],
       inputText:"",
       options:{
-        // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmspOutboundResult?apiId=152",
+        //first请求数据的地址
+        requestUrl: "/api/v1/wms/getWmspOutboundResult?apiId=152"
       },
     }
   },
+  created(){
+      this.queryDate=this.getToday();
+  },
   methods:{
     onclick(){
-      this.option.requestUrl="/api/v1/wms/getWmspOutboundResult/152?con="+this.inputText;
+       //改变查询条件
+      this.$refs.tab.setDataRequestQuery({"startTime":sjTime(this.queryDate[0]),
+                      "endTime":sjTime(this.queryDate[1]) 
+                      });         
+    },
+    getToday() {
+        let obj = [];
+        obj[0] = moment(moment().startOf("day").valueOf()).format("YYYY-MM-DD HH:mm:ss");
+        obj[1]  = moment(moment().valueOf()).format("YYYY-MM-DD HH:mm:ss");
+        return obj
     },
   }
 }

+ 108 - 0
src/views/WMS/components/steel/steel_outboundStatistics.vue

@@ -0,0 +1,108 @@
+//出库统计炉号生产数量
+<template>
+  <div class="steel_inbound">
+    <div class="sache">
+      <span>出库时间:</span>
+      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
+      </el-date-picker>
+      <span>至</span>
+      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
+      </el-date-picker>
+           <el-input
+        placeholder="请输入炉号"
+        v-model="textInput"
+        clearable>
+      </el-input>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button type="primary" @click="refresh">
+        <i class="el-icon-refresh"></i>刷新
+      </el-button> -->
+      <span style="margin-left: 1rem;">总件数:</span>
+      <el-input v-model="totalNumber" :disabled="true" style="width: 150px;"></el-input>
+      <span style="margin-left: 1rem;">总重量:</span>
+      <el-input v-model="totalWeight" :disabled="true" style="width: 150px;"></el-input>
+    </div>
+    <div class="table">
+      <dilTable v-bind.sync="option" @func="func">
+      </dilTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import { sjTime } from "@/utils/sharedJsFile";
+export default {
+  data(){
+    return{
+      textInput:"",
+      startTime: null,
+      endTime: null,
+      totalNumber:0,
+      totalWeight:0,
+      option:{
+        // first请求数据的地址
+        requestUrl: "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=null&endTime=null&i=" +new Date()+"&con="+this.textInput,
+      },
+    }
+  },
+  methods:{
+      refresh(){
+      this.$router.go(0);
+    },
+    func(res){
+      console.log(res)
+      var total1 = 0
+      var total2 = 0
+      res.list.forEach(e => {
+        total1 = total1+e.coun
+        total2 = total2+e.theoreticalWeight
+      });
+  
+      this.totalNumber = total1
+      this.totalWeight = total2
+    },
+   onclick() {
+     console.log("textInput",this.textInput);
+      let startTime = null;
+      let endTime = null;
+      if(this.startTime){
+        startTime = sjTime(this.startTime);
+      }
+      if(this.endTime){
+        endTime = sjTime(this.endTime);
+      }
+      if(startTime && endTime){
+        if(startTime < endTime){
+          this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
+        }else{
+          this.startTime = null;
+          this.endTime = null;
+          this.$message.warning('开始时间要比结束时间早')
+        }
+      }else{
+        this.option.requestUrl = "/api/v1/wms/getWmsOutboundResultStatistics?apiId=446&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date()+"&con="+this.textInput;
+      }
+    },
+    selectionChange(selection) {
+      this.options.mapList = selection;
+    },
+  }
+}
+</script>
+
+<style lang="scss" scode>
+.steel_inbound{
+  .sache{
+    height: 5rem;
+    display: flex;
+    align-items: center;
+    padding-left: 1.875rem;
+     .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 6 - 2
src/views/WMS/router/index.js

@@ -41,8 +41,10 @@ import steel_checkWarehouse from '../components/steel/checkWarehouse.vue'
 import steel_addCheckWarehouse from '../components/steel/addCheckWarehouse.vue'
 import addSteelInbound from '../components/steel/addSteelInbound.vue'
 import addSteelReserved from '../components/steel/addSteelReserved.vue'
+import steel_outboundStatistics from '../components/steel/steel_outboundStatistics.vue'
 import steel_inboundStatistics from '../components/steel/steel_inboundStatistics.vue'
 
+
 // 一帮库页面配置
 import bar1_addTransfer from '../components/steel/bar1_steel/bar1_addTransfer.vue'
 import bar1_billOfLading from '../components/steel/bar1_steel/bar1_billOfLading.vue'
@@ -69,7 +71,7 @@ import bar1_steel_addCheckWarehouse from '../components/steel/bar1_steel/bar1_ad
 import bar1_addSteelInbound from '../components/steel/bar1_steel/bar1_addSteelInbound.vue'
 import bar1_addSteelReserved from '../components/steel/bar1_steel/bar1_addSteelReserved.vue'
 import bar1_steel_inboundStatistics from '../components/steel/bar1_steel/bar1_steel_inboundStatistics.vue'
-
+import bar1_steel_outboundStatistics from '../components/steel/bar1_steel/bar1_steel_outboundStatistics.vue'
 Vue.use(Router)
 const constantRouterMap = [
 	{
@@ -116,7 +118,7 @@ const constantRouterMap = [
 		{path: 'addSteelInbound', name: 'addSteelInbound', meta: {code: 'xtpzgl-yhgl'}, component: addSteelInbound},
 		{path: 'addSteelReserved', name: 'addSteelReserved', meta: {code: 'xtpzgl-yhgl'}, component: addSteelReserved},
 		{path: 'steel_inboundStatistics', name: 'steel_inboundStatistics', meta: {code: 'xtpzgl-yhgl'}, component: steel_inboundStatistics},
-
+		{path: 'steel_outboundStatistics',name: 'steel_outboundStatistics',meta: {code: 'xtpzgl-yhgl'},component: steel_outboundStatistics},
 		{path: 'bar1_addTransfer', name: 'bar1_addTransfer', meta: {code: 'xtpzgl-yhgl'}, component: bar1_addTransfer},
 		{path: 'bar1_billOfLading', name: 'bar1_billOfLading', meta: {code: 'xtpzgl-yhgl'}, component: bar1_billOfLading},
 		{path: 'bar1_billOfLadingAdd/:orderId', name: 'bar1_billOfLadingAdd', meta: {code: 'xtpzgl-yhgl'}, component: bar1_billOfLadingAdd},
@@ -142,6 +144,8 @@ const constantRouterMap = [
 		{path: 'bar1_addSteelInbound', name: 'bar1_addSteelInbound', meta: {code: 'xtpzgl-yhgl'}, component: bar1_addSteelInbound},
 		{path: 'bar1_addSteelReserved', name: 'bar1_addSteelReserved', meta: {code: 'xtpzgl-yhgl'}, component: bar1_addSteelReserved},
 		{path: 'bar1_steel_inboundStatistics', name: 'bar1_steel_inboundStatistics', meta: {code: 'xtpzgl-yhgl'}, component: bar1_steel_inboundStatistics},
+		{path: 'bar1_steel_outboundStatistics', name: 'bar1_steel_outboundStatistics', meta: {code: 'xtpzgl-yhgl'}, component: bar1_steel_outboundStatistics},
+
 	  ]
 	}
   ];

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

@@ -316,7 +316,7 @@ export default {
       addressDrawer:false,
       //线路的表格
       line: {
-        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
+        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con="+'销售',
         selectionType: "radio",
       },
       //车辆的表格

+ 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>

+ 192 - 59
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:[],
       //销售订单物资信息
@@ -324,7 +347,7 @@ export default {
       addressDrawer:false,
       //线路的表格
       line: {
-        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3",
+        requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con="+'销售',
         selectionType: "radio",
       },
       //车辆的表格
@@ -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: "取消下发!",
             });
           });
       }

+ 447 - 0
src/views/appoint/components/saleContract/saleOrderCoproduct.vue

@@ -0,0 +1,447 @@
+<template>
+  <!-- 销售订单页面 -->
+  <div class="salePlan">
+    <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="refresh">
+        <i class="el-icon-refresh"></i>刷新
+      </el-button>
+    </div>
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <!-- 已审批 -->
+       <el-tab-pane label="已审批" name="four">
+        <dilTable v-bind.sync="option4" ref="table">
+          <el-table-column fixed="right" label="操作" width="200">
+            <template slot-scope="scope">
+              <el-button
+                @click="coproductSendClick(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >副产品派车</el-button
+              >
+              <el-button
+                @click="detailclick(scope.row)"
+                type="text"
+                size="small"
+                >物资详情</el-button
+              >
+            </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>
+      </el-tab-pane>
+      <!-- 未上报 -->
+      <el-tab-pane label="未上报" name="first">
+        <dilTable v-bind.sync="option" ref="table3">
+          <el-table-column fixed="right" label="操作" align="center" width="200">
+            <template slot-scope="scope">
+              <el-button
+                @click="uploadclick(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >上传</el-button
+              >
+              <el-button
+                @click="click(scope.row.saleOrderId)"
+                type="text"
+                size="small"
+                >修改</el-button
+              >
+              <el-button
+                type="text"
+                size="small"
+                @click="deleteclick(scope.row.saleOrderId)"
+                >删除</el-button
+              >
+              <el-button
+                @click="detailclick3(scope.row)"
+                type="text"
+                size="small"
+                >物资详情</el-button
+              >
+            </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="tableData3" 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>
+      </el-tab-pane>
+      <!-- 已下发 -->
+      <el-tab-pane label="已上报" name="second">
+        <dilTable v-bind.sync="option2" ref="table2">
+        <el-table-column fixed="right" label="操作" width="70">
+            <template slot-scope="scope">
+              <el-button
+                @click="detailclick2(scope.row)"
+                type="text"
+                size="small"
+                >物资详情</el-button
+              >
+            </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="tableData2" 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>
+      </el-tab-pane>
+      
+    </el-tabs>
+  </div>
+</template>
+<script>
+export default {
+  name: "saleOrder",
+  data() {
+    return {
+      activeName: "four",
+      input: "",
+      option: {
+        // 表格请求数据的地址
+        requestUrl:
+          "/api/v1/ams/getSaleOrderInfoes?apiId=408",
+      },
+      option2: {
+        // 表格请求数据的地址
+        requestUrl:
+          "/api/v1/ams/getSaleOrderReportedes?apiId=408",
+      },
+      option3: {
+        // 表格请求数据的地址
+        requestUrl:
+          "/api/v1/ams/getAmsSaleOrderApprovedes?apiId=409",
+      },
+      option4: {
+        // 表格请求数据的地址
+        requestUrl:
+          "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409",
+      },
+      
+      //记录旧的row对象 (销售公司已审批)
+      oldRow: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (销售公司已审批)
+      oldRowCount: 1,
+      //记录旧的row对象 (财务已审批)
+      oldRow1: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (财务已审批)
+      oldRowCount1: 1,
+      //记录旧的row对象 (已上报)
+      oldRow2: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (已上报)
+      oldRowCount2: 1,
+      //记录旧的row对象 (未上报)
+      oldRow3: "",
+      //记录上一个展开的点击次数,单数为展开状态,复数为闭合状态 (未上报)
+      oldRowCount3: 1,
+      tableHead: [
+        {
+          prop: "materialName",
+          label: "物资名称",
+          width: 150,
+        },
+        {
+          prop: "specificationModel",
+          label: "规格型号",
+          width: 150,
+        },
+        {
+          prop: "materialNumber",
+          label: "物资件数",
+          width: 100,
+        },
+        {
+          prop: "materialWeight",
+          label: "物资重量",
+          width: 100,
+        },
+      ],
+      //(销售公司已审批)
+      tableData: [],
+      //(财务已审批)
+      tableData1: [],
+      //(已上报)
+      tableData2: [],
+      //(未上报)
+      tableData3: [],
+    };
+  },
+  methods: {
+    refresh(){
+      this.$router.go(0);
+    },
+    handleClick(tab, event) {
+      console.log(tab, event);
+    },
+    onclick() {
+      if(this.activeName == "first"){
+        this.option.requestUrl = "/api/v1/ams/getSaleOrderInfoes?apiId=408&con="+this.input;
+      }else if(this.activeName == "second"){
+        this.option2.requestUrl = "/api/v1/ams/getSaleOrderReportedes?apiId=408&con="+this.input;      
+      }else if(this.activeName == "four"){
+        this.option4.requestUrl = "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&con="+this.input;      
+      }
+    },
+    seeclick(saleOrderId) {
+      this.$router.push("/saleOrderDetail/" + saleOrderId);
+    },
+    btnclick() {
+      this.$router.push("/addSaleOrder");
+    },
+    click(saleOrderId) {
+      this.$router.push("/editSaleOrder/" + saleOrderId);
+    },
+    coproductSendClick(saleOrderId){
+      this.$router.push("/addSaleOrderCoproductSend/" + saleOrderId);
+    },
+    // -------查看物资详情 (已审批)
+    detailclick(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;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData = res.data.data;
+        });
+    },
+
+    // -------查看物资详情 (财务已审批)
+    detailclick1(row) {
+      // 记录重复点击次数
+      if (this.oldRow1 === row) {
+        this.oldRowCount1 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table1.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow1 != "") {
+        if (this.oldRow1 != row) {
+          if (this.oldRowCount1 % 2 === 1) {
+            this.$refs.table1.toggleRowExpansion(this.oldRow1);
+          } else {
+            this.oldRowCount1 = 1;
+          }
+        } else {
+          this.oldRow1 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow1 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData1 = res.data.data;
+        });
+    },
+
+    // -------查看物资详情 (已上报)
+    detailclick2(row) {
+      // 记录重复点击次数
+      if (this.oldRow2 === row) {
+        this.oldRowCount2 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table2.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow2 != "") {
+        if (this.oldRow2 != row) {
+          if (this.oldRowCount2 % 2 === 1) {
+            this.$refs.table2.toggleRowExpansion(this.oldRow2);
+          } else {
+            this.oldRowCount2 = 1;
+          }
+        } else {
+          this.oldRow2 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow2 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData2 = res.data.data;
+        });
+    },
+
+    // -------查看物资详情 (未上报)
+    detailclick3(row) {
+      // 记录重复点击次数
+      if (this.oldRow3 === row) {
+        this.oldRowCount3 += 1;
+      }
+      // 切换当前详情表
+      this.$refs.table3.toggleRowExpansion(row);
+      // 打开前关闭上一个详情表
+      if (this.oldRow3 != "") {
+        if (this.oldRow3 != row) {
+          if (this.oldRowCount3 % 2 === 1) {
+            this.$refs.table3.toggleRowExpansion(this.oldRow3);
+          } else {
+            this.oldRowCount3 = 1;
+          }
+        } else {
+          this.oldRow3 = null;
+          return;
+        }
+      }
+      // 重置上一个点击对象
+      this.oldRow3 = row;
+      // 根据销售订单id查询物资信息
+      this.axios
+        .post("/api/v1/ams/getSaleMaterialList?saleOrderId=" +row.saleOrderId)
+        .then((res) => {
+          this.tableData3 = res.data.data;
+        });
+    },
+
+    // 上传
+    uploadclick(saleOrderId) {
+      this.$confirm("是否上传", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "上传成功!",
+          });
+          this.axios
+            .post(
+              "/api/v1/ams/uploadSaleOrder?saleOrderId=" +
+                saleOrderId
+            )
+            .then(() => {
+              this.$router.go(0);
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消上传!",
+          });
+        });
+    },
+    //删除
+    deleteclick(scope) {
+      let saleOrderId = scope;
+      this.$confirm("是否删除", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true,
+      })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          this.axios
+            .post(
+              "/api/v1/ams/deleteAmsSaleOrderBySaleOrderId?saleOrderId=" +
+                saleOrderId
+            )
+            .then(() => {
+              this.$router.go(0);
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消删除!",
+          });
+        });
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+.salePlan {
+  .top {
+    padding: 1.25rem 0.375rem;
+    .el-input {
+      width: 20%;
+      margin-right: 1.25rem;
+    }
+  }
+}
+</style>

+ 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: "取消删除!",
-    //       });
-    //     });
-    // },
   },
   
 };

+ 4 - 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'
@@ -49,6 +50,7 @@ import editTruckNoDetail from '../components/saleContract/editTruckNoDetail.vue'
 import saleCokeInward from '../components/saleContract/saleCokeInward.vue'
 import saleOrder from '../components/saleContract/saleOrder.vue'
 import saleOrderArrange from '../components/saleContract/saleOrderArrange.vue'
+import saleOrderCoproduct from '../components/saleContract/saleOrderCoproduct.vue'
 import saleOrderDetail from '../components/saleContract/saleOrderDetail.vue'
 import saleOrderDetailApproved from '../components/saleContract/saleOrderDetailApproved.vue'
 import saleOrderMaterial from '../components/saleContract/saleOrderMaterial.vue'
@@ -93,6 +95,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},
@@ -109,6 +112,7 @@ const constantRouterMap = [
       {path: 'saleCokeInward', name: 'saleCokeInward', meta: {code: 'xtpzgl-yhgl'}, component: saleCokeInward},
       {path: 'saleOrder', name: 'saleOrder', meta: {code: 'xtpzgl-yhgl'}, component: saleOrder},
       {path: 'saleOrderArrange', name: 'saleOrderArrange', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderArrange},
+      {path: 'saleOrderCoproduct', name: 'saleOrderCoproduct', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderCoproduct},
       {path: 'saleOrderDetail/:saleOrderId', name: 'saleOrderDetail', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderDetail},
       {path: 'saleOrderDetailApproved/:saleOrderId', name: 'saleOrderDetailApproved', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderDetailApproved},
       {path: 'saleOrderUpdateLog/:saleOrderId', name: 'saleOrderUpdateLog', meta: {code: 'xtpzgl-yhgl'}, component: saleOrderUpdateLog},

+ 3 - 1
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -25,7 +25,7 @@
         </el-autocomplete>
         </el-form-item>
     </el-form>
-    </div>
+      </div>
       <div class="form-box">
         <dil-form :formId="300" v-model="form"></dil-form>
       </div>
@@ -505,9 +505,11 @@ export default {
         requirementWorkEnvironment: this.form.requirementWorkEnvironment,
         requirementWorkType: this.form.requirementWorkType,
         requirementShipperId: this.shipperId,
+        DueTime:sjTime(this.form.DueTime),
         mapList:this.tableData,
         orgCode:getCookie("orgCode")
       };
+      console.log("requirement",requiremnet);
       this.axios
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
         .then(res => {

+ 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",
 		          });
 		        }

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

@@ -8,30 +8,396 @@
       </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></el-input>
+          <label>原单价</label>
+          <el-input style="width:100px" v-model="originalPriceValue" disabled></el-input>
+          
+        </el-form-item>
+        <el-form-item label="新详单地址" :label-width="formLabelWidth">
+          <el-input style="width:250px" v-model="newAddress" disabled></el-input>
+          <label>现单价</label>
+          <el-input style="width:100px" v-model="newPriceValue" disabled></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="DaDryBasis"></el-input>
+      </el-form-item>
+      <el-form-item label="九江收货的干基" :label-width="formLabelWidth">
+        <el-input v-model="JiuDryBasis"></el-input>
+      </el-form-item>
+      <el-form-item label="单价" :label-width="formLabelWidth">
+        <el-input v-model="Fee"></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,
+      //达钢的干基
+      DaDryBasis:null,
+      //九江收货的干基
+      JiuDryBasis:null,
+      //单价
+      Fee: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.DaDryBasis){
+        this.$message.error('达钢的干基还未填!')
+      }else if(!this.JiuDryBasis){
+        this.$message.error('九江收货的干基还未填!')
+      }else if(!this.Fee){
+        this.$message.error('单价还未填!')
+      }else{
+        this.dialogDamage = false;
+        //计算途损 [(达钢的干基-九江收货的干基)/达钢的干基 - 0.03] * 单价 > 0, 扣除途损
+        this.damageFee = ((this.DaDryBasis - this.JiuDryBasis) / this.DaDryBasis - 0.03) * this.Fee;
+        if(this.damageFee>0){
+          let map = {
+        detailsId: this.detailsId,
+        lossFees: this.damageFee.toFixed(2)
+        }
+        //是否确定增加途损费!
+          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

@@ -257,11 +257,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);
     },