import{I as K,y as Q,G as X,H as Y,w as Z,D as ee,C as oe,L as te,M as ae,N as le}from"./element-plus.258bf9e7.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.60e89e82.js";import{f as ue,a as ie}from"./index.ec401e3b.js";import{u as se}from"./usePaging.f6660143.js";import{u as re}from"./useDictOptions.c644f395.js";import{_ as pe,m as de,a as x,b as me}from"./edit.vue_vue_type_script_setup_true_name_projectEdit_lang.29e977a3.js";import"./lodash.1d82ee7c.js";import ce from"./detail.e52c666c.js";import{d as L,a0 as I,s as q,r as k,ai as _e,o as i,c as P,V as e,M as a,O as _,u as r,L as d,S as $,W as fe,a8 as ve,a as j,k as Ee,T as c,n as y}from"./@vue.ab566ce7.js";import"./@vueuse.8fcae4c2.js";import"./@element-plus.b89f1627.js";import"./lodash-es.49f4af13.js";import"./dayjs.4afe12d3.js";import"./axios.37fc980d.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./vue-router.87ebc608.js";import"./pinia.b6700c26.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.d0bec2c9.js";import"./color.ea90db3f.js";import"./clone.cbd692e6.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.ad6bc3c0.js";import"./ms.a9ae1d6d.js";import"./nprogress.bcdf1f46.js";import"./vue-clipboard3.c45111bf.js";import"./clipboard.1cb79a0d.js";import"./echarts.50cbfcc9.js";import"./tslib.60310f1a.js";import"./zrender.a255a587.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.62ff6725.js";import"./index.9492d03b.js";import"./index.vue_vue_type_style_index_0_lang.0ff67de9.js";import"./common.c510575b.js";import"./index.vue_vue_type_script_setup_true_lang.5a5f706a.js";import"./project.bccf4059.js";import"./projecttype.f974a874.js";import"./department.1c914e1a.js";import"./organization.f0387125.js";import"./custom.13e75d58.js";const we=c("\u67E5\u8BE2"),be=c("\u91CD\u7F6E"),Fe=c(" \u65B0\u589E "),he=c(" \u5220\u9664 "),De={class:"mt-4"},Ce=c(" \u7F16\u8F91 "),ge=c(" \u5220\u9664 "),ke=c(" \u8BE6\u60C5 "),ye={class:"flex justify-end mt-4"},Ve=L({name:"projectLists"}),Co=L({...Ve,setup(Re){I([]);const h=q(),E=q(),w=k(!1),D=k(!1),s=I({code:"",contract_id:"",name:""}),C=k([]),S=l=>{C.value=l.map(({id:o})=>o)},{dictData:g}=re("pay_period,invoice_type"),{pager:f,getLists:b,resetParams:M,resetPage:N}=se({fetchFun:de,params:s}),T=async()=>{var l;w.value=!0,await y(),(l=E.value)==null||l.open("add")},U=async l=>{var p,n;let o=await x({id:l.id});w.value=!0,await y(),(p=E.value)==null||p.open("edit"),(n=E.value)==null||n.setFormData(o)},V=async l=>{await ue.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await me({id:l}),b()},A=async l=>{var p,n;let o=await x({id:l.id});D.value=!0,await y(),(p=h.value)==null||p.open(),(n=h.value)==null||n.setFormData(o)};return b(),(l,o)=>{const p=K,n=Q,R=X,O=Y,m=Z,G=ee,B=oe,H=ie,u=te,W=ae,z=ne,v=_e("perms"),J=le;return i(),P("div",null,[e(B,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(G,{class:"mb-[-16px]",model:s,inline:"","label-width":"auto"},{default:a(()=>[e(n,{label:"\u4ED3\u5E93\u7F16\u7801",prop:"code"},{default:a(()=>[e(p,{class:"w-[280px]",modelValue:s.code,"onUpdate:modelValue":o[0]||(o[0]=t=>s.code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u7F16\u7801"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name"},{default:a(()=>[e(p,{class:"w-[280px]",modelValue:s.name,"onUpdate:modelValue":o[1]||(o[1]=t=>s.name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4ED3\u5E93\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(n,{label:"\u9879\u76EE\u540D\u79F0",prop:"project_name"},{default:a(()=>[e(p,{class:"w-[280px]",modelValue:s.project_name,"onUpdate:modelValue":o[2]||(o[2]=t=>s.project_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(n,{label:"MRP\u4ED3\u5E93",prop:"is_mrp"},{default:a(()=>[e(O,{class:"w-[280px]",modelValue:s.is_mrp,"onUpdate:modelValue":o[3]||(o[3]=t=>s.is_mrp=t),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426MRP\u4ED3\u5E93"},{default:a(()=>[e(R,{label:"\u5168\u90E8",value:""}),(i(!0),P(fe,null,ve(r(g).is_mrp,(t,F)=>(i(),d(R,{key:F,label:t.contract_name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(n,null,{default:a(()=>[e(m,{type:"primary",onClick:r(N)},{default:a(()=>[we]),_:1},8,["onClick"]),e(m,{onClick:r(M)},{default:a(()=>[be]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((i(),d(B,{class:"!border-none",shadow:"never"},{default:a(()=>[_((i(),d(m,{type:"primary",onClick:T},{icon:a(()=>[e(H,{name:"el-icon-Plus"})]),default:a(()=>[Fe]),_:1})),[[v,["InvoicingRequests.InvoicingRequests/add"]]]),_((i(),d(m,{disabled:!C.value.length,onClick:o[4]||(o[4]=t=>V(C.value))},{default:a(()=>[he]),_:1},8,["disabled"])),[[v,["InvoicingRequests.InvoicingRequests/delete"]]]),j("div",De,[e(W,{data:r(f).lists,onSelectionChange:S},{default:a(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"\u5E8F\u53F7",type:"index",width:"55"}),e(u,{label:"\u9879\u76EE\u7F16\u7801",prop:"project_code","show-overflow-tooltip":""}),e(u,{label:"\u9879\u76EE\u540D\u79F0",prop:"project_name","show-overflow-tooltip":""}),e(u,{label:"\u4ED3\u5E93\u7F16\u7801",prop:"code","show-overflow-tooltip":""}),e(u,{label:"\u4ED3\u5E93\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(u,{label:"\u662F\u5426MRP\u4ED3\u5E93",prop:"is_mrp","show-overflow-tooltip":""}),e(u,{label:"\u8D1F\u8D23\u4EBA",prop:"head_user","show-overflow-tooltip":""}),e(u,{label:"\u5730\u5740",prop:"address","show-overflow-tooltip":""}),e(u,{label:"\u5907\u6CE8",prop:"remark","show-overflow-tooltip":""}),e(u,{label:"\u64CD\u4F5C",width:"160",fixed:"right"},{default:a(({row:t})=>[_((i(),d(m,{type:"primary",link:"",onClick:F=>U(t)},{default:a(()=>[Ce]),_:2},1032,["onClick"])),[[v,["InvoicingRequests.InvoicingRequests/edit"]]]),_((i(),d(m,{type:"danger",link:"",onClick:F=>V(t.id)},{default:a(()=>[ge]),_:2},1032,["onClick"])),[[v,["InvoicingRequests.InvoicingRequests/delete"]]]),_((i(),d(m,{link:"",onClick:F=>A(t)},{default:a(()=>[ke]),_:2},1032,["onClick"])),[[v,["InvoicingRequests.InvoicingRequests/detail"]]])]),_:1})]),_:1},8,["data"])]),j("div",ye,[e(z,{modelValue:r(f),"onUpdate:modelValue":o[5]||(o[5]=t=>Ee(f)?f.value=t:null),onChange:r(b)},null,8,["modelValue","onChange"])])]),_:1})),[[J,r(f).loading]]),w.value?(i(),d(pe,{key:0,ref_key:"editRef",ref:E,"dict-data":r(g),onSuccess:r(b),onClose:o[6]||(o[6]=t=>w.value=!1)},null,8,["dict-data","onSuccess"])):$("",!0),D.value?(i(),d(ce,{key:1,ref_key:"detailRef",ref:h,"dict-data":r(g),onClose:o[7]||(o[7]=t=>D.value=!1)},null,8,["dict-data"])):$("",!0)])}}});export{Co as default};