|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7633],{91884:function(je,H,t){"use strict";t.r(H),t.d(H,{default:function(){return Ge}});var Y=t(57338),ee=t(25084),I=t(62350),w=t(75443),g=t(3182),Q=t(57663),G=t(71577),i=t(11849),ce=t(47673),D=t(4107),X=t(93224),q=t(34792),o=t(48086),f=t(2824),k=t(94043),n=t.n(k),fe=t(49101),x=t(67294),De=t(78009),Se=t(85224),Ae=t(16894),Ce=t(12826),tt=t(71194),Fe=t(50146),nt=t(49111),Pe=t(19650),rt=t(77883),Ee=t(85482),at=t(88983),te=t(47933),ut=t(62999),Be=t(54680),st=t(9715),h=t(86835),lt=t(43358),F=t(34041),Ie=t(59465),e=t(85893),be=function(l){var S=F.Z.Option,r=F.Z.OptGroup;return(0,e.jsx)(Fe.Z,{title:l.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:1400,visible:l.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){l.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(h.Z,{layout:"vertical",preserve:!1,initialValues:l.values,onFinish:l.onFinish,children:[(0,e.jsx)(h.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(D.Z,{})}),(0,e.jsx)(h.Z.Item,{name:"storeId",label:"\u9009\u62E9\u5E97\u94FA",rules:[{required:!0}],children:(0,e.jsx)(Be.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:l.OrgData,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,e.jsx)(h.Z.Item,{label:"\u5206\u8D26\u8D26\u6237",children:(0,e.jsx)(h.Z.List,{name:"businessList",children:function(U,N){var oe=N.add,de=N.remove;return(0,e.jsxs)(e.Fragment,{children:[U.map(function(R){var O=R.key,A=R.name,P=R.fieldKey,E=(0,X.Z)(R,["key","name","fieldKey"]);return(0,e.jsxs)(Pe.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u5206\u8D26\u8D26\u6237\u7C7B\u522B",name:[A,"accountType"],fieldKey:[P,"accountType"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5206\u8D26\u8D26\u6237\u7C7B\u522B"}],children:(0,e.jsxs)(te.ZP.Group,{children:[(0,e.jsx)(te.ZP,{value:0,children:"\u5546\u6237"}),(0,e.jsx)(te.ZP,{value:1,children:"\u4E2A\u4EBA"})]})})),(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u5206\u8D26\u8D26\u6237\u540D\u79F0",name:[A,"businessName"],fieldKey:[P,"businessName"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u8D26\u6237\u540D\u79F0"}],children:(0,e.jsx)(D.Z,{placeholder:"\u5206\u8D26\u8D26\u6237\u540D\u79F0"})})),(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u5206\u8D26\u8D26\u6237\u53F7",name:[A,"businessId"],fieldKey:[P,"businessId"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u8D26\u6237\u53F7"}],children:(0,e.jsx)(D.Z,{placeholder:"\u5206\u8D26\u8D26\u6237\u53F7",style:{width:250}})})),(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{name:[A,"orderType"],fieldKey:[P,"orderType"],label:"\u8BA2\u5355\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{style:{width:120},children:(0,e.jsxs)(r,{children:[(0,e.jsx)(F.Z.Option,{value:0,children:"\u4E3B\u8BA2\u5355"}),(0,e.jsx)(F.Z.Option,{value:1,children:"\u5B50\u8BA2\u5355"})]})})})),(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{name:[A,"splitType"],fieldKey:[P,"splitType"],label:"\u5206\u8D26\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{style:{width:120},children:(0,e.jsxs)(r,{children:[(0,e.jsx)(F.Z.Option,{value:0,children:"\u6BD4\u4F8B\u5206\u8D26"}),(0,e.jsx)(F.Z.Option,{value:1,children:"\u56FA\u5B9A\u91D1\u989D"})]})})})),(0,e.jsx)(h.Z.Item,{noStyle:!0,shouldUpdate:function(B,b){var $,K,z;return(B==null||($=B.businessList[O])===null||$===void 0?void 0:$.splitType)!=null||(B==null||(K=B.businessList[O])===null||K===void 0?void 0:K.splitType)!==(b==null||(z=b.businessList[O])===null||z===void 0?void 0:z.splitType)},children:function(B){var b,$=B.getFieldValue;return((b=$("businessList")[O])===null||b===void 0?void 0:b.splitType)!="1"?(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u5206\u8D26\u6BD4\u4F8B",name:[A,"proportion"],fieldKey:[P,"proportion"],rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u6BD4\u4F8B"}],children:(0,e.jsx)(Ee.Z,{step:.1,min:0,max:1,precision:2,style:{width:150}})})):(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u56FA\u5B9A\u91D1\u989D",name:[A,"fixedMoney"],fieldKey:[P,"fixedMoney"],rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u56FA\u5B9A\u91D1\u989D"}],children:(0,e.jsx)(D.Z,{placeholder:"\u56FA\u5B9A\u91D1\u989D",style:{width:150}})}))}}),(0,e.jsx)(h.Z.Item,(0,i.Z)((0,i.Z)({},E),{},{label:"\u5206\u8D26\u63CF\u8FF0",name:[A,"remark"],fieldKey:[P,"remark"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u63CF\u8FF0"}],children:(0,e.jsx)(D.Z,{placeholder:"\u5206\u8D26\u63CF\u8FF0"})})),(0,e.jsx)(Ie.Z,{onClick:function(){return de(A)}})]},O)}),(0,e.jsx)(h.Z.Item,{children:(0,e.jsx)(G.Z,{type:"dashed",onClick:function(){return oe()},block:!0,icon:(0,e.jsx)(fe.Z,{}),children:"\u6DFB\u52A0"})})]})}})}),(0,e.jsx)(h.Z.Item,{name:"planId",label:"\u5206\u8D26\u65B9\u6848",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{children:l.planArray.map(function(j,U){return(0,e.jsx)(F.Z.Option,{index:U,value:j.id,children:j.text},j.id)})})}),(0,e.jsx)(h.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!1,max:64}],children:(0,e.jsx)(D.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(h.Z.Item,{children:(0,e.jsx)(G.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Te=be,W=t(48971);function Oe(c){return ne.apply(this,arguments)}function ne(){return ne=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,W.WY)("/kitchen/api/split-account/account-details-page",{method:"Post",data:l}));case 1:case"end":return r.stop()}},c)})),ne.apply(this,arguments)}function Le(c){return re.apply(this,arguments)}function re(){return re=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,W.WY)("/kitchen/api/split-account/split-account-detail",{method:"POST",data:l}));case 1:case"end":return r.stop()}},c)})),re.apply(this,arguments)}function We(c){return ae.apply(this,arguments)}function ae(){return ae=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,W.WY)("/kitchen/api/split-account/account-details",{method:"PUT",data:l}));case 1:case"end":return r.stop()}},c)})),ae.apply(this,arguments)}function Re(c){return ue.apply(this,arguments)}function ue(){return ue=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return console.log(l),r.abrupt("return",(0,W.WY)("/kitchen/api/split-account/account-detail",{method:"DELETE",data:l}));case 2:case"end":return r.stop()}},c)})),ue.apply(this,arguments)}function $e(c){return se.apply(this,arguments)}function se(){return se=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,W.WY)("\u200B/kitchen/api\u200B/store-info\u200B/store-info-page",{method:"POST",data:l}));case 1:case"end":return r.stop()}},c)})),se.apply(this,arguments)}function we(c,l){return le.apply(this,arguments)}function le(){return le=(0,g.Z)(n().mark(function c(l,S){return n().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return j.abrupt("return",(0,W.WY)("/kitchen/api/split-business/business/".concat(l,"/").concat(S),{method:"GET"}));case 1:case"end":return j.stop()}},c)})),le.apply(this,arguments)}function Ke(c){return ie.apply(this,arguments)}function ie(){return ie=(0,g.Z)(n().mark(function c(l){return n().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,W.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,i.Z)({},l)}));case 1:case"end":return r.stop()}},c)})),ie.apply(this,arguments)}var Me=t(69918),Ye=function(){var l=(0,x.useState)(),S=(0,f.Z)(l,2),r=S[0],j=S[1],U=(0,x.useState)([]),N=(0,f.Z)(U,2),oe=N[0],de=N[1],R=(0,x.useState)(),O=(0,f.Z)(R,2),A=O[0],P=O[1],E=(0,x.useState)([]),V=(0,f.Z)(E,2),B=V[0],b=V[1],$=(0,x.useState)([]),K=(0,f.Z)($,2),z=K[0],ke=K[1],Ue=(0,x.useState)([]),he=(0,f.Z)(Ue,2),it=he[0],Ne=he[1];(0,x.useEffect)(function(){var s=function(Z){var m=(0,Me.t1)({current:1,pageSize:1e3}).then(function(y){var d={},v=[];y.data.data.forEach(function(T){v.push({text:T.planName,id:T.id}),d[T.id]={text:T.planName}}),de(v),j(d)})},a=function(Z){var m=$e({current:1,pageSize:1e3}).then(function(y){var d={},v=[];y.data.data.forEach(function(T){v.push({text:T.store_Name,id:T.id}),d[T.id]={text:T.store_Name}}),b(v),P(d)})};function u(){Ke().then(function(p){Z(p.data);function Z(d){for(var v in d)d[v].type==2||d[v].type==3?d[v].disabled=!1:d[v].disabled=!0,d[v].children&&Z(d[v].children)}ke(p.data);var m={};y(p.data);function y(d){for(var v in d)m[d[v].disabled]=!0,m[d[v].value]={text:d[v].title},d[v].children&&y(d[v].children)}Ne(m)})}u(),s(),a()},[]);var Ve=(0,x.useState)(!1),pe=(0,f.Z)(Ve,2),ze=pe[0],_=pe[1],Je=(0,x.useState)(!1),me=(0,f.Z)(Je,2),He=me[0],ve=me[1],L=(0,x.useRef)(),Qe=(0,x.useState)(),ye=(0,f.Z)(Qe,2),C=ye[0],J=ye[1],Xe=(0,x.useState)([]),Ze=(0,f.Z)(Xe,2),M=Ze[0],ge=Ze[1];function qe(s){try{return Le(JSON.stringify(s)),o.default.success("\u6DFB\u52A0\u6210\u529F"),L.current.reload(),!0}catch(a){return o.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function _e(s){try{return We(JSON.stringify(s)).then(function(a){a.data?(o.default.success("\u4FEE\u6539\u6210\u529F"),L.current.reload()):o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(a){return o.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function et(){try{return Re(M.map(function(s,a){return s.id})).then(function(s){s.data?o.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),L.current.reload(),!0}catch(s){o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}}function ot(s){try{return removeSingleAccount(s).then(function(a){a.data?(o.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),L.current.reload()):o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),!0}catch(a){o.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}}var xe=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(a,u){return(0,e.jsx)("a",{onClick:function(){J(u),ve(!0)},children:a})}},{title:"\u5E97\u94FA",dataIndex:"storeId",valueEnum:A},{title:"\u5206\u8D26\u65B9\u6848",dataIndex:"planId",valueEnum:r},{title:"\u5907\u6CE8",dataIndex:"remark",valueType:"textarea",hideInSearch:!0},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"dateTime",hideInSearch:!0,renderFormItem:function(a,u,p){var Z=u.defaultRender,m=(0,X.Z)(u,["defaultRender"]),y=p.getFieldValue("state");return"".concat(y)==="0"?!1:"".concat(y)==="3"?(0,e.jsx)(D.Z,(0,i.Z)((0,i.Z)({},m),{},{placeholder:"\u8BF7\u8F93\u5165\u5F02\u5E38\u539F\u56E0\uFF01"})):Z(a)}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(a,u){return[(0,e.jsx)("a",{onClick:function(){we(u.storeId,u.planId).then(function(Z){Z.data&&(_(!0),J(function(){return u.businessList=Z.data,u}))})},children:"\u66F4\u65B0"},"config")]}}];return(0,e.jsxs)(De.ZP,{children:[(0,e.jsx)(Ae.ZP,{headerTitle:"\u5206\u8D26\u8D26\u6237",actionRef:L,rowKey:"id",search:{labelWidth:120},columns:xe,toolBarRender:function(){return[(0,e.jsxs)(G.Z,{type:"primary",onClick:function(){_(!0),J({})},children:[(0,e.jsx)(fe.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var s=(0,g.Z)(n().mark(function a(u){var p,Z;return n().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return p=[],Z=0,y.next=4,Oe(u).then(function(d){p=d.data.data,Z=d.data.total});case 4:return y.abrupt("return",{data:p,success:!0,total:Z});case 5:case"end":return y.stop()}},a)}));return function(a){return s.apply(this,arguments)}}(),rowSelection:{onChange:function(a,u){ge(u)}}}),(M==null?void 0:M.length)>0&&(0,e.jsx)(Se.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:M.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(w.Z,{type:"primary",title:"\u786E\u8BA4\u662F\u5426\u5220\u9664\u9009\u4E2D\u9879\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var a,u;et(M),ge([]),(a=L.current)===null||a===void 0||(u=a.reloadAndRest)===null||u===void 0||u.call(a)},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,e.jsx)(Te,{OrgData:z,planArray:oe,storeArray:B,onFinish:function(){var s=(0,g.Z)(n().mark(function a(u){var p;return n().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(p=!1,!u.id){m.next=7;break}return m.next=4,_e(u);case 4:p=m.sent,m.next=10;break;case 7:return m.next=9,qe(u);case 9:p=m.sent;case 10:p&&(_(!1),L.current&&L.current.reload());case 11:case"end":return m.stop()}},a)}));return function(a){return s.apply(this,arguments)}}(),onCancel:function(){J(void 0),_(!1)},createModalVisible:ze,values:C||{}}),(0,e.jsx)(ee.Z,{width:600,visible:He,onClose:function(){J(void 0),ve(!1)},closable:!1,children:(C==null?void 0:C.name)&&(0,e.jsx)(Ce.ZP,{column:2,title:C==null?void 0:C.name,request:(0,g.Z)(n().mark(function s(){return n().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",{data:C||{}});case 1:case"end":return u.stop()}},s)})),params:{id:C==null?void 0:C.name},columns:xe})})]})},Ge=Ye},69918:function(je,H,t){"use strict";t.d(H,{t1:function(){return g},n4:function(){return G},Vs:function(){return ce},Wt:function(){return X}});var Y=t(3182),ee=t(94043),I=t.n(ee),w=t(48971);function g(o){return Q.apply(this,arguments)}function Q(){return Q=(0,Y.Z)(I().mark(function o(f){return I().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,w.WY)("/kitchen/api/split-plan/split-plan-page",{method:"Post",data:f}));case 1:case"end":return n.stop()}},o)})),Q.apply(this,arguments)}function G(o){return i.apply(this,arguments)}function i(){return i=(0,Y.Z)(I().mark(function o(f){return I().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,w.WY)("/kitchen/api/split-plan/split-plan",{method:"POST",data:f}));case 1:case"end":return n.stop()}},o)})),i.apply(this,arguments)}function ce(o){return D.apply(this,arguments)}function D(){return D=(0,Y.Z)(I().mark(function o(f){return I().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,w.WY)("/kitchen/api/split-plan/split-plan",{method:"PUT",data:f}));case 1:case"end":return n.stop()}},o)})),D.apply(this,arguments)}function X(o){return q.apply(this,arguments)}function q(){return q=(0,Y.Z)(I().mark(function o(f){return I().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(f),n.abrupt("return",(0,w.WY)("/kitchen/api/split-plan/split-plan",{method:"DELETE",data:f}));case 2:case"end":return n.stop()}},o)})),q.apply(this,arguments)}}}]);
|