index.0f2b58.js 5.0 KB

1234
  1. import{aa as z,aX as Y,_ as I,d as M,n as N,w as g,a0 as P,r as F,o as m,G as d,C as s,j as i,l as e,aY as E,aP as f,J as k,a as C,a_ as T,b5 as U,h as $,M as O,b1 as R,ax as B}from"./index.js";import{u as W}from"./use-page-search.75689a84.js";import{a as L,b}from"./index.dc7a6683.js";import{a as j}from"./columnRenderHelper.e746a45d.js";const D=[{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"}],J=[{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 z(Y,{type:((l=D.find(a=>a.value==n.status))==null?void 0:l.type)||"--",size:"small"},{default:()=>{var a;return((a=D.find(r=>r.value==n.status))==null?void 0:a.label)||"--"}})}},{label:"\u5907\u6CE8",width:150,prop:"remark"},{label:"\u5C01\u88C5\u64CD\u4F5C\u4EBA",prop:"apply_name",minWidth:100},{label:"\u5C01\u88C5\u65F6\u95F4",prop:"create_time",minWidth:120},{label:"\u64CD\u4F5C",fixed:"right",slot:"operation",width:160}],G={columns:J,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:D}]},H={class:"w-full mt-[10px] flex justify-end"},X="productManager",Z=M({__name:"index",setup(n){const l=N(),a=g(null),{isSuperUser:r}=P(),p=g(""),v=g(!1),_=g(""),w={pageSearchHook:()=>W(void 0,void 0,x)},S={content:{preview:o=>l.push(`/invoiceInOut/summaryDetail?data=${JSON.stringify(o)}`)}};async function y(o,t){var h;try{if(await R.alert("\u662F\u5426\u786E\u8BA4\u5BA1\u6838","\u63D0\u793A",{type:"warning",confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",showCancelButton:!0}),t=="3"){v.value=!0,_.value=o;return}const c=await b({id:o,status:t});c.code==0?(h=a.value)==null||h.onSearch():B.warning(c.message)}catch(c){console.error("\u72B6\u6001\u53D8\u66F4\u5931\u8D25:",c)}}async function V(){var o;try{if(p.value.trim().length===0){B.warning("\u8BF7\u8F93\u5165\u9A73\u56DE\u5907\u6CE8");return}const t=await b({id:_.value,status:"3",remark:p.value});t.code==0?((o=a.value)==null||o.onSearch(),v.value=!1):B.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:X},{default:s(()=>[i(h,{hooks:w,events:S,searchConfig:e(x),contentConfig:e(G),"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:A=>y(u.id,"2"),icon:e(k)("checkbox-circle-line")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0),u.status=="2"&&!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:A=>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"||u.status=="3")&&!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:A=>y(u.id,"1"),icon:e(k)("compass")},null,8,["onClick","icon"])]),_:2},1024)):C("v-if",!0),u.status=="2"&&!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:A=>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="",_.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"]),$("div",H,[i(e(f),{type:"primary",onClick:V},{default:s(()=>t[3]||(t[3]=[O("\u4FDD\u5B58")])),_:1})])]),_:1},8,["modelValue"])]),_:1})}}});var te=I(Z,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/invoiceInOut/summary/index.vue"]]);export{te as default};