2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
import{R as Y,S as Z,T as K,U as M,I as ee,y as W,w as q,C as z,G as te,H as le,A as ae,B as se,V as ne}from"./element-plus.517d4382.js";import{K as ue,e as oe}from"./@element-plus.b89f1627.js";import{f as ce,a as _e,b as re}from"./approve.bbbe5096.js";import{u as ie}from"./index.8b1962e9.js";import{d as J,e as de,r as T,s as pe,a0 as P,o as n,c as B,V as l,M as t,T as r,U as f,u as p,W as F,a8 as x,a as S,L as o,S as h}from"./@vue.ab566ce7.js";import{a as fe}from"./flow.34e13ba8.js";import{u as me}from"./vue-router.87ebc608.js";const be={class:"edit-popup"},ke={class:"steps-cls"},ve=r(" \u901A\u8FC7 "),he=r(" \u62D2\u7EDD "),ge=r(" \u64A4\u9500 "),ye=J({name:"projectEdit"}),Ie=J({...ye,props:{approve_id:Number},emits:["off"],setup(V,{expose:U,emit:E}){const A=V,m=ie(),u=de(()=>m.userInfo);let I=T(0);const g=T("");T("");const j=pe(),e=P({id:"",title:"",create_user:1,check_status:0,flow_name:"",check_status_text:"",current_check_user:"",create_user_name:"admin",copy_user:"admin",current_check_user_ids:[],content:{},step:[{flow_step:"",flow_user:"",is_active:"",flow_step_text:""}],record:[{title:"",content:"",check_time:"",status:0,status_text:""}]}),i=()=>{var a;return Boolean(((a=e==null?void 0:e.current_check_user_ids)==null?void 0:a.includes(String(u.id)))&&e.check_status!=3)},b=()=>Boolean((e==null?void 0:e.check_status)==0&&e.create_user==u.id),N=async a=>{for(const s in e)a[s]!=null&&a[s]!=null&&(e[s]=a[s])},O=()=>{var a;(a=j.value)==null||a.open()},C=async()=>{await _e({id:A.approve_id,revoke_reason:g.value}),E("off")},y=async a=>{await re({id:A.approve_id,check_status:a,check_reason:g.value}),E("off")},w=(a,s)=>s==0?e.create_user_name+"\u521B\u5EFA":a==null?void 0:a.flow_step_text;return ce({id:A.approve_id}).then(a=>{I.value=a.step.findIndex(s=>(s==null?void 0:s.is_active)==1),N(a)}),U({open:O,setFormData:N}),(a,s)=>{const c=Y,R=Z,$=K,_=M,k=ee,D=W,L=q,Q=z;return n(),B("div",be,[l(Q,null,{default:t(()=>[l(R,{column:3,title:"\u5BA1\u6279\u8BE6\u60C5",border:""},{default:t(()=>[l(c,{label:"\u5BA1\u6279\u4E3B\u9898","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(e.title),1)]),_:1}),l(c,{label:"\u5BA1\u6279\u6D41\u7A0B","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(e.flow_name),1)]),_:1}),l(c,{label:"\u5BA1\u6838\u72B6\u6001","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(e.check_status_text),1)]),_:1}),l(c,{label:"\u7533\u8BF7\u4EBA","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(e.create_user_name),1)]),_:1}),l(c,{label:"\u5F53\u524D\u5BA1\u6279\u4EBA","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(e.current_check_user),1)]),_:1}),l(c,{label:"\u6284\u9001\u4EBA","label-align":"left",align:"left","label-class-name":"my-label"},{default:t(()=>[r(f(i())+" "+f(b())+" "+f(e.copy_user),1)]),_:1})]),_:1}),l(R,{column:1,border:""},{default:t(()=>{var G;return[l(c,{label:"\u5BA1\u6279\u6D41\u7A0B","label-align":"left",align:"left"},{default:t(()=>[l(_,{active:p(I),simple:"","align-center":!0},{default:t(()=>[(n(!0),B(F,null,x(e.step,(v,d)=>(n(),o($,{title:w(v,d),icon:d==0?p(ue):p(oe),key:d},null,8,["title","icon"]))),128))]),_:1},8,["active"])]),_:1}),l(c,{label:"\u5BA1\u6279\u8BB0\u5F55","label-align":"left",align:"left"},{default:t(()=>[S("div",ke,[l(_,{direction:"vertical",active:e.record.length,"align-center":!0,space:50,style:{"margin-top":"20px"}},{default:t(()=>[(n(!0),B(F,null,x(e.record,(v,d)=>(n(),o($,{title:v.check_time+" "+v.title,key:d},null,8,["title"]))),128))]),_:1},8,["active"])])]),_:1}),S("div",null,[((G=e==null?void 0:e.current_check_user_ids)==null?void 0:G.includes(String(p(u).id)))&&e.check_status!=3||(e==null?void 0:e.check_status)==0&&e.create_user==p(u).id?(n(),o(c,{key:0,label:"\u64CD\u4F5C","label-align":"left",align:"left"},{default:t(()=>{var v;return[((v=e==null?void 0:e.current_check_user_ids)==null?void 0:v.includes(String(p(u).id)))&&e.check_status!=3||(e==null?void 0:e.check_status)==0&&e.create_user==p(u).id?(n(),o(D,{key:0,label:"\u610F\u89C1"},{default:t(()=>[l(k,{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=d=>g.value=d),clearable:"",placeholder:"\u8BF7\u8F93\u5165",type:"textarea"},null,8,["modelValue"])]),_:1})):h("",!0),l(D,{label:"\u5BA1\u6279"},{default:t(()=>{var d,H;return[((d=e==null?void 0:e.current_check_user_ids)==null?void 0:d.includes(String(p(u).id)))&&e.check_status!=3?(n(),o(L,{key:0,type:"primary",onClick:s[1]||(s[1]=X=>y(1))},{default:t(()=>[ve]),_:1})):h("",!0),((H=e==null?void 0:e.current_check_user_ids)==null?void 0:H.includes(String(p(u).id)))&&e.check_status!=3?(n(),o(L,{key:1,onClick:s[2]||(s[2]=X=>y(2))},{default:t(()=>[he]),_:1})):h("",!0),(e==null?void 0:e.check_status)==0&&e.create_user==p(u).id?(n(),o(L,{key:2,onClick:C},{default:t(()=>[ge]),_:1})):h("",!0)]}),_:1})]}),_:1})):h("",!0)])]}),_:1})]),_:1})])}}});const we=S("div",{class:"card-header"},[S("span",null,"\u5BA1\u6279\u6D41\u7A0B")],-1),Be=r(" \u63D0\u4EA4 "),Ne={__name:"index",props:{id:Number,flows:Object,submitApi:Object},emits:["off"],setup(V,{emit:U}){const E=V,A=me(),m=P({flow_id:"",path:A.path,id:E.id}),u=T({}),I=async()=>{let i=await fe({id:m.flow_id});u.value=i},g=i=>i.flow_step==1?"\u5F53\u524D\u90E8\u95E8\u8D1F\u8D23\u4EBA":i.flow_user.map(b=>[b.name]).join(","),j=async()=>{await E.submitApi({...m}),U("off")},e=i=>["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D","\u5341"][i];return(i,b)=>{const N=te,O=le,C=W,y=ae,w=se,a=K,s=M,c=ne,R=q,$=z;return n(),o($,null,{header:t(()=>[we]),default:t(()=>[S("div",null,[l(w,null,{default:t(()=>[l(y,{span:8},{default:t(()=>[l(C,{label:"\u5BA1\u6279\u6D41\u7A0B",prop:"flow_cate"},{default:t(()=>[l(O,{class:"flex-1",modelValue:m.flow_id,"onUpdate:modelValue":b[0]||(b[0]=_=>m.flow_id=_),clearable:"",onChange:I,placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6279\u7C7B\u578B"},{default:t(()=>[(n(!0),B(F,null,x(V.flows,(_,k)=>(n(),o(N,{key:k,label:_.name,value:parseInt(_.id)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),u.value.id?(n(),o(w,{key:0},{default:t(()=>[l(y,{span:24},{default:t(()=>[l(C,{label:"\u5BA1\u6279\u6D41\u7A0B",prop:"mailing_no"},{default:t(()=>[l(s,{"align-center":"",active:u.value.flow_list.length},{default:t(()=>[(n(!0),B(F,null,x(u.value.flow_list,(_,k)=>(n(),o(a,{title:`\u7B2C${e(k+1)}\u7EA7\u5BA1\u6279`,description:g(_),key:i.idnex},null,8,["title","description"]))),128))]),_:1},8,["active"])]),_:1})]),_:1})]),_:1})):h("",!0),u.value.id?(n(),o(w,{key:1},{default:t(()=>[l(y,{span:24},{default:t(()=>[l(C,{label:"\u6284\u9001\u4EBA",prop:"mailing_no"},{default:t(()=>[(n(!0),B(F,null,x(u.value.copy_uids,(_,k)=>(n(),o(c,{key:k,class:"ml-2"},{default:t(()=>[r(f(_.name),1)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):h("",!0),l(w,null,{default:t(()=>[l(R,{onClick:j,type:"primary",disabled:!m.flow_id},{default:t(()=>[Be]),_:1},8,["disabled"])]),_:1})])]),_:1})}}};export{Ne as _,Ie as a};
|