(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[6223,1322],{99047:function(yt,k,t){"use strict";t.r(k),t.d(k,{default:function(){return X}});var g=t(3182),It=t(57663),$=t(71577),c=t(2824),M=t(94043),l=t.n(M),Y=t(90631),u=t(67294),B=t(78009),F=t(16894),G=t(53667),z=t.n(G),V=t(11849),x=t(48971);function H(s){return Z.apply(this,arguments)}function Z(){return Z=(0,g.Z)(l().mark(function s(d){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("/kitchen/api/stock-item-application/stock-page",{method:"Post",data:d}));case 1:case"end":return e.stop()}},s)})),Z.apply(this,arguments)}function K(s){return E.apply(this,arguments)}function E(){return E=(0,g.Z)(l().mark(function s(d){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("/kitchen/api/product/product-list",{method:"Post",data:d}));case 1:case"end":return e.stop()}},s)})),E.apply(this,arguments)}function Q(s){return P.apply(this,arguments)}function P(){return P=(0,g.Z)(l().mark(function s(d){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,x.WY)("/kitchen/api\u200B/sysOrg\u200B/page",{method:"GET",data:d}));case 1:case"end":return e.stop()}},s)})),P.apply(this,arguments)}function b(s,d){return C.apply(this,arguments)}function C(){return C=(0,g.Z)(l().mark(function s(d,S){return l().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.abrupt("return",(0,x.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,V.Z)({},d)}));case 1:case"end":return I.stop()}},s)})),C.apply(this,arguments)}var y=t(85893),J=function(){var d=(0,u.useState)(!1),S=(0,c.Z)(d,2),e=S[0],I=S[1],q=(0,u.useState)(!1),w=(0,c.Z)(q,2),xt=w[0],_=w[1],tt=(0,u.useRef)(),et=(0,u.useState)(),L=(0,c.Z)(et,2),Zt=L[0],at=L[1],nt=(0,u.useState)([]),T=(0,c.Z)(nt,2),Et=T[0],rt=T[1],ut=(0,u.useState)([]),D=(0,c.Z)(ut,2),O=D[0],st=D[1],it=(0,u.useState)(),j=(0,c.Z)(it,2),ot=j[0],ct=j[1],lt=(0,u.useState)([]),A=(0,c.Z)(lt,2),Pt=A[0],dt=A[1],ht=(0,u.useState)(),W=(0,c.Z)(ht,2),Ct=W[0],ft=W[1],pt=(0,u.useState)([]),N=(0,c.Z)(pt,2),Rt=N[0],vt=N[1],mt=(0,u.useState)(),U=(0,c.Z)(mt,2),kt=U[0],St=U[1];(0,u.useEffect)(function(){var m=function(a){var p=K({current:1,pageSize:1e3}).then(function(n){var r={},v=[];n.data.data.forEach(function(f){v.push({text:f.name,id:f.id}),r[f.id]={text:f.name}}),vt(v),ft(r)})},i=function(a){var p=Q({current:1,pageSize:1e3}).then(function(n){var r={},v=[];n.data.data.forEach(function(f){v.push({text:f.name,id:f.id}),r[f.id]={text:f.name}}),dt(v),ct(r)})},o=function(a){var p=b().then(function(n){var r={};n.data.forEach(function(v){r[v.id]={text:v.name}}),St(r)})};m(),i(),o()},[]);function gt(){var m=O.ReqDetailList,i={},o=[];R.map(function(a,p){p>1&&o.push(a)}),i.fileName="\u5E93\u5B58\u62A5\u8868",i.datas=[{sheetData:O.map(function(a){var p={};return R.forEach(function(n,r){r>1&&(p[n.dataIndex]=a[n.dataIndex])}),p}),sheetName:"\u5E93\u5B58\u62A5\u8868",sheetFilter:o.map(function(a){return a.dataIndex}),sheetHeader:o.map(function(a){return a.title}),columnWidths:o.map(function(){return 10})}];var h=new(z())(i);h.saveExcel()}var R=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(i,o){return(0,y.jsx)("a",{onClick:function(){at(o),_(!0)},children:i})}},{title:"\u673A\u6784\u540D\u79F0",dataIndex:"orgId",hideInTable:!0,valueEnum:ot},{title:"\u6536\u8D27\u673A\u6784",hideInSearch:!0,dataIndex:"orgName"},{title:"\u7269\u6599\u540D\u79F0",hideInSearch:!0,dataIndex:"productName"},{title:"\u5E93\u5B58\u6570\u91CF",dataIndex:"stockQty",valueType:"textarea",hideInSearch:!0},{title:"\u7269\u6599\u5355\u4F4D",hideInSearch:!0,dataIndex:"uintName"},{title:"\u7269\u6599\u7F16\u7801",dataIndex:"code",valueType:"textarea",hideInSearch:!0}];return(0,y.jsx)(B.ZP,{children:(0,y.jsx)(F.ZP,{headerTitle:"\u7269\u6599\u5165\u5E93",actionRef:tt,rowKey:"id",search:{labelWidth:120},columns:R,toolBarRender:function(){return[(0,y.jsxs)($.Z,{type:"primary",onClick:function(){return gt()},children:[(0,y.jsx)(Y.Z,{})," \u5BFC\u51FA"]},"primary")]},request:function(){var m=(0,g.Z)(l().mark(function i(o){var h,a;return l().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return h=[],a=0,n.next=4,H(o).then(function(r){h=r.data.data,a=r.data.total,st(r.data.data)});case 4:return n.abrupt("return",{data:h,success:!0,total:a});case 5:case"end":return n.stop()}},i)}));return function(i){return m.apply(this,arguments)}}(),rowSelection:{onChange:function(i,o){rt(o)}}})})},X=J}}]);