Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

2 строки
14 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2482],{25632:function(we,_,a){"use strict";a.r(_),a.d(_,{default:function(){return be}});var $e=a(57338),se=a(273),s=a(39428),v=a(3182),Re=a(57663),Y=a(71577),d=a(11849),Oe=a(47673),T=a(4107),ee=a(93224),Ge=a(34792),y=a(48086),k=a(2824),ne=a(49101),B=a(67294),le=a(78009),ie=a(16894),de=a(12826),Ye=a(71194),ce=a(50146),Ke=a(49111),oe=a(19650),Le=a(88983),K=a(47933),Me=a(77883),L=a(85986),We=a(9715),l=a(71257),Ve=a(14965),pe=a(91774),Ne=a(43358),g=a(34041),he=a(59465),me=a(30381),te=a.n(me),e=a(85893),fe=["key","name","fieldKey"],ve=function(u){var Z=g.Z.Option,n=g.Z.OptGroup,X=pe.Z.RangePicker,w=[];return u.values&&(w.push(u.values.planStartTime),w.push(u.values.planEndTime)),u.values.planDate=w,(0,e.jsx)(ce.Z,{title:u.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:1200,visible:u.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){u.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(l.Z,{layout:"Horizontal",labelCol:{span:2},preserve:!1,initialValues:u.values,onFinish:u.onFinish,children:[(0,e.jsx)(l.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(T.Z,{})}),(0,e.jsx)(l.Z.Item,{name:"planName",label:"\u65B9\u6848\u540D\u79F0",rules:[{required:!0,max:20}],children:(0,e.jsx)(T.Z,{placeholder:"\u65B9\u6848\u540D\u79F0"})}),(0,e.jsx)(l.Z.Item,{name:"planDate",label:"\u9009\u62E9\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(X,{showTime:!0,format:"YYYY-MM-DD HH:mm:ss"})}),(0,e.jsx)(l.Z.Item,{name:"serviceFee",label:"\u670D\u52A1\u8D39\u6BD4\u4F8B",children:(0,e.jsx)(L.Z,{step:.01,min:0,max:1,defaultValue:.06,precision:2})}),(0,e.jsx)(l.Z.Item,{name:"accountDay",label:"\u8D26\u671F\u65F6\u95F4",children:(0,e.jsx)(L.Z,{step:1,min:1,max:7,defaultValue:1,precision:2})}),(0,e.jsx)(l.Z.Item,{name:"franchiseeId",label:"\u9009\u62E9\u52A0\u76DF\u5546",rules:[{required:!0}],children:(0,e.jsxs)(g.Z,{disabled:!!u.values.id,children:[" ",u.Company.map(function(b,$){return(0,e.jsx)(g.Z.Option,{index:$,value:b.id,children:b.text},b.id)})]})}),(0,e.jsx)(l.Z.Item,{label:"\u5206\u8D26\u8D26\u6237",children:(0,e.jsx)(l.Z.List,{name:"businessList",children:function($,O){var q=O.add,G=O.remove;return(0,e.jsxs)(e.Fragment,{children:[$.map(function(E){var C=E.key,x=E.name,j=E.fieldKey,D=(0,ee.Z)(E,fe);return(0,e.jsxs)(oe.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u5206\u8D26\u8D26\u6237\u7C7B\u522B",name:[x,"accountType"],fieldKey:[j,"accountType"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5206\u8D26\u8D26\u6237\u7C7B\u522B"}],children:(0,e.jsxs)(K.ZP.Group,{children:[(0,e.jsx)(K.ZP,{value:0,children:"\u5546\u6237"}),(0,e.jsx)(K.ZP,{value:1,children:"\u4E2A\u4EBA"})]})})),(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u5206\u8D26\u8D26\u6237\u540D\u79F0",name:[x,"businessName"],fieldKey:[j,"businessName"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u8D26\u6237\u540D\u79F0"}],children:(0,e.jsx)(T.Z,{placeholder:"\u5206\u8D26\u8D26\u6237\u540D\u79F0"})})),(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u5206\u8D26\u8D26\u6237\u53F7",name:[x,"businessId"],fieldKey:[j,"businessId"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u8D26\u6237\u53F7"}],children:(0,e.jsx)(T.Z,{placeholder:"\u5206\u8D26\u8D26\u6237\u53F7",style:{width:250}})})),(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{name:[x,"orderType"],fieldKey:[j,"orderType"],label:"\u8BA2\u5355\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(g.Z,{style:{width:120},children:(0,e.jsxs)(n,{children:[(0,e.jsx)(g.Z.Option,{value:0,children:"\u4E3B\u8BA2\u5355"}),(0,e.jsx)(g.Z.Option,{value:1,children:"\u5B50\u8BA2\u5355"})]})})})),(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{name:[x,"splitType"],fieldKey:[j,"splitType"],label:"\u5206\u8D26\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(g.Z,{style:{width:120},children:(0,e.jsxs)(n,{children:[(0,e.jsx)(g.Z.Option,{value:0,children:"\u6BD4\u4F8B\u5206\u8D26"}),(0,e.jsx)(g.Z.Option,{value:1,children:"\u56FA\u5B9A\u91D1\u989D"})]})})})),(0,e.jsx)(l.Z.Item,{noStyle:!0,shouldUpdate:function(c,F){var P,m,I;return(c==null||(P=c.businessList[C])===null||P===void 0?void 0:P.splitType)!=null||(c==null||(m=c.businessList[C])===null||m===void 0?void 0:m.splitType)!==(F==null||(I=F.businessList[C])===null||I===void 0?void 0:I.splitType)},children:function(c){var F,P=c.getFieldValue;return((F=P("businessList")[C])===null||F===void 0?void 0:F.splitType)!="1"?(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u5206\u8D26\u6BD4\u4F8B",name:[x,"proportion"],fieldKey:[j,"proportion"],rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u6BD4\u4F8B"}],children:(0,e.jsx)(L.Z,{step:.1,min:0,max:1,precision:2,style:{width:150}})})):(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u56FA\u5B9A\u91D1\u989D",name:[x,"fixedMoney"],fieldKey:[j,"fixedMoney"],rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u56FA\u5B9A\u91D1\u989D"}],children:(0,e.jsx)(T.Z,{placeholder:"\u56FA\u5B9A\u91D1\u989D",style:{width:150}})}))}}),(0,e.jsx)(l.Z.Item,(0,d.Z)((0,d.Z)({},D),{},{label:"\u5206\u8D26\u63CF\u8FF0",name:[x,"remark"],fieldKey:[j,"remark"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u8D26\u63CF\u8FF0"}],children:(0,e.jsx)(T.Z,{placeholder:"\u5206\u8D26\u63CF\u8FF0"})})),(0,e.jsx)(he.Z,{onClick:function(){return G(x)}})]},C)}),(0,e.jsx)(l.Z.Item,{children:(0,e.jsx)(Y.Z,{type:"dashed",onClick:function(){return q()},block:!0,icon:(0,e.jsx)(ne.Z,{}),children:"\u6DFB\u52A0"})})]})}})}),(0,e.jsx)(l.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!1,max:64}],children:(0,e.jsx)(T.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(l.Z.Item,{children:(0,e.jsx)(Y.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Ze=ve,S=a(48971);function ye(r){return M.apply(this,arguments)}function M(){return M=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/select/GetCompany"));case 1:case"end":return n.stop()}},r)})),M.apply(this,arguments)}function xe(r){return W.apply(this,arguments)}function W(){return W=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/GetPage",{method:"Post",data:u}));case 1:case"end":return n.stop()}},r)})),W.apply(this,arguments)}function je(r){return V.apply(this,arguments)}function V(){return V=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Add",{method:"Post",data:u}));case 1:case"end":return n.stop()}},r)})),V.apply(this,arguments)}function ge(r){return N.apply(this,arguments)}function N(){return N=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Update",{method:"Post",data:u}));case 1:case"end":return n.stop()}},r)})),N.apply(this,arguments)}function Ce(r){return U.apply(this,arguments)}function U(){return U=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Enable?Id=".concat(u)));case 1:case"end":return n.stop()}},r)})),U.apply(this,arguments)}function De(r){return H.apply(this,arguments)}function H(){return H=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Stop?Id=".concat(u)));case 1:case"end":return n.stop()}},r)})),H.apply(this,arguments)}function Se(r){return J.apply(this,arguments)}function J(){return J=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Copy?Id=".concat(u)));case 1:case"end":return n.stop()}},r)})),J.apply(this,arguments)}function Fe(r){return z.apply(this,arguments)}function z(){return z=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/Stop?Id=".concat(u)));case 1:case"end":return n.stop()}},r)})),z.apply(this,arguments)}function Ie(r){return Q.apply(this,arguments)}function Q(){return Q=(0,v.Z)((0,s.Z)().mark(function r(u){return(0,s.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,S.WY)("/kitchen/api/SplitPlan/BusinessList?Id=".concat(u),{method:"GET"}));case 1:case"end":return n.stop()}},r)})),Q.apply(this,arguments)}var Te=["defaultRender"],Be=function(){var u=(0,B.useState)(),Z=(0,k.Z)(u,2),n=Z[0],X=Z[1],w=(0,B.useState)([]),b=(0,k.Z)(w,2),$=b[0],O=b[1];(0,B.useEffect)(function(){var o=function(){var t=[];ye().then(function(i){X(i.data);for(var f in i.data)t.push({id:f.toString(),text:i.data[f.toString()]})}),O(t)};o()},[]);var q=(0,B.useState)(!1),G=(0,k.Z)(q,2),E=G[0],C=G[1],x=(0,B.useState)(!1),j=(0,k.Z)(x,2),D=j[0],R=j[1],c=(0,B.useRef)(),F=(0,B.useState)(),P=(0,k.Z)(F,2),m=P[0],I=P[1],Pe=(0,B.useState)([]),ae=(0,k.Z)(Pe,2),Ue=ae[0],Ae=ae[1];function Ee(o){y.default.loading("\u6B63\u5728\u6DFB\u52A0");try{return je(JSON.stringify(o)),y.default.success("\u6DFB\u52A0\u6210\u529F"),c.current.reload(),!0}catch(p){return y.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function ke(o){try{return ge(JSON.stringify(o)).then(function(p){p.data?(y.default.success("\u914D\u7F6E\u6210\u529F"),c.current.reload()):y.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(p){return y.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}var ue=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(p,t){return(0,e.jsx)("a",{onClick:function(){I(t),R(!0)},children:p})}},{title:"\u5206\u8D26\u65B9\u6848\u540D\u79F0",dataIndex:"planName",valueType:"textarea"},{title:"\u5F00\u59CB\u65F6\u95F4",hideInSearch:!0,dataIndex:"planStartTime",valueType:"dateTime"},{title:"\u7ED3\u675F\u65F6\u95F4",hideInSearch:!0,dataIndex:"planEndTime",valueType:"dateTime"},{title:"\u670D\u52A1\u8D39\u6BD4\u4F8B",dataIndex:"serviceFee",valueType:"textarea",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u6B63\u5E38"},1:{text:"\u505C\u7528"},2:{text:"\u7981\u7528"}}},{title:"\u52A0\u76DF\u5546",width:80,dataIndex:"franchiseeId",hideInSearch:!0,valueEnum:n},{title:"\u5907\u6CE8",dataIndex:"remark",valueType:"textarea",hideInSearch:!0},{title:"\u521B\u5EFA\u65F6\u95F4",sorter:!0,dataIndex:"createAt",valueType:"dateTime",hideInSearch:!0,renderFormItem:function(p,t,i){var f=t.defaultRender,h=(0,ee.Z)(t,Te),A=i.getFieldValue("state");return"".concat(A)==="0"?!1:"".concat(A)==="3"?(0,e.jsx)(T.Z,(0,d.Z)((0,d.Z)({},h),{},{placeholder:"\u8BF7\u8F93\u5165\u5F02\u5E38\u539F\u56E0\uFF01"})):f(p)}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(p,t){var i=[];return t.status!=2&&i.push((0,e.jsx)("a",{onClick:function(){Ie(t.id).then(function(h){h.data&&I(function(){return C(!0),t.planStartTime!=null&&(t.planStartTime=te()(t.planStartTime),t.planEndTime=te()(t.planEndTime)),t.businessList=h.data,t})})},children:"\u66F4\u65B0"},"config"),(0,e.jsx)("a",{onClick:function(){Fe(t.id),y.default.success("\u7981\u7528\u5206\u8D26"),c.current.reload()},children:"\u5220\u9664"},"config")),t.status==1&&i.push((0,e.jsx)("a",{onClick:function(){var h=Ce(t.id);h?y.default.success("\u542F\u7528\u6210\u529F"):y.default.success("\u542F\u7528\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u65B9\u6848\u8BBE\u7F6E\uFF01"),c.current.reload()},children:"\u542F\u7528"},"config")),t.status==0&&i.push((0,e.jsx)("a",{onClick:function(){De(t.id),y.default.success("\u505C\u7528\u6210\u529F"),c.current.reload()},children:"\u505C\u7528"},"config")),i.push((0,e.jsx)("a",{onClick:function(){Se(t.id),y.default.success("\u590D\u5236\u6210\u529F"),c.current.reload()},children:"\u590D\u5236"},"config")),i}}];return(0,e.jsxs)(le.ZP,{children:[(0,e.jsx)(ie.ZP,{headerTitle:"\u5206\u8D26\u65B9\u6848",actionRef:c,rowKey:"id",search:{labelWidth:120},columns:ue,toolBarRender:function(){return[(0,e.jsxs)(Y.Z,{type:"primary",onClick:function(){C(!0),I({})},children:[(0,e.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var o=(0,v.Z)((0,s.Z)().mark(function p(t){var i,f;return(0,s.Z)().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i=[],f=0,A.next=4,xe(t).then(function(re){i=re.data.data,f=re.data.total});case 4:return A.abrupt("return",{data:i,success:!0,total:f});case 5:case"end":return A.stop()}},p)}));return function(p){return o.apply(this,arguments)}}(),rowSelection:{onChange:function(p,t){Ae(t)}}}),(0,e.jsx)(Ze,{Company:$,onFinish:function(){var o=(0,v.Z)((0,s.Z)().mark(function p(t){var i;return(0,s.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t.planStartTime=new Date(t.planDate[0]),t.planEndTime=new Date(t.planDate[1]),i=!1,!t.id){h.next=9;break}return h.next=6,ke(t);case 6:i=h.sent,h.next=12;break;case 9:return h.next=11,Ee(t);case 11:i=h.sent;case 12:i&&(C(!1),c.current&&c.current.reload());case 13:case"end":return h.stop()}},p)}));return function(p){return o.apply(this,arguments)}}(),onCancel:function(){I(void 0),C(!1)},createModalVisible:E,values:m||{}}),(0,e.jsx)(se.Z,{width:600,visible:D,onClose:function(){I(void 0),R(!1)},closable:!1,children:(m==null?void 0:m.name)&&(0,e.jsx)(de.ZP,{column:2,title:m==null?void 0:m.name,request:(0,v.Z)((0,s.Z)().mark(function o(){return(0,s.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:m||{}});case 1:case"end":return t.stop()}},o)})),params:{id:m==null?void 0:m.name},columns:ue})})]})},be=Be}}]);