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
9.4 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7379,1322],{54435:function(ke,D,a){"use strict";a.r(D),a.d(D,{default:function(){return re}});var m=a(3182),Ce=a(57663),B=a(71577),je=a(34792),S=a(48086),y=a(2824),M=a(94043),i=a.n(M),N=a(90631),p=a(67294),V=a(78009),G=a(16894),Ze=a(71194),Pe=a(77883),Fe=a(43358),be=a(9715),Ee=a(47673),I=a(85893),we=function(t){return console.log(t.values),console.log(t.orgArray),_jsx(_Modal,{title:"\u4FEE\u6539\u5E93\u5B58",width:600,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:_jsxs(_Form,{layout:"vertical",preserve:!1,initialValues:t.values,onFinish:t.onFinish,children:[_jsx(_Form.Item,{name:"id",hidden:!0,children:_jsx(_Input,{})}),_jsx(_Form.Item,{name:"orgId",label:"\u9009\u62E9\u673A\u6784",rules:[{required:!0}],children:_jsx(_Select,{disabled:!!t.values.id,children:t.orgArray.map(function(o,e){return _jsx(_Select.Option,{index:e,value:o.id,children:o.text},o.id)})})}),_jsx(_Form.Item,{name:"productId",label:"\u9009\u62E9\u7269\u6599",rules:[{required:!0}],children:_jsx(_Select,{disabled:!!t.values.id,children:t.productArray.map(function(o,e){return _jsx(_Select.Option,{index:e,value:o.stockUint,children:o.text},o.id)})})}),_jsx(_Form.Item,{name:"stockQty",label:"\u5E93\u5B58\u6570\u91CF",rules:[{required:!0}],children:_jsx(_InputNumber,{step:1,min:0,max:1e3,style:{width:150}})}),_jsx(_Form.Item,{name:"code",label:"\u7269\u6599\u7F16\u7801",rules:[{required:!0,max:64}],children:_jsx(_Input,{placeholder:"\u7269\u6599\u6761\u7801"})}),_jsx(_Form.Item,{children:_jsx(_Button,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Te=null,Q=a(53667),z=a.n(Q),H=a(11849),g=a(48971);function J(u){return C.apply(this,arguments)}function C(){return C=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api/stock-item-application/stock-page",{method:"Post",data:t}));case 1:case"end":return e.stop()}},u)})),C.apply(this,arguments)}function K(u){return j.apply(this,arguments)}function j(){return j=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api/stock-item-application/stock-inventory-set",{method:"Post",data:t}));case 1:case"end":return e.stop()}},u)})),j.apply(this,arguments)}function X(u){return Z.apply(this,arguments)}function Z(){return Z=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api/stock-item-application/stock-inventory/".concat(t),{method:"Post"}));case 1:case"end":return e.stop()}},u)})),Z.apply(this,arguments)}function q(u){return P.apply(this,arguments)}function P(){return P=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api/stock-item-application/stock-item-count",{method:"PUT",data:t}));case 1:case"end":return e.stop()}},u)})),P.apply(this,arguments)}function _(u){return F.apply(this,arguments)}function F(){return F=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api/product/product-list",{method:"Post",data:t}));case 1:case"end":return e.stop()}},u)})),F.apply(this,arguments)}function ee(u){return b.apply(this,arguments)}function b(){return b=(0,m.Z)(i().mark(function u(t){return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,g.WY)("/kitchen/api\u200B/sysOrg\u200B/page",{method:"GET",data:t}));case 1:case"end":return e.stop()}},u)})),b.apply(this,arguments)}function te(u,t){return E.apply(this,arguments)}function E(){return E=(0,m.Z)(i().mark(function u(t,o){return i().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.abrupt("return",(0,g.WY)("/kitchen/api/unit/uint-list",{method:"GET",params:(0,H.Z)({},t)}));case 1:case"end":return k.stop()}},u)})),E.apply(this,arguments)}var ae=function(){var t=(0,p.useState)(!1),o=(0,y.Z)(t,2),e=o[0],k=o[1],ne=(0,p.useState)(!1),O=(0,y.Z)(ne,2),De=O[0],ue=O[1],ie=(0,p.useRef)(),se=(0,p.useState)(),L=(0,y.Z)(se,2),Oe=L[0],le=L[1],oe=(0,p.useState)([]),R=(0,y.Z)(oe,2),w=R[0],ce=R[1],de=(0,p.useState)(),$=(0,y.Z)(de,2),Le=$[0],he=$[1],fe=(0,p.useState)([]),A=(0,y.Z)(fe,2),Re=A[0],pe=A[1],me=(0,p.useState)(),U=(0,y.Z)(me,2),$e=U[0],ve=U[1],ye=(0,p.useState)([]),W=(0,y.Z)(ye,2),Ae=W[0],xe=W[1],Se=(0,p.useState)(),Y=(0,y.Z)(Se,2),Ue=Y[0],ge=Y[1];(0,p.useEffect)(function(){var h=function(r){var f=_({current:1,pageSize:1e3}).then(function(n){var s={},v=[];n.data.data.forEach(function(x){v.push({text:x.name,id:x.id}),s[x.id]={text:x.name}}),xe(v),ve(s)})},l=function(r){var f=ee({current:1,pageSize:1e3}).then(function(n){var s={},v=[];n.data.data.forEach(function(x){v.push({text:x.name,id:x.id}),s[x.id]={text:x.name}}),pe(v),he(s)})},c=function(r){var f=te().then(function(n){var s={};n.data.forEach(function(v){s[v.id]={text:v.name}}),ge(s)})};h(),l(),c()},[]);function We(h){try{return q(JSON.stringify(h)).then(function(l){l.data?(S.default.success("\u4FEE\u6539\u6210\u529F"),ie.current.reload()):S.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(l){return S.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Ie(){var h=w.ReqDetailList,l={},c=[];T.map(function(r,f){f>0&&r.title!="\u64CD\u4F5C"&&c.push(r)}),l.fileName="\u5E93\u5B58\u62A5\u8868",l.datas=[{sheetData:w.map(function(r){var f={};return T.forEach(function(n,s){s>0&&r.title!="\u64CD\u4F5C"&&(f[n.dataIndex]=r[n.dataIndex])}),f}),sheetName:"\u5E93\u5B58\u62A5\u8868",sheetFilter:c.map(function(r){return r.dataIndex}),sheetHeader:c.map(function(r){return r.title}),columnWidths:c.map(function(){return 10})}];var d=new(z())(l);d.saveExcel()}var T=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(l,c){return(0,I.jsx)("a",{onClick:function(){le(c),ue(!0)},children:l})}},{title:"\u5546\u54C1\u5927\u7C7B",hideInSearch:!0,dataIndex:"",editable:!1},{title:"\u5546\u54C1\u5C0F\u7C7B",hideInSearch:!0,dataIndex:"",editable:!1},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"productName",editable:!1},{title:"\u4F9B\u5E94\u5546",dataIndex:"",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u54C1\u724C",hideInSearch:!0,dataIndex:"",editable:!1},{title:"\u5546\u54C1\u89C4\u683C",dataIndex:"specs",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u5E93\u5B58\u5355\u4F4D",dataIndex:"uintName",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u4E0A\u671F\u5E93\u5B58\u6570\u91CF",dataIndex:"stockQty",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u5165\u5E93\u6570\u91CF",dataIndex:"",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u51FA\u5E93\u6570\u91CF",dataIndex:"",valueType:"textarea",hideInSearch:!0,editable:!1},{title:"\u76D8\u70B9\u6570\u91CF",dataIndex:"stockQty",valueType:"textarea",hideInSearch:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u62A5\u635F",dataIndex:"damageCount",valueType:"textarea",hideInSearch:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u8C03\u62E8\u51FA\u5E93\u6570\u91CF",dataIndex:"transferIssueCount",valueType:"textarea",hideInSearch:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u8C03\u62E8\u5165\u5E93\u6570\u91CF",dataIndex:"transferReceiptCount",valueType:"textarea",hideInSearch:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(l,c,d,r){return[(0,I.jsx)("a",{style:{color:"#78cdd1"},onClick:function(){var n;(n=r.startEditable)===null||n===void 0||n.call(r,c.id)},children:"\u7F16\u8F91"},"editable")]}}];return(0,I.jsx)(V.ZP,{children:(0,I.jsx)(G.ZP,{rowKey:"id",columns:T,toolBarRender:function(){return[(0,I.jsxs)(B.Z,{type:"primary",onClick:function(){return Ie()},children:[(0,I.jsx)(N.Z,{})," \u5BFC\u51FA"]},"primary")]},request:function(){var h=(0,m.Z)(i().mark(function l(c){var d,r;return i().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return d=[],r=0,n.next=4,J(c).then(function(s){d=s.data.data,r=s.data.total,ce(s.data.data)});case 4:return n.abrupt("return",{data:d,success:!0});case 5:case"end":return n.stop()}},l)}));return function(l){return h.apply(this,arguments)}}(),value:w,editable:{type:"multiple",onSave:function(){var h=(0,m.Z)(i().mark(function c(d,r,f){return i().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:K(r).then(function(v){v.data?S.default.success("\u4FEE\u6539\u6210\u529F"):S.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),console.log(d,r,f);case 2:case"end":return s.stop()}},c)}));function l(c,d,r){return h.apply(this,arguments)}return l}(),onDelete:function(){var h=(0,m.Z)(i().mark(function c(d,r){return i().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:X(d).then(function(s){s.data?S.default.success("\u5220\u9664\u6210\u529F"):S.default.error("\u5220\u9664\u5931\u8D25\uFF01")}),console.log(d,r);case 2:case"end":return n.stop()}},c)}));function l(c,d){return h.apply(this,arguments)}return l}()},recordCreatorProps:{position:"end",record:function(){return{id:Date.now()}},onClick:function(){S.default.destroy()}}})})},re=ae}}]);