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

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4424],{58211:function(Pe,X,n){"use strict";n.r(X),n.d(X,{default:function(){return Fe}});var we=n(71194),q=n(50146),_=n(11849),be=n(57663),O=n(71577),Oe=n(71153),ee=n(60331),Be=n(43185),ae=n(93349),Ge=n(9715),j=n(55843),S=n(2824),o=n(39428),$e=n(34792),c=n(48086),m=n(3182),Z=n(67294),se=n(28790),ue=n(85224),le=n(49101),ie=n(16894),Ie=n(47673),te=n(4107),Ue=n(43358),B=n(34041),D=n(48971);function oe(s){return M.apply(this,arguments)}function M(){return M=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("/saasbase/api/devicevesion/page",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),M.apply(this,arguments)}function de(s){return L.apply(this,arguments)}function L(){return L=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("/saasbase/api/devicevesion/add",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),L.apply(this,arguments)}function ce(s){return W.apply(this,arguments)}function W(){return W=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("\u200B/saasbase/api/devicevesion/delete",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),W.apply(this,arguments)}function fe(s){return k.apply(this,arguments)}function k(){return k=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("\u200B/saasbase/api/devicevesion/update",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),k.apply(this,arguments)}function pe(s){return Y.apply(this,arguments)}function Y(){return Y=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("\u200B/saasbase/api/devicevesion/updatestatus",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),Y.apply(this,arguments)}function Ve(s){return K.apply(this,arguments)}function K(){return K=_asyncToGenerator(_regeneratorRuntime().mark(function s(t){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/saasbase/api/dict-data/dic-list/".concat(t),{method:"Get"}));case 1:case"end":return a.stop()}},s)})),K.apply(this,arguments)}function he(s){return N.apply(this,arguments)}function N(){return N=(0,m.Z)((0,o.Z)().mark(function s(t){return(0,o.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,D.WY)("/saasbase/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:t}));case 1:case"end":return a.stop()}},s)})),N.apply(this,arguments)}var ve=n(9669),me=n.n(ve),r=n(85893),ye=function(t){t.form.setFieldsValue(t.values);var f=B.Z.Option,a=B.Z.OptGroup,u={name:"file",showUploadList:!1,multiple:!1,accept:".xlsx, .xls",headers:{"Content-Type":"application/octet-stream"},customRequest:function(p){var w=p.action,x=p.file,ne=p.headers,z=p.onError,G=p.onProgress,y=p.onSuccess,F=p.withCredentials;console.log("\u4E0A\u4F20\u56FE\u7247",x);var J=x.name.lastIndexOf("."),$=x.name.substr(J+1),C=null;return he({directory:"goods",fileExtension:$,method:"PUT"}).then(function(T){w=T.allUrl;var I=new FileReader;I.readAsArrayBuffer(x),I.onload=function(U){C=U.target.result,me().put(w,C,{withCredentials:F,headers:ne,onUploadProgress:function(A){var H=A.total,V=A.loaded;G({percent:Math.round(V/H*100).toFixed(2)},x)}}).then(function(E){console.log("onSuccess",E,x),(E.status==200||E.statusText=="OK")&&t.form.setFieldsValue({templatePath:T.seeUrl})}).catch(z)}}),{abort:function(){console.log("upload progress is aborted.")}}}};return(0,r.jsx)(q.Z,{title:t.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){t.onCancel()},destroyOnClose:!0,children:(0,r.jsxs)(j.Z,{layout:"vertical",preserve:!1,form:t.form,onFinish:t.onFinish,children:[(0,r.jsx)(j.Z.Item,{name:"id",hidden:!0,children:(0,r.jsx)(te.Z,{})}),(0,r.jsx)(j.Z.Item,{label:"\u7248\u672C\u53F7",name:"vesion",rules:[{required:!0,max:50}],children:(0,r.jsx)(te.Z,{})}),(0,r.jsx)(j.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceTypeKey",rules:[{required:!0,max:50}],children:(0,r.jsx)(B.Z,{children:t.dicData.map(function(i,p){return(0,r.jsx)(B.Z.Option,{index:p,value:i.code,children:i.value},i.code)})})}),(0,r.jsx)(j.Z.Item,{children:(0,r.jsx)(O.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ge=ye,P="message",Ze=function(){var s=(0,m.Z)((0,o.Z)().mark(function t(f){return(0,o.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,c.default.loading("\u6B63\u5728\u6DFB\u52A0",P),u.next=4,de(JSON.stringify(f)).then(function(i){return c.default.destroy(P),i.data?(c.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(c.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:u.next=10;break;case 6:return u.prev=6,u.t0=u.catch(0),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 10:case"end":return u.stop()}},t,null,[[0,6]])}));return function(f){return s.apply(this,arguments)}}(),xe=function(){var s=(0,m.Z)((0,o.Z)().mark(function t(f){return(0,o.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,c.default.loading("\u6B63\u5728\u4FEE\u6539",P),c.default.destroy(P),u.next=5,fe(JSON.stringify(f)).then(function(i){return c.default.destroy(P),i.data?(c.default.success("\u4FEE\u6539\u6210\u529F"),!0):(c.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:u.next=11;break;case 7:return u.prev=7,u.t0=u.catch(0),c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 11:case"end":return u.stop()}},t,null,[[0,7]])}));return function(f){return s.apply(this,arguments)}}(),Ce=function(){var s=(0,m.Z)((0,o.Z)().mark(function t(f){var a;return(0,o.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,c.default.loading("\u6B63\u5728\u5220\u9664"),a=[],f.forEach(function(p){a.push(p.id)}),i.next=6,ce(a).then(function(p){return p.data?(c.default.success("\u5220\u9664\u6210\u529F"),!0):(c.default.error(p.errors),!1)});case 6:i.next=12;break;case 8:return i.prev=8,i.t0=i.catch(0),c.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),i.abrupt("return",!1);case 12:case"end":return i.stop()}},t,null,[[0,8]])}));return function(f){return s.apply(this,arguments)}}(),Se=function(){var t=(0,Z.useState)(!1),f=(0,S.Z)(t,2),a=f[0],u=f[1],i=(0,Z.useRef)(),p=(0,Z.useState)([]),w=(0,S.Z)(p,2),x=w[0],ne=w[1],z=(0,Z.useState)(),G=(0,S.Z)(z,2),y=G[0],F=G[1],J=(0,Z.useState)([]),$=(0,S.Z)(J,2),C=$[0],T=$[1],I=(0,Z.useState)(!1),U=(0,S.Z)(I,2),E=U[0],A=U[1],H=(0,Z.useState)(!1),V=(0,S.Z)(H,2),Ae=V[0],Q=V[1],je=j.Z.useForm(),De=(0,S.Z)(je,1),Te=De[0],Ee={beforeUpload:function(l){return l.type!=="application/vnd.ms-excel"&&l.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&c.default.error("".concat(l.name," \u4E0D\u662F exelce \u6587\u4EF6")),l.type=="application/vnd.ms-excel"||l.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:ae.Z.LIST_IGNORE},name:"file",data:{id:y==null?void 0:y.id,deviceClientType:y==null?void 0:y.deviceTypeKey,version:y==null?void 0:y.vesion,isAddGoodsTemplate:Ae},action:"/saasbase/api/goods/goodstemplateexport",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(l){l.file.status!=="uploading"&&console.log(l.file,l.fileList),Q(!1),l.file.status==="done"?(A(!1),i.current.reload(),c.default.success("".concat(l.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F."))):l.file.status==="error"&&c.default.error("".concat(l.file.name," \u6587\u4EF6\u4E0A\u8F7D\u5931\u8D25."))}},Re=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u7248\u672C\u53F7",dataIndex:"vesion",valueType:"textarea"},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueType:"textarea"},{title:"\u662F\u5426\u5B58\u5728\u6A21\u677F",dataIndex:"templatePath",valueType:"textarea",render:function(l,d){return[(0,r.jsxs)("div",{children:[(0,r.jsx)(ee.Z,{color:"#f50",style:{textAlign:"center",display:d.templatePath==null||d.templatePath==""?"none":"block"},children:"\u5B58\u5728\u6A21\u677F"}),(0,r.jsx)(ee.Z,{style:{textAlign:"center",display:d.templatePath==null||d.templatePath==""?"block":"none"},color:"#2db7f5",children:"\u65E0\u6A21\u677F"})]})]}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(l,d){return[(0,r.jsx)("a",{onClick:function(){u(!0),F(d)},children:" \u66F4\u65B0"},"config"),(0,r.jsxs)("a",{onClick:function(){var g={id:d.id,status:d.status==0?1:0};pe(g).then(function(R){R.succeeded?(c.default.success("\u64CD\u4F5C\u6210\u529F"),i.current.reload()):c.default.error(e.error)})},children:[" ",d.status==0?"\u7981\u7528":"\u542F\u7528"]},"primary"),(0,r.jsx)("a",{onClick:function(){F(d),A(!0),Q(!1)},children:" \u4E0A\u4F20\u8BBE\u5907\u5DE5\u827A\u6A21\u578B"},"config"),(0,r.jsx)("a",{onClick:function(){F(d),A(!0),Q(!0)},children:" \u4E0A\u4F20\u5546\u54C1\u5DE5\u827A\u6A21\u7248"},"config"),(0,r.jsx)("a",{href:d.templatePath,children:" \u4E0B\u8F7D\u5DE5\u827A\u6A21\u677F"},"config")]}}];return(0,Z.useEffect)(function(){},[]),(0,r.jsxs)(se.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,r.jsx)(ie.ZP,{headerTitle:"\u8BBE\u5907\u7248\u672C",actionRef:i,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,r.jsxs)(O.Z,{type:"primary",onClick:function(){u(!0)},children:[(0,r.jsx)(le.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var h=(0,m.Z)((0,o.Z)().mark(function l(d){var v,g;return(0,o.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return v=[],g=0,b.next=4,oe(d).then(function(re){v=re.data.data,g=re.data.total});case 4:return b.abrupt("return",{data:v,success:!0,total:g});case 5:case"end":return b.stop()}},l)}));return function(l){return h.apply(this,arguments)}}(),columns:Re,rowSelection:{onChange:function(l,d){T(d)}}}),(C==null?void 0:C.length)>0&&(0,r.jsx)(ue.Z,{extra:(0,r.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,r.jsx)("a",{style:{fontWeight:600},children:C.length})," ","\u9879 \xA0\xA0"]}),children:(0,r.jsx)(O.Z,{onClick:(0,m.Z)((0,o.Z)().mark(function h(){var l,d;return(0,o.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Ce(C);case 2:T([]),(l=i.current)===null||l===void 0||(d=l.reloadAndRest)===null||d===void 0||d.call(l);case 4:case"end":return g.stop()}},h)})),children:"\u5220\u9664"})}),(0,r.jsx)(ge,{onFinish:function(){var h=(0,m.Z)((0,o.Z)().mark(function l(d){var v;return(0,o.Z)().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:v=!1,d.id?v=xe(d):v=Ze(d),v&&(u(!1),F(void 0)),i.current.reload();case 4:case"end":return R.stop()}},l)}));return function(l){return h.apply(this,arguments)}}(),onCancel:function(){u(!1),F(void 0)},createModalVisible:a,values:y||{},form:Te,dicData:x}),(0,r.jsx)(q.Z,{title:"\u4E0A\u4F20\u5DE5\u827A\u6A21\u7248",open:E,footer:null,onCancel:function(){A(!1)},children:(0,r.jsx)(ae.Z,(0,_.Z)((0,_.Z)({},Ee),{},{maxCount:1,children:(0,r.jsx)(O.Z,{children:"\u5BFC\u5165\u5DE5\u827A\u6A21\u7248"})}))})]})},Fe=Se}}]);