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

+ 1 - 1
build/utils.js

@@ -17,7 +17,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
 
 let devModules = ['all']
-// let devModules = ['index', 'statisticalReport', 'inward']
+// let devModules = ['index', 'WMS']
 // let devModules = ['all']
 
 // let devModules = ['index', 'ADMINISTRATORS']

+ 52 - 25
src/utils/sharedJsFile.js

@@ -1,62 +1,89 @@
 // 把时间戳改为正常可读的时间
 export function renderTime(date) {
   if (date !== null) {
-    let dateee = new Date(date).toJSON();
+    let dateee = new Date(date).toJSON()
     return new Date(+new Date(dateee) + 8 * 3600 * 1000)
       .toISOString()
       .replace(/T/g, ' ')
-      .replace(/\.[\d]{3}Z/, '');
+      .replace(/\.[\d]{3}Z/, '')
   }
-  return null;
+  return null
 }
 export function sjTime(orderPlanInTime) {
-  var stringTime = renderTime(orderPlanInTime);
-  var timestamp1 = stringTime.replace(/-/g, '/');
-  return new Date(timestamp1).getTime();
+  var stringTime = renderTime(orderPlanInTime)
+  var timestamp1 = stringTime.replace(/-/g, '/')
+  return new Date(timestamp1).getTime()
 }
 export function isVehicleNumber(vehicleNumber) {
-  var result = false;
+  var result = false
   if (vehicleNumber != null) {
     if (vehicleNumber.length === 7) {
-      var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
-      result = express.test(vehicleNumber);
+      var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
+      result = express.test(vehicleNumber)
     }
   }
-  return result;
+  return result
 }
 
 export function isNumber(value) {
   // 验证是否为数字
-  var patrn = /^(-?\d+)(\.\d+)?$/;
+  var patrn = /^(-?\d+)(\.\d+)?$/
   if (patrn.exec(value) == null || value === '') {
-    return false;
+    return false
   } else {
-    return true;
+    return true
   }
 }
 export function isIntegerNumber(value) {
   // 验证是否为整数
-  var patrn = /^\+?[1-9][0-9]*$/g;
+  var patrn = /^\+?[1-9][0-9]*$/g
   if (patrn.exec(value) == null || value === '') {
-    return false;
+    return false
   } else {
-    return true;
+    return true
   }
 }
 export function stringToDate(dateStr, separator) {
   if (!separator) {
-    separator = '-';
+    separator = '-'
   }
-  var dateArr = dateStr.split(separator);
-  var year = parseInt(dateArr[0]);
-  var month;
+  var dateArr = dateStr.split(separator)
+  var year = parseInt(dateArr[0])
+  var month
   // 处理月份为04这样的情况
   if (dateArr[1].indexOf('0') === 0) {
-    month = parseInt(dateArr[1].substring(1));
+    month = parseInt(dateArr[1].substring(1))
   } else {
-    month = parseInt(dateArr[1]);
+    month = parseInt(dateArr[1])
+  }
+  var day = parseInt(dateArr[2])
+  var date = new Date(year, month - 1, day)
+  return date
+}
+
+export function isJsonStr(str) {
+  if (typeof str === 'string') {
+    try {
+      const obj = JSON.parse(str)
+      if (typeof obj === 'object' && obj) {
+        return true
+      } else {
+        return false
+      }
+    } catch (e) {
+      return false
+    }
+  }
+  return false
+}
+
+export function jsonStrToMap(jsonStr) {
+  if (isJsonStr(jsonStr)) {
+    const jsonObj = JSON.parse(jsonStr)
+    const map = new Map()
+    for (const k of Object.keys(jsonObj)) {
+      map.set(k, jsonObj[k])
+    }
+    return map
   }
-  var day = parseInt(dateArr[2]);
-  var date = new Date(year, month - 1, day);
-  return date;
 }

+ 28 - 4
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -5,6 +5,18 @@
       <div class="admin1">
         <el-tabs v-model="activeName" tab-position="left">
           <el-tab-pane label="补录计量实绩" name="first">
+            <span
+              >请在下发输入框输入需要转换的报文(便捷操作,可在下方直接输入)</span
+            >
+            <el-input
+              type="textarea"
+              placeholder="请输入内容"
+              v-model="jsonStringValue"
+            >
+            </el-input>
+            <el-button size="mini" type="primary" @click="transfer"
+              >转换</el-button
+            >
             <div class="switch">
               <el-switch
                 v-model="switchValue"
@@ -633,6 +645,7 @@
 </template>
 <script>
 import { toDateString, toDateNo } from '../app.js'
+import { jsonStrToMap } from '@/utils/sharedJsFile'
 export default {
   data() {
     return {
@@ -665,7 +678,8 @@ export default {
       enFactoryGatepost: null,
       gatePostId: null,
       orderStatus: null,
-      loadDetail: {}
+      loadDetail: {},
+      jsonStringValue: ''
     }
   },
   created() {
@@ -676,6 +690,16 @@ export default {
     this.information()
   },
   methods: {
+    transfer() {
+      console.log(jsonStrToMap(this.jsonStringValue), 'map')
+      const map = jsonStrToMap(this.jsonStringValue)
+      this.capacityName = map.get('carNo')
+      //判断是不是钢材销售,如果是钢材销售那就通过车牌号去查信息,如果不是钢材销售就拿运输订单号
+      if (map.get('flag') == 'GCXS') {
+        this.capacityName = map.get('carNo')
+        this.querySearchCapacity(this.capacityName)
+      }
+    },
     selectLoadingIdRemark() {
       if (
         this.loadDetail.orderNumber &&
@@ -854,12 +878,12 @@ export default {
           }
         })
     },
-    clearEnAndQue(){
+    clearEnAndQue() {
       console.log(this.orderNumber)
       this.axios
-        .post('/api/v1/bp/clearEnAndQue',{orderNumber:this.orderNumber})
+        .post('/api/v1/bp/clearEnAndQue', { orderNumber: this.orderNumber })
         .then(res => {
-          this.$message.success(res.data.data);
+          this.$message.success(res.data.data)
         })
     },
     updateLineSqe() {

+ 124 - 126
src/views/RMS/components/addCapacity.vue

@@ -63,23 +63,23 @@
 </template>
 
 <script>
-import PageTitle from "@/components/Page/Title";
-import { getCookie } from "@/utils/util.js";
+import PageTitle from '@/components/Page/Title'
+import { getCookie } from '@/utils/util.js'
 export default {
   components: { PageTitle },
   data() {
     return {
-      driverLicence: "",
+      driverLicence: '',
       addLoading: false,
       form1: {},
-      shippingCertificate: "",
+      shippingCertificate: '',
       form1Initialization: {
         capacityTypeId: 1,
-        capacityNumber: "",
-        capacityCorlor: "黄",
-        capacityOwneris: "否",
-        capacityVip: "否",
-        capacityBlacklist: "否"
+        capacityNumber: '',
+        capacityCorlor: '黄',
+        capacityOwneris: '否',
+        capacityVip: '否',
+        capacityBlacklist: '否'
       },
       value: undefined,
       carrierIds: null,
@@ -90,162 +90,162 @@ export default {
       userCode: null,
       carrierUserId: null,
       carrierId: null,
-      orgcode:null
-    };
+      orgcode: null
+    }
   },
   created() {
-    this.carrierUserId = getCookie("userId");
-    this.orgcode = getCookie("orgCode");
-    if(this.orgcode === "wuliuyunshubu" || this.orgcode === "dagangadmin"){
-      
+    this.carrierUserId = getCookie('userId')
+    this.orgcode = getCookie('orgCode')
+    if (this.orgcode === 'wuliuyunshubu' || this.orgcode === 'dagangadmin') {
     }
-    this.form1 = this.form1Initialization;
+    this.form1 = this.form1Initialization
   },
   mounted() {
     this.axios
       .post(
-        "/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=" + this.carrierUserId
+        '/api/v1/rms/getCarrierNameBySSOId?carrierSSOId=' + this.carrierUserId
       )
       .then(res => {
-        if (res.data.code == "200") {
+        if (res.data.code == '200') {
           // console.log(res.data.data);
           if (res.data.data) {
-            this.state = res.data.data.carrierName;
-            this.carrierIds = res.data.data.carrierId;
+            this.state = res.data.data.carrierName
+            this.carrierIds = res.data.data.carrierId
           }
         }
-      });
+      })
   },
   methods: {
     upCLick(val) {
-      this.num = val;
+      this.num = val
     },
     beforeUpload(file) {
-      this.upBool = true;
-      const isLt2M = file.size < 1024 * 1024 * 0.5;
+      this.upBool = true
+      const isLt2M = file.size < 1024 * 1024 * 0.5
       if (!isLt2M) {
-        this.$message.error("上传文件大小不能超过500kb!");
+        this.$message.error('上传文件大小不能超过500kb!')
       } else {
-        let size = file.size / 1024;
-        let _URL = window.URL || window.webkitURL;
-        let img  = new Image();
-        img.src  = _URL.createObjectURL(file);
+        let size = file.size / 1024
+        let _URL = window.URL || window.webkitURL
+        let img = new Image()
+        img.src = _URL.createObjectURL(file)
       }
-      return isLt2M;
+      return isLt2M
     },
     onError(err) {
       if (this.upBool) {
         if (this.num == 1) {
-          this.shippingCertificate = null;
-          this.imageUrl1 = null;
+          this.shippingCertificate = null
+          this.imageUrl1 = null
           // this.$message.error("上传失败");
         } else if (this.num == 2) {
-          this.businessLicense = null;
-          this.imageUrl2 = null;
+          this.businessLicense = null
+          this.imageUrl2 = null
           // this.$message.error("上传失败");
         } else if (this.num == 3) {
-          this.businessLicense1 = null;
-          this.imageUrl3 = null;
+          this.businessLicense1 = null
+          this.imageUrl3 = null
           // this.$message.error("上传失败");
         }
       }
     },
     handleAvatarSuccess(res, file) {
-      console.log(res, file);
+      console.log(res, file)
       if (res.code) {
-        this.upBool = false;
+        this.upBool = false
         if (this.num == 1) {
-          this.driverLicence = res.data;
-          this.shippingCertificate = file.name;
+          this.driverLicence = res.data
+          this.shippingCertificate = file.name
         } else if (this.num == 2) {
-          this.imageUrl2 = res.data;
-          this.businessLicense = file.name;
+          this.imageUrl2 = res.data
+          this.businessLicense = file.name
         } else if (this.num == 3) {
-          this.imageUrl3 = res.data;
-          this.businessLicense1 = file.name;
+          this.imageUrl3 = res.data
+          this.businessLicense1 = file.name
         }
-        this.$message.success("上传成功");
+        this.$message.success('上传成功')
       }
     },
     //承运商弹出层
     handleSelect(item) {
-      this.carrierIds = item.carrierId;
-      item.carrierName = this.state;
+      this.carrierIds = item.carrierId
+      item.carrierName = this.state
     },
     //以下是承运商边输边查搜索
     querySearch(queryString, cb) {
       this.axios
-        .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
+        .post('/api/v1/uc/getCarrierMesByLike?index=' + queryString)
         .then(res => {
-          if (res.data.code == "200") {
+          if (res.data.code == '200') {
             // console.log(res.data.data);
-            var restaurants = res.data.data;
+            var restaurants = res.data.data
             // console.log(restaurants, "restaurants");
             var results = queryString
               ? restaurants.filter(this.createFilter(queryString))
-              : restaurants;
+              : restaurants
             // 调用 callback 返回建议列表的数据
-            cb(results);
+            cb(results)
           }
-        });
+        })
     },
     createFilter(queryString) {
       return restaurants => {
         return (
           restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
           -1
-        );
-      };
+        )
+      }
     },
     //以上是承运商边输边查搜索
     deleteUser(userId) {
-      this.axios.delete("pass/v1/sysusers/" + userId).then(res => {
-        this.$message.error("添加失败,车牌可能重复");
-      });
+      this.axios.delete('pass/v1/sysusers/' + userId).then(res => {
+        this.$message.error('添加失败,车牌可能重复')
+      })
     },
     insertRole(userId, userCode) {
       this.axios
         .post(
-          "pass/v1/sysuserroles/addUserroles?userId=" +
+          'pass/v1/sysuserroles/addUserroles?userId=' +
             userId +
-            "&userCode=" +
+            '&userCode=' +
             userCode +
-            "&roleId=" +
-            "923693668269953024"
+            '&roleId=' +
+            '923693668269953024'
         )
         .then(res => {
-          if (res.code === "0") {
-            this.$message.success("操作成功");
-            this.saveLoading = false;
-            this.rolesTree.loading = false;
+          if (res.code === '0') {
+            this.$message.success('添加成功')
+            this.$router.push('capacity')
+            // this.saveLoading = false;
+            // this.rolesTree.loading = false;
           } else {
-            this.$message.error(res.message);
+            this.$message.error(res.message)
           }
-        });
+        })
     },
     isVehicleNumber(vehicleNumber) {
       // console.log(vehicleNumber);
-      var result = false;
+      var result = false
       if (vehicleNumber.length == 7) {
-        var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使场领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
-        result = express.test(vehicleNumber);
-      }else if(vehicleNumber.length == 8){
-        var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}[A-HJ-NP-Z]{1}(([A-HJ-NP-Z0-9]{5})|([0-9]{6}|[A-HJ-NP-Z]{1}[0-9]{5}|[0-9]{5}[A-HJ-NP-Z]{1}|[A-HJ-NP-Z]{2}[0-9]{4}))$/;
-        result = express.test(vehicleNumber);
+        var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使场领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/
+        result = express.test(vehicleNumber)
+      } else if (vehicleNumber.length == 8) {
+        var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}[A-HJ-NP-Z]{1}(([A-HJ-NP-Z0-9]{5})|([0-9]{6}|[A-HJ-NP-Z]{1}[0-9]{5}|[0-9]{5}[A-HJ-NP-Z]{1}|[A-HJ-NP-Z]{2}[0-9]{4}))$/
+        result = express.test(vehicleNumber)
       }
-      return result;
+      return result
     },
     makeSure() {
-      this.addLoading = true;
+      this.addLoading = true
       if (!this.isVehicleNumber(this.form1.capacityNumber.toUpperCase())) {
-        this.$message.error("车牌号格式不正确");
-        this.addLoading = false;
-        return;
+        this.$message.error('车牌号格式不正确')
+        this.addLoading = false
+        return
       }
       if (this.carrierIds == null) {
-        this.$message.error("请选择承运商");
-        this.addLoading = false;
-        return;
+        this.$message.error('请选择承运商')
+        this.addLoading = false
+        return
       }
       let RmsCapacity = {
         capacityTypeId: this.form1.capacityTypeId,
@@ -258,9 +258,9 @@ export default {
         remark: this.form1.remark,
         carrierId: this.carrierIds,
         state: this.state,
-        capacityTel:this.form1.capacityTel
-      };
-      console.log(RmsCapacity);
+        capacityTel: this.form1.capacityTel
+      }
+      console.log(RmsCapacity)
       if (
         RmsCapacity.capacityNumber == null ||
         RmsCapacity.capacityCorlor == null ||
@@ -268,85 +268,83 @@ export default {
         RmsCapacity.capacityVip == null ||
         RmsCapacity.capacityBlacklist == null
       ) {
-        this.$message.error("存在空值!");
-        this.addLoading = false;
+        this.$message.error('存在空值!')
+        this.addLoading = false
       } else {
         //新增SSO运力账号
-        var formData = new FormData();
-        formData.append("userCode", this.form1.capacityNumber.toUpperCase());
-        formData.append("orgCode", "yunli");
-        formData.append("orgName", "运力");
+        var formData = new FormData()
+        formData.append('userCode', this.form1.capacityNumber.toUpperCase())
+        formData.append('orgCode', 'yunli')
+        formData.append('orgName', '运力')
 
-        formData.append("groupId", "506514577756917769");
-        formData.append("companyId", "713710108567277568");
-        formData.append("orgId", "924126716337721344");
+        formData.append('groupId', '506514577756917769')
+        formData.append('companyId', '713710108567277568')
+        formData.append('orgId', '924126716337721344')
         // console.log(formData.get("userCode"));
         // console.log(typeof formData);
         this.$store
-          .dispatch("system/usersManage/addUser", formData)
+          .dispatch('system/usersManage/addUser', formData)
           .then(res => {
             // console.log(res);
-            if (res.code === "0") {
+            if (res.code === '0') {
               // console.log(res.data.userId);
-              this.userId = res.data.userId;
-              this.userCode = res.data.userCode;
-              RmsCapacity.ssoId = res.data.userId;
+              this.userId = res.data.userId
+              this.userCode = res.data.userCode
+              RmsCapacity.ssoId = res.data.userId
               this.axios
-                .post("/api/v1/rms/insertCapacity", RmsCapacity)
+                .post('/api/v1/rms/insertCapacity', RmsCapacity)
                 .then(res => {
                   if (res.data.data == 1) {
-                    this.insertRole(this.userId, this.userCode);
-                    this.$message.success("添加成功");
-                    this.$router.push("capacity");
-                  } else if (res.data.code == "201") {
-                    this.deleteUser(this.userId);
+                    this.insertRole(this.userId, this.userCode)
+                  } else if (res.data.code == '201') {
+                    this.deleteUser(this.userId)
                   } else {
-                    this.deleteUser(this.userId);
+                    this.deleteUser(this.userId)
                   }
-                });
+                })
             } else {
               // console.log(RmsCapacity, "RmsCapacity");
-              if (res.message == "账号已被注册") {
+              if (res.message == '账号已被注册') {
                 this.$confirm(
-                  "该账号已经被注册, 是否确定新增承运商绑定关系?",
-                  "提示",
+                  '该账号已经被注册, 是否确定新增承运商绑定关系?',
+                  '提示',
                   {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning"
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
                   }
                 )
                   .then(() => {
                     this.axios
-                      .post("/api/v1/rms/insertCapacity", RmsCapacity)
+                      .post('/api/v1/rms/insertCapacity', RmsCapacity)
                       .then(res => {
                         // console.log(res, "res");
                         if (res.data.data == 0) {
-                          this.$message.success("新增承运商绑定关系成功!");
-                          this.$router.push("capacity");
+                          this.$message.success('新增承运商绑定关系成功!')
+                          this.$router.push('capacity')
                         } else {
-                          this.$message.error("该绑定关系已存在!");
+                          this.$message.error('该绑定关系已存在!')
                         }
-                      });
+                      })
                   })
                   .catch(() => {
                     this.$message({
-                      type: "info",
-                      message: "已取消删除"
-                    });
-                  });
+                      type: 'info',
+                      message: '已取消删除'
+                    })
+                  })
               }
             }
-          });
-        this.addLoading = false;
+          })
+        this.addLoading = false
       }
     },
     // 取消
     cancel() {
-      this.$router.go(-1);
+      this.$router.go(-1)
     }
   }
-};
+}
 </script>
 <style lang="scss">
 .shippingCertificate {

+ 37 - 2
src/views/WMS/components/steel/bar1_steel/bar1_steel_inbound.vue

@@ -38,11 +38,14 @@
           <el-button type="primary" class="btn" @click="onreserved">
             入库
           </el-button>
+          <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+            导出
+          </el-button>
         </el-form-item>
       </el-form>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
+      <dilTable v-bind.sync="options" @func="func">
         <!-- <el-table-column fixed="right" label="操作" width="150">
 								<template slot-scope="scope">
 									<el-button type="text" size="mini" @click="inboundDetails(scope)">
@@ -61,6 +64,7 @@ import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
+      tableTitle: '一棒预留转入库(未上传金蝶)',
       inputText: '',
       startTime: null,
       endTime: null,
@@ -69,7 +73,9 @@ export default {
         requestUrl: ''
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      dataColumnData: [],
+      totalArr: []
     }
   },
   created() {
@@ -90,6 +96,35 @@ export default {
   },
 
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+      console.log(res, 'res')
+    },
+    //导出excel
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(

+ 88 - 34
src/views/WMS/components/steel/bar1_steel/bar1_steel_reserved.vue

@@ -2,29 +2,45 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input
-        placeholder="请输入内容"
-        v-model="inputText"
-        clearable
-        style="width:250px"
-      >
-      </el-input>
-
-      <!-- <span>入库时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
-      </el-date-picker>
-      <span>至</span>
-      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
-      </el-date-picker> -->
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button type="primary" class="btn" @click="onreserved">
-        预留
-      </el-button>
+      <el-form :inline="true">
+        <el-form-item>
+          <span class="text">入库时间:</span>
+          <el-date-picker
+            v-model="startTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+          <span class="text">至</span>
+          <el-date-picker
+            v-model="endTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-input
+          placeholder="请输入内容"
+          v-model="inputText"
+          clearable
+          style="width: 200px;"
+        >
+        </el-input>
+        <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+        <el-button type="primary" class="btn" @click="onreserved">
+          预留
+        </el-button>
+        <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+          导出
+        </el-button>
+      </el-form>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
+      <dilTable v-bind.sync="options" @func="func">
         <!-- <el-table-column fixed="right" label="操作" width="150">
 								<template slot-scope="scope">
 									<el-button type="text" size="mini" @click="inboundDetails(scope)">
@@ -38,44 +54,82 @@
 </template>
 
 <script>
-import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from "@/utils/util.js";
+import { sjTime } from '@/utils/sharedJsFile'
+import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
-      inputText: "",
+      tableTitle: '一棒入库转预留(已上传金蝶)',
+      inputText: '',
       startTime: null,
       endTime: null,
       options: {
         // first请求数据的地址
         requestUrl:
-          "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" + 1
+          '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' + 1
         // selectionType: "select",
         // mapList: [],
-      }
-    };
+      },
+
+      totalArr: [],
+      dataColumnData: []
+    }
   },
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+    },
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     // inboundDetails(scope){
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     onclick() {
+      console.log('我尽力了')
+      if (this.startTime && this.endTime) {
+        this.options.requestQuery = {
+          startTime: sjTime(this.startTime),
+          endTime: sjTime(this.endTime)
+        }
+      }
       this.options.requestUrl =
-        "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" +
+        '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' +
         1 +
-        "&con=" +
-        this.inputText;
+        '&con=' +
+        this.inputText
     },
     selectionChange(selection) {
-      this.options.mapList = selection;
+      this.options.mapList = selection
     },
     onreserved() {
       this.$router.push({
-        path: "/bar1_addSteelReserved"
-      });
+        path: '/bar1_addSteelReserved'
+      })
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scode>

+ 39 - 4
src/views/WMS/components/steel/bar2_steel/bar2_steel_inbound.vue

@@ -2,9 +2,9 @@
 <template>
   <div class="steel_inbound02">
     <div class="sache">
-      <el-form :inline="true">
+      <el-form inline="true">
         <el-form-item>
-          <span class="text">入库时间:</span>
+          <span class="text">预留时间:</span>
           <el-date-picker
             v-model="startTime"
             type="datetime"
@@ -38,11 +38,14 @@
           <el-button type="primary" class="btn" @click="onreserved">
             入库
           </el-button>
+          <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+            导出
+          </el-button>
         </el-form-item>
       </el-form>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options"> </dilTable>
+      <dilTable v-bind.sync="options" @func="func"> </dilTable>
     </div>
   </div>
 </template>
@@ -53,6 +56,7 @@ import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
+      tableTitle: '二棒预留转入库(未上传金蝶)',
       inputText: '',
       startTime: null,
       endTime: null,
@@ -61,7 +65,9 @@ export default {
         requestUrl: ''
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      dataColumnData: [],
+      totalArr: []
     }
   },
   created() {
@@ -82,6 +88,35 @@ export default {
   },
 
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+      console.log(res, 'res')
+    },
+    //导出excel
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(

+ 86 - 34
src/views/WMS/components/steel/bar2_steel/bar2_steel_reserved.vue

@@ -2,29 +2,45 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input
-        placeholder="请输入内容"
-        v-model="inputText"
-        clearable
-        style="width:250px"
-      >
-      </el-input>
-
-      <!-- <span>入库时间:</span>
-      <el-date-picker v-model="startTime" type="datetime" placeholder="选择日期">
-      </el-date-picker>
-      <span>至</span>
-      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
-      </el-date-picker> -->
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button type="primary" class="btn" @click="onreserved">
-        预留
-      </el-button>
+      <el-form inline="true">
+        <el-form-item>
+          <span class="text">入库时间:</span>
+          <el-date-picker
+            v-model="startTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+          <span class="text">至</span>
+          <el-date-picker
+            v-model="endTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-input
+          placeholder="请输入内容"
+          v-model="inputText"
+          clearable
+          style="width: 200px;"
+        >
+        </el-input>
+        <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+        <el-button type="primary" class="btn" @click="onreserved">
+          预留
+        </el-button>
+        <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+          导出
+        </el-button>
+      </el-form>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
+      <dilTable v-bind.sync="options" @func="func">
         <!-- <el-table-column fixed="right" label="操作" width="150">
 								<template slot-scope="scope">
 									<el-button type="text" size="mini" @click="inboundDetails(scope)">
@@ -38,44 +54,80 @@
 </template>
 
 <script>
-import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from "@/utils/util.js";
+import { sjTime } from '@/utils/sharedJsFile'
+import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
-      inputText: "",
+      tableTitle: '二棒入库转预留(已上传金蝶)',
+      inputText: '',
       startTime: null,
       endTime: null,
       options: {
         // first请求数据的地址
         requestUrl:
-          "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" + 2
+          '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' + 2
         // selectionType: "select",
         // mapList: [],
-      }
-    };
+      },
+      totalArr: [],
+      dataColumnData: []
+    }
   },
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+    },
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     // inboundDetails(scope){
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     onclick() {
+      if (this.startTime && this.endTime) {
+        this.options.requestQuery = {
+          startTime: sjTime(this.startTime),
+          endTime: sjTime(this.endTime)
+        }
+      }
       this.options.requestUrl =
-        "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" +
+        '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' +
         2 +
-        "&con=" +
-        this.inputText;
+        '&con=' +
+        this.inputText
     },
     selectionChange(selection) {
-      this.options.mapList = selection;
+      this.options.mapList = selection
     },
     onreserved() {
       this.$router.push({
-        path: "/bar2_addSteelReserved"
-      });
+        path: '/bar2_addSteelReserved'
+      })
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>

+ 38 - 4
src/views/WMS/components/steel/steel_inbound.vue

@@ -4,7 +4,7 @@
     <div class="sache">
       <el-form :inline="true">
         <el-form-item>
-          <span class="text">入库时间:</span>
+          <span class="text">预留时间:</span>
           <el-date-picker
             v-model="startTime"
             type="datetime"
@@ -38,6 +38,9 @@
           <el-button type="primary" class="btn" @click="onreserved">
             入库
           </el-button>
+          <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+            导出
+          </el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -46,6 +49,7 @@
         v-if="tableShow"
         :selectionType="selectionType"
         v-bind.sync="options"
+        @func="func"
       >
       </dilTable>
     </div>
@@ -57,6 +61,7 @@ import { sjTime } from '@/utils/sharedJsFile'
 export default {
   data() {
     return {
+      tableTitle: '高线预留转入库(未上传金蝶)',
       tableShow: false,
       selectionType: '',
       inputText: '',
@@ -67,16 +72,16 @@ export default {
         requestUrl: ''
         // selectionType: "select",
         // mapList: [],
-      }
+      },
+      dataColumnData: [],
+      totalArr: []
     }
   },
   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)
-
     this.options.requestUrl =
       '/api/v1/wms/getWmsInboundResult?apiId=371&warehouseId=' +
       3 +
@@ -87,6 +92,35 @@ export default {
     this.tableShow = true
   },
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+      console.log(res, 'res')
+    },
+    //导出excel
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(

+ 42 - 17
src/views/WMS/components/steel/steel_rebound.vue

@@ -2,48 +2,73 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input
-        placeholder="请输入内容"
-        v-model="inputText"
-        clearable>
+      <el-form-item>
+        <span class="text">入库时间:</span>
+        <el-date-picker
+          v-model="startTime"
+          type="datetime"
+          placeholder="选择日期"
+          style="width: 200px;"
+        >
+        </el-date-picker>
+        <span class="text">至</span>
+        <el-date-picker
+          v-model="endTime"
+          type="datetime"
+          placeholder="选择日期"
+          style="width: 200px;"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-input placeholder="请输入内容" v-model="inputText" clearable>
       </el-input>
       <el-button type="primary" class="btn" @click="onclick">
         <i class="el-icon-search"></i>查询
       </el-button>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options">
-      </dilTable>
+      <dilTable v-bind.sync="options" @func="func"> </dilTable>
     </div>
   </div>
 </template>
 
 <script>
+import { sjTime } from '@/utils/sharedJsFile'
 export default {
-  data(){
-    return{
-      inputText:"",
-      options:{
+  data() {
+    return {
+      inputText: '',
+      options: {
         // first请求数据的地址
-        requestUrl: "/api/v1/wms/getWmsReboundResult?apiId=161",
+        requestUrl: '/api/v1/wms/getWmsReboundResult?apiId=161'
       },
+      startTime: null,
+      endTime: null
     }
   },
-  methods:{
-    onclick(){
-      console.log("点击事件");
+  methods: {
+    func(res) {},
+    onclick() {
+      if (this.startTime && this.endTime) {
+        this.options.requestQuery = {
+          startTime: sjTime(this.startTime),
+          endTime: sjTime(this.endTime)
+        }
+      }
+      this.options.requestUrl =
+        '/api/v1/wms/getWmsReboundResult?apiId=161&con=' + this.inputText
     }
   }
 }
 </script>
 
 <style lang="scss" scode>
-.steel_inbound{
-  .sache{
+.steel_inbound {
+  .sache {
     height: 5rem;
     display: flex;
     align-items: center;
     padding-left: 1.875rem;
   }
 }
-</style>
+</style>

+ 82 - 22
src/views/WMS/components/steel/steel_reserved.vue

@@ -2,60 +2,120 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <el-input placeholder="请输入内容" v-model="inputText" clearable>
-      </el-input>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button type="primary" class="btn" @click="onreserved">
-        预留
-      </el-button>
+      <el-form inline="true">
+        <el-form-item>
+          <span class="text">入库时间:</span>
+          <el-date-picker
+            v-model="startTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+          <span class="text">至</span>
+          <el-date-picker
+            v-model="endTime"
+            type="datetime"
+            placeholder="选择日期"
+            style="width: 200px;"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-input placeholder="请输入内容" v-model="inputText" clearable>
+        </el-input>
+        <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>查询
+        </el-button>
+        <el-button type="primary" class="btn" @click="onreserved">
+          预留
+        </el-button>
+        <el-button type="primary" class="btn" @click="exportAllReportToExcel">
+          导出
+        </el-button>
+      </el-form>
     </div>
     <div class="table">
-      <dilTable v-bind.sync="options"> </dilTable>
+      <dilTable v-bind.sync="options" @func="func"> </dilTable>
     </div>
   </div>
 </template>
 
 <script>
-import { sjTime } from "@/utils/sharedJsFile";
-import { getCookie } from "@/utils/util.js";
+import { sjTime } from '@/utils/sharedJsFile'
+import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
-      inputText: "",
+      tableTitle: '高线入库转预留(已上传金蝶)',
+      inputText: '',
       startTime: null,
       endTime: null,
       options: {
         // first请求数据的地址
         requestUrl:
-          "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" + 3
+          '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' + 3
         // selectionType: "select",
         // mapList: [],
-      }
-    };
+      },
+      totalArr: [],
+      dataColumnData: []
+    }
   },
   methods: {
+    func(res) {
+      this.dataColumnData = res.columnData
+      this.totalArr = res.list
+    },
+    //导出excel
+    exportAllReportToExcel() {
+      var title = this.tableTitle
+      let tHeader = []
+      let filterVal = []
+      this.dataColumnData.forEach(e1 => {
+        if (tHeader.indexOf(e1.label) === -1) {
+          tHeader.push(e1.label)
+        }
+        if (filterVal.indexOf(e1.prop) === -1) {
+          filterVal.push(e1.prop)
+        }
+      })
+      //导出为excel
+      this.downloadLoading = true
+      require.ensure([], () => {
+        const {
+          export_json_to_excel
+        } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
+        // let list = this.$refs.excelDom.dataTabel;
+        let data = this.totalArr.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
+        export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
+      })
+    },
     // inboundDetails(scope){
     //   	this.$router.push("/inboundDetails/" + scope.row.inboundId)
     // },
     onclick() {
+      if (this.startTime && this.endTime) {
+        this.options.requestQuery = {
+          startTime: sjTime(this.startTime),
+          endTime: sjTime(this.endTime)
+        }
+      }
       this.options.requestUrl =
-        "/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=" +
+        '/api/v1/wms/getWmsReservedResult?apiId=371&warehouseId=' +
         3 +
-        "&con=" +
-        this.inputText;
+        '&con=' +
+        this.inputText
     },
     selectionChange(selection) {
-      this.options.mapList = selection;
+      this.options.mapList = selection
     },
     onreserved() {
       this.$router.push({
-        path: "/addSteelReserved"
-      });
+        path: '/addSteelReserved'
+      })
     }
   }
-};
+}
 </script>
 
 <style lang="scss" scoped>