(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2a4c423e"],{"094b":function(e,t,a){"use strict";var o=a("1c4f"),n=a.n(o);n.a},"1c4f":function(e,t,a){},be4f:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"brand_content"},[a("div",{staticClass:"brand_header"},[a("span",{on:{click:e.goBack}},[a("Icon",{attrs:{type:"md-arrow-back",size:"18",color:"#1890FF"}})],1),a("span",[e._v("Excel批量上传商标")])]),a("div",{staticClass:"brand_content_upload"},[e._m(0),a("div",[a("Upload",{ref:"upload",attrs:{data:e.d,action:e.action,accept:".csv","on-success":e.handleSuccess,"before-upload":e.handleBeforeUpload}},[a("Button",{attrs:{icon:"ios-cloud-upload-outline"}},[e._v("上传Csv文件")])],1),a("Button",{attrs:{type:"primary"},on:{click:e.check}},[e._v("发布")])],1)]),a("BizTable",{ref:"bt",attrs:{formatCol:e.formatCol,modelName:"upload",metaName:"upload_info",packageName:"trademark",tblheight:e.adjustHeight-120,isMulti:"",refvalidatemethod:e.validmethod,savebefore:e.beforesave,editbefore:e.beforedit,addbefore:e.beforeadd},on:{onexec:e.onexec,oninitbtn:e.oninitbtn}}),a("Modal",{attrs:{title:"确定发布？"},on:{"on-ok":e.ok,"on-cancel":e.cancel},model:{value:e.modal1,callback:function(t){e.modal1=t},expression:"modal1"}},[a("Form",{ref:"forminfo",staticStyle:{height:"100%"},attrs:{model:e.formItem,"label-position":"left",rules:e.ruleValidate}},[a("FormItem",{attrs:{label:"批次名称",prop:"name"}},[a("Input",{attrs:{placeholder:""},model:{value:e.formItem.name,callback:function(t){e.$set(e.formItem,"name",t)},expression:"formItem.name"}})],1)],1),a("p",[e._v("发布后平台审核人员会在1个工作日内审核上架，请耐心等待")])],1)],1)},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("p",[e._v(" 第一次上传请下载 "),a("a",{attrs:{href:"https://gsb-zc.oss-cn-beijing.aliyuncs.com/%E5%95%86%E6%A0%87%E6%A8%A1%E7%89%88.csv",download:"商标上传模版.csv"}},[e._v("商标上传模板")]),e._v(" ，并严格按模板提供内容填入商标信息。 ")])}],r=(a("7f7f"),a("a481"),a("c1df")),c=a.n(r),s=a("0086"),i=a("60b7"),l=a("06d3"),u=a("7e1e"),d=(a("c276"),{components:{BizTable:l["a"],Forms:s["a"]},data:function(){return{fileurl:"",modal1:!1,action:"",d:{},formItem:{name:""},ruleValidate:{name:[{required:!0,message:"批次名称不能为空",trigger:"blur"}]}}},methods:{goBack:function(){this.$router.go(-1)},handleSuccess:function(e,t,a){var o=this.loadXML(e),n=o.documentElement.getElementsByTagName("Location")[0].textContent;this.fileurl=n},loadXML:function(e){var t=null;if(!window.DOMParser&&window.ActiveXObject)for(var a=["MSXML.2.DOMDocument.6.0","MSXML.2.DOMDocument.3.0","Microsoft.XMLDOM"],o=0;o<a.length;o++)try{t=new ActiveXObject(a[o]),t.async=!1,t.loadXML(e);break}catch(r){}else{if(!(window.DOMParser&&document.implementation&&document.implementation.createDocument))return null;try{var n=new DOMParser;t=n.parseFromString(e,"text/xml")}catch(r){console.log(r)}}return t},handleBeforeUpload:function(e){this.$refs.upload.clearFiles();var t=new Date;return this.d.key="zc_"+Math.round(500*Math.random())+t.getMonth()+t.getTime()+t.getFullYear()+t.getDate()+t.getHours()+t.getMinutes()+t.getSeconds()+t.getMilliseconds()+e.name.replace(" ",""),!0},check:function(){if(!this.fileurl)return this.$Message.warning("先上传文件");this.modal1=!0},ok:function(){var e=this;this.$refs.forminfo.validate((function(t){t?e.publish(e.formItem.name):e.modal1=!0}))},cancel:function(){},publish:function(e){var t=this;Object(u["f"])("/web/trademark/trademarkCtl/excelpublish",{file_url:this.fileurl,name:e,channel_name:this.$store.state.user.userobj.company.name}).then((function(e){-200!=e.data.status?(t.$Message.success("发布成功"),t.$refs.bt.fetchData(),t.$refs.upload.clearFiles(),t.fileurl=""):(t.$Message.error("发布失败"),console.log("details err:",e))})).catch((function(e){t.$Message.error("发布失败"),console.log("details err:",e)}))},onexec:function(e,t){var a=this;"info"===e&&Object(u["f"])("/web/trademark/trademarkCtl/getidlist",{upload_id:t.id}).then((function(e){if(-200!=e.data.status){var t=e.data.data.map((function(e){return e.trademark_id}));a.$router.push({name:"originmanage_order",query:{ids:t}})}else console.log("details err:",e)})).catch((function(e){console.log("details err:",e)}))},formatCol:function(e,t,a){var o=e[t];return"created_at"===t?o=c()(o).format("YYYY-MM-DD"):"status"===t&&(o=0==o?"处理中":"处理完成"),o}},mounted:function(){var e=this,t="/web/common/uploadCtl/getOssConfig";Object(i["a"])(t,null).then((function(t){if(200==t.status){var a=t.data;e.d["key"]="key",e.d["Bucket"]=a.Bucket,e.d["OSSAccessKeyId"]=a.OSSAccessKeyId,e.d["Signature"]=a.Signature,e.d["policy"]=a.policy,e.d["success_action_status"]=a.success_action_status,e.action=a.url}else console.log("cofig fetch failuer")}))},watch:{}}),f=d,m=(a("094b"),a("2877")),h=Object(m["a"])(f,o,n,!1,null,"0b6e6fc4",null);t["default"]=h.exports}}]);