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 line
4.2KB

  1. import{o as F,d as H,r as N}from"./annualPlanStore.e306db95.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 L,g as X,E as h}from"./index.e8b71da7.js";const Z={key:0},ee={key:0},ae=["onClick"],te=["onClick"],oe={class:"text-right w-full mt-8"},le="\u5173\u8054\u8FD0\u7EF4\u5305",re={__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"),I=s(),P=s(),r=s(!1),m=s(!1),f=s(!1);let v;function M(t){v=t}const b=s([]),C=$;async function S(t){if(!t.operationPackageName){h({message:"\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})}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(),C("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(),C("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"),A=n("el-input"),x=n("el-form-item"),G=n("el-date-picker"),J=n("el-table"),_=n("el-button"),T=n("el-form"),q=n("el-dialog"),z=Q("loading");return i(),u(q,{"model-value":y.value,title:le,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(T,null,{default:o(()=>[l(J,{ref_key:"tableRef",ref:I,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=>M(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(x,{key:1},{default:o(()=>[l(A,{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",Z,k(e.row.operationPackageName),1))]),_:1}),l(c,{prop:"operationPackageYear",label:"\u9884\u7B97\u5E74\u5EA6",width:"250"},{default:o(e=>[e.row.edit?L("",!0):(i(),w("div",ee,k(e.row.operationPackageYear),1)),e.row.edit?(i(),u(x,{key:1,prop:"operationPackageYear"},{default:o(()=>[l(G,{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)):L("",!0)]),_:1}),l(c,{prop:"address",label:"\u64CD\u4F5C",width:"120"},{default:o(e=>[e.row.edit?(i(),w("a",{key:1,onClick:d=>S(e.row)},"\u4FDD\u5B58",8,te)):(i(),w("a",{key:0,onClick:d=>(e.row.edit=!0,e.row.operationPackageYear=e.row.operationPackageYear+"")},"\u7F16\u8F91"+k(e.row.data),9,ae))]),_:1})]),_:1},8,["data"]),X("p",oe,[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{re as default};