(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1204b85a"],{"857a":function(t,e,n){"use strict";var a=n("e330"),i=n("1d80"),o=n("577e"),l=/"/g,c=a("".replace);t.exports=function(t,e,n,a){var r=o(i(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+c(o(a),l,"&quot;")+'"'),s+">"+r+"</"+e+">"}},9911:function(t,e,n){"use strict";var a=n("23e7"),i=n("857a"),o=n("af03");a({target:"String",proto:!0,forced:o("link")},{link:function(t){return i(this,"a","href",t)}})},af03:function(t,e,n){"use strict";var a=n("d039");t.exports=function(t){return a((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},c9be:function(t,e,n){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",[e("a",{ref:"link",attrs:{href:t.url,target:"_blank"}})])},i=[],o=(n("9911"),{data:function(){return{url:""}},components:{},computed:{},methods:{openWindow:function(t,e){var n=this;this.url=t,this.$nextTick((function(){n.$refs.link.click(),n.$confirm("正在签章，请完成签章操作后点击 “完成签章” 或者直接选择 “退出签章”。","提示",{confirmButtonText:"完成签章",cancelButtonText:"退出签章",type:"info",closeOnClickModal:!1,closeOnPressEscape:!1}).then((function(){n.$emit("CompleteEsign",{isComplete:!0,other:e})})).catch((function(){n.$emit("CompleteEsign",{isComplete:!1,other:e})}))}))}},mounted:function(){}}),l=o,c=n("2877"),r=Object(c["a"])(l,a,i,!1,null,null,null);e["a"]=r.exports},ec28:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t._self._c;return e("div",[e("contract-file",{attrs:{"contract-id":t.contractId,"is-init":!0}})],1)},i=[],o=n("f13a"),l={data:function(){return{contractId:""}},components:{contractFile:o["a"]},mounted:function(){this.contractId=this.$route.query.contractId}},c=l,r=n("2877"),s=Object(r["a"])(c,a,i,!1,null,null,null);e["default"]=s.exports},f13a:function(t,e,n){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",[t.isRed?e("div",{staticStyle:{"margin-top":"20px"}},[e("el-upload",{staticStyle:{display:"inline-block",margin:"0 10px"},attrs:{action:"",multiple:"","show-file-list":!1,"http-request":t.uploadaction}},[e("el-button",{attrs:{type:"primary"}},[t._v(" 上传文件 ")])],1)],1):t._e(),t.isRed?t._e():e("div",{staticStyle:{"margin-top":"20px"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.printPdf}},[t._v(" 打印合同 ")]),e("el-upload",{staticStyle:{display:"inline-block",margin:"0 10px"},attrs:{action:"",multiple:"","show-file-list":!1,"http-request":t.uploadaction}},[e("el-button",{attrs:{type:"primary"}},[t._v(" 上传合同 ")])],1),e("el-button",{attrs:{type:"primary"},on:{click:t.downFiles}},[t._v(" 下载合同 ")]),e("el-button",{attrs:{type:"primary"},on:{click:t.goEsing}},[t._v(" 电子签章 ")]),e("p",{staticStyle:{color:"red","margin-top":"5px"}},[t._v(" 注： 1.若使用纸质版合同，请先点击“打印合同”，打印出纸质合同盖章后再上传合同附件； 2.若使用电子版合同，请点击“电子签章”进行签章，签章完成后会自动生成合同附件。 ")])],1),e("ul",{staticClass:"el-upload-list el-upload-list--text",staticStyle:{margin:"10px 0"}},[e("el-row",{attrs:{gutter:60}},t._l(t.fileList,(function(n,a){return e("el-col",{directives:[{name:"show",rawName:"v-show",value:n.loading,expression:"item.loading"}],key:a,staticClass:"el-col-auto",attrs:{span:9}},[e("li",{staticClass:"el-upload-list__item is-success",attrs:{tabindex:"0"}},[e("a",{staticClass:"el-upload-list__item-name"},[e("i",{staticClass:"el-icon-document"}),t._v(" "+t._s(n.enclosureName)+" ")]),n.loading?t._e():e("label",{staticClass:"el-upload-list__item-status-label"},[e("i",{staticClass:"el-icon-upload-success el-icon-circle-check"})]),n.loading?e("el-progress",{staticStyle:{"margin-top":"5px"},attrs:{percentage:n.percentage,"stroke-width":4,"show-text":!1}}):t._e()],1)])})),1)],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.tableLoading,expression:"tableLoading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","row-key":"id"},on:{"selection-change":t.handleSelectionChange}},[e("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e("el-table-column",{attrs:{prop:"rfileName",label:"文件名称",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){var a=n.row;return[e("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:function(e){return t.openContract(a.rFileCode)}}},[t._v(" "+t._s(a.rFileName)+" ")])]}}])}),e("el-table-column",{attrs:{prop:"rUpdatedBy",label:"上传人",align:"center"}}),e("el-table-column",{attrs:{prop:"rCreatedTime",label:"上传时间",align:"center"}}),e("el-table-column",{attrs:{prop:"rUpdatedTime",label:"最后更新时间",align:"center"}}),e("el-table-column",{attrs:{prop:"pname",label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(n){var a=n.row;return[e("el-popover",{attrs:{width:"160"},model:{value:a.removeVisible,callback:function(e){t.$set(a,"removeVisible",e)},expression:"row.removeVisible"}},[e("p",{staticStyle:{"line-height":"30px"}},[t._v(" 确认删除该文件吗? ")]),e("div",{staticStyle:{"text-align":"right",margin:"0"}},[e("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){a.removeVisible=!1}}},[t._v(" 取消 ")]),e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.removeFile(a)}}},[t._v(" 确定 ")])],1),e("el-button",{staticStyle:{color:"#F56C6C"},attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v(" 删除 ")])],1),e("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"text"},on:{click:function(e){return t.downOneFile(a.rFileCode)}}},[t._v(" 下载 ")])]}}])})],1),t.isShow&&!t.isRed?e("div",{staticStyle:{"margin-top":"10px"}},[e("el-button",{attrs:{type:"primary"},on:{click:t.submit}},[t._v(" 提交并返回列表 ")]),e("el-button",{attrs:{type:"primary"},on:{click:t.back}},[t._v(" 退回到待办 ")])],1):t._e(),e("a",{ref:"downTag",attrs:{href:t.fileserveDownUrl,target:"_blank"}}),e("do-esign",{ref:"doEsign",on:{CompleteEsign:t.CompleteEsign}})],1)},i=[],o=(n("99af"),n("14d9"),n("b0c0"),n("e9f5"),n("7d54"),n("a9e3"),n("d3b7"),n("4d63"),n("c607"),n("ac1f"),n("2c3e"),n("00b4"),n("25f0"),n("159b"),n("36b2")),l=n("ce02"),c=n("c9be"),r=n("b0a5"),s={data:function(){return{tableData:[],multipleSelection:[],fileList:[],tableLoading:!1,uploadUrl:"",downFileUrl:"",token:"",fileserveDownUrl:""}},props:{contractId:{type:[String,Number],required:!0},isInit:{type:Boolean,default:!0},isShow:{type:Boolean,default:!0},isRed:{type:Boolean,default:!1}},components:{doEsign:c["a"]},computed:{},methods:{searchFiles:function(){var t=this;this.tableLoading=!0;var e="";e=this.$route.query.contractId?this.$route.query.contractId:this.contractId,this.isRed?this.fileType=2:this.fileType=1,Object(o["me"])(e,this.fileType).then((function(e){var n=e.data;t.tableLoading=!1,"200"===n.status&&(t.tableData=n.data)})).catch((function(){t.tableLoading=!1}))},initToken:function(){var t=this;Object(o["z"])().then((function(e){var n=e.data;"200"===n.status&&(t.token=n.data.token,t.uploadUrl=n.data.uploadUrl,t.downFileUrl=n.data.downloadUrl)})).catch((function(){}))},submit:function(){var t=this,e={contractId:this.$route.query.contractId};Object(o["Eg"])(e).then((function(e){var n=e.data;"200"===n.status&&(t.$message.success("提交成功"),t.$router.push({name:"agent_thh_list"}))})).catch((function(){}))},back:function(){var t=this;Object(r["Qb"])(this.$route.query.contractId).then((function(e){var n=e.data;"200"===n.status&&t.$router.go(-1)})).catch((function(t){console.log(t)}))},downFiles:function(){var t=this;if(this.multipleSelection.length)if(1===this.multipleSelection.length)this.downOneFile(this.multipleSelection[0].rFileCode);else{var e=[];this.multipleSelection.forEach((function(t){e.push(t.rFileCode)}));var n={catalogName:"下单合同集合",fileIds:e};Object(o["xe"])(n).then((function(e){var n=e.data;"200"===n.status&&t.downzipFile(n.data.token,n.data.downloadZipUrl)})).catch((function(){}))}else this.$notify({title:"请至少选择一个文件",type:"warning"})},downOneFile:function(t){var e=this;this.fileserveDownUrl=this.downFileUrl+"/".concat(t,"?Token=").concat(this.token),this.$nextTick((function(){e.$refs.downTag.click()}))},downzipFile:function(t,e){var n=this;this.fileserveDownUrl=e+"?Token=".concat(t),this.$nextTick((function(){n.$refs.downTag.click()}))},handleSelectionChange:function(t){this.multipleSelection=t},submitfile:function(t){var e=this;this.tableLoading=!0,Object(o["Uf"])(t).then((function(t){var n=t.data;e.tableLoading=!1,"200"===n.status&&e.searchFiles()})).catch((function(){e.tableLoading=!1}))},checkSpecialCharacters:function(t){var e=new RegExp("[`~!@#$^&*()=|{}':;',\\[\\]<>《》/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？ ]");return!!e.test(t)},uploadaction:function(t){var e=this;if(this.checkSpecialCharacters(t.file.name))this.$message.error("文件名中不能包含特殊字符！");else{var n="";n=this.$route.query.contractId?this.$route.query.contractId:this.contractId;var a=new FormData;a.append("files",t.file);var i={enclosureName:t.file.name,loading:!0,percentage:0};this.fileList.push(i),l["a"].post(this.uploadUrl+"?Token=".concat(this.token),a,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){i.percentage=t.loaded/t.total*100|0}}).then((function(a){var o=a.data;"200"===o.status?(e.submitfile([{rFileName:o.data[0].FullName,rFileCode:o.data[0].FID,rContractId:n,rFileType:e.isRed?2:1}]),i.loading=!1,e.$message.success("文件“".concat(t.file.name,"”,上传成功."))):(i.loading=!1,e.$message.error("文件“".concat(t.file.name,"”,上传失败.")))})).catch((function(){i.loading=!1,e.$message.error("文件“".concat(t.file.name,"”,上传失败."))}))}},removeFile:function(t){var e=this;this.tableLoading=!0,Object(o["Bb"])({contractId:t.rContractId,attachmentId:t.rId}).then((function(t){var n=t.data;"200"===n.status?e.searchFiles():e.tableLoading=!1})).catch((function(){e.tableLoading=!1}))},goEsing:function(){var t=this,e="";e=this.$route.query.contractId?this.$route.query.contractId:this.contractId,Object(o["Ib"])(e).then((function(e){var n=e.data;"200"===n.status&&t.$refs.doEsign.openWindow(n.data)})).catch((function(){}))},CompleteEsign:function(t){t.isComplete&&this.searchFiles()},printPdf:function(){var t=this,e="";e=this.$route.query.contractId?this.$route.query.contractId:this.contractId,Object(o["mf"])(e).then((function(e){var n=e.data;"200"===n.status&&(t.fileserveDownUrl="/pdf/web/viewer.html?file=".concat(encodeURIComponent(n.data)),t.$nextTick((function(){t.$refs.downTag.click()})))})).catch((function(){}))},openContract:function(t){Object(o["Ae"])(t).then((function(t){var e=t.data;"200"===e.status&&window.open(e.data)})).catch((function(t){}))}},created:function(){this.isInit&&this.searchFiles(),this.initToken()}},u=s,d=n("2877"),p=Object(d["a"])(u,a,i,!1,null,null,null);e["a"]=p.exports}}]);
//# sourceMappingURL=chunk-1204b85a.bd1cab8b.js.map