You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.3KB

  1. import{o as F,d as H,r as N}from"./annualPlanStore.bf18f6f7.js";import{ah as K,ai as D,r as s,J as O,c as n,a2 as Q,e as i,G as u,i as o,h as l,j as p,w as W,t as k,f as w,k as S,g as X,E as h,L as Z}from"./index.55251523.js";const ee={key:0},ae={key:0},te=["onClick"],oe=["onClick"],le={class:"text-right w-full mt-8"},ne="\u5173\u8054\u8FD0\u7EF4\u5305",de={__name:"operationDialog",props:{modelValue:{},modelModifiers:{},selectProjectList:{type:Array,defult:[]},selectProjectListModifiers:{}},emits:K(["relevanceSuccess"],["update:modelValue","update:selectProjectList"]),setup(V,{emit:$}){const y=D(V,"modelValue"),Y=D(V,"selectProjectList"),C=s(),P=s(),r=s(!1),m=s(!1),f=s(!1);let v;function I(t){v=t}const b=s([]),x=$;async function M(t){if(!t.operationPackageName){h({message:"\u8BF7\u8F93\u5165\u8FD0\u7EF4\u5305\u540D\u79F0",type:"warning"});return}if(!t.operationPackageYear){h({message:"\u8BF7\u9009\u62E9\u9884\u7B97\u5E74\u5EA6",type:"warning"});return}r.value=!0;try{await H(t),r.value=!1,t.edit=!1,j()}catch{r.value=!1}}function U(){b.value.push({operationPackageYear:"",operationPackageName:"",edit:!0}),Z(()=>{C.value.setScrollTop(1e6)})}async function B(){if(!v){h({message:"\u8BF7\u5148\u9009\u62E9\u5173\u8054\u5305",type:"warning"});return}const t={operationPackageId:v.id,projectIds:Y.value.map(a=>a.projectId)};m.value=!0;try{await N(t),m.value=!1,g(),x("relevanceSuccess")}catch{m.value=!1}}async function E(){f.value=!0;const t={projectIds:Y.value.map(a=>a.projectId)};try{await N(t),f.value=!1,g(),x("relevanceSuccess")}catch{f.value=!1}}function g(){y.value=!1,v=void 0,P.value=void 0}O(()=>y.value,async t=>{t&&await j()});async function j(){r.value=!0;const t=await F();b.value=t.data,r.value=!1}return(t,a)=>{const R=n("el-radio"),c=n("el-table-column"),T=n("el-input"),L=n("el-form-item"),A=n("el-date-picker"),G=n("el-table"),_=n("el-button"),J=n("el-form"),q=n("el-dialog"),z=Q("loading");return i(),u(q,{"model-value":y.value,title:ne,width:"700","destroy-on-close":"",onClose:g},{footer:o(()=>[l(_,{onClick:g},{default:o(()=>a[3]||(a[3]=[p(" \u5173\u95ED ")])),_:1}),l(_,{type:"danger",disabled:r.value,loading:f.value,onClick:E},{default:o(()=>a[4]||(a[4]=[p(" \u53D6\u6D88\u6240\u6709\u5173\u8054 ")])),_:1},8,["disabled","loading"]),l(_,{disabled:r.value,type:"primary",loading:m.value,onClick:B},{default:o(()=>a[5]||(a[5]=[p(" \u786E\u8BA4\u5173\u8054 ")])),_:1},8,["disabled","loading"])]),default:o(()=>[W((i(),u(J,null,{default:o(()=>[l(G,{ref_key:"tableRef",ref:C,data:b.value,style:{width:"100%",height:"60vh"}},{default:o(()=>[l(c,{prop:"index",width:"50"},{default:o(e=>[(i(),u(R,{key:e.$index,modelValue:P.value,"onUpdate:modelValue":a[0]||(a[0]=d=>P.value=d),value:e.$index,disabled:e.row.edit,onChange:d=>I(e.row)},null,8,["modelValue","value","disabled","onChange"]))]),_:1}),l(c,{prop:"index",label:"\u5E8F\u53F7",width:"60"},{default:o(e=>[p(k(e.$index+1),1)]),_:1}),l(c,{prop:"operationPackageName",label:"\u8FD0\u7EF4\u5305\u540D\u79F0",width:"180"},{default:o(e=>[e.row.edit?(i(),u(L,{key:1},{default:o(()=>[l(T,{modelValue:e.row.operationPackageName,"onUpdate:modelValue":d=>e.row.operationPackageName=d,placeholder:"\u8BF7\u8F93\u5165\u8FD0\u7EF4\u5305\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):(i(),w("div",ee,k(e.row.operationPackageName),1))]),_:1}),l(c,{prop:"operationPackageYear",label:"\u9884\u7B97\u5E74\u5EA6",width:"250"},{default:o(e=>[e.row.edit?S("",!0):(i(),w("div",ae,k(e.row.operationPackageYear),1)),e.row.edit?(i(),u(L,{key:1,prop:"operationPackageYear"},{default:o(()=>[l(A,{modelValue:e.row.operationPackageYear,"onUpdate:modelValue":d=>e.row.operationPackageYear=d,type:"year",placeholder:"\u8BF7\u9009\u62E9\u9884\u7B97\u5E74\u5EA6",format:"YYYY","value-format":"YYYY"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):S("",!0)]),_:1}),l(c,{prop:"address",label:"\u64CD\u4F5C",width:"120"},{default:o(e=>[e.row.edit?(i(),w("a",{key:1,onClick:d=>M(e.row)},"\u4FDD\u5B58",8,oe)):(i(),w("a",{key:0,onClick:d=>(e.row.edit=!0,e.row.operationPackageYear=e.row.operationPackageYear+"")},"\u7F16\u8F91"+k(e.row.data),9,te))]),_:1})]),_:1},8,["data"]),X("p",le,[l(_,{type:"primary",class:"w-full",plain:"",icon:"Plus",onClick:a[1]||(a[1]=()=>U())},{default:o(()=>a[2]||(a[2]=[p("\u6DFB\u52A0 ")])),_:1})])]),_:1})),[[z,r.value]])]),_:1},8,["model-value"])}}};export{de as default};