(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-d569"],{"/01j":function(e,t,a){"use strict";a.r(t);var s={components:{dialog_choice_department_staff:a("x8Yw").a},data:function(){return{modeRadio:0,signTableData:[],person_id:"",seal_id:"",options:[],loading:!1,signerLoading:!1,addDepartmentTipsShow:!1,checkAll:!1,isIndeterminate:!1,worker_list:[],progressFlag1:!1,progressFlag2:!1,progressPercent1:0,progressPercent2:0,id:"",currIndex:1,maxSize:104693760,contract_attach:[],contract_doc_name:"",contract_doc_url:"",showSeal:"0",showSigner:"0",ruleForm:{name:"",status:!0,auth_worker_status:"0",auth_worker:[]},rules:{name:[{required:!0,message:"请输入模版名称",trigger:"blur"}]},checkboxArr:[],checkboxIds:{},sign_role_max:3}},watch:{},created:function(){this.id=this.$route.query.id,this.getDeatil()},destroyed:function(){},methods:{remoteMethod:function(e){var t=this;this.signerLoading=!0,$http.post("plugin.yun-sign.frontend.company-seal.getWorkerList",{kwd:e}).then(function(e){1===e.result?t.worker_list=e.data.worker_list:console.log(e.msg),t.signerLoading=!1}).catch(function(e){console.log(e)})},remoteMethodSeal:function(e){var t=this;this.loading=!0,$http.post("plugin.yun-sign.frontend.template.getCompanySeal",{kwd:e}).then(function(e){1===e.result?t.options=e.data:console.log(e.msg),t.loading=!1}).catch(function(e){console.log(e)})},choiceComfirm:function(e){this.checkboxArr=e.checkboxArr,this.checkboxIds=e.checkboxIds},delChoice:function(e){"staff"==e.type?delete this.checkboxIds[e.user_id]:delete this.checkboxIds[e.id];var t=[];for(var a in this.checkboxIds)t.push(this.checkboxIds[a]);this.checkboxArr=t},openChoice:function(){var e=this;this.addDepartmentTipsShow=!0,this.$nextTick(function(){e.$refs.dialog_choice_department_staff.setChoiceData(e.checkboxIds)})},getDeatil:function(){var e=this;$http.post("plugin.yun-sign.frontend.template.get-detail",{id:this.id},"loading").then(function(t){if(1===t.result){e.Data=t.data,e.ruleForm.name=e.Data.name,1==e.Data.status?e.ruleForm.status=!0:e.ruleForm.status=!1,e.contract_doc_name=e.Data.contract_doc_name,e.contract_doc_url=e.Data.contract_doc_url,e.contract_attach=e.Data.contract_attach||[],e.Data.auth_worker_status&&(e.ruleForm.auth_worker_status=e.Data.auth_worker_status.toString()),e.sign_role_max=Number(t.data.sign_role_max)||3;var a=e.Data.staff||[],s=e.Data.department||[];e.checkboxArr=a.concat(s)||[];var o={};if(e.checkboxArr.map(function(e){e.user_id?e.type="staff":e.type="department",o[e.user_id?e.user_id:e.id]=e}),e.checkboxIds=o,e.Data.appoint_person&&(e.showSigner="1",e.person_id=e.Data.appoint_person.name),e.Data.appoint_seal&&(e.showSeal="1",e.seal_id=e.Data.appoint_seal.name),e.remoteMethodSeal(""),e.modeRadio=Number(t.data.role_sign_mode)||0,t.data.roles_list&&t.data.roles_list.length>0)t.data.roles_list.forEach(function(t){e.signTableData.push({sign_role_name:t.sign_role_name&&t.sign_role_name.toString()||"",id:t.id,role_id:t.role_id&&t.role_id.toString()||"",name:t.name,tel:t.tel,sign_type:t.sign_type&&t.sign_type.toString()||"0",company_name:t.company_name})});else{var i=window.localStorage.getItem("identity_type")||2;e.signTableData.push({role_id:"1",sign_role_name:"签署方1",name:"",tel:"",sign_type:2==i?"1":"0",company_name:""})}}else e.$message.error(t.msg)}).catch(function(e){console.log(e)})},selectStyle:function(){this.currIndex=1},outStyle:function(){this.currIndex=1},deleteSingle:function(){this.contract_doc_name="",this.contract_doc_url=""},deleteList:function(e){this.contract_attach.splice(e,1)},onProgress1:function(e,t,a){this.progressPercent1=Number(e.percent.toFixed(2))},onProgress2:function(e,t,a){this.progressPercent2=Number(e.percent.toFixed(2))},beforeUpload1:function(e){if(e.size>=this.maxSize)return this.$message.error("文件大小超出10M"),!1;this.progressFlag1=!0},beforeUpload2:function(e){if(e.size>=this.maxSize)return this.$message.error("文件大小超出10M"),!1;this.progressFlag2=!0},onSuccess:function(e,t,a){100===this.progressPercent1&&(this.progressFlag1=!1,this.progressPercent1=0),this.contract_doc_name=e.data.file_name,this.contract_doc_url=e.data.file_url},onSuccess2:function(e,t,a){100===this.progressPercent2&&(this.progressFlag2=!1,this.progressPercent2=0),this.contract_attach.push(e.data)},onError:function(){this.progressFlag1=!1,this.progressFlag2=!1,this.progressPercent1=0,this.progressPercent2=0,this.$message.error("上传失败请重新上传")},submitForm:function(e){var t=this;if(this.ruleForm.name)if(this.contract_doc_url){var a=this.ruleForm.auth_worker;a=a.map(function(e){return{worker_id:e}});var s=0;s=this.ruleForm.status?1:0;var o={name:this.ruleForm.name,status:s,auth_worker_status:this.ruleForm.auth_worker_status,auth_worker:a,contract_doc_name:this.contract_doc_name,contract_doc_url:this.contract_doc_url,contract_attach:this.contract_attach||[],role_list:this.signTableData,role_sign_mode:this.modeRadio},i=[],r=[];this.checkboxArr.map(function(e){"staff"==e.type?i.push(e.id):r.push(e.id)}),o.staff_ids=i,o.department_ids=r,"1"==this.showSeal&&(o.seal_id=Number(this.seal_id)>=0?this.seal_id:this.Data.appoint_seal?this.Data.appoint_seal.id:""),"1"==this.showSigner&&(o.person_id=Number(this.person_id)>=0?this.person_id:this.Data.appoint_person?this.Data.appoint_person.id:"");var n="";"save"==e?(o.id=this.id,n="plugin.yun-sign.frontend.template.edit-template"):n="plugin.yun-sign.frontend.template.add-template",$http.post(n,o,"loading").then(function(e){if(1===e.result){var a="";a=e.data.template_id?e.data.template_id:t.id,t.$router.push(t.fun.getUrl("set_template",{id:a}))}else t.$message.error(e.msg)}).catch(function(e){console.log(e)})}else this.$message.error("请先上传模版文件");else this.$message.error("请先填写模版名称")},onChangeMode:function(e){var t=Number(e)+1;if(this.signTableData.length>t)this.signTableData.splice(t);else if(1==Number(this.modeRadio)&&this.signTableData.length<2)this.toAdd();else if(2==Number(this.modeRadio)&&this.signTableData.length0)for(var s=0;s=this.sign_role_max)this.$message.error("签署角色最多"+this.sign_role_max+"个");else{var t=this.signTableData.length+1,a=window.localStorage.getItem("identity_type")||2;this.signTableData.push({role_id:t.toString(),sign_role_name:"签署方"+t.toString(),name:"",tel:"",sign_type:e||(2==a?"1":"0"),company_name:""})}},handleSelectChange:function(e,t){for(var a=0;a 企业管理 -> 模板管理 -> 创建模板")]),e._v(" "),s("div",{staticClass:"box"},[e._m(0),e._v(" "),s("div",{staticStyle:{"padding-right":"50px"}},[s("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"140px"},nativeOn:{submit:function(e){e.preventDefault()}}},[s("el-form-item",{attrs:{label:"模版名称",prop:"name"}},[s("el-input",{attrs:{placeholder:"请输入模版名称"},model:{value:e.ruleForm.name,callback:function(t){e.$set(e.ruleForm,"name","string"==typeof t?t.trim():t)},expression:"ruleForm.name"}})],1),e._v(" "),s("el-form-item",{attrs:{label:"状态"}},[s("el-switch",{model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}}),e._v(" "),s("span",{staticStyle:{"margin-left":"20px"}},[e._v(e._s(e.ruleForm.status?"启用":"禁用"))])],1),e._v(" "),s("el-form-item",{attrs:{label:"是否指定印章"}},[s("el-radio",{attrs:{label:"1"},model:{value:e.showSeal,callback:function(t){e.showSeal=t},expression:"showSeal"}},[e._v("是")]),e._v(" "),s("el-radio",{attrs:{label:"0"},model:{value:e.showSeal,callback:function(t){e.showSeal=t},expression:"showSeal"}},[e._v("否")]),e._v(" "),1==e.showSeal?s("el-select",{staticStyle:{width:"250px"},attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"可搜索选择印章","remote-method":e.remoteMethodSeal,loading:e.loading},model:{value:e.seal_id,callback:function(t){e.seal_id=t},expression:"seal_id"}},e._l(e.options,function(e){return s("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})):e._e()],1),e._v(" "),s("el-form-item",{attrs:{label:"可见范围"}},[s("div",{staticStyle:{display:"flex","flex-wrap":"wrap"}},[s("div",{staticClass:"show-people"},e._l(e.checkboxArr,function(t){return s("span",{staticClass:"show-people-item"},[s("i",{staticClass:"iconfont ",class:["department"==t.type?"icon-fontclass-bumenguanli":"icon-fontclass-yuangongguanli"]}),e._v(e._s(t.name)),s("i",{staticClass:"iconfont icon-close11",on:{click:function(a){e.delChoice(t)}}})])})),e._v(" "),s("el-button",{attrs:{type:"text"},on:{click:e.openChoice}},[e._v("添加")])],1)]),e._v(" "),s("el-form-item",{attrs:{label:"是否指定签署人"}},[s("el-radio",{attrs:{label:"1"},model:{value:e.showSigner,callback:function(t){e.showSigner=t},expression:"showSigner"}},[e._v("是")]),e._v(" "),s("el-radio",{attrs:{label:"0"},model:{value:e.showSigner,callback:function(t){e.showSigner=t},expression:"showSigner"}},[e._v("否")]),e._v(" "),1==e.showSigner?s("el-select",{staticStyle:{width:"250px"},attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"搜索员工姓名选择指定签署人","remote-method":e.remoteMethod,loading:e.signerLoading},model:{value:e.person_id,callback:function(t){e.person_id=t},expression:"person_id"}},e._l(e.worker_list,function(e){return s("el-option",{key:e.person.id,attrs:{label:e.name+(e.person?e.person.tel:""),value:e.person.id}})})):e._e()],1)],1)],1)]),e._v(" "),s("dialog_choice_department_staff",{ref:"dialog_choice_department_staff",attrs:{from:"sign",show:e.addDepartmentTipsShow},on:{confirm:e.choiceComfirm,"update:show":function(t){e.addDepartmentTipsShow=t}}}),e._v(" "),s("div",{staticClass:"box"},[e._m(1),e._v(" "),s("div",{staticClass:"template-box"},[s("el-row",[s("el-col",{attrs:{span:3}},[s("div",[e._v("合同文档")])]),e._v(" "),s("el-col",{attrs:{span:10}},[e.contract_doc_name?e._e():s("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{"show-file-list":!1,"before-upload":e.beforeUpload1,"on-progress":e.onProgress1,"on-success":e.onSuccess,"on-error":e.onError,accept:"application/pdf",action:e.fun.getRealUrl("plugin.yun-sign.frontend.template.upload")}},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.progressFlag1,expression:"progressFlag1"}],staticClass:"progress-box"},[s("el-progress",{attrs:{type:"circle",percentage:e.progressPercent1}})],1),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.progressFlag1,expression:"!progressFlag1"}],staticClass:"fileAddItem_1Vqb7"},[s("i",{staticClass:"iconfont icon-adsystem_icon_add"}),e._v(" "),s("p",{staticClass:"defaultInfoStyle_2mgdq"},[e._v("添加模版")])]),e._v(" "),s("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("支持10M以内的pdf格式文件")])]),e._v(" "),s("div",{staticStyle:{height:"20px"}}),e._v(" "),e.contract_doc_name?s("div",{staticClass:"fileItemArea_2VWWl"},[s("div",{staticClass:"imgPlaceholder_22teb"},[s("div",{directives:[{name:"show",rawName:"v-show",value:1==e.currIndex,expression:"currIndex == 1"}],on:{mouseover:e.selectStyle,mouseout:e.outStyle}},[s("img",{attrs:{src:a("ud4p"),alt:""}})]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:0==e.currIndex,expression:"currIndex == 0"}],on:{mouseover:e.selectStyle,mouseout:e.outStyle}},[s("img",{attrs:{src:a("G2Fa"),alt:""}})])]),e._v(" "),s("div",{staticClass:"fileInfoArea_3dGBW"},[s("p",{staticClass:"fileName_25vmY"},[e._v(e._s(e.contract_doc_name))]),e._v(" "),s("p",{staticClass:"fileName_25vmY deleted",on:{click:e.deleteSingle}},[s("i",{staticClass:"el-icon-delete"}),e._v("删除")])])]):e._e()],1)],1),e._v(" "),s("el-row",[s("el-col",{attrs:{span:3}},[s("div",[e._v("模版附件")])]),e._v(" "),s("el-col",{attrs:{span:20}},[s("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{"show-file-list":!1,"before-upload":e.beforeUpload2,"on-progress":e.onProgress2,"on-success":e.onSuccess2,"on-error":e.onError,accept:"application/pdf",action:e.fun.getRealUrl("plugin.yun-sign.frontend.template.upload")}},[s("el-button",{attrs:{size:"small",type:"primary"}},[e._v("点击上传附件")]),e._v(" "),s("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("支持10M以内的pdf格式文件")])],1),e._v(" "),s("div",{staticStyle:{height:"20px"}}),e._v(" "),e._l(e.contract_attach,function(t,o){return s("div",{key:o,staticClass:"fileItemArea_2VWWl"},[s("div",{staticClass:"imgPlaceholder_22teb"},[s("div",{directives:[{name:"show",rawName:"v-show",value:1==e.currIndex,expression:"currIndex == 1"}],on:{mouseover:e.selectStyle,mouseout:e.outStyle}},[s("img",{attrs:{src:a("ud4p"),alt:""}})]),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:0==e.currIndex,expression:"currIndex == 0"}],on:{mouseover:e.selectStyle,mouseout:e.outStyle}},[s("img",{attrs:{src:a("G2Fa"),alt:""}})])]),e._v(" "),s("div",{staticClass:"fileInfoArea_3dGBW"},[s("p",{staticClass:"fileName_25vmY"},[e._v(e._s(t.file_name))]),e._v(" "),s("p",{staticClass:"fileName_25vmY deleted",on:{click:function(t){e.deleteList(o)}}},[s("i",{staticClass:"el-icon-delete"}),e._v("删除")])])])}),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:e.progressFlag2,expression:"progressFlag2"}],staticClass:"progress-box",staticStyle:{display:"inline-block"}},[s("el-progress",{attrs:{type:"circle",percentage:e.progressPercent2}})],1)],2)],1)],1)]),e._v(" "),s("div",{staticClass:"box"},[e._m(2),e._v(" "),s("div",{staticStyle:{padding:"10px"}},[s("el-radio-group",{on:{change:e.onChangeMode},model:{value:e.modeRadio,callback:function(t){e.modeRadio=t},expression:"modeRadio"}},[s("el-radio",{attrs:{label:0}},[e._v("\n 单方签署\n "),s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"单方签署:需要1方盖章,例如:独家声明、公函、授权书、证明等场景适用",placement:"top-start"}},[s("i",{staticClass:"el-icon-question",staticStyle:{"padding-left":"6px"}})])],1),e._v(" "),s("el-radio",{attrs:{label:1}},[e._v("\n 双方签署\n "),s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"双方签署:需要2方盖章,例如:租房、租赁、劳动关系、生活交易等场景适用",placement:"top-start"}},[s("i",{staticClass:"el-icon-question",staticStyle:{"padding-left":"6px"}})])],1),e._v(" "),s("el-radio",{attrs:{label:2}},[e._v("\n 多方签署\n "),s("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"多方签署:需要3方及以上盖章,例如:股权投资协议、销售场景、财务场景等需多方签署场景适用",placement:"top-start"}},[s("i",{staticClass:"el-icon-question",staticStyle:{"padding-left":"6px"}})])],1)],1)],1),e._v(" "),s("div",{staticClass:"template-box"},[s("el-table",{staticStyle:{width:"100%"},attrs:{data:e.signTableData,"empty-text":"暂无签署角色"}},[[s("transition",{attrs:{name:"el-zoom-in-center"}},[s("el-table-column",{attrs:{label:"参与主体",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-select",{attrs:{placeholder:"请选择签署主体"},model:{value:t.row.sign_type,callback:function(a){e.$set(t.row,"sign_type",a)},expression:"scope.row.sign_type"}},[s("el-option",{attrs:{label:"个人",value:"0"}}),e._v(" "),s("el-option",{attrs:{label:"企业",value:"1"}})],1)]}}])})],1)],e._v(" "),s("el-table-column",{attrs:{label:"","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-input",{attrs:{placeholder:"请输入角色名称"},on:{change:function(a){e.handleSelectChange(a,t.$index)}},model:{value:t.row.sign_role_name,callback:function(a){e.$set(t.row,"sign_role_name","string"==typeof a?a.trim():a)},expression:"scope.row.sign_role_name"}})]}}])}),e._v(" "),s("el-table-column",{attrs:{label:"参与方式",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("签署")]}}])}),e._v(" "),s("el-table-column",{attrs:{label:"参与方信息",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-input",{attrs:{placeholder:"请输入手机号",disabled:""},model:{value:t.row.tel,callback:function(a){e.$set(t.row,"tel","string"==typeof a?a.trim():a)},expression:"scope.row.tel"}})]}}])}),e._v(" "),s("el-table-column",{attrs:{label:"","min-width":"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-input",{attrs:{placeholder:"请输入姓名",disabled:""},model:{value:t.row.name,callback:function(a){e.$set(t.row,"name","string"==typeof a?a.trim():a)},expression:"scope.row.name"}})]}}])}),e._v(" "),s("el-table-column",{attrs:{label:"","min-width":"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-input",{attrs:{placeholder:"请输入企业名称",disabled:""},model:{value:t.row.company_name,callback:function(a){e.$set(t.row,"company_name","string"==typeof a?a.trim():a)},expression:"scope.row.company_name"}})]}}])}),e._v(" "),s("el-table-column",{attrs:{label:"操作","min-width":"180",align:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[2==e.modeRadio&&e.signTableData.length>2&&t.$index==e.signTableData.length-1?s("i",{staticClass:"el-icon-delete",staticStyle:{"font-size":"24px"},on:{click:function(a){e.handleDelete(t.$index,t.row)}}}):e._e()]}}])})],2),e._v(" "),s("div",{directives:[{name:"show",rawName:"v-show",value:2==e.modeRadio&&e.signTableData.length