Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

2 rader
10 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2679],{99971:function(Ve,N,n){"use strict";n.r(N),n.d(N,{default:function(){return we}});var Ge=n(57338),se=n(273),l=n(39428),h=n(3182),Qe=n(57663),$=n(71577),ze=n(34792),g=n(48086),x=n(2824),H=n(49101),f=n(67294),le=n(78009),ce=n(85224),oe=n(16894),de=n(12826),Je=n(71194),he=n(50146),Ne=n(49111),fe=n(19650),He=n(77883),me=n(85986),C=n(11849),pe=n(93224),Xe=n(43358),L=n(34041),qe=n(9715),y=n(71257),_e=n(47673),X=n(4107),ve=n(59465),t=n(85893),ye=["key","name","fieldKey"],Ze=function(r){return console.log(r.values),(0,t.jsx)(he.Z,{title:r.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:700,visible:r.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,children:(0,t.jsxs)(y.Z,{layout:"vertical",preserve:!1,initialValues:r.values,onFinish:r.onFinish,children:[(0,t.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(X.Z,{})}),(0,t.jsx)(y.Z.Item,{name:"orgId",label:"\u9009\u62E9\u673A\u6784",rules:[{required:!0}],children:(0,t.jsx)(L.Z,{disabled:!!r.values.id,children:r.orgArray.map(function(c,e){return(0,t.jsx)(L.Z.Option,{index:e,value:c.id,children:c.text},c.id)})})}),(0,t.jsx)(y.Z.Item,{label:"\u9009\u62E9\u7269\u6599",children:(0,t.jsx)(y.Z.List,{name:"productList",children:function(e,S){var Q=S.add,W=S.remove;return(0,t.jsxs)(t.Fragment,{children:[e.map(function(E){var z=E.key,F=E.name,w=E.fieldKey,O=(0,pe.Z)(E,ye);return(0,t.jsxs)(fe.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,t.jsx)(y.Z.Item,(0,C.Z)((0,C.Z)({},O),{},{name:[F,"productId"],fieldKey:[w,"productId"],label:"\u9009\u62E9\u7269\u6599",rules:[{required:!0}],children:(0,t.jsx)(L.Z,{style:{width:150},showSearch:!0,optionFilterProp:"children",children:r.productArray.map(function(T,J){return(0,t.jsx)(L.Z.Option,{index:J,value:T.stockUint,children:T.text},T.id)})})})),(0,t.jsx)(y.Z.Item,(0,C.Z)((0,C.Z)({},O),{},{name:[F,"stockQty"],fieldKey:[w,"stockQty"],label:"\u5E93\u5B58\u6570\u91CF",rules:[{required:!0}],children:(0,t.jsx)(me.Z,{step:1,min:0,max:1e3,style:{width:150}})})),(0,t.jsx)(y.Z.Item,(0,C.Z)((0,C.Z)({},O),{},{name:[F,"code"],fieldKey:[w,"code"],label:"\u7269\u6599\u7F16\u7801",rules:[{required:!0,max:64}],children:(0,t.jsx)(X.Z,{placeholder:"\u7269\u6599\u6761\u7801",style:{width:300}})})),(0,t.jsx)(ve.Z,{onClick:function(){return W(F)}})]},z)}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)($.Z,{type:"dashed",onClick:function(){return Q()},block:!0,icon:(0,t.jsx)(H.Z,{}),children:"\u6DFB\u52A0"})})]})}})}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)($.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ge=Ze,j=n(48971);function xe(a){return U.apply(this,arguments)}function U(){return U=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api\u200B/stock-item-application\u200B/stock-item-page",{method:"Post",data:r}));case 1:case"end":return e.stop()}},a)})),U.apply(this,arguments)}function Se(a){return D.apply(this,arguments)}function D(){return D=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api/stock-item-application/stock-item",{method:"POST",data:r}));case 1:case"end":return e.stop()}},a)})),D.apply(this,arguments)}function Ie(a){return Y.apply(this,arguments)}function Y(){return Y=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api/stock-item-application/stock-item",{method:"PUT",data:r}));case 1:case"end":return e.stop()}},a)})),Y.apply(this,arguments)}function je(a){return b.apply(this,arguments)}function b(){return b=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(r),e.abrupt("return",(0,j.WY)("/kitchen/api/stock-item-application/stock-item",{method:"DELETE",data:r}));case 2:case"end":return e.stop()}},a)})),b.apply(this,arguments)}function ke(a){return K.apply(this,arguments)}function K(){return K=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api/product/product-list",{method:"Post",data:r}));case 1:case"end":return e.stop()}},a)})),K.apply(this,arguments)}function Ce(a){return M.apply(this,arguments)}function M(){return M=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api\u200B/sysOrg\u200B/page",{method:"GET",data:r}));case 1:case"end":return e.stop()}},a)})),M.apply(this,arguments)}function Ee(a,r){return V.apply(this,arguments)}function V(){return V=(0,h.Z)((0,l.Z)().mark(function a(r,c){return(0,l.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.abrupt("return",(0,j.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,C.Z)({},r)}));case 1:case"end":return S.stop()}},a)})),V.apply(this,arguments)}function Pe(a){return G.apply(this,arguments)}function G(){return G=(0,h.Z)((0,l.Z)().mark(function a(r){return(0,l.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,j.WY)("/kitchen/api/stock-item-application/stock-item/".concat(r),{method:"GET"}));case 1:case"end":return e.stop()}},a)})),G.apply(this,arguments)}var Fe=function(){var r=(0,f.useState)(),c=(0,x.Z)(r,2),e=c[0],S=c[1],Q=(0,f.useState)([]),W=(0,x.Z)(Q,2),E=W[0],z=W[1],F=(0,f.useState)(),w=(0,x.Z)(F,2),O=w[0],T=w[1],J=(0,f.useState)([]),q=(0,x.Z)(J,2),Te=q[0],Ae=q[1],Oe=(0,f.useState)(),_=(0,x.Z)(Oe,2),Re=_[0],$e=_[1];(0,f.useEffect)(function(){var i=function(Z){var d=ke({current:1,pageSize:1e3}).then(function(p){var v={},k=[];p.data.data.forEach(function(I){k.push({text:I.name,id:I.id}),v[I.id]={text:I.name}}),Ae(k),T(v)})},s=function(Z){var d=Ce({current:1,pageSize:1e3}).then(function(p){var v={},k=[];p.data.data.forEach(function(I){k.push({text:I.name,id:I.id}),v[I.id]={text:I.name}}),z(k),S(v)})},u=function(Z){var d=Ee().then(function(p){var v={};p.data.forEach(function(k){v[k.id]={text:k.name}}),$e(v)})};i(),s(),u()},[]);var Le=(0,f.useState)(!1),ee=(0,x.Z)(Le,2),We=ee[0],B=ee[1],Be=(0,f.useState)(!1),te=(0,x.Z)(Be,2),Ue=te[0],ne=te[1],P=(0,f.useRef)(),De=(0,f.useState)(),re=(0,x.Z)(De,2),m=re[0],R=re[1],Ye=(0,f.useState)([]),ae=(0,x.Z)(Ye,2),A=ae[0],ue=ae[1];function be(i){g.default.loading("\u6B63\u5728\u6DFB\u52A0");try{return Se(JSON.stringify(i)),g.default.success("\u6DFB\u52A0\u6210\u529F"),P.current.reload(),!0}catch(s){return g.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Ke(i){try{return Ie(JSON.stringify(i)).then(function(s){s.data?(g.default.success("\u914D\u7F6E\u6210\u529F"),P.current.reload()):g.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(s){return g.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Me(){try{return je(A.map(function(i,s){return i.id})).then(function(i){i.data?g.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):g.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),P.current.reload(),!0}catch(i){g.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}}var ie=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(s,u){return(0,t.jsx)("a",{onClick:function(){R(u),ne(!0)},children:s})}},{title:"\u673A\u6784\u540D\u79F0",dataIndex:"orgId",valueEnum:e},{title:"\u7269\u6599\u540D\u79F0",dataIndex:"productId",valueEnum:O},{title:"\u5E93\u5B58\u6570\u91CF",dataIndex:"stockQty",valueType:"textarea",hideInSearch:!0},{title:"\u5E93\u5B58\u5355\u4F4D",dataIndex:"stockUint",valueEnum:Re,hideInSearch:!0},{title:"\u7269\u6599\u7F16\u7801",dataIndex:"code",valueType:"textarea",hideInSearch:!0},{title:"\u521B\u5EFA\u65F6\u95F4",sorter:!0,dataIndex:"createAt",valueType:"dateTime",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(s,u){return[(0,t.jsx)("a",{onClick:function(){Pe(u.id).then(function(Z){Z.data&&(B(!0),R(function(){return u.productList=Z.data,u}))})},children:"\u66F4\u65B0"},"config")]}}];return(0,t.jsxs)(le.ZP,{children:[(0,t.jsx)(oe.ZP,{headerTitle:"\u7269\u6599\u5165\u5E93",actionRef:P,rowKey:"id",search:{labelWidth:120},columns:ie,toolBarRender:function(){return[(0,t.jsxs)($.Z,{type:"primary",onClick:function(){B(!0),R({})},children:[(0,t.jsx)(H.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var i=(0,h.Z)((0,l.Z)().mark(function s(u){var o,Z;return(0,l.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=[],Z=0,p.next=4,xe(u).then(function(v){o=v.data.data,Z=v.data.total});case 4:return p.abrupt("return",{data:o,success:!0,total:Z});case 5:case"end":return p.stop()}},s)}));return function(s){return i.apply(this,arguments)}}(),rowSelection:{onChange:function(s,u){ue(u)}}}),(A==null?void 0:A.length)>0&&(0,t.jsx)(ce.Z,{extra:(0,t.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,t.jsx)("a",{style:{fontWeight:600},children:A.length})," ","\u9879 \xA0\xA0"]}),children:(0,t.jsx)($.Z,{onClick:function(){var s,u;Me(A),ue([]),(s=P.current)===null||s===void 0||(u=s.reloadAndRest)===null||u===void 0||u.call(s)},type:"primary",children:"\u6279\u91CF\u5220\u9664"},"primary")}),(0,t.jsx)(ge,{productArray:Te,orgArray:E,onFinish:function(){var i=(0,h.Z)((0,l.Z)().mark(function s(u){var o;return(0,l.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(o=!1,!u.id){d.next=7;break}return d.next=4,Ke(u);case 4:o=d.sent,d.next=10;break;case 7:return d.next=9,be(u);case 9:o=d.sent;case 10:o&&(B(!1),P.current&&P.current.reload());case 11:case"end":return d.stop()}},s)}));return function(s){return i.apply(this,arguments)}}(),onCancel:function(){R(void 0),B(!1)},createModalVisible:We,values:m||{}}),(0,t.jsx)(se.Z,{width:600,visible:Ue,onClose:function(){R(void 0),ne(!1)},closable:!1,children:(m==null?void 0:m.name)&&(0,t.jsx)(de.ZP,{column:2,title:m==null?void 0:m.name,request:(0,h.Z)((0,l.Z)().mark(function i(){return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",{data:m||{}});case 1:case"end":return u.stop()}},i)})),params:{id:m==null?void 0:m.name},columns:ie})})]})},we=Fe}}]);