luobang 2 gadi atpakaļ
vecāks
revīzija
b65d439dc1

+ 1 - 1
build/utils.js

@@ -19,7 +19,7 @@ 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"];
-let devModules = ["all"];
+let devModules = ["index", "statisticalReport"];
 
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
 // let devModules = ["index", "ADMINISTRATORS", "RMS"];

+ 2 - 2
config/index.js

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

+ 291 - 232
src/views/TMS/components/domesticMine/wagonLoadAdd.vue

@@ -3,73 +3,81 @@
   <div class="addWagonLoad">
     <page-title>返回</page-title>
     <div class="cp">
-      <el-upload style="margin: 8px;"
-          class="upload-excel"
-          action=""
-          :on-change="importExcel"
-          :show-file-list="false"
-          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          :auto-upload="false">
-          <el-button  type="primary">导入车皮号(Excel)</el-button>
+      <el-upload
+        style="margin: 8px;"
+        class="upload-excel"
+        action=""
+        :on-change="importExcel"
+        :show-file-list="false"
+        accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+        :auto-upload="false"
+      >
+        <el-button type="primary">导入车皮号(Excel)</el-button>
       </el-upload>
-      <div style="margin-right:200px;">当前导入数量:{{tableData.length}}</div>
+      <div style="margin-right:200px;">
+        当前导入数量:{{ tableData.length }}
+      </div>
     </div>
     <div class="table item">
-      <el-table
-        stripe
-        :data="tableData"
-        style="width: 100%"
-        id="domesticTable">
+      <el-table stripe :data="tableData" style="width: 100%" id="domesticTable">
         <el-table-column
-        type="index"
-        width="50"
-        prop="number"
-        label="序号"
-        align="center"
-        fixed="left"
-        :resizable="false">
+          type="index"
+          width="50"
+          prop="number"
+          label="序号"
+          align="center"
+          fixed="left"
+          :resizable="false"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
+          align="center"
           prop="productName"
           label="品  名"
-          width="240px">
+          width="240px"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
+          align="center"
           prop="mineral"
           label="矿种"
-          width="100px">
+          width="100px"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
+          align="center"
           prop="wagonNo"
           label="车号"
-          width="180px">
+          width="180px"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
+          align="center"
           prop="unloadPoint"
           label="卸货地点"
-          width="180px">
+          width="180px"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
+          align="center"
           prop="sendStation"
           label="发站"
-          width="180px">
+          width="180px"
+        >
         </el-table-column>
         <el-table-column
-        align="center"
-        width="180px"
+          align="center"
+          width="180px"
           prop="arrivalStation"
-          label="到站">
+          label="到站"
+        >
         </el-table-column>
-         <el-table-column
-         align="center"
-        width="180px"
+        <el-table-column
+          align="center"
+          width="180px"
           prop="weight"
-          label="标重">
+          label="标重"
+        >
         </el-table-column>
       </el-table>
     </div>
@@ -77,20 +85,20 @@
       <div class="form_box" style="margin-right: 10rem;margin-top:20px">
         <el-form>
           <div class="preview-group">
-              <el-form-item label="到站:">
-                <el-autocomplete
-                  class="inline-input"
-                  v-model="toTheStation"
-                  :fetch-suggestions="querySearchToTheStation"
-                  placeholder="请输入到站名称"
-                  :trigger-on-focus="false"
-                  @select="handleSelectToTheStation"
-                >
-                  <template slot-scope="{ item }">
-                    <div class="name">{{ item.arrivalName }}</div>
-                  </template>
-                </el-autocomplete>
-              </el-form-item>
+            <el-form-item label="到站:">
+              <el-autocomplete
+                class="inline-input"
+                v-model="toTheStation"
+                :fetch-suggestions="querySearchToTheStation"
+                placeholder="请输入到站名称"
+                :trigger-on-focus="false"
+                @select="handleSelectToTheStation"
+              >
+                <template slot-scope="{ item }">
+                  <div class="name">{{ item.arrivalName }}</div>
+                </template>
+              </el-autocomplete>
+            </el-form-item>
           </div>
         </el-form>
         <dil-form :formId="364" v-model="form1" ref="from1"></dil-form>
@@ -98,7 +106,9 @@
     </div>
     <div class="button_box">
       <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" :loading="isLoading"  @click="makeSure">确定</el-button>
+      <el-button type="primary" :loading="isLoading" @click="makeSure"
+        >确定</el-button
+      >
     </div>
   </div>
 </template>
@@ -106,13 +116,13 @@
 <script>
 import PageTitle from "@/components/Page/Title";
 import { sjTime, isNumber } from "@/utils/sharedJsFile";
-import {getCookie} from "@/utils/util.js";
+import { getCookie } from "@/utils/util.js";
 export default {
   components: { PageTitle },
   data() {
     return {
-      isLoading:false,
-      file:null,
+      isLoading: false,
+      file: null,
       list: [],
       form1: {},
       input: "",
@@ -134,11 +144,11 @@ export default {
       //物资id
       materialId: null,
       //表格数据
-      tableData:[],
-      unloadPointName:null,
-      materials:[],
-      suppliers:[],
-      unloadPointId:null,
+      tableData: [],
+      unloadPointName: null,
+      materials: [],
+      suppliers: [],
+      unloadPointId: null,
       //是否需要打开模态窗口
       drawer: false,
       a: 1,
@@ -147,22 +157,22 @@ export default {
       frist: {
         requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
         selectionType: "radio",
-        mapList1: [],
+        mapList1: []
       },
       secend: {
         requestUrl:
           "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
         selectionType: "radio",
-        mapList2: [],
+        mapList2: []
       },
       unloadPoint: {
         requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
-        selectionType: "radio",
+        selectionType: "radio"
       },
-      sendStationId:null,
-      toTheStationId:1,
-      sendStation:null,
-      toTheStation:"老区轨道衡",
+      sendStationId: null,
+      toTheStationId: 1,
+      sendStation: null,
+      toTheStation: "老区轨道衡"
     };
   },
   watch: {
@@ -170,35 +180,35 @@ export default {
       if (val) {
         this.getPurchaseOrderNo();
       }
-    },
+    }
   },
   created() {
     this.form1 = {
-      arrivalStationId: 1,
+      arrivalStationId: 1
     };
   },
-  mounted(){
-    this.form1.resultLoadingDate=new Date();
+  mounted() {
+    this.form1.resultLoadingDate = new Date();
   },
   methods: {
     getPurchaseOrderNo() {
       console.log(this.matching);
       let map = {
         materialId: this.materialId,
-        supplierId: this.supplierId,
+        supplierId: this.supplierId
       };
       if (this.remark) {
         map.remark = this.remark;
       }
       console.log(this.map);
       if (this.materialId && this.supplierId) {
-        this.axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
+        this.axios.post("/api/v1/oms/selectNewOrderId", map).then(res => {
           console.log(res);
           if (res.data.code == "200") {
             if (res.data.data == null) {
               this.$message({
                 message: "没有匹配的采购订单号!",
-                type: "warning",
+                type: "warning"
               });
               this.form1 = [];
             } else {
@@ -221,10 +231,10 @@ export default {
     querySearchToTheStation(queryString, cb) {
       this.axios
         .get("/api/v1/uc/getArrivalByLike?index=" + this.toTheStation)
-        .then((res) => {
+        .then(res => {
           if (res.data.code == "200") {
             var restaurantsSupplier = res.data.data;
-            console.log(restaurantsSupplier)
+            console.log(restaurantsSupplier);
             var results = queryString
               ? restaurantsSupplier.filter(
                   this.createFilterToTheStation(queryString)
@@ -237,7 +247,7 @@ export default {
     },
     //到站
     createFilterToTheStation(queryString) {
-      return (restaurantsSupplier) => {
+      return restaurantsSupplier => {
         return (
           restaurantsSupplier.arrivalName
             .toLowerCase()
@@ -247,201 +257,251 @@ export default {
     },
     // 确定
     makeSure() {
-      let that=this;
-      this.isLoading=true;
-      if (this.tableData.length <= 0  || !this.toTheStationId || !this.form1.resultLoadingDate){
+      let that = this;
+      this.isLoading = true;
+      if (
+        this.tableData.length <= 0 ||
+        !this.toTheStationId ||
+        !this.form1.resultLoadingDate
+      ) {
         if (this.tableData.length <= 0) {
           this.$message({
             type: "warning",
-            message: "请导入数据!",
+            message: "请导入数据!"
           });
         } else if (!this.toTheStationId) {
           this.$message({
             type: "warning",
-            message: "请选择到站!",
+            message: "请选择到站!"
           });
-        }else if (!this.form1.resultLoadingDate) {
+        } else if (!this.form1.resultLoadingDate) {
           this.$message({
             type: "warning",
-            message: "请选择装车时间!",
+            message: "请选择装车时间!"
           });
         }
-        this.isLoading=false;
+        this.isLoading = false;
         return;
       }
       //绑定通用字段
-      this.tableData.forEach((row)=>{
-        row.resultType=3;//装车类型为国产矿
-        row.arrivalStationId=that.form1.arrivalStationId;//到站id,默认老区轨道衡
-        row.resultLoadingDate=sjTime(that.form1.resultLoadingDate);//装车日期
-        row.resultRemarks=that.form1.resultRemarks;//备注
-      })
-      let data={
-        list:this.tableData,
-        userId:getCookie("userId")
-      }
+      this.tableData.forEach(row => {
+        row.resultType = 3; //装车类型为国产矿
+        row.arrivalStationId = that.form1.arrivalStationId; //到站id,默认老区轨道衡
+        row.resultLoadingDate = sjTime(that.form1.resultLoadingDate); //装车日期
+        row.resultRemarks = that.form1.resultRemarks; //备注
+      });
+      let data = {
+        list: this.tableData,
+        userId: getCookie("userId")
+      };
       console.log(data);
       //请求添加
-      this.axios
-        .post("/api/v1/tms/addDomesticLoadResult", data)
-        .then((res) => {
-          console.log(res);
-          if (res.data.code == "200") {
-            this.$message({
-              type: "success",
-              message: "新增成功",
-            });
-            this.cancel();
-          }else{
-            this.$message({
-              type: "error", 
-              message: res.data.data,
-            });
-          }
-          this.isLoading=false;
-        });
+      this.axios.post("/api/v1/tms/addDomesticLoadResult", data).then(res => {
+        console.log(res);
+        if (res.data.code == "200") {
+          this.$message({
+            type: "success",
+            message: "新增成功"
+          });
+          this.cancel();
+        } else {
+          this.$message({
+            type: "error",
+            message: res.data.data
+          });
+        }
+        this.isLoading = false;
+      });
     },
     cancel() {
       this.$router.push("/wagonLoadMine");
     },
     // 导入excel
     importExcel(file) {
-      let that=this;
+      let that = this;
       if (!file) {
         that.$message({
           message: "文件错误!",
-          type: "warning",
+          type: "warning"
         });
-        return
+        return;
       }
-      this.tableData=[];
+      this.tableData = [];
       var reader = new FileReader();
-      var data=null;
-      var workbook=null;
+      var data = null;
+      var workbook = null;
       //设置读取操作
-      reader.onload = function (e) {
+      reader.onload = function(e) {
         console.log(e);
         data = e.target.result;
-        workbook= XLSX.read(data, {
-            type: 'binary'
+        workbook = XLSX.read(data, {
+          type: "binary"
         });
         console.log(workbook);
-        let rows= XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);//只取第一页
-        let index=1;
-        for(index=1;index<rows.length;index++){
-          if(typeof workbook.Sheets[workbook.SheetNames[0]]['A'+index] !='undefined'){
+        let rows = XLSX.utils.sheet_to_json(
+          workbook.Sheets[workbook.SheetNames[0]]
+        ); //只取第一页
+        let index = 1;
+        for (index = 1; index < rows.length; index++) {
+          if (
+            typeof workbook.Sheets[workbook.SheetNames[0]]["A" + index] !=
+            "undefined"
+          ) {
             index++;
             break;
-           }
+          }
         }
-        console.log('表头行数:'+index);
+        console.log("表头行数:" + index);
         //校验表头
-        if( workbook.Sheets[workbook.SheetNames[0]]['A'+index].v!='序号'
-        || workbook.Sheets[workbook.SheetNames[0]]['B'+index].v!='发站'
-        || workbook.Sheets[workbook.SheetNames[0]]['C'+index].v!='到站'
-        || workbook.Sheets[workbook.SheetNames[0]]['D'+index].v!='发货日期'
-        || workbook.Sheets[workbook.SheetNames[0]]['E'+index].v!='到货日期'
-        || workbook.Sheets[workbook.SheetNames[0]]['F'+index].v!='卸货地点'
-        || workbook.Sheets[workbook.SheetNames[0]]['G'+index].v!='品名'
-        || (workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费\n吨位'
-        && workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费吨位'
-        && workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费&#10;吨位')
-        || workbook.Sheets[workbook.SheetNames[0]]['J'+index].v!='车号'
-        || workbook.Sheets[workbook.SheetNames[0]]['K'+index].v!='计量吨位'
-        || workbook.Sheets[workbook.SheetNames[0]]['L'+index].v!='计费吨位合计'){
-          if(workbook.Sheets[workbook.SheetNames[0]]['A'+index].v!='序号'){
-             that.$message({
-                message: "表格格式错误:序号错误",
-                type: "warning",
+        if (
+          workbook.Sheets[workbook.SheetNames[0]]["A" + index].v != "序号" ||
+          workbook.Sheets[workbook.SheetNames[0]]["B" + index].v != "发站" ||
+          workbook.Sheets[workbook.SheetNames[0]]["C" + index].v != "到站" ||
+          workbook.Sheets[workbook.SheetNames[0]]["D" + index].v !=
+            "发货日期" ||
+          workbook.Sheets[workbook.SheetNames[0]]["E" + index].v !=
+            "到货日期" ||
+          workbook.Sheets[workbook.SheetNames[0]]["F" + index].v !=
+            "卸货地点" ||
+          workbook.Sheets[workbook.SheetNames[0]]["G" + index].v != "品名" ||
+          (workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+            "计费\n吨位" &&
+            workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+              "计费吨位" &&
+            workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+              "计费&#10;吨位") ||
+          workbook.Sheets[workbook.SheetNames[0]]["J" + index].v != "车号" ||
+          workbook.Sheets[workbook.SheetNames[0]]["K" + index].v !=
+            "计量吨位" ||
+          workbook.Sheets[workbook.SheetNames[0]]["L" + index].v !=
+            "计费吨位合计"
+        ) {
+          if (
+            workbook.Sheets[workbook.SheetNames[0]]["A" + index].v != "序号"
+          ) {
+            that.$message({
+              message: "表格格式错误:序号错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['B'+index].v!='发站'){
-             that.$message({
-                message: "表格格式错误:发站错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["B" + index].v != "发站"
+          ) {
+            that.$message({
+              message: "表格格式错误:发站错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['C'+index].v!='到站'){
-             that.$message({
-                message: "表格格式错误:到站错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["C" + index].v != "到站"
+          ) {
+            that.$message({
+              message: "表格格式错误:到站错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['D'+index].v!='发货日期'){
-             that.$message({
-                message: "表格格式错误:发货日期错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["D" + index].v != "发货日期"
+          ) {
+            that.$message({
+              message: "表格格式错误:发货日期错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['E'+index].v!='到货日期'){
-             that.$message({
-                message: "表格格式错误:到货日期错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["E" + index].v != "到货日期"
+          ) {
+            that.$message({
+              message: "表格格式错误:到货日期错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['F'+index].v!='卸货地点'){
-             that.$message({
-                message: "表格格式错误:卸货地点错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["F" + index].v != "卸货地点"
+          ) {
+            that.$message({
+              message: "表格格式错误:卸货地点错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['G'+index].v!='品名'){
-             that.$message({
-                message: "表格格式错误:品名错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["G" + index].v != "品名"
+          ) {
+            that.$message({
+              message: "表格格式错误:品名错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费\n吨位' 
-          && workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费吨位'
-          && workbook.Sheets[workbook.SheetNames[0]]['I'+index].v!='计费&#10;吨位'){
-             that.$message({
-                message: "表格格式错误:计费吨位错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+              "计费\n吨位" &&
+            workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+              "计费吨位" &&
+            workbook.Sheets[workbook.SheetNames[0]]["I" + index].v !=
+              "计费&#10;吨位"
+          ) {
+            that.$message({
+              message: "表格格式错误:计费吨位错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['J'+index].v!='车号'){
-             that.$message({
-                message: "表格格式错误:车号错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["J" + index].v != "车号"
+          ) {
+            that.$message({
+              message: "表格格式错误:车号错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['K'+index].v!='计量吨位'){
-             that.$message({
-                message: "表格格式错误:计量吨位错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["K" + index].v != "计量吨位"
+          ) {
+            that.$message({
+              message: "表格格式错误:计量吨位错误",
+              type: "warning"
             });
-          }else if(workbook.Sheets[workbook.SheetNames[0]]['L'+index].v!='计费吨位合计'){
-             that.$message({
-                message: "表格格式错误:计费吨位合计错误",
-                type: "warning",
+          } else if (
+            workbook.Sheets[workbook.SheetNames[0]]["L" + index].v !=
+            "计费吨位合计"
+          ) {
+            that.$message({
+              message: "表格格式错误:计费吨位合计错误",
+              type: "warning"
             });
           }
           return;
         }
         //读取表格
-        for(let i=1;i<=rows.length+1;i++){
-          let row=workbook.Sheets[workbook.SheetNames[0]]['A'+i];
-          if(row!='undefined' && row!=null && typeof row.v=='number' 
-              && workbook.Sheets[workbook.SheetNames[0]]['B'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['B'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['C'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['C'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['D'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['D'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['E'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['E'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['F'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['F'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['G'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['G'+i]!=null
-              && workbook.Sheets[workbook.SheetNames[0]]['J'+i]!='undefined'
-            && workbook.Sheets[workbook.SheetNames[0]]['J'+i]!=null){
-            let tableRow={
-              sendStation:workbook.Sheets[workbook.SheetNames[0]]['B'+i].v,
-              arrivalStation:workbook.Sheets[workbook.SheetNames[0]]['C'+i].v,
-              sendDate:sjTime(workbook.Sheets[workbook.SheetNames[0]]['D'+i].v),
-              arrivalDate:workbook.Sheets[workbook.SheetNames[0]]['E'+i].v,
-              unloadPoint:workbook.Sheets[workbook.SheetNames[0]]['F'+i].v,
-              productName:workbook.Sheets[workbook.SheetNames[0]]['G'+i].v,
-              wagonNo:workbook.Sheets[workbook.SheetNames[0]]['J'+i].v,
-              weight:workbook.Sheets[workbook.SheetNames[0]]['I'+i].v,
-              mineral:workbook.Sheets[workbook.SheetNames[0]]['H'+i].v,
-            }
-            if((tableRow.wagonNo+"").length!=7){
+        for (let i = 1; i <= rows.length + 1; i++) {
+          let row = workbook.Sheets[workbook.SheetNames[0]]["A" + i];
+          if (
+            row != "undefined" &&
+            row != null &&
+            typeof row.v == "number" &&
+            workbook.Sheets[workbook.SheetNames[0]]["B" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["B" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["C" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["C" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["D" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["D" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["E" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["E" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["F" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["F" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["G" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["G" + i] != null &&
+            workbook.Sheets[workbook.SheetNames[0]]["J" + i] != "undefined" &&
+            workbook.Sheets[workbook.SheetNames[0]]["J" + i] != null
+          ) {
+            let tableRow = {
+              sendStation: workbook.Sheets[workbook.SheetNames[0]]["B" + i].v,
+              arrivalStation:
+                workbook.Sheets[workbook.SheetNames[0]]["C" + i].v,
+              sendDate: sjTime(
+                workbook.Sheets[workbook.SheetNames[0]]["D" + i].v
+              ),
+              arrivalDate: workbook.Sheets[workbook.SheetNames[0]]["E" + i].v,
+              unloadPoint: workbook.Sheets[workbook.SheetNames[0]]["F" + i].v,
+              productName: workbook.Sheets[workbook.SheetNames[0]]["G" + i].v,
+              wagonNo: workbook.Sheets[workbook.SheetNames[0]]["J" + i].v,
+              weight: workbook.Sheets[workbook.SheetNames[0]]["I" + i].v,
+              mineral: workbook.Sheets[workbook.SheetNames[0]]["H" + i].v
+            };
+            if ((tableRow.wagonNo + "").length != 7) {
               that.$message({
-                message: "存在车皮号长度不等于7:"+tableRow.wagonNo,
-                type: "warning",
+                message: "存在车皮号长度不等于7:" + tableRow.wagonNo,
+                type: "warning"
               });
               continue;
             }
@@ -451,11 +511,12 @@ export default {
         console.log(that.tableData);
       };
       reader.readAsBinaryString(file.raw); //以二进制方式读取
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang='scss'>
+
+<style lang="scss">
 .addWagonLoad {
   color: #606266;
   font-size: 0.675rem;
@@ -486,7 +547,7 @@ export default {
       padding: 0.625rem;
       display: flex;
       flex-wrap: wrap;
-      overflow:auto;
+      overflow: auto;
       .cpList1 {
         background-color: #c9c7c7;
         height: 1.875rem;
@@ -562,7 +623,7 @@ export default {
       width: 1.875rem;
       height: 1.25rem;
     }
-    .el-input{
+    .el-input {
       width: 13.5rem;
       margin-right: 2.375rem;
     }
@@ -583,10 +644,9 @@ export default {
   .form {
     display: flex;
     width: 340px;
-    margin-left:37.5%; 
+    margin-left: 37.5%;
     margin-right: 20px;
     .form_box {
-      
       .el-form {
         .preview-group {
           .el-form-item {
@@ -601,10 +661,10 @@ export default {
               .el-input {
                 width: 250px;
               }
-              .el-textarea{
-                .el-textarea__inner{
+              .el-textarea {
+                .el-textarea__inner {
                   width: 250px;
-                
+
                   margin-top: 0.03rem;
                 }
               }
@@ -620,10 +680,9 @@ export default {
     margin-top: 30px;
     margin-bottom: 30px;
   }
-   .fromOther  .el-input__inner{
+  .fromOther .el-input__inner {
     width: 250px;
   }
- 
 }
 </style>
-
+<style lang="scss" scoped></style>

+ 0 - 1
src/views/TMS/components/importedMine/addWagonloadCopy.vue

@@ -615,7 +615,6 @@ export default {
           resultType: 1,
           purchaseNo: this.form1.purchaseOrderNo
         };
-        console.log(map);
         this.axios
           .post("/api/v1/tms/addWarehouseOutResult", map)
           .then(res => {

+ 8 - 8
src/views/appoint/components/saleContract/addSaleOrderSteelSendCarrier.vue

@@ -509,14 +509,14 @@ export default {
                   //线路Id
                   lineId: 0
                 };
-                (mapItem.capacityNumber = this.selectionList[i].capacityNumber),
-                  (mapItem.driverTel = this.selectionList[i].driverTel),
-                  (mapItem.saleOrderMaterialId = this.selectionList[
-                    i
-                  ].saleOrderMaterialId),
-                  (mapItem.carrierId = this.selectionList[i].carrierId),
-                  (mapItem.lineId = this.selectionList[i].lineId),
-                  mapList.push(mapItem);
+                mapItem.capacityNumber = this.selectionList[i].capacityNumber;
+                mapItem.driverTel = this.selectionList[i].driverTel;
+                mapItem.saleOrderMaterialId = this.selectionList[
+                  i
+                ].saleOrderMaterialId;
+                mapItem.carrierId = this.selectionList[i].carrierId;
+                mapItem.lineId = this.selectionList[i].lineId;
+                mapList.push(mapItem);
               }
             }
             this.axios

+ 4 - 8
src/views/statisticalReport/components/columnItem.vue

@@ -1,9 +1,5 @@
 <template>
-  <el-table-column
-    :prop="col.prop"
-    :label="col.label"
-    :align="alignType"
-  >
+  <el-table-column :prop="col.prop" :label="col.label" :align="alignType">
     <template v-for="(item, index) of col.children">
       <column-item v-if="item.children" :key="index" :col="item"></column-item>
       <el-table-column
@@ -19,7 +15,7 @@
 
 <script>
 export default {
-  name: 'ColumnItem',
+  name: "ColumnItem",
   props: {
     col: {
       type: Object
@@ -27,9 +23,9 @@ export default {
     // 判断单元格文字是居中还是左对齐显示
     alignType: {
       type: String,
-      default: 'center'// 默认居中
+      default: "center" // 默认居中
     }
   }
-}
+};
 </script>
 <style scoped></style>

+ 618 - 95
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelAllReport.vue

@@ -3,6 +3,28 @@
   <div class="purchasFuelNewMonitor">
     <div class="tableTop">
       <el-form :inline="true" style="margin-top :5px">
+        <el-form-item>
+          <el-select
+            v-model="screen"
+            placeholder="请选择需筛选的内容"
+            clearable
+            @change="changeScreen"
+            style="width:150px"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            style="width:200px"
+            v-model="input"
+            placeholder="请输入查询条件"
+          ></el-input>
+        </el-form-item>
         <el-form-item>
           <label class="el-form-item__label" style="width: auto;"
             >订单时间:</label
@@ -11,6 +33,7 @@
             v-model="startTime"
             type="datetime"
             placeholder="选择日期时间"
+            style="width:200px"
           >
           </el-date-picker>
           <span>至</span>
@@ -18,20 +41,21 @@
             v-model="endTime"
             type="datetime"
             placeholder="选择日期时间"
+            style="width:200px"
           >
           </el-date-picker>
           <el-button type="primary" class="btn" @click="onclick">
-            <i class="el-icon-search"></i>查询
+            <i class="el-icon-search"></i>
           </el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="exportData()"
-            ><i class="el-icon-download"></i>导出(Excel)</el-button
+          <el-button type="primary" @click="exportAllReportToExcel"
+            ><i class="el-icon-download"></i>Excel</el-button
           >
         </el-form-item>
         <el-form-item>
           <el-button type="primary" @click="refresh">
-            <i class="el-icon-refresh"></i>刷新
+            <i class="el-icon-refresh"></i>
           </el-button>
         </el-form-item>
         <el-form-item>
@@ -42,19 +66,27 @@
             style="width: 100px;"
           ></el-input>
         </el-form-item>
+        <el-form-item>
+          <span style="margin-left: 1rem">合计件数:</span>
+          <el-input
+            v-model="totalNumber"
+            :disabled="true"
+            style="width: 100px;"
+          ></el-input>
+        </el-form-item>
       </el-form>
     </div>
     <div class="table">
       <el-table
         :data="tableData"
         :span-method="objectSpanMethod"
+        ref="tableRef"
         border
         stripe
         @filter-change="filterChange"
         style="width: 100%; margin-top: 20px"
-        max-height="500px"
+        max-height="800px"
         @cell-click="cellClik"
-        @cell-mouse-leave="cellLeaveMouse"
       >
         <el-table-column
           width="50"
@@ -94,13 +126,13 @@
               @select="handleSelectCarrier(scope.row, scope.$index)"
               :disabled="scope.row.isCarrierShow != 1"
             >
-              <el-button
-                @click="updateTruckCarrier(row)"
-                type="primary"
-                v-if="scope.row.isCarrierShow == 1"
-                >提交</el-button
-              >
             </el-autocomplete>
+            <el-button
+              @click="updateTruckCarrier(scope.row)"
+              type="primary"
+              v-if="scope.row.isCarrierShow == 1"
+              >提交</el-button
+            >
           </template>
         </el-table-column>
         <el-table-column
@@ -156,6 +188,20 @@
           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>
@@ -168,6 +214,34 @@
         </el-table-column>
         <el-table-column prop="materialSpe" label="物资规格" align="center">
         </el-table-column>
+        <el-table-column
+          prop="materialNum"
+          label="物资件数"
+          align="center"
+          width="150px"
+        >
+          <template slot-scope="scope">
+            <button
+              type="primary"
+              @click="scope.row.materialNum--"
+              v-if="scope.row.isNumShow == 1"
+              style="height:40px"
+            >
+              -
+            </button>
+            <input
+              v-model="scope.row.materialNum"
+              disabled
+              style="width:40px;height: 40px;font-size:16px;line-height: 40px;text-align: center;"
+            />
+            <el-button
+              type="primary"
+              @click="updateBillOrder(scope.row)"
+              v-if="scope.row.isNumShow == 1"
+              >提交</el-button
+            >
+          </template>
+        </el-table-column>
         <el-table-column prop="grossWeight" label="毛重"> </el-table-column>
         <el-table-column
           prop="grossWeightTime"
@@ -230,11 +304,19 @@
         >
         </el-table-column>
         <el-table-column prop="truckNo" label="车序号"> </el-table-column>
-        <el-table-column prop="consigneeTel" label="收货客户电话">
+        <el-table-column
+          prop="consigneeTel"
+          label="收货客户电话"
+          :width="flexColumnWidth('consigneeTel', tableData, 'max')"
+        >
         </el-table-column>
         <el-table-column prop="isSelfMention" label="是否自提" align="center">
         </el-table-column>
-        <el-table-column prop="saleOrderStatus" label="销售订单状态">
+        <el-table-column
+          prop="saleOrderStatus"
+          label="销售订单状态"
+          :width="flexColumnWidth('saleOrderStatus', tableData, 'max')"
+        >
         </el-table-column>
         <el-table-column
           label="操作"
@@ -246,13 +328,103 @@
             <el-button
               type="text"
               size="small"
-              @click="deleteEasEntryId(scope.row)"
+              @click="closeEasEntryId(scope.row)"
               >关闭分录</el-button
             >
           </template>
         </el-table-column>
+        <el-table-column
+          label="操作"
+          fixed="right"
+          width="120px"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              size="small"
+              @click="deleteEasEntryId(scope.row)"
+              >关闭车辆</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
     </div>
+    <div class="address">
+      <!-- 收货地址弹出框 -->
+      <el-dialog title="收货地址" :visible.sync="drawer" width="90%">
+        <el-form :inline="true">
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;">省</label>
+            <el-select
+              v-model="province"
+              filterable
+              placeholder="请选择"
+              @change="onchangeProvince"
+            >
+              <el-option
+                v-for="item in provinceList"
+                :key="item.id"
+                :label="item.addressProvince"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;">市</label>
+            <el-select
+              v-model="city"
+              filterable
+              placeholder="请选择"
+              @change="onchangeCity"
+            >
+              <el-option
+                v-for="item in cityList"
+                :key="item.id"
+                :label="item.addressDistrict"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;"
+              >县(区)</label
+            >
+            <el-select
+              v-model="county"
+              filterable
+              placeholder="请选择"
+              @change="onchangeCounty"
+            >
+              <el-option
+                v-for="item in countyList"
+                :key="item.id"
+                :label="item.addressTown"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <label class="el-form-item__label" style="width: auto;"
+              >具体收货地址</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-form>
+        <div slot="footer" class="button-box">
+          <el-button @click="drawer = false">取消</el-button>
+          <el-button type="primary" @click="addAddressClick">确定</el-button>
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -263,6 +435,24 @@ import { getCookie } from "@/utils/util.js";
 export default {
   data() {
     return {
+      drawer: false,
+      clickIndex: null,
+      input: null,
+      screen: "",
+      options: [
+        {
+          value: "下单客户",
+          lable: "下单客户"
+        },
+        {
+          value: "承运商",
+          lable: "承运商"
+        },
+        {
+          value: "车牌号",
+          lable: "车牌号"
+        }
+      ],
       startTime: null,
       endTime: null,
       //合计净重
@@ -285,7 +475,6 @@ export default {
         5,
         6,
         7,
-        15,
         16,
         17,
         18,
@@ -296,8 +485,34 @@ export default {
         23,
         24,
         25,
-        26
-      ]
+        26,
+        27,
+        29
+      ],
+      tableTitle: "销售钢材统计报表",
+      //所有省
+      provinceList: [],
+      //选中的省
+      province: "",
+      //所有市
+      cityList: [],
+      //选中的市
+      city: "",
+      //所有的县(区)
+      countyList: [],
+      //选中的县
+      county: "",
+      //地址输入框的值
+      addresText: "",
+      //已选中省市县
+      address: null,
+      //具体地址
+      place: null,
+      //暂存具体地址
+      place1: null,
+      //省市县Id
+      addressId: null,
+      addressRow: {}
     };
   },
   computed: {
@@ -326,21 +541,44 @@ export default {
     this.getSteelReport();
   },
   methods: {
-    filterChange(filters) {
-      console.log(filters);
-      var arr = this.tableData;
-      var capacityNoList = Array.from(filters.capacityNo);
-      this.tableData = [];
-      this.tableData = arr.filter((item, index) => {
-        return capacityNoList.indexOf(item.capacityNo) != -1;
+    //销售钢材报表导出excel
+    exportAllReportToExcel() {
+      const loading = this.$loading({
+        lock: true,
+        text: "正在导出Excel",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
-      this.getSpanArr(this.tableData);
-      console.log(this.tableData);
+      var title = this.tableTitle;
+      let tHeader = [];
+      let filterVal = [];
+      console.log(this.$refs.tableRef);
+      this.$refs.tableRef.$children.forEach(item => {
+        if (item.label != undefined && item.prop != undefined) {
+          if (tHeader.indexOf(item.label) === -1) {
+            tHeader.push(item.label);
+          }
+          if (filterVal.indexOf(item.prop) === -1) {
+            filterVal.push(item.prop);
+          }
+        }
+      });
+      this.downloadLoading = true;
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require("@/assets/excel/Export2Excel.js"); //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        let data = this.tableData.map(v => filterVal.map(j => v[j])); //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title); // (title)导出的表格名称
+      });
+      loading.close();
     },
+    changeScreen() {
+      console.log(this.screen);
+    },
+    filterChange(filters) {},
     filterTag(value, row, column) {
-      // console.log(value);
-      // console.log(row);
-      // console.log(column);
+      return row.capacityNo == value;
     },
     // 数组对象去重
     deWeight(arr) {
@@ -355,54 +593,67 @@ export default {
       return arr;
     },
     cellClik(row, column, cell, event) {
-      console.log(cell);
+      if (row.group != this.clickIndex) {
+        this.tableData.forEach(item => {
+          if (item.group == this.clickIndex) {
+            this.$set(item, "isCapacityShow", 0);
+            this.$set(item, "isCarrierShow", 0);
+            this.$set(item, "isTelShow", 0);
+            this.$set(item, "isAddressShow", 0);
+            this.$set(item, "isNumShow", 0);
+          }
+        });
+      }
       if (column.property == "capacityNo") {
         this.$set(row, "isCapacityShow", 1);
+        this.clickIndex = row.group;
       }
       if (column.property == "carrierName") {
         this.$set(row, "isCarrierShow", 1);
+        this.clickIndex = row.group;
       }
       if (column.property == "capacityTel") {
         this.$set(row, "isTelShow", 1);
+        this.clickIndex = row.group;
       }
-      if (column.property == "capacityTel") {
-        this.$set(row, "isTelShow", 1);
-      }
-    },
-    cellLeaveMouse(row, column, cell, event) {
-      if (column.property == "capacityNo") {
-        this.$set(row, "isCapacityShow", 0);
-      }
-      if (column.property == "carrierName") {
-        this.$set(row, "isCarrierShow", 0);
-      }
-      if (column.property == "capacityTel") {
-        this.$set(row, "isTelShow", 0);
+      if (column.property == "addressPlace") {
+        this.$set(row, "isAddressShow", 1);
+        this.clickIndex = row.group;
       }
-      if (column.property == "capacityTel") {
-        this.$set(row, "isTelShow", 0);
+      if (column.property == "materialNum") {
+        this.$set(row, "isNumShow", 1);
+        this.clickIndex = row.group;
       }
     },
     //承运商弹出层
     handleSelectCarrier(row, index, item) {
-      console.log(this.carrierList);
-      console.log(row);
+      this.carrierList.forEach(item => {
+        if (item.carrierName == row.carrierName) {
+          row.carrierId = item.carrierId;
+        }
+      });
     },
     //承运商边输边查
     querySearchCarrier(queryString, cb) {
-      this.axios
-        .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
-        .then(res => {
-          if (res.data.code == "200") {
-            var restaurants = res.data.data;
-            this.carrierList = res.data.data;
-            console.log(restaurants);
-            var results = queryString
-              ? restaurants.filter(this.createFilterCarrier(queryString))
-              : restaurants;
-            cb(results);
-          }
-        });
+      if (queryString.length > 1) {
+        this.axios
+          .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.carrierList = [];
+              if (res.data.data.length == 0) {
+                this.$message.info("承运商不存在,请前往注册");
+                return;
+              }
+              var restaurants = res.data.data;
+              this.carrierList = res.data.data;
+              var results = queryString
+                ? restaurants.filter(this.createFilterCarrier(queryString))
+                : restaurants;
+              cb(results);
+            }
+          });
+      }
     },
     createFilterCarrier(queryString) {
       return restaurants => {
@@ -418,12 +669,12 @@ export default {
         this.axios
           .post("/api/v1/uc/getCapacityByLike?index=" + queryString)
           .then(res => {
+            this.capacityList = [];
             if (res.data.code == "200") {
               if (res.data.data.length == 0) {
-                this.$message.info("车牌号不存在");
+                this.$message.info("车牌号不存在,请前往注册");
                 return;
               }
-              this.capacityList = [];
               var restaurants = res.data.data;
               this.capacityList = res.data.data;
               var results = queryString
@@ -447,37 +698,51 @@ export default {
     handleSelect(row, index) {
       this.capacityList.forEach(item => {
         if (item.capacityNumber === row.capacityNo) {
-          row.newCapacityId = item.capacityId;
+          row.newsCapacityId = item.capacityId;
         }
       });
     },
-    //更换车牌号接口
-    updateCapacitySure() {
-      let map = {
-        orderId: this.orderId,
-        saleOrderMaterialId: this.saleOrderMaterialId,
-        lineSequence: this.lineSequence,
-        capacityId: this.newCapacityId
-      };
-      this.axios
-        .post("/api/v1/ams/updateCapacityNumberInFactory", map)
-        .then(res => {
-          if (res.data.code == 200) {
-            this.$message.success("变更成功");
-            this.getSteelReport();
-          } else {
+    updateCapacity(row) {
+      if (row.newsCapacityId == null) {
+        this.$message.warning("请先注册车牌号或者选中弹出后再提交!");
+        return;
+      }
+      if (row.capacityIds != 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/updateCapacityNumberInFactory", row)
+          .then(res => {
+            if (res.data.code == 200) {
+              this.$message.success("变更车牌号成功!");
+              this.getSteelReport();
+              loading.close();
+            } else {
+              this.$message.success("变更失败,请联系管理员");
+              this.getSteelReport();
+              loading.close();
+            }
+          })
+          .catch(() => {
             this.$message.success("变更失败,请联系管理员");
             this.getSteelReport();
-          }
-        })
-        .catch(() => {
-          this.$message.success("变更失败,请联系管理员");
-          this.getSteelReport();
-        });
+            loading.close();
+          });
+      } else {
+      }
     },
     //修改司机电话号码
     updateDriverTel(row) {
-      console.log(row.capacityTel);
+      const loading = this.$loading({
+        lock: true,
+        text: "修改电话号码中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
       if (row.capacityTel == null || row.capacityTel == "") {
         this.$message.error("电话号码不能为空");
         return;
@@ -491,19 +756,21 @@ export default {
           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();
         });
     },
     //关闭金蝶分录
     deleteEasEntryId(row) {
-      let title = `确定关闭-${this.capacityNumber}-金蝶分录?`;
       this.$confirm(title, {
         confirmButtonText: "是",
         cancelButtonText: "否",
@@ -535,18 +802,160 @@ export default {
         });
     },
     //修改承运商授权
-    //修改承运商授权
     updateTruckCarrier(row) {
-      this.axios.post("/api/v1/ams/updateTruckNoCarrier", map).then(res => {
-        if (res.data.code == "200") {
-          this.$message.success("修改授权成功");
-          this.getRequestUrl();
-          this.dialogTableVisible = false;
-        }
+      if (row.carrierId == 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 {
+            this.$message.error("修改失败,请联系管理员!");
+            this.getSteelReport();
+            loading.close();
+          }
+        })
+        .catch(() => {
+          this.$message.error("修改失败,请联系管理员!");
+          this.getSteelReport();
+          loading.close();
+        });
+    },
+    updateAddress(row) {
+      this.drawer = true;
+      this.addressRow = row;
+      this.province = row.addressProvince;
+      this.city = row.addressDistrict;
+      this.county = row.addressTown;
+      this.addressId = row.shipperAddressId;
+      this.getAllProvince();
+    },
+    //获取所有省数据
+    getAllProvince() {
+      this.axios.post("/api/v1/uc/getAllProvince").then(res => {
+        this.provinceList = res.data.data;
+      });
+    },
+    //省改变
+    onchangeProvince() {
+      this.axios
+        .post(
+          "/api/v1/uc/getDistrictByProvince?addressProvince=" +
+            this.province +
+            "&i=" +
+            new Date()
+        )
+        .then(res => {
+          this.cityList = res.data.data;
+          // this.city = "";
+          // this.county = "";
+        });
+    },
+    //市改变
+    onchangeCity() {
+      this.axios
+        .post(
+          "/api/v1/uc/getTownByDistrict?addressDistrict=" +
+            this.city +
+            "&i=" +
+            new Date()
+        )
+        .then(res => {
+          this.countyList = res.data.data;
+        });
+    },
+    //县(区)改变
+    onchangeCounty() {
+      let mapValue = {
+        addressProvince: this.province,
+        addressDistrict: this.city,
+        addressTown: this.county
+      };
+      this.axios.post("/api/v1/uc/getPlaceByAllAddress", mapValue).then(res => {
+        this.addressId = res.data.data[0].addressId;
+      });
+    },
+    //收货地址弹出层
+    handleSelect1(item) {
+      console.log("获取所有下拉值!");
+    },
+    //以下是收货地址边输边查搜索
+    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
+        );
+      };
+    },
+    addAddressClick() {
+      const loading = this.$loading({
+        lock: true,
+        text: "正在修改收货地址",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
+      let map = this.addressRow;
+      map.isCloseEas = Number(1);
+      map.isNewCar = Number(1);
+      map.place = this.place;
+      map.shipperAddressId = this.addressId;
+      this.axios
+        .post("/api/v1/ams/updateCarAddress", map)
+        .then(res => {
+          if (res.data.code == "200") {
+            this.$message.success("修改收货地址成功!");
+            this.getSteelReport();
+            this.drawer = false;
+            loading.close();
+          } else {
+            this.$message.error("修改失败,请联系管理员!");
+            this.getSteelReport();
+            this.drawer = false;
+            loading.close();
+          }
+        })
+        .catch(() => {
+          this.$message.error("修改失败,请联系管理员!");
+          this.getSteelReport();
+          this.drawer = false;
+          loading.close();
+        });
     },
     //记录每一行的合并数
     getSpanArr(data) {
+      console.log("我执行");
       //每次调用方法初始化
       this.spanArr = [];
       for (var i = 0; i < data.length; i++) {
@@ -566,6 +975,10 @@ export default {
             data[i].group = data[i - 1].group + 1;
           }
         }
+        this.totalCapacity = data[data.length - 1].group + 1;
+        this.totalNumber = data.reduce(function(prev, item) {
+          return prev + item.materialNum;
+        }, 0);
       }
     },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@@ -578,11 +991,99 @@ export default {
         };
       }
     },
+    //减少物资件数
+    updateBillOrder(row) {
+      const loading = this.$loading({
+        lock: true,
+        text: "修改物资件数中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      let map = {
+        materialId: row.materialId,
+        materialNum: row.materialNum
+      };
+      let arr = [];
+      arr.push(map);
+      let updateMap = {
+        orderId: row.orderId,
+        mapList: arr
+      };
+      this.axios
+        .post("/api/v1/oms/updateMaterialMes", updateMap)
+        .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();
+        });
+    },
+    closeEasEntryId(row) {
+      console.log(row);
+      this.$prompt("确定关闭该条分录吗?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        center: true,
+        inputPlaceholder: "请输入关闭理由"
+      })
+        .then(({ value }) => {
+          if (value != null || value != "") {
+            const loading = this.$loading({
+              lock: true,
+              text: "正在关闭该条分录",
+              spinner: "el-icon-loading",
+              background: "rgba(0, 0, 0, 0.7)"
+            });
+            let map = {
+              orderId: row.orderId,
+              saleOrderMaterialId: row.saleOrderMaterialId,
+              saleMaterialId: row.saleMaterialId,
+              reason: value,
+              number: row.saleOrderNo
+            };
+            this.axios
+              .post("/api/v1/ams/closeSteelMaterialId", map)
+              .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.info("取消输入");
+        });
+    },
     //查询,输入查询条件
     onclick() {
       let startTime = null;
       let endTime = null;
       let carrierSsoId = null;
+      let carrierName = null;
+      let consigneeName = null;
+      let capacityNo = null;
+      let remark = null;
       if (this.startTime && this.endTime) {
         startTime = sjTime(this.startTime);
         endTime = sjTime(this.endTime);
@@ -590,6 +1091,15 @@ export default {
       if (getCookie("orgCode") == "chengyunshang") {
         carrierSsoId = getCookie("userId");
       }
+      if (this.screen == "下单客户") {
+        consigneeName = this.input;
+      } else if (this.screen == "承运商") {
+        carrierName = this.input;
+      } else if (this.screen == "车牌号") {
+        capacityNo = this.input;
+      } else {
+        remark = this.input;
+      }
       this.axios
         .post(
           "/api/v1/tms/getSaleSteelReport?startTime=" +
@@ -601,7 +1111,13 @@ export default {
             "&i=" +
             new Date() +
             "&remark=" +
-            this.input
+            remark +
+            "&consigneeName=" +
+            consigneeName +
+            "&carrierName=" +
+            carrierName +
+            "&capacityNo=" +
+            capacityNo
         )
         .then(res => {
           this.tableData = res.data.data;
@@ -715,5 +1231,12 @@ export default {
     margin-left: 20px;
     margin-top: 20px;
   }
+  .address {
+    .button-box {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+  }
 }
 </style>

+ 2 - 2
src/views/statisticalReport/components/tableItem.vue

@@ -101,7 +101,7 @@ export default {
           spanOneArr.push(1);
         } else {
           // name 修改
-          if (item.batchId === arr[index - 1].batchId) {
+          if (item.batchInfacoryId === arr[index - 1].batchInfacoryId) {
             // 第一列需合并相同内容的判断条件
             spanOneArr[concatOne] += 1;
             spanOneArr.push(0);
@@ -133,7 +133,7 @@ export default {
           colspan: _col
         };
       }
-       if (columnIndex === 4) {
+      if (columnIndex === 4) {
         // this.tableData  修改
         const _row = this.flitterData(this.tableData).one[rowIndex];
         const _col = _row > 0 ? 1 : 0;