Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

2 rindas
14 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2482],{25632:function(ke,_,t){"use strict";t.r(_),t.d(_,{default:function(){return Be}});var we=t(57338),se=t(25084),v=t(3182),$e=t(57663),Y=t(71577),d=t(11849),Oe=t(47673),T=t(4107),ee=t(93224),Re=t(34792),Z=t(48086),k=t(2824),le=t(94043),s=t.n(le),ne=t(49101),B=t(67294),ie=t(78009),de=t(16894),ce=t(12826),Ge=t(71194),oe=t(50146),Ye=t(49111),pe=t(19650),Ke=t(88983),K=t(47933),Le=t(77883),L=t(85482),Me=t(9715),l=t(86835),We=t(14965),he=t(91774),Ve=t(43358),g=t(34041),me=t(59465),fe=t(30381),te=t.n(fe),e=t(85893),ve=function(u){var y=g.Z.Option,n=g.Z.OptGroup,X=he.Z.RangePicker,w=[];return u.values&&(w.push(u.values.planStartTime),w.push(u.values.planEndTime)),u.values.planDate=w,(0,e.jsx)(oe.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($,R){var q=R.add,G=R.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,["key","name","fieldKey"]);return(0,e.jsxs)(pe.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)(me.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"})})]})})},ye=ve,S=t(48971);function Ze(r){return M.apply(this,arguments)}function M(){return M=(0,v.Z)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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)(s().mark(function r(u){return s().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=function(){var u=(0,B.useState)(),y=(0,k.Z)(u,2),n=y[0],X=y[1],w=(0,B.useState)([]),b=(0,k.Z)(w,2),$=b[0],R=b[1];(0,B.useEffect)(function(){var o=function(){var a=[];Ze().then(function(i){X(i.data);for(var f in i.data)a.push({id:f.toString(),text:i.data[f.toString()]})}),R(a)};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],O=j[1],c=(0,B.useRef)(),F=(0,B.useState)(),P=(0,k.Z)(F,2),m=P[0],I=P[1],be=(0,B.useState)([]),ae=(0,k.Z)(be,2),Ne=ae[0],Pe=ae[1];function Ae(o){Z.default.loading("\u6B63\u5728\u6DFB\u52A0");try{return je(JSON.stringify(o)),Z.default.success("\u6DFB\u52A0\u6210\u529F"),c.current.reload(),!0}catch(p){return Z.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function Ee(o){try{return ge(JSON.stringify(o)).then(function(p){p.data?(Z.default.success("\u914D\u7F6E\u6210\u529F"),c.current.reload()):Z.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(p){return Z.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,a){return(0,e.jsx)("a",{onClick:function(){I(a),O(!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,a,i){var f=a.defaultRender,h=(0,ee.Z)(a,["defaultRender"]),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,a){var i=[];return a.status!=2&&i.push((0,e.jsx)("a",{onClick:function(){Ie(a.id).then(function(h){h.data&&I(function(){return C(!0),a.planStartTime!=null&&(a.planStartTime=te()(a.planStartTime),a.planEndTime=te()(a.planEndTime)),a.businessList=h.data,a})})},children:"\u66F4\u65B0"},"config"),(0,e.jsx)("a",{onClick:function(){Fe(a.id),Z.default.success("\u7981\u7528\u5206\u8D26"),c.current.reload()},children:"\u5220\u9664"},"config")),a.status==1&&i.push((0,e.jsx)("a",{onClick:function(){var h=Ce(a.id);h?Z.default.success("\u542F\u7528\u6210\u529F"):Z.default.success("\u542F\u7528\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u65B9\u6848\u8BBE\u7F6E\uFF01"),c.current.reload()},children:"\u542F\u7528"},"config")),a.status==0&&i.push((0,e.jsx)("a",{onClick:function(){De(a.id),Z.default.success("\u505C\u7528\u6210\u529F"),c.current.reload()},children:"\u505C\u7528"},"config")),i.push((0,e.jsx)("a",{onClick:function(){Se(a.id),Z.default.success("\u590D\u5236\u6210\u529F"),c.current.reload()},children:"\u590D\u5236"},"config")),i}}];return(0,e.jsxs)(ie.ZP,{children:[(0,e.jsx)(de.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)(s().mark(function p(a){var i,f;return s().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return i=[],f=0,A.next=4,xe(a).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,a){Pe(a)}}}),(0,e.jsx)(ye,{Company:$,onFinish:function(){var o=(0,v.Z)(s().mark(function p(a){var i;return s().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(a.planStartTime=new Date(a.planDate[0]),a.planEndTime=new Date(a.planDate[1]),i=!1,!a.id){h.next=9;break}return h.next=6,Ee(a);case 6:i=h.sent,h.next=12;break;case 9:return h.next=11,Ae(a);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),O(!1)},closable:!1,children:(m==null?void 0:m.name)&&(0,e.jsx)(ce.ZP,{column:2,title:m==null?void 0:m.name,request:(0,v.Z)(s().mark(function o(){return s().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",{data:m||{}});case 1:case"end":return a.stop()}},o)})),params:{id:m==null?void 0:m.name},columns:ue})})]})},Be=Te}}]);