index.207a00.js 5.0 KB

1234
  1. import{a7 as S,bq as I,_ as N,d as Y,j as M,m as g,V as P,r as F,o as m,A as d,x as s,f as i,h as e,br as E,bm as f,D as k,a as C,bt as T,bD as U,e as W,H as $,by as O,az as D}from"./index.js";import{u as R}from"./use-page-search.dfa27a70.js";import{a as L,b}from"./index.4b1879ca.js";import{a as j}from"./columnRenderHelper.8411add2.js";const _=[{value:"0",label:"\u672A\u5C01\u5E10",type:"info"},{value:"1",label:"\u5F85\u5BA1\u6279",type:"warning"},{value:"2",label:"\u5C01\u8D26\u5B8C\u6210",type:"success"},{value:"3",label:"\u5C01\u8D26\u9A73\u56DE",type:"warning"},{value:"4",label:"\u5C01\u8D26\u5931\u8D25",type:"danger"}],H=[{label:"\u5C01\u5E10\u7F16\u53F7",prop:"fzCode",minWidth:150},{label:"\u8BB0\u5E10\u6708\u4EFD",prop:"fz_date",minWidth:70},{label:"\u4E1A\u52A1\u516C\u53F8\u540D\u79F0",minWidth:160,...j(n=>n.company_code,n=>n.company_name,"\u4E1A\u52A1\u516C\u53F8\u7EB3\u7A0E\u53F7:")},{label:"\u72B6\u6001",width:100,cellRenderer({row:n}){var l;return S(I,{type:((l=_.find(a=>a.value==n.status))==null?void 0:l.type)||"--",size:"small"},{default:()=>{var a;return((a=_.find(r=>r.value==n.status))==null?void 0:a.label)||"--"}})}},{label:"\u5907\u6CE8",width:150,prop:"remark"},{label:"\u5C01\u5E10\u64CD\u4F5C\u4EBA",prop:"apply_name",minWidth:100},{label:"\u5C01\u5E10\u65F6\u95F4",prop:"create_time",minWidth:120},{label:"\u66F4\u65B0\u65F6\u95F4",prop:"update_time",minWidth:120},{label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:120}],q={columns:H,title:"\u5546\u54C1\u7BA1\u7406",permissions:["007"],companyProp:"company_code",apis:{httpList:(n={})=>{let{fz_date:l,...a}=n;return Array.isArray(l)&&l.length===0&&(l=""),L({fz_date:l,...a})},httpAdd:!0}},x={formItems:[{field:"fz_date",type:"date_picker",span:7,otherOptions:{type:"month",placeholder:"\u8BB0\u8D26\u6708\u4EFD",valueFormat:"YYYY-MM",format:"YYYY-MM"}},{field:"status",type:"select",placeholder:"\u72B6\u6001",options:_}]},J={class:"w-full mt-[10px] flex justify-end"},Z="productManager",G=Y({__name:"index",setup(n){const l=M(),a=g(null),{isSuperUser:r}=P(),p=g(""),v=g(!1),A=g(""),V={pageSearchHook:()=>R(void 0,void 0,x)},w={content:{preview:o=>l.push(`/invoiceInOut/summaryDetail?data=${JSON.stringify(o)}`)}};async function y(o,t){var h;try{if(await O.alert("\u662F\u5426\u786E\u8BA4\u5BA1\u6838","\u63D0\u793A",{type:"warning",confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",showCancelButton:!0}),t=="3"){v.value=!0,A.value=o;return}const c=await b({id:o,status:t});c.code==0?(h=a.value)==null||h.onSearch():D.warning(c.message)}catch(c){console.error("\u72B6\u6001\u53D8\u66F4\u5931\u8D25:",c)}}async function z(){var o;try{if(p.value.trim().length===0){D.warning("\u8BF7\u8F93\u5165\u9A73\u56DE\u5907\u6CE8");return}const t=await b({id:A.value,status:"3",remark:p.value});t.code==0?((o=a.value)==null||o.onSearch(),v.value=!1):D.warning(t.message)}catch(t){console.error("\u72B6\u6001\u53D8\u66F4\u5931\u8D25:",t)}}return(o,t)=>{const h=F("PageContainer"),c=F("PageAuth");return m(),d(c,{pageName:Z},{default:s(()=>[i(h,{hooks:V,events:w,searchConfig:e(x),contentConfig:e(q),"get-content-ref":u=>a.value=u},{content_action:s(u=>[u.status=="1"&&!e(r)?(m(),d(e(E),{key:0,content:"\u5BA1\u6279\u901A\u8FC7",placement:"top"},{default:s(()=>[i(e(f),{link:"",size:"small",type:"primary",onClick:B=>y(u.id,"2"),icon:e(k)("checkbox-circle-line")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0),u.status=="3"&&!e(r)?(m(),d(e(E),{key:1,content:"\u6539\u4E3A\u672A\u5C01\u8D26",placement:"top"},{default:s(()=>[i(e(f),{link:"",size:"small",type:"primary",onClick:B=>y(u.id,"0"),icon:e(k)("close-circle-line")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0),C(` <ElTooltip content="\u89E3\u9664\u5C01\u8D26" placement="top" v-if="row.status == '2' && !isSuperUser">\r
  2. <ElButton link size="small" type="primary" @click="handleStatusChange(row.id, '0')"\r
  3. :icon="useRenderIcon('link')" />\r
  4. </ElTooltip> `),u.status=="0"&&!e(r)?(m(),d(e(E),{key:2,content:"\u6539\u4E3A\u5F85\u5BA1\u6279",placement:"top"},{default:s(()=>[i(e(f),{link:"",size:"small",type:"primary",onClick:B=>y(u.id,"1"),icon:e(k)("compass")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0),u.status=="1"&&!e(r)?(m(),d(e(E),{key:3,content:"\u5BA1\u6838\u9A73\u56DE",placement:"top"},{default:s(()=>[i(e(f),{link:"",size:"small",type:"primary",onClick:B=>y(u.id,"3"),icon:e(k)("close")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0)]),_:1},8,["searchConfig","contentConfig","get-content-ref"]),i(e(T),{title:"\u9A73\u56DE\u5907\u6CE8",center:"",modelValue:v.value,"onUpdate:modelValue":t[1]||(t[1]=u=>v.value=u),onClose:t[2]||(t[2]=u=>{p.value="",A.value=""})},{default:s(()=>[i(e(U),{type:"textarea",modelValue:p.value,"onUpdate:modelValue":t[0]||(t[0]=u=>p.value=u),placeholder:"\u9A73\u56DE\u5907\u6CE8"},null,8,["modelValue"]),W("div",J,[i(e(f),{type:"primary",onClick:z},{default:s(()=>t[3]||(t[3]=[$("\u4FDD\u5B58")])),_:1})])]),_:1},8,["modelValue"])]),_:1})}}});var te=N(G,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/summary/index.vue"]]);export{te as default};