1 line
8.8 KiB
JavaScript
1 line
8.8 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-375b"],{20:function(t,e){},23:function(t,e){},24:function(t,e){},"27NO":function(t,e,a){"use strict";var n=a("Jdnr");a.n(n).a},"8qIy":function(t,e,a){},GNCz:function(t,e,a){"use strict";var n=a("8qIy");a.n(n).a},Jdnr:function(t,e,a){},T7Bn:function(t,e,a){"use strict";a.r(e);var n=a("4d7F"),r=a.n(n),o=a("EUZL"),s=a.n(o),l={props:{beforeUpload:Function,onSuccess:Function},data:function(){return{loading:!1,excelData:{header:null,results:null}}},methods:{generateData:function(t){var e=t.header,a=t.results;this.excelData.header=e,this.excelData.results=a,this.onSuccess&&this.onSuccess(this.excelData)},handleDrop:function(t){if(t.stopPropagation(),t.preventDefault(),!this.loading){var e=t.dataTransfer.files;if(1===e.length){var a=e[0];if(!this.isExcel(a))return this.$message.error("Only supports upload .xlsx, .xls, .csv suffix files"),!1;this.upload(a),t.stopPropagation(),t.preventDefault()}else this.$message.error("Only support uploading one file!")}},handleDragover:function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},handleUpload:function(){this.$refs["excel-upload-input"].click()},handleClick:function(t){var e=t.target.files[0];e&&this.upload(e)},upload:function(t){(this.$refs["excel-upload-input"].value=null,this.beforeUpload)?this.beforeUpload(t)&&this.readerData(t):this.readerData(t)},readerData:function(t){var e=this;return this.loading=!0,new r.a(function(a,n){var r=new FileReader;r.onload=function(t){var n=t.target.result,r=e.fixData(n),o=s.a.read(btoa(r),{type:"base64"}),l=o.SheetNames[0],i=o.Sheets[l],u=e.getHeaderRow(i),c=s.a.utils.sheet_to_json(i);e.generateData({header:u,results:c}),e.loading=!1,a()},r.readAsArrayBuffer(t)})},fixData:function(t){for(var e="",a=0,n=10240;a<t.byteLength/n;++a)e+=String.fromCharCode.apply(null,new Uint8Array(t.slice(a*n,a*n+n)));return e+=String.fromCharCode.apply(null,new Uint8Array(t.slice(a*n)))},getHeaderRow:function(t){var e=[],a=s.a.utils.decode_range(t["!ref"]),n=void 0,r=a.s.r;for(n=a.s.c;n<=a.e.c;++n){var o=t[s.a.utils.encode_cell({c:n,r:r})],l="UNKNOWN "+n;o&&o.t&&(l=s.a.utils.format_cell(o)),e.push(l)}return e},isExcel:function(t){return/\.(xlsx|xls|csv)$/.test(t.name)}}},i=(a("yms4"),a("KHd+")),u=Object(i.a)(l,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("input",{ref:"excel-upload-input",staticClass:"excel-upload-input",attrs:{type:"file",accept:".xlsx, .xls"},on:{change:t.handleClick}}),t._v(" "),a("div",{staticClass:"drop",on:{drop:t.handleDrop,dragover:t.handleDragover,dragenter:t.handleDragover}},[t._v("\n 更新点位地图\n "),a("el-button",{staticStyle:{"margin-left":"16px"},attrs:{loading:t.loading,size:"mini",type:"primary"},on:{click:t.handleUpload}},[t._v("浏览")])],1)])},[],!1,null,"3fa50f92",null);u.options.__file="load.vue";var c=u.exports,d={props:{beforeUpload:Function,onSuccess:Function},data:function(){return{loading:!1,excelData:{header:null,results:null}}},methods:{generateData:function(t){var e=t.header,a=t.results;this.excelData.header=e,this.excelData.results=a,this.onSuccess&&this.onSuccess(this.excelData)},handleDrop:function(t){if(t.stopPropagation(),t.preventDefault(),!this.loading){var e=t.dataTransfer.files;if(1===e.length){var a=e[0];if(!this.isExcel(a))return this.$message.error("Only supports upload .xlsx, .xls, .csv suffix files"),!1;this.upload(a),t.stopPropagation(),t.preventDefault()}else this.$message.error("Only support uploading one file!")}},handleDragover:function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},handleUpload:function(){this.$refs["excel-upload-input"].click()},handleClick:function(t){var e=t.target.files[0];e&&this.upload(e)},upload:function(t){(this.$refs["excel-upload-input"].value=null,this.beforeUpload)?this.beforeUpload(t)&&this.readerData(t):this.readerData(t)},readerData:function(t){var e=this;return this.loading=!0,new r.a(function(a,n){var r=new FileReader;r.onload=function(t){var n=t.target.result,r=e.fixData(n),o=s.a.read(btoa(r),{type:"base64"}),l=o.SheetNames[0],i=o.Sheets[l],u=e.getHeaderRow(i),c=s.a.utils.sheet_to_json(i);e.generateData({header:u,results:c}),e.loading=!1,a()},r.readAsArrayBuffer(t)})},fixData:function(t){for(var e="",a=0,n=10240;a<t.byteLength/n;++a)e+=String.fromCharCode.apply(null,new Uint8Array(t.slice(a*n,a*n+n)));return e+=String.fromCharCode.apply(null,new Uint8Array(t.slice(a*n)))},getHeaderRow:function(t){var e=[],a=s.a.utils.decode_range(t["!ref"]),n=void 0,r=a.s.r;for(n=a.s.c;n<=a.e.c;++n){var o=t[s.a.utils.encode_cell({c:n,r:r})],l="UNKNOWN "+n;o&&o.t&&(l=s.a.utils.format_cell(o)),e.push(l)}return e},isExcel:function(t){return/\.(xlsx|xls|csv)$/.test(t.name)}}},f=(a("GNCz"),Object(i.a)(d,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("input",{ref:"excel-upload-input",staticClass:"excel-upload-input",attrs:{type:"file",accept:".xlsx, .xls"},on:{change:t.handleClick}}),t._v(" "),a("div",{staticClass:"drop",on:{drop:t.handleDrop,dragover:t.handleDragover,dragenter:t.handleDragover}},[t._v("\n 扩展点位地图\n "),a("el-button",{staticStyle:{"margin-left":"16px"},attrs:{loading:t.loading,size:"mini",type:"primary"},on:{click:t.handleUpload}},[t._v("浏览")])],1)])},[],!1,null,"2044b569",null));f.options.__file="add.vue";var p=f.exports,h=a("c/X4"),g={name:"UploadExcel",components:{UploadExcelComponent:c,AddExcelComponent:p},data:function(){return{tableData:[],tableHeader:[]}},mounted:function(){this.getModelData()},methods:{beforeUpload:function(t){return t.size/1024/1024<1||(this.$message({message:"Please do not upload files larger than 1m in size.",type:"warning"}),!1)},handleSuccess:function(t){var e=t.results,a=t.header;this.tableData=e,this.tableHeader=a;for(var n=[],r=0;r<e.length;r++){var o={name:e[r].BIN,width:1e3,length:1e3,pos_x:e[r].X,pos_z:e[r].Y};n.push(o)}h.a.ImportBinModelData(n).then(function(t){})},handleSuccess2:function(t){t.results,t.header},getModelData:function(){var t=this;h.a.GetStoreModel().then(function(e){t.tableHeader=["h","name","w","x","y"],t.tableData=e.data.data.bins})}}},v=(a("27NO"),Object(i.a)(g,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"box"},[a("upload-excel-component",{attrs:{"on-success":t.handleSuccess,"before-upload":t.beforeUpload}}),t._v(" "),a("add-excel-component",{attrs:{"on-success":t.handleSuccess2,"before-upload":t.beforeUpload}})],1),t._v(" "),a("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:t.tableData,border:"","highlight-current-row":""}},t._l(t.tableHeader,function(t){return a("el-table-column",{key:t,attrs:{prop:t,label:t}})}))],1)},[],!1,null,null,null));v.options.__file="importMap.vue";e.default=v.exports},"c/X4":function(t,e,a){"use strict";var n=a("t3Un");e.a={GetBinsInfo:function(t){return Object(n.a)({url:"/storage/GetBinsInfo",method:"post",data:t})},GetStoreModel:function(){return Object(n.a)({url:"/store/GetStoreModel",method:"post"})},GetStoreModel2:function(){return Object(n.a)({url:"/store/GetStoreModel2",method:"post"})},ImportBinModelData:function(t){return Object(n.a)({url:"/store/ImportBinModel",method:"post",data:t})},SetStoreModel:function(t){return Object(n.a)({url:"/store/SetStoreModel",method:"post",data:t})},SaveStockInfo:function(t){return Object(n.a)({url:"/store/SaveStockInfo",method:"post",data:t})},saveBasicInfo:function(t){return Object(n.a)({url:"/store/SaveBasicInfo",method:"post",data:t})},getBasicInfo:function(){return Object(n.a)({url:"/store/GetBasicInfo",method:"post"})},getStoreStatData:function(){return Object(n.a)({url:"/store/GetStoreStatData",method:"post"})},getCheckRecord:function(){return Object(n.a)({url:"/store/GetCheckRecord",method:"post"})},getBatchList:function(){return Object(n.a)({url:"/storage/GetBatchList",method:"post"})},getAllBatchList:function(){return Object(n.a)({url:"/storage/GetAllBatchList",method:"post"})},getProductionBatchList:function(){return Object(n.a)({url:"/erp/GetProductionBatchList",method:"post"})},addBatchNumber:function(t){return Object(n.a)({url:"/storage/AddBatchNumber",method:"post",data:t})},GetCurrentBatchAndPackage:function(){return Object(n.a)({url:"/storage/GetCurrentBatchAndPackage",method:"post"})},SetCurrentBatchAndPackage:function(t){return Object(n.a)({url:"/storage/SetCurrentBatchAndPackage",method:"post",data:t})},getBatchInfo:function(t){return Object(n.a)({url:"/storage/GetBatchInfo",method:"post",data:t})},SetBinStoreInfo:function(t){return Object(n.a)({url:"/storage/SetBinStoreInfo",method:"post",data:t})},GetBinStoreInfo:function(t){return Object(n.a)({url:"/storage/GetBinStoreInfo",method:"post",data:t})},getInOutInfo:function(t){return Object(n.a)({url:"/storage/getInOutInfo",method:"post",data:t})},getProductByBatch:function(t){return Object(n.a)({url:"/storage/getProductByBatch",method:"post",data:t})}}},mBoq:function(t,e,a){},yms4:function(t,e,a){"use strict";var n=a("mBoq");a.n(n).a}}]); |