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