gjy 3 jaren geleden
bovenliggende
commit
ab30e83596

+ 1 - 0
package.json

@@ -54,6 +54,7 @@
     "element-ui": "^2.13.2",
     "form-making-advanced": "^1.2.6",
     "html2canvas": "^1.3.2",
+    "js-base64": "^3.7.2",
     "js-cookie": "2.2.0",
     "lodash": "^4.17.20",
     "node-gyp": "^5.0.6",

+ 2 - 0
src/api/V2/warehouse/index.js

@@ -55,6 +55,8 @@ export const API_GET_GOODSNAME_XIALA = '/warehouseInOutInfo/selectTemporaryGoods
 export const API_GET_WAREHOUSE_LIST = '/warehouseInOutInfo/selectWarehouseInOutInfoTemporary'
 //任务列表
 export const API_GET_WAREHOUSE_TASKLIST = '/inOutWarehouseTask/selectInOutWarehouseTask'
+// 成本管理
+export const API_GET_COSTMANAGEMENT = '/costManagementInfo/selectCostManagementInfo'
 
 
 

+ 2 - 0
src/lang/zh.js

@@ -502,6 +502,7 @@ export default {
 
     //仓库管理
     warehouseManagementList: '仓库管理',
+    costmanagement:'成本管理',
     warehouseManagementAdd: '仓库管理添加',
     warehouseManagementEdit: '仓库管理编辑',
     warehouseManagementPut: '入库',
@@ -4802,6 +4803,7 @@ export default {
   //仓库管理
   warehouseManagement: {
     warehouseManagementList: '仓库管理',
+    costmanagement:'成本管理',
     warehouseManagementAdd: '仓库管理添加',
     warehouseManagementEdit: '仓库管理编辑',
     warehouseManagementPut: '入库',

+ 3 - 1
src/model/warehouse/index.js

@@ -27,6 +27,7 @@ import {
     API_GET_GOODSNAME_XIALA,
     API_GET_WAREHOUSE_LIST,
     API_GET_WAREHOUSE_TASKLIST,
+    API_GET_COSTMANAGEMENT
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
 // 列表
@@ -82,7 +83,8 @@ export const completeList = appRx.get(API_GET_WAREHOUSE_LIST, errorCatcher, erro
 export const xialaNo = appRx.get(API_GET_WAREHOUSE_NO, errorCatcher, errorHandle, filter)
 //任务列表
 export const taskList = appRx.get(API_GET_WAREHOUSE_TASKLIST,errorCatcher, errorHandle, filter)
-
+// 成本管理
+export const getcost = appRx.get(API_GET_COSTMANAGEMENT,errorCatcher, errorHandle, filter)
 
 
 

+ 99 - 0
src/views/tranManagement/tranManagementFireFeedback.vue

@@ -121,6 +121,18 @@
         </ws-info-table>
       </div>
       <div class="small-title" style="font-size: 16px">装车详情</div>
+      <!-- 导入 -->
+      <div style="font-size: 16px; width: 100%;  text-align: right">
+        <el-upload style="margin-left: 8px;"
+          class="upload-demo inline-block margin-right-10"
+          action=""
+          :on-change="handleChange"
+          :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <el-button  type="primary">导入</el-button>
+        </el-upload>
+      </div>
       <div class="liaison">
         <div
           style="width: 100%"
@@ -365,6 +377,7 @@ export default {
       staffList: [],
       options: [],
       carModel: [],
+      fileTemp:{},
       tranCarInfoList: {
         loadPoundImg: '',
       },
@@ -386,6 +399,7 @@ export default {
     this.getList()
   },
   computed: {
+    
     totalStorage: function () {
       var maxStorage = 0
       for (var i = 0; i < this.freightspace.length; i++) {
@@ -408,6 +422,91 @@ export default {
     },
   },
   methods: {
+    handleChange(file, fileList) {
+            this.fileTemp = file.raw
+                let fileName = file.raw.name
+                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
+                // 判断上传文件格式
+                if (this.fileTemp) {
+                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
+                        this.importf(this.fileTemp)
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: '附件格式错误,请删除后重新上传!'
+                        })
+                    }
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: '请上传附件!'
+                    })
+                }
+
+    },
+ importf(obj) {
+                this.dialogVisible = true;
+                let _this = this;
+                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
+                this.file = event.currentTarget.files[0];
+                var rABS = false; //是否将文件读取为二进制字符串
+                var f = this.file;
+                var reader = new FileReader();
+                //if (!FileReader.prototype.readAsBinaryString) {
+                FileReader.prototype.readAsBinaryString = function (f) {
+                    var binary = "";
+                    var rABS = false; //是否将文件读取为二进制字符串
+                    var pt = this;
+                    var wb; //读取完成的数据
+                    var outdata;
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var bytes = new Uint8Array(reader.result);
+                        var length = bytes.byteLength;
+                        for (var i = 0; i < length; i++) {
+                            binary += String.fromCharCode(bytes[i]);
+                        }
+                        var XLSX = require('xlsx');
+                        if (rABS) {
+                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                                type: 'base64'
+                            });
+                        } else {
+                            wb = XLSX.read(binary, {
+                                type: 'binary'
+                            });
+                        }
+                        // outdata就是你想要的东西 excel导入的数据
+                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+                        // excel 数据再处理
+                        let arr = []
+                        outdata.map(v => {
+                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
+                            console.log(jsonString);
+                            v = JSON.parse(jsonString);
+                            let obj = {}
+                            //xxx代表列名
+                            obj.boxNo = v.车厢号
+                            obj.loadNetWeight = v.装车净重
+                            obj.loadingDate = toString(v.装车日期)
+                            obj.status= v.状态
+                            obj.unloadPoundImg = v.磅单
+                            console.log(obj)
+                            _this.freightspace.push(obj)
+                        })
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
+                    }
+                    reader.readAsArrayBuffer(f);
+                }
+                if (rABS) {
+                    reader.readAsArrayBuffer(f);
+                } else {
+                    reader.readAsBinaryString(f);
+                }
+                console.log(reader)
+            },
     marker: function (item) {
       this.deptBudgetList.warehousePositioning =
         item.lnglat.lat + ',' + item.lnglat.lng

+ 96 - 0
src/views/tranManagement/tranManagementFireReceivingFeedback.vue

@@ -121,6 +121,17 @@
         </ws-info-table>
       </div>
       <div class="small-title" style="font-size: 16px">卸车详情</div>
+      <div style="font-size: 16px; width: 100%;  text-align: right">
+        <el-upload style="margin-left: 8px;"
+          class="upload-demo inline-block margin-right-10"
+          action=""
+          :on-change="handleChange"
+          :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <el-button  type="primary">导入</el-button>
+        </el-upload>
+      </div>
       <div class="liaison">
         <div
           style="width: 100%"
@@ -414,6 +425,91 @@ export default {
     },
   },
   methods: {
+    handleChange(file, fileList) {
+            this.fileTemp = file.raw
+                let fileName = file.raw.name
+                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
+                // 判断上传文件格式
+                if (this.fileTemp) {
+                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
+                        this.importf(this.fileTemp)
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: '附件格式错误,请删除后重新上传!'
+                        })
+                    }
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: '请上传附件!'
+                    })
+                }
+
+    },
+ importf(obj) {
+                this.dialogVisible = true;
+                let _this = this;
+                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
+                this.file = event.currentTarget.files[0];
+                var rABS = false; //是否将文件读取为二进制字符串
+                var f = this.file;
+                var reader = new FileReader();
+                //if (!FileReader.prototype.readAsBinaryString) {
+                FileReader.prototype.readAsBinaryString = function (f) {
+                    var binary = "";
+                    var rABS = false; //是否将文件读取为二进制字符串
+                    var pt = this;
+                    var wb; //读取完成的数据
+                    var outdata;
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var bytes = new Uint8Array(reader.result);
+                        var length = bytes.byteLength;
+                        for (var i = 0; i < length; i++) {
+                            binary += String.fromCharCode(bytes[i]);
+                        }
+                        var XLSX = require('xlsx');
+                        if (rABS) {
+                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                                type: 'base64'
+                            });
+                        } else {
+                            wb = XLSX.read(binary, {
+                                type: 'binary'
+                            });
+                        }
+                        // outdata就是你想要的东西 excel导入的数据
+                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+                        // excel 数据再处理
+                        let arr = []
+                        outdata.map(v => {
+                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
+                            console.log(jsonString);
+                            v = JSON.parse(jsonString);
+                            let obj = {}
+                            //xxx代表列名
+                            obj.boxNo = v.车厢号
+                            obj.loadNetWeight = v.装车净重
+                            obj.loadingDate = toString(v.装车日期)
+                            obj.status= v.状态
+                            obj.unloadPoundImg = v.磅单
+                            console.log(obj)
+                            _this.freightspace.push(obj)
+                        })
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
+                    }
+                    reader.readAsArrayBuffer(f);
+                }
+                if (rABS) {
+                    reader.readAsArrayBuffer(f);
+                } else {
+                    reader.readAsBinaryString(f);
+                }
+                console.log(reader)
+            },
     marker: function (item) {
       this.deptBudgetList.warehousePositioning =
         item.lnglat.lat + ',' + item.lnglat.lng

+ 113 - 8
src/views/tranManagement/tranManagementReceivingloading.vue

@@ -81,15 +81,30 @@
 
           <div class="small-title" style="font-size: 16px;width: 50%;float: left;">卸车详情</div>
           <!-- 导入 -->
-          <div style="font-size: 16px;width: 50%; margin-left: 1150px;">
-          <el-button
-            class="bg-bottom"
-            type="primary"
-            size="small"
-            @click="import(deptBudgetList)"
-            >导入</el-button
+          <div style="font-size: 16px; width: 100%;text-align: right;">
+      <!-- <el-upload style="margin-left: 8px;"
+          class=""
+          action="https://www.zthymaoyi.com/upload/admin"
+          :show-file-list="false"
+          :on-success="
+          (res, file) => {
+            uploadSuccessHandle(res)
+          }
+        "
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
           >
-        </div>
+          <el-button  type="primary">导入</el-button>
+        </el-upload> -->
+        <el-upload style="margin-left: 8px;"
+          class="upload-demo inline-block margin-right-10"
+          action=""
+          :on-change="handleChange"
+          :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <el-button  type="primary">导入</el-button>
+        </el-upload>
+    </div>
           <div
             class="driver position liaison"
             v-for="(item, index) in deptBudgetList.tranCarInfoList"
@@ -335,6 +350,96 @@ export default {
     this.getList()
   },
   methods: {
+    handleChange(file, fileList) {
+            this.fileTemp = file.raw
+                let fileName = file.raw.name
+                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
+                // 判断上传文件格式
+                if (this.fileTemp) {
+                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
+                        this.importf(this.fileTemp)
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: '附件格式错误,请删除后重新上传!'
+                        })
+                    }
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: '请上传附件!'
+                    })
+                }
+
+    },
+ importf(obj) {
+                this.dialogVisible = true;
+                let _this = this;
+                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
+                this.file = event.currentTarget.files[0];
+                var rABS = false; //是否将文件读取为二进制字符串
+                var f = this.file;
+                var reader = new FileReader();
+                //if (!FileReader.prototype.readAsBinaryString) {
+                FileReader.prototype.readAsBinaryString = function (f) {
+                    var binary = "";
+                    var rABS = false; //是否将文件读取为二进制字符串
+                    var pt = this;
+                    var wb; //读取完成的数据
+                    var outdata;
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var bytes = new Uint8Array(reader.result);
+                        var length = bytes.byteLength;
+                        for (var i = 0; i < length; i++) {
+                            binary += String.fromCharCode(bytes[i]);
+                        }
+                        var XLSX = require('xlsx');
+                        if (rABS) {
+                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                                type: 'base64'
+                            });
+                        } else {
+                            wb = XLSX.read(binary, {
+                                type: 'binary'
+                            });
+                        }
+                        // outdata就是你想要的东西 excel导入的数据
+                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+                        // excel 数据再处理
+                        let arr = []
+                        outdata.map(v => {
+                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
+                            console.log(jsonString);
+                            v = JSON.parse(jsonString);
+                            let obj = {}
+                            //xxx代表列名
+                            obj.temporaryDriverFlag = v.临时司机标识
+                            obj.caseNo= v.箱号
+                            obj.titleNo= v.封号
+                            obj.driverPhone = v.司机电话
+                            obj.driver=v.司机姓名
+                            obj.loadNetWeight = v.装车净重
+                            obj.loadingDate = toString(v.装车日期)
+                            obj.status= v.状态
+                            obj.carNo = v.车牌号
+                            obj.unloadPoundImg = v.磅单
+                            console.log(obj)
+                            _this.freightspace.push(obj)
+                        })
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
+                    }
+                    reader.readAsArrayBuffer(f);
+                }
+                if (rABS) {
+                    reader.readAsArrayBuffer(f);
+                } else {
+                    reader.readAsBinaryString(f);
+                }
+                console.log(reader)
+            },
     //返回按钮
     revert() {
       this.$router.push({ path: 'tranManagementReceivingFeedback' })

+ 10 - 10
src/views/tranManagement/tranManagementShippingFeedback.vue

@@ -144,9 +144,6 @@
           action=""
           :on-change="handleChange"
           :show-file-list="false"
-          :on-remove="handleRemove"
-          :file-list="fileListUpload"
-          :limit="limitUpload"
           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
           :auto-upload="false">
           <el-button  type="primary">导入</el-button>
@@ -601,10 +598,14 @@ export default {
                             obj.binNumber = v.仓位号
                             obj.positionWeight=v.散船重量
                             obj.loadNetWeight = v.装船净重
-                            obj.loadingDate = v.装船日期
-                            arr.push(obj)
+                            obj.loadingDate = toString(v.装船日期)
+                            obj.status= v.状态
+                            obj.shipType = v.类型
+                            console.log(obj)
+                            _this.freightspace.push(obj)
                         })
-                        _this.freightspace.concat(arr)
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
                     }
                     reader.readAsArrayBuffer(f);
                 }
@@ -613,6 +614,7 @@ export default {
                 } else {
                     reader.readAsBinaryString(f);
                 }
+                console.log(reader)
             },
     uploadSectionFile (param) {
       var fileName = param.file.name.split('.')
@@ -1189,16 +1191,14 @@ export default {
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 19%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;
   background: #f6f7fc;
 }
-/deep/.liaison .flex {
-  display: contents;
-}
 /deep/.liaison .ws-info-table {
+  width: 100%;
   background: #f6f7fc;
   border-radius: 4px;
   border: 1px solid #d8dce6;

+ 124 - 17
src/views/tranManagement/tranManagementTransporFeedback.vue

@@ -92,7 +92,7 @@
       <div class="small-title" style="font-size: 16px; width: 50%;float: left;">装车详情</div>
           <!-- 导入 -->
       <div style="font-size: 16px; width: 50%;float: left;text-align: right;">
-      <el-upload style="margin-left: 8px;"
+      <!-- <el-upload style="margin-left: 8px;"
           class=""
           action="https://www.zthymaoyi.com/upload/admin"
           :show-file-list="false"
@@ -104,21 +104,16 @@
           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
           >
           <el-button  type="primary">导入</el-button>
-        </el-upload>
+        </el-upload> -->
         <el-upload style="margin-left: 8px;"
-          class="upload-demo"
-          action="https://www.zthymaoyi.com/upload/admin"
+          class="upload-demo inline-block margin-right-10"
+          action=""
+          :on-change="handleChange"
           :show-file-list="false"
-          :on-success="
-          (res, file) => {
-            uploadSuccessHandle1(res)
-          }
-        "
           accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-          >
+          :auto-upload="false">
           <el-button  type="primary">导入</el-button>
         </el-upload>
-       
     </div>
       <div class="liaison">
         <div
@@ -427,7 +422,9 @@ export default {
       tranCarInfoList: {
         loadPoundImg:''
       },
+      localFile:'',
       //上传
+
       accessoryTFs: false,
       fileList: [],
       appendixIdsAdd: '',
@@ -460,10 +457,122 @@ export default {
     },
   },
   methods: {
-    uploadSuccessHandle1(e){
-console.log(document.getElementsByClassName("upload-demo"))
+    uploadHandle(response, file, fileList){
+      this.localFile=file.raw  // 或者 this.localFile=file.raw
+let Base64 = require('js-base64').Base64
+                    // 转换操作可以不放到这个函数里面,
+                    // 因为这个函数会被多次触发,上传时触发,上传成功也触发
+                    let reader = new FileReader()
+                    reader.readAsDataURL(this.localFile);// 这里也可以直接写参数event.raw
+                      
+                    // 转换成功后的操作,reader.result即为转换后的DataURL ,
+                    // 它不需要自己定义,你可以console.log(reader.result)看一下
+                    reader.onload=()=>{
+                      console.log(reader.result)
+                    }
+
+
+    },
+    handleChange(file, fileList) {
+            this.fileTemp = file.raw
+                let fileName = file.raw.name
+                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
+                // 判断上传文件格式
+                if (this.fileTemp) {
+                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
+                        this.importf(this.fileTemp)
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: '附件格式错误,请删除后重新上传!'
+                        })
+                    }
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: '请上传附件!'
+                    })
+                }
 
     },
+ importf(obj) {
+                this.dialogVisible = true;
+                let _this = this;
+                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
+                this.file = event.currentTarget.files[0];
+                var rABS = false; //是否将文件读取为二进制字符串
+                var f = this.file;
+                var reader = new FileReader();
+                //if (!FileReader.prototype.readAsBinaryString) {
+                FileReader.prototype.readAsBinaryString = function (f) {
+                    var binary = "";
+                    var rABS = false; //是否将文件读取为二进制字符串
+                    var pt = this;
+                    var wb; //读取完成的数据
+                    var outdata;
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var bytes = new Uint8Array(reader.result);
+                        var length = bytes.byteLength;
+                        for (var i = 0; i < length; i++) {
+                            binary += String.fromCharCode(bytes[i]);
+                        }
+                        var XLSX = require('xlsx');
+                        if (rABS) {
+                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                                type: 'base64'
+                            });
+                        } else {
+                            wb = XLSX.read(binary, {
+                                type: 'binary'
+                            });
+                        }
+                        // outdata就是你想要的东西 excel导入的数据
+                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+                        // excel 数据再处理
+                        let arr = []
+                        outdata.map(v => {
+                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
+                            console.log(jsonString);
+                            v = JSON.parse(jsonString);
+                            let obj = {}
+                            //xxx代表列名
+                            obj.temporaryDriverFlag = v.临时司机标识
+                            obj.caseNo= v.箱号
+                            obj.titleNo= v.封号
+                            obj.driverPhone = v.司机电话
+                            obj.driver=v.司机姓名
+                            obj.loadNetWeight = v.装车净重
+                            obj.loadingDate = toString(v.装车日期)
+                            obj.status= v.状态
+                            obj.carNo = v.车牌号
+                            obj.unloadPoundImg = v.磅单
+                            console.log(obj)
+                            _this.freightspace.push(obj)
+                        })
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
+                    }
+                    reader.readAsArrayBuffer(f);
+                }
+                if (rABS) {
+                    reader.readAsArrayBuffer(f);
+                } else {
+                    reader.readAsBinaryString(f);
+                }
+                console.log(reader)
+            },
+    beforeUpload(file){
+          if(window.createObjectURL!=undefined){
+            this.fileName = window.createObjectURL(file)
+          }else if(window.URL!=undefined){
+            this.fileName = window.URL.createObjectURL(file)
+          }else if (window.webkitURL!=undefined){
+            this.fileName = window.webkitURL.createObjectURL(file)
+          }
+          console.log(this.fileName)
+        },
     uploadSuccessHandle(e) {
       console.log(e)
       importApplFileUrl({file:e.url}) .toPromise()
@@ -1058,16 +1167,14 @@ console.log(document.getElementsByClassName("upload-demo"))
 }
 //联络员及车次
 /deep/.liaison .ws-info-table .el-form-item {
-  width: 20%;
+  width: 19%;
 }
 /deep/.liaison .ws-info-table .el-form-item .el-form-item__label {
   width: 50%;
   background: #f6f7fc;
 }
-/deep/.liaison .flex {
-  display: contents;
-}
 /deep/.liaison .ws-info-table {
+  width:100%;
   background: #f6f7fc;
   border-radius: 4px;
   border: 1px solid #d8dce6;

+ 99 - 8
src/views/tranManagement/tranManagementUnShippingFeedback.vue

@@ -138,14 +138,17 @@
         卸船详情
       </div>
       <!-- 导入 -->
-      <div style="font-size: 16px; width: 50%; float: left; text-align: right">
-        <el-button
-          class="bg-bottom"
-          type="primary"
-          size="small"
-          @click="import(deptBudgetList)"
-          >导入</el-button
-        >
+      <!-- 导入 -->
+      <div style="font-size: 16px; width: 100%; text-align: right">
+        <el-upload style="margin-left: 8px;"
+          class="upload-demo inline-block margin-right-10"
+          action=""
+          :on-change="handleChange"
+          :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <el-button  type="primary">导入</el-button>
+        </el-upload>
       </div>
       <div class="liaison">
         <div
@@ -452,6 +455,94 @@ export default {
     },
   },
   methods: {
+    handleChange(file, fileList) {
+            this.fileTemp = file.raw
+                let fileName = file.raw.name
+                let fileType = fileName.substring(fileName.lastIndexOf('.') + 1);
+                // 判断上传文件格式
+                if (this.fileTemp) {
+                    if ((fileType == 'xlsx') || (fileType == 'xls')) {
+                        this.importf(this.fileTemp)
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: '附件格式错误,请删除后重新上传!'
+                        })
+                    }
+                } else {
+                    this.$message({
+                        type: 'warning',
+                        message: '请上传附件!'
+                    })
+                }
+
+    },
+ importf(obj) {
+                this.dialogVisible = true;
+                let _this = this;
+                let inputDOM = this.$refs.inputer;   // 通过DOM取文件数据
+                this.file = event.currentTarget.files[0];
+                var rABS = false; //是否将文件读取为二进制字符串
+                var f = this.file;
+                var reader = new FileReader();
+                //if (!FileReader.prototype.readAsBinaryString) {
+                FileReader.prototype.readAsBinaryString = function (f) {
+                    var binary = "";
+                    var rABS = false; //是否将文件读取为二进制字符串
+                    var pt = this;
+                    var wb; //读取完成的数据
+                    var outdata;
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var bytes = new Uint8Array(reader.result);
+                        var length = bytes.byteLength;
+                        for (var i = 0; i < length; i++) {
+                            binary += String.fromCharCode(bytes[i]);
+                        }
+                        var XLSX = require('xlsx');
+                        if (rABS) {
+                            wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                                type: 'base64'
+                            });
+                        } else {
+                            wb = XLSX.read(binary, {
+                                type: 'binary'
+                            });
+                        }
+                        // outdata就是你想要的东西 excel导入的数据
+                        outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+                        // excel 数据再处理
+                        let arr = []
+                        outdata.map(v => {
+                            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+                            let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig,'');
+                            console.log(jsonString);
+                            v = JSON.parse(jsonString);
+                            let obj = {}
+                            //xxx代表列名
+                            obj.caseNo = v.箱号
+                            obj.titleNo= v.封号
+                            obj.binNumber = v.仓位号
+                            obj.positionWeight=v.散船重量
+                            obj.loadNetWeight = v.装船净重
+                            obj.loadingDate = toString(v.装船日期)
+                            obj.status= v.状态
+                            obj.shipType = v.类型
+                            console.log(obj)
+                            _this.freightspace.push(obj)
+                        })
+                        // _this.freightspace.concat(arr)
+                        console.log(arr,_this.freightspace)
+                    }
+                    reader.readAsArrayBuffer(f);
+                }
+                if (rABS) {
+                    reader.readAsArrayBuffer(f);
+                } else {
+                    reader.readAsBinaryString(f);
+                }
+                console.log(reader)
+            },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {

+ 14 - 2
src/views/warehouse/component/router/index.js

@@ -24,10 +24,22 @@ const warehouseManagementRouter = {
         permissicon: [],
         keepAlive: true
         // module: 'procurement.sparepart.applDetail'
+      }
+    },
+    {
+      path: 'costmanagement',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/warehouse/costmanagement'),
+      name: 'warehouseManagementList',
+      meta: {
+        title: 'costmanagement',
+        shortcutEntrance: 'warehouseManagementList',
+        module: 'warehouseManagement.warehouse.warehouseInfo',
+        permissicon: [],
+        keepAlive: true
+        // module: 'procurement.sparepart.applDetail'
       },
-       hidden: true
     },
-
     {
       path: 'warehouseManagementAdd',
       component: () =>

+ 450 - 0
src/views/warehouse/costmanagement.vue

@@ -0,0 +1,450 @@
+<!--仓库管理-->
+<template>
+  <div>
+    <BaseHeaderLayout :leftSpan="15">
+      
+      <template slot="left">
+        <div >
+          <el-radio-group
+            v-model="warehouseType"
+            @change="changeradio"
+            size="small"
+          >
+            <el-radio-button label="1">常用仓库</el-radio-button>
+            <el-radio-button label="2">临时仓库</el-radio-button>
+          </el-radio-group>
+        </div>
+      </template>
+      <template slot="right">
+        <ws-input
+          v-model="warehouseName"
+          placeholder="请输入仓库名"
+          clearable
+          maxlength="500"
+          type="input"
+          class="findValue"
+        ></ws-input>
+        <!-- v-hasPermission="'procurement.sparepart.directShip'" -->
+        <ws-button class="find" type="primary" @click="find()"
+          ><img
+            width="16"
+            height="16"
+            style="
+              vertical-align: text-top;
+              position: relative;
+              top: 0px;
+              left: -8px;
+            "
+            src="../../../public/img/sousuo.png"
+            alt=""
+        /></ws-button>
+      </template>
+    </BaseHeaderLayout>
+    <div v-show="this.warehouseType == '1'">
+      <el-table
+        class="wenzi"
+        :data="warehouseList"
+        style="width: 100%; margin-top: 20px"
+        height="780"
+      >
+      <el-table-column label="序号" type="index" show-overflow-tooltip width="50">
+      </el-table-column>
+        <el-table-column prop="warehouseName" label="仓库" >
+        </el-table-column>
+        <el-table-column prop="binNumber" label="货名" >
+        </el-table-column>
+        <el-table-column prop="capacity" label="储量(吨)">
+          <template slot-scope="scope">
+
+          </template>
+        </el-table-column>
+        <el-table-column label="加权成本(元/吨)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+              {{ item.goodsName }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="价值(元)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+               {{item.inNetWeight}}
+            </div>
+          </template>
+        </el-table-column>
+        
+        <el-table-column prop="address" label="操作" width="200">
+          <template slot-scope="scope">
+            <div class="record" v-hasPermission="
+           `warehouseManagement.warehouse.warehouseInfo.view`
+          " @click="record(scope.row)">修改</div>
+            <div class="adjustment" v-hasPermission="
+           `warehouseManagement.warehouse.warehouseInfo.view`
+          " @click="loss(scope.row)">加权明细</div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div v-show="this.warehouseType == '2'">
+      <el-table
+        class="wenzi"
+        :data="warehouseList"
+        style="width: 100%; margin-top: 20px"
+        height="780"
+      >
+      <el-table-column label="序号" type="index" show-overflow-tooltip width="50">
+      </el-table-column>
+        <el-table-column prop="warehouseName" label="仓库" >
+        </el-table-column>
+        <el-table-column prop="binNumber" label="货名" >
+        </el-table-column>
+        <el-table-column prop="capacity" label="储量(吨)">
+          <template slot-scope="scope">
+
+          </template>
+        </el-table-column>
+        <el-table-column label="加权成本(元/吨)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+              {{ item.goodsName }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="价值(元)">
+          <template slot-scope="scope">
+            <div
+              style="height: 24px"
+              v-for="(item, i) in scope.row.warehouseNumViewList"
+            >
+               {{item.inNetWeight}}
+            </div>
+          </template>
+        </el-table-column>
+        
+        <el-table-column prop="address" label="操作" width="200">
+          <template slot-scope="scope">
+            <div class="record" v-hasPermission="
+           `warehouseManagement.warehouse.warehouseInfo.view`
+          " @click="record(scope.row)">修改</div>
+            <div class="adjustment" v-hasPermission="
+           `warehouseManagement.warehouse.warehouseInfo.view`
+          " @click="loss(scope.row)">加权明细</div>
+          </template>
+        </el-table-column>
+      </el-table>
+      
+    </div>
+  </div>
+</template>
+<script>
+import {
+  getcost,
+  export1,
+  editstatus,
+  billoperatehis,
+  clearancee,
+} from '@/model/warehouse/index'
+import { downloadFile } from '@/utils/batchDown'
+import Pagination from '@/components/Pagination'
+import WsUpload from '@/components/WsUpload'
+import { EventBus } from 'base-core-lib'
+export default {
+  name: 'viewSpareMoney',
+  components: {
+    WsUpload,
+    Pagination,
+  },
+  watch: {
+    vesselId(val) {
+      this.getList()
+    },
+    isShow(val) {
+      this.showType = val
+    },
+  },
+  data() {
+    return {
+        currectPage:1,
+        pageSize:10,
+      //弹出框
+      dialogViewSpareMoney: false,
+      dialogApproveFormVisible: false,
+      // 船舶类型
+      monetaryKey: null,
+      // 表格显示数据
+      tableDate: [],
+
+      // 是否显示
+      showType: true,
+      // 年
+      year: '',
+
+      searchType: 1,
+      searchTypeText: '未完成',
+      searchKeyWord: '',
+      contractType: 2,
+      warehouseType: '1',
+      // 提交类型
+      submitType: true,
+      size: 10,
+      spanArr: [],
+      warehouseName: '',
+      compId: sessionStorage.getItem('ws-pf_compId'),
+      deptCircularPage: {},
+      warehouseList: [],
+      deptBudgetList: {},
+      historyList: [],
+      deptBudgetTotal: 0,
+      pickerBeginDateBefore: {
+        disabledDate: (time) => {
+          return time.getTime() > Date.now()
+        },
+      },
+      accessoryTFs: false,
+    }
+  },
+  activated() {
+    this.getList()
+    this.showType = this.isShow
+  },
+
+  methods: {
+    //查看
+    handleLook() {
+      this.$router.push({ path: 'warehouseManagementLook' })
+    },
+    //添加
+    handleAdd() {
+      this.$router.push({ path: 'warehouseManagementAdd' })
+    },
+    //编辑
+    handleEdit() {
+      this.$router.push({ path: 'warehouseManagementEdit' })
+    },
+    handleDelete() {
+      this.$router.push({ path: 'warehouseManagementDelete' })
+    },
+    //任务
+    handlTask(){
+      this.$router.push({ path: 'tranManagementWarehouseInOutTask' })
+    },
+    handleClose() {
+      this.accessoryTFs = false
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.pageSize = val
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      this.currentPage = val
+      console.log(`当前页: ${val}`)
+      this.getList()
+    },
+    getList() {
+      getcost({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        warehouseName: this.warehouseName,
+        warehouseType: this.warehouseType,
+        currectPage:this.currectPage,
+        pageSize:this.pageSize
+      })
+        .toPromise()
+        .then((response) => {
+          this.warehouseList = response
+        })
+    },
+    editClick(row) {
+      var status = ''
+      if (row.status == '待执行' || row.status == '已完成') {
+        status = '执行中'
+      } else if (row.status == '执行中') {
+        status = '已完成'
+      }
+      //cancelButtonClass: "btn-custom-cancel"
+      this.$confirm(`是否将状态改为${status}`, {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          editstatus({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$notify.success({
+                title: '成功',
+                message: '状态修改成功',
+              })
+              this.getList()
+            })
+            .catch((response) => {
+              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            })
+        })
+        .catch(() => {
+          return false
+        })
+    },
+    selecttaskType(e) {
+      for (var i = 0; i < this.taskTypeList.length; i++) {
+        if (this.taskTypeList[i].value == e) {
+          this.searchType = this.taskTypeList[i].type
+        }
+      }
+    },
+
+    fujian(row) {
+      if (
+        row.receiveAttachmentPath === null ||
+        row.receiveAttachmentPath === ''
+      ) {
+        EventBus.$emit(
+          'warning',
+          this.$t('system.noticeCircular.NoInformation')
+        )
+      } else {
+        this.accessoryTFs = true
+      }
+      this.appendixIdss = row.receiveAttachmentPath
+    },
+    handleExamine(row) {
+      this.$router.push({
+        name: 'salesContractExamine',
+        query: { id: row.id },
+      })
+    },
+    // 关闭 dialog时 处理文件url 初始化upload组件
+    handleCloe() {
+      this.dialogViewSpareMoney = false
+    },
+
+    history(row) {
+      billoperatehis({ id: row.id })
+        .toPromise()
+        .then((response) => {
+          this.historyList = response
+        })
+    },
+    find() {
+      this.currentPage = 1
+      this.getList()
+    },
+    async exportlist() {
+      const { data } = await export1(
+        {
+          compId: sessionStorage.getItem('ws-pf_compId'),
+          contractType: this.contractType,
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          searchType: this.searchType,
+          searchKeyWord: this.searchKeyWord,
+          startDate: this.startDate,
+          endDate: this.endDate,
+        },
+        {},
+        { responseType: 'blob' }
+      ).toPromise()
+      downloadFile({
+        res: data,
+        fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }_采购合同`,
+        type: 'xls',
+      })
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+.connert {
+  width: 90%;
+  margin: 0 auto;
+}
+.vertical-text-left {
+  width: 62px;
+  text-align: right;
+}
+.el-button--primary {
+  background-color: #5878e8;
+  border-color: #5878e8;
+}
+.el-button--default {
+  color: #8890b1;
+  border-color: #e8eaf1;
+}
+/deep/.base_header_layout .grid-content.right .find.el-button--primary {
+  width: 30px;
+  margin-left: 0;
+  border-top-left-radius: 0px;
+  border-bottom-left-radius: 0px;
+}
+/deep/.findValue .el-input__inner {
+  border-top-right-radius: 0px;
+  border-bottom-right-radius: 0px;
+}
+.completed.el-button--default {
+  border-color: #5878e8;
+  background-color: #f6f7fc;
+  color: #5878e8;
+}
+.putstorage.el-button--default,
+.deliverystorage.el-button--default {
+  border-color: #8890b1;
+  background-color: #fff;
+  color: #8890b1;
+}
+/deep/.el-table td,
+/deep/.el-table th.is-leaf {
+  border-right: 1px solid #e9ecf7;
+  text-align: center;
+}
+/deep/.el-table tr td:first-child,
+/deep/.el-table tr th.is-leaf:first-child {
+  border-left: 1px solid #e9ecf7;
+}
+/deep/.el-table .el-table__header .cell,
+/deep/.el-table .el-table__body .cell {
+  -webkit-line-clamp: 10;
+  max-height: 400px;
+}
+.record,
+.adjustment {
+  display: inline-block;
+  color: #5878e8;
+  padding: 0 4px !important;
+  position: relative;
+}
+.record:after {
+  position: absolute;
+  content: '';
+  display: block;
+  top: 5px;
+  right: -2px;
+  width: 1px;
+  height: 12px;
+  background: #e9ecf7;
+}
+/deep/.el-radio-button:first-child .el-radio-button__inner {
+  margin-left: 10px;
+}
+//分页
+.el-pagination {
+  text-align: center;
+    white-space: nowrap;
+    padding: 2px 5px;
+    color: #303133;
+    font-weight: 700;
+    margin-bottom: 20px;
+}
+
+</style>

+ 0 - 5
vue.config.js

@@ -141,13 +141,8 @@ module.exports = {
         // target: 'https://product-server.winsea.com/', //目标地址
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
-<<<<<<< HEAD
         target: 'http://192.168.1.115:8090/',
         // target: 'http://192.168.1.122:9100/',
-=======
-        target: 'http://192.168.1.122:8090/',
->>>>>>> fda6d6a17183b1b8bd85dcbfa90d78b2cdf7412b
-        // target: 'http://192.168.1.112:8090/',
         // target: 'http://192.168.1.121:8090/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址