liyg 2 years ago
parent
commit
bbc38dfd1c

+ 1 - 1
build/utils.js

@@ -15,7 +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 = ["all"];
+let devModules = ["index","TMS"];
 // 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"];

+ 2 - 2
config/index.js

@@ -65,8 +65,8 @@ 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://localhost:8080",
     ws: true,
     ws: true,
     pathRewrite: {
     pathRewrite: {
       "^/api/v1": "/api/v1"
       "^/api/v1": "/api/v1"

+ 27 - 75
src/views/TMS/components/domesticMine/wagonLoadAdd.vue

@@ -527,10 +527,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,22 +552,26 @@ 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);
@@ -583,81 +587,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){
             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("绑定发货单位失败,请检查数据!");
-                      }
-                });
+              //表格数据
+              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>

+ 9 - 55
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();
     }
     }
   },
   },
 };
 };