Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

approvalDialog.8086ea6d.js 8.7KB

pirms 2 mēnešiem
1
  1. import{_ as Q}from"./index.e40e8eca.js";import{a as X}from"./flowConfiguration.d56e454e.js";import{d as Y,r as c,b as Z,L as ee,c as u,e as f,f as k,h as l,i as a,j as n,I as _,g as N,F as R,J as B,t as D,k as A}from"./index.8d65dd27.js";import"./unitManage.96f59ba2.js";const ae={class:"flex flex-col items-start"},le=Y({name:"approvalDialog"}),ne=Object.assign(le,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close","update:data"],setup(w,{emit:G}){const t=w,v=G,E=c(),e=c({name:void 0,orgType:void 0,assignedOrg:[],subProcess:void 0,procDefId:void 0,threeDaysAutoPass:!1}),h={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u8282\u70B9\u540D\u79F0",trigger:"blur"}],orgType:[{required:!0,message:"\u8BF7\u9009\u62E9\u8282\u70B9\u8D1F\u8D23\u5355\u4F4D"}],assignedOrg:[{required:!0,message:"\u8BF7\u81F3\u5C11\u6307\u5B9A\u4E00\u4E2A\u5355\u4F4D"}],subProcess:[{required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D\u5185\u90E8\u6D41\u7A0B"}],type:[{required:!0,message:"\u8BF7\u9009\u62E9\u5355\u4F4D\u5185\u90E8\u6D41\u7A0B"}],threeDaysAutoPass:[{type:Boolean,required:!0,message:"\u8BF7\u9009\u62E9"}],constructionSuggestions:[{type:Boolean,required:!0,message:"\u8BF7\u9009\u62E9"}]},I=async r=>{!r||await r.validate(async s=>{if(s){const p={name:e.value.name||"",id:e.value.id||"",parentId:e.value.parentId||"",type:"SUB",props:{mode:"AND",sign:!1,assignedType:"ASSIGN_ORG",refuse:{type:"TO_END",target:""},assignedOrg:e.value.orgType==="TARGET_LABEL"?e.value.assignedOrg&&e.value.assignedOrg.map(d=>({...d,type:T.value.find(i=>i.processDefId===e.value.subProcess).type||"DEFAULT",processDefId:e.value.subProcess,orgType:e.value.orgType})):[{orgType:e.value.orgType,type:e.value.type}],threeDaysAutoPass:e.value.type==="SEAL"?!1:e.value.threeDaysAutoPass||!1,constructionSuggestions:e.value.constructionSuggestions||!1}};v("update:data",p),v("close",!0)}})},U=()=>{e.value.assignedOrg=[],e.value.subProcess=void 0,e.value.type=void 0},y=Z({unitVisible:!1,showCheckbox:!1,data:void 0}),q=()=>{y.unitVisible=!0,y.showCheckbox=!1,y.data=e.value.assignedOrg.map(r=>({key:r.orgCode,title:r.orgName}))},x=(r,s)=>{e.value.assignedOrg=r.map(p=>({orgCode:p.key,orgName:p.title})),P(r[0].key)},F=()=>{y.unitVisible=!1},$=r=>{e.value.assignedOrg.splice(r,1)},T=c([]),P=async r=>{const s=await X({pageNum:1,pageSize:1e3,orgCode:r});T.value=s.data.records.filter(p=>!p.isStop),s.data.records&&!s.data.records.length&&(T.value=[])},O=c(!1),M=[{label:"\u5B57\u6BB5\u540D\u79F0",prop:"fieldName",key:"fieldName"},{label:"\u662F\u5426\u5FC5\u586B",prop:"isRequired",key:"isRequired"},{label:"\u586B\u5199\u7C7B\u578B",prop:"writeType",key:"writeType"}],j=c([{fieldName:"\u8BC4\u5BA1\u610F\u89C1\u9644\u4EF6",isRequired:"\u662F",writeType:"\u6587\u4EF6\u4E0A\u4F20"},{fieldName:"\u5EFA\u8BAE\u603B\u6295\u8D44",isRequired:"\u662F",writeType:"\u6587\u672C"},{fieldName:"\u5EFA\u8BAE\u5E74\u5EA6\u9884\u7B97",isRequired:"\u662F",writeType:"\u6587\u672C"}]);return ee(()=>t.visible,async r=>{var s,p,d,i,m;r?(t.data&&t.data.props&&((s=t.data.props.assignedOrg)==null?void 0:s.length)&&t.data.props.assignedOrg[0].orgType==="TARGET_LABEL"&&P(t.data.props.assignedOrg[0].orgCode),e.value={...t.data,props:void 0,orgType:t.data.props&&((p=t.data.props.assignedOrg)==null?void 0:p.length)?t.data.props.assignedOrg[0].orgType:null,subProcess:t.data.props&&t.data.props.assignedOrg[0].orgType==="TARGET_LABEL"?t.data.props.assignedOrg[0].processDefId:void 0,assignedOrg:t.data.props&&t.data.props.assignedOrg&&t.data.props.assignedOrg.length&&t.data.props.assignedOrg[0].orgType==="TARGET_LABEL"&&t.data.props.assignedOrg.map(g=>g)||[],type:t.data.props&&((d=t.data.props.assignedOrg)==null?void 0:d.length)&&t.data.props.assignedOrg[0].orgType!=="TARGET_LABEL"?t.data.props.assignedOrg[0].type:void 0,threeDaysAutoPass:((i=t.data.props)==null?void 0:i.threeDaysAutoPass)||!1,constructionSuggestions:((m=t.data.props)==null?void 0:m.constructionSuggestions)||!1}):E.value.resetFields()}),(r,s)=>{const p=u("el-input"),d=u("el-form-item"),i=u("el-col"),m=u("el-row"),g=u("el-radio"),L=u("el-radio-group"),J=u("Plus"),W=u("el-icon"),V=u("el-button"),z=u("el-tag"),C=u("el-switch"),K=u("el-form"),S=u("el-dialog"),H=u("table-list");return f(),k(R,null,[l(S,{"model-value":w.visible,title:"\u5BA1\u6279\u8282\u70B9\u8BBE\u7F6E",width:"840px","destroy-on-close":"",onClose:s[9]||(s[9]=o=>v("close"))},{footer:a(()=>[l(V,{type:"primary",onClick:s[7]||(s[7]=o=>I(E.value))},{default:a(()=>[n(" \u63D0\u4EA4 ")]),_:1}),l(V,{onClick:s[8]||(s[8]=o=>v("close"))},{default:a(()=>[n(" \u5173\u95ED ")]),_:1})]),default:a(()=>[l(K,{ref_key:"formRef",ref:E,model:e.value,rules:h,"label-width":"200","label-suffix":":"},{default:a(()=>[l(m,null,{default:a(()=>[l(i,{span:24},{default:a(()=>[l(d,{label:"\u8282\u70B9\u540D\u79F0",prop:"name"},{default:a(()=>[l(p,{modelValue:e.value.name,"onUpdate:modelValue":s[0]||(s[0]=o=>e.value.name=o),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),l(m,null,{default:a(()=>[l(i,{span:24},{default:a(()=>[l(d,{label:"\u8282\u70B9\u8D1F\u8D23\u5355\u4F4D",prop:"orgType"},{default:a(()=>[l(L,{modelValue:e.value.orgType,"onUpdate:modelValue":s[1]||(s[1]=o=>e.value.orgType=o),onChange:U},{default:a(()=>[l(g,{label:"TARGET_LABEL"},{default:a(()=>[n("\u6307\u5B9A\u5355\u4F4D")]),_:1}),l(g,{label:"TARGET_MANAGEMENT"},{default:a(()=>[n("\u4E3B\u7BA1\u5355\u4F4D")]),_:1}),l(g,{label:"TARGET_OWNER"},{default:a(()=>[n("\u53D1\u8D77\u5355\u4F4D")]),_:1}),l(g,{label:"TARGET_LINE_MANAGEMENT"},{default:a(()=>[n("\u4E0A\u7EA7\u6761\u7EBF\u4E3B\u7BA1\u5355\u4F4D")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.value.orgType==="TARGET_LABEL"?(f(),_(m,{key:0},{default:a(()=>[l(i,{span:24},{default:a(()=>[l(d,{prop:"assignedOrg"},{default:a(()=>[N("div",ae,[l(V,{type:"primary",onClick:q},{default:a(()=>[l(W,null,{default:a(()=>[l(J)]),_:1}),n("\u6DFB\u52A0\u5355\u4F4D")]),_:1}),N("p",null,[(f(!0),k(R,null,B(e.value.assignedOrg,(o,b)=>(f(),_(z,{key:b,class:"mr-8",closable:"",onClose:se=>$(b)},{default:a(()=>[n(D(o.orgName),1)]),_:2},1032,["onClose"]))),128))])])]),_:1})]),_:1})]),_:1})):A("",!0),e.value.orgType==="TARGET_LABEL"&&e.value.assignedOrg.length||e.value.orgType&&e.value.orgType!=="TARGET_LABEL"?(f(),_(m,{key:1},{default:a(()=>[l(i,{span:24},{default:a(()=>[e.value.orgType==="TARGET_LABEL"?(f(),_(d,{key:0,label:"\u5355\u4F4D\u5185\u90E8\u6D41\u7A0B",prop:"subProcess"},{default:a(()=>[l(L,{modelValue:e.value.subProcess,"onUpdate:modelValue":s[2]||(s[2]=o=>e.value.subProcess=o)},{default:a(()=>[(f(!0),k(R,null,B(T.value,(o,b)=>(f(),_(g,{key:b,label:o.processDefId||0},{default:a(()=>[n(D(o.processDefName)+D(o.type==="SEAL"?"\uFF08\u76D6\u7AE0\u6D41\u7A0B\uFF09":o.type==="DEFAULT"?"\uFF08\u9ED8\u8BA4\u6D41\u7A0B\uFF09":""),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})):(f(),_(d,{key:1,prop:"type",label:"\u5355\u4F4D\u5185\u90E8\u6D41\u7A0B"},{default:a(()=>[l(L,{modelValue:e.value.type,"onUpdate:modelValue":s[3]||(s[3]=o=>e.value.type=o)},{default:a(()=>[l(g,{label:"DEFAULT"},{default:a(()=>[n("\u9ED8\u8BA4\u6D41\u7A0B")]),_:1}),l(g,{label:"SEAL"},{default:a(()=>[n("\u76D6\u7AE0\u6D41\u7A0B")]),_:1}),l(g,{label:"JOINT_REVIEW"},{default:a(()=>[n("\u91CD\u5927\u9879\u76EE\u8054\u5BA1\u6D41\u7A0B")]),_:1}),l(g,{label:"JOINT_REVIEW_CONFIRM"},{default:a(()=>[n("\u8054\u5BA1\u786E\u8BA4\u6D41\u7A0B")]),_:1})]),_:1},8,["modelValue"])]),_:1}))]),_:1})]),_:1})):A("",!0),e.value.type!=="SEAL"?(f(),_(m,{key:2},{default:a(()=>[l(i,{span:24},{default:a(()=>[l(d,{label:"3\u5929\u4E0D\u5904\u7406\u81EA\u52A8\u901A\u8FC7",prop:"threeDaysAutoPass"},{default:a(()=>[l(C,{modelValue:e.value.threeDaysAutoPass,"onUpdate:modelValue":s[4]||(s[4]=o=>e.value.threeDaysAutoPass=o)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})):A("",!0),r.$route.query.formName==="\u5EFA\u8BBE\u65B9\u6848\u5BA1\u6279\u6D41\u7A0B"?(f(),_(m,{key:3},{default:a(()=>[l(i,{span:24},{default:a(()=>[l(d,{label:"\u662F\u5426\u6DFB\u52A0\u8BC4\u5BA1\u5EFA\u8BAE\u4FE1\u606F\u5B57\u6BB5",prop:"constructionSuggestions"},{default:a(()=>[l(C,{modelValue:e.value.constructionSuggestions,"onUpdate:modelValue":s[5]||(s[5]=o=>e.value.constructionSuggestions=o)},null,8,["modelValue"]),N("a",{class:"ml-8 cursor-pointer",onClick:s[6]||(s[6]=o=>O.value=!0)},"\u67E5\u770B\u5B57\u6BB5")]),_:1})]),_:1})]),_:1})):A("",!0)]),_:1},8,["model"])]),_:1},8,["model-value"]),l(S,{"model-value":O.value,title:"\u67E5\u770B\u5B57\u6BB5",width:"600px","destroy-on-close":"",onClose:s[10]||(s[10]=o=>O.value=!1)},{default:a(()=>[l(H,{column:M,data:j.value,pagination:!1},null,8,["data"])]),_:1},8,["model-value"]),l(Q,{visible:y.unitVisible,"show-checkbox":y.showCheckbox,"default-data":y.data,params:{onlyUnit:!0},onClose:F,onGetSelectUnit:x},null,8,["visible","show-checkbox","default-data"])],64)}}});export{ne as default};