luobang 2 سال پیش
والد
کامیت
dba9ffde6b

+ 1 - 6
build/utils.js

@@ -19,14 +19,9 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 // let devModules = ["index", "statisticalReport", "appoint", "TMS"];
 // let devModules = ["index", "statisticalReport", "TMS", "appoint"];
 
-
 // let devModules = ["index", "appoint", "statisticalReport"];
-<<<<<<< HEAD
-let devModules = ["index", "statisticalReport"];
+let devModules = ["index", "appoint", "statisticalReport", "WMS"];
 
-=======
-let devModules = ["all"];
->>>>>>> 8bcc07c4e8c878b870389f5ee83558b028aad856
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
 // let devModules = ["index", "ADMINISTRATORS", "RMS"];
 // let devModules = ["index", "inward", "statisticalReport"];

+ 65 - 61
build/webpack.base.conf.js

@@ -1,74 +1,78 @@
-'use strict'
-const path = require('path')
-const utils = require('./utils')
-const config = require('../config')
-const vueLoaderConfig = require('./vue-loader.conf')
-const pathSrc = path.resolve(__dirname, '../src');
+"use strict";
+const path = require("path");
+const utils = require("./utils");
+const config = require("../config");
+const vueLoaderConfig = require("./vue-loader.conf");
+const pathSrc = path.resolve(__dirname, "../src");
 function resolve(dir) {
-  return path.join(__dirname, '..', dir)
+  return path.join(__dirname, "..", dir);
 }
 
 const createLintingRule = () => ({
   test: /\.(js|vue)$/,
-  loader: 'eslint-loader',
-  enforce: 'pre',
-  include: [resolve('src'), resolve('test')],
+  loader: "eslint-loader",
+  enforce: "pre",
+  include: [resolve("src"), resolve("test")],
   options: {
-    formatter: require('eslint-friendly-formatter'),
+    formatter: require("eslint-friendly-formatter"),
     emitWarning: !config.dev.showEslintErrorsInOverlay
   }
-})
+});
 
 let babelLoader = {
+  include: [
+    resolve("src"),
+    resolve("test"),
+    resolve("node_modules/webpack-dev-server/client"),
+    resolve("node_modules/vue-element-bigdata-table"),
+    resolve("node_modules/element-ui/src"),
+    resolve("node_modules/icore-sdk")
+  ],
+  exclude: [
+    resolve("node_modules/element-ui/src/utils/date.js"),
+    resolve("node_modules/element-ui/src/utils/popper.js")
+  ] // sb element-ui竟然在源码里面单独把这两个js转译成了es5 气死哥了!!
+};
+
+if (pathSrc.indexOf("node_modules") > -1) {
+  babelLoader = {
     include: [
-                resolve('src'), resolve('test'), 
-                resolve('node_modules/webpack-dev-server/client'),
-                resolve('node_modules/vue-element-bigdata-table'),
-                resolve('node_modules/element-ui/src'),
-                resolve('node_modules/icore-sdk')
-            ],
+      resolve("src"),
+      resolve("test"),
+      resolve("../../src"),
+      resolve("../../test"),
+      resolve("../webpack-dev-server/client"),
+      resolve("../vue-element-bigdata-table"),
+      resolve("../element-ui/src"),
+      resolve("../icore-sdk")
+    ],
     exclude: [
-                resolve('node_modules/element-ui/src/utils/date.js'), 
-                resolve('node_modules/element-ui/src/utils/popper.js')
-            ]// sb element-ui竟然在源码里面单独把这两个js转译成了es5 气死哥了!!
-}
-
-if (pathSrc.indexOf('node_modules') > -1) {
-    babelLoader = {
-        include: [
-                    resolve('src'), resolve('test'),
-                    resolve('../../src'), resolve('../../test'), 
-                    resolve('../webpack-dev-server/client'),
-                    resolve('../vue-element-bigdata-table'),
-                    resolve('../element-ui/src'),
-                    resolve('../icore-sdk')
-                ],
-        exclude: [
-                    resolve('../element-ui/src/utils/date.js'), 
-                    resolve('../element-ui/src/utils/popper.js')
-                ]// sb element-ui竟然在源码里面单独把这两个js转译成了es5 气死哥了!!
-    }
+      resolve("../element-ui/src/utils/date.js"),
+      resolve("../element-ui/src/utils/popper.js")
+    ] // sb element-ui竟然在源码里面单独把这两个js转译成了es5 气死哥了!!
+  };
 }
 
 module.exports = {
-  context: path.resolve(__dirname, '../'),
+  context: path.resolve(__dirname, "../"),
   // entry: {
   //   app: './src/main.js'
   // },
   entry: utils.entries(),
   output: {
     path: config.build.assetsRoot,
-    filename: '[name].js',
-    publicPath: process.env.NODE_ENV === 'production' ?
-      config.build.assetsPublicPath :
-      config.dev.assetsPublicPath
+    filename: "[name].js",
+    publicPath:
+      process.env.NODE_ENV === "production"
+        ? config.build.assetsPublicPath
+        : config.dev.assetsPublicPath
   },
   resolve: {
-    extensions: ['.js', '.vue', '.json'],
+    extensions: [".js", ".vue", ".json"],
     alias: {
-      'vue$': 'vue/dist/vue.esm.js',
-      '@': resolve('src'),
-      '~': resolve('../../src'),
+      vue$: "vue/dist/vue.esm.js",
+      "@": resolve("src"),
+      "~": resolve("../../src")
     }
   },
   module: {
@@ -76,37 +80,37 @@ module.exports = {
       ...(config.dev.useEslint ? [createLintingRule()] : []),
       {
         test: /\.vue$/,
-        loader: 'vue-loader',
+        loader: "vue-loader",
         options: vueLoaderConfig
       },
       {
         test: /\.js$/,
-        loader: 'babel-loader',
+        loader: "babel-loader",
         exclude: babelLoader.exclude,
         include: babelLoader.include
       },
       {
         test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
-        loader: 'url-loader',
+        loader: "url-loader",
         options: {
           limit: 10000,
-          name: utils.assetsPath('img/[name].[hash].[ext]')
+          name: utils.assetsPath("img/[name].[hash].[ext]")
         }
       },
       {
         test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
-        loader: 'url-loader',
+        loader: "url-loader",
         options: {
           limit: 10000,
-          name: utils.assetsPath('media/[name].[hash].[ext]')
+          name: utils.assetsPath("media/[name].[hash].[ext]")
         }
       },
       {
         test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
-        loader: 'url-loader',
+        loader: "url-loader",
         options: {
           limit: 10000,
-          name: utils.assetsPath('fonts/[name].[hash].[ext]')
+          name: utils.assetsPath("fonts/[name].[hash].[ext]")
         }
       }
     ]
@@ -117,10 +121,10 @@ module.exports = {
     setImmediate: false,
     // prevent webpack from injecting mocks to Node native modules
     // that does not make sense for the client
-    dgram: 'empty',
-    fs: 'empty',
-    net: 'empty',
-    tls: 'empty',
-    child_process: 'empty'
+    dgram: "empty",
+    fs: "empty",
+    net: "empty",
+    tls: "empty",
+    child_process: "empty"
   }
-}
+};

+ 2 - 2
config/index.js

@@ -66,8 +66,8 @@ let proxyTable = {
   // 所有数据的请求域名地址
   "/api/v1": {
     // target: "http://localhost:8080",
-    target: "http://172.16.33.166:80",
-    // target: "http://192.168.1.105:8080",
+    // target: "http://172.16.33.166:80",
+    target: "http://192.168.1.107:8080",
     // target: "http://192.168.1.106:8080",
     ws: true,
     pathRewrite: {

+ 8 - 8
src/utils/QueueStartList.js

@@ -1,14 +1,14 @@
-import axios from 'axios'
+import axios from "axios";
 //返回月台
-export function loadingPoint(URL){
-  let loadingpoint = []
-  axios.get(URL).then((res)=>{
+export function loadingPoint(URL) {
+  let loadingpoint = [];
+  axios.get(URL).then(res => {
     res.data.data.forEach(e => {
       let arr = {
-          value:e.GRID_NAME
+        value: e.GRID_NAME
       };
-    loadingpoint.push(arr)
+      loadingpoint.push(arr);
     });
-  })
+  });
   return loadingpoint;
-}
+}

+ 46 - 32
src/utils/sharedJsFile.js

@@ -1,35 +1,49 @@
- // 把时间戳改为正常可读的时间
- export function renderTime(date) {
-   if (date !== null) {
-     let dateee = new Date(date).toJSON();
-     return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
-   }
-   return null;
- }
- export function sjTime(orderPlanInTime) {
-   var stringTime = renderTime(orderPlanInTime);
-   var timestamp1 = stringTime.replace(/-/g, '/');
-   return new Date(timestamp1).getTime();
- }
- export function isNumber(value) {
-   // 验证是否为数字
-   var patrn = /^(-?\d+)(\.\d+)?$/;
-   if (patrn.exec(value) == null || value === '') {
-     return false;
-   } else {
-     return true;
-   }
- }
- export function isIntegerNumber(value) {
-   // 验证是否为整数
-   var patrn = /^\+?[1-9][0-9]*$/g;
-   if (patrn.exec(value) == null || value === '') {
-     return false;
-   } else {
-     return true;
-   }
- }
- export function stringToDate(dateStr, separator) {
+// 把时间戳改为正常可读的时间
+export function renderTime(date) {
+  if (date !== null) {
+    let dateee = new Date(date).toJSON();
+    return new Date(+new Date(dateee) + 8 * 3600 * 1000)
+      .toISOString()
+      .replace(/T/g, ' ')
+      .replace(/\.[\d]{3}Z/, '');
+  }
+  return null;
+}
+export function sjTime(orderPlanInTime) {
+  var stringTime = renderTime(orderPlanInTime);
+  var timestamp1 = stringTime.replace(/-/g, '/');
+  return new Date(timestamp1).getTime();
+}
+export function isVehicleNumber(vehicleNumber) {
+  var result = false;
+  if (vehicleNumber != null) {
+    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;
+}
+
+export function isNumber(value) {
+  // 验证是否为数字
+  var patrn = /^(-?\d+)(\.\d+)?$/;
+  if (patrn.exec(value) == null || value === '') {
+    return false;
+  } else {
+    return true;
+  }
+}
+export function isIntegerNumber(value) {
+  // 验证是否为整数
+  var patrn = /^\+?[1-9][0-9]*$/g;
+  if (patrn.exec(value) == null || value === '') {
+    return false;
+  } else {
+    return true;
+  }
+}
+export function stringToDate(dateStr, separator) {
   if (!separator) {
     separator = '-';
   }

+ 82 - 8
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -97,12 +97,17 @@
     <el-form :inline="true" style="margin-top: 1rem;">
       <el-form-item>
         <label class="el-form-item__label" style="width: auto;">收货地址</label>
-        <el-input
-          style="width: 400px"
+        <el-autocomplete
+          style="width:400px"
           v-model="saleShipperAddressName"
-          disabled
+          :fetch-suggestions="querySearchAddress"
+          placeholder="请输入内容"
+          @select="handleSelectAddress"
         >
-        </el-input>
+          <template slot-scope="{ item }">
+            <span class="addr">{{ item.addressPlace }}</span>
+          </template>
+        </el-autocomplete>
         <el-button type="primary" @click="ondrawerOut">选择</el-button>
       </el-form-item>
       <el-form-item>
@@ -394,7 +399,7 @@
           </template>
         </el-table-column>
         <!-- 操作列 -->
-        <el-table-column fixed="right" label="操作" width="100">
+        <el-table-column fixed="right" label="操作" width="200">
           <template slot-scope="scope">
             <el-button
               @click.native.prevent="deleteRow(scope.$index, selectionList)"
@@ -402,6 +407,18 @@
               icon="el-icon-close"
               size="big"
             ></el-button>
+            <el-button
+              @click.native.prevent="copyRow(scope.$index, scope.row)"
+              type="text"
+              size="big"
+              >复制为一车</el-button
+            >
+            <el-button
+              @click.native.prevent="copyRowflu(scope.$index, scope.row)"
+              type="text"
+              size="big"
+              >复制为分录</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -888,7 +905,8 @@ export default {
       //收款公司
       saleOrderReceiveCustomer: null,
       //是否忽视收货客户电话字段
-      ignoreSaleOrderConsigneeTel: 0
+      ignoreSaleOrderConsigneeTel: 0,
+      restaurants: []
     };
   },
   created() {
@@ -933,8 +951,8 @@ export default {
                   this.consigneeId
               )
               .then(res => {
+                this.restaurants = res.data.data;
                 const place = res.data.data;
-                console.log(place);
                 this.saleShipperAddressName =
                   place[0].addressProvince +
                   place[0].addressDistrict +
@@ -947,10 +965,45 @@ export default {
               });
           }
         });
-      console.log(getCookie("userId"));
     }
   },
   methods: {
+    handleSelectAddress(item) {
+      console.log(item);
+      this.saleShipperAddressName = item.addressPlace;
+      this.province = item.addressProvince;
+      this.city = item.addressDistrict;
+      this.county = item.addressTown;
+      this.saleShipperAddressId = item.shipperAddressId;
+      this.addressId = item.shipperAddressId;
+      this.place1 = item.place;
+      this.saleOrderConsigneeTel = item.saleOrderConsigneeTel;
+    },
+    querySearchAddress(queryString, cb) {
+      if (this.consigneeId != null) {
+        this.axios
+          .post(
+            "/api/v1/ams/matchingAddressRecently?receiveId=" + this.consigneeId
+          )
+          .then(res => {
+            var restaurants = res.data.data;
+            console.log(restaurants);
+            var results = queryString
+              ? restaurants.filter(this.createStateFilter(queryString))
+              : restaurants;
+            cb(results);
+          });
+      }
+    },
+    createStateFilter(queryString) {
+      return restaurants => {
+        return (
+          restaurants.addressPlace
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        );
+      };
+    },
     onblur() {
       this.isCellClick = 0;
       console.log("我这里值也变化了");
@@ -1076,6 +1129,7 @@ export default {
             place[0].addressTown +
             place[0].place;
           this.saleShipperAddressId = place[0].shipperAddressId;
+          this.addressId = place[0].shipperAddressId;
           this.place1 = place[0].place;
           this.saleMan = place[0].salerId;
           this.saleOrderConsigneeTel = place[0].saleOrderConsigneeTel;
@@ -1236,6 +1290,26 @@ export default {
       //调用记录每一行的合并数的方法
       this.getSpanArr(this.selectionList);
     },
+    copyRow(index, row) {
+      let copyRow = new Object();
+      Object.keys(row).forEach(key => {
+        copyRow[key] = row[key];
+      });
+      copyRow.cxh = this.maxCxh;
+      this.selectionList.push(copyRow);
+      this.getSpanArr(this.selectionList);
+      this.maxCxh++;
+    },
+    copyRowflu(index, row) {
+      console.log(index);
+      let copyRowflu = new Object();
+      Object.keys(row).forEach(key => {
+        copyRowflu[key] = row[key];
+      });
+      this.selectionList.splice(index + 1, 0, copyRowflu);
+      // this.selectionList.push(copyRowflu);
+      this.getSpanArr(this.selectionList);
+    },
     singleDistribute() {
       let ml = this.materialList.length;
       if (ml == 0) {

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

@@ -187,6 +187,12 @@
                   size="small"
                   >撤销上报</el-button
                 >
+                <el-button
+                  @click="updateReportedSaleOrder(scope)"
+                  type="text"
+                  size="small"
+                  >修改</el-button
+                >
               </template>
             </el-table-column>
           </mergeRowTable>
@@ -343,6 +349,9 @@ export default {
     }
   },
   methods: {
+    updateReportedSaleOrder(scope) {
+      this.$router.push("/editSaleOrder/" + scope.row.saleOrderId);
+    },
     updateSaleOrderStatusById(scope) {
       console.log(scope.row.saleOrderId);
       this.$confirm("是否撤销", "警告", {

+ 204 - 97
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelAllReport.vue

@@ -23,6 +23,7 @@
             style="width:200px"
             v-model="input"
             placeholder="请输入查询条件"
+            clearable
           ></el-input>
         </el-form-item>
         <el-form-item>
@@ -83,7 +84,6 @@
         ref="tableRef"
         border
         stripe
-        @filter-change="filterChange"
         style="width: 100%; margin-top: 20px"
         max-height="800px"
         @cell-click="cellClik"
@@ -97,13 +97,6 @@
         >
           <template slot-scope="scope">{{ scope.row.group + 1 }}</template>
         </el-table-column>
-        <el-table-column
-          prop="saleOrderNo"
-          label="销售订单号"
-          width="200px"
-          align="center"
-        >
-        </el-table-column>
         <el-table-column
           prop="consigneeName"
           label="下单客户"
@@ -141,9 +134,6 @@
           label="车牌号"
           align="center"
           width="250px"
-          :filter-multiple="true"
-          :filters="filterData()"
-          :filter-method="filterTag"
         >
           <template slot-scope="scope">
             <el-autocomplete
@@ -155,56 +145,13 @@
               :disabled="scope.row.isCapacityShow != 1"
             ></el-autocomplete>
             <el-button
-              @click="updateCapacity(row)"
+              @click="updateCapacity(scope.row)"
               type="primary"
               v-if="scope.row.isCapacityShow == 1"
               >提交</el-button
             >
           </template>
         </el-table-column>
-        <el-table-column
-          prop="capacityTel"
-          label="司机电话"
-          width="250px"
-          align="center"
-        >
-          <template slot-scope="scope">
-            <el-input
-              style="width:120px"
-              v-model="scope.row.capacityTel"
-              placeholder="请输入电话号码"
-              :disabled="scope.row.isTelShow != 1"
-            ></el-input>
-            <el-button
-              @click="updateDriverTel(scope.row)"
-              type="primary"
-              v-if="scope.row.isTelShow == 1"
-              >提交</el-button
-            >
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="addressPlace"
-          label="收货地址"
-          :width="flexColumnWidth('addressPlace', tableData, 'max')"
-        >
-          <template slot-scope="scope">
-            <el-input
-              style="width:300px"
-              v-model="scope.row.addressPlace"
-              placeholder="请输入收货地址"
-              :disabled="scope.row.isAddressShow != 1"
-            ></el-input>
-            <el-button
-              @click="updateAddress(scope.row)"
-              type="primary"
-              v-if="scope.row.isAddressShow == 1"
-              >选择</el-button
-            >
-          </template>
-        </el-table-column>
-        <el-table-column prop="orderStatus" label="运单状态" align="center">
-        </el-table-column>
         <el-table-column
           prop="materialName"
           label="物资名称"
@@ -242,6 +189,28 @@
             >
           </template>
         </el-table-column>
+        <el-table-column
+          prop="addressPlace"
+          label="收货地址"
+          :width="flexColumnWidth('addressPlace', tableData, 'max')"
+        >
+          <template slot-scope="scope">
+            <el-input
+              style="width:280px"
+              v-model="scope.row.addressPlace"
+              placeholder="请输入收货地址"
+              :disabled="scope.row.isAddressShow != 1"
+            ></el-input>
+            <el-button
+              @click="updateAddress(scope.row)"
+              type="primary"
+              v-if="scope.row.isAddressShow == 1"
+              >选择</el-button
+            >
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderStatus" label="运单状态" align="center">
+        </el-table-column>
         <el-table-column prop="grossWeight" label="毛重"> </el-table-column>
         <el-table-column
           prop="grossWeightTime"
@@ -294,6 +263,27 @@
           align="center"
         >
         </el-table-column>
+        <el-table-column
+          prop="capacityTel"
+          label="司机电话"
+          width="250px"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <el-input
+              style="width:120px"
+              v-model="scope.row.capacityTel"
+              placeholder="请输入电话号码"
+              :disabled="scope.row.isTelShow != 1"
+            ></el-input>
+            <el-button
+              @click="updateDriverTel(scope.row)"
+              type="primary"
+              v-if="scope.row.isTelShow == 1"
+              >提交</el-button
+            >
+          </template>
+        </el-table-column>
         <el-table-column prop="saler" label="业务员" align="center">
         </el-table-column>
         <el-table-column
@@ -312,6 +302,13 @@
         </el-table-column>
         <el-table-column prop="isSelfMention" label="是否自提" align="center">
         </el-table-column>
+        <el-table-column
+          prop="saleOrderNo"
+          label="销售订单号"
+          width="200px"
+          align="center"
+        >
+        </el-table-column>
         <el-table-column
           prop="saleOrderStatus"
           label="销售订单状态"
@@ -429,7 +426,7 @@
 </template>
 
 <script>
-import { sjTime } from "@/utils/sharedJsFile";
+import { sjTime, isVehicleNumber } from "@/utils/sharedJsFile";
 import { getCookie } from "@/utils/util.js";
 
 export default {
@@ -471,10 +468,9 @@ export default {
         1,
         2,
         3,
-        4,
-        5,
-        6,
         7,
+        8,
+        14,
         16,
         17,
         18,
@@ -489,6 +485,21 @@ export default {
         27,
         29
       ],
+      //钢材多拼车辆线路ID
+      //索引从1-10为1-10拼路线ID
+      lineSpelling: [
+        0,
+        110001,
+        110002,
+        110003,
+        110004,
+        110005,
+        110006,
+        110007,
+        110008,
+        110009,
+        110010
+      ],
       tableTitle: "销售钢材统计报表",
       //所有省
       provinceList: [],
@@ -576,10 +587,6 @@ export default {
     changeScreen() {
       console.log(this.screen);
     },
-    filterChange(filters) {},
-    filterTag(value, row, column) {
-      return row.capacityNo == value;
-    },
     // 数组对象去重
     deWeight(arr) {
       for (var i = 0; i < arr.length - 1; i++) {
@@ -594,6 +601,7 @@ export default {
     },
     cellClik(row, column, cell, event) {
       if (row.group != this.clickIndex) {
+        // this.getSteelReport();
         this.tableData.forEach(item => {
           if (item.group == this.clickIndex) {
             this.$set(item, "isCapacityShow", 0);
@@ -629,6 +637,7 @@ export default {
     handleSelectCarrier(row, index, item) {
       this.carrierList.forEach(item => {
         if (item.carrierName == row.carrierName) {
+          row.newCarrierId = item.carrierId;
           row.carrierId = item.carrierId;
         }
       });
@@ -707,6 +716,10 @@ export default {
         this.$message.warning("请先注册车牌号或者选中弹出后再提交!");
         return;
       }
+      if (!isVehicleNumber(row.capacityNo)) {
+        this.$message.error("请输入正确格式的车牌号!");
+        return;
+      }
       if (row.capacityIds != 0) {
         const loading = this.$loading({
           lock: true,
@@ -733,6 +746,45 @@ export default {
             loading.close();
           });
       } else {
+        if (row.carrierIds == 0) {
+          this.$message.error("请先选择承运商!");
+          return;
+        }
+        let i = 0;
+        this.tableData.forEach(e => {
+          if (row.group == e.group) {
+            i++;
+          }
+        });
+        row.lineId = this.lineSpelling[i];
+        row.driverTel = row.capacityTel;
+        row.capacityNumber = row.capacityNo;
+        let arr = [];
+        arr.push(row);
+        const loading = this.$loading({
+          lock: true,
+          text: "正在变更车牌号",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)"
+        });
+        this.axios
+          .post("/api/v1/ams/dispatchSteelOrder", arr)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("派车成功!");
+              this.getSteelReport();
+              loading.close();
+            } else {
+              this.$message.error("派车失败,请联系管理员");
+              this.getSteelReport();
+              loading.close();
+            }
+          })
+          .catch(() => {
+            this.$message.error("派车失败,请联系管理员");
+            this.getSteelReport();
+            loading.close();
+          });
       }
     },
     //修改司机电话号码
@@ -769,9 +821,9 @@ export default {
           loading.close();
         });
     },
-    //关闭金蝶分录
+    //关闭车辆金蝶分录
     deleteEasEntryId(row) {
-      this.$confirm(title, {
+      this.$confirm("确定关闭该车金蝶分录吗?", "提示", {
         confirmButtonText: "是",
         cancelButtonText: "否",
         center: true,
@@ -780,58 +832,96 @@ export default {
         .then(() => {
           let map = row;
           map.isCloseEas = Number(0);
-          map.saleOrderId = this.$route.params.saleOrderId;
+          const loading = this.$loading({
+            lock: true,
+            text: "正在关闭车辆",
+            spinner: "el-icon-loading",
+            background: "rgba(0, 0, 0, 0.7)"
+          });
           this.axios
             .post("/api/v1/ams/updateCarAddress", map)
             .then(res => {
               if (res.data.code == "200") {
-                this.$message.success("关闭成功");
-                this.getOrderList();
+                this.$message.success("关闭车辆成功");
+                this.getSteelReport();
+                loading.close();
               } else {
-                this.$message.error("关闭失败");
-                this.getOrderList();
+                this.$message.error("关闭车辆失败");
+                this.getSteelReport();
+                loading.close();
               }
             })
             .catch(() => {
-              this.$message.error("关闭失败");
-              this.getOrderList();
+              this.$message.error("关闭车辆失败");
+              this.getSteelReport();
+              loading.close();
             });
         })
         .catch(() => {
-          this.$message.info("取消删除");
+          this.$message.info("取消关闭");
         });
     },
     //修改承运商授权
     updateTruckCarrier(row) {
-      if (row.carrierId == null) {
+      if (row.newCarrierId == null) {
         this.$message.warning("请注册承运商或者选中弹出层之后再提交!");
         this.getSteelReport();
         return;
       }
-      const loading = this.$loading({
-        lock: true,
-        text: "正在修改承运商授权",
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)"
-      });
-      this.axios
-        .post("/api/v1/ams/updateTruckNoCarrier", row)
-        .then(res => {
-          if (res.data.code == "200") {
-            this.$message.success("修改承运商授权成功");
-            this.getSteelReport();
-            loading.close();
-          } else {
+      if (row.carrierIds != 0) {
+        const loading = this.$loading({
+          lock: true,
+          text: "正在修改承运商授权",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)"
+        });
+        this.axios
+          .post("/api/v1/ams/updateTruckNoCarrier", row)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("修改承运商授权成功");
+              this.getSteelReport();
+              loading.close();
+            } else {
+              this.$message.error("修改失败,请联系管理员!");
+              this.getSteelReport();
+              loading.close();
+            }
+          })
+          .catch(() => {
             this.$message.error("修改失败,请联系管理员!");
             this.getSteelReport();
             loading.close();
-          }
-        })
-        .catch(() => {
-          this.$message.error("修改失败,请联系管理员!");
-          this.getSteelReport();
-          loading.close();
+          });
+      } else {
+        //授权承运商
+        let arr = [];
+        arr.push(row);
+        const loading = this.$loading({
+          lock: true,
+          text: "正在授权承运商",
+          spinner: "el-icon-loading",
+          background: "rgba(0, 0, 0, 0.7)"
         });
+        this.axios
+          .post("/api/v1/ams/dispatchToCarrier", arr)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("授权承运商成功");
+              this.getSteelReport();
+              loading.close();
+            } else {
+              this.$message.error("授权失败,请联系管理员");
+              this.getSteelReport();
+              loading.close();
+            }
+          })
+          .catch(() => {
+            this.$message.error("授权失败,请联系管理员");
+            this.getSteelReport();
+            loading.close();
+          });
+      }
     },
     updateAddress(row) {
       this.drawer = true;
@@ -841,6 +931,8 @@ export default {
       this.county = row.addressTown;
       this.addressId = row.shipperAddressId;
       this.getAllProvince();
+      this.onchangeProvince();
+      this.onchangeCity();
     },
     //获取所有省数据
     getAllProvince() {
@@ -919,6 +1011,7 @@ export default {
         );
       };
     },
+    //修改收货地址
     addAddressClick() {
       const loading = this.$loading({
         lock: true,
@@ -955,7 +1048,6 @@ export default {
     },
     //记录每一行的合并数
     getSpanArr(data) {
-      console.log("我执行");
       //每次调用方法初始化
       this.spanArr = [];
       for (var i = 0; i < data.length; i++) {
@@ -1007,6 +1099,7 @@ export default {
       arr.push(map);
       let updateMap = {
         orderId: row.orderId,
+        saleOrderMaterialId: row.saleOrderMaterialId,
         mapList: arr
       };
       this.axios
@@ -1028,6 +1121,7 @@ export default {
           loading.close();
         });
     },
+    //关闭单条分录
     closeEasEntryId(row) {
       console.log(row);
       this.$prompt("确定关闭该条分录吗?", "警告", {
@@ -1049,7 +1143,8 @@ export default {
               saleOrderMaterialId: row.saleOrderMaterialId,
               saleMaterialId: row.saleMaterialId,
               reason: value,
-              number: row.saleOrderNo
+              number: row.saleOrderNo,
+              closeEntryId: row.closeEntryId
             };
             this.axios
               .post("/api/v1/ams/closeSteelMaterialId", map)
@@ -1084,6 +1179,7 @@ export default {
       let consigneeName = null;
       let capacityNo = null;
       let remark = null;
+      let saler = null;
       if (this.startTime && this.endTime) {
         startTime = sjTime(this.startTime);
         endTime = sjTime(this.endTime);
@@ -1091,6 +1187,9 @@ export default {
       if (getCookie("orgCode") == "chengyunshang") {
         carrierSsoId = getCookie("userId");
       }
+      if (getCookie("orgCode") == "xiaoshouyewuyuan") {
+        saler = getCookie("loginName");
+      }
       if (this.screen == "下单客户") {
         consigneeName = this.input;
       } else if (this.screen == "承运商") {
@@ -1117,7 +1216,9 @@ export default {
             "&carrierName=" +
             carrierName +
             "&capacityNo=" +
-            capacityNo
+            capacityNo +
+            "&saler=" +
+            saler
         )
         .then(res => {
           this.tableData = res.data.data;
@@ -1131,9 +1232,13 @@ export default {
     //获取钢材统计报表
     getSteelReport() {
       let carrierSsoId = null;
+      let saler = null;
       if (getCookie("orgCode") == "chengyunshang") {
         carrierSsoId = getCookie("userId");
       }
+      if (getCookie("orgCode") == "xiaoshouyewuyuan") {
+        saler = getCookie("loginName");
+      }
       this.axios
         .post(
           "/api/v1/tms/getSaleSteelReport?startTime=" +
@@ -1142,6 +1247,8 @@ export default {
             null +
             "&carrierSsoId=" +
             carrierSsoId +
+            "&saler=" +
+            saler +
             "&i=" +
             new Date()
         )