luobang 3 jaren geleden
bovenliggende
commit
f8b32895dc
3 gewijzigde bestanden met toevoegingen van 121 en 106 verwijderingen
  1. 1 1
      build/utils.js
  2. 2 2
      config/index.js
  3. 118 103
      src/views/WMS/components/steel/steel_inbound.vue

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow']
 // let devModules = ['index','inward']
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
-let devModules = ["index", "WMS"];
+let devModules = ["all"];
 // let devModules = ['index','TMS']
 // let devModules = ['index','statisticalReport','inward']
 if (pathSrc.indexOf("node_modules") > -1) {

+ 2 - 2
config/index.js

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

+ 118 - 103
src/views/WMS/components/steel/steel_inbound.vue

@@ -3,19 +3,29 @@
   <div class="steel_inbound">
     <div class="sache">
       <span class="text">入库时间:</span>
-      <el-date-picker disabled v-model="startTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        disabled
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span class="text">至</span>
-      <el-date-picker disabled v-model="endTime" type="datetime" placeholder="选择日期">
+      <el-date-picker
+        disabled
+        v-model="endTime"
+        type="datetime"
+        placeholder="选择日期"
+      >
       </el-date-picker>
       <span class="text">物资类型</span>
       <el-autocomplete
-      class="inputStyle"
-      v-model="inputText"
-      :fetch-suggestions="querySearch"
-      placeholder="请输入内容"
-      @select="handleSelect"
-    ></el-autocomplete>
+        class="inputStyle"
+        v-model="inputText"
+        :fetch-suggestions="querySearch"
+        placeholder="请输入内容"
+        @select="handleSelect"
+      ></el-autocomplete>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
@@ -24,7 +34,11 @@
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-if="tableShow" :selectionType="selectionType"  v-bind.sync="options" >
+      <dilTable
+        v-if="tableShow"
+        :selectionType="selectionType"
+        v-bind.sync="options"
+      >
       </dilTable>
     </div>
   </div>
@@ -32,77 +46,92 @@
 
 <script>
 import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from '@/utils/util.js';
+import { getCookie } from "@/utils/util.js";
 export default {
-  data(){
-    return{
-      tableShow:false,
-      selectionType:"",
-      inputText:"",
+  data() {
+    return {
+      tableShow: false,
+      selectionType: "",
+      inputText: "",
       startTime: null,
       endTime: null,
-      options:{
+      options: {
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+3,
+        requestUrl: "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId=" + 3
         // selectionType: "select",
         // mapList: [],
-      },
-    }
+      }
+    };
   },
-  mounted(){
-
+  mounted() {
     var date = new Date();
-    let dateStr=this.formatDate(date, 'yyyy-MM-dd hh:mm:ss');
-    
-    this.startTime= Date.parse(new Date(dateStr));
-    this.endTime=new Date(this.startTime+86400000);
+    let dateStr = this.formatDate(date, "yyyy-MM-dd hh:mm:ss");
 
-    this.options.requestUrl= "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+3+"&startTime=" + sjTime(this.startTime) + "&endTime=" + sjTime(this.endTime) ;
-    this.tableShow=true;
+    this.startTime = Date.parse(new Date(dateStr));
+    this.endTime = new Date(this.startTime + 86400000);
+
+    this.options.requestUrl =
+      "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId=" +
+      3 +
+      "&startTime=" +
+      sjTime(this.startTime) +
+      "&endTime=" +
+      sjTime(this.endTime);
+    this.tableShow = true;
   },
-  methods:{
-    formatDate (date, fmt) {
-        if (/(y+)/.test(fmt)) {
-          fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
-        }
-        let o = {
-          'M+': date.getMonth() + 1,
-          'd+': date.getDate(),
-          'h+': 0,
-          'm+': 0,
-          's+': 0
+  methods: {
+    formatDate(date, fmt) {
+      if (/(y+)/.test(fmt)) {
+        fmt = fmt.replace(
+          RegExp.$1,
+          (date.getFullYear() + "").substr(4 - RegExp.$1.length)
+        );
       }
+      let o = {
+        "M+": date.getMonth() + 1,
+        "d+": date.getDate(),
+        "h+": 0,
+        "m+": 0,
+        "s+": 0
+      };
       for (let k in o) {
         if (new RegExp(`(${k})`).test(fmt)) {
-          let str = o[k] + ''
-          fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : this.padLeftZero(str))
+          let str = o[k] + "";
+          fmt = fmt.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? str : this.padLeftZero(str)
+          );
         }
-            }
-      return fmt
+      }
+      return fmt;
+    },
+    padLeftZero(str) {
+      return ("00" + str).substr(str.length);
+    },
+    querySearch(queryString, cb) {
+      var restaurants = [
+        { value: "螺纹钢" },
+        { value: "盘螺" },
+        { value: "乱尺" }
+      ];
+      var results = queryString
+        ? restaurants.filter(this.createFilter(queryString))
+        : restaurants;
+      // 调用 callback 返回建议列表的数据
+      cb(results);
     },
-    padLeftZero (str) {
-        return ('00' + str).substr(str.length)
+    createFilter(queryString) {
+      return restaurant => {
+        return (
+          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
+          0
+        );
+      };
     },
-     querySearch(queryString, cb) {
-        var restaurants = [ 
-                            {"value":"螺纹钢"},
-                            {"value":"盘螺"},
-                            {"value":"乱尺"}
-                          ];
-        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
-        // 调用 callback 返回建议列表的数据
-        cb(results);
-      },
-      createFilter(queryString) {
-        return (restaurant) => {
-          return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
-        };
-      },
     // inboundDetails(scope){
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
-    onclick(){
-
+    onclick() {
       let startTime = null;
       let endTime = null;
       if (this.startTime) {
@@ -113,10 +142,18 @@ export default {
       }
       if (startTime && endTime) {
         if (startTime < endTime) {
-          this.options.requestUrl = "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId="+3+"&startTime=" + startTime + "&endTime=" + endTime + "&i=" +new Date();
-          this.options.requestQuery={
-            "materialNames":this.inputText
-          }
+          this.options.requestUrl =
+            "/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId=" +
+            3 +
+            "&startTime=" +
+            startTime +
+            "&endTime=" +
+            endTime +
+            "&i=" +
+            new Date();
+          this.options.requestQuery = {
+            materialNames: this.inputText
+          };
           // this.selectionType="select";
         } else {
           this.startTime = null;
@@ -124,7 +161,7 @@ export default {
           this.$message.warning("开始时间要比结束时间早");
         }
       } else {
-         this.$message.warning("没有选择时间段");
+        this.$message.warning("没有选择时间段");
         // this.getRequestUrl()
       }
     },
@@ -132,48 +169,26 @@ export default {
       this.options.mapList = selection;
     },
     handleSelect(item) {
-        console.log(item);
+      console.log(item);
     },
-    onreserved(){
+    onreserved() {
       this.$router.push({
-        path: "/addSteelInbound",
+        path: "/addSteelInbound"
       });
     }
   }
-}
+};
 </script>
 
-<style lang="scss" scode>
-.steel_inbound{
-  margin-top: 30px;
-  margin-left: 20px;
-   
-    .sache{
-      display: flex;
-      margin-bottom: 10px;
-      padding-right: 10px;
-       .inputStyle{
-          width: 200px;
-          margin-right: 5px;
-        margin-left: 5px;
-        }
-      .text {
-        text-align: left;
-        line-height: 40px;
-      }
-      .el-date-editor {
-        margin-right: 5px;
-        margin-left: 5px;
-      }
-      .btn {
-        margin-left: 10px;
-      }
-      .el-select {
-      width: 100%;
-      .el-input__inner {
-        width: 150px;
-      }
-    }
-    }
+<style lang="scss" scoped>
+.steel_inbound {
+  .sache {
+    margin-left: 20px;
+    margin-top: 20px;
+  }
+  .table {
+    margin-left: 20px;
+    margin-top: 20px;
+  }
 }
-</style>
+</style>