Browse Source

港口出库新增和修改增加拼装

liyg 2 years ago
parent
commit
3470ec3381

+ 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>

+ 29 - 20
src/views/TMS/components/importedMine/outBoundWagon.vue

@@ -7,30 +7,32 @@
       <el-button type="primary" class="btn" @click="onclick">
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
         <i class="el-icon-search"></i>查询
       </el-button>
       </el-button>
-      <el-button type="primary" class="btn" @click="insert">
-        出库
-      </el-button>
+      <el-button type="primary" class="btn" @click="insert"> 出库 </el-button>
     </div>
     </div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <mergeRowTable v-bind.sync="option1" ref="table">
       <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
+        <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"
             type="text"
             size="small"
             size="small"
             @click="deleteclick(scope.row.resultId)"
             @click="deleteclick(scope.row.resultId)"
-            >删除</el-button >
-        </template>
-      </el-table-column> -->
+            >删除</el-button > -->
+          </template>
+        </el-table-column>
       </mergeRowTable>
       </mergeRowTable>
     </el-tabs>
     </el-tabs>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
+import { getCookie } from "@/utils/util.js";
 export default {
 export default {
   name: "inplantTMS",
   name: "inplantTMS",
   data() {
   data() {
@@ -41,11 +43,9 @@ export default {
       option1: {
       option1: {
         // 表格请求数据的地址
         // 表格请求数据的地址
         requestUrl: "/api/v1/wmsh/getUnLockPortStock?apiId=494",
         requestUrl: "/api/v1/wmsh/getUnLockPortStock?apiId=494",
-        comparison:"resultNumber",
-        columnIndexs:[
-          0,1,2,3,4,5
-        ]
-      }
+        comparison: "resultNumber",
+        columnIndexs: [0, 1, 2, 3, 4, 5],
+      },
     };
     };
   },
   },
   filters: {},
   filters: {},
@@ -62,10 +62,19 @@ export default {
     handleClick(tab, event) {
     handleClick(tab, event) {
       console.log(tab, event);
       console.log(tab, event);
     },
     },
-   click(resultId) {
-      this.$router.push("/editOutBoundWagon/" + resultId);
+    click(resultId) {
+      console.log("res",getCookie("orgCode"));
+      if (
+        getCookie("orgCode") == "yuanliaogongsi" ||
+        getCookie("orgCode") == "dagangadmin"
+      ) {
+       this.$router.push("/editOutBoundWagon/" + resultId);
+      
+      } else {
+          this.$message.warning("权限不足,请联系部门管理员!");
+        }
     },
     },
-  }
+  },
 };
 };
 </script>
 </script>
 <style lang="scss" scoped>
 <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 editApproveWagonPlease from "../components/importedMine/editApproveWagonPlease.vue";
 import editWagonLoad from "../components/importedMine/editWagonLoad.vue";
 import editWagonLoad from "../components/importedMine/editWagonLoad.vue";
 import editWagonPlease from "../components/importedMine/editWagonPlease.vue";
 import editWagonPlease from "../components/importedMine/editWagonPlease.vue";
+import editOutBoundWagon from "../components/importedMine/editOutBoundWagon.vue";
 import editWagonUnLoad from "../components/importedMine/editWagonUnLoad.vue";
 import editWagonUnLoad from "../components/importedMine/editWagonUnLoad.vue";
 import entrust from "../components/importedMine/entrust.vue";
 import entrust from "../components/importedMine/entrust.vue";
 import wagonApprove from "../components/importedMine/wagonApprove.vue";
 import wagonApprove from "../components/importedMine/wagonApprove.vue";
@@ -776,6 +777,12 @@ const constantRouterMap = [
         meta: { code: "xtpzgl-yhgl" },
         meta: { code: "xtpzgl-yhgl" },
         component: editWagonPlease
         component: editWagonPlease
       },
       },
+      {
+        path: "editOutBoundWagon/:resultId",
+        name: "editOutBoundWagon",
+        meta: { code: "xtpzgl-yhgl" },
+        component: editOutBoundWagon
+      },
       {
       {
         path: "editWagonUnLoad/:unloadingId",
         path: "editWagonUnLoad/:unloadingId",
         name: "editWagonUnLoad",
         name: "editWagonUnLoad",