(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[24],{4309:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return m}});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:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch.apply(null,arguments)}},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:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch.apply(null,arguments)}},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"},on:{change:function(e){return t.handleSearch()}},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=[],a=(r(560),r(3550)),s=r(9669),o=r.n(s),u=r(9036),c=r(7484),l=r.n(c),d={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,a.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,a.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");o().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,u.NR)(t).then((e=>{this.goodsList=e.data.filter((e=>e.title.toLowerCase().indexOf(t.toLowerCase())>-1))}))}),200)):this.goodsList=[]}},mounted(){let t=l()().subtract(7,"day").format("YYYY-MM-DD")+" 00:00:00",e=l()().format("YYYY-MM-DD hh:mm:ss");this.addTime=[t,e],this.fetchList()}},f=d,h=r(1001),p=(0,h.Z)(f,n,i,!1,null,"475fb543",null),m=p.exports},7484:function(t){!function(e,r){t.exports=r()}(0,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",a="minute",s="hour",o="day",u="week",c="month",l="quarter",d="year",f="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},v=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},y={s:v,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+v(n,2,"0")+":"+v(i,2,"0")},m:function t(e,r){if(e.date()1)return t(s[0])}else{var o=e.name;b[o]=e,i=o}return!n&&i&&(_=i),i||!n&&_},x=function(t,e){if(k(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},M=y;M.l=w,M.i=k,M.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function g(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[$]=!0}var v=g.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(p);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return M},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var r=x(t);return this.startOf(e)<=r&&r<=this.endOf(e)},v.isAfter=function(t,e){return x(t)l)if(o=u[l++],o!==o)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},5649:function(t,e,r){"use strict";var n=r(7697),i=r(2297),a=TypeError,s=Object.getOwnPropertyDescriptor,o=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=o?function(t,e){if(i(t)&&!s(t,"length").writable)throw new a("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},8758:function(t,e,r){"use strict";var n=r(6812),i=r(9152),a=r(2474),s=r(2560);t.exports=function(t,e,r){for(var o=i(e),u=s.f,c=a.f,l=0;lr)throw e("Maximum allowed index exceeded");return t}},2739:function(t){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:function(t,e,r){"use strict";var n=r(9037),i=r(2474).f,a=r(5773),s=r(1880),o=r(5014),u=r(8758),c=r(5266);t.exports=function(t,e){var r,l,d,f,h,p,m=t.target,g=t.global,v=t.stat;if(l=g?n:v?n[m]||o(m,{}):n[m]&&n[m].prototype,l)for(d in e){if(h=e[d],t.dontCallGetSet?(p=i(l,d),f=p&&p.value):f=l[d],r=c(g?d:m+(v?".":"#")+d,t.forced),!r&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(t.sham||f&&f.sham)&&a(h,"sham",!0),s(l,d,h,t)}}},4413:function(t,e,r){"use strict";var n=r(8844),i=r(3689),a=r(6648),s=Object,o=n("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"===a(t)?o(t,""):s(t)}:s},2297:function(t,e,r){"use strict";var n=r(6648);t.exports=Array.isArray||function(t){return"Array"===n(t)}},5266:function(t,e,r){"use strict";var n=r(3689),i=r(9985),a=/#|\.prototype\./,s=function(t,e){var r=u[o(t)];return r===l||r!==c&&(i(e)?n(e):!!e)},o=s.normalize=function(t){return String(t).replace(a,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",l=s.POLYFILL="P";t.exports=s},6310:function(t,e,r){"use strict";var n=r(3126);t.exports=function(t){return n(t.length)}},8828:function(t){"use strict";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){"use strict";var n=r(7697),i=r(2615),a=r(9556),s=r(5684),o=r(5290),u=r(8360),c=r(6812),l=r(8506),d=Object.getOwnPropertyDescriptor;e.f=n?d:function(t,e){if(t=o(t),e=u(e),l)try{return d(t,e)}catch(r){}if(c(t,e))return s(!i(a.f,t,e),t[e])}},2741:function(t,e,r){"use strict";var n=r(4948),i=r(2739),a=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,a)}},7518:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},4948:function(t,e,r){"use strict";var n=r(8844),i=r(6812),a=r(5290),s=r(4328).indexOf,o=r(7248),u=n([].push);t.exports=function(t,e){var r,n=a(t),c=0,l=[];for(r in n)!i(o,r)&&i(n,r)&&u(l,r);while(e.length>c)i(n,r=e[c++])&&(~s(l,r)||u(l,r));return l}},9556:function(t,e){"use strict";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){"use strict";var n=r(6058),i=r(8844),a=r(2741),s=r(7518),o=r(5027),u=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=a.f(o(t)),r=s.f;return r?u(e,r(t)):e}},7578:function(t,e,r){"use strict";var n=r(8700),i=Math.max,a=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):a(r,e)}},5290:function(t,e,r){"use strict";var n=r(4413),i=r(4684);t.exports=function(t){return n(i(t))}},8700:function(t,e,r){"use strict";var n=r(8828);t.exports=function(t){var e=+t;return e!==e||0===e?0:n(e)}},3126:function(t,e,r){"use strict";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){"use strict";var n=r(9989),i=r(690),a=r(6310),s=r(5649),o=r(5565),u=r(3689),c=u((function(){return 4294967297!==[].push.call({length:4294967296},1)})),l=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},d=c||!l();n({target:"Array",proto:!0,arity:1,forced:d},{push:function(t){var e=i(this),r=a(e),n=arguments.length;o(r+n);for(var u=0;u