瀏覽代碼

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

zyf 2 年之前
父節點
當前提交
e80d7af391

+ 1 - 1
src/components/DilCommonUI/packages/mergeRowTable/src/mergeRowTable.vue

@@ -233,7 +233,7 @@ export default {
     // 每页显示个数选择器的选项设置
     pageSizes: {
       default() {
-        return [10, 20, 50, 100, 200, 1000, 50000];
+        return [10, 20, 50, 100, 200, 1000];
       }
     },
     // 每页显示条目个数,支持 .sync 修饰符

+ 1 - 1
src/components/DilCommonUI/packages/table/src/table.vue

@@ -235,7 +235,7 @@ export default {
     // 每页显示个数选择器的选项设置
     pageSizes: {
       default() {
-        return [5, 10, 20, 50, 100, 200, 1000, 50000];
+        return [5, 10, 20, 50, 100, 200, 1000];
       }
     },
     // 每页显示条目个数,支持 .sync 修饰符

+ 10 - 4
src/views/WMS/components/steel/addSteelInbound.vue

@@ -13,7 +13,7 @@
     </div>
     <div class="materialNumber from">
       <span class="text">件数:</span>
-      <el-input class="input" v-model="materialNumber"> </el-input>
+      <el-input class="input" v-model.lazy="materialNumber"> </el-input>
     </div>
     <div class="materialNumber from">
       <span class="text">理重(磅重)</span>
@@ -135,7 +135,9 @@ export default {
             this.materialModel +
             "&num=" +
             this.materialNumber +
-            "&status=1"
+            "&status=1" +
+            "&i=" +
+            new Date()
         )
         .then(res => {
           if (res.data.data == -1) {
@@ -187,7 +189,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     ondrawer(num) {
@@ -204,7 +208,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     // 返回

+ 11 - 4
src/views/WMS/components/steel/bar1_steel/bar1_addSteelInbound.vue

@@ -13,7 +13,7 @@
     </div>
     <div class="materialNumber from">
       <span class="text">件数:</span>
-      <el-input class="input" v-model="materialNumber"> </el-input>
+      <el-input class="input" v-model.lazy="materialNumber"> </el-input>
     </div>
     <div class="materialNumber from">
       <span class="text">理重(磅重)</span>
@@ -135,7 +135,9 @@ export default {
             this.materialModel +
             "&num=" +
             this.materialNumber +
-            "&status=1"
+            "&status=1" +
+            "&i=" +
+            new Date()
         )
         .then(res => {
           if (res.data.data == -1) {
@@ -186,7 +188,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     ondrawer(num) {
@@ -203,7 +207,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     // 返回
@@ -270,6 +276,7 @@ export default {
               message: "入库的数量不正确",
               type: "faile"
             });
+            this.disabled = false;
           }
           this.$router.go(-1);
         });

+ 8 - 3
src/views/WMS/components/steel/bar2_steel/bar2_addSteelInbound.vue

@@ -13,7 +13,7 @@
     </div>
     <div class="materialNumber from">
       <span class="text">件数:</span>
-      <el-input class="input" v-model="materialNumber"> </el-input>
+      <el-input class="input" v-model.lazy="materialNumber"> </el-input>
     </div>
     <div class="materialNumber from">
       <span class="text">理重(磅重)</span>
@@ -186,7 +186,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     ondrawer(num) {
@@ -203,7 +205,9 @@ export default {
           "&startTime=" +
           sjTime(this.startTime) +
           "&endTime=" +
-          sjTime(this.endTime);
+          sjTime(this.endTime) +
+          "&i=" +
+          new Date();
       }
     },
     // 返回
@@ -270,6 +274,7 @@ export default {
               message: "入库的数量不正确",
               type: "faile"
             });
+            this.disabled = false;
           }
           this.$router.go(-1);
         });

+ 85 - 93
src/views/appoint/components/saleContract/saleOrderSteel.vue

@@ -226,25 +226,6 @@
         </el-tab-pane>
       </el-tabs>
     </div>
-    <div>
-      <el-dialog
-        title="销售订单预览"
-        :visible.sync="dialogTableVisible"
-        :center="true"
-        width="100%"
-      >
-        <ExcelSaleOrder :tableData="tableData"></ExcelSaleOrder>
-        <div class="btn">
-          <el-button
-            type="primary"
-            @click="addExcelInport"
-            @keyup.native.enter="addExcelInport"
-            >确认</el-button
-          >
-          <el-button type="primary" @click="cancelExcelInport">取消</el-button>
-        </div>
-      </el-dialog>
-    </div>
   </div>
 </template>
 <script>
@@ -350,7 +331,8 @@ export default {
         "isSelfMention",
         "saleRemark",
         "saleOrderReceiveCustomer",
-        "salerName"
+        "salerName",
+        "saleOrderNo"
       ],
       saleOrderMapList: [
         "truckNo",
@@ -444,18 +426,7 @@ export default {
     } else {
       this.saleDateOfReceipt = loadTime1;
     }
-    // document.addEventListener("keydown", e => {
-    //   let key = window.event.keyCode;
-    //   if (key == 13) {
-    //     // 13是enter键的键盘码 如果等于13 就调用click的登录方法
-    //     this.addExcelInport();
-    //   }
-    // });
   },
-  // beforeDestroy() {
-  //   //这里的 this.login('loginForm') 指的是键盘事件的方法名
-  //   document.removeEventListener("keydown", this.addExcelInport());
-  // },
   activated() {
     if (getCookie("orgCode") == "shouhuokehu") {
       this.option.requestUrl =
@@ -521,13 +492,35 @@ export default {
           let map = {};
           try {
             Object.keys(e).forEach(e1 => {
+              if (e1.includes("销售订单编号")) {
+                map.saleOrderNo = e[e1];
+              }
               if (e1.includes("物资名称")) {
                 map.materialName = e[e1];
+                if (
+                  e[e1].includes("盘螺") ||
+                  e[e1].includes("乱尺") ||
+                  e[e1].includes("盘元") ||
+                  e[e1].includes("盘圆")
+                ) {
+                  map.isPoundSale = 0;
+                } else {
+                  map.isPoundSale = 1;
+                }
+                //确定更改的物资有无米数
+                if (e[e1].includes("米")) {
+                  map.steelMeters = Number(e[e1].replace(/[^0-9]/gi, ""));
+                } else {
+                  map.steelMeters = null;
+                }
               }
               if (e1.includes("下单客户")) {
                 map.receiveName = e[e1];
               }
-              if (e1.includes("米数")) {
+              if (
+                e1.includes("米数") &&
+                (map.steelMeters == null || map.steelMeters != "")
+              ) {
                 map.steelMeters = e[e1];
               }
               if (e1.includes("物资规格")) {
@@ -593,18 +586,6 @@ export default {
               if (e1.includes("备注")) {
                 map.truckRemark = e[e1];
               }
-              if (e1.includes("是否磅重交货")) {
-                if (e[e1] == "是") {
-                  map.isPoundSale = 0;
-                } else if (e[e1] == "否") {
-                  map.isPoundSale = 1;
-                } else {
-                  throw new Error(
-                    `该Excel第--${index +
-                      2}--行-“是否磅重交货”-错误,请核实后再输入`
-                  );
-                }
-              }
               if (e1.includes("是否自提")) {
                 if (e[e1] === "是" || e[e1] === "否") {
                   map.isSelfMention = e[e1];
@@ -621,64 +602,75 @@ export default {
             that.$message.error(e.message);
           }
         });
-        that.dialogTableVisible = true;
+        console.log(this.tableData);
+        that.addExcelInport();
+        // that.dialogTableVisible = true;
         return;
       };
       reader.readAsBinaryString(file.raw); //以二进制方式读取
     },
     addExcelInport() {
-      this.$confirm("以上均核对正确,确定导入Excel", "提示", {
-        cancelButtonText: "取消",
-        confirmButtonText: "确认",
-        center: true
-      })
-        .then(() => {
-          let map = {};
-          let arr = [];
-          this.tableData.forEach(e => {
-            let mapMaterial = {};
-            Object.keys(e).forEach(e1 => {
-              if (this.saleOrderList.includes(e1)) {
-                map[e1] = e[e1];
-              }
-              if (this.saleOrderMapList.includes(e1)) {
-                mapMaterial[e1] = e[e1];
-              }
-            });
-            mapMaterial.saleDateOfReceipt = sjTime(this.saleDateOfReceipt);
-            arr.push(mapMaterial);
+      //加载虚拟
+      const loading = this.$loading({
+        lock: true,
+        text: "正在快马加鞭为您生成销售订单,请稍候",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      //需要遍历数组,以销售订单编号为分类
+      const map1 = this.tableData.reduce((result, item) => {
+        result[item.saleOrderNo] = result[item.saleOrderNo] || [];
+        result[item.saleOrderNo].push(item);
+        return result;
+      }, {});
+      // result即为所求
+      let result = Object.values(map1);
+      //遍历数组
+      let saleOrderListMap = [];
+      result.forEach((saleOrderList, index) => {
+        let map = {};
+        let arr = [];
+        console.log("saleOrderList");
+        console.log(saleOrderList);
+        saleOrderList.forEach(e => {
+          let mapMaterial = {};
+          Object.keys(e).forEach(e1 => {
+            if (this.saleOrderList.includes(e1)) {
+              map[e1] = e[e1];
+            }
+            if (this.saleOrderMapList.includes(e1)) {
+              mapMaterial[e1] = e[e1];
+            }
           });
-          map.shipperId = 1;
-          map.mapList = arr;
-          console.log(map);
-          this.axios
-            .post("/api/v1/ams/addSteelSaleOrder", map)
-            .then(res => {
-              if (res.data.code == "200") {
-                this.$message.success("新增销售订单成功!");
-                this.getRequestUrl();
-                this.dialogTableVisible = false;
-                this.tableData = [];
-              } else {
-                this.$message.error(res.data.data);
-                this.getRequestUrl();
-                this.dialogTableVisible = false;
-                this.tableData = [];
-              }
-            })
-            .catch(e => {
-              this.$message.error("生成错误!");
-              this.dialogTableVisible = false;
-              this.tableData = [];
-            });
+          mapMaterial.saleDateOfReceipt = sjTime(this.saleDateOfReceipt);
+          arr.push(mapMaterial);
+        });
+        map.shipperId = 1;
+        map.mapList = arr;
+        saleOrderListMap.push(map);
+      });
+      console.log(saleOrderListMap);
+      this.axios
+        .post("/api/v1/ams/addSteelSaleOrderList", saleOrderListMap)
+        .then(res => {
+          if (res.data.code == "200") {
+            loading.close();
+            this.getRequestUrl();
+            this.$message.success("新增销售订单成功!");
+            this.tableData = [];
+          } else {
+            this.$message.error(res.data.data);
+            this.getRequestUrl();
+            loading.close();
+            this.tableData = [];
+          }
         })
-        .catch(() => {
-          this.$message.info("取消导入");
+        .catch(e => {
+          this.$message.error("生成错误!");
+          loading.close();
+          this.tableData = [];
         });
     },
-    cancelExcelInport() {
-      this.dialogTableVisible = false;
-    },
     adverseCloseSaleOrder(row) {
       console.log(row);
       this.$confirm("确定反关闭整条订单吗?", "继续?", {

+ 59 - 6
src/views/appoint/components/ship/addDeliveryNotice.vue

@@ -40,7 +40,10 @@
       <span class="motext">批次</span>
       <el-input class="moinput" v-model="batchIds" disabled> </el-input>
       <el-button class="mobutton" type="primary" @click="ondrawer(5)"
-        >浏览</el-button
+        >选批次</el-button
+      >
+      <el-button class="mobutton" type="primary" @click="ondrawer(6)"
+        >录批次</el-button
       >
     </div>
     <div class="form">
@@ -82,7 +85,7 @@
       <el-input
         placeholder="请输入内容"
         v-model="input"
-        style="margin-top: 10px; margin-left: 20px; width: 250px"
+        style="margin-top: 10px; margin-left: 20px; width: 200px"
         clearable
       >
       </el-input>
@@ -94,6 +97,21 @@
       >
         <i class="el-icon-search"></i>查询
       </el-button>
+      <el-input
+       v-show="a == 6"
+        placeholder="请输入外轮船名"
+        v-model="foreignShipName"
+        style="width: 200px"
+        clearable
+      ></el-input>
+      <el-button
+      v-show="a == 6"
+        type="primary"
+        class="btn"
+        @click="handleClose"
+        style="margin-bottom: 15px"
+      >确定
+      </el-button>
       <!-- <div v-show="a == 4">
         <dilTable v-bind.sync="options" @radio-change="currentRadioChange6"></dilTable>
       </div> -->
@@ -127,6 +145,12 @@
           @radio-change="currentRadioChange5"
         ></dilTable>
       </div>
+      <div v-show="a == 6">
+        <dilTable
+          v-bind.sync="second6"
+          @radio-change="currentRadioChange6"
+        ></dilTable>
+      </div>
     </el-drawer>
     <el-form
       :inline="true"
@@ -225,7 +249,11 @@ export default {
         selectionType: "radio",
         mapList5: [],
       },
-
+      second6: {
+        requestUrl: "/api/v1/uc/queryMaterialByLike?apiId=244",
+        selectionType: "radio",
+      },
+      foreignShipName:null,
       value: undefined,
       value2: undefined,
       value4: undefined,
@@ -350,7 +378,17 @@ export default {
         (this.batchIds =
           selection.foreignShipName + "" + selection.materialName);
     },
-
+    currentRadioChange6(selection) {
+      this.second5.mapList5 = selection;
+      console.log("selection",selection);
+    },
+    checkForeignShipName(){
+      if(this.foreignShipName==null || this.foreignShipName==''){
+        this.$message.warning("请输入外轮船名!");
+        return false;
+      }
+      return true;
+    },
     onchange(val) {},
 
     onclick(a) {
@@ -367,10 +405,25 @@ export default {
       } else if (a == 5) {
         this.second5.requestUrl =
           "/api/v1/tms/getBatchIdByForeign?apiId=489&con=" + this.input;
+      }else if(a == 6){
+          this.second6.requestUrl = 
+          "/api/v1/uc/queryMaterialByLike?apiId=244&index=" + this.input;
       }
     },
-
+    //关闭模态框窗口
     handleClose(done) {
+      if(this.a==6){
+        //校验外轮船名和批次
+        if(!this.checkForeignShipName()){
+          return;
+        }else if(this.second5.mapList5.length == 0){
+          this.$message.warning("请选择物资!");
+          return;
+        }
+        this.batchIds = this.foreignShipName + "" + this.second5.mapList5.materialName;
+        this.second5.mapList5.foreignShipName = this.foreignShipName;
+      }
+      this.drawer=false;
       done();
     },
 
@@ -439,7 +492,7 @@ export default {
         sulfurcontent: this.form1.sulfurcontent,
         userId: getCookie("userId"),
       };
-
+      
       //判断放货数量是否为数字
       if (
         map.noticeCommerceMethod == null ||

+ 149 - 128
src/views/inward/components/truckAppoint/addPlan.vue

@@ -2,44 +2,64 @@
 <template>
   <div class="addInwardPlan">
     <page-title>新增计划</page-title>
-  <div class="carrier form">
-  <el-form  class="demo-form-inline"  label-width="80px" label-position="left">
-  <el-form-item label="承运商">
-    <el-autocomplete
-      class="inline-input"
-      v-model="state2"
-      :fetch-suggestions="querySearch"
-      placeholder="请输入承运商名称"
-      :trigger-on-focus="false"
-      @select="handleSelect"
-    >
-  <template slot-scope="{ item }">
-    <div class="name">{{ item.value }}</div>
-  </template>
-    </el-autocomplete>
-  </el-form-item>
-  <div class="truckNum">
-    <el-form  class="demo-form-inline"  label-width="80px" label-position="left">
-    <el-form-item label="车数">
-    <el-input   v-model="planTruckNumber" placeholder="非必填" class="input"></el-input>
-    </el-form-item>
-  </el-form>
-  </div>
-</el-form>
-</div>
+    <div class="carrier form">
+      <el-form
+        class="demo-form-inline"
+        label-width="80px"
+        label-position="left"
+      >
+        <el-form-item label="承运商">
+          <el-autocomplete
+            class="inline-input"
+            v-model="state2"
+            :fetch-suggestions="querySearch"
+            placeholder="请输入承运商名称"
+            :trigger-on-focus="false"
+            @select="handleSelect"
+          >
+            <template slot-scope="{ item }">
+              <div class="name">{{ item.value }}</div>
+            </template>
+          </el-autocomplete>
+        </el-form-item>
+        <div class="truckNum">
+          <el-form
+            class="demo-form-inline"
+            label-width="80px"
+            label-position="left"
+          >
+            <el-form-item label="车数">
+              <el-input
+                v-model="planTruckNumber"
+                placeholder="非必填"
+                class="input"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+      </el-form>
+    </div>
     <template>
-			<div>		
-			<mergeRowTable v-bind.sync="first" @radio-change="currentRadioChange" ref="table">
-            <el-table-column fixed="right" label="操作" width="120">
-                <template slot-scope="scope">
-                  <el-button type="text" size="mini" @click="deleteRequirement(scope)">
-                    拒绝需求
-                  </el-button>
-                </template>
-              </el-table-column>
-			</mergeRowTable>
+      <div>
+        <mergeRowTable
+          v-bind.sync="first"
+          @radio-change="currentRadioChange"
+          ref="table"
+        >
+          <el-table-column fixed="right" label="操作" width="120">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                size="mini"
+                @click="deleteRequirement(scope)"
+              >
+                拒绝需求
+              </el-button>
+            </template>
+          </el-table-column>
+        </mergeRowTable>
       </div>
-		</template>
+    </template>
     <div class="button-box">
       <el-button type="primary" @click="makeSure">确认新增</el-button>
       <el-button type="primary" @click="cancel">返回</el-button>
@@ -54,84 +74,86 @@ export default {
   data() {
     return {
       restaurants: [],
-      state2:null,
-      planTruckNumber:null,
-      carrierId:null,
-      requirementId:null,
+      state2: null,
+      planTruckNumber: null,
+      carrierId: null,
+      requirementId: null,
       form: {},
-      first:{
-        requestUrl:"/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
+      first: {
+        requestUrl:
+          "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2",
         selectionType: "radio",
-        columnIndexs:[0,1,2,3,4,20,21,22],
+        columnIndexs: [0, 1, 2, 3, 4, 20, 21, 22],
         comparison: "requirementNumber",
-				mapList: {},
+        mapList: {}
       },
       numberValidateForm: {
-          planTruckNumber: null,
-      },
+        planTruckNumber: null
+      }
     };
   },
   methods: {
-    handleSelect(item){
-      this.carrierId = item.carrierId
-      this.state2 = item.carrierName 
+    handleSelect(item) {
+      this.carrierId = item.carrierId;
+      this.state2 = item.carrierName;
     },
-        //搜索
+    //搜索
     querySearch(queryString, cb) {
-        this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+this.state2).then((res)=>{
-        if(res.data.code == "200"){
-          console.log(res)
-          var restaurants = res.data.data
-           var results = queryString ? restaurants.filter(this.createFilter(queryString)) :restaurants;
-          // 调用 callback 返回建议列表的数据
-          console.log(results,"results");
-          cb(results);
-        }
-      })
-       
-      },
-      createFilter(queryString) {
-        return (restaurants) => {
-          return (restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
-        };
-      },
-    currentRadioChange(selection){
-        this.mapList = selection
-        this.requirementId = selection.requirementId
-        console.log(this.mapList)
+      this.axios
+        .post("/api/v1/uc/getCarrierMesByLike?index=" + this.state2)
+        .then(res => {
+          if (res.data.code == "200") {
+            console.log(res);
+            var restaurants = res.data.data;
+            var results = queryString
+              ? restaurants.filter(this.createFilter(queryString))
+              : restaurants;
+            // 调用 callback 返回建议列表的数据
+            console.log(results, "results");
+            cb(results);
+          }
+        });
+    },
+    createFilter(queryString) {
+      return restaurants => {
+        return (
+          restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
+    currentRadioChange(selection) {
+      this.mapList = selection;
+      this.requirementId = selection.requirementId;
+      console.log(this.mapList);
     },
     // 新增
     makeSure() {
-      console.log(typeof(this.planTruckNumber))  
-      if(this.carrierId == null){
-        this.$alert('请输入承运商!')
-        return
-      }else if(this.requirementId== null){
-        this.$alert('请选择需要制定计划的需求!')
-        return
+      console.log(typeof this.planTruckNumber);
+      if (this.carrierId == null || this.state2 == "") {
+        this.$alert("请输入承运商!");
+        return;
+      } else if (this.requirementId == null) {
+        this.$alert("请选择需要制定计划的需求!");
+        return;
       }
       let plan = {
-        requirementId : this.mapList.requirementId,
+        requirementId: this.mapList.requirementId,
         planTruckNumber: Number(this.planTruckNumber),
         carrierId: this.carrierId
       };
-      this.axios
-        .post(
-          "/api/v1/ams/addTruckPlan",
-          plan
-        )
-        .then((res) => {
-            console.log(res)
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "新增成功!",
-            });            
-            this.$router.go(-1);
-          } else {
-            this.$message.error("新增失败!");
-          }
-        });
+      this.axios.post("/api/v1/ams/addTruckPlan", plan).then(res => {
+        console.log(res);
+        if (res.data.code == 200) {
+          this.$message({
+            type: "success",
+            message: "新增成功!"
+          });
+          this.$router.go(-1);
+        } else {
+          this.$message.error("新增失败!");
+        }
+      });
     },
     // 返回
     cancel() {
@@ -142,24 +164,26 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.axios
             .post(
               "/api/v1/ams/deleteTruckRequirement/" + scope.row.requirementId
             )
-            .then((res) => {
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "拒绝成功!",
+                  message: "拒绝成功!"
                 });
-                this.first.requestUrl = "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2&i=" + new Date()
+                this.first.requestUrl =
+                  "/api/v1/ams/getTruckRequirementList?apiId=250&requirementStatus=2&i=" +
+                  new Date();
               } else {
                 this.$message({
                   message: "拒绝失败",
-                  type: "warning",
+                  type: "warning"
                 });
               }
             });
@@ -167,41 +191,38 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "删除操作已取消!",
+            message: "删除操作已取消!"
           });
         });
-    },
-  },
+    }
+  }
 };
 </script>
 
 <style lang="scss" scoped>
-.addInwardPlan{
-.carrier{
-  display: inline-block !important;
-  margin-left: 38%;
-  .el-input{
-    width:250px
-  }
-  .input{
-    margin-left: -10px;
+.addInwardPlan {
+  .carrier {
+    display: inline-block !important;
+    margin-left: 38%;
+    .el-input {
+      width: 250px;
+    }
+    .input {
+      margin-left: -10px;
+    }
+    .el-form {
+      padding: 10px;
+    }
   }
-  .el-form{
-    padding: 10px;  
+  .truckNum {
+    .el-input {
+      width: 250px;
+    }
   }
-}
-.truckNum {
-  .el-input{
-    width: 250px;
+  .button-box {
+    display: flex;
+    justify-content: center;
+    margin-left: 25px !important;
   }
 }
-.button-box
-{
-  display: flex;
-  justify-content: center;
-  margin-left: 25px !important;
-}
-}
-
-
 </style>

+ 89 - 76
src/views/inward/components/truckAppoint/addRequirement2.vue

@@ -81,40 +81,35 @@
             </el-form-item>
           </el-form>
         </div>
-        <el-drawer
-          title="选择车辆类型"
-          :visible.sync="drawer2"
-          direction="rtl"
-          size="40%"
-          :show-close="false"
-        >
-          <div style="margin-left: -300px">
+        <div class="drawSty">
+          <el-drawer
+            :visible.sync="drawer2"
+            direction="rtl"
+            size="40%"
+            :show-close="false"
+          >
             <el-input
               placeholder="请输入内容"
               v-model="inputCapacityType"
-              style="margin-left: 20px; width: 250px"
               clearable
+              style="margin-left:20px"
             >
             </el-input
             ><el-button type="primary" class="btn" @click="onclickCapacity">
               <i class="el-icon-search"></i>查询
             </el-button>
-          </div>
-
-          <!-- <el-button @click="open">取消</el-button> -->
-
-          <div class="tablecls">
-            <dilTable
-              ref="options3"
-              v-bind.sync="options3"
-              @radio-change="selectionChange1"
-              :drawer="aaadrawer"
-            >
-            </dilTable>
-          </div>
-        </el-drawer>
+            <div class="tablecls">
+              <dilTable
+                ref="options3"
+                v-bind.sync="options3"
+                @radio-change="selectionChange1"
+                :drawer="aaadrawer"
+              >
+              </dilTable>
+            </div>
+          </el-drawer>
+        </div>
       </div>
-
       <!-- 选择物资 -->
       <div class="materialDrawer">
         <el-form :inline="true" class="demo-form-inline" label-width="80px">
@@ -278,7 +273,7 @@
         <el-input
           placeholder="请输入内容"
           v-model="input"
-          style="margin-top: 5px; margin-left: 10px; width: 250px"
+          style="width: 250px"
           clearable
         >
         </el-input>
@@ -311,9 +306,7 @@
       </el-drawer>
     </div>
     <div class="button-box">
-      <el-button type="primary" @click="makeSure" 
-        >确认新增</el-button
-      >
+      <el-button type="primary" @click="makeSure">确认新增</el-button>
       <el-button type="primary" @click="cancel">返回</el-button>
     </div>
   </div>
@@ -334,44 +327,44 @@ export default {
       options6: [
         {
           value: "焦化",
-          label: "焦化",
+          label: "焦化"
         },
         {
           value: "污粉",
-          label: "污粉",
+          label: "污粉"
         },
         {
           value: "喷煤",
-          label: "喷煤",
+          label: "喷煤"
         },
         {
           value: "溶剂",
-          label: "溶剂",
+          label: "溶剂"
         },
         {
           value: "配料",
-          label: "配料",
+          label: "配料"
         },
         {
           value: "二次",
-          label: "二次",
+          label: "二次"
         },
         {
           value: "原料",
-          label: "原料",
+          label: "原料"
         },
         {
           value: "烧结矿",
-          label: "烧结矿",
+          label: "烧结矿"
         },
         {
           value: "打堆、装车",
-          label: "打堆、装车",
+          label: "打堆、装车"
         },
         {
           value: "回收废旧物资",
-          label: "回收废旧物资",
-        },
+          label: "回收废旧物资"
+        }
       ],
       installremark: "",
       options: [],
@@ -389,25 +382,25 @@ export default {
         {
           prop: "materialName",
           label: "物资名称",
-          width: "140",
+          width: "140"
         },
         {
           prop: "requirementPlatformName",
           label: "装货点",
           slot: true,
-          width: "140",
+          width: "140"
         },
         {
           prop: "truckPoint1",
           label: "卸货点",
           slot: true,
-          width: "140",
+          width: "140"
         },
         {
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true,
-        },
+          slot: true
+        }
       ],
       row: {},
       //物资表格数据
@@ -439,25 +432,25 @@ export default {
       materialTable: {
         requestUrl: "",
         selectionType: "select",
-        mapList1: [],
+        mapList1: []
       },
       second1: {
         requestUrl: "",
         selectionType: "radio",
-        mapList2: [],
+        mapList2: []
       },
       options3: {
         requestUrl: "",
         selectionType: "radio",
-        mapList3: [],
+        mapList3: []
       },
-      form: {},
+      form: {}
     };
   },
   computed: {
     requirementType() {
       return this.form.requirementType;
-    },
+    }
   },
   watch: {
     requirementType() {
@@ -484,14 +477,14 @@ export default {
         this.tableTop.push({
           prop: "orderMaterialNumber",
           label: "件数",
-          slot: true,
+          slot: true
         });
       } else {
         this.tableTop.splice(this.tableTop.length - 1, 1);
         this.tableTop.push({
           prop: "orderMaterialWeight",
           label: "重量",
-          slot: true,
+          slot: true
         });
       }
     },
@@ -501,7 +494,7 @@ export default {
       } else {
         this.aaadrawer = true;
       }
-    },
+    }
   },
   methods: {
     //用车单位弹出层
@@ -517,7 +510,7 @@ export default {
     querySearchCarrier(queryString, cb) {
       this.axios
         .post("/api/v1/uc/getRequireUnitName?index=" + queryString)
-        .then((res) => {
+        .then(res => {
           if (res.data.code == "200") {
             var restaurantsCarrier = res.data.data;
             // console.log(restaurantsCarrier,"restaurantsCarrier");
@@ -530,7 +523,7 @@ export default {
         });
     },
     createFilterCarrier(queryString) {
-      return (restaurantsCarrier) => {
+      return restaurantsCarrier => {
         return (
           restaurantsCarrier.shipperName
             .toLowerCase()
@@ -580,16 +573,23 @@ export default {
     },
     handleClose2(done) {
       console.log(this.tableData.length);
-      console.log("this.form.requirementType:",this.form.requirementType);
-      if (this.tableData.length > 0 && this.selectionList1.length > 0 && this.form.requirementType!='倒库') {
+      console.log("this.form.requirementType:", this.form.requirementType);
+      if (
+        this.tableData.length > 0 &&
+        this.selectionList1.length > 0 &&
+        this.form.requirementType != "倒库"
+      ) {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
       }
-      if (this.selectionList1.length > 1 && this.form.requirementType!='倒库') {
+      if (
+        this.selectionList1.length > 1 &&
+        this.form.requirementType != "倒库"
+      ) {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
       }
-      this.selectionList1.forEach((e) => {
+      this.selectionList1.forEach(e => {
         // console.log(e.materialModel,e.materialSpecification)
         if (e.materialSpecification == null) {
           e.materialSpecification = "";
@@ -600,7 +600,7 @@ export default {
         var addmap = {
           materialName:
             e.materialName + e.materialSpecification + e.materialModel,
-          materialId: e.materialId,
+          materialId: e.materialId
         };
         this.tableData.push(addmap);
       });
@@ -611,7 +611,7 @@ export default {
     refreshTable() {
       var arr = this.tableData;
       this.tableData = [];
-      arr.forEach((e) => {
+      arr.forEach(e => {
         var addmap = {
           materialName: e.materialName,
           materialId: e.materialId,
@@ -622,7 +622,7 @@ export default {
           orderMaterialNumber: e.orderMaterialNumber,
           orderMaterialWeight: e.orderMaterialWeight,
           loadPointName: e.loadPointName,
-          unloadPointName: e.unloadPointName,
+          unloadPointName: e.unloadPointName
         };
         this.tableData.push(addmap);
       });
@@ -645,7 +645,6 @@ export default {
             "&index=" +
             this.inputMaterial;
         }
-        this.inputMaterial = null;
       }
     },
     onclickCapacity() {
@@ -655,7 +654,6 @@ export default {
         this.options3.requestUrl =
           "/api/v1/uc/getCapacityType?apiId=460&index=" +
           this.inputCapacityType;
-        this.inputCapacityType = null;
       }
     },
     //删除行
@@ -667,15 +665,22 @@ export default {
     // 返回主界面
     makeSure1() {
       console.log(this.tableData.length);
-      if (this.tableData.length > 0 && this.selectionList1.length > 0 && this.form.requirementType!="倒库") {
+      if (
+        this.tableData.length > 0 &&
+        this.selectionList1.length > 0 &&
+        this.form.requirementType != "倒库"
+      ) {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
       }
-      if (this.selectionList1.length > 1 && this.form.requirementType!="倒库") {
+      if (
+        this.selectionList1.length > 1 &&
+        this.form.requirementType != "倒库"
+      ) {
         this.$message.warning("一个需求只允许填写一个物资");
         return;
       }
-      this.selectionList1.forEach((e) => {
+      this.selectionList1.forEach(e => {
         // console.log(e.materialModel,e.materialSpecification)
         if (e.materialSpecification == null) {
           e.materialSpecification = "";
@@ -686,7 +691,7 @@ export default {
         var addmap = {
           materialName:
             e.materialName + e.materialSpecification + e.materialModel,
-          materialId: e.materialId,
+          materialId: e.materialId
         };
         this.tableData.push(addmap);
       });
@@ -696,7 +701,7 @@ export default {
     refreshTable() {
       var arr = this.tableData;
       this.tableData = [];
-      arr.forEach((e) => {
+      arr.forEach(e => {
         var addmap = {
           materialName: e.materialName,
           materialId: e.materialId,
@@ -707,7 +712,7 @@ export default {
           orderMaterialNumber: e.orderMaterialNumber,
           orderMaterialWeight: e.orderMaterialWeight,
           loadPointName: e.loadPointName,
-          unloadPointName: e.unloadPointName,
+          unloadPointName: e.unloadPointName
         };
         this.tableData.push(addmap);
       });
@@ -797,7 +802,7 @@ export default {
       // console.log("进来了");
       // console.log(this.whether);
       // console.log(this.installremark);
-      if (this.tableData.length > 1 && this.form.requirementType!='倒库') {
+      if (this.tableData.length > 1 && this.form.requirementType != "倒库") {
         this.$message.warning("非倒库需求只允许填写一个物资");
         return;
       }
@@ -846,7 +851,7 @@ export default {
         return;
       }
       var i = 0;
-      this.tableData.forEach((e) => {
+      this.tableData.forEach(e => {
         if (e.requirementPlatformId && e.requirementUnloadUnitId) {
           i++;
         }
@@ -901,15 +906,15 @@ export default {
         capacityTypeId: this.capacityTypeId,
         mapList: this.tableData,
         orgCode: getCookie("orgCode"),
-        remark: this.form.Tel + this.capacityTypeName + this.form.typeRemarks,
+        remark: this.form.Tel + this.capacityTypeName + this.form.typeRemarks
       };
       this.axios
         .post("/api/v1/ams/addTruckRequirement", requiremnet)
-        .then((res) => {
+        .then(res => {
           if (res.data.code == 200) {
             this.$message({
               type: "success",
-              message: "新增成功!",
+              message: "新增成功!"
             });
             this.$router.go(-1);
           } else {
@@ -925,8 +930,8 @@ export default {
     // 返回
     cancel() {
       this.$router.go(-1);
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -1054,3 +1059,11 @@ export default {
   }
 }
 </style>
+<style>
+.el-drawer__body {
+  overflow: auto;
+}
+.el-drawer__container ::-webkit-scrollbar {
+  display: none;
+}
+</style>

+ 33 - 27
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelAllReport.vue

@@ -87,6 +87,7 @@
         style="width: 100%; margin-top: 20px"
         max-height="600px"
         @cell-click="cellClik"
+        @row-click="rowClick"
         :row-style="{ height: '30px' }"
         :cell-style="{ fontWeight: '700' }"
       >
@@ -102,21 +103,20 @@
         <el-table-column
           prop="consigneeName"
           label="下单客户"
-          :width="flexColumnWidth('consigneeName', tableData, 'max')"
+          width="160px"
           align="center"
-          fixed
+          show-overflow-tooltip
         >
         </el-table-column>
         <el-table-column
           prop="carrierName"
           label="承运商"
           align="center"
-          width="250px"
-          fixed
+          width="120px"
         >
           <template slot-scope="scope">
             <el-autocomplete
-              style="width:120px"
+              style="width:100px"
               v-model="scope.row.carrierName"
               :fetch-suggestions="querySearchCarrier"
               placeholder="请输入承运商"
@@ -137,8 +137,7 @@
           column-key="capacityNo"
           label="车牌号"
           align="center"
-          width="250px"
-          fixed
+          width="150px"
         >
           <template slot-scope="scope">
             <el-autocomplete
@@ -232,13 +231,15 @@
         <el-table-column
           prop="arrivalAddress"
           label="抵达地址"
-          :width="flexColumnWidth('arrivalAddress', tableData, 'max')"
+          width="280px"
+          show-overflow-tooltip
         >
         </el-table-column>
         <el-table-column
           prop="receiptAddress"
           label="签收地址"
-          :width="flexColumnWidth('receiptAddress', tableData, 'max')"
+          width="280px"
+          show-overflow-tooltip
         >
         </el-table-column>
         <el-table-column
@@ -296,11 +297,14 @@
           width="100px"
         >
         </el-table-column>
+        <el-table-column prop="closeEntryId" label="金蝶分录ID" width="100px">
+        </el-table-column>
         <el-table-column
           label="操作"
           fixed="right"
           width="120px"
           align="center"
+          v-if="operateShow == 1"
         >
           <template slot-scope="scope">
             <el-button
@@ -310,13 +314,21 @@
               v-if="scope.row.deletedStatus == null"
               >关闭分录</el-button
             >
+            <el-button
+              type="text"
+              size="small"
+              @click="adverseCloseSaleMaterial(scope.row)"
+              v-if="scope.row.deletedStatus != null"
+              >反关闭分录</el-button
+            >
           </template>
         </el-table-column>
         <el-table-column
           label="操作"
           fixed="right"
-          width="120px"
+          width="80px"
           align="center"
+          v-if="operateShow == 1"
         >
           <template slot-scope="scope">
             <el-button
@@ -332,22 +344,6 @@
             >
           </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="adverseCloseSaleMaterial(scope.row)"
-              v-if="scope.row.deletedStatus != null"
-              >反关闭分录</el-button
-            >
-          </template>
-        </el-table-column>
       </el-table>
     </div>
     <div class="address">
@@ -526,7 +522,8 @@ export default {
       place1: null,
       //省市县Id
       addressId: null,
-      addressRow: {}
+      addressRow: {},
+      operateShow: 0
     };
   },
   created() {},
@@ -534,6 +531,13 @@ export default {
     this.getSteelReport();
   },
   methods: {
+    rowClick() {
+      if (this.operateShow == 1) {
+        this.operateShow = 0;
+      } else {
+        this.operateShow = 1;
+      }
+    },
     //反关闭整条分录
     adverseCloseSaleMaterial(row) {
       console.log(row.saleMaterialId);
@@ -1221,6 +1225,7 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data;
+          this.operateShow = 0;
           this.getSpanArr(res.data.data);
         });
     },
@@ -1254,6 +1259,7 @@ export default {
         .then(res => {
           this.tableData = res.data.data;
           this.getSpanArr(res.data.data);
+          this.operateShow = 0;
         });
     },
     //控制列自动撑开

+ 515 - 0
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelCarrierReport.vue

@@ -0,0 +1,515 @@
+//钢材统计报表
+<template>
+  <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="请输入查询条件"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <label class="el-form-item__label" style="width: auto;"
+            >订单时间:</label
+          >
+          <el-date-picker
+            v-model="startTime"
+            type="datetime"
+            placeholder="选择日期时间"
+            style="width:200px"
+          >
+          </el-date-picker>
+          <span>至</span>
+          <el-date-picker
+            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>
+          </el-button>
+        </el-form-item>
+        <el-form-item>
+          <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>
+          </el-button>
+        </el-form-item>
+        <el-form-item>
+          <span style="margin-left: 1rem">合计车数:</span>
+          <el-input
+            v-model="totalCapacity"
+            :disabled="true"
+            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
+        style="width: 100%; margin-top: 20px"
+        max-height="700px"
+        :row-style="{ height: '30px' }"
+        :cell-style="{ fontWeight: '700' }"
+      >
+        <el-table-column
+          width="50"
+          label="序号"
+          align="center"
+          fixed="left"
+          :resizable="false"
+        >
+          <template slot-scope="scope">{{ scope.row.group + 1 }}</template>
+        </el-table-column>
+        <el-table-column
+          prop="consigneeName"
+          label="下单客户"
+          width="160px"
+          align="center"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="carrierName"
+          label="承运商"
+          align="center"
+          width="120px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="capacityNo"
+          column-key="capacityNo"
+          label="车牌号"
+          align="center"
+          width="150px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialName"
+          label="物资名称"
+          align="center"
+          width="150px"
+        >
+        </el-table-column>
+        <el-table-column prop="materialSpe" label="物资规格" align="center">
+        </el-table-column>
+        <el-table-column
+          prop="materialNum"
+          label="物资件数"
+          align="center"
+          width="150px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="addressPlace"
+          label="收货地址"
+          width="250px"
+          align="center"
+          show-overflow-tooltip
+        >
+        </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" label="毛重时间" width="130px">
+        </el-table-column>
+        <el-table-column prop="tareWeight" label="皮重"> </el-table-column>
+        <el-table-column prop="tareWeightTime" label="皮重时间" width="130px">
+        </el-table-column>
+        <el-table-column prop="netWeight" label="净重"> </el-table-column>
+        <el-table-column prop="entryGateTime" label="进厂时间" width="130px">
+        </el-table-column>
+        <el-table-column prop="loadTime" label="装货时间" width="130px">
+        </el-table-column>
+        <el-table-column prop="outGateTime" label="出厂时间" width="130px">
+        </el-table-column>
+        <el-table-column
+          prop="arrivalAddress"
+          label="抵达地址"
+          width="300px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="receiptAddress"
+          label="签收地址"
+          width="300px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="orderNo"
+          label="运输订单号"
+          width="180px"
+          align="center"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="capacityTel"
+          label="司机电话"
+          width="250px"
+          align="center"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="shipperName"
+          label="发货单位"
+          width="170px"
+          align="center"
+        >
+        </el-table-column>
+        <el-table-column prop="truckNo" label="车序号"> </el-table-column>
+        <el-table-column prop="consigneeTel" label="收货客户电话" width="120px">
+        </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>
+    </div>
+  </div>
+</template>
+
+<script>
+import { sjTime, isVehicleNumber } from "@/utils/sharedJsFile";
+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,
+      //合计净重
+      totalNumber: 0,
+      //合计车数
+      totalCapacity: 0,
+      tableTitle: "销售统计报表",
+      capacityList: [],
+      carrierList: [],
+      tableData: [],
+      spanArr: [],
+      pos: 0,
+      isCellClick: 0,
+      columnIndexs: [
+        0,
+        1,
+        2,
+        3,
+        7,
+        8,
+        14,
+        16,
+        17,
+        18,
+        19,
+        20,
+        21,
+        22,
+        23,
+        24,
+        25,
+        26,
+        27,
+        29
+      ],
+      //钢材多拼车辆线路ID
+      //索引从1-10为1-10拼路线ID
+      lineSpelling: [
+        0,
+        110001,
+        110002,
+        110003,
+        110004,
+        110005,
+        110006,
+        110007,
+        110008,
+        110009,
+        110010
+      ],
+      tableTitle: "销售钢材统计报表",
+      //所有省
+      provinceList: [],
+      //选中的省
+      province: "",
+      //所有市
+      cityList: [],
+      //选中的市
+      city: "",
+      //所有的县(区)
+      countyList: [],
+      //选中的县
+      county: "",
+      //地址输入框的值
+      addresText: "",
+      //已选中省市县
+      address: null,
+      //具体地址
+      place: null,
+      //暂存具体地址
+      place1: null,
+      //省市县Id
+      addressId: null,
+      addressRow: {}
+    };
+  },
+  created() {},
+  mounted() {
+    this.getSteelReport();
+  },
+  methods: {
+    //销售钢材报表导出excel
+    exportAllReportToExcel() {
+      const loading = this.$loading({
+        lock: true,
+        text: "正在导出Excel",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
+      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);
+    },
+    //车牌号弹出层
+    handleSelect(row, index) {
+      this.capacityList.forEach(item => {
+        if (item.capacityNumber === row.capacityNo) {
+          row.newsCapacityId = item.capacityId;
+        }
+      });
+    },
+    //记录每一行的合并数
+    getSpanArr(data) {
+      //每次调用方法初始化
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.push(1);
+          data[i].group = i;
+          this.pos = 0;
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
+            this.spanArr[this.pos] += 1;
+            data[i].group = data[i - 1].group;
+            this.spanArr.push(0);
+          } else {
+            this.spanArr.push(1);
+            this.pos = i;
+            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 }) {
+      if (this.columnIndexs.indexOf(columnIndex) != -1) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    //查询,输入查询条件
+    onclick() {
+      let startTime = null;
+      let endTime = null;
+      let carrierSsoId = null;
+      let carrierName = null;
+      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);
+      }
+      if (getCookie("orgCode") == "chengyunshang") {
+        carrierSsoId = getCookie("userId");
+      }
+      if (getCookie("orgCode") == "xiaoshouyewuyuan") {
+        saler = getCookie("loginName");
+      }
+      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=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&carrierSsoId=" +
+            carrierSsoId +
+            "&i=" +
+            new Date() +
+            "&remark=" +
+            remark +
+            "&consigneeName=" +
+            consigneeName +
+            "&carrierName=" +
+            carrierName +
+            "&capacityNo=" +
+            capacityNo +
+            "&saler=" +
+            saler
+        )
+        .then(res => {
+          this.tableData = res.data.data;
+          this.getSpanArr(res.data.data);
+        });
+    },
+    //重新获取表格数据
+    refresh() {
+      this.getSteelReport();
+    },
+    //获取钢材统计报表
+    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=" +
+            null +
+            "&endTime=" +
+            null +
+            "&carrierSsoId=" +
+            carrierSsoId +
+            "&saler=" +
+            saler +
+            "&i=" +
+            new Date()
+        )
+        .then(res => {
+          this.tableData = res.data.data;
+          this.getSpanArr(res.data.data);
+        });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.purchasFuelNewMonitor {
+  .tableTop {
+    margin-left: 20px;
+    margin-top: 20px;
+  }
+  .table {
+    margin-left: 20px;
+    margin-top: 20px;
+    ::-webkit-scrollbar {
+      // width: 20px;
+      height: 30px;
+      background-color: transparent;
+    }
+  }
+  .address {
+    .button-box {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+    }
+  }
+}
+</style>

+ 9 - 0
src/views/statisticalReport/router/index.js

@@ -35,6 +35,7 @@ import saleSteelAllReport from "../components/salesLogisticsStatistics/saleSteel
 import loadWagonWorkReport from "../components/wanzhouReport/loadWagonWorkReport.vue";
 import unloadShipWorkReport from "../components/wanzhouReport/unloadShipWorkReport.vue";
 import wagonWorkReport from "../components/wanzhouReport/wagonWorkReport.vue";
+import saleSteelCarrierReport from "@/views/statisticalReport/components/salesLogisticsStatistics/saleSteelCarrierReport";
 Vue.use(Router);
 
 const constantRouterMap = [
@@ -226,6 +227,14 @@ const constantRouterMap = [
           code: "xtpzgl-yhgl"
         },
         component: wagonWorkReport
+      },
+      {
+        path: "saleSteelCarrierReport",
+        name: "saleSteelCarrierReport",
+        meta: {
+          code: "xtpzgl-yhgl"
+        },
+        component: saleSteelCarrierReport
       }
     ]
   }