Browse Source

修改内转钢材到异地库

luobang 2 years ago
parent
commit
a2deb904b3

+ 10 - 0
src/views/RMS/components/addContractPrice.vue

@@ -87,6 +87,7 @@ export default {
       }
       else{
          let map=this.form;
+         map.userId=getCookie("userId");
          console.log(map);
          map.startTime = sjTime(this.form.startTime);
          map.endTime = sjTime(this.form.endTime);
@@ -119,6 +120,15 @@ export default {
           } else {
             this.$message.error(res.data.data);
           }
+        }).then(()=>{
+          let copy=this.$route.query;
+          console.log("copy:",copy);
+          if(copy){
+            if(copy.portId){
+              copy.portId=copy.portId * 1;
+            }
+            this.$set(this,"form",copy);
+          }
         });
     }
   }

+ 15 - 3
src/views/RMS/components/contractPrice.vue

@@ -13,12 +13,15 @@
     </div>
     <div class="table">
       <dilTable v-bind.sync="options">
-        <el-table-column fixed="right" label="操作" width="100">
+        <el-table-column fixed="right" label="操作" width="180">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="update(scope)">
+            <el-button type="text" size="small" @click="add(scope)" style="margin:10px">
+              复制新增
+            </el-button>
+            <el-button type="text" size="small" @click="update(scope)" style="margin:10px">
               修改
             </el-button>
-            <el-button type="text" size="mini" @click="deleteOne(scope)">
+            <el-button type="text" size="mini" @click="deleteOne(scope)" style="margin:10px">
               删除
             </el-button>
           </template>
@@ -53,6 +56,15 @@ export default {
       console.log(scope.row.resultId);
       this.$router.push("/editContractPrice/" + scope.row.resultId);
     },
+    //复制新增
+    add(scope) {
+      console.log(scope.row);
+      this.$router.push("/addContractPrice?contractNo="+scope.row.contractNo
+      +"&portId="+scope.row.portId
+      +"&unitPrice="+scope.row.unitPrice
+      +"&startTime="+scope.row.startTime
+      +"&endTime="+scope.row.endTime);
+    },
     showCarrier(scope) {
       console.log(scope.row.resultId);
       this.$router.push("/showContractPrice/" + scope.row.resultId);

+ 32 - 7
src/views/TMS/components/domesticMine/wagonLoadAdd.vue

@@ -154,7 +154,7 @@
       :visible.sync="drawer"
       :direction="direction"
       :before-close="handleClose"
-      size="50%"
+      size="80%"
     >
     <el-input
         placeholder="发货单位"
@@ -413,7 +413,7 @@ export default {
         list: selection,
         userId: getCookie("userId")
       };
-      console.log(data);
+      console.log("data:",data);
       //请求添加
       this.axios.post("/api/v1/tms/addDomesticLoadResult", data).then(res => {
         console.log(res);
@@ -616,9 +616,17 @@ export default {
           }
           return;
         }
+        let groupNo=1;
+        let isLoading=true;
         //读取表格
-        for (let i = 1; i <= rows.length + 1; i++) {
+        for (let i = index+1; i <= rows.length + 1; i++) {
           let row = workbook.Sheets[workbook.SheetNames[0]]["A" + i];//先取A列,如果是数字则取该行数据
+          if(row && typeof row.v == "number" && isLoading==false){
+            isLoading=true;
+            groupNo++;
+          }else if(!row || typeof row.v != "number" && isLoading==true){
+            isLoading=false;
+          }
           if (
             row && typeof row.v == "number" &&
             workbook.Sheets[workbook.SheetNames[0]]["B" + i] != "undefined" &&
@@ -645,7 +653,8 @@ export default {
               productName: workbook.Sheets[workbook.SheetNames[0]]["G" + i].v,
               wagonNo: workbook.Sheets[workbook.SheetNames[0]]["J" + i].v,
               weight: workbook.Sheets[workbook.SheetNames[0]]["I" + i].v,
-              mineral: workbook.Sheets[workbook.SheetNames[0]]["H" + i].v
+              mineral: workbook.Sheets[workbook.SheetNames[0]]["H" + i].v,
+              groupNo:groupNo
             };
             if ((tableRow.wagonNo + "").length != 7) {
               that.$message({
@@ -657,7 +666,7 @@ export default {
             excelData.push(tableRow);
           }
         }
-        console.log(excelData);
+        console.log("excelData",excelData);
         let map={
           list:excelData
         }
@@ -665,15 +674,31 @@ export default {
         that.axios.post("/api/v1/tms/importDomesticLoadResult",map).then(res => {
           console.log(res);
           if (res.data.code == "200") {
+            //赋值
             that.tableData=res.data.data;
+            //查询匹配失败记录数
+            let length=that.tableData.length;
+            that.tableData.forEach((item)=>{
+              if(item.purchaseOrderId)
+                length--;
+            });
+            if(length<=0){
+              that.$message({
+                message: "导入"+that.tableData.length+"条数据,全部匹配成功!",
+                type: "success",
+              });
+            }else if(length>0){
+               that.$confirm("导入"+that.tableData.length+"条数据,"+length+"条数据匹配失败!请手动配单!")
+                .then(_ => {
+                  done();
+                });
+            }
           } else {
             that.$message({
               type: "error",
               message: res.data.data
             });
           }
-        }).then(()=>{
-          // that.isLoading = false;
         });
       };
       reader.readAsBinaryString(file.raw); //以二进制方式读取

+ 2 - 2
src/views/TMS/components/domesticMine/wagonLoadbu.vue

@@ -131,7 +131,7 @@ export default {
         requestUrl: "/api/v1/tms/findPurchaseOrderList?apiId=81",
         // 控制选择单列
         selectionType: "radio",
-        pageSize:5,
+        pageSize:10,
       },
       option: {
         // 表格请求数据的地址
@@ -188,7 +188,7 @@ export default {
     };
   },
   mounted(){
-    this.searchMaterialName('');
+    // this.searchMaterialName('');
   },
   methods: {
     //确定

File diff suppressed because it is too large
+ 602 - 287
src/views/TMS/components/importedEmergency/addWagonLoadEmergency.vue


+ 3 - 0
src/views/TMS/components/importedEmergency/wagonLoadEmergency.vue

@@ -93,6 +93,9 @@ export default {
         this.$router.push("/editWagonLoadEmergency/" + resultId);
       }
     },
+    click(resultId) {
+      this.$router.push("/editWagonLoadEmergency/" + resultId);
+    },
     deleteclick(resultId) {
       this.$confirm("是否删除", "提示", {
         confirmButtonText: "确定",

+ 50 - 23
src/views/TMS/components/importedMine/addWagonLoad.vue

@@ -16,21 +16,22 @@
       <span >当前导入数量:{{tableData.length}}</span>
     </div> -->
     <div class="tempTable">
-      <div class="search" style="display:flex">
+      <div class="search" style="display:flex;margin: 10px;">
         <el-input
           placeholder="请输入"
-          v-model="input"
-          style="margin: 10px; width:20%"
+         value="请先导入查询,再勾选,如果查询失败,可能是港口没有出库或者已经装车"
+          style="margin: 10px; width:38%"
           clearable
+          disabled
         ></el-input>
-        <el-button
+        <!-- <el-button
           type="primary"
           class="btn"
           @click="searchLoadTemp()"
           style="margin: 10px;"
         >
           <i class="el-icon-search"></i>查询
-        </el-button>
+        </el-button> -->
          <el-upload style="margin: 10px;"
           class="upload-excel"
           action=""
@@ -40,16 +41,18 @@
           :auto-upload="false">
           <el-button  type="primary">
             <i class="el-icon-search"></i>导入查询</el-button>
+            <span >查询结果数量:{{tableDataReal.length}}</span>
       </el-upload>
       </div>
       <!-- 临时表已导入配单的车皮 -->
       <div class="tempTable" style="height:300px;overflow:scroll;float:left;margin-left:5px">
         <el-table
           ref="tempTable"
+          empty-text="请先查询,再查看数据"
           highlight-current-row
           @selection-change="handleSelectionChange"
           @row-click="rowClick"
-          :data="tableData"
+          :data="tableDataReal"
           :row-style="{height:'40px'}"
           style="width: 100%;font-size: 18px"
           id="domesticTable">
@@ -223,6 +226,7 @@ export default {
       list: [],
       form1: {},
       tableData:[],
+      tableDataReal:[],
       selectionRow:[],
       input: "",
       value: undefined,
@@ -495,9 +499,17 @@ export default {
           }
           return;
         }
+        let groupNo=1;
+        let isLoading=true;
         //读取表格
-        for(let i=1;i<=rows.length+1;i++){
+        for(let i=index+1;i<=rows.length+1;i++){
           let row=workbook.Sheets[workbook.SheetNames[0]]['A'+i];
+          if(row && typeof row.v == "number" && isLoading==false){
+            isLoading=true;
+            groupNo++;
+          }else if(!row || typeof row.v != "number" && isLoading==true){
+            isLoading=false;
+          }
           if(row!='undefined' && row!=null && typeof row.v=='number' 
               && workbook.Sheets[workbook.SheetNames[0]]['B'+i]!='undefined'
             && workbook.Sheets[workbook.SheetNames[0]]['B'+i]!=null
@@ -516,13 +528,14 @@ export default {
             let tableRow={
               sendStation:workbook.Sheets[workbook.SheetNames[0]]['B'+i].v,
               arrivalStation:workbook.Sheets[workbook.SheetNames[0]]['C'+i].v,
-              sendDate:sjTime(workbook.Sheets[workbook.SheetNames[0]]['D'+i].v),
-              arrivalDate:workbook.Sheets[workbook.SheetNames[0]]['E'+i].v,
+              sendDate: that.formatDate(workbook.Sheets[workbook.SheetNames[0]]["D" + i].v),
+              arrivalDate: that.formatDate(workbook.Sheets[workbook.SheetNames[0]]["E" + i].v),
               unloadPoint:workbook.Sheets[workbook.SheetNames[0]]['F'+i].v,
               productName:workbook.Sheets[workbook.SheetNames[0]]['G'+i].v,
               wagonNo:workbook.Sheets[workbook.SheetNames[0]]['J'+i].v,
               weight:workbook.Sheets[workbook.SheetNames[0]]['I'+i].v,
               mineral:workbook.Sheets[workbook.SheetNames[0]]['H'+i].v,
+              groupNo:groupNo
             }
             if((tableRow.wagonNo+"").length!=7){
               that.$message({
@@ -543,7 +556,7 @@ export default {
           return;
         }else if(that.tableData.length<=0){
           that.$message({
-            message:"当前列表没有可用数据",
+            message:"数据库没有可用数据",
             type:"warning "
           })
           return;
@@ -552,22 +565,24 @@ export default {
         let tableData=[];
         importData.forEach((row)=>{
           let temp=that.tableData.find(item=>item.wagonNo==row.wagonNo 
-          && row.productName.includes(item.foreignShipName)
-          && item.materialName.includes(row.mineral));
-          if(temp)
+          && row.productName.includes(item.foreignShipName));
+          if(temp){
+            temp.sendDate=row.sendDate;
+            temp.arrivalDate=row.arrivalDate;
+            temp.groupNo=row.groupNo;
             tableData.push(temp);
+          }
         });
-        console.log("test",tableData);
         that.tableDataReal=tableData;
-        if(that.tableData.length<=0){
-           that.$message({
-            message: "查询不到相关车皮!",
-            type: "warning",
+        if(tableData.length<=0){
+          that.$confirm('查询不到相关车皮!')
+          .then(_ => {
+            done();
           });
-        }else if(that.tableData.length<importData.length){
-          that.$message({
-            message: "共"+importData.length-that.tableData.length+"条车皮查询失败!",
-            type: "warning",
+        }else if(tableData.length<importData.length){
+           that.$confirm("共"+(importData.length-tableData.length)+"条车皮查询失败!")
+          .then(_ => {
+            done();
           });
         }else{
           that.$message({
@@ -593,8 +608,9 @@ export default {
     },
     //查询临时表
     searchLoadTemp(){
+      this.tableDataReal=[];
       this.axios.post('/api/v1/tms/getResultType?apiId=58&resultType=1&con='+this.input).then((res)=>{
-        console.log(res);
+        console.log("temp:",res.data.data);
         if(res.data.code == "200"){
           this.tableData=res.data.data;
         }else {
@@ -636,6 +652,17 @@ export default {
       this.selectionRow = rows //保存已选择行
       console.log(this.selectionRow);
     },
+    formatDate(numb, format) {
+      const time = new Date((numb - 1) * 24 * 3600000 + 1)
+      time.setYear(time.getFullYear() - 70)
+      const year = time.getFullYear() + ''
+      const month = time.getMonth() + 1 + ''
+      const date = time.getDate() + ''
+      if (format && format.length === 1) {
+        return year + format + month + format + date
+      }
+      return year + '年' + (month < 10 ? '0' + month : month)+ '月' + (date < 10 ? '0' + date : date) + '日'
+    },
   },
 };
 </script>

+ 1 - 1
src/views/TMS/components/importedMine/outBoundWagon.vue

@@ -17,7 +17,7 @@
               @click="click(scope.row.resultId)"
               type="text"
               size="small"
-              :disabled="!isEdit"
+              :disabled="scope.row.isEdit!=1"
               >修改</el-button
             >
             <!-- <el-button

+ 42 - 15
src/views/TMS/components/importedShip/addLoadShip.vue

@@ -12,11 +12,9 @@
     <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
     </dilTable>
     <div class="form">
-      <!-- 第二部分 -->
       <div class="form_box">
         <dil-form :formId="120" v-model="form"></dil-form>
-            <el-form :inline="true">
-            <!-- 含水率 -->
+            <!-- <el-form :inline="true">
           <el-form-item>
             <label class="el-form-item__label" style="width: auto;margin: left 2px;"
               >含水率</label
@@ -25,7 +23,6 @@
           <el-form-item>
             <el-input placeholder="" v-model="resultMoistureContent"></el-input>
           </el-form-item>
-          <!-- 合同水分值 -->
           <el-form-item>
             <label class="el-form-item__label" style="width: auto"
               >合同水分值</label
@@ -38,7 +35,6 @@
               :disabled="true"
             ></el-input>
           </el-form-item>
-          <!-- 水分吨位 -->
           <el-form-item>
             <label class="el-form-item__label" style="width: auto"
               >水分吨位</label
@@ -51,11 +47,10 @@
               :disabled="true"
             ></el-input>
           </el-form-item>
-        </el-form>
+        </el-form> -->
       </div>
-      <!-- 下方内容 -->  
     </div>
-    <div class="button_box">
+    <div class="button_box_addLoadShip">
       <el-button type="primary" @click="makeSure">新增装船作业</el-button>
     </div>
   </div>
@@ -75,7 +70,9 @@ export default {
       batchInfactoryId:"",
       restaurants: [],
       state: "",
-      form: {},
+      form: {
+        waterUnitPrice:null,
+      },
       option: {
         // 表格请求数据的地址
         requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
@@ -83,21 +80,50 @@ export default {
         selectionType: "radio",
       },
       rowMap: {},
+      unitPrices:[]
     };
   },
-  mounted() {},
+  mounted() {
+    this.getUnitPrice();
+  },
     watch: {
     resultMoistureContent() {
       this.pipeiContarct();
     },
     batchId() {
       this.pipeiContarct();
+    },
+    "form.resultOutWharyTime":{
+      handler(newVal,oldVal){
+        this.findUnitPrice();
+      },
+      deep: true,
+      immediate: true
     }
   },
   methods: {
+    getUnitPrice(){
+      this.axios
+            .post("/api/v1/rms/selectbmsshipContractPriceList?apiId=500")
+            .then((res) => {
+                this.unitPrices=res.data.data.list;
+        });
+    },
+    findUnitPrice(){
+      if(this.rowMap && this.form.resultOutWharyTime){
+          let contract=this.unitPrices.find(item=>
+          item.portId==this.rowMap.startPortId
+          && sjTime(this.form.resultOutWharyTime)>=sjTime(item.startTime)
+          && sjTime(this.form.resultOutWharyTime)<=sjTime(item.endTime));
+          if(contract){
+             this.form.waterUnitPrice=contract.unitPrice;
+          }
+      }
+    },
     currentRadioChange(row) {
       this.rowMap = row;
       this.batchInfactoryId=this.rowMap.batchInfactoryId;
+      this.findUnitPrice();
     },
 
     pipeiContarct() {
@@ -139,17 +165,18 @@ export default {
         resultOutWharyName: this.form.resultOutWharyName,
         resultOutWharyTime: sjTime(this.form.resultOutWharyTime),
         resultMemo: this.form.resultMemo,
-        resultPlannedDate: sjTime(this.form.planDate),
-        expectNoticeDate: sjTime(this.form.expectNoticeDate),
+        //resultPlannedDate: sjTime(this.form.planDate),
+        //expectNoticeDate: sjTime(this.form.expectNoticeDate),
         resultEmptyHeavyWaterMeter: this.form.resultEmptyHeavyWaterMeter,
         resultMoistureContent: this.resultMoistureContent,
-        resultInspectionFees: this.form.resultInspectionFees,
+        //resultInspectionFees: this.form.resultInspectionFees,
         contractMoistureValue: this.contractMoistureValue,
         moistureTonnage: this.moistureTonnage,
         waterUnitPrice:this.form.waterUnitPrice,
-        isNeedAssemble:this.form.isNeedAssemble,
+        //isNeedAssemble:this.form.isNeedAssemble,
         userId: getCookie("userId"),
       };
+      console.log("mapVal:",mapVal);
       //判断放货数量是否为数字
       function isNumber() {
         var value = mapVal.resultActualInstallations;
@@ -255,7 +282,7 @@ export default {
       margin-right: 1.25rem;
     }
   }
-  .button_box {
+  .button_box_addLoadShip {
     margin-left: 45%;
   }
 }

+ 3 - 3
src/views/TMS/components/importedShip/updateLoadShip.vue

@@ -73,9 +73,9 @@ export default {
         ),
         resultIsClear: this.form1.resultIsClear,
         resultOutPortName:this.form1.resultOutPortName,
-        planDate:sjTime(this.form1.planDate),
-        planDeliveryDate:sjTime(this.form1.planDeliveryDate),
-        resultHeavyWeight:this.form1.resultHeavyWeight,
+        //planDate:sjTime(this.form1.planDate),
+        //planDeliveryDate:sjTime(this.form1.planDeliveryDate),
+        //resultHeavyWeight:this.form1.resultHeavyWeight,
         userId:getCookie("userId"),
       };
               //判断放货数量是否为数字

Some files were not shown because too many files changed in this diff