chunk-2ab34744.ec1f6e89.js 3.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2ab34744"],{3761:function(t,e,i){"use strict";i("7a30")},"7a30":function(t,e,i){},f1df:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-dialog",{attrs:{title:"模板导入",visible:t.templateDialogVisible,width:"40%","close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(e){t.templateDialogVisible=e},close:t.cancel}},[i("el-row",[i("el-col",{attrs:{span:24}},[i("el-form",{attrs:{inline:!0,"label-position":"right","label-width":"200px"}},[i("el-form-item",{attrs:{label:"导入文件:"}},[i("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{drag:"",action:"",multiple:"",limit:1,accept:".xls, .xlsx","file-list":t.fileList,"before-upload":t.beforeUpload,"http-request":t.uploadHttpRequest,"on-remove":t.removeContractAttachment}},[i("i",{staticClass:"el-icon-upload"}),i("div",{staticClass:"el-upload__text"},[t._v(" 将文件拖到此处,或"),i("em",[t._v("点击上传")])])])],1)],1)],1)],1),i("el-row",[i("span",{staticClass:"download",staticStyle:{cursor:"pointer",width:"100px","margin-left":"200px",color:"#0c80ea"},on:{click:t.downloadTel}},[t._v("下载模板")])]),i("div",{staticStyle:{"margin-top":"20px","margin-left":"200px",color:"#c7bd78"}},[t._v(" 提示:请先按照导出模版文件填写后进行上传 ")]),i("el-row",{staticStyle:{"text-align":"right","margin-top":"50px","padding-top":"10px"}},[i("el-button",{on:{click:t.cancel}},[t._v(" 取消 ")]),i("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"primary"},on:{click:t.submit}},[t._v(" 确定 ")])],1)],1)],1)},l=[],n=i("c7eb"),s=i("1da1"),o=(i("caad"),i("14d9"),i("b0c0"),i("2532"),i("943d")),c=i("21a6"),r=i.n(c),p={name:"EitcErmPcUploadTemplateDialog",props:{listInId:{type:String,default:""}},data:function(){return{templateDialogVisible:!1,whiteList:["xlsx","xls"],formdata:{},fileList:[]}},mounted:function(){},methods:{downloadTel:function(){var t=encodeURI("/static/upload/病历模版.xlsx");window.location.href=t},beforeUpload:function(t){var e=t.name.split(".")[t.name.split(".").length-1];return!!this.whiteList.includes(e)||(this.$message.error("文件格式错误"),!1)},uploadHttpRequest:function(t){this.fileList.push({name:t.file.name});var e=new FormData;e.append("file",t.file),e.append("diagnosisTypeId",this.listInId),this.formdata=e},removeContractAttachment:function(t,e){this.fileList=e},cancel:function(){this.templateDialogVisible=!1,this.fileList=[]},submit:function(){var t=this;return Object(s["a"])(Object(n["a"])().mark((function e(){var i,a;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.fileList.length){e.next=2;break}return e.abrupt("return",t.$message.info("文件不能为空!"));case 2:return e.next=4,Object(o["ob"])(t.formdata);case 4:i=e.sent,console.log(i,888),0!==(null===i||void 0===i?void 0:i.size)&&(a=new Blob([i]),r.a.saveAs(a,"错误信息.xlsx")),0==(null===i||void 0===i?void 0:i.size)&&t.$message.success("导入成功"),t.templateDialogVisible=!1,t.$parent.initList();case 10:case"end":return e.stop()}}),e)})))()}}},d=p,u=(i("3761"),i("2877")),f=Object(u["a"])(d,a,l,!1,null,"08455f49",null);e["default"]=f.exports}}]);