(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08b2476e","chunk-6ddcf9b0","chunk-2d0e66d0"],{"2c4d":function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return a})),r.d(t,"g",(function(){return i})),r.d(t,"e",(function(){return s})),r.d(t,"f",(function(){return l})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return u}));var o=r("b775");function n(e){return Object(o["a"])({url:"/pc/fin/warehouse/ledger/getListExport",responseType:"blob",method:"post",params:e})}function a(e){return Object(o["a"])({url:"/pc/warehouse/warningConfig/add",method:"post",data:e})}function i(e){return Object(o["a"])({url:"/pc/warehouse/warningConfig/upd",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/pc/warehouse/warningConfig/getById",method:"get",params:e})}function l(e){return Object(o["a"])({url:"/pc/warehouse/warningConfig/del",method:"delete",data:e})}function c(e){return Object(o["a"])({url:"/pc/warehouse/warning/getList",method:"get",params:e})}function u(e){return Object(o["a"])({url:"/pc/warehouse/warning/getWarningTypeNum",method:"get",params:e})}},"433d":function(e,t,r){"use strict";var o=r("c559"),n={ftpUrl:o["a"].ftpUrl,apiBaseURL:o["a"].apiBaseURL};t["a"]=n},"6ec5":function(e,t,r){"use strict";r.d(t,"l",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"g",(function(){return s})),r.d(t,"c",(function(){return l})),r.d(t,"j",(function(){return c})),r.d(t,"f",(function(){return u})),r.d(t,"d",(function(){return d})),r.d(t,"e",(function(){return f})),r.d(t,"p",(function(){return p})),r.d(t,"n",(function(){return m})),r.d(t,"m",(function(){return h})),r.d(t,"k",(function(){return g})),r.d(t,"s",(function(){return b})),r.d(t,"r",(function(){return y})),r.d(t,"q",(function(){return v})),r.d(t,"o",(function(){return w})),r.d(t,"b",(function(){return S})),r.d(t,"i",(function(){return O})),r.d(t,"h",(function(){return I}));var o=r("b775"),n=r("433d");function a(e){return o["a"].get(n["a"].apiBaseURL+"/pc/fin/sys/tenant/select/tree_fin_tenant",{params:e})}function i(e){return Object(o["a"])({url:"/pc/base/category/add",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/pc/base/category/edit",method:"post",data:e})}function l(e){return Object(o["a"])({url:"/pc/base/warehouse/add",method:"post",data:e})}function c(e){return Object(o["a"])({url:"/pc/base/warehouse/edit",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/pc/base/warehouse/del",method:"delete",data:e})}function d(){return Object(o["a"])({url:"/pc/base/goods/template/select/classificationCode",method:"get"})}function f(e){return Object(o["a"])({url:"/pc/base/category/del",method:"delete",data:e})}function p(e){return Object(o["a"])({url:"/pc/base/warehouse/select/tenant_warehouse",method:"get",params:e})}function m(e){return Object(o["a"])({url:"/pc/base/goods/template/query/goodsTemplate",method:"get",params:e})}function h(e){return Object(o["a"])({url:"/pc/base/goods/models/query/goodsModel",method:"get",params:e})}function g(e){return o["a"].get(n["a"].apiBaseURL+"/pc/base/category/select/tree",{params:e})}function b(e){return Object(o["a"])({url:"/pc/base/warehouse/select/number",method:"get",params:e})}function y(e){return Object(o["a"])({url:"/pc/base/warehouse/select/in/warehouse/num",method:"get",params:e})}function v(e){return Object(o["a"])({url:"/pc/fin/sys/tenant/user/query/user",method:"get",params:e})}function w(e){return Object(o["a"])({url:"/pc/base/goods/models/queryGoodsModelInfo",method:"get",params:e})}function S(e){return Object(o["a"])({url:"/pc/fin/sys/tenant/add",method:"post",data:e})}function O(e){return Object(o["a"])({url:"/pc/fin/sys/tenant/edit",method:"post",data:e})}function I(e){return Object(o["a"])({url:"/pc/fin/sys/tenant/editState",method:"post",data:e})}},9960:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.dialogShow?r("el-dialog",{attrs:{width:"40%",center:!0,"close-on-click-modal":!1,"close-on-press-escape":!1,title:e.dialogTitle,"before-close":e.beforeClose,modal:e.modal,visible:e.dialogShow}},[r("el-row",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"element-loading-text":"数据导入中"}},[r("el-col",{attrs:{span:24}},[r("el-form",[null!=e.templateSettings.templateUrl?r("el-form-item",{attrs:{label:"下载模板:",prop:"lon"}},[r("a",{staticClass:"blue-txt",staticStyle:{color:"#409EFF"},attrs:{href:e.templateSettings.templateUrl,target:"_blank",rel:"noreferrer noopener"}},[e._v(e._s(e.templateSettings.templateName))])]):e._e(),e._v(" "),r("el-form-item",{attrs:{label:"选取文件:",prop:"lon"}},[r("el-upload",{ref:e.fileSettings.ref,staticClass:"upload-demo",attrs:{headers:e.headers,name:"file",data:e.fileSettings.data,action:e.fileSettings.uploadUrl,"before-upload":e.beforeAvatarUpload,"on-success":e.handleUploadSuccess,"on-change":e.file,multiple:e.fileSettings.multiple,limit:e.fileSettings.num,accept:e.fileSettings.accept,"auto-upload":e.fileSettings.autoUpload}},[r("el-button",{attrs:{size:"small",type:"primary"}},[e._v(e._s(e.fileSettings.title))]),e._v(" "),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("只能上传"+e._s(e.fileSettings.num)+"个格式为"+e._s(e.fileSettings.accept)+"的文件,且不超过"+e._s(e.fileSettings.max)+"kb")])],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"导入数据:",prop:"lon"}},[r("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"success"},on:{click:e.handleSubmit}},[e._v("开始导入")])],1)],1)],1)],1)],1):e._e()},n=[],a=r("5f87"),i=r("83d6"),s={props:{importSetting:{type:Object,default:function(){return{}}},dialogShow:{type:Boolean,default:!1},modal:{type:Boolean,default:!1},dialogTitle:{type:String,default:""}},data:function(){return{headers:{},loading:!1,fileSettings:{ref:"myFile",data:{},title:"点击上传",max:1024,num:1,accept:".xlsx",uploadUrl:"",type:"text",multiple:!1,disabled:!1,autoUpload:!1,onSuccess:null},isUpload:!1,templateSettings:{templateName:"模板下载",templateUrl:null}}},watch:{dialogShow:function(e){e&&(this.fileSettings=Object.assign(this.fileSettings,this.importSetting.fileSettings),this.templateSettings=Object.assign(this.templateSettings,this.importSetting.templateSettings),console.log(this.templateSettings),this.fileSettings.onSuccess=this.importSetting.onSuccess)}},mounted:function(){this.headers[i["sessionToken"]]=Object(a["a"])()},methods:{beforeClose:function(){var e=this;this.loading?this.$confirm("正在执行导入,确认关闭?").then((function(){e.importSetting.dialogShow=!1,e.loading=!1})).catch():this.importSetting.dialogShow=!1},beforeAvatarUpload:function(e){var t=this.fileSettings.accept.split(",").indexOf(e.name.substr(e.name.lastIndexOf("."),e.name.length).toLocaleString())>-1;t||this.$message.error("上传文件只能是 ".concat(this.fileSettings.accept," 格式!"));var r=e.size/1024=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;k(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,o){return this.delegate={iterator:N(t),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=e),y}},t}function f(e,t,r,o,n,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(o,n)}function p(e){return function(){var t=this,r=arguments;return new Promise((function(o,n){var a=e.apply(t,r);function i(e){f(a,o,n,i,s,"next",e)}function s(e){f(a,o,n,i,s,"throw",e)}i(void 0)}))}}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function h(e){for(var t=1;t=e.upperLimit?r(new Error(1===e.type?"保底库存必须小于封顶库存":"封顶库存必须大于保底库存")):void r():r(new Error("请输入数字值")):r(new Error(1===e.type?"请输入保底数量":"请输入封顶数量"))},loading:!0,type:"",warehouses:[],agencyOptions:[],categoryOptions:[],goodsTemplatelOptions:[],modelsOptions:[],formData:{warehouseType:0,baseWarehouseId:"",baseCategoryIds:"",baseCategoryId:"",baseGoodsTemplateId:"",modelsIds:[],models:[]},rules:{baseWarehouseId:[{required:!0,message:"请选择预警仓库",trigger:"change"}],baseCategoryId:[{required:!0,message:"请选择物品分类",trigger:"change"}],baseGoodsTemplateId:[{required:!0,message:"请选择物品",trigger:"change"}],modelsIds:[{required:!0,message:"请选择规格型号",trigger:"change"}],lowerLimit:[{required:!0,message:"请输入",trigger:"blur"},{type:"number",message:"请输入数字值",trigger:"blur"}],upperLimit:[{required:!0,message:"请输入",trigger:"blur"},{type:"number",message:"请输入数字值",trigger:"blur"}]}}},computed:h({},Object(c["b"])(["userInfo"])),created:function(){this.init()},methods:{init:function(){var e=p(d().mark((function e(){var t,r;return d().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getWarehouseList();case 2:return e.next=4,this.getCategoryTree();case 4:if(!this.setting.id){e.next=18;break}return this.type="edit",e.next=8,Object(l["e"])({id:this.setting.id});case 8:return t=e.sent,e.next=11,Object(s["o"])({baseGoodsModelsId:t.baseGoodsModelsId});case 11:r=e.sent,t.baseCategoryId=r[0].categoryId,this.getgoodsTemplate(t.baseCategoryId),this.getgoodsModel(t.baseGoodsTemplateId),this.formData=Object.assign({},t),this.formData.modelsIds=[t.baseGoodsModelsId],this.getWarehouseList();case 18:this.loading=!1;case 19:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),getWarehouseList:function(){var e=this;Object(s["p"])({agencyId:this.userInfo.tenantId}).then((function(t){e.warehouses=t,e.warehouses.length&&!e.formData.baseWarehouseId&&(e.formData.baseWarehouseId=e.warehouses[0].id)})).catch((function(e){console.log("err",e)}))},getCategoryTree:function(){var e=this;return new Promise(function(){var t=p(d().mark((function t(r){var o;return d().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["k"])();case 2:o=t.sent,e.categoryOptions=e.removeEmptyChildren(o),r();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},getgoodsTemplate:function(e){var t=this;Object(s["n"])({categoryId:e||"",agencyId:this.userInfo.tenantId}).then((function(e){t.goodsTemplatelOptions=e}))},getgoodsModel:function(e){var t=this;Object(s["m"])({goodsTemplatesId:e||""}).then((function(e){t.modelsOptions=e}))},getGoodsModelsName:function(e){var t=this.modelsOptions.find((function(t){return t.id==e}));if(t)return t.modelName},categoryChange:function(e){this.goodsTemplatelOptions=[],this.modelsOptions=[],this.formData.baseGoodsTemplateId="",this.formData.modelsIds=[],this.formData.models=[],this.getgoodsTemplate(e)},goodsTemplateChange:function(e){this.formData.modelsIds=[],this.formData.models=[],this.formData.baseGoodsTemplateId=e,this.getgoodsModel(e)},removeEmptyChildren:function(e){var t=this;return e.forEach((function(e){e.children&&e.children.length?t.removeEmptyChildren(e.children):delete e.children})),e},modelChange:function(e){var t=this.formData.models,r=JSON.stringify(t);e.forEach((function(e,o){r&&!r.includes(e)&&t.push({baseGoodsModelsId:e,lowerLimit:null,upperLimit:null})}))},modelRemoveTag:function(e){if(-1!==e){var t=this.formData.models.findIndex((function(t){return t.baseGoodsModelsId==e}));this.formData.models.splice(t,1)}else this.formData.models=[]},getEditInfo:function(e){},close:function(){this.$emit("close")},save:function(){var e=this;this.$refs.ruleForm.validate((function(t){if(t){if(e.loading)return;if(e.loading=!0,e.setting.id){var r={id:e.setting.id,lowerLimit:e.formData.lowerLimit,upperLimit:e.formData.upperLimit};Object(l["g"])(r).then((function(t){e.loading=!1,e.$message.success("保存成功!"),e.close(),e.$emit("search")})).catch((function(t){e.loading=!1,e.$message.error("保存失败")}))}else{var o={warehouseType:e.formData.warehouseType,baseWarehouseId:e.formData.baseWarehouseId,baseGoodsTemplateId:e.formData.baseGoodsTemplateId,modelConfigStr:JSON.stringify(e.formData.models)};Object(l["d"])(o).then((function(t){e.loading=!1,e.$message.success("保存成功!"),e.close(),e.$emit("search")})).catch((function(t){e.loading=!1,e.$message.error("保存失败")}))}}else e.$message.error("校验未通过,请检查。")}))}}},w=v,S=r("2877"),O=Object(S["a"])(w,o,n,!1,null,null,null);t["default"]=O.exports}}]);