包含后厨 团餐 门店分支
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 regels
14 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9976],{29425:function(Ae,_,r){"use strict";r.r(_),r.d(_,{default:function(){return Ie}});var Te=r(57338),re=r(83107),Ce=r(62350),ne=r(24565),o=r(39428),F=r(3182),Ee=r(57663),B=r(71577),De=r(34792),h=r(48086),S=r(2824),ue=r(49101),j=r(67294),se=r(28790),le=r(85224),ie=r(16894),de=r(12826),Re=r(71194),oe=r(50146),ee=r(11849),Ue=r(77883),ce=r(21888),Oe=r(43185),C=r(93349),Pe=r(47673),R=r(4107),Ye=r(14965),me=r(34895),Le=r(9715),d=r(55843),$e=r(43358),Z=r(34041),he=r(84391),E=r(48971),we=r(65754),e=r(85893),fe=function(u){var v=Z.Z.Option,n=Z.Z.OptGroup,U=d.Z.useForm(),K=(0,S.Z)(U,1),A=K[0],Q=(0,j.useState)(),Y=(0,S.Z)(Q,2),y=Y[0],X=Y[1],G=(0,j.useState)(),p=(0,S.Z)(G,2),O=p[0],te=p[1],M=me.Z.RangePicker,D=R.Z.TextArea,P=[];u.values&&(P.push(u.values.startTime),P.push(u.values.endTime)),u.values.planDate=P;function k(c){X(c)}function L(c){var t=(0,E.WY)("/kitchen/api/Upload/DeleteFile?fileUrl=".concat(c),{method:"post"})}var T=[];u.values.imageUrl&&(T=u.values.imageUrl);var q={beforeUpload:function(t){var f=A.getFieldValue("storeId");if(typeof f=="undefined")return h.default.error("\u8BF7\u9009\u62E9\u5E97\u94FA!"),C.Z.LIST_IGNORE;var I=A.getFieldValue("type");if(I==0){var s=t.type==="image/jpeg"||t.type==="image/png"||t.type==="image/jpg";if(!s)return h.default.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u683C\u5F0F\u6587\u4EF6!"),C.Z.LIST_IGNORE;var l=t.size/1024/1024<4;return l?!0:(h.default.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E4MB!"),C.Z.LIST_IGNORE)}else if(I==1){var a=t.type==="video/mp4"||t.type==="video/rmvb"||t.type==="video/avi"||t.type==="video/m4v";if(!a)return h.default.error("\u8BF7\u4E0A\u4F20\u89C6\u9891\u683C\u5F0F\u6587\u4EF6!"),C.Z.LIST_IGNORE;var m=t.size/1024/1024<100;return m?!0:(h.default.error("\u89C6\u9891\u4E0D\u80FD\u5927\u4E8E100MB!"),C.Z.LIST_IGNORE)}else return h.default.error("\u8BF7\u9009\u62E9\u5E7F\u544A\u7C7B\u578B!"),C.Z.LIST_IGNORE},name:"file",action:"/storemanage/api/Upload/FormImg?storeId=".concat(typeof y=="undefined"?u.values.storeId:y),headers:{authorization:"authorization-text"},showUploadList:{showPreviewIcon:!1},listType:"picture-card",multiple:!0,maxCount:10,onChange:function(t){t.file.status!=="uploading"&&console.log(t.file,t.fileList),t.file.status==="done"?t.file.response.isSuccess?(t.file.response.msg==="mv"?A.setFieldsValue({videoUrl:t.file.response.data[0]}):(T.push({name:t.file.response.data[0]}),A.setFieldsValue({imageUrl:T})),h.default.success("".concat(t.file.name," \u4E0A\u4F20\u6210\u529F"))):h.default.error(t.file.response.msg):t.file.status==="error"&&h.default.error("".concat(t.file.name," \u4E0A\u4F20\u5931\u8D25"))},onRemove:function(t){var f="";typeof t.response=="undefined"?(L(t.name),f=t.name):(L(t.response.data[0]),f=t.response.data[0]);for(var I=0,s=Object.entries(T);I<s.length;I++){var l=s[I],a=(0,S.Z)(l,2),m=a[0],x=a[1];x.name==f&&delete T[m]}},onPreview:function(t){},defaultFileList:u.values.imageUrl?u.values.imageUrl:null};return(0,e.jsx)(oe.Z,{title:u.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:700,visible:u.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){u.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(d.Z,{form:A,layout:"Horizontal",preserve:!1,initialValues:u.values,onFinish:u.onFinish,children:[(0,e.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(R.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"storeId",label:"\u9009\u62E9\u5E97\u94FA",rules:[{required:!1}],children:(0,e.jsx)(Z.Z,{disabled:!!u.values.id,onChange:k,children:u.storeArray.map(function(c,t){return(0,e.jsx)(Z.Z.Option,{index:t,value:c.id,children:c.text},c.id)})})}),(0,e.jsx)(d.Z.Item,{name:"title",label:"\u5E7F\u544A\u6807\u9898",rules:[{required:!1,max:20,whitespace:!0}],children:(0,e.jsx)(R.Z,{placeholder:"\u5E7F\u544A\u6807\u9898"})}),(0,e.jsx)(d.Z.Item,{name:"planDate",label:"\u9009\u62E9\u65F6\u95F4",rules:[{required:!1}],children:(0,e.jsx)(M,{showTime:!0,format:"YYYY-MM-DD HH:mm:ss",style:{width:550}})}),(0,e.jsx)(d.Z.Item,{name:"type",label:"\u5E7F\u544A\u7C7B\u578B",children:(0,e.jsx)(Z.Z,{children:(0,e.jsxs)(n,{children:[(0,e.jsx)(Z.Z.Option,{value:0,children:"\u56FE\u7247"}),(0,e.jsx)(Z.Z.Option,{value:1,children:"\u89C6\u9891"})]})})}),(0,e.jsx)(d.Z.Item,{noStyle:!0,shouldUpdate:function(t,f){return t.type!==f.type},children:function(t){var f=t.getFieldValue;return f("type")=="1"?(0,e.jsx)(d.Z.Item,{hidden:!0}):(0,e.jsx)(d.Z.Item,{style:{height:32},children:(0,e.jsx)(d.Z.Item,{label:"\u8F6E\u64AD\u95F4\u9694",name:"step",rules:[{required:!1,message:"\u56FE\u7247\u8F6E\u64AD\u65F6\u95F4\u95F4\u9694"}],children:(0,e.jsx)(ce.Z,{min:1,max:10,style:{width:250}})})})}}),(0,e.jsx)(d.Z.Item,{name:"uploadType",label:"\u4E0A\u4F20\u65B9\u5F0F",children:(0,e.jsx)(Z.Z,{children:(0,e.jsxs)(n,{children:[(0,e.jsx)(Z.Z.Option,{value:0,children:"\u81EA\u5B9A\u4E49\u4E0A\u4F20"}),(0,e.jsx)(Z.Z.Option,{value:1,children:"\u7F51\u7EDC\u8DEF\u5F84"})]})})}),(0,e.jsx)(d.Z.Item,{noStyle:!0,shouldUpdate:function(t,f){return t.uploadType!==f.uploadType},children:function(t){var f=t.getFieldValue;return f("uploadType")=="1"?(0,e.jsx)(d.Z.Item,{name:"netWorkUrl",label:"\u7F51\u7EDC\u8DEF\u5F84",children:(0,e.jsx)(R.Z,{placeholder:"\u7F51\u7EDC\u8DEF\u5F84"})}):(0,e.jsx)(d.Z.Item,{style:{height:100},children:(0,e.jsx)(C.Z,(0,ee.Z)((0,ee.Z)({},q),{},{children:(0,e.jsx)(B.Z,{icon:(0,e.jsx)(he.Z,{}),children:"\u4E0A\u4F20"})}))})}}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)("span",{style:{color:"#FF0000",marginLeft:70},children:"\u6CE8: \u7F51\u7EDC\u8DEF\u5F84\u4E0A\u4F20\u56FE\u7247\u65F6\uFF0C\u591A\u5F20\u56FE\u7247\u89C4\u5219\u8BF7\u7528 \xA0|\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx.jpg|2.xxxxxx.jpg"})}),(0,e.jsx)(d.Z.Item,{name:"imageUrl",label:"\u56FE\u7247\u5730\u5740",hidden:!0,children:(0,e.jsx)(R.Z,{placeholder:"\u56FE\u7247\u5730\u5740"})}),(0,e.jsx)(d.Z.Item,{name:"videoUrl",label:"\u89C6\u9891\u5730\u5740",hidden:!0,children:(0,e.jsx)(R.Z,{placeholder:"\u89C6\u9891\u5730\u5740"})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(B.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},ve=fe,pe=r(30381),w=r.n(pe);function xe(){return V.apply(this,arguments)}function V(){return V=(0,F.Z)((0,o.Z)().mark(function i(){return(0,o.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.abrupt("return",(0,E.WY)("/storemanagement/api/shop/alllist",{method:"GET"}));case 1:case"end":return v.stop()}},i)})),V.apply(this,arguments)}function ye(i){return H.apply(this,arguments)}function H(){return H=(0,F.Z)((0,o.Z)().mark(function i(u){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,E.WY)("/storemanagement/api/StoreAdvertisement/GetStoreAdvertisementPage",{method:"Post",data:u}));case 1:case"end":return n.stop()}},i)})),H.apply(this,arguments)}function Ze(i){return W.apply(this,arguments)}function W(){return W=(0,F.Z)((0,o.Z)().mark(function i(u){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,E.WY)("/storemanagement/api/StoreAdvertisement/AddStoreAdvertisement",{method:"POST",data:u}));case 1:case"end":return n.stop()}},i)})),W.apply(this,arguments)}function ge(i){return N.apply(this,arguments)}function N(){return N=(0,F.Z)((0,o.Z)().mark(function i(u){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,E.WY)("/storemanagement/api/StoreAdvertisement/UpdateStoreAdvertisement",{method:"PUT",data:u}));case 1:case"end":return n.stop()}},i)})),N.apply(this,arguments)}function Fe(i){return b.apply(this,arguments)}function b(){return b=(0,F.Z)((0,o.Z)().mark(function i(u){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,E.WY)("/storemanagement/api/StoreAdvertisement/DelStoreAdvertisement",{method:"DELETE",data:u}));case 1:case"end":return n.stop()}},i)})),b.apply(this,arguments)}function Se(i){return z.apply(this,arguments)}function z(){return z=(0,F.Z)((0,o.Z)().mark(function i(u){return(0,o.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,E.WY)("/storemanagement/api/StoreAdvertisement/UpdateStoreAdvertisementStatus",{method:"POST",data:u}));case 1:case"end":return n.stop()}},i)})),z.apply(this,arguments)}function Ge(i){return J.apply(this,arguments)}function J(){return J=_asyncToGenerator(_regeneratorRuntime().mark(function i(u){return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",request("/storemanagement/api/StoreAdvertisement/QueryStoreAdvertisementURL",{method:"POST",data:u}));case 1:case"end":return n.stop()}},i)})),J.apply(this,arguments)}var je=function(){var u=(0,j.useState)(!1),v=(0,S.Z)(u,2),n=v[0],U=v[1],K=(0,j.useState)(!1),A=(0,S.Z)(K,2),Q=A[0],Y=A[1],y=(0,j.useRef)(),X=(0,j.useState)(),G=(0,S.Z)(X,2),p=G[0],O=G[1],te=(0,j.useState)([]),M=(0,S.Z)(te,2),D=M[0],P=M[1],k=(0,j.useState)([]),L=(0,S.Z)(k,2),T=L[0],q=L[1];(0,j.useEffect)(function(){var s=xe().then(function(l){var a,m=[];(a=l.data)===null||a===void 0||a.forEach(function(x){m.push({id:x.id,text:x.name,value:x.id,label:x.name})}),q(m)})},[]);function c(s){try{return Ze(JSON.stringify(s)),h.default.success("\u6DFB\u52A0\u6210\u529F"),y.current.reload(),!0}catch(l){return h.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function t(s){try{return ge(JSON.stringify(s)).then(function(l){l.data?(h.default.success("\u4FEE\u6539\u6210\u529F"),y.current.reload()):h.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(l){return h.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function f(){try{return Fe(D.map(function(s,l){return s.id})).then(function(s){s.data?h.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),y.current.reload(),!0}catch(s){h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}}var I=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(l,a){return(0,e.jsx)("a",{onClick:function(){O(a),Y(!0)},children:l})}},{title:"\u5E97\u94FA",dataIndex:"storeId",valueType:"select",fieldProps:{options:T}},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"type",valueEnum:{0:{text:"\u56FE\u7247"},1:{text:"\u89C6\u9891"}},hideInSearch:!0},{title:"\u4E0A\u4F20\u65B9\u5F0F",dataIndex:"uploadType",valueEnum:{0:{text:"\u81EA\u5B9A\u4E49\u4E0A\u4F20"},1:{text:"\u7F51\u7EDC\u8DEF\u5F84"}},hideInSearch:!0},{title:"\u5E7F\u544A\u6807\u9898",dataIndex:"title",valueType:"textarea"},{title:"\u8F6E\u64AD\u95F4\u9694\uFF08\u79D2\uFF09",dataIndex:"step",valueType:"textarea",hideInSearch:!0},{title:"\u5F00\u59CB\u65F6\u95F4",hideInSearch:!0,dataIndex:"startTime",valueType:"dateTime"},{title:"\u7ED3\u675F\u65F6\u95F4",hideInSearch:!0,dataIndex:"endTime",valueType:"dateTime"},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,hideInSearch:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"textarea",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:150,render:function(l,a){return[(0,e.jsx)("a",{onClick:function(){U(!0),O(function(){return a.startTime!=null&&(a.startTime=w()(a.startTime),a.endTime=w()(a.endTime)),a})},children:"\u66F4\u65B0"},"config"),(0,e.jsxs)("a",{onClick:function(){a.status=a.status==0?1:0,Se(a).then(function(x){x.data&&y.current.reload()})},children:[" ",a.status==0?"\u505C\u7528":"\u542F\u7528"]},"primary")]}}];return(0,e.jsxs)(se.ZP,{header:{title:"",breadcrumb:{}},children:[(0,e.jsx)(ie.ZP,{pagination:{pageSize:10},scroll:{x:1300},headerTitle:"\u5E7F\u544A\u5217\u8868",actionRef:y,rowKey:"id",search:{labelWidth:120},columns:I,toolBarRender:function(){return[(0,e.jsxs)(B.Z,{type:"primary",onClick:function(){U(!0),O({})},children:[(0,e.jsx)(ue.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var s=(0,F.Z)((0,o.Z)().mark(function l(a){var m,x;return(0,o.Z)().wrap(function($){for(;;)switch($.prev=$.next){case 0:return m=[],x=0,$.next=4,ye(a).then(function(ae){m=ae.data.data,x=ae.data.total});case 4:return $.abrupt("return",{data:m,success:!0,total:x});case 5:case"end":return $.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),rowSelection:{onChange:function(l,a){P(a)}}}),(D==null?void 0:D.length)>0&&(0,e.jsx)(le.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:D.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(ne.Z,{type:"primary",title:"\u786E\u8BA4\u662F\u5426\u5220\u9664\u9009\u4E2D\u9879\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var l,a;f(D),P([]),(l=y.current)===null||l===void 0||(a=l.reloadAndRest)===null||a===void 0||a.call(l)},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,e.jsx)(ve,{storeArray:T,onFinish:function(){var s=(0,F.Z)((0,o.Z)().mark(function l(a){var m;return(0,o.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(m=!1,a.startTime=w()(a.planDate[0]).format("YYYY-MM-DD HH:mm:ss"),a.endTime=w()(a.planDate[1]).format("YYYY-MM-DD HH:mm:ss"),!a.id){g.next=9;break}return g.next=6,t(a);case 6:m=g.sent,g.next=12;break;case 9:return g.next=11,c(a);case 11:m=g.sent;case 12:m&&(U(!1),y.current&&y.current.reload());case 13:case"end":return g.stop()}},l)}));return function(l){return s.apply(this,arguments)}}(),onCancel:function(){O(void 0),U(!1)},createModalVisible:n,values:p||{}}),(0,e.jsx)(re.Z,{width:600,visible:Q,onClose:function(){O(void 0),Y(!1)},closable:!1,children:(p==null?void 0:p.name)&&(0,e.jsx)(de.ZP,{column:2,title:p==null?void 0:p.name,request:(0,F.Z)((0,o.Z)().mark(function s(){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",{data:p||{}});case 1:case"end":return a.stop()}},s)})),params:{id:p==null?void 0:p.name},columns:I})})]})},Ie=je}}]);