集成,总结MES功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 regels
12 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[450],{48223:function(re,z,t){var f=t(97857),v=t.n(f),S=t(56002);z.Z={Add:function(y){return(0,S.request)("/api/materialsinfo/add",{method:"POST",data:v()({},y)})},Del:function(y){return(0,S.request)("/api/materialsinfo/del",{method:"POST",data:v()({},y)})},Update:function(y){return(0,S.request)("/api/materialsinfo/update",{method:"POST",data:v()({},y)})},List:function(){return(0,S.request)("/api/materialsinfo/list",{method:"GET"})},selectlist:function(){return(0,S.request)("/api/materialsinfo/selectlist",{method:"GET"})},PagedList:function(y){return(0,S.request)("/api/materialsinfo/pagedlist",{method:"POST",data:v()({},y)})}}},51349:function(re,z,t){t.r(z),t.d(z,{default:function(){return Y}});var f=t(15009),v=t.n(f),S=t(99289),b=t.n(S),y=t(5574),D=t.n(y),K=t(83145),E=t(8232),F=t(14726),G=t(86738),Z=t(45360),X=t(85576),w=t(66309),B=t(49978),V=t(34041),I=t(67294),U=t(97857),L=t.n(U),x=t(56002),H={Add:function(h){return(0,x.request)("/api/stockinfo/add",{method:"POST",data:L()({},h)})},Del:function(h){return(0,x.request)("/api/stockinfo/del",{method:"POST",data:L()({},h)})},Update:function(h){return(0,x.request)("/api/stockinfo/update",{method:"POST",data:L()({},h)})},Detail:function(h){return(0,x.request)("/api/stockinfo/detail?id=".concat(h),{method:"GET"})},List:function(){return(0,x.request)("/api/stockinfo/list",{method:"POST"})},UnBindList:function(){return(0,x.request)("/api/stockinfo/UnBindList",{method:"GET"})},PagedList:function(h){return(0,x.request)("/api/stockinfo/pagedlist",{method:"POST",data:L()({},h)})},RecipeList:function(h){return(0,x.request)(" api/stockrecipe/list",{method:"POST",data:{StockId:h}})},selectlist:function(){return(0,x.request)("/api/stockinfo/selectlist",{method:"GET"})}},Q=t(48223),s=t(85893),Y=function(){var T=E.Z.useForm(),h=D()(T,1),N=h[0],q=(0,I.useState)(),J=D()(q,2),ne=J[0],k=J[1],_=(0,I.useState)(!1),e=D()(_,2),a=e[0],o=e[1],r=(0,I.useRef)(),n=(0,I.useState)([]),C=D()(n,2),p=C[0],$=C[1],P=[{title:"id",dataIndex:"id",tooltip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u6599\u4ED3\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u6599\u4ED3\u539F\u6599",dataIndex:"materialName",ellipsis:!0,hideInSearch:!0},{title:"\u6599\u4ED3\u7F16\u53F7",dataIndex:"code",ellipsis:!0},{title:"\u6599\u4ED3\u5BB9\u79EF",dataIndex:"volume",ellipsis:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",render:function(m,c){return[(0,s.jsx)(F.ZP,{type:"primary",size:"small",onClick:b()(v()().mark(function u(){var g;return v()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:o(!0),k("\u7F16\u8F91\u4FE1\u606F"),g=JSON.parse(JSON.stringify(c)),g.state=g.state==="0",N.setFieldsValue(g);case 5:case"end":return d.stop()}},u)})),children:"\u7F16\u8F91"},"edit"),(0,s.jsx)(G.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var g={id:c.id,name:"",code:"",lineId:"",materialName:"",materialId:"",volume:void 0};H.Del(g).then(function(l){if(l.statusCode===200){var d;Z.ZP.success(l.statusCode===200?"\u5220\u9664\u6210\u529F":l.message),(d=r.current)===null||d===void 0||d.reload()}})},onCancel:function(){Z.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,s.jsx)(F.ZP,{type:"primary",danger:!0,size:"small",children:"\u5220\u9664"})},"del")]}}];(0,I.useEffect)(function(){var i=function(){var m=b()(v()().mark(function c(){var u;return v()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,Q.Z.selectlist();case 2:u=l.sent,$(u.data);case 4:case"end":return l.stop()}},c)}));return function(){return m.apply(this,arguments)}}();i()},[]);var A=function(){var i=b()(v()().mark(function m(c){var u,g,l,d;return v()().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(console.log("values",c),!c.id){j.next=8;break}return j.next=4,H.Update(c);case 4:u=j.sent,u.statusCode===200?(Z.ZP.success("\u4FEE\u6539\u6210\u529F"),(g=r.current)===null||g===void 0||g.reload(),o(!1)):Z.ZP.error(JSON.stringify(u.errors)||"\u4FEE\u6539\u5931\u8D25"),j.next=13;break;case 8:return j.next=10,H.Add(c);case 10:l=j.sent,console.log("response",l),l.statusCode===200?(Z.ZP.success("\u6DFB\u52A0\u6210\u529F"),(d=r.current)===null||d===void 0||d.reload(),o(!1)):Z.ZP.error(JSON.stringify(l.errors)||"\u6DFB\u52A0\u5931\u8D25");case 13:case"end":return j.stop()}},m)}));return function(c){return i.apply(this,arguments)}}();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(K.Z,{columns:P,actionRef:r,cardBordered:!0,bordered:!0,scroll:{x:!0},rowClassName:function(m,c,u){return c%2===0?"":"even-row-background"},request:b()(v()().mark(function i(){var m,c,u,g=arguments;return v()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return m=g.length>0&&g[0]!==void 0?g[0]:{},c={pageIndex:m.current||1,pageSize:m.pageSize||10,name:m.name||"",id:"",code:m.code},d.next=4,H.PagedList(c);case 4:if(u=d.sent,console.log(u),u.statusCode!==200){d.next=10;break}return d.abrupt("return",{data:u.data.items,success:!0,total:u.data.total});case 10:return d.abrupt("return",{data:[],success:!1,total:0});case 11:case"end":return d.stop()}},i)})),rowKey:"id",pagination:{pageSize:10,showSizeChanger:!1},dateFormatter:"string",headerTitle:"\u6599\u4ED3\u5217\u8868",toolBarRender:function(){return[(0,s.jsx)(F.ZP,{type:"primary",onClick:function(){N.resetFields(),o(!0),k("\u65B0\u589E\u6599\u4ED3")},children:"\u65B0\u5EFA\u6599\u4ED3"},"button")]}},"myTable"),(0,s.jsx)(X.Z,{maskClosable:!1,width:800,title:(0,s.jsx)(w.Z,{color:"#cd201f",children:ne}),open:a,onCancel:function(){o(!1)},footer:[(0,s.jsx)(F.ZP,{onClick:function(){o(!1)},children:"\u8FD4\u56DE"},"back"),(0,s.jsx)(F.ZP,{form:"stockForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],children:(0,s.jsxs)(E.Z,{form:N,name:"basic",id:"stockForm",labelCol:{span:4},wrapperCol:{span:12},onFinish:A,autoComplete:"off",children:[(0,s.jsx)(E.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,s.jsx)(B.Z,{})}),(0,s.jsx)(E.Z.Item,{label:"\u6599\u4ED3\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(B.Z,{})}),(0,s.jsx)(E.Z.Item,{label:"\u6599\u4ED3\u539F\u6599",name:"materialId",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(V.Z,{placeholder:"\u8BF7\u9009\u62E9\u539F\u6599",children:p.map(function(i){return console.log(i),(0,s.jsx)(V.Z.Option,{value:i.key,children:(0,s.jsx)("span",{children:i.value})},i.key)})})}),(0,s.jsx)(E.Z.Item,{label:"\u6599\u4ED3\u7F16\u53F7",name:"code",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(B.Z,{})}),(0,s.jsx)(E.Z.Item,{label:"\u6599\u4ED3\u5BB9\u79EF",name:"volume",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,s.jsx)(B.Z,{})})]})},"01")]})}},66309:function(re,z,t){t.d(z,{Z:function(){return _}});var f=t(67294),v=t(93967),S=t.n(v),b=t(98423),y=t(98787),D=t(69760),K=t(96159),E=t(45353),F=t(53124),G=t(85088),Z=t(10274),X=t(14747),w=t(45503),B=t(27036);const V=e=>{const{paddingXXS:a,lineWidth:o,tagPaddingHorizontal:r,componentCls:n,calc:C}=e,p=C(r).sub(o).equal(),$=C(a).sub(o).equal();return{[n]:Object.assign(Object.assign({},(0,X.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:p,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,G.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${n}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${n}-close-icon`]:{marginInlineStart:$,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${n}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${n}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:p}}),[`${n}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},I=e=>{const{lineWidth:a,fontSizeIcon:o,calc:r}=e,n=e.fontSizeSM;return(0,w.TS)(e,{tagFontSize:n,tagLineHeight:(0,G.bf)(r(e.lineHeightSM).mul(n).equal()),tagIconSize:r(o).sub(r(a).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},U=e=>({defaultBg:new Z.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var L=(0,B.I$)("Tag",e=>{const a=I(e);return V(a)},U),x=function(e,a){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]]);return o},Q=f.forwardRef((e,a)=>{const{prefixCls:o,style:r,className:n,checked:C,onChange:p,onClick:$}=e,P=x(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:A,tag:i}=f.useContext(F.E_),m=W=>{p==null||p(!C),$==null||$(W)},c=A("tag",o),[u,g,l]=L(c),d=S()(c,`${c}-checkable`,{[`${c}-checkable-checked`]:C},i==null?void 0:i.className,n,g,l);return u(f.createElement("span",Object.assign({},P,{ref:a,style:Object.assign(Object.assign({},r),i==null?void 0:i.style),className:d,onClick:m})))}),s=t(98719);const Y=e=>(0,s.Z)(e,(a,o)=>{let{textColor:r,lightBorderColor:n,lightColor:C,darkColor:p}=o;return{[`${e.componentCls}${e.componentCls}-${a}`]:{color:r,background:C,borderColor:n,"&-inverse":{color:e.colorTextLightSolid,background:p,borderColor:p},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var T=(0,B.bk)(["Tag","preset"],e=>{const a=I(e);return Y(a)},U);function h(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const N=(e,a,o)=>{const r=h(o);return{[`${e.componentCls}${e.componentCls}-${a}`]:{color:e[`color${o}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var q=(0,B.bk)(["Tag","status"],e=>{const a=I(e);return[N(a,"success","Success"),N(a,"processing","Info"),N(a,"error","Error"),N(a,"warning","Warning")]},U),J=function(e,a){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]]);return o};const k=f.forwardRef((e,a)=>{const{prefixCls:o,className:r,rootClassName:n,style:C,children:p,icon:$,color:P,onClose:A,bordered:i=!0,visible:m}=e,c=J(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:u,direction:g,tag:l}=f.useContext(F.E_),[d,W]=f.useState(!0),j=(0,b.Z)(c,["closeIcon","closable"]);f.useEffect(()=>{m!==void 0&&W(m)},[m]);const ae=(0,y.o2)(P),oe=(0,y.yT)(P),ee=ae||oe,de=Object.assign(Object.assign({backgroundColor:P&&!ee?P:void 0},l==null?void 0:l.style),C),O=u("tag",o),[ue,fe,me]=L(O),ge=S()(O,l==null?void 0:l.className,{[`${O}-${P}`]:ee,[`${O}-has-color`]:P&&!ee,[`${O}-hidden`]:!d,[`${O}-rtl`]:g==="rtl",[`${O}-borderless`]:!i},r,n,fe,me),se=M=>{M.stopPropagation(),A==null||A(M),!M.defaultPrevented&&W(!1)},[,pe]=(0,D.Z)((0,D.w)(e),(0,D.w)(l),{closable:!1,closeIconRender:M=>{const Ce=f.createElement("span",{className:`${O}-close-icon`,onClick:se},M);return(0,K.wm)(M,Ce,R=>({onClick:ce=>{var te;(te=R==null?void 0:R.onClick)===null||te===void 0||te.call(R,ce),se(ce)},className:S()(R==null?void 0:R.className,`${O}-close-icon`)}))}}),ve=typeof c.onClick=="function"||p&&p.type==="a",le=$||null,he=le?f.createElement(f.Fragment,null,le,p&&f.createElement("span",null,p)):p,ie=f.createElement("span",Object.assign({},j,{ref:a,className:ge,style:de}),he,pe,ae&&f.createElement(T,{key:"preset",prefixCls:O}),oe&&f.createElement(q,{key:"status",prefixCls:O}));return ue(ve?f.createElement(E.Z,{component:"Tag"},ie):ie)});k.CheckableTag=Q;var _=k}}]);