import{_ as Y,d as Z,w as p,ag as y,bq as B,r as i,aC as $,o as r,G as c,C as t,H as ee,l as o,b1 as ue,j as s,c as C,F as D,D as F,M as E,L as le,a as te,h as ae}from"./index.js";import{a as oe,d as se,h as re,e as ne}from"./index.4f7f3298.js";const ie=[{value:"1",label:"\u5F00\u59CB\u8282\u70B9"},{value:"2",label:"\u8FC7\u7A0B\u8282\u70B9"},{value:"3",label:"\u4E2D\u65AD\u8282\u70B9"},{value:"4",label:"\u7ED3\u675F\u8282\u70B9"}],de=[{value:"1",label:"\u5BA1\u6279\u8282\u70B9"},{value:"2",label:"\u7CFB\u7EDF\u8282\u70B9"}],ce={action_type:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u8282\u70B9\u7C7B\u578B",required:!0},operation_type:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u7C7B\u578B",required:!0},status_name:{trigger:"blur",message:"\u8BF7\u8F93\u5165\u8282\u70B9\u540D\u79F0",required:!0},order_process:{trigger:"blur",message:"\u8BF7\u8F93\u5165\u8282\u70B9\u503C",required:!0},next_action_ids:{trigger:"blur",message:"\u8BF7\u9009\u62E9\u4E0B\u4E00\u8282\u70B9",required:!0}},pe={flex:"","w-full":"","justify-end":""},_e=Z({__name:"process-modal",props:{currentProcess:{type:Object,required:!0}},emits:["reload"],setup(A,{expose:w,emit:L}){const b=A,d=p(""),g=p(!1),_=p(!1),V=p(null),x=y(()=>!d.value),l=p({action_type:"",operation_type:"",status_name:"",order_process:"",next_action_ids:[]}),k=()=>{_.value=!1,L("reload")},P=y(()=>l.value.action_type==="1"||l.value.action_type==="2"),{run:U,data:q,listLoading:j}=B({initalData:[],isList:[]}),{run:N,data:R,loading:M}=B({initalData:{},success:()=>{const{order_process:a,status_name:u,operation_type:m,action_type:v,next_action_ids:n}=R.value;l.value={order_process:a,status_name:u,operation_type:m,action_type:v,next_action_ids:n.filter(f=>f)}}}),{run:T,loading:O}=B({success:()=>k()}),{run:S,loading:h}=B({success:()=>k()});function z(){const{currentProcess:a}=b;T(re({process_id:a.id,...l.value}))}function G(){const{currentProcess:a}=b;S(ne({id:d.value,process_id:a.id,...l.value}))}function H(){V.value.validate(a=>{if(!!a){if(x.value)return z();G()}})}const I=y(()=>g.value?"\u6D41\u7A0B\u8282\u70B9\u8BE6\u60C5":x.value?"\u521B\u5EFA\u6D41\u7A0B\u8282\u70B9":"\u7F16\u8F91\u6D41\u7A0B\u8282\u70B9");return w({onDisplay(a,u=!1){if(_.value=!0,d.value=a,g.value=u,U(oe({process_id:b.currentProcess.id})),d.value)return N(se({id:d.value}))}}),(a,u)=>{const m=i("el-option"),v=i("el-select"),n=i("el-form-item"),f=i("el-input"),J=i("el-checkbox"),K=i("el-checkbox-group"),Q=i("el-button"),W=i("el-dialog"),X=$("loading");return r(),c(W,{modelValue:_.value,"onUpdate:modelValue":u[6]||(u[6]=e=>_.value=e),title:o(I),center:"",onClose:u[7]||(u[7]=()=>l.value={...a.initalData}),rules:o(ce),"close-on-click-modal":!1},{default:t(()=>[ee((r(),c(o(ue),{"label-width":"100px",model:l.value,disabled:g.value,ref_key:"formRef",ref:V},{default:t(()=>[s(n,{label:"\u8282\u70B9\u7C7B\u578B",prop:"action_type"},{default:t(()=>[s(v,{"w-full":"",modelValue:l.value.action_type,"onUpdate:modelValue":u[0]||(u[0]=e=>l.value.action_type=e)},{default:t(()=>[(r(!0),C(D,null,F(o(ie),e=>(r(),c(m,{key:e.value,value:e.value,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(n,{label:"\u64CD\u4F5C\u7C7B\u578B",prop:"operation_type"},{default:t(()=>[s(v,{"w-full":"",modelValue:l.value.operation_type,"onUpdate:modelValue":u[1]||(u[1]=e=>l.value.operation_type=e)},{default:t(()=>[(r(!0),C(D,null,F(o(de),e=>(r(),c(m,{key:e.value,value:e.value,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(n,{label:"\u8282\u70B9\u540D\u79F0",prop:"status_name"},{default:t(()=>[s(f,{modelValue:l.value.status_name,"onUpdate:modelValue":u[2]||(u[2]=e=>l.value.status_name=e)},null,8,["modelValue"])]),_:1}),s(n,{label:"\u8282\u70B9\u503C",prop:"order_process"},{default:t(()=>[s(f,{modelValue:l.value.order_process,"onUpdate:modelValue":u[3]||(u[3]=e=>l.value.order_process=e)},null,8,["modelValue"])]),_:1}),o(P)?(r(),c(n,{key:0,label:"\u4E0B\u4E00\u8282\u70B9",prop:"next_action_ids"},{default:t(()=>[s(K,{modelValue:l.value.next_action_ids,"onUpdate:modelValue":u[4]||(u[4]=e=>l.value.next_action_ids=e)},{default:t(()=>[(r(!0),C(D,null,F(o(q),e=>(r(),c(J,{label:e.id,key:e.id,disabled:e.id===d.value},{default:t(()=>[E(le(e.status_name),1)]),_:2},1032,["label","disabled"]))),128))]),_:1},8,["modelValue"])]),_:1})):te("v-if",!0),s(n,null,{default:t(()=>[ae("div",pe,[s(Q,{loading:o(h)||o(O),type:"primary",onClick:u[5]||(u[5]=()=>H())},{default:t(()=>[E("\u4FDD\u5B58 ")]),_:1},8,["loading"])])]),_:1})]),_:1},8,["model","disabled"])),[[X,o(M)||o(j)]])]),_:1},8,["modelValue","title","rules"])}}});var me=Y(_e,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/parameter/setActionProcess/components/process-modal.vue"]]),Be=Object.freeze(Object.defineProperty({__proto__:null,default:me},Symbol.toStringTag,{value:"Module"}));export{me as P,ie as a,de as o,Be as p};
