胖子天骄的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 lines
8.5 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[187],{48223:function(b,D,e){var S=e(97857),o=e.n(S),d=e(12578);D.Z={Add:function(u){return(0,d.request)("/api/materialsinfo/add",{method:"POST",data:o()({},u)})},Del:function(u){return(0,d.request)("/api/materialsinfo/del",{method:"POST",data:o()({},u)})},Update:function(u){return(0,d.request)("/api/materialsinfo/update",{method:"POST",data:o()({},u)})},List:function(){return(0,d.request)("/api/materialsinfo/list",{method:"GET"})},selectlist:function(){return(0,d.request)("/api/materialsinfo/selectlist",{method:"GET"})},PagedList:function(u){return(0,d.request)("/api/materialsinfo/pagedlist",{method:"POST",data:o()({},u)})}}},70226:function(b,D,e){var S=e(97857),o=e.n(S),d=e(12578);D.Z={Add:function(u){return(0,d.request)("/api/recipesinfo/add",{method:"POST",data:o()({},u)})},Del:function(u){return(0,d.request)("/api/recipesinfo/del",{method:"POST",data:o()({},u)})},Update:function(u){return(0,d.request)("/api/recipesinfo/update",{method:"POST",data:o()({},u)})},List:function(){return(0,d.request)("/api/recipesinfo/list",{method:"GET"})},PagedList:function(u){return(0,d.request)("/api/recipesinfo/pagedlist",{method:"POST",data:o()({},u)})},MaterialList:function(u){return(0,d.request)("/api/recipematerial/list",{method:"POST",data:o()({},u)})},BatchAdd:function(u){return(0,d.request)("/api/recipematerial/batchadd",{method:"POST",data:u})},ChangeGroup:function(u){return(0,d.request)("/api/recipesinfo/changegroup",{method:"POST",data:u})},selectlist:function(){return(0,d.request)("/api/recipesinfo/selectlist",{method:"GET"})}}},44148:function(b,D,e){e.r(D);var S=e(15009),o=e.n(S),d=e(99289),l=e.n(d),u=e(5574),p=e.n(u),$=e(67286),G=e(88280),w=e(15513),O=e(12029),E=e(45360),z=e(42075),P=e(71577),N=e(86738),B=e(5914),k=e(51904),j=e(12096),V=e(75081),c=e(67294),v=e(70226),H=e(48223),r=e(85893),Q=function(){var X=O.Z.useForm(),Y=p()(X,1),Z=Y[0],q=(0,c.useState)(!1),A=p()(q,2),ee=A[0],M=A[1],te=(0,c.useState)(!1),L=p()(te,2),ae=L[0],R=L[1],re=(0,c.useState)(!1),U=p()(re,2),ne=U[0],T=U[1],se=(0,c.useState)(),y=p()(se,2),ue=y[0],ge=y[1],ie=(0,c.useState)(),F=p()(ie,2),oe=F[0],le=F[1],de=(0,c.useState)([]),K=p()(de,2),g=K[0],C=K[1],_e=(0,c.useState)([]),W=p()(_e,2),ce=W[0],me=W[1],pe=(0,c.useState)(),x=p()(pe,2),fe=x[0],Ee=x[1],I=(0,c.useRef)(),Pe=O.Z.useForm(),he=p()(Pe,1),De=he[0],Oe=(0,c.useRef)(),J=(0,c.useRef)(),ve=function(){var _=l()(o()().mark(function i(a){var n,s,m,t;return o()().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(a.picUrl=fe,!a.id){f.next=8;break}return f.next=4,v.Z.Update(a);case 4:n=f.sent,n.statusCode===200?(E.ZP.success("\u4FEE\u6539\u6210\u529F"),(s=I.current)===null||s===void 0||s.reload(),M(!1)):E.ZP.error(n.errors||"\u4FEE\u6539\u5931\u8D25"),f.next=12;break;case 8:return f.next=10,v.Z.Add(a);case 10:m=f.sent,m.statusCode===200?(E.ZP.success("\u6DFB\u52A0\u6210\u529F"),(t=I.current)===null||t===void 0||t.reload(),M(!1)):E.ZP.error(m.errors||"\u6DFB\u52A0\u5931\u8D25");case 12:case"end":return f.stop()}},i)}));return function(a){return _.apply(this,arguments)}}(),Me=[{title:"\u914D\u65B9\u540D\u79F0",dataIndex:"name",align:"center"},{title:"\u914D\u65B9\u7F16\u7801",dataIndex:"code",align:"center",hideInSearch:!0},{title:"\u64CD\u4F5C",align:"center",valueType:"option",key:"option",render:function(i,a){return[(0,r.jsxs)(z.Z,{size:"middle",children:[(0,r.jsx)(P.ZP,{type:"primary",ghost:!0,onClick:l()(o()().mark(function n(){var s;return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:M(!0),s=JSON.parse(JSON.stringify(a)),Ee(s.picUrl),Z.setFieldsValue(s);case 4:case"end":return t.stop()}},n)})),children:"\u7F16\u8F91"},"edit"),(0,r.jsx)(P.ZP,{type:"primary",ghost:!0,onClick:l()(o()().mark(function n(){var s;return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:T(!0),R(!0),s={id:"",materialId:"",recipesId:a.id,weight:""},le(a),v.Z.MaterialList(s).then(function(h){h.statusCode===200&&(C(h.data),T(!0)),R(!1)}).catch(function(){T(!1),R(!1)});case 5:case"end":return t.stop()}},n)})),children:"\u914D\u7F6E\u7269\u6599"},"site"),(0,r.jsx)(N.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var s={id:a.id,name:"",code:"",picUrl:"",groupId:""};v.Z.Del(s).then(function(m){if(m.statusCode===200){var t;E.ZP.success(m.statusCode===200?"\u5220\u9664\u6210\u529F":m.message),(t=I.current)===null||t===void 0||t.reload()}})},onCancel:function(){E.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,r.jsx)(P.ZP,{type:"primary",danger:!0,ghost:!0,children:"\u5220\u9664"})},"del")]},"nm")]}}],Se=[{title:"\u7269\u6599\u540D\u79F0",dataIndex:"materialId",valueType:"select",ellipsis:!0,request:function(){var _=l()(o()().mark(function a(){var n,s;return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,H.Z.List();case 2:return n=t.sent,s=[],n.statusCode===200&&(me(n.data),n.data.map(function(h){return s.push({label:"".concat(h.name,"[").concat(h.unit,"]"),value:h.id})})),t.abrupt("return",s);case 6:case"end":return t.stop()}},a)}));function i(){return _.apply(this,arguments)}return i}(),formItemProps:function(){return{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}},{title:"\u91CD\u91CF",dataIndex:"weight",valueType:"text",ellipsis:!0,formItemProps:function(){return{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}},{title:"\u91CD\u91CF\u8BEF\u5DEE(\xB1)",dataIndex:"errorWeight",valueType:"text",ellipsis:!0,formItemProps:function(){return{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}},{title:"\u64CD\u4F5C",valueType:"option",render:function(i,a){return[(0,r.jsx)(P.ZP,{type:"primary",ghost:!0,onClick:function(){var s;console.log(a),(s=J.current)===null||s===void 0||s.startEditable(a.id)},children:"\u7F16\u8F91\u539F\u6599"},"edit")]}}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w.Z,{columns:Me,actionRef:I,cardBordered:!0,params:ue,request:l()(o()().mark(function _(){var i,a,n,s=arguments;return o()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=s.length>0&&s[0]!==void 0?s[0]:{},console.log("params",i),a={pageIndex:i.current||1,pageSize:i.pageSize||10,name:i.name||"",id:i.id,code:i.code,picUrl:"",groupId:i.groupId},t.next=5,v.Z.PagedList(a);case 5:if(n=t.sent,n.statusCode!==200){t.next=10;break}return t.abrupt("return",{data:n.data.items,success:!0,total:n.data.total});case 10:return t.abrupt("return",{data:[],success:!1,total:0});case 11:case"end":return t.stop()}},_)})),rowKey:"id",pagination:{pageSize:10,showSizeChanger:!1},dateFormatter:"string",headerTitle:"\u914D\u65B9\u5217\u8868",toolBarRender:function(){return[(0,r.jsx)(P.ZP,{type:"primary",onClick:function(){Z.resetFields(),M(!0)},children:"\u6DFB\u52A0\u914D\u65B9\u914D\u65B9"},"button")]}},"myTable"),(0,r.jsx)(B.Z,{maskClosable:!1,width:800,title:(0,r.jsx)(k.Z,{color:"#cd201f",children:"\u65B0\u589E\u4FE1\u606F"}),open:ee,onCancel:function(){M(!1)},footer:[(0,r.jsx)(P.ZP,{onClick:function(){M(!1)},children:"\u8FD4\u56DE"},"back"),(0,r.jsx)(P.ZP,{form:"myForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],children:(0,r.jsxs)(O.Z,{form:Z,name:"basic",id:"myForm",labelCol:{span:4},wrapperCol:{span:12},onFinish:ve,autoComplete:"off",children:[(0,r.jsx)(O.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,r.jsx)(j.Z,{})}),(0,r.jsx)(O.Z.Item,{label:"\u914D\u65B9\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,r.jsx)(j.Z,{})}),(0,r.jsx)(O.Z.Item,{label:"\u914D\u65B9\u7F16\u7801",name:"code",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,r.jsx)(j.Z,{})})]})},"01"),(0,r.jsx)(B.Z,{maskClosable:!1,width:1200,title:"\u914D\u7F6E\u7269\u6599",open:ne,destroyOnClose:!0,onCancel:function(){T(!1),C([])},onOk:function(){var i=JSON.parse(JSON.stringify(g));i.map(function(a){a.recipesId=oe.id,a.id=""}),v.Z.BatchAdd(i).then(function(a){a.statusCode===200?(E.ZP.success("\u4FDD\u5B58\u6210\u529F!"),T(!1)):E.ZP.error("\u4FDD\u5B58\u5931\u8D25!")})},children:(0,r.jsx)(V.Z,{spinning:ae,children:(0,r.jsx)($.Z,{children:(0,r.jsx)("div",{style:{maxWidth:1200,margin:"auto"},children:(0,r.jsx)(G.Z,{rowKey:"id",controlled:!0,editableFormRef:Oe,actionRef:J,columns:Se,value:g,recordCreatorProps:{record:function(){return{id:Date.now().toString(),materialId:"",recipesId:"",weight:""}}},editable:{form:De,type:"single",onValuesChange:function(i,a){console.log(ce),a?C(a):(g.push(i),C(g)),console.log("materiallist",g)},actionRender:function(i,a,n){return[n.delete,n.save,n.cancel]}}})})})})},"02")]})};D.default=Q}}]);