Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

2 lignes
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 Te}});var Ge=n(57338),se=n(25084),h=n(3182),Qe=n(57663),R=n(71577),ze=n(34792),Z=n(48086),S=n(2824),le=n(94043),l=n.n(le),H=n(49101),f=n(67294),ce=n(78009),oe=n(85224),de=n(16894),he=n(12826),Je=n(71194),fe=n(50146),Ne=n(49111),me=n(19650),He=n(77883),pe=n(85482),C=n(11849),ve=n(93224),Xe=n(43358),L=n(34041),qe=n(9715),y=n(86835),_e=n(47673),X=n(4107),ye=n(59465),t=n(85893),ge=function(r){return console.log(r.values),(0,t.jsx)(fe.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,x){var Q=x.add,W=x.remove;return(0,t.jsxs)(t.Fragment,{children:[e.map(function(E){var z=E.key,F=E.name,T=E.fieldKey,O=(0,ve.Z)(E,["key","name","fieldKey"]);return(0,t.jsxs)(me.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:[T,"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(w,J){return(0,t.jsx)(L.Z.Option,{index:J,value:w.stockUint,children:w.text},w.id)})})})),(0,t.jsx)(y.Z.Item,(0,C.Z)((0,C.Z)({},O),{},{name:[F,"stockQty"],fieldKey:[T,"stockQty"],label:"\u5E93\u5B58\u6570\u91CF",rules:[{required:!0}],children:(0,t.jsx)(pe.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:[T,"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)(ye.Z,{onClick:function(){return W(F)}})]},z)}),(0,t.jsx)(y.Z.Item,{children:(0,t.jsx)(R.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)(R.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Ze=ge,j=n(48971);function Se(a){return U.apply(this,arguments)}function U(){return U=(0,h.Z)(l().mark(function a(r){return l().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 xe(a){return D.apply(this,arguments)}function D(){return D=(0,h.Z)(l().mark(function a(r){return l().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)(l().mark(function a(r){return l().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 K.apply(this,arguments)}function K(){return K=(0,h.Z)(l().mark(function a(r){return l().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)})),K.apply(this,arguments)}function ke(a){return M.apply(this,arguments)}function M(){return M=(0,h.Z)(l().mark(function a(r){return l().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)})),M.apply(this,arguments)}function Ce(a){return b.apply(this,arguments)}function b(){return b=(0,h.Z)(l().mark(function a(r){return l().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)})),b.apply(this,arguments)}function Ee(a,r){return V.apply(this,arguments)}function V(){return V=(0,h.Z)(l().mark(function a(r,c){return l().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.abrupt("return",(0,j.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,C.Z)({},r)}));case 1:case"end":return x.stop()}},a)})),V.apply(this,arguments)}function Pe(a){return G.apply(this,arguments)}function G(){return G=(0,h.Z)(l().mark(function a(r){return l().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,S.Z)(r,2),e=c[0],x=c[1],Q=(0,f.useState)([]),W=(0,S.Z)(Q,2),E=W[0],z=W[1],F=(0,f.useState)(),T=(0,S.Z)(F,2),O=T[0],w=T[1],J=(0,f.useState)([]),q=(0,S.Z)(J,2),we=q[0],Ae=q[1],Oe=(0,f.useState)(),_=(0,S.Z)(Oe,2),$e=_[0],Re=_[1];(0,f.useEffect)(function(){var i=function(g){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),w(v)})},s=function(g){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),x(v)})},u=function(g){var d=Ee().then(function(p){var v={};p.data.forEach(function(k){v[k.id]={text:k.name}}),Re(v)})};i(),s(),u()},[]);var Le=(0,f.useState)(!1),ee=(0,S.Z)(Le,2),We=ee[0],B=ee[1],Be=(0,f.useState)(!1),te=(0,S.Z)(Be,2),Ue=te[0],ne=te[1],P=(0,f.useRef)(),De=(0,f.useState)(),re=(0,S.Z)(De,2),m=re[0],$=re[1],Ye=(0,f.useState)([]),ae=(0,S.Z)(Ye,2),A=ae[0],ue=ae[1];function Ke(i){Z.default.loading("\u6B63\u5728\u6DFB\u52A0");try{return xe(JSON.stringify(i)),Z.default.success("\u6DFB\u52A0\u6210\u529F"),P.current.reload(),!0}catch(s){return Z.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Me(i){try{return Ie(JSON.stringify(i)).then(function(s){s.data?(Z.default.success("\u914D\u7F6E\u6210\u529F"),P.current.reload()):Z.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(s){return Z.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function be(){try{return je(A.map(function(i,s){return i.id})).then(function(i){i.data?Z.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):Z.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),P.current.reload(),!0}catch(i){Z.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(){$(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:$e,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(g){g.data&&(B(!0),$(function(){return u.productList=g.data,u}))})},children:"\u66F4\u65B0"},"config")]}}];return(0,t.jsxs)(ce.ZP,{children:[(0,t.jsx)(de.ZP,{headerTitle:"\u7269\u6599\u5165\u5E93",actionRef:P,rowKey:"id",search:{labelWidth:120},columns:ie,toolBarRender:function(){return[(0,t.jsxs)(R.Z,{type:"primary",onClick:function(){B(!0),$({})},children:[(0,t.jsx)(H.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var i=(0,h.Z)(l().mark(function s(u){var o,g;return l().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=[],g=0,p.next=4,Se(u).then(function(v){o=v.data.data,g=v.data.total});case 4:return p.abrupt("return",{data:o,success:!0,total:g});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)(oe.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)(R.Z,{onClick:function(){var s,u;be(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)(Ze,{productArray:we,orgArray:E,onFinish:function(){var i=(0,h.Z)(l().mark(function s(u){var o;return l().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(o=!1,!u.id){d.next=7;break}return d.next=4,Me(u);case 4:o=d.sent,d.next=10;break;case 7:return d.next=9,Ke(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(){$(void 0),B(!1)},createModalVisible:We,values:m||{}}),(0,t.jsx)(se.Z,{width:600,visible:Ue,onClose:function(){$(void 0),ne(!1)},closable:!1,children:(m==null?void 0:m.name)&&(0,t.jsx)(he.ZP,{column:2,title:m==null?void 0:m.name,request:(0,h.Z)(l().mark(function i(){return l().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})})]})},Te=Fe}}]);