"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[617],{5010:function(t,e,r){r.r(e),r.d(e,{default:function(){return f}});var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pageBox"},[e("div",{staticClass:"cardBox"},[e("div",{staticClass:"searchBox"},[e("div",{staticClass:"row"},[e("span",[t._v("商品名称:")]),e("el-input",{attrs:{clearable:""},model:{value:t.filter.title,callback:function(e){t.$set(t.filter,"title",e)},expression:"filter.title"}})],1),e("div",{staticClass:"row"},[e("span",[t._v("商品编码:")]),e("el-input",{attrs:{clearable:""},model:{value:t.filter.external_sku_id,callback:function(e){t.$set(t.filter,"external_sku_id",e)},expression:"filter.external_sku_id"}})],1),e("div",{staticClass:"row"},[e("span",[t._v("创建时间:")]),e("el-date-picker",{staticStyle:{width:"340px"},attrs:{type:"datetimerange","range-separator":"-","start-placeholder":"开始时间","end-placeholder":"结束时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.addTime,callback:function(e){t.addTime=e},expression:"addTime"}})],1),e("div",{staticClass:"row"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.handleSearch}},[t._v("筛选")])],1)])]),e("el-card",[e("div",{staticClass:"opaBox"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.handleAdd}},[t._v("新增")]),e("el-button",{attrs:{type:"warning",icon:"el-icon-upload2"},on:{click:t.handleImport}},[t._v("导入")])],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.supplierList,border:""}},[e("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",align:"center"}}),e("el-table-column",{attrs:{prop:"goods_sku.name",label:"商品名称"}}),e("el-table-column",{attrs:{prop:"goods_sku.external_sku_id",label:"商品编码"}}),e("el-table-column",{attrs:{prop:"day",label:"日期"}}),e("el-table-column",{attrs:{prop:"inventory",label:"盘点库存"}}),e("el-table-column",{attrs:{prop:"inventory_time",label:"盘点时间"}})],1),e("div",{staticClass:"page-pagination"},[e("el-pagination",{attrs:{"current-page":t.page,"page-sizes":[10,20,50,100],"page-size":t.pageSize,layout:"prev, pager, next, jumper, sizes, total",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1),e("el-dialog",{attrs:{title:"新增",visible:t.dialogVisible,width:"500px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[t._l(t.inventoryOrders,(function(r,n){return e("div",{key:n,staticClass:"bgBox"},[e("div",{staticClass:"close",on:{click:function(e){return t.delItem(n)}}},[e("i",{staticClass:"el-icon-delete-solid"})]),e("el-form",{attrs:{"label-width":"90px","label-position":"right"}},[e("el-form-item",{attrs:{label:"商品名称:"}},[e("el-select",{attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"商品名称",clearable:"","remote-method":t.remoteMethod,loading:t.searchLoading},model:{value:r.external_sku_id,callback:function(e){t.$set(r,"external_sku_id",e)},expression:"item.external_sku_id"}},t._l(t.goodsList,(function(t){return e("el-option",{key:t.external_sku_id,attrs:{label:t.title,value:t.external_sku_id}})})),1)],1),e("el-form-item",{attrs:{label:"盘点库存:"}},[e("el-input",{attrs:{clearable:""},model:{value:r.inventory,callback:function(e){t.$set(r,"inventory",e)},expression:"item.inventory"}})],1)],1)],1)})),e("div",{staticClass:"btn",on:{click:function(e){return t.addItem()}}},[e("i",{staticClass:"el-icon-plus"}),t._v("添加记录")]),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",loading:t.commitloading},on:{click:t.commitSupplier}},[t._v("确 定")])],1)],2),e("el-dialog",{attrs:{title:"导入",visible:t.showImport,width:"500px"},on:{"update:visible":function(e){t.showImport=e}}},[e("div",{staticStyle:{"text-align":"center"}},[e("el-upload",{staticClass:"upload-demo",attrs:{drag:"",action:"",limit:1,multiple:!1,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel","file-list":t.fileList,"auto-upload":!1,"on-change":t.importFileChange,"on-remove":t.fileRemove}},[e("i",{staticClass:"el-icon-upload"}),e("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),e("em",[t._v("点击上传")])])])],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.showImport=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary",loading:t.commitloading},on:{click:t.commitUpload}},[t._v("上 传")])],1)])],1)},i=[],o=(r(560),r(3550)),a=r(9669),s=r.n(a),l=r(9036),u={data(){return{loading:!1,page:1,pageSize:10,total:0,supplierList:[],dialogVisible:!1,inventoryOrders:[],commitloading:!1,filter:{title:"",external_sku_id:""},addTime:[],showImport:!1,goodsList:[],searchLoading:!1,fileList:[]}},methods:{fetchList(){this.loading=!0;let t={page:this.page,per_page:this.pageSize,...this.filter,start_time:this.addTime?this.addTime[0]:"",end_time:this.addTime?this.addTime[1]:""};(0,o.zB)(t).then((t=>{this.supplierList=t.data.data,this.total=t.data.meta.total,this.loading=!1})).catch((()=>{this.loading=!1}))},handleSizeChange(t){this.page=1,this.pageSize=t,this.fetchList()},handleCurrentChange(t){this.page=t,this.fetchList()},handleSearch(){this.page=1,this.fetchList()},handleAdd(){this.inventoryOrders=[{external_sku_id:"",inventory:""}],this.dialogVisible=!0},delItem(t){this.inventoryOrders.splice(t,1)},addItem(){this.inventoryOrders.push({external_sku_id:"",inventory:""})},commitSupplier(){this.commitloading=!0,(0,o.zo)({inventoryOrders:this.inventoryOrders}).then((t=>{this.page=1,this.fetchList(),this.$message({type:"success",message:"新增成功!"}),this.dialogVisible=!1,this.commitloading=!1})).catch((()=>{this.commitloading=!1}))},handleImport(){this.fileList=[],this.showImport=!0},importFileChange(t,e){console.log(e),this.fileList=e},fileRemove(){this.fileList=[]},commitUpload(){if(this.fileList.length){this.commitloading=!0;const t=new FormData;t.append("inventoryFile",this.fileList[0].raw);let e=localStorage.getItem("token");s().post("/api/supplier/daily_stock_record/inventory_import",t,{headers:{Authorization:`Bearer ${e}`}}).then((t=>{200===t.status?(this.$message.success("导入成功"),this.page=1,this.fetchList(),this.commitloading=!1,this.showImport=!1):this.commitloading=!1})).catch((()=>{this.commitloading=!1}))}else this.$message.error("请先上传文件")},remoteMethod(t){""!==t?(this.searchLoading=!0,setTimeout((()=>{this.searchLoading=!1,(0,l.NR)(t).then((e=>{this.goodsList=e.data.filter((e=>e.title.toLowerCase().indexOf(t.toLowerCase())>-1))}))}),200)):this.goodsList=[]}},mounted(){this.fetchList()}},c=u,d=r(1001),p=(0,d.Z)(c,n,i,!1,null,"7638a0e4",null),f=p.exports},9036:function(t,e,r){r.d(e,{CD:function(){return _},JS:function(){return b},K1:function(){return c},NR:function(){return h},Rq:function(){return o},Vx:function(){return u},b9:function(){return y},cM:function(){return d},e3:function(){return l},gM:function(){return v},lO:function(){return i},no:function(){return g},od:function(){return p},rQ:function(){return a},sx:function(){return m},t5:function(){return s},zl:function(){return f}});var n=r(8430);function i(t){return(0,n.Z)({url:"/api/goods_skus",method:"get",params:t})}function o(t){return(0,n.Z)({url:"/api/goods",method:"post",data:t})}function a(t){return(0,n.Z)({url:`/api/goods_skus/${t}`,method:"get"})}function s(t){return(0,n.Z)({url:"/api/goods",method:"get",params:t})}function l(t,e){return(0,n.Z)({url:`/api/goods_skus/${t}`,method:"patch",data:e})}function u(t){return(0,n.Z)({url:"/api/batch/goods_skus",method:"patch",data:t})}function c(t,e){return(0,n.Z)({url:`/api/single/goods_skus/${t}`,method:"patch",data:e})}function d(t,e){return(0,n.Z)({url:"/api/upload",Headers:e,method:"post",data:t})}function p(t){return(0,n.Z)({url:"/api/goodsList",method:"get",params:t})}function f(t){return(0,n.Z)({url:"/api/goods_sku_location",method:"get",params:t})}function h(t){return(0,n.Z)({url:"/api/goodsSkusList",method:"get",params:{title:t}})}function m(){return(0,n.Z)({url:"/api/stock/goods_skus",method:"get"})}function g(t){return(0,n.Z)({url:"/api/goods/filter/"+t,method:"get"})}function v(t){return(0,n.Z)({url:"/api/goods_combination",method:"post",data:t})}function _(t){return(0,n.Z)({url:"/api/goods_combination",method:"get",params:t})}function b(t){return(0,n.Z)({url:"/api/goods_combination/"+t,method:"get"})}function y(t){return(0,n.Z)({url:"/api/batch/goods_skus",method:"patch",data:t})}},3550:function(t,e,r){r.d(e,{EY:function(){return h},Fb:function(){return i},GI:function(){return a},JI:function(){return d},Js:function(){return l},Mo:function(){return p},S6:function(){return s},X2:function(){return o},iY:function(){return c},oK:function(){return f},qJ:function(){return u},zB:function(){return m},zo:function(){return g}});var n=r(8430);function i(t){return(0,n.Z)({url:"/api/supplier",method:"get",params:t})}function o(t){return(0,n.Z)({url:`/api/supplier/${t}`,method:"delete"})}function a(t){return(0,n.Z)({url:"/api/supplier",method:"post",data:t})}function s(t,e){return(0,n.Z)({url:`/api/supplier/${t}`,method:"patch",data:e})}function l(t){return(0,n.Z)({url:"/api/supplier/purchase_record",method:"get",params:t})}function u(t){return(0,n.Z)({url:"/api/purchase_record/purchase_batch_check",method:"post",data:t})}function c(t){return(0,n.Z)({url:"/api/purchase_record/purchase_batch_store",method:"post",data:t})}function d(t,e){return(0,n.Z)({url:`/api/supplier/purchase_record/${t}`,method:"patch",data:e})}function p(t){return(0,n.Z)({url:"/api/supplier/loss_record",method:"get",params:t})}function f(t){return(0,n.Z)({url:"/api/loss_record/loss_batch_store",method:"post",data:t})}function h(t,e){return(0,n.Z)({url:`/api/supplier/loss_record/${t}`,method:"patch",data:e})}function m(t){return(0,n.Z)({url:"/api/supplier/daily_stock_record",method:"get",params:t})}function g(t){return(0,n.Z)({url:"/api/daily_stock_record/inventory_batch_store",method:"post",data:t})}},4328:function(t,e,r){var n=r(5290),i=r(7578),o=r(6310),a=function(t){return function(e,r,a){var s,l=n(e),u=o(l),c=i(a,u);if(t&&r!==r){while(u>c)if(s=l[c++],s!==s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},5649:function(t,e,r){var n=r(7697),i=r(2297),o=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!a(t,"length").writable)throw new o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},8758:function(t,e,r){var n=r(6812),i=r(9152),o=r(2474),a=r(2560);t.exports=function(t,e,r){for(var s=i(e),l=a.f,u=o.f,c=0;cr)throw e("Maximum allowed index exceeded");return t}},2739:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:function(t,e,r){var n=r(9037),i=r(2474).f,o=r(5773),a=r(1880),s=r(5014),l=r(8758),u=r(5266);t.exports=function(t,e){var r,c,d,p,f,h,m=t.target,g=t.global,v=t.stat;if(c=g?n:v?n[m]||s(m,{}):n[m]&&n[m].prototype,c)for(d in e){if(f=e[d],t.dontCallGetSet?(h=i(c,d),p=h&&h.value):p=c[d],r=u(g?d:m+(v?".":"#")+d,t.forced),!r&&void 0!==p){if(typeof f==typeof p)continue;l(f,p)}(t.sham||p&&p.sham)&&o(f,"sham",!0),a(c,d,f,t)}}},4413:function(t,e,r){var n=r(8844),i=r(3689),o=r(6648),a=Object,s=n("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===o(t)?s(t,""):a(t)}:a},2297:function(t,e,r){var n=r(6648);t.exports=Array.isArray||function(t){return"Array"===n(t)}},5266:function(t,e,r){var n=r(3689),i=r(9985),o=/#|\.prototype\./,a=function(t,e){var r=l[s(t)];return r===c||r!==u&&(i(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},l=a.data={},u=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},6310:function(t,e,r){var n=r(3126);t.exports=function(t){return n(t.length)}},8828:function(t){var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},2474:function(t,e,r){var n=r(7697),i=r(2615),o=r(9556),a=r(5684),s=r(5290),l=r(8360),u=r(6812),c=r(8506),d=Object.getOwnPropertyDescriptor;e.f=n?d:function(t,e){if(t=s(t),e=l(e),c)try{return d(t,e)}catch(r){}if(u(t,e))return a(!i(o.f,t,e),t[e])}},2741:function(t,e,r){var n=r(4948),i=r(2739),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},7518:function(t,e){e.f=Object.getOwnPropertySymbols},4948:function(t,e,r){var n=r(8844),i=r(6812),o=r(5290),a=r(4328).indexOf,s=r(7248),l=n([].push);t.exports=function(t,e){var r,n=o(t),u=0,c=[];for(r in n)!i(s,r)&&i(n,r)&&l(c,r);while(e.length>u)i(n,r=e[u++])&&(~a(c,r)||l(c,r));return c}},9556:function(t,e){var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);e.f=i?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},9152:function(t,e,r){var n=r(6058),i=r(8844),o=r(2741),a=r(7518),s=r(5027),l=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=o.f(s(t)),r=a.f;return r?l(e,r(t)):e}},7578:function(t,e,r){var n=r(8700),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},5290:function(t,e,r){var n=r(4413),i=r(4684);t.exports=function(t){return n(i(t))}},8700:function(t,e,r){var n=r(8828);t.exports=function(t){var e=+t;return e!==e||0===e?0:n(e)}},3126:function(t,e,r){var n=r(8700),i=Math.min;t.exports=function(t){var e=n(t);return e>0?i(e,9007199254740991):0}},560:function(t,e,r){var n=r(9989),i=r(690),o=r(6310),a=r(5649),s=r(5565),l=r(3689),u=l((function(){return 4294967297!==[].push.call({length:4294967296},1)})),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},d=u||!c();n({target:"Array",proto:!0,arity:1,forced:d},{push:function(t){var e=i(this),r=o(e),n=arguments.length;s(r+n);for(var l=0;l