Browse Source

修改进口矿

zx 2 years ago
parent
commit
527eb154e4

+ 1 - 12
build/utils.js

@@ -15,18 +15,7 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 // ['index','appoint','configManager','homepage',''inward,'queue','RMS','sale','serviceManager','SporadicManage'
 // ['index','appoint','configManager','homepage',''inward,'queue','RMS','sale','serviceManager','SporadicManage'
 //       统计报表       组织机构/系统管理 采购  仓储
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
-
-// let devModules = ['index','inward']
-
-// let devModules = ['index','TMS']
-// let devModules = ["index", "appoint", "sale", "statisticalReport"];
-
-// let devModules = ["index", "statisticalReport", "inward", "TMS", "appoint"];
-
-// let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
-let devModules = ["index",'TMS','appoint','statisticalReport'];
-// let devModules = ['index','TMS']
-
+let devModules = ['all'];
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
 // let devModules = ["index", "ADMINISTRATORS", "RMS"];
 // let devModules = ["index", "ADMINISTRATORS", "RMS"];
 // let devModules = ["index", "inward", "statisticalReport"];
 // let devModules = ["index", "inward", "statisticalReport"];

+ 3 - 3
config/index.js

@@ -65,15 +65,15 @@ let proxyTable = {
   },
   },
   // 所有数据的请求域名地址
   // 所有数据的请求域名地址
   "/api/v1": {
   "/api/v1": {
-    target: "http://172.16.33.162:80",
-    // target: "http://localhost:8080",
+    //target: "http://172.16.33.162:80",
+     target: "http://172.16.33.166:80",
     ws: true,
     ws: true,
     pathRewrite: {
     pathRewrite: {
       "^/api/v1": "/api/v1"
       "^/api/v1": "/api/v1"
     }
     }
   },
   },
   "/views/api/v1": {
   "/views/api/v1": {
-    target: "http://172.16.33.162:80",
+    target: "http://172.16.33.166:80",
     // target: "http://192.168.1.109:8080",
     // target: "http://192.168.1.109:8080",
     ws: true,
     ws: true,
     pathRewrite: {
     pathRewrite: {

+ 33 - 92
src/views/TMS/components/domesticMine/wagonLoadAdd.vue

@@ -14,22 +14,7 @@
           <el-button  type="primary">导入</el-button>
           <el-button  type="primary">导入</el-button>
       </el-upload>
       </el-upload>
       <span >当前导入数量:{{tableData.length}}</span>
       <span >当前导入数量:{{tableData.length}}</span>
-      <!-- <el-input
-        placeholder="请输入内容"
-        v-model="input"
-        @change="onchang"
-        clearable
-      >
-      </el-input> -->
     </div>
     </div>
-    <!-- <div class="cpList">
-      <div class="list">
-        <div class="cpList1" v-for="(item, i) in list" :key="i">
-          {{ item }}
-          <i class="el-icon-close itu" @click="onclick(i)"></i>
-        </div>
-      </div>
-    </div> -->
     <div class="table item">
     <div class="table item">
       <el-table
       <el-table
         stripe
         stripe
@@ -185,7 +170,7 @@
 
 
     <div class="button_box">
     <div class="button_box">
       <el-button @click="cancel">取消</el-button>
       <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="makeSure">确定</el-button>
+      <el-button type="primary" :disabled="disable"  @click="makeSure">确定</el-button>
     </div>
     </div>
     <!-- 模态窗口 -->
     <!-- 模态窗口 -->
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
@@ -232,6 +217,7 @@ export default {
   components: { PageTitle },
   components: { PageTitle },
   data() {
   data() {
     return {
     return {
+      disable:true,
       file:null,
       file:null,
       list: [],
       list: [],
       form1: {},
       form1: {},
@@ -501,6 +487,7 @@ export default {
     },
     },
     // 确定
     // 确定
     makeSure() {
     makeSure() {
+      this.disable=true;
       let that=this;
       let that=this;
       if (this.tableData.length <= 0  || !this.toTheStationId || this.form1.resultLoadingDate){
       if (this.tableData.length <= 0  || !this.toTheStationId || this.form1.resultLoadingDate){
         if (this.tableData.length <= 0) {
         if (this.tableData.length <= 0) {
@@ -509,6 +496,7 @@ export default {
             message: "请导入数据!",
             message: "请导入数据!",
           });
           });
         } else {
         } else {
+            this.disable=false;
             if (this.toTheStationId) {
             if (this.toTheStationId) {
               if (this.form1.resultLoadingDate) {
               if (this.form1.resultLoadingDate) {
               } else {
               } else {
@@ -527,10 +515,10 @@ export default {
       }
       }
       //绑定通用字段
       //绑定通用字段
       this.tableData.forEach((row)=>{
       this.tableData.forEach((row)=>{
-        row.resultType=3;
-        row.resultLoadingDate=sjTime(that.form1.resultLoadingDate);
-        row.arrivalStationId=that.form1.arrivalStationId;
-        row.resultRemarks=that.form1.resultRemarks;
+        row.resultType=3;//装车类型为国产矿
+        row.arrivalStationId=that.form1.arrivalStationId;//到站id,默认老区轨道衡
+        row.resultLoadingDate=sjTime(that.form1.resultLoadingDate);//装车日期
+        row.resultRemarks=that.form1.resultRemarks;//备注
       })
       })
       console.log(that.tableData);
       console.log(that.tableData);
       //请求添加
       //请求添加
@@ -552,27 +540,32 @@ export default {
       this.$router.push("/wagonLoadMine");
       this.$router.push("/wagonLoadMine");
     },
     },
     // 导入excel
     // 导入excel
-    async importExcel(file) {
+    importExcel(file) {
       let that=this;
       let that=this;
       if (!file) {
       if (!file) {
-        alert('文件错误,请重新选择');
+        that.$message({
+          message: "文件错误!",
+          type: "warning",
+        });
         return
         return
         }
         }
         var reader = new FileReader();
         var reader = new FileReader();
         var data=null;
         var data=null;
         var workbook=null;
         var workbook=null;
         //设置读取操作
         //设置读取操作
-        reader.onload =async function (e) {
+        reader.onload = function (e) {
           console.log(e);
           console.log(e);
           data = e.target.result;
           data = e.target.result;
           workbook= XLSX.read(data, {
           workbook= XLSX.read(data, {
               type: 'binary'
               type: 'binary'
           });
           });
+          console.log(workbook);
           //读取表格
           //读取表格
           let rows= XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);//只取第一页
           let rows= XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);//只取第一页
           console.log(rows);
           console.log(rows);
           //清空
           //清空
           if(rows.length>0){
           if(rows.length>0){
+            that.disable=false;
             that.tableData=[];
             that.tableData=[];
             if((typeof rows[0]['车号'])=='undefined'){
             if((typeof rows[0]['车号'])=='undefined'){
               that.$message({
               that.$message({
@@ -583,81 +576,29 @@ export default {
             }
             }
           }
           }
           //绑定数据
           //绑定数据
-          rows.forEach(async (row,index) => {
+          rows.forEach((row,index) => {
             let carNumber=row['车号'];
             let carNumber=row['车号'];
-            if((typeof carNumber)!="undefined" && carNumber.length > 6){
-            //查询数据库中的对于物资和发货单位
-            let materialName=row['品  名'];
-            let supplierName=row['发货单位'];
-            let material;
-            let supplier;
-            if((typeof material)=="undefined" || material==null){
-                await that.axios.post("/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
-                    materialName).then((res)=>{
-                      if(res.data.code == "200" && res.data.data &&res.data.data.list.length > 0 ) {
-                        //赋值
-                        material={
-                            materialId:res.data.data.list[0].materialId,
-                            materialName:res.data.data.list[0].materialName
-                        };
-                      }else{
-                        this.$message.error("绑定品名失败,请检查数据!");
-                        material=null;
-                      }
-                });
-            }
-            if((typeof supplier)=="undefined" || supplier==null){
-                //绑定发货单位id
-                await that.axios.post("/api/v1/uc/getSupplierMesByMaterialId?apiId=247&index=" +
-                    supplierName).then((res)=>{
-                      if(res.data.code == "200" && res.data.data &&res.data.data.list.length > 0 ) {
-                        //赋值
-                        supplier={
-                          supplierId:res.data.data.list[0].supplierId,
-                          supplierName:res.data.data.list[0].supplierName
-                        }
-                      }else{
-                        supplier=null;
-                        this.$message.error("绑定发货单位失败,请检查数据!");
-                      }
-                });
+            if((typeof carNumber)!="undefined" && carNumber.length == 7){
+              //表格数据
+              let temp={
+                number:row['序号'],
+                materialName:row['品  名'],
+                supplierName:row['发货单位'],
+                sendDate:row['发货日期'],
+                sendStation:row['发站'],
+                arrivalStation:row['到站'],
+                wagonNo:row['车号'],
+                weight:row['标重']
+              }
+              that.tableData.push(temp);
             }
             }
-            //表格数据
-            let temp={
-              number:row['序号'],
-              materialId:material.materialId,
-              materialName:material.materialName,
-              sendUnitId:supplier.supplierId,
-              supplierName:supplier.supplierName,
-              sendDate:row['发货日期'],
-              sendStation:row['发站'],
-              arrivalStation:row['到站'],
-              wagonNo:row['车号'],
-              weight:row['标重']
+            else{
+              console.log("车号"+carNumber+"不是7位数!");
             }
             }
-            that.tableData.push(temp);
-          }
-          else
-            console.log("车号"+carNumber+"不符合格式");
         });
         });
         };
         };
         reader.readAsBinaryString(file.raw); //以二进制方式读取
         reader.readAsBinaryString(file.raw); //以二进制方式读取
-    },
-    indexOfMaterial(materialName,materials){
-      materials.forEach((item,index)=>{
-        console.log(item);
-          if(item.materialName==materialName)
-            return index;
-      });
-      return -1;
-    },
-    indexOfSupplier(supplierName,suppliers){
-      suppliers.forEach((item,index)=>{
-          if(item.supplierName==supplierName)
-            return index;
-      });
-      return -1;
-    },
+    }
   },
   },
 };
 };
 </script>
 </script>

+ 10 - 56
src/views/TMS/components/domesticMine/wagonLoadbu.vue

@@ -1,40 +1,6 @@
 <template>
 <template>
   <div class="wagonLoadbu">
   <div class="wagonLoadbu">
     <page-title>返回</page-title>
     <page-title>返回</page-title>
-    <!-- <div class="top">
-      <div class="text">物资:</div>
-      <el-select
-        v-model="materialId"
-        filterable
-        remote
-        reserve-keyword
-        placeholder="选择物资名"
-        :remote-method="searchMaterialName"
-        @change="searchSupplierName();getPurchaseOrderNo()">
-        <el-option
-          v-for="item in materialNames"
-          :key="item.materialId"
-          :label="item.materialName"
-          :value="item.materialId">
-        </el-option>
-      </el-select>
-      <div class="text">发货单位:</div>
-       <el-select
-        v-model="supplierId"
-        filterable
-        remote
-        reserve-keyword
-        placeholder="选择发货单位"
-        :remote-method="searchSupplierName"
-        @change="getPurchaseOrderNo();supplierIdChange()">
-        <el-option
-          v-for="item in supplierNames"
-          :key="item.supplierId"
-          :label="item.supplierName"
-          :value="item.supplierId">
-        </el-option>
-      </el-select>
-    </div> -->
      <div class="purchaseOrder_table">
      <div class="purchaseOrder_table">
       <div class="search" style="display:flex">
       <div class="search" style="display:flex">
         <div style="margin-top: 18px;margin-left:10px">
         <div style="margin-top: 18px;margin-left:10px">
@@ -68,14 +34,13 @@
       @click="makeSure" 
       @click="makeSure" 
       style="margin: 10px;">确认配单
       style="margin: 10px;">确认配单
       </el-button>
       </el-button>
-
       </div>
       </div>
+      <!-- 采购订单号 -->
       <dilTable
       <dilTable
         v-bind.sync="purchaseOption"
         v-bind.sync="purchaseOption"
         @radio-change="orderChange"
         @radio-change="orderChange"
       ></dilTable>
       ></dilTable>
-    </div>
-
+      </div>
     <!-- <div class="material form">
     <!-- <div class="material form">
       <span class="text">物资:</span>
       <span class="text">物资:</span>
       <el-input v-model="materialName" disabled> </el-input>
       <el-input v-model="materialName" disabled> </el-input>
@@ -97,12 +62,12 @@
       <el-input v-model="remark" @blur="onBlur" > </el-input>
       <el-input v-model="remark" @blur="onBlur" > </el-input>
       <span class="span"></span>
       <span class="span"></span>
     </div>
     </div>
-
     <div class="form">
     <div class="form">
       <div class="form_box">  
       <div class="form_box">  
       <dil-form :formId="361" v-model="form1" ref="from1"></dil-form>
       <dil-form :formId="361" v-model="form1" ref="from1"></dil-form>
       </div>
       </div>
     </div> -->
     </div> -->
+    <!--待补录表格-->
     <div class="wagonLoadbu_table">
     <div class="wagonLoadbu_table">
       <dilTable
       <dilTable
         v-bind.sync="option"
         v-bind.sync="option"
@@ -111,10 +76,8 @@
       ></dilTable>
       ></dilTable>
     </div>
     </div>
     
     
-    
-   
     <!-- 模态窗口 -->
     <!-- 模态窗口 -->
-    <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
+    <!-- <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
       <el-input
       <el-input
         placeholder="请输入内容"
         placeholder="请输入内容"
         v-model="inputText"
         v-model="inputText"
@@ -147,7 +110,7 @@
           @radio-change="currentRadioChange3"
           @radio-change="currentRadioChange3"
         ></dilTable>
         ></dilTable>
       </div>
       </div>
-    </el-drawer>
+    </el-drawer> -->
   </div>
   </div>
 </template>
 </template>
 
 
@@ -239,8 +202,7 @@ export default {
       else{
       else{
         let map = {
         let map = {
           resultIdList:this.selecTionListMap,
           resultIdList:this.selecTionListMap,
-          purchaseOrderId:this.purchaseOrderId,
-          insertUpdateRemark: this.form1.insertUpdateRemark
+          purchaseOrderId:this.purchaseOrderId
         }
         }
         let that=this;
         let that=this;
         this.axios.post('/api/v1/tms/updateDomesticLoadResult',map).then((res)=>{
         this.axios.post('/api/v1/tms/updateDomesticLoadResult',map).then((res)=>{
@@ -250,8 +212,7 @@ export default {
               message: "配单成功!",
               message: "配单成功!",
               type: "success",
               type: "success",
             });
             });
-            that.purchaseOption.requestUrl += "&i="+new Date();
-            console.log();
+            that.tableChange();
             // this.cancel();//不退出
             // this.cancel();//不退出
           }
           }
         })
         })
@@ -272,7 +233,6 @@ export default {
       this.supplierId=selection.supplierId;
       this.supplierId=selection.supplierId;
       this.supplierName=selection.supplierName;
       this.supplierName=selection.supplierName;
       this.remark=selection.resultForeignShipName;
       this.remark=selection.resultForeignShipName;
-      this.tableChange();
     },
     },
     //表格选中
     //表格选中
     selectionChange(selection) {
     selectionChange(selection) {
@@ -287,13 +247,11 @@ export default {
       this.materialName = selection.materialName;
       this.materialName = selection.materialName;
       this.materialId = selection.materialId;
       this.materialId = selection.materialId;
       this.getPurchaseOrderNo();
       this.getPurchaseOrderNo();
-      this.tableChange();
     },
     },
     currentRadioChange2(selection) {
     currentRadioChange2(selection) {
       this.supplierName = selection.supplierName;
       this.supplierName = selection.supplierName;
       this.supplierId = selection.supplierId;
       this.supplierId = selection.supplierId;
       this.getPurchaseOrderNo();
       this.getPurchaseOrderNo();
-      this.tableChange();
     },
     },
     currentRadioChange3(selection) {
     currentRadioChange3(selection) {
       this.unloadPointId = selection.warehouseId;
       this.unloadPointId = selection.warehouseId;
@@ -342,6 +300,7 @@ export default {
       }
       }
     },
     },
     searchOrder(){
     searchOrder(){
+      //查询订单
       if((typeof this.search1)!="undefined" && (typeof this.search2)!='undefined'){
       if((typeof this.search1)!="undefined" && (typeof this.search2)!='undefined'){
         let requestUrl="/api/v1/tms/findPurchaseOrderList?apiId=81";
         let requestUrl="/api/v1/tms/findPurchaseOrderList?apiId=81";
         if(this.search1!=null){
         if(this.search1!=null){
@@ -398,13 +357,8 @@ export default {
       });
       });
     },
     },
     tableChange(){
     tableChange(){
-      //重新查询配单车辆
-      if(typeof this.materialId !='undefined'&& this.materialId!=null && typeof this.supplierId!='undefined' && this.supplierId!=null){
-         this.option.requestUrl=
-          "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10&materialId="
-          +this.materialId+"&supplierId="
-          +this.supplierId;
-      }
+      //刷新表格
+      this.option.requestUrl="/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10&i="+new Date();
     }
     }
   },
   },
 };
 };

+ 331 - 121
src/views/TMS/components/importedEmergency/addWagonLoadEmergency.vue

@@ -1,10 +1,122 @@
 <template>
 <template>
   <!-- 添加车皮装车实绩 -->
   <!-- 添加车皮装车实绩 -->
   <div class="addWagonLoad">
   <div class="addWagonLoad">
-    <page-title>新增</page-title>
- 
+    <page-title>返回</page-title>
+    <div class="purchaseOrder_table">
+      <div class="search" style="display:flex">
+        <div style="margin-top: 18px;margin-left:10px">
+          <el-label>物资名或订单号:</el-label>
+        </div>
+        <el-input
+        placeholder="请输入"
+        v-model="search1"
+        style="margin: 10px; width:10%"
+        clearable
+        ></el-input>
+        <div style="margin-top: 18px;margin-left:10px">
+          <el-label>外轮船名:</el-label>
+        </div>
+        <el-input
+          placeholder="请输入"
+          v-model="search2"
+          style="margin: 10px;width:10%"
+          clearable
+        ></el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="searchOrder()"
+        style="margin: 10px;">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button 
+      type="primary"
+      class="btn" 
+      @click="makeSure" 
+      style="margin: 10px;">确认配单
+      </el-button> -->
+      </div>
+      <!-- 采购订单号 -->
+      <dilTable
+        v-bind.sync="purchaseOption"
+        @radio-change="orderChange"
+      ></dilTable>
+    </div>
     <div class="cp">
     <div class="cp">
-      <span style="width:80px">车皮号:</span>
+      <span >车皮号:</span>
+      <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">导入</el-button>
+      </el-upload>
+      <span >当前导入数量:{{tableData.length}}</span>
+    </div>
+    <div class="table item"
+        style="width:680px;
+        height:300px;
+        float:left;
+        overflow:auto" >
+      <el-table
+        stripe
+        :data="tableData"
+        style="width: 100%">
+        <el-table-column
+        type="index"
+        width="50"
+        prop="number"
+        label="序号"
+        align="center"
+        fixed="left"
+        :resizable="false">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="makeDate"
+          label="制票日期"
+          width="120px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="wagonNo"
+          label="车号"
+          width="120px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="materialName"
+          label="物资"
+          width="180px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="mineral"
+          label="矿种"
+          width="120px">
+        </el-table-column>
+         <el-table-column
+         align="center"
+        width="80px"
+          prop="weight"
+          label="标重">
+        </el-table-column>
+        <!-- <el-table-column
+        align="center"
+        width="100px"
+          fixed="right"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
+            <el-button type="text" size="small">编辑</el-button>
+          </template>
+        </el-table-column> -->
+      </el-table>
+    </div>
+    <!-- <div class="cp">
+      <span style="width:80px">车皮号:</span>
       <el-input
       <el-input
         placeholder="请输入内容"
         placeholder="请输入内容"
         v-model="input"
         v-model="input"
@@ -42,51 +154,53 @@
       <span class="text">卸货点:</span>
       <span class="text">卸货点:</span>
       <el-input v-model="unloadPointName" disabled> </el-input>
       <el-input v-model="unloadPointName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
       <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
+    </div> -->
+    <div class="right" 
+    style="margin-top:10px
+           float:right;">
+        <div class="form">
+          <div class="form_box" style="margin-right: 10rem">
+            <el-form>
+               <div class="preview-group">
+                  <el-form-item label="发站:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="sendStation"
+                      :fetch-suggestions="querySearchSendStation"
+                      placeholder="请输入发站名称"
+                      :trigger-on-focus="false"
+                      @select="handleSelectSendStation"
+                    >
+                      <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="102" v-model="form1" ref="from1"></dil-form>
+          </div>
+        </div>
+        <div class="button-box">
+          <el-button @click="cancel">取消</el-button>
+          <el-button type="primary" :disabled="disable" @click="makeSure">确定</el-button>
+        </div>
     </div>
     </div>
-    <div class="fromOther">
-      <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
-        <el-form-item label="发站:">
-          <el-autocomplete
-            class="inline-input"
-            v-model="sendStation"
-            :fetch-suggestions="querySearchSendStation"
-            placeholder="请输入发站名称"
-            :trigger-on-focus="false"
-            @select="handleSelectSendStation"
-          >
-            <template slot-scope="{ item }">
-              <div class="name">{{ item.arrivalName }}</div>
-            </template>
-          </el-autocomplete>
-        </el-form-item>
-      </el-form>
-      <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
-        <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>
-    </div>
-    <div class="form">
-      <div class="form_box" style="margin-right: 10rem">
-        <dil-form :formId="254" v-model="form1" ref="from1"></dil-form>
-      </div>
-    </div>
-    <div class="button-box">
-      <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="makeSure">确定</el-button>
-    </div>
-
+    
     <!-- 模态窗口 -->
     <!-- 模态窗口 -->
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
       <el-input
       <el-input
@@ -127,13 +241,15 @@
 
 
 <script>
 <script>
 import PageTitle from "@/components/Page/Title";
 import PageTitle from "@/components/Page/Title";
-import { sjTime,isNumber } from "@/utils/sharedJsFile";
+import { sjTime } from "@/utils/sharedJsFile";
 export default {
 export default {
   components: { PageTitle },
   components: { PageTitle },
   data() {
   data() {
     return {
     return {
+      disable:true,
       list: [],
       list: [],
       form1: {},
       form1: {},
+      tableData:[],
       input: "",
       input: "",
       value: undefined,
       value: undefined,
       //船名
       //船名
@@ -154,9 +270,19 @@ export default {
       unloadPointId: null,
       unloadPointId: null,
       //卸货点名称
       //卸货点名称
       unloadPointName: null,
       unloadPointName: null,
+      //查询
+      search1:null,
+      search2:null,
       a: 1,
       a: 1,
       direction: "rtl",
       direction: "rtl",
       inputText: "",
       inputText: "",
+      purchaseOption:{
+         // 表格请求数据的地址
+        requestUrl: "/api/v1/tms/findPurchaseOrderList?apiId=81",
+        // 控制选择单列
+        selectionType: "radio",
+        pageSize:5,
+      },
       frist: {
       frist: {
         requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
         requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
         selectionType: "radio",
         selectionType: "radio",
@@ -172,17 +298,12 @@ export default {
         requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
         requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
         selectionType: "radio",
         selectionType: "radio",
       },
       },
-      sendStationId:null,
+      sendStationId:2,
       toTheStationId:1,
       toTheStationId:1,
-      sendStation:null,
+      sendStation:"万州港",
       toTheStation:"老区轨道衡"
       toTheStation:"老区轨道衡"
     };
     };
   },
   },
-  created(){
-    this.form1 = {
-      arrivalStationId:1,
-    }
-  },
   methods: {
   methods: {
     currentRadioChange1(selection) {
     currentRadioChange1(selection) {
       this.input = null;
       this.input = null;
@@ -257,50 +378,6 @@ export default {
           "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.inputText;
           "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.inputText;
       }
       }
     },
     },
-    onchang() {
-      var state = false;
-      var cptop = this.input.substring(0, 2);
-      var cptop1 = this.input.substring(0, 3);
-      if (
-        cptop == "45" ||
-        cptop == "46" ||
-        cptop == "42" ||
-        cptop == "47" ||
-        cptop == "15" ||
-        cptop == "16" ||
-        cptop == "17" ||
-        cptop == "18"
-      ) {
-        state = true;
-      } else if (
-        cptop1 == "140" ||
-        cptop1 == "141" ||
-        cptop1 == "142" ||
-        cptop1 == "143" ||
-        cptop1 == "145"
-      ) {
-        state = true;
-      } else {
-        this.$message({
-          type: "warning",
-          message: "车皮号格式不对,请重新输入!",
-        });
-      }
-      if (state) {
-        if (this.input.length == 7) {
-          this.list.push(this.input);
-          this.input = "";
-        } else {
-          this.$message({
-            type: "warning",
-            message: "车皮号长度不足7位数,请重新输入!",
-          });
-        }
-      }
-    },
-    onclick(index) {
-      this.list.splice(index, 1);
-    },
     //发站弹出层
     //发站弹出层
     handleSelectSendStation(item) {
     handleSelectSendStation(item) {
       this.sendStationId = item.arrivalId;
       this.sendStationId = item.arrivalId;
@@ -367,21 +444,84 @@ export default {
         );
         );
       };
       };
     },
     },
+    onchang() {
+      var state = false;
+      var cptop = this.input.substring(0, 2);
+      var cptop1 = this.input.substring(0, 3);
+      if (
+        cptop == "45" ||
+        cptop == "46" ||
+        cptop == "42" ||
+        cptop == "47" ||
+        cptop == "15" ||
+        cptop == "16" ||
+        cptop == "17" ||
+        cptop == "18"
+      ) {
+        state = true;
+      } else if (
+        cptop1 == "140" ||
+        cptop1 == "141" ||
+        cptop1 == "142" ||
+        cptop1 == "143" ||
+        cptop1 == "145"
+      ) {
+        state = true;
+      } else {
+        this.$message({
+          type: "warning",
+          message: "车皮号格式不对,请重新输入!",
+        });
+      }
+      if (state) {
+        if (this.input.length == 7) {
+          this.list.push(this.input);
+          this.input = "";
+        } else {
+          this.$message({
+            type: "warning",
+            message: "车皮号长度不足7位数,请重新输入!",
+          });
+        }
+      }
+    },
+    searchOrder(){
+      //查询订单
+      if((typeof this.search1)!="undefined" && (typeof this.search2)!='undefined'){
+        let requestUrl="/api/v1/tms/findPurchaseOrderList?apiId=81";
+        if(this.search1!=null){
+            requestUrl+=("&materialName="+this.search1);
+        }
+        if(this.search2!=null){
+            requestUrl+=("&resultForeignShipName="+this.search2);
+        }
+        this.purchaseOption.requestUrl=requestUrl;
+      }else{
+        this.purchaseOption.requestUrl=
+        "/api/v1/tms/findPurchaseOrderList?apiId=81"
+      }
+    },
+    onclick(index) {
+      this.list.splice(index, 1);
+    },
     // 确定
     // 确定
     makeSure() {
     makeSure() {
+      this.disable=true;
       let state = 0;
       let state = 0;
       if (
       if (
         this.list.length > 0 &&
         this.list.length > 0 &&
         this.materialId &&
         this.materialId &&
         this.supplierId &&
         this.supplierId &&
-        this.unloadPointId &&
         this.purchaseOrderId &&
         this.purchaseOrderId &&
+        this.form1.resultIsclear &&
+        this.form1.resultClass &&
         this.sendStationId &&
         this.sendStationId &&
         this.toTheStationId &&
         this.toTheStationId &&
         this.form1.resultLoadingDate
         this.form1.resultLoadingDate
       ) {
       ) {
         state = 1;
         state = 1;
       } else {
       } else {
+        this.disable=false;
         console.log(this.list.length);
         console.log(this.list.length);
         if (this.list.length == 0) {
         if (this.list.length == 0) {
           this.$message({
           this.$message({
@@ -390,9 +530,9 @@ export default {
           });
           });
         } else {
         } else {
           if (this.materialId) {
           if (this.materialId) {
-            if (this.supplierId) {
-              if (this.unloadPointId) {
                 if (this.purchaseOrderId) {
                 if (this.purchaseOrderId) {
+                  if (this.form1.resultIsclear) {
+                    if (this.form1.resultClass) {
                       if (this.sendStationId) {
                       if (this.sendStationId) {
                         if (this.toTheStationId) {
                         if (this.toTheStationId) {
                           if (this.form1.resultLoadingDate) {
                           if (this.form1.resultLoadingDate) {
@@ -415,24 +555,24 @@ export default {
                         });
                         });
                       }
                       }
                     } else {
                     } else {
+                      this.$message({
+                        type: "warning",
+                        message: "请选择班别!",
+                      });
+                    }
+                  } else {
+                    this.$message({
+                      type: "warning",
+                      message: "请选择是否清场!",
+                    });
+                  }
+                } else {
                   this.$message({
                   this.$message({
                     type: "warning",
                     type: "warning",
                     message: "该物资没有采购订单号!",
                     message: "该物资没有采购订单号!",
                   });
                   });
                 }
                 }
-              } else {
-                this.$message({
-                  type: "warning",
-                  message: "请选择卸货地点!",
-                });
-              }
-            } else {
-              this.$message({
-                type: "warning",
-                message: "请选择发货单位!",
-              });
-            }
-          } else {
+            }  else {
             this.$message({
             this.$message({
               type: "warning",
               type: "warning",
               message: "请选择物资!",
               message: "请选择物资!",
@@ -443,7 +583,7 @@ export default {
       if(state == 1){
       if(state == 1){
         let map = {
         let map = {
           wagonNoList:this.list,
           wagonNoList:this.list,
-          unloadingPointId:this.unloadPointId,
+          // unloadingPointId:this.unloadPointId,
           purchaseOrderRailPlanId:this.purchaseOrderId,
           purchaseOrderRailPlanId:this.purchaseOrderId,
           materialId:this.materialId,
           materialId:this.materialId,
           sendUnitId:this.supplierId,
           sendUnitId:this.supplierId,
@@ -455,6 +595,7 @@ export default {
           resultRemarks: this.form1.resultRemarks,
           resultRemarks: this.form1.resultRemarks,
           resultType:2,
           resultType:2,
         }
         }
+        console.log(map);
         this.axios.post('/api/v1/tms/insertTmstrainLoadingResult',map).then((res)=>{
         this.axios.post('/api/v1/tms/insertTmstrainLoadingResult',map).then((res)=>{
           console.log(res);
           console.log(res);
           if(res.data.code == "200"){
           if(res.data.code == "200"){
@@ -462,7 +603,7 @@ export default {
               type: "success",
               type: "success",
               message: "新增成功",
               message: "新增成功",
             });
             });
-            this.$router.go(-1);
+            this.cancel();
           }
           }
         })
         })
       }
       }
@@ -471,6 +612,77 @@ export default {
     cancel() {
     cancel() {
       this.$router.go(-1);
       this.$router.go(-1);
     },
     },
+    // 导入excel
+    importExcel(file) {
+      let that=this;
+      if (!file) {
+        that.$message({
+          message: "文件错误!",
+          type: "warning",
+        });
+        return
+        }
+        var reader = new FileReader();
+        var data=null;
+        var workbook=null;
+        //设置读取操作
+        reader.onload = function (e) {
+          console.log(e);
+          data = e.target.result;
+          workbook= XLSX.read(data, {
+              type: 'binary'
+          });
+          console.log(workbook);
+          //读取表格
+          let rows= XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);//只取第一页
+          console.log(rows);
+          //清空
+          if(rows.length>0){
+            that.list=[];
+            that.tableData=[];
+            that.disable=false;
+            if((typeof rows[0]['车皮号'])=='undefined'){
+              that.$message({
+                message: "导入Excel格式错误!",
+                type: "warning",
+              });
+              return;
+            }
+          }
+          //绑定数据
+          rows.forEach((row,index) => {
+            let carNumber=row['车皮号'];
+            if((typeof carNumber)!="undefined" && carNumber.length == 7){
+              //车号表
+              that.list.push(carNumber);
+              //表格数据
+              let temp={
+                number:row['序号'],
+                makeDate:row['制票日期'],
+                materialName:row['品名'],
+                wagonNo:row['车皮号'],
+                mineral:row['矿种'],
+                weight:row['计费&#10;吨位']
+              }
+              that.tableData.push(temp);
+            }
+            else{
+              console.log("车号"+carNumber+"不是7位数!");
+            }
+        });
+        };
+        reader.readAsBinaryString(file.raw); //以二进制方式读取
+    },
+    //采购订单表格选中
+    orderChange(selection){
+      console.log(selection);
+      this.purchaseOrderId=selection.purchaseOrderId;
+      this.form1 = { purchaseOrderNo: selection.purchaseOrderNo };
+      this.materialId=selection.materialId;
+      this.materialName=selection.materialName;
+      this.supplierId=selection.supplierId;
+      this.supplierName=selection.supplierName;
+    },
   },
   },
 };
 };
 </script>
 </script>
@@ -597,7 +809,6 @@ export default {
     .form_box {
     .form_box {
       width: 340px;
       width: 340px;
       margin-left: 37%;
       margin-left: 37%;
-     
       margin-right: 20px;
       margin-right: 20px;
       .el-form {
       .el-form {
         .preview-group {
         .preview-group {
@@ -615,8 +826,7 @@ export default {
               }
               }
               .el-textarea{
               .el-textarea{
                 .el-textarea__inner{
                 .el-textarea__inner{
-                  width: 220px;
-                
+                  width: 225px;     
                   margin-top: 0.03rem;
                   margin-top: 0.03rem;
                 }
                 }
               }
               }
@@ -631,7 +841,7 @@ export default {
     justify-content: center;
     justify-content: center;
     padding-top: 30px;
     padding-top: 30px;
   }
   }
-  .fromOther .el-input__inner{
+  .formOther  .el-input__inner{
     width: 250px;
     width: 250px;
   }
   }
 }
 }

+ 269 - 66
src/views/TMS/components/importedMine/addWagonLoad.vue

@@ -1,8 +1,121 @@
 <template>
 <template>
   <!-- 添加车皮装车实绩 -->
   <!-- 添加车皮装车实绩 -->
   <div class="addWagonLoad">
   <div class="addWagonLoad">
-    <page-title>新增</page-title>
+    <page-title>返回</page-title>
+    <div class="purchaseOrder_table">
+      <div class="search" style="display:flex">
+        <div style="margin-top: 18px;margin-left:10px">
+          <el-label>物资名或订单号:</el-label>
+        </div>
+        <el-input
+        placeholder="请输入"
+        v-model="search1"
+        style="margin: 10px; width:10%"
+        clearable
+        ></el-input>
+        <div style="margin-top: 18px;margin-left:10px">
+          <el-label>外轮船名:</el-label>
+        </div>
+        <el-input
+          placeholder="请输入"
+          v-model="search2"
+          style="margin: 10px;width:10%"
+          clearable
+        ></el-input>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="searchOrder()"
+        style="margin: 10px;">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <!-- <el-button 
+      type="primary"
+      class="btn" 
+      @click="makeSure" 
+      style="margin: 10px;">确认配单
+      </el-button> -->
+      </div>
+      <!-- 采购订单号 -->
+      <dilTable
+        v-bind.sync="purchaseOption"
+        @radio-change="orderChange"
+      ></dilTable>
+    </div>
     <div class="cp">
     <div class="cp">
+      <span >车皮号:</span>
+      <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">导入</el-button>
+      </el-upload>
+      <span >当前导入数量:{{tableData.length}}</span>
+    </div>
+    <div class="table item"
+        style="width:680px;
+        height:300px;
+        float:left;
+        overflow:auto" >
+      <el-table
+        stripe
+        :data="tableData"
+        style="width: 100%">
+        <el-table-column
+        type="index"
+        width="50"
+        prop="number"
+        label="序号"
+        align="center"
+        fixed="left"
+        :resizable="false">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="makeDate"
+          label="制票日期"
+          width="120px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="wagonNo"
+          label="车号"
+          width="120px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="materialName"
+          label="物资"
+          width="180px">
+        </el-table-column>
+        <el-table-column
+        align="center"
+          prop="mineral"
+          label="矿种"
+          width="120px">
+        </el-table-column>
+         <el-table-column
+         align="center"
+        width="80px"
+          prop="weight"
+          label="标重">
+        </el-table-column>
+        <!-- <el-table-column
+        align="center"
+        width="100px"
+          fixed="right"
+          label="操作">
+          <template slot-scope="scope">
+            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
+            <el-button type="text" size="small">编辑</el-button>
+          </template>
+        </el-table-column> -->
+      </el-table>
+    </div>
+    <!-- <div class="cp">
       <span style="width:80px">车皮号:</span>
       <span style="width:80px">车皮号:</span>
       <el-input
       <el-input
         placeholder="请输入内容"
         placeholder="请输入内容"
@@ -41,50 +154,53 @@
       <span class="text">卸货点:</span>
       <span class="text">卸货点:</span>
       <el-input v-model="unloadPointName" disabled> </el-input>
       <el-input v-model="unloadPointName" disabled> </el-input>
       <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
       <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
+    </div> -->
+    <div class="right" 
+    style="margin-top:10px
+           float:right;">
+        <div class="form">
+          <div class="form_box" style="margin-right: 10rem">
+            <el-form>
+               <div class="preview-group">
+                  <el-form-item label="发站:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="sendStation"
+                      :fetch-suggestions="querySearchSendStation"
+                      placeholder="请输入发站名称"
+                      :trigger-on-focus="false"
+                      @select="handleSelectSendStation"
+                    >
+                      <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="102" v-model="form1" ref="from1"></dil-form>
+          </div>
+        </div>
+        <div class="button-box">
+          <el-button @click="cancel">取消</el-button>
+          <el-button type="primary" :disabled="disable" @click="makeSure">确定</el-button>
+        </div>
     </div>
     </div>
-    <div class="fromOther">
-      <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
-        <el-form-item label="发站:">
-          <el-autocomplete
-            class="inline-input"
-            v-model="sendStation"
-            :fetch-suggestions="querySearchSendStation"
-            placeholder="请输入发站名称"
-            :trigger-on-focus="false"
-            @select="handleSelectSendStation"
-          >
-            <template slot-scope="{ item }">
-              <div class="name">{{ item.arrivalName }}</div>
-            </template>
-          </el-autocomplete>
-        </el-form-item>
-      </el-form>
-      <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
-        <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>
-    </div>
-    <div class="form">
-      <div class="form_box" style="margin-right: 10rem">
-        <dil-form :formId="102" v-model="form1" ref="from1"></dil-form>
-      </div>
-    </div>
-    <div class="button-box">
-      <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="makeSure">确定</el-button>
-    </div>
+    
     <!-- 模态窗口 -->
     <!-- 模态窗口 -->
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
     <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
       <el-input
       <el-input
@@ -130,8 +246,10 @@ export default {
   components: { PageTitle },
   components: { PageTitle },
   data() {
   data() {
     return {
     return {
+      disable:true,
       list: [],
       list: [],
       form1: {},
       form1: {},
+      tableData:[],
       input: "",
       input: "",
       value: undefined,
       value: undefined,
       //船名
       //船名
@@ -152,9 +270,19 @@ export default {
       unloadPointId: null,
       unloadPointId: null,
       //卸货点名称
       //卸货点名称
       unloadPointName: null,
       unloadPointName: null,
+      //查询
+      search1:null,
+      search2:null,
       a: 1,
       a: 1,
       direction: "rtl",
       direction: "rtl",
       inputText: "",
       inputText: "",
+      purchaseOption:{
+         // 表格请求数据的地址
+        requestUrl: "/api/v1/tms/findPurchaseOrderList?apiId=81",
+        // 控制选择单列
+        selectionType: "radio",
+        pageSize:5,
+      },
       frist: {
       frist: {
         requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
         requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
         selectionType: "radio",
         selectionType: "radio",
@@ -357,17 +485,33 @@ export default {
         }
         }
       }
       }
     },
     },
+    searchOrder(){
+      //查询订单
+      if((typeof this.search1)!="undefined" && (typeof this.search2)!='undefined'){
+        let requestUrl="/api/v1/tms/findPurchaseOrderList?apiId=81";
+        if(this.search1!=null){
+            requestUrl+=("&materialName="+this.search1);
+        }
+        if(this.search2!=null){
+            requestUrl+=("&resultForeignShipName="+this.search2);
+        }
+        this.purchaseOption.requestUrl=requestUrl;
+      }else{
+        this.purchaseOption.requestUrl=
+        "/api/v1/tms/findPurchaseOrderList?apiId=81"
+      }
+    },
     onclick(index) {
     onclick(index) {
       this.list.splice(index, 1);
       this.list.splice(index, 1);
     },
     },
     // 确定
     // 确定
     makeSure() {
     makeSure() {
+      this.disable=true;
       let state = 0;
       let state = 0;
       if (
       if (
         this.list.length > 0 &&
         this.list.length > 0 &&
         this.materialId &&
         this.materialId &&
         this.supplierId &&
         this.supplierId &&
-        this.unloadPointId &&
         this.purchaseOrderId &&
         this.purchaseOrderId &&
         this.form1.resultIsclear &&
         this.form1.resultIsclear &&
         this.form1.resultClass &&
         this.form1.resultClass &&
@@ -377,6 +521,7 @@ export default {
       ) {
       ) {
         state = 1;
         state = 1;
       } else {
       } else {
+        this.disable=false;
         console.log(this.list.length);
         console.log(this.list.length);
         if (this.list.length == 0) {
         if (this.list.length == 0) {
           this.$message({
           this.$message({
@@ -385,13 +530,11 @@ export default {
           });
           });
         } else {
         } else {
           if (this.materialId) {
           if (this.materialId) {
-            if (this.supplierId) {
-              if (this.unloadPointId) {
                 if (this.purchaseOrderId) {
                 if (this.purchaseOrderId) {
                   if (this.form1.resultIsclear) {
                   if (this.form1.resultIsclear) {
-                    if (this.form1.resultIsclear) {
-                      if (this.form1.sendStationId) {
-                        if (this.form1.arrivalStationId) {
+                    if (this.form1.resultClass) {
+                      if (this.sendStationId) {
+                        if (this.toTheStationId) {
                           if (this.form1.resultLoadingDate) {
                           if (this.form1.resultLoadingDate) {
                           } else {
                           } else {
                             this.$message({
                             this.$message({
@@ -429,19 +572,7 @@ export default {
                     message: "该物资没有采购订单号!",
                     message: "该物资没有采购订单号!",
                   });
                   });
                 }
                 }
-              } else {
-                this.$message({
-                  type: "warning",
-                  message: "请选择卸货地点!",
-                });
-              }
-            } else {
-              this.$message({
-                type: "warning",
-                message: "请选择发货单位!",
-              });
-            }
-          } else {
+            }  else {
             this.$message({
             this.$message({
               type: "warning",
               type: "warning",
               message: "请选择物资!",
               message: "请选择物资!",
@@ -452,7 +583,7 @@ export default {
       if(state == 1){
       if(state == 1){
         let map = {
         let map = {
           wagonNoList:this.list,
           wagonNoList:this.list,
-          unloadingPointId:this.unloadPointId,
+          // unloadingPointId:this.unloadPointId,
           purchaseOrderRailPlanId:this.purchaseOrderId,
           purchaseOrderRailPlanId:this.purchaseOrderId,
           materialId:this.materialId,
           materialId:this.materialId,
           sendUnitId:this.supplierId,
           sendUnitId:this.supplierId,
@@ -464,6 +595,7 @@ export default {
           resultRemarks: this.form1.resultRemarks,
           resultRemarks: this.form1.resultRemarks,
           resultType:1,
           resultType:1,
         }
         }
+        console.log(map);
         this.axios.post('/api/v1/tms/insertTmstrainLoadingResult',map).then((res)=>{
         this.axios.post('/api/v1/tms/insertTmstrainLoadingResult',map).then((res)=>{
           console.log(res);
           console.log(res);
           if(res.data.code == "200"){
           if(res.data.code == "200"){
@@ -471,7 +603,7 @@ export default {
               type: "success",
               type: "success",
               message: "新增成功",
               message: "新增成功",
             });
             });
-            this.$router.push("/wagonLoad");
+            this.cancel();
           }
           }
         })
         })
       }
       }
@@ -480,6 +612,77 @@ export default {
     cancel() {
     cancel() {
       this.$router.go(-1);
       this.$router.go(-1);
     },
     },
+    // 导入excel
+    importExcel(file) {
+      let that=this;
+      if (!file) {
+        that.$message({
+          message: "文件错误!",
+          type: "warning",
+        });
+        return
+        }
+        var reader = new FileReader();
+        var data=null;
+        var workbook=null;
+        //设置读取操作
+        reader.onload = function (e) {
+          console.log(e);
+          data = e.target.result;
+          workbook= XLSX.read(data, {
+              type: 'binary'
+          });
+          console.log(workbook);
+          //读取表格
+          let rows= XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);//只取第一页
+          console.log(rows);
+          //清空
+          if(rows.length>0){
+            that.list=[];
+            that.tableData=[];
+            that.disable=false;
+            if((typeof rows[0]['车皮号'])=='undefined'){
+              that.$message({
+                message: "导入Excel格式错误!",
+                type: "warning",
+              });
+              return;
+            }
+          }
+          //绑定数据
+          rows.forEach((row,index) => {
+            let carNumber=row['车皮号'];
+            if((typeof carNumber)!="undefined" && carNumber.length == 7){
+              //车号表
+              that.list.push(carNumber);
+              //表格数据
+              let temp={
+                number:row['序号'],
+                makeDate:row['制票日期'],
+                materialName:row['品名'],
+                wagonNo:row['车皮号'],
+                mineral:row['矿种'],
+                weight:row['计费&#10;吨位']
+              }
+              that.tableData.push(temp);
+            }
+            else{
+              console.log("车号"+carNumber+"不是7位数!");
+            }
+        });
+        };
+        reader.readAsBinaryString(file.raw); //以二进制方式读取
+    },
+    //采购订单表格选中
+    orderChange(selection){
+      console.log(selection);
+      this.purchaseOrderId=selection.purchaseOrderId;
+      this.form1 = { purchaseOrderNo: selection.purchaseOrderNo };
+      this.materialId=selection.materialId;
+      this.materialName=selection.materialName;
+      this.supplierId=selection.supplierId;
+      this.supplierName=selection.supplierName;
+    },
   },
   },
 };
 };
 </script>
 </script>
@@ -638,7 +841,7 @@ export default {
     justify-content: center;
     justify-content: center;
     padding-top: 30px;
     padding-top: 30px;
   }
   }
-  .fromOther  .el-input__inner{
+  .formOther  .el-input__inner{
     width: 250px;
     width: 250px;
   }
   }
 }
 }

+ 7 - 6
src/views/TMS/components/importedShip/addShipmentInstructions.vue

@@ -79,11 +79,12 @@ export default {
     onDrawer() {
     onDrawer() {
       this.drawer = true;
       this.drawer = true;
     },
     },
-    changeStatus(){
-      this.status=true;
+    changeStatus() {
+      // this.status=!this.status;
+      console.log(this.status);
       // console.log("aaa",this.status);
       // console.log("aaa",this.status);
     },
     },
-    
+
     onclick() {
     onclick() {
       this.options.requestUrl =
       this.options.requestUrl =
         "/api/v1/tms/getBatchListForInstruction?apiId=383&con=" + this.input;
         "/api/v1/tms/getBatchListForInstruction?apiId=383&con=" + this.input;
@@ -116,9 +117,9 @@ export default {
         batchId: this.maplist.batchId,
         batchId: this.maplist.batchId,
         instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
         instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
         instructionTime: sjTime(this.form1.instructionTime),
         instructionTime: sjTime(this.form1.instructionTime),
-        statu:this.status,
-        transportPortName:this.form1.transportPortName,
-        handoverMethod:this.form1.handoverMethod,
+        statu: this.status,
+        transportPortName: this.form1.transportPortName,
+        handoverMethod: this.form1.handoverMethod,
       };
       };
 
 
       //判断合计吨位是否为数字
       //判断合计吨位是否为数字

+ 0 - 1
src/views/TMS/components/importedShip/addUnloadShip.vue

@@ -117,7 +117,6 @@ export default {
         resultEndTime: resultEndTime,
         resultEndTime: resultEndTime,
         resultStatus: this.form.resultStatus
         resultStatus: this.form.resultStatus
       };
       };
-      debugger;
       this.axios
       this.axios
         .post("/api/v1/tms/addUnLoadShip", {
         .post("/api/v1/tms/addUnLoadShip", {
           mapVal: mapVal,
           mapVal: mapVal,