Bläddra i källkod

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

luobang 2 år sedan
förälder
incheckning
d4deefbe61

+ 27 - 11
src/views/TMS/components/importedMine/addWagonloadCopy.vue

@@ -30,12 +30,6 @@
         >
           <i class="el-icon-search"></i>查询
         </el-button>
-        <!-- <el-button 
-      type="primary"
-      class="btn" 
-      @click="makeSure" 
-      style="margin: 10px;">确认配单
-      </el-button> -->
       </div>
       <!-- 采购订单号 -->
       <dilTable
@@ -107,7 +101,7 @@
           width="120px"
         >
         </el-table-column>
-        <el-table-column align="center" width="80px" prop="weight" label="标重">
+        <el-table-column align="center" width="80px" prop="wagonWeight" label="标重">
         </el-table-column>
         <!-- <el-table-column
         align="center"
@@ -198,6 +192,11 @@
                   </template>
                 </el-autocomplete>
               </el-form-item>
+              <el-form-item label="有拼装:">
+                <el-switch
+                  v-model="isAssembly">
+                </el-switch>
+              </el-form-item>
             </div>
           </el-form>
           <dil-form :formId="102" v-model="form1" ref="from1"></dil-form>
@@ -262,6 +261,7 @@ export default {
       form1: {},
       tableData: [],
       input: "",
+      isAssembly:false,
       value: undefined,
       //船名
       remark: null,
@@ -309,7 +309,7 @@ export default {
         requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
         selectionType: "radio"
       },
-      sendStationId: 2,
+      sendStationId: 4,//发站id和到站id都写死了,并且赋了港口名,如果数据库id变化,要注意
       toTheStationId: 1,
       sendStation: "万州港",
       toTheStation: "老区轨道衡"
@@ -600,7 +600,7 @@ export default {
       if (state == 1) {
         let map = {
           portName: this.sendStation,
-          wagonList: this.list,
+          wagonList: this.tableData,
           // unloadingPointId:this.unloadPointId,
           purchaseOrderRailPlanId: this.purchaseOrderId,
           materialId: this.materialId,
@@ -613,8 +613,24 @@ export default {
           resultRemarks: this.form1.resultRemarks,
           userId: getCookie("userId"),
           resultType: 1,
-          purchaseNo: this.form1.purchaseOrderNo
+          purchaseNo: this.form1.purchaseOrderNo,
+          isAssembly:this.isAssembly
         };
+        console.log(map);
+        //校验拼装车的标重
+        if(this.isAssembly){
+          let flag=false;
+          map.wagonList.forEach((item)=>{
+            if(typeof item.wagonWeight !='undefined'){
+              flag=true;
+            }
+          });
+          if(!flag){
+            this.$message.warning("拼装车的标重不存在!");
+            this.disable = false;
+            return ;
+          }
+        }
         this.axios
           .post("/api/v1/tms/addWarehouseOutResult", map)
           .then(res => {
@@ -698,7 +714,7 @@ export default {
               materialName: row["品名"],
               wagonNo: row["车皮号"],
               mineral: row["矿种"],
-              weight: row["计费&#10;吨位"]
+              wagonWeight: row["标重"]
             };
             that.tableData.push(temp);
           } else {

+ 272 - 0
src/views/TMS/components/importedMine/editOutBoundWagon.vue

@@ -0,0 +1,272 @@
+<template>
+  <!-- 修改车皮出库实绩 -->
+  <div class="editOutBoundWagon">
+    <page-title>返回</page-title>
+
+    <div class="form">
+      <div class="form_box">
+        <el-form :inline="true" class="demo-form-inline">
+          <div class="preview-group">
+            <el-form-item label="车皮">
+              <el-input v-model="form.wagonNo"></el-input>
+            </el-form-item>
+            <el-form-item label="采购订单号">
+              <el-input v-model="form.purchaseOrderNo" disabled></el-input>
+            </el-form-item>
+            <el-form-item label="是否拼装">
+              <el-switch v-model="isAssembly"> </el-switch>
+            </el-form-item>
+            <el-form-item v-show="isAssembly" label="标重">
+              <el-input type="number" v-model="form.tonnage"></el-input>
+            </el-form-item>
+            <el-form-item label="发站">
+              <el-autocomplete
+                class="inline-input"
+                v-model="sendStation"
+                :fetch-suggestions="querySearchSendStation"
+                placeholder="请输入发站名称"
+                disabled
+                :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"
+                disabled
+                :fetch-suggestions="querySearchToTheStation"
+                placeholder="请输入到站名称"
+                :trigger-on-focus="false"
+                @select="handleSelectToTheStation"
+              >
+                <template slot-scope="{ item }">
+                  <div class="name">{{ item.arrivalName }}</div>
+                </template>
+              </el-autocomplete>
+            </el-form-item>
+            <el-form-item label="备注">
+              <el-input type="textarea" v-model="form.resultMarks"></el-input>
+            </el-form-item>
+          </div>
+        </el-form>
+      </div>
+    </div>
+    <!-- 确定和取消 -->
+    <div class="button_box">
+      <el-button @click="cancel">返回</el-button>
+      <el-button type="primary" @click="makeSure">确认</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from "@/components/Page/Title";
+import { sjTime, isNumber } from "@/utils/sharedJsFile";
+import { getCookie } from "@/utils/util.js";
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+      form: {},
+      wagonNo: null,
+      tonnage: null,
+      isAssembly: false,
+      sendStationId: 4, //发站id和到站id都写死了,并且赋了港口名,如果数据库id变化,要注意
+      toTheStationId: 1,
+      sendStation: "万州港",
+      toTheStation: "老区轨道衡",
+    };
+  },
+  mounted() {
+    this.information();
+  },
+  methods: {
+    information() {
+      console.log("resultId" + this.$route.params.resultId);
+      //编辑车皮装车作业
+      this.axios
+        .post(
+          "/api/v1/tms/getWareHouseOutresult/" + this.$route.params.resultId
+        )
+        .then((res) => {
+          res.data.data.forEach((e) => {
+            this.form = e;
+            this.wagonNo = e.wagonNo;
+            this.tonnage = e.tonnage;
+            console.log(e);
+          });
+        });
+    },
+    handleCheckedCitiesChange(value) {
+      console.log(value);
+    },
+    // 返回
+    cancel() {
+      this.$router.go(-1);
+    },
+    currentRadioChange(row) {
+      this.aaaa = row;
+    },
+    //发站弹出层
+    handleSelectSendStation(item) {
+      this.sendStationId = item.arrivalId;
+      this.sendStation = item.arrivalName;
+    },
+    //以下是发站边输边查搜索
+    querySearchSendStation(queryString, cb) {
+      this.axios
+        .get("/api/v1/uc/getArrivalByLike?index=" + this.sendStation)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurantsSupplier = res.data.data;
+            console.log(restaurantsSupplier);
+            var results = queryString
+              ? restaurantsSupplier.filter(
+                  this.createFilterSendStation(queryString)
+                )
+              : restaurantsSupplier;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    //发站
+    createFilterSendStation(queryString) {
+      return (restaurantsSupplier) => {
+        return (
+          restaurantsSupplier.arrivalName
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        );
+      };
+    },
+    //到站弹出层
+    handleSelectToTheStation(item) {
+      this.toTheStationId = item.arrivalId;
+      this.toTheStation = item.arrivalName;
+    },
+    //以下是到站边输边查搜索
+    querySearchToTheStation(queryString, cb) {
+      this.axios
+        .get("/api/v1/uc/getArrivalByLike?index=" + this.toTheStation)
+        .then((res) => {
+          if (res.data.code == "200") {
+            var restaurantsSupplier = res.data.data;
+            console.log(restaurantsSupplier);
+            var results = queryString
+              ? restaurantsSupplier.filter(
+                  this.createFilterToTheStation(queryString)
+                )
+              : restaurantsSupplier;
+            // 调用 callback 返回建议列表的数据
+            cb(results);
+          }
+        });
+    },
+    //到站
+    createFilterToTheStation(queryString) {
+      return (restaurantsSupplier) => {
+        return (
+          restaurantsSupplier.arrivalName
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        );
+      };
+    },
+    // 确认
+    makeSure() {
+     
+      let map = {
+        loadingTempId: this.$route.params.resultId,
+        OutResultId: this.form.OutResultId,
+        isAssembly: this.isAssembly,
+        wagonNo: this.wagonNo,
+        wagonNew: this.form.wagonNo,
+        batchId: this.form.batchId,
+        portId: this.form.portId,
+        wagonWeight: this.tonnage,
+        wagonWeightNew: this.form.tonnage,
+        resultRemarks: this.form.resultRemarks,
+        purchaseOrderNo: this.form.purchaseOrderNo,
+        userId: getCookie("userId"),
+        resultType: 1,
+      };
+      console.log(map);
+      if (
+        map.loadingTempId == null ||
+        map.wagonNew == null ||
+        map.purchaseOrderNo == null ||
+        (map.isAssembly && map.wagonWeightNew == null)
+      )
+        this.$message.error("必填项存在空值!");
+      else
+        this.axios
+          .post("/api/v1/tms/updateWarehouseResult", map)
+          .then((res) => {
+            if (res.data.code == "200") {
+              this.$message({
+                type: "success",
+                message: "修改成功!",
+              });
+              this.$router.go(-1);
+            } else {
+              this.$message({
+                type: "error",
+                message: res.data.data,
+              });
+            }
+          });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.editOutBoundWagon {
+  .form {
+    display: flex;
+    .form_box {
+      width: 340px;
+      margin-left: 35%;
+      margin-top: 30px;
+      margin-right: 20px;
+      .el-form {
+        .preview-group {
+          .el-form-item {
+            .el-form-item__label {
+              display: inline-block;
+              width: 70px !important;
+            }
+            .el-form-item__content {
+              .el-select {
+                width: 250px;
+              }
+              .el-input {
+                width: 250px;
+              }
+              .el-textarea {
+                .el-textarea__inner {
+                  width: 220px;
+                  margin-left: 65px;
+                  margin-top: 0.03rem;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  .button_box {
+    margin-left: 42%;
+    margin-top: 55px;
+  }
+  .fromOther .el-input__inner {
+    width: 250px;
+  }
+}
+</style>

+ 38 - 9
src/views/TMS/components/importedMine/outBoundWagon.vue

@@ -7,17 +7,32 @@
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
-      <el-button type="primary" class="btn" @click="insert">
-        出库
-      </el-button>
+      <el-button type="primary" class="btn" @click="insert"> 出库 </el-button>
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
-      <dilTable v-bind.sync="option1" ref="table"> </dilTable>
+      <mergeRowTable v-bind.sync="option1" ref="table">
+        <el-table-column fixed="right" label="操作" width="50">
+          <template slot-scope="scope">
+            <el-button
+              @click="click(scope.row.resultId)"
+              type="text"
+              size="small"
+              >修改</el-button
+            >
+            <!-- <el-button
+            type="text"
+            size="small"
+            @click="deleteclick(scope.row.resultId)"
+            >删除</el-button > -->
+          </template>
+        </el-table-column>
+      </mergeRowTable>
     </el-tabs>
   </div>
 </template>
 
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
   name: "inplantTMS",
   data() {
@@ -27,8 +42,10 @@ export default {
       activeName: "first",
       option1: {
         // 表格请求数据的地址
-        requestUrl: "/api/v1/wmsh/getOutBoundResult?apiId=159"
-      }
+        requestUrl: "/api/v1/wmsh/getUnLockPortStock?apiId=494",
+        comparison: "resultNumber",
+        columnIndexs: [0, 1, 2, 3, 4, 5],
+      },
     };
   },
   filters: {},
@@ -36,7 +53,7 @@ export default {
     onclick() {
       if (this.activeName == "first") {
         this.option1.requestUrl =
-          "/api/v1/wmsh/getOutBoundResult?apiId=159&con=" + this.input;
+          "/api/v1/wmsh/getUnLockPortStock?apiId=494&con=" + this.input;
       }
     },
     insert() {
@@ -44,8 +61,20 @@ export default {
     },
     handleClick(tab, event) {
       console.log(tab, event);
-    }
-  }
+    },
+    click(resultId) {
+      console.log("res",getCookie("orgCode"));
+      if (
+        getCookie("orgCode") == "yuanliaogongsi" ||
+        getCookie("orgCode") == "dagangadmin"
+      ) {
+       this.$router.push("/editOutBoundWagon/" + resultId);
+      
+      } else {
+          this.$message.warning("权限不足,请联系部门管理员!");
+        }
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 7 - 0
src/views/TMS/router/index.js

@@ -110,6 +110,7 @@ import addWagonUnLoad from "../components/importedMine/addWagonUnLoad.vue";
 import editApproveWagonPlease from "../components/importedMine/editApproveWagonPlease.vue";
 import editWagonLoad from "../components/importedMine/editWagonLoad.vue";
 import editWagonPlease from "../components/importedMine/editWagonPlease.vue";
+import editOutBoundWagon from "../components/importedMine/editOutBoundWagon.vue";
 import editWagonUnLoad from "../components/importedMine/editWagonUnLoad.vue";
 import entrust from "../components/importedMine/entrust.vue";
 import wagonApprove from "../components/importedMine/wagonApprove.vue";
@@ -776,6 +777,12 @@ const constantRouterMap = [
         meta: { code: "xtpzgl-yhgl" },
         component: editWagonPlease
       },
+      {
+        path: "editOutBoundWagon/:resultId",
+        name: "editOutBoundWagon",
+        meta: { code: "xtpzgl-yhgl" },
+        component: editOutBoundWagon
+      },
       {
         path: "editWagonUnLoad/:unloadingId",
         name: "editWagonUnLoad",