/*! For license information please see 7.344fdca5.chunk.js.LICENSE.txt */ (this.webpackJsonpmarketingsystem=this.webpackJsonpmarketingsystem||[]).push([[7],{105:function(e,t,a){},117:function(e,t,a){},137:function(e,t,a){},187:function(e,t,a){},188:function(e,t,a){},249:function(e,t,a){},250:function(e,t,a){},253:function(e,t,a){},254:function(e,t,a){},278:function(e,t,a){},280:function(e,t,a){},281:function(e,t,a){},282:function(e,t,a){},283:function(e,t,a){},284:function(e,t,a){},285:function(e,t,a){},286:function(e,t,a){},287:function(e,t,a){},288:function(e,t,a){},289:function(e,t,a){},293:function(e,t,a){},294:function(e,t,a){},295:function(e,t,a){},296:function(e,t,a){},297:function(e,t,a){},298:function(e,t,a){},299:function(e,t,a){},304:function(e,t,a){},305:function(e,t,a){},308:function(e,t,a){},309:function(e,t,a){},310:function(e,t,a){},311:function(e,t,a){},312:function(e,t,a){},313:function(e,t,a){},314:function(e,t,a){},315:function(e,t,a){},316:function(e,t,a){},317:function(e,t,a){},318:function(e,t,a){},319:function(e,t,a){},320:function(e,t,a){},321:function(e,t,a){},322:function(e,t,a){},323:function(e,t,a){},324:function(e,t,a){},325:function(e,t,a){},326:function(e,t,a){},327:function(e,t,a){},328:function(e,t,a){},329:function(e,t,a){},330:function(e,t,a){},331:function(e,t,a){},332:function(e,t,a){},333:function(e,t,a){},334:function(e,t,a){},335:function(e,t,a){},336:function(e,t,a){},337:function(e,t,a){},338:function(e,t,a){},339:function(e,t,a){},340:function(e,t,a){"use strict";a.d(t,"a",(function(){return us})),a.d(t,"b",(function(){return ds})),a.d(t,"c",(function(){return hs}));var n=a(66),i=a(68),s=a(60),c=a(63),o=a(64),r=a(62),l=a(540),d=a(0),u=a.n(d),h=a(472),p=a(567),m=a(228),b=a(1);var f=a(71),j=a(72),g=a(24),y=a(25),_=a(26),v=a(27),x=a(18),O=a.n(x),k=(a(249),a(255)),S=a(568),w=a(218),C=a(198),N=a(503),D=a(231),I=(a(250),a(616)),T=a(610),F=a(505),L=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={count:10,page:1|e.page,visible:!1,jump_page:"",page_num:"",dataCount:n.props.data},n}return Object(y.a)(a,[{key:"getPageArr",value:function(e,t,a){var n,i=[].concat(e),s=i.length,c="\u2026";if(t=Math.max(1,Math.min(t,s)),s<=a)return i[t-1]=""+i[t-1],i;for(i=[""+t],n=(a=Math.max(5,a||7))-1;;){var o=+i[0],r=+i[i.length-1];if(o>1&&(i.unshift(o-1),!--n))break;if(rt?t:e.target.value;this.setState({jump_page:a})}},{key:"onJumpPage",value:function(e){""!=e&&(this.setState({page:e}),this.props.onJumpPage(e),this.setState({jump_page:""}))}},{key:"onMenuClick",value:function(e,t){switch(this.onJumpPage(1),t){case"1":this.setState({count:10}),this.props.onCountChange(10);break;case"2":this.setState({count:20}),this.props.onCountChange(20);break;case"3":this.setState({count:50}),this.props.onCountChange(50);break;case"4":this.setState({count:100}),this.props.onCountChange(100);break;case"5":this.setState({count:200}),this.props.onCountChange(200)}this.setState({visible:!1})}},{key:"componentWillMount",value:function(){}},{key:"componentWillReceiveProps",value:function(e){e.page&&this.setState({page:e.page})}},{key:"render",value:function(){for(var e=this,t=this.props.data,a=Math.ceil(t.count/this.state.count),n=[],i=1;i1?"page-prev":"page-prev disabled"}),"undefined"!=s?s.map((function(t,a){return Object(b.jsx)("div",{onClick:function(){e.onPageClick(t)},className:t==e.state.page?"btn-page active":"btn-page",children:t},a)})):1,Object(b.jsx)(w.a,{onClick:function(){e.onNextClick()},type:"right",className:this.state.page>=a?"page-next disabled":"page-next"}),Object(b.jsxs)("div",{className:"jump-button",children:[Object(b.jsx)("div",{className:"jump-button-left",children:Object(b.jsx)("input",{type:"text",value:this.state.jump_page,onChange:function(t){e.onInputChange(t,a)}})}),Object(b.jsx)("div",{className:"jump-button-right",onClick:function(t){e.onJumpPage(e.state.jump_page)},children:"\u8df3\u8f6c"})]})]})]})})}}]),a}(u.a.Component),M=(a(253),a(254),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={text:e.text,length:e.text.length,maxlength:24},n}return Object(y.a)(a,[{key:"onChange",value:function(e){this.setState({text:e.target.value}),this.inputdoing||this.setState({length:this.state.text.length}),this.props.onChange(e.target.value)}},{key:"compositionstart",value:function(e){this.inputdoing=!0}},{key:"compositionend",value:function(e){this.inputdoing=!1,this.setState({length:this.state.text.length})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{className:"border-input",children:[Object(b.jsx)("input",{value:this.state.text,onCompositionStart:function(t){e.compositionstart(t)},onCompositionEnd:function(t){e.compositionend(t)},onInput:function(t){e.onChange(t)},maxlength:this.state.maxlength,type:"text"}),Object(b.jsxs)("div",{className:"input-label",children:[this.state.length,"/",this.state.maxlength]})]})}}]),a}(u.a.Component)),H=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;Object(g.a)(this,a),n=t.call(this,e);var i=JSON.parse(JSON.stringify(e.row));return n.state={visible:e.visible,row:i,column:e.column,text:e.row[e.column]},n}return Object(y.a)(a,[{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onOk",value:function(){this.props.onOk(this.state.row)}},{key:"textChange",value:function(e){var t=this.state.row;t[this.props.column]=e,this.setState({row:t})}},{key:"render",value:function(){var e=this,t=this.props.pos;return t.y+156>window.innerHeight&&(t.y=t.y-156),t.x+412>window.innerWidth&&(t.x=t.x-412),Object(b.jsxs)("div",{className:"gridEdit",id:"gridEdit",style:{position:"absolute",top:t.y+10,left:t.x+10},children:[",",Object(b.jsxs)("div",{className:"gridEdit-title",children:["\u4fee\u6539",this.props.title]}),Object(b.jsx)("div",{className:"gridEdit-content",children:Object(b.jsx)(M,{text:this.state.text,onChange:function(t){e.textChange(t)}})}),Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)("div",{className:"btn-cancel",onClick:function(t){e.onCancel()},children:"\u53d6\u6d88"}),Object(b.jsx)("div",{className:"btn-current",onClick:function(t){e.onOk()},children:"\u786e\u5b9a"})]})]})}}]),a}(u.a.Component),q=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;Object(g.a)(this,a),(n=t.call(this,e)).scrollFunc=function(e){},n.AllCheckChange=function(e){if(0!=n.state.tableData.length){n.setState({indeterminate:!1}),n.setState({allChecked:e.target.checked});Object(C.a)(n.state.tableData,(function(t){return t.checked=e.target.checked&&!t.disabled}));n.setState({tableData:n.state.tableData});var t=Object(N.a)(n.state.tableData,(function(e){return 1==e.checked}));n.props.checkChange(t)}},n.onConfirm=function(){},n.onCancel=function(){},n.total=function(e){var t=0;if(!e.total)return"";for(var a=0;a12?"100px":100/(this.state.Column.length-2)+"%";return Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"gird",style:{border:this.props.isBorder?"1px solid #dfe1e6":"none"},id:"grid",children:[Object(b.jsxs)("div",{className:"th-head",children:[" ",this.props.isMultiple?Object(b.jsxs)("div",{className:"th-td",style:{width:"30px",textAlign:"left",background:this.props.headBackgroud},children:[Object(b.jsx)(k.a,{checked:this.state.allChecked,indeterminate:this.state.indeterminate,onChange:this.AllCheckChange,children:" "})," "]}):null," ",this.props.isSwitch?Object(b.jsxs)("div",{className:"th-td",style:{width:"30px",textAlign:"left",visibility:"hidden",background:this.props.headBackgroud},children:[Object(b.jsx)(S.a,{size:"small",checked:!0,onChange:function(){e.switchChange()},children:" "})," "]}):null,this.state.Column.map((function(t,a){return n="auto"==t.width?i:t.width,Object(b.jsxs)("div",{className:"th-td",style:{width:n,justifyContent:t.textAlign,background:e.props.headBackgroud},children:[" ",t.title,t.sort?Object(b.jsx)(w.a,{type:"arrow-down"}):null," "]},a)}))," "]}),Object(b.jsxs)("div",{className:this.state.pageLoading?"grid-loading show":"grid-loading",children:[Object(b.jsx)("div",{className:"loading-bar"}),Object(b.jsx)("div",{className:"loading-txt",children:"\u6570\u636e\u52a0\u8f7d\u4e2d,\u8bf7\u8010\u5fc3\u7b49\u5f85"})]}),Object(b.jsxs)("div",{className:this.state.pageLoading?"th-body hide":"th-body",style:{maxHeight:this.props.maxheight+"px"},children:[" ",0==this.state.tableData.length?Object(b.jsxs)("div",{className:"empty-text",children:[" ",this.state.emptyText," "]}):this.state.tableData.map((function(t,s){return Object(b.jsxs)("div",{className:e.state.curIndex==s?"tr active":"tr",onClick:function(t){e.rowItemClick(s)},style:{background:s%2==0?e.props.spliteColor:"#ffffff"},children:[" ",e.props.isMultiple?Object(b.jsxs)("div",{className:"td",style:{width:"30px",textAlign:"left"},children:[Object(b.jsx)(k.a,{checked:t.checked,disabled:t.disabled,onChange:function(t){e.checkChange(s,t)},children:" "})," "]}):null,e.props.isSwitch?Object(b.jsxs)("div",{className:"td",style:{width:"30px",textAlign:"left"},children:[Object(b.jsx)(S.a,{size:"small",checked:t.switched,onChange:function(t){e.switchChange(s,t)},loading:e.state.switchLoading,children:" "})," "]}):null,e.state.Column.map((function(c,o){return n="auto"==c.width?i:c.width,"normal"==c.type?Object(b.jsxs)("div",{className:"td",style:{width:n,justifyContent:c.textAlign},children:[" ",e.getCellValue(c.prop,t)]},o):Object(b.jsxs)("div",{className:"td",style:{width:n,justifyContent:c.textAlign},children:[" ",a(c.prop,t,s)," "]},o)}))," "]},s)})),this.state.editShow?Object(b.jsx)(H,{pos:this.state.postion,title:this.state.edit_title,column:this.state.edit_column,onCancel:function(){e.setState({editShow:!1})},onOk:function(t){e.setState({editShow:!1})},row:this.state.curRow}):null,Object(b.jsx)("div",{className:"sortbar"})]}),Object(b.jsxs)("div",{className:!this.state.pageLoading&&this.props.countbarVisible?"tfoot":"tfoot hide",style:{background:this.props.spliteColor},children:[" ",Object(b.jsxs)("div",{className:"th-td-total",style:{width:"130px"},children:["\u603b\u8ba1(",this.state.tableData.length,"\u6761\u6570\u636e):"]}),this.state.Column.map((function(t,a){return n="auto"==t.width?i:t.width,Object(b.jsxs)("div",{className:"td total",style:{width:n,textAlign:t.textAlign},children:[" ",e.total(t)," "]},a)}))," "]})]}),this.props.isShowPageBar?Object(b.jsx)("div",{className:this.state.pageLoading?"pagebar hide":"pagebar",children:Object(b.jsx)(L,{data:{count:this.props.dataCount},onPrevClick:function(t){e.gridPageLoad(),e.props.pageChange(t)},page:this.props.page,pageFn:function(t){return e.setState({page:t})},onNextClick:function(t){e.gridPageLoad(),e.props.pageChange(t)},onJumpPage:function(t){e.gridPageLoad(),e.props.pageChange(t)},onCountChange:function(t){e.onCountChange(t)}})}):null]})}}]),a}(u.a.Component);q.defaultProps={isShowPageBar:!0,isMultiple:!0,isSwitch:!0,page:"",headBackgroud:"",spliteColor:"#f9fafc",countbarVisible:!0,maxheight:400,isBorder:!1,Column:[{title:"\u63a8\u5e7f\u8ba1\u5212\u540d\u79f0",prop:"name",width:"300px",textAlign:"flex-start",type:"normal",sort:!1,total:!1,valueType:"text"},{title:"\u64cd\u4f5c",prop:"edit",width:"220px",textAlign:"flex-start",type:"slot",sort:!1,total:!1,valueType:"text"},{title:"\u66dd\u5149\u91cf",prop:"num1",width:"auto",textAlign:"left",type:"normal",sort:!0,total:!0,valueType:"number"},{title:"\u70b9\u51fb\u91cf",prop:"num2",width:"auto",textAlign:"left",type:"normal",sort:!0,total:!0,valueType:"number"},{title:"\u70b9\u51fb\u7387",prop:"num3",width:"auto",textAlign:"left",type:"normal",sort:!0,total:!0,valueType:"percentage"},{title:"\u70b9\u51fb\u5747\u4ef7",prop:"price",width:"auto",textAlign:"left",type:"normal",sort:!0,total:!0,valueType:"price"},{title:"\u82b1\u8d39",prop:"totalprice",width:"auto",textAlign:"left",type:"normal",sort:!0,total:!0,valueType:"price"}],tableData:[{id:0,name:"\u63a8\u5e7f\u8ba1\u5212-2021-10-19 17:43",num1:0,num2:0,num3:0,price:0,totalprice:0}],emptyText:"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55",dataCount:0,curIndex:0};var P=function(e,t){var a=0,n=e.toString(),i=t.toString();try{a+=n.split(".")[1].length}catch(s){}try{a+=i.split(".")[1].length}catch(s){}return Number(n.replace(".",""))*Number(i.replace(".",""))/Math.pow(10,a)},B=function(e,t){var a,n,i=0,s=0;try{i=e.toString().split(".")[1].length}catch(c){}try{s=t.toString().split(".")[1].length}catch(c){}return a=Number(e.toString().replace(".","")),n=Number(t.toString().replace(".","")),P(a/n,Math.pow(10,s-i))},E=function(e){var t=sessionStorage.getItem("KeyPcType"),a=parseInt(B(e.all_budget,P(e.reduce_amount,e.send_num)));return"2"===t||"3"===t?a:e.stock?e.stock:a},A=function(e){var t={type:2};return t.upstream=J(e.channel),t.only=e,t.product_id=e.goods_id?e.goods_id:e.channel_activity_id,t.product_name=e.batch_goods_name,t.official_price=e.reduce_amount,t.contract_price=e.price,t.quantity=E(e),t.stock=E(e),t.channel_activity_id=e.channel_activity_id,t.all_budget=Number(e.all_budget),t.effectDate="".concat(e.time_limit.effect_time.start_time," \u81f3 ").concat(e.time_limit.effect_time.end_time),t.create_time=e.create_time,t},V=function(e){var t={},a="1"===e.cash_amount_type?e.denomination:"".concat(e.min_denomination,"~").concat(e.max_denomination);return t.type=3,t.upstream=J(e.channel),t.only=e,t.product_id=e.goods_id||e.id||e.cash_activity_id,t.product_name=e.batch_goods_name,t.official_price=a,t.contract_price=(e.total_contract_price/e.num).toFixed(4),t.cost_price=a,t.quantity=e.num,t.stock=e.stock||e.num,t.channel_activity_id=e.cash_activity_id,t.all_budget=Number(e.all_budget),t.effectDate="".concat(e.begin_time," \u81f3 ").concat(e.end_time),t};function J(e){switch(Number(e)){case 1:return"\u652f\u4ed8\u5b9d";case 2:return"\u5fae\u4fe1";case 3:return"\u4e91\u95ea\u4ed8"}}function W(){var e=sessionStorage.getItem("phone_number_all")?JSON.parse(sessionStorage.getItem("phone_number_all")):void 0;if(e){var t=e.reduce((function(e,t){return t.phone_number.forEach((function(t){e.push(t)})),e}),[]),a=new Set(t);return t.length!==a.size}}var z="1\u3001\u7acb\u51cf\u91d1\u81ea\u9886\u53d6\u4e4b\u65e5\u8d7730\u5929\u6709\u6548\uff0c\u8bf7\u5728\u6709\u6548\u671f\u5185\u4f7f\u7528\n
2\u3001\u5fae\u4fe1\u7acb\u51cf\u91d1\u81ea\u9886\u53d6\u540e\u6bcf\u4e2a\u7acb\u51cf\u91d1\u4e00\u6b21\u6027\u4f7f\u7528\uff0c\u4e0d\u5151\u6362\uff0c\u4e0d\u627e\u96f6\uff0c\u5230\u671f\u540e\u81ea\u52a8\u5931\u6548\uff0c\u903e\u671f\u672a\u4f7f\u7528\u4e0d\u518d\u8865\u53d1\u3002\u4f7f\u7528\u5fae\u4fe1\u652f\u4ed8\u8fdb\u884c\u4ed8\u6b3e\uff08\u5927\u4e8e\u7acb\u51cf\u91d1\u9762\u989d0.01\u5143\u4ee5\u4e0a\uff09\u5373\u53ef\u81ea\u52a8\u62b5\u6263\n
3\u3001\u591a\u5f20\u7acb\u51cf\u91d1\u53ef\u5728\u5355\u7b14\u5fae\u4fe1\u652f\u4ed8\u8ba2\u5355\u4e2d\u4e00\u8d77\u4f7f\u7528\uff0c\u4f46\u5f53\u7528\u6237\u7684\u7acb\u51cf\u91d1\u8d85\u8fc78\u5f20\u65f6\uff0c\u7cfb\u7edf\u4f1a\u9009\u53d6\u5176\u4e2d\u4e00\u90e8\u5206\u4f7f\u7528\uff0c\u4e0d\u4fdd\u8bc1\u5728\u4e00\u5f20\u8ba2\u5355\u4e2d\u5168\u90e8\u4f7f\u7528\n
4\u3001\u5728\u4e2d\u56fd\u5883\u5185\u5546\u6237\u4f7f\u7528\u5fae\u4fe1\u652f\u4ed8\u5373\u53ef\u4f7f\u7528\uff0c\u5c11\u6570\u7279\u5b9a\u5546\u6237\uff08\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\uff1aCoCo\u5976\u8336\u3001\u4f18\u8863\u5e93\u3001\u661f\u5df4\u514b\u3001\u80af\u5fb7\u57fa\u3001\u5fc5\u80dc\u5ba2\u3001\u540c\u7a0b\u827a\u9f99\u3001\u70ed\u98ce\u3001\u592a\u5e73\u9e1f\u3001\u5b69\u5b50\u738b\u3001\u822a\u8054\u4fdd\u9669\u3001\u534e\u4e3a\u5546\u57ce\u3001Miss Sixty\u3001Ochirly\u3001Apple\u5546\u57ce\u3001FivePlus\u3001\u4fe1\u7528\u5361\u8fd8\u6b3e\u3001\u96f6\u94b1\u901a\u3001\u7406\u8d22\u901a\u7b49\uff09\u3001\u4ee5\u53ca\u793e\u4ea4\u652f\u4ed8\uff08\u5982\u8f6c\u8d26\u3001\u7ea2\u5305\u3001\u4e2a\u4eba\u6536\u6b3e\u7801\u652f\u4ed8\u7b49\uff09\u53ca\u5408\u5355\u652f\u4ed8\uff08\u5fae\u4fe1\u652f\u4ed8\u8ba2\u5355\u53f7\u4e3a44\u5f00\u5934\u7684\u4ea4\u6613\uff09\u65e0\u6cd5\u4f7f\u7528\u7acb\u51cf\u91d1'\n
5\u3001\u4f7f\u7528\u7acb\u51cf\u91d1\u7684\u5fae\u4fe1\u652f\u4ed8\u8ba2\u5355\uff0c\u5982\u53d1\u751f\u5168\u989d\u9000\u6b3e\uff0c\u4e14\u7acb\u51cf\u91d1\u4ecd\u5728\u6709\u6548\u671f\u5185\uff0c\u7acb\u51cf\u91d1\u5c06\u81ea\u52a8\u9000\u8fd8\u7ed9\u7528\u6237\uff0c\u5982\u7acb\u51cf\u91d1\u5df2\u8fc7\u671f\uff0c\u5219\u4e0d\u9000\u8fd8\u7ed9\u7528\u6237\uff1b\u5982\u53d1\u751f\u90e8\u5206\u9000\u6b3e\uff0c\u7528\u6237\u652f\u4ed8\u91d1\u989d\u5c06\u6309\u6bd4\u4f8b\u539f\u8def\u9000\u8fd8\uff0c\u7acb\u51cf\u91d1\u5c06\u4e0d\u9000\u8fd8\u7ed9\u7528\u6237",R="1\u3001\u7acb\u51cf\u91d1\u81ea\u9886\u53d6\u4e4b\u65e5\u8d777\u5929\u6709\u6548\uff0c\u8bf7\u5728\u6709\u6548\u671f\u5185\u4f7f\u7528\n
2\u3001\u652f\u4ed8\u5b9d\u7acb\u51cf\u91d1\u81ea\u9886\u53d6\u540e\u6bcf\u4e2a\u7acb\u51cf\u91d1\u4e00\u6b21\u6027\u4f7f\u7528\uff0c\u4e0d\u5151\u6362\u3001\u4e0d\u627e\u96f6\uff0c\u5230\u671f\u540e\u81ea\u52a8\u5931\u6548\uff0c\u903e\u671f\u672a\u4f7f\u7528\u4e0d\u518d\u8865\u53d1\u3002\u4f7f\u7528\u652f\u4ed8\u5b9d\u652f\u4ed8\u8fdb\u884c\u4ed8\u6b3e(\u5927\u4e8e\u7acb\u51cf\u91d1\u9762\u989d0.01\u5143\u4ee5\u4e0a)\u5373\u53ef\u81ea\u52a8\u62b5\u6263\n
3\u3001\u591a\u5f20\u7acb\u51cf\u91d1\u53ef\u5728\u5355\u7b14\u652f\u4ed8\u5b9d\u652f\u4ed8\u8ba2\u5355\u4e2d\u4e00\u8d77\u4f7f\u7528\uff0c\u4f46\u5f53\u7528\u6237\u7684\u7acb\u51cf\u91d1\u8d85\u8fc78\u5f20\u65f6\uff0c\u7cfb\u7edf\u4f1a\u9009\u53d6\u5176\u4e2d\u4e00\u90e8\u5206\u4f7f\u7528\uff0c\u4e0d\u4fdd\u8bc1\u5728\u4e00\u5f20\u8ba2\u5355\u4e2d\u5168\u90e8\u4f7f\u7528\n
4\u3001\u4f7f\u7528\u7acb\u51cf\u91d1\u7684\u652f\u4ed8\u5b9d\u652f\u4ed8\u8ba2\u5355\uff0c\u5982\u53d1\u751f\u5168\u989d\u9000\u6b3e\uff0c\u4e14\u7acb\u51cf\u91d1\u4ecd\u5728\u6709\u6548\u671f\u5185\uff0c\u7acb\u51cf\u91d1\u5c06\u81ea\u52a8\u9000\u8fd8\u7ed9\u7528\u6237\uff0c\u5982\u7acb\u51cf\u91d1\u5df2\u8fc7\u671f\uff0c\u5219\u4e0d\u9000\u8fd8\u7ed9\u7528\u6237;\u5982\u53d1\u751f\u90e8\u5206\u9000\u6b3e\uff0c\u7528\u6237\u652f\u4ed8\u91d1\u989d\u5c06\u6309\u6bd4\u4f8b\u539f\u8def\u9000\u8fd8\uff0c\u7acb\u51cf\u91d1\u5c06\u4e0d\u9000\u8fd8\u7ed9\u7528\u6237",Y="\u6e29\u99a8\u63d0\u793a\uff1a\u5355\u7b14\u4ea4\u6613\u5927\u4e8eX.01\u5143\u53ef\u7528\u7acb\u51cfX\u5143\uff01\u540c\u4e00\u6279\u6b21\u6d3b\u52a8\uff08\u540c\u4e00\u5238\u7f16\u7801\u4e3a\u540c\u4e00\u6279\u6b21\u6d3b\u52a8\uff09\u5355\u65e5\u9886\u53d6\u4e0a\u9650\u4e3a10\u5f20\uff0c\u603b\u9886\u53d6\u4e0a\u9650\u4e3a30\u5f20\uff01\n
1.\u5f53\u4ea4\u6613\u65f6\u4f7f\u7528\u4e91\u95ea\u4ed8\u6d88\u8d39\u5238\u62b5\u6263\uff0c\u5982\u53d1\u751f\u64a4\u9500\u3001\u9000\u8d27\u7b49\u64cd\u4f5c\u65f6\uff0c\u7528\u6237\u5b9e\u9645\u652f\u4ed8\u91d1\u989d\u539f\u8def\u9000\u56de\u81f3\u652f\u4ed8\u94f6\u884c\u5361\uff0c\u4ec5\u5168\u989d\u9000\u6b3e\u6d88\u8d39\u5361\u5238\u4f1a\u9000\u8fd8\u81f3\u7528\u6237\uff08\u90e8\u5206\u9000\u6b3e\u5361\u5238\u4e0d\u4f1a\u9000\u56de\uff09\uff0c\u5238\u9000\u56de\u65e5\u671f\u4e3aD+1\u4e2a\u5de5\u4f5c\u65e5\uff0c\u903e\u671f\u4f5c\u5e9f\uff1b\n
2.\u672c\u5238\u9700\u7ed1\u5b9a\u4f17\u90a6\u94f6\u884c\u5361\u4f7f\u7528\uff0c\u4e0d\u53ef\u4e0e\u5176\u4ed6\u4f18\u60e0\u540c\u4eab\uff0c\u8bf7\u4e00\u6b21\u6027\u4f7f\u7528\uff0c\u4e0d\u627e\u96f6\u3001\u4e0d\u5151\u6362\u3001\u4e0d\u63d0\u73b0\u3001\u4e0d\u53ef\u53e0\u52a0\u4f7f\u7528\uff0c\u4e0d\u53ef\u7528\u4e8e\u8d2d\u4e70\u6d3b\u671f\uff0b\u6216\u8005\u5176\u4ed6\u7406\u8d22\u4ea7\u54c1\uff1b\n
3.\u7528\u6237\u4e3b\u626b\u65f6\uff0c\u53ef\u81ea\u4e3b\u9009\u62e9\u662f\u5426\u4f7f\u7528\u6d88\u8d39\u5238\u53ca\u5177\u4f53\u4f7f\u7528\u54ea\u4e00\u5f20\uff1b\u88ab\u626b\u65f6\uff0c\u9ed8\u8ba4\u4f18\u5148\u4f7f\u7528\u7b26\u5408\u89c4\u5219\u4e14\u4f18\u60e0\u6700\u5927\u7684\u6d88\u8d39\u5238\uff1b\n
4.\u7528\u6237\u540c\u4e00\u8d26\u53f7\u6709\u591a\u7c7b\u4e91\u95ea\u4ed8\u6d88\u8d39\u5238\u65f6\uff0c\u4f18\u5148\u4f7f\u7528\u53ef\u62b5\u6263\u91d1\u989d\u5927\u7684\u6d88\u8d39\u5238\u8fdb\u884c\u62b5\u6263\uff1b\u53ef\u62b5\u6263\u91d1\u989d\u76f8\u540c\u65f6\uff0c\u4f18\u5148\u4f7f\u7528\u5148\u83b7\u53d6\u7684\u6d88\u8d39\u5238\u8fdb\u884c\u62b5\u6263\uff1b\u5f53\u540c\u4e00\u7c7b\u4e91\u95ea\u4ed8\u6d88\u8d39\u5238\u6709\u4e0d\u540c\u6709\u6548\u671f\u7684\u91d1\u989d\u65f6\uff0c\u4f18\u5148\u4f7f\u7528\u5373\u5c06\u5230\u671f\u7684\u6d88\u8d39\u5238\u8fdb\u884c\u62b5\u6263\uff1b\n
5.\u5bf9\u4f7f\u7528\u6216\u6d89\u5acc\u4f7f\u7528\u8fdd\u53cd\u6d3b\u52a8\u89c4\u5219\u6216\u4e0d\u6b63\u5f53\u65b9\u5f0f\u5957\u53d6\u94f6\u8054\u4f18\u60e0\u7684\u7528\u6237\u53ca\u5176\u6240\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\u624b\u673a\u53f7\u3001\u94f6\u884c\u5361\u53f7\u3001APP\u8d26\u53f7\u7b49\uff0c\u4e2d\u56fd\u94f6\u8054\u548c\u5546\u6237\u6709\u6743\u4e0d\u4e88\u5176\u4f7f\u7528\u4e91\u95ea\u4ed8\u6d88\u8d39\u5238\u3001\u8ffd\u56de\u5df1\u53d1\u653e\u7684\u4e91\u95ea\u4ed8\u6d88\u8d39\u5238\uff1b\n
6.\u7528\u6237\u4f7f\u7528\u6d88\u8d39\u5238\u65f6\uff0c\u8bf7\u5c06 APP \u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u7531\u4e8e\u7528\u6237\u7535\u5b50\u8bbe\u5907\u4e0d\u652f\u6301\u3001APP \u672a\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3001\u5361\u7247\u6302\u5931\u3001\u6362\u5361\u3001\u8d26\u53f7\u8f93\u9519\u7b49\u81ea\u8eab\u539f\u56e0\u5bfc\u81f4\u65e0\u6cd5\u4eab\u53d7\u4f18\u60e0\u7684\uff0c\u8be5\u4f18\u60e0\u540e\u7eed\u4e0d\u4e88\u8865\u53d1\u3002\n
7.\u672c\u5546\u54c1\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u5982\u6709\u4e0d\u660e\u4e4b\u5904\uff0c\u8bf7\u8054\u7cfb\u4f9b\u5e94\u5546\u6210\u90fd\u84dd\u8272\u5144\u5f1f\u7f51\u7edc\u79d1\u6280\u6709\u9650\u516c\u53f8\u5ba2\u670d\uff1a4001181216";function K(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 1==e.expiration_type?"\u4e0d\u8bbe\u7f6e":2==e.expiration_type?"".concat(e.expiration_value[0],"~").concat(e.expiration_value[1]):3==e.expiration_type?"\u63a5\u53e3\u8c03\u53d6\u540e".concat(e.expiration_value,"\u5929"):"-"}function G(e){return/^[0-9][0-9]*([.][0-9]{1,2})?$/.test(e)}var U=a(620),Q=a(569),$=a(76),Z=a.n($),X=a(216),ee=a(608),te=a(265),ae=a(262),ne=a(344),ie=a(614),se=a(93),ce=a(87),oe=a(177);function re(e,t){var a,n=new Map,i=Object(oe.a)(e);try{for(i.s();!(a=i.n()).done;){var s=a.value;n.has(s[t])||n.set(s[t],s)}}catch(c){i.e(c)}finally{i.f()}return Object(ce.a)(n.values())}function le(e,t){var a,n,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(t=t||i.length,e)for(a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=[{id:1,name:"\u5468\u4e00"},{id:2,name:"\u5468\u4e8c"},{id:3,name:"\u5468\u4e09"},{id:4,name:"\u5468\u56db"},{id:5,name:"\u5468\u4e94"},{id:6,name:"\u5468\u516d"},{id:7,name:"\u5468\u65e5"}],a=e.map((function(e){return t.filter((function(t){return t.name===e||t.id==e}))})).flat(1/0).sort((function(e,t){return e.id-t.id})),n=[];if(he(a.map((function(e){return e.id})))&&a.length>1)n.push("".concat(a[0].name," \u81f3 ").concat(a.slice(-1)[0].name));else for(var i=0;i3?{a:36-2.5*(a-3)+"px",b:20-(a-3)+"px"}:{b:"20px",a:"36px"}}return Object(b.jsxs)("div",{id:"reduceKnockGold",className:"mobile",children:[Object(b.jsxs)("div",{className:"couponShow",children:[Object(b.jsxs)("div",{className:"coupon-left",children:[Object(b.jsxs)("p",{className:"coupon_money",style:{fontSize:a().a},children:[Object(b.jsx)("span",{style:{fontSize:a().b},children:"\uffe5"}),t.reduce_amount?t.reduce_amount:"0.00"]}),Object(b.jsxs)("p",{className:"full_money",children:["\u6ee1",t.denomination?t.denomination:"0.00","\u53ef\u7528"]})]}),Object(b.jsxs)("div",{className:"coupon-right",children:[Object(b.jsxs)("p",{className:t.batch_goods_name.length<20?"title":"isTitle",children:[t.batch_goods_name?t.batch_goods_name:"\u7acb\u51cf\u91d1",t.send_num>1?Object(b.jsxs)("span",{className:"send_num",children:["x",t.send_num]}):null]}),Object(b.jsxs)("p",{children:[(null===t||void 0===t?void 0:t.card_type.length)>0?t.card_type.map((function(e){return("1"===e?"\u501f\u8bb0\u5361":"\u4fe1\u7528\u5361")+" "})):"xxx xxx xxx"," ","\u53ef\u7528"]}),1==t.timer_show?Object(b.jsxs)("p",{className:"validity",children:["\u6709\u6548\u671f:",t.entry_time[0]||"xxxx-xx-xx xx:xx:xx","\u81f3",t.entry_time[1]||"xxxx-xx-xx xx:xx:xx"]}):null]})]}),Object(b.jsx)("div",{className:"receiveBtn",children:"\u7acb\u5373\u9886\u53d6"}),Object(b.jsxs)("div",{className:"coupon_explain",children:[Object(b.jsx)("h1",{children:"- \u5151\u6362\u8bf4\u660e -"}),Object(b.jsx)(Oe,{data:t}),t.notice?Object(b.jsxs)("div",{className:"content",children:[Object(b.jsx)("h3",{children:"\u4f7f\u7528\u987b\u77e5"}),Object(b.jsx)("p",{dangerouslySetInnerHTML:{__html:t.notice}})]}):null,t.instruction?Object(b.jsxs)("div",{className:"content",children:[Object(b.jsx)("h3",{children:"\u4f7f\u7528\u89c4\u5219"}),Object(b.jsx)("div",{dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:ke,rows:14,dashed:!1})]})]})},we=a(134),Ce=a.n(we),Ne=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={editorHtml:"",count:0},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(){var e=this,t=this,a=new Ce.a("#".concat(this.props.pageType));a.destroy(),this.setState({editor:a}),a.config.colors=["#696969","#9093a2","#fgddbb","#e3e7eb"],a.config.pasteText=!0,a.config.height=this.props.height,a.config.showFullScreen=!1,a.config.menus=["bold","foreColor","italic","indent","link","justify"],a.config.onchange=function(e){var n=a.txt.text();if(0==n.length&&t.props.setEdittext(""),n.length>t.props.limitLength){var i=n.slice(0,t.props.limitLength);return t.setState({editorHtml:i}),a.txt.html(i),void t.props.setEdittext(i)}t.setState({count:n.length}),t.setState({editorHtml:e}),t.props.setEdittext(e)},a.create();var n=setTimeout((function(){a.txt.html(e.props.text),clearTimeout(n)}),500)}},{key:"render",value:function(){return Object(b.jsxs)("div",{className:"countBox_par",children:[Object(b.jsx)("div",{id:this.props.pageType,style:{width:this.props.width}}),Object(b.jsx)("p",{className:"countBox",children:this.state.count+"/"+this.props.limitLength})]})}}]),a}(u.a.Component),De=[24,100,100,100,80,100,100,100,80,100,100,100,80,100,100,100,100],Ie=function(e){var t=e.data;return Object(b.jsxs)("div",{id:"ysf-knockGoldViews",className:"mobile",children:[Object(b.jsx)("img",{className:"bubble",src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/ysf-logo.png",alt:""}),Object(b.jsxs)("div",{className:"content",children:[Object(b.jsxs)("p",{className:"title",children:[t.batch_goods_name||"\u4e91\u95ea\u4ed8\u7acb\u51cf\u91d1",t.send_num>1?Object(b.jsxs)("span",{className:"send_num",children:["x",t.send_num]}):null]}),Object(b.jsxs)("div",{className:"information",children:[Object(b.jsxs)("p",{className:"money",style:{fontSize:function(){var e=t.denomination,a=t.reduce_amount,n=String(parseFloat(e)).length+String(parseFloat(a)).length+1;return n>12?{a:30-1.8*(n-12)+"px"}:{a:"30px"}}().a},children:["\u6ee1",t.denomination?parseFloat(t.denomination):100.1,"\u5143\u51cf",t.reduce_amount?parseFloat(t.reduce_amount):99.99,"\u5143"]}),1==t.timer_show?Object(b.jsxs)("p",{className:"information-p2",children:["\u8bf7\u5728\xa0",t.entry_time[0]||"2023-12-30 59:59:59"," ~"," ",t.entry_time[1]||"2023-12-30 59:59:59","\xa0\u5185\u9886\u53d6"]}):null,Object(b.jsx)("p",{className:"type",children:Object(b.jsx)("span",{children:(null===t||void 0===t?void 0:t.card_type.length)>0?t.card_type.map((function(e){return("1"===e?"\u501f\u8bb0\u5361":"\u4fe1\u7528\u5361")+" "})):"xxx"})})]}),Object(b.jsxs)("div",{className:"form","v-if":"coupon.status===3",children:[Object(b.jsx)("p",{className:"form-label",children:"\u4e91\u95ea\u4ed8\u8d26\u53f7"}),Object(b.jsx)("input",{className:"form-input",disabled:!0,type:"text",placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"}),Object(b.jsx)("input",{className:"form-input mt0",disabled:!0,type:"text",placeholder:"\u8bf7\u518d\u6b21\u8f93\u5165\u624b\u673a\u53f7"}),Object(b.jsxs)("p",{className:"form-note",children:["\u6e29\u99a8\u63d0\u793a\uff1a\u5355\u7b14\u4ea4\u6613\u5927\u4e8e",t.denomination?parseFloat(t.denomination):100.1,"\u5143\u53ef\u7acb\u51cf",t.reduce_amount?parseFloat(t.reduce_amount):99.99,"\u5143"]}),Object(b.jsx)("button",{className:"form-button",children:"\u7acb\u5373\u9886\u53d6"})]}),Object(b.jsxs)("div",{className:"segmentation",children:[Object(b.jsx)("i",{className:"left"}),Object(b.jsx)("i",{className:"middle"}),Object(b.jsx)("i",{className:"right"})]}),Object(b.jsx)("div",{className:"illustrate",children:t.instruction||t.usable_time?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(Oe,{data:t}),Object(b.jsx)("h3",{className:"illustrate-title",children:"\u6d3b\u52a8\u8bf4\u660e"}),Object(b.jsx)("p",{className:"illustrate-text",dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:De,rows:12,dashed:!1})})]})]})},Te=[24,100,100,100,80,100,100,100,80,100,100,100,80,100,100,100,100],Fe=function(e){var t=e.data;return Object(b.jsxs)("div",{id:"ysf-knockGoldViews",className:"mobile zfb-knockGoldViews",children:[Object(b.jsx)("img",{className:"bubble",src:"https://lsxd-zfb-reduction.oss-cn-hangzhou.aliyuncs.com/img/logo.png",alt:""}),Object(b.jsxs)("div",{className:"content",children:[Object(b.jsxs)("p",{className:"title",children:[t.batch_goods_name||"\u652f\u4ed8\u5b9d\u7acb\u51cf\u91d1",t.send_num>1?Object(b.jsxs)("span",{className:"send_num",children:["x",t.send_num]}):null]}),Object(b.jsxs)("div",{className:"information",children:[Object(b.jsxs)("p",{className:"money",style:{fontSize:function(){var e=t.denomination,a=t.reduce_amount,n=String(parseFloat(e)).length+String(parseFloat(a)).length+1;return n>12?{a:30-1.8*(n-12)+"px"}:{a:"30px"}}().a},children:["\u6ee1",t.denomination?parseFloat(t.denomination):100.1,"\u5143\u51cf",t.reduce_amount?parseFloat(t.reduce_amount):99.99,"\u5143"]}),1==t.timer_show?Object(b.jsxs)("p",{className:"information-p2",children:["\u8bf7\u5728\xa0",t.entry_time[0]||"2023-12-30 59:59:59"," ~"," ",t.entry_time[1]||"2023-12-30 59:59:59","\xa0\u5185\u9886\u53d6"]}):null,Object(b.jsx)("p",{className:"type",children:Object(b.jsx)("span",{children:(null===t||void 0===t?void 0:t.card_type.length)>0?t.card_type.map((function(e){return("1"===e?"\u501f\u8bb0\u5361":"\u4fe1\u7528\u5361")+" "})):"xxx"})})]}),Object(b.jsxs)("div",{className:"form",children:[Object(b.jsx)("p",{className:"form-label",children:"\u652f\u4ed8\u5b9d\u8d26\u53f7"}),Object(b.jsx)("input",{className:"form-input",disabled:!0,type:"text",placeholder:"\u8bf7\u8f93\u5165\u652f\u4ed8\u5b9d\u8d26\u53f7"}),Object(b.jsx)("input",{className:"form-input mt0",disabled:!0,type:"text",placeholder:"\u8bf7\u518d\u6b21\u8f93\u5165\u652f\u4ed8\u5b9d\u8d26\u53f7"}),Object(b.jsx)("p",{className:"form-note",children:"\u60a8\u53ef\u5728\u652f\u4ed8\u5b9d\u7684\u4e2a\u4eba\u4fe1\u606f\u4e2d\u67e5\u770b\u3010\u652f\u4ed8\u5b9d\u8d26\u53f7\u3011"}),Object(b.jsx)("button",{className:"form-button",children:"\u7acb\u5373\u9886\u53d6"})]}),Object(b.jsxs)("div",{className:"segmentation",children:[Object(b.jsx)("i",{className:"left"}),Object(b.jsx)("i",{className:"middle"}),Object(b.jsx)("i",{className:"right"})]}),Object(b.jsx)("div",{className:"illustrate",children:t.instruction||t.usable_time?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(Oe,{data:t}),Object(b.jsx)("h3",{className:"illustrate-title",children:"\u6d3b\u52a8\u8bf4\u660e"}),Object(b.jsx)("p",{className:"illustrate-text",dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:Te,rows:12,dashed:!1})})]})]})},Le=a(611),Me=a(593),He=Object(d.forwardRef)((function(e,t){var a=e.channel,n=e.voucherBatchData,s=e.subjectList,c=e.isEdit,o=Object(d.useCallback)((function(e,t,a){return function(n){p((function(i){return i.map((function(i,s){if(s===e){var c=i;return c[t]=a&&1===a?n:n.target.value,c}return i}))}))}}),[]),r=Object(d.useState)((function(){return n?n.map((function(e){var t=s.find((function(t){return t.key===e.provider})),a={provider:t||s[0],channel_activity_id:e.channel_activity_id,temp_no:e.temp_no,weight:e.weight};return c&&(a.id=e.id),a})):[{provider:s[0],channel_activity_id:"",temp_no:"",weight:""}]})),l=Object(i.a)(r,2),u=l[0],p=l[1],f=Object(d.useCallback)((function(e){var t=Object(ce.a)(u);t.length>1?(t.splice(e,1),p(t)):h.a.error("\u4e0d\u80fd\u5220\u9664\u6700\u540e\u4e00\u4e2a")}),[u]),j=Object(d.useMemo)((function(){var e=[{title:"\u4e3b\u4f53\u540d\u79f0",name:"provider",width:180,bodyRender:function(e,t){var n=t.row;return Object(b.jsx)(ne.a,{width:180,options:s,disabled:"3"===a||!!e.id,value:e.provider,onChange:o(n,"provider",1)})}},{title:"\u6279\u6b21\u53f7",name:"channel_activity_id",bodyRender:function(e,t){var a=t.row;return Object(b.jsx)(Le.a,{placeholder:"",value:e.channel_activity_id,disabled:!!e.id,onChange:o(a,"channel_activity_id"),maxLength:50})}},{title:"\u5238\u6a21\u677f\u7f16\u53f7",name:"temp_no",bodyRender:function(e,t){var a=t.row;return Object(b.jsx)(Le.a,{placeholder:"",value:e.temp_no,disabled:!!e.id,onChange:o(a,"temp_no"),maxLength:50})}},{title:"\u6743\u91cd",name:"weight",width:100,bodyRender:function(e,t){var a=t.row;return Object(b.jsx)(Le.a,{value:e.weight,type:"number",onChange:o(a,"weight"),width:100})}},{title:"\u64cd\u4f5c",name:"operation",width:100,bodyRender:function(e,t){var a=t.row;return Object(b.jsx)(m.a,{type:"primary",size:"small",onClick:function(){return f(a)},children:"\u5220\u9664"})}}];return"1"!==a&&e.splice(2,1),e}),[o,f,a,s]),g=function(){p([{provider:s[0],channel_activity_id:"",temp_no:"",weight:""}])},y=function(){var e=Object(ce.a)(u);return e=e.map((function(e){var t={};return t.provider=e.provider.key,t.channel_activity_id=e.channel_activity_id,t.weight=e.weight,e.id&&""!==e.id&&(t.id=e.id),"1"===a&&(t.temp_no=e.temp_no),t}))},_=function(e,t){var a,n=new Set,i=Object(oe.a)(e);try{for(i.s();!(a=i.n()).done;){var s=a.value;if(n.has(s[t]))return!0;n.add(s[t])}}catch(c){i.e(c)}finally{i.f()}return!1},v=function(){return function(e){var t,a=Object(oe.a)(e);try{for(a.s();!(t=a.n()).done;){var n=t.value;for(var i in n)if("temp_no"!==i&&""===n[i])return!0}}catch(s){a.e(s)}finally{a.f()}return!1}(u)?(h.a.error("\u7acb\u51cf\u91d1\u5e73\u53f0\u6570\u636e\u4e0d\u80fd\u4e3a\u7a7a"),!1):_(u,"channel_activity_id")?(h.a.error("\u6279\u6b21\u53f7\u91cd\u590d"),!1):_(u,"weight")?(h.a.error("\u6743\u91cd\u91cd\u590d"),!1):!function(e){var t,a=Object(oe.a)(e);try{for(a.s();!(t=a.n()).done;){var n=t.value;if(!/^\d+$/.test(n.weight)||parseInt(n.weight)<=0)return!0}}catch(i){a.e(i)}finally{a.f()}return!1}(u)||(h.a.error("\u6743\u91cd\u5fc5\u987b\u662f\u6b63\u6574\u6570"),!1)};return Object(d.useImperativeHandle)(t,(function(){return{validator:v,getVoucherBatchData:y,setSubjectToggle:g}})),Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{style:{margin:"20px 0px 10px 0px",display:"flex",alignItems:"center"},children:[Object(b.jsxs)("span",{style:{paddingLeft:"0"},children:["\u7acb\u51cf\u91d1\u5e73\u53f0\u6279\u6b21\u53f7",Object(b.jsx)("span",{style:{color:"red"},children:"*"})]}),Object(b.jsx)(m.a,{style:{margin:"0px 0 0px 46px"},type:"primary",onClick:function(){var e=Object(ce.a)(u);e.push({provider:s[0],channel_activity_id:"",temp_no:"",weight:""}),p(e)},children:"\u65b0\u589e\u6279\u6b21"})]}),Object(b.jsx)("div",{style:{border:"1px solid #f0f0f0",margin:"0 20px 10px 0px"},children:Object(b.jsx)(Me.a,{columns:j,datasets:u,size:"large"})})]})})),qe=[{key:"1",text:"\u501f\u8bb0\u5361"},{key:"2",text:"\u4fe1\u7528\u5361"}],Pe=[{key:"all",text:"\u603b\u5171"},{key:"month",text:"\u6bcf\u6708"},{key:"week",text:"\u6bcf\u5468"},{key:"day",text:"\u6bcf\u65e5"}],Be=[{key:"Mon",text:"\u5468\u4e00"},{key:"Tue",text:"\u5468\u4e8c"},{key:"Wed",text:"\u5468\u4e09"},{key:"Thu",text:"\u5468\u56db"},{key:"Fri",text:"\u5468\u4e94"},{key:"Sat",text:"\u5468\u516d"},{key:"Sun",text:"\u5468\u65e5"}],Ee=["70","50","30","20"],Ae=function(e){return Array.from({length:e},(function(e,t){return t}))},Ve="\n1\u3001\u5728\u652f\u4ed8\u5b9dH5\u5185\u6253\u5f00\u94fe\u63a5\uff0c\u70b9\u51fb\u3010\u7acb\u5373\u9886\u53d6\u3011\u5b8c\u6210\u9886\u53d6\u652f\u4ed8\u5b9d\u7acb\u51cf\u91d1
\n2\u3001\u652f\u4ed8\u5b9d\u7acb\u51cf\u91d1\u4e00\u65e6\u9886\u53d6\u4e0d\u53ef\u64a4\u9500\u3001\u4e0d\u53ef\u8f6c\u8ba9\u3002\u6ce8\u610f\u4e0d\u8981\u5c06\u5151\u6362\u5238\u6cc4\u9732\u7ed9\u4ed6\u4eba",Je=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onDisabledRange=function(e,t){var a=!1;return"end"==t&&(a=Z()(e.getTime()).add(1,"days")<=(new Date).getTime()),"start"==t&&(a=e.getTime()<=(new Date).getTime()),a},n.onDisabledRange1=function(e,t){var a=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),n=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(a.end_time).format("HH:mm:ss");return"start"==t&&(n=s<"23:59:59"?Z()(i).isBefore(a.begin_time)||Z()(i).subtract(1,"days").isAfter(a.end_time):Z()(i).isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),"end"==t&&(n=Z()(i).add(1,"days").isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),n},n.onDisabledRange2=function(e,t){var a=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(n.state.model.entry_time[1]).format("HH:mm:ss");return"start"==t&&(a=s<"23:59:59"?Z()(i).isBefore(n.state.model.entry_time[0])||Z()(i).subtract(1,"days").isAfter(n.state.model.entry_time[1]):Z()(i).isBefore(n.state.model.entry_time[0])||Z()(i).isAfter(n.state.model.entry_time[1])),"end"==t&&(a=Z()(i).add(1,"days").isBefore(n.state.model.entry_time[0])||Z()(i).isAfter(n.state.model.entry_time[1])),a},n.onDisabledTime=function(e,t){var a=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),n=new Date(a.begin_time),i=n.getHours(),s=n.getMinutes(),c=n.getSeconds();return Object(Q.a)(e,n)?{disabledHours:function(){return Ae(i)},disabledMinutes:function(e){return e===i?Ae(s):[]},disabledSeconds:function(e,t){return e===i&&t===s?Ae(c):[]}}:{}},n.onDisabledTime1=function(e,t){var a=new Date(n.state.model.entry_time[0]),i=a.getHours(),s=a.getMinutes(),c=a.getSeconds();return Object(Q.a)(e,a)?{disabledHours:function(){return Ae(i)},disabledMinutes:function(e){return e===i?Ae(s):[]},disabledSeconds:function(e,t){return e===i&&t===s?Ae(c):[]}}:{}},n.state={model:{channel:"1",entry_time:[],batch_goods_name:"",channel_activity_id:"",temp_no:"",weight:"0",price:"",recharge_amount:"",denomination:"",reduce_amount:"",all_budget:"",day_budget:"",card_type:[],natural_limit:"1",brush_limit:"1",instruction:R,early_per:[],early_notifier:[],receive_number:"",receive_type:"all",usable_time:"",fixed_time:[],timer:[],timer_type:"1",effect_date_type:"",effect_date:"",irregularDate:[[]],irregularTime:[[]],ruleDate:[[]],ruleWeek:[],send_num:1,provider:"lsxd",receive_mode:1,is_webview:0,timer_show:1,notice:Ve},subjectList:[],TimeDiffer:"",visible:!1,warningInput:"",input_early_per:"",getTimeList:[{key:"0",text:"\u7acb\u5373\u751f\u6548",disabled:!1},{key:"1",text:"\u6b21\u65e5\u751f\u6548",disabled:!1}],userSelectList:[],form_data:{}},n}return Object(y.a)(a,[{key:"componentWillMount",value:function(){if(this.props.data){var e,t,a,n,i,s,c=this.state.model;if(c.entry_time[0]=this.props.data.time_limit.effect_time.start_time,c.entry_time[1]=this.props.data.time_limit.effect_time.end_time,c.timer_show=Number(this.props.data.time_limit.timer_show)||1,c.instruction=this.props.data.instruction,this.props.data.notice&&(c.notice=this.props.data.notice),c.fixed_time[0]=null===(e=this.props.data.time_limit.use_time.fiexd_time)||void 0===e?void 0:e.start_time,c.fixed_time[1]=null===(t=this.props.data.time_limit.use_time.fiexd_time)||void 0===t?void 0:t.end_time,"week"===this.props.data.time_limit.use_time.type)c.ruleWeek=null===(a=this.props.data.time_limit.use_time)||void 0===a?void 0:a.week,c.ruleDate=null===(n=this.props.data.time_limit.use_time)||void 0===n?void 0:n.time;if("irregular"===this.props.data.time_limit.use_time.type)c.irregularDate=null===(i=this.props.data.time_limit.use_time)||void 0===i?void 0:i.day,c.irregularTime=null===(s=this.props.data.time_limit.use_time)||void 0===s?void 0:s.time;this.setState({model:c}),this.getSubject(this.props.data.channel)}else if(this.props.combining){var o=this.state.model;o.channel=this.props.combining.channel,o.receive_mode=this.props.combining.receive_mode,o.entry_time=this.props.combining.date_time,this.setState({model:o}),this.onHandleChangeChannel(this.props.combining.channel),this.getSubject(o.channel)}else this.getSubject(this.state.model.channel);this.getUserSelectList(),this.getTimeDiff()}},{key:"addOrMoveFunction",value:function(e,t,a,n,i){var s,c=this;if(null===(s=this.props.data)||void 0===s||!s.id)return Object(b.jsxs)(b.Fragment,{children:[0!==e?Object(b.jsx)("p",{className:"move",onClick:function(){var n=a;n.splice(e,1),c.setState(Object(se.a)({},t,n))},children:"\u5220\u9664"}):null,e===a.length-1?Object(b.jsx)("p",{className:"add",onClick:function(){if(n||a.length<3){var e=a;e.push([]),c.setState(Object(se.a)({},t,e))}else i&&h.a.warn(i)},children:"\u6dfb\u52a0"}):null]})}},{key:"echoFun",value:function(e){var t=this;if(this.props.data){var a,n,i,s=this.state.model;for(var c in this.props.data)s[c]=this.props.data[c];s.weight=String(this.props.data.weight),s.is_webview=Number(this.props.data.is_webview)||0,s.early_per=this.props.data.early_per.map((function(e){return String(e)})),s.channel=String(this.props.data.channel),s.natural_limit=String(this.props.data.natural_limit),s.brush_limit=String(this.props.data.brush_limit),s.card_type=this.props.data.card_type.map((function(e){return String(e)})),s.receive_number=this.props.data.receive_conf.num,s.receive_type=this.props.data.receive_conf.type,s.receive_mode=this.props.data.receive_mode,s.timer[0]=this.props.data.time_limit.receive_time.start_time,s.timer[1]=this.props.data.time_limit.receive_time.end_time,s.timer_type=null!==(a=this.props.data.time_limit.receive_time)&&void 0!==a&&a.start_time?"2":"1",s.effect_date_type=this.state.getTimeList[Number(this.props.data.time_limit.use_time.effect_date_type)],s.effect_date=this.props.data.time_limit.use_time.effect_day,s.usable_time=this.props.data.time_limit.use_time.type,s.early_notifier=null===(n=this.props.data.early_notifier)||void 0===n?void 0:n.map((function(t){return null===e||void 0===e?void 0:e.map((function(e){if((null===t||void 0===t?void 0:t.mobile)===e.key||(null===t||void 0===t?void 0:t.real_name)===e.text)return e})).filter((function(e){return e}))[0]})).filter((function(e){return e})),s.origin=this.props.data,((null===(i=this.props.data)||void 0===i?void 0:i.early_per)||[]).map((function(e){return-1===Ee.indexOf(e)?t.setState({input_early_per:e,model:s}):t.setState({model:s})}))}}},{key:"calculateInventory",value:function(){var e,t=this.state.model.recharge_amount/this.state.model.reduce_amount,a=isNaN(t)||!isFinite(t)?0:t;return Object(b.jsxs)("p",{style:{marginTop:"20px",color:"red"},children:["\u5145\u503c\u6279\u6b21\u5e93\u5b58\uff1a",Math.floor(a),"\xa0\xa0\u5145\u503c\u6279\u6b21\u5269\u4f59\u5e93\u5b58\uff1a",null!==(e=this.props.data)&&void 0!==e&&e.usage?Math.floor(a-this.state.model.reduce_amount*this.props.data.usage/this.state.model.reduce_amount):Math.floor(a),"\xa0\xa0\u9884\u8b66\u5e93\u5b58\u503c\uff1a",this.state.model.early_per.length?this.state.model.early_per.map((function(e){return(a*(e/100)).toFixed(0)})).sort((function(e,t){return t-e})).filter((function(e){return Number(e)})).join(","):0]})}},{key:"getUserSelectList",value:function(e){var t=this;Object(s.Tb)().then((function(e){return Object(s.cc)(e,(function(e,a){var n=e.default.map((function(e){return e.real_name})),i=e.default.map((function(e){return e.mobile})),s=[],c=e.data.map((function(e){if(-1!==n.indexOf(e.real_name)||-1!==i.indexOf(e.mobile)){var t={key:e.mobile,text:e.real_name,disabled:!0,closable:!1};return s.push(t),t}return{key:e.mobile,text:e.real_name,closable:!0}}));t.onHandleChange(s,"early_notifier"),t.setState({userSelectList:c}),t.echoFun(c)}),(function(e){h.a.error(e)}))}))}},{key:"filterEarlyPer",value:function(){var e=this,t=this.state.model.early_per.filter((function(t){return t!==e.state.input_early_per}));this.onHandleChange(t,"early_per")}},{key:"submit",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a,i,s,c,o,r=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.refs.form.validator()&&this.refs.form1.validator()&&this.refs.form2.validator()&&this.refs.form4.validator()&&this.refs.voucherBatchRef.validator())){e.next=30;break}if(!this.props.data){e.next=16;break}if(a=[],sessionStorage.getItem("knockGoldData")&&(a=JSON.parse(sessionStorage.getItem("knockGoldData"))),!1!==this.limitFunction()){e.next=6;break}return e.abrupt("return",!1);case 6:return i=a.findIndex((function(e){return e.channel_activity_id===r.props.data.channel_activity_id})),null!==(t=this.props.data)&&void 0!==t&&t.goods_id?a[i]=Object.assign(Object(n.a)(Object(n.a)({},this.state.model.origin),this.transformDataCode())):a[i]=this.transformDataCode(),a[i].voucher_batch=this.refs.voucherBatchRef.getVoucherBatchData(),a[i].channel_activity_id=a[i].voucher_batch[0].channel_activity_id,"1"===a[i].channel&&(a[i].temp_no=a[i].voucher_batch[0].temp_no),sessionStorage.setItem("knockGoldData",JSON.stringify(a)),this.setState({form_data:a[i]}),e.abrupt("return",!0);case 16:if(!1!==this.limitFunction()){e.next=18;break}return e.abrupt("return",!1);case 18:return s=[],sessionStorage.getItem("knockGoldData")&&(s=JSON.parse(sessionStorage.getItem("knockGoldData"))),c=s||[],(o=this.transformDataCode()).voucher_batch=this.refs.voucherBatchRef.getVoucherBatchData(),o.channel_activity_id=o.voucher_batch[0].channel_activity_id,"1"===o.channel&&(o.temp_no=o.voucher_batch[0].temp_no),c.push(o),sessionStorage.setItem("knockGoldData",JSON.stringify(c)),this.setState({form_data:o}),e.abrupt("return",!0);case 30:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"detectTimeConflict",value:function(e){for(var t=0;t=s&&as}}},{key:"transformDataCode",value:function(){var e,t={};return t.channel=this.state.model.channel,t.provider=this.state.model.provider,t.receive_mode=this.state.model.receive_mode,1==t.channel?t.temp_no=this.state.model.temp_no:t.temp_no="",t.batch_goods_name=this.state.model.batch_goods_name,t.channel_activity_id=this.state.model.channel_activity_id,t.voucher_batch=this.state.model.voucher_batch,t.price=this.state.model.price,t.recharge_amount=this.state.model.recharge_amount,t.send_num=this.state.model.send_num,t.denomination=this.state.model.denomination,t.reduce_amount=this.state.model.reduce_amount,t.all_budget=this.state.model.all_budget,t.day_budget=this.state.model.day_budget,t.card_type=this.state.model.card_type,t.natural_limit=this.state.model.natural_limit,t.brush_limit=this.state.model.brush_limit,t.instruction=this.state.model.instruction,t.notice=this.state.model.notice,t.early_per=this.state.model.early_per.filter((function(e){return e})),t.early_notifier=this.state.model.early_notifier.map((function(e){return{real_name:e.text,mobile:e.key}})),t.is_webview=this.state.model.is_webview,t.weight=this.state.model.weight,t.receive_conf={type:this.state.model.receive_type,num:this.state.model.receive_number},t.time_limit={effect_time:{start_time:this.state.model.entry_time[0],end_time:this.state.model.entry_time[1]},timer_show:this.state.model.timer_show,receive_time:{start_time:this.state.model.timer[0],end_time:this.state.model.timer[1]},use_time:Object(n.a)(Object(n.a)({type:this.state.model.usable_time},this.withTimeFunction(this.state.model.usable_time)),{},{effect_day:this.state.model.effect_date,effect_date_type:null===(e=this.state.model.effect_date_type)||void 0===e?void 0:e.key})},t}},{key:"withTimeFunction",value:function(e){var t={};switch(e){case"week":t.time=this.state.model.ruleDate,t.week=this.state.model.ruleWeek;break;case"irregular":t.time=this.state.model.irregularTime,t.day=this.state.model.irregularDate;break;default:t.fiexd_time={start_time:this.state.model.fixed_time[0],end_time:this.state.model.fixed_time[1]}}return t}},{key:"testDateFunction",value:function(e){var t=this;return e.map((function(e){return t.setTime(e)})).filter((function(e){return e}))}},{key:"getSubject",value:function(e){var t=this;Object(s.Lb)(e).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.map((function(e){return{key:e.id,text:e.name}}));t.setState({subjectList:n})}),(function(e){h.a.error(e)}))}))}},{key:"limitFunction",value:function(){if(!this.state.model.card_type.length)return h.a.error("\u8bf7\u9009\u62e9\u5361\u79cd"),!1;if(this.state.model.early_per.filter((function(e){return e})).length<1)return h.a.error("\u8bf7\u9009\u9884\u8b66\u767e\u5206\u6bd4"),!1;if((2==this.state.model.channel||1==this.state.model.channel&&1==this.state.model.receive_mode&&!this.props.combining)&&!this.state.model.notice)return h.a.error("\u8bf7\u8f93\u5165\u4f7f\u7528\u987b\u77e5"),!1;if(!this.state.model.usable_time)return h.a.error("\u8bf7\u9009\u62e9\u53ef\u7528\u65f6\u95f4\u6bb5\u7c7b\u578b"),!1;var e;if("received"===this.state.model.usable_time&&(null===(e=this.state.model.effect_date_type)||void 0===e||!e.key||!this.state.model.effect_date))return h.a.error("\u8bf7\u5b8c\u6574\u7684\u586b\u5199\u6216\u9009\u62e9\u53ef\u7528\u65f6\u95f4\u6bb5"),!1;if((this.state.TimeDifferNumber(this.state.model.effect_date))&&"received"===this.state.model.usable_time)return h.a.error("\u6709\u9650\u671f\u4e0d\u5141\u8bb8\u5927\u4e8e\u751f\u6548\u65f6\u95f4\u6bb5 \u6ce8\uff1a\u5f53\u524d\u6709\u6548\u671f\u6700\u5c0f\u65f6\u95f4\u4e3a 1 \u5929\uff0c\u6700\u5927\u65f6\u95f4\u4e3a ".concat(this.state.TimeDiffer," \u5929")),!1;if("fiexd"===this.state.model.usable_time&&this.setTime(this.state.model.fixed_time))return h.a.error("\u8bf7\u5b8c\u6574\u7684\u9009\u62e9\u56fa\u5b9a\u65f6\u95f4\u6bb5"),!1;if("fiexd"===this.state.model.usable_time&&this.state.model.fixed_time[0]>this.state.model.entry_time[1]||"fiexd"===this.state.model.usable_time&&this.state.model.fixed_time[1]>this.state.model.entry_time[1])return h.a.error("\u56fa\u5b9a\u5f00\u59cb\u65f6\u95f4\u6216\u7ed3\u675f\u65f6\u95f4\u4e0d\u5141\u8bb8\u5927\u4e8e\u751f\u6548\u7ed3\u675f\u65f6\u95f4"),!1;if("week"===this.state.model.usable_time&&(this.testDateFunction(this.state.model.ruleDate).length>0||this.state.model.ruleWeek.length<1))return h.a.error("\u8bf7\u5b8c\u6574\u7684\u9009\u62e9\u89c4\u5219\u65e5\u671f\u548c\u65f6\u95f4"),!1;if("irregular"===this.state.model.usable_time&&(this.testDateFunction(this.state.model.irregularDate).length>0||this.testDateFunction(this.state.model.irregularTime).length>0))return h.a.error("\u8bf7\u5b8c\u6574\u7684\u9009\u62e9\u4e0d\u89c4\u5219\u65e5\u671f\u548c\u65f6\u95f4"),!1;if(this.detectTimeConflict(this.state.model.ruleDate))return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u89c4\u5219\u65f6\u95f4\u5b58\u5728\u4ea4\u96c6"),!1;if(this.detectTimeConflict(this.state.model.irregularDate))return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65e5\u671f\u5b58\u5728\u4ea4\u96c6"),!1;if(this.detectTimeConflict(this.state.model.irregularTime))return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65f6\u95f4\u5b58\u5728\u4ea4\u96c6"),!1;var t=/^-?\d+\.?\d{0,2}$/;return t.test(this.state.model.denomination)&&t.test(this.state.model.reduce_amount)?this.state.model.denomination-0this.state.model.all_budget-0?(h.a.error("\u5145\u503c\u6279\u6b21\u91d1\u989d\u4e0d\u5141\u8bb8\u5927\u4e8e\u603b\u9884\u7b97"),!1):this.state.model.all_budget-014?(h.a.error("\u76ee\u524d\u4ec5\u652f\u6301\u65b0\u589e10\u4e2a\u9884\u8b66\u901a\u77e5\u4eba"),!1):void 0:(h.a.error("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u9762\u989d\u91d1\u989d\u6216\u7acb\u51cf\u91d1\u989d\uff08\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\uff09"),!1)}},{key:"setTime",value:function(e){if(!Object(pe.a)(e)||0===(null===e||void 0===e?void 0:e.length))return!0;var t=e.map((function(e){return Boolean(e)})),a=null;return t.map((function(e){e||(a=!0)})),a}},{key:"onHandleChange",value:function(e,t,a){var n=this.state.model;a?n[t][a]=e:n[t]=e,this.setState({model:n})}},{key:"getTimeDiff",value:function(){if(this.state.model.entry_time[1]){var e=function(e,t){var a=new Date(e).getTime()/1e3,n=new Date(t).getTime()/1e3,i="",s="";a\n2\u3001\u5fae\u4fe1\u7acb\u51cf\u91d1\u4e00\u65e6\u9886\u53d6\u4e0d\u53ef\u64a4\u9500\u3001\u4e0d\u53ef\u8f6c\u8ba9\u3002\u6ce8\u610f\u4e0d\u8981\u5c06\u5151\u6362\u5238\u6cc4\u9732\u7ed9\u4ed6\u4eba","notice"),this.onHandleChange(z,"instruction")):this.onHandleChange(Y,"instruction"),1!=e&&this.onHandleChange(1,"receive_mode"),2!=e&&3!=e||this.onHandleChange("voucher_wechat_lsxd","provider"),1==e&&this.onHandleChange("lsxd","provider")}},{key:"render",value:function(){var e,t,a,n,i,s,l,d,u,h,f,j,g,y,_,v,x,O,S,w,C,N,D,I,T,F,L,M,H,q,P,B=this;return Object(b.jsxs)("div",{id:"addKnockGold",children:[Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u57fa\u672c\u4fe1\u606f",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:_e.basic,ref:"form",children:[Object(b.jsx)(c.a,{labelname:"\u6e20\u9053",prop:"channel",id:"channel",children:Object(b.jsxs)(te.a,{disabled:!(null===(e=this.props.data)||void 0===e||!e.id)||!!this.props.combining,onChange:function(e){var t=e.target;B.onHandleChangeChannel(t.value),B.onHandleChange(0,"is_webview"),1!=t.value&&2!=t.value||B.getSubject(t.value)},value:this.state.model.channel,children:[Object(b.jsx)(me.a,{value:"1",children:"\u652f\u4ed8\u5b9d"}),Object(b.jsx)(me.a,{value:"2",children:"\u5fae\u4fe1"}),this.props.ysf?null:Object(b.jsx)(me.a,{value:"3",children:"\u4e91\u95ea\u4ed8"})]})}),2!=this.state.model.channel||this.props.combining?null:Object(b.jsx)(c.a,{labelname:"\u6253\u5f00\u65b9\u5f0f",prop:"is_webview",id:"is_webview",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;B.onHandleChange(t.value,"is_webview")},value:this.state.model.is_webview,disabled:!(null===(t=this.props.data)||void 0===t||!t.id),children:[Object(b.jsx)(me.a,{value:0,children:"\u5c0f\u7a0b\u5e8f"}),Object(b.jsx)(me.a,{value:1,disabled:2===Number(sessionStorage.getItem("keyType")),children:"\u516c\u4f17\u53f7"}),Object(b.jsx)(me.a,{value:2,disabled:2===Number(sessionStorage.getItem("keyType")),children:"\u901a\u7528\u9886\u53d6"})]})},"is_webview"),1!=this.state.model.channel||this.props.ysf?null:Object(b.jsx)(c.a,{labelname:"\u9886\u53d6\u65b9\u5f0f",prop:"receive_mode",id:"receive_mode",children:Object(b.jsxs)(te.a,{disabled:!!this.props.combining,onChange:function(e){var t=e.target;B.onHandleChange(t.value,"receive_mode")},value:this.state.model.receive_mode,children:[Object(b.jsx)(me.a,{value:1,children:"\u5b98\u65b9\u9886\u53d6"}),Object(b.jsx)(me.a,{value:2,children:"\u8d26\u53f7\u9886\u53d6"})]})},"receive_mode"),this.state.subjectList.length>0?Object(b.jsx)(c.a,{noLabel:!0,required:!1,labelwidth:"0px",children:Object(b.jsx)(He,{ref:"voucherBatchRef",isEdit:!(null===(a=this.props.data)||void 0===a||!a.id),channel:this.state.model.channel,subjectList:this.state.subjectList,voucherBatchData:null===(n=this.props.data)||void 0===n?void 0:n.voucher_batch})}):null,Object(b.jsx)(c.a,{labelname:"\u6279\u6b21\u5546\u54c1\u540d\u79f0",prop:"batch_goods_name",id:"batch_goods_name",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"batch_goods_name")},onClearItem:function(){B.onHandleChange("","batch_goods_name")},value:this.state.model.batch_goods_name,disabled:!(null===(i=this.props.data)||void 0===i||!i.id),placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:30,height:"36px",width:"520px",alignment:"left"})}),this.props.combining?null:Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u6743\u91cd",prop:"weight",id:"weight",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"weight")},onClearItem:function(){B.onHandleChange("","weight")},value:this.state.model.weight,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:3,height:"36px",width:"520px",countShow:!1,alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5408\u540c\u5355\u4ef7",prop:"price",id:"price",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"price")},onClearItem:function(){B.onHandleChange("","price")},value:this.state.model.price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:7,height:"36px",disabled:!(null===(s=this.props.data)||void 0===s||!s.id),width:"520px",unit:"\u5143",countShow:!1,alignment:"left"})}),Object(b.jsxs)(c.a,{labelname:"\u5145\u503c\u6279\u6b21\u91d1\u989d",prop:"recharge_amount",id:"recharge_amount",children:[Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"recharge_amount")},onClearItem:function(){B.onHandleChange("","recharge_amount")},value:this.state.model.recharge_amount,disabled:!(null===(l=this.props.data)||void 0===l||!l.id),placeholder:"\u8bf7\u8f93\u5165",unit:"\u5143",countShow:!1,labelWidth:"0px",maxLength:9,height:"36px",width:"520px",alignment:"left"}),this.state.model.id?Object(b.jsx)(m.a,{onClick:function(e){B.setState({visible:!0})},children:"\u52a0\u6b3e"}):null]})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u53d1\u653e\u89c4\u5219",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:_e.grant,ref:"form1",children:[Object(b.jsxs)(c.a,{id:"denomination",labelname:"\u9762\u989d",children:[Object(b.jsx)("span",{children:"\u6ee1"}),Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"denomination")},onClearItem:function(){B.onHandleChange("","denomination")},value:this.state.model.denomination,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",unit:"\u5143",disabled:!(null===(d=this.props.data)||void 0===d||!d.id),countShow:!1,maxLength:7,height:"36px",width:"231px",alignment:"left"}),Object(b.jsx)("span",{className:"JIan",children:"\u51cf"}),Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"reduce_amount")},onClearItem:function(){B.onHandleChange("","reduce_amount")},value:this.state.model.reduce_amount,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",unit:"\u5143",disabled:!(null===(u=this.props.data)||void 0===u||!u.id),countShow:!1,maxLength:7,height:"36px",width:"231px",alignment:"left"})]}),Object(b.jsx)(c.a,{id:"all_budget",labelname:"\u603b\u9884\u7b97",prop:"all_budget",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"all_budget")},onClearItem:function(){B.onHandleChange("","all_budget")},value:this.state.model.all_budget,placeholder:"\u8bf7\u8f93\u5165",disabled:!(null===(h=this.props.data)||void 0===h||!h.id),labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"day_budget",labelname:"\u5355\u5929\u9884\u7b97\u53d1\u653e\u4e0a\u9650",prop:"day_budget",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"day_budget")},onClearItem:function(){B.onHandleChange("","day_budget")},disabled:!(null===(f=this.props.data)||void 0===f||!f.id),value:this.state.model.day_budget,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"send_num",labelname:"\u5355\u6b21\u5230\u8d26",prop:"send_num",children:Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"send_num")},onClearItem:function(){B.onHandleChange("","send_num")},disabled:!(null===(j=this.props.data)||void 0===j||!j.id),value:this.state.model.send_num,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5f20",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsxs)(c.a,{id:"receive_number",labelname:"\u7528\u6237\u53ef\u9886\u4e2a\u6570",prop:"receive_number",children:[Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"receive_number")},onClearItem:function(){B.onHandleChange("","receive_number")},disabled:!(null===(g=this.props.data)||void 0===g||!g.id),value:this.state.model.receive_number,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:4,height:"36px",unit:"\u4e2a",countShow:!1,width:"304px",alignment:"left"}),Object(b.jsx)(te.a,{disabled:!(null===(y=this.props.data)||void 0===y||!y.id),onChange:function(e){var t=e.target;B.onHandleChange(t.value,"receive_type")},value:this.state.model.receive_type,children:Pe.map((function(e){var t=e.key,a=e.text;return Object(b.jsx)(me.a,{value:t,children:a},t)}))})]}),Object(b.jsx)(c.a,{id:"card_type",labelname:"\u5361\u79cd",prop:"card_type",children:Object(b.jsx)(be.a,{disabled:!(null===(_=this.props.data)||void 0===_||!_.id),value:this.state.model.card_type,onChange:function(e){B.onHandleChange(e,"card_type")},children:qe.map((function(e){return Object(b.jsx)(k.a,{value:e.key,children:e.text},e.key)}))})}),Object(b.jsx)(c.a,{id:"natural_limit",labelname:"\u662f\u5426\u5f00\u542f\u81ea\u7136\u4eba\u9650\u5236",prop:"natural_limit",children:Object(b.jsxs)(te.a,{disabled:!(null===(v=this.props.data)||void 0===v||!v.id),onChange:function(e){var t=e.target;B.onHandleChange(t.value,"natural_limit")},value:this.state.model.natural_limit,children:[Object(b.jsx)(me.a,{value:"1",children:"\u662f"}),Object(b.jsx)(me.a,{value:"5",children:"\u5426"})]})}),Object(b.jsx)(c.a,{id:"brush_limit",labelname:"\u662f\u5426\u5f00\u542f\u9632\u5237\u62e6\u622a",prop:"brush_limit",children:Object(b.jsxs)(te.a,{disabled:!(null===(x=this.props.data)||void 0===x||!x.id),onChange:function(e){var t=e.target;B.onHandleChange(t.value,"brush_limit")},value:this.state.model.brush_limit,children:[Object(b.jsx)(me.a,{value:"1",children:"\u662f"}),Object(b.jsx)(me.a,{value:"5",children:"\u5426"})]})})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u65f6\u95f4\u9650\u5236",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:_e.time,ref:"form2",children:[this.props.combining?null:Object(b.jsxs)(c.a,{id:"entry_time",labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"entry_time",children:[Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",disabled:[!(null===(O=this.props.data)||void 0===O||!O.id),!(null===(S=this.props.data)||void 0===S||!S.id)],width:245,value:this.state.model.entry_time,onChange:function(e){B.onHandleChange(e,"entry_time"),B.getTimeDiff()},disabledTime:this.onDisabledTime,disabledDate:this.onDisabledRange1}),this.props.ysf?null:Object(b.jsxs)(te.a,{style:{marginLeft:"20px"},onChange:function(e){var t=e.target;B.onHandleChange(t.value,"timer_show")},value:this.state.model.timer_show,children:[Object(b.jsx)(me.a,{value:1,children:"\u663e\u793a"}),Object(b.jsx)(me.a,{value:2,children:"\u9690\u85cf"})]})]}),this.props.combining?null:Object(b.jsx)(b.Fragment,{children:"2"===this.state.model.timer_type?Object(b.jsxs)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",prop:"timer",children:[Object(b.jsx)(fe.a,{disabled:!(null===(w=this.props.data)||void 0===w||!w.id),className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:this.state.model.timer,onChange:function(e){B.onHandleChange(e,"timer")},width:"240px",disabledTime:this.onDisabledRange}),Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;B.onHandleChange(t.value,"timer_type"),"1"===t.value&&B.onHandleChange("","timer")},disabled:!(null===(C=this.props.data)||void 0===C||!C.id),value:this.state.model.timer_type,children:[Object(b.jsx)(me.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:"2",children:"\u6bcf\u65e5"})]})]}):Object(b.jsx)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;B.onHandleChange(t.value,"timer_type")},disabled:!(null===(N=this.props.data)||void 0===N||!N.id),value:this.state.model.timer_type,children:[Object(b.jsx)(me.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:"2",children:"\u6bcf\u65e5"})]})})}),Object(b.jsxs)(c.a,{id:"usable_time",labelname:"\u53ef\u7528\u65f6\u95f4\u6bb5",prop:"official_price",children:[Object(b.jsxs)("div",{className:"boxTime",children:[Object(b.jsx)(te.a,{value:this.state.model.usable_time,disabled:!(null===(D=this.props.data)||void 0===D||!D.id),onChange:function(e){var t=e.target;B.onHandleChange(t.value,"usable_time"),B.onHandleChange([],"fixed_time"),B.onHandleChange([[]],"irregularDate"),B.onHandleChange([[]],"irregularTime"),B.onHandleChange([],"ruleWeek"),B.onHandleChange([[]],"ruleDate")},children:Object(b.jsx)(ae.a,{value:"received",children:"\u9886\u53d6\u540e"})}),"received"===this.state.model.usable_time?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("div",{className:"zent-demo-select-basic select-basic",children:Object(b.jsx)(ne.a,{clearable:!0,options:this.state.getTimeList,placeholder:"\u9009\u62e9\u4e00\u9879",onChange:function(e){B.onHandleChange(e,"effect_date_type")},value:this.state.model.effect_date_type,className:"select-basic",disabled:!(null===(I=this.props.data)||void 0===I||!I.id),width:"195px",popupWidth:"195px",disableSearch:!0})}),Object(b.jsx)("span",{className:"effect_dates",children:"\u6709\u6548\u671f"}),Object(b.jsx)(r.a,{onChange:function(e){B.onHandleChange(e,"effect_date")},onClearItem:function(){B.onHandleChange("","effect_date")},disabled:!(null===(T=this.props.data)||void 0===T||!T.id),value:this.state.model.effect_date,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:3,height:"36px",unit:"\u5929",countShow:!1,width:"172px",alignment:"left"})]}):null]}),Object(b.jsxs)("div",{className:"boxTime",style:{marginTop:"15px"},children:[Object(b.jsx)(te.a,{disabled:!(null===(F=this.props.data)||void 0===F||!F.id),value:this.state.model.usable_time,onChange:function(e){var t=e.target;B.onHandleChange(t.value,"usable_time"),B.onHandleChange("","effect_date_type"),B.onHandleChange("","effect_date"),B.onHandleChange([[]],"irregularDate"),B.onHandleChange([[]],"irregularTime"),B.onHandleChange([],"ruleWeek"),B.onHandleChange([[]],"ruleDate")},children:Object(b.jsx)(ae.a,{value:"fiexd",children:"\u56fa\u5b9a\u65f6\u95f4"})}),"fiexd"===this.state.model.usable_time?Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",disabled:[!(null===(L=this.props.data)||void 0===L||!L.id),!(null===(M=this.props.data)||void 0===M||!M.id)],width:195,value:this.state.model.fixed_time,onChange:function(e){B.onHandleChange(e,"fixed_time")},disabledDate:this.onDisabledRange2,disabledTime:this.onDisabledTime1}):null]}),Object(b.jsxs)("div",{className:"boxTime column",children:[Object(b.jsx)(te.a,{className:"column_label",disabled:!(null===(H=this.props.data)||void 0===H||!H.id),value:this.state.model.usable_time,onChange:function(e){var t=e.target;B.onHandleChange(t.value,"usable_time"),B.onHandleChange("","effect_date_type"),B.onHandleChange("","effect_date"),B.onHandleChange([[]],"fixed_time"),B.onHandleChange([[]],"irregularDate"),B.onHandleChange([[]],"irregularTime")},children:Object(b.jsx)(ae.a,{value:"week",children:"\u6709\u6548\u671f\u5185\uff0c\u89c4\u5219\u65e5\u671f\u53ef\u7528"})}),"week"===this.state.model.usable_time?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(k.a.Group,{value:this.state.model.ruleWeek,onChange:function(e){return B.onHandleChange(e,"ruleWeek")},style:{marginLeft:"25px",marginTop:"20px"},children:Be.map((function(e){var t;return Object(b.jsx)(k.a,{className:"checkbox",disabled:!(null===(t=B.props.data)||void 0===t||!t.id),value:e.text,children:e.text},e.key)}))}),this.state.model.ruleDate.map((function(e,t){var a;return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(fe.a,{disabled:!(null===(a=B.props.data)||void 0===a||!a.id),className:"zent-datepicker-plan column_datepicker",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:B.state.model.ruleDate[t],onChange:function(e){var a=B.state.model.ruleDate;a[t]=e,B.onHandleChange(a,"ruleDate")},width:205,disabledTime:B.onDisabledRange}),B.addOrMoveFunction(t,"ruleDate",B.state.model.ruleDate,!1,"\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5")]},t)})),Object(b.jsx)("p",{className:"notice",children:"\u8bf7\u6309\u716724\u5c0f\u65f6\u5236\u8f93\u5165\u53ef\u7528\u65f6\u6bb5\uff0c\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5"})]}):null]}),Object(b.jsxs)("div",{className:"boxTime column",style:{marginTop:"15px"},children:[Object(b.jsx)(te.a,{disabled:!(null===(q=this.props.data)||void 0===q||!q.id),value:this.state.model.usable_time,onChange:function(e){var t=e.target;B.onHandleChange(t.value,"usable_time"),B.onHandleChange("","effect_date_type"),B.onHandleChange("","effect_date"),B.onHandleChange([[]],"fixed_time"),B.onHandleChange([],"ruleWeek"),B.onHandleChange([[]],"ruleDate")},children:Object(b.jsx)(ae.a,{value:"irregular",children:"\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65e5\u671f\u53ef\u7528"})}),"irregular"===this.state.model.usable_time?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("p",{className:"notice",style:{width:"500px"},children:"\u53ef\u5728\u6709\u6548\u671f\u5185\u4efb\u610f\u9009\u62e9\u65f6\u95f4\u5929\u6570\uff0c\u4ee5\u53ca\u53ef\u7528\u65f6\u6bb5\u3002 \u56e0\u5f53\u524d\u5fae\u4fe1\u652f\u6301\u95ee\u9898\uff0c\u5982\u9009\u62e9\u4e0d\u89c4\u5219\u65f6\u95f4\uff0c\u5fae\u4fe1\u5361\u5305\u5185\u5f53\u524d\u4ec5\u4f1a\u5c55\u793a\u6709\u6548\u671f\uff0c\u5efa\u8bae \u5c06\u5177\u4f53\u53ef\u7528\u65e5\u671f\u4ee5\u53ca\u65f6\u95f4\u6bb5\u586b\u5199\u5728\u4f7f\u7528\u8bf4\u660e\u5185\u3002"}),this.state.model.irregularDate.map((function(e,t){var a,n;return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(ie.a,{className:"zent-datepicker-plan column_datepicker",format:"YYYY-MM-DD",disabled:[!(null===(a=B.props.data)||void 0===a||!a.id),!(null===(n=B.props.data)||void 0===n||!n.id)],width:205,value:B.state.model.irregularDate[t],onChange:function(e){var a=B.state.model.irregularDate;a[t]=e,B.onHandleChange(a,"irregularDate")},disabledDate:B.onDisabledRange2,disabledTime:B.onDisabledTime1}),B.addOrMoveFunction(t,"irregularDate",B.state.model.irregularDate,!0)]},t)})),this.state.model.irregularTime.map((function(e,t){var a;return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(fe.a,{disabled:!(null===(a=B.props.data)||void 0===a||!a.id),className:"zent-datepicker-plan column_datepicker",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:B.state.model.irregularTime[t],onChange:function(e){var a=B.state.model.irregularTime;a[t]=e,B.onHandleChange(a,"irregularTime")},width:205,disabledTime:B.onDisabledRange}),B.addOrMoveFunction(t,"irregularTime",B.state.model.irregularTime,!1,"\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5")]},t)}))]}):null]})]})]})}),Object(b.jsxs)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u9884\u8b66\u89c4\u5219",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:_e.warning,ref:"form4",children:[Object(b.jsxs)(c.a,{id:"early_per",labelname:"\u9884\u8b66\u767e\u5206\u6bd4",children:[Object(b.jsxs)(be.a,{value:this.state.model.early_per,onChange:function(e){B.onHandleChange(e,"early_per")},children:[Ee.map((function(e){return Object(b.jsxs)(k.a,{value:e,children:[e,"%"]},e)})),Object(b.jsx)(k.a,{value:this.state.input_early_per})]}),Object(b.jsx)(r.a,{className:"percent",onChange:function(e){B.filterEarlyPer(),B.setState({input_early_per:e})},onClearItem:function(){B.filterEarlyPer(),B.setState({input_early_per:""})},value:this.state.input_early_per,placeholder:"",labelWidth:"0px",maxLength:3,height:"36px",unit:"%",countShow:!1,width:"190px",alignment:"left"})]}),Object(b.jsxs)(c.a,{id:"early_notifier",labelname:"\u9884\u8b66\u901a\u77e5\u4eba",children:[Object(b.jsx)("div",{className:"bt_se",children:Object(b.jsx)(ne.a,{className:"bt_se_select",options:this.state.userSelectList,placeholder:"\u9009\u62e9\u4e00\u9879",size:"xl",value:this.state.warningInput,onChange:function(e){var t=B.state.model;e&&(t.early_notifier.push(e),t.early_notifier=re(t.early_notifier,"key")),B.setState({warningInput:e,model:t})}})}),Object(b.jsx)("div",{className:"userSelect",children:Object(b.jsx)("ol",{children:Object(pe.a)(this.state.model.early_notifier)&&(null===(P=this.state.model.early_notifier)||void 0===P?void 0:P.map((function(e){return Object(b.jsx)(je.a,{closable:null===e||void 0===e?void 0:e.closable,onClose:function(){return B.closeCallback(e)},children:null===e||void 0===e?void 0:e.text},null===e||void 0===e?void 0:e.key)})))})}),this.calculateInventory()]})]}),Object(b.jsx)(ge.a,{visible:this.state.visible,className:"questModal",onClose:function(){return B.setState({visible:!1})},title:"\u52a0\u6b3e",children:Object(b.jsx)(ve,{data:this.state.model,onChangeMoney:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=B.state.model;a.recharge_amount=(t+Number(a.recharge_amount)).toFixed(2),B.setState({visible:e,model:a})}})})]}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u6837\u5f0f\u8bbe\u7f6e",children:Object(b.jsxs)(o.a,{ref:"form3",children:[2==this.state.model.channel||1==this.state.model.channel&&1==this.state.model.receive_mode&&!this.props.combining?Object(b.jsx)(c.a,{id:"notice",labelname:"\u4f7f\u7528\u987b\u77e5",children:Object(b.jsx)(Ne,{pageType:"detaileditor1",setEdittext:function(e){B.onHandleChange(e,"notice")},height:125,width:"520px",text:this.state.model.notice,limitLength:200},this.state.model.channel+1)}):null,Object(b.jsx)(c.a,{id:"instruction",labelname:"\u4f7f\u7528\u8bf4\u660e",required:"",children:Object(b.jsx)(Ne,{pageType:"detaileditor",setEdittext:function(e){B.onHandleChange(e,"instruction")},height:200,width:"520px",text:this.state.model.instruction,limitLength:5e3},this.state.model.channel)})]})}),this.switchComponents()]})}}]),a}(d.Component),We=a(582),ze=a(539),Re=(a(117),function(e){var t=e.data,a=Object(d.useState)([]),n=Object(i.a)(a,2),s=n[0],c=n[1];return Object(d.useEffect)((function(){c(ue(t.receive_rule.week))}),[t.receive_rule.week,t.receive_irregular]),function(){var e,a;switch(t.receive_type){case 1:return Object(b.jsxs)("div",{className:"available_time",children:[Object(b.jsx)("p",{className:"available_time_text",children:"\u9886\u53d6\u65f6\u95f4"}),Object(b.jsx)("ul",{className:"timeList",children:null===s||void 0===s?void 0:s.map((function(e){return Object(b.jsxs)("li",{children:[e,t.receive_rule.time.map((function(e,t){if(e[1])return Object(b.jsxs)("p",{style:{textAlign:"center",marginTop:"5px"},children:[e[0],"~",e[1]]},t)}))]},e)}))})]});case 2:return Object(b.jsxs)("div",{className:"available_time",children:[Object(b.jsx)("p",{className:"available_time_text",children:"\u9886\u53d6\u65f6\u95f4"}),Object(b.jsx)("ul",{className:"timeList",children:null===(e=t.receive_irregular)||void 0===e?void 0:e.map((function(e){return Object(b.jsxs)("li",{children:[e.date,e.time.map((function(e){if(e[1])return Object(b.jsxs)("p",{style:{marginTop:"5px"},children:[e[0],"~",e[1]]},e[1])}))]},e.data)}))})]});case 3:return Object(b.jsxs)("div",{className:"available_time",children:[Object(b.jsx)("p",{className:"available_time_text",children:"\u9886\u53d6\u65f6\u95f4"}),Object(b.jsx)("ul",{className:"timeList",children:null===(a=t.receive_day)||void 0===a?void 0:a.map((function(e){return Object(b.jsx)("li",{children:e.join(" ~ ")},e.item)}))})]});default:return Object(b.jsx)(b.Fragment,{})}}()}),Ye=[24,100,100,100,80,100,100,100,80,100,100,100,80,100,100,100,100],Ke=function(e){var t=e.data;function a(){var e=t.cash_amount_type,a=t.min_denomination,n=t.max_denomination,i={b:"20px",a:"40px"};if("2"===e){var s=String(parseFloat(a)).length+String(parseFloat(n)).length+1;return s>6?{a:32-1.1*(s-6)+"px",b:20-(s-6)+"px"}:i}return i}return Object(b.jsx)("div",{id:"redPacketsViews",className:"mobile",children:Object(b.jsxs)("div",{className:"box",children:[Object(b.jsxs)("div",{className:"top",children:[Object(b.jsx)("p",{className:"title",children:t.batch_goods_name||Object(b.jsx)("span",{children:"\u798f\u5229\u6765\u88ad \xa0\u7ea2\u5305\u5151\u6362"})}),Object(b.jsx)("p",{className:"effect_date",children:Object(b.jsxs)("span",{children:["\u7ea2\u5305\u6709\u9650\u671f\u622a\u6b62:",t.effect_date[1]||"2023-12-30 23:59:59"]})}),Object(b.jsxs)("p",{className:"money",style:{fontSize:a().a},children:[Object(b.jsx)("span",{className:"tag",style:{fontSize:a().b},children:"\uffe5"}),"1"===t.cash_amount_type?parseFloat(t.denomination||.01):"".concat(parseFloat(t.min_denomination||.01),"~").concat(parseFloat(t.max_denomination||88.88))]}),Object(b.jsx)("p",{className:"type",children:Object(b.jsx)("span",{children:"1"===t.cash_amount_type?"\u56fa\u989d\u7ea2\u5305":"\u968f\u673a\u7ea2\u5305"})}),Object(b.jsx)("img",{src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/common_btn_receive.png",className:"bt",alt:""})]}),Object(b.jsxs)("div",{className:"instruction-box",children:[Object(b.jsx)("div",{className:"instruction-header"}),Object(b.jsx)("div",{className:"instruction",children:Object(b.jsxs)("div",{className:"instruction-1",children:[Object(b.jsx)("p",{className:"center",children:Object(b.jsx)("img",{className:"notice",src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/common_title_notice.png",alt:""})}),t.instruction||[1,2,3].includes(t.receive_type)?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(Re,{data:t}),Object(b.jsx)("h3",{className:"instruction-text",children:"\u4f7f\u7528\u89c4\u5219"}),Object(b.jsx)("p",{className:"scroll",dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:Ye,rows:20,dashed:!1})]})})]})]})})},Ge=a(510),Ue=/^\d+(\.\d{1,2})?$/,Qe={type:"regExp",message:"\u6700\u591a\u4fdd\u75592\u4f4d\u5c0f\u6570",reg:Ue},$e={basic:{batch_goods_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u6279\u6b21\u5546\u54c1\u540d\u79f0"}],wishing:[{type:"required",message:"\u8bf7\u8f93\u5165"},{type:"regExp",message:"\u4e0d\u5141\u8bb8\u8f93\u5165\u7a7a\u683c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165",reg:/^\S*$/}]},grant:{num:[{type:"required",message:"\u8bf7\u8f93\u5165\u7ea2\u5305\u4e2a\u6570"},{type:"regExp",message:"\u8bf7\u8f93\u51651 ~ 100000\u4e2a\u6b63\u6574\u6570\u7ea2\u5305",reg:/^[1-9]\d{0,4}$|^100000$/}],denomination:[{type:"required",message:"\u8bf7\u8f93\u5165\u652f\u4ed8\u5b9d\uff080.01\uff09/ \u5fae\u4fe1\uff080.1\uff09 ~ 200\u9762\u989d"},Object(n.a)({},Qe)],total_contract_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u5408\u540c\u603b\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:/^\d+(\.\d{1,4})?$/}],all_budget:[{type:"required",message:"\u8bf7\u8f93\u5165\u603b\u9884\u7b97"},Object(n.a)({},Qe)],day_budget:[{type:"required",message:"\u8bf7\u8f93\u5165\u5355\u5929\u9884\u7b97"},Object(n.a)({},Qe)],receive_num:[{type:"required",message:"\u8bf7\u8f93\u5165\u7528\u6237\u53ef\u9886\u4e2a\u6570"},{type:"regExp",message:"\u8bf7\u8f93\u51651 ~ 100000\u4e2a\u6b63\u6574\u6570\u7ea2\u5305",reg:/^[1-9]\d{0,4}$|^100000$/}]},time:{effect_date:[{type:"required",message:"\u8bf7\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5"}]}};function Ze(e,t,a){var n=Object(ye.a)(e.model);if(n.all_budget=Number(n.all_budget),n.day_budget=Number(n.day_budget),n.receive_num=Number(n.receive_num),n.num=Number(n.num),n.min_denomination=Number(n.min_denomination),n.max_denomination=Number(n.max_denomination),n.denomination=Number(n.denomination),3===n.receive_type){if(n.receive_day.length<1)return h.a.error("\u8bf7\u9009\u62e9\u6bcf\u65e5\u53ef\u9886\u65f6\u95f4"),!1;if(tt(n.receive_day))return h.a.error("\u6bcf\u65e5\u53ef\u9886\u65f6\u95f4\u5b58\u5728\u4ea4\u96c6"),!1}if(1===n.receive_type){if(n.receive_rule.time.length<1||n.receive_rule.week.length<1)return h.a.error("\u8bf7\u5b8c\u6574\u7684\u9009\u62e9\u89c4\u5219\u65e5\u671f\u548c\u65f6\u95f4"),!1;if(tt(n.receive_rule.time))return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u89c4\u5219\u65f6\u95f4\u5b58\u5728\u4ea4\u96c6"),!1}if(2===n.receive_type){var i=!1,s=!1,c=[];if(n.receive_irregular.map((function(e){e.date||(i=!0),e.date&&c.push(e.date),tt(e.time)&&(s=!0),e.time.map((function(e){e.length<2&&(i=!0)}))})),i)return h.a.error("\u8bf7\u5b8c\u6574\u7684\u9009\u62e9\u4e0d\u89c4\u5219\u65e5\u671f\u548c\u65f6\u95f4"),!1;if(Object(Ge.a)(c).length!==n.receive_irregular.length)return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65e5\u671f\u5b58\u5728\u4ea4\u96c6"),!1;if(s)return h.a.error("\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65f6\u95f4\u5b58\u5728\u4ea4\u96c6"),!1}if(n.early_per.filter((function(e){return e})).length<1)return h.a.error("\u8bf7\u9009\u9884\u8b66\u767e\u5206\u6bd4"),!1;if(n.numn.day_budget)return h.a.error("\u5355\u5929\u9884\u7b97\u53d1\u653e\u4e0a\u9650\u5e94\u8be5\u5927\u4e8e\u6216\u7b49\u4e8e\u9762\u989d"),!1;if(n.day_budget>n.all_budget)return h.a.error("\u5355\u5929\u9884\u7b97\u53d1\u653e\u4e0a\u9650\u9700\u8981\u5c0f\u4e8e\u6216\u7b49\u4e8e\u603b\u9884\u7b97"),!1;if(1===n.receive_every&&n.receive_num>10)return h.a.error("\u6bcf\u65e5\u7ea2\u5305\u6700\u9ad8\u4e0a\u9650\u4e3a10\u4e2a"),!1;if(2===n.receive_every&&n.receive_num>70)return h.a.error("\u6bcf\u5468\u7ea2\u5305\u6700\u9ad8\u4e0a\u9650\u4e3a70\u4e2a"),!1;if(3===n.receive_every&&n.receive_num>310)return h.a.error("\u6bcf\u6708\u7ea2\u5305\u6700\u9ad8\u4e0a\u9650\u4e3a310\u4e2a"),!1;if(n.early_notifier.length>14)return h.a.error("\u76ee\u524d\u4ec5\u652f\u6301\u65b0\u589e10\u4e2a\u9884\u8b66\u901a\u77e5\u4eba"),!1;if("2"===n.cash_amount_type){if(2===n.channel&&Xe(n,.1))return!1;if([1,3].includes(n.channel)&&Xe(n,.01))return!1;if(n.all_budgetn.max_denomination)return h.a.error("\u968f\u673a\u6700\u5927\u9762\u989d\u4e0d\u80fd\u5c0f\u4e8e\u6700\u5927\u9762\u989d\u7684\u6700\u5c0f\u503c"),!1;if(n.all_budgetn.day_budget)return h.a.error("\u5355\u5929\u9884\u7b97\u53d1\u653e\u4e0a\u9650\u5e94\u8be5\u5927\u4e8e\u6216\u7b49\u4e8e\u6700\u5c0f\u9762\u989d"),!1;if(n.day_budgetn.all_budget)return h.a.error("\u5355\u65e5\u53d1\u653e\u9884\u7b97\u4e0d\u5f97\u5c0f\u4e8e\u9762\u989d\u4e14\u4e0d\u5927\u4e8e\u603b\u9884\u7b97"),!1}if("1"===n.cash_amount_type){if(2===n.channel&&et(n,.1))return!1;if([1,3].includes(n.channel)&&et(n,.01))return!1;if(n.all_budgetn.all_budget)return h.a.error("\u5355\u65e5\u53d1\u653e\u9884\u7b97\u4e0d\u5f97\u5c0f\u4e8e\u9762\u989d\u4e14\u4e0d\u5927\u4e8e\u603b\u9884\u7b97"),!1}}function Xe(e,t){if(e.min_denomination200||!Ue.test(e.max_denomination)||!Ue.test(e.min_denomination))return e.min_denomination>e.max_denomination?(h.a.error("\u968f\u673a\u7ea2\u5305\u6700\u5c0f\u9762\u989d\u4e0d\u5f97\u5927\u4e8e\u6700\u5927\u9762\u989d"),!0):(h.a.error("\u8bf7\u8f93\u5165".concat(t," ~ 200\u7684\u9762\u989d\u4e14\u4fdd\u75592\u4f4d\u5c0f\u6570")),!0)}function et(e,t){if(e.denomination200||!Ue.test(e.denomination))return h.a.error("\u8bf7\u8f93\u5165".concat(t," ~ 200\u7684\u9762\u989d\u4e14\u4fdd\u75592\u4f4d\u5c0f\u6570")),!0}function tt(e){for(var t=0;t=s&&as}}var at=[{key:1,text:"\u6bcf\u65e5"},{key:2,text:"\u6bcf\u5468"},{key:3,text:"\u6bcf\u6708"},{key:0,text:"\u603b\u5171"}],nt=[{key:"1",text:"\u5468\u4e00"},{key:"2",text:"\u5468\u4e8c"},{key:"3",text:"\u5468\u4e09"},{key:"4",text:"\u5468\u56db"},{key:"5",text:"\u5468\u4e94"},{key:"6",text:"\u5468\u516d"},{key:"7",text:"\u5468\u65e5"}],it=["70","50","30","20"];var st=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={editorHtml:"",count:0},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(){var e=this,t=this,a=new Ce.a("#wangeditorDom");a.destroy(),this.setState({editor:a}),a.config.colors=["#696969","#9093a2","#fgddbb","#e3e7eb"],a.config.pasteText=!0,a.config.height=200,a.config.showFullScreen=!1,a.config.menus=["bold","foreColor","italic","indent","link","justify"],a.config.onchange=function(e){var n=a.txt.text();if(0==n.length&&t.props.setEdittext(""),n.length>t.props.limitLength){var i=n.slice(0,t.props.limitLength);return t.setState({editorHtml:i}),a.txt.html(i),void t.props.setEdittext(i)}t.setState({count:n.length}),t.setState({editorHtml:e}),t.props.setEdittext(e)},a.create();var n=setTimeout((function(){a.txt.html(e.props.text),clearTimeout(n)}),500)}},{key:"render",value:function(){return Object(b.jsxs)("div",{className:"countBox_par",children:[Object(b.jsx)("div",{id:"wangeditorDom",style:{width:this.props.width}}),Object(b.jsx)("p",{className:"countBox",children:this.state.count+"/"+this.props.limitLength})]})}}]),a}(u.a.Component),ct=[24,100,100,100,80,100,100,100,80,100,100,100,80,100,100,100,100],ot=function(e){var t=e.data;return Object(b.jsxs)("div",{id:"ysf-redPacketsViews",className:"mobile",children:[Object(b.jsx)("img",{className:"bubble",src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/ysf-logo.png",alt:""}),Object(b.jsxs)("div",{className:"content",children:[Object(b.jsx)("p",{className:"title",children:t.batch_goods_name||"\u4e91\u95ea\u4ed8"}),Object(b.jsxs)("div",{className:"information",children:[Object(b.jsxs)("p",{className:"money",style:{fontSize:"32px"},children:[Object(b.jsx)("span",{className:"tag",style:{fontSize:"20px"},children:"\uffe5"}),"1"===t.cash_amount_type?parseFloat(t.denomination||.01):"".concat(parseFloat(t.min_denomination||.01)," ~ ").concat(parseFloat(t.max_denomination||88.88))]}),Object(b.jsxs)("p",{className:"information-p2",children:["\u8bf7\u5728\xa0",t.effect_date[1]||"2023-12-30 23:59:59","\xa0\u5185\u9886\u53d6"]}),Object(b.jsx)("p",{className:"type",children:Object(b.jsx)("span",{children:"1"===t.cash_amount_type?"\u56fa\u989d\u7ea2\u5305":"\u968f\u673a\u7ea2\u5305"})})]}),Object(b.jsxs)("div",{className:"form","v-if":"coupon.status===3",children:[Object(b.jsx)("p",{className:"form-label",children:"\u4e91\u95ea\u4ed8\u8d26\u53f7"}),Object(b.jsx)("input",{className:"form-input",disabled:!0,type:"text",placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"}),Object(b.jsx)("input",{className:"form-input mt0",disabled:!0,type:"text",placeholder:"\u8bf7\u518d\u6b21\u8f93\u5165\u624b\u673a\u53f7"}),Object(b.jsx)("p",{className:"form-note",children:"\u60a8\u53ef\u5728\u4e91\u95ea\u4ed8\u7684\u4e2a\u4eba\u4fe1\u606f\u4e2d\u67e5\u770b\u3010\u4e91\u95ea\u4ed8\u8d26\u53f7\u3011"}),Object(b.jsx)("button",{className:"form-button",children:"\u7acb\u5373\u9886\u53d6"})]}),Object(b.jsxs)("div",{className:"segmentation",children:[Object(b.jsx)("i",{className:"left"}),Object(b.jsx)("i",{className:"middle"}),Object(b.jsx)("i",{className:"right"})]}),Object(b.jsx)("div",{className:"illustrate",children:t.instruction||[1,2,3].includes(t.receive_type)?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(Re,{data:t}),Object(b.jsx)("p",{className:"illustrate-title",children:"\u6d3b\u52a8\u8bf4\u660e"}),Object(b.jsx)("p",{className:"illustrate-text",dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:ct,rows:12,dashed:!1})})]})]})},rt=[24,100,100,100,80,100,100,100,80,100,100,100,80,100,100,100,100],lt=function(e){var t=e.data;function a(){var e=t.cash_amount_type,a=t.min_denomination,n=t.max_denomination,i={b:"20px",a:"40px"};if("2"===e){var s=String(parseFloat(a)).length+String(parseFloat(n)).length+1;return s>6?{a:32-1.1*(s-6)+"px",b:20-(s-6)+"px"}:i}return i}return Object(b.jsx)("div",{id:"zfb-mobileComponent",className:"mobile",children:Object(b.jsxs)("div",{className:"box",children:[Object(b.jsxs)("div",{className:"top",children:[Object(b.jsx)("p",{className:"title",children:t.batch_goods_name||Object(b.jsx)("span",{children:"\u798f\u5229\u6765\u88ad \xa0\u7ea2\u5305\u5151\u6362"})}),Object(b.jsx)("p",{className:"effect_date",children:Object(b.jsxs)("span",{children:["\u7ea2\u5305\u6709\u9650\u671f\u622a\u6b62:",t.effect_date[1]||"2023-12-30 23:59:59"]})}),Object(b.jsxs)("p",{className:"money",style:{fontSize:a().a},children:[Object(b.jsx)("span",{className:"tag",style:{fontSize:a().b},children:"\uffe5"}),"1"===t.cash_amount_type?parseFloat(t.denomination||.01):"".concat(parseFloat(t.min_denomination||.01),"~").concat(parseFloat(t.max_denomination||88.88))]}),Object(b.jsx)("p",{className:"type",children:Object(b.jsx)("span",{children:"1"===t.cash_amount_type?"\u56fa\u989d\u7ea2\u5305":"\u968f\u673a\u7ea2\u5305"})})]}),Object(b.jsxs)("div",{className:"form",children:[Object(b.jsx)("input",{className:"form-input",disabled:!0,type:"text",placeholder:"\u8bf7\u8f93\u5165\u771f\u5b9e\u59d3\u540d"}),Object(b.jsx)("input",{className:"form-input mt0",disabled:!0,type:"text",placeholder:"\u8bf7\u8f93\u5165\u652f\u4ed8\u5b9d\u8d26\u53f7"}),Object(b.jsx)("p",{className:"form-note",children:"\u60a8\u53ef\u5728\u652f\u4ed8\u5b9d\u7684\u4e2a\u4eba\u4fe1\u606f\u4e2d\u67e5\u770b\u3010\u652f\u4ed8\u5b9d\u8d26\u53f7\u3011"}),Object(b.jsx)("img",{src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/zfb-red-but.png",className:"but",alt:""})]}),Object(b.jsxs)("div",{className:"instruction-box",children:[Object(b.jsx)("div",{className:"instruction-header"}),Object(b.jsx)("div",{className:"instruction",children:Object(b.jsxs)("div",{className:"instruction-1",children:[Object(b.jsx)("p",{className:"center",children:Object(b.jsx)("img",{className:"notice",src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/redPacktes/common_title_notice.png",alt:""})}),t.instruction||[1,2,3].includes(t.receive_type)?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(Re,{data:t}),Object(b.jsx)("h3",{className:"instruction-text",children:"\u4f7f\u7528\u89c4\u5219"}),Object(b.jsx)("p",{className:"scroll",dangerouslySetInnerHTML:{__html:t.instruction}})]}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:rt,rows:20,dashed:!1})]})})]})]})})},dt=function(e){return Array.from({length:e},(function(e,t){return t}))},ut=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var i;return Object(g.a)(this,a),(i=t.call(this,e)).onDisabledRange1=function(e,t){var a=JSON.parse(sessionStorage.getItem("redPackets_effectDate")),n=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(a.end_time).format("HH:mm:ss");return"start"==t&&(n=s<"23:59:59"?Z()(i).isBefore(a.begin_time)||Z()(i).subtract(1,"days").isAfter(a.end_time):Z()(i).isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),"end"==t&&(n=Z()(i).add(1,"days").isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),n},i.onDisabledTime=function(e,t){var a=JSON.parse(sessionStorage.getItem("redPackets_effectDate")),n=new Date(a.begin_time),i=n.getHours(),s=n.getMinutes(),c=n.getSeconds();return Object(Q.a)(e,n)?{disabledHours:function(){return dt(i)},disabledMinutes:function(e){return e===i?dt(s):[]},disabledSeconds:function(e,t){return e===i&&t===s?dt(c):[]}}:{}},i.state=Object(n.a)({},function(e){var t=e.data;return{model:{channel:1,cash_amount_type:"1",cash_activity_id:le(8),batch_goods_name:"",num:"",denomination:"",min_denomination:"",max_denomination:"",all_budget:"",total_contract_price:"",day_budget:"",receive_num:"",receive_every:1,early_per:[],early_notifier:[],instruction:"",effect_date:[],begin_time:"",end_time:"",receive_type:0,wishing:"",receive_mode:1,receive_irregular:[{date:"",time:[[]]}],receive_rule:{week:[],time:[[]]},receive_day:[[]]},TimeDiffer:"",warningInput:[],input_early_per:"",userSelectList:[],form_data:{},isEdit:!(null===t||void 0===t||!t.id),computeMax:""}}(i.props)),i}return Object(y.a)(a,[{key:"componentWillMount",value:function(){this.getUserSelectList()}},{key:"ruleComponents",value:function(e){var t=this;return Object(b.jsxs)(b.Fragment,{children:[e>0&&Object(b.jsx)("p",{className:"move",onClick:function(){var a=t.state.model;a.receive_rule.time.splice(e,1),t.setState({model:a})},children:"\u5220\u9664"}),e===this.state.model.receive_rule.time.length-1&&Object(b.jsx)("p",{className:"add",onClick:function(){if(t.state.model.receive_rule.time.length<3){var e=t.state.model;e.receive_rule.time.push([]),t.setState({model:e})}else h.a.warn("\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5")},children:"\u6dfb\u52a0"})]})}},{key:"ruleDayComponents",value:function(e){var t=this;return Object(b.jsxs)(b.Fragment,{children:[e>0&&Object(b.jsx)("p",{className:"move",onClick:function(){var a=t.state.model;a.receive_day.splice(e,1),t.setState({model:a})},children:"\u5220\u9664"}),e===this.state.model.receive_day.length-1&&Object(b.jsx)("p",{className:"add",onClick:function(){if(t.state.model.receive_day.length<3){var e=t.state.model;e.receive_day.push([]),t.setState({model:e})}else h.a.warn("\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5")},children:"\u6dfb\u52a0"})]})}},{key:"irregularComponents",value:function(){var e=this;return Object(b.jsx)(b.Fragment,{children:this.state.model.receive_irregular.map((function(t,a){return Object(b.jsxs)("div",{children:[Object(b.jsx)(We.a,{className:"item-time",title:"\u7b2c".concat(0===a?"\u4e00":1===a?"\u4e8c":"\u4e09","\u7ec4\u4e0d\u89c4\u5219\u65e5\u671f")}),Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(ze.a,{className:"zent-datepicker-plan column_datepicker",format:"YYYY-MM-DD",width:205,value:t.date,onChange:function(t){var n=e.state.model.receive_irregular;n[a].date=t,e.onHandleChange(n,"receive_irregular")},disabledDate:{min:e.state.model.effect_date[0],max:e.state.model.effect_date[1]}}),a>0&&Object(b.jsx)("p",{className:"move",onClick:function(){var t=e.state.model;t.receive_irregular.splice(a,1),e.setState({model:t})},children:"\u5220\u9664"}),a===e.state.model.receive_irregular.length-1&&Object(b.jsx)("p",{className:"add",onClick:function(){if(e.state.model.receive_irregular.length<3){var t=e.state.model;t.receive_irregular.push({date:"",time:[[]]}),e.setState({model:t})}else h.a.warn("\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65e5\u671f")},children:"\u6dfb\u52a0"})]},a),t.time.map((function(n,i){return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(fe.a,{className:"zent-datepicker-plan column_datepicker",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:n,onChange:function(t){var n=e.state.model;n.receive_irregular[a].time[i]=t,e.setState({model:n})},width:205}),i>0&&Object(b.jsx)("p",{className:"move",onClick:function(){var t=e.state.model;t.receive_irregular[a].time.splice(i,1),e.setState({model:t})},children:"\u5220\u9664"}),i===t.time.length-1&&Object(b.jsx)("p",{className:"add",onClick:function(){if(t.time.length<3){var n=e.state.model;n.receive_irregular[a].time.push([]),e.setState({model:n})}else h.a.warn("\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5")},children:"\u6dfb\u52a0"})]},i)}))]},a)}))})}},{key:"echoFun",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=Object(ye.a)(this.props.data);if(a){var n=a.early_notifier,i=a.early_per,s=a.begin_time,c=a.end_time,o=a.receive_mode;a.early_notifier=n.map((function(e){return t.map((function(t){if((null===e||void 0===e?void 0:e.mobile)===t.key||(null===e||void 0===e?void 0:e.real_name)===t.text)return t})).filter((function(e){return e}))[0]})).filter((function(e){return e})),a.effect_date=[],a.effect_date[0]=s,a.receive_mode=o||1,a.effect_date[1]=c,a.copy&&(a.cash_activity_id=le(8));var r=i||[];r.map((function(t){return-1===it.indexOf(t)?e.setState({input_early_per:t,model:a}):e.setState({model:a})}))}}},{key:"getUserSelectList",value:function(){var e=this;Object(s.Tb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.default.map((function(e){return e.real_name})),i=t.default.map((function(e){return e.mobile})),s=[],c=t.data.map((function(e){if(-1!==n.indexOf(e.real_name)||-1!==i.indexOf(e.mobile)){var t={key:e.mobile,text:e.real_name,disabled:!0,closable:!1};return s.push(t),t}return{key:e.mobile,text:e.real_name,closable:!0}}));e.onHandleChange(s,"early_notifier"),e.setState({userSelectList:c}),e.echoFun(c)}),(function(e){h.a.error(e)}))}))}},{key:"filterEarlyPer",value:function(){var e=this,t=this.state.model.early_per.filter((function(t){return t!==e.state.input_early_per}));this.onHandleChange(t,"early_per")}},{key:"submit",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a,n,i,s,c=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.refs.form.validator()&&this.refs.form1.validator()&&this.refs.form2.validator()&&this.refs.form4.validator())){e.next=26;break}if(t=[],(a=sessionStorage.getItem("redPacketsData"))&&(t=JSON.parse(a)),!this.props.data){e.next=14;break}if(n=t.findIndex((function(e){return e.cash_activity_id===c.props.data.cash_activity_id})),!1!==Ze(this.state,this.computeMin(),this.computeMax_Min(!1))){e.next=8;break}return e.abrupt("return",!1);case 8:return this.props.data.cash_activity_id?t[n]=Object.assign(this.props.data,this.transformDataCode()):t[n]=this.transformDataCode(),sessionStorage.setItem("redPacketsData",JSON.stringify(t)),this.setState({form_data:t[n]}),e.abrupt("return",!0);case 14:if(!1!==Ze(this.state,this.computeMin(),this.computeMax_Min(!1))){e.next=16;break}return e.abrupt("return",!1);case 16:if(i=t||[],s=this.transformDataCode(),!i.find((function(e){return e.cash_activity_id===s.cash_activity_id}))){e.next=22;break}return h.a.error("\u4e0d\u5141\u8bb8\u8f93\u5165\u91cd\u590d\u7684\u5e73\u53f0\u6279\u6b21\u53f7"),e.abrupt("return",!1);case 22:return i.push(s),sessionStorage.setItem("redPacketsData",JSON.stringify(i)),this.setState({form_data:s}),e.abrupt("return",!0);case 26:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"transformDataCode",value:function(){var e=this.state.model,t=Object(ye.a)(e);t.begin_time=e.effect_date[0],t.end_time=e.effect_date[1];var a=e.receive_num,n=e.num,i=e.early_notifier;return t.receive_num=Number(a),t.num=Number(n),t.early_notifier=i.map((function(e){return{real_name:e.text,mobile:e.key}})),Object(l.a)(t,["effect_date"])}},{key:"onHandleChange",value:function(e,t,a){var n=this.state.model;a?n[t][a]=e:n[t]=e,this.setState({model:n})}},{key:"computeAllBudget",value:function(){var e=this.state.model,t=e.num,a=e.cash_amount_type,n=e.denomination;"1"===a&&this.onHandleChange((n*t).toFixed(2),"all_budget")}},{key:"computeMax_Min",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.state.model,a=t.min_denomination,n=t.num,i=t.all_budget,s=1===this.state.model.channel?.01:.1,c=i-(n-1)*a,o=0;return o=c>200?200:c200?200:a}else e=t;return e.toFixed(2)}},{key:"closeCallback",value:function(e){var t=this.state.model.early_notifier.filter((function(t){return t.key!==e.key}));this.onHandleChange(t,"early_notifier"),t.length<1&&this.setState({warningInput:[]})}},{key:"dynamicPlaceholder",value:function(){return this.state.model.min_denomination*this.state.model.num>this.state.model.all_budget?"\u8bf7\u8f93\u5165":this.state.computeMax?"\u6700\u5927\u9762\u989d\u4e3a".concat(this.computeMin()," ~ ").concat(this.state.computeMax):"\u8bf7\u8f93\u5165"}},{key:"switchComponents",value:function(){return 1==this.state.model.channel&&2===this.state.model.receive_mode?Object(b.jsx)(lt,{data:this.state.model}):3==this.state.model.channel?Object(b.jsx)(ot,{data:this.state.model}):Object(b.jsx)(Ke,{data:this.state.model})}},{key:"render",value:function(){var e,t=this;return Object(b.jsxs)("div",{id:"redPackets",children:[Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u57fa\u672c\u4fe1\u606f",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:$e.basic,ref:"form",children:[Object(b.jsx)(c.a,{labelname:"\u6e20\u9053\u5e73\u53f0",prop:"channel",id:"type",children:Object(b.jsxs)(te.a,{disabled:this.state.isEdit,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"channel"),3===a.value?t.onHandleChange("\u7528\u6237\u53ef\u5728\u4e91\u95ea\u4ed8APP-\u6211\u7684\u7ea2\u5305\u4e2d\u67e5\u770b\u6700\u8fd160\u5929\u5185\u5373\u5c06\u8fc7\u671f\u7684\u4e91\u95ea\u4ed8\u7ea2\u5305\u91d1\u989d\u53ca\u5230\u671f\u65f6\u95f4\u3002\u7528\u6237\u53c2\u52a0\u6d3b\u52a8 (\u5982\u5929\u5929\u9886\u7ea2\u5305\u3001\u79fb\u52a8\u79ef\u5206\u5151\u6362\u7ea2\u5305\u7b49\u6d3b\u52a8)\u83b7\u5f97\u7684\u4e91\u95ea\u4ed8\u7ea2\u5305\u6709\u6548\u671f\u4ee5\u8425\u9500\u6d3b\u52a8\u9875\u9762\u89c4\u5219\u8bf4\u660e\u4e3a\u51c6\uff0c\u5230\u671f\u540e\u81ea\u52a8\u5931\u6548\u3002\n
(\u4e00)\u5728\u4e91\u95ea\u4ed8\u7ea2\u5305\u7684\u6709\u6548\u671f\u5185\u4e0d\u9650\u4f7f\u7528\u65f6\u95f4\n
(\u4e8c) \u4f7f\u7528\u5546\u6237:\u4e13\u4eab\u7ea2\u5305\u652f\u6301\u4e91\u95ea\u4ed8APP\u5185\u624b\u673a\u5145\u503c\u3001\u6c34\u7535\u7164\u7f34\u8d39\u5546\u57ce\u8d2d\u7269\u7b49\u591a\u573a\u666f\u62b5\u6263\u652f\u4ed8\u3002\u4e5f\u53ef\u901a\u8fc7\u4e91\u95ea\u4ed8APP\u5728\u4e91\u95ea\u4ed8\u7ebf\u4e0b\u53d7\u7406\u5546\u6237\u8fdb\u884c\u4e8c\u7ef4\u7801\u4e3b\u626b\u6216\u88ab\u626b\u652f\u4ed8\u65f6\u62b5\u6263\u3002\u4e2a\u522b\u5546\u6237\u4e0d\u652f\u6301\u7ea2\u5305\u62b5\u6263\uff0c\u5177\u4f53\u4ee5\u652f\u4ed8\u7ed3\u679c\u4e3a\u51c6\u3002\n
(\u4e09) \u4f7f\u7528\u89c4\u5219:\n
1\u3001\u7ebf\u4e0b\u5546\u6237:\u7528\u6237\u5728\u4e91\u95ea\u4ed8\u7ebf\u4e0b\u53d7\u7406\u5546\u6237\u4f7f\u7528\u4e91\u95ea\u4ed8APP\uff0c\u51fa\u793a\u4ed8\u6b3e\u7801\u652f\u4ed8\u65f6\uff0c\u53ef\u4f7f\u7528\u4e91\u95ea\u4ed8\u7ea2\u5305\u62b5\u6263\u8ba2\u5355\u91d1\u989d\uff0c\u5982\u80af\u5fb7\u57fa\u3001\u5168\u5bb6\u4fbf\u5229\u5e97\u3001\u661f\u5df4\u514b\u3001\u5c48\u81e3\u6c0f\u3001\u7f57\u68ee\u4fbf\u5229\u5e97\u3001DQ\u3001\u6765\u4f0a\u4efd\u7b49\u3002\n
2\u3001\u7ebf\u4e0a\u5546\u6237:\u5728\u4e91\u95ea\u4ed8APP\u5185\u6216\u7ebf\u4e0a\u5546\u6237\uff0c\u9009\u62e9\u4e91\u95ea\u4ed8APP\u652f\u4ed8\u65f6\uff0c\u53ef\u4f7f\u7528\u4e91\u95ea\u4ed8\u7ea2\u5305\u62b5\u6263\u8ba2\u5355\u91d1\u989d\uff0c\u598212306\u3001\u4eac\u4e1c\u5230\u5bb6\u3001\u672c\u6765\u751f\u6d3b\u7b49\u3002\n
3\u30011\u5143\u4e91\u95ea\u4ed8\u7ea2\u5305\u53ef\u62b5\u62631\u5143\u4eba\u6c11\u5e01\u8ba2\u5355\u91d1\u989d\u3002\n
4\u3001\u8ba2\u5355\u91d1\u989d\u6ee10.01\u5143\u65f6\uff0c\u65b9\u53ef\u4f7f\u7528\u4e91\u95ea\u4ed8\u7ea2\u5305;\u62b5\u6263\u8ba2\u5355\u91d1\u989d\u65f6\uff0c\u9700\u81f3\u5c11\u652f\u4ed80.01\u5143\u3002\n
5\u3001\u4e91\u95ea\u4ed8\u7ea2\u5305\u4e0d\u53ef\u7528\u4e8e\u63d0\u73b0\u3001\u8d2d\u4e70\u6d3b\u671f+\u6216\u8005\u5176\u4ed6\u7406\u8d22\u4ea7\u54c1\u3002","instruction"):t.onHandleChange("","instruction"),1!==a.value&&t.onHandleChange(1,"receive_mode")},value:this.state.model.channel,children:[Object(b.jsx)(me.a,{value:1,children:"\u652f\u4ed8\u5b9d"}),Object(b.jsx)(me.a,{value:2,children:"\u5fae\u4fe1"}),Object(b.jsx)(me.a,{value:3,children:"\u4e91\u95ea\u4ed8"})]})}),Object(b.jsx)(c.a,{labelname:"\u7ea2\u5305\u7c7b\u578b",prop:"cash_amount_type",id:"type",children:Object(b.jsxs)(te.a,{disabled:this.state.isEdit,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"cash_amount_type"),t.onHandleChange("","all_budget"),t.onHandleChange("","max_denomination"),t.onHandleChange("","min_denomination"),t.onHandleChange("","denomination"),t.onHandleChange("","total_contract_price")},value:this.state.model.cash_amount_type,children:[Object(b.jsx)(me.a,{value:"1",children:"\u56fa\u989d"}),Object(b.jsx)(me.a,{value:"2",children:"\u968f\u673a"})]})}),1===this.state.model.channel?Object(b.jsx)(c.a,{labelname:"\u9886\u53d6\u65b9\u5f0f",prop:"receive_mode",id:"receive_mode",children:Object(b.jsxs)(te.a,{onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_mode")},value:this.state.model.receive_mode,children:[Object(b.jsx)(me.a,{value:1,children:"\u5b98\u65b9\u9886\u53d6"}),Object(b.jsx)(me.a,{value:2,children:"\u8d26\u53f7\u9886\u53d6"})]})},"receive_mode"):null,Object(b.jsxs)(c.a,{labelname:"\u7ea2\u5305\u6279\u6b21\u53f7",prop:"channel_activity_id",id:"batch_number",children:[Object(b.jsx)(r.a,{disabled:!0,onChange:function(e){t.onHandleChange(e,"cash_activity_id")},onClearItem:function(){t.onHandleChange("","cash_activity_id")},value:this.state.model.cash_activity_id,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:50,height:"36px",width:"452px",alignment:"left"}),Object(b.jsx)(m.a,{type:"icon",icon:"refresh",onClick:function(){return t.onHandleChange(le(8),"cash_activity_id")},disabled:this.state.isEdit})]}),Object(b.jsx)(c.a,{labelname:"\u6279\u6b21\u5546\u54c1\u540d\u79f0",prop:"batch_goods_name",id:"batch_goods_name",children:Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"batch_goods_name")},onClearItem:function(){t.onHandleChange("","batch_goods_name")},value:this.state.model.batch_goods_name,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:14,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:3===this.state.model.channel?"\u53d1\u653e\u5907\u6ce8":"\u795d\u798f\u8bed",prop:"wishing",id:"wishing",children:Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"wishing")},onClearItem:function(){t.onHandleChange("","wishing")},value:this.state.model.wishing,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:32,height:"36px",width:"520px",alignment:"left"})})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u53d1\u653e\u89c4\u5219",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:$e.grant,ref:"form1",children:[Object(b.jsx)(c.a,{id:"all_budget",labelname:"\u603b\u9884\u7b97",prop:"all_budget",children:Object(b.jsx)(r.a,{value:this.state.model.all_budget,placeholder:"\u8bf7\u8f93\u5165",disabled:this.state.isEdit||"1"===this.state.model.cash_amount_type,onChange:function(e){t.onHandleChange(e,"all_budget"),t.onHandleChange("","min_denomination"),t.onHandleChange("","num"),"2"===t.state.model.cash_amount_type&&t.computeMax_Min()},onClearItem:function(){t.onHandleChange("","all_budget"),t.onHandleChange("","min_denomination"),t.onHandleChange("","num"),"2"===t.state.model.cash_amount_type&&t.computeMax_Min()},labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"redPackets_number",labelname:"\u7ea2\u5305\u4e2a\u6570",prop:"num",children:Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"num"),"1"===t.state.model.cash_amount_type?t.computeAllBudget():t.computeMax_Min()},onClearItem:function(){t.onHandleChange("","num"),"1"===t.state.model.cash_amount_type?t.computeAllBudget():t.computeMax_Min()},value:this.state.model.num,placeholder:"\u8bf7\u8f93\u5165",disabled:this.state.isEdit,labelWidth:"0px",maxLength:9,height:"36px",unit:"\u4e2a",countShow:!1,width:"520px",alignment:"left"})}),"1"===this.state.model.cash_amount_type?Object(b.jsx)(c.a,{labelname:"\u9762\u989d",prop:"denomination",children:Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"denomination"),t.computeAllBudget()},onClearItem:function(){t.onHandleChange("","denomination"),t.computeAllBudget()},value:this.state.model.denomination,placeholder:"\u8bf7\u8f93\u5165",disabled:this.state.isEdit,labelWidth:"0px",maxLength:6,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})},"denomination"):Object(b.jsxs)(c.a,{id:"denomination",labelname:"\u9762\u989d",children:[Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"min_denomination"),t.computeMax_Min()},onClearItem:function(){t.onHandleChange("","min_denomination"),t.computeMax_Min()},value:this.state.model.min_denomination,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",unit:"\u5143",disabled:this.state.isEdit,countShow:!1,maxLength:6,height:"36px",width:"245px",alignment:"left"}),Object(b.jsx)("span",{className:"JIan",children:"~"}),Object(b.jsx)(r.a,{id:"denomination",onChange:function(e){t.onHandleChange(e,"max_denomination")},onClearItem:function(){t.onHandleChange("","max_denomination")},value:this.state.model.max_denomination,prolong:!0,placeholder:this.dynamicPlaceholder(),labelWidth:"0px",unit:"\u5143",disabled:this.state.isEdit||!this.state.model.min_denomination||this.state.model.min_denomination*this.state.model.num>this.state.model.all_budget,countShow:!1,maxLength:6,height:"36px",width:"245px",alignment:"left"})]},"random-denomination"),Object(b.jsx)(c.a,{id:"all_budget",labelname:"\u5408\u540c\u603b\u4ef7",prop:"total_contract_price",children:Object(b.jsx)(r.a,{value:this.state.model.total_contract_price,onChange:function(e){t.onHandleChange(e,"total_contract_price")},onClearItem:function(){t.onHandleChange("","total_contract_price")},placeholder:"\u8bf7\u8f93\u5165",disabled:this.state.isEdit,labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})},"amount"),Object(b.jsx)(c.a,{id:"day_budget",labelname:"\u5355\u5929\u9884\u7b97\u53d1\u653e\u4e0a\u9650",prop:"day_budget",children:Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"day_budget")},onClearItem:function(){t.onHandleChange("","day_budget")},disabled:this.state.isEdit,value:this.state.model.day_budget,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:9,height:"36px",unit:"\u5143",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsxs)(c.a,{id:"receive_number",labelname:"\u7528\u6237\u53ef\u9886\u4e2a\u6570",prop:"receive_num",children:[Object(b.jsx)(r.a,{onChange:function(e){t.onHandleChange(e,"receive_num")},onClearItem:function(){t.onHandleChange("","receive_num")},disabled:this.state.isEdit,value:this.state.model.receive_num,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",height:"36px",unit:"\u4e2a",countShow:!1,width:"304px",alignment:"left"}),Object(b.jsx)(te.a,{disabled:this.state.isEdit,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_every")},value:Number(this.state.model.receive_every),children:at.map((function(e){var t=e.key,a=e.text;return Object(b.jsx)(me.a,{value:t,children:a},t)}))})]})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u65f6\u95f4\u9650\u5236",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:$e.time,ref:"form2",children:[Object(b.jsx)(c.a,{id:"entry_time",labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"effect_date",children:Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",disabled:[this.state.isEdit,this.state.isEdit],width:245,value:this.state.model.effect_date,onChange:function(e){t.onHandleChange(e,"effect_date")},disabledTime:this.onDisabledTime,disabledDate:this.onDisabledRange1})}),Object(b.jsxs)(c.a,{id:"usable_time",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",prop:"official_price",children:[Object(b.jsx)("div",{className:"boxTime",children:Object(b.jsx)(te.a,{value:this.state.model.receive_type,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_type"),t.onHandleChange([[]],"receive_day"),t.onHandleChange([{date:"",time:[[]]}],"receive_irregular"),t.onHandleChange({week:[],time:[[]]},"receive_rule")},children:Object(b.jsx)(ae.a,{value:0,children:"\u4e0d\u8bbe\u7f6e"})})}),Object(b.jsxs)("div",{className:"boxTime column ",style:{marginTop:"15px"},children:[Object(b.jsx)(te.a,{value:this.state.model.receive_type,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_type"),t.onHandleChange([{date:"",time:[[]]}],"receive_irregular"),t.onHandleChange({week:[],time:[[]]},"receive_rule")},children:Object(b.jsx)(ae.a,{value:3,children:"\u6bcf\u65e5\u53ef\u9886"})}),3===this.state.model.receive_type?Object(b.jsx)(b.Fragment,{children:this.state.model.receive_day.map((function(e,a){return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(fe.a,{className:"zent-datepicker-plan column_datepicker",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},width:195,value:e,onChange:function(e){var n=t.state.model;n.receive_day[a]=e,t.setState({model:n})}}),t.ruleDayComponents(a)]},a)}))}):null]}),Object(b.jsxs)("div",{className:"boxTime column",children:[Object(b.jsx)(te.a,{className:"column_label",value:this.state.model.receive_type,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_type"),t.onHandleChange([{date:"",time:[[]]}],"receive_irregular"),t.onHandleChange([[]],"receive_day")},children:Object(b.jsx)(ae.a,{value:1,children:"\u6709\u6548\u671f\u5185\uff0c\u89c4\u5219\u65e5\u671f\u53ef\u9886"})}),1===this.state.model.receive_type?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(k.a.Group,{value:this.state.model.receive_rule.week,onChange:function(e){return t.onHandleChange(e,"receive_rule","week")},style:{marginLeft:"25px",marginTop:"20px"},children:nt.map((function(e){return Object(b.jsx)(k.a,{className:"checkbox",value:e.key,children:e.text},e.key)}))}),this.state.model.receive_rule.time.map((function(e,a){return Object(b.jsxs)("div",{className:"options_time",children:[Object(b.jsx)(fe.a,{className:"zent-datepicker-plan column_datepicker",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:e,onChange:function(e){var n=t.state.model;n.receive_rule.time[a]=e,t.setState({model:n})},width:205}),t.ruleComponents(a)]},a)})),Object(b.jsx)("p",{className:"notice",children:"\u8bf7\u6309\u716724\u5c0f\u65f6\u5236\u8f93\u5165\u53ef\u7528\u65f6\u6bb5\uff0c\u6700\u591a\u8bbe\u7f6e3\u4e2a\u65f6\u6bb5"})]}):null]}),Object(b.jsxs)("div",{className:"boxTime column",style:{marginTop:"15px"},children:[Object(b.jsx)(te.a,{value:this.state.model.receive_type,onChange:function(e){var a=e.target;t.onHandleChange(a.value,"receive_type"),t.onHandleChange({week:[],time:[[]]},"receive_rule"),t.onHandleChange([[]],"receive_day")},children:Object(b.jsx)(ae.a,{value:2,children:"\u6709\u6548\u671f\u5185\uff0c\u4e0d\u89c4\u5219\u65e5\u671f\u53ef\u9886"})}),2===this.state.model.receive_type?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("p",{className:"notice",style:{width:"500px"},children:"\u53ef\u5728\u6709\u6548\u671f\u5185\u4efb\u610f\u9009\u62e9\u65f6\u95f4\u5929\u6570\uff0c\u4ee5\u53ca\u53ef\u7528\u65f6\u6bb5\u3002 \u56e0\u5f53\u524d\u5fae\u4fe1\u652f\u6301\u95ee\u9898\uff0c\u5982\u9009\u62e9\u4e0d\u89c4\u5219\u65f6\u95f4\uff0c\u5fae\u4fe1\u5361\u5305\u5185\u5f53\u524d\u4ec5\u4f1a\u5c55\u793a\u6709\u6548\u671f\uff0c\u5efa\u8bae \u5c06\u5177\u4f53\u53ef\u7528\u65e5\u671f\u4ee5\u53ca\u65f6\u95f4\u6bb5\u586b\u5199\u5728\u4f7f\u7528\u8bf4\u660e\u5185\u3002"}),this.irregularComponents()]}):null]})]})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u9884\u8b66\u89c4\u5219",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:$e.warning,ref:"form4",children:[Object(b.jsxs)(c.a,{id:"early_per",labelname:"\u9884\u8b66\u767e\u5206\u6bd4",children:[Object(b.jsxs)(be.a,{value:this.state.model.early_per,onChange:function(e){t.onHandleChange(e,"early_per")},children:[it.map((function(e){return Object(b.jsxs)(k.a,{value:e,children:[e,"%"]},e)})),Object(b.jsx)(k.a,{value:this.state.input_early_per})]}),Object(b.jsx)(r.a,{className:"percent",onChange:function(e){t.filterEarlyPer(),t.setState({input_early_per:e})},onClearItem:function(){t.filterEarlyPer(),t.setState({input_early_per:""})},value:this.state.input_early_per,placeholder:"",labelWidth:"0px",maxLength:3,height:"36px",unit:"%",countShow:!1,width:"190px",alignment:"left"})]}),Object(b.jsxs)(c.a,{id:"early_notifier",labelname:"\u9884\u8b66\u901a\u77e5\u4eba",children:[Object(b.jsx)("div",{className:"bt_se",children:Object(b.jsx)(ne.a,{className:"bt_se_select",options:this.state.userSelectList,placeholder:"\u9009\u62e9\u4e00\u9879",size:"xl",value:this.state.warningInput,onChange:function(e){var a=t.state.model;e&&(a.early_notifier.push(e),a.early_notifier=re(a.early_notifier,"key")),t.setState({warningInput:e,model:a})}})}),Object(b.jsx)("div",{className:"userSelect",children:Object(b.jsx)("ol",{children:Object(pe.a)(this.state.model.early_notifier)?null===(e=this.state.model.early_notifier)||void 0===e?void 0:e.map((function(e){return Object(b.jsx)(je.a,{closable:null===e||void 0===e?void 0:e.closable,onClose:function(){return t.closeCallback(e)},children:null===e||void 0===e?void 0:e.text},null===e||void 0===e?void 0:e.key)})):null})})]})]})}),Object(b.jsx)(p.a,{style:{width:"70%",margin:"10px 0"},title:"\u6837\u5f0f\u8bbe\u7f6e",children:Object(b.jsx)(o.a,{ref:"form3",children:Object(b.jsx)(c.a,{id:"instruction",labelname:"\u4f7f\u7528\u8bf4\u660e",required:"",children:Object(b.jsx)(st,{pageType:"detaileditor",setEdittext:function(e){t.onHandleChange(e,"instruction")},width:"520px",text:this.state.model.instruction,limitLength:5e3},this.state.model.channel)})})}),this.switchComponents()]})}}]),a}(d.Component),ht=a(599),pt=a(621),mt=(a(427),a(428)),bt=a.n(mt),ft=a(258),jt=a(598),gt=(a(278),{product_id:[{type:"required",message:"\u8bf7\u9009\u62e9\u6620\u5c04\u5546\u54c1"}],quantity:[{type:"required",message:"\u8bf7\u8f93\u5165\u5546\u54c1\u5e93\u5b58"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u5c0f\u4e8e100\u4e07\u7684\u6574\u6570",reg:"^(?!0)(?:[0-9]{1,6}|1000000)$"}],contract_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u5408\u540c\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:"^[0-9]+(.[0-9]{1,4})?$"}],product_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u5546\u54c1\u540d\u79f0"}],weight:[{type:"required",message:"\u8bf7\u8f93\u5165\u6743\u91cd"},{type:"regExp",message:"\u8bf7\u8f93\u51650~100\u6743\u91cd\u6570\u5b57",reg:"^([0-9]{0,2}|100)$"}],end_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u5151\u6362\u7ed3\u675f\u65f6\u95f4"}],card_show:[{type:"required",message:"\u8bf7\u9009\u62e9\u5361\u5bc6\u53d1\u653e\u7c7b\u578b"}]}),yt=Object(d.forwardRef)((function(e,t){var a=e.productData,n=e.checkedProduct,l=e.directResellerId,u=e.productType,p=Object(d.useRef)(null),m=Object(d.useRef)(null);Object(d.useImperativeHandle)(t,(function(){return{submit:F,getFormModel:T}}));var g=Object(U.a)({productOption:[],productDataAll:[],productPic:[],isUpdatePic:!1,loading:!0}),y=Object(i.a)(g,2),_=y[0],v=y[1],x=Object(U.a)({cur_product:void 0,code_batch_id:"",product_type:Number(u),cost_price:"",weight:"0",quantity:"",contract_price:"",product_name:"",official_price:"",show_url:[],describe_url:[],detail_url:[],product_id:"",account_type:"",map_product_name:"",end_time:"",card_show:2}),O=Object(i.a)(x,2),k=O[0],S=O[1];Object(d.useEffect)((function(){D().then((function(e){if(a){var t=e.find((function(e){return e.key===Number(a.product_id)}));t&&S({cur_product:t})}I()}))}),[]),Object(pt.a)((function(){D()}),[k.product_type]),Object(d.useEffect)((function(){v({productPic:k.describe_url})}),[_.isUpdatePic]);var w=Object(d.useState)(null),C=Object(i.a)(w,2),N=(C[0],C[1]);Object(d.useEffect)((function(){var e=new bt.a(".swiper-container",{slidesPerView:1,centeredSlides:!0,loop:!0,autoplay:3e3,initialSlide:0,observer:!0,observeParents:!1,pagination:".swiper-pagination",paginationClickable:!0});N(e)}),[]);var D=function(){return v({loading:!0}),new Promise((function(e,t){if(l){var a=3===k.product_type,i={reseller_id:l,type:a?1:k.product_type};Object(s.Ab)(i).then((function(a){Object(s.cc)(a,(function(t,a){var i=t.data.map((function(e){return{key:e.id,text:e.title,disabled:-1!==n.indexOf(e.id)}}));v({productOption:i,loading:!1,productDataAll:t.data}),e(i)}),(function(e){v({loading:!1}),t(!1)}))}))}else e(!1)}))},I=function(){return new Promise((function(e,t){a?(S({goods_id:a.goods_id,cost_price:a.cost_price,weight:String(a.weight),quantity:a.quantity,contract_price:a.contract_price,product_name:a.product_name,official_price:a.official_price,product_id:a.product_id,account_type:a.account_type,map_product_name:a.map_product_name,product_type:a.is_e_card?3:k.product_type,card_show:Number(a.card_show),code_batch_id:a.code_batch_id,end_time:a.end_time,show_url:[{id:(new Date).getTime(),src:a.show_url,name:"\u5546\u54c1Logo"}],detail_url:a.detail_url?[{id:(new Date).getTime(),src:a.detail_url,name:"\u5546\u54c1\u8be6\u60c5"}]:[],describe_url:a.describe_url.map((function(e,t){return{id:"".concat((new Date).getTime(),"-").concat(t),src:e,name:"".concat(t)}}))}),setTimeout((function(){v({isUpdatePic:!_.isUpdatePic})}),300),e(!0)):e(!1)}))},T=function(){var t=3===k.product_type;return{product_id:k.product_id,product_type:t?1:k.product_type,is_e_card:Number(t),product_name:k.product_name,contract_price:k.contract_price,cost_price:k.cost_price,official_price:k.official_price,quantity:k.quantity,weight:k.weight,show_url:1!==e.isSettlement?k.show_url[0].src:"https://lsxd-customcard-h5.oss-cn-hangzhou.aliyuncs.com/vip.png",describe_url:k.describe_url.map((function(e){return e.src})),detail_url:k.detail_url[0]?k.detail_url[0].src:"",account_type:k.account_type,map_product_name:k.product_name,goods_id:k.goods_id,end_time:k.end_time,card_show:k.card_show}},F=function(){var t=Object(j.a)(Object(f.a)().mark((function t(){var a;return Object(f.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=!1,!p.current.validator()){t.next=9;break}if(!(k.show_url.length<=0&&1!==e.isSettlement)){t.next=5;break}return h.a.error("\u8bf7\u4e0a\u4f20\u5546\u54c1Logo"),t.abrupt("return");case 5:if(!(k.describe_url.length<=0)){t.next=8;break}return h.a.error("\u8bf7\u4e0a\u4f20\u5546\u54c1\u56fe\u7247"),t.abrupt("return");case 8:a=!0;case 9:return t.abrupt("return",a);case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),L=function(e){S({cur_product:void 0,code_batch_id:"",cost_price:"",weight:"0",quantity:"",contract_price:"",product_name:"",product_type:1,product_id:"",official_price:"",show_url:[],describe_url:[],detail_url:[],account_type:"",map_product_name:"",end_time:"",card_show:2}),setTimeout((function(){v({isUpdatePic:!_.isUpdatePic})}),300),S({product_type:e.target.value}),3==e.target.value&&S({show_url:[{id:(new Date).getTime(),src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/jd_logo.png",name:"common-pic.png"}],describe_url:[{id:(new Date).getTime(),src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/jd_card.png",name:"common-pic.png"}]})},M=function(e,t){"overMaxAmount"===e?h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247")):"overMaxSize"===e&&h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))},H=function(e){return new Promise((function(t,a){try{var n=new FormData;n.append("file",e),n.append("path","common_image"),Object(s.sd)(n).then((function(e){Object(s.cc)(e,(function(e,a){t(e.path)}),(function(e){h.a.error(e),a(e)}))}))}catch(i){a(i)}}))},q=function(e,t){e.length>0?H(e[0].file).then((function(a){S(0===t?{show_url:[{src:a,id:"".concat((new Date).getTime(),"-0"),name:e[0].file.name}]}:{detail_url:[{src:a,id:"".concat((new Date).getTime(),"-0"),name:e[0].file.name}]})})):S(0===t?{show_url:[]}:{detail_url:[]})};return Object(b.jsx)("div",{className:"addProduct",children:Object(b.jsxs)(ft.a,{loading:_.loading,iconSize:16,textSize:12,icon:"circle",iconText:"\u52a0\u8f7d\u4e2d",children:[Object(b.jsxs)(o.a,{model:k,rules:gt,ref:p,children:[Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u7c7b\u578b",prop:"type",id:"type",children:Object(b.jsxs)(te.a,{onChange:function(e){L(e)},value:k.product_type,children:[Object(b.jsx)(me.a,{value:1,disabled:1===e.isSettlement&&e.settlementData&&(8===e.settlementData.key||9===e.settlementData.key)||!!k.code_batch_id,children:"\u76f4\u5145"}),Object(b.jsx)(me.a,{value:2,disabled:1===e.isSettlement&&e.settlementData&&7===e.settlementData.key||!!k.code_batch_id,children:"\u5361\u5bc6"}),Object(b.jsx)(me.a,{value:3,disabled:1===e.isSettlement&&e.settlementData&&(8===e.settlementData.key||9===e.settlementData.key)||!!k.code_batch_id,children:"\u4eac\u4e1cE\u5361"})]})}),2===k.product_type?Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u7c7b\u578b",prop:"card_show",id:"type",children:Object(b.jsxs)(te.a,{onChange:function(e){S({card_show:e.target.value})},value:k.card_show,disabled:!!k.code_batch_id,children:[Object(b.jsx)(me.a,{value:2,children:"\u5e73\u53f0\u67e5\u770b"}),Object(b.jsx)(me.a,{value:1,children:"\u77ed\u4fe1\u4e0b\u53d1"})]})}):null,Object(b.jsx)(c.a,{labelname:"\u6620\u5c04\u5546\u54c1",prop:"product_id",id:"product",children:Object(b.jsx)(ne.a,{clearable:!0,width:520,options:_.productOption,placeholder:"\u8bf7\u9009\u62e9\u5546\u54c1",value:k.cur_product,disabled:!!k.code_batch_id,onChange:function(e){!function(e){S({cur_product:e});var t=e?_.productDataAll.find((function(t){return t.id===e.key})):{},a=window.goods.find((function(e){return Number(e.id)===Number(t.product_category_id)}));S({product_id:t.id||"",official_price:t.official_price||"",cost_price:t.cost_price||"",product_name:t.title||"",account_type:t.account_type||0,quantity:"",contract_price:""});var n=[{id:(new Date).getTime(),src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/commonproductlogo/goods-pic/common-pic.png",name:"common-pic.png"}];if(a){var i=[],s=a.products.find((function(e){return Number(e.id)===Number(t.id)}));null===s||void 0===s||s.pic.map((function(e,t){i.push({id:(new Date).getTime(),src:e,name:s.title+t})})),S({show_url:[{id:(new Date).getTime(),src:a.pic,name:a.name}],describe_url:i.length?i:n,map_product_name:t.title})}else S({show_url:[],describe_url:n});setTimeout((function(){v({isUpdatePic:!_.isUpdatePic})}),300)}(e)}})}),2===k.product_type?Object(b.jsx)(c.a,{id:"end_time",labelname:"\u5361\u5bc6\u6709\u6548\u671f\u81f3",prop:"end_time",children:Object(b.jsx)(ze.a,{className:"zent-datepicker-plan",showTime:{defaultTime:"23:59:59"},value:k.end_time,width:520,format:"YYYY-MM-DD HH:mm:ss",onChange:function(e){S({end_time:e})}})}):null,Object(b.jsx)(c.a,{labelname:"\u9884\u4f30\u6210\u672c\u4ef7",prop:"cost_price",id:"cost_price",children:Object(b.jsx)(r.a,{onChange:function(e){},onClearItem:function(e){},value:k.cost_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:3,height:"36px",countShow:!1,width:"520px",alignment:"left",disabled:!0})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u6743\u91cd",prop:"weight",id:"weight",children:Object(b.jsx)(r.a,{onChange:function(e){S({weight:e})},onClearItem:function(e){S({weight:0})},value:k.weight,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:3,height:"36px",countShow:!1,width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u5e93\u5b58",prop:"quantity",id:"quantity",children:Object(b.jsx)(r.a,{onChange:function(e){S({quantity:e})},onClearItem:function(e){S({quantity:""})},value:k.quantity,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:7,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"contract_price",labelname:"\u5408\u540c\u4ef7",prop:"contract_price",children:Object(b.jsx)(r.a,{onChange:function(e){S({contract_price:e})},onClearItem:function(e){S({contract_price:""})},value:k.contract_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"product_name",labelname:"\u5546\u54c1\u540d\u79f0",prop:"product_name",children:Object(b.jsx)(r.a,{onChange:function(e){S({product_name:e})},onClearItem:function(e){S({product_name:""})},value:k.product_name,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:20,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"official_price",labelname:"\u5546\u54c1\u5b98\u65b9\u4ef7",prop:"official_price",children:Object(b.jsx)(r.a,{onChange:function(e){},onClearItem:function(e){},value:k.official_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:3,height:"36px",countShow:!1,width:"520px",alignment:"left",disabled:!0})}),1!==e.isSettlement?Object(b.jsx)(c.a,{id:"show_url",prop:"show_url",labelname:"\u5546\u54c1Logo",children:Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:5242880,tips:"\u56fe\u7247\u4e0d\u8d85\u8fc7 5M",maxAmount:1,onError:M,onChange:function(e){q(e,0)},fileList:k.show_url})}):null,Object(b.jsx)(c.a,{prop:"describe_url",labelname:"\u5546\u54c1\u56fe",id:"describe_url",children:Object(b.jsx)(jt.a,{className:"good-image-upload-demo",maxSize:5242880,tips:"\u56fe\u7247\u4e0d\u8d85\u8fc7 5M",maxAmount:9,onError:M,onChange:function(e,t){!function(e,t){if(t)if("add"===t.type)H(t.item.file).then((function(e){var a=k.describe_url;a.push({id:t.item.id,name:t.item.name,src:e}),S({describe_url:a})}));else{var a=k.describe_url.filter((function(e){return e.id!==t.item.id}));S({describe_url:a})}else S({describe_url:e});setTimeout((function(){v({isUpdatePic:!_.isUpdatePic})}),300)}(e,t)},sortable:!0,fileList:k.describe_url,multiple:!0})}),Object(b.jsx)(c.a,{prop:"detail_url",labelname:"\u5546\u54c1\u8be6\u60c5",id:"detail_url",required:!1,children:Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:5242880,tips:"\u56fe\u7247\u4e0d\u8d85\u8fc7 5M",maxAmount:1,onError:M,fileList:k.detail_url,onChange:function(e){q(e,1)}})})]}),Object(b.jsxs)("div",{className:"mobile",children:[Object(b.jsx)("div",{className:"mobile_top",children:_.productPic?Object(b.jsxs)("div",{className:"swiper-container",children:[Object(b.jsx)("div",{className:"swiper-wrapper",ref:m,children:_.productPic.map((function(e,t){return Object(b.jsx)("div",{className:"swiper-slide",children:Object(b.jsx)("img",{src:e.src,alt:""})},t)}))}),Object(b.jsx)("div",{className:"swiper-pagination"})]}):null}),Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"mobile_center"}),Object(b.jsx)("div",{className:"mobile_bottom",children:k.detail_url.length>0?Object(b.jsx)("img",{src:k.detail_url[0].src,alt:""}):null})]})]})]})})})),_t=yt,vt=Object(d.forwardRef)((function(e,t){var a=e.product_title,n=e.drawerVisible,i=e.onClose,s=e.type,c=e.productData,o=e.submit,r=e.tableData,l=e.table_index,u=e.directResellerId,h=e.productType,g=e.checkedProduct,y=e.isCoupon,_=Object(d.useRef)(null),v=Object(d.useRef)(null),x=Object(d.useRef)(null),O=function(){var e=r,t=_.current.getFormModel();if(t.upstream="\u76f4\u8fde\u5929\u4e0b",t.type=1,t.stock=t.quantity,t.all_budget=P(Number(t.contract_price),Number(t.quantity)),t.effectDate="-","\u7f16\u8f91\u5546\u54c1"===a){if(-1!==l){var n=e[l].checked;e[l]=t,e[l].checked=n}}else e.push(t);return e},k=function(){var e=r,t=v.current.state.form_data,n=A(t);if("\u7f16\u8f91\u7acb\u51cf\u91d1"===a){if(-1!==l){var i=e[l].checked;e[l]=n,e[l].only=t,e[l].checked=i}}else e.push(n);return e},S=function(){var e=r,t=x.current.state.form_data,n=V(t);if(n.only.copy=!1,"\u7f16\u8f91\u7ea2\u5305"===a){if(-1!==l){var i=e[l].checked;e[l]=n,e[l].only=t,e[l].checked=i}}else e.push(n);return e},w=function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=!1,"addProduct"!==s){e.next=8;break}return e.next=5,_.current.submit();case 5:t=e.sent,e.next=17;break;case 8:if("addKnockGold"!==s){e.next=14;break}return e.next=11,v.current.submit();case 11:t=e.sent,e.next=17;break;case 14:return e.next=16,x.current.submit();case 16:t=e.sent;case 17:t&&(a={},a="addProduct"===s?O():"addKnockGold"===s?k():S(),o(a),i()),e.next=22;break;case 20:e.prev=20,e.t0=e.catch(0);case 22:case"end":return e.stop()}}),e,null,[[0,20]])})));return function(){return e.apply(this,arguments)}}();return Object(b.jsx)(ht.a,{className:"draw",width:"86%",title:a,footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(e){w()},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(e){return i()},children:"\u53d6\u6d88"})]}),visible:n,onClose:function(e){return i()},maskClosable:!1,children:Object(b.jsx)("div",{className:"draw2",children:Object(b.jsx)(p.a,{className:"borderNone",style:{width:"95%",margin:"10px auto"},children:function(){switch(s){case"addKnockGold":return Object(b.jsx)(Je,{className:"addKnockGold",data:c,ref:v,ysf:y&&!0});case"addProduct":return Object(b.jsx)(_t,{ref:_,checkedProduct:g,productData:c,directResellerId:u,productType:h,isSettlement:e.isSettlement,settlementData:e.settlementData});case"redPackets":return Object(b.jsx)(ut,{ref:x,data:c})}}()})})})})),xt=vt,Ot=(a(280),function(e){return Array.from({length:e},(function(e,t){return t}))}),kt=[{title:"\u5546\u54c1\u7f16\u53f7",name:"product_id",prop:"product_id",type:"slot",width:"auto"},{title:"\u5546\u54c1\u540d\u79f0",name:"product_name",prop:"product_name",type:"normal",width:"auto"},{title:"\u5b98\u65b9\u4ef7",name:"official_price",prop:"official_price",type:"normal",width:"auto"},{title:"\u5408\u540c\u5355\u4ef7",name:"contract_price",prop:"contract_price",type:"normal",width:"auto"},{title:"\u5e93\u5b58\u6570\u91cf",name:"stock",prop:"stock",type:"normal",width:"auto"},{title:"\u6279\u6b21\u53f7",prop:"voucher_batch",name:"voucher_batch",type:"slot",width:"auto"},{title:"\u603b\u9884\u7b97",name:"all_budget",prop:"all_budget",type:"normal",width:"auto"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"300px",name:"effectDate",prop:"effectDate",type:"normal"},{title:"\u521b\u5efa\u65f6\u95f4",width:"350px",name:"create_time",prop:"create_time",type:"normal"},{title:"\u7c7b\u578b",name:"type",prop:"type",type:"slot",width:"auto"},{title:"\u4e0a\u6e38\u5e73\u53f0",name:"upstream",prop:"upstream",type:"normal",width:"auto"},{title:"\u64cd\u4f5c",name:"opearo",prop:"opearo",type:"slot",width:"auto"}],St={plan_id:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5e\u8ba1\u5212"}],key_batch_id:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5ekey"}],title:[{type:"required",message:"\u8bf7\u8f93\u5165\u6279\u6b21\u540d\u79f0"}],date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u65f6\u95f4"}]},wt={full:[{type:"required",message:"\u8bf7\u8f93\u5165\u9762\u989d"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u4e24\u4f4d\u5c0f\u6570",reg:"^[0-9][0-9]*([.][0-9]{1,2})?$"}],reduce:[{type:"required",message:"\u8bf7\u8f93\u5165\u51cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u4e24\u4f4d\u5c0f\u6570",reg:"^[0-9][0-9]*([.][0-9]{1,2})?$"}],quantity:[{type:"required",message:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^[1-9][0-9]*$"}],restrict:[{type:"required",message:"\u8bf7\u8f93\u5165\u7ed1\u5b9a\u6570"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^[1-9][0-9]*$"}]},Ct=Object(d.forwardRef)((function(e,t){var a=e.couponType,l=void 0===a?0:a,u=e.direct_reseller_id,g=e.editData,y=Object(U.a)({setup1_title:"\u57fa\u672c\u4fe1\u606f",setup2_title:"\u53d1\u653e\u89c4\u5219",setup3_title:"\u5546\u54c1\u8303\u56f4",tableData:[],tableHeight:500,page:1,dataCount:0,rankOptions:[],rank:[],newGoodsBtnLoading:!1,newGoldLoading:!1,lodgingTable:!0,isQuantity:!0,plan_OPTIONS:[],key_OPTIONS:[],product_title:"",showScopePop:!1,scopePopType:"",productData:{},direct_reseller_id:u||0,table_index:-1,examinePopShow:!1,payType:3,payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],coupon_batch_id:"",oldProduct:{},id:"",status:-1,statusDisabled:!1,productType:1,checkedProduct:[],KeyPcType:sessionStorage.getItem("KeyPcType"),isLoadingBtn:!1}),_=Object(i.a)(y,2),v=_[0],x=_[1],O=Object(U.a)({plan_id:"",key_batch_id:"",title:"",date_time:""}),k=Object(i.a)(O,2),S=k[0],N=k[1],D=Object(d.useRef)(null),I=Object(U.a)({full:"",reduce:"",quantity:"",budget:"",restrict:""}),T=Object(i.a)(I,2),F=T[0],L=T[1],M=Object(d.useRef)(null),H=Object(d.useRef)(null);Object(d.useEffect)((function(){!function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(sessionStorage.getItem("KeyPcType"),0!==l){e.next=12;break}if(!g||""===g){e.next=8;break}return e.next=6,J().then((function(e){var t=e.find((function(e){return e.text===g.plan_title}));t&&void 0!==t&&"undefined"!==t&&(N({plan_id:t}),sessionStorage.setItem("knockGold_effectDate",JSON.stringify({begin_time:t.key.dateTime[0],end_time:t.key.dateTime[1]})),$(t.key.reseller_id),N({key_batch_id:{key:g.key_batch_id,text:g.key_batch_name}}),E(),"2"===v.KeyPcType&&N({title:"".concat(g.title,"_").concat(g.copy_count+1).substring(0,12)}),"1"===v.KeyPcType&&x({oldProduct:g.product}),V(g.status))}));case 6:e.next=10;break;case 8:return e.next=10,J();case 10:e.next=13;break;case 12:g&&""!==g?(x({id:g.id,status:g.status}),E(),V(g.status)):(t=sessionStorage.getItem("knockGold_effectDate"))&&(a=JSON.parse(t),N({date_time:[a.begin_time,a.end_time]}));case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()()}),[]);var E=function(){try{N({title:g.title,date_time:[g.begin_time,g.end_time]}),L({full:g.full,reduce:g.reduce,quantity:g.quantity,budget:P(Number(g.reduce),Number(g.quantity)),restrict:g.restrict});var e=g.product.legal.map((function(e){return"2"===v.KeyPcType&&delete e.id,Object(n.a)(Object(n.a)({},e),{},{type:1,upstream:"\u76f4\u8fde\u5929\u4e0b",all_budget:P(Number(e.contract_price),Number(e.quantity)),effectDate:"-"})})),t=g.product.reduce.map((function(e){return"2"===v.KeyPcType&&(delete e.id,delete e.goods_id),A(e)})),a=e.concat(t);a=Object(C.a)(a,(function(e){return 2===e.type?e.only.is_delete?e.checked=!1:e.checked=!0:e.is_delete?e.checked=!1:e.checked=!0,e}));var i=Object(C.a)(a,(function(e){var t={};return t.key=e.product_id,t.text=e.product_name,t}));x({rankOptions:i,rank:i,tableData:a})}catch(s){}},V=function(e){"2"!==v.KeyPcType&&[1,2,3].includes(e)&&x({statusDisabled:!0})},J=function(){return new Promise((function(e,t){try{Object(s.Zc)({bind_object:"2"}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:{key:e.id,reseller_id:e.reseller_id,dateTime:[e.begin_time,e.end_time]},text:e.title}}));x({plan_OPTIONS:n}),e(n)}))}))}catch(a){t(a)}}))},W=function(e){return new Promise((function(t,a){try{Object(s.Yc)({status:"4,5",plan_id:e,bind_object:2}).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.map((function(e){return{key:e.id,text:e.batch_name}}));x({key_OPTIONS:n}),t(n)}))}))}catch(n){a(n)}}))};Object(d.useEffect)((function(){de()}),[F.reduce,F.full]),Object(d.useEffect)((function(){ue()}),[F.reduce,F.quantity]);var z=Object(d.useRef)(null);Object(d.useImperativeHandle)(t,(function(){return{submit:R,getModel:Y,clearCouponForm:K}}));var R=function(){var e=!1;if(!D.current.validator())return e=!1;if(e=!0,!M.current.validator())return e=!1;if(e=!0){if(!(v.rank.length>0))return h.a.error("\u8bf7\u9009\u62e9\u5546\u54c1\u8303\u56f4"),!1;var t=v.tableData.filter((function(e){return e.checked})),a=0;if(t.map((function(e){1===e.type?a+=parseInt(e.quantity):a+=parseInt(B(e.only.all_budget,P(e.only.reduce_amount,e.only.send_num)))})),a-1,t}));x({tableData:t,rank:e})}(e)}}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){re("addProduct")},children:"\u65b0\u5efa\u5546\u54c1"}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){re("addKnockGold")},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan")),children:"\u65b0\u5efa\u7acb\u51cf\u91d1"})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"range",id:"range",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",maxheight:200,isBorder:!0,spliteColor:"#fff",tableData:v.tableData,Column:kt,countbarVisible:!1,isSwitch:!1,isShowPageBar:!1,page:v.page,ref:z,dataCount:v.dataCount,pageChange:function(e){},emptyText:"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55",countChange:function(e){},checkChange:function(e){return function(e){var t=[];Object(C.a)(e,(function(e){var a={};return a.key=e.product_id,a.text=e.product_name,t.push(a),a})),x({rank:t})}(e)},ComponentHandler:function(e,t,a){return"opearo"===e?Object(b.jsx)("div",{children:Object(b.jsx)("span",{className:"grid-link",onClick:function(){return function(e,t){try{if(v.direct_reseller_id<=0)return void h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546");if(ce(),1===e.type){x({product_title:"\u7f16\u8f91\u5546\u54c1",scopePopType:"addProduct",table_index:t,checkedProduct:oe(),productType:e.product_type});var a=sessionStorage.getItem("plan_status");"2"!==v.KeyPcType&&"0"!==a||delete e.code_batch_id,x({productData:e,showScopePop:!0})}else{var n=e.only;"2"===v.KeyPcType&&delete n.id,x({product_title:"\u7f16\u8f91\u7acb\u51cf\u91d1",productData:n,scopePopType:"addKnockGold",showScopePop:!0,table_index:t})}}catch(i){}}(t,a)},children:"\u7f16\u8f91"})}):"product_id"===e?Object(b.jsx)("span",{children:"2"===v.KeyPcType&&2===t.type?"-":t.product_id}):"voucher_batch"==e?2===t.type?Object(b.jsx)(b.Fragment,{children:(n=t.only.voucher_batch,n.map((function(e){return e.channel_activity_id})).join(" , "))}):Object(b.jsx)(b.Fragment,{children:t.channel_activity_id}):"type"===e?Object(b.jsx)("span",{children:1===t.type?"\u5546\u54c1":"\u7acb\u51cf\u91d1"}):void 0;var n}})})]}),0===l?Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return R()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:" \u662f\u5426\u8fd4\u56de?"}),onConfirm:function(){window.history.back()},onCancel:function(){},className:"questModal",parentComponent:void 0})},children:"\u53d6\u6d88"})]}):null,v.examinePopShow?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",style:{zIndex:99},children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(e){x({examinePopShow:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(e){x({payType:e.target.value})},value:v.payType,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(e){x({examinePopShow:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",loading:v.isLoadingBtn,onClick:function(e){!function(){if(x({isLoadingBtn:!0}),"1"===v.KeyPcType){var e={payment_direction:v.payment_direction[v.payType-1],title:S.title,begin_time:S.date_time[0],end_time:S.date_time[1],new_product:{},update_product:{},delete_product:[]},t=v.tableData.filter((function(e){return e.checked&&1===e.type})),a=v.tableData.filter((function(e){return e.checked&&2===e.type}));e.new_product.legal=t.filter((function(e){return e.checked&&!e.goods_id})),e.update_product.legal=t.filter((function(e){return e.checked&&e.goods_id})),e.new_product.reduce=a.filter((function(e){return e.checked&&!e.only.goods_id})).map((function(e){return e.only})),e.update_product.reduce=a.filter((function(e){return e.checked&&e.only.goods_id})).map((function(e){return e.only})),e.delete_product=v.tableData.filter((function(e){return!e.checked&&(e.goods_id||e.only)})).map((function(e){return e.only?e.only.goods_id:e.goods_id})),Object(s.L)(g.id,e).then((function(e){Object(s.cc)(e,(function(t,a){h.a.success(e.message),setTimeout((function(){x({isLoadingBtn:!1}),window.history.back()}),500)}),(function(e){x({isLoadingBtn:!1}),h.a.error(e)}))}))}else{var i={plan_id:S.plan_id.key.key,key_batch_id:S.key_batch_id.key,title:S.title,begin_time:S.date_time[0],end_time:S.date_time[1],full:F.full,reduce:F.reduce,quantity:F.quantity,budget:F.budget,restrict:F.restrict,payment_direction:"",product:{legal:[],reduce:[]}};i.payment_direction=v.payment_direction[v.payType-1];var c=v.tableData.filter((function(e){return e.checked}));i.product.legal=c.filter((function(e){return 1===e.type}));var o=c.filter((function(e){return 2===e.type}));if(i.product.reduce=o.map((function(e){return Object(n.a)({},e.only)})),"2"===v.KeyPcType&&(i.copy_code_batch_id=g.id,i.product.legal=i.product.legal.map((function(e){return delete e.code_batch_id,delete e.goods_id,e})),i.product.reduce=i.product.reduce.map((function(e){return delete e.goods_id,e}))),!1===(i.product.legal,!0))return void x({isLoadingBtn:!1});Object(s.a)(i).then((function(e){Object(s.cc)(e,(function(t,a){h.a.success(e.message),setTimeout((function(){x({isLoadingBtn:!1}),window.history.back()}),500)}),(function(e){x({isLoadingBtn:!1}),h.a.error(e)}))}))}}()},children:"\u786e\u5b9a"})]})]})]}):null,Object(b.jsx)(xt,{ref:H,product_title:v.product_title,drawerVisible:v.showScopePop,type:v.scopePopType,productData:v.productData,onClose:function(){x({showScopePop:!1})},tableData:v.tableData,checkedProduct:v.checkedProduct,table_index:v.table_index,directResellerId:v.direct_reseller_id,productType:v.productType,isCoupon:!0,submit:function(e){return function(e){try{var t=e,a=[];t.map((function(e){var t={};t.key=e.product_id,t.text=e.product_name,a.push(t)}));var n=[];t.map((function(e){var t={};e.checked&&(t.key=e.product_id,t.text=e.product_name,n.push(t))})),x({tableData:t,rankOptions:a,rank:n})}catch(i){}}(e)}})]})})),Nt=Ct,Dt=function(){var e=Object(d.useRef)(null),t=Object(U.a)({isShow:!1,editModel:"",direct_reseller_id:0,comType:0}),a=Object(i.a)(t,2),n=a[0],c=a[1];return Object(d.useEffect)((function(){var e=sessionStorage.getItem("code_id");e&&"undefined"!==e&&void 0!==e?Object(s.bb)(e).then((function(e){Object(s.cc)(e,(function(e,t){c({editModel:e,isShow:!0})}))})):c({isShow:!0})}),[]),Object(b.jsx)("div",{className:"coupon-add-edit",children:n.isShow?Object(b.jsx)(Nt,{couponType:0,editData:n.editModel,isAuditButton:!1,ref:e,direct_reseller_id:n.direct_reseller_id}):null})},It=(a(281),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={activeIndex:0,tabList:e.tabs,width:e.width?e.width:220},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(){if(this.props.first){this.setState({activeIndex:0});for(var e=[],t=0;t1&&this.props.tabChange(e)}},{key:"render",value:function(){var e=this;this.props.tabs;return Object(b.jsxs)("div",{className:"tabpage",children:[Object(b.jsxs)("div",{className:"tabbar-group",children:[this.state.tabList.map((function(t,a){return Object(b.jsx)("div",{className:t.className,style:{width:e.state.width},onClick:function(){e.tabChange(a)},children:Object(b.jsxs)("div",{className:"tabbar-title",children:[" ",t.title," "]})},a)})),Object(b.jsx)("div",{className:"tabbar-slot",children:this.props.slot})]}),Object(b.jsx)("div",{className:"tab-body",children:this.props.children})]})}}]),a}(u.a.Component)),Tt=a(511),Ft=a(512),Lt=a(513),Mt=[{title:"\u5546\u54c1\u7f16\u53f7",name:"product_id",prop:"product_id",className:"name",type:"normal",width:"auto"},{title:"\u5546\u54c1\u540d\u79f0",prop:"product_name",name:"product_name",width:"200px",type:"normal"},{title:"\u7acb\u51cf\u91d1\u5e73\u53f0\u6279\u6b21\u53f7",width:"200px",prop:"voucher_batch",name:"voucher_batch",type:"slot"},{title:"\u4e0a\u6e38\u5e73\u53f0",width:"auto",prop:"upstream",name:"upstream",type:"normal"},{title:"\u5546\u54c1\u6743\u91cd",width:"auto",prop:"weight",name:"weight",type:"normal"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"500px",prop:"effectDate",name:"effectDate",type:"normal"},{title:"\u5b98\u65b9\u4ef7\u683c",name:"official_price",prop:"official_price",type:"normal",width:"auto"},{title:"\u5408\u540c\u4ef7",name:"contract_price",type:"normal",prop:"contract_price",width:"auto"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",type:"normal",prop:"create_time",width:"250px"},{title:"\u7c7b\u578b",name:"product_type_text",type:"normal",prop:"product_type_text",width:"auto"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"200px"}],Ht=function(){var e=Object(U.a)({tabList:[{title:"\u5546\u54c1\u8303\u56f4\u5217\u8868",index:0}],tableData:[],tableHeight:500,lodgingTable:!0,combinedValue:[],key_word:"",page:1,limit:10,total:0,isQuery:!1}),t=Object(i.a)(e,2),a=t[0],c=t[1],o=Object(d.useRef)(null),l=function(){var e=function(){var e={key_word:a.key_word||null,code_batch_id:sessionStorage.getItem("code_id"),page:a.page,limit:a.limit};return Object(Tt.a)(Object(n.a)({},e),(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)}))}();Object(s.W)(e).then((function(e){Object(s.cc)(e,(function(e,t){var a=[];e.data.map((function(e){1===e.type?(e.entity.upstream="\u76f4\u8fde\u5929\u4e0b",e.entity.only=e.entity.product_id,e.entity.id=e.id,e.entity.weight=e.weight,e.entity.all_budget=Number(e.entity.contract_price)*Number(e.entity.quantity),e.entity.type=1,e.entity.voucher_batch=[],a.push(e.entity)):2===e.type&&a.push({product_id:e.entity.goods_id,product_type_text:"\u7acb\u51cf\u91d1",only:e.entity.channel_activity_id,id:e.id,upstream:J(e.entity.channel),code_batch_id:e.code_batch_id,contract_price:e.entity.price,create_time:e.create_time,official_price:e.entity.reduce_amount,channel_activity_id:e.entity.channel_activity_id,product_name:e.entity.batch_goods_name,quantity:e.stock,voucher_batch:e.entity.voucher_batch,weight:e.weight,effectDate:e.entity.time_limit.effect_time.start_time+" \u81f3 "+e.entity.time_limit.effect_time.end_time})})),c({tableData:a})}))}))};Object(d.useEffect)((function(){l()}),[a.isQuery]);return Object(b.jsxs)("div",{className:"table-box-app",children:[Object(b.jsx)(It,{tabs:a.tabList,tabChange:function(e){return function(e){c({page:1,limit:10,status:e,isQuery:!a.isQuery})}(e)}}),Object(b.jsxs)("div",{className:"query-box",children:[Object(b.jsx)("div",{}),Object(b.jsx)(r.a,{onChange:function(e){return c({key_word:e})},value:a.key_word,wordSearch:function(){return l()},icon:"search",placeholder:"\u8bf7\u8f93\u5165\u5546\u54c1\u540d\u79f0\u8fdb\u884c\u5339\u914d\u67e5\u8be2",countShow:!1,height:"36px",width:"260px",onClearItem:function(e){return c({key_word:"",isQuery:!a.isQuery})},alignment:"left"})]}),Object(b.jsx)(q,{spliteColor:"#fff",tableData:a.tableData,Column:Mt,maxheight:a.tableHeight,isSwitch:!1,isShowPageBar:!1,countbarVisible:!1,page:a.page,ref:o,dataCount:a.total,pageChange:function(e){c({page:e,isQuery:!a.isQuery})},emptyText:a.lodgingTable?"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55":"\u67e5\u8be2 \u8bf7\u8f93\u5165\u3010\u5206\u9500\u5546\u3011\u6216\u3010\u8ba1\u5212\u540d\u79f0\u3011\u6216\u3010key\u3011\u8fdb\u884c\u67e5\u8be2",countChange:function(e){c({limit:e,isQuery:!a.isQuery})},ComponentHandler:function(e,t){return"dates"===e?Object(b.jsxs)("span",{children:[t.begin_time," \u81f3 ",t.end_time]}):"voucher_batch"==e?Object(b.jsx)(b.Fragment,{children:(n=t.voucher_batch,n.join(" , "))}):"opearo"===e?Object(b.jsx)("div",{children:Object(b.jsx)("span",{style:{color:"red"},className:"grid-link",onClick:function(){return e=t,void ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u4f60\u786e\u5b9a\u8981\u5220\u9664\u6539\u6761\u6570\u636e?"}),onConfirm:function(){Object(s.H)(e.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),c({isQuery:!a.isQuery})}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:function(){},className:"questModal",parentComponent:void 0});var e},children:"\u5220\u9664"})}):void 0;var n}})]})},qt={exchangeStatus:function(e){switch(e){case 0:return"\u672a\u5f00\u59cb";case 1:return"\u8fdb\u884c\u4e2d";case-1:return"\u6682\u505c";case 2:return"\u5df2\u7ed3\u675f";case 5:return"\u5df2\u4f5c\u5e9f"}},exchangeStatusBg:function(e){switch(e){case 0:return"#BFBFBF";case 1:return"#3575C7";case-1:return"#F6C041";case 2:return"#43A65D";case 5:return"#DC4F40"}},orderStatus:function(e){switch(e){case 0:return"\u5f85\u652f\u4ed8";case 1:return"\u5145\u503c\u4e2d";case 2:return"\u5df2\u5b8c\u6210";case 3:return"\u5145\u503c\u5931\u8d25"}},orderStatusBg:function(e){if(1===e.status&&2===e.type)return"#43A65D";switch(e.status){case 0:case 1:return"#3575C7";case 2:return"#43A65D";case 3:return"#ff0000";case 4:return"#c9c9c9";case 5:case 6:return"#ca6b61";case 7:return"#9655b4";case 8:return"#9f19dd";default:return"transparent"}},orderPayStatusBg:function(e){switch(e){case 1:return"#3575C7";case 2:return"#43A65D";case 3:return"#ff0000";default:return"transparent"}},orderVoucherStatusBg:function(e){switch(e){case 1:case 5:case 6:return"#3575C7";case 2:return"#43A65D";case 3:return"#ff0000";case 4:return"#0026ff";case 7:return"#9655b4";case 8:return"#9f19dd";default:return"transparent"}},planStatus:function(e){switch(e){case 0:return"\u521b\u5efa\u4e2d";case 2:return"\u5ba1\u6838\u4e2d";case 3:return"\u5f85\u751f\u6548";case 4:return"\u8fdb\u884c\u4e2d";case 5:return"\u6682\u505c\u4e2d";case 6:return"\u5df2\u5b8c\u7ed3";case 7:return"\u672a\u901a\u8fc7"}},planStatusBg:function(e){switch(e){case 0:return"#BFBFBF";case 2:return"#ffaa00";case 3:return"#3575C7";case 4:return"#55ff7f";case 5:return"#55aaff";case 6:return"#e64c00";case 7:return"#b6bcb8"}},keyStatus:function(e){switch(e){case 1:return"\u5f85\u4f7f\u7528";case 2:return"\u5df2\u4f7f\u7528";case 3:return"\u5df2\u5931\u6548";case 4:return"\u5df2\u4f5c\u5e9f";case 5:return"\u4f7f\u7528\u9501\u5b9a\u4e2d"}},keyStatusBg:function(e){switch(e){case 1:return"#BFBFBF";case 2:return"#43A65D";case 3:return"#ffaa00";case 4:return"#e64c00";case 5:return"#3575C7"}},pageStatus:function(e){switch(e){case 1:return"H5";case 2:return"\u5fae\u4fe1";case 4:return"\u652f\u4ed8\u5b9d"}},pageStatusBg:function(e){switch(e){case 1:return"#ffaa00";case 2:return"#55ff7f";case 4:return"#55aaff"}},pageTypeStatus:function(e){switch(e){case 3:return"\u5151\u6362\u7801";case 1:return"\u767d\u540d\u5355";case 2:return"\u7acb\u51cf\u91d1";case 4:return"\u4f18\u60e0\u5238";case 8:return"\u4f18\u60e0\u5238\u767d\u540d\u5355"}},pageTypeStatusBg:function(e){switch(e){case 1:return"#ffaa00";case 2:return"#e64c00";case 3:return"#55aaff";case 4:return"#79AF83";case 8:return"#F2A505"}},keysStatus:function(e){switch(e){case 1:return"\u521b\u5efa\u4e2d";case 2:return"\u5ba1\u6838\u4e2d";case 4:return"\u8fdb\u884c\u4e2d";case 5:return"\u5df2\u6682\u505c";case 6:return"\u5df2\u5b8c\u7ed3";case 7:return"\u5df2\u4f5c\u5e9f";case 8:return"\u5ba1\u6279\u9a73\u56de"}},keysStatusBg:function(e){switch(e){case 1:return"#ffaa00";case 2:return"#55ff7f";case 5:case 8:return"#e64c00";case 4:return"#55aaff";case 6:return"#555500";case 7:return"#3575C7"}}},Pt=a(3),Bt=a(606),Et=(a(282),void 0),At=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;return new Promise(function(){var a=Object(j.a)(Object(f.a)().mark((function a(n,i){var c;return Object(f.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(c=null,1!==t){a.next=7;break}return a.next=4,Object(s.gd)(e);case 4:c=a.sent,a.next=16;break;case 7:if(2!==t){a.next=13;break}return a.next=10,Object(s.hd)(e);case 10:c=a.sent,a.next=16;break;case 13:return a.next=15,Object(s.id)(e);case 15:c=a.sent;case 16:200===c.code?!0===c.data.have?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u8be5key\u6279\u6b21(key\u3001\u5151\u6362\u7801)\uff0c\u4e0b\u9762\u6709",c.data.order.status_text,"\u8ba2\u5355\uff0c\u662f\u5426\u7ee7\u7eed\u4f5c\u5e9f \uff1f"]}),onConfirm:function(){n(2)},onCancel:function(){n(0)},className:"questModal",parentComponent:Et}):n(1):i(c);case 17:case"end":return a.stop()}}),a)})));return function(e,t){return a.apply(this,arguments)}}())},Vt=void 0,Jt=[{title:"\u4f18\u60e0\u5238-\u6279\u6b21ID",name:"id",prop:"id",type:"normal",width:"auto"},{title:"\u4f18\u60e0\u5238\u6279\u6b21\u540d\u79f0",width:"auto",type:"slot",prop:"title",name:"title"},{title:"\u6709\u6548\u671f",type:"slot",prop:"dates",name:"dates",width:"250px"},{title:"\u5f52\u5c5e\u8425\u9500\u8ba1\u5212\u540d\u79f0",width:"auto",type:"normal",prop:"plan_title",name:"plan_title"},{title:"\u5f52\u5c5ekey\u6279\u6b21id",width:"auto",type:"normal",prop:"key_batch_id",name:"key_batch_id"},{title:"\u542f\u7528/\u6682\u505c",width:"auto",type:"slot",prop:"switch"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"250px"},{title:"\u72b6\u6001",width:"auto",type:"slot",prop:"status",name:"status"},{title:"\u5238\u603b\u6570(\u5df2\u53d1\u653e)",width:"auto",type:"normal",prop:"quantity",name:"quantity"},{title:"\u5df2\u9886\u53d6",width:"auto",type:"normal",prop:"received",name:"received"},{title:"\u5df2\u4f7f\u7528",width:"auto",type:"normal",prop:"usage",name:"usage"},{title:"\u5269\u4f59\u6570",width:"auto",type:"normal",prop:"stock",name:"stock"},{title:"\u5df2\u5931\u6548",width:"auto",type:"normal",prop:"expired",name:"expired"},{title:"\u5df2\u4f5c\u5e9f",width:"auto",type:"normal",prop:"invalid",name:"invalid"}],Wt=function(){var e=Object(U.a)({tabList:[{title:"\u5168\u90e8",index:0},{title:"\u521b\u5efa\u4e2d",index:-1},{title:"\u672a\u5f00\u59cb",index:3},{title:"\u5ba1\u6838\u4e2d",index:6},{title:"\u672a\u901a\u8fc7",index:7},{title:"\u8fdb\u884c\u4e2d",index:1},{title:"\u751f\u6210\u4e2d",index:8},{title:"\u6682\u505c\u4e2d",index:2},{title:"\u5df2\u7ed3\u675f",index:4},{title:"\u5df2\u4f5c\u5e9f",index:5}],tableData:[],tableHeight:500,lodgingTable:!0,search:{plan_title:"",key_batch_id:"",code_batch_id:"",code_batch_name:""},planOptions:[],combinedValue:[],begin_time:"",end_time:"",status:"",page:1,limit:10,total:0,isQuery:!1}),t=Object(i.a)(e,2),a=t[0],l=t[1],u=Object(d.useRef)(null),p=Object(Pt.f)(),f=function(){var e=function(){var e,t=Object(ye.a)(a.search);t.plan_title=(null===(e=t.plan_title)||void 0===e?void 0:e.text)||"";var i=Object(n.a)(Object(n.a)({},t),{},{begin_time:a.begin_time||null,end_time:a.end_time||null,status:999!==a.status&&""!==a.status?a.status:null,page:a.page,limit:a.limit});return Object(Tt.a)(Object(n.a)({},i),(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)}))}();Object(s.cb)(e).then((function(e){Object(s.cc)(e,(function(e,t){l({page:e.page,total:e.total,tableData:e.data})}))}))};function j(e,t){var n=a.search;n[e]=t,l({search:n})}Object(d.useEffect)((function(){Object(s.yb)().then((function(e){return Object(s.cc)(e,(function(e,t){var a=e.map((function(e){return{key:e.id,text:e.title}}));l({planOptions:a})}),(function(e){}))}))}),[]),Object(d.useEffect)((function(){f()}),[a.isQuery]);var g=function(e,t){var a="3";sessionStorage.setItem("knockGold_effectDate",JSON.stringify({}));var n=[{pagetitle:"\u65b0\u5efa\u5151\u6362\u7801",items:[{path:"/home/coupon-list",name:"\u4f18\u60e0\u5238\u7ba1\u7406"},{path:"/home/coupon-add-edit",name:"\u65b0\u5efa\u4f18\u60e0\u5238"}]}];1===e?(n[0].pagetitle="\u590d\u5236",n[0].items[1].name="\u590d\u5236:".concat(t.title),sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t.keyBatch.plan)),sessionStorage.setItem("keyBatch_id",t.key_batch_id),a="2"):2===e?(n[0].pagetitle="\u7f16\u8f91",n[0].items[1].name="\u7f16\u8f91:".concat(t.title),sessionStorage.setItem("approval_id",t.approval_id),sessionStorage.setItem("approval_status",t.status),sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t.keyBatch.plan)),a="1"):(a="3",sessionStorage.setItem("knockGold_effectDate","")),sessionStorage.setItem("code_id",null===t||void 0===t?void 0:t.id),sessionStorage.setItem("breaknav",JSON.stringify(n)),sessionStorage.setItem("pathname2","/home/coupon-add-edit"),sessionStorage.setItem("keyType","2"),sessionStorage.setItem("KeyPcType",a),p.push("/home/coupon-add-edit")},y=function(e){Object(s.v)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),l({isQuery:!a.isQuery})}),(function(e){h.a.error(e)}))})).catch((function(e){}))},_=function(e,t){switch(e){case 1:return[4,5,6,8].includes(t.status)?Object(b.jsx)("span",{style:{color:"#d8dbdd"},className:"grid-link",children:"\u7f16\u8f91"}):Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return g(2,t)},children:"\u7f16\u8f91"});case 2:return[1,2,3].includes(t.status)||[4,5].includes(t.status)&&[4,5,8].includes(t.keyBatch.status)&&[3,5,4].includes(t.keyBatch.plan.status)?Object(b.jsx)("span",{className:"grid-link",style:{},onClick:function(e){return g(1,t)},children:"\u590d\u5236"}):Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u590d\u5236"});case 3:return-1===t.status||7===t.status&&-1===t.old_status?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(){return e=t,void ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u4f60\u786e\u5b9a\u8981\u5220\u9664\u8be5\u6761\u6570\u636e?"}),onConfirm:function(){Object(s.G)(e.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),l({isQuery:!a.isQuery})}),(function(e){h.a.error(e)}))}))},onCancel:function(){},className:"questModal",parentComponent:Vt});var e},children:"\u5220\u9664"}):[1,2,3].includes(t.old_status)?1===t.approval_status?Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u4f5c\u5e9f"}):Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return function(e,t){if(6!=t.status){var a={type:3,object_value:t.id};try{At(a).then((function(e){2===e?y(t.id):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u4f5c\u5e9f",t.title,"\uff1f"]}),onConfirm:function(){y(t.id)},onCancel:function(){},className:"questModal",parentComponent:Vt})}))}catch(n){}}else h.a.error("\u5ba1\u6838\u4e2d\u7684\u6570\u636e\u4e0d\u5141\u8bb8\u4f5c\u5e9f")}(0,t)},children:"\u4f5c\u5e9f"}):Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u4f5c\u5e9f"});case 4:return 6===t.status&&Number(t.approval_id)>0?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return v(e,t)},children:"\u64a4\u9500\u5ba1\u6279"}):Object(b.jsx)("span",{style:{color:"#d8dbdd"},children:"\u64a4\u9500\u5ba1\u6279"});default:return}},v=function(e,t){var n=t.approval_id;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u8be5\u6570\u636e\u6b63\u5728\u5ba1\u6279\u4e2d,\u662f\u5426\u786e\u8ba4\u64a4\u9500\u5ba1\u6279\uff1f"}),onConfirm:function(){Object(s.pd)(n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u64a4\u9500\u5ba1\u6279\u6210\u529f"),setTimeout((function(){l({isQuery:!a.isQuery})}),3e3)}),(function(e){h.a.error(e)}))}))},onCancel:function(){},className:"questModal",parentComponent:Vt})},x=Object(b.jsx)(Bt.a,{className:"zent-datepicker-demo",value:a.combinedValue,showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",onChange:function(e){return function(e){if(e[0]){if(Z()(e[1]).diff(Z()(e[0]),"years")>2)return void h.a.error("\u67e5\u8be2\u65f6\u95f4\u4e0d\u80fd\u8d85\u8fc73\u5e74");l({begin_time:e[0],end_time:e[1],isQuery:!a.isQuery,combinedValue:e})}else l({combinedValue:e,begin_time:"",end_time:"",isQuery:!a.isQuery})}(e)}});return Object(b.jsxs)("div",{className:"table-box-app",children:[Object(b.jsx)(It,{tabs:a.tabList,tabChange:function(e){return function(e){var t=a.tabList[e].index;l({page:1,limit:10,status:t,isQuery:!a.isQuery})}(e)},width:130,first:!0,slot:x}),Object(b.jsxs)("div",{className:"query-box",children:[Object(b.jsx)("div",{className:"codesFind",children:Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u540d\u79f0\uff1a",required:"",labelwidth:"90px",children:Object(b.jsx)(ne.a,{name:"state",value:a.search.plan_title,options:a.planOptions,placeholder:"\u8bf7\u8f93\u5165",width:250,clearable:!0,onChange:function(e){j("plan_title",e)}})}),Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21ID\uff1a",required:"",labelwidth:"100px",children:Object(b.jsx)(r.a,{value:a.search.key_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(e){j("key_batch_id",e)},onClearItem:function(e){j("key_batch_id","")}})}),Object(b.jsx)(c.a,{labelname:"\u4f18\u60e0\u5238\u6279\u6b21\u540d\u79f0\uff1a",required:"",labelwidth:"155px",children:Object(b.jsx)(r.a,{value:a.search.code_batch_name,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(e){j("code_batch_name",e)},onClearItem:function(e){j("code_batch_name","")}})}),Object(b.jsx)(c.a,{labelname:"\u4f18\u60e0\u5238\u6279\u6b21ID\uff1a",required:"",labelwidth:"130px",children:Object(b.jsx)(r.a,{value:a.search.code_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(e){j("code_batch_id",e)},onClearItem:function(e){j("code_batch_id","")}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return f()},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){l({search:{plan_title:"",key_batch_id:"",code_batch_id:"",code_batch_name:""},isQuery:!a.isQuery})},children:"\u91cd\u7f6e"})]})]})}),Object(b.jsx)(m.a,{type:"primary",className:"add",icon:"plus",onClick:function(){return g()},children:"\u65b0\u589e\u4f18\u60e0\u5238"})]}),Object(b.jsx)(q,{spliteColor:"#fff",tableData:a.tableData,Column:Jt,maxheight:a.tableHeight,isSwitch:!1,isMultiple:!1,countbarVisible:!1,page:a.page,ref:u,dataCount:a.total,pageChange:function(e){l({page:e,isQuery:!a.isQuery})},emptyText:a.lodgingTable?"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55":"\u67e5\u8be2 \u8bf7\u8f93\u5165\u3010\u5206\u9500\u5546\u3011\u6216\u3010\u8ba1\u5212\u540d\u79f0\u3011\u6216\u3010key\u3011\u8fdb\u884c\u67e5\u8be2",countChange:function(e){l({limit:e,isQuery:!a.isQuery})},ComponentHandler:function(e,t){return"title"===e?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return function(e,t){sessionStorage.setItem("pathname2","/home/coupon-commodity");var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/coupon-list",name:"\u4f18\u60e0\u5238\u7ba1\u7406"},{path:"/home/coupon-add-edit",name:t.title+"\u4f18\u60e0\u5238\u7684\u5546\u54c1\u8303\u56f4\u5217\u8868"}]}];sessionStorage.setItem("code_id",t.id),sessionStorage.setItem("breaknav",JSON.stringify(a)),window.open("#/home/coupon-commodity")}(0,t)},children:t.title}):"dates"===e?Object(b.jsxs)("span",{children:[t.begin_time," \u81f3 ",t.end_time]}):"switch"==e?Object(b.jsx)(S.a,{size:"small",checked:2!=t.old_status,onChange:function(e){return n=t,void ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426",2==n.old_status?"\u542f\u7528":"\u505c\u7528","\u8be5\u4f18\u60e0\u5238\u6279\u6b21\uff1f"]}),onConfirm:function(){Object(s.Ic)(n.id,{operation:1==n.old_status?"2":"1"}).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),l({isQuery:!a.isQuery})}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:function(){},className:"questModal",parentComponent:Vt});var n},disabled:4==t.status||5==t.status}):"status"==e?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.exchangeStatusBg(parseInt(t.status))}}),t.status_text]})}):"opearo"==e?Object(b.jsxs)("div",{children:[_(1,t),_(2,t),_(3,t),t.approval_id&&6===t.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return n=t.approval_id,void Object(s.K)(n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success(t),l({isQuery:!a.isQuery})}),(function(e){h.a.error(e)}))}));var n},children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}),_(4,t)]}):void 0}})]})},zt=(a(39),a(283),a(609)),Rt=a(80),Yt=a(583),Kt=a(407),Gt=(a(284),function(e){var t=e.options,a=(e.clearable,e.placeholder),n=void 0===a?"\u8bf7\u8f93\u5165":a,s=e.value,c=e.onChange,o=e.width,r=e.onChangePage,l=e.disabled,u=void 0!==l&&l,h=e.onKeywordChange,p=e.keyword,m=void 0===p?"":p,f=!0,j=Object(d.useState)(!0),g=Object(i.a)(j,2),y=g[0],_=g[1],v=Object(d.useState)(!1),x=Object(i.a)(v,2),O=x[0],k=x[1],S=function(e){setTimeout((function(){r(e)}),2e3)};return Object(b.jsx)("div",{children:Object(b.jsx)(ne.a,{options:t,placeholder:n,value:s,onChange:c,width:o,loading:y,open:O,disabled:u,onOpenChange:function(e){k(e),e&&f&&(f=!1,_(!0),setTimeout((function(){_(!1)}),2e3))},renderOptionList:function(e,t){return Object(b.jsx)(Yt.a,{hasMore:!0,skipLoadOnMount:!0,loadMore:S,className:"infinite-scroller-demo",loader:Object(b.jsx)("div",{className:"loading-text",children:Object(b.jsx)(Kt.a,{iconSize:18,loading:!0,icon:"circle",iconText:"\u52a0\u8f7d\u4e2d\u2026",textPosition:"right",colorPreset:"grey"})}),children:e.map((function(e,a){return t(e,a)}))})},onKeywordChange:h,keyword:m})})}),Ut=[{type:"required",message:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7"},{type:"regExp",message:"\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u5bf9",reg:/^[1][3,4,5,6,7,8,9][0-9]{9}$/}],Qt=[{type:"required",message:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1"}],$t=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onUploadError=function(e,t){"overMaxAmount"===e?(h.a.clear(),h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247"))):"overMaxSize"===e&&(h.a.clear(),h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize,"b")))},n.state={phone_nums:1,id:"",headImg:"",uploadimgFile:"",email_nums:1,disabled:!1,pwdtype:"text",phoneSwitch:[!1,!1,!1,!1],emailSwitch:[!1,!1,!1,!1],defaultFileList:[{src:""}],isSelectDirect:!1,model:{name:"",account:"",password:"",subject:"",contact_name:"",contact_phone:"",contact_email:"",salesman_id:"",company_id:"",identity_type:"",phone1:"",phone2:"",phone3:"",phone4:"",email1:"",email2:"",email3:"",email4:"",direct_reseller_id:""},rules:{fullname:[{type:"required",message:"\u8bf7\u8f93\u5165\u5206\u9500\u5546\u5168\u79f0"}],subject:[{type:"required",message:"\u8bf7\u8f93\u5165\u5206\u9500\u5546\u4e3b\u4f53"}],account:[{type:"required",message:"\u8bf7\u8f93\u5165\u767b\u5f55\u8d26\u53f7"}],pwd:[{type:"required",message:"\u8bf7\u8f93\u5165\u5bc6\u7801"},{type:"regExp",message:"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210\uff0c(\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199)",reg:/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/}],contacts:[{type:"required",message:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba"},{type:"regExp",message:"2-16\u5b57\u6c49\u5b57/\u5b57\u6bcd\u7ec4\u6210",reg:/^([\u4e00-\u9fa5]|[a-zA-Z]){2,16}$/}],contacts_phone:Ut,contacts_email:[{type:"required",message:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1"}],sale:[{type:"required",message:"\u8bf7\u9009\u62e9\u9500\u552e\u4eba\u5458"}],identity:[{type:"required",message:"\u8bf7\u9009\u62e9\u8eab\u4efd\u7c7b\u578b"}],sign:[{type:"required",message:"\u8bf7\u9009\u62e9\u7b7e\u7ea6\u516c\u53f8"}],phone1:Ut,phone2:Ut,phone3:Ut,phone4:Ut,email1:Qt,email2:Qt,email3:Qt,email4:Qt,direct_reseller_id:[{type:"required",message:"\u8bf7\u9009\u62e9\u6620\u5c04\u5206\u9500\u5546"}]},companyList:[],directList:[],personnelList:[],fieldArr:[],fieldTitle:"",addfield:{},identityType:[{key:1,text:"\u76f4\u5ba2"},{key:2,text:"\u53cb\u5546"}],limit:15,page:1,keyword:""},n}return Object(y.a)(a,[{key:"setZentOpt",value:function(e){return e.map((function(e){return{key:e.id,text:e.name,disabled:e.disabled}}))}},{key:"componentDidMount",value:function(){var e={limit:this.state.limit,page:this.state.page};this.directList(e)}},{key:"directList",value:function(e){var t=this;Object(s.gb)(e).then((function(e){if(200===e.code){var a=t.state.directList;a=a.concat(t.setZentOpt(e.data.data)),t.setState({directList:a})}}))}},{key:"submit",value:function(){return this.refs.form1.validator()}},{key:"onUploadChange",value:function(e){var t=this;if(e&&e.length>0){var a=new FormData;a.append("file",e[0].file),a.append("path","reseller_avatar"),Object(s.sd)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({headImg:e.path}),h.a.clear(),h.a.success(a)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else t.setState({headImg:""})}},{key:"onSetAll",value:function(e,t){var a=this.state.model;a[e]=t,this.setState({model:a})}},{key:"onDirectChange",value:function(e){var t=this.state.model;t.direct_reseller_id=e,this.setState({page:1,model:t})}},{key:"onChangePageSelect",value:function(e){var t=this.state.page;this.setState({page:t+1});var a={limit:this.state.limit,page:t+1};this.directList(a),e&&e()}},{key:"NameblurFn",value:function(e){if(0==this.props.enumer)Object(s.jb)(e).then((function(e){Object(s.cc)(e,(function(e,t){}),(function(e){h.a.error(e)}))})).catch((function(e){}));else{var t={id:JSON.parse(sessionStorage.getItem("dataInfo")).id};Object(s.Xb)(e,t).then((function(e){Object(s.cc)(e,(function(e,t){}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}},{key:"AccountblurFn",value:function(e){if(0==this.props.enumer)Object(s.ib)(e).then((function(e){Object(s.cc)(e,(function(e,t){}),(function(e){h.a.error(e)}))})).catch((function(e){}));else{var t={id:JSON.parse(sessionStorage.getItem("dataInfo")).id};Object(s.Wb)(e,t).then((function(e){Object(s.cc)(e,(function(e,t){}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}},{key:"cancel",value:function(){this.setState({model:{}}),this.refs.form1.cancel()}},{key:"componentWillMount",value:function(){if(this.getPersonnelFn(),this.getCompanyFn(),1==this.props.enumer){var e,t=JSON.parse(sessionStorage.getItem("dataInfo")),a="",n="";t&&(a=0===t.direct_reseller_id?"":{key:t.direct_reseller_id,text:t.direct_reseller_name},n=0!==t.direct_reseller_id);for(var i=Object(ye.a)(t),s={name:i.name,password:"yxtx2021",account:i.account,contact_name:i.contact_name,company_id:{key:i.company_id,text:i.company_name},identity_type:{key:i.identity_type,text:i.identity_type_text},salesman_id:{key:i.salesman_id,text:i.salesman_name},subject:i.subject,direct_reseller_id:a},c=i.contact_phone,o=this.state.phoneSwitch,r=0;r0)o[r-1]=!0,s["phone"+r]=c[r]}this.setState({pwdtype:"password"}),this.setState({phoneSwitch:o});for(var l=this.state.emailSwitch,d=i.contact_email,u=0;u0)l[u-1]=!0,s["email"+u]=d[u]}this.setState({emailSwitch:l});var h={};h.src=i.head_img,this.setState((e={id:i.id,phone_nums:c.length,email_nums:d.length,model:s,disabled:!0,isSelectDirect:n,defaultFileList:[h]},Object(se.a)(e,"id",i.id),Object(se.a)(e,"headImg",i.head_img),e))}}},{key:"getPersonnelFn",value:function(){var e=this;Object(s.xb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.real_name}}));e.setState({personnelList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getCompanyFn",value:function(){var e=this;Object(s.ab)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.company_name}}));e.setState({companyList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"addfieldArr",value:function(){if(4==this.state.phoneSwitch.filter((function(e){return 1==e})).length)h.a.clear(),h.a.error("\u6dfb\u52a0\u7684\u624b\u673a\u53f7\u7801\u6570\u91cf\u5df2\u7ecf\u8fbe\u5230\u4e0a\u9650\uff01");else{for(var e=this.state.phoneSwitch,t=0;t<4;t++)if(0==e[t]){e[t]=!0;break}this.setState({phoneSwicth:e})}}},{key:"addEmailArr",value:function(){if(4==this.state.emailSwitch.filter((function(e){return 1==e})).length)h.a.clear(),h.a.error("\u6dfb\u52a0\u7684\u90ae\u7bb1\u53f7\u7801\u6570\u91cf\u5df2\u7ecf\u8fbe\u5230\u4e0a\u9650\uff01");else{for(var e=this.state.emailSwitch,t=0;t<4;t++)if(0==e[t]){e[t]=!0;break}this.setState({emailSwitch:e})}}},{key:"changeType",value:function(e){this.setState({pwdtype:e})}},{key:"changeKind",value:function(){this.setState({pwdtype:"password"})}},{key:"onKeywordChange",value:function(e){var t=this;this.setState({keyword:e});var a={limit:this.state.limit,page:1,key_word:e};a.key_word||delete a.key_word,Object(s.gb)(a).then((function(e){if(200===e.code){var a=t.state.directList;a=t.setZentOpt(e.data.data),t.setState({directList:a})}}))}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"addaccinfo",className:"addreseller",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:this.state.rules,ref:"form1",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5206\u9500\u5546\u5168\u79f0",prop:"fullname",children:Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("name",t)},onClearItem:function(t){e.onSetAll("name","")},onblurFn:function(t){e.NameblurFn(t)},countShow:!1,value:this.state.model.name,placeholder:"\u8bf7\u8f93\u5165\u5206\u9500\u5546\u5168\u79f0",labelWidth:"0px",maxLength:32,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u4e3b\u4f53\u540d\u79f0",prop:"subject",children:Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("subject",t)},onClearItem:function(t){e.onSetAll("subject","")},countShow:!1,value:this.state.model.subject,placeholder:"\u8bf7\u8f93\u5165\u4e3b\u4f53\u5168\u79f0",labelWidth:"0px",maxLength:32,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u767b\u5f55\u8d26\u53f7",prop:"account",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("account",t)},disabled:this.state.disabled,onblurFn:function(t){e.AccountblurFn(t)},onClearItem:function(t){e.onSetAll("account","")},countShow:!1,value:this.state.model.account,placeholder:"\u8bf7\u8f93\u5165\u767b\u5f55\u8d26\u53f7",labelWidth:"0px",maxLength:32,height:"36px",width:"520px",alignment:"left"}),0==this.props.enumer?Object(b.jsx)(zt.a,{text:"\u8d26\u53f7\uff1a"+this.state.model.account+";\u5bc6\u7801\uff1a"+this.state.model.password,onCopySuccess:function(){h.a.clear(),h.a.success("\u590d\u5236\u6210\u529f\uff01")},children:Object(b.jsx)(m.a,{type:"info",disabled:!this.state.model.account||this.state.model.password.length<6,children:"\u590d\u5236\u8d26\u53f7\u5bc6\u7801"})}):null]})}),Object(b.jsx)(c.a,{labelname:"\u5bc6\u7801",prop:"pwd",children:Object(b.jsx)(r.a,{markedShow:function(t){e.changeType(t)},kind:this.state.pwdtype,onChange:function(t){e.onSetAll("password",t)},disabled:this.state.disabled,countShow:!0,onfocusFn:function(t){return e.changeKind()},onClearItem:function(t){e.onSetAll("password","")},value:this.state.model.password,placeholder:"\u8bf7\u8f93\u5165\u5bc6\u7801",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba",prop:"contacts",children:Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("contact_name",t)},onClearItem:function(t){e.onSetAll("contact_name","")},countShow:!0,value:this.state.model.contact_name,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u624b\u673a\u53f7",prop:"contacts_phone",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("contact_phone",t)},onClearItem:function(t){e.onSetAll("contact_phone","")},countShow:!1,value:this.state.model.contact_phone,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{onClick:function(){return e.addfieldArr()},children:"\u6dfb\u52a0\u53f7\u7801"})]})}),1==this.state.phoneSwitch[0]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u624b\u673a\u53f71",prop:"phone1",id:"phone1",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("phone1",t),Rt.a.emit("input","phone1",t)},onClearItem:function(t){e.onSetAll("phone1","")},countShow:!1,value:this.state.model.phone1,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("phone1","");var a=e.state.phoneSwitch;a[0]=!1,e.setState({phoneSwitch:a});var n=e.state.phone_nums-1;e.setState({phone_nums:n})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.phoneSwitch[1]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u624b\u673a\u53f72",prop:"phone2",id:"phone2",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("phone2",t),Rt.a.emit("input","phone2",t)},onClearItem:function(t){e.onSetAll("phone2","")},countShow:!1,value:this.state.model.phone2,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("phone2","");var a=e.state.phoneSwitch;a[1]=!1,e.setState({phoneSwitch:a});var n=e.state.phone_nums-1;e.setState({phone_nums:n})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.phoneSwitch[2]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u624b\u673a\u53f73",prop:"phone3",id:"phone3",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("phone3",t),Rt.a.emit("input","phone3",t)},onClearItem:function(t){e.onSetAll("phone3","")},countShow:!1,value:this.state.model.phone3,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("phone3","");var a=e.state.phoneSwitch;a[2]=!1,e.setState({phoneSwitch:a});var n=e.state.phone_nums-1;e.setState({phone_nums:n})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.phoneSwitch[3]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u624b\u673a\u53f74",prop:"phone4",id:"phone4",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("phone4",t),Rt.a.emit("input","phone4",t)},onClearItem:function(t){e.onSetAll("phone4","")},countShow:!1,value:this.state.model.phone4,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("phone4","");var a=e.state.phoneSwitch;a[3]=!1,e.setState({phoneSwitch:a});var n=e.state.phone_nums-1;e.setState({phone_nums:n})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u90ae\u7bb1",prop:"contacts_email",id:"contacts_email",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("contact_email",t)},onClearItem:function(t){e.onSetAll("contact_email","")},countShow:!1,value:this.state.model.contact_email,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1",labelWidth:"0px",maxLength:50,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{onClick:function(){return e.addEmailArr()},children:"\u6dfb\u52a0\u90ae\u7bb1"})]})}),1==this.state.emailSwitch[0]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u90ae\u7bb11",prop:"email1",id:"email1",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("email1",t),Rt.a.emit("input","email1",t)},onClearItem:function(t){e.onSetAll("email1","")},countShow:!1,value:this.state.model.email1,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1",labelWidth:"0px",maxLength:50,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("email1","");var a=e.state.emailSwitch;a[0]=!1,e.setState({emailSwitch:a})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.emailSwitch[1]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u90ae\u7bb12",prop:"email2",id:"email2",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("email2",t),Rt.a.emit("input","email2",t)},onClearItem:function(t){e.onSetAll("email2",t)},countShow:!1,value:this.state.model.email2,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1",labelWidth:"0px",maxLength:50,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("email2","");var a=e.state.emailSwitch;a[1]=!1,e.setState({emailSwitch:a})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.emailSwitch[2]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u90ae\u7bb13",prop:"email3",id:"email3",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("email3",t),Rt.a.emit("input","email3",t)},onClearItem:function(t){e.onSetAll("email3","")},countShow:!1,value:this.state.model.email3,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1",labelWidth:"0px",maxLength:50,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("email3","");var a=e.state.emailSwitch;a[2]=!1,e.setState({emailSwitch:a})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,1==this.state.emailSwitch[3]?Object(b.jsx)(c.a,{labelname:"\u8054\u7cfb\u4eba\u90ae\u7bb14",prop:"email4",id:"email4",children:Object(b.jsxs)("div",{className:"phonet",children:[Object(b.jsx)(r.a,{onChange:function(t){e.onSetAll("email4",t),Rt.a.emit("input","email4",t)},onClearItem:function(t){e.onSetAll("email4","")},countShow:!1,value:this.state.model.email4,placeholder:"\u8bf7\u8f93\u5165\u8054\u7cfb\u4eba\u90ae\u7bb1",labelWidth:"0px",maxLength:50,height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)(m.a,{type:"danger",onClick:function(t){e.onSetAll("email4","");var a=e.state.emailSwitch;a[3]=!1,e.setState({emailSwitch:a})},children:"\u5220\u9664\u6b64\u9879"})]})}):null,Object(b.jsx)(c.a,{prop:"sale",labelname:"\u9500\u552e\u4eba\u5458",id:"sale",children:Object(b.jsx)(ne.a,{options:this.state.personnelList,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u9500\u552e\u4eba\u5458",value:this.state.model.salesman_id,onChange:function(t){e.onSetAll("salesman_id",t),Rt.a.emit("change","sale",t)},popupWidth:"360px",width:"520px"})}),Object(b.jsx)(c.a,{prop:"identity",labelname:"\u8eab\u4efd\u7c7b\u578b",id:"identity",children:Object(b.jsx)(ne.a,{options:this.state.identityType,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u8eab\u4efd\u7c7b\u578b",value:this.state.model.identity_type,onChange:function(t){e.onSetAll("identity_type",t),Rt.a.emit("change","identity",t)},popupWidth:"360px",width:"520px"})}),Object(b.jsx)(c.a,{prop:"sign",labelname:"\u7b7e\u7ea6\u516c\u53f8",id:"sign",children:Object(b.jsx)(ne.a,{options:this.state.companyList,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u7b7e\u7ea6\u516c\u53f8",value:this.state.model.company_id,onChange:function(t){e.onSetAll("company_id",t),Rt.a.emit("change","sign",t)},popupWidth:"520px",width:"520px"})}),Object(b.jsxs)(c.a,{prop:"direct_reseller_id",labelname:"\u6620\u5c04\u5206\u9500\u5546",id:"direct_reseller_id",children:[Object(b.jsx)(Gt,{options:this.state.directList,clearable:!0,page:this.state.page,placeholder:"\u8bf7\u9009\u62e9\u6620\u5c04\u5206\u9500\u5546",value:this.state.model.direct_reseller_id,onChangePage:this.onChangePageSelect.bind(this),disabled:this.state.isSelectDirect,keyword:this.state.keyword,onKeywordChange:this.onKeywordChange.bind(this),onChange:function(t){e.onDirectChange(t),Rt.a.emit("change","direct_reseller_id",t)},width:"520px"}),Object(b.jsx)("p",{className:"tip-reseller",children:"\u63d0\u793a\uff1a\u6620\u5c04\u5206\u9500\u5546\u4fdd\u5b58\u540e\u4e0d\u53ef\u7f16\u8f91\uff0c\u8bf7\u8c28\u614e\u9009\u62e9\uff01"})]})]}),Object(b.jsxs)("div",{className:"mypic",children:[Object(b.jsx)("b",{children:"\u5206\u9500\u5546\u5934\u50cf"}),Object(b.jsx)("div",{className:"changepic dflexac",children:this.state.defaultFileList[0].src.includes("lsxd")?Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,defaultFileList:this.state.defaultFileList,onError:this.onUploadError}):Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,onError:this.onUploadError})})]})]})}}]),a}(u.a.Component),Zt=(a(285),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={enumer:0},n}return Object(y.a)(a,[{key:"activeFn",value:function(){var e=this.refs.disbutorForm.submit(),t=this.refs.disbutorForm.state.model,a=this;e?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:0==a.state.enumer?Object(b.jsxs)("p",{children:["\u662f\u5426\u65b0\u589e",Object(b.jsxs)("b",{children:["[",t.name,"]"]}),"\u5206\u9500\u5546\uff1f"]}):Object(b.jsxs)("p",{children:["\u662f\u5426\u4fee\u6539",Object(b.jsxs)("b",{children:["[",t.name,"]"]}),"\u5206\u9500\u5546\u4fe1\u606f\uff1f"]}),onConfirm:function(){var e=Object(ye.a)(t);a.refs.disbutorForm.state.headImg&&(e.head_img=a.refs.disbutorForm.state.headImg),e.salesman_id=t.salesman_id.key,e.salesman_name=t.salesman_id.text,e.company_id=t.company_id.key,e.company_name=t.company_id.text,e.identity_type=t.identity_type.key;var n=[t.contact_phone];n.push(e.phone1),n.push(e.phone2),n.push(e.phone3),n.push(e.phone4);var i=n.filter((function(e){return e}));e.contact_phone=i.join(",");var c=[t.contact_email];c.push(e.email1),c.push(e.email2),c.push(e.email3),c.push(e.email4);var o=c.filter((function(e){return e}));if(e.contact_email=o.join(","),(e=Object(l.a)(e,["phone1","phone2","phone3","phone4","email1","email2","email3","email4"])).direct_reseller_id=t.direct_reseller_id.key,0==a.state.enumer)Object(s.tc)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/distributor-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}));else{var r=a.refs.disbutorForm.state.id;delete e.account,delete e.password,e.head=a.state.headImg,Object(s.Pc)(r,e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/distributor-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.error("\u8bf7\u5b8c\u5584\u8868\u5355\u6570\u636e"))}},{key:"componentWillMount",value:function(){var e=JSON.parse(sessionStorage.getItem("breaknav"))[0].pagetitle,t=e.includes("\u65b0\u5efa")?0:1;this.setState({pagetitle:e+"\u5206\u9500\u5546",enumer:t})}},{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/distributor-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"render",value:function(){return Object(b.jsxs)("div",{className:"maincenter",children:[Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.pagetitle,children:Object(b.jsx)("div",{className:"adddistributor",children:Object(b.jsx)($t,{ref:"disbutorForm",enumer:this.state.enumer})})}),Object(b.jsxs)("div",{className:"distributorbtn",children:[Object(b.jsx)(m.a,{type:"primary",onClick:this.activeFn.bind(this),children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:this.cancel.bind(this),children:"\u53d6\u6d88"})]})]})}}]),a}(u.a.Component)),Xt=(a(286),a(28)),ea=(a(287),a(514)),ta=(a(288),a(438)),aa=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={checkVisble:!0,visible:e.visible,data:e.data},n}return Object(y.a)(a,[{key:"componentDidUpdate",value:function(e,t){e.data.length!==t.data.length&&this.setState({data:e.data})}},{key:"clearAllCheck",value:function(){}},{key:"clearIndexCheck",value:function(e){var t=Object(ta.a)(this.props.data,(function(t){return t.id==e}));this.state.data[t].check=!1,this.setState({data:this.state.data})}},{key:"checkChange",value:function(e,t){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();var a=[];if(this.props.multiple)a=this.state.data;else{for(var n=0;n0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:function(){var t=e.state.tableData.map((function(e){return e.checked=!1,e}));e.setState({selectionData:[],tableData:t})},children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:this.state.selectionData.length}),"\u9879\uff0c\u5b98\u65b9\u4ef7\u683c\u603b\u8ba1:",this.state.contractPrice.toFixed(4),"\uff0c\u5408\u540c\u4ef7\u603b\u8ba1\uff1a",this.state.totalPrice.toFixed(4)]}):null,Object(b.jsx)("div",{className:"code-table",children:Object(b.jsx)(q,{isMultiple:!0,spliteColor:"#fff",dataCount:this.state.dataCount,tableData:this.state.tableData,Column:fa,countbarVisible:!1,isSwitch:!1,maxheight:this.state.tableHeight,pageChange:function(t){e.onPageChange(t)},countChange:function(t){e.onCountChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(t,a){return"status"==t?Object(b.jsx)(je.a,{theme:"blue",outline:!0,children:a.status}):"voucher_batch"==t?Object(b.jsx)(b.Fragment,{children:e.voucherBatchForEl(a.voucher_batch)}):"opearo"==t?Object(b.jsx)(b.Fragment,{children:1==e.state.isCombining?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(t){return e.deleteFn(t,a)},children:"\u5220\u9664"}):Object(b.jsx)("span",{className:"grid-link",style:{color:"rgb(216, 219, 221)"},children:"\u5220\u9664"})}):void 0}})})]})})}}]),a}(u.a.Component),ga=a(518),ya=a(519),_a=a(520),va=a(342),xa=(a(295),{code_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u540d\u79f0"}],planSelect:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5e\u8ba1\u5212"}],keyBatchSelect:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5eKey"}],issued:[{type:"required",message:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf"}],restrict:[{type:"required",message:"\u8bf7\u8f93\u5165\u7ed1\u5b9a\u6570\u91cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u5927\u4e8e0\u7684\u6b63\u6574\u6570",reg:"^[0-9]*[1-9][0-9]*$"}]}),Oa={date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5"}],period_num:[{type:"required",message:"\u8bf7\u8f93\u5165\u5468\u671f\u89c4\u5219"}]},ka=[{title:"\u5546\u54c1ID",name:"product_id",prop:"product_id",width:"50px",type:"normal"},{title:"\u5546\u54c1\u540d\u79f0",width:"200px",prop:"product_name",name:"product_name",type:"normal"},{title:"\u603b\u9884\u7b97",name:"all_budget",prop:"all_budget",type:"normal",width:"50px"},{title:"\u5408\u540c\u5355\u4ef7",name:"contract_price",prop:"contract_price",type:"normal",width:"50px"},{title:"\u5546\u54c1\u5b98\u65b9\u4ef7",type:"normal",prop:"official_price",width:"auto"},{title:"\u7c7b\u578b",width:"50px",prop:"type",name:"type",type:"slot"},{title:"\u4e0a\u6e38\u5e73\u53f0",width:"50px",prop:"upstream",name:"upstream",type:"normal"},{title:"\u6279\u6b21\u53f7",width:"120px",prop:"voucher_batch",name:"voucher_batch",type:"slot"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"130px",prop:"effectDate",name:"effectDate",type:"normal"},{title:"\u5f53\u524d\u6210\u672c\u4ef7\u683c",prop:"cost_price",name:"cost_price",width:"auto",type:"50px"},{title:"\u5e93\u5b58\u603b\u6570\u91cf",prop:"quantity",name:"quantity",type:"normal",width:"100px"},{title:"\u5269\u4f59\u6570\u91cf",prop:"stock",name:"stock",type:"normal",width:"50px"},{title:"\u5df2\u4f7f\u7528\u6570\u91cf",prop:"usage",name:"usage",type:"normal",width:"100px"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"50px"}];function Sa(e){var t={},a="1"===e.cash_amount_type?e.denomination:"".concat(e.min_denomination,"~").concat(e.max_denomination);return t.product_name=e.batch_goods_name,t.channel_activity_id=e.cash_activity_id,t.cash_activity_id=e.cash_activity_id,t.only=e.cash_activity_id,t.type=3,t.checked=null===e||void 0===e?void 0:e.checked,t.upstream=J(e.channel),t.edit="edit",t.all_budget=e.all_budget,t.effectDate=e.begin_time+" \u81f3 "+e.end_time,t.contract_price=(e.total_contract_price/e.num).toFixed(4),t.cost_price=a,t.official_price=a,t.quantity=e.total_stock||e.num,t.stock=e.stock||e.num,t.usage=e.usage||0,t.id=e.goods_id||e.id,t.product_id=e.goods_id||"-",t.origin=e,t}function wa(e){var t,a,n=parseInt(B(e.all_budget,P(e.reduce_amount,e.send_num))),i={};return i.product_name=e.batch_goods_name||e.product_name,i.channel_activity_id=e.channel_activity_id,i.only=e.channel_activity_id,i.type=2,i.checked=null===e||void 0===e?void 0:e.checked,i.upstream=J(e.channel),i.edit="edit",i.all_budget=e.all_budget,i.effectDate=e.effectDate||(null===(t=e.time_limit)||void 0===t?void 0:t.effect_time.start_time)+" \u81f3 "+(null===(a=e.time_limit)||void 0===a?void 0:a.effect_time.end_time),i.contract_price=e.contract_price||e.price,i.official_price=e.official_price||e.reduce_amount,i.quantity=e.quantity||n,i.stock=e.stock||n,i.usage=e.usage||0,i.origin=e,i.id=e.goods_id||e.id,i.product_id=e.goods_id||"-",i}var Ca=function(e){return Array.from({length:e},(function(e,t){return t}))},Na="",Da=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var i;return Object(g.a)(this,a),(i=t.call(this,e)).onDisabledTime=function(e){var t=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),a=new Date(t.begin_time),n=a.getHours(),i=a.getMinutes(),s=a.getSeconds();return Object(Q.a)(e,a)?{disabledHours:function(){return Ca(n)},disabledMinutes:function(e){return e===n?Ca(i):[]},disabledSeconds:function(e,t){return e===n&&t===i?Ca(s):[]}}:{}},i.onDisabledRange=function(e,t){var a=!1,n=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(i.state.plan_time[1]).format("HH:mm:ss");return"start"===t&&(a=s<"23:59:59"?Z()(n).isBefore(i.state.plan_time[0])||Z()(n).subtract(1,"days").isAfter(i.state.plan_time[1]):Z()(n).isBefore(i.state.plan_time[0])||Z()(n).isAfter(i.state.plan_time[1])),"end"===t&&(a=Z()(n).add(1,"days").isBefore(i.state.plan_time[0])||Z()(n).isAfter(i.state.plan_time[1])),a},i.state=Object(n.a)({},{uploading:!1,model:{product_id:"",product_type:"1",contract_price:"",official_price:"",cost_price:"",quantity:"",product_name:"",show_url:"",describe_url:"",detail_url:"",weight:"0"},codeInfo:{code_name:"",issued:"",describe:"",date_time:"",range:"",stock:"",planSelect:"",keyBatchSelect:"",restrict:"",period_type:"1",period_num:1,period_day:"",period_fixed_receive_time:""},isload:!1,tempdata:[],oldProduct:[],deleteProduct:[],new_product:[],cur_product:null,productOption:[],rankoptions:[],rank:[],recall_visible:!1,approvalLoading:!1,timer:3,payType:3,reseller:null,payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],isAudit:!1,approvalsStatus:!1,oldTable:[],product_title:"\u65b0\u5efa\u5546\u54c1",plan_time:"",direct_reseller_id:0,newGoodsBtnLoading:!1,tableLoading:!1,addIsType:1,isState:0,planSelectData:[],keyBatchSelectData:[],codeStatus:"",productData:null,settlement_type:0,isSettlement:2,settlementData:null}),i}return Object(y.a)(a,[{key:"componentDidMount",value:function(){var e=~~sessionStorage.getItem("isState");Na=~~sessionStorage.getItem("code_id"),this.setState({isState:e}),e&&this.getDetailFunction(e),2!==e&&(sessionStorage.setItem("productData",[]),sessionStorage.setItem("knockGoldData",[]),sessionStorage.setItem("redPacketsData",[]),this.getPlanSelect())}},{key:"getPlanSelect",value:function(){var e=this;Object(s.Zc)({bind_object:"1"}).then((function(t){Object(s.cc)(t,(function(t,a){var i=t.filter((function(e){return e.settlement_type<=0})).map((function(e){return Object(n.a)({key:e.id,text:e.title},e)}));e.setState({planSelectData:i})}),(function(e){h.a.error(e)}))}))}},{key:"getKeyBatchSelect",value:function(e){var t=this;Object(s.Yc)({status:"4,5",plan_id:e,bind_object:1}).then((function(e){Object(s.cc)(e,(function(e,a){var i=e.map((function(e){return Object(n.a)({key:e.id,text:e.batch_name},e)}));t.setState({keyBatchSelectData:i})}),(function(e){h.a.error(e)}))}))}},{key:"getResellerFunction",value:function(e){var t=this;Object(s.Cb)(e).then((function(e){Object(s.cc)(e,(function(e,a){var n={id:e.id,name:e.name,company_name:e.company_name,receive_email:e.contact_email[0]};t.setState({direct_reseller_id:e.direct_reseller_id,reseller:n})}))}))}},{key:"getDetailFunction",value:function(){var e=this;Object(s.Y)(Na).then((function(t){Object(s.cc)(t,(function(t){var a=Object(ye.a)(t);e.codeStatus=t.status;var n=e.transFormData(a.goods);a.goods=n;var i={code_name:a.title,issued:a.quantity,stock:a.stock,restrict:a.restrict,describe:a.describe,date_time:[a.begin_time,a.end_time],period_type:String(a.period_type)||"1",period_num:a.period_num||1,period_day:a.period_day||"",period_fixed_receive_time:a.period_fixed_receive_time||"",range:[],planSelect:{key:t.plan.id,text:t.plan.title},keyBatchSelect:{key:t.key_batch_id,text:t.key_batch.batch_name}},s=[];if(n.length>0){var c=[],o=[];i.range=n.map((function(e){null!==e&&void 0!==e&&e.id?(s.push({key:e.only,text:e.product_name,id:e.id}),e.checked=!0,o.push(e.id)):(e.checked=!1,c.push(e.only))})),e.setState({new_product:c,oldProduct:o})}1===e.state.isState&&(i.code_name="".concat(a.title,"_").concat(a.copy_count+1).substring(0,12)),e.getResellerFunction(a.plan.reseller_id);var r=[];Object(C.a)(a.goods,(function(e){var t={};return t.key=e.only,t.text=e.product_name,t.id=e.id,r.push(t),t})),e.setState({codeInfo:i,isload:!0,tempdata:a.goods||[],plan_time:[a.plan.begin_time,a.plan.end_time],rank:s,rankoptions:r,settlement_type:a.plan.settlement_type,isSettlement:a.plan.settlement_type>0?1:2,settlementData:a.plan.settlement_type>0?{key:a.plan.settlement_type}:null})}),(function(e){}))})).catch((function(e){}))}},{key:"getTableList",value:function(){if(sessionStorage.getItem("addMoneyData")){var e=JSON.parse(sessionStorage.getItem("addMoneyData")),t=Object(ye.a)(this.state.tempdata).map((function(t){return e.map((function(e){t.channel_activity_id===e.channel_activity_id&&(t.origin.recharge_amount=e.recharge_amount)})),t}));this.setState({tempdata:t})}}},{key:"transFormData",value:function(e){var t=this,a=[],n=[],i=[],s=[];return e.legal.map((function(e){var i;e.type=1,e.only=e.product_id,e.upstream="\u76f4\u8fde\u5929\u4e0b",[0,1].includes(t.state.isState)&&(e.stock=e.quantity,e.usage=0),2===t.state.isState&&(e.stock=e.stock||e.quantity,e.usage=e.usage||0),null!==(i=e)&&void 0!==i&&i.goods_id&&(e.id=e.goods_id),1===t.state.isState&&(e=Object(l.a)(e,["code_batch_id"])),a.push(e),n.push(e)})),e.reduce.map((function(e){2===t.state.isState&&(e.quantity=e.total_stock,e.usage=e.use_stock);var n=wa(e);if(1===t.state.isState){var s=parseInt(B(e.all_budget,P(e.reduce_amount,e.send_num)));n.quantity=s,n.stock=s,n.usage=0,n.origin=Object(l.a)(e,["id","total_stock","use_stock","stock","goods_id"]),n=Object(l.a)(n,["product_id"])}if(2===t.state.isState){n.stock=e.stock,n.quantity=e.total_stock;var c=["total_stock","use_stock"];n.origin=Object(l.a)(e,c),n=Object(l.a)(n,c)}a.push(n),i.push(n.origin)})),e.cash.map((function(e){2===t.state.isState&&(e.quantity=e.total_stock,e.usage=e.use_stock);var n=Sa(e);if(1===t.state.isState&&(n.stock=e.num,n.usage=0,n.origin.copy=!0,n.origin=Object(l.a)(e,["id","total_stock","use_stock","stock","goods_id","update_time","delete_time"]),n=Object(l.a)(n,["product_id"])),2===t.state.isState){n.stock=e.stock,n.quantity=e.total_stock;var i=["total_stock","use_stock"];n.origin=Object(l.a)(e,i),n=Object(l.a)(n,i)}a.push(n),s.push(n.origin)})),sessionStorage.setItem("productData",JSON.stringify(n)),sessionStorage.setItem("knockGoldData",JSON.stringify(i)),sessionStorage.setItem("redPacketsData",JSON.stringify(s)),a}},{key:"onRankChange",value:function(e){Object(ga.a)(this.state.tempdata,(function(t){t.checked=e.findIndex((function(e){return e.key==t.only}))>-1})),this.setState({tempdata:this.state.tempdata}),this.setState({rank:e})}},{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/exchangecode-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"buildData",value:function(){var e=this,t=[];Object(C.a)(this.state.rank,(function(e){t.push(e.text)}));var a=this.refs.tempdata.getSelectData(),i=a.filter((function(t){return e.state.oldProduct.indexOf(t.id)<0})),s=[],c=[];Object(C.a)(a,(function(t){if(e.state.oldProduct.indexOf(t.id)>-1){s.push(t.id);var a={};1===t.type?(a.contract_price=t.contract_price,a.cost_price=t.cost_price,a.describe_url=t.describe_url,a.official_price=t.official_price,a.product_id=t.product_id,a.account_type=t.account_type,a.product_name=t.product_name,a.product_type=t.product_type,a.weight=t.weight,a.quantity=t.quantity,a.show_url=t.show_url,a.end_time=t.end_time,a.detail_url=t.detail_url,a.map_product_name=t.map_product_name,a.goods_id=t.goods_id,a.type=t.type):a=Object(n.a)(Object(n.a)({},t.origin),{},{type:t.type}),c.push(a)}}));var o=Object(ya.a)(this.state.oldProduct,s,_a.a);o=o.filter((function(t){return e.state.new_product.indexOf(t)<0})),this.state.deleteProduct.length>0&&(o=o.concat(this.state.deleteProduct).map(Number)),s=Object(C.a)(c,(function(e){return e.only})),o=Object(N.a)(o,(function(e){return s.indexOf(e)<0}));var r={legal:[],reduce:[],cash:[]};i.map((function(e){2===e.type?e.origin&&r.reduce.push(e.origin):3===e.type?r.cash.push(e.origin):r.legal.push(e)}));var l={legal:[],reduce:[],cash:[]};return c.map((function(e){2===e.type?l.reduce.push(e):3===e.type?l.cash.push(e):l.legal.push(e)})),{data:{reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.reseller.receive_email,payment_direction:this.state.payment_direction[this.state.payType-1],title:this.state.codeInfo.code_name,period_type:String(this.state.codeInfo.period_type)||"1",period_num:this.state.codeInfo.period_num||1,period_day:this.state.codeInfo.period_day||"",period_fixed_receive_time:this.state.codeInfo.period_fixed_receive_time||"",recharge_type:1,range:t,describe:this.state.codeInfo.describe,begin_time:this.state.codeInfo.date_time[0],end_time:this.state.codeInfo.date_time[1],quantity:this.state.codeInfo.issued,new_product:r,update_product:l,delete_product:o},addProduct:i,updateProduct:c}}},{key:"copyOrAddBuildData",value:function(){var e=[];Object(C.a)(this.state.rank,(function(t){e.push(t.text)}));var t=this.refs.tempdata.getSelectData(),a={begin_time:this.state.codeInfo.date_time[0],end_time:this.state.codeInfo.date_time[1],describe:this.state.codeInfo.describe,quantity:this.state.codeInfo.issued,range:e.join(),period_type:String(this.state.codeInfo.period_type)||"1",period_num:this.state.codeInfo.period_num||1,period_day:this.state.codeInfo.period_day||"",period_fixed_receive_time:this.state.codeInfo.period_fixed_receive_time||"",recharge_type:1,title:this.state.codeInfo.code_name,restrict:this.state.codeInfo.restrict,product:{legal:t.filter((function(e){if(1==e.type)return Object(l.a)(e,["type","only","id","goods_id"])})),reduce:t.filter((function(e){return 2===e.type})).map((function(e){return Object(l.a)(e.origin,["goods_id"])})),cash:t.filter((function(e){return 3===e.type})).map((function(e){return e.origin}))}};return 1===this.state.isState&&(a.copy_code_batch_id=Na),{code_batch:[a],reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.reseller.receive_email,payment_direction:this.state.payment_direction[this.state.payType-1],addCode:!0}}},{key:"submitCodeData",value:function(){var e=this;if(this.state.reseller){var t=this.buildData().data;Object(s.Hc)(Na,t).then((function(t){Object(s.cc)(t,(function(t,a){var n=e.state.model;n.show_url=t.path,e.setState({model:n}),h.a.clear(),h.a.success(a),setTimeout((function(){window.location.replace("#/home/exchangecode-list")}),1e3)}),(function(e){h.a.error(e)}))}))}else h.a.error("\u8be5\u5151\u6362\u7801\u5bf9\u5e94\u5206\u9500\u5546\u4e0d\u5b58\u5728")}},{key:"submitCopyOrAddCodeData",value:function(){var e=this.copyOrAddBuildData(),t=sessionStorage.getItem("keyBatch_id");Object(s.ic)(t,e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u6210\u529f\u53d1\u8d77\u5ba1\u6279"),setTimeout((function(){window.history.back()}),1e3)}),(function(e){h.a.error(e)}))}))}},{key:"submit",value:function(){var e=this;if(this.refs.code_info.validator()&&this.refs.code_rule.validator())if("1"===this.state.codeInfo.period_type||this.state.codeInfo.period_day)if("2"!=this.state.codeInfo.period_type||this.state.codeInfo.period_fixed_receive_time)if(2===this.state.isState){if(this.state.uploading)return void h.a.error("\u8fd8\u6709\u56fe\u7247\u4e0a\u4f20\u4e2d\uff0c\u4e0d\u53ef\u63d0\u4ea4");var t=this.buildData(),a=t.data,n=t.addProduct,i=t.updateProduct;if([].concat(Object(ce.a)(i),Object(ce.a)(n)).length<1)return h.a.error("\u8bf7\u7ed1\u5b9a\u5bf9\u8c61");if(this.state.settlement_type>0)if([].concat(Object(ce.a)(i),Object(ce.a)(n)).length>1)return void h.a.error("\u5305\u7801\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5546\u54c1");var c=sessionStorage.getItem("approval_id");Number(c)<=0?Object(s.kb)(Na,a).then((function(t){Object(s.cc)(t,(function(t,a){t.is_require_approval?e.setState({audit_visible:!0}):e.submitCodeData()}),(function(e){h.a.error(e)}))})):Object(s.U)(c).then((function(t){Object(s.cc)(t,(function(t,n){0==t.status&&(e.setState({approvalsStatus:!0}),e.setState({recall_visible:!0})),1!=t.status&&2!=t.status&&3!=t.status||Object(s.kb)(Na,a).then((function(t){Object(s.cc)(t,(function(t,a){t.is_require_approval?e.setState({audit_visible:!0}):e.submitCodeData()}),(function(e){h.a.error(e)}))}))}),(function(e){h.a.error(e)}))}))}else{var o=this.refs.tempdata.getSelectData();if("1"!=String(this.state.codeInfo.period_type)&&this.state.codeInfo.period_num!=Number(this.state.codeInfo.restrict))return h.a.error("\u5151\u6362\u7801\u7ed1\u5b9a\u6570\u5fc5\u987b\u7b49\u4e8e\u5468\u671f\u6b21\u6570");if(this.state.uploading)return h.a.error("\u8fd8\u6709\u56fe\u7247\u4e0a\u4f20\u4e2d\uff0c\u4e0d\u53ef\u63d0\u4ea4");if(o.length<1)return h.a.error("\u8bf7\u7ed1\u5b9a\u5bf9\u8c61");if(!this.state.reseller)return h.a.error("\u8be5\u5151\u6362\u7801\u5bf9\u5e94\u5206\u9500\u5546\u4e0d\u5b58\u5728");this.setState({audit_visible:!0})}else h.a.error("\u8bf7\u586b\u5199\u5468\u671f\u89c4\u5219\u65f6\u95f4");else h.a.error("\u8bf7\u586b\u5199\u5468\u671f\u95f4\u9694\u5929\u6570")}},{key:"onConfirm",value:function(){this.setState({audit_visible:!1}),2!==this.state.isState?this.submitCopyOrAddCodeData():this.submitCodeData()}},{key:"addProduct",value:function(e){var t=this.state.direct_reseller_id;if(!this.state.isState&&!this.state.codeInfo.planSelect.key)return h.a.error("\u8bf7\u9009\u62e9\u5f52\u5c5e\u8ba1\u5212");if(!t)return h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546");var a="";switch(e){case 1:a="\u65b0\u5efa\u5546\u54c1";break;case 2:a="\u65b0\u589e\u7acb\u51cf\u91d1";break;case 3:a="\u65b0\u589e\u7ea2\u5305"}this.setState({productData:null,drawerVisible:!0,addIsType:e,product_title:a})}},{key:"productEditShow",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.state.direct_reseller_id){e.next=3;break}return e.abrupt("return",h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546"));case 3:1===t.type?this.setState({product_title:"\u7f16\u8f91\u5546\u54c1",productData:t,addIsType:1}):2===t.type?this.setState({product_title:"\u7f16\u8f91\u7acb\u51cf\u91d1",productData:t.origin,addIsType:2}):this.setState({product_title:"\u7f16\u8f91\u7ea2\u5305",productData:t.origin,addIsType:3}),this.setState({drawerVisible:!0});case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"switchProductType",value:function(){switch(this.state.addIsType){case 1:var e=this.state,t=e.tempdata,a=e.productData,n=e.direct_reseller_id,i=t.map((function(e){return 1===e.type&&e.product_id})),s=a?a.product_type:1;return Object(b.jsx)(_t,{ref:"product",checkedProduct:i,productData:a,directResellerId:n,productType:s,isSettlement:this.state.isSettlement,settlementData:this.state.settlementData});case 2:return Object(b.jsx)(Je,{ref:"knockGold",data:this.state.productData});case 3:return Object(b.jsx)(ut,{ref:"redPackets",data:this.state.productData})}}},{key:"onChangeCombinedDate",value:function(e){var t=this.state.codeInfo;t.date_time=e,this.setState({codeInfo:t})}},{key:"productSubmit",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a,n,i,s,c,o,r,l,d=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="",1!==this.state.addIsType){e.next=7;break}return e.next=4,this.refs.product.submit();case 4:t=e.sent,e.next=16;break;case 7:if(2!==this.state.addIsType){e.next=13;break}return e.next=10,this.refs.knockGold.submit();case 10:t=e.sent,e.next=16;break;case 13:return e.next=15,this.refs.redPackets.submit();case 15:t=e.sent;case 16:if(!t){e.next=38;break}if(this.setState({drawerVisible:!1}),a=[],n=[],i=[],1!==this.state.addIsType){e.next=30;break}return e.next=24,this.refs.product.getFormModel();case 24:s=e.sent,i=this.state.tempdata,(c=this.state.tempdata.findIndex((function(e){return e.product_id==s.product_id})))>-1?(s.stock=s.quantity-i[c].usage,i[c]=Object.assign(i[c],s)):(s.type=1,s.upstream="\u76f4\u8fde\u5929\u4e0b",s.only=s.product_id,s.stock=s.quantity,s.usage=0,n.push(s)),e.next=31;break;case 30:2===this.state.addIsType?(a=JSON.parse(sessionStorage.getItem("knockGoldData")),i=this.state.tempdata.filter((function(e){return 2!==e.type})),n=Object(C.a)(a,(function(e){var t=d.state.tempdata.findIndex((function(t){return t.channel_activity_id===e.channel_activity_id}));return t>-1&&(e.checked=d.state.tempdata[t].checked),wa(e)}))):(a=JSON.parse(sessionStorage.getItem("redPacketsData")),i=this.state.tempdata.filter((function(e){return 3!==e.type})),n=Object(C.a)(a,(function(e,t){var a=d.state.tempdata.findIndex((function(t){return t.cash_activity_id===e.cash_activity_id}));return a>-1&&(e.checked=d.state.tempdata[a].checked),e.copy=!1,Sa(e)})));case 31:o=re(n.concat(i),"only"),r=[],l=[],Object(C.a)(o,(function(e){r.push({key:e.only,text:e.product_name}),e.checked&&l.push({key:e.only,text:e.product_name})})),r=re(r,"key"),this.setState({tempdata:o,rankoptions:r,rank:l}),this.getTableList();case 38:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onReCall",value:function(){var e=this,t=sessionStorage.getItem("approval_id");this.setState({recall_visible:!1}),Object(s.pd)(t).then((function(t){Object(s.cc)(t,(function(t,a){e.setState({approvalLoading:!0});var n=setInterval((function(){e.state.timer<=0&&(clearInterval(n),e.setState({approvalLoading:!1}),h.a.success("\u64a4\u9500\u6210\u529f,\u8bf7\u91cd\u65b0\u63d0\u4ea4\u5ba1\u6838"));var t=e.state.timer-1;e.setState({timer:t})}),1e3)}),(function(e){h.a.error(e)}))}))}},{key:"handleChange",value:function(e,t){var a=this.state.codeInfo;a[t]=e,this.setState({codeInfo:a})}},{key:"vestingPlanFunction",value:function(e){if(null!==e&&void 0!==e&&e.key){this.getKeyBatchSelect(e.key),this.getResellerFunction(e.reseller_id),this.handleChange("","keyBatchSelect"),this.setState({plan_time:[e.begin_time,e.end_time]});var t={begin_time:e.begin_time,end_time:e.end_time};sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(t))}}},{key:"voucherBatchForEl",value:function(e){return e.map((function(e){return e.channel_activity_id})).join(" , ")}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"editcode",children:[Object(b.jsx)("div",{children:Object(b.jsx)(p.a,{style:{width:"90%",margin:"10px auto"},title:"\u57fa\u672c\u4fe1\u606f",children:Object(b.jsx)("div",{className:"addcode",children:Object(b.jsxs)(o.a,{model:this.state.codeInfo,rules:xa,ref:"code_info",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5f52\u5c5e\u8ba1\u5212",prop:"planSelect",id:"planSelect",children:Object(b.jsx)(ne.a,{onChange:function(t){e.handleChange(t,"planSelect"),e.vestingPlanFunction(t)},clearable:!0,value:this.state.codeInfo.planSelect,options:this.state.planSelectData,placeholder:"\u8bf7\u9009\u62e9",labelWidth:"0px",height:"36px",width:"520px",disabled:this.state.isState,alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5f52\u5c5ekey",prop:"keyBatchSelect",id:"keyBatchSelect",children:Object(b.jsx)(ne.a,{onChange:function(t){e.handleChange(t,"keyBatchSelect"),sessionStorage.setItem("keyBatch_id",null===t||void 0===t?void 0:t.id)},clearable:!0,value:this.state.codeInfo.keyBatchSelect,options:this.state.keyBatchSelectData,placeholder:"\u8bf7\u9009\u62e9",labelWidth:"0px",height:"36px",width:"520px",disabled:this.state.isState,alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5151\u6362\u7801\u540d\u79f0",prop:"code_name",id:"code_name",children:Object(b.jsx)(r.a,{onChange:function(t){return e.handleChange(t,"code_name")},onClearItem:function(){return e.handleChange("","code_name")},value:this.state.codeInfo.code_name,placeholder:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u540d\u79f0",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),2!==this.state.isState?Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u6570",prop:"restrict",id:"restrict",children:Object(b.jsx)(r.a,{onChange:function(t){return e.handleChange(t,"restrict")},onClearItem:function(){return e.handleChange("","restrict")},value:this.state.codeInfo.restrict,placeholder:"\u8bf7\u8f93\u5165\u7ed1\u5b9a\u6570\u91cf",labelWidth:"0px",maxLength:6,countShow:!1,unit:"\u6761",height:"36px",width:"520px",alignment:"left"})}):null,2===this.state.isState?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u603b\u91cf",prop:"issued",id:"issued",children:Object(b.jsx)("div",{className:"line",children:this.state.codeInfo.issued})}),Object(b.jsx)(c.a,{labelname:"\u5269\u4f59\u5e93\u5b58\u91cf",prop:"stock",id:"stock",children:Object(b.jsx)("div",{className:"line",children:this.state.codeInfo.stock})})]}):Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u603b\u91cf",prop:"issued",id:"issued",children:Object(b.jsx)(r.a,{onChange:function(t){return e.handleChange(t,"issued")},onClearItem:function(){return e.handleChange("","issued")},value:this.state.codeInfo.issued,placeholder:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf",labelWidth:"0px",maxLength:6,countShow:!1,unit:"\u6761",height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u4f7f\u7528\u8bf4\u660e",prop:"describe",id:"describe",required:!1,children:Object(b.jsx)(Le.a,{type:"textarea",autoSize:!0,width:"520px",maxLength:100,value:this.state.codeInfo.describe,onChange:function(t){return e.handleChange(t.target.value,"describe")},maxCharacterCount:100,showCount:!0})})]})})})}),Object(b.jsx)("div",{children:Object(b.jsx)(p.a,{style:{width:"90%",margin:"10px auto"},title:"\u57fa\u672c\u89c4\u5219",children:Object(b.jsx)("div",{children:Object(b.jsxs)(o.a,{model:this.state.codeInfo,rules:Oa,ref:"code_rule",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u5230\u8d26",prop:"period_type",id:"period_type",children:Object(b.jsxs)(ae.a.Group,{disabled:2==this.state.isState,value:this.state.codeInfo.period_type,onChange:function(t){e.handleChange(t.target.value,"period_type"),e.handleChange(1,"period_num"),e.handleChange("","period_day"),e.handleChange("","period_fixed_receive_time")},children:[Object(b.jsx)(ae.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(ae.a,{value:"2",children:"\u81ea\u52a8\u53d1\u653e"}),Object(b.jsx)(ae.a,{value:"3",children:"\u624b\u52a8\u9886\u53d6"})]})}),"1"!==this.state.codeInfo.period_type?Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u89c4\u5219",prop:"period_num",id:"period_num",children:Object(b.jsxs)("div",{className:"warningValue",children:[Object(b.jsx)(r.a,{onChange:function(t){if(!t||!(isNaN(Number(t))||Number(t)<0)&&/^[1-9]\d*$/.test(t))return Number(t)>24?(h.a.clear(),h.a.error("\u5206\u671f\u6b21\u6570\u4e0d\u5141\u8bb8\u8d85\u8fc724\uff01")):void e.handleChange(t,"period_num")},onClearItem:function(t){e.handleChange("","period_num")},disabled:2==this.state.isState,value:this.state.codeInfo.period_num,countShow:!1,placeholder:"\u8bf7\u8f93\u5165\u5206\u671f\u6b21\u6570",labelWidth:"0px",height:"36px",unit:"\u6b21",width:"240px",alignment:"left"}),"-",Object(b.jsx)("div",{className:"icon-box",children:Object(b.jsx)(r.a,{onChange:function(t){t&&(isNaN(Number(t))||Number(t)<0||!/^[1-9]\d*$/.test(t))||e.handleChange(t,"period_day")},onClearItem:function(t){e.handleChange("","period_day")},disabled:2==this.state.isState,countShow:!1,value:this.state.codeInfo.period_day,placeholder:"\u8bf7\u8f93\u5165\u95f4\u9694\u5929\u6570",unit:"\u5929",labelWidth:"0px",height:"36px",width:"240px",alignment:"left"})}),"2"==this.state.codeInfo.period_type?Object(b.jsx)(va.a,{showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},disabled:2==this.state.isState,value:this.state.codeInfo.period_fixed_receive_time,onChange:function(t){e.handleChange(t,"period_fixed_receive_time")},width:"240px"}):null]})}):null,Object(b.jsx)(c.a,{labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"date_time",id:"date_time",children:Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},disabled:[2===this.state.isState&&[1,2,3,7].includes(this.codeStatus),!1],format:"YYYY-MM-DD HH:mm:ss",value:this.state.codeInfo.date_time,onChange:function(t){Rt.a.emit("change","date_time",t),e.onChangeCombinedDate(t)},width:245,disabledTime:this.onDisabledTime,disabledDate:this.onDisabledRange})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u8303\u56f4",prop:"rank",id:"rank",children:Object(b.jsxs)("div",{className:"goods-boxs",children:[Object(b.jsx)(ne.a,{options:this.state.rankoptions,multiple:!0,value:this.state.rank,placeholder:"\u9009\u62e9\u4e00\u9879",width:410,onChange:function(t){e.onRankChange(t)}}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){e.addProduct(1)},disabled:1===this.state.isSettlement&&this.state.settlementData&&(8===this.state.settlementData.key||9===this.state.settlementData.key),children:"\u65b0\u5efa\u5546\u54c1"}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){e.addProduct(2)},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan"))||1===this.state.isSettlement&&this.state.settlementData&&7===this.state.settlementData.key,children:"\u65b0\u5efa\u7acb\u51cf\u91d1"}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){e.addProduct(3)},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan"))||1===this.state.isSettlement&&this.state.settlementData&&(7===this.state.settlementData.key||8===this.state.settlementData.key),children:"\u65b0\u5efa\u7ea2\u5305"})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"range",id:"range",children:Object(b.jsx)(q,{ref:"tempdata",headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:this.state.tempdata,value:this.state.tempdata,Column:ka,maxheight:200,countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(t){e.pageChange(t)},checkChange:function(t){var a=[];Object(C.a)(t,(function(e){var t={};return t.key=e.only,t.text=e.product_name,a.push(t),t})),e.setState({rank:a})},ComponentHandler:function(t,a){return"type"==t?Object(b.jsx)(b.Fragment,{children:2===a.type?"\u7acb\u51cf\u91d1":3===a.type?"2"===a.origin.cash_amount_type?"\u968f\u673a\u7ea2\u5305":"\u56fa\u989d\u7ea2\u5305":"\u5546\u54c1"}):"cost_price"==t?Object(b.jsx)(b.Fragment,{children:2===a.type?a.official_price:a.cost_price}):"voucher_batch"==t?2===a.type?Object(b.jsx)(b.Fragment,{children:e.voucherBatchForEl(a.origin.voucher_batch)}):Object(b.jsx)(b.Fragment,{children:a.channel_activity_id}):"edit"==t?Object(b.jsx)("a",{className:"grid-link",onClick:function(t){e.productEditShow(a)},children:"\u7f16\u8f91"}):void 0}})})]})})})}),Object(b.jsx)(ht.a,{className:"draw",width:"86%",title:this.state.product_title,footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.productSubmit()},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(t){e.setState({drawerVisible:!1}),e.getTableList()},children:"\u53d6\u6d88"})]}),visible:this.state.drawerVisible,onClose:function(t){e.setState({drawerVisible:!1})},maskClosable:!1,children:Object(b.jsx)("div",{className:"draw2",children:Object(b.jsx)(p.a,{style:{width:"95%",margin:"10px auto",border:0},children:this.switchProductType()})})}),this.state.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(t){return e.setState({payType:t.target.value})},value:this.state.payType,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onConfirm(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.recall_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({recall_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u5f53\u524d\u6b63\u5728\u5ba1\u6838\u4e2d"}),Object(b.jsx)("div",{className:"audit-box-txt",children:"\u63d0\u4ea4\u5ba1\u6838\u4f1a\u5c06\u539f\u6765\u5ba1\u6279\u64a4\u56de\u624d\u53ef\u8fdb\u884c\u63d0\u4ea4,\u662f\u5426\u64a4\u56de?"}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({recall_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onReCall(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.approvalLoading?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)("div",{className:"audit-box-title",children:"\u64a4\u9500\u5ba1\u6279\u4e2d"}),Object(b.jsxs)("div",{className:"audit-box-txt",children:["\u6b63\u5728\u53d1\u8d77\u64a4\u9500...,\u8bf7\u7b49\u5f85 ",Object(b.jsxs)("span",{style:{color:"red"},children:[" ",this.state.timer]})," \u79d2"]})]})]}):null,Object(b.jsxs)("div",{className:"edit-btnList",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.submit()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.cancel()},children:"\u53d6\u6d88"})]})]})}}]),a}(u.a.Component),Ia=(a(187),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={editorHtml:"",count:0},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(){var e=this,t=this,a=new Ce.a("#wangeditorCombining");a.destroy(),this.setState({editor:a}),a.config.colors=["#696969","#9093a2","#fgddbb","#e3e7eb"],a.config.pasteText=!0,a.config.height=200,a.config.showFullScreen=!1,a.config.menus=["bold","foreColor","italic","indent","link","justify"],a.config.onchange=function(e){var n=a.txt.text();if(0==n.length&&t.props.setEdittext(""),n.length>t.props.limitLength){var i=n.slice(0,t.props.limitLength);return t.setState({editorHtml:i}),a.txt.html(i),void t.props.setEdittext(i)}t.setState({count:n.length}),t.setState({editorHtml:e}),t.props.setEdittext(e)},a.create();var n=setTimeout((function(){a.txt.html(e.props.text),clearTimeout(n)}),500)}},{key:"render",value:function(){return Object(b.jsxs)("div",{className:"countBox_par",children:[Object(b.jsx)("div",{id:"wangeditorCombining",style:{width:this.props.width}}),Object(b.jsx)("p",{className:"countBox",children:this.state.count+"/"+this.props.limitLength})]})}}]),a}(u.a.Component)),Ta=(a(296),[80,100,100,100,80,24,100,100,100]),Fa=function(e){var t=e.data,a=e.products;function n(){switch(Number(t.channel)){case 1:return{bg:"#4989f5",title_color:"#fff",banner:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_banner.png",goods_bg:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_img.png",footer_top:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_top.png",footer_middle:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_middle.png",footer_bottom:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_d.png",footer_color:"#4989F5",notis_color:"#FF486D",goods_a:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_tobeused.png",goods_b:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_overdue.png"};case 2:return{bg:"#cee5be",title_color:"#239700",banner:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_banner.png",goods_bg:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_redenvelope_img.png",footer_top:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_top.png",footer_middle:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_middle.png",footer_bottom:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_d.png",footer_color:"#5eb145",time_color:"#5eb145",notis_color:"#239700",goods_a:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_tobeused.png",goods_b:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_overdue.png"};case 3:return{bg:"#ff4830",title_color:"#FF3024",banner:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_banner.png",goods_bg:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_redenvelope_img.png",footer_top:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_top.png",footer_middle:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_middle.png",footer_bottom:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_d.png",footer_color:"#FF4901",notis_color:"#FFD3D8",goods_a:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_redenvelope_tobeused.png",goods_b:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_redenvelope_overdue.png"};default:return{}}}return Object(b.jsx)("div",{id:"combiningMobile",children:Object(b.jsxs)("div",{className:"content",style:{background:n().bg},children:[Object(b.jsx)("img",{className:"banner",src:n().banner,alt:""}),Object(b.jsxs)("div",{className:"box",children:[Object(b.jsxs)("div",{className:"box-cotent",children:[Object(b.jsxs)("div",{className:"goods-box",style:{backgroundImage:"url(".concat(n().goods_bg,")"),paddingTop:1==t.channel?"28px":2==t.channel?"16px":"20px"},children:[Object(b.jsx)("p",{className:"title",style:{color:n().title_color},children:t.code_name||"\u7acb\u51cf\u91d1\u7ec4\u5408\u5546\u54c1"}),Object(b.jsx)("ul",{className:"g-b-u",style:{marginLeft:1==t.channel?"12px":"14px",marginTop:2==t.channel?"12px":"28px"},children:a.map((function(e){return Object(b.jsxs)("li",{style:{backgroundImage:"url(".concat(n().goods_b,")")},"v-for":"item in goods.product",children:[Object(b.jsx)("p",{className:"g-b-u-t",children:"\u7acb\u51cf\u91d1"}),Object(b.jsxs)("p",{className:"money",children:[Object(b.jsx)("span",{children:"\uffe5"}),e.origin.reduce_amount]}),Object(b.jsxs)("p",{className:"reduce",children:["\u6ee1",e.origin.denomination,"\u53ef\u7528"]}),Object(b.jsxs)("p",{className:"g-b-but","v-if":"goods.receive_status==1",children:["\u5f85\u9886\u53d6(0/",e.send_num,")"]})]},e.channel_activity_id)}))}),Object(b.jsx)("p",{className:"notis",style:{color:n().notis_color,marginBottom:1!=t.channel&&"18px"},children:"\u6ed1\u52a8\u67e5\u770b\u66f4\u591a"})]}),3==t.channel||1==t.channel&&2==t.receive_mode?Object(b.jsxs)("p",{className:"g_b_title",children:[Object(b.jsx)("img",{src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_title_icon.png",alt:""}),1==t.channel?"\u652f\u4ed8\u5b9d\u8d26\u53f7":"\u4e91\u95ea\u4ed8\u8d26\u53f7",Object(b.jsx)("img",{src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_title_icon.png",alt:""})]}):null,3==t.channel||1==t.channel&&2==t.receive_mode?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("input",{type:"text",readOnly:!0,placeholder:3==t.channel?"\u8bf7\u8f93\u5165\u624b\u673a\u53f7":"\u8bf7\u8f93\u5165\u8d26\u53f7","v-model":"form.confirm"}),Object(b.jsx)("input",{type:"text",readOnly:!0,placeholder:3==t.channel?"\u8bf7\u518d\u6b21\u8f93\u5165\u624b\u673a\u53f7":"\u8bf7\u518d\u6b21\u8f93\u5165\u8d26\u53f7","v-model":"form.receive_account"})]}):null,Object(b.jsx)("img",{className:"but",style:{marginTop:2==t.channel||1==t.channel&&1==t.receive_mode&&"12px"},src:"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_but.png",alt:""}),1==t.timer_show?Object(b.jsxs)("p",{className:"time",style:{marginTop:0},children:["\u751f\u6548\u65f6\u95f4\uff1a",t.date_time.length>1?"".concat(t.date_time[0]," ~ ").concat(t.date_time[1]):"2024-01-01 00:00:00 ~ 2029-01-01 00:00:00"]}):null,t.timer[0]?Object(b.jsxs)("p",{className:"time",style:{marginTop:"10px",color:n().time_color},children:["\u9886\u53d6\u65f6\u95f4\uff1a","".concat(t.timer[0]," ~ ").concat(t.timer[1])]}):null]}),Object(b.jsxs)("div",{className:"box-footer",children:[Object(b.jsx)("img",{className:"b-f-img",src:n().footer_top,alt:""}),Object(b.jsx)("div",{className:"b-f-b",style:{backgroundImage:"url(".concat(n().footer_middle,")")},children:function(){var e;return 2==t.instructionType&&t.group_image[0]?Object(b.jsx)("img",{className:"group_image",src:null===(e=t.group_image[0])||void 0===e?void 0:e.src}):1==t.instructionType&&t.instruction?Object(b.jsx)("div",{className:"b-f-i",dangerouslySetInnerHTML:{__html:t.instruction},style:{color:n().footer_color},"v-if":"data.instructionType==1"}):Object(b.jsx)(xe.a.TextBlock,{className:"TextBlock",animate:!0,widths:Ta,rows:8,dashed:!1})}()}),Object(b.jsx)("img",{className:"b-f-img",src:n().footer_bottom,alt:""})]})]})]})})},La=(a(297),{code_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u540d\u79f0"}],planSelect:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5e\u8ba1\u5212"}],keyBatchSelect:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5eKey"}],issued:[{type:"required",message:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^([1-9][0-9]*){1,3}$"}]}),Ma={date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5"}],timer:[{type:"required",message:"\u8bf7\u9009\u62e9\u9886\u53d6\u65f6\u95f4\u6bb5"}]},Ha=[{title:"\u5546\u54c1ID",name:"product_id",prop:"product_id",width:"auto",type:"normal"},{title:"\u5546\u54c1\u540d\u79f0",width:"auto",prop:"product_name",name:"product_name",type:"normal"},{title:"\u603b\u9884\u7b97",name:"all_budget",prop:"all_budget",type:"normal",width:"auto"},{title:"\u5408\u540c\u5355\u4ef7",name:"contract_price",prop:"contract_price",type:"normal",width:"auto"},{title:"\u5546\u54c1\u5b98\u65b9\u4ef7",type:"normal",prop:"official_price",width:"auto"},{title:"\u7c7b\u578b",width:"auto",prop:"type",name:"type",type:"slot"},{title:"\u4e0a\u6e38\u5e73\u53f0",width:"auto",prop:"upstream",name:"upstream",type:"normal"},{title:"\u6279\u6b21\u53f7",width:"auto",prop:"voucher_batch",name:"voucher_batch",type:"slot"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"300px",prop:"effectDate",name:"effectDate",type:"slot"},{title:"\u5f53\u524d\u6210\u672c\u4ef7\u683c",prop:"cost_price",name:"cost_price",width:"auto",type:"slot"},{title:"\u5e93\u5b58\u603b\u6570\u91cf",prop:"quantity",name:"quantity",type:"normal",width:"auto"},{title:"\u5269\u4f59\u6570\u91cf",prop:"stock",name:"stock",type:"normal",width:"auto"},{title:"\u5355\u6b21\u5230\u8d26",prop:"send_num",name:"send_num",type:"normal",width:"auto"},{title:"\u5df2\u4f7f\u7528\u6570\u91cf",prop:"usage",name:"usage",type:"normal",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}];function qa(e){var t=parseInt(B(e.all_budget,P(e.reduce_amount,e.send_num))),a={};return a.product_name=e.batch_goods_name||e.product_name,a.channel_activity_id=e.channel_activity_id,a.only=e.channel_activity_id,a.type=2,a.checked=e.checked||!1,a.disabled=e.disabled||!1,a.upstream=J(e.channel),a.edit="edit",a.all_budget=e.all_budget,a.send_num=e.send_num||1,a.contract_price=e.contract_price||e.price,a.official_price=e.official_price||e.reduce_amount,a.quantity=e.quantity||t,a.stock=e.stock||t,a.usage=e.usage||0,a.origin=e,a.id=e.goods_id||e.id,a.product_id=e.goods_id||"-",a.index=e.index,a}var Pa,Ba=function(e){return Array.from({length:e},(function(e,t){return t}))},Ea="",Aa=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var i;return Object(g.a)(this,a),(i=t.call(this,e)).onDisabledTime=function(e){var t=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),a=new Date(t.begin_time),n=a.getHours(),i=a.getMinutes(),s=a.getSeconds();return Object(Q.a)(e,a)?{disabledHours:function(){return Ba(n)},disabledMinutes:function(e){return e===n?Ba(i):[]},disabledSeconds:function(e,t){return e===n&&t===i?Ba(s):[]}}:{}},i.onDisabledRange=function(e,t){var a=!1,n=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(i.state.plan_time[1]).format("HH:mm:ss");return"start"===t&&(a=s<"23:59:59"?Z()(n).isBefore(i.state.plan_time[0])||Z()(n).subtract(1,"days").isAfter(i.state.plan_time[1]):Z()(n).isBefore(i.state.plan_time[0])||Z()(n).isAfter(i.state.plan_time[1])),"end"===t&&(a=Z()(n).add(1,"days").isBefore(i.state.plan_time[0])||Z()(n).isAfter(i.state.plan_time[1])),a},i.state=Object(n.a)({},{uploading:!1,loading:!1,model:{product_id:"",product_type:"1",contract_price:"",official_price:"",cost_price:"",quantity:"",product_name:"",show_url:"",describe_url:"",detail_url:"",weight:"0"},codeInfo:{code_name:"",issued:"",describe:"",date_time:[],range:"",stock:"",instruction:"",planSelect:"",keyBatchSelect:"",restrict:1,group_cover:"",group_image:[],timer:[],timer_type:1,channel:"1",receive_mode:1,instructionType:1,is_webview:0,period_type:"1",period_day:"",timer_show:1,period_fixed_receive_time:""},tempdata:[],oldProduct:[],deleteProduct:[],new_product:[],cur_product:null,productOption:[],rankoptions:[],rank:[],recall_visible:!1,approvalLoading:!1,timer:3,payType:3,reseller:null,payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],isAudit:!1,approvalsStatus:!1,oldTable:[],product_title:"\u65b0\u5efa\u5546\u54c1",plan_time:"",direct_reseller_id:0,newGoodsBtnLoading:!1,tableLoading:!1,addIsType:1,isState:0,planSelectData:[],keyBatchSelectData:[],codeStatus:"",productData:null}),i}return Object(y.a)(a,[{key:"componentDidMount",value:function(){var e=~~sessionStorage.getItem("isState");Ea=~~sessionStorage.getItem("code_id"),this.setState({isState:e}),e&&this.getDetailFunction(e),2!==e&&(this.setState({loading:!0}),sessionStorage.setItem("knockGoldData",[]),this.handleChange(R,"instruction"),this.getPlanSelect())}},{key:"getPlanSelect",value:function(){var e=this;Object(s.Zc)({bind_object:"1"}).then((function(t){Object(s.cc)(t,(function(t,a){var i=t.map((function(e){return Object(n.a)({key:e.id,text:e.title},e)}));e.setState({planSelectData:i})}),(function(e){h.a.error(e)}))}))}},{key:"getKeyBatchSelect",value:function(e){var t=this;Object(s.Yc)({status:"4,5",plan_id:e,bind_object:1}).then((function(e){Object(s.cc)(e,(function(e,a){var i=e.map((function(e){return Object(n.a)({key:e.id,text:e.batch_name},e)}));t.setState({keyBatchSelectData:i})}),(function(e){h.a.error(e)}))}))}},{key:"getResellerFunction",value:function(e){var t=this;Object(s.Cb)(e).then((function(e){Object(s.cc)(e,(function(e,a){var n={id:e.id,name:e.name,company_name:e.company_name,receive_email:e.contact_email[0]};t.setState({direct_reseller_id:e.direct_reseller_id,reseller:n})}))}))}},{key:"getDetailFunction",value:function(){var e=this;Object(s.Y)(Ea).then((function(t){Object(s.cc)(t,(function(t){var a=Object(ye.a)(t);e.codeStatus=t.status;var n=e.transFormData(a.goods),i=a.group_info,s=i.channel,c=i.receive_mode,o=i.instruction,r=i.group_image,l=i.time_limit,d=i.is_webview;e.handleChange(o,"instruction"),a.goods=n;var u={code_name:a.title,is_webview:Number(d)||0,timer_show:Number(l.timer_show)||1,issued:a.quantity,period_type:String(a.period_type)||"1",period_day:a.period_day||"",period_fixed_receive_time:a.period_fixed_receive_time||"",instructionType:Number(a.group_info.instructionType)||1,stock:a.stock,restrict:a.restrict,instruction:o,date_time:[a.begin_time,a.end_time],group_image:r?[{id:(new Date).getTime(),src:r,name:"\u5546\u54c1\u63cf\u8ff0"}]:[],timer:l.receive_time.start_time?[l.receive_time.start_time,l.receive_time.end_time]:[],timer_type:l.receive_time.end_time?2:1,channel:s,receive_mode:Number(c),range:[],planSelect:{key:t.plan.id,text:t.plan.title},keyBatchSelect:{key:t.key_batch_id,text:t.key_batch.batch_name}},h=[];if(n.length>0){var p=[],m=[];u.range=n.map((function(e){null!==e&&void 0!==e&&e.id?(h.push({key:e.only,text:e.product_name,id:e.id}),e.checked=!0,m.push(e.id)):(e.checked=!1,p.push(e.only))})),e.setState({new_product:p,oldProduct:m})}1===e.state.isState&&(u.code_name="".concat(a.title,"_").concat(a.copy_count+1).substring(0,12)),e.getResellerFunction(a.plan.reseller_id);var b=[];Object(C.a)(a.goods,(function(e){var t={};return t.key=e.only,t.text=e.product_name,t.id=e.id,b.push(t),t})),e.setState({codeInfo:u,loading:!0,tempdata:a.goods||[],plan_time:[a.plan.begin_time,a.plan.end_time],rank:h,rankoptions:b})}),(function(e){}))})).catch((function(e){}))}},{key:"getTableList",value:function(){if(sessionStorage.getItem("addMoneyData")){var e=JSON.parse(sessionStorage.getItem("addMoneyData")),t=Object(ye.a)(this.state.tempdata).map((function(t){return e.map((function(e){t.channel_activity_id===e.channel_activity_id&&(t.origin.recharge_amount=e.recharge_amount)})),t}));this.setState({tempdata:t})}}},{key:"transFormData",value:function(e){var t=this,a=[],n=[];return e.reduce.map((function(e){2===t.state.isState&&(e.quantity=e.total_stock,e.usage=e.use_stock);var i=qa(e);if(1===t.state.isState){var s=parseInt(B(e.all_budget,P(e.reduce_amount,e.send_num)));i.quantity=s,i.stock=s,i.usage=0,i.origin=Object(l.a)(e,["id","total_stock","use_stock","stock","goods_id"]),i=Object(l.a)(i,["product_id"])}if(2===t.state.isState){i.disabled=-1!==t.codeStatus,i.stock=e.stock,i.quantity=e.total_stock;var c=["total_stock","use_stock"];i.origin=Object(l.a)(e,c),i=Object(l.a)(i,c)}i.send_num=e.send_num,i.index=e.index,a.push(i),n.push(i.origin)})),sessionStorage.setItem("knockGoldData",JSON.stringify(n)),a}},{key:"onRankChange",value:function(e){Object(ga.a)(this.state.tempdata,(function(t){t.checked=e.findIndex((function(e){return e.key==t.only}))>-1})),this.setState({tempdata:this.state.tempdata}),this.setState({rank:e})}},{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/exchangecode-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"buildData",value:function(){var e=this,t=[];Object(C.a)(this.state.rank,(function(e){t.push(e.text)}));var a=this.refs.tempdata.getSelectData(),i=a.filter((function(t){return e.state.oldProduct.indexOf(t.id)<0})),s=[],c=[];Object(C.a)(a,(function(t){if(e.state.oldProduct.indexOf(t.id)>-1){s.push(t.id);var a={};1===t.type?(a.contract_price=t.contract_price,a.cost_price=t.cost_price,a.describe_url=t.describe_url,a.official_price=t.official_price,a.product_id=t.product_id,a.account_type=t.account_type,a.product_name=t.product_name,a.product_type=t.product_type,a.weight=t.weight,a.quantity=t.quantity,a.show_url=t.show_url,a.end_time=t.end_time,a.detail_url=t.detail_url,a.map_product_name=t.map_product_name,a.goods_id=t.goods_id,a.type=t.type):a=Object(n.a)(Object(n.a)({},t.origin),{},{type:t.type}),c.push(a)}}));var o=Object(ya.a)(this.state.oldProduct,s,_a.a);o=o.filter((function(t){return e.state.new_product.indexOf(t)<0})),this.state.deleteProduct.length>0&&(o=o.concat(this.state.deleteProduct).map(Number)),s=Object(C.a)(c,(function(e){return e.only})),o=Object(N.a)(o,(function(e){return s.indexOf(e)<0}));var r={legal:[],reduce:[],cash:[]};i.map((function(e){2===e.type?e.origin&&r.reduce.push(e.origin):3===e.type?r.cash.push(e.origin):r.legal.push(e)}));var l={legal:[],reduce:[],cash:[]};c.map((function(e){2===e.type?l.reduce.push(e):3===e.type?l.cash.push(e):l.legal.push(e)}));var d=this.state.codeInfo;return{data:{reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.reseller.receive_email,payment_direction:this.state.payment_direction[this.state.payType-1],title:d.code_name,range:t,recharge_type:2,restrict:1,period_type:String(d.period_type)||"1",period_day:d.period_day||"",period_fixed_receive_time:d.period_fixed_receive_time||"",group_info:{type:2,is_webview:d.is_webview,quantity:d.quantity,instructionType:d.instructionType,group_cover:"",group_image:d.group_image[0]?d.group_image[0].src:"",instruction:d.instruction,receive_mode:d.receive_mode,channel:d.channel,time_limit:{timer_show:d.timer_show,effect_time:{end_time:d.date_time[1],start_time:d.date_time[0]},receive_time:{end_time:d.timer[1]||"",start_time:d.timer[0]||""}}},instruction:d.instruction,begin_time:d.date_time[0],end_time:d.date_time[1],quantity:d.issued,new_product:r,update_product:l,delete_product:o},addProduct:i,updateProduct:c}}},{key:"copyOrAddBuildData",value:function(){var e=[];Object(C.a)(this.state.rank,(function(t){e.push(t.text)}));var t=this.refs.tempdata.getSelectData(),a=this.state.codeInfo,n={begin_time:a.date_time[0],end_time:a.date_time[1],instruction:a.instruction,quantity:a.issued,period_type:String(a.period_type)||"1",period_day:a.period_day||"",period_fixed_receive_time:a.period_fixed_receive_time||"",range:e.join(),title:a.code_name,restrict:a.restrict,recharge_type:2,group_info:{type:2,is_webview:a.is_webview,quantity:a.quantity,instructionType:a.instructionType,group_cover:"",group_image:a.group_image[0]?a.group_image[0].src:"",instruction:a.instruction,receive_mode:a.receive_mode,channel:a.channel,time_limit:{timer_show:a.timer_show,effect_time:{end_time:a.date_time[1],start_time:a.date_time[0]},receive_time:{end_time:a.timer[1]||"",start_time:a.timer[0]||""}}},product:{legal:[],reduce:t.filter((function(e){return 2===e.type})).map((function(e){return Object(l.a)(e.origin,["goods_id"])})),cash:[]}};return 1===this.state.isState&&(n.copy_code_batch_id=Ea),{code_batch:[n],reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.reseller.receive_email,payment_direction:this.state.payment_direction[this.state.payType-1],addCode:!0}}},{key:"submitCodeData",value:function(){var e=this;if(this.state.reseller){var t=this.buildData().data;Object(s.Hc)(Ea,t).then((function(t){Object(s.cc)(t,(function(t,a){var n=e.state.model;n.show_url=t.path,e.setState({model:n}),h.a.clear(),h.a.success(a),setTimeout((function(){window.location.replace("#/home/exchangecode-list")}),1e3)}),(function(e){h.a.error(e)}))}))}else h.a.error("\u8be5\u5151\u6362\u7801\u5bf9\u5e94\u5206\u9500\u5546\u4e0d\u5b58\u5728")}},{key:"submitCopyOrAddCodeData",value:function(){var e=this.copyOrAddBuildData(),t=sessionStorage.getItem("keyBatch_id");Object(s.ic)(t,e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u6210\u529f\u53d1\u8d77\u5ba1\u6279"),setTimeout((function(){window.history.back()}),1e3)}),(function(e){h.a.error(e)}))}))}},{key:"submit",value:function(){var e=this;if(this.refs.code_info.validator()&&this.refs.code_rule.validator()){var t=this.state.tempdata.filter((function(e){return e.checked})),a=!1;if(t.map((function(t){t.quantity-1&&(e.checked=o.state.tempdata[t].checked),e.id&&(e.disabled=!0),qa(e)})),i=re(a.concat(n),"only"),s=[],c=[],Object(C.a)(i,(function(e){s.push({key:e.only,text:e.product_name}),e.checked&&c.push({key:e.only,text:e.product_name})})),s=re(s,"key"),this.setState({tempdata:i,rankoptions:s,rank:c}),this.getTableList());case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onReCall",value:function(){var e=this,t=sessionStorage.getItem("approval_id");this.setState({recall_visible:!1}),Object(s.pd)(t).then((function(t){Object(s.cc)(t,(function(t,a){e.setState({approvalLoading:!0});var n=setInterval((function(){e.state.timer<=0&&(clearInterval(n),e.setState({approvalLoading:!1}),h.a.success("\u64a4\u9500\u6210\u529f,\u8bf7\u91cd\u65b0\u63d0\u4ea4\u5ba1\u6838"));var t=e.state.timer-1;e.setState({timer:t})}),1e3)}),(function(e){h.a.error(e)}))}))}},{key:"voucherBatchForEl",value:function(e){return e.map((function(e){return e.channel_activity_id})).join(" , ")}},{key:"handleChange",value:function(e,t){var a=this.state.codeInfo;a[t]=e,this.setState({codeInfo:a})}},{key:"vestingPlanFunction",value:function(e){if(null!==e&&void 0!==e&&e.key){this.getKeyBatchSelect(e.key),this.getResellerFunction(e.reseller_id),this.handleChange("","keyBatchSelect"),this.setState({plan_time:[e.begin_time,e.end_time]});var t={begin_time:e.begin_time,end_time:e.end_time};sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t))}}},{key:"onUploadError",value:function(e,t){"overMaxAmount"===e?h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247")):"overMaxSize"===e&&h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))}},{key:"imgUpload",value:function(e){return new Promise((function(t,a){try{var n=new FormData;n.append("file",e),n.append("path","common_image"),Object(s.sd)(n).then((function(e){Object(s.cc)(e,(function(e,a){t(e.path)}),(function(e){h.a.error(e),a(e)}))}))}catch(i){a(i)}}))}},{key:"onUploadChangeGoods",value:function(e){var t=this;e.length>0?this.imgUpload(e[0].file).then((function(a){t.handleChange([{src:a,id:"".concat((new Date).getTime(),"-0"),name:e[0].file.name}],"group_image")})):this.handleChange([],"group_image")}},{key:"onDisabledRange1",value:function(e,t){var a=!1;return"end"==t&&(a=Z()(e.getTime()).add(1,"days")<=(new Date).getTime()),"start"==t&&(a=e.getTime()<=(new Date).getTime()),a}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"combiningAdd",children:[Object(b.jsx)("div",{children:Object(b.jsxs)(p.a,{className:"card1",title:"\u57fa\u672c\u4fe1\u606f",children:[Object(b.jsx)("div",{className:"addcode",children:Object(b.jsxs)(o.a,{model:this.state.codeInfo,rules:La,ref:"code_info",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5f52\u5c5e\u8ba1\u5212",prop:"planSelect",id:"planSelect",children:Object(b.jsx)(ne.a,{onChange:function(t){e.handleChange(t,"planSelect"),e.vestingPlanFunction(t)},clearable:!0,value:this.state.codeInfo.planSelect,options:this.state.planSelectData,placeholder:"\u8bf7\u9009\u62e9",labelWidth:"0px",height:"36px",width:"520px",disabled:this.state.isState,alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5f52\u5c5ekey",prop:"keyBatchSelect",id:"keyBatchSelect",children:Object(b.jsx)(ne.a,{onChange:function(t){e.handleChange(t,"keyBatchSelect"),sessionStorage.setItem("keyBatch_id",null===t||void 0===t?void 0:t.id)},clearable:!0,value:this.state.codeInfo.keyBatchSelect,options:this.state.keyBatchSelectData,placeholder:"\u8bf7\u9009\u62e9",labelWidth:"0px",height:"36px",width:"520px",disabled:this.state.isState,alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u7ec4\u5408\u5546\u54c1\u540d\u79f0",prop:"code_name",id:"code_name",children:Object(b.jsx)(r.a,{onChange:function(t){return e.handleChange(t,"code_name")},onClearItem:function(){return e.handleChange("","code_name")},value:this.state.codeInfo.code_name,placeholder:"\u8bf7\u8f93\u5165\u7ec4\u5408\u5546\u54c1\u540d\u79f0",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u6570",prop:"restrict",id:"restrict",children:Object(b.jsx)("div",{className:"line",children:this.state.codeInfo.restrict})}),2===this.state.isState&&-1!==this.codeStatus?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u603b\u91cf",prop:"issued",id:"issued",children:Object(b.jsx)("div",{className:"line",children:this.state.codeInfo.issued})}),Object(b.jsx)(c.a,{labelname:"\u5269\u4f59\u5e93\u5b58\u91cf",prop:"stock",id:"stock",children:Object(b.jsx)("div",{className:"line",children:this.state.codeInfo.stock})})]}):Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u603b\u91cf",prop:"issued",id:"issued",children:Object(b.jsx)(r.a,{onChange:function(t){return e.handleChange(t,"issued")},onClearItem:function(){return e.handleChange("","issued")},value:this.state.codeInfo.issued,placeholder:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf",labelWidth:"0px",maxLength:6,countShow:!1,unit:"\u6761",height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u6e20\u9053",prop:"channel",id:"type",children:Object(b.jsx)(te.a,{disabled:!!this.state.tempdata.length&&1!==this.state.isState,onChange:function(t){var a,n=t.target;(e.handleChange(n.value,"channel"),"3"===n.value?e.handleChange(2,"receive_mode"):e.handleChange(1,"receive_mode"),"1"===n.value?e.handleChange(R,"instruction"):"2"===n.value?e.handleChange(z,"instruction"):e.handleChange(Y,"instruction"),1===e.state.isState)&&(e.setState((a={tempdata:[]},Object(se.a)(a,"tempdata",[]),Object(se.a)(a,"rankoptions",[]),Object(se.a)(a,"rank",[]),a)),sessionStorage.setItem("knockGoldData",JSON.stringify([])));e.handleChange(0,"is_webview")},value:this.state.codeInfo.channel,children:Object(b.jsxs)(ma.a,{trigger:"hover",content:"\u53ea\u80fd\u7ec4\u5408\u540c\u4e00\u79cd\u6e20\u9053\u7acb\u51cf\u91d1",children:[Object(b.jsx)(me.a,{value:"1",children:"\u652f\u4ed8\u5b9d"}),Object(b.jsx)(me.a,{value:"2",children:"\u5fae\u4fe1"}),Object(b.jsx)(me.a,{value:"3",children:"\u4e91\u95ea\u4ed8"})]})})}),2==this.state.codeInfo.channel?Object(b.jsx)(c.a,{labelname:"\u6253\u5f00\u65b9\u5f0f",prop:"is_webview",id:"is_webview",children:Object(b.jsxs)(te.a,{disabled:2===this.state.isState,onChange:function(t){var a=t.target;e.handleChange(a.value,"is_webview")},value:this.state.codeInfo.is_webview,children:[Object(b.jsx)(me.a,{value:0,children:"\u5c0f\u7a0b\u5e8f"}),Object(b.jsx)(me.a,{value:1,children:"\u516c\u4f17\u53f7"})]})},"is_webview"):null,1==this.state.codeInfo.channel?Object(b.jsx)(c.a,{labelname:"\u9886\u53d6\u65b9\u5f0f",prop:"receive_mode",id:"receive_mode",children:Object(b.jsx)(te.a,{disabled:!!this.state.tempdata.length&&1!==this.state.isState,onChange:function(t){var a=t.target;e.handleChange(a.value,"receive_mode"),1===e.state.isState&&(e.setState({tempdata:[],rankoptions:[],rank:[]}),sessionStorage.setItem("knockGoldData",JSON.stringify([])))},value:this.state.codeInfo.receive_mode,children:Object(b.jsxs)(ma.a,{trigger:"hover",content:"\u53ea\u80fd\u7ec4\u5408\u540c\u4e00\u79cd\u9886\u53d6\u65b9\u5f0f\u7acb\u51cf\u91d1",children:[Object(b.jsx)(me.a,{value:1,children:"\u5b98\u65b9\u9886\u53d6"}),Object(b.jsx)(me.a,{value:2,children:"\u8d26\u53f7\u9886\u53d6"})]})})}):null,Object(b.jsx)(c.a,{labelname:"\u63cf\u8ff0\u7c7b\u578b",prop:"instructionType",id:"instructionType",children:Object(b.jsxs)(te.a,{onChange:function(t){var a=t.target;e.handleChange(a.value,"instructionType")},value:this.state.codeInfo.instructionType,children:[Object(b.jsx)(me.a,{value:1,children:"\u6587\u5b57\u63cf\u8ff0"}),Object(b.jsx)(me.a,{value:2,children:"\u56fe\u7247\u63cf\u8ff0"})]})}),2===this.state.codeInfo.instructionType?Object(b.jsx)(c.a,{prop:"group_image",labelname:"\u5546\u54c1\u63cf\u8ff0",id:"group_image",required:"",children:Object(b.jsx)(jt.a,{className:"good-image-upload-demo",maxSize:5242880,tips:"\u56fe\u7247\u4e0d\u8d85\u8fc7 5M",maxAmount:1,onError:this.onUploadError,onChange:function(t,a){e.onUploadChangeGoods(t,a)},sortable:!0,fileList:this.state.codeInfo.group_image,multiple:!0})}):Object(b.jsx)(b.Fragment,{children:this.state.loading?Object(b.jsx)(c.a,{labelname:"\u4f7f\u7528\u8bf4\u660e",prop:"instruction",id:"instruction",required:!1,children:Object(b.jsx)(Ia,{pageType:"detaileditor",setEdittext:function(t){e.handleChange(t,"instruction")},width:"520px",text:this.state.codeInfo.instruction,limitLength:5e3},this.state.codeInfo.channel)}):null})]})}),Object(b.jsx)(Fa,{data:this.state.codeInfo,products:this.state.tempdata})]})}),Object(b.jsx)("div",{children:Object(b.jsx)(p.a,{style:{width:"90%",margin:"10px auto"},title:"\u57fa\u672c\u89c4\u5219",children:Object(b.jsx)("div",{children:Object(b.jsxs)(o.a,{model:this.state.codeInfo,rules:Ma,ref:"code_rule",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u5230\u8d26",prop:"period_type",id:"period_type",children:Object(b.jsxs)(ae.a.Group,{value:this.state.codeInfo.period_type,disabled:2===this.state.isState,onChange:function(t){e.handleChange(t.target.value,"period_type"),e.handleChange(1,"period_day"),e.handleChange("","period_fixed_receive_time")},children:[Object(b.jsx)(ae.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(ae.a,{value:"2",children:"\u81ea\u52a8\u53d1\u653e"}),Object(b.jsx)(ae.a,{value:"3",children:"\u624b\u52a8\u9886\u53d6"})]})}),"1"!==this.state.codeInfo.period_type?Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u89c4\u5219",prop:"period_day",id:"period_day",children:Object(b.jsxs)("div",{className:"warningValue",children:[Object(b.jsx)(r.a,{onChange:function(t){t&&(isNaN(Number(t))||Number(t)<0||!/^[1-9]\d*$/.test(t))||e.handleChange(t,"period_day")},onClearItem:function(t){e.handleChange("","period_day")},disabled:2===this.state.isState,countShow:!1,value:this.state.codeInfo.period_day,placeholder:"\u8bf7\u8f93\u5165\u95f4\u9694\u5929\u6570",unit:"\u5929",labelWidth:"0px",height:"36px",width:"520px",alignment:"left"}),Object(b.jsx)("div",{className:"icon-box",children:"2"==this.state.codeInfo.period_type?Object(b.jsx)(va.a,{showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},disabled:2===this.state.isState,value:this.state.codeInfo.period_fixed_receive_time,onChange:function(t){e.handleChange(t,"period_fixed_receive_time")},width:"240px"}):null})]})}):null,Object(b.jsxs)(c.a,{labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"date_time",id:"date_time",children:[Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},disabled:[2===this.state.isState&&[1,2,3,7].includes(this.codeStatus),!1],format:"YYYY-MM-DD HH:mm:ss",value:this.state.codeInfo.date_time,onChange:function(t){Rt.a.emit("change","date_time",t),e.onChangeCombinedDate(t)},width:245,disabledTime:this.onDisabledTime,disabledDate:this.onDisabledRange}),Object(b.jsxs)(te.a,{style:{marginLeft:"20px"},onChange:function(t){var a=t.target;e.handleChange(a.value,"timer_show")},value:this.state.codeInfo.timer_show,children:[Object(b.jsx)(me.a,{value:1,children:"\u663e\u793a"}),Object(b.jsx)(me.a,{value:2,children:"\u9690\u85cf"})]})]}),2===this.state.codeInfo.timer_type?Object(b.jsxs)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",prop:"timer",children:[Object(b.jsx)(fe.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:this.state.codeInfo.timer,onChange:function(t){e.handleChange(t,"timer")},width:"240px",disabledTime:this.onDisabledRange1}),Object(b.jsxs)(te.a,{style:{marginLeft:"15px"},onChange:function(t){var a=t.target;e.handleChange(a.value,"timer_type"),1===a.value&&e.handleChange([],"timer")},value:this.state.codeInfo.timer_type,children:[Object(b.jsx)(me.a,{value:1,children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:2,children:"\u6bcf\u65e5"})]})]}):Object(b.jsx)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",children:Object(b.jsxs)(te.a,{onChange:function(t){var a=t.target;e.handleChange(a.value,"timer_type")},value:this.state.codeInfo.timer_type,children:[Object(b.jsx)(me.a,{value:1,children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:2,children:"\u6bcf\u65e5"})]})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u8303\u56f4",prop:"rank",id:"rank",children:Object(b.jsxs)("div",{className:"goods-boxs",children:[Object(b.jsx)(ne.a,{options:this.state.rankoptions,multiple:!0,value:this.state.rank,placeholder:"\u9009\u62e9\u4e00\u9879",disabled:2==this.state.isState&&-1!==this.codeStatus,width:410,onChange:function(t){e.onRankChange(t)}}),2!==this.state.isState||-1===this.codeStatus?Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){e.addProduct()},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan")),children:"\u65b0\u5efa\u7acb\u51cf\u91d1"}):null]})}),Object(b.jsx)(c.a,{labelname:"",prop:"range",id:"range",children:Object(b.jsx)(q,{ref:"tempdata",headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:this.state.tempdata,value:this.state.tempdata,Column:Ha,maxheight:200,countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(t){e.pageChange(t)},checkChange:function(t){var a=[];Object(C.a)(t,(function(e){var t={};return t.key=e.only,t.text=e.product_name,a.push(t),t})),e.setState({rank:a})},ComponentHandler:function(t,a,n){return"index"===t?Object(b.jsx)(Le.a,{value:a.index,onChange:function(t){var a=t.target;e.state.tempdata[n].index=a.value,e.state.tempdata[n].origin.index=a.value,e.setState({tempdata:e.state.tempdata})},disabled:2===e.state.isState,type:"number",width:100}):"type"==t?Object(b.jsx)(b.Fragment,{children:"\u7acb\u51cf\u91d1"}):"effectDate"==t?Object(b.jsxs)(b.Fragment,{children:[e.state.codeInfo.date_time[0]," \u81f3 ",e.state.codeInfo.date_time[1]]}):"voucher_batch"==t?Object(b.jsx)(b.Fragment,{children:e.voucherBatchForEl(a.origin.voucher_batch)}):"cost_price"==t?Object(b.jsx)(b.Fragment,{children:2===a.type?a.official_price:a.cost_price}):"edit"==t?Object(b.jsx)("a",{className:"grid-link",onClick:function(t){e.productEditShow(a)},children:"\u7f16\u8f91"}):void 0}})})]})})})}),Object(b.jsx)(ht.a,{className:"draw",width:"86%",title:this.state.product_title,footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.productSubmit()},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(t){e.setState({drawerVisible:!1}),e.getTableList()},children:"\u53d6\u6d88"})]}),visible:this.state.drawerVisible,onClose:function(t){e.setState({drawerVisible:!1})},maskClosable:!1,children:Object(b.jsx)("div",{className:"draw2",children:Object(b.jsx)(p.a,{style:{width:"95%",margin:"10px auto",border:0},children:Object(b.jsx)(Je,{ref:"knockGold",data:this.state.productData,combining:this.state.codeInfo})})})}),this.state.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(t){return e.setState({payType:t.target.value})},value:this.state.payType,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onConfirm(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.recall_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({recall_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u5f53\u524d\u6b63\u5728\u5ba1\u6838\u4e2d"}),Object(b.jsx)("div",{className:"audit-box-txt",children:"\u63d0\u4ea4\u5ba1\u6838\u4f1a\u5c06\u539f\u6765\u5ba1\u6279\u64a4\u56de\u624d\u53ef\u8fdb\u884c\u63d0\u4ea4,\u662f\u5426\u64a4\u56de?"}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({recall_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onReCall(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.approvalLoading?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)("div",{className:"audit-box-title",children:"\u64a4\u9500\u5ba1\u6279\u4e2d"}),Object(b.jsxs)("div",{className:"audit-box-txt",children:["\u6b63\u5728\u53d1\u8d77\u64a4\u9500...,\u8bf7\u7b49\u5f85 ",Object(b.jsxs)("span",{style:{color:"red"},children:[" ",this.state.timer]})," \u79d2"]})]})]}):null,Object(b.jsxs)("div",{className:"edit-btnList",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.submit()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.cancel()},children:"\u53d6\u6d88"})]})]})}}]),a}(u.a.Component),Va=(a(298),[{title:"\u5151\u6362\u7801-\u6279\u6b21ID",name:"id",prop:"id",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u540d\u79f0",prop:"title",name:"title",width:"auto",type:"solt"},{title:"\u6709\u6548\u671f",name:"time",prop:"time",type:"slot",width:"250px"},{title:"\u8425\u9500\u8ba1\u5212\u5f52\u5c5e",name:"plan_title",type:"normal",prop:"plan_title",width:"auto"},{title:"\u5f52\u5c5eKEY\u6279\u6b21ID",name:"key_batch_id",type:"normal",prop:"key_batch_id",width:"auto"},{title:"\u542f\u7528/\u6682\u505c",width:"auto",type:"slot",prop:"switch"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"280px"},{title:"\u72b6\u6001",name:"status",type:"slot",prop:"status",width:"auto"},{title:"\u5238\u603b\u6570(\u5df2\u53d1\u653e)",name:"quantity",type:"normal",prop:"quantity",width:"auto"},{title:"\u5df2\u9886\u53d6",name:"received",type:"normal",prop:"received",width:"auto"},{title:"\u5df2\u4f7f\u7528",name:"usage",type:"normal",prop:"usage",width:"auto"},{title:"\u5269\u4f59\u6570",name:"stock",type:"normal",prop:"stock",width:"auto"},{title:"\u5df2\u5931\u6548",name:"expired",type:"normal",prop:"expired",width:"auto"},{title:"\u5df2\u4f5c\u5e9f",name:"invalid",type:"normal",prop:"invalid",width:"auto"}]),Ja=[{title:"\u5168\u90e8",index:0},{title:"\u521b\u5efa\u4e2d",index:-1},{title:"\u672a\u5f00\u59cb",index:3},{title:"\u5ba1\u6838\u4e2d",index:6},{title:"\u672a\u901a\u8fc7",index:7},{title:"\u8fdb\u884c\u4e2d",index:1},{title:"\u6682\u505c\u4e2d",index:2},{title:"\u751f\u6210\u4e2d",index:8},{title:"\u5df2\u7ed3\u675f",index:4},{title:"\u5df2\u4f5c\u5e9f",index:5}],Wa=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={codeList:[],total:0,page:1,limit:10,tabList:Object(ce.a)(Ja),combinedValue:[],DateTime:"",search:n.initSearch(),status:0,tableHeight:600,tabIndex:0,planOptions:[]},n}return Object(y.a)(a,[{key:"addCodeFunction",value:function(e,t){sessionStorage.setItem("knockGold_effectDate",JSON.stringify({})),sessionStorage.setItem("redPackets_effectDate",JSON.stringify({}));var a=[{pagetitle:"\u65b0\u5efa\u5151\u6362\u7801",items:[{path:"/home/exchangecode-list",name:"\u5151\u6362\u7801\u7ba1\u7406"},{path:"/home/exchangecode-exchangecodeAdd",name:"\u65b0\u5efa\u5151\u6362\u7801"}]}];1===e?(a[0].pagetitle="\u590d\u5236",a[0].items[1].name="\u590d\u5236:".concat(t.title),sessionStorage.setItem("keyBatch_id",t.key_batch_id)):2===e&&(a[0].pagetitle="\u7f16\u8f91",a[0].items[1].name="\u7f16\u8f91:".concat(t.title,"\u5151\u6362\u7801\u7684\u5546\u54c1\u8303\u56f4\u5217\u8868"),sessionStorage.setItem("approval_id",t.approval_id),sessionStorage.setItem("approval_status",t.status)),e&&(sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t.keyBatch.plan)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(t.keyBatch.plan))),sessionStorage.setItem("keyType","1"),sessionStorage.setItem("code_id",null===t||void 0===t?void 0:t.id),sessionStorage.setItem("isState",e),sessionStorage.setItem("breaknav",JSON.stringify(a)),sessionStorage.setItem("pathname2","/home/exchangecode-exchangecodeAdd"),this.props.history.push("/home/exchangecode-exchangecodeAdd")}},{key:"aboutFn",value:function(e,t){sessionStorage.setItem("pathname2","/home/exchange-addcommodity");var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/exchangecode-list",name:"\u5151\u6362\u7801\u7ba1\u7406"},{path:"/home/exchange-addcommodity",name:t.title+"\u5151\u6362\u7801\u7684\u5546\u54c1\u8303\u56f4\u5217\u8868"}]}];sessionStorage.setItem("code_id",t.id),sessionStorage.setItem("isCombining",t.recharge_type),sessionStorage.setItem("breaknav",JSON.stringify(a)),window.open("#/home/exchange-addcommodity")}},{key:"initSearch",value:function(){return{plan_title:"",key_batch_id:"",code_batch_id:"",code_batch_name:""}}},{key:"searchChange",value:function(e,t){var a=this.state.search;a[e]=t,this.setState({search:a})}},{key:"getPlan",value:function(){var e=this;Object(s.yb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.title}}));e.setState({planOptions:n})}),(function(e){}))}))}},{key:"copyElementFunction",value:function(e){var t,a,n=this,i=[1,2,3].includes(null===e||void 0===e?void 0:e.status)||[4,5].includes(null===e||void 0===e?void 0:e.status)&&[4,5,8].includes(null===(t=e.keyBatch)||void 0===t?void 0:t.status)&&[3,5,4].includes(null===(a=e.keyBatch.plan)||void 0===a?void 0:a.status);return e.keyBatch.plan&&i&&0===e.keyBatch.plan.settlement_type?Object(b.jsx)("span",{className:"grid-link",style:{},onClick:function(t){return n.addCodeFunction(1,e)},children:"\u590d\u5236"}):Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u590d\u5236"})}},{key:"deleteCodeFunction",value:function(e){var t=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u5220\u9664\u8be5\u5151\u6362\u7801\uff1f"}),onConfirm:function(){Object(s.F)(e.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"tabFn",value:function(e){var t=this;this.setState({tabIndex:e,search:this.initSearch(),page:1,limit:10}),setTimeout((function(){t.getCodeListFn({},e)}),10)}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getCodeListFn()}),10)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getCodeListFn()}),10)}},{key:"sureFn",value:function(){var e=this;this.setState({page:1,limit:10},(function(){e.getCodeListFn()}))}},{key:"delCodeFun",value:function(e){var t=this;Object(s.s)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"delFn",value:function(e,t){var a=this;if(6!=t.status){var n=this,i={type:2,object_value:t.id};try{At(i).then((function(e){2===e?n.delCodeFun(t.id):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u4f5c\u5e9f",t.title,"\uff1f"]}),onConfirm:function(){n.delCodeFun(t.id)},onCancel:function(){},className:"questModal",parentComponent:a})}))}catch(s){}}else h.a.error("\u5ba1\u6838\u4e2d\u7684\u6570\u636e\u4e0d\u5141\u8bb8\u4f5c\u5e9f")}},{key:"changestatus",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426",1==t.old_status?"\u505c\u7528":"\u542f\u7528","\u8be5\u5151\u6362\u7801\u6279\u6b21\uff1f"]}),onConfirm:function(){Object(s.Gc)(t.id,{operation:1==t.old_status?"2":"1"}).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"onChangeCombinedDate",value:function(e){this.setState({combinedValue:e}),this.getCodeListFn(e)}},{key:"getCodeListFn",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.tabIndex,i=this,c=Object(ye.a)(i.state),o=c.page,r=c.limit,l=c.search;l.plan_title=(null===(e=l.plan_title)||void 0===e?void 0:e.text)||"";var d=Object(n.a)({page:o,limit:r},l);this.state.combinedValue&&this.state.combinedValue[0]&&(d.begin_time=this.state.combinedValue[0],d.end_time=this.state.combinedValue[1]),t&&t[0]&&(d.begin_time=t[0],d.end_time=t[1]),t&&null==t[0]&&t.length>1&&d.begin_time&&(delete d.begin_time,delete d.end_time),a&&(d.status=this.state.tabList[a].index,0==a&&(d.status=null)),Object(s.Z)(d).then((function(e){var t=JSON.parse(e);if(200==t.code){var a=t.data.data,n=t.data.total;i.setState({codeList:a,total:n})}})).catch((function(e){}))}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390}),this.getPlan()}},{key:"onReCall",value:function(e,t){var a=this,n=t.approval_id;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u8be5\u6570\u636e\u6b63\u5728\u5ba1\u6279\u4e2d,\u662f\u5426\u786e\u8ba4\u64a4\u9500\u5ba1\u6279\uff1f"}),onConfirm:function(){Object(s.pd)(n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u64a4\u9500\u5ba1\u6279\u6210\u529f"),setTimeout((function(){a.getCodeListFn()}),3e3)}),(function(e){h.a.error(e)}))}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"dingTask",value:function(e){var t=this;Object(s.K)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))}))}},{key:"render",value:function(){var e=this,t=Object(b.jsx)(Bt.a,{showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",className:"zent-datepicker-demo",value:this.state.combinedValue,onChange:function(t){e.onChangeCombinedDate(t)}});return Object(b.jsx)("div",{id:"exchangecodelists",children:Object(b.jsxs)(It,{slot:t,tabs:this.state.tabList,tabChange:this.tabFn.bind(this),width:130,children:[Object(b.jsxs)("div",{className:"codetable",children:[Object(b.jsx)("div",{className:"codesFind",children:Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u540d\u79f0\uff1a",required:"",labelwidth:"90px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.plan_title,options:this.state.planOptions,placeholder:"\u8bf7\u8f93\u5165",width:250,clearable:!0,onChange:function(t){e.searchChange("plan_title",t)}})}),Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21ID\uff1a",required:"",labelwidth:"100px",children:Object(b.jsx)(r.a,{value:this.state.search.key_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("key_batch_id",t)},onClearItem:function(t){e.searchChange("key_batch_id","")}})}),Object(b.jsx)(c.a,{labelname:"\u5151\u6362\u7801\u6279\u6b21\u540d\u79f0\uff1a",required:"",labelwidth:"155px",children:Object(b.jsx)(r.a,{value:this.state.search.code_batch_name,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("code_batch_name",t)},onClearItem:function(t){e.searchChange("code_batch_name","")}})}),Object(b.jsx)(c.a,{labelname:"\u5151\u6362\u7801\u6279\u6b21ID\uff1a",required:"",labelwidth:"130px",children:Object(b.jsx)(r.a,{value:this.state.search.code_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("code_batch_id",t)},onClearItem:function(t){e.searchChange("code_batch_id","")}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.getCodeListFn()},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){return e.setState({search:e.initSearch()},(function(){return e.getCodeListFn()}))},children:"\u91cd\u7f6e"})]})]})}),Object(b.jsx)(m.a,{type:"primary",className:"add",icon:"plus",onClick:function(){return e.addCodeFunction()},children:"\u65b0\u5efa\u5151\u6362\u7801"})]}),Object(b.jsx)("div",{className:"code-table",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.codeList,Column:Va,maxheight:this.state.tableHeight,countbarVisible:!1,isSwitch:!1,page:this.state.page,dataCount:this.state.total,isMultiple:!1,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"time"==t?Object(b.jsxs)("span",{children:[a.begin_time,"\u81f3",a.end_time]}):"title"==t?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.aboutFn(t,a)},children:a.title}):"switch"==t?Object(b.jsx)(S.a,{size:"small",checked:2!=a.old_status,onChange:function(t){return e.changestatus(t,a)},disabled:4==a.status||5==a.status}):"status"==t?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.exchangeStatusBg(parseInt(a.status))}}),a.status_text]})}):"opearo"==t?Object(b.jsxs)("div",{children:[4!=a.status&&5!=a.status&&8!=a.status&&6!=a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.addCodeFunction(2,a)},children:"\u7f16\u8f91"}):Object(b.jsx)("span",{style:{color:"#d8dbdd"},className:"grid-link",children:"\u7f16\u8f91"}),e.copyElementFunction(a),[4,5,8,6,-1].includes(a.status)||7===a.status&&-1===a.old_status?Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u4f5c\u5e9f"}):Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.delFn(t,a)},children:"\u4f5c\u5e9f"}),6==a.status&&Number(a.approval_id)>0?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.onReCall(t,a)},children:"\u64a4\u9500\u5ba1\u6279"}):Object(b.jsx)("span",{style:{color:"#d8dbdd",marginRight:"12px"},children:"\u64a4\u9500\u5ba1\u6279"}),a.approval_id&&6===a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.dingTask(a.approval_id)},children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}),[-1,7].includes(a.status)&&-1==a.old_status?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(t){return e.deleteCodeFunction(a)},children:"\u5220\u9664"}):Object(b.jsx)("span",{style:{color:"#d8dbdd"},className:"grid-link",children:"\u5220\u9664"})]}):void 0}})})]})})}}]),a}(u.a.Component),za=(a(299),[{title:"\u5151\u6362\u7801-\u6279\u6b21ID",name:"id",prop:"id",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u540d\u79f0",prop:"title",name:"title",width:"auto",type:"solt"},{title:"\u6709\u6548\u671f",name:"time",prop:"time",type:"slot",width:"250px"},{title:"\u8425\u9500\u8ba1\u5212\u5f52\u5c5e",name:"plan_title",type:"normal",prop:"plan_title",width:"auto"},{title:"\u5f52\u5c5eKEY\u6279\u6b21ID",name:"key_batch_id",type:"normal",prop:"key_batch_id",width:"auto"},{title:"\u542f\u7528/\u6682\u505c",width:"auto",type:"slot",prop:"switch"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"280px"},{title:"\u72b6\u6001",name:"status",type:"slot",prop:"status",width:"auto"},{title:"\u5238\u603b\u6570(\u5df2\u53d1\u653e)",name:"quantity",type:"normal",prop:"quantity",width:"auto"},{title:"\u5df2\u9886\u53d6",name:"received",type:"normal",prop:"received",width:"auto"},{title:"\u5df2\u4f7f\u7528",name:"usage",type:"normal",prop:"usage",width:"auto"},{title:"\u5269\u4f59\u6570",name:"stock",type:"normal",prop:"stock",width:"auto"},{title:"\u5df2\u5931\u6548",name:"expired",type:"normal",prop:"expired",width:"auto"},{title:"\u5df2\u4f5c\u5e9f",name:"invalid",type:"normal",prop:"invalid",width:"auto"}]),Ra=[{title:"\u5168\u90e8",index:0},{title:"\u521b\u5efa\u4e2d",index:-1},{title:"\u672a\u5f00\u59cb",index:3},{title:"\u5ba1\u6838\u4e2d",index:6},{title:"\u672a\u901a\u8fc7",index:7},{title:"\u8fdb\u884c\u4e2d",index:1},{title:"\u6682\u505c\u4e2d",index:2},{title:"\u751f\u6210\u4e2d",index:8},{title:"\u5df2\u7ed3\u675f",index:4},{title:"\u5df2\u4f5c\u5e9f",index:5}],Ya=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={codeList:[],total:0,page:1,limit:10,tabList:Object(ce.a)(Ra),combinedValue:[],DateTime:"",search:n.initSearch(),status:0,tableHeight:600,tabIndex:0,planOptions:[]},n}return Object(y.a)(a,[{key:"addCodeFunction",value:function(e,t){sessionStorage.setItem("knockGold_effectDate",JSON.stringify({})),sessionStorage.setItem("redPackets_effectDate",JSON.stringify({}));var a=[{pagetitle:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1",items:[{path:"/home/combining-list",name:"\u7ec4\u5408\u5546\u54c1\u7ba1\u7406"},{path:"/home/combiningAdd",name:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1"}]}];1===e?(a[0].pagetitle="\u590d\u5236",a[0].items[1].name="\u590d\u5236:".concat(t.title),sessionStorage.setItem("keyBatch_id",t.key_batch_id)):2===e&&(a[0].pagetitle="\u7f16\u8f91",a[0].items[1].name="\u7f16\u8f91:".concat(t.title,"\u5151\u6362\u7801\u7684\u5546\u54c1\u8303\u56f4\u5217\u8868"),sessionStorage.setItem("approval_id",t.approval_id),sessionStorage.setItem("approval_status",t.status)),e&&(sessionStorage.setItem("knockGold_effectDate",JSON.stringify(t.keyBatch.plan)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(t.keyBatch.plan))),sessionStorage.setItem("code_id",null===t||void 0===t?void 0:t.id),sessionStorage.setItem("isState",e),sessionStorage.setItem("breaknav",JSON.stringify(a)),sessionStorage.setItem("pathname2","/home/combiningAdd"),this.props.history.push("/home/combiningAdd")}},{key:"aboutFn",value:function(e,t){sessionStorage.setItem("pathname2","/home/exchange-addcommodity");var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/exchangecode-list",name:"\u5151\u6362\u7801\u7ba1\u7406"},{path:"/home/exchange-addcommodity",name:t.title+"\u5151\u6362\u7801\u7684\u5546\u54c1\u8303\u56f4\u5217\u8868"}]}];sessionStorage.setItem("code_id",t.id),sessionStorage.setItem("breaknav",JSON.stringify(a)),window.open("#/home/exchange-addcommodity")}},{key:"initSearch",value:function(){return{plan_title:"",key_batch_id:"",code_batch_id:"",code_batch_name:""}}},{key:"searchChange",value:function(e,t){var a=this.state.search;a[e]=t,this.setState({search:a})}},{key:"getPlan",value:function(){var e=this;Object(s.yb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.title}}));e.setState({planOptions:n})}),(function(e){}))}))}},{key:"copyElementFunction",value:function(e){var t,a,n=this;return([1,2,3].includes(null===e||void 0===e?void 0:e.status)||[4,5].includes(null===e||void 0===e?void 0:e.status)&&[4,5,8].includes(null===(t=e.keyBatch)||void 0===t?void 0:t.status)&&[3,5,4].includes(null===(a=e.keyBatch.plan)||void 0===a?void 0:a.status))&&0===e.keyBatch.plan.settlement_type?Object(b.jsx)("span",{className:"grid-link",style:{},onClick:function(t){return n.addCodeFunction(1,e)},children:"\u590d\u5236"}):Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u590d\u5236"})}},{key:"deleteCodeFunction",value:function(e){var t=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u5220\u9664\u8be5\u5151\u6362\u7801\uff1f"}),onConfirm:function(){Object(s.F)(e.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"tabFn",value:function(e){var t=this;this.setState({tabIndex:e,search:this.initSearch(),page:1,limit:10}),setTimeout((function(){t.getCodeListFn({},e)}),10)}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getCodeListFn()}),10)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getCodeListFn()}),10)}},{key:"sureFn",value:function(){var e=this;this.setState({page:1,limit:10},(function(){e.getCodeListFn()}))}},{key:"delCodeFun",value:function(e){var t=this;Object(s.s)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"delFn",value:function(e,t){var a=this;if(6!=t.status){var n=this,i={type:2,object_value:t.id};try{At(i).then((function(e){2===e?n.delCodeFun(t.id):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u4f5c\u5e9f",t.title,"\uff1f"]}),onConfirm:function(){n.delCodeFun(t.id)},onCancel:function(){},className:"questModal",parentComponent:a})}))}catch(s){}}else h.a.error("\u5ba1\u6838\u4e2d\u7684\u6570\u636e\u4e0d\u5141\u8bb8\u4f5c\u5e9f")}},{key:"changestatus",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426",1==t.old_status?"\u505c\u7528":"\u542f\u7528","\u8be5\u5151\u6362\u7801\u6279\u6b21\uff1f"]}),onConfirm:function(){Object(s.Gc)(t.id,{operation:1==t.old_status?"2":"1"}).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getCodeListFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"onChangeCombinedDate",value:function(e){this.setState({combinedValue:e}),this.getCodeListFn(e)}},{key:"getCodeListFn",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state.tabIndex,i=this,c=Object(ye.a)(i.state),o=c.page,r=c.limit,l=c.search;l.plan_title=(null===(e=l.plan_title)||void 0===e?void 0:e.text)||"";var d=Object(n.a)(Object(n.a)({page:o,limit:r},l),{},{recharge_type:2});this.state.combinedValue&&this.state.combinedValue[0]&&(d.begin_time=this.state.combinedValue[0],d.end_time=this.state.combinedValue[1]),t&&t[0]&&(d.begin_time=t[0],d.end_time=t[1]),t&&null==t[0]&&t.length>1&&d.begin_time&&(delete d.begin_time,delete d.end_time),a&&(d.status=this.state.tabList[a].index,0==a&&(d.status=null)),Object(s.Z)(d).then((function(e){var t=JSON.parse(e);if(200==t.code){var a=t.data.data,n=t.data.total;i.setState({codeList:a,total:n})}})).catch((function(e){}))}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390}),this.getPlan()}},{key:"onReCall",value:function(e,t){var a=this,n=t.approval_id;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u8be5\u6570\u636e\u6b63\u5728\u5ba1\u6279\u4e2d,\u662f\u5426\u786e\u8ba4\u64a4\u9500\u5ba1\u6279\uff1f"}),onConfirm:function(){Object(s.pd)(n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u64a4\u9500\u5ba1\u6279\u6210\u529f"),setTimeout((function(){a.getCodeListFn()}),3e3)}),(function(e){h.a.error(e)}))}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"dingTask",value:function(e){var t=this;Object(s.K)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success(a),t.getCodeListFn()}),(function(e){h.a.error(e)}))}))}},{key:"render",value:function(){var e=this,t=Object(b.jsx)(Bt.a,{showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",className:"zent-datepicker-demo",value:this.state.combinedValue,onChange:function(t){e.onChangeCombinedDate(t)}});return Object(b.jsx)("div",{id:"exchangecodelists",children:Object(b.jsxs)(It,{slot:t,tabs:this.state.tabList,tabChange:this.tabFn.bind(this),width:130,children:[Object(b.jsxs)("div",{className:"codetable ",children:[Object(b.jsx)("div",{className:"codesFind",children:Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u540d\u79f0\uff1a",required:"",labelwidth:"90px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.plan_title,options:this.state.planOptions,placeholder:"\u8bf7\u8f93\u5165",width:250,clearable:!0,onChange:function(t){e.searchChange("plan_title",t)}})}),Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21ID\uff1a",required:"",labelwidth:"100px",children:Object(b.jsx)(r.a,{value:this.state.search.key_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("key_batch_id",t)},onClearItem:function(t){e.searchChange("key_batch_id","")}})}),Object(b.jsx)(c.a,{labelname:"\u5151\u6362\u7801\u6279\u6b21\u540d\u79f0\uff1a",required:"",labelwidth:"155px",children:Object(b.jsx)(r.a,{value:this.state.search.code_batch_name,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("code_batch_name",t)},onClearItem:function(t){e.searchChange("code_batch_name","")}})}),Object(b.jsx)(c.a,{labelname:"\u5151\u6362\u7801\u6279\u6b21ID\uff1a",required:"",labelwidth:"130px",children:Object(b.jsx)(r.a,{value:this.state.search.code_batch_id,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:250,onChange:function(t){e.searchChange("code_batch_id",t)},onClearItem:function(t){e.searchChange("code_batch_id","")}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.getCodeListFn()},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){return e.setState({search:e.initSearch()},(function(){return e.getCodeListFn()}))},children:"\u91cd\u7f6e"})]})]})}),Object(b.jsx)(m.a,{type:"primary",className:"add",icon:"plus",onClick:function(){return e.addCodeFunction()},children:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1"})]}),Object(b.jsx)("div",{className:"code-table",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.codeList,Column:za,maxheight:this.state.tableHeight,countbarVisible:!1,isSwitch:!1,page:this.state.page,dataCount:this.state.total,isMultiple:!1,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"time"==t?Object(b.jsxs)("span",{children:[a.begin_time,"\u81f3",a.end_time]}):"title"==t?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.aboutFn(t,a)},children:a.title}):"switch"==t?Object(b.jsx)(S.a,{size:"small",checked:2!=a.old_status,onChange:function(t){return e.changestatus(t,a)},disabled:4==a.status||5==a.status}):"status"==t?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.exchangeStatusBg(parseInt(a.status))}}),a.status_text]})}):"opearo"==t?Object(b.jsxs)("div",{children:[4!=a.status&&5!=a.status&&8!=a.status&&6!=a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.addCodeFunction(2,a)},children:"\u7f16\u8f91"}):Object(b.jsx)("span",{style:{color:"#d8dbdd"},className:"grid-link",children:"\u7f16\u8f91"}),e.copyElementFunction(a),[4,5,8,6,-1].includes(a.status)||7===a.status&&-1===a.old_status?Object(b.jsx)("span",{style:{paddingRight:"10px",color:"#d8dbdd"},children:"\u4f5c\u5e9f"}):Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.delFn(t,a)},children:"\u4f5c\u5e9f"}),6==a.status&&Number(a.approval_id)>0?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.onReCall(t,a)},children:"\u64a4\u9500\u5ba1\u6279"}):Object(b.jsx)("span",{style:{color:"#d8dbdd",marginRight:"12px"},children:"\u64a4\u9500\u5ba1\u6279"}),a.approval_id&&6===a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.dingTask(a.approval_id)},children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}),[-1,7].includes(a.status)&&-1==a.old_status?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(t){return e.deleteCodeFunction(a)},children:"\u5220\u9664"}):Object(b.jsx)("span",{style:{color:"#d8dbdd"},className:"grid-link",children:"\u5220\u9664"})]}):void 0}})})]})})}}]),a}(u.a.Component),Ka=a(300),Ga=(a(301),a(207)),Ua={1:"access_conf",3:"exchange",4:"coupon",8:"coupon"},Qa=[{title:"\u57fa\u672c\u4fe1\u606f",name:"thumb",prop:"thumb",className:"name",type:"slot",width:"10%"},{title:"\u6807\u9898",prop:"title",name:"title",width:"200px",type:"normal"},{title:"\u843d\u5730\u9875\u7c7b\u578b",name:"page",prop:"page",type:"slot",defaultText:0,width:"auto"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"update_time",type:"normal",prop:"update_time",defaultText:"PM",width:"auto"},Object(se.a)({title:"\u5f52\u5c5e\u8ba1\u5212",name:"plan.title",type:"normal",prop:"plan.title",defaultText:0,width:"auto"},"type","normal"),{title:"\u94fe\u63a5\u5730\u5740",name:"href",type:"slot",prop:"href",defaultText:0,width:"auto"},{title:"\u521b\u5efa\u4eba",width:"auto",type:"normal",prop:"user_name",name:"user_name"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"300px",defaultText:0}],$a=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u5168\u90e8"},{title:"\u672a\u5f00\u59cb"},{title:"\u8fdb\u884c\u4e2d"},{title:"\u6682\u505c\u4e2d"},{title:"\u5df2\u7ed3\u675f"}],distdata:[],tableHeight:500,filterList:[{id:0,label:"\u5206\u9500\u5546\u72b6\u6001",menuList:[{id:0,name:"\u5f00"},{id:1,name:"\u5173"}]}],menuList:[{id:0,name:"\u5206\u9500\u5546\u72b6\u6001",check:!1}],page:1,limit:10,key_word:"",status:null,dataCount:0,preview_visible:!1,preview_url:"",previewData:{},showType:1},n}return Object(y.a)(a,[{key:"getTableList",value:function(e){var t=this;this.state.key_word&&(e.title=this.state.key_word);var a=Object(Tt.a)(e,(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)}));Object(s.Pb)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({dataCount:e.total}),t.setState({distdata:e.data})}))}))}},{key:"countChange",value:function(e){this.setState({limit:e});var t={page:this.state.page,limit:e,title:this.state.key_word};this.getTableList(t)}},{key:"pageChange",value:function(e){this.setState({page:e});var t={page:e,limit:this.state.limit,title:this.state.key_word,status:this.state.status};this.getTableList(t)}},{key:"editFn",value:function(e,t){sessionStorage.setItem("mouldType",2),sessionStorage.setItem("pageChange",1),sessionStorage.setItem("pageInfo",JSON.stringify(t)),window.location.href="/#/edittemplate"}},{key:"delFn",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",t.plan.title,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.C)(t.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getAccountFn()}),(function(e){}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"tabChange",value:function(e){var t=this;this.setState({page:1}),this.setState({limit:10}),this.setState({key_word:""});var a={page:1,limit:10},n=null;n=e>0?3==e?5:4==e?3:e:null,a.status=n,this.setState({status:n}),setTimeout((function(){t.getTableList(a)}),10)}},{key:"onPreview",value:function(e,t){var a=t[Ua[t.page]];this.setState({preview_visible:!0,previewData:a,showType:t.page})}},{key:"closePhone",value:function(e){this.setState({preview_visible:!1})}},{key:"sureFn",value:function(){this.setState({page:1}),this.setState({limit:10});var e={page:1,limit:10,title:this.state.key_word,status:this.state.status};this.getTableList(e)}},{key:"componentDidUpdate",value:function(e,t){t.key_word==this.state.key_word||this.state.key_word||this.sureFn()}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-430})}},{key:"onBack",value:function(){this.refs.preview.popPage()}},{key:"onClose",value:function(){this.setState({preview_visible:!1})}},{key:"render",value:function(){var e=this,t=this.state;t.current,t.pageSize;return Object(b.jsxs)("div",{id:"dislist",children:[Object(b.jsxs)(It,{tabs:this.state.tabList,tabChange:function(t){return e.tabChange(t)},children:[Object(b.jsxs)("div",{className:"distable dflexj",children:[Object(b.jsx)("div",{children:" "}),Object(b.jsx)(r.a,{icon:"search",placeholder:"\u8bf7\u8f93\u5165\u5173\u952e\u5b57\u8fdb\u884c\u641c\u7d22",countShow:!1,value:this.state.key_word,height:"36px",width:"260px",alignment:"left",onClearItem:function(t){e.setState({key_word:""})},onChange:function(t){e.setState({key_word:t})},wordSearch:function(t){e.sureFn()}})]}),Object(b.jsx)("div",{children:Object(b.jsx)(q,{isBorder:!0,spliteColor:"#fff",page:this.state.page,maxheight:this.state.tableHeight,tableData:this.state.distdata,Column:Qa,isMultiple:!1,countbarVisible:!1,isSwitch:!1,dataCount:this.state.dataCount,countChange:function(t){e.countChange(t)},pageChange:function(t){e.pageChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){if("thumb"==t)return Object(b.jsx)(ma.a,{trigger:"hover",position:"right-center",content:Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"375px",transform:"scale(.8)"}}),children:Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"30px",height:"30px"}})});if("name"==t)return Object(b.jsx)(S.a,{size:"small",checked:!0});if("client"==t)return Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.pageStatusBg(parseInt(a.client))}}),qt.pageStatus(parseInt(a.client))]});if("page"==t)return Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.pageTypeStatusBg(parseInt(a.page))}}),qt.pageTypeStatus(parseInt(a.page))]});if("edit"==t)return Object(b.jsxs)("span",{children:[Object(b.jsx)("a",{className:"grid-link",onClick:function(t){e.editFn(t,a)},children:"\u7f16\u8f91"}),Object(b.jsx)("a",{onClick:function(t){e.onPreview(t,a)},className:"grid-link",children:"\u9884\u89c8"})]});if("href"==t){var n=Object(b.jsx)(Ga,{value:a.href});return Object(b.jsx)(ma.a,{trigger:"hover",content:n,children:Object(b.jsx)("a",{href:a.href,children:a.href})})}}})})]}),this.state.preview_visible?Object(b.jsx)(Ka.a,{previewData:this.state.previewData,showType:this.state.showType,onCloseFn:this.onClose.bind(this)}):null]})}}]),a}(u.a.Component),Za=(a(304),[{title:"\u7f29\u7565\u56fe",name:"thumb",prop:"thumb",type:"slot",width:"10%"},{title:"\u6807\u9898",prop:"title",name:"title",width:"auto",type:"normal"},{title:"\u843d\u5730\u9875\u7c7b\u578b",prop:"client",name:"client",type:"slot",width:"auto"},{title:"\u66f4\u65b0\u65f6\u95f4",prop:"update_time",name:"update_time",type:"normal",width:"auto"},{title:"\u521b\u5efa\u4eba",prop:"user_name",name:"user_name",type:"normal",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}]),Xa=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={distdata:[],total:0,combinedValue:[],page:1,limit:10,tabList:[{title:"\u6211\u7684\u6a21\u677f\u5217\u8868"}],DateTime:"",key_word:"",tableHeight:600,dataCount:0},n}return Object(y.a)(a,[{key:"componentDidUpdate",value:function(e,t){t.key_word==this.state.key_word||this.state.key_word||this.sureFn()}},{key:"sureFn",value:function(){this.setState({page:1}),this.setState({limit:10});var e={page:1,limit:10,title:this.state.key_word};this.getTableList(e)}},{key:"editFn",value:function(e,t){if(0==t.creator)return h.a.clear(),void h.a.error("\u7cfb\u7edf\u6a21\u677f\u4e0d\u53ef\u7f16\u8f91");sessionStorage.setItem("pageInfo",JSON.stringify(t)),sessionStorage.setItem("mouldType",1),sessionStorage.setItem("pageChange",1),window.location.href="/#/edittemplate"}},{key:"getTableList",value:function(e){var t=this;Object(s.Nb)(e).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({dataCount:e.total}),t.setState({distdata:e.data})}),(function(e){}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390});var e={page:this.state.page,limit:this.state.limit};this.state.combinedValue&&this.state.combinedValue[0]&&(e.begin_time=this.state.combinedValue[0],e.end_time=this.state.combinedValue[1]),this.getTableList(e)}},{key:"countChange",value:function(e){this.setState({page:1,limit:e});var t={page:e,limit:this.state.limit};this.getTableList(t)}},{key:"pageChange",value:function(e){this.setState({page:e});var t={page:e,limit:this.state.limit};this.state.key_word&&(t.title=this.state.key_word),this.getTableList(t)}},{key:"newTemplate",value:function(e){sessionStorage.setItem("pageInfo",null);var t=window.location.href.replace(window.location.hash,"#/home/mytempMould");window.open(t,"_blank")}},{key:"delFn",value:function(e,t){var a=this;if(0!=t.creator){var n=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:[" ","\u662f\u5426\u5220\u9664 ",Object(b.jsxs)("b",{children:[" [",t.title,"] "]}),"\uff1f"]}),onConfirm:function(){Object(s.C)(t.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t);var i={page:a.state.page,limit:a.state.limit,title:a.state.key_word};n.getTableList(i)}),(function(e){}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}else h.a.error("\u7cfb\u7edf\u6a21\u677f\u4e0d\u53ef\u5220\u9664")}},{key:"render",value:function(){var e=this,t=this.state;t.current,t.pageSize;return Object(b.jsxs)("div",{id:"exchangecodelist",children:[Object(b.jsxs)(It,{tabs:this.state.tabList,children:[Object(b.jsxs)("div",{className:"codetable dflexj",children:[Object(b.jsxs)(m.a,{type:"primary",icon:"plus",onClick:function(t){e.newTemplate(t)},children:["\u65b0\u589e\u6a21\u677f"," "]})," "," ",Object(b.jsx)(r.a,{onClearItem:function(t){e.setState({key_word:""})},wordSearch:this.sureFn.bind(this),onChange:function(t){return e.setState({key_word:t})},value:this.state.key_word,icon:"search",placeholder:"\u8bf7\u8f93\u5165\u5173\u952e\u5b57\u8fdb\u884c\u5339\u914d\u67e5\u8be2",countShow:!1,height:"36px",width:"260px",alignment:"left"})," "]})," ",Object(b.jsxs)("div",{className:"code-table",children:[Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.distdata,Column:Za,maxheight:this.state.tableHeight,countbarVisible:!1,isSwitch:!1,page:this.state.page,dataCount:this.state.dataCount,isMultiple:!1,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"thumb"==t?Object(b.jsxs)(ma.a,{trigger:"hover",position:"right-center",content:Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"375px",transform:"scale(.8)"}}),children:[" ",Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"30px",height:"30px"}})," "]}):"client"==t?Object(b.jsxs)("span",{children:[" ",Object(b.jsx)("font",{className:"icon",style:{background:qt.pageTypeStatusBg(parseInt(a.page))},children:" "}),qt.pageTypeStatus(parseInt(a.page))]}):"edit"==t?Object(b.jsxs)("span",{children:[Object(b.jsxs)("a",{className:"grid-link",onClick:function(t){e.editFn(t,a)},children:[" ","\u7f16\u8f91"," "]})," ",Object(b.jsxs)("a",{onClick:function(t){e.delFn(t,a)},className:"grid-link",children:[" ","\u5220\u9664"," "]})]}):void 0}})," "]})," "]})," "]})}}]),a}(u.a.Component),en=(a(302),a(303)),tn={1:"access_conf",3:"exchange",4:"coupon",8:"coupon"},an=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{id:0,title:"H5"}],sourceList:[{id:0,title:"\u7cfb\u7edf\u63a8\u8350\u6a21\u677f"},{id:1,title:"\u6211\u7684\u6a21\u677f"}],typeList:[{id:-1,title:"\u5168\u90e8"}],tabIndex:0,sourceIndex:0,page:1,typeIndex:0,showPage:1,activeHeight:667,showType:1,previewData:{},moudleData:{},previewwhite:{},previewexchange:{},system_template:[],pageStep:1,fontSize:1e4/281.25,preview_visible:!1,topbar:"",setStyle:{width:"375px",height:"667px",transform:"scale(0.75)"},top:"",toTopshow:!1,toTopFlag:!1,endreq:!0,center:"",bottom:"",detailType:3},n}return Object(y.a)(a,[{key:"onpageChange",value:function(e){this.setState({showPage:e.target.value,pageStep:e.target.value,detailType:3})}},{key:"ondetailTypeChange",value:function(e){this.setState({detailType:e.target.value,pageStep:e.target.value})}},{key:"onTypeChange",value:function(e){this.setState({showType:e.target.value,pageStep:1,showPage:1,detailType:3});var t=Object(ye.a)(this.state.moudleData)[tn[e.target.value]];t||(t={land:{describe:{}},product_list:{list:"",describe:{}},product_detail:{describe:{}}}),this.setState({previewData:t})}},{key:"componentDidMount",value:function(){var e=this,t=this;Object(s.Qb)().then((function(e){Object(s.cc)(e,(function(){var a=e.data.map((function(e){return{id:e.id,title:e.name}})),n=t.state.typeList.concat(a);t.setState({typeList:n})}),(function(){}))})).catch((function(){}));Object(s.Mb)({page:1,limit:10}).then((function(t){Object(s.cc)(t,(function(t){e.setState({system_template:t.data})}),(function(){}))})).catch((function(){})),this.refs.component.addEventListener("scroll",(function(t){var a=t.target.scrollTop,n=e.state.endreq;if(a>300){e.setState({toTopFlag:!0,toTopshow:!1});var i=t.target.scrollHeight-t.target.clientHeight;if(Math.round(i)==Math.round(t.target.scrollTop)&&n){var c=e.state.system_template,o=e.state.page,r={page:o+=1,limit:10};0==e.state.sourceIndex?(0!=e.state.typeIndex&&(r.type_id=e.state.typeIndex),Object(s.Mb)(r).then((function(t){Object(s.cc)(t,(function(t){if(00){var a=c.concat(t.data);e.setState({system_template:a,page:o})}else e.setState({endreq:!1})}),(function(){}))})).catch((function(){}))}}else e.setState({toTopFlag:!1})}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("scroll",this.bindHandleScroll)}},{key:"createBox",value:function(){sessionStorage.removeItem("pageInfo"),sessionStorage.setItem("mouldType",1),window.location.href="/#/edittemplate"}},{key:"typeClick",value:function(e){var t=this;this.setState({typeIndex:e,page:1,endreq:!0});var a={page:1,limit:10};e&&(a.type_id=e),Object(s.Mb)(a).then((function(e){Object(s.cc)(e,(function(e){t.setState({system_template:e.data}),e.data.length<10&&t.setState({endreq:!1})}),(function(){}))})).catch((function(){}))}},{key:"sourceClick",value:function(e){var t=this;this.setState({sourceIndex:e,page:1,endreq:!0});var a={page:1,limit:10};0==e?Object(s.Mb)(a).then((function(e){Object(s.cc)(e,(function(e){t.setState({system_template:e.data})}),(function(){}))})).catch((function(){})):Object(s.Nb)(a).then((function(e){Object(s.cc)(e,(function(e){t.setState({system_template:e.data})}),(function(){}))})).catch((function(){}))}},{key:"onPreview",value:function(e){var t;(t=1==this.state.sourceIndex?e[tn[e.page]]:e.exchange)||(t={land:{describe:{}},product_list:{list:"",describe:{}},product_detail:{describe:{}}}),this.setState({preview_visible:!0,previewData:t,showType:e.page,moudleData:e,showPage:1,pageStep:1,activeHeight:667,setStyle:{width:"375px",height:"667px",transform:"scale(0.75)"}})}},{key:"onUse",value:function(e,t){0!=e.edit?0==this.state.sourceIndex?Object(s.p)(e.id).then((function(a){Object(s.cc)(a,(function(a){e.id=a.id,sessionStorage.setItem("pageInfo",JSON.stringify(e)),sessionStorage.setItem("isSort",0),sessionStorage.setItem("pageChange",0),sessionStorage.setItem("mouldType",1),window.location.href=t?"/#/edittemplate?type="+t:"/#/edittemplate?type="+e.page}),(function(){}))})).catch((function(){})):(sessionStorage.setItem("pageInfo",JSON.stringify(e)),sessionStorage.setItem("pageChange",1),sessionStorage.setItem("mouldType",1),window.location.href=t?"/#/edittemplate?type="+t:"/#/edittemplate?type="+e.page):h.a.error("\u8be5\u6a21\u677f\u662f\u5b9a\u5236\u6a21\u677f\u65e0\u6cd5\u7f16\u8f91")}},{key:"toTop",value:function(){this.refs.component.scrollTo({top:0,behavior:"smooth"})}},{key:"onBack",value:function(){this.refs.preview.popPage()}},{key:"onClose",value:function(){this.setState({preview_visible:!1})}},{key:"mouseupFn",value:function(){this.setState({toTopshow:!0})}},{key:"mouseoverFn",value:function(){this.setState({toTopshow:!1})}},{key:"handleSize",value:function(e,t){var a={width:e+"px",height:t+"px",transform:"scale(0.75)"};this.setState({setStyle:a,activeHeight:t})}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{className:"mytemplate",children:Object(b.jsxs)("div",{className:"scroller-page",ref:"component",children:[Object(b.jsxs)("div",{className:"scroller-page-banner basic",children:[Object(b.jsxs)("div",{className:"scroller-page-banner-content",children:[Object(b.jsxs)("h1",{className:"title",children:["\u6a21\u677f\u4e2d\u5fc3",Object(b.jsx)("div",{className:"editor-type-basic-only",children:Object(b.jsx)("span",{className:"toggle-inner",children:Object(b.jsx)("i",{children:"(v2.0.0)"})})})]}),Object(b.jsx)("p",{className:"desc",children:"\u652f\u6301\u591a\u5e73\u53f0,\u591a\u573a\u666f\u4e30\u5bcc\u901a\u7528\u843d\u5730\u9875\u6a21\u677f,\u5e2e\u52a9\u4f7f\u7528\u8005\u66f4\u9ad8\u8f6c\u5316"})]}),Object(b.jsx)("div",{className:"scroller-page-banner-mask"})]}),Object(b.jsx)("div",{className:"scroller-page-body",children:Object(b.jsx)("div",{className:"scroller-page-body-content",children:Object(b.jsxs)("div",{className:"scroller-page-body-content-inner",children:[Object(b.jsx)("div",{className:"xj-simple-tabs scroller-page-tabs",children:this.state.tabList.map((function(t,a){return Object(b.jsx)("div",{className:e.state.tabIndex==a?" xj-simple-tabs-item active":" xj-simple-tabs-item",children:t.title},a)}))}),Object(b.jsxs)("div",{className:"block-selector-list-group",children:[Object(b.jsxs)("div",{className:"block-selector-list",children:[Object(b.jsx)("span",{className:"block-selector-list-label",children:"\u6765\u6e90\uff1a"}),Object(b.jsx)("div",{className:"block-selector",children:this.state.sourceList.map((function(t,a){return Object(b.jsx)("div",{className:e.state.sourceIndex==a?"block-selector-item active":"block-selector-item",onClick:function(){e.sourceClick(a)},children:t.title},a)}))})]}),0==this.state.sourceIndex?Object(b.jsxs)("div",{className:"block-selector-list",children:[Object(b.jsx)("span",{className:"block-selector-list-label",children:"\u5206\u7c7b\uff1a"}),Object(b.jsx)("div",{className:"block-selector",children:this.state.typeList.map((function(t,a){return Object(b.jsx)("div",{className:e.state.typeIndex==a?"block-selector-item active":"block-selector-item",onClick:function(){e.typeClick(a)},children:t.title},a)}))})]}):null,Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"xj-template-list",children:[Object(b.jsx)("div",{className:"xj-template-blank-card",children:Object(b.jsx)("div",{className:"xj-template-blank-card-content",children:Object(b.jsxs)("div",{className:"xj-template-blank-card-create-box",onClick:this.createBox,children:[Object(b.jsx)("div",{className:"xj-template-blank-card-icon-create",children:Object(b.jsx)("span",{children:"+"})}),Object(b.jsx)("div",{className:"xj-template-blank-card-text"})]})})}),this.state.system_template.map((function(t,a){return Object(b.jsxs)("div",{className:"xj-template-preview-card",children:[Object(b.jsx)("div",{className:"xj-template-preview-card-label",children:Object(b.jsx)("span",{children:t.title})}),Object(b.jsxs)("div",{className:"xj-template-preview-card-background",style:{backgroundImage:"url("+t.thumb+")",animationDuration:"10.7493s"},children:[Object(b.jsx)("div",{className:"xj-template-preview-card-tag",children:Object(b.jsx)("i",{className:""})}),Object(b.jsxs)("div",{className:"xj-template-preview-card-operation",children:[Object(b.jsxs)("a",{onClick:function(){e.onPreview(t)},children:[Object(b.jsx)("div",{className:"svg-icon-container",style:{width:"22px",height:"16px",marginRight:"8px"},children:Object(b.jsx)("div",{className:"svg-icon svg-icon-preview"})})," ","\u9884\u89c8"]}),Object(b.jsxs)("a",{onClick:function(){e.onUse(t)},children:[Object(b.jsx)("div",{className:"svg-icon-container",style:{width:"20px",height:"16px",marginRight:"8px"},children:Object(b.jsx)("div",{className:"svg-icon svg-icon-use"})})," ","\u4f7f\u7528"]})]})]})]},a)}))]}),this.state.toTopFlag?Object(b.jsx)("div",{ref:"toTop",className:"toTop-canvas",onMouseEnter:this.mouseupFn.bind(this),onMouseLeave:this.mouseoverFn.bind(this),children:Object(b.jsx)("img",{className:"toTopBtn",onClick:this.toTop.bind(this),src:this.state.toTopshow?"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/totopbtn.svg":"https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/willtotop.svg",alt:""})}):null,Object(b.jsx)("div",{style:{textAlign:"center",color:"#BBC1D2",marginBottom:"15px"},children:this.state.endreq?"\u6b63\u5728\u52a0\u8f7d\u4e2d...":"\u5230\u5e95\u90e8\u4e86\u54df,\u6ca1\u6709\u4e86\u54e6"})]})]})]})})}),this.state.preview_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal",style:{background:"rgba(0,0,0,0.8)",zIndex:999}}),Object(b.jsxs)("div",{className:"preview-box",children:[Object(b.jsx)(w.a,{type:"close",className:"preview-top-close",onClick:function(t){e.onClose(t)}}),Object(b.jsx)("div",{style:{height:"100%"},children:Object(b.jsxs)("div",{className:"previewComponent",children:[Object(b.jsx)("div",{className:"previewbody",children:Object(b.jsx)("div",{className:"ctorSize",style:this.state.setStyle,children:Object(b.jsx)(en.a,{data:this.state.previewData,pageType:this.state.showType,fontSize:this.state.fontSize,ref:"preview",step:this.state.pageStep})})}),Object(b.jsxs)("div",{className:"left-choice",children:[Object(b.jsxs)("div",{className:"exchange-page",children:[Object(b.jsx)("p",{className:"preview-setting",children:"\u843d\u5730\u9875\u9884\u89c8:"}),Object(b.jsxs)("section",{className:"screen-size-selector",children:[Object(b.jsxs)("div",{className:667==this.state.activeHeight?"size active":"size",onClick:function(){return e.handleSize(375,667)},children:["\u4e3b\u6d41\u673a\u578b",Object(b.jsx)("span",{children:"375x667"})]}),Object(b.jsxs)("div",{className:750==this.state.activeHeight?"size active":"size",onClick:function(){return e.handleSize(375,750)},children:["\u5168\u9762\u5c4f",Object(b.jsx)("span",{children:"375x750"})]}),Object(b.jsxs)("div",{className:812==this.state.activeHeight?"size active":"size",onClick:function(){return e.handleSize(375,812)},children:["\u5218\u6d77\u5c4f",Object(b.jsx)("span",{children:"375x812"})]}),Object(b.jsxs)("div",{className:500==this.state.activeHeight?"size active":"size",onClick:function(){return e.handleSize(375,500)},children:["\u5c0f\u5c4f\u624b\u673a",Object(b.jsx)("span",{children:"375x500"})]})]}),Object(b.jsx)("p",{children:"\u843d\u5730\u9875\u7c7b\u578b:"}),Object(b.jsxs)(te.a,{onChange:function(t){e.onTypeChange(t)},value:this.state.showType,children:[Object(b.jsx)(me.a,{value:3,disabled:1==this.state.sourceIndex,children:"\u5151\u6362\u7801"}),Object(b.jsx)(me.a,{value:1,disabled:1==this.state.sourceIndex,children:"\u767d\u540d\u5355"}),Object(b.jsx)(me.a,{value:4,disabled:1==this.state.sourceIndex,children:"\u4f18\u60e0\u5238"}),Object(b.jsx)(me.a,{value:8,disabled:1==this.state.sourceIndex,children:"\u4f18\u60e0\u5238\u767d\u540d\u5355"})]})]}),Object(b.jsxs)("div",{className:"exchange-page",children:[Object(b.jsx)("p",{children:"\u9875\u9762\u7c7b\u578b:"}),Object(b.jsxs)(te.a,{onChange:function(t){e.onpageChange(t)},value:this.state.showPage,children:[Object(b.jsx)(me.a,{value:1,children:"\u843d\u5730\u9875"}),Object(b.jsx)(me.a,{value:2,children:"\u5217\u8868\u9875"}),Object(b.jsx)(me.a,{value:3,children:"\u8be6\u60c5\u9875"})]})]}),3==this.state.showPage?Object(b.jsxs)("div",{className:"exchange-page",children:[Object(b.jsx)("p",{children:"\u8be6\u60c5\u9875\u5206\u7c7b:"}),Object(b.jsxs)(te.a,{onChange:function(t){e.ondetailTypeChange(t)},value:this.state.detailType,children:[Object(b.jsx)(me.a,{value:3,children:"\u6743\u2003\u76ca"}),Object(b.jsx)(me.a,{value:4,children:"\u7acb\u51cf\u91d1"}),Object(b.jsx)(me.a,{value:5,children:"\u7ea2\u5305"})]})]}):null,Object(b.jsx)("div",{className:"touse",children:Object(b.jsxs)(m.a,{type:"primary",onClick:function(){e.onUse(e.state.moudleData,e.state.showType)},children:[" ","\u4f7f\u7528"," "]})})]})]})})]})]}):null]})})}}]),a}(u.a.Component),nn=a(605),sn=[{title:"\u8ba2\u5355\u6587\u4ef6\u540d\u79f0",name:"file_name",prop:"file_name",type:"normal",width:"50%"},{title:"\u751f\u6210\u8fdb\u5ea6\u6761",prop:"progress",name:"progress",width:"30%",type:"slot"},{title:"\u64cd\u4f5c",name:"role",prop:"operation",type:"slot",defaultText:0,width:"20%"}],cn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u8ba2\u5355\u4e0b\u8f7d\u5217\u8868"}],orderList:[],tableHeight:500,page:1,limit:10,file_name:"",key_word:"",total:3,loading_visible:!1},n}return Object(y.a)(a,[{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-430})}},{key:"componentDidMount",value:function(){var e=this;this.getDownloadList(),Pa=setInterval((function(){e.getDownloadList()}),2e3)}},{key:"componentWillUnmount",value:function(){clearInterval(Pa)}},{key:"deleteFn",value:function(e){var t=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",e.file_name,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.J)({task_id:e.task_id}).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getDownloadList()}),(function(e){h.a.error(e)}))})).catch()},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getDownloadList()}),0)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getDownloadList()}),0)}},{key:"sureFn",value:function(){var e=this;this.setState({page:1}),setTimeout((function(){e.getDownloadList()}),0)}},{key:"exportFn",value:function(e){var t=this;this.setState({loading_visible:!0}),Object(s.sb)({task_id:e}).then((function(e){t.setState({loading_visible:!1}),function(e,t){var a=document.createElement("a");a.style.display="none",a.href=e,a.download=t||"",document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(e)}(e.data)})).catch((function(e){}))}},{key:"getDownloadList",value:function(){var e=this,t=this.state,a={page:t.page,limit:t.limit,file_name:t.file_name};Object(s.Xc)(a).then((function(t){Object(s.cc)(t,(function(t,a){t.data?(e.setState({total:t.total,orderList:t.data}),0===t.data.filter((function(e){return 100!==e.process})).length&&clearInterval(Pa)):e.setState({total:t.total,orderList:[]})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"statuStyle",value:function(e){var t;return e<"70"&&(t="normal"),"80"==e&&(t="normal"),"100"==e&&(t="success"),t}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"dislist",className:"orderList",children:Object(b.jsx)(It,{tabs:this.state.tabList,children:Object(b.jsxs)(ft.a,{loading:this.state.loading_visible,icon:"circle",iconSize:32,iconText:"\u4e0b\u8f7d\u4e2d...",className:"save_loading",children:[Object(b.jsx)("div",{className:"distable dflexajce",children:Object(b.jsx)(r.a,{labelWidth:0,onClearItem:function(t){e.setState({file_name:"",page:1}),setTimeout((function(){e.getDownloadList()}),0)},wordSearch:this.sureFn.bind(this),onChange:function(t){return e.setState({file_name:t})},value:this.state.file_name,icon:"search",placeholder:"\u8bf7\u8f93\u5165\u8ba2\u5355\u6587\u4ef6\u540d\u79f0\u641c\u7d22",countShow:!1,height:"36px",width:"260px",alignment:"left"})}),Object(b.jsx)("div",{className:"table-container",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.orderList,Column:sn,dataCount:this.state.total,itemcheck:this.state.itemcheck,allcheck:this.state.allcheck,isMultiple:!1,page:this.state.page,countbarVisible:!1,isSwitch:!1,ref:"orderList",maxheight:this.state.tableHeight,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},ComponentHandler:function(t,a){return"progress"==t?Object(b.jsx)(nn.a,{percent:a.process,status:e.statuStyle(a.process),width:180,strokeWidth:5,strokeLinecap:"round"}):"operation"==t?Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:100!==a.process?"grid-link disabled":"grid-link",onClick:function(t){100===a.process&&e.exportFn(a.task_id)},children:"\u4e0b\u8f7d"}),Object(b.jsx)("span",{className:100!==a.process?"grid-link ml15 disabled":"ml15 grid-link",onClick:function(t){100===a.process&&e.deleteFn(a)},children:"\u5220\u9664"})]}):void 0}})})]})})})}}]),a}(u.a.Component),on=[{title:"\u6587\u4ef6\u540d",name:"name",prop:"name",type:"normal",width:"auto"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",prop:"create_time",type:"normal",width:"220px"},{title:"\u751f\u6210\u72b6\u6001",name:"status",prop:"status",type:"slot",width:"100px"},{title:"\u64cd\u4f5c",name:"role",prop:"operation",type:"slot",defaultText:0,width:"20%"}],rn=function(){var e=Object(U.a)({tabList:[{title:"\u4e0b\u8f7d\u5217\u8868"}],loading:!1,page:1,limit:10,tableHeight:500,tableData:[],dataCount:0,isQuery:!1}),t=Object(i.a)(e,2),a=t[0],n=t[1],c=function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,i;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={page:a.page,limit:a.limit},e.next=3,Object(s.n)(t);case 3:i=e.sent,Object(s.cc)(i,(function(e,t){n({tableData:i.data.data,dataCount:i.data.total})}),(function(e){h.a.error(e)}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(d.useEffect)((function(){c()}),[]),Object(pt.a)((function(){c()}),[a.isQuery]);var o=function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){var a;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(s.m)(t);case 2:a=e.sent,Object(s.cc)(a,(function(e,t){window.location.href=a.data.download_url}),(function(e){h.a.error(e)}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(b.jsx)("div",{className:"key-container",id:"dislist",children:Object(b.jsx)(It,{tabs:a.tabList,style:{paddingBottom:0},children:Object(b.jsx)(ft.a,{loading:a.loading,icon:"circle",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:a.tableData,Column:on,countbarVisible:!1,maxheight:a.tableHeight,isSwitch:!1,isMultiple:!1,page:a.page,dataCount:a.dataCount,pageChange:function(e){return function(e){n({page:e,isQuery:!a.isQuery})}(e)},countChange:function(e){return function(e){n({limit:e,isQuery:!a.isQuery})}(e)},ComponentHandler:function(e,t){return"status"===e?function(e){switch(e){case 1:return Object(b.jsx)("span",{children:"\u5f85\u751f\u6210"});case 2:return Object(b.jsx)("span",{children:"\u751f\u6210\u4e2d"});case 3:return Object(b.jsx)("span",{children:"\u751f\u6210\u5b8c\u6210"});case 4:return Object(b.jsx)("span",{children:"\u751f\u6210\u5931\u8d25"});default:return 0}}(t.status):"operation"===e?Object(b.jsxs)("span",{children:[3===t.status?Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px"},onClick:function(){return o(t.id)},children:"\u4e0b\u8f7d"}):Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"#ccc"},children:"\u4e0b\u8f7d"}),3===t.status||4===t.status?Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"red"},onClick:function(){return e=t.id,void ee.a.confirm({title:"\u786e\u8ba4\u4fe1\u606f",content:Object(b.jsx)("p",{children:"\u786e\u8ba4\u5220\u9664\u8be5\u6570\u636e\uff1f"}),onConfirm:function(){var t=Object(j.a)(Object(f.a)().mark((function t(){return Object(f.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:Object(s.E)(e).then((function(e){Object(s.cc)(e,(function(t,i){200===e.code?(h.a.clear(),h.a.success(i),n({isQuery:!a.isQuery})):h.a.error(i)}),(function(e){h.a.error(e)}))}));case 1:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),onCancel:function(){},parentComponent:void 0});var e},children:"\u5220\u9664"}):Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"#ccc"},children:"\u5220\u9664"})]}):void 0}})})})})},ln=function(){var e=new Date;return e.setTime(e.getTime()-2592e5),e},dn=function(){return new Date};var un=a(527),hn=(a(305),[{title:"\u8ba2\u5355\u53f7",name:"order_number",prop:"order_number",type:"normal",width:"150px"},{title:"\u5305\u7801\u7ed3\u7b97\u8ba2\u5355ID",name:"settlement_no",prop:"settlement_no",type:"normal",width:"200px"},{title:"\u5151\u6362\u7801-\u6279\u6b21ID",name:"code_batch_id",prop:"code_batch_id",type:"normal",width:"80px"},{title:"\u5546\u54c1\u540d\u79f0",prop:"product_name",name:"product_name",width:"120px",type:"normal"},{title:"\u5b98\u65b9\u4ef7\u683c",name:"official_price",prop:"official_price",type:"normal",width:"80px"},{title:"\u5408\u540c\u4ef7(\u6210\u672c\u4ef7)",name:"cost",type:"slot",prop:"cost",width:"120px"},{title:"\u5236\u5238\u5546\u6237",name:"wechat_subject",prop:"wechat_subject",width:"50px",type:"slot"},{title:"\u5206\u9500\u5546",name:"reseller_name",type:"normal",prop:"reseller_name",width:"auto"},{title:"\u5f52\u5c5ekey\u6279\u6b21",name:"key_batch_id",prop:"key_batch_id",width:"80px",type:"normal"},{title:"\u5f52\u5c5e\u8425\u9500\u8ba1\u5212",name:"plan_title",prop:"plan_title",width:"auto",type:"normal"},{title:"\u8d2d\u4e70\u6570\u91cf",name:"num",type:"normal",prop:"num",width:"50px"},{title:"\u8ba2\u5355\u72b6\u6001",name:"statusDom",prop:"statusDom",type:"slot",width:"120px"},{title:"\u652f\u4ed8\u72b6\u6001",name:"pay_status",prop:"pay_status",type:"slot",width:"80px"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"220px"},{title:"\u6279\u6b21\u53f7",prop:"channel_activity_id",name:"channel_activity_id",type:"normal",width:"150px"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",prop:"create_time",width:"130px",type:"normal"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"status_modify_time",prop:"status_modify_time",width:"130px",type:"slot"},{title:"\u8d26\u53f7",name:"account",type:"slot",prop:"account",width:"auto"},{title:"\u5546\u54c1\u7c7b\u578b",name:"product_type",prop:"product_type",width:"50px",type:"slot"},{title:"\u8ba2\u5355\u7c7b\u578b",name:"order_type",prop:"order_type",width:"50px",type:"slot"},{title:"\u6838\u9500\u72b6\u6001",name:"usage_status",prop:"usage_status",width:"120px",type:"slot"},{title:"\u5931\u8d25\u539f\u56e0",name:"receive_error",prop:"receive_error",width:"150px",type:"slot"},{title:"\u51cf\u6263\uff08\u5143\uff09",name:"discount_amount",prop:"discount_amount",type:"normal",width:"80px"},{title:"\u5238\u540e\u4ef7\uff08\u5143\uff09",name:"pay_amount",prop:"pay_amount",type:"normal",width:"80px"},{title:"key",name:"key",prop:"key",width:"140px",type:"normal"}]),pn=[{key:"order_number",text:"\u8ba2\u5355\u53f7",placeholder:"\u8bf7\u8f93\u5165\u8ba2\u5355\u53f7\u67e5\u8be2"},{key:"key",text:"key\u67e5\u8be2",placeholder:"\u8bf7\u8f93\u5165key\u67e5\u8be2"},{key:"key_batch_id",text:"key\u6279\u6b21",placeholder:"\u8bf7\u8f93\u5165key\u6279\u6b21\u67e5\u8be2"},{key:"account",text:"\u5145\u503c\u8d26\u53f7",placeholder:"\u8bf7\u8f93\u5165\u5145\u503c\u8d26\u53f7\u67e5\u8be2"},{key:"cash_activity_id",text:"\u7ea2\u5305\u6279\u6b21\u53f7",placeholder:"\u8bf7\u8f93\u5165\u7ea2\u5305\u6279\u6b21\u53f7\u67e5\u8be2"},{key:"code_batch_id",text:"\u5151\u6362\u7801\u6279\u6b21ID",placeholder:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u6279\u6b21ID\u67e5\u8be2"},{key:"channel_activity_id",text:"\u7acb\u51cf\u91d1\u6279\u6b21\u53f7",placeholder:"\u8bf7\u8f93\u5165"},{key:"receive_user_id",text:"\u7ea2\u5305\u8ba2\u5355\u7528\u6237openId",placeholder:"\u8bf7\u8f93\u5165"},{key:"channel_user_id",text:"\u7acb\u51cf\u91d1\u8ba2\u5355\u7528\u6237openId",placeholder:"\u8bf7\u8f93\u5165"},{key:"settlement_no",text:"\u5305\u7801\u7ed3\u7b97\u8ba2\u5355ID",placeholder:"\u8bf7\u8f93\u5165"}],mn=[{id:0,label:"\u8ba2\u5355\u72b6\u6001",prop:"status",menuList:[{id:0,name:"\u76f4\u5145-\u5f85\u5145\u503c"},{id:1,name:"\u76f4\u5145-\u5145\u503c\u4e2d"},{id:2,name:"\u76f4\u5145-\u5df2\u5b8c\u6210"},{id:3,name:"\u76f4\u5145-\u5145\u503c\u5931\u8d25"},{id:4,name:"\u76f4\u5145-\u5df2\u53d6\u6d88"},{id:111,name:"\u7acb\u51cf\u91d1-\u5f85\u9886\u53d6"},{id:222,name:"\u7acb\u51cf\u91d1-\u5df2\u9886\u53d6"},{id:5,name:"\u7acb\u51cf\u91d1-\u5df2\u8fc7\u671f"},{id:6,name:"\u73b0\u91d1\u7ea2\u5305-\u5f85\u53d1\u653e"},{id:7,name:"\u73b0\u91d1\u7ea2\u5305-\u5df2\u6838\u9500"},{id:8,name:"\u73b0\u91d1\u7ea2\u5305-\u5df2\u8fc7\u671f"},{id:9,name:"\u73b0\u91d1\u7ea2\u5305-\u5df2\u5931\u8d25"}]},{id:1,label:"\u652f\u4ed8\u72b6\u6001",prop:"pay_status",menuList:[{id:1,name:"\u5f85\u652f\u4ed8"},{id:2,name:"\u5df2\u652f\u4ed8"},{id:3,name:"\u5df2\u9000\u6b3e"}]},{id:3,label:"\u6838\u9500\u72b6\u6001",prop:"voucher_status",menuList:[{id:1,name:"\u672a\u6838\u9500"},{id:2,name:"\u5df2\u6838\u9500"},{id:3,name:"\u5df2\u8fc7\u671f"},{id:4,name:"\u5df2\u9000\u6b3e"},{id:7,name:"\u90e8\u5206\u9000\u56de"},{id:8,name:"\u5df2\u9000\u56de"}]}],bn={account:[{type:"required",message:"\u8bf7\u8f93\u5165\u8d26\u53f7"}]},fn=[{title:"\u4ea4\u6613\u53f7",name:"trade_no",prop:"trade_no",type:"normal",width:"200px"},{title:"\u6e20\u9053",name:"channel",prop:"channel",type:"slot",width:"150px"},{title:"\u6e20\u9053\u7acb\u51cf\u91d1\u6279\u6b21\u53f7",prop:"channel_activity_id",name:"channel_activity_id",type:"normal",width:"150px"},{title:"\u6e20\u9053\u7528\u6237ID",name:"channel_user_id",prop:"trade_no",type:"normal",width:"150px"},{title:"\u5238ID",name:"channel_voucher_id",prop:"channel_voucher_id",type:"normal",width:"150px"},{title:"\u7acb\u51cf\u91d1\u9886\u53d6\u65f6\u95f4",name:"grant_time",prop:"grant_time",type:"normal",width:"150px"},{title:"\u72b6\u6001",name:"status",prop:"status",type:"slot",width:"100px"},{title:"\u6838\u9500\u65f6\u95f4",name:"usage_time",prop:"usage_time",type:"normal",width:"150px"},{title:"\u9000\u6b3e\u65f6\u95f4",name:"refund_time",prop:"refund_time",type:"normal",width:"150px"},{title:"\u53d1\u5238\u65b9\u5f0f",name:"receive_mode",prop:"receive_mode",type:"slot",width:"150px"},{title:"\u9886\u53d6\u5931\u8d25\u539f\u56e0",name:"receive_error",prop:"receive_error",type:"normal",width:"150px"},{title:"\u652f\u4ed8\u5b9d\u9886\u53d6\u7ed3\u679c",name:"query_text",prop:"query_text",type:"normal",width:"150px"},{title:"\u64cd\u4f5c",name:"role",prop:"operation",type:"slot",width:"150px",fixed:"right"}],jn=a(76),gn=jn(dn()).format("YYYY-MM-DD"),yn=jn(ln()).format("YYYY-MM-DD"),_n=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={orderType:"",tabList:[{title:"\u8ba2\u5355\u5217\u8868"}],orderList:[],filterList:mn,selectiondata:[],menuList:[{id:0,name:"\u8ba2\u5355\u72b6\u6001",check:!1},{id:1,name:"\u652f\u4ed8\u72b6\u6001",check:!1}],allcheck:!1,itemcheck:!1,menuVisible:!1,combinedValue:[],tableHeight:500,status:null,pay_status:null,voucher_status:null,planOptions:[],resellerOptions:[],productOptions:[],page:1,limit:10,key_word:"",officialprice:0,contractprice:0,costprice:0,totalprice:0,placeholder:"\u8bf7\u8f93\u5165key\u67e5\u8be2",visible:!1,showLqDetail:!1,model:{account:""},search:n.initSearch(),detailDatasets:[]},n.onChangeCombinedDate=n.onChangeCombinedDate.bind(Object(Xt.a)(n)),n}return Object(y.a)(a,[{key:"initSearch",value:function(){return{plan_id:"",reseller_id:"",product_id:""}}},{key:"searchChange",value:function(e,t){var a=this.state.search;a[e]=t,this.setState({search:a})}},{key:"selection",value:function(e){this.setState({selectiondata:e});var t=0,a=0,n=0,i=0;e.forEach((function(e){t+=Number(e.official_price),a+=Number(e.contract_price),n+=Number(e.cost_price),i+=Number(e.total)})),this.setState({officialprice:t,contractprice:a,costprice:n,totalprice:i})}},{key:"getPlan",value:function(){var e=this;Object(s.yb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.title}}));e.setState({planOptions:n})}),(function(e){}))})),Object(s.Bb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.name}}));e.setState({resellerOptions:n})}))}))}},{key:"getProducts",value:function(e){var t=this;Object(s.bc)(e).then((function(e){return Object(s.cc)(e,(function(e,a){var n=e.map((function(e){return{key:e.goods_id,text:e.goods_name}}));t.setState({productOptions:n})}),(function(e){}))}))}},{key:"handlerRefundFunction",value:function(){var e=this;this.refs.form.validator()&&Object(s.dc)(this.state.orderNumber,{refund_account:this.state.model.account}).then((function(t){Object(s.cc)(t,(function(t,a){h.a.clear(),h.a.success(a),e.setState({visible:!1})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"refundFunction",value:function(e){Object(s.dd)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"exportFn",value:function(){var e=this.state,t=e.status,a=e.orderType,n=e.option,i=e.key_word,c=e.pay_status,o=e.voucher_status,r=e.search,l=r.plan_id,d=r.product_id,u=r.reseller_id,p={};if(p.plan_id=l?l.key:"",p.product_id=d?d.key:"",p.reseller_id=u?u.key:"",a&&t&&(p.type=a),this.state.combinedValue&&this.state.combinedValue[0]&&(p.begin_time=this.state.combinedValue[0],p.end_time=this.state.combinedValue[1]),null!==t&&void 0!==t&&t.length&&(p.status=null===t||void 0===t?void 0:t.join(",")),null!==c&&void 0!==c&&c.length&&(p.pay_status=null===c||void 0===c?void 0:c.join(",")),null!==o&&void 0!==o&&o.length&&(p.voucher_status=null===o||void 0===o?void 0:o.join(",")),n&&(p[n.key]=i),this.state.selectiondata&&this.state.selectiondata.length>0){var m=this.state.selectiondata.map((function(e){return e.order_number}));p.order_numbers=m.join(",")}var f=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u5bfc\u51fa\u8ba2\u5355\uff1f"}),onConfirm:function(){Object(s.tb)(p).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),f.props.history.push("/home/download-orderlist")}),(function(e){h.a.error(e)}))})).catch((function(e){h.a.error(e.message)}))},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"deleteFn",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u4f5c\u5e9f",Object(b.jsxs)("b",{children:["[",t.order_number,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.Mc)(t.order_number).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getOrderFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"changeSuccessFn",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5c06",Object(b.jsxs)("b",{children:["[",t.order_number,"]"]}),"\u8ba2\u5355\u6539\u4e3a\u6210\u529f\u72b6\u6001\uff1f"]}),onConfirm:function(){Object(s.Nc)(t.order_number).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getOrderFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"moreFn",value:function(e,t){window.open("#/home/order-addetails?oid="+t.order_number),sessionStorage.setItem("pathname2","/home/order-addetails");sessionStorage.setItem("breaknav",JSON.stringify([{items:[{path:"/home/order-list",name:"\u8ba2\u5355\u7ba1\u7406"},{path:"/home/order-addetails",name:"\u8ba2\u5355\u8be6\u60c5"}]}]))}},{key:"clearFn",value:function(){this.setState({allcheck:!1,selectiondata:[],itemcheck:!1})}},{key:"onChangeCombinedDate",value:function(e){var t=this;this.setState({combinedValue:e,page:1,limit:10,selectiondata:[]},(function(){t.getOrderFn()}))}},{key:"pageChange",value:function(e){var t=this;this.setState({selectiondata:[],page:e},(function(){t.getOrderFn()}))}},{key:"countChange",value:function(e){var t=this;this.setState({selectiondata:[],page:1,limit:e},(function(){t.getOrderFn()}))}},{key:"dynamicVoucher",value:function(){3===this.state.menuList.length&&this.refs.filterBar.onCloseSelect("",3,"voucher_status"),this.setState({menuList:[{id:0,name:"\u8ba2\u5355\u72b6\u6001",check:!1},{id:1,name:"\u652f\u4ed8\u72b6\u6001",check:!1}]})}},{key:"onFilterClose",value:function(e){"status"===e&&this.dynamicVoucher();var t={};t[e]=null,this.setState(t),this.setState({orderType:null})}},{key:"getOrderFn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,a=t.state,n=a.page,i=a.limit,c=a.status,o=a.option,r=a.key_word,l=a.orderType,d=a.pay_status,u=a.voucher_status,p=a.search,m=p.plan_id,b=p.product_id,f=p.reseller_id,j={page:n,limit:i,plan_id:m?m.key:"",product_id:b?b.key:"",reseller_id:f?f.key:""};l&&(j.type=l),this.state.combinedValue&&this.state.combinedValue[0]&&(j.begin_time=this.state.combinedValue[0],j.end_time=this.state.combinedValue[1]),e&&e[0]&&(j.begin_time=e[0],j.end_time=e[1]),e&&null==e[0]&&e.length>1&&(delete j.begin_time,delete j.end_time),o&&(j[o.key]=r),null!==c&&void 0!==c&&c.length&&(j.status=null===c||void 0===c?void 0:c.join(",")),null!==d&&void 0!==d&&d.length&&(j.pay_status=null===d||void 0===d?void 0:d.join(",")),null!==u&&void 0!==u&&u.length&&(j.voucher_status=null===u||void 0===u?void 0:u.join(",")),Object(s.ub)(j).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.data,i=e.total;t.setState({orderList:n,total:i})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){var e=[yn+" 00:00:00",gn+" 23:59:59"];this.getOrderFn(e),this.getPlan(),this.setState({tableHeight:window.innerHeight-490,combinedValue:e})}},{key:"selectedId",value:function(e,t){if("status"===t){Object(un.a)([111,222,5],e).length>0?this.setState({menuList:[{id:0,name:"\u8ba2\u5355\u72b6\u6001",check:!1},{id:1,name:"\u652f\u4ed8\u72b6\u6001",check:!1},{id:3,name:"\u6838\u9500\u72b6\u6001",check:!1}]}):this.dynamicVoucher()}var a={},n=[];e.length&&"status"===t&&(e.map((function(t,a){[6,7,8,9].includes(t)?n.push(3):[111,222,5].includes(t)?n.push(2):n.push(1),111===t&&(e[a]=1),[222,7].includes(t)&&(e[a]=2),9===t&&(e[a]=3),6===t&&(e[a]=0),8===t&&(e[a]=5)})),n=Object(ce.a)(new Set(n)).join(","),this.setState({orderType:n})),e.length<1&&"status"===t&&this.setState({orderType:""}),a[t]=e,this.setState(a),this.setState({page:1})}},{key:"usageFunction",value:function(e){switch(e){case 1:case 5:case 6:return"\u672a\u6838\u9500";case 2:return"\u5df2\u6838\u9500";case 3:return"\u5df2\u8fc7\u671f";case 4:return"\u5df2\u9000\u6b3e";case 7:return"\u90e8\u5206\u9000\u56de";case 8:return"\u5df2\u9000\u56de";default:return"-"}}},{key:"sendSms",value:function(e){var t=e.order_number;Object(s.ed)({order_number:t}).then((function(e){var t=e.code,a=e.message;h.a.clear(),200===t?h.a.success(a):h.a.error(a)}))}},{key:"handlerReceiveRetry",value:function(e){var t=this;Object(s.cd)({order_number:e}).then((function(e){var a=e.code,n=e.message;h.a.clear(),200===a?(h.a.success(n),t.getOrderFn()):h.a.error(n)}))}},{key:"componentDidUpdate",value:function(e,t){t.status!=this.state.status&&this.getOrderFn(),t.pay_status!=this.state.pay_status&&this.getOrderFn(),t.voucher_status!=this.state.voucher_status&&this.getOrderFn()}},{key:"reset",value:function(){var e=this;this.setState({search:this.initSearch(),page:1,limit:10,key_word:"",placeholder:"",option:""},(function(){return e.getOrderFn()}))}},{key:"menuItemClick",value:function(e,t){var a=this;0==e?Object(s.td)({order_number:t}).then((function(e){var t=e.code,n=e.message;h.a.clear(),200===t?(a.getOrderFn(),h.a.success(n)):h.a.error(n)})):Object(s.kc)({order_number:t,event:e}).then((function(e){var t=e.code,a=e.message;h.a.clear(),200===t?h.a.success(a):h.a.error(a)}))}},{key:"getVoucher",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){var a;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,Object(s.Sb)(t);case 3:200===(a=e.sent).code?this.setState({showLqDetail:!0,detailDatasets:a.data}):h.a.error(a.message);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getAlipayDetail",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){var a,n,i;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,Object(s.bd)(t);case 3:200===(a=e.sent).code?(n=this.state.detailDatasets,-1!==(i=n.findIndex((function(e){return e.id===t})))&&(n[i].query_text=a.data.query_text,this.setState({detailDatasets:n}))):h.a.error(a.message);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=Object(b.jsx)(Bt.a,{className:"zent-datepicker-demo",value:this.state.combinedValue,showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",onChange:this.onChangeCombinedDate});return Object(b.jsxs)("div",{id:"dislist",className:"orderList",children:[Object(b.jsxs)(It,{tabs:this.state.tabList,slot:t,children:[Object(b.jsxs)("div",{className:"order-query",children:[Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u540d\u79f0\uff1a",required:"",labelwidth:"95px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.plan_id,options:this.state.planOptions,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(t){e.searchChange("plan_id",t),t?e.getProducts(t.key):(e.setState({productOptions:[]}),e.searchChange("product_id",""))}})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u540d\u79f0\uff1a",required:"",labelwidth:"100px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.product_id,options:this.state.productOptions,placeholder:"\u8bf7\u5148\u9009\u62e9\u8ba1\u5212",width:204,clearable:!0,onChange:function(t){e.searchChange("product_id",t)}})}),Object(b.jsx)(c.a,{labelname:"\u5206\u9500\u5546\u540d\u79f0\uff1a",required:"",labelwidth:"120px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.reseller_id,options:this.state.resellerOptions,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(t){e.searchChange("reseller_id",t)}})}),Object(b.jsx)(c.a,{labelname:"\u591a\u529f\u80fd\u67e5\u8be2\uff1a",required:"",labelwidth:"120px",children:Object(b.jsx)(ne.a,{width:"204px",value:this.state.option,style:{marginBottom:"5px"},onChange:function(t){return e.setState({option:t,key_word:"",placeholder:t&&t.placeholder})},disableSearch:!0,options:pn,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u67e5\u8be2\u5206\u7c7b"})}),this.state.option?Object(b.jsx)(c.a,{labelname:"",required:"",labelwidth:"0",children:Object(b.jsx)(r.a,{className:"query-ip",labelWidth:0,onClearItem:function(t){e.setState({key_word:""})},onChange:function(t){return e.setState({key_word:t})},value:this.state.key_word,placeholder:this.state.placeholder,countShow:!1,height:32,width:270})}):null,Object(b.jsx)(c.a,{labelname:"",required:"",labelwidth:"0",children:Object(b.jsxs)("div",{style:{width:"200px"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){e.setState({page:1},(function(){e.getOrderFn()}))},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){return e.reset()},children:"\u91cd\u7f6e"})]})})]}),Object(b.jsx)(m.a,{className:"exportOrder",type:"default",icon:"download",onClick:this.exportFn.bind(this),children:"\u5bfc\u51fa\u8ba2\u5355"})]}),Object(b.jsx)(ia,{onClose:function(t){e.onFilterClose(t)},selectFn:function(t,a){e.selectedId(t,a)},ref:"filterBar",multiple:!0,filterList:this.state.filterList,menuList:this.state.menuList}),Object(b.jsxs)("div",{children:[this.state.selectiondata.length>0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:this.clearFn.bind(this),children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:this.state.selectiondata.length}),"\u9879\uff0c\u5b98\u65b9\u4ef7\u91d1\u989d\u603b\u8ba1\uffe5",this.state.officialprice.toFixed(4),"\uff0c\u5408\u540c\u4ef7\u91d1\u989d\u603b\u8ba1\uffe5",this.state.contractprice.toFixed(4),"\uff0c\u6210\u672c\u4ef7\u91d1\u989d\u603b\u8ba1\uff1a\uffe5",this.state.costprice.toFixed(4),"\uff0c\u7ed3\u7b97\u4ef7\u91d1\u989d\u603b\u8ba1\uff1a\uffe5",this.state.totalprice.toFixed(4)]}):null,Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.orderList,Column:hn,dataCount:this.state.total,itemcheck:this.state.itemcheck,allcheck:this.state.allcheck,isMultiple:!0,page:this.state.page,countbarVisible:!1,isSwitch:!1,ref:"orderList",maxheight:this.state.tableHeight,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(t,a){return"cost"==t?Object(b.jsxs)("span",{children:[a.contract_price,"(",1===a.type?a.cost_price:a.official_price,")"]}):"account"==t?Object(b.jsx)("span",{children:a.account||"-"}):"statusDom"==t?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.orderStatusBg(a)}}),a.status_text,2===a.type&&[1,2].includes(a.status)?"\uff08".concat(a.received_num,"/").concat(a.num,"\uff09"):""]})}):"pay_status"==t&&1===a.use_coupon?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.orderPayStatusBg(1===a.pay_status?"":parseInt(a.pay_status))}}),a.pay_status_text]})}):"order_type"==t?Object(b.jsx)("span",{children:"\u865a\u62df"}):"receive_error"==t?Object(b.jsx)("span",{children:a.orderVoucher?a.orderVoucher.receive_error:"-"}):"usage_status"==t?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.orderVoucherStatusBg(parseInt(a.orderVoucher?a.orderVoucher.status:0))}}),e.usageFunction(null===(n=a.orderVoucher)||void 0===n?void 0:n.status),2===a.type&&2===(null===(i=a.orderVoucher)||void 0===i?void 0:i.status)?"\uff08".concat(a.used_num,"/").concat(a.num,"\uff09"):""]})}):"status_modify_time"==t?Object(b.jsx)("span",{children:3==a.type?a.update_time:(null===(s=a.orderVoucher)||void 0===s?void 0:s.status_modify_time)||"-"}):"wechat_subject"==t?Object(b.jsx)(b.Fragment,{children:a.wechat_subject||"-"}):"product_type"==t?Object(b.jsx)("span",{children:1===a.type&&2==a.product_type?"\u5361\u5bc6":1==a.type?"\u76f4\u51b2":2==a.type?"\u7acb\u51cf\u91d1":3==a.type?"\u5151\u6362\u7801\u73b0\u91d1\u7ea2\u5305":"-"}):"opearo"==t?Object(b.jsxs)("div",{children:[2===a.type&&1===a.product.entity.channel?Object(b.jsx)("span",{className:"grid-link",onClick:function(){return e.getVoucher(a.order_number)},children:"\u9886\u53d6\u660e\u7ec6"}):null,Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.moreFn(t,a)},children:"\u8be6\u60c5"}),2!=a.type&&(1==a.status||0==a.status&&1==a.type||6==a.status||0==a.status&&3==a.type)?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.deleteFn(t,a)},children:"\u4f5c\u5e9f"}):null,2!=a.type&&(1==a.status||0==a.status&&3==a.type)&&Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.changeSuccessFn(t,a)},children:"\u6539\u4e3a\u6210\u529f"}),3==a.status&&2==a.pay_status?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("span",{className:"grid-link",onClick:function(){return e.refundFunction(a.order_number)},children:"\u91cd\u8bd5\u9000\u6b3e"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.setState({orderNumber:a.order_number,visible:!0})},children:"\u624b\u52a8\u9000\u6b3e"})]}):null,2===a.type&&[1,2].includes(a.status)&&a.received_num!==a.num?Object(b.jsx)("span",{className:"grid-link",onClick:function(){return e.handlerReceiveRetry(a.order_number)},children:"\u91cd\u8bd5\u9886\u53d6"}):null,1==a.type&&2==a.product_type&&1==a.product.card_show&&2==a.status&&Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.sendSms(a)},children:"\u53d1\u9001\u5361\u5bc6\u77ed\u4fe1"}),Object(b.jsxs)(I.a,{position:I.d.RightTop,visible:e.state.menuVisible,onVisibleChange:function(t){return e.setState({visible1:t})},children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore grid-link",children:["\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(t,n){return e.menuItemClick(n,a.order_number)},children:[a.notifyEvent&&a.notifyEvent.map((function(e){return Object(b.jsx)(F.a,{disabled:2==e.disable,children:e.name},e.event)})),2===a.type&&a.orderVoucher&&1===a.orderVoucher.status&&Object(b.jsx)(F.a,{children:"\u6838\u9500\u67e5\u8be2"},0)]})})]})]}):void 0;var n,i,s}})]}),Object(b.jsxs)(ge.a,{visible:this.state.visible,className:"questModal refundForm",onClose:function(){return e.setState({visible:!1})},title:"\u9000\u6b3e",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:bn,ref:"form",children:[Object(b.jsx)(c.a,{labelname:"\u9000\u6b3e\u8d26\u53f7",id:"account",prop:"account",labelwidth:"80px",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.account=t,e.setState({model:a})},onClearItem:function(){var t=e.state.model;t.account="",e.setState({model:t})},value:this.state.model.account,placeholder:"",labelWidth:"0px",maxLength:40,height:"36px",unit:"",countShow:!1,width:"300px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"",id:"account-none",prop:"account",children:Object(b.jsx)(r.a,{onChange:function(e){},onClearItem:function(){},value:this.state.model.account,placeholder:"",labelWidth:"0px",maxLength:40,height:"36px",unit:"",countShow:!1,width:"520px",alignment:"left"})})]}),Object(b.jsxs)("p",{className:"dflexajce",children:[Object(b.jsx)(m.a,{onClick:function(){return e.setState({visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.handlerRefundFunction()},htmlType:"submit",children:"\u63d0\u4ea4"})]})]})]}),Object(b.jsx)(ge.a,{className:"zent-dialog-demo-basic-dialog",visible:this.state.showLqDetail,style:{width:"1000px"},maskClosable:!1,onClose:function(){return e.setState({showLqDetail:!1})},footer:Object(b.jsx)(b.Fragment,{children:Object(b.jsx)(m.a,{onClick:function(){return e.setState({showLqDetail:!1})},children:"\u5173\u95ed"})}),title:"\u9886\u53d6\u660e\u7ec6",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.detailDatasets,maxheight:this.state.tableHeight,Column:fn,isMultiple:!1,isSwitch:!1,countbarVisible:!1,isShowPageBar:!1,ComponentHandler:function(t,a,n){return"account"==t?Object(b.jsx)("span",{children:a.account||"-"}):"channel"==t?function(e){switch(e){case 1:return Object(b.jsx)("span",{children:"\u652f\u4ed8\u5b9d"});case 2:return Object(b.jsx)("span",{children:"\u5fae\u4fe1"});case 3:return Object(b.jsx)("span",{children:"\u4e91\u95ea\u4ed8"});default:return"-"}}(a.channel):"status"==t?function(e){switch(e){case 1:return Object(b.jsx)("span",{children:"\u53ef\u7528"});case 2:return Object(b.jsx)("span",{children:"\u5df2\u5b9e\u6263"});case 3:return Object(b.jsx)("span",{children:"\u5df2\u8fc7\u671f"});case 4:return Object(b.jsx)("span",{children:"\u5df2\u9000\u6b3e"});case 5:return Object(b.jsx)("span",{children:"\u9886\u53d6\u5931\u8d25"});case 6:return Object(b.jsx)("span",{children:"\u53d1\u653e\u4e2d"});case 7:return Object(b.jsx)("span",{children:"\u90e8\u5206\u9000\u6b3e"});case 8:return Object(b.jsx)("span",{children:"\u5df2\u9000\u56de(\u5168\u989d\u9000)"});default:return"-"}}(a.status):"receive_mode"==t?function(e){switch(e){case 1:return Object(b.jsx)("span",{children:"\u6e20\u9053\u6388\u6743\u7528\u6237id"});case 2:return Object(b.jsx)("span",{children:"\u624b\u673a\u53f7\u6216\u90ae\u7bb1"});default:return"-"}}(a.receive_mode):"voucher_batch"==t?Object(b.jsx)(b.Fragment,{children:e.voucherBatchForEl(a)}):"operation"==t&&1==a.channel?Object(b.jsx)("span",{className:"grid-link",onClick:function(){return e.getAlipayDetail(a.id)},children:"\u67e5\u8be2\u652f\u4ed8\u5b9d\u9886\u53d6\u7ed3\u679c"}):void 0}})})]})}}]),a}(u.a.Component),vn=a(208),xn=a.n(vn),On=(a(308),[{title:"\u5e8f\u53f7",name:"index",prop:"index",type:"slot",width:"20%"},{title:"\u521b\u5efa\u65f6\u95f4",name:"time",prop:"time",type:"slot",width:"20%"},{title:"\u64cd\u4f5c\u63cf\u8ff0",name:"message",prop:"message",type:"normal",width:"20%"},{title:"\u8be6\u60c5",name:"opearo",type:"slot",prop:"opearo",width:"50%"}]),kn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u8be6\u60c5"},{title:"\u65e5\u5fd7"}],tabactive:0,orderDetailLog_data:[],orderDetail_data:{},tableHeight:500,page:1,orderNo:"",limit:10,total:0},n}return Object(y.a)(a,[{key:"tabFn",value:function(e){this.setState({tabactive:e});var t=[];t=0==e?[{items:[{path:"/order-list",name:"\u8ba2\u5355\u7ba1\u7406"},{path:"/order-addetails",name:"\u8ba2\u5355\u8be6\u60c5"}]}]:[{items:[{path:"/order-list",name:"\u8ba2\u5355\u7ba1\u7406"},{path:"/order-addetails",name:"\u8ba2\u5355\u65e5\u5fd7"}]}],sessionStorage.setItem("breaknav",JSON.stringify(t)),this.getOrderLogFn()}},{key:"selection",value:function(){}},{key:"getOrderLogFn",value:function(){var e=this,t=this.state,a=t.page,n=t.limit,i=t.orderNo,c={page:a,limit:n};Object(s.vb)(i,c).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data;e.setState({orderDetailLog_data:n,total:t.total})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getDetails",value:function(e){var t=this;Object(s.rb)(e).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({orderDetail_data:e})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getOrderLogFn()}),0)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getOrderLogFn()}),0)}},{key:"componentWillMount",value:function(){var e=window.location.href,t=e.lastIndexOf("="),a=e.substr(t+1,e.length);this.getDetails(a),this.setState({tableHeight:window.innerHeight-430,orderNo:a})}},{key:"render",value:function(){var e,t,a,n,i=this,s=this.state.orderDetail_data;return Object(b.jsx)("div",{id:"more",className:"maincenter",children:Object(b.jsx)(It,{tabs:this.state.tabList,tabChange:this.tabFn.bind(this),children:0==this.state.tabactive?Object(b.jsxs)("ul",{className:"main-body",children:[Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u8ba2\u5355\u53f7"}),Object(b.jsx)("font",{children:s.order_number})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u521b\u5efa\u65f6\u95f4"}),Object(b.jsx)("font",{children:s.create_time})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5546\u54c1\u540d\u79f0"}),Object(b.jsx)("font",{children:null===(e=s.orderDetail)||void 0===e?void 0:e.product_name})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u6620\u5c04\u5546\u54c1"}),Object(b.jsx)("font",{children:s.map_product_name||"-"})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5b98\u65b9\u4ef7"}),Object(b.jsx)("font",{children:null===(t=s.orderDetail)||void 0===t?void 0:t.official_price})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u6210\u672c\u4ef7"}),Object(b.jsx)("font",{children:null===(a=s.orderDetail)||void 0===a?void 0:a.cost_price})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5408\u540c\u4ef7"}),Object(b.jsx)("font",{children:s.contract_price})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u8d2d\u4e70\u6570\u91cf"}),Object(b.jsx)("font",{children:s.num})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u603b\u8ba1"}),Object(b.jsx)("font",{children:(s.num*s.contract_price).toFixed(4)})]}),1===(null===(n=s.orderDetail)||void 0===n?void 0:n.product.product_type)?Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5145\u503c\u8d26\u53f7"}),Object(b.jsx)("font",{children:s.account})]}):null,Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u72b6\u6001"}),Object(b.jsx)("font",{children:s.status_text})]})]}):Object(b.jsx)("div",{className:"main-body",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.orderDetailLog_data,Column:On,isMultiple:!1,maxheight:this.state.tableHeight,dataCount:this.state.total,countChange:function(e){i.countChange(e)},countbarVisible:!1,isSwitch:!1,pageChange:function(e){i.pageChange(e)},checkChange:this.selection.bind(this),ComponentHandler:function(e,t,a){return"time"==e?Object(b.jsx)("div",{children:Z.a.unix(t.time).format("YYYY-MM-DD HH:mm:ss")}):"index"==e?Object(b.jsx)("span",{children:a+1}):"opearo"==e?Object(b.jsx)("div",{children:t.data?Object(b.jsx)(xn.a,{collapsed:!0,name:!1,src:t.data,displayDataTypes:!1}):Object(b.jsx)("span",{children:"-"})}):void 0}})})})})}}]),a}(u.a.Component),Sn=(a(309),[{title:"\u5305\u7801\u7ed3\u7b97\u8ba2\u5355ID",name:"settlement_no",prop:"settlement_no",type:"normal",width:"320px"},{title:"\u7ed3\u7b97\u7c7b\u578b",name:"type_text",prop:"type_text",type:"normal",width:"auto"},{title:"key\u7801",name:"key",prop:"key",type:"normal",width:"auto"},{title:"\u8ba1\u5212\u540d\u79f0",prop:"plan_title",name:"plan_title",width:"auto",type:"normal"},{title:"key\u6279\u6b21\u540d\u79f0",prop:"key_batch_name",name:"key_batch_name",width:"auto",type:"normal"},{title:"\u5206\u9500\u5546",name:"reseller_name",prop:"reseller_name",type:"normal",width:"auto"},{title:"\u5b98\u65b9\u4ef7\uff08\u5143\uff09",name:"key_official_price",prop:"key_official_price",type:"normal",width:"auto"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",prop:"create_time",type:"normal",width:"220px"},{title:"\u6210\u672c\u4ef7\uff08\u5143\uff09",name:"key_cost_price",prop:"key_cost_price",type:"normal",width:"auto"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"auto"}]),wn=a(592),Cn=a(76),Nn=Cn(dn()).format("YYYY-MM-DD"),Dn=Cn(ln()).format("YYYY-MM-DD"),In=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u5305\u7801\u5217\u8868"}],orderList:[],selectionData:[],allcheck:!1,itemcheck:!1,tableHeight:500,combinedValue:[],planOptions:[],resellerOptions:[],keysOptions:[],settlementOptions:[],page:1,limit:10,officialPrice:0,costPrice:0,search:n.initSearch(),downloadLoad:!1},n.onChangeCombinedDate=n.onChangeCombinedDate.bind(Object(Xt.a)(n)),n}return Object(y.a)(a,[{key:"initSearch",value:function(){return{plan_id:"",reseller_id:"",key_batch_id:"",type:"",key:"",settlement_no:""}}},{key:"searchChange",value:function(e,t){var a=this.state.search;a[e]=t,this.setState({search:a})}},{key:"selection",value:function(e){this.setState({selectionData:e});var t=0,a=0;e.forEach((function(e){t+=Number(e.key_official_price),a+=Number(e.key_cost_price)})),this.setState({officialPrice:t,costPrice:a})}},{key:"getPlan",value:function(){var e=this;Object(s.yb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.filter((function(e){return e.settlement_type>0})).map((function(e){return{key:e.id,text:e.title}}));e.setState({planOptions:n})}),(function(e){}))})),Object(s.Bb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.name}}));e.setState({resellerOptions:n})}))})),Object(s.Jb)().then((function(t){return Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.settlement_type,text:e.settlement_text}}));e.setState({settlementOptions:n})}),(function(e){}))}))}},{key:"getBatchKeys",value:function(e){var t=this;Object(s.Yc)({status:"4,5",plan_id:e,bind_object:1}).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.map((function(e){return{key:e.id,text:e.batch_name}}));t.setState({keysOptions:n})}),(function(e){h.a.error(e)}))}))}},{key:"moreFn",value:function(e,t){window.open("#/home/packageDetail?id="+t.id),sessionStorage.setItem("pathname2","/home/packageDetail");sessionStorage.setItem("breaknav",JSON.stringify([{items:[{path:"/home/settlementList",name:"\u5305\u7801\u5217\u8868"},{path:"/home/packageDetail",name:"\u5305\u7801\u8be6\u60c5"}]}]))}},{key:"clearFn",value:function(){this.setState({allcheck:!1,selectionData:[],itemcheck:!1})}},{key:"onChangeCombinedDate",value:function(e){var t=this;this.setState({combinedValue:e,page:1,selectionData:[]},(function(){t.getOrderFn()}))}},{key:"bachExportOrder",value:function(){var e={};if(this.state.selectionData.length>0)e.ids=this.state.selectionData.map((function(e){return e.id}));else{var t=this.state,a=t.page,n=t.limit,i=t.search,c=t.combinedValue,o=i.key,r=i.key_batch_id,l=i.plan_id,d=i.reseller_id,u=i.type,p=i.settlement_no;if(!l||!c)return void h.a.error("\u8ba2\u5355\u5bfc\u51fa\u5fc5\u987b\u6709\u8ba1\u5212id\u548c\u65f6\u95f4");e={page:a,limit:n,begin_time:c[0],end_time:c[1],key:o||"",key_batch_id:r?r.key:"",plan_id:l?l.key:"",reseller_id:d?d.key:"",type:u?u.key:"",settlement_no:p}}try{Object(s.Hb)(e).then((function(e){if("application/json"==e.type){var t=new FileReader;t.readAsText(e,"utf-8"),t.onload=function(){var e=JSON.parse(t.result);h.a.clear(),h.a.error(e.message)}}else{var a=new Blob([e]),n="\u5305\u7801\u7ed3\u7b97\u8ba2\u5355\u5217\u8868"+de()+".xlsx",i=document.createElement("a");i.href=window.URL.createObjectURL(a),i.download=n,i.click(),window.URL.revokeObjectURL(i.href)}}))}catch(m){}}},{key:"pageChange",value:function(e){var t=this;this.setState({selectionData:[],page:e},(function(){t.getOrderFn()}))}},{key:"countChange",value:function(e){var t=this;this.setState({selectionData:[],page:1,limit:e},(function(){t.getOrderFn()}))}},{key:"getOrderFn",value:function(){var e=this,t=this.state,a=t.page,n=t.limit,i=t.search,c=t.combinedValue,o=i.key,r=i.key_batch_id,l=i.plan_id,d=i.reseller_id,u=i.type,p=i.settlement_no,m={page:a,limit:n,begin_time:c[0],end_time:c[1],key:o||"",key_batch_id:r?r.key:"",plan_id:l?l.key:"",reseller_id:d?d.key:"",type:u?u.key:"",settlement_no:p};Object(s.Ib)(wn.a.pickBy(m)).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data,i=t.total;e.setState({orderList:n,total:i})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){var e=this,t=[Dn+" 00:00:00",Nn+" 23:59:59"];this.getPlan(),this.setState({tableHeight:window.innerHeight-490,combinedValue:t},(function(){e.getOrderFn()}))}},{key:"reset",value:function(){var e=this;this.setState({search:this.initSearch(),page:1},(function(){return e.getOrderFn()}))}},{key:"createExportOrderTask",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a,n,i,c,o,r,l,d,u,p,m,b,j,g=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.setState({downloadLoad:!0}),setTimeout((function(){g.setState({downloadLoad:!1})}),3e3),t={},!(this.state.selectionData.length>0)){e.next=10;break}a=this.state.combinedValue,t.ids=this.state.selectionData.map((function(e){return e.id})),t.begin_time=a[0],t.end_time=a[1],e.next=17;break;case 10:if(n=this.state,i=n.page,c=n.limit,o=n.search,r=n.combinedValue,l=o.key,d=o.key_batch_id,u=o.plan_id,p=o.reseller_id,m=o.type,b=o.settlement_no,u&&r){e.next=15;break}return h.a.error("\u8ba2\u5355\u5bfc\u51fa\u5fc5\u987b\u6709\u8ba1\u5212id\u548c\u65f6\u95f4"),e.abrupt("return");case 15:t={page:i,limit:c,begin_time:r[0],end_time:r[1],key:l||null,key_batch_id:d?d.key:null,plan_id:u?u.key:null,reseller_id:p?p.key:null,type:m?m.key:null,settlement_no:b||null},t=wn.a.pickBy(t);case 17:return e.next=19,Object(s.q)(t);case 19:200===(j=e.sent).code?(h.a.success("\u521b\u5efa\u5bfc\u51fa\u4efb\u52a1\u6210\u529f!"),this.props.history.push("/home/bm-download-orderlist")):h.a.error(j.message);case 21:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=Object(b.jsx)(Bt.a,{className:"zent-datepicker-demo",value:this.state.combinedValue,dateSpan:90,showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",onChange:this.onChangeCombinedDate});return Object(b.jsx)("div",{id:"dislist",className:"settlementList",children:Object(b.jsxs)(It,{tabs:this.state.tabList,slot:t,children:[Object(b.jsxs)("div",{className:"order-query",children:[Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8425\u9500\u8ba1\u5212\uff1a",required:"",labelwidth:"95px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.plan_id,options:this.state.planOptions,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(t){e.searchChange("plan_id",t),t?e.getBatchKeys(t.key):(e.setState({keysOptions:[]}),e.searchChange("key_batch_id",""))}})}),Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21\uff1a",required:"",labelwidth:"86px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.key_batch_id,options:this.state.keysOptions,placeholder:"\u8bf7\u5148\u9009\u62e9\u8ba1\u5212",width:204,clearable:!0,onChange:function(t){e.searchChange("key_batch_id",t)}})}),Object(b.jsx)(c.a,{labelname:"\u5206\u9500\u5546\uff1a",required:"",labelwidth:"80px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.reseller_id,options:this.state.resellerOptions,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(t){e.searchChange("reseller_id",t)}})}),Object(b.jsx)(c.a,{labelname:"\u7ed3\u7b97\u7c7b\u578b\uff1a",required:"",labelwidth:"100px",children:Object(b.jsx)(ne.a,{name:"state",value:this.state.search.type,options:this.state.settlementOptions,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(t){e.searchChange("type",t)}})}),Object(b.jsx)(c.a,{labelname:"key\u7801\uff1a",required:"",labelwidth:"65px",children:Object(b.jsx)(r.a,{value:this.state.search.key,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:204,onChange:function(t){e.searchChange("key",t)},onClearItem:function(t){e.searchChange("key","")}})}),Object(b.jsx)(c.a,{labelname:"\u5305\u7801\u8ba2\u5355ID\uff1a",required:"",labelwidth:"105px",style:{marginLeft:"0px"},children:Object(b.jsx)(r.a,{value:this.state.search.settlement_no,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",style:{marginLeft:"0px"},width:204,onChange:function(t){e.searchChange("settlement_no",t)},onClearItem:function(t){e.searchChange("settlement_no","")}})}),Object(b.jsx)(c.a,{labelname:"",required:"",labelwidth:"0",children:Object(b.jsxs)("div",{style:{width:"200px",marginLeft:"20px"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){e.setState({page:1},(function(){e.getOrderFn()}))},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){return e.reset()},children:"\u91cd\u7f6e"})]})})]}),Object(b.jsx)(m.a,{className:"exportOrder",type:"default",icon:"download",disabled:this.state.downloadLoad,onClick:this.createExportOrderTask.bind(this),children:"\u521b\u5efa\u5bfc\u51fa\u4efb\u52a1"})]}),Object(b.jsxs)("div",{children:[this.state.selectionData.length>0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:this.clearFn.bind(this),children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:this.state.selectionData.length}),"\u9879\uff0c\u5b98\u65b9\u4ef7\u91d1\u989d\u603b\u8ba1\uffe5",this.state.officialPrice.toFixed(4),"\uff0c\u6210\u672c\u4ef7\u91d1\u989d\u603b\u8ba1\uff1a\uffe5",this.state.costPrice.toFixed(4)]}):null,Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.orderList,Column:Sn,dataCount:this.state.total,itemcheck:this.state.itemcheck,allcheck:this.state.allcheck,isMultiple:!0,page:this.state.page,countbarVisible:!1,isSwitch:!1,ref:"orderList",maxheight:this.state.tableHeight,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(t,a){if("opearo"==t)return Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.moreFn(t,a)},children:"\u8be6\u60c5"})}})]})]})})}}]),a}(u.a.Component),Tn=(a(310),[{title:"\u521b\u5efa\u65f6\u95f4",name:"time",prop:"time",type:"slot",width:"20%"},{title:"\u64cd\u4f5c\u63cf\u8ff0",name:"message",prop:"message",type:"normal",width:"20%"},{title:"\u8be6\u60c5",name:"opearo",type:"slot",prop:"opearo",width:"50%"}]),Fn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u8be6\u60c5"}],tabactive:0,orderDetailLog_data:[],orderDetail_data:{},tableHeight:500,page:1,orderNo:"",limit:10,total:0},n}return Object(y.a)(a,[{key:"tabFn",value:function(e){this.setState({tabactive:e});var t=[];0==e&&(t=[{items:[{path:"/settlementList",name:"\u5305\u7801\u7ed3\u7b97\u5217\u8868"},{path:"/packageDetail",name:"\u5305\u7801\u8be6\u60c5"}]}]),sessionStorage.setItem("breaknav",JSON.stringify(t))}},{key:"selection",value:function(){}},{key:"getDetails",value:function(e){var t=this;Object(s.wb)(e).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({orderDetail_data:e})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){var e=window.location.href,t=e.lastIndexOf("="),a=e.substr(t+1,e.length);this.setState({orderNo:a}),this.getDetails(a),this.setState({tableHeight:window.innerHeight-430})}},{key:"render",value:function(){var e=this,t=this.state.orderDetail_data;return Object(b.jsx)("div",{id:"more2",className:"maincenter",children:Object(b.jsx)(It,{tabs:this.state.tabList,tabChange:this.tabFn.bind(this),children:0==this.state.tabactive?Object(b.jsxs)("ul",{className:"main-body",children:[Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u7ed3\u7b97\u8ba2\u5355\u53f7:"}),Object(b.jsx)("span",{children:t.settlement_no})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u521b\u5efa\u65f6\u95f4:"}),Object(b.jsx)("span",{children:t.create_time})]}),Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5151\u6362\u6570\u91cf:"}),Object(b.jsx)("span",{children:t.order_rows?t.order_rows.length:"0"})]}),t.order_rows?t.order_rows.map((function(e){return Object(b.jsxs)("li",{children:[Object(b.jsx)("span",{children:"\u5173\u8054\u8ba2\u5355\u53f7:"}),Object(b.jsx)("span",{children:e.order_number}),Object(b.jsx)("span",{children:e.create_time})]},e.order_number)})):null]}):Object(b.jsx)("div",{className:"main-body",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.orderDetailLog_data,Column:Tn,isMultiple:!1,maxheight:this.state.tableHeight,dataCount:this.state.total,countChange:function(t){e.countChange(t)},countbarVisible:!1,isSwitch:!1,pageChange:function(t){e.pageChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(e,t){if("time"==e)return Object(b.jsx)("div",{children:Z.a.unix(t.time).format("YYYY-MM-DD HH:mm:ss")})}})})})})}}]),a}(u.a.Component),Ln=(a(137),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onDisabledRange=function(e,t){var a=!1;return"end"==t&&(a=Z()(e.getTime()).add(1,"days")<=(new Date).getTime()),"start"==t&&(a=e.getTime()<=(new Date).getTime()),a},n.phoneChange=function(e){n.setState({phone:e.target.value})},n.emailChange=function(e){n.setState({email:e.target.value})},n.state={model:{title:"",type:2,send_method:"1",reseller:null,return_id:"1",date_time:["",""],stock_id:null,settlement_type:null},settlementOptions:[],lodshow:!1,loading:!1,isSettlement:2,directList:[],limit:15,page:1,hasMore:!0,keyword:"",showEmailPop:!1,email:"",phone:"",reseller_id:0,direct_reseller_name:""},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(e){var t=this,a={limit:this.state.limit,page:this.state.page};this.getDirect(a),Object(s.Jb)().then((function(e){Object(s.cc)(e,(function(e,a){var n=Object(C.a)(e,(function(e){var t={};return t.key=e.settlement_type,t.text=e.settlement_text,t}));t.setState({settlementOptions:n})}),(function(e){h.a.error(e)}))}))}},{key:"componentDidUpdate",value:function(e){this.props.direct_reseller_name!==e.direct_reseller_name&&this.setState({model:Object(n.a)(Object(n.a)({},this.state.model),{},{reseller:{text:this.props.direct_reseller_name!==this.state.model.reseller.text?this.props.direct_reseller_name+"\uff08".concat(this.state.model.reseller.text,"\uff09"):this.state.model.reseller.text}})})}},{key:"setZentOpt",value:function(e){return e.map((function(e){return{key:e.id,text:e.reseller_name&&e.reseller_name!==e.name?e.name+"\uff08".concat(e.reseller_name,"\uff09"):e.name,direct_reseller_id:e.id,reseller_id:e.reseller_id,disabled:1!==e.status}}))}},{key:"getDirect",value:function(e){var t=this;this.state.hasMore&&Object(s.gb)(e).then((function(e){Object(s.cc)(e,(function(e,a){var n=t.state.directList;n=n.concat(t.setZentOpt(e.data)),t.setState({directList:n}),(0===e.data.length||e.data.length0?(this.setState({isSettlement:1}),t.settlement_type={key:i.settlement_type,text:i.settlement_type_text}):this.setState({isSettlement:2})}this.setState({model:t,lodshow:!0,reseller_id:e.reseller_id})}},{key:"submit",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){var a,n,i,c,o,r,l,d,u,p=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!1,!this.refs.form1.validator()){e.next=47;break}if(""!=this.state.model.date_time[1]){e.next=5;break}return h.a.error("\u7ed3\u675f\u65e5\u671f\u4e0d\u80fd\u4e3a\u7a7a"),e.abrupt("return",!1);case 5:if(!this.state.model.stock_id||/^[a-zA-Z0-9]+$/.test(this.state.model.stock_id)){e.next=8;break}return h.a.error("\u8bf7\u8f93\u5165\u7531\u5b57\u6bcd\u6216\u6570\u5b57\u7ec4\u6210\u7684\u8ba1\u5212\u7f16\u53f7"),e.abrupt("return",!1);case 8:if((c={}).title=this.state.model.title,c.stock_id=this.state.model.stock_id,c.type=parseInt(this.state.model.type),c.send_method=this.state.model.send_method,c.return_type=1,c.reseller_id=null!==(n=this.state.model.reseller.key)&&void 0!==n?n:this.state.reseller_id,o=null!==(i=this.state.model.reseller._text)&&void 0!==i?i:this.state.model.reseller.text,r=o.match(/\uff08([^\uff09]+)\uff09/),c.reseller_name=r?r[1]:o,c.begin_time=this.state.model.date_time[0],c.end_time=this.state.model.date_time[1],1===this.state.isSettlement&&this.state.model.settlement_type&&(c.settlement_type=this.state.model.settlement_type.key),!this.state.loading){e.next=23;break}return e.abrupt("return");case 23:if(this.setState({loading:!0}),!t){e.next=31;break}return l={title:c.title,begin_time:c.begin_time,end_time:c.end_time,settlement_type:c.settlement_type},1===this.state.isSettlement&&this.state.model.settlement_type&&(l.settlement_type=c.settlement_type),e.next=29,Object(s.Oc)(t,l).then((function(e){p.setState({loading:!1}),Object(s.cc)(e,(function(e,t){h.a.success("\u4fdd\u5b58\u6210\u529f"),a=!0}),(function(e){h.a.error(e)}))}));case 29:case 38:e.next=47;break;case 31:if((d={}).info=c,u=sessionStorage.getItem("plan_id"),d.info.copy_plan_id=sessionStorage.getItem("plan_id_copy"),""!=u){e.next=40;break}return e.next=38,Object(s.d)("",d).then((function(e){p.setState({loading:!1}),Object(s.cc)(e,(function(e,t){sessionStorage.setItem("plan_id",e.id),delete c.copy_plan_id,sessionStorage.setItem("step1",JSON.stringify(c)),sessionStorage.setItem("knockGold_effectDate",JSON.stringify(c)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(c)),sessionStorage.setItem("plan_item",JSON.stringify(c)),a=!0}),(function(e){h.a.error(e)}))}));case 40:return this.setState({loading:!1}),delete c.copy_plan_id,sessionStorage.setItem("step1",JSON.stringify(c)),sessionStorage.setItem("knockGold_effectDate",JSON.stringify(c)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(c)),sessionStorage.setItem("plan_item",JSON.stringify(c)),e.abrupt("return",!0);case 47:return e.abrupt("return",a);case 48:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"onCancel",value:function(){this.refs.form1.cancel()}},{key:"updateData",value:function(e,t){if(sessionStorage.getItem("step1")){var a=JSON.parse(sessionStorage.getItem("step1"));a[e]=t,sessionStorage.setItem("knockGold_effectDate",JSON.stringify(a)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(a)),sessionStorage.setItem("plan_item",JSON.stringify(a)),sessionStorage.setItem("step1",a)}}},{key:"onTypeChange",value:function(e){var t=this.state.model;t.type=e.target.value,this.setState({model:t})}},{key:"onChangeCombinedDate",value:function(e){var t=this.state.model;t.date_time=e,this.setState({model:t});var a={begin_time:t.date_time[0],end_time:t.date_time[1]};sessionStorage.setItem("knockGold_effectDate",JSON.stringify(a)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(a)),sessionStorage.setItem("plan_item",JSON.stringify(a))}},{key:"addEmail",value:function(e){var t=this,a=new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"),n=new RegExp("^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"),i={contact_phone:this.state.phone,contact_email:this.state.email};i.contact_phone&&a.test(i.contact_phone)?i.contact_email&&n.test(i.contact_email)?Object(s.M)(i,this.state.reseller_id).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({showEmailPop:!1}),h.a.success("\u6dfb\u52a0\u6210\u529f")}),(function(e){h.a.error(e)}))})):h.a.error("\u90ae\u7bb1\u683c\u5f0f\u4e0d\u6b63\u786e"):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"cancel",value:function(e){this.setState({showEmailPop:!1,model:Object(n.a)(Object(n.a)({},this.state.model),{},{reseller:{key:"",_text:""}})})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"step1",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:{title:[{type:"required",message:"\u8bf7\u8f93\u5165\u8425\u9500\u8ba1\u5212\u540d\u79f0"},{type:"regExp",message:"\u53ea\u5141\u8bb8\u5305\u542b\u5b57\u6bcd\u6570\u5b57\u6c49\u5b57\u548c\u3001\u3002\uff0c ( ) & - +",reg:/^[\u4e00-\u9fa5a-zA-Z0-9\u3002\uff0c\u3001_.\\\uff08\uff09&\-+]+$/}],reseller:[{type:"required",message:"\u8bf7\u9009\u62e9\u5206\u9500\u5546"}],date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u65f6\u95f4\u6bb5"}],settlement_type:[{type:"required",message:"\u8bf7\u9009\u62e9\u5305\u7801\u7ed3\u7b97\u65b9\u5f0f"}]},ref:"form1",children:[Object(b.jsx)(c.a,{labelname:"\u8425\u9500\u8ba1\u5212\u540d\u79f0",prop:"title",id:"title",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.title=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.title="",e.setState({model:a})},value:this.state.model.title,countShow:!1,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u8425\u9500\u8ba1\u5212\u7f16\u53f7",prop:"stock_id",id:"stock_id",required:"",children:Object(b.jsx)(r.a,{disabled:this.props.disabled,onChange:function(t){var a=e.state.model;a.stock_id=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.stock_id="",e.setState({model:a})},value:this.state.model.stock_id,countShow:!1,placeholder:"\u5b57\u6bb5\u4e3a\u7a7a\u81ea\u52a8\u751f\u6210ID",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u7c7b\u578b",prop:"type",id:"type",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onTypeChange(t)},value:this.state.model.type,children:[Object(b.jsx)(me.a,{value:1,disabled:!0,children:"\u6d3b\u52a8"}),Object(b.jsx)(me.a,{value:2,children:"\u4ec5\u5151\u6362"})]})}),Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u65b9\u5f0f",prop:"send_method",id:"send_method",children:Object(b.jsxs)(te.a,{onChange:function(t){var a=e.state.model;a.send_method=t.target.value,e.setState({model:a}),e.props.setDistributionMethod(t.target.value)},value:this.state.model.send_method,disabled:this.props.disabled,children:[Object(b.jsx)(me.a,{value:"1",children:"\u90ae\u4ef6\u53d1\u653e"}),Object(b.jsx)(me.a,{value:"2",children:"API\u8c03\u7528"})]})}),Object(b.jsx)(c.a,{labelname:"\u5305\u7801\u7ed3\u7b97",prop:"isSettlement",required:"",id:"isSettlement",children:Object(b.jsxs)(te.a,{disabled:this.props.disabled,onChange:function(t){e.props.setTlementType(t.target.value),e.setState({isSettlement:t.target.value})},value:this.state.isSettlement,children:[Object(b.jsx)(me.a,{value:1,children:"\u662f"}),Object(b.jsx)(me.a,{value:2,children:"\u5426"})]})}),1===this.state.isSettlement?Object(b.jsx)(c.a,{labelname:"\u5305\u7801\u7ed3\u7b97\u65b9\u5f0f",prop:"settlement_type",id:"settlement_type",children:Object(b.jsx)(ne.a,{options:this.state.settlementOptions,placeholder:"\u9009\u62e9\u4e00\u9879",disabled:this.props.disabled,width:515,value:this.state.model.settlement_type,onChange:function(t){var a=e.state.model;a.settlement_type=t,e.setState({model:a}),e.props.setTlementData(t)}})}):null,Object(b.jsx)(c.a,{labelname:"\u5206\u9500\u5546",prop:"reseller",id:"reseller",children:Object(b.jsx)(Gt,{options:this.state.directList,clearable:!0,page:this.state.page,placeholder:"\u9009\u62e9\u4e00\u9879",disabled:this.props.disabled,value:this.state.model.reseller,onChangePage:this.onChangePageSelect.bind(this),keyword:this.state.keyword,onKeywordChange:this.onKeywordChange.bind(this),filterOption:!1,onChange:function(t){e.onResellerChange(t),Rt.a.emit("change","reseller",t)},width:515})}),Object(b.jsx)(c.a,{labelname:"\u5f00\u59cb~\u7ed3\u675f\u65f6\u95f4",prop:"date_time",id:"date_time",children:Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",disabled:[this.props.disabled,!1],value:this.state.model.date_time,onChange:function(t){Rt.a.emit("change","date_time",t),e.onChangeCombinedDate(t)},disabledDate:this.onDisabledRange})})]}),this.state.showEmailPop?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.cancel(t)}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u5b8c\u5584\u5206\u9500\u5546\u4fe1\u606f"}),Object(b.jsxs)("div",{className:"input-group input-flex",children:[Object(b.jsxs)("div",{className:"input-label",children:[Object(b.jsx)("text",{children:"* "}),"\u63a5\u6536\u624b\u673a\u53f7\uff1a"]}),Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u624b\u673a\u53f7",onChange:this.phoneChange,value:this.state.phone})]}),Object(b.jsxs)("div",{className:"input-group input-flex",children:[Object(b.jsxs)("div",{className:"input-label",children:[Object(b.jsx)("text",{children:"* "}),"\u63a5\u6536\u90ae\u7bb1\uff1a"]}),Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u90ae\u7bb1",onChange:this.emailChange,value:this.state.email})]}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.cancel(t)},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.addEmail(t)},children:"\u786e\u5b9a"})]})]})]}):null]})}}]),a}(u.a.Component)),Mn=(a(311),function(e){return Array.from({length:e},(function(e,t){return t}))}),Hn=[{title:"\u5546\u54c1ID",name:"product_id",prop:"product_id",width:"auto",type:"normal"},{title:"\u5546\u54c1\u540d\u79f0",width:"auto",prop:"product_name",name:"product_name",type:"normal"},{title:"\u5e73\u53f0\u6279\u6b21\u53f7",width:"250px",prop:"voucher_batch",name:"voucher_batch",type:"slot"},{title:"\u7c7b\u578b",width:"auto",prop:"type",name:"type",type:"slot"},{title:"\u4e0a\u6e38\u5e73\u53f0",width:"auto",prop:"upstream",name:"upstream",type:"normal"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"350px",prop:"effectDate",name:"effectDate",type:"normal"},{title:"\u603b\u9884\u7b97",prop:"all_budget",name:"all_budget",width:"auto",type:"normal"},{title:"\u5f53\u524d\u6210\u672c\u4ef7\u683c",prop:"cost_price",name:"cost_price",width:"200px",type:"slot"},{title:"\u5408\u540c\u4ef7",name:"contract_price",prop:"contract_price",type:"normal",width:"auto"},{title:"\u5546\u54c1\u5b98\u65b9\u4ef7",type:"normal",prop:"official_price",width:"auto"},{title:"\u5e93\u5b58",type:"normal",prop:"quantity",width:"auto"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"auto"}],qn={code_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u540d\u79f0"}],issued:[{type:"required",message:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^([1-9][0-9]*){1,3}$"}]},Pn={period_num:[{type:"required",message:"\u8bf7\u8f93\u5165\u5468\u671f\u89c4\u5219"}],date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5"}],rank:[{type:"required",message:"\u8bf7\u9009\u62e9\u5546\u54c1\u8303\u56f4"}]},Bn=Object(d.forwardRef)((function(e,t){var a=e.direct_reseller_id,s=e.editData,l=Object(d.useRef)(null),u=Object(d.useRef)(null),f=Object(d.useRef)(null),j=Object(d.useRef)(null),g=Object(U.a)({rankOptions:[],rank:[],tableData:[],addProductBtnLoading:!1,tableLoading:!1,direct_reseller_id:a||0,showScopePop:!1,scopePopType:"",productData:[],table_index:-1,id:"",status:"",checkedProduct:[],KeyPcType:sessionStorage.getItem("KeyPcType")}),y=Object(i.a)(g,2),_=y[0],v=y[1],x=Object(U.a)({code_name:"",issued:"",describe:"",date_time:"",range:"",period_type:"1",period_num:1,period_day:"",period_fixed_receive_time:"",restrict:""}),O=Object(i.a)(x,2),k=O[0],S=O[1];Object(d.useImperativeHandle)(t,(function(){return{submit:w,getModel:N,clearExchangeForm:D}})),Object(d.useEffect)((function(){if(s&&""!==s)v({id:s.id,status:s.status}),I();else{var e=sessionStorage.getItem("knockGold_effectDate");if(e){var t=JSON.parse(e);S({date_time:[t.begin_time,t.end_time]})}}}),[]);var w=function(){var e=!1;if(!l.current.validator())return e=!1;if(e=!0,!u.current.validator())return e=!1;if(e=!0,"1"===k.period_type||k.period_day){if("2"!=k.period_type||k.period_fixed_receive_time){if(e){if(!(_.rank.length>0))return h.a.error("\u8bf7\u9009\u62e9\u5546\u54c1\u8303\u56f4"),!1;var t=_.tableData.filter((function(e){return e.checked})),a=0;if(t.map((function(e){a+=parseInt(e.quantity)})),a24?(h.a.clear(),h.a.error("\u5206\u671f\u6b21\u6570\u4e0d\u5141\u8bb8\u8d85\u8fc724\uff01")):void S({period_num:e})},onClearItem:function(e){S({period_num:""})},value:k.period_num,countShow:!1,placeholder:"\u8bf7\u8f93\u5165\u5206\u671f\u6b21\u6570",labelWidth:"0px",height:"36px",unit:"\u6b21",width:"240px",alignment:"left"}),"-",Object(b.jsx)("div",{className:"icon-box",children:Object(b.jsx)(r.a,{onChange:function(e){e&&(isNaN(Number(e))||Number(e)<0||!/^[1-9]\d*$/.test(e))||S({period_day:e})},onClearItem:function(e){S({period_day:""})},countShow:!1,value:k.period_day,placeholder:"\u8bf7\u8f93\u5165\u95f4\u9694\u5929\u6570",unit:"\u5929",labelWidth:"0px",height:"36px",width:"240px",alignment:"left"})}),"2"==k.period_type?Object(b.jsx)(va.a,{showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:k.period_fixed_receive_time,onChange:function(e){S({period_fixed_receive_time:e})},width:"240px"}):null]})}):null,Object(b.jsx)(c.a,{labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"date_time",id:"date_time",children:Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",value:k.date_time,onChange:function(e){S({date_time:e})},disabledTime:function(e,t){var a=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),n=new Date(a.begin_time),i=n.getHours(),s=n.getMinutes(),c=n.getSeconds();return Object(Q.a)(e,n)?{disabledHours:function(){return Mn(i)},disabledMinutes:function(e){return e===i?Mn(s):[]},disabledSeconds:function(e,t){return e===i&&t===s?Mn(c):[]}}:{}},disabledDate:function(e,t){var a=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),n=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(a.end_time).format("HH:mm:ss");return"start"==t&&(n=s<"23:59:59"?Z()(i).isBefore(a.begin_time)||Z()(i).subtract(1,"days").isAfter(a.end_time):Z()(i).isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),"end"==t&&(n=Z()(i).add(1,"days").isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),n}})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u8303\u56f4",prop:"rank",id:"rank",children:Object(b.jsxs)("div",{className:"goods-boxs",children:[Object(b.jsx)(ne.a,{options:_.rankOptions,multiple:!0,value:_.rank,placeholder:"\u9009\u62e9\u4e00\u9879",width:405,onChange:function(e){!function(e){var t=_.tableData.map((function(t){return t.checked=e.findIndex((function(e){return e.key==t.product_id}))>-1,t}));v({tableData:t,rank:e})}(e)}}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},loading:_.addProductBtnLoading,disabled:1===e.isSettlement&&e.settlementData&&(8===e.settlementData.key||9===e.settlementData.key),onClick:function(){M("addProduct")},children:"\u65b0\u5efa\u5546\u54c1"}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){M("addKnockGold")},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan"))||1===e.isSettlement&&e.settlementData&&7===e.settlementData.key,children:"\u65b0\u5efa\u7acb\u51cf\u91d1"}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){M("redPackets")},disabled:!JSON.parse(sessionStorage.getItem("isEarlyWarningMan"))||1===e.isSettlement&&e.settlementData&&(7===e.settlementData.key||8===e.settlementData.key),children:"\u65b0\u5efa\u7ea2\u5305"})]})})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"range",id:"range",children:Object(b.jsx)(ft.a,{loading:_.tableLoading,iconSize:16,textSize:12,icon:"circle",iconText:"\u52a0\u8f7d\u4e2d",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",isBorder:!0,spliteColor:"#fff",tableData:_.tableData,Column:Hn,countbarVisible:!1,maxheight:_.tableHeight,isSwitch:!1,isShowPageBar:!1,page:_.page,ref:f,dataCount:_.dataCount,emptyText:"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55",checkChange:function(e){return function(e){var t=[];Object(C.a)(e,(function(e){var a={};return a.key=e.product_id,a.text=e.product_name,t.push(a),a})),v({rank:t})}(e)},ComponentHandler:function(e,t,a){return"opearo"===e?Object(b.jsx)("div",{children:Object(b.jsx)("span",{className:"grid-link",onClick:function(){return function(e,t){try{if(_.direct_reseller_id<=0)return void h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546");if(T(),1===e.type){v({product_title:"\u7f16\u8f91\u5546\u54c1",scopePopType:"addProduct",checkedProduct:L(),table_index:t,productType:e.product_type});var a=sessionStorage.getItem("plan_status");"2"!==_.KeyPcType&&"0"!==a||delete e.code_batch_id,v({productData:e,showScopePop:!0})}else if(2===e.type){var n=e.only;"2"===_.KeyPcType&&delete n.id,v({product_title:"\u7f16\u8f91\u7acb\u51cf\u91d1",productData:n,scopePopType:"addKnockGold",showScopePop:!0,table_index:t})}else{var i=e.only;"2"===_.KeyPcType&&delete i.id,v({product_title:"\u7f16\u8f91\u7ea2\u5305",productData:i,scopePopType:"redPackets",showScopePop:!0,table_index:t})}}catch(s){}}(t,a)},children:"\u7f16\u8f91"})}):"period_type"===e?2===t.period_type?"\u81ea\u52a8":3===t.period_type?"\u624b\u52a8":"\u4e0d\u8bbe\u7f6e":"type"===e?Object(b.jsx)("span",{children:1===t.type?"\u5546\u54c1":3===t.type?"2"===t.only.cash_amount_type?"\u968f\u673a\u7ea2\u5305":"\u56fa\u989d\u7ea2\u5305":"\u7acb\u51cf\u91d1"}):"voucher_batch"==e?2===t.type?Object(b.jsx)(b.Fragment,{children:(n=t.only.voucher_batch,n.map((function(e){return e.channel_activity_id})).join(" , "))}):Object(b.jsx)(b.Fragment,{children:t.channel_activity_id}):"cost_price"===e?Object(b.jsx)(b.Fragment,{children:2===t.type?t.official_price:t.cost_price}):void 0;var n}})})})]}),Object(b.jsx)(xt,{ref:j,product_title:_.product_title,drawerVisible:_.showScopePop,type:_.scopePopType,productData:_.productData,onClose:function(){v({showScopePop:!1})},tableData:_.tableData,checkedProduct:_.checkedProduct,table_index:_.table_index,directResellerId:_.direct_reseller_id,productType:_.productType,submit:function(e){return function(e){try{var t=e,a=[];t.map((function(e){var t={};t.key=e.product_id,t.text=e.product_name,a.push(t)}));var n=[];t.map((function(e){var t={};e.checked&&(t.key=e.product_id,t.text=e.product_name,n.push(t))})),v({tableData:t,rankOptions:a,rank:n})}catch(i){}}(e)},isSettlement:e.isSettlement,settlementData:e.settlementData})]})})),En=[{title:"\u5546\u54c1ID",name:"product_id",prop:"product_id",width:"auto",type:"normal"},{title:"\u5546\u54c1\u540d\u79f0",width:"auto",prop:"product_name",name:"product_name",type:"normal"},{title:"\u5e73\u53f0\u6279\u6b21\u53f7",width:"250px",prop:"voucher_batch",name:"voucher_batch",type:"slot"},{title:"\u7c7b\u578b",width:"auto",prop:"type",name:"type",type:"slot"},{title:"\u4e0a\u6e38\u5e73\u53f0",width:"auto",prop:"upstream",name:"upstream",type:"normal"},{title:"\u6709\u6548\u65f6\u95f4\u6bb5",width:"300px",prop:"effectDate",name:"effectDate",type:"slot"},{title:"\u603b\u9884\u7b97",prop:"all_budget",name:"all_budget",width:"auto",type:"normal"},{title:"\u5f53\u524d\u6210\u672c\u4ef7\u683c",prop:"cost_price",name:"cost_price",width:"200px",type:"slot"},{title:"\u5408\u540c\u4ef7",name:"contract_price",prop:"contract_price",type:"normal",width:"auto"},{title:"\u5546\u54c1\u5b98\u65b9\u4ef7",type:"normal",prop:"official_price",width:"auto"},{title:"\u5355\u6b21\u5230\u8d26",type:"normal",prop:"send_num",width:"auto"},{title:"\u5e93\u5b58",type:"normal",prop:"quantity",width:"auto"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"auto"}],An={code_name:[{type:"required",message:"\u8bf7\u8f93\u5165\u5151\u6362\u7801\u540d\u79f0"}],quantity:[{type:"required",message:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^([1-9][0-9]*){1,3}$"}]},Vn={period_day:[{type:"required",message:"\u8bf7\u8f93\u5165\u5468\u671f\u89c4\u5219"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^([1-9][0-9]*){1,3}$"}],period_fixed_receive_time:[{type:"required",message:"\u8bf7\u8f93\u5165\u5468\u671f\u89c4\u5219\u65f6\u95f4"}],date_time:[{type:"required",message:"\u8bf7\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5"}],timer:[{type:"required",message:"\u8bf7\u9009\u62e9\u9886\u53d6\u65f6\u95f4\u6bb5"}],rank:[{type:"required",message:"\u8bf7\u9009\u62e9\u5546\u54c1\u8303\u56f4"}]};function Jn(e){return Array.from({length:e},(function(e,t){return t}))}var Wn=Object(d.forwardRef)((function(e,t){var a=e.propsData,l=Object(d.useRef)(null),u=Object(d.useRef)(null),g=Object(d.useRef)(null),y=Object(d.useRef)(null),_=Object(U.a)(I()),v=Object(i.a)(_,2),x=v[0],O=v[1],k=Object(U.a)(T()),S=Object(i.a)(k,2),w=S[0],N=S[1],D=function(){O(I()),N(T())};function I(){return{rankOptions:[],rank:[],tableData:[],productData:null,visible:!1,keyPcType:Number(sessionStorage.getItem("KeyPcType"))||0}}function T(){return{instruction:R,code_name:"",quantity:"",date_time:[],channel:"1",receive_mode:1,timer_type:1,timer:[],group_cover:"",group_image:[],instructionType:1,is_webview:0,timer_show:1,period_type:"1",period_day:"",period_fixed_receive_time:""}}function F(){var e=!1;if(!l.current.validator())return e=!1;if(e=!0,!u.current.validator())return e=!1;if(e=!0){if(!(x.rank.length>0))return h.a.error("\u8bf7\u9009\u62e9\u5546\u54c1\u8303\u56f4"),!1;var t=x.tableData.filter((function(e){return e.checked})),a=!1;if(t.map((function(e){e.quantity0?function(e){return new Promise((function(t,a){try{var n=new FormData;n.append("file",e),n.append("path","common_image"),Object(s.sd)(n).then((function(e){Object(s.cc)(e,(function(e,a){t(e.path)}),(function(e){h.a.error(e),a(e)}))}))}catch(i){a(i)}}))}(e[0].file).then((function(t){N({group_image:[{src:t,id:"".concat((new Date).getTime(),"-0"),name:e[0].file.name}]})})):N({group_image:[]})};return Object(b.jsxs)("div",{className:"combiningCommon",children:[Object(b.jsxs)(p.a,{className:"card1",title:"\u57fa\u672c\u4fe1\u606f",children:[Object(b.jsx)("div",{className:"addcode",children:Object(b.jsxs)(o.a,{model:w,rules:An,ref:l,className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u6e20\u9053",prop:"channel",id:"type",children:Object(b.jsx)(te.a,{disabled:!!x.tableData.length&&2!==x.keyPcType,onChange:function(e){var t=e.target;N({channel:t.value,is_webview:0}),"3"===t.value?N({receive_mode:2}):N({receive_mode:1}),"1"===t.value?N({instruction:R}):"2"===t.value?N({instruction:z}):N({instruction:Y}),2===x.keyPcType&&(O({rankOptions:[],rank:[],tableData:[]}),sessionStorage.setItem("knockGoldData",JSON.stringify([])))},value:w.channel,children:Object(b.jsxs)(ma.a,{trigger:"hover",content:"\u53ea\u80fd\u7ec4\u5408\u540c\u4e00\u79cd\u6e20\u9053\u7acb\u51cf\u91d1",children:[Object(b.jsx)(me.a,{value:"1",children:"\u652f\u4ed8\u5b9d"}),Object(b.jsx)(me.a,{value:"2",children:"\u5fae\u4fe1"}),Object(b.jsx)(me.a,{value:"3",children:"\u4e91\u95ea\u4ed8"})]})})}),2==w.channel?Object(b.jsx)(c.a,{labelname:"\u6253\u5f00\u65b9\u5f0f",prop:"is_webview",id:"is_webview",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;N({is_webview:t.value})},value:w.is_webview,children:[Object(b.jsx)(me.a,{value:0,children:"\u5c0f\u7a0b\u5e8f"}),Object(b.jsx)(me.a,{value:1,children:"\u516c\u4f17\u53f7"})]})},"is_webview"):null,1==w.channel?Object(b.jsx)(c.a,{labelname:"\u9886\u53d6\u65b9\u5f0f",prop:"receive_mode",id:"receive_mode",children:Object(b.jsx)(te.a,{disabled:!!x.tableData.length&&2!==x.keyPcType,onChange:function(e){var t=e.target;N({receive_mode:t.value}),2===x.keyPcType&&(O({rankOptions:[],rank:[],tableData:[]}),sessionStorage.setItem("knockGoldData",JSON.stringify([])))},value:w.receive_mode,children:Object(b.jsxs)(ma.a,{trigger:"hover",content:"\u53ea\u80fd\u7ec4\u5408\u540c\u4e00\u79cd\u9886\u53d6\u65b9\u5f0f\u7acb\u51cf\u91d1",children:[Object(b.jsx)(me.a,{value:1,children:"\u5b98\u65b9\u9886\u53d6"}),Object(b.jsx)(me.a,{value:2,children:"\u8d26\u53f7\u9886\u53d6"})]})})}):null,Object(b.jsx)(c.a,{labelname:"\u7ec4\u5408\u5546\u54c1\u540d\u79f0",prop:"code_name",id:"code_name",children:Object(b.jsx)(r.a,{onChange:function(e){N({code_name:e})},onClearItem:function(e){N({code_name:""})},value:w.code_name,placeholder:"\u8bf7\u8f93\u5165\u7ec4\u5408\u5546\u54c1\u540d\u79f0",labelWidth:"0px",maxLength:10,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u53d1\u653e\u603b\u91cf",prop:"quantity",id:"quantity",children:Object(b.jsx)(r.a,{onChange:function(e){N({quantity:e})},onClearItem:function(e){N({quantity:""})},unit:"\u6761",countShow:!1,value:w.quantity,placeholder:"\u8bf7\u8f93\u5165\u53d1\u653e\u603b\u91cf",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u63cf\u8ff0\u7c7b\u578b",prop:"instructionType",id:"instructionType",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;N({instructionType:t.value})},value:w.instructionType,children:[Object(b.jsx)(me.a,{value:1,children:"\u6587\u5b57\u63cf\u8ff0"}),Object(b.jsx)(me.a,{value:2,children:"\u56fe\u7247\u63cf\u8ff0"})]})}),2===w.instructionType?Object(b.jsx)(c.a,{prop:"group_image",labelname:"\u5546\u54c1\u63cf\u8ff0",id:"group_image",required:"",children:Object(b.jsx)(jt.a,{className:"good-image-upload-demo",maxSize:5242880,tips:"\u56fe\u7247\u4e0d\u8d85\u8fc7 5M",maxAmount:1,onError:function(e,t){"overMaxAmount"===e?h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247")):"overMaxSize"===e&&h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))},onChange:function(e,t){H(e)},sortable:!0,fileList:w.group_image,multiple:!0})}):Object(b.jsx)(c.a,{labelname:"\u4f7f\u7528\u8bf4\u660e",prop:"instruction",id:"instruction",required:!1,children:Object(b.jsx)(Ia,{pageType:"detaileditor",setEdittext:function(e){N({instruction:e})},width:"520px",text:w.instruction,limitLength:5e3},w.channel)})]})}),Object(b.jsx)(Fa,{data:w,products:x.tableData})]}),Object(b.jsxs)(p.a,{style:{width:"95%",margin:"10px auto"},title:"\u57fa\u672c\u89c4\u5219",children:[Object(b.jsx)("div",{children:Object(b.jsxs)(o.a,{model:w,rules:Vn,ref:u,className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u5230\u8d26",prop:"period_type",id:"period_type",children:Object(b.jsxs)(ae.a.Group,{value:w.period_type,onChange:function(e){N({period_type:e.target.value}),N({period_day:""}),N({period_fixed_receive_time:""})},children:[Object(b.jsx)(ae.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(ae.a,{value:"2",children:"\u81ea\u52a8\u53d1\u653e"}),Object(b.jsx)(ae.a,{value:"3",children:"\u624b\u52a8\u9886\u53d6"})]})}),"1"!==w.period_type?Object(b.jsx)(c.a,{labelname:"\u5468\u671f\u89c4\u5219",prop:"period_day",id:"period_day",children:Object(b.jsxs)("div",{className:"warningValue",children:[Object(b.jsx)(r.a,{onChange:function(e){e&&(isNaN(Number(e))||Number(e)<0||!/^[1-9]\d*$/.test(e))||N({period_day:e})},onClearItem:function(e){N({period_day:""})},countShow:!1,value:w.period_day,placeholder:"\u8bf7\u8f93\u5165\u95f4\u9694\u5929\u6570",unit:"\u5929",labelWidth:"0px",height:"36px",width:"240px",alignment:"left"}),Object(b.jsx)("div",{className:"icon-box",children:"2"==w.period_type?Object(b.jsx)(va.a,{showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:w.period_fixed_receive_time,onChange:function(e){N({period_fixed_receive_time:e})},width:"240px"}):null})]})}):null,Object(b.jsxs)(c.a,{labelname:"\u751f\u6548\u65f6\u95f4\u6bb5",prop:"date_time",id:"date_time",children:[Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:["00:00:00","23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",value:w.date_time,onChange:function(e){N({date_time:e}),x.tableData.map((function(t){t.origin.time_limit.effect_time.start_time=e[0],t.origin.time_limit.effect_time.end_time=e[1],t.only.time_limit.effect_time.start_time=e[0],t.only.time_limit.effect_time.end_time=e[1]}))},disabledTime:function(e,t){var a=JSON.parse(sessionStorage.getItem("plan_item")),n=new Date(a.begin_time),i=n.getHours(),s=n.getMinutes(),c=n.getSeconds();return Object(Q.a)(e,n)?{disabledHours:function(){return Jn(i)},disabledMinutes:function(e){return e===i?Jn(s):[]},disabledSeconds:function(e,t){return e===i&&t===s?Jn(c):[]}}:{}},disabledDate:function(e,t){var a=JSON.parse(sessionStorage.getItem("plan_item")),n=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(a.end_time).format("HH:mm:ss");return"start"==t&&(n=s<"23:59:59"?Z()(i).isBefore(a.begin_time)||Z()(i).subtract(1,"days").isAfter(a.end_time):Z()(i).isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),"end"==t&&(n=Z()(i).add(1,"days").isBefore(a.begin_time)||Z()(i).isAfter(a.end_time)),n}}),Object(b.jsxs)(te.a,{style:{marginLeft:"20px"},onChange:function(e){var t=e.target;N({timer_show:t.value})},value:w.timer_show,children:[Object(b.jsx)(me.a,{value:1,children:"\u663e\u793a"}),Object(b.jsx)(me.a,{value:2,children:"\u9690\u85cf"})]})]}),2===w.timer_type?Object(b.jsxs)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",prop:"timer",children:[Object(b.jsx)(fe.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},value:w.timer,onChange:function(e){N({timer:e})},width:"240px",disabledTime:function(e,t){var a=!1;return"end"==t&&(a=Z()(e.getTime()).add(1,"days")<=(new Date).getTime()),"start"==t&&(a=e.getTime()<=(new Date).getTime()),a}}),Object(b.jsxs)(te.a,{style:{marginLeft:"15px"},onChange:function(e){var t=e.target;N({timer_type:t.value}),1===t.value&&N({timer:[]})},value:w.timer_type,children:[Object(b.jsx)(me.a,{value:1,children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:2,children:"\u6bcf\u65e5"})]})]}):Object(b.jsx)(c.a,{id:"timer",labelname:"\u9886\u53d6\u65f6\u95f4\u6bb5",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;N({timer_type:t.value})},value:w.timer_type,children:[Object(b.jsx)(me.a,{value:1,children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(me.a,{value:2,children:"\u6bcf\u65e5"})]})}),Object(b.jsx)(c.a,{labelname:"\u5546\u54c1\u8303\u56f4",prop:"rank",id:"rank",children:Object(b.jsxs)("div",{className:"goods-boxs",children:[Object(b.jsx)(ne.a,{options:x.rankOptions,multiple:!0,value:x.rank,placeholder:"\u9009\u62e9\u4e00\u9879",width:405,onChange:function(e){!function(e){var t=x.tableData.map((function(t){return t.checked=e.findIndex((function(e){return e.key==t.product_id}))>-1,t}));O({tableData:t,rank:e})}(e)}}),Object(b.jsx)(m.a,{type:"primary",style:{marginLeft:"20px"},onClick:function(){!function(){if(w.date_time.filter((function(e){return e})).length<2)return h.a.error("\u8bf7\u5148\u9009\u62e9\u751f\u6548\u65f6\u95f4\u6bb5");sessionStorage.setItem("knockGold_effectDate",JSON.stringify({begin_time:w.date_time[0],end_time:w.date_time[1]})),O({visible:!0,productData:null})}()},children:"\u65b0\u5efa\u7acb\u51cf\u91d1"})]})})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"range",id:"range",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",isBorder:!0,spliteColor:"#fff",tableData:x.tableData,Column:En,countbarVisible:!1,maxheight:x.tableHeight,isSwitch:!1,isShowPageBar:!1,page:x.page,ref:g,dataCount:x.dataCount,emptyText:"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55",checkChange:function(e){return function(e){var t=[];Object(C.a)(e,(function(e){var a={};return a.key=e.product_id,a.text=e.product_name,t.push(a),a})),O({rank:t})}(e)},ComponentHandler:function(e,t,a){return"index"===e?Object(b.jsx)(Le.a,{value:t.index,onChange:function(e){var t=e.target;x.tableData[a].index=t.value,x.tableData[a].origin.index=t.value,O({tableData:x.tableData})},type:"number",width:100}):"opearo"===e?Object(b.jsx)("div",{children:Object(b.jsx)("span",{className:"grid-link",onClick:function(){return function(e){e.origin.index=e.index,O({visible:!0,productData:e.origin})}(t)},children:"\u7f16\u8f91"})}):"cost_price"===e?Object(b.jsx)(b.Fragment,{children:2===t.type?t.official_price:t.cost_price}):"voucher_batch"==e?2===t.type?Object(b.jsx)(b.Fragment,{children:(n=t.origin.voucher_batch,n.map((function(e){return e.channel_activity_id})).join(" , "))}):Object(b.jsx)(b.Fragment,{children:t.channel_activity_id}):"type"===e?Object(b.jsx)(b.Fragment,{children:"\u7acb\u51cf\u91d1"}):"effectDate"==e?Object(b.jsxs)(b.Fragment,{children:[w.date_time[0]," \u81f3 ",w.date_time[1]]}):void 0;var n}})})]}),Object(b.jsx)(ht.a,{className:"draw",width:"86%",title:"\u65b0\u5efa\u7acb\u51cf\u91d1",footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return L.apply(this,arguments)},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(e){O({visible:!1})},children:"\u53d6\u6d88"})]}),visible:x.visible,onClose:function(e){O({visible:!1})},maskClosable:!1,children:Object(b.jsx)("div",{className:"draw2",children:Object(b.jsx)(p.a,{style:{width:"95%",margin:"10px auto",border:0},children:Object(b.jsx)(Je,{ref:y,data:x.productData,combining:w})})})})]})})),zn=Wn,Rn=a(350),Yn=(a(312),function(e){return Array.from({length:e},(function(e,t){return t}))}),Kn=[{title:"\u884c\u53f7",name:"line",prop:"line",width:"30px",type:"normal"},{title:"\u624b\u673a\u53f7",width:"80px",prop:"mobile",name:"mobile",type:"normal"},{title:"\u9519\u8bef\u539f\u56e0",width:"80px",prop:"tips",name:"tips",type:"normal"},{title:"\u662f\u5426\u5bfc\u5165",width:"50px",prop:"is_import",name:"is_import",type:"slot"}],Gn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onCheckChange=function(e){var t=e.target;sessionStorage.setItem("keyType",t.value),n.props.setKeyType(t.value),n.props.getStep3Theme&&n.props.getStep3Theme()},n.onDisabledCombinedDate=function(e){var t=Z()(e).format("YYYY-MM-DD HH:mm:ss");return!Z()(t).isBetween(n.state.step1.begin_time,n.state.step1.end_time,null,"(]")},n.onDisabledTime=function(e,t){var a=new Date,n=a.getHours(),i=a.getMinutes(),s=a.getSeconds();return Object(Q.a)(e,a)?{disabledHours:function(){return Yn(n)},disabledMinutes:function(e){return e===n?Yn(i):[]},disabledSeconds:function(e,t){return e===n&&t===i?Yn(s):[]}}:{}},n.onDisabledRange=function(e,t){var a=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(n.state.step1.end_time).format("HH:mm:ss");return"start"==t&&(a=s<"23:59:59"?Z()(i).isBefore(n.state.step1.begin_time)||Z()(i).subtract(1,"days").isAfter(n.state.step1.end_time):Z()(i).isBefore(n.state.step1.begin_time)||Z()(i).isAfter(n.state.step1.end_time)),"end"==t&&(a=Z()(i).add(1,"days").isBefore(n.state.step1.begin_time)||Z()(i).isAfter(n.state.step1.end_time)),a},n.onUpload=function(e,t){return new Promise((function(a,n){var i="",c=new FormData;c.append("file",e),c.append("path","common_image"),Object(s.sd)(c).then((function(e){Object(s.cc)(e,(function(e,t){i=e.path}),(function(e){n()}))}));var o=0;setTimeout((function e(){i?a(i):o<100?(t(o+=2),setTimeout(e,500)):n()}),500)}))},n.onUploadError=function(e,t){"overMaxAmount"===e?h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247")):"overMaxSize"===e&&h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))},n.clearTableData=function(){n.setState({distdata:[],couponData:[]})},n.state={model:{style:1,quantity:0,allow_repetition:0,allow_loss:0,merge_stock:1,code_batch:"",draw_title:"",batch_name:"",key_official_price:"",key_cost_price:"",expiration_type:"1",expiration_value:"",person:[],val:"",per:""},warningPersonOptions:[],step1:JSON.parse(sessionStorage.getItem("step1")),drawerVisible:!1,drawerVisible2:!1,exchangeType:1,productData:[],codeInfo:{code_name:"",issued:"",describe:"",date_time:"",range:""},rank:null,rankoptions:[],tempdata:[],distdata:[],couponData:[],column_distdata:[],exceldata:[],oldData:null,uploading:!1,rowIndex:-1,isload:!!e.isload&&e.isload,import_visible:!1,white_visible:!1,success_visible:!1,fail_visible:!1,file_loading:!1,upload_visible:!1,excel_visible:!1,accessVerify:!1,mobile_excel:"",mobile_repeat:[],execel_path:"",excel_count:0,success_count:0,error_count:0,whiteStyle:!1,import_success:!1,product_title:"\u65b0\u5efa\u5546\u54c1",newGoodsBtnLoading:!1,newGoldLoading:!1,direct_reseller_id:0,tableLoading:!1,isCopy:!!e.isCopy,rowCouponData:"",rowExchangeData:"",Column:[{title:"\u5151\u6362\u540d\u79f0",name:"title",prop:"title",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u8303\u56f4",prop:"product",name:"product",width:"auto",type:"slot"},{title:"\u6709\u6548\u5f00\u59cb\u65e5\u671f",prop:"begin_time",name:"begin_time",width:"auto",type:"normal"},{title:"\u6709\u6548\u7ed3\u675f\u65e5\u671f",name:"end_time",prop:"end_time",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u6570\u91cf",name:"quantity",type:"normal",prop:"quantity",defaultText:"PM",width:"auto"},{title:"\u7ed1\u5b9a\u6570",prop:"restrict",name:"restrict",type:"slot",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}],Column_coupon:[{title:"\u4f18\u60e0\u5238\u540d\u79f0",name:"title",prop:"title",type:"normal",width:"auto"},{title:"\u4f18\u60e0\u5238\u8303\u56f4",prop:"product",name:"product",width:"auto",type:"slot"},{title:"\u6709\u6548\u5f00\u59cb\u65e5\u671f",prop:"begin_time",name:"begin_time",width:"auto",type:"normal"},{title:"\u6709\u6548\u7ed3\u675f\u65e5\u671f",name:"end_time",prop:"end_time",type:"normal",width:"auto"},{title:"\u4f18\u60e0\u5238\u6570\u91cf",name:"quantity",type:"normal",prop:"quantity",defaultText:"PM",width:"auto"},{title:"\u7ed1\u5b9a\u6570",prop:"restrict",name:"restrict",type:"slot",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}]},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(e){var t=this;if(O.a.findDOMNode(this).getElementsByClassName("form-Item")[1].getElementsByTagName("input")[0].focus(),this.props.name>0){var a=this.state.model;a.style=this.props.keyStyle,this.setState({whiteStyle:this.props.whiteStyle,white_visible:this.props.whiteStyle,model:a})}Object(s.Tb)().then((function(e){var a=e.data.data.map((function(e,t){return{key:t,text:e.real_name,mobile:e.mobile}}));t.setState({warningPersonOptions:a})}))}},{key:"submit",value:function(){if(2==this.props.send_method&&this.state.model.val&&this.state.model.person.length<1)return h.a.error("\u8bf7\u9009\u62e9\u9884\u8b66\u4eba"),!1;if(2==this.state.expiration_type&&this.state.expiration_value.length<1)return h.a.error("\u8bf7\u9009\u62e9\u56fa\u5b9a\u65f6\u95f4\u6bb5"),!1;if(3==this.state.expiration_type&&!this.state.expiration_value)return h.a.error("\u8bf7\u8f93\u5165\u63a5\u53e3\u8c03\u53d6\u540e\u6709\u6548\u671f"),!1;if(1===this.props.keyType){if(this.refs.form1.validator()){var e=this.refs.tempdata.getSelectData(),t={};return t.batch_name=this.state.model.batch_name,t.style=this.state.model.style,t.quantity=this.state.model.quantity,t.warning_conf={per:this.state.model.per,val:this.state.model.val,person:this.state.model.person.map((function(e){return{name:e.text,phone:e.mobile}}))},t.bind_object=[this.props.keyType],t.allow_repetition=this.state.model.allow_repetition,t.allow_loss=this.state.model.allow_loss,t.merge_stock=this.state.model.merge_stock,t.code_batch=e,t.mobile_excel=this.state.mobile_excel,t.mobile_repeat=this.state.mobile_repeat,t.key_official_price=this.state.model.key_official_price,t.key_cost_price=this.state.model.key_cost_price,t.expiration_conf={expiration_type:this.state.model.expiration_type,expiration_value:this.state.model.expiration_value},t}}else if(this.refs.form1.validator()){var a=this.state.couponData.filter((function(e){return e.checked})),n={};n.batch_name=this.state.model.batch_name,n.style=this.state.model.style,n.quantity=this.state.model.quantity,n.warning_conf={per:this.state.model.per,val:this.state.model.val,person:this.state.model.person.map((function(e){return{name:e.text,phone:e.mobile}}))},n.bind_object=[this.props.keyType],n.allow_repetition=this.state.model.allow_repetition,n.allow_loss=this.state.model.allow_loss,n.merge_stock=this.state.model.merge_stock,n.coupon=a,n.mobile_excel=this.state.mobile_excel,n.mobile_repeat=this.state.mobile_repeat,n.expiration_conf={expiration_type:this.state.model.expiration_type,expiration_value:this.state.model.expiration_value};for(var i=0;i-1&&(e.checked=a.state.tempdata[t].checked),e.type=1,e.only=e.product_id,e.upstream="\u76f4\u8fde\u5929\u4e0b",e}))):(e=JSON.parse(sessionStorage.getItem("knockGoldData")).filter((function(e){return 1!==e.type})),n=a.state.tempdata.filter((function(e){return 2!==e.type})),t=Object(C.a)(e,(function(e){var t,n,i=a.state.tempdata.findIndex((function(t){return t.channel_activity_id===e.channel_activity_id}));i>-1&&(e.checked=a.state.tempdata[i].checked);var s={};return s.product_name=e.batch_goods_name?e.batch_goods_name:e.product_name,s.map_product_name=e.product_name,s.channel_activity_id=e.channel_activity_id,s.only=e.channel_activity_id,s.type=2,s.checked=null===e||void 0===e?void 0:e.checked,s.upstream=J(e.channel),s.edit="edit",s.effectDate=e.effectDate?e.effectDate:(null===(t=e.time_limit)||void 0===t?void 0:t.effect_time.start_time)+" \u81f3 "+(null===(n=e.time_limit)||void 0===n?void 0:n.effect_time.end_time),s.contract_price=e.contract_price?e.contract_price:e.price,s.official_price=e.official_price?e.official_price:e.reduce_amount,s.quantity=e.quantity?e.quantity:parseInt(B(e.all_budget,e.reduce_amount)),s.origin=null!==e&&void 0!==e&&e.origin?null===e||void 0===e?void 0:e.origin:e,s})));var i=re(t.concat(n),"only"),s=[],c=[];Object(C.a)(i,(function(e){s.push({key:e.only,text:e.product_name}),e.checked&&c.push({key:e.only,text:e.product_name})})),s=re(s,"key"),a.setState({tempdata:i,rankoptions:s,rank:c})}),500));case 11:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setkeyStyle",value:function(e){6==e?this.setState({white_visible:!0,whiteStyle:!0}):this.setState({white_visible:!1,whiteStyle:!1});var t=this.state.model;t.style=e,this.setState({model:t})}},{key:"componentWillReceiveProps",value:function(e){}},{key:"onChangeCombinedDate",value:function(e){var t=this.state.codeInfo;t.date_time=e,this.setState({codeInfo:t})}},{key:"submit2",value:function(){this.refs.form2.validator()}},{key:"onRankChange",value:function(e){Object(ga.a)(this.state.tempdata,(function(t){t.checked=e.findIndex((function(e){return e.key==t.only}))>-1})),this.setState({tempdata:this.state.tempdata,rank:e})}},{key:"codeSubmit",value:function(){if(2!==this.props.keyType){if(1!==this.props.keyType);else if(this.refs.addEditExchangeEl.submit()){var e=this.refs.addEditExchangeEl.getModel();if(1===this.props.isSettlement&&(e.restrict="1"),1===this.props.isSettlement&&2!==this.state.exchangeType)if([].concat(Object(ce.a)(e.product.legal),Object(ce.a)(e.product.reduce),Object(ce.a)(e.product.cash)).length>1)return void h.a.error("\u5305\u7801\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5546\u54c1");var t=this.state.distdata;this.state.rowIndex>-1?(t[this.state.rowIndex]=e,this.setState({distdata:t})):(t.push(e),this.setState({distdata:t})),this.setState({drawerVisible:!1})}}else if(this.refs.addEditCouponEl.submit()){var a=this.refs.addEditCouponEl.getModel(),n=this.state.couponData;this.state.rowIndex>-1?(n[this.state.rowIndex]=a,this.setState({couponData:n})):(n.push(a),this.setState({couponData:n})),this.setState({drawerVisible:!1})}}},{key:"addNewKey",value:function(){this.props.addNewkey()}},{key:"onRestrict",value:function(e,t,a){var n=e.target.value;n=n.replace(/[^\d]/g,""),1===this.props.keyType?(this.state.distdata[a].restrict=n,this.setState({distdata:this.state.distdata})):(this.state.couponData[a].restrict=n,this.setState({couponData:this.state.couponData}))}},{key:"edit",value:function(e){var t,a,n,i={batch_name:e.batch_name,style:parseInt(e.style),quantity:e.quantity,allow_repetition:parseInt(e.allow_repetition),allow_loss:parseInt(e.allow_loss),merge_stock:e.merge_stock,code_batch:e.code_batch,per:(null===(t=e.warning_conf)||void 0===t?void 0:t.per)||"",val:(null===(a=e.warning_conf)||void 0===a?void 0:a.val)||"",person:null!==(n=e.warning_conf)&&void 0!==n&&n.person?e.warning_conf.person.map((function(e,t){return{key:t,text:e.name,mobile:e.phone}})):[],draw_title:e.draw_title,key_official_price:e.key_official_price,key_cost_price:e.key_cost_price,expiration_type:e.expiration_conf?e.expiration_conf.expiration_type:"1",expiration_value:e.expiration_conf?e.expiration_conf.expiration_value:""},s=sessionStorage.getItem("bm_obj");if(s){var c=JSON.parse(s);c.settlement_type>0?(this.setState({isSettlement:1}),i.settlement_type={key:c.settlement_type,text:c.settlement_type_text}):this.setState({isSettlement:2})}6==i.style?(sessionStorage.setItem("white",1),this.setState({white_visible:!0})):sessionStorage.setItem("white",3);var o=Object(C.a)(e.code_batch,(function(e){return e.checked=!0,e}));this.setState({mobile_repeat:e.mobile_repeat,mobile_excel:e.mobile_excel,model:i,checkedList:e.bind_object.map(Number)[0],distdata:o,isload:!0})}},{key:"coupon_edit",value:function(e){var t,a,n,i={batch_name:e.batch_name,style:parseInt(e.style),quantity:e.quantity,allow_repetition:parseInt(e.allow_repetition),allow_loss:parseInt(e.allow_loss),merge_stock:e.merge_stock,draw_title:e.draw_title,coupon:e.coupon,per:(null===(t=e.warning_conf)||void 0===t?void 0:t.per)||"",val:(null===(a=e.warning_conf)||void 0===a?void 0:a.val)||"",person:null!==(n=e.warning_conf)&&void 0!==n&&n.person?e.warning_conf.person.map((function(e,t){return{key:t,text:e.name,mobile:e.phone}})):[]};6==i.style?(sessionStorage.setItem("white",1),this.setState({white_visible:!0})):sessionStorage.setItem("white",3);var s=Object(C.a)(e.coupon,(function(e){return e.checked=!0,e}));this.setState({mobile_repeat:e.mobile_repeat,mobile_excel:e.mobile_excel,model:i,couponData:s,isload:!0})}},{key:"onUploadChange1",value:function(e,t){if(e.length>0&&"success"==e[0].status){var a=this.state.tempdata.findIndex((function(e){return e.product_id==t.product_id}));this.state.tempdata[a].describe_url=e[0].src,this.setState({tempdata:this.state.tempdata})}}},{key:"onUploadChange2",value:function(e,t){if(e.length>0&&"success"==e[0].status){var a=this.state.tempdata.findIndex((function(e){return e.product_id==t.product_id}));this.state.tempdata[a].describe_url=e[0].src,this.setState({tempdata:this.state.tempdata})}}},{key:"onNameChange",value:function(e,t,a){this.state.tempdata[a].product_name=e.target.value;var n=Object(C.a)(this.state.tempdata,(function(e){var t={};return t.key=e.product_id,t.text=e.product_name,t}));this.setState({rank:n,rankoptions:n,tempdata:this.state.tempdata})}},{key:"onQuantityChange",value:function(e,t,a){this.state.tempdata[a].quantity=""==e.target.value?0:e.target.value,this.setState({tempdata:this.state.tempdata})}},{key:"onPriceChange",value:function(e,t,a){var n=e.target.value.replace(/[^\d^\.]+/g,"").replace(".","$#$").replace(/\./g,"").replace("$#$",".");this.state.tempdata[a].contract_price=n,this.setState({tempdata:this.state.tempdata})}},{key:"rowItemClick",value:function(e,t){1===this.props.keyType?2==e.recharge_type?this.setState({draw_title:"\u7f16\u8f91\u7ec4\u5408\u5546\u54c1",rowIndex:t,rowExchangeData:e,drawerVisible:!0,exchangeType:2}):this.setState({draw_title:"\u7f16\u8f91\u5151\u6362\u7801",rowIndex:t,rowExchangeData:e,drawerVisible:!0,exchangeType:1}):this.setState({draw_title:"\u7f16\u8f91\u4f18\u60e0\u5238",rowIndex:t,rowCouponData:e,drawerVisible:!0})}},{key:"initUpload",value:function(){this.setState({accessVerify:!1,excel_visible:!1,upload_visible:!1,file_loading:!1,fail_visible:!1,success_visible:!1,import_visible:!1})}},{key:"isPositiveInteger",value:function(e){return/^[1-9]\d*$/.test(e)}},{key:"importConfirmClick",value:function(){var e=this.state.exceldata.filter((function(e){return"success"==e.type})),t=Object(C.a)(e,(function(e){return e.mobile})),a=this.state.model;a.quantity=this.state.excel_count-this.state.error_count+t.length,this.setState({import_success:!0,model:a,accessVerify:!1,excel_visible:!1,import_visible:!1,mobile_repeat:t})}},{key:"importClick",value:function(){this.state.file_loading?h.a.error("\u6587\u4ef6\u6b63\u5728\u89e3\u6790\u4e2d\u8bf7\u7a0d\u7b49"):this.state.success_visible?this.setState({excel_visible:!0,accessVerify:!1,import_visible:!1}):h.a.error("\u8bf7\u4e0a\u4f20\u6b63\u786e\u7684\u6587\u4ef6")}},{key:"fileChange",value:function(e){var t=this,a=e.target.files[0];if(this.setState({upload_visible:!0,myfile:a}),a.name.indexOf(".xls")||a.name.indexOf(".xlsx")||a.name.indexOf(".csv")){if(a.size>1024e3)return void h.a.error("\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u5927\u4e8e2M");var n=new FormData;n.append("file",a),n.append("path","white_list_excel"),this.setState({file_loading:!0}),Object(s.sd)(n).then((function(e){Object(s.cc)(e,(function(e,a){var n={excel:e.path};(sessionStorage.getItem("plan_id")||sessionStorage.getItem("plan_id_copy"))&&(n.plan_id=sessionStorage.getItem("plan_id")||sessionStorage.getItem("plan_id_copy")),1===t.props.isSettlement&&(n.plan_creat=!0),t.setState({mobile_excel:e.path}),Object(s.P)(n).then((function(e){t.setState({file_loading:!1}),Object(s.cc)(e,(function(e,a){var n=e.count-e.errorCount;t.setState({excel_count:e.count,accessVerify:!0,error_count:e.errorCount,success_count:n,exceldata:e.validationFailed,success_visible:!0});var i=sessionStorage.getItem("phone_number_all")?JSON.parse(sessionStorage.getItem("phone_number_all")):[],s=i.find((function(e){return e.key===t.props.step_id}));s?s.phone_number=e.phone_number:i.push({key:t.props.step_id,phone_number:e.phone_number}),sessionStorage.setItem("phone_number_all",JSON.stringify(i))}),(function(e){h.a.error(e),t.setState({success_visible:!1})}))}))}),(function(e){h.a.error(e),t.setState({success_visible:!1})}))}))}else this.setState({success_visible:!1})}},{key:"resetUpload",value:function(){this.setState({import_visible:!0,excel_visible:!1,accessVerify:!0})}},{key:"switchChange",value:function(e,t){t.type=e?"success":"success"==t.type?"repeat":"error"}},{key:"downLoadTemplate",value:function(){window.location.href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/%E7%99%BD%E5%90%8D%E5%8D%95%E6%A8%A1%E6%9D%BF.xlsx"}},{key:"productEditShow",value:function(e){var t=this;if(this.props.direct_reseller_id>0)if(this.setState({tableLoading:!0}),2===e.type){var a=e.origin;this.state.isCopy&&delete a.id,this.setState({product_title:"\u7f16\u8f91\u7acb\u51cf\u91d1",productData:a,addIsType:"addKnockGold"}),setTimeout((function(){t.setState({drawerVisible2:!0,tableLoading:!1})}),300)}else if(3===e.type){var n=e.origin;this.state.isCopy&&delete n.id,this.setState({product_title:"\u7f16\u8f91\u7ea2\u5305",productData:n,addIsType:"redPackets"}),setTimeout((function(){t.setState({tableLoading:!1,drawerVisible2:!0})}),300)}else this.getProductInfoSelectData(this.props.direct_reseller_id).then((function(a){sessionStorage.setItem("productsList",JSON.stringify(a)),"2"===sessionStorage.getItem("KeyPcType")&&delete e.code_batch_id,t.setState({product_title:"\u7f16\u8f91\u5546\u54c1",productData:e,addIsType:"addProduct"}),setTimeout((function(){t.setState({drawerVisible2:!0,tableLoading:!1})}),300)}));else h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546")}},{key:"dynamicComponents",value:function(){return 1===this.props.keyType?1===this.state.exchangeType?Object(b.jsx)(Bn,{ref:"addEditExchangeEl",editData:this.state.rowExchangeData,direct_reseller_id:this.props.direct_reseller_id,isSettlement:this.props.isSettlement,settlementData:this.props.settlementData}):Object(b.jsx)(zn,{propsData:this.state.rowExchangeData,ref:"addEditExchangeEl"}):Object(b.jsx)(Nt,{couponType:1,editData:this.state.rowCouponData,isAuditButton:!1,ref:"addEditCouponEl",direct_reseller_id:this.props.direct_reseller_id})}},{key:"setModelChange",value:function(e,t){var a=this.state.model;a[e]=t,this.setState({model:a})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"step2",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:{batch_name:[{type:"required",message:"\u8bf7\u8f93\u5165key\u6279\u6b21\u540d\u79f0"}],key_official_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u5b98\u65b9\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:"^[0-9]+(.[0-9]{1,4})?$"}],key_cost_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u6210\u672c\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:"^[0-9]+(.[0-9]{1,4})?$"}]},ref:"form1",children:[Object(b.jsx)(c.a,{labelname:" key\u6837\u5f0f",prop:"style",id:"style",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onStyleChange(t)},value:this.state.model.style,children:[Object(b.jsx)(me.a,{value:1,disabled:this.props.name>0&&6==this.state.model.style,children:"\u4e32\u7801"}),Object(b.jsx)(me.a,{value:2,disabled:this.props.name>0&&6==this.state.model.style||1===this.props.isSettlement&&this.props.settlementData&&2===this.props.settlementData.key,children:"\u94fe\u63a5"}),Object(b.jsx)(me.a,{value:4,disabled:this.props.name>0&&6==this.state.model.style||1===this.props.isSettlement&&this.props.settlementData&&2===this.props.settlementData.key,children:"\u4e8c\u7ef4\u7801"}),Object(b.jsx)(me.a,{value:6,disabled:this.props.name>0&&6!=this.state.model.style,children:"\u767d\u540d\u5355"})]})}),this.state.isload&&1===this.props.isSettlement?Object(b.jsx)(c.a,{labelname:"\u6210\u672c\u4ef7",prop:"key_cost_price",id:"key_cost_price",children:Object(b.jsx)(r.a,{onChange:function(t){e.setModelChange("key_cost_price",t)},onClearItem:function(t){e.setModelChange("key_cost_price","")},value:this.state.model.key_cost_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}):null,this.state.isload&&1===this.props.isSettlement?Object(b.jsx)(c.a,{labelname:"\u5b98\u65b9\u4ef7",prop:"key_official_price",id:"key_official_price",children:Object(b.jsx)(r.a,{onChange:function(t){e.setModelChange("key_official_price",t)},onClearItem:function(t){e.setModelChange("key_official_price","")},value:this.state.model.key_official_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}):null,this.state.isload?Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21\u540d\u79f0",prop:"batch_name",id:"batch_name",children:Object(b.jsx)(r.a,{onChange:function(t){e.setModelChange("batch_name",t)},onClearItem:function(t){e.setModelChange("batch_name","")},value:this.state.model.batch_name,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}):null,this.state.isload?Object(b.jsx)(c.a,{labelname:"key\u6570\u91cf",prop:"quantity",id:"quantity",children:Object(b.jsxs)("div",{className:"key_number",children:[Object(b.jsx)(r.a,{onChange:function(t){e.setModelChange("quantity",t),e.setModelChange("val",""),e.setModelChange("per","")},onClearItem:function(t){e.setModelChange("quantity",""),e.setModelChange("val",""),e.setModelChange("per","")},value:this.state.model.quantity,disabled:6==this.state.model.style,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:5,height:"36px",width:"520px",alignment:"left"}),this.state.white_visible?Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.initUpload(),e.setState({import_visible:!0})},children:"\u5bfc\u5165\u767d\u540d\u5355"}):null]})}):null,this.state.isload&&2==this.props.send_method?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(c.a,{labelname:"\u5e93\u5b58\u9884\u8b66\u503c",prop:"warningValue",id:"warningValue",required:"",children:Object(b.jsxs)("div",{className:"warningValue",children:[Object(b.jsx)(r.a,{disabled:this.state.model.quantity<1,onChange:function(t){isNaN(Number(t))||t>99.99||(e.setModelChange("per",t),e.setModelChange("val",Math.ceil(t/100*e.state.model.quantity)||""))},onClearItem:function(t){e.setModelChange("val",""),e.setModelChange("per","")},countShow:!1,value:this.state.model.per,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",height:"36px",unit:"%",width:"240px",alignment:"left"}),"-",Object(b.jsxs)("div",{className:"icon-box",children:[Object(b.jsx)(r.a,{disabled:this.state.model.quantity<1,onChange:function(t){if(!isNaN(Number(t))){if(e.state.model.quantity=Number(t.target.value)))return void h.a.error("key\u7801\u6709\u6548\u671f\u4e0d\u80fd\u8d85\u8fc7\u8ba1\u5212\u6709\u6548\u671f(".concat(s,"\u5929)"));var c=e.state.model;c.expiration_value=t.target.value,e.setState({model:c})}}})}):null,Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u7c7b\u578b",prop:"bind_object",id:"bind_object",children:Object(b.jsxs)(ae.a.Group,{value:this.props.keyType,onChange:function(t){e.onCheckChange(t)},children:[Object(b.jsx)(ae.a,{value:1,disabled:0!==this.props.name,children:"\u5151\u6362\u7801"}),Object(b.jsx)(ae.a,{value:2,disabled:0!==this.props.name||1===this.props.isSettlement,children:"\u4f18\u60e0\u5238"})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"btn",required:!1,children:1===this.props.keyType?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(m.a,{disabled:1===this.props.isSettlement&&this.state.distdata.length>=1,onClick:function(t){1===e.props.isSettlement&&e.state.distdata.length>=1?h.a.error("\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5151\u6362\u7801"):e.planAddExchangeCoupon(0)},children:"\u65b0\u5efa\u5151\u6362\u7801"}),Object(b.jsx)(ma.a,{trigger:"hover",content:"\u4e00\u6b21\u6027\u5145\u503c\u591a\u5f20\u7acb\u51cf\u91d1",children:Object(b.jsx)(m.a,{disabled:1===this.props.isSettlement&&this.state.distdata.length>=1||1===this.props.isSettlement&&this.props.settlementData&&7===this.props.settlementData.key,onClick:function(t){1===e.props.isSettlement&&e.state.distdata.length>=1?h.a.error("\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5151\u6362\u7801"):e.planAddExchangeCoupon(2)},children:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1"})})]}):Object(b.jsx)(m.a,{onClick:function(t){e.planAddExchangeCoupon(1)},children:"\u65b0\u5efa\u4f18\u60e0\u5238"})}),Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u5bf9\u8c61",prop:"grid",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:1===this.props.keyType?this.state.distdata:this.state.couponData,Column:1===this.props.keyType?this.state.Column:this.state.Column_coupon,ref:"tempdata",countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(t){e.pageChange(t)},checkChange:function(e){},ComponentHandler:function(t,a,n){return"restrict"==t?Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u6570\u91cf",width:120,maxLength:5,disabled:2==a.recharge_type||1==a.period_type&&1===e.props.isSettlement,value:a.restrict,onChange:function(t){e.onRestrict(t,a,n)}}):"product"===t?function(e){var t,a=e.legal.map((function(e){return e.product_name})),n=e.reduce.map((function(e){return e.batch_goods_name})),i=null===(t=e.cash)||void 0===t?void 0:t.map((function(e){return e.batch_goods_name})),s=a.concat(n,i);return s=s.join(","),Object(b.jsx)("span",{children:s})}(a.product):"edit"==t?Object(b.jsx)("span",{onClick:function(t){e.rowItemClick(a,n)},style:{color:"#2B66F2"},children:"\u7f16\u8f91"}):void 0}})}),Object(b.jsx)(c.a,{labelname:"\u91cd\u590d\u9009\u62e9\u5546\u54c1",id:"allow_repetition",prop:"allow_repetition",children:Object(b.jsxs)(te.a,{onChange:function(t){return e.onRepetitionChange(t)},value:this.state.model.allow_repetition,children:[Object(b.jsx)(me.a,{value:1,children:"\u662f"}),Object(b.jsx)(me.a,{value:0,children:"\u5426"})]})}),Object(b.jsx)(c.a,{labelname:"\u662f\u5426\u5141\u8bb8\u4e8f\u635f",id:"allow_loss",prop:"allow_loss",children:Object(b.jsxs)(te.a,{onChange:function(t){return e.onLossChange(t)},value:this.state.model.allow_loss,children:[Object(b.jsx)(me.a,{value:1,children:"\u662f"}),Object(b.jsx)(me.a,{value:0,children:"\u5426"})]})})]}),Object(b.jsx)("div",{className:"btnadd-key",onClick:function(){e.addNewKey()},children:"\u6dfb\u52a0\u65b0\u7684\u6279\u6b21key"}),Object(b.jsx)(ht.a,{width:"90%",title:this.state.draw_title,footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.codeSubmit(t)},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(t){e.closeDraw()},children:"\u53d6\u6d88"})]}),visible:this.state.drawerVisible,onClose:function(t){e.closeDraw()},maskClosable:!1,children:this.dynamicComponents()}),this.state.import_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal"}),Object(b.jsxs)("div",{className:"import-excel",children:[Object(b.jsxs)("div",{className:"import-header",children:[Object(b.jsx)("div",{className:"import-title",children:"\u4eceExcel\u5bfc\u5165\u767d\u540d\u5355"}),Object(b.jsx)(w.a,{type:"close",className:"import-close",onClick:function(t){e.setState({import_visible:!1})}})]}),Object(b.jsxs)("div",{className:"step-bar",children:[Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code active",children:"1"}),Object(b.jsx)("span",{className:"step-label active",children:"\u4e0a\u4f20\u6587\u4ef6"})]}),Object(b.jsx)("div",{className:"step-center",children:Object(b.jsx)("div",{className:"step-line"})}),Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code",children:"2"}),Object(b.jsx)("span",{className:"step-label",children:"\u5bfc\u5165\u5b8c\u6210"})]})]}),Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u76f4\u63a5\u4e0a\u4f20"}),Object(b.jsxs)("div",{className:"upload-info",children:[Object(b.jsx)("div",{children:"\u652f\u6301\u6587\u4ef6\u7c7b\u578b\uff1axls\uff0cxlsx\uff0ccsv"}),Object(b.jsx)("div",{children:"- \u652f\u6301\u6240\u6709\u57fa\u7840\u5b57\u6bb5\u7684\u5bfc\u5165\uff0c\u4e00\u6b21\u81f3\u591a\u5bfc\u5165 10000 \u6761\u624b\u673a\u53f7\uff08\u4e0d\u7b26\u5408\u89c4\u5219\u6574\u6761\u4efb\u52a1\u4e0d\u4e88\u4ee5\u5bfc\u5165\uff09"})]})]}),this.state.upload_visible?Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"upload-msgbar",children:[Object(b.jsxs)("div",{className:"execel-name",children:[Object(b.jsx)(w.a,{type:"text-guide-o",className:"doc-flag"}),Object(b.jsx)("span",{className:"excel-txt",children:this.state.myfile.name})]}),this.state.file_loading?Object(b.jsxs)("div",{className:"file-tag",children:[Object(b.jsx)(w.a,{type:"loading",spin:!0,className:"file-loading"}),Object(b.jsx)("span",{className:"excel-txt",children:"\u89e3\u6790\u4e2d "})]}):Object(b.jsxs)("div",{className:"file-tag",children:[Object(b.jsx)("input",{type:"file",className:"upload-input",onChange:function(t){return e.fileChange(t)}}),Object(b.jsx)(w.a,{type:"up-circle-o",className:"upload-flag"}),Object(b.jsx)("span",{className:"excel-txt",children:"\u66f4\u65b0\u6587\u4ef6 "})]})]}),this.state.success_visible?Object(b.jsxs)("div",{className:"file-tip success",children:[Object(b.jsx)(w.a,{type:"check-circle",className:"success-icon"}),"\u6587\u4ef6\u89e3\u6790\u6210\u529f,\u70b9\u51fb\u786e\u5b9a\u5bfc\u5165 \u5373\u53ef\u5bfc\u5165"]}):null,this.state.fail_visible?Object(b.jsxs)("div",{className:"file-tip error",children:[Object(b.jsx)(w.a,{type:"error-circle",className:"error-icon"}),"\u6587\u4ef6\u89e3\u6790\u5931\u8d25,\u8bf7\u67e5\u770b\u5bfc\u5165\u89c4\u5219\u5e76\u66f4\u65b0\u6587\u4ef6"]}):null]}):Object(b.jsxs)("div",{children:[Object(b.jsx)("input",{type:"file",className:"upload-input",onChange:function(t){return e.fileChange(t)}}),Object(b.jsx)(m.a,{className:"btn-upload",style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u4e0a\u4f20\u6587\u4ef6"})," "]}),Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u4e0b\u8f7d\u6a21\u677f\u5e76\u586b\u5199\u540e\u4e0a\u4f20"}),Object(b.jsx)("div",{className:"upload-info",children:Object(b.jsx)("div",{children:"\u8bf7\u5148\u4e0b\u8f7d\u300c\u6570\u5b57\u4e16\u754c\u8425\u9500\u7ba1\u7406\u7cfb\u7edf_\u767d\u540d\u5355_\u6a21\u677f\u300d\u5e76\u6309\u7167\u6a21\u677f\u586b\u5199\u540e\u518d\u4e0a\u4f20\u3002"})})]}),Object(b.jsx)(m.a,{type:"default",className:"btn-download",onClick:function(t){e.downLoadTemplate(t)},children:"\u4e0b\u8f7d\u6a21\u677f"}),Object(b.jsx)("div",{className:"foot-bar",children:Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(t){e.setState({import_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.importClick(t)},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})})]})]}):null,this.state.excel_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal"}),Object(b.jsxs)("div",{className:"import-excel",children:[Object(b.jsxs)("div",{className:"import-header",children:[Object(b.jsx)("div",{className:"import-title",children:"\u4eceExcel\u5bfc\u5165\u767d\u540d\u5355"}),Object(b.jsx)(w.a,{type:"close",className:"import-close",onClick:function(t){e.setState({excel_visible:!1})}})]}),Object(b.jsxs)("div",{className:"file-upload-tip",children:["\u6587\u4ef6\u4e0a\u4f20\u6210\u529f.\u5171",this.state.excel_count,"\u6761\u624b\u673a\u53f7,\u5176\u4e2d",this.state.success_count,"\u6761\u53ef\u6210\u529f\u5bfc\u5165"]}),Object(b.jsxs)("div",{className:"file-errmsg",children:["\u53d1\u73b0\u4ee5\u4e0b",this.state.error_count,"\u6761\u4e0d\u7b26\u5408\u8981\u6c42,\u5c06\u4e0d\u4f1a\u88ab\u5bfc\u5165"]}),Object(b.jsx)("div",{}),Object(b.jsx)("div",{className:"gridpanel",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:this.state.exceldata,value:this.state.exceldata,Column:Kn,maxheight:200,isMultiple:!1,countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(t){e.pageChange(t)},ComponentHandler:function(t,a,n){if("is_import"==t){if("success"==a.type||"repeat"==a.type){var i="success"==a.type;return Object(b.jsx)(S.a,{checked:i,onChange:function(t){e.switchChange(t,a)}})}return Object(b.jsx)("div",{className:"isImport",children:"-"})}}})}),Object(b.jsx)("div",{className:"foot-bar",children:Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(t){e.resetUpload()},children:"\u91cd\u65b0\u4e0a\u4f20"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.importConfirmClick(t)},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})})]})]}):null]})}}]),a}(u.a.Component),Un=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={model:{theme_id:"",use:1,link:1},select_theme:null,keyType:sessionStorage.getItem("keyType")},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(e){this.getThemeData()}},{key:"getThemeData",value:function(){var e=this,t={},a=sessionStorage.getItem("white"),n=sessionStorage.getItem("keyType");if(this.setState({keyType:n}),"2"===n){var i=this.state.model;i.link=1,this.setState({model:i}),t.page="1"===a?8:4}else t.page="1"===a?1:3;Object(s.Ob)(t).then((function(t){Object(s.cc)(t,(function(t,a){var n=Object(C.a)(t,(function(e){var t={};return t.key=e.id,t.text=e.title,t})),i=e.state.model;if(i.theme_id="",e.setState({model:i,options:n}),e.props.data&&e.props.data.theme_id){var s=e.state.options.find((function(t){return t.key==e.props.data.theme_id})),c=e.state.model;c.theme_id=s,e.setState({model:c,theme_id:e.props.data.theme_id})}}),(function(e){}))}))}},{key:"submit",value:function(){var e=!1;return this.refs.form1.validator()&&((e={}).theme_id=this.state.model.theme_id.key,e.use=this.state.model.use,e.link=this.state.model.link),e}},{key:"onCancel",value:function(){this.refs.form1.cancel()}},{key:"onLinkChange",value:function(e){var t=this.state.model;t.link=e.target.value,this.setState({model:t})}},{key:"onListChange",value:function(e){var t=this.state.model;t.list=e.target.value,this.setState({model:t})}},{key:"onUserChange",value:function(e){var t=this.state.model;t.link=e.target.value,this.setState({model:t})}},{key:"onThemeChange",value:function(e){var t=this.state.model;t.theme_id=e,this.setState({model:t})}},{key:"linkToPage",value:function(){var e=window.location.href.replace(window.location.hash,"#/home/mytempMould");window.open(e,"_blank")}},{key:"refresh",value:function(){this.getThemeData()}},{key:"edit",value:function(e){var t={theme_id:192,use:e.use,link:e.link};this.setState({model:t})}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"step3",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:{theme_id:[{type:"required",message:"\u8bf7\u9009\u62e9\u843d\u5730\u9875"}]},ref:"form1",children:[Object(b.jsxs)(c.a,{labelname:"\u9009\u62e9\u843d\u5730\u9875",prop:"theme_id",id:"theme_id",children:[Object(b.jsx)(ne.a,{options:this.state.options,placeholder:"\u9009\u62e9\u4e00\u9879",width:355,value:this.state.model.theme_id,onChange:function(t){e.onThemeChange(t),Rt.a.emit("change","theme_id",t)}}),Object(b.jsx)("a",{type:"refresh",onClick:function(){e.refresh()},className:"refresh-btn",children:"\u5237\u65b0"}),Object(b.jsx)("a",{type:"primary",onClick:function(){e.linkToPage()},className:"newpage",children:"\u65b0\u5efa\u843d\u5730\u9875"})]}),Object(b.jsx)(c.a,{labelname:"\u57df\u540d\u9009\u62e9",prop:"link",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onUserChange(t)},value:this.state.model.link,children:[Object(b.jsx)(ma.a,{trigger:"hover",content:"22233.cn ",children:Object(b.jsx)(me.a,{value:1,children:"\u5927\u5ba2\u6237"})}),Object(b.jsx)(ma.a,{trigger:"hover",content:"83323.cn",children:Object(b.jsx)(me.a,{value:2,disabled:"2"===this.state.keyType,children:"\u666e\u901a\u5546\u6237"})}),Object(b.jsx)(ma.a,{trigger:"hover",content:"86885.cn",children:Object(b.jsx)(me.a,{value:3,disabled:"2"===this.state.keyType,children:"\u5907\u7528"})})]})})]})})}}]),a}(u.a.Component),Qn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).setTlementType=function(e){n.setState({isSettlement:e}),n.setState({keys:["step2-0"]})},n.setDistributionMethod=function(e){n.setState({send_method:e})},n.setTlementData=function(e){n.setState({settlementData:e})},n.phoneChange=function(e){n.setState({phone:e.target.value})},n.emailChange=function(e){n.setState({email:e.target.value})},n.getDirectResellerId=function(e){n.setState({direct_reseller_id:e.direct_reseller_id})},n.state={keys:["step2-0"],step1_pagetitle:"\u65b0\u5efa\u8ba1\u5212",step2_pagetitle:"\u751f\u6210key",step3_pagetitle:"\u7ed1\u5b9a\u843d\u5730\u9875",curstep:1,menuList:[{id:1,title:"\u8425\u9500\u8ba1\u5212",child:[{step:1,title:"\u65b0\u5efa\u8ba1\u5212"}]},{id:2,title:"key",child:[{step:1,title:"\u751f\u6210key"},{step:2,title:"\u7ed1\u5b9a\u5361\u5238"}]},{id:3,title:"\u843d\u5730\u9875",child:[{step:1,title:"\u7ed1\u5b9a\u843d\u5730\u9875"}]}],phone_list:[],email_list:[],phone:"",email:"",email_radio:-1,phone_radio:-1,audit_visible:!1,card_visible:!1,step1:null,paytype:3,reseller:"",payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],isload:!1,is_audit:!1,whiteStyle:!1,keyStyle:1,direct_reseller_id:0,keyType:1,isSettlement:2,settlementData:null,send_method:1},n}return Object(y.a)(a,[{key:"submit",value:function(){this.refs.step1.submit()}},{key:"onReturn",value:function(){var e=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:" \u662f\u5426\u8fd4\u56de\u8ba1\u5212\u5217\u8868?"}),onConfirm:function(){e.props.history.push("/home/plan-list/")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"componentDidMount",value:function(e){sessionStorage.setItem("white",3),sessionStorage.setItem("plan_id",""),sessionStorage.setItem("keyType","1")}},{key:"onConfirm",value:function(e){var t=this,a=sessionStorage.getItem("plan_id");this.setState({audit_visible:!1,is_audit:!0});var n={reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.email_list[0],payment_direction:this.state.payment_direction[this.state.paytype-1]};Object(s.g)(a,n).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success("\u6210\u529f\u53d1\u8d77\u5ba1\u6279"),t.props.history.push("/home/plan-list/"),t.setState({is_audit:!1})}),(function(e){h.a.error(e)}))}))}},{key:"onPayTypeChange",value:function(e){this.setState({paytype:e.target.value})}},{key:"onNextStep",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a,n,i,c,o,r,l,d,u=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.state.curstep>=1)){e.next=9;break}return e.next=3,this.refs.step1.submit();case 3:if(e.t0=e.sent,1!=e.t0){e.next=8;break}this.setState({curstep:2,isload:!0}),e.next=9;break;case 8:return e.abrupt("return");case 9:if(!(this.state.curstep>=2)){e.next=42;break}t=[],a=0;case 12:if(!(a0&&this.refs[this.state.keys[t]].setkeyStyle(6)}else{sessionStorage.setItem("white",3);for(var a=0;a0&&this.refs[this.state.keys[a]].setkeyStyle(1);this.setState({whiteStyle:!1})}}},{key:"onPhoneChange",value:function(e){this.setState({phone_radio:e.target.value})}},{key:"onEmailChange",value:function(e){this.setState({email_radio:e.target.value})}},{key:"cancel",value:function(e){this.setState({audit_visible:!1})}},{key:"closeStep",value:function(e){this.state.keys[e]="",this.setState({keys:this.state.keys})}},{key:"getStep3Theme",value:function(){this.state.card_visible&&this.refs.step3.getThemeData()}},{key:"send",value:function(e){var t=this,a=sessionStorage.getItem("plan_id"),n={phone:this.state.phone_radio>-1?this.state.phone_list[this.state.phone_radio]:this.state.phone,email:this.state.email_radio>-1?this.state.email_list[this.state.email_radio]:this.state.email};new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$").test(n.phone)?Object(s.mc)(a,n).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success("\u53d1\u9001\u6210\u529f,\u8bf7\u57281-2\u5206\u949f\u540e\u67e5\u770b"),t.props.history.push("/home/plan-list/")}),(function(e){h.a.error(e),t.props.history.push("/home/plan-list/")}))})):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"plan-add",children:[Object(b.jsx)("div",{className:"plan-left",children:this.state.menuList.map((function(t,a){return Object(b.jsxs)("div",{className:"box-item",children:[Object(b.jsx)("div",{className:"main-title",children:t.title}),t.child.map((function(a,n){return Object(b.jsxs)("div",{className:"title-inline",children:[Object(b.jsxs)("div",{className:e.state.curstep>=t.id?"child-title active":"child-title",children:[a.title," "]},a.title),e.state.curstep>=t.id?Object(b.jsx)(w.a,{type:"check",className:"checkIcon"}):null]},n)})),Object(b.jsx)("div",{className:"under-line"})]},t.title)}))}),Object(b.jsx)("div",{className:"plan-right",children:Object(b.jsxs)("div",{className:"action-panel",children:[Object(b.jsxs)("div",{id:"step1",className:"step1",children:[Object(b.jsx)("div",{className:"plan-title",children:"\u8425\u9500\u8ba1\u5212"}),Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.step1_pagetitle,children:Object(b.jsx)(Ln,{ref:"step1",setTlementType:function(t){return e.setTlementType(t)},setDistributionMethod:function(t){return e.setDistributionMethod(t)},setTlementData:function(t){return e.setTlementData(t)},onGetDirectResellerId:function(t){return e.getDirectResellerId(t)}})})]}),this.state.curstep>=2?Object(b.jsxs)("div",{id:"step2",className:"step2",children:[Object(b.jsx)("div",{className:"plan-title",children:"key"}),this.state.keys.map((function(t,a){return t?Object(b.jsx)(p.a,{style:{width:"100%",height:"auto",marginBottom:"10px"},title:e.state.step2_pagetitle,action:a>0?Object(b.jsx)("span",{className:"zent-link",target:"_blank",onClick:function(t){e.closeStep(a)},children:"\u5173\u95ed"}):null,children:Object(b.jsx)(Gn,{ref:t,addNewkey:function(){e.addNewkey()},onStyleChange:function(t){e.onStyleChange(t)},step_id:a,getStep3Theme:function(){return e.getStep3Theme()},keyStyle:e.state.keyStyle,keyType:e.state.keyType,setKeyType:function(t){return e.setState({keyType:t})},isload:e.state.isload,curstep:e.state.curstep,direct_reseller_id:e.state.direct_reseller_id,name:a,whiteStyle:e.state.whiteStyle,isSettlement:e.state.isSettlement,send_method:e.state.send_method,settlementData:e.state.settlementData})},a):null}))]}):null,this.state.card_visible?Object(b.jsx)("div",{id:"step3",className:"step3",children:Object(b.jsx)(p.a,{style:{width:"100%",height:"auto"},title:this.state.step3_pagetitle,children:Object(b.jsx)(Un,{ref:"step3"})})}):null,3==this.state.curstep?Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}):Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},children:"\u4e0b\u4e00\u6b65"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}),this.state.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onPayTypeChange(t)},value:this.state.paytype,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onConfirm(t)},children:"\u786e\u5b9a"})]})]})]}):null]})})]})}}]),a}(u.a.Component),$n=(a(313),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).setTlementType=function(e){n.setState({isSettlement:e}),n.setState({keys:["step2-0"]}),n.refs["step2-0"]&&n.refs["step2-0"].clearTableData()},n.setDistributionMethod=function(e){n.setState({send_method:e}),n.setState({keys:["step2-0"]}),n.refs["step2-0"]&&n.refs["step2-0"].clearTableData()},n.setTlementData=function(e){n.setState({settlementData:e}),n.setState({keys:["step2-0"]}),n.refs["step2-0"]&&n.refs["step2-0"].clearTableData()},n.getDirectResellerId=function(e){n.setState({direct_reseller_id:e.direct_reseller_id})},n.phoneChange=function(e){n.setState({phone:e.target.value})},n.emailChange=function(e){n.setState({email:e.target.value})},n.state={keys:[],step1_pagetitle:"\u4fee\u6539\u8ba1\u5212",step2_pagetitle:"\u751f\u6210key",step3_pagetitle:"\u7ed1\u5b9a\u5361\u5238",curstep:1,menuList:[{id:1,title:"\u8425\u9500\u8ba1\u5212",child:[{step:1,title:"\u65b0\u5efa\u8ba1\u5212"}]},{id:2,title:"key",child:[{step:1,title:"\u751f\u6210key"},{step:2,title:"\u7ed1\u5b9a\u5361\u5238"}]},{id:3,title:"\u843d\u5730\u9875",child:[{step:1,title:"\u7ed1\u5b9a\u843d\u5730\u9875"}]}],phone_list:[],email_list:[],phone:"",email:"",email_radio:-1,phone_radio:-1,audit_visible:!1,card_visible:!1,recall_visible:!1,step1_data:null,step2_data:null,step3_data:null,disabled:!1,disabled_time:!1,paytype:3,reseller:null,payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],approvalLoading:!1,timer:3,theme_options:[],isload:!1,is_Edit:!1,whiteStyle:!1,btn_loading:!1,direct_reseller_id:0,direct_reseller_name:"",keyType:1,isSettlement:2,send_method:1,settlementData:null},n}return Object(y.a)(a,[{key:"submit",value:function(){this.refs.step1.submit()}},{key:"onReturn",value:function(){var e=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:" \u662f\u5426\u8fd4\u56de\u8ba1\u5212\u5217\u8868?"}),onConfirm:function(){e.props.history.push("/home/plan-list/")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"componentDidMount",value:function(e){var t=this,a=sessionStorage.getItem("bm_obj");if(a){var n=JSON.parse(a);n.settlement_type>0&&this.setState({isSettlement:1,settlementData:{key:n.settlement_type,text:n.settlement_type_text}})}var i=sessionStorage.getItem("plan_status");3!=i&&4!=i&&5!=i&&2!=i||this.setState({disabled:!0});var c=sessionStorage.getItem("plan_id"),o=sessionStorage.getItem("approval_id");Number(o)>0?Object(s.T)(o).then((function(e){Object(s.cc)(e,(function(e,a){try{t.setState({send_method:e.info.send_method}),Object(s.Cb)(e.info.reseller_id).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({direct_reseller_id:e.direct_reseller_id,direct_reseller_name:e.direct_reseller_name})}))}))}catch(o){}if(e.info&&(sessionStorage.setItem("step1",JSON.stringify(e.info)),t.refs.step1.edit(e.info)),e.keys.length>0&&0==t.state.disabled){t.setState({curstep:2}),e.keys=t.tranFormData(e);for(var n=0;n0&&0==t.state.disabled){t.setState({curstep:2}),e.keys=t.tranFormData(e);for(var n=0;n=1)){e.next=8;break}return e.next=3,this.refs.step1.submit();case 3:if(!e.sent){e.next=7;break}this.setState({curstep:2,isload:!0}),e.next=8;break;case 7:return e.abrupt("return");case 8:if(!(this.state.curstep>=2)){e.next=44;break}t=[],a=0;case 11:if(!(a-1?this.state.phone_list[this.state.phone_radio]:this.state.phone,email:this.state.email_radio>-1?this.state.email_list[this.state.email_radio]:this.state.email};new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$").test(n.phone)?Object(s.mc)(a,n).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success("\u53d1\u9001\u6210\u529f,\u8bf7\u57281-2\u5206\u949f\u540e\u67e5\u770b"),t.props.history.push("/home/plan-list/")}),(function(e){h.a.success("\u53d1\u9001\u6210\u529f,\u8bf7\u57281-2\u5206\u949f\u540e\u67e5\u770b"),t.props.history.push("/home/plan-list/")}))})):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"onEditInfo",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(){var t,a=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=sessionStorage.getItem("plan_id"),this.state.is_Edit){e.next=10;break}return this.setState({is_Edit:!0}),e.next=5,this.refs.step1.submit(t);case 5:if(!e.sent){e.next=9;break}setTimeout((function(){a.setState({is_Edit:!1}),a.props.history.push("/home/plan-list/")}),1500),e.next=10;break;case 9:this.setState({is_Edit:!1});case 10:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"onConfirm",value:function(e){var t=this;if(1!=this.state.btn_loading){this.setState({btn_loading:!0});var a=sessionStorage.getItem("plan_id");sessionStorage.getItem("plan_status");this.setState({audit_visible:!1});var n=sessionStorage.getItem("approval_id");if(n>0)Object(s.U)(n).then((function(e){setTimeout((function(){t.setState({btn_loading:!1})}),500),Object(s.cc)(e,(function(e,n){if(0==e.status&&t.setState({recall_visible:!0}),1==e.status&&(h.a.error("\u8fdb\u884c\u4e2d\u7684\u8ba1\u5212\u4e0d\u80fd\u63d0\u4ea4\u5ba1\u6838"),setTimeout((function(){t.props.history.push("/home/plan-list/")}),2e3)),2==e.status||3==e.status){var i={reseller_id:t.state.reseller.id,reseller_name:t.state.reseller.name,company_name:t.state.reseller.company_name,receive_email:t.state.reseller.contact_email[0],payment_direction:t.state.payment_direction[t.state.paytype-1]};if(t.state.direct_reseller_id<=0)return void h.a.error("\u8bf7\u6dfb\u52a0\u6620\u5c04\u5206\u9500\u5546");Object(s.g)(a,i).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({audit_visible:!1}),h.a.success("\u6210\u529f\u53d1\u8d77\u5ba1\u6279"),t.props.history.push("/home/plan-list/")}),(function(e){h.a.error(e)}))}))}}),(function(e){h.a.error(e)}))}));else{var i={reseller_id:this.state.reseller.id,reseller_name:this.state.reseller.name,company_name:this.state.reseller.company_name,receive_email:this.state.email_list[0],payment_direction:this.state.payment_direction[this.state.paytype-1]};Object(s.g)(a,i).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success("\u6210\u529f\u53d1\u8d77\u5ba1\u6279"),t.setState({audit_visible:!1}),t.props.history.push("/home/plan-list/")}),(function(e){h.a.error(e)}))}))}}}},{key:"onPayTypeChange",value:function(e){this.setState({paytype:e.target.value})}},{key:"onReCall",value:function(){var e=this,t=sessionStorage.getItem("approval_id");this.setState({recall_visible:!1}),Object(s.pd)(t).then((function(t){Object(s.cc)(t,(function(t,a){e.setState({approvalLoading:!0});var n=setInterval((function(){e.state.timer<=0&&(clearInterval(n),e.setState({approvalLoading:!1}),h.a.success("\u64a4\u9500\u6210\u529f,\u8bf7\u91cd\u65b0\u63d0\u4ea4\u5ba1\u6838"));var t=e.state.timer-1;e.setState({timer:t})}),1e3)}),(function(e){h.a.error(e)}))}))}},{key:"onStyleChange",value:function(e){if(6==e.target.value){this.setState({keyStyle:6,whiteStyle:!0}),sessionStorage.setItem("white",1);for(var t=0;t0&&this.refs[this.state.keys[t]].setkeyStyle(6)}else{sessionStorage.setItem("white",3);for(var a=0;a0&&this.refs[this.state.keys[a]].setkeyStyle(1);this.setState({whiteStyle:!1})}}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"plan-edit",children:this.state.disabled?Object(b.jsx)("div",{className:"plan-main",children:Object(b.jsxs)("div",{className:"action-panel",children:[Object(b.jsxs)("div",{id:"step1",className:"step1",children:[Object(b.jsx)("div",{className:"plan-title",children:"\u8425\u9500\u8ba1\u5212"}),Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.step1_pagetitle,children:Object(b.jsx)(Ln,{ref:"step1",data:this.state.step1_data,disabled:this.state.disabled,direct_reseller_name:this.state.direct_reseller_name})})]}),Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onEditInfo()},children:"\u4fee\u6539"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]})]})}):Object(b.jsxs)("div",{className:"plan-main",children:[Object(b.jsx)("div",{className:"plan-left",style:{top:"60px"},children:this.state.menuList.map((function(t,a){return Object(b.jsxs)("div",{className:"box-item",children:[Object(b.jsx)("div",{className:"main-title",children:t.title}),t.child.map((function(a,n){return Object(b.jsxs)("div",{className:"title-inline",children:[Object(b.jsxs)("div",{className:e.state.curstep>=t.id?"child-title active":"child-title",children:[a.title," "]},a.title),e.state.curstep>=t.id?Object(b.jsx)(w.a,{type:"check",className:"checkIcon"}):null]},n)})),Object(b.jsx)("div",{className:"under-line"})]},t.title)}))}),Object(b.jsx)("div",{className:"plan-right",children:Object(b.jsxs)("div",{className:"action-panel",children:[Object(b.jsxs)("div",{id:"step1",className:"step1",children:[Object(b.jsx)("div",{className:"plan-title",children:"\u8425\u9500\u8ba1\u5212"}),Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.step1_pagetitle,children:Object(b.jsx)(Ln,{ref:"step1",data:this.state.step1_data,disabled:this.state.disabled,onGetDirectResellerId:function(t){return e.getDirectResellerId(t)},setTlementType:function(t){return e.setTlementType(t)},setDistributionMethod:function(t){return e.setDistributionMethod(t)},setTlementData:function(t){return e.setTlementData(t)},direct_reseller_name:this.state.direct_reseller_name})})]}),this.state.curstep>=2?Object(b.jsxs)("div",{id:"step2",className:"step2",children:[Object(b.jsx)("div",{className:"plan-title",children:"key"}),this.state.keys.map((function(t,a){return t?Object(b.jsx)(p.a,{style:{width:"100%",height:"auto",marginBottom:"10px"},title:e.state.step2_pagetitle,action:a>0?Object(b.jsx)("span",{className:"zent-link",target:"_blank",onClick:function(t){e.closeStep(a)},children:"\u5173\u95ed"}):null,children:Object(b.jsx)(Gn,{ref:"step2-"+a,addNewkey:function(){e.addNewkey()},name:a,onStyleChange:function(t){e.onStyleChange(t)},is_Edit:!0,step_id:a,keyType:e.state.keyType,setKeyType:function(t){return e.setState({keyType:t})},getStep3Theme:function(){return e.getStep3Theme()},curstep:e.state.curstep,whiteStyle:e.state.whiteStyle,keyStyle:e.state.keyStyle,isload:e.state.isload,data:t,direct_reseller_id:e.state.direct_reseller_id,disabled:e.state.disabled,isSettlement:e.state.isSettlement,send_method:e.state.send_method,settlementData:e.state.settlementData})}):null}))]}):null,this.state.card_visible?Object(b.jsx)("div",{id:"step3",className:"step3",children:Object(b.jsx)(p.a,{style:{width:"100%",height:"auto"},title:this.state.step3_pagetitle,children:Object(b.jsx)(Un,{ref:"step3",data:this.state.step3_data,options:this.state.theme_options,disabled:this.state.disabled})})}):null,this.state.card_visible?Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},disabled:this.state.disabled,children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}):Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},disabled:this.state.disabled,children:"\u4e0b\u4e00\u6b65"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}),this.state.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onPayTypeChange(t)},value:this.state.paytype,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onConfirm(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.recall_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.onReturn(t)}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u5ba1\u6838\u4e2d"}),Object(b.jsx)("div",{className:"audit-box-txt",children:"\u63d0\u4ea4\u5ba1\u6838\u4f1a\u5c06\u539f\u6765\u5ba1\u6279\u64a4\u56de\u624d\u53ef\u8fdb\u884c\u63d0\u4ea4,\u662f\u5426\u64a4\u56de?"}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({recall_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onReCall(t)},children:"\u786e\u5b9a"})]})]})]}):null,this.state.approvalLoading?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)("div",{className:"audit-box-title",children:"\u64a4\u9500\u5ba1\u6279\u4e2d"}),Object(b.jsxs)("div",{className:"audit-box-txt",children:["\u6b63\u5728\u53d1\u8d77\u64a4\u9500...,\u8bf7\u7b49\u5f85",Object(b.jsxs)("span",{style:{color:"red"},children:[" ",this.state.timer]}),"\u79d2"]})]})]}):null]})})]})})}}]),a}(u.a.Component)),Zn=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).setTlementType=function(e){n.setState({isSettlement:e}),n.setState({keys:["step2-0"]}),n.refs["step2-0"].clearTableData()},n.setDistributionMethod=function(e){n.setState({send_method:e})},n.setTlementData=function(e){n.setState({settlementData:e}),n.setState({keys:["step2-0"]}),n.refs["step2-0"].clearTableData()},n.phoneChange=function(e){n.setState({phone:e.target.value})},n.emailChange=function(e){n.setState({email:e.target.value})},n.getDirectResellerId=function(e){n.setState({direct_reseller_id:e.direct_reseller_id})},n.state={keys:[],step1_pagetitle:"\u65b0\u5efa\u8ba1\u5212",step2_pagetitle:"\u751f\u6210key",step3_pagetitle:"\u7ed1\u5b9a\u843d\u5730\u9875",curstep:1,menuList:[{id:1,title:"\u8425\u9500\u8ba1\u5212",child:[{step:1,title:"\u65b0\u5efa\u8ba1\u5212"}]},{id:2,title:"key",child:[{step:1,title:"\u751f\u6210key"},{step:2,title:"\u7ed1\u5b9a\u5361\u5238"}]},{id:3,title:"\u843d\u5730\u9875",child:[{step:1,title:"\u7ed1\u5b9a\u843d\u5730\u9875"}]}],button_conf:[],phone_list:[],email_list:[],phone:"",email:"",email_radio:-1,phone_radio:-1,audit_visible:!1,card_visible:!1,step1:null,paytype:3,reseller:"",payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],isload:!1,is_audit:!1,whiteStyle:!1,keyStyle:1,direct_reseller_id:0,step1_data:null,step2_data:null,step3_data:null,disabled:!1,keyType:1,send_method:1,isSettlement:2,settlementData:null},n}return Object(y.a)(a,[{key:"submit",value:function(){this.refs.step1.submit()}},{key:"onReturn",value:function(){var e=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:" \u662f\u5426\u8fd4\u56de\u8ba1\u5212\u5217\u8868?"}),onConfirm:function(){e.props.history.push("/home/plan-list/")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"componentDidMount",value:function(e){var t=sessionStorage.getItem("bm_obj");if(t){var a=JSON.parse(t);a.settlement_type>0&&this.setState({isSettlement:1,settlementData:{key:a.settlement_type,text:a.settlement_type_text}})}sessionStorage.setItem("plan_id","");var n=sessionStorage.getItem("plan_id_copy");this.setState({plan_id_detail:n}),this.getDetails(n)}},{key:"getDetails",value:function(e){var t=this,a=sessionStorage.getItem("copy_count_golod");Object(s.Vb)(e).then((function(e){Object(s.cc)(e,(function(e,n){if(Object(s.Cb)(e.info.reseller_id).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({direct_reseller_id:e.direct_reseller_id})}))})),e.info&&(e.info.title="".concat(e.info.title,"_").concat(Number(a)+1).substring(0,12),sessionStorage.setItem("step1",JSON.stringify(e.info)),t.setState({send_method:e.info.send_method,button_conf:e.info.button_conf}),t.refs.step1.edit(e.info)),e.keys.length>0&&0==t.state.disabled){t.setState({curstep:2}),e.keys=t.tranFormData(e);for(var i=0;i=1)){e.next=9;break}return e.next=3,this.refs.step1.submit();case 3:if(e.t0=e.sent,1!=e.t0){e.next=8;break}this.setState({curstep:2,isload:!0}),e.next=9;break;case 8:return e.abrupt("return");case 9:if(!(this.state.curstep>=2)){e.next=42;break}t=[],a=0;case 12:if(!(a0&&this.refs[this.state.keys[t]].setkeyStyle(6)}else{sessionStorage.setItem("white",3);for(var a=0;a0&&this.refs[this.state.keys[a]].setkeyStyle(1);this.setState({whiteStyle:!1})}}},{key:"onPhoneChange",value:function(e){this.setState({phone_radio:e.target.value})}},{key:"onEmailChange",value:function(e){this.setState({email_radio:e.target.value})}},{key:"cancel",value:function(e){this.setState({audit_visible:!1})}},{key:"closeStep",value:function(e){this.state.keys[e]="",this.setState({keys:this.state.keys})}},{key:"send",value:function(e){var t=this,a=sessionStorage.getItem("plan_id"),n={phone:this.state.phone_radio>-1?this.state.phone_list[this.state.phone_radio]:this.state.phone,email:this.state.email_radio>-1?this.state.email_list[this.state.email_radio]:this.state.email};new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$").test(n.phone)?Object(s.mc)(a,n).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success("\u53d1\u9001\u6210\u529f,\u8bf7\u57281-2\u5206\u949f\u540e\u67e5\u770b"),t.props.history.push("/home/plan-list/")}),(function(e){h.a.error(e),t.props.history.push("/home/plan-list/")}))})):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"plan-add",children:[Object(b.jsx)("div",{className:"plan-left",style:{paddingTop:"125px"},children:this.state.menuList.map((function(t,a){return Object(b.jsxs)("div",{className:"box-item",children:[Object(b.jsx)("div",{className:"main-title",children:t.title}),t.child.map((function(a,n){return Object(b.jsxs)("div",{className:"title-inline",children:[Object(b.jsxs)("div",{className:e.state.curstep>=t.id?"child-title active":"child-title",children:[a.title," "]},a.title),e.state.curstep>=t.id?Object(b.jsx)(w.a,{type:"check",className:"checkIcon"}):null]},n)})),Object(b.jsx)("div",{className:"under-line"})]},t.title)}))}),Object(b.jsx)("div",{className:"plan-right",children:Object(b.jsxs)("div",{className:"action-panel",children:[Object(b.jsxs)("div",{id:"step1",className:"step1",children:[Object(b.jsx)("div",{className:"plan-title",children:"\u8425\u9500\u8ba1\u5212"}),Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.step1_pagetitle,children:Object(b.jsx)(Ln,{ref:"step1",data:this.state.step1_data,onGetDirectResellerId:function(t){return e.getDirectResellerId(t)},setTlementType:function(t){return e.setTlementType(t)},setDistributionMethod:function(t){return e.setDistributionMethod(t)},setTlementData:function(t){return e.setTlementData(t)}})})]}),this.state.curstep>=2?Object(b.jsxs)("div",{id:"step2",className:"step2",children:[Object(b.jsx)("div",{className:"plan-title",children:"key"}),this.state.keys.map((function(t,a){return t?Object(b.jsx)(p.a,{style:{width:"100%",height:"auto",marginBottom:"10px"},title:e.state.step2_pagetitle,action:a>0?Object(b.jsx)("span",{className:"zent-link",target:"_blank",onClick:function(t){e.closeStep(a)},children:"\u5173\u95ed"}):null,children:Object(b.jsx)(Gn,{ref:t,addNewkey:function(){e.addNewkey()},onStyleChange:function(t){e.onStyleChange(t)},step_id:a,keyStyle:e.state.keyStyle,getStep3Theme:function(){return e.getStep3Theme()},curstep:e.state.curstep,keyType:e.state.keyType,setKeyType:function(t){return e.setState({keyType:t})},isCopy:!0,isload:e.state.isload,direct_reseller_id:e.state.direct_reseller_id,name:a,whiteStyle:e.state.whiteStyle,isSettlement:e.state.isSettlement,send_method:e.state.send_method,settlementData:e.state.settlementData})},a):null}))]}):null,this.state.card_visible?Object(b.jsx)("div",{id:"step3",className:"step3",children:Object(b.jsx)(p.a,{style:{width:"100%",height:"auto"},title:this.state.step3_pagetitle,children:Object(b.jsx)(Un,{ref:"step3"})})}):null,3==this.state.curstep?Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}):Object(b.jsxs)("div",{className:"step-btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},children:"\u4e0b\u4e00\u6b65"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onReturn()},children:"\u53d6\u6d88"})]}),this.state.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.setState({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(t){e.onPayTypeChange(t)},value:this.state.paytype,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.setState({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.onConfirm(t)},children:"\u786e\u5b9a"})]})]})]}):null]})})]})}}]),a}(u.a.Component),Xn=void 0,ei=function(e){return Array.from({length:e},(function(e,t){return t}))},ti={quantity:[{type:"required",message:"key\u6570\u91cf\u4e0d\u80fd\u4e3a0"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u6b63\u6574\u6570",reg:"^([1-9][0-9]*){1,3}$"}],bind_object:[{type:"required",message:"\u8bf7\u9009\u62e9\u7ed1\u5b9a\u7c7b\u578b"}],batch_name:[{type:"required",message:"\u8bf7\u8f93\u5165key\u6279\u6b21\u540d\u79f0"}],key_official_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u5b98\u65b9\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:"^[0-9]+(.[0-9]{1,4})?$"}],key_cost_price:[{type:"required",message:"\u8bf7\u8f93\u5165\u6210\u672c\u4ef7"},{type:"regExp",message:"\u6700\u591a\u4fdd\u75594\u4f4d\u5c0f\u6570",reg:"^[0-9]+(.[0-9]{1,4})?$"}]},ai=[{title:"\u884c\u53f7",name:"line",prop:"line",width:"30px",type:"normal"},{title:"\u624b\u673a\u53f7",width:"80px",prop:"mobile",name:"mobile",type:"normal"},{title:"\u9519\u8bef\u539f\u56e0",width:"80px",prop:"tips",name:"tips",type:"normal"},{title:"\u662f\u5426\u5bfc\u5165",width:"50px",prop:"is_import",name:"is_import",type:"slot"}],ni=function(){var e=Object(U.a)({pageTitle:"\u7f16\u8f91key",isEdit:!1,import_visible:!1,success_visible:!1,fail_visible:!1,file_loading:!1,upload_visible:!1,excel_visible:!1,accessVerify:!1,excel_count:0,success_count:0,send_method:1,error_count:0,exceldata:[],warningPersonOptions:[],myfile:{},audit_visible:!1,key_status:-1,exchangeType:1,keyType:Number(sessionStorage.getItem("keyType")),rowIndex:-1,distdata:[],couponData:[],rowCouponData:"",rowExChangeData:"",Column:[{title:"\u5151\u6362\u540d\u79f0",name:"title",prop:"title",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u8303\u56f4",prop:"product",name:"product",width:"auto",type:"slot"},{title:"\u6709\u6548\u5f00\u59cb\u65e5\u671f",prop:"begin_time",name:"begin_time",width:"auto",type:"normal"},{title:"\u6709\u6548\u7ed3\u675f\u65e5\u671f",name:"end_time",prop:"end_time",type:"normal",width:"auto"},{title:"\u5151\u6362\u7801\u6570\u91cf",name:"quantity",type:"normal",prop:"quantity",defaultText:"PM",width:"auto"},{title:"\u7ed1\u5b9a\u6570",prop:"restrict",name:"restrict",type:"slot",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}],Column_coupon:[{title:"\u4f18\u60e0\u5238\u540d\u79f0",name:"title",prop:"title",type:"normal",width:"auto"},{title:"\u4f18\u60e0\u5238\u8303\u56f4",prop:"product",name:"product",width:"auto",type:"slot"},{title:"\u6709\u6548\u5f00\u59cb\u65e5\u671f",prop:"begin_time",name:"begin_time",width:"auto",type:"normal"},{title:"\u6709\u6548\u7ed3\u675f\u65e5\u671f",name:"end_time",prop:"end_time",type:"normal",width:"auto"},{title:"\u4f18\u60e0\u5238\u6570\u91cf",name:"quantity",type:"normal",prop:"quantity",defaultText:"PM",width:"auto"},{title:"\u7ed1\u5b9a\u6570",prop:"restrict",name:"restrict",type:"slot",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}],KeyPcType:sessionStorage.getItem("KeyPcType"),draw_title:"",drawerVisible:!1,direct_reseller_id:0,plan_id:"",id:"",reseller:{},payment_direction:["\u5bf9\u79c1\u8d26\u6237","\u5bf9\u516c\u8d26\u6237","\u9884\u4ed8\u6b3e\u6263\u9664"],payType:3,copyKeyCodeId:"",reseller_id:"",white_visible:!1,keyCodeId:"",settlement_type:sessionStorage.getItem("plan_list_settlement")?JSON.parse(sessionStorage.getItem("plan_list_settlement")).key:0,isSettlement:sessionStorage.getItem("isSettlement")?1:2,settlementData:sessionStorage.getItem("plan_list_settlement")?JSON.parse(sessionStorage.getItem("plan_list_settlement")):null}),t=Object(i.a)(e,2),a=t[0],n=t[1],l=Object(d.useRef)(null),u=Object(d.useRef)(null),f=Object(d.useRef)(null),j=Object(d.useRef)(null),g=Object(U.a)({plan_title:"",batch_name:"",style:1,allow_repetition:0,allow_loss:0,quantity:"0",stock:"",merge_stock:1,mobile_excel:"",mobile_repeat:[],key_official_price:"",key_cost_price:"",expiration_type:"1",expiration_value:"",person:[],val:"",per:""}),y=Object(i.a)(g,2),_=y[0],v=y[1];Object(d.useEffect)((function(){x(),Object(s.Tb)().then((function(e){var t=e.data.data.map((function(e,t){return{key:t,text:e.real_name,mobile:e.mobile}}));n({warningPersonOptions:t})}))}),[]);var x=function(){var e,t=sessionStorage.getItem("plan_item");if(t){var i=JSON.parse(t);v({plan_title:i.title}),n({plan_id:i.id,reseller_id:i.reseller_id,send_method:i.send_method}),e=i.reseller_id,Object(s.Cb)(e).then((function(e){Object(s.cc)(e,(function(e,t){n({direct_reseller_id:e.direct_reseller_id}),n({reseller:e})}),(function(e){h.a.error(e)}))}))}if("3"===a.KeyPcType){n({pageTitle:"\u65b0\u589ekey"});var c=sessionStorage.getItem("keyStyle");1===Number(c)&&(v({style:6}),n({white_visible:!0}))}else"1"===a.KeyPcType?(k(),n({pageTitle:"\u7f16\u8f91key"})):(k(),n({pageTitle:"\u590d\u5236key"}))},O=function(e){var t=e.target.files[0];if(n({myfile:t}),n({upload_visible:!0}),t.name.indexOf(".xls")||t.name.indexOf(".xlsx")||t.name.indexOf(".csv")){if(t.size>1024e3)return void h.a.error("\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u5927\u4e8e2M");var i=new FormData;i.append("file",t),i.append("path","white_list_excel"),n({file_loading:!0}),Object(s.sd)(i).then((function(e){Object(s.cc)(e,(function(e,t){var i={excel:e.path,plan_id:a.plan_id};v({mobile_excel:e.path}),Object(s.P)(i).then((function(e){n({file_loading:!1}),Object(s.cc)(e,(function(e,t){var a=e.count-e.errorCount;n({excel_count:e.count,accessVerify:!0,error_count:e.errorCount,success_count:a,exceldata:e.validationFailed,success_visible:!0})}),(function(e){h.a.error(e),n({success_visible:!1})}))}))}),(function(e){h.a.error(e),n({success_visible:!1})}))}))}else n({success_visible:!1})},k=function(){var e=sessionStorage.getItem("keybatch_id");Object(s.lb)(e).then((function(e){Object(s.cc)(e,(function(e,t){n({key_status:e.status,id:e.id,keyCodeId:e.id,send_method:e.plan.send_method}),N(e)}),(function(e){}))}))},N=function(e){var t,i,s;v({batch_name:e.batch_name,style:e.style,allow_repetition:e.allow_repetition,allow_loss:e.allow_loss,quantity:e.quantity,stock:e.stock,merge_stock:e.merge_stock,mobile_excel:e.mobile_excel,person:null!==(t=e.warning_conf)&&void 0!==t&&t.person?e.warning_conf.person.map((function(e,t){return{key:t,text:e.name,mobile:e.phone}})):[],per:(null===(i=e.warning_conf)||void 0===i?void 0:i.per)||"",val:(null===(s=e.warning_conf)||void 0===s?void 0:s.val)||"",mobile_repeat:e.mobile_repeat,key_official_price:e.key_official_price,key_cost_price:e.key_cost_price,expiration_type:e.expiration_conf?e.expiration_conf.expiration_type:"1",expiration_value:e.expiration_conf?e.expiration_conf.expiration_value:""});var c=[];c=1===Number(e.bind_object[0])?e.code_batch:e.coupon,"2"===a.KeyPcType?(v({batch_name:"".concat(e.batch_name,"_").concat(++e.copy_count).substring(0,12)}),c=c.map((function(e){var t;delete e.id,delete e.status;var a=e.product;return a.legal.map((function(e){return delete e.code_batch_id,delete e.status,delete e.goods_id,e})),a.reduce.map((function(e){return delete e.id,delete e.status,delete e.goods_id,e})),null===(t=a.cash)||void 0===t||t.map((function(e){return delete e.id,delete e.status,delete e.goods_id,e})),e}))):Object(C.a)(c,(function(e){return e.checked=!0,e.status&&-1!==Number(e.status)&&(e.disabled=!0),e})),1===Number(e.bind_object[0])?n({distdata:c}):n({couponData:c})},D=function(){return"2"!==a.KeyPcType&&("1"===a.KeyPcType?1!==a.key_status:void 0)},I=function(e){switch(e){case 0:n({draw_title:"\u65b0\u5efa\u5151\u6362\u7801",exchangeType:1}),setTimeout((function(){f.current.clearExchangeForm()}),300);break;case 1:n({draw_title:"\u65b0\u5efa\u4f18\u60e0\u5238"}),setTimeout((function(){j.current.clearCouponForm()}),300);break;case 2:n({draw_title:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1",exchangeType:2,rowExChangeData:null}),setTimeout((function(){f.current.clearExchangeForm()}),300)}n({drawerVisible:!0,rowIndex:-1})},T=function(){2===a.keyType&&setTimeout((function(){j.current.clearCouponForm()}),300),1===a.keyType&&setTimeout((function(){f.current.clearExchangeForm()}),300),n({drawerVisible:!1})},F=function(){if(_.val&&_.person.length<1)return h.a.error("\u8bf7\u9009\u62e9\u9884\u8b66\u4eba"),!1;if(l.current.validator()){if(1===a.keyType){if(a.distdata.length<=0)return void h.a.error("\u8bf7\u6dfb\u52a0\u7ed1\u5b9a\u5bf9\u8c61")}else if(a.couponData.length<=0)return void h.a.error("\u8bf7\u6dfb\u52a0\u7ed1\u5b9a\u5bf9\u8c61");var e=u.current.getSelectData();if(e.length<=0)return void h.a.error("\u8bf7\u52fe\u9009\u7ed1\u5b9a\u5bf9\u8c61");if(e.filter((function(e){return""===e.restrict})).length>0)return void h.a.error("\u7ed1\u5b9a\u6570\u4e0d\u80fd\u4e3a\u7a7a");!function(){var e=!1,t=sessionStorage.getItem("keybatch_id"),i=[];if(1===a.keyType){if(2==_.expiration_type&&_.expiration_value.length<1)return h.a.error("\u8bf7\u9009\u62e9\u56fa\u5b9a\u65f6\u95f4\u6bb5");if(3==_.expiration_type&&!_.expiration_value)return h.a.error("\u8bf7\u8f93\u5165\u63a5\u53e3\u8c03\u53d6\u540e\u6709\u6548\u671f");i=a.distdata.filter((function(e){return!0===e.checked&&(-1===e.status||7===e.status||""===e.id||!e.id)})),D()&&i.length<=0&&(e=!0);for(var c=0;c0)L(1,e);else{var t=a.distdata.filter((function(e){return!0===e.checked&&!e.id}));L(0,t)}else L(1,e)}():function(){var e=a.couponData.filter((function(e){return!0===e.checked&&(-1===e.status||7===e.status||""===e.id||!e.id)}));if("3"===a.KeyPcType||"2"===a.KeyPcType)L(0,e);else if(1===a.key_status)if(a.couponData.filter((function(e){return e.id&&""!==e.id})).length>0)L(1,e);else{var t=a.couponData.filter((function(e){return!0===e.checked&&!e.id}));L(0,t)}else L(1,e)}()};return Object(b.jsxs)("div",{id:"addkey",className:"addkey",style:{width:"98%",height:"auto",margin:"0 auto"},children:[Object(b.jsx)(p.a,{title:a.pageTitle,children:Object(b.jsxs)(o.a,{model:_,rules:ti,ref:l,children:[Object(b.jsx)(c.a,{labelname:" key\u5f52\u5c5e\u8ba1\u5212",prop:"plan_title",id:"plan_title",children:Object(b.jsx)("div",{className:"line-value",children:_.plan_title})}),Object(b.jsx)(c.a,{labelname:" key\u6279\u6b21\u540d\u79f0",prop:"batch_name",id:"batch_name",children:Object(b.jsx)(r.a,{onChange:function(e){v({batch_name:e})},onClearItem:function(e){v({batch_name:""})},value:_.batch_name,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:" key\u6837\u5f0f",prop:"style",id:"style",children:Object(b.jsxs)(te.a,{onChange:function(e){!function(e){D()||v({style:e.target.value})}(e)},value:_.style,disabled:D(),children:[Object(b.jsx)(me.a,{value:1,disabled:6==_.style,children:"\u4e32\u7801"}),Object(b.jsx)(me.a,{value:2,disabled:6==_.style||2===a.settlement_type,children:"\u94fe\u63a5"}),Object(b.jsx)(me.a,{value:4,disabled:6==_.style||2===a.settlement_type,children:"\u4e8c\u7ef4\u7801"}),Object(b.jsx)(me.a,{value:6,disabled:6!=_.style,children:"\u767d\u540d\u5355"})]})}),1===a.isSettlement?Object(b.jsx)(c.a,{labelname:"\u6210\u672c\u4ef7",prop:"key_cost_price",id:"key_cost_price",children:Object(b.jsx)(r.a,{onChange:function(e){v({key_cost_price:e})},onClearItem:function(e){v({key_cost_price:""})},value:_.key_cost_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:12,height:"36px",disabled:"1"===a.KeyPcType,width:"520px",alignment:"left"})}):null,1===a.isSettlement?Object(b.jsx)(c.a,{labelname:"\u5b98\u65b9\u4ef7",prop:"key_official_price",id:"key_official_price",children:Object(b.jsx)(r.a,{onChange:function(e){v({key_official_price:e})},onClearItem:function(e){v({key_official_price:""})},value:_.key_official_price,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",disabled:"1"===a.KeyPcType,maxLength:12,height:"36px",width:"520px",alignment:"left"})}):null,"1"===a.KeyPcType?null:Object(b.jsx)(b.Fragment,{children:Object(b.jsx)(c.a,{labelname:"key\u6570\u91cf",prop:"quantity",id:"quantity",children:Object(b.jsxs)("div",{className:"key_number",children:[Object(b.jsx)(r.a,{onChange:function(e){v({quantity:e,val:"",per:""})},value:_.quantity,disabled:6===_.style,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:5,height:"36px",width:"520px",alignment:"left"}),a.white_visible?Object(b.jsx)(m.a,{type:"primary",onClick:function(e){n({file_loading:!1,fail_visible:!1,success_visible:!1,import_visible:!1,upload_visible:!1,excel_visible:!1,accessVerify:!1}),n({import_visible:!0})},children:"\u5bfc\u5165\u767d\u540d\u5355"}):null]})})}),"3"===a.KeyPcType||"2"===a.KeyPcType?null:Object(b.jsx)(c.a,{labelname:"key\u53d1\u653e",prop:"quantity",id:"quantity",children:Object(b.jsx)(r.a,{onChange:function(e){v({quantity:e})},value:_.quantity,disabled:6===_.style||"1"===a.KeyPcType,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:5,height:"36px",width:"520px",alignment:"left"})}),1===a.key_status||"3"===a.KeyPcType||"2"===a.KeyPcType?null:Object(b.jsx)(c.a,{labelname:"key\u5269\u4f59",prop:"stock",id:"stock",children:Object(b.jsx)(r.a,{onChange:function(e){},value:_.stock,disabled:!0,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:5,height:"36px",width:"520px",alignment:"left"})}),2==a.send_method?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(c.a,{labelname:"\u5e93\u5b58\u9884\u8b66\u503c",prop:"warningValue",id:"warningValue",required:"",children:Object(b.jsxs)("div",{className:"warningValue",children:[Object(b.jsx)(r.a,{disabled:_.quantity<1,onChange:function(e){isNaN(Number(e))||e>99.99||v({per:e||"",val:Math.ceil(e/100*_.quantity)||""})},onClearItem:function(e){v({val:"",per:""})},countShow:!1,value:_.per,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",height:"36px",unit:"%",width:"240px",alignment:"left"}),"-",Object(b.jsxs)("div",{className:"icon-box",children:[Object(b.jsx)(r.a,{disabled:_.quantity<1,onChange:function(e){if(!isNaN(Number(e)))return _.quantity=Number(e.target.value)))return void h.a.error("key\u7801\u6709\u6548\u671f\u4e0d\u80fd\u8d85\u8fc7\u8ba1\u5212\u6709\u6548\u671f(".concat(i,"\u5929)"));v({expiration_value:e.target.value})}}})}):null,Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u7c7b\u578b",prop:"bind_object",id:"bind_object",children:Object(b.jsxs)(ae.a.Group,{value:a.keyType,disabled:!0,onChange:function(e){},children:[Object(b.jsx)(ae.a,{value:1,children:"\u5151\u6362\u7801"}),Object(b.jsx)(ae.a,{value:2,children:"\u4f18\u60e0\u5238"})]})}),Object(b.jsx)(c.a,{labelname:"",prop:"btn",required:!1,children:1===a.keyType?Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(m.a,{disabled:1===a.isSettlement&&a.distdata.length>=1,onClick:function(e){a.settlement_type>0&&a.distdata.length>=1?h.a.error("\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5151\u6362\u7801"):I(0)},children:"\u65b0\u5efa\u5151\u6362\u7801"}),Object(b.jsx)(ma.a,{trigger:"hover",content:"\u4e00\u6b21\u6027\u5145\u503c\u591a\u5f20\u7acb\u51cf\u91d1",children:Object(b.jsx)(m.a,{disabled:1===a.isSettlement&&a.distdata.length>=1||1===a.isSettlement&&a.settlementData&&7===a.settlementData.key,onClick:function(e){a.settlement_type>0&&a.distdata.length>=1?h.a.error("\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5151\u6362\u7801"):I(2)},children:"\u65b0\u5efa\u7ec4\u5408\u5546\u54c1"})})]}):Object(b.jsx)(m.a,{onClick:function(e){I(1)},children:"\u65b0\u5efa\u4f18\u60e0\u5238"})}),Object(b.jsx)(c.a,{labelname:"\u7ed1\u5b9a\u5bf9\u8c61",prop:"grid",children:Object(b.jsx)(q,{ref:u,headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:1===a.keyType?a.distdata:a.couponData,Column:1===a.keyType?a.Column:a.Column_coupon,countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(e){},checkChange:function(e){},ComponentHandler:function(e,t,i){if("restrict"==e)return Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u6570\u91cf",value:t.restrict,disabled:t.disabled||2==t.recharge_type||1==t.period_type&&1===a.isSettlement,maxLength:5,onChange:function(e){!function(e,t,i){1===a.keyType?(a.distdata[i].restrict=e.target.value,n({distdata:a.distdata})):(a.couponData[i].restrict=e.target.value,n({couponData:a.couponData}))}(e,0,i)}});if("product"===e)return function(e){var t,a=e.legal.map((function(e){return e.product_name})),n=e.reduce.map((function(e){return e.batch_goods_name})),i=null===(t=e.cash)||void 0===t?void 0:t.map((function(e){return e.batch_goods_name})),s=a.concat(n,i);return s=s.join(","),Object(b.jsx)("span",{children:s})}(t.product);if("edit"===e){var s=Object(b.jsx)("span",{onClick:function(e){!function(e,t){1===a.keyType?2==e.recharge_type?n({draw_title:"\u7f16\u8f91\u7ec4\u5408\u5546\u54c1",rowIndex:t,rowExChangeData:e,drawerVisible:!0,exchangeType:2}):n({draw_title:"\u7f16\u8f91\u5151\u6362\u7801",rowIndex:t,rowExChangeData:e,drawerVisible:!0,exchangeType:1}):n({draw_title:"\u7f16\u8f91\u4f18\u60e0\u5238",rowIndex:t,rowCouponData:e,drawerVisible:!0})}(t,i)},style:{color:"#2B66F2"},children:"\u7f16\u8f91"}),c=Object(b.jsx)("span",{style:{color:"#d6d6d6"},children:"\u7f16\u8f91"});return t.disabled?c:s}}})}),Object(b.jsx)(c.a,{labelname:"\u91cd\u590d\u9009\u62e9\u5546\u54c1",id:"allow_repetition",prop:"allow_repetition",children:Object(b.jsxs)(te.a,{disabled:D(),onChange:function(e){return function(e){v({allow_repetition:e.target.value})}(e)},value:_.allow_repetition,children:[Object(b.jsx)(me.a,{value:1,children:"\u662f"}),Object(b.jsx)(me.a,{value:0,children:"\u5426"})]})}),Object(b.jsx)(c.a,{labelname:"\u662f\u5426\u5141\u8bb8\u4e8f\u635f",id:"allow_loss",prop:"allow_loss",children:Object(b.jsxs)(te.a,{disabled:D(),onChange:function(e){return function(e){v({allow_loss:e.target.value})}(e)},value:_.allow_loss,children:[Object(b.jsx)(me.a,{value:1,children:"\u662f"}),Object(b.jsx)(me.a,{value:0,children:"\u5426"})]})})]})}),Object(b.jsxs)("div",{style:{marginTop:"15px"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return F()},children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.history.back()},onCancel:function(){},className:"questModal",parentComponent:Xn})},children:"\u53d6\u6d88"})]}),Object(b.jsx)(ht.a,{width:"90%",title:a.draw_title,footer:Object(b.jsxs)("div",{style:{textAlign:"center"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(e){!function(){if(2!==a.keyType){if(1!==a.keyType);else if(f.current.submit()){var e=f.current.getModel();if(1===a.isSettlement&&(e.restrict="1"),1===a.isSettlement&&2!==a.exchangeType&&[].concat(Object(ce.a)(e.product.legal),Object(ce.a)(e.product.reduce),Object(ce.a)(e.product.cash)).length>1&&!sessionStorage.getItem("has_combining"))return void h.a.error("\u5305\u7801\u53ea\u80fd\u521b\u5efa\u4e00\u4e2a\u5546\u54c1");var t=a.distdata;a.rowIndex>-1?(t[a.rowIndex]=e,n({distdata:t})):(t.push(e),n({distdata:t})),n({drawerVisible:!1})}}else if(j.current.submit()){var i=j.current.getModel(),s=a.couponData;a.rowIndex>-1?(s[a.rowIndex]=i,n({couponData:s})):(s.push(i),n({couponData:s})),n({drawerVisible:!1})}}()},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(e){T()},children:"\u53d6\u6d88"})]}),visible:a.drawerVisible,onClose:function(e){T()},maskClosable:!1,children:1===a.keyType?1===a.exchangeType?Object(b.jsx)(Bn,{direct_reseller_id:a.direct_reseller_id,editData:a.rowExChangeData,ref:f,isSettlement:a.isSettlement,settlementData:a.settlementData}):Object(b.jsx)(zn,{propsData:a.rowExChangeData,ref:f}):Object(b.jsx)(Nt,{couponType:1,editData:a.rowCouponData,isAuditButton:!1,ref:j,direct_reseller_id:a.direct_reseller_id})}),a.audit_visible?Object(b.jsxs)("div",{className:"audit",children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(e){n({audit_visible:!1})}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u63d0\u4ea4\u5ba1\u6838"}),Object(b.jsx)("div",{className:"payType",children:Object(b.jsxs)(te.a,{onChange:function(e){!function(e){n({payType:e.target.value})}(e)},value:a.payType,className:"audit-obj",children:[Object(b.jsx)(ae.a,{value:3,children:"\u9884\u4ed8\u6b3e\u6263\u9664"}),Object(b.jsx)(ae.a,{value:1,children:"\u5bf9\u79c1\u8d26\u6237"}),Object(b.jsx)(ae.a,{value:2,children:"\u5bf9\u516c\u8d26\u6237"})]})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(e){n({audit_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(e){M()},children:"\u786e\u5b9a"})]})]})]}):null,a.import_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal"}),Object(b.jsxs)("div",{className:"import-excel",children:[Object(b.jsxs)("div",{className:"import-header",children:[Object(b.jsx)("div",{className:"import-title",children:"\u4eceExcel\u5bfc\u5165\u767d\u540d\u5355"}),Object(b.jsx)(w.a,{type:"close",className:"import-close",onClick:function(e){n({import_visible:!1})}})]}),Object(b.jsxs)("div",{className:"step-bar",children:[Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code active",children:"1"}),Object(b.jsx)("span",{className:"step-label active",children:"\u4e0a\u4f20\u6587\u4ef6"})]}),Object(b.jsx)("div",{className:"step-center",children:Object(b.jsx)("div",{className:"step-line"})}),Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code",children:"2"}),Object(b.jsx)("span",{className:"step-label",children:"\u5bfc\u5165\u5b8c\u6210"})]})]}),Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u76f4\u63a5\u4e0a\u4f20"}),Object(b.jsxs)("div",{className:"upload-info",children:[Object(b.jsx)("div",{children:"\u652f\u6301\u6587\u4ef6\u7c7b\u578b\uff1axls\uff0cxlsx\uff0ccsv"}),Object(b.jsx)("div",{children:"- \u652f\u6301\u6240\u6709\u57fa\u7840\u5b57\u6bb5\u7684\u5bfc\u5165\uff0c\u4e00\u6b21\u81f3\u591a\u5bfc\u5165 10000 \u6761\u624b\u673a\u53f7\uff08\u4e0d\u7b26\u5408\u89c4\u5219\u6574\u6761\u4efb\u52a1\u4e0d\u4e88\u4ee5\u5bfc\u5165\uff09"})]})]}),a.upload_visible?Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"upload-msgbar",children:[Object(b.jsxs)("div",{className:"execel-name",children:[Object(b.jsx)(w.a,{type:"text-guide-o",className:"doc-flag"}),Object(b.jsx)("span",{className:"excel-txt",children:a.myfile.name})]}),a.file_loading?Object(b.jsxs)("div",{className:"file-tag",children:[Object(b.jsx)(w.a,{type:"loading",spin:!0,className:"file-loading"}),Object(b.jsx)("span",{className:"excel-txt",children:"\u89e3\u6790\u4e2d "})]}):Object(b.jsxs)("div",{className:"file-tag",children:[Object(b.jsx)("input",{type:"file",className:"upload-input",onChange:function(e){return O(e)}}),Object(b.jsx)(w.a,{type:"up-circle-o",className:"upload-flag"}),Object(b.jsx)("span",{className:"excel-txt",children:"\u66f4\u65b0\u6587\u4ef6 "})]})]}),a.success_visible?Object(b.jsxs)("div",{className:"file-tip success",children:[Object(b.jsx)(w.a,{type:"check-circle",className:"success-icon"}),"\u6587\u4ef6\u89e3\u6790\u6210\u529f,\u70b9\u51fb\u786e\u5b9a\u5bfc\u5165 \u5373\u53ef\u5bfc\u5165"]}):null,a.fail_visible?Object(b.jsxs)("div",{className:"file-tip error",children:[Object(b.jsx)(w.a,{type:"error-circle",className:"error-icon"}),"\u6587\u4ef6\u89e3\u6790\u5931\u8d25,\u8bf7\u67e5\u770b\u5bfc\u5165\u89c4\u5219\u5e76\u66f4\u65b0\u6587\u4ef6"]}):null]}):Object(b.jsxs)("div",{children:[Object(b.jsx)("input",{type:"file",className:"upload-input",onChange:function(e){return O(e)}}),Object(b.jsx)(m.a,{className:"btn-upload",style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u4e0a\u4f20\u6587\u4ef6"})," "]}),Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u4e0b\u8f7d\u6a21\u677f\u5e76\u586b\u5199\u540e\u4e0a\u4f20"}),Object(b.jsx)("div",{className:"upload-info",children:Object(b.jsx)("div",{children:"\u8bf7\u5148\u4e0b\u8f7d\u300c\u6570\u5b57\u4e16\u754c\u8425\u9500\u7ba1\u7406\u7cfb\u7edf_\u767d\u540d\u5355_\u6a21\u677f\u300d\u5e76\u6309\u7167\u6a21\u677f\u586b\u5199\u540e\u518d\u4e0a\u4f20\u3002"})})]}),Object(b.jsx)(m.a,{type:"default",className:"btn-download",onClick:function(e){window.location.href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/%E7%99%BD%E5%90%8D%E5%8D%95%E6%A8%A1%E6%9D%BF.xlsx"},children:"\u4e0b\u8f7d\u6a21\u677f"}),Object(b.jsx)("div",{className:"foot-bar",children:Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(e){n({import_visible:!1})},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(e){a.file_loading?h.a.error("\u6587\u4ef6\u6b63\u5728\u89e3\u6790\u4e2d\u8bf7\u7a0d\u7b49"):a.success_visible?n({excel_visible:!0,accessVerify:!1,import_visible:!1}):h.a.error("\u8bf7\u4e0a\u4f20\u6b63\u786e\u7684\u6587\u4ef6")},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})})]})]}):null,a.excel_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal"}),Object(b.jsxs)("div",{className:"import-excel",children:[Object(b.jsxs)("div",{className:"import-header",children:[Object(b.jsx)("div",{className:"import-title",children:"\u4eceExcel\u5bfc\u5165\u767d\u540d\u5355"}),Object(b.jsx)(w.a,{type:"close",className:"import-close",onClick:function(e){n({excel_visible:!1})}})]}),Object(b.jsxs)("div",{className:"file-upload-tip",children:["\u6587\u4ef6\u4e0a\u4f20\u6210\u529f.\u5171",a.excel_count,"\u6761\u624b\u673a\u53f7,\u5176\u4e2d",a.success_count,"\u6761\u53ef\u6210\u529f\u5bfc\u5165"]}),Object(b.jsxs)("div",{className:"file-errmsg",children:["\u53d1\u73b0\u4ee5\u4e0b",a.error_count,"\u6761\u4e0d\u7b26\u5408\u8981\u6c42,\u5c06\u4e0d\u4f1a\u88ab\u5bfc\u5165"]}),Object(b.jsx)("div",{}),Object(b.jsx)("div",{className:"gridpanel",children:Object(b.jsx)(q,{headBackgroud:"#f9fafc",isShowPageBar:!1,spliteColor:"#fff",tableData:a.exceldata,value:a.exceldata,Column:ai,maxheight:200,isMultiple:!1,countbarVisible:!1,isBorder:!0,isSwitch:!1,pageChange:function(e){Xn.pageChange(e)},ComponentHandler:function(e,t,a){if("is_import"==e){if("success"==t.type||"repeat"==t.type){var n="success"==t.type;return Object(b.jsx)(S.a,{checked:n,onChange:function(e){!function(e,t){t.type=e?"success":"success"==t.type?"repeat":"error"}(e,t)}})}return Object(b.jsx)("div",{className:"isImport",children:"-"})}}})}),Object(b.jsx)("div",{className:"foot-bar",children:Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(e){n({import_visible:!0,excel_visible:!1,accessVerify:!0})},children:"\u91cd\u65b0\u4e0a\u4f20"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(e){!function(){var e=a.exceldata.filter((function(e){return"success"==e.type})),t=Object(C.a)(e,(function(e){return e.mobile}));v({quantity:a.excel_count-a.error_count+t.length}),n({mobile_repeat:t,accessVerify:!1,model:_,excel_visible:!1,import_visible:!1,import_success:!0})}()},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})})]})]}):null]})},ii=(a(314),function(e){return Array.from({length:e},(function(e,t){return t}))}),si=Z()().format("YYYY-MM-DD HH:mm:ss"),ci=function(e){var t=e.data,a=void 0===t?[]:t,r=e.onColes,l=Object(d.useRef)(),u=Object(U.a)({expiration_type:"1",expiration_value:""}),p=Object(i.a)(u,2),f=p[0],j=p[1];return Object(d.useEffect)((function(){a.length<2&&j(Object(n.a)({},a[0].expiration_conf))}),[a]),Object(b.jsx)(b.Fragment,{children:Object(b.jsxs)(o.a,{ref:l,model:f,id:"keyDelay",children:[Object(b.jsx)(c.a,{labelname:"\u5f53\u524dkey\u6279\u6b21\u6709\u6548\u671f:",id:"keyDelay",children:Object(b.jsx)("p",{children:K(a[0].batch_expiration_conf)})}),Object(b.jsx)(c.a,{labelname:"key\u7801\u6709\u6548\u671f:",prop:"expiration_type",id:"keyDelay",children:Object(b.jsxs)(ae.a.Group,{value:f.expiration_type,onChange:function(e){j({expiration_value:"",expiration_type:e.target.value})},children:[Object(b.jsx)(ae.a,{value:"1",children:"\u4e0d\u8bbe\u7f6e"}),Object(b.jsx)(ae.a,{value:"2",children:"\u56fa\u5b9a\u65f6\u95f4\u6bb5"}),Object(b.jsx)(ae.a,{value:"3",children:"\u63a5\u53e3\u8c03\u53d6\u540e\u6709\u6548\u671f"})]})}),"2"===f.expiration_type?Object(b.jsx)(c.a,{labelname:"\u56fa\u5b9a\u65f6\u95f4\u6bb5:",id:"keyDelay",children:Object(b.jsx)(ie.a,{className:"zent-datepicker-plan",showTime:{format:"HH:mm:ss",defaultTime:[Z()().format("HH:mm:ss"),"23:59:59"]},format:"YYYY-MM-DD HH:mm:ss",value:f.expiration_value,onChange:function(e){j({expiration_value:e})},disabledDate:function(e,t){var a=JSON.parse(sessionStorage.getItem("knockGold_effectDate")),n=!1,i=Z()(e).format("YYYY-MM-DD HH:mm:ss"),s=Z()(a.end_time).format("HH:mm:ss");return"start"==t&&(n=s<"23:59:59"?Z()(i).isBefore(si)||Z()(i).subtract(1,"days").isAfter(a.end_time):Z()(i).isBefore(si)||Z()(i).isAfter(a.end_time)),"end"==t&&(n=Z()(i).add(1,"days").isBefore(si)||Z()(i).isAfter(a.end_time)),n},disabledTime:function(e,t){var a=new Date(si),n=a.getHours(),i=a.getMinutes(),s=a.getSeconds();return Object(Q.a)(e,a)?{disabledHours:function(){return ii(n)},disabledMinutes:function(e){return e===n?ii(i):[]},disabledSeconds:function(e,t){return e===n&&t===i?ii(s):[]}}:{}}})}):null,"3"===f.expiration_type?Object(b.jsx)(c.a,{labelname:"\u63a5\u53e3\u8c03\u53d6\u540e\u6709\u6548\u671f:",id:"keyDelay",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u5929\u6570",value:f.expiration_value,width:120,maxLength:5,onChange:function(e){var t=sessionStorage.getItem("knockGold_effectDate");if(t){t=JSON.parse(t);var a=new Date(si),n=new Date(t.end_time).getTime()-a.getTime(),i=Math.ceil(n/864e5);if(!(i>=Number(e.target.value)))return h.a.clear(),void h.a.error("key\u7801\u6709\u6548\u671f\u4e0d\u80fd\u8d85\u8fc7\u8ba1\u5212\u6709\u6548\u671f(".concat(i,"\u5929)"));j({expiration_value:e.target.value})}}})}):null,a.length>1?Object(b.jsx)("p",{className:"tip",children:"*\u63d0\u4ea4\u540e\u5c06\u4f1a\u5bf9\u6240\u6709\u9009\u4e2dkey\u7801\u8fdb\u884c\u6279\u91cf\u66f4\u65b0\u6709\u6548\u671f\uff0c\u8bf7\u8c28\u614e\u64cd\u4f5c"}):null,Object(b.jsxs)("p",{className:"keyDelay-but",children:[Object(b.jsx)(m.a,{onClick:function(){r(!1)},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(){if(2==f.expiration_type&&(!f.expiration_value||f.expiration_value.filter((function(e){return e})).length<2))return h.a.error("\u8bf7\u9009\u62e9\u56fa\u5b9a\u65f6\u95f4\u6bb5");if(3==f.expiration_type&&!f.expiration_value)return h.a.error("\u8bf7\u8f93\u5165\u63a5\u53e3\u8c03\u53d6\u540e\u6709\u6548\u671f");var e=a.map((function(e){return e.key}));Object(s.rd)({expiration_conf:f,keys:e}).then((function(e){200==e.code?(h.a.success(e.message),r(!0)):h.a.error(e.message)})).catch((function(e){h.a.error(e.message)}))},htmlType:"submit",children:"\u63d0\u4ea4"})]})]})})},oi=(a(315),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={dataCount:0,page:1,limit:10,keyDelayVisible:!1,keyDelay:[],tabList:[{title:"\u5168\u90e8",index:0},{title:"\u53ef\u4f7f\u7528",index:1},{title:"\u5df2\u4f7f\u7528",index:2},{title:"\u5df2\u5b8c\u7ed3",index:3},{title:"\u5df2\u4f5c\u5e9f",index:4}],distdata:[{title:"\u58eb\u5927\u592b\u5927\u5e08\u5085"}],filterList:[{id:0,label:"\u72b6\u6001",prop:"status",menuList:[{id:999,name:"\u5168\u90e8"},{id:0,name:"\u521b\u5efa\u4e2d"},{id:2,name:"\u5ba1\u6838\u4e2d"},{id:3,name:"\u5f85\u751f\u6548"},{id:4,name:"\u8fdb\u884c\u4e2d"},{id:5,name:"\u6682\u505c\u4e2d"},{id:6,name:"\u5df2\u5b8c\u7ed3"}]}],tableHeight:500,menuList:[{id:0,name:"\u72b6\u6001",check:!1}],phone_list:[],email_list:[],phone:"",email:"",email_radio:-1,phone_radio:-1,search:"",audit_visible:!1,cur_item:null,selectiondata:[],plan_id:0,grantTotal:0,surplusTotal:0,usageTotal:0,silentTotal:0,receive_total:0,usage_total:0,outdateTotal:0,invalidTotal:0,multiple:!0},n}return Object(y.a)(a,[{key:"onPageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getpageFn()}),0)}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-430})}},{key:"getKeyCodeList",value:function(e){var t=this,a=Object(Tt.a)(e,(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)})),n=sessionStorage.getItem("key_batch_id");Object(s.Yb)(n,a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({dataCount:e.total,distdata:e.data})}),(function(e){}))}))}},{key:"onCountChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getpageFn()}),0)}},{key:"getpageFn",value:function(){var e={page:this.state.page,limit:this.state.limit,key:this.state.key},t=this.state.status>0?this.state.status:null;t&&(e.status=t),this.getKeyCodeList(e)}},{key:"clearFn",value:function(){this.refs.plan_list.allChecked(!1),this.setState({selectiondata:[],multiple:!0})}},{key:"selection",value:function(e){e.length>0?this.setState({multiple:!1}):this.setState({multiple:!0}),this.setState({selectiondata:e});var t=0,a=0,n=0,i=0,s=0;e.forEach((function(e){t+=Number(e.total),a+=Number(e.residue),n+=Number(e.usage),s+=Number(e.overdue),i+=Number(e.invalid),Number(e.usage_total),Number(e.silent_total)})),this.setState({grantTotal:t,usageTotal:n,invalidTotal:i,outdateTotal:s,surplusTotal:a})}},{key:"componentDidUpdate",value:function(e,t){t.search==this.state.search||this.state.search||this.iptsureFn()}},{key:"iptsureFn",value:function(e){var t=this.state.status>0?this.state.status:null;this.setState({limit:10,page:1});var a={page:1,limit:10,key:this.state.search};t&&(a.status=t),this.getKeyCodeList(a)}},{key:"onFilterClose",value:function(e){var t={};t[e]=null,this.setState(t);var a={page:1,limit:10,key:this.state.search};this.getKeyCodeList(a)}},{key:"tabFn",value:function(e){var t=e>0?e:null;this.setState({limit:10,page:1,search:"",status:e});var a={page:1,limit:10,status:t};this.getKeyCodeList(a)}},{key:"keyCancelFun",value:function(e){var t=this,a={key:e.key};Object(s.hc)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({page:1,limit:10}),t.getKeyCodeList({page:1,limit:10}),h.a.success("\u4f5c\u5e9f\u6210\u529f")}),(function(e){h.a.error(e)}))}))}},{key:"menuItemClick",value:function(e,t,a){var n=this,i=this;if(5==t&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u91cd\u7f6e",a.key_code,"\uff1f"]}),onConfirm:function(){var e={key:a.key};Object(s.fd)(e).then((function(e){Object(s.cc)(e,(function(e,t){i.setState({page:1,limit:10}),i.getKeyCodeList({page:1,limit:10}),h.a.success("\u91cd\u7f6ekey\u7801\u6210\u529f")}),(function(e){h.a.error(e)}))}))},onCancel:function(){},className:"questModal",parentComponent:this}),1==t){var c={key:a.key};Object(s.jc)(c).then((function(e){Object(s.cc)(e,(function(e,t){n.setState({page:1,limit:10}),n.getKeyCodeList({page:1,limit:10}),h.a.success("\u6807\u8bb0\u4e3a\u4f7f\u7528\u6210\u529f")}),(function(e){h.a.error(e)}))}))}if(2==t){var o={type:4,object_value:a.key};try{At(o).then((function(e){2===e?i.keyCancelFun(a):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u4f5c\u5e9fkey\u6279\u6b21ID",Object(b.jsxs)("b",{children:["[",a.key,"]"]}),"\uff1f"]}),onConfirm:function(){i.keyCancelFun(a)},onCancel:n.onCancel,className:"questModal",parentComponent:n})}))}catch(r){}}3==t&&(sessionStorage.setItem("keyCode",a.key),window.open("#/home/key-log")),4==t&&this.setState({keyDelayVisible:!0,keyDelay:[a]})}},{key:"multipleCancel",value:function(){var e=this,t={keys:Object(C.a)(this.state.selectiondata,(function(e){return e.key}))};Object(s.ec)(t).then((function(t){Object(s.cc)(t,(function(t,a){h.a.success("\u6279\u91cf\u4f5c\u5e9f\u6210\u529f");e.setState({page:1,limit:10}),e.clearFn(),e.getKeyCodeList({page:1,limit:10})}),(function(e){h.a.error(e)}))}))}},{key:"multipleUse",value:function(){var e=this,t={keys:Object(C.a)(this.state.selectiondata,(function(e){return e.key}))};Object(s.gc)(t).then((function(t){Object(s.cc)(t,(function(t,a){h.a.success("\u6279\u91cf\u6807\u8bb0\u4e3a\u4f7f\u7528\u6210\u529f");e.setState({page:1,limit:10}),e.clearFn(),e.getKeyCodeList({page:1,limit:10})}),(function(e){h.a.error(e)}))}))}},{key:"render",value:function(){var e=this;Bt.a,this.state.combinedValue,this.onChangeCombinedDate;return Object(b.jsxs)("div",{id:"dislist",children:[Object(b.jsxs)(It,{tabs:this.state.tabList,tabChange:this.tabFn.bind(this),children:[Object(b.jsxs)("div",{className:"distable dflexj",children:[Object(b.jsxs)("div",{children:[Object(b.jsx)(m.a,{onClick:function(){e.multipleCancel()},disabled:this.state.multiple,children:"\u6279\u91cf\u4f5c\u5e9f"}),Object(b.jsx)(m.a,{onClick:function(){e.multipleUse()},disabled:this.state.multiple,children:"\u6279\u91cf\u6807\u8bb0\u4e3a\u5df2\u4f7f\u7528"}),Object(b.jsx)(m.a,{onClick:function(){var t=e.state.selectiondata.filter((function(e){return[1,2].includes(e.status)}));e.setState({keyDelayVisible:!0,keyDelay:t})},disabled:!this.state.selectiondata.filter((function(e){return[1,2].includes(e.status)})).length,children:"\u6279\u91cf\u7f16\u8f91key\u7801\u6709\u6548\u671f"})]}),Object(b.jsx)(r.a,{onChange:function(t){return e.setState({search:t})},value:this.state.search,wordSearch:this.iptsureFn.bind(this),icon:"search",placeholder:"\u8bf7\u5b8c\u6574\u8f93\u5165key",countShow:!1,height:"36px",width:"260px",onClearItem:function(t){e.setState({search:""});e.getKeyCodeList({page:1,limit:10})},alignment:"left"})]}),Object(b.jsxs)("div",{className:"code-table",children:[this.state.selectiondata.length>0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:this.clearFn.bind(this),children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:this.state.selectiondata.length}),"\u53d1\u653ekey\u603b\u6570:",this.state.grantTotal,",\u5269\u4f59key\u603b\u6570:",this.state.surplusTotal,",\u5df2\u4f7f\u7528\u603b\u6570:",this.state.usageTotal,",\u5df2\u8fc7\u671f\u603b\u6570:",this.state.outdateTotal,",\u5df2\u4f5c\u5e9f\u603b\u6570:",this.state.invalidTotal]}):null,Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.distdata,Column:[{title:"key\u7801",name:"key_code",prop:"key_code",type:"normal",width:"auto"},{title:"\u5f52\u5c5e\u8425\u9500\u8ba1\u5212",width:"auto",type:"normal",prop:"plan_title",name:"plan_title"},{title:"\u72b6\u6001",prop:"status",name:"status",width:"auto",type:"slot"},{title:"\u64cd\u4f5c",name:"opearo",prop:"opearo",type:"slot",width:"auto"},{title:"\u53d1\u653e\u603b\u6570",prop:"total",name:"total",width:"auto",type:"normal"},{title:"key\u7801\u6709\u6548\u671f",prop:"delay",name:"delay",width:"auto",type:"slot"},{title:"\u5269\u4f59\u603b\u6570",prop:"residue",name:"residue",width:"auto",type:"normal"},{title:"\u4f7f\u7528\u603b\u6570",name:"usage",prop:"usage",type:"normal",width:"auto"},{title:"\u5931\u6548\u603b\u6570",name:"overdue",prop:"overdue",type:"normal",width:"auto"},{title:"\u4f5c\u5e9f\u603b\u6570",name:"invalid",prop:"invalid",type:"normal",width:"auto"},{title:"\u5df2\u5b8c\u7ed3\u603b\u6570",name:"end",prop:"end",type:"normal",width:"auto"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"update_time",prop:"update_time",type:"normal",width:"auto"},{title:"\u53d1\u653e\u65f6\u95f4",name:"send_time",prop:"send_time",type:"normal",width:"auto"}],countbarVisible:!1,maxheight:this.state.tableHeight,isSwitch:!1,page:this.state.page,ref:"plan_list",dataCount:this.state.dataCount,pageChange:function(t){e.onPageChange(t)},countChange:function(t){e.onCountChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(t,a){if("dates"==t)return Object(b.jsxs)("span",{children:[a.begin_time," \u81f3 ",a.end_time]});if("delay"==t)return Object(b.jsx)("span",{children:K(a.expiration_conf)});if("title"==t)return Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.linkTo(a)},children:a.title});if("switch"==t)return Object(b.jsx)(S.a,{size:"small",checked:1==a.open,disabled:!a.is_open,onChange:function(t){e.onSwitchChange(t,a)}});if("status"==t)return Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.keyStatusBg(parseInt(a.status))}}),a.status_text]})});if("opearo"==t){return 1==a.status?Object(b.jsxs)("span",{children:[Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"#d8dbdd"},children:"\u8be6\u60c5"}),Object(b.jsxs)(I.a,{position:I.d.RightTop,children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore",onClick:function(e){},children:[" ","\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})," "]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(t,n){return e.menuItemClick(t,n,a)},children:[Object(b.jsx)(F.a,{children:"\u6807\u8bb0\u6210\u5df2\u4f7f\u7528"},"1"),Object(b.jsx)(F.a,{children:"\u7f16\u8f91key\u7801\u6709\u6548\u671f"},"4"),Object(b.jsx)(F.a,{children:"\u91cd\u7f6e"},"5"),Object(b.jsx)(F.a,{children:"\u4f5c\u5e9f"},"2"),Object(b.jsx)(F.a,{disabled:!0,children:"\u65e5\u5fd7"},"3")]})})]})]}):Object(b.jsxs)("span",{children:[Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"#d8dbdd"},children:"\u8be6\u60c5"}),Object(b.jsxs)(I.a,{position:I.d.RightTop,children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore",onClick:function(e){},children:[" ","\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})," "]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(t,n){return e.menuItemClick(t,n,a)},children:[Object(b.jsx)(F.a,{disabled:!0,children:"\u6807\u8bb0\u6210\u5df2\u4f7f\u7528"},"1"),Object(b.jsx)(F.a,{disabled:![1,2].includes(a.status),children:"\u7f16\u8f91key\u7801\u6709\u6548\u671f"},"4"),Object(b.jsx)(F.a,{children:"\u91cd\u7f6e"},"5"),Object(b.jsx)(F.a,{disabled:2!=a.status,children:"\u4f5c\u5e9f"},"2"),Object(b.jsx)(F.a,{disabled:!0,children:"\u65e5\u5fd7"},"3")]})})]})]})}}}),this.state.audit_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.cancel(t)}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u53d1\u9001"}),Object(b.jsx)("div",{className:"audit-box-question",children:"\u662f\u5426\u7acb\u5373\u53d1\u9001key\u4ee5\u53ca\u89e3\u538b\u5bc6\u7801?"}),Object(b.jsxs)("div",{className:"phone-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u624b\u673a\u53f7"}),Object(b.jsx)("div",{className:"phone-list",children:Object(b.jsx)(te.a,{value:this.state.phone_radio,isValueEqual:this.isValueEqual,onChange:function(t){e.onPhoneChange(t)},children:this.state.phone_list.map((function(t,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){t==e.state.phone_list[e.state.phone_radio]&&e.setState({phone_radio:-1})},children:t})}))})})]}),Object(b.jsxs)("div",{className:"email-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u90ae\u7bb1"}),Object(b.jsx)("div",{className:"email-list",children:Object(b.jsx)(te.a,{value:this.state.email_radio,isValueEqual:this.isValueEqual,onChange:function(t){e.onEmailChange(t)},children:this.state.email_list.map((function(t,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){t==e.state.email_list[e.state.email_radio]&&e.setState({email_radio:-1})},children:t})}))})})]}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u624b\u673a\u53f7",onChange:this.phoneChange,disabled:this.state.phone_radio>-1})}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u90ae\u7bb1",onChange:this.emailChange,disabled:this.state.email_radio>-1})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.cancel(t)},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.send(t)},children:"\u53d1\u9001"})]})]})]}):null]})]}),Object(b.jsx)(ge.a,{visible:this.state.keyDelayVisible,className:"questModal",onClose:function(){return e.setState({keyDelayVisible:!1})},title:this.state.keyDelay.length>1?"\u6279\u91cf\u7f16\u8f91key\u7801\u6709\u6548\u671f":"\u7f16\u8f91key\u7801\u6709\u6548\u671f",children:Object(b.jsx)(ci,{data:this.state.keyDelay,onColes:function(t){t&&e.getpageFn(),e.setState({keyDelayVisible:!1})}})})]})}}]),a}(u.a.Component)),ri=(a(316),[{title:"\u521b\u5efa\u65f6\u95f4",name:"time",prop:"time",type:"slot",width:"20%"},{title:"\u64cd\u4f5c\u63cf\u8ff0",name:"message",prop:"message",type:"normal",width:"20%"},{title:"\u8be6\u60c5",name:"opearo",type:"slot",prop:"opearo",width:"50%"}]),li=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={tabList:[{title:"\u65e5\u5fd7"}],tabactive:0,keyDetailLog_data:[],keyDetail_data:{},tableHeight:500,page:1,key:"",limit:10,total:0},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(e){this.getKeyLogFn({page:1,limit:10})}},{key:"tabFn",value:function(){this.getKeyLogFn()}},{key:"getKeyLogFn",value:function(){var e=this,t=this.state,a={page:t.page,limit:t.limit,key:sessionStorage.getItem("keyCode")};Object(s.nb)(a).then((function(t){Object(s.cc)(t,(function(t,a){e.setState({total:t.total,keyDetailLog_data:t.data})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getKeyLogFn()}),0)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getKeyLogFn()}),0)}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"more",className:"maincenter",children:Object(b.jsx)(It,{tabs:this.state.tabList,tabChange:this.tabFn,children:0==this.state.tabactive?Object(b.jsx)("div",{className:"main-body",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.keyDetailLog_data,Column:ri,isMultiple:!1,maxheight:this.state.tableHeight,dataCount:this.state.total,countChange:function(t){e.countChange(t)},countbarVisible:!1,isSwitch:!1,pageChange:function(t){e.pageChange(t)},checkChange:this.selection,ComponentHandler:function(e,t){return"time"==e?Object(b.jsx)("div",{children:Z.a.unix(t.time).format("YYYY-MM-DD HH:mm:ss")}):"opearo"==e?Object(b.jsx)("div",{children:t.data?Object(b.jsx)(xn.a,{collapsed:!0,name:!1,src:t.data,displayDataTypes:!1}):Object(b.jsx)("span",{children:"-"})}):void 0}})}):null})})}}]),a}(u.a.Component),di=a(463),ui=a.n(di),hi=(a(317),[{title:"key-\u6279\u6b21ID",name:"id",prop:"id",className:"name",type:"normal",width:"100px"},{title:"\u6279\u6b21\u540d\u79f0",name:"link",prop:"link",type:"slot",width:"180px"},{title:"\u542f\u7528",prop:"switch",name:"switch",width:"80px",type:"solt"},{title:"\u5f52\u5c5e\u8425\u9500\u8ba1\u5212",name:"plan_title",prop:"plan_title",type:"normal",width:"200px"},{title:"\u64cd\u4f5c",name:"plan",type:"slot",prop:"edit",width:"260px"},{title:"\u72b6\u6001",name:"status",type:"slot",prop:"status",width:"60px"},{title:"\u521b\u5efa\u4eba",name:"creator_name",prop:"creator_name",type:"normal",width:"100px"},{title:"\u751f\u6210key\u7801\u603b\u6570",name:"grant",type:"normal",prop:"grant",width:"110px"},{title:"\u90ae\u4ef6\u53d1\u653e\u603b\u6570",name:"receive",type:"slot",prop:"receive",width:"120px"},{title:"\u5df2\u6d88\u8017key\u7801\u603b\u6570",name:"usage",type:"slot",prop:"usage",width:"120px"},{title:"API\u8c03\u7528key\u7801\u603b\u6570",name:"key_send_num",type:"slot",prop:"key_send_num",width:"120px"},{title:"\u4f5c\u5e9fkey\u7801\u603b\u6570",name:"invalid",type:"normal",prop:"invalid",width:"120px"},{title:"\u53ef\u7528key\u7801\u603b\u6570",name:"silent",type:"normal",prop:"silent",width:"140px"},{title:"\u5931\u6548key\u7801\u603b\u6570",name:"overdue",type:"normal",prop:"overdue",width:"140px"},{title:"\u5b8c\u7ed3key\u7801\u603b\u6570",name:"end",type:"normal",prop:"end",width:"140px"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"update_time",type:"normal",prop:"update_time",width:"140px"}]),pi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n,i;return Object(g.a)(this,a),(i=t.call(this,e)).phoneChange=function(e){i.setState({phone:e.target.value})},i.emailChange=function(e){i.setState({email:e.target.value})},i.state=(n={planStatus:"",dataCount:0,page:1,limit:10,tabList:[{title:"\u5168\u90e8"},{title:"\u521b\u5efa\u4e2d"},{title:"\u5ba1\u6838\u4e2d"},{title:"\u672a\u901a\u8fc7"},{title:"\u8fdb\u884c\u4e2d"},{title:"\u751f\u6210\u4e2d"},{title:"\u6682\u505c\u4e2d"},{title:"\u5df2\u5b8c\u7ed3"},{title:"\u5df2\u4f5c\u5e9f"}],gridSelection:[],distdata:[],bulkExportLoading:!1,combinedValue:[],distdata2:[{id:0xb32df55cf43,name:"\u7231\u5947\u827a\u6708\u5361\u5151\u6362\u5238",time:"2021-11-08 14:21:06\u81f32021-11-08 15:06:04",plan:"\u8425\u9500\u8ba1\u52122",belongid:3123213,send:100,record:58,used:41,dead:11,fail:12,status:"1"}],activepage:0,distdata4:[],distdata3:[],distdata11:[],tableHeight:600,disabled:!1,email:"",key_word:"",phone:"",phone_list:[],email_list:[]},Object(se.a)(n,"phone",""),Object(se.a)(n,"email",""),Object(se.a)(n,"email_radio",-1),Object(se.a)(n,"phone_radio",-1),Object(se.a)(n,"menuVisible",!1),Object(se.a)(n,"isBulkSend",!1),Object(se.a)(n,"plan",JSON.parse(sessionStorage.getItem("plan_item"))),n),i}return Object(y.a)(a,[{key:"cancel",value:function(e){this.setState({audit_visible:!1})}},{key:"send",value:function(e){var t=this,a=new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"),i=[JSON.parse(sessionStorage.getItem("key_batch_id"))],c={phone:this.state.phone_radio>-1?this.state.phone_list[this.state.phone_radio]:this.state.phone,email:this.state.email_radio>-1?this.state.email_list[this.state.email_radio]:this.state.email};a.test(c.phone)?(this.state.isBulkSend&&(i=this.state.gridSelection.map((function(e){return e.id}))),Object(s.i)(Object(n.a)({ids:i},c)).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({audit_visible:!1}),h.a.success("\u53d1\u9001\u6210\u529f")}),(function(e){h.a.error(e)}))}))):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"getKeyList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=this,n=a.state,i=n.page,c=n.limit,o=n.key_word,r=n.activepage,l={page:i,limit:c};l.plan_id=sessionStorage.getItem("key_plan_id"),this.state.combinedValue&&this.state.combinedValue[0]&&(l.begin_time=this.state.combinedValue[0],l.end_time=this.state.combinedValue[1]),r&&(l.status=r),o&&(l.key_word=o),t&&t[0]&&(l.begin_time=t[0],l.end_time=t[1]),t&&null==t[0]&&t.length>1&&(delete l.begin_time,delete l.end_time),0==this.state.activepage&&delete l.status,Object(s.mb)(l).then((function(t){Object(s.cc)(t,(function(t,a){t.data.length>0&&sessionStorage.setItem("keyType",t.data[0].bind_object[0]),e.setState({dataCount:t.total,distdata:t.data,planStatus:t.plan.status}),sessionStorage.setItem("key_plan_status",t.plan.status)}),(function(e){}))}))}},{key:"onPageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getKeyList()}),0)}},{key:"clickFn",value:function(){sessionStorage.setItem("pathname2","/home/key-addEdit");sessionStorage.setItem("keybatch_id",""),sessionStorage.setItem("copyOpearo",0),this.state.distdata.length>0&&6==this.state.distdata[0].style?sessionStorage.setItem("keyStyle",1):sessionStorage.setItem("keyStyle",0),sessionStorage.setItem("breakchangenav",JSON.stringify([{pagetitle:"\u65b0\u5efa",items:[{path:"/home/key-list",name:"key\u5217\u8868\u7ba1\u7406"},{path:"/home/key-addEdit",name:"\u65b0\u5efakey"}]}])),sessionStorage.setItem("KeyPcType","3"),this.props.history.push("/home/key-addEdit")}},{key:"onCopyRow",value:function(e,t){sessionStorage.setItem("pathname2","/home/key-addEdit");var a=[{pagetitle:"\u590d\u5236",items:[{path:"/home/key-list",name:"key\u5217\u8868\u7ba1\u7406"},{path:"/home/key-addEdit",name:"\u590d\u5236key:"+t.batch_name}]}];sessionStorage.setItem("keybatch_id",t.id),sessionStorage.setItem("copyOpearo",1),sessionStorage.setItem("key_reseller_id",t.reseller_id),sessionStorage.setItem("breakchangenav",JSON.stringify(a)),sessionStorage.setItem("KeyPcType","2"),this.props.history.push("/home/key-addEdit")}},{key:"onEditRow",value:function(e,t){sessionStorage.setItem("pathname2","/home/key-addEdit");var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:t.plan_title+"key\u5217\u8868\u7ba1\u7406"},{path:"/home/key-list",name:"key-\u6279\u6b21ID:"+t.id},{path:"/home/key-addEdit",name:"\u7f16\u8f91key"}]}];sessionStorage.setItem("breakchangenav",JSON.stringify(a)),sessionStorage.setItem("keybatch_id",t.id),sessionStorage.setItem("key_reseller_id",t.reseller_id),sessionStorage.setItem("approval_id",t.approval_id),sessionStorage.setItem("KeyPcType","1"),this.props.history.push("/home/key-addEdit")}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getKeyList()}),200)}},{key:"tabFn",value:function(e){var t=this;switch(this.setState({activepage:e,key_word:""}),e){case 1:this.setState({activepage:1});break;case 2:this.setState({activepage:2});break;case 3:this.setState({activepage:8});break;case 4:this.setState({activepage:4});break;case 5:this.setState({activepage:3});break;case 6:this.setState({activepage:5});break;case 7:this.setState({activepage:6});break;case 8:this.setState({activepage:7})}this.setState({page:1,limit:10}),setTimeout((function(){t.getKeyList()}),10)}},{key:"delFn",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u4f5c\u5e9f\u3010\u6e32\u67d3\u8ba2\u5355\u53f7\u3011\u8ba2\u5355\uff1f"}),onConfirm:function(){alert("\u5f00\u59cb\u8c03\u7528\u4f5c\u5e9f\u63a5\u53e3")},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"onChangeCombinedDate",value:function(e){this.setState({combinedValue:e}),this.getKeyList(e)}},{key:"onSwitchChange",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5c06",Object(b.jsxs)("b",{children:["[key-\u6279\u6b21id",t.id,"]"]}),4==t.status?"\u6682\u505c":"\u5f00\u542f","\uff1f"]}),onConfirm:function(){a.changeState(e,t)},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"changeState",value:function(e,t){var a=this,n=this,i={operation:e?4:5};Object(s.nd)(t.id,i).then((function(i){Object(s.cc)(i,(function(i,s){var c=Object(ta.a)(a.state.distdata,(function(e){return e.id==t.id}));a.state.distdata[c].status=e,a.setState({distdata:a.state.distdata}),h.a.success(s);var o={page:1,limit:10,plan_id:sessionStorage.getItem("key_plan_id")};n.getKeyList(o)}),(function(e){h.a.error(e)}))}))}},{key:"iptsureFn",value:function(){var e=this;this.setState({page:1}),setTimeout((function(){e.getKeyList()}),200)}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390});["6","0","2","5","8"].indexOf(sessionStorage.getItem("key_plan_status"))>-1&&this.setState({disabled:!0})}},{key:"getResellerInfoFunction",value:function(e){var t=this;Object(s.Cb)(e).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({phone_list:e.contact_phone,email_list:e.contact_email,audit_visible:!0,phone_radio:-1,email_radio:-1})}),(function(e){h.a.error(e)}))}))}},{key:"bulkSendFunction",value:function(){if(this.state.gridSelection.some((function(e){return![4,5].includes(e.status)})))return h.a.warn("\u53ea\u6709\u72b6\u6001\u4e3a\u8fdb\u884c\u4e2d\u3001\u6682\u505c\u4e2d\u7684\u5141\u8bb8\u53d1\u9001");this.getResellerInfoFunction(this.state.gridSelection[0].reseller_id),this.setState({isBulkSend:!0})}},{key:"bulkExport",value:function(){var e=this,t=this.state.gridSelection.map((function(e){return e.id})),a=t.length?"":~~sessionStorage.getItem("key_plan_id");this.setState({bulkExportLoading:!0}),Object(s.fc)({key_batch_id:t,plan_id:a}).then((function(t){var a=new Blob([t]),n=Date.now()+".zip",i=document.createElement("a");i.href=window.URL.createObjectURL(a),i.download=n,i.click(),window.URL.revokeObjectURL(i.href),e.setState({bulkExportLoading:!1})})).catch((function(e){}))}},{key:"cancelKeyFn",value:function(e){var t=this;Object(s.o)(e.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a);var n={page:1,limit:10,plan_id:sessionStorage.getItem("key_plan_id")};t.getKeyList(n)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"menuItemClick",value:function(e,t){var a=this,n=this;if(1==e&&(this.setState({isBulkSend:!1}),this.getResellerInfoFunction(t.reseller_id),sessionStorage.setItem("key_batch_id",t.id)),5==e){t.id;if(2==t.status)return h.a.error("\u5ba1\u6838\u4e2d\u7684\u6570\u636e\u4e0d\u5141\u8bb8\u4f5c\u5e9f"),void this.setState({menuVisible:!1});var i={type:1,object_value:t.id};try{At(i).then((function(e){2===e?n.cancelKeyFn(t):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u4f5c\u5e9fkey\u6279\u6b21ID",Object(b.jsxs)("b",{children:["[",t.id,"]"]}),"\uff1f"]}),onConfirm:function(){n.cancelKeyFn(t)},onCancel:a.onCancel,className:"questModal",parentComponent:a})}))}catch(s){}}6==e&&this.callBack(t)}},{key:"callBack",value:function(e){sessionStorage.setItem("callBackId",JSON.stringify(e.id)),sessionStorage.setItem("callBackType",JSON.stringify(3)),sessionStorage.setItem("pathname2","callback-message");var t=[{pagetitle:"\u56de\u8c03\u5730\u5740",items:[{path:"distributor-list",name:"key\u6279\u6b21\u4e00"+e.batch_name},{path:"callback-message",name:"\u8bbe\u7f6e\u56de\u8c03\u901a\u77e5\u5730\u5740"}]}];sessionStorage.setItem("breaknav",JSON.stringify(t)),sessionStorage.setItem("linkshowname","key\u6279\u6b21"),this.props.history.push("/home/callback-message")}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getKeyList()}),0)}},{key:"linkTo",value:function(e){var t=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:e.plan_title+"key\u5217\u8868"},{path:"/home/key-detail",name:e.batch_name+"key\u7801\u5217\u8868"}]}];sessionStorage.setItem("breakchangenav",JSON.stringify(t)),sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212\u7ba1\u7406"),sessionStorage.setItem("key_batch_id",e.id),this.props.history.push("/home/key-detail")}},{key:"componentDidUpdate",value:function(e,t){t.key_word==this.state.key_word||this.state.key_word||this.getKeyList()}},{key:"onPhoneChange",value:function(e){this.setState({phone_radio:e.target.value})}},{key:"onEmailChange",value:function(e){this.setState({email_radio:e.target.value})}},{key:"deleteFun",value:function(e){var t=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u4f60\u786e\u5b9a\u8981\u5220\u9664\u8be5\u6761\u6570\u636e?"}),onConfirm:function(){Object(s.I)(e.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),setTimeout((function(){t.getKeyList()}),3e3)}),(function(e){h.a.error(e)}))}))},onCancel:function(){},className:"questModal",parentComponent:this})}},{key:"onReCall",value:function(e,t){var a=this,n=t.approval_id;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u8be5\u6570\u636e\u6b63\u5728\u5ba1\u6279\u4e2d,\u662f\u5426\u786e\u8ba4\u64a4\u9500\u5ba1\u6279\uff1f"}),onConfirm:function(){Object(s.pd)(n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u64a4\u9500\u5ba1\u6279\u6210\u529f"),setTimeout((function(){a.getKeyList()}),3e3)}),(function(e){h.a.error(e)}))}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"opearoEl",value:function(e,t){var a=this;switch(e){case 1:return[1,8,4,5].includes(t.status)?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){a.onEditRow(e,t)},children:"\u7f16\u8f91"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u7f16\u8f91"});case 2:if([4,5,7].includes(t.status)){if(7===t.status)if(ui()(t.end_time).valueOf()<=ui()().valueOf())return Object(b.jsx)("span",{className:"grid-link disabled",children:"\u590d\u5236"});return Object(b.jsx)("span",{className:"grid-link",onClick:function(e){a.onCopyRow(e,t)},children:"\u590d\u5236"})}return Object(b.jsx)("span",{className:"grid-link disabled",children:"\u590d\u5236"});case 3:return[2].includes(t.status)?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){return a.onReCall(e,t)},children:"\u64a4\u9500\u5ba1\u6279"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u64a4\u9500\u5ba1\u6279"});case 4:return 8===t.status&&1===t.old_status?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(){return a.deleteFun(t)},children:"\u5220\u9664"}):[8,4,5].includes(t.status)&&1!==t.old_status?Object(b.jsxs)(I.a,{position:I.d.RightTop,visible:this.state.menuVisible,onVisibleChange:function(e){return a.setState({visible:e})},children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore grid-link",children:["\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(e,n){return a.menuItemClick(n,t)},children:[Object(b.jsx)(F.a,{disabled:2==this.state.plan.send_method,children:"\u53d1\u9001\u5bc6\u7801\u53ca\u538b\u7f29\u5305"},"1"),Object(b.jsx)(F.a,{children:"\u8bbe\u7f6e\u56de\u8c03"},"6"),Object(b.jsx)(F.a,{disabled:!0,children:"\u65e5\u5fd7"},"2"),Object(b.jsx)(F.a,{children:"\u4f5c\u5e9f"},"5")]})})]}):1===t.status?Object(b.jsx)("span",{className:"grid-link",style:{color:"red"},onClick:function(){return a.deleteFun(t)},children:"\u5220\u9664"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u66f4\u591a"});default:return}}},{key:"dingTask",value:function(e){var t=this;Object(s.K)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success(a),t.getKeyList()}),(function(e){h.a.error(e)}))}))}},{key:"render",value:function(){var e,t=this,a=this.state;a.current,a.pageSize;return Object(b.jsx)("div",{id:"exchangecodelist",children:Object(b.jsx)(ft.a,{loading:this.state.bulkExportLoading,icon:"circle",iconSize:32,iconText:"\u4e0b\u8f7d\u4e2d...",children:Object(b.jsxs)(It,{tabs:this.state.tabList,tabChange:this.tabFn.bind(this),children:[Object(b.jsxs)("div",{className:"codetable dflexj",children:[Object(b.jsxs)("div",{children:[Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.clickFn.bind(this),disabled:this.state.disabled,children:"\u65b0\u5efakey"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(){return t.bulkExport()},children:"\u6279\u91cf\u5bfc\u51fa"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(){return t.bulkSendFunction()},disabled:!(null!==(e=this.state.gridSelection[0])&&void 0!==e&&e.reseller_id),children:"\u6279\u91cf\u53d1\u9001"})]}),Object(b.jsx)(r.a,{icon:"search",placeholder:"\u8bf7\u8f93\u5165key\u6279\u6b21ID\u8fdb\u884c\u5339\u914d\u67e5\u8be2",onChange:function(e){return t.setState({key_word:e})},value:this.state.key_word,wordSearch:this.iptsureFn.bind(this),countShow:!1,height:"36px",width:"260px",onClearItem:function(e){t.setState({key_word:""})},alignment:"left"})]}),Object(b.jsx)("div",{className:"code-table",children:Object(b.jsx)(q,{countChange:function(e){t.countChange(e)},spliteColor:"#fff",tableData:this.state.distdata,Column:hi,maxheight:this.state.tableHeight,countbarVisible:!1,isSwitch:!1,page:this.state.page,dataCount:this.state.dataCount,pageChange:function(e){t.pageChange(e)},checkChange:function(e){t.setState({gridSelection:e})},ComponentHandler:function(e,a){if("link"==e){var n=Object(b.jsx)("span",{className:"grid-link",onClick:function(e){t.linkTo(a)},children:a.batch_name});return 4==a.style&&(n=Object(b.jsx)("span",{style:{color:"#d8dbdd"},children:a.batch_name})),n}return"usage"==e?Object(b.jsx)(ma.a,{trigger:"hover",content:(i=a,Object(b.jsxs)("div",{children:[Object(b.jsx)("b",{children:"\u5151\u6362\u7801\u7edf\u8ba1"}),Object(b.jsxs)("ul",{className:"dflexaj mt5 fz12",children:[Object(b.jsxs)("li",{className:"dflexajc mr15",children:[Object(b.jsx)("span",{children:"\u5df2\u4f5c\u5e9f\u6570"}),Object(b.jsx)("span",{children:i.invalid_total})]}),Object(b.jsxs)("li",{className:"dflexajc mr15",children:[Object(b.jsx)("span",{children:"\u5df2\u4f7f\u7528\u6570"}),Object(b.jsx)("span",{children:i.usage_total})]}),Object(b.jsxs)("li",{className:"dflexajc",children:[Object(b.jsx)("span",{children:"\u5df2\u5931\u6548\u6570"}),Object(b.jsx)("span",{children:i.overdue_total})]})]})]})),children:Object(b.jsx)("span",{className:"grid-link",children:a.usage})}):"switch"==e?Object(b.jsx)(S.a,{size:"small",checked:4==a.status,disabled:a.status>=6,onChange:function(e){t.onSwitchChange(e,a)}}):"receive"==e?Object(b.jsx)("span",{children:2==t.state.plan.send_method?0:a.receive}):"key_send_num"==e?Object(b.jsx)("span",{children:1==t.state.plan.send_method?0:a.key_send_num}):"status"==e?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.keysStatusBg(a.status)}}),a.status_text]})}):"edit"==e?Object(b.jsxs)("div",{children:[t.opearoEl(1,a),t.opearoEl(2,a),t.opearoEl(3,a),a.approval_id&&2===a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){t.dingTask(a.approval_id)},children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}),t.opearoEl(4,a)]}):void 0;var i}})}),this.state.audit_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(e){t.cancel(e)}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u53d1\u9001"}),Object(b.jsx)("div",{className:"audit-box-question",children:"\u662f\u5426\u7acb\u5373\u53d1\u9001key\u4ee5\u53ca\u89e3\u538b\u5bc6\u7801?"}),Object(b.jsxs)("div",{className:"phone-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u624b\u673a\u53f7"}),Object(b.jsx)("div",{className:"phone-list",children:Object(b.jsx)(te.a,{value:this.state.phone_radio,isValueEqual:this.isValueEqual,onChange:function(e){t.onPhoneChange(e)},children:this.state.phone_list.map((function(e,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){e==t.state.phone_list[t.state.phone_radio]&&t.setState({phone_radio:-1})},children:e},a)}))})})]}),Object(b.jsxs)("div",{className:"email-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u90ae\u7bb1"}),Object(b.jsx)("div",{className:"email-list",children:Object(b.jsx)(te.a,{value:this.state.email_radio,isValueEqual:this.isValueEqual,onChange:function(e){t.onEmailChange(e)},children:this.state.email_list.map((function(e,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){e==t.state.email_list[t.state.email_radio]&&t.setState({email_radio:-1})},children:e},a)}))})})]}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u624b\u673a\u53f7",onChange:this.phoneChange,disabled:this.state.phone_radio>-1})}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u90ae\u7bb1",onChange:this.emailChange,disabled:this.state.email_radio>-1})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(e){t.cancel(e)},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(e){t.send(e)},children:"\u53d1\u9001"})]})]})]}):null]})})})}}]),a}(u.a.Component),mi=(a(318),[{title:"\u884c\u53f7",name:"id"},{title:"key",name:"key"},{title:"\u9519\u8bef\u539f\u56e0",name:"msg"}]),bi=function(e){var t=e.title,a=void 0===t?"\u63d0\u793a":t,n=e.onClose,c=e.onImport,o=e.visible,r=void 0!==o&&o,l=e.url,u=Object(d.useState)(null),p=Object(i.a)(u,2),g=(p[0],p[1]),y=Object(d.useState)(""),_=Object(i.a)(y,2),v=_[0],x=_[1],O=Object(d.useState)(2),k=Object(i.a)(O,2),S=k[0],C=k[1],N=Object(d.useState)(!1),D=Object(i.a)(N,2),I=D[0],T=D[1],F=Object(d.useState)(""),L=Object(i.a)(F,2),M=L[0],H=L[1],q=Object(d.useState)(!0),P=Object(i.a)(q,2),B=P[0],E=P[1],A=Object(d.useState)(!1),V=Object(i.a)(A,2),J=V[0],W=V[1],z=Object(d.useState)(!1),R=Object(i.a)(z,2),Y=R[0],K=R[1],G=Object(d.useState)(0),U=Object(i.a)(G,2),Q=U[0],$=U[1],Z=Object(d.useState)(0),X=Object(i.a)(Z,2),ee=X[0],te=X[1],ae=Object(d.useState)([]),ne=Object(i.a)(ae,2),ie=ne[0],se=ne[1],ce=Object(d.useRef)(null),oe=Object(d.useState)(!1),re=Object(i.a)(oe,2),le=re[0],de=re[1];Object(d.useEffect)((function(){try{var e=ce.current;e&&e.click()}catch(t){}}),[ce,le]);var ue=function(e){C(200),H(e.data.hash),E(!1)},he=function(e){var t="";for(var a in e)t+=e[a]+" ";return t},pe=function(e){W(!0);var t=e.data.rowError;$(t.total),te(t.error_count),H(t.hash);var a=[];for(var n in t.error)a.push(t.error[n]);a=a.map((function(e,t){return{key:e.key,id:t+1,msg:he(e.msg)}})),se(a)},me=function(){var e=Object(j.a)(Object(f.a)().mark((function e(t){var a;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:T(!0),(a=new FormData).append("file",t),Object(s.h)(l,a).then((function(e){if(T(!1),200===e.code||0===e.code||1===e.code)switch(e.code){case 200:return void ue(e);case 0:return void C(0);case 1:return void pe(e);default:return}else h.a.error(e.message),C(0)}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),be=function(e){var t=e.target.files[0];g(t),x(t.name),K(!0),me(t)},fe=function(){""!==M&&(je(),c(M))},je=function(){C(2),W(!1),K(!1),E(!0),n()},ge=function(){return Object(b.jsxs)("div",{className:"up-files-excel",children:[Object(b.jsxs)("div",{className:"user-file-box",children:[Object(b.jsxs)("p",{className:"user-file-name",children:[Object(b.jsx)(w.a,{type:"text-guide-o"}),v]}),Object(b.jsxs)("div",{className:"file-update-box",children:[Object(b.jsx)("input",{type:"file",accept:".xls,.xlsx,.csv",className:"upload-input1",onClick:function(e){return e.target.value=""},onChange:function(e){return be(e)}}),Object(b.jsx)(w.a,{type:"up-circle-o"}),Object(b.jsx)("span",{children:"\u66f4\u65b0\u6587\u4ef6"})]})]}),function(){switch(S){case 0:return Object(b.jsxs)("div",{className:"upload-error",children:[Object(b.jsx)(w.a,{type:"error-circle",className:"error-icon"}),Object(b.jsx)("span",{children:"\u6587\u4ef6\u89e3\u6790\u5931\u8d25, \u8bf7\u67e5\u770b\u5bfc\u5165\u89c4\u5219\u5e76\u66f4\u65b0\u6587\u4ef6"})]});case 200:return Object(b.jsxs)("div",{className:"upload-success",children:[Object(b.jsx)(w.a,{type:"check-circle",className:"success-icon"}),Object(b.jsx)("span",{children:'\u6587\u4ef6\u89e3\u6790\u6210\u529f\uff0c \u70b9\u51fb "\u786e\u5b9a\u5bfc\u5165" \u5373\u53ef\u5bfc\u5165'})]});default:return}}()]})},ye=function(){return Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u4e0b\u8f7d\u6a21\u677f\u5e76\u586b\u5199\u540e\u4e0a\u4f20"}),Object(b.jsx)("div",{className:"upload-info",children:Object(b.jsxs)("div",{children:["\u8bf7\u5148\u4e0b\u8f7d\u300c\u6570\u5b57\u4e16\u754c\u8425\u9500\u7ba1\u7406\u7cfb\u7edf_keys_\u6a21\u677f\u300d\u5e76\u6309\u7167\u6a21\u677f\u586b\u5199\u540e\u518d\u4e0a\u4f20\uff0c",Object(b.jsx)("span",{style:{color:"red"},children:"\u6279\u91cf\u4e0a\u4f20\u67e5\u8be2 \u53ea\u80fd\u662f\u4e00\u4e2a\u8ba1\u5212\u4e0b\u9762key\u3002"})]})}),Object(b.jsx)(m.a,{type:"default",className:"btn-upload1",onClick:function(){window.location.href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/key%E6%A8%A1%E7%89%88.xlsx"},children:"\u4e0b\u8f7d\u6a21\u677f"}),Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(){return je()},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",disabled:B,onClick:function(e){fe()},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})]})};return Object(b.jsx)("div",{children:r?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal"}),Object(b.jsx)("div",{className:"import-excel",style:{height:"auto"},children:Object(b.jsxs)(ft.a,{loading:I,iconText:"\u89e3\u6790\u4e2d...",icon:"circle",children:[Object(b.jsxs)("div",{className:"import-header",children:[Object(b.jsx)("div",{className:"import-title",children:a}),Object(b.jsx)(w.a,{type:"close",className:"import-close",onClick:function(){return je()}})]}),J?Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"file-upload-tip",children:["\u6587\u4ef6\u4e0a\u4f20\u6210\u529f.\u5171 ",Q," \u6761key\u7801,\u5176\u4e2d ",Q-ee,"\u6761\u53ef\u6210\u529f\u5bfc\u5165"]}),Object(b.jsxs)("div",{className:"file-errmsg1",children:["\u53d1\u73b0\u4ee5\u4e0b ",ee," \u6761\u4e0d\u7b26\u5408\u8981\u6c42,\u5c06\u4e0d\u4f1a\u88ab\u5bfc\u5165"]}),Object(b.jsx)("div",{className:"gridpanel1",children:Object(b.jsx)(Me.a,{columns:mi,datasets:ie,scroll:{y:250},size:"large"})}),Object(b.jsx)("div",{className:"foot-bar",children:Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"default",onClick:function(e){g(null),C(2),W(!1),K(!1),E(!0),de(!le)},children:"\u91cd\u65b0\u4e0a\u4f20"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(e){fe()},style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u786e\u5b9a\u5bfc\u5165"})]})})]}):Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{children:[Object(b.jsxs)("div",{className:"step-bar",children:[Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code active",children:"1"}),Object(b.jsx)("span",{className:"step-label active",children:"\u4e0a\u4f20\u6587\u4ef6"})]}),Object(b.jsx)("div",{className:"step-center",children:Object(b.jsx)("div",{className:"step-line"})}),Object(b.jsxs)("div",{className:"step-group",children:[Object(b.jsx)("div",{className:"step-code",children:"2"}),Object(b.jsx)("span",{className:"step-label",children:"\u5bfc\u5165\u5b8c\u6210"})]})]}),Object(b.jsxs)("div",{className:"upload-panel1",children:[Object(b.jsx)("div",{className:"upload-label",children:"\u76f4\u63a5\u4e0a\u4f20"}),Object(b.jsxs)("div",{className:"upload-info",children:[Object(b.jsx)("div",{children:" - \u652f\u6301\u6587\u4ef6\u7c7b\u578b\uff1axls\uff0cxlsx\uff0ccsv"}),Object(b.jsx)("div",{children:"- \u652f\u6301\u6240\u6709\u57fa\u7840\u5b57\u6bb5\u7684\u5bfc\u5165\uff0c\u4e00\u6b21\u81f3\u591a\u5bfc\u5165 100 \u6761key\u7801\uff08\u4e0d\u7b26\u5408\u89c4\u5219\u6574\u6761\u4efb\u52a1\u4e0d\u4e88\u4ee5\u5bfc\u5165\uff09"})]})]})]}),Y?ge():Object(b.jsxs)("div",{className:"upload-excel-01",children:[Object(b.jsx)("input",{ref:ce,type:"file",accept:".xls,.xlsx,.csv",className:"upload-input",onClick:function(e){return e.target.value=""},onChange:function(e){return be(e)}}),Object(b.jsx)(m.a,{style:{background:"#1890ff",color:"#FFFFFF",border:"none"},children:"\u4e0a\u4f20\u6587\u4ef6"})]}),ye()]})]})})]}):null})},fi=(a(319),[{key:0,text:"\u5168\u90e8"},{key:1,text:"\u53ef\u4f7f\u7528"},{key:2,text:"\u5df2\u4f7f\u7528"},{key:3,text:"\u5df2\u5b8c\u7ed3"},{key:4,text:"\u5df2\u4f5c\u5e9f"}]);var ji=Object(d.forwardRef)((function(e,t){var a=e.onQuery,l=e.query,u=e.resetChange,p=Object(d.useState)({date:[],reseller:"",plan:"",state:{key:0,text:"\u5168\u90e8"},key:"",key_batch_id:""}),f=Object(i.a)(p,2),j=f[0],g=f[1],y=Object(d.useState)([]),_=Object(i.a)(y,2),v=_[0],x=_[1],O=Object(d.useState)([]),k=Object(i.a)(O,2),S=k[0],w=k[1],C=Object(d.useState)([]),N=Object(i.a)(C,2),D=N[0],I=N[1];function T(){g({date:[],reseller:"",plan:"",state:{key:0,text:"\u5168\u90e8"},key:"",key_batch_id:""})}function F(e,t){return Object(b.jsx)(X.a,{height:256,itemCount:e.length,itemSize:32,width:200,children:function(a){var n=a.index,i=a.style;return Object(b.jsx)("div",{style:i,children:t(e[n],n)})}})}function L(e){var t,a,n,i;return{begin_time:e.date[0]||null,end_time:e.date[1]||null,reseller_id:(null===(t=e.reseller)||void 0===t?void 0:t.key)||null,plan_id:(null===(a=e.plan)||void 0===a?void 0:a.key)||null,status:(null===(n=e.state)||void 0===n?void 0:n.key)||null,key:e.key||null,key_batch_id:(null===(i=e.key_batch_id)||void 0===i?void 0:i.id)||null}}return Object(d.useEffect)((function(){var e=L(j);l(e)}),[j]),Object(d.useEffect)((function(){Object(s.Bb)().then((function(e){return Object(s.cc)(e,(function(e,t){var a=e.map((function(e){return{key:e.id,text:e.name}}));x(a)}),(function(e){}))})),Object(s.yb)().then((function(e){return Object(s.cc)(e,(function(e,t){var a=e.map((function(e){return{key:e.id,text:e.title}}));w(a)}),(function(e){}))}))}),[]),Object(d.useImperativeHandle)(t,(function(){return{clearData:T}})),Object(b.jsx)("div",{className:"keysFind",children:Object(b.jsxs)(o.a,{children:[Object(b.jsx)(c.a,{labelname:"\u8bf7\u9009\u62e9\u65e5\u671f\uff1a",required:"",labelwidth:"95px",children:Object(b.jsx)(ie.a,{dateFormat:"YYYY-MM-DD",value:j.date,className:"zent-datepicker-plan",width:204,onChange:function(e){return g(Object(n.a)(Object(n.a)({},j),{},{date:e}))}})}),Object(b.jsx)(c.a,{labelname:"\u72b6\u6001\uff1a",required:"",labelwidth:"50px",children:Object(b.jsx)(ne.a,{name:"state",value:j.state,options:fi,placeholder:"\u8bf7\u9009\u62e9",width:204,clearable:!0,onChange:function(e){return g(Object(n.a)(Object(n.a)({},j),{},{state:e}))}})}),Object(b.jsx)(c.a,{labelname:"\u5206\u9500\u5546\uff1a",required:"",labelwidth:"70px",children:Object(b.jsx)(ne.a,{value:j.reseller,options:v,placeholder:"\u8bf7\u9009\u62e9",renderOptionList:F,width:204,clearable:!0,onChange:function(e){return g(Object(n.a)(Object(n.a)({},j),{},{reseller:e}))}})}),Object(b.jsx)(c.a,{labelname:"\u8ba1\u5212\u540d\u79f0\uff1a",required:"",labelwidth:"90px",children:Object(b.jsx)(ne.a,{value:j.plan,options:S,placeholder:"\u8bf7\u9009\u62e9",renderOptionList:F,width:204,clearable:!0,onChange:function(e){var t;e?(t=e.key,Object(s.Yc)({plan_id:t}).then((function(e){Object(s.cc)(e,(function(e,t){var a=e.map((function(e){return Object(n.a)({key:e.id,text:e.batch_name},e)}));I(a)}),(function(e){h.a.error(e)}))})),g(Object(n.a)(Object(n.a)({},j),{},{plan:e}))):(g(Object(n.a)(Object(n.a)({},j),{},{key_batch_id:null,plan:null})),I([]))}})}),Object(b.jsx)(c.a,{labelname:"key\u6279\u6b21\uff1a",required:"",labelwidth:"80px",children:Object(b.jsx)(ne.a,{value:j.key_batch_id,options:D,placeholder:"\u8bf7\u9009\u62e9",renderOptionList:function(e,t){return Object(b.jsx)(X.a,{height:256,itemCount:e.length,itemSize:32,width:200,children:function(a){var n=a.index,i=a.style;return Object(b.jsx)("div",{style:i,children:t(e[n],n)})}})},width:204,clearable:!0,onChange:function(e){g(Object(n.a)(Object(n.a)({},j),{},{key_batch_id:e}))}})}),Object(b.jsx)(c.a,{labelname:"KEY\uff1a",required:"",labelwidth:"50px",children:Object(b.jsx)(r.a,{value:j.key,countShow:!1,labelWidth:"0px",placeholder:"\u8bf7\u8f93\u5165",width:204,onChange:function(e){return g(Object(n.a)(Object(n.a)({},j),{},{key:e}))},onClearItem:function(){return g(Object(n.a)(Object(n.a)({},j),{},{key:""}))}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){L(j).plan_id||L(j).reseller_id||L(j).key?a(L(j)):h.a.warn("\u8bf7\u8f93\u5165\u3010\u8ba1\u5212\u540d\u79f0\u3011\u6216\u3010key\u3011\u8fdb\u884c\u67e5\u8be2")},children:"\u67e5\u8be2"}),Object(b.jsx)(m.a,{onClick:function(){g({date:[],reseller:"",plan:"",state:{key:0,text:"\u5168\u90e8"},key:"",key_batch_id:""}),u()},children:"\u91cd\u7f6e"})]})]})})})),gi=(a(320),void 0),yi=[{title:"key\u7801",name:"key_code",prop:"key_code",type:"normal",width:"auto"},{title:"\u5f52\u5c5e\u8425\u9500\u8ba1\u5212",width:"auto",type:"normal",prop:"title",name:"title"},{title:"\u5f52\u5c5eKEY\u6279\u6b21",prop:"batch_name",name:"batch_name",width:"auto",type:"normal"},{title:"\u72b6\u6001",prop:"status",name:"status",width:"auto",type:"slot"},{title:"\u64cd\u4f5c",name:"opearo",prop:"opearo",type:"slot",width:"auto"},{title:"\u603b\u53d1\u653e\u6761\u6570",prop:"total",name:"total",width:"auto",type:"normal"},{title:"\u5269\u4f59\u6761\u6570",prop:"residue",name:"residue",width:"auto",type:"normal"},{title:"\u5df2\u4f7f\u7528\u6761\u6570",name:"usage",prop:"usage",type:"normal",width:"auto"},{title:"\u5df2\u8fc7\u671f\u6761\u6570",name:"overdue",prop:"overdue",type:"normal",width:"auto"},{title:"\u5df2\u4f5c\u5e9f\u6761\u6570",name:"invalid",prop:"invalid",type:"normal",width:"auto"},{title:"\u5df2\u5b8c\u7ed3\u6761\u6570",name:"end",prop:"end",type:"normal",width:"auto"},{title:"key\u7801\u6709\u6548\u671f",prop:"delay",name:"delay",width:"auto",type:"slot"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"update_time",prop:"update_time",type:"normal",width:"220px"},{title:"\u53d1\u653e\u65f6\u95f4",name:"send_time",prop:"send_time",type:"normal",width:"220px"}],_i=function(){var e=Object(d.useRef)(null),t=Object(d.useRef)(null),a=Object(U.a)({tabList:[{title:"KEY\u5217\u8868"}],query:{begin_time:"",end_time:"",reseller_id:"",plan_id:"",status:"",key:"",key_batch_id:""},keyDelayVisible:!1,keyDelay:[],hash:"",loading:!1,page:1,limit:10,isQuery:!1,selectTable:[],multipleDisabledBtn:!0,exportKeyBtn:!1,lodgingTable:!1,tableHeight:500,tableData:[],grantTotal:0,surplusTotal:0,usageTotal:0,outdateTotal:0,invalidTotal:0,dialogTitle:"",bachVisible:!1,bachUrl:"",bachApiType:0}),c=Object(i.a)(a,2),o=c[0],r=c[1],l=function(){var e={begin_time:o.query.begin_time||null,end_time:o.query.end_time||null,reseller_id:o.query.reseller_id||null,plan_id:o.query.plan_id||null,status:o.query.status||null,key:o.query.key||null,key_batch_id:o.query.key_batch_id||null,hash:""!==o.hash?o.hash:null,page:o.page,limit:o.limit};return e=Object(Tt.a)(Object(n.a)({},e),(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)}))},u=function(){var e=l();r({loading:!0}),Object(s.ob)(e).then((function(e){Object(s.cc)(e,(function(e,t){r({loading:!1}),e.total>0?r({lodgingTable:!1}):r({lodgingTable:!0}),r({dataCount:e.total,tableData:e.data})}),(function(e){h.a.error(e),r({loading:!1})}))}))};Object(pt.a)((function(){u()}),[o.isQuery]);var p=function(){t.current.allChecked(!1),r({selectTable:[]})},f=function(e){var t={keys:e};try{Object(s.ec)(t).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u6279\u91cf\u4f5c\u5e9f\u6210\u529f"),p(),r({multipleDisabledBtn:!0,isQuery:!o.isQuery})}))}))}catch(a){}},j=function(e){var t={key:e.key};Object(s.hc)(t).then((function(e){Object(s.cc)(e,(function(e,t){r({page:1,limit:10,isQuery:!o.isQuery}),h.a.success("\u4f5c\u5e9f\u6210\u529f")}),(function(e){h.a.error(e)}))}))},g=function(t){Object(s.k)({hash:t}).then((function(a){Object(s.cc)(a,(function(a,n){h.a.success("\u6279\u91cf\u4e0a\u4f20\u6807\u8bb0\u4e3a\u4f5c\u5e9f"),e.current.clearData(),r({page:1,limit:10,hash:t,isQuery:!o.isQuery})}),(function(e){h.a.error(e)}))}))};return Object(b.jsxs)("div",{className:"key-container",id:"dislist",children:[Object(b.jsxs)(It,{tabs:o.tabList,style:{paddingBottom:0},children:[Object(b.jsx)("div",{className:"distable dflexj",style:{paddingBottom:0},children:Object(b.jsx)(ji,{ref:e,query:function(e){return function(e){var t=Object(Tt.a)(Object(n.a)({},e),(function(e){return Object(Ft.a)(e)||Object(Lt.a)(e)}));r({query:t})}(e)},onQuery:function(e){r({page:1,limit:10,hash:"",isQuery:!o.isQuery})},resetChange:function(){r({page:1,limit:10,hash:"",tableData:[],lodgingTable:!1,dataCount:0})}})}),Object(b.jsx)("div",{className:"distable dflexj",style:{paddingTop:0},children:Object(b.jsxs)("div",{children:[Object(b.jsx)(m.a,{onClick:function(){r({bachUrl:"/key/import?type=1",dialogTitle:"\u6279\u91cf\u4e0a\u4f20\u67e5\u8be2",bachVisible:!0,bachApiType:1})},children:"\u6279\u91cf\u4e0a\u4f20\u67e5\u8be2"}),Object(b.jsx)(m.a,{style:{border:"1px solid red",color:"red"},onClick:function(){r({bachUrl:"/key/import?type=2",dialogTitle:"\u6279\u91cf\u4e0a\u4f20\u4f5c\u5e9f",bachVisible:!0,bachApiType:2})},children:"\u6279\u91cf\u4e0a\u4f20\u4f5c\u5e9f"}),Object(b.jsx)(m.a,{style:{border:"1px solid red",color:"red"},onClick:function(){r({bachUrl:"/key/import?type=3",dialogTitle:"\u6279\u91cf\u4e0a\u4f20\u4f7f\u7528",bachVisible:!0,bachApiType:3})},children:"\u6279\u91cf\u4e0a\u4f20\u6807\u8bb0\u6210\u5df2\u4f7f\u7528"}),Object(b.jsx)(m.a,{onClick:function(){var e=o.selectTable.filter((function(e){return[1,2].includes(e.status)}));sessionStorage.setItem("knockGold_effectDate",JSON.stringify({begin_time:e[0].plan_begin_time,end_time:e[0].plan_end_time})),r({keyDelayVisible:!0,keyDelay:e})},disabled:!o.selectTable.filter((function(e){return[1,2].includes(e.status)})).length,children:"\u6279\u91cf\u7f16\u8f91key\u7801\u6709\u6548\u671f"}),Object(b.jsx)(m.a,{onClick:function(){return function(){var e=Object(C.a)(o.selectTable,(function(e){return e.key})),t={keys:e};try{At(t,2).then((function(t){2===t?f(e):1===t&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u786e\u5b9a\u6279\u91cf\u4f5c\u5e9f\uff1f"}),onConfirm:function(){f(e)},onCancel:function(){},className:"questModal",parentComponent:gi})}))}catch(a){}}()},disabled:o.multipleDisabledBtn,children:"\u6279\u91cf\u4f5c\u5e9f"}),Object(b.jsx)(m.a,{onClick:function(){return function(){var e={keys:Object(C.a)(o.selectTable,(function(e){return e.key}))};Object(s.gc)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success("\u6279\u91cf\u6807\u8bb0\u4e3a\u4f7f\u7528\u6210\u529f"),p(),r({multipleDisabledBtn:!0,isQuery:!o.isQuery})}),(function(e){h.a.error(e)}))}))}()},disabled:o.multipleDisabledBtn,children:"\u6279\u91cf\u6807\u8bb0\u4e3a\u5df2\u4f7f\u7528"}),Object(b.jsx)(m.a,{onClick:function(){return function(){var e=!1,t=l();for(var a in delete t.page,delete t.limit,""!==o.hash&&(t.hash=o.hash),t)!0!==t.hasOwnProperty("key")&&!0!==t.hasOwnProperty("plan_id")&&!0!==t.hasOwnProperty("reseller_id")&&!0!==t.hasOwnProperty("hash")||(e=!0);o.selectTable.length>0&&(t={keys:o.selectTable.map((function(e){return e.key})).join(",")},e=!0);e&&Object(s.N)(t).then((function(e){if("application/json"==e.type){var t=new FileReader;t.readAsText(e,"utf-8"),t.onload=function(){var e=JSON.parse(t.result);h.a.clear(),h.a.error(e.message)}}else{var a=new Blob([e]),n="\u8425\u9500\u8ba1\u5212"+de()+".xlsx",i=document.createElement("a");i.href=window.URL.createObjectURL(a),i.download=n,i.click(),window.URL.revokeObjectURL(i.href)}}))}()},disabled:o.exportKeyBtn,children:"\u5bfc\u51fa"})]})}),Object(b.jsxs)("div",{children:[o.selectTable.length>0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:function(){return p()},children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:o.selectTable.length}),"\u53d1\u653ekey\u603b\u6570:",o.grantTotal,",\u5269\u4f59key\u603b\u6570:",o.surplusTotal,",\u5df2\u4f7f\u7528\u603b\u6570:",o.usageTotal,",\u5df2\u8fc7\u671f\u603b\u6570:",o.outdateTotal,",\u5df2\u4f5c\u5e9f\u603b\u6570:",o.invalidTotal]}):null,Object(b.jsx)(ft.a,{loading:o.loading,icon:"circle",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:o.tableData,Column:yi,countbarVisible:!1,maxheight:o.tableHeight,isSwitch:!1,page:o.page,ref:t,dataCount:o.dataCount,pageChange:function(e){return function(e){r({page:e,isQuery:!o.isQuery})}(e)},emptyText:o.lodgingTable?"\u62b1\u6b49\uff0c\u6682\u65e0\u76f8\u5173\u6570\u636e\u8bb0\u5f55":"\u67e5\u8be2 \u8bf7\u8f93\u5165\u3010\u5206\u9500\u5546\u3011\u6216\u3010\u8ba1\u5212\u540d\u79f0\u3011\u6216\u3010key\u3011\u8fdb\u884c\u67e5\u8be2",countChange:function(e){return function(e){r({limit:e,isQuery:!o.isQuery})}(e)},checkChange:function(e){return function(e){e.length>0?r({multipleDisabledBtn:!1}):r({multipleDisabledBtn:!0}),r({selectTable:e});var t=0,a=0,n=0,i=0,s=0;e.forEach((function(e){t+=Number(e.total),a+=Number(e.residue),n+=Number(e.usage),s+=Number(e.overdue),i+=Number(e.invalid)})),r({grantTotal:t,usageTotal:n,invalidTotal:i,outdateTotal:s,surplusTotal:a})}(e)},ComponentHandler:function(e,t){return"dates"==e?Object(b.jsxs)("span",{children:[t.begin_time," \u81f3 ",t.end_time]}):"delay"==e?Object(b.jsx)("span",{children:K(t.expiration_conf)}):"status"==e?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.keyStatusBg(parseInt(t.status))}}),t.status_text]})}):"opearo"==e?Object(b.jsxs)("span",{children:[Object(b.jsx)("a",{className:"grid-link",style:{paddingLeft:"2px",color:"#d8dbdd"},children:"\u8be6\u60c5"}),Object(b.jsxs)(I.a,{position:I.d.RightTop,children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore",children:["\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(e,a){return function(e,t,a){if(5===Number(t)&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u91cd\u7f6e",a.key_code,"\uff1f"]}),onConfirm:function(){var e={key:a.key};Object(s.fd)(e).then((function(e){Object(s.cc)(e,(function(e,t){r({page:1,limit:10,isQuery:!o.isQuery}),h.a.success("\u91cd\u7f6ekey\u7801\u6210\u529f")}),(function(e){h.a.error(e)}))}))},onCancel:function(){},className:"questModal",parentComponent:gi}),1===Number(t)){var n={key:a.key};Object(s.jc)(n).then((function(e){Object(s.cc)(e,(function(e,t){r({page:1,limit:10,isQuery:!o.isQuery}),h.a.success("\u6807\u8bb0\u4e3a\u4f7f\u7528\u6210\u529f")}),(function(e){h.a.error(e)}))}))}if(2===Number(t)){var i={type:4,object_value:a.key};try{At(i).then((function(e){2===e?j(a):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u786e\u5b9a\u4f5c\u5e9f",a.title,"\uff1f"]}),onConfirm:function(){j(a)},onCancel:function(){},className:"questModal",parentComponent:gi})}))}catch(c){}}3===Number(t)&&(sessionStorage.setItem("keyCode",a.key),window.open("#/home/key-log")),4==t&&(sessionStorage.setItem("knockGold_effectDate",JSON.stringify({begin_time:a.plan_begin_time,end_time:a.plan_end_time})),r({keyDelayVisible:!0,keyDelay:[a]}))}(0,a,t)},children:[Object(b.jsx)(F.a,{disabled:1!==t.status,children:"\u6807\u8bb0\u6210\u5df2\u4f7f\u7528"},"1"),Object(b.jsx)(F.a,{disabled:![1,2].includes(t.status),children:"\u7f16\u8f91key\u7801\u6709\u6548\u671f"},"4"),Object(b.jsx)(F.a,{children:"\u91cd\u7f6e"},"5"),Object(b.jsx)(F.a,{disabled:4===t.status||3===t.status,children:"\u4f5c\u5e9f"},"2"),Object(b.jsx)(F.a,{children:"\u65e5\u5fd7"},"3")]})})]})]}):void 0}})})]})]}),Object(b.jsx)(bi,{title:o.dialogTitle,visible:o.bachVisible,url:o.bachUrl,onClose:function(){r({bachVisible:!1})},onImport:function(t){return function(t){1!==o.bachApiType?2!==o.bachApiType?3!==o.bachApiType||Object(s.j)({hash:t}).then((function(a){Object(s.cc)(a,(function(a,n){h.a.success("\u6279\u91cf\u4e0a\u4f20\u6807\u8bb0\u4e3a\u4f7f\u7528"),e.current.clearData(),r({page:1,limit:10,hash:t,isQuery:!o.isQuery})}),(function(e){h.a.error(e)}))})):At({hash:t},1).then((function(e){2===e?g(t):1===e&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u786e\u5b9a\u8981\u6279\u91cf\u4f5c\u5e9f\uff1f"}),onConfirm:function(){g(t)},onCancel:function(){},className:"questModal",parentComponent:gi})})):r({page:1,hash:t,isQuery:!o.isQuery})}(t)}}),Object(b.jsx)(ge.a,{visible:o.keyDelayVisible,className:"questModal",onClose:function(){return r({keyDelayVisible:!1})},title:"\u7f16\u8f91key\u7801\u6709\u6548\u671f",children:Object(b.jsx)(ci,{data:o.keyDelay,onColes:function(e){e&&u(),r({keyDelayVisible:!1})}})})]})},vi=a(435),xi=(a(321),a(207)),Oi=[{title:"\u8ba1\u5212 ID",name:"id",prop:"id",type:"normal",width:"auto"},{title:"\u8ba1\u5212\u7f16\u53f7",name:"stock_id",prop:"stock_id",type:"normal",width:"auto"},{title:"\u8425\u9500\u8ba1\u5212\u540d\u79f0",name:"title",prop:"title",type:"slot",width:"auto"},{title:"\u542f\u7528",width:"auto",type:"slot",prop:"switch"},{title:"\u5206\u9500\u5546",prop:"reseller_name",name:"reseller_name",width:"auto",type:"normal"},{title:"\u72b6\u6001",name:"status",prop:"status",type:"slot",width:"auto"},{title:"\u521b\u5efa\u4eba",name:"creator_name",prop:"creator_name",type:"normal",width:"auto"},{title:"\u65f6\u95f4\u8303\u56f4",type:"slot",prop:"dates",width:"260px"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"270px"},{title:"\u751f\u6210key\u7801\u603b\u6570",name:"grant",type:"normal",prop:"grant",width:"auto"},{title:"API\u8c03\u7528key\u7801\u603b\u6570",name:"api_send",type:"slot",prop:"api_send",width:"auto"},{title:"\u90ae\u4ef6\u53d1\u653e\u603b\u6570",name:"receive",type:"slot",prop:"receive",width:"auto"},{title:"\u5df2\u6d88\u8017key\u7801\u603b\u6570",name:"usage",type:"normal",prop:"usage",width:"auto"},{title:"\u5931\u6548key\u7801\u603b\u6570",name:"overdue",type:"normal",prop:"overdue",width:"auto"},{title:"\u4f5c\u5e9fkey\u7801\u603b\u6570",name:"invalid",type:"normal",prop:"invalid",width:"auto"},{title:"\u53ef\u7528key\u7801\u603b\u6570",name:"silent",type:"normal",prop:"silent",width:"auto"},{title:"\u5b8c\u7ed3key\u7801\u603b\u6570",name:"end",type:"normal",prop:"end",width:"auto"},{title:"\u66f4\u65b0\u65f6\u95f4",name:"update_time",type:"normal",prop:"update_time",width:"140px"}],ki=[{key:"id",text:"\u8ba1\u5212ID",placeholder:"\u8bf7\u8f93\u5165\u8ba1\u5212ID\u67e5\u8be2"},{key:"title",text:"\u8ba1\u5212\u540d\u79f0",placeholder:"\u8bf7\u8f93\u5165\u8ba1\u5212\u540d\u79f0\u67e5\u8be2"},{key:"reseller_name",text:"\u5206\u9500\u5546\u540d\u79f0",placeholder:"\u8bf7\u8f93\u5165\u5206\u9500\u5546\u540d\u79f0\u67e5\u8be2"}],Si=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).phoneChange=function(e){n.setState({phone:e.target.value})},n.emailChange=function(e){n.setState({email:e.target.value})},n.state={dataCount:0,page:1,limit:10,tabList:[{title:"\u8425\u9500\u8ba1\u5212\u5217\u8868"}],distdata:[],filterList:[{id:0,label:"\u72b6\u6001",prop:"status",menuList:[{id:999,name:"\u5168\u90e8"},{id:"0",name:"\u521b\u5efa\u4e2d"},{id:2,name:"\u5ba1\u6838\u4e2d"},{id:3,name:"\u5f85\u751f\u6548"},{id:4,name:"\u8fdb\u884c\u4e2d"},{id:5,name:"\u6682\u505c\u4e2d"},{id:6,name:"\u5df2\u5b8c\u7ed3"},{id:7,name:"\u672a\u901a\u8fc7"},{id:8,name:"\u5df2\u4f5c\u5e9f"}]}],tableHeight:500,menuList:[{id:0,name:"\u72b6\u6001",check:!1}],phone_list:[],email_list:[],phone:"",email:"",email_radio:-1,phone_radio:-1,key_word:"",searchOption:void 0,placeholder:"",audit_visible:!1,cur_item:null,selectiondata:[],plan_id:0,grantTotal:0,receiveTotal:0,usageTotal:0,silentTotal:0,receive_total:0,usage_total:0,silent_total:0,isSend:!0,isCancel:!1,mer_no:""},n}return Object(y.a)(a,[{key:"clickFn",value:function(){var e=window.location.href.replace(window.location.hash,"#/home/plan-create");sessionStorage.setItem("KeyPcType","3"),window.open(e,"_blank")}},{key:"onPageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getpageFn()}),0)}},{key:"send",value:function(e){var t=this,a=new RegExp("^[1][3,4,5,6,7,8,9][0-9]{9}$"),n=this.state.plan_id,i={phone:this.state.phone_radio>-1?this.state.phone_list[this.state.phone_radio]:this.state.phone,email:this.state.email_radio>-1?this.state.email_list[this.state.email_radio]:this.state.email};a.test(i.phone)?Object(s.mc)(n,i).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({audit_visible:!1}),h.a.success("\u53d1\u9001\u6210\u529f")}),(function(e){h.a.error(e)}))})):h.a.error("\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e")}},{key:"componentDidMount",value:function(e){this.getPlanList({page:1,limit:10})}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-430})}},{key:"getPlanList",value:function(e){var t=this;Object(s.zb)(Object(vi.a)(e)).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({distdata:e.data,dataCount:e.total})}),(function(e){}))}))}},{key:"onCountChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getpageFn()}),200)}},{key:"getpageFn",value:function(){var e={page:this.state.page,limit:this.state.limit,status:this.state.status};this.state.searchOption&&(e[this.state.searchOption.key]=this.state.key_word),this.getPlanList(e)}},{key:"onSwitchChange",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u6539\u53d8",1==t.open?"\u5173\u95ed":"\u5f00\u542f",Object(b.jsxs)("b",{children:["[",t.title,"]"]}),"\u7684\u72b6\u6001\uff1f"]}),onConfirm:function(){a.changeState(e,t)},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"cancel",value:function(e){this.setState({audit_visible:!1})}},{key:"changeState",value:function(e,t){var a=this,n=this,i={operation:e?1:2};if(3==t.status)return h.a.warn("\u5f85\u751f\u6548\u72b6\u6001\u8ba1\u5212\u65e0\u6cd5\u542f\u7528\uff01");Object(s.od)(t.id,i).then((function(i){Object(s.cc)(i,(function(i,s){var c=Object(ta.a)(a.state.distdata,(function(e){return e.id==t.id}));a.state.distdata[c].open=e?2:1,a.setState({distdata:a.state.distdata});var o={page:a.state.page,limit:a.state.limit,status:a.state.status};a.state.searchOption&&(o[a.state.searchOption.key]=a.state.key_word),n.getPlanList(o),h.a.success("\u66f4\u6539\u72b6\u6001\u6210\u529f")}),(function(e){h.a.error(e)}))}))}},{key:"linkTo",value:function(e){sessionStorage.setItem("showflag",!0);var t=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:e.title+"key\u5217\u8868"}]}];sessionStorage.setItem("plan_item",JSON.stringify(e)),sessionStorage.setItem("knockGold_effectDate",JSON.stringify(e)),sessionStorage.setItem("redPackets_effectDate",JSON.stringify(e)),sessionStorage.setItem("breaknav",JSON.stringify(t)),sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212\u7ba1\u7406"),sessionStorage.setItem("key_plan_id",e.id),sessionStorage.setItem("key_plan_status",e.status),e.settlement_type>0?(sessionStorage.setItem("isSettlement",1),sessionStorage.setItem("plan_list_settlement",JSON.stringify({key:e.settlement_type}))):(sessionStorage.removeItem("isSettlement"),sessionStorage.removeItem("plan_list_settlement")),window.open("#/home/key-list")}},{key:"menuItemClick",value:function(){var e=Object(j.a)(Object(f.a)().mark((function e(t,a){var n,i,c,o,r,l=this;return Object(f.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this,this.setState({plan_id:a.id}),6!=a.status){e.next=6;break}return h.a.clear(),h.a.error("\u8be5\u72b6\u6001\u4e0b\u7684\u6570\u636e\u4e0d\u5141\u8bb8\u7f16\u8f91"),e.abrupt("return");case 6:e.t0=Number(t),e.next=1===e.t0?9:2===e.t0?11:3===e.t0?12:4===e.t0?14:5===e.t0?16:8===e.t0?24:32;break;case 9:return Object(s.Cb)(a.reseller_id).then((function(e){Object(s.cc)(e,(function(e,t){l.setState({audit_visible:!0,phone_list:e.contact_phone,email_list:e.contact_email})}),(function(e){h.a.error(e)}))})),e.abrupt("return");case 11:return e.abrupt("break",33);case 12:return ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u786e\u5b9a\u4f5c\u5e9f[",a.title,"]\uff1f"]}),onConfirm:function(){n.setState({isCancel:!0}),Object(s.lc)(a.id).then((function(e){n.setState({isCancel:!1}),Object(s.cc)(e,(function(e,t){h.a.success("\u4f5c\u5e9f\u6210\u529f"),n.setState({page:1,limit:10});n.getPlanList({page:1,limit:10})}),(function(e){h.a.error(e)}))}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}),e.abrupt("return");case 14:return ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u786e\u5b9a\u5220\u9664[",a.title,"]\uff1f"]}),onConfirm:function(){Object(s.D)(a.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.success(t),n.setState({limit:10,page:1});var a={page:1,limit:10,status:l.state.status};l.state.searchOption&&(a[l.state.searchOption.key]=l.state.key_word),n.getPlanList(a)}),(function(e){h.a.error(e)}))}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}),e.abrupt("return");case 16:return sessionStorage.setItem("pathname2","/home/plan-message"),sessionStorage.setItem("showflag",!0),i=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:a.title},{path:"/home/key-list",name:"\u81ea\u5b9a\u4e49\u5151\u6362\u63d0\u793a"}]}],sessionStorage.setItem("breakchangenav",JSON.stringify(i)),sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212\u7ba1\u7406"),sessionStorage.setItem("plan_id",a.id),this.props.history.push("/home/plan-message"),e.abrupt("return");case 24:return sessionStorage.setItem("pathname2","/home/plan-defineButton"),sessionStorage.setItem("showflag",!0),c=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:a.title},{path:"/home/key-list",name:"\u81ea\u5b9a\u4e49\u5151\u6362\u6309\u94ae"}]}],sessionStorage.setItem("breakchangenav",JSON.stringify(c)),sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212\u7ba1\u7406"),sessionStorage.setItem("plan_id",a.id),this.props.history.push("/home/plan-defineButton"),e.abrupt("return");case 32:return e.abrupt("break",33);case 33:if(6==t&&this.callBack(a),7!=t){e.next=39;break}return e.next=37,Object(s.Ub)({plan_id:a.id});case 37:200===(o=e.sent).code&&((r=this).setState({mer_no:o.data.mer_no}),ee.a.confirm({type:"info",closeBtn:!0,title:"\u90ae\u50a8\u5546\u6237\u7f16\u53f7",content:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u90ae\u50a8\u5546\u6237\u7f16\u53f7",maxLength:200,onChange:function(e){return r.setState({mer_no:e.target.value})},defaultValue:r.state.mer_no}),onConfirm:function(e){if(""===r.state.mer_no)return h.a.error("\u8bf7\u8f93\u5165\u90ae\u50a8\u5546\u6237\u7f16\u53f7"),!1;Object(s.l)({plan_id:a.id,mer_no:r.state.mer_no}).then((function(t){if(200!==t.code)return h.a.error(t.message),!1;h.a.success("\u7ed1\u5b9a\u6210\u529f"),r.setState({page:1,limit:10});r.getPlanList({page:1,limit:10}),e()}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}));case 39:case"end":return e.stop()}}),e,this)})));return function(t,a){return e.apply(this,arguments)}}()},{key:"clearFn",value:function(){this.refs.plan_list.allChecked(!1),this.setState({selectiondata:[]})}},{key:"callBack",value:function(e){sessionStorage.setItem("callBackId",JSON.stringify(e.id)),sessionStorage.setItem("callBackType",JSON.stringify(2)),sessionStorage.setItem("pathname2","callback-message");var t=[{pagetitle:"\u56de\u8c03\u5730\u5740",items:[{path:"distributor-list",name:"\u8425\u9500\u8ba1\u5212\u4e00"+e.title},{path:"callback-message",name:"\u8bbe\u7f6e\u56de\u8c03\u901a\u77e5\u5730\u5740"}]}];sessionStorage.setItem("breaknav",JSON.stringify(t)),sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212"),this.props.history.push("/home/callback-message")}},{key:"selection",value:function(e){this.setState({selectiondata:e});var t=0,a=0,n=0,i=0,s=0,c=0,o=0;e.forEach((function(e){t+=Number(e.grant),a+=Number(e.receive),n+=Number(e.usage),i+=Number(e.silent),s+=Number(e.receive_total),c+=Number(e.usage_total),o+=Number(e.silent_total)})),this.setState({grantTotal:t,receiveTotal:a,usageTotal:n,silentTotal:i,receive_total:s,usage_total:c,silent_total:o})}},{key:"onFilter",value:function(e,t){this.setState({limit:10,page:1});var a={page:1,limit:10};if(this.state.searchOption&&(a[this.state.searchOption.key]=this.state.key_word),a[t]=e,999==e)delete a[t];else{var n={};n[t]=e,this.setState(n)}this.getPlanList(a)}},{key:"componentDidUpdate",value:function(e,t){t.key_word==this.state.key_word||this.state.key_word||this.iptSureFn(),t.searchOption==this.state.searchOption||this.state.searchOption||(this.iptSureFn(),this.setState({key_word:""}))}},{key:"iptSureFn",value:function(e){this.setState({page:1,limit:10});var t={page:1,limit:10,status:this.state.status};this.state.searchOption&&(t[this.state.searchOption.key]=this.state.key_word),this.getPlanList(t)}},{key:"onPhoneChange",value:function(e){this.setState({phone_radio:e.target.value})}},{key:"onEmailChange",value:function(e){this.setState({email_radio:e.target.value})}},{key:"onEdit",value:function(e,t){sessionStorage.setItem("showflag",!0);var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:"\u7f16\u8f91:"+t.title}]}];if(sessionStorage.setItem("breakchangenav",JSON.stringify(a)),6==t.status)return h.a.clear(),void h.a.error("\u4e0d\u53ef\u7f16\u8f91");var n={settlement_type:t.settlement_type,settlement_type_text:t.settlement_type_text};sessionStorage.setItem("bm_obj",JSON.stringify(n)),sessionStorage.setItem("plan_id",t.id),sessionStorage.setItem("plan_status",t.status),sessionStorage.setItem("approval_id",t.approval_id);var i=window.location.href.replace(window.location.hash,"#/home/plan-edit");sessionStorage.setItem("KeyPcType","1"),window.open(i,"_blank")}},{key:"onCopy",value:function(e,t){sessionStorage.setItem("showflag",!0);var a=[{pagetitle:"\u590d\u5236",items:[{path:"/home/key-list",name:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406"},{path:"/home/key-list",name:"\u590d\u5236:"+t.title}]}],n={settlement_type:t.settlement_type,settlement_type_text:t.settlement_type_text};sessionStorage.setItem("bm_obj",JSON.stringify(n)),sessionStorage.setItem("breakchangenav",JSON.stringify(a)),sessionStorage.setItem("plan_id_copy",t.id),sessionStorage.setItem("plan_status",t.status),sessionStorage.setItem("approval_id",t.approval_id),sessionStorage.setItem("copy_count_golod",t.copy_count);var i=window.location.href.replace(window.location.hash,"#/home/plan-edit-copy");sessionStorage.setItem("KeyPcType","2"),window.open(i,"_blank")}},{key:"onFilterClose",value:function(e){var t={};t[e]=null,this.setState(t),this.setState({page:1,limit:10});var a={page:1,limit:10};this.state.searchOption&&(a[this.state.searchOption.key]=this.state.key_word),this.getPlanList(a)}},{key:"currPreview",value:function(e){var t=this;return[0,1,2,6,7,8].includes(e.status)?Object(b.jsx)("span",{style:{color:"#ccc"},children:"\u9884\u89c8"}):Object(b.jsx)(ma.a,{trigger:"hover",content:Object(b.jsx)(xi,{value:e.href}),children:Object(b.jsx)("span",{style:{color:"#2B66F2"},onClick:function(a){return t.currPreviewBtn(e.href)},children:"\u9884\u89c8"})})}},{key:"currPreviewBtn",value:function(e){window.open(e,"_blank")}},{key:"opearoEl",value:function(e,t){var a=this;switch(e){case 1:return[0,2,3,4,5,7].includes(t.status)?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){a.onEdit(e,t)},children:"\u7f16\u8f91"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u7f16\u8f91"});case 2:return[3,4,5,6,8].includes(t.status)?Object(b.jsx)("span",{className:"grid-link",onClick:function(e){a.onCopy(e,t)},children:"\u590d\u5236"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u590d\u5236"});case 3:return[3,4,5].includes(t.status)&&1!==t.old_status?Object(b.jsxs)(I.a,{position:I.d.AutoTopLeft,visible:this.state.menuVisible,onVisibleChange:function(e){return a.setState({visible:e})},children:[Object(b.jsx)(I.b,{children:Object(b.jsxs)("div",{className:"linkmore grid-link",children:["\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})]})}),Object(b.jsx)(I.c,{children:Object(b.jsxs)(T.a,{onClick:function(e,n){return a.menuItemClick(n,t)},children:[Object(b.jsx)(F.a,{children:"\u53d1\u9001\u5bc6\u7801\u53ca\u538b\u7f29\u5305"},"1"),Object(b.jsx)(F.a,{children:"\u7ed1\u5b9a\u90ae\u50a8\u5546\u6237\u7f16\u53f7"},"7"),Object(b.jsx)(F.a,{children:"\u81ea\u5b9a\u4e49\u5151\u6362\u63d0\u793a"},"5"),Object(b.jsx)(F.a,{children:"\u81ea\u5b9a\u4e49\u5151\u6362\u6309\u94ae"},"8"),Object(b.jsx)(F.a,{children:"\u8bbe\u7f6e\u56de\u8c03"},"6"),Object(b.jsx)(F.a,{children:"\u4f5c\u5e9f"},"3")]})})]}):Object(b.jsxs)("span",{className:"grid-link disabled",children:["\u66f4\u591a ",Object(b.jsx)(w.a,{type:"down"})]});case 4:return 0===t.order_num?Object(b.jsx)("span",{className:"grid-link",style:{color:"red",paddingRight:0},onClick:function(){return a.menuItemClick(4,t)},children:"\u5220\u9664"}):Object(b.jsx)("span",{className:"grid-link disabled",style:{paddingRight:0},children:"\u5220\u9664"});default:return""}}},{key:"dingTask",value:function(e){var t=this;Object(s.K)(e).then((function(e){Object(s.cc)(e,(function(e,a){h.a.success(a),t.getpageFn()}),(function(e){h.a.error(e)}))}))}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"dislist",children:Object(b.jsxs)(It,{tabs:this.state.tabList,children:[Object(b.jsxs)("div",{className:"distable dflexj",children:[Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.clickFn.bind(this),children:"\u65b0\u5efa\u8425\u9500\u8ba1\u5212"}),Object(b.jsxs)("div",{className:"dfleac query-plan",children:[Object(b.jsx)(ne.a,{width:"180px",value:this.state.searchOption,onChange:function(t){return e.setState({searchOption:t,key_word:"",placeholder:t&&t.placeholder})},disableSearch:!0,options:ki,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u67e5\u8be2\u5206\u7c7b"}),this.state.searchOption?Object(b.jsx)(r.a,{labelWidth:0,onClearItem:function(t){e.setState({key_word:""})},wordSearch:this.iptSureFn.bind(this),onChange:function(t){return e.setState({key_word:t})},value:this.state.key_word,icon:"search",placeholder:this.state.placeholder,countShow:!1,height:"36px",width:"260px",alignment:"left"}):null]})]}),Object(b.jsx)(ia,{filterList:this.state.filterList,menuList:this.state.menuList,selectFn:function(t,a){e.onFilter(t,a)},onClose:function(t){e.onFilterClose(t)}}),Object(b.jsxs)("div",{children:[this.state.selectiondata.length>0?Object(b.jsxs)(ba.a,{type:"info",extraContent:Object(b.jsx)(m.a,{type:"primary",onClick:this.clearFn.bind(this),children:"\u6e05\u7a7a"}),children:["\u5df2\u9009\u62e9",Object(b.jsx)("font",{color:"#296bef",style:{fontWeight:"bold"},children:this.state.selectiondata.length}),"\u53d1\u653ekey\u603b\u6570:",this.state.grantTotal,",\u9886\u53d6key\u603b\u6570:",this.state.receiveTotal,",\u5df2\u4f7f\u7528\u603b\u6570:",this.state.usageTotal,",\u6c89\u9ed8\u603b\u6570:",this.state.silentTotal,",\u9886\u53d6\u603b\u4ef7(\u9884\u4f30):",this.state.receive_total.toFixed(4),", \u5df2\u4f7f\u7528\u603b\u4ef7(\u9884\u4f30):",this.state.usage_total.toFixed(4),", \u6c89\u9ed8\u603b\u4ef7(\u9884\u4f30):",this.state.silent_total.toFixed(4)]}):null,Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.distdata,Column:Oi,countbarVisible:!1,maxheight:this.state.tableHeight,isSwitch:!1,page:this.state.page,ref:"plan_list",dataCount:this.state.dataCount,pageChange:function(t){e.onPageChange(t)},countChange:function(t){e.onCountChange(t)},checkChange:this.selection.bind(this),ComponentHandler:function(t,a){return"dates"==t?Object(b.jsxs)("span",{children:[a.begin_time," \u81f3 ",a.end_time]}):"api_send"==t?Object(b.jsx)("span",{children:1==a.send_method?0:a.api_send}):"receive"==t?Object(b.jsx)("span",{children:2==a.send_method?0:a.receive}):"title"==t?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.linkTo(a)},children:a.title}):"switch"==t?Object(b.jsx)(S.a,{size:"small",checked:1==a.open,disabled:!a.is_open,onChange:function(t){e.onSwitchChange(t,a)}}):"status"==t?Object(b.jsx)("p",{className:"dflexa",children:Object(b.jsxs)("span",{children:[Object(b.jsx)("font",{className:"icon",style:{background:qt.planStatusBg(parseInt(a.status))}}),a.status_text]})}):"opearo"==t?Object(b.jsxs)("div",{children:[e.opearoEl(1,a),e.opearoEl(2,a),Object(b.jsx)("span",{className:"grid-link",children:e.currPreview(a)}),a.approval_id&&2===a.status?Object(b.jsx)("span",{className:"grid-link",onClick:function(t){e.dingTask(a.approval_id)},children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}):Object(b.jsx)("span",{className:"grid-link disabled",children:"\u9489\u9489\u5ba1\u6279\u67e5\u8be2"}),e.opearoEl(3,a),e.opearoEl(4,a)]}):void 0}}),this.state.audit_visible?Object(b.jsxs)("div",{children:[Object(b.jsx)("div",{className:"modal",children:" "}),Object(b.jsxs)("div",{className:"audit-box",children:[Object(b.jsx)(w.a,{type:"close",className:"audit-close",onClick:function(t){e.cancel(t)}}),Object(b.jsx)("div",{className:"audit-box-title",children:"\u53d1\u9001"}),Object(b.jsx)("div",{className:"audit-box-question",children:"\u662f\u5426\u7acb\u5373\u53d1\u9001key\u4ee5\u53ca\u89e3\u538b\u5bc6\u7801?"}),Object(b.jsxs)("div",{className:"phone-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u624b\u673a\u53f7"}),Object(b.jsx)("div",{className:"phone-list",children:Object(b.jsx)(te.a,{value:this.state.phone_radio,isValueEqual:this.isValueEqual,onChange:function(t){e.onPhoneChange(t)},children:this.state.phone_list.map((function(t,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){t==e.state.phone_list[e.state.phone_radio]&&e.setState({phone_radio:-1})},children:t})}))})})]}),Object(b.jsxs)("div",{className:"email-group",children:[Object(b.jsx)("div",{children:"\u63a5\u6536\u90ae\u7bb1"}),Object(b.jsx)("div",{className:"email-list",children:Object(b.jsx)(te.a,{value:this.state.email_radio,isValueEqual:this.isValueEqual,onChange:function(t){e.onEmailChange(t)},children:this.state.email_list.map((function(t,a){return Object(b.jsx)(ae.a,{value:a,onClick:function(){t==e.state.email_list[e.state.email_radio]&&e.setState({email_radio:-1})},children:t})}))})})]}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u624b\u673a\u53f7",onChange:this.phoneChange,disabled:this.state.phone_radio>-1})}),Object(b.jsx)("div",{className:"input-group",children:Object(b.jsx)(Le.a,{placeholder:"\u8bf7\u8f93\u5165\u63a5\u6536\u90ae\u7bb1",onChange:this.emailChange,disabled:this.state.email_radio>-1})}),Object(b.jsxs)("div",{className:"audit-btn-group",children:[Object(b.jsx)(m.a,{onClick:function(t){e.cancel(t)},children:"\u53d6\u6d88"}),Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.send(t)},children:"\u53d1\u9001"})]})]})]}):null]})]})})}}]),a}(u.a.Component),wi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={},n}return Object(y.a)(a,[{key:"render",value:function(){return Object(b.jsx)("div",{id:"plan",children:"\u8425\u9500\u8ba1\u5212\u9875\u9762"})}}]),a}(u.a.Component);a(322);a(323);a(324);var Ci=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={roleList:[],tabList:[{title:"\u4e8c\u7ef4\u7801\u5c0f\u5de5\u5177"}],tableHeight:600,page:1,limit:10,total:0},n}return Object(y.a)(a,[{key:"render",value:function(){return Object(b.jsx)("div",{id:"rolelist",className:"qrcode-tool",children:Object(b.jsx)(It,{tabs:this.state.tabList,children:Object(b.jsx)("div",{className:"table-container",children:Object(b.jsx)("iframe",{frameBorder:"0",src:"https://ewm.83323.cn/qrcode/index/html",width:"100%",height:"1200px"})})})})}}]),a}(u.a.Component),Ni=(a(325),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onUploadError=function(e,t){"overMaxAmount"===e?(h.a.clear(),h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247"))):"overMaxSize"===e&&(h.a.clear(),h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize,"b")))},n.state={model:{user_name:"",mobile:"",password:"",real_name:"",company:"",deparment:"",post:"",station:""},companyList:[],departmentList:[],departmentJob:[],roleList:[],headImg:"",pwdtype:"text",defaultFileList:[{src:""}],disabled:!1,id:""},n}return Object(y.a)(a,[{key:"componentDidMount",value:function(e){}},{key:"componentWillMount",value:function(){var e=this;this.getCompanyFn();var t=JSON.parse(sessionStorage.getItem("company"));t||this.getCompanyFn(),this.getRoleFn();var a=this.props;if(a&&1==a.enumer){var n,i,c,o,r,l;this.setState({pwdtype:"password"});var d=Object(ye.a)(a.rowData),u={user_name:d.user_name,mobile:d.mobile,password:"yxtx2021",real_name:d.real_name,company:t.find((function(e){return e.key==d.company_id})),deparment:{key:null===(n=d.department)||void 0===n?void 0:n.id,text:null===(i=d.department)||void 0===i?void 0:i.department_name},post:{key:null===(c=d.job)||void 0===c?void 0:c.id,text:null===(o=d.job)||void 0===o?void 0:o.job_name},station:{key:null===(r=d.role)||void 0===r?void 0:r.id,text:null===(l=d.role)||void 0===l?void 0:l.role_name}},p={};p.src=d.head,this.setState({model:u,disabled:!0,defaultFileList:[p],id:d.id,headImg:d.head}),u.company&&u.company.key&&Object(s.eb)({company_id:u.company.key}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.department_name}}));e.setState({departmentList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){})),u.deparment.key&&Object(s.fb)({department_id:u.deparment.key}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.job_name}}));e.setState({departmentJob:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}},{key:"submit",value:function(){var e=this.refs.form1.validator(),t=this.state.model,a=this;e?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:0==a.props.enumer?Object(b.jsxs)("p",{children:["\u662f\u5426\u65b0\u589e",Object(b.jsxs)("b",{children:["[",t.user_name,"]"]}),"\u8d26\u53f7\uff1f"]}):Object(b.jsxs)("p",{children:["\u662f\u5426\u4fee\u6539",Object(b.jsxs)("b",{children:["[",a.props.rowData.user_name,"]"]}),"\u8d26\u53f7\u4fe1\u606f\uff1f"]}),onConfirm:function(){var e={user_name:t.user_name,mobile:t.mobile,password:t.password,real_name:t.real_name,job_id:t.post.key,role_id:t.station.key};if(a.state.headImg&&(e.head=a.state.headImg),0==a.props.enumer)Object(s.nc)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/system/account-list"),sessionStorage.setItem("pathname2","/home/system/account-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}));else{var n=a.state.id;delete e.password,e.head=a.state.headImg,Object(s.Ec)(n,e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){sessionStorage.setItem("pathname2","/home/system/account-list"),window.location.replace("#/home/system/account-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.error("\u8bf7\u5b8c\u5584\u8868\u5355\u6570\u636e"))}},{key:"onUploadChange",value:function(e){var t=this;if(e&&e.length>0){var a=new FormData;a.append("file",e[0].file),a.append("path","account_avatar"),Object(s.sd)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({headImg:e.path}),h.a.clear(),h.a.success(a)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else t.setState({headImg:""})}},{key:"onCompanyChange",value:function(e){if(!e){var t=this.state.model;t.deparment="",t.post="",this.setState({model:t})}var a=this,n=this.state.model;if(n.company=e,this.setState({model:n}),e){var i=this.state.model;i.deparment="",i.post="",a.setState({departmentList:[]}),a.setState({departmentJob:[]}),a.setState({model:i}),Object(s.eb)({company_id:e.key}).then((function(e){Object(s.cc)(e,(function(e,t){var n=e.map((function(e){return{key:e.id,text:e.department_name}}));a.setState({departmentList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else a.setState({departmentList:[]}),a.setState({departmentJob:[]})}},{key:"onDepartmentChange",value:function(e){var t=this;if(!e){var a=this.state.model;a.post="",this.setState({model:a})}var n=this,i=this.state.model;i.deparment=e,this.setState({model:i}),n.setState({departmentJob:[]}),e?Object(s.fb)({department_id:e.key}).then((function(e){Object(s.cc)(e,(function(e,a){var i=e.map((function(e){return{key:e.id,text:e.job_name}}));n.setState({departmentJob:i});var s=t.state.model;s.post="",n.setState({model:s})}),(function(e){h.a.error(e)}))})).catch((function(e){})):n.setState({departmentJob:[]})}},{key:"onPostChange",value:function(e){var t=this.state.model;t.post=e,this.setState({model:t})}},{key:"onStationChange",value:function(e){var t=this.state.model;t.station=e,this.setState({model:t})}},{key:"getCompanyFn",value:function(){var e=this;Object(s.ab)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.company_name}}));sessionStorage.setItem("company",JSON.stringify(n)),e.setState({companyList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"changeType",value:function(e){this.setState({pwdtype:e})}},{key:"getRoleFn",value:function(){var e=this;Object(s.Fb)({page:1,limit:1e3}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data.map((function(e){return{key:e.id,text:e.role_name}}));e.setState({roleList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"changeKind",value:function(){this.setState({pwdtype:"password"})}},{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/system/account-list"),sessionStorage.setItem("pathname2","/home/system/account-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"addaccinfo",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:{account:[{type:"required",message:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"}],phone:[{type:"required",message:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"},{type:"regExp",message:"\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"}],pwd:[{type:"required",message:"\u8bf7\u8f93\u5165\u5bc6\u7801"},{type:"regExp",message:"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210(\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199)",reg:"^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$"}],name:[{type:"required",message:"\u8bf7\u8f93\u5165\u771f\u5b9e\u59d3\u540d"},{type:"regExp",message:"2-16\u5b57\u6c49\u5b57/\u5b57\u6bcd\u7ec4\u6210",reg:"^([\u4e00-\u9fa5]|[a-zA-Z]){2,16}$"}],company:[{type:"required",message:"\u8bf7\u9009\u62e9\u516c\u53f8"}],deparment:[{type:"required",message:"\u8bf7\u9009\u62e9\u90e8\u95e8"}],post:[{type:"required",message:"\u8bf7\u9009\u62e9\u5c97\u4f4d"}],station:[{type:"required",message:"\u8bf7\u9009\u62e9\u89d2\u8272"}]},ref:"form1",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u8d26\u53f7",prop:"account",id:"account",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.user_name=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.user_name="",e.setState({model:a})},value:this.state.model.user_name,placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:" \u624b\u673a\u53f7",prop:"phone",id:"phone",children:Object(b.jsx)(r.a,{kind:"tel",onChange:function(t){var a=e.state.model;a.mobile=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.mobile="",e.setState({model:a})},value:this.state.model.mobile,placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5bc6\u7801",prop:"pwd",id:"pwd",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.password=t,e.setState({model:a})},markedShow:function(t){e.changeType(t)},kind:this.state.pwdtype,disabled:this.state.disabled,onfocusFn:function(t){return e.changeKind()},onClearItem:function(t){var a=e.state.model;a.password="",e.setState({model:a})},value:this.state.model.password,placeholder:"\u8bf7\u8f93\u5165\u5bc6\u7801",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u771f\u5b9e\u59d3\u540d",prop:"name",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.real_name=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.real_name="",e.setState({model:a})},value:this.state.model.real_name,placeholder:"\u8bf7\u8f93\u5165\u771f\u5b9e\u59d3\u540d",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"company",labelname:"\u5c97\u4f4d",prop:"company",myClassName:"sel1",children:Object(b.jsx)(ne.a,{options:this.state.companyList,placeholder:"\u8bf7\u9009\u62e9\u516c\u53f8",value:this.state.model.company,onChange:function(t){e.onCompanyChange(t),Rt.a.emit("change","company",t)}})}),Object(b.jsx)(c.a,{id:"deparment",prop:"deparment",myClassName:"sel2",labelwidth:"0px",children:Object(b.jsx)(ne.a,{options:this.state.departmentList,placeholder:"\u8bf7\u9009\u62e9\u90e8\u95e8",popupWidth:"360px",value:this.state.model.deparment,onChange:function(t){e.onDepartmentChange(t),Rt.a.emit("change","deparment",t)}})}),Object(b.jsx)(c.a,{id:"post",prop:"post",myClassName:"sel2 sel3",labelwidth:"0px",children:Object(b.jsx)(ne.a,{options:this.state.departmentJob,placeholder:"\u8bf7\u9009\u62e9\u5c97\u4f4d",popupWidth:"360px",value:this.state.model.post,onChange:function(t){e.onPostChange(t),Rt.a.emit("change","post",t)}})}),Object(b.jsx)(c.a,{prop:"station",labelname:"\u89d2\u8272",id:"station",children:Object(b.jsx)(ne.a,{options:this.state.roleList,clearable:!0,placeholder:"\u8bf7\u9009\u62e9\u89d2\u8272",value:this.state.model.station,onChange:function(t){e.onStationChange(t),Rt.a.emit("change","station",t)},popupWidth:"360px",width:"520px"})}),Object(b.jsxs)("div",{className:"zent-form-actions",children:[Object(b.jsx)(m.a,{type:"primary",onClick:this.submit.bind(this),children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",htmlType:"reset",onClick:this.cancel.bind(this),children:"\u53d6\u6d88"})]})]}),Object(b.jsxs)("div",{className:"mypic",children:[Object(b.jsx)("b",{children:"\u5934\u50cf"}),Object(b.jsx)("div",{className:"changepic dflexac",children:""==this.state.defaultFileList[0].src?Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,onError:this.onUploadError}):Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,defaultFileList:this.state.defaultFileList,onError:this.onUploadError})})]})]})}}]),a}(u.a.Component)),Di=(a(326),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={pagetitle:"\u65b0\u5efa\u8d26\u53f7",rowData:{},enumer:1},n}return Object(y.a)(a,[{key:"componentWillMount",value:function(){var e=JSON.parse(sessionStorage.getItem("breaknav"))[0].pagetitle,t=e.includes("\u65b0\u5efa")?0:1,a=JSON.parse(sessionStorage.getItem("dataInfo"));this.setState({pagetitle:e+"\u8d26\u53f7",rowData:a,enumer:t})}},{key:"render",value:function(){return Object(b.jsx)("div",{id:"accadd",className:"maincenter",children:Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.pagetitle,children:Object(b.jsx)("div",{className:"addaccount",children:Object(b.jsx)(Ni,{enumer:this.state.enumer,rowData:this.state.rowData})})})})}}]),a}(u.a.Component)),Ii=(a(188),ae.a.Group),Ti=ae.a.Button,Fi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).setVisible=function(e){n.setState({visible:e})},n.authChange=function(e){Object(Xt.a)(n);n.setState({authWay:e.target.value}),1==e.target.value?n.getequalMigration(n.props.deldata.id):n.getAutnMan(n.props.deldata.id)},n.state={classification:"",personnel:"",value:"1",authWay:1,levelAuth:!0,downLevel:!0,levelAuthdata:[],downLeveldata:[],authperson:[],loadshow:!1,model:{}},n}return Object(y.a)(a,[{key:"getequalMigration",value:function(e){var t=this;Object(s.pb)(e).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.map((function(e){return{text:e.real_name,key:e.id}}));t.setState({levelAuth:n.length>0,authperson:n,levelAuthdata:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getAutnMan",value:function(e){var t=this;Object(s.ac)(e,{page:1,limit:1e3}).then((function(e){Object(s.cc)(e,(function(e,a){var n=e.data.filter((function(e){return 1==e.status})).map((function(e){return{text:e.real_name,key:e.id}}));t.setState({downLevel:n.length>0,authperson:n,downLeveldata:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){var e=this;this.getequalMigration(this.props.deldata.id),this.getAutnMan(this.props.deldata.id),setTimeout((function(){e.state.levelAuth?e.setState({authperson:e.state.levelAuthdata,loadshow:!0,authWay:1}):e.setState({authperson:e.state.downLeveldata,loadshow:!0,authWay:0})}),300)}},{key:"render",value:function(){var e=this;return this.state.loadshow?Object(b.jsxs)("div",{id:"delAuth",children:[Object(b.jsx)("p",{className:"tips",children:"\u5220\u9664\u8d26\u53f7\uff0c\u9700\u586b\u5199\u4ea4\u63a5\u4eba\u3002\u5220\u9664\u8d26\u53f7\uff0c\u6570\u636e\u5c06\u5168\u90e8\u79fb\u4ea4\u7ed9\u4ea4\u63a5\u4eba\uff0c\u4e14\u5220\u9664\u8d26\u53f7\u4e0d\u53ef\u6062\u590d"}),Object(b.jsxs)(o.a,{ref:"form1",children:[Object(b.jsx)(c.a,{labelname:"\u4ea4\u63a5\u89d2\u8272",children:Object(b.jsxs)(Ii,{onChange:this.authChange,value:this.state.authWay,children:[Object(b.jsx)(Ti,{value:1,disabled:!this.state.levelAuth,children:"\u5e73\u7ea7"}),Object(b.jsx)(Ti,{value:0,disabled:!this.state.downLevel,children:"\u4e0b\u7ea7"})]})}),Object(b.jsx)(c.a,{labelname:"\u4ea4\u63a5\u4eba",children:Object(b.jsx)(ne.a,{options:this.state.authperson,placeholder:"\u8bf7\u9009\u62e9",onChange:function(t){return e.setState({personnel:t})},value:this.state.personnel})})]})]}):null}}]),a}(u.a.Component);function Li(e,t){return e!==t.getSectionValue("password").password?{name:"passwordEqual",message:"\u4e24\u6b21\u586b\u5199\u7684\u5bc6\u7801\u4e0d\u4e00\u81f4"}:null}var Mi=function(e){var t=sa.a.useForm(ca.b.View),a=u.a.useState("password"),n=Object(i.a)(a,2),c=n[0],o=n[1],r=u.a.useState("password"),l=Object(i.a)(r,2),d=l[0],p=l[1],f=u.a.useCallback((function(t){var a=t.getValue();if(a){var n=Object(ye.a)(a);Object(s.Kc)(e.id,n).then((function(t){Object(s.cc)(t,(function(t,a){h.a.clear(),h.a.success(a),e.visibleShow(!1)}),(function(e){h.a.clear(),h.a.error(t.data.message)}))})).catch((function(e){}))}}),[]);return Object(b.jsxs)(sa.a,{form:t,layout:"horizontal",scrollToError:!0,onSubmit:f,children:[Object(b.jsx)(oa.a,{name:"password",label:"\u65b0\u5bc6\u7801",className:"selfpwd",required:!0,helpDesc:"",after:Object(b.jsx)(w.a,{type:"password"==c?"eye-o":"closed-eye",onClick:function(){o("password"==c?"text":"password")}}),validators:[ra.b.required("\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801"),ra.b.pattern(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/,"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210\uff0c(\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199)")],notice:"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210\uff0c\u5b57\u6bcd(\u533a\u5206\u5927\u5c0f\u5199)",props:{type:"password"==c?"password":"text",maxLength:16,autoComplete:"new-password"}}),Object(b.jsx)(oa.a,{name:"old_password",label:"\u786e\u8ba4\u5bc6\u7801",className:"selfpwd",after:Object(b.jsx)(w.a,{type:"password"==d?"eye-o":"closed-eye",onClick:function(){p("password"==d?"text":"password")}}),required:!0,notice:"\u5fc5\u987b\u4e0e\u65b0\u5bc6\u7801\u8f93\u5165\u4e00\u81f4",validators:[ra.b.required("\u8bf7\u786e\u8ba4\u5bc6\u7801"),Li],props:{type:"password"==d?"password":"text",maxLength:16,autoComplete:"new-password"}}),Object(b.jsxs)("p",{className:"dflexajce",children:[Object(b.jsx)(m.a,{type:"primary",htmlType:"submit",children:"\u786e\u5b9a"}),",",Object(b.jsx)(m.a,{onClick:function(){e.visibleShow(!1)},children:"\u53d6\u6d88"})]})]})},Hi=[{title:"\u8d26\u53f7",name:"user_name",prop:"user_name",type:"normal",width:"10%"},{title:"\u624b\u673a\u53f7",prop:"mobile",name:"mobile",width:"10%",type:"normal"},{title:"\u89d2\u8272",name:"role",prop:"role.role_name",type:"normal",defaultText:0,width:"10%"},{title:"\u5c97\u4f4d",name:"job.job_name",type:"normal",prop:"job.job_name",width:"10%"},{title:"\u59d3\u540d",name:"real_name",type:"normal",prop:"real_name",width:"10%"},{title:"\u72b6\u6001",width:"10%",type:"slot",name:"name",prop:"status"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",prop:"create_time",width:"20%",type:"normal"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"20%"}],qi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onChange=function(e){n.setState(e)},n.onConfirm=function(){},n.onCancel=function(){},n.setVisible=function(e){n.setState({visible:e})},n.setdelVisible=function(e){n.setState({delvisible:e})},n.getChildrenMsg=function(e,t){n.setState({visible:t})},n.state={checkedSmall:!0,tableHeight:600,visible:!1,delvisible:!1,tabList:[{title:"\u8d26\u53f7\u5217\u8868"}],accList:[],page:1,limit:10,total:0,deldata:{},search:"",id:""},n}return Object(y.a)(a,[{key:"clickFn",value:function(){sessionStorage.setItem("pathname2","/home/system/account-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u65b0\u5efa",items:[{path:"/home/system/account-list",name:"\u8d26\u53f7\u7ba1\u7406"},{path:"/home/system/account-add",name:"\u65b0\u5efa\u8d26\u53f7"}]}])),window.open("#/home/system/account-add")}},{key:"onSwitchChange",value:function(e,t){var a=this,n={status:0==t.status?1:0};ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426",0==t.status?"\u542f\u7528":"\u505c\u7528",Object(b.jsxs)("b",{children:["[",t.user_name,"]"]}),"\u8d26\u53f7\uff1f"]}),onConfirm:function(){Object(s.Cc)(t.id,n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getAccountFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"changeState",value:function(e,t){var a=this,n=Object(ta.a)(a.state.accoutdata,(function(e){return e.id==t.id}));a.state.accoutdata[n].status=e,a.setState({accoutdata:a.state.accoutdata})}},{key:"delFn",value:function(e,t){if(1==t.status)h.a.clear(),h.a.warn("\u8bf7\u5148\u5c06\u6b64\u8d26\u53f7\u7981\u7528\uff01");else{this.setState({delvisible:!0,deldata:t})}}},{key:"editFn",value:function(e,t){Object(s.ab)().then((function(e){Object(s.cc)(e,(function(e,t){var a=e.map((function(e){return{key:e.id,text:e.company_name}}));sessionStorage.setItem("company",JSON.stringify(a)),window.open("#/home/system/account-add")}),(function(e){h.a.error(e)}))})).catch((function(e){})),sessionStorage.setItem("pathname2","/home/system/account-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u7f16\u8f91",items:[{path:"/home/system/account-list",name:"\u8d26\u53f7\u7ba1\u7406"},{path:"/home/system/account-add",name:"\u7f16\u8f91\u8d26\u53f7"}]}])),sessionStorage.setItem("dataInfo",JSON.stringify(t))}},{key:"resetpwd",value:function(e,t){this.setState({visible:!0,id:t.id})}},{key:"subaccount",value:function(e,t){this.props.history.push("/home/system/subaccount-list?aid="+t.id);var a=[{pagetitle:"\u7f16\u8f91",items:[{path:"/home/system/account-list",name:"\u8d26\u53f7\u7ba1\u7406"},{path:"/home/system/subaccount-add",name:t.real_name+"\u7684\u5b50\u8d26\u53f7\u5217\u8868"}]}];sessionStorage.setItem("subbreaknav",JSON.stringify(a)),sessionStorage.setItem("subaid",t.id)}},{key:"getAccountFn",value:function(){var e=this,t=e.state,a=t.page,n=t.limit,i=t.search,c={page:a,limit:n};i&&(c.search=i),Object(s.Q)(c).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data,i=t.total;e.setState({accList:n,total:i})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"delSubmit",value:function(){var e=this,t=this,a=this.refs.delAuthDom.state;a.personnel.key?1==a.authWay?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u79fb\u4ea4\u5e76\u5220\u9664",Object(b.jsxs)("b",{children:["[",this.state.deldata.real_name,"]"]}),"\uff1f"]}),onConfirm:function(){var n={admin_user_id:e.state.deldata.id,receive_uid:a.personnel.key};Object(s.Uc)(n).then((function(a){Object(s.cc)(a,(function(a,n){h.a.clear(),h.a.success(n),setTimeout((function(){Object(s.r)(e.state.deldata.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getAccountFn(),t.setState({delvisible:!1})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}):ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u79fb\u4ea4\u5e76\u5220\u9664",Object(b.jsxs)("b",{children:["[",this.state.deldata.real_name,"]"]}),"\uff1f"]}),onConfirm:function(){var n={admin_user_id:e.state.deldata.id,receive_uid:a.personnel.key};Object(s.Dc)(n).then((function(a){Object(s.cc)(a,(function(a,n){h.a.clear(),h.a.success(n),setTimeout((function(){Object(s.r)(e.state.deldata.id).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),t.getAccountFn(),t.setState({delvisible:!1})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.warn("\u8bf7\u9009\u62e9\u4ea4\u63a5\u4eba"))}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getAccountFn()}),10)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getAccountFn()}),10)}},{key:"iptsureFn",value:function(){var e=this;this.setState({page:1}),setTimeout((function(){e.getAccountFn()}),300)}},{key:"componentWillMount",value:function(){this.getAccountFn(),this.setState({tableHeight:window.innerHeight-390})}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e,t){t.search==this.state.search||this.state.search||this.getAccountFn()}},{key:"sureFn",value:function(){this.setVisible(!1),this.refs.midify.onSubmit()}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"accountlist",children:[Object(b.jsx)(It,{tabs:this.state.tabList,children:Object(b.jsxs)("div",{className:"acctable",children:[Object(b.jsxs)("div",{className:"accountable dflexj",children:[Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.clickFn.bind(this),children:"\u65b0\u5efa\u8d26\u53f7"}),Object(b.jsx)(r.a,{onChange:function(t){return e.setState({search:t})},value:this.state.search,wordSearch:this.iptsureFn.bind(this),icon:"search",placeholder:"\u8bf7\u8f93\u5165\u59d3\u540d\u3001\u624b\u673a\u53f7\u3001\u8d26\u53f7\u67e5\u8be2",countShow:!1,height:"36px",width:"260px",onClearItem:function(t){e.setState({search:""})},alignment:"left"})]}),Object(b.jsx)("div",{className:"table-container",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.accList,Column:Hi,page:this.state.page,maxheight:this.state.tableHeight,isMultiple:!1,dataCount:this.state.total,countbarVisible:!1,isSwitch:!1,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"status"==t?Object(b.jsx)(S.a,{size:"small",checked:0!=a.status,onChange:function(t){e.onSwitchChange(t,a)}}):"opearo"==t?Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.editFn(t,a)},children:"\u7f16\u8f91"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.delFn(t,a)},children:"\u5220\u9664"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.resetpwd(t,a)},children:"\u91cd\u7f6e\u5bc6\u7801"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.subaccount(t,a)},children:"\u5b50\u8d26\u53f7\u7ba1\u7406"})]}):void 0}})})]})}),Object(b.jsx)(ge.a,{visible:this.state.visible,className:"questModal",onClose:function(){return e.setVisible(!1)},title:"\u91cd\u7f6e\u5bc6\u7801",children:Object(b.jsx)("div",{children:Object(b.jsx)(Mi,{visibleShow:function(t){return e.setVisible(t)},id:this.state.id})})}),Object(b.jsx)(ge.a,{visible:this.state.delvisible,className:"questModal",onClose:function(){return e.setdelVisible(!1)},title:"\u5220\u9664\u8d26\u53f7",footer:Object(b.jsxs)("div",{style:{textAlign:"right"},children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(t){e.delSubmit(t)},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{onClick:function(t){e.setdelVisible(!1)},children:"\u53d6\u6d88"})]}),children:Object(b.jsx)("div",{children:Object(b.jsx)(Fi,{deldata:this.state.deldata,visibleShow:function(t){return e.setdelVisible(t)},id:this.state.id,ref:"delAuthDom"})})})]})}}]),a}(u.a.Component),Pi=a(612),Bi=(a(327),function(e){var t=e.item,a=e.onDelete;return Object(b.jsxs)("div",{className:"dflexj",children:[Object(b.jsx)("span",{children:t.name}),Object(b.jsx)("span",{className:"delfilebtn",onClick:function(){return a(t)},children:"\u5220\u9664"})]})}),Ei=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onUploadFileChange=function(e){e.length>0&&n.setState({file:e[0].file})},n.onUploadError=function(e,t){"overMaxSize"===e&&h.a.error("\u6587\u4ef6\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize))},n.state={model:{title:"",scope:"",client:""},client:[],file:"",headImg:"",account:[]},n}return Object(y.a)(a,[{key:"onUploadChange",value:function(e){var t=this;if(e&&e.length>0){var a=new FormData;a.append("file",e[0].file),a.append("path"," plan_theme"),Object(s.sd)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({headImg:e.path}),h.a.clear(),h.a.success(a)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else h.a.clear(),h.a.warn("\u8bf7\u5148\u9009\u62e9\u56fe\u7247\uff01")}},{key:"onNextStep",value:function(){var e=this;this.refs.form1.validator()&&(this.state.headImg&&this.state.file?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u65b0\u589e",Object(b.jsxs)("b",{children:["[",e.state.model.title,"]"]}),"\u6a21\u677f\uff1f"]}),onConfirm:function(){var t=new FormData,a=Object(ye.a)(e.state.model);t.append("thumb",e.state.headImg),t.append("file",e.state.file),t.append("client",a.client.key),t.append("scope",a.scope.key),t.append("title",a.title),Object(s.Bc)(t).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.warn("\u8bf7\u5148\u4e0a\u4f20\u6587\u4ef6\u56fe\u7247")))}},{key:"onCancel",value:function(){window.history.back()}},{key:"getAccount",value:function(){var e=this;Object(s.xb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.user_name}}));e.setState({account:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"onscopeChange",value:function(e){var t=this.state.model;t.scope=e,this.setState({model:t})}},{key:"onclientChange",value:function(e){var t=this.state.model;t.client=e,this.setState({model:t})}},{key:"componentWillMount",value:function(){this.getAccount();var e=JSON.parse(sessionStorage.getItem("enmu")).theme_client_type.code,t=[];for(var a in e)t.push({key:a,text:e[a]});this.setState({client:t})}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{className:"customize",children:Object(b.jsxs)(p.a,{type:"nested",title:"\u5b9a\u5236\u5316\u6a21\u677f",className:"customize-card",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:{name:[{type:"required",message:"\u8bf7\u8f93\u5165\u6807\u9898"}],client:[{type:"required",message:"\u8bf7\u9009\u62e9\u9875\u9762\u7c7b\u578b"}],scope:[{type:"required",message:"\u8bf7\u9009\u62e9\u5f52\u5c5e\u8d26\u53f7"}]},ref:"form1",children:[Object(b.jsx)(c.a,{labelname:"\u6807\u9898",prop:"name",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.title=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.title="",e.setState({model:a})},value:this.state.model.title,placeholder:"\u8bf7\u8f93\u5165",labelWidth:"0px",maxLength:32,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u6587\u4ef6\u4e0a\u4f20",prop:"zip",children:Object(b.jsx)(Pi.a,{multiple:!0,className:"zent-upload-demo-pic",maxSize:51200,tips:"\u5355\u4e2a\u6587\u4ef6\u4e0d\u8d85\u8fc7 50kb",onChange:function(t){return e.onUploadFileChange(t)},onUpload:this.onUpload,customUploadItem:Bi,onError:this.onUploadError,sortable:!0})}),Object(b.jsx)(c.a,{labelname:"\u622a\u56fe\u4e0a\u4f20",prop:"picurl",children:Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:1048576,tips:"\u5efa\u8bae\u5c3a\u5bf8 375*667\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc71Mb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload})}),Object(b.jsx)(c.a,{labelname:"\u5f52\u5c5e\u8d26\u53f7",prop:"scope",id:"scope",children:Object(b.jsx)(ne.a,{options:this.state.account,onChange:function(t){e.onscopeChange(t)},placeholder:"\u9009\u62e9\u4e00\u9879",width:515,value:this.state.model.scope})}),Object(b.jsx)(c.a,{labelname:"\u9875\u9762\u7c7b\u578b",prop:"client",id:"client",children:Object(b.jsx)(ne.a,{options:this.state.client,onChange:function(t){e.onclientChange(t)},placeholder:"\u9009\u62e9\u4e00\u9879",width:515,value:this.state.model.client})})]}),Object(b.jsxs)("div",{className:"btn-group",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){return e.onNextStep()},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return e.onCancel()},children:"\u53d6\u6d88"})]})]})})}}]),a}(u.a.Component),Ai=a(600),Vi=(a(328),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onselect=function(e,t){document.querySelectorAll(".leftTree .zent-tree-content").forEach((function(e){e.style.background="#fff"})),t.style.background="#A8C3F0",n.setState({selectdom:e}),n.props.menuInfo(e)},n.onCheck=function(e,t){n.setState({checkedKeys:e})},n.state={checkedKeys:[],disabledCheckedKeys:[],selectdom:{},menu_data:[]},n}return Object(y.a)(a,[{key:"getMenuFn",value:function(){var e=this;Object(s.qb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=Object(ye.a)(t);e.setState({menu_data:n})}))}))}},{key:"componentWillMount",value:function(){this.getMenuFn()}},{key:"componentWillReceiveProps",value:function(e){}},{key:"render",value:function(){var e=this.state,t=e.checkedKeys,a=e.disabledCheckedKeys;return Object(b.jsx)("div",{id:"menuLeft",children:Object(b.jsx)(Ai.a,{checkable:!0,size:"small",data:this.state.menu_data,onCheck:this.onCheck,onSelect:this.onselect,checkedKeys:t,disabledCheckedKeys:a})})}}]),a}(u.a.Component)),Ji=a(603),Wi=(a(329),ae.a.Group),zi=ae.a.Button,Ri=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).typeonChange=function(e){var t=n.state.model;t.level=e.target.value,n.setState({model:t})},n.methodsonChange=function(e){var t=n.state.model;t.method=e.target.value,n.setState({model:t})},n.statusChange=function(e){var t=n.state.model;t.status=e.target.value,n.setState({model:t})},n.authChange=function(e){var t=n.state.model;t.auth=e.target.value,n.setState({model:t})},n.state={model:{title:"",fid:"",url:"",auth:"",sort:"",status:"",icon:"",method:"",level:"",router:""}},n}return Object(y.a)(a,[{key:"sortChange",value:function(e){var t=this.state.model;t.sort=e,this.setState({model:t})}},{key:"submit",value:function(){return this.refs.form1.validator()}},{key:"cancel",value:function(){this.setState({model:{menuname:""}}),this.refs.form1.cancel()}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"menuright",children:Object(b.jsxs)(o.a,{model:this.state.model,rules:{menuname:[{type:"required",message:"\u8bf7\u8f93\u5165\u83dc\u5355\u540d\u79f0"}]},ref:"form1",children:[Object(b.jsx)(c.a,{labelname:"\u83dc\u5355\u540d\u79f0",prop:"menuname",id:"menuname",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.title=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.title="",e.setState({model:a})},value:this.state.model.title,placeholder:"\u8bf7\u8f93\u5165\u83dc\u5355\u540d\u79f0",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u7c7b\u578b",children:Object(b.jsxs)(Wi,{onChange:this.typeonChange,value:this.state.model.level,children:[Object(b.jsx)(zi,{value:"1",children:"\u4e00\u7ea7\u83dc\u5355"}),Object(b.jsx)(zi,{value:"5",children:"\u4e8c\u7ea7\u83dc\u5355"}),Object(b.jsx)(zi,{value:"10",children:"\u64cd\u4f5c\u6309\u94ae"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u8bf7\u6c42\u65b9\u5f0f",children:Object(b.jsxs)(Wi,{onChange:this.methodsonChange,value:this.state.model.method,children:[Object(b.jsx)(zi,{value:"1",children:"GET"}),Object(b.jsx)(zi,{value:"5",children:"POST"}),Object(b.jsx)(zi,{value:"10",children:"PUT"}),Object(b.jsx)(zi,{value:"15",children:"DELETE"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u662f\u5426\u663e\u793a",children:Object(b.jsxs)(Wi,{onChange:this.statusChange,value:this.state.model.status,children:[Object(b.jsx)(zi,{value:"1",children:"\u662f"}),Object(b.jsx)(zi,{value:"0",children:"\u5426"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u662f\u5426\u9a8c\u8bc1\u767b\u9646",children:Object(b.jsxs)(Wi,{onChange:this.authChange,value:this.state.model.auth,children:[Object(b.jsx)(zi,{value:"1",children:"\u662f"}),Object(b.jsx)(zi,{value:"0",children:"\u5426"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u56fe\u6807",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.icon=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.icon="",e.setState({model:a})},value:this.state.model.icon,placeholder:"\u8bf7\u8f93\u5165\u83dc\u5355\u56fe\u6807",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u540e\u7aef\u7c7b\u5e93",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.url=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.url="",e.setState({model:a})},value:this.state.model.url,placeholder:"\u8bf7\u8f93\u5165\u540e\u7aef\u7c7b\u5e93",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u524d\u7aef\u8def\u7531",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.router=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.router="",e.setState({model:a})},value:this.state.model.router,placeholder:"\u8bf7\u8f93\u5165\u524d\u7aef\u8def\u7531",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u524d\u7aef\u7ec4\u4ef6",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.component=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.component="",e.setState({model:a})},value:this.state.model.component,placeholder:"\u8bf7\u8f93\u5165\u524d\u7aef\u7ec4\u4ef6",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u6392\u5e8f",children:Object(b.jsx)(Ji.a,{value:this.state.model.sort,showStepper:!0,onChange:function(t){return e.sortChange(t)},placeholder:"\u8bf7\u8f93\u5165\u6570\u5b57"})})]})})}}]),a}(u.a.Component),Yi=(a(330),ae.a.Group),Ki=ae.a.Button,Gi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).typeonChange=function(e){var t=n.state.model;t.level=e.target.value,n.setState({model:t})},n.methodsonChange=function(e){var t=n.state.model;t.method=e.target.value,n.setState({model:t})},n.statusChange=function(e){var t=n.state.model;t.status=e.target.value,n.setState({model:t})},n.authChange=function(e){var t=n.state.model;t.auth=e.target.value,n.setState({model:t})},n.state={model:{title:"",fid:"",url:"",auth:"",sort:"",status:"",icon:"",method:"",level:""},menutype:"",cancelInfo:{},menumethods:""},n}return Object(y.a)(a,[{key:"sortChange",value:function(e){var t=this.state.model;t.sort=e,this.setState({model:t})}},{key:"modifysubmit",value:function(){var e=this;if(this.refs.form1.validator()){var t=Object(ye.a)(this.state.model);delete t.id,ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u4fee\u6539\u83dc\u5355\u4fe1\u606f\uff1f"}),onConfirm:function(){Object(s.Vc)(e.state.model.id,t).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),window.history.go(0)}),(function(e){}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}}},{key:"resetInfo",value:function(){this.setState({model:this.state.cancelInfo}),setTimeout((function(){h.a.clear(),h.a.success("\u91cd\u7f6e\u6210\u529f")}),500)}},{key:"cancel",value:function(){this.setState({model:{menuname:""}}),this.refs.form1.cancel()}},{key:"componentWillReceiveProps",value:function(e){this.setState({cancelInfo:this.props.menuList})}},{key:"componentDidUpdate",value:function(e,t){if(t.cancelInfo!=this.state.cancelInfo){var a=Object(ye.a)(this.state.cancelInfo),n={title:a.title,fid:a.fid,url:a.url,auth:a.auth,sort:a.sort,status:a.status,icon:a.icon,method:a.method,level:a.level,router:a.router,id:a.id};this.setState({model:n})}}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"menuright",children:[Object(b.jsxs)("p",{className:"btnlist",children:[Object(b.jsx)(m.a,{type:"primary",onClick:this.modifysubmit.bind(this),children:"\u4fee\u6539\u5e76\u4fdd\u5b58"}),Object(b.jsx)(m.a,{type:"normal",onClick:this.resetInfo.bind(this),children:"\u91cd\u7f6e"})]}),Object(b.jsxs)(o.a,{model:this.state.model,rules:{menuname:[{type:"required",message:"\u8bf7\u8f93\u5165\u83dc\u5355\u540d\u79f0"}]},ref:"form1",children:[Object(b.jsx)(c.a,{labelname:"\u83dc\u5355\u540d\u79f0",prop:"menuname",id:"menuname",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.title=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.title="",e.setState({model:a})},value:this.state.model.title,placeholder:"\u8bf7\u8f93\u5165\u83dc\u5355\u540d\u79f0",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u7c7b\u578b",children:Object(b.jsxs)(Yi,{onChange:this.typeonChange,value:this.state.model.level,children:[Object(b.jsx)(Ki,{value:1,children:"\u4e00\u7ea7\u83dc\u5355"}),Object(b.jsx)(Ki,{value:5,children:"\u4e8c\u7ea7\u83dc\u5355"}),Object(b.jsx)(Ki,{value:10,children:"\u64cd\u4f5c\u6309\u94ae"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u8bf7\u6c42\u65b9\u5f0f",children:Object(b.jsxs)(Yi,{onChange:this.methodsonChange,value:this.state.model.method,children:[Object(b.jsx)(Ki,{value:1,children:"GET"}),Object(b.jsx)(Ki,{value:5,children:"POST"}),Object(b.jsx)(Ki,{value:10,children:"PUT"}),Object(b.jsx)(Ki,{value:15,children:"DELETE"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u662f\u5426\u663e\u793a",children:Object(b.jsxs)(Yi,{onChange:this.statusChange,value:this.state.model.status,children:[Object(b.jsx)(Ki,{value:1,children:"\u662f"}),Object(b.jsx)(Ki,{value:0,children:"\u5426"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u662f\u5426\u9a8c\u8bc1\u767b\u9646",children:Object(b.jsxs)(Yi,{onChange:this.authChange,value:this.state.model.auth,children:[Object(b.jsx)(Ki,{value:1,children:"\u662f"}),Object(b.jsx)(Ki,{value:0,children:"\u5426"})]})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u56fe\u6807",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.icon=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.icon="",e.setState({model:a})},value:this.state.model.icon,placeholder:"\u8bf7\u8f93\u5165\u83dc\u5355\u56fe\u6807",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u540e\u7aef\u7c7b\u5e93",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.url=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.url="",e.setState({model:a})},value:this.state.model.url,placeholder:"\u8bf7\u8f93\u5165\u540e\u7aef\u7c7b\u5e93",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u524d\u7aef\u8def\u7531",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.router=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.router="",e.setState({model:a})},value:this.state.model.router,placeholder:"\u8bf7\u8f93\u5165\u524d\u7aef\u8def\u7531",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u524d\u7aef\u7ec4\u4ef6",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.component=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.component="",e.setState({model:a})},value:this.state.model.component,placeholder:"\u8bf7\u8f93\u5165\u524d\u7aef\u7ec4\u4ef6",labelWidth:"0px",countShow:!1,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{required:!1,labelname:"\u83dc\u5355\u6392\u5e8f",children:Object(b.jsx)(Ji.a,{value:this.state.model.sort,showStepper:!0,onChange:function(t){return e.sortChange(t)},placeholder:"\u8bf7\u8f93\u5165\u6570\u5b57"})})]})]})}}]),a}(u.a.Component),Ui=(a(331),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).setVisible=function(e){n.setState({visible:e})},n.state={visible:!1,dialogtitle:"",selectdom:{},fid:0},n}return Object(y.a)(a,[{key:"addchildmenu",value:function(){var e=this.refs.navitem.state.selectdom;e.id?this.setState({dialogtitle:"\u65b0\u5efa\u5b50\u83dc\u5355",visible:!0,fid:e.id}):(h.a.clear(),h.a.warn("\u8bf7\u5148\u70b9\u51fb\u9009\u62e9\u4e00\u4e2a\u83dc\u5355"))}},{key:"addmenu",value:function(){this.setState({dialogtitle:"\u6dfb\u52a0\u4e00\u7ea7\u83dc\u5355",visible:!0,fid:0})}},{key:"delmenuBtn",value:function(){var e=this.refs.navitem.state.selectdom;e.id?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",e.title,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.y)(e.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),window.history.go(0)}),(function(e){}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.warn("\u8bf7\u5148\u70b9\u51fb\u9009\u62e9\u4e00\u4e2a\u83dc\u5355"))}},{key:"sureFn",value:function(){var e=this,t=this.refs.menubody.submit(),a=this;if(t){var n=this.refs.menubody.state.model;n.fid=this.state.fid,Object(s.sc)(n).then((function(t){Object(s.cc)(t,(function(t,n){h.a.clear(),h.a.success(n),a.refs.navitem.getMenuFn(),e.setState({visible:!1})}))}))}}},{key:"getMenuInfo",value:function(e){this.setState({selectdom:e})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"systemMenu",className:"maincenter",children:[Object(b.jsx)(p.a,{style:{width:"100%"},children:Object(b.jsxs)("p",{className:"menuBtn",children:[Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.addchildmenu.bind(this),children:"\u65b0\u5efa\u5b50\u83dc\u5355"}),Object(b.jsx)(m.a,{type:"warn",onClick:this.addmenu.bind(this),children:"\u6dfb\u52a0\u4e00\u7ea7\u83dc\u5355"}),Object(b.jsx)(m.a,{type:"danger",onClick:this.delmenuBtn.bind(this),children:"\u5220\u9664\u83dc\u5355"})]})}),Object(b.jsxs)("div",{className:"menu-body",children:[Object(b.jsx)(p.a,{className:"leftNav",title:"\u83dc\u5355\u5bfc\u822a",children:Object(b.jsx)("div",{className:"leftTree",children:Object(b.jsx)(Vi,{ref:"navitem",menuInfo:function(t){e.getMenuInfo(t)}})})}),Object(b.jsx)(p.a,{className:"rightmenu",title:"\u83dc\u5355\u8be6\u60c5",children:Object(b.jsx)("div",{className:"leftfrom",children:Object(b.jsx)(Gi,{menuList:this.state.selectdom})})})]}),Object(b.jsx)(ge.a,{style:{width:"50%"},visible:this.state.visible,className:"questModal",onClose:function(){return e.setVisible(!1)},footer:Object(b.jsxs)("p",{children:[Object(b.jsx)(m.a,{onClick:this.sureFn.bind(this),type:"primary",children:"\u786e\u5b9a"}),",",Object(b.jsx)(m.a,{onClick:function(){return e.setVisible(!1)},children:"\u53d6\u6d88"})]}),title:this.state.dialogtitle,children:Object(b.jsx)(Ri,{ref:"menubody",fid:this.state.fid})})]})}}]),a}(u.a.Component)),Qi=(a(332),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onCheck=function(e,t){n.setState({checkedKeys:e})},n.state={checkedKeys:[],disabledCheckedKeys:[],menu_data:[],menuList:{}},n}return Object(y.a)(a,[{key:"getMenuFn",value:function(){var e=this;Object(s.qb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t;e.setState({menu_data:n})}))}))}},{key:"componentWillMount",value:function(){this.getMenuFn(),this.setState({checkedKeys:this.props.rules})}},{key:"render",value:function(){var e=this.state,t=e.checkedKeys,a=e.disabledCheckedKeys;return Object(b.jsx)("div",{id:"treedom",children:Object(b.jsx)(Ai.a,{checkable:!0,size:"medium",data:this.state.menu_data,onCheck:this.onCheck,checkedKeys:t,disabledCheckedKeys:a})})}}]),a}(u.a.Component)),$i=(a(333),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).authchange=function(e){var t=n.state.model;t.account_type=e.target.value,n.setState({model:t})},n.state={model:{role:"",account_type:5,setrole:[],pagetitle:"\u65b0\u5efa\u89d2\u8272"},enumer:0,menuList:{}},n}return Object(y.a)(a,[{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/system/role-list"),sessionStorage.setItem("pathname2","/home/system/role-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"submit",value:function(){var e=this,t=this.refs.roleform.validator(),a=this;this.refs.roletree.state.checkedKeys?t&&ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:0==a.state.enumer?Object(b.jsxs)("p",{children:["\u662f\u5426\u65b0\u589e",Object(b.jsxs)("b",{children:["[",a.state.model.role,"]"]}),"\u89d2\u8272\uff1f"]}):Object(b.jsx)("p",{children:"\u662f\u5426\u4fee\u6539\u5f53\u524d\u89d2\u8272\u4fe1\u606f\uff1f"}),onConfirm:function(){var t={role_name:a.state.model.role,menu_id:e.refs.roletree.state.checkedKeys,account_type:a.state.model.account_type};0==a.state.enumer?Object(s.Ac)(t).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/system/role-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){})):Object(s.Jc)(a.state.menuList.id,t).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/system/role-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.error("\u8bf7\u81f3\u5c11\u9009\u4e2d\u4e00\u4e2a\u6a21\u5757\u6743\u9650"))}},{key:"componentWillMount",value:function(){var e=JSON.parse(sessionStorage.getItem("breaknav"))[0].pagetitle,t=e.includes("\u65b0\u5efa")?0:1;if(this.setState({pagetitle:e+"\u89d2\u8272",enumer:t}),1==t){var a=JSON.parse(sessionStorage.getItem("dataInfo")),n={};n.role=a.role_name,n.account_type=a.account_type,this.setState({menuList:a,model:n})}}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"addrole",className:"maincenter",children:[Object(b.jsx)("p",{className:"title"}),Object(b.jsx)(p.a,{style:{width:"100%"},title:this.state.pagetitle,children:Object(b.jsxs)(o.a,{model:this.state.model,rules:{role:[{type:"required",message:"\u8bf7\u8f93\u5165\u89d2\u8272\u540d"}]},ref:"roleform",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u89d2\u8272\u540d",prop:"role",id:"role",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.role=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.role="",e.setState({model:a})},value:this.state.model.role,placeholder:"\u8bf7\u8f93\u5165\u89d2\u8272",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u6570\u636e\u6743\u9650\u5206\u7ec4",children:Object(b.jsxs)(te.a,{onChange:this.authchange,value:this.state.model.account_type,children:[Object(b.jsx)(me.a,{value:1,children:"\u6240\u6709\u6570\u636e"}),Object(b.jsx)(me.a,{value:5,children:"\u8be5\u8d26\u53f7\u6570\u636e"})]})}),Object(b.jsx)(c.a,{labelname:"\u8bbe\u7f6e\u6743\u9650",prop:"setrole",id:"setrole",children:Object(b.jsx)(Qi,{ref:"roletree",rules:this.state.menuList.rule_id})})]})}),Object(b.jsxs)("p",{className:"btnlist",children:[Object(b.jsx)(m.a,{type:"primary",onClick:this.submit.bind(this),children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:this.cancel.bind(this),children:"\u53d6\u6d88"})]})]})}}]),a}(u.a.Component)),Zi=(a(334),[{title:"\u89d2\u8272\u540d",name:"role_name",width:"40%",prop:"role_name",type:"normal"},{title:"\u521b\u5efa\u65f6\u95f4",width:"40%",prop:"create_time",name:"create_time",type:"normal"},{title:"\u64cd\u4f5c",name:"opearo",width:"20%",prop:"opearo",type:"slot"}]),Xi=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onChange=function(e){n.setState(e)},n.state={roleList:[],tabList:[{title:"\u89d2\u8272\u7ba1\u7406"}],tableHeight:600,page:1,limit:10,total:0},n}return Object(y.a)(a,[{key:"getRoleFn",value:function(){var e=this,t=e.state,a={page:t.page,limit:t.limit};Object(s.Gb)(a).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data,i=t.total;e.setState({roleList:n,total:i})}))}))}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),setTimeout((function(){t.getRoleFn()}),10)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),setTimeout((function(){t.getRoleFn()}),10)}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390}),this.getRoleFn()}},{key:"clickFn",value:function(){sessionStorage.setItem("pathname2","/home/system/role-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u65b0\u5efa",items:[{path:"/home/system/role-list",name:"\u89d2\u8272\u7ba1\u7406"},{path:"/home/system/role-add",name:"\u65b0\u5efa\u89d2\u8272"}]}])),window.open("#/home/system/role-add")}},{key:"editFn",value:function(e,t){sessionStorage.setItem("pathname2","/home/system/role-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u7f16\u8f91",items:[{path:"/home/system/role-list",name:"\u89d2\u8272\u7ba1\u7406"},{path:"/home/system/role-add",name:"\u7f16\u8f91\u89d2\u8272"}]}])),sessionStorage.setItem("dataInfo",JSON.stringify(t)),window.open("#/home/system/role-add")}},{key:"delFn",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",t.role_name,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.A)(t.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),a.getRoleFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"render",value:function(){var e=this;return Object(b.jsx)("div",{id:"rolelist",children:Object(b.jsxs)(It,{tabs:this.state.tabList,children:[Object(b.jsx)("p",{className:"roletable",children:Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.clickFn.bind(this),children:"\u65b0\u5efa\u89d2\u8272"})}),Object(b.jsx)("div",{className:"table-container",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.roleList,Column:Zi,dataCount:this.state.total,isMultiple:!1,countbarVisible:!1,isSwitch:!1,maxheight:this.state.tableHeight,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"name"==t?Object(b.jsx)(S.a,{size:"small",checked:!0}):"opearo"==t?Object(b.jsxs)("span",{children:[Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.editFn(t,a)},children:"\u7f16\u8f91"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.delFn(t,a)},children:"\u5220\u9664"})]}):void 0}})})]})})}}]),a}(u.a.Component),es=a(530),ts=(a(335),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),n=t.call(this,e),window.mystation=Object(Xt.a)(n),n.state={companyBtn:!0,departmentBtn:!0,postBtn:!0,editId:0,visible:!1,company:[],company_id:1,companyName:1,departmentData:[],departmentName:1,department_id:1,opertip:"\u7f16\u8f91",post:[],jobName:"",visibleId:"",vistype:""},n.addItem=n.addItem.bind(Object(Xt.a)(n)),n.changeval=n.changeval.bind(Object(Xt.a)(n)),n.delbtnFn=n.delbtnFn.bind(Object(Xt.a)(n)),n.editbtnFn=n.editbtnFn.bind(Object(Xt.a)(n)),n.savebtnFn=n.savebtnFn.bind(Object(Xt.a)(n)),n.cancelbtnFn=n.cancelbtnFn.bind(Object(Xt.a)(n)),n}return Object(y.a)(a,[{key:"saveFn",value:function(e,t){"\u53d6\u6d88"==e.innerHTML?("\u516c\u53f8"==t?(this.setState({companyBtn:!0,companyName:1}),this.getCompanyFn(),this.getDepartmentFn(this.state.companyName)):"\u90e8\u95e8"==t?(this.setState({departmentBtn:!0}),this.getDepartmentFn(this.state.companyName),this.state.departmentName&&this.getDepartmentJobFn(this.state.departmentName)):"\u5c97\u4f4d"==t&&this.setState({postBtn:!0}),e.parentNode.parentNode.remove()):this.setState({visible:!0})}},{key:"getCompanyFn",value:function(){var e=this;Object(s.ab)().then((function(t){Object(s.cc)(t,(function(t,a){e.setState({company:t})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getDepartmentFn",value:function(e){var t=this;Object(s.eb)({company_id:e}).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({departmentData:e}),t.setState({departmentName:e[0].id}),t.getDepartmentJobFn(e[0].id)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getDepartmentJobFn",value:function(e){var t=this;Object(s.fb)({department_id:e}).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({post:e})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"editFn",value:function(e,t){var a=this,n=null;if("\u516c\u53f8"==t?n="companyBtn":"\u90e8\u95e8"==t?n="departmentBtn":"\u5c97\u4f4d"==t&&(n="postBtn"),e.parentNode.parentNode.children[0].value){var i=e.parentNode.parentNode.children[0].value;if("\u4fdd\u5b58"==e.innerHTML){if(e.parentNode.parentNode.className=n+" newitem","\u516c\u53f8"==t){var c={company_name:i};Object(s.qc)(c).then((function(t){Object(s.cc)(t,(function(t,n){h.a.clear(),h.a.success(n),a.getCompanyFn(),e.parentNode.parentNode.remove(),a.setState({companyBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else if("\u90e8\u95e8"==t){if(!this.state.companyName)return h.a.clear(),h.a.error("\u8bf7\u9009\u62e9\u5f52\u5c5e\u516c\u53f8"),!1;var o={department_name:i,company_id:this.state.companyName};Object(s.uc)(o).then((function(t){Object(s.cc)(t,(function(t,n){h.a.clear(),h.a.success(n),a.getDepartmentFn(a.state.companyName),e.parentNode.parentNode.remove(),a.setState({departmentBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else if("\u5c97\u4f4d"==t){if(!this.state.departmentName)return h.a.clear(),h.a.error("\u8bf7\u9009\u62e9\u5f52\u5c5e\u90e8\u95e8"),!1;var r={job_name:i,department_id:this.state.departmentName};Object(s.wc)(r).then((function(t){Object(s.cc)(t,(function(t,n){h.a.clear(),h.a.success(n),a.getDepartmentJobFn(a.state.departmentName),e.parentNode.parentNode.remove(),a.setState({postBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}else e.parentNode.parentNode.children[0].disabled="",e.parentNode.parentNode.children[0].focus(),e.parentNode.parentNode.className="newitem focusactive",e.innerHTML="\u4fdd\u5b58","\u516c\u53f8"==t?this.setState({companyBtn:!1}):"\u90e8\u95e8"==t?this.setState({departmentBtn:!1}):"\u5c97\u4f4d"==t&&this.setState({postBtn:!1})}else h.a.clear(),h.a.error("\u8bf7\u586b\u5165".concat(t,"\u540d\u79f0")),e.parentNode.parentNode.children[0].focus()}},{key:"hasVal",value:function(e,t){return Object(ta.a)(e,(function(e){return e.id==t}))}},{key:"sureFn",value:function(e,t,a){var n=this;if(e.target.value&&13==e.keyCode){var i=null;if("\u516c\u53f8"==a?i="companyBtn":"\u90e8\u95e8"==a?i="departmentBtn":"\u5c97\u4f4d"==a&&(i="postBtn"),t.parentNode.className=i+" newitem","\u516c\u53f8"==a){var c={company_name:e.target.value};Object(s.qc)(c).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),n.getCompanyFn(),t.parentNode.remove(),n.setState({companyBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else if("\u90e8\u95e8"==a){var o={department_name:e.target.value,company_id:this.state.companyName};Object(s.uc)(o).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),n.getDepartmentFn(n.state.companyName),t.parentNode.remove(),n.setState({departmentBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else if("\u5c97\u4f4d"==a){var r={job_name:e.target.value,department_id:this.state.departmentName};Object(s.wc)(r).then((function(e){Object(s.cc)(e,(function(e,a){h.a.clear(),h.a.success(a),n.getDepartmentJobFn(n.state.departmentName),t.parentNode.remove(),n.setState({postBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}}},{key:"itemClick",value:function(e,t,a){if(!(!this.state.companyBtn|!this.state.departmentBtn|!this.state.postBtn))if(this.setState({vistype:a}),"\u516c\u53f8"==a){if(!this.state.companyBtn)return!1;this.setState({companyName:t.id}),this.setState({departmentData:[]}),this.setState({post:[]}),this.getDepartmentFn(t.id)}else if("\u90e8\u95e8"==a){if(!this.state.departmentBtn)return!1;this.setState({departmentName:t.id}),this.getDepartmentJobFn(t.id)}else if("\u5c97\u4f4d"==a){if(!this.state.postBtn)return!1;this.setState({jobName:t.id})}}},{key:"delbtnFn",value:function(e,t,a){var n=this,i=null,c=t.id;this.setState({vistype:a}),i="\u516c\u53f8"==a?t.company_name:"\u90e8\u95e8"==a?t.department_name:t.job_name,ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",i,"]"]}),"\uff1f"]}),onConfirm:function(){"\u516c\u53f8"==a?Object(s.u)(c).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),n.getCompanyFn()}),(function(e){h.a.error(e)}))})).catch((function(e){})):"\u90e8\u95e8"==a?Object(s.w)(c).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),n.getDepartmentFn(n.state.companyName)}),(function(e){h.a.error(e)}))})).catch((function(e){})):Object(s.x)(c).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),n.getDepartmentJobFn(n.state.departmentName)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"savebtnFn",value:function(e,t,a){var n=this,i=t.id;this.setState({vistype:a}),ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u66f4\u6539\u6b64\u6570\u636e\u540d\u79f0\uff1f"}),onConfirm:function(){"\u516c\u53f8"==a?Object(s.rc)(i,{company_name:t.company_name}).then((function(e){Object(s.cc)(e,(function(e,t){n.setState({visibleId:"",opertip:"\u53d6\u6d88"}),h.a.clear(),h.a.success(t),n.getCompanyFn(),n.setState({companyBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){})):"\u90e8\u95e8"==a?Object(s.vc)(i,{department_name:t.department_name}).then((function(e){Object(s.cc)(e,(function(e,t){n.setState({visibleId:"",opertip:"\u53d6\u6d88"}),h.a.clear(),h.a.success(t),n.getDepartmentFn(n.state.companyName),n.setState({departmentBtn:!0})}),(function(e){h.a.error(e)}))})).catch((function(e){})):Object(s.xc)(i,{job_name:t.job_name}).then((function(e){Object(s.cc)(e,(function(e,t){n.setState({visibleId:"",opertip:"\u53d6\u6d88"}),n.getDepartmentJobFn(n.state.departmentName)}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"cancelbtnFn",value:function(e,t,a){this.setState({visibleId:""}),this.setState({opertip:"\u53d6\u6d88"}),"\u516c\u53f8"==a?(this.getCompanyFn(),this.setState({companyBtn:!0})):"\u90e8\u95e8"==a?(this.getDepartmentFn(this.state.companyName),this.setState({departmentBtn:!0})):(this.getDepartmentJobFn(this.state.departmentName),this.setState({postBtn:!0}))}},{key:"editbtnFn",value:function(e,t,a){var n=null,i=t.id;this.setState({opertip:"\u7f16\u8f91",vistype:a,visibleId:i}),"\u516c\u53f8"==a?(n=t.company_name,this.setState({visibletip:n,companyBtn:!1,companyName:t.id}),this.state.companyName==i&&e.target.parentNode.parentNode.children[0].focus()):"\u90e8\u95e8"==a?(n=t.department_name,this.setState({visibletip:n,departmentBtn:!1,departmentName:t.id}),this.state.departmentName==i&&e.target.parentNode.parentNode.children[0].focus()):(n=t.job_name,this.setState({visibletip:n,postBtn:!1,jobName:t.id}),this.state.jobName==i&&e.target.parentNode.parentNode.children[0].focus())}},{key:"changeval",value:function(e,t,a){var n=null;if("\u516c\u53f8"==a){n=this.hasVal(this.state.company,t.id);var i=Object(es.a)(this.state.company,[]);-1!=n&&(i[n].company_name=e.target.value,this.setState({company:i}))}else if("\u90e8\u95e8"==a){n=this.hasVal(this.state.departmentData,t.id);var s=Object(es.a)(this.state.departmentData,[]);-1!=n&&(s[n].department_name=e.target.value,this.setState({departmentData:s}))}else{n=this.hasVal(this.state.post,t.id);var c=Object(es.a)(this.state.post,[]);-1!=n&&(c[n].job_name=e.target.value,this.setState({post:c}))}}},{key:"addItem",value:function(e,t){var a=null,n=null;if("companyBtn"==t)a=this.state.companyBtn,n="\u516c\u53f8",this.setState({departmentData:[]}),this.setState({post:[]}),this.setState({companyName:null});else if("departmentBtn"==t){if(a=this.state.departmentBtn,n="\u90e8\u95e8",this.setState({post:[]}),this.setState({departmentName:null}),!this.state.companyName)return h.a.clear(),void h.a.warn("\u8bf7\u5148\u8865\u5168\u516c\u53f8\u4fe1\u606f\uff01")}else if("postBtn"==t&&(a=this.state.postBtn,n="\u5c97\u4f4d",!this.state.departmentName))return h.a.clear(),void h.a.warn("\u8bf7\u5148\u8865\u5168\u5f52\u5c5e\u90e8\u95e8\u4fe1\u606f\uff01");if(a){if("\u5c97\u4f4d"==n&&this.state.departmentData.length<1)return h.a.clear(),h.a.warn("\u8bf7\u5148\u521b\u5efa\u90e8\u95e8\uff01"),!1;var i=e.target.nextSibling,s=document.createElement("div");s.className=t+" newitem",s.innerHTML='\n \n

\u53d6\u6d88\u4fdd\u5b58

\n "),i.appendChild(s),"companyBtn"==t?this.setState({companyBtn:!1}):"departmentBtn"==t?this.setState({departmentBtn:!1}):"postBtn"==t&&this.setState({postBtn:!1}),i.children[0].className="newitem focusactive"}else h.a.clear(),h.a.warn("\u8bf7\u5148\u64cd\u4f5c\u65b0\u589e\u7684".concat(n,"\u540d"))}},{key:"componentWillMount",value:function(){this.getCompanyFn(),this.getDepartmentFn(this.state.companyName)}},{key:"render",value:function(){var e=this,t=this.state;t.current,t.pageSize;return Object(b.jsx)("div",{id:"station",className:"maincenter",children:Object(b.jsx)(p.a,{style:{width:"100%"},title:"\u5c97\u4f4d\u5217\u8868",children:Object(b.jsxs)("div",{className:"cardtable",children:[Object(b.jsx)(p.a,{type:"nested",title:"\u516c\u53f8",className:"carditem",children:Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{className:"newadd",onClick:function(t){return e.addItem(t,"companyBtn")},children:"+\u65b0\u5efa\u516c\u53f8"}),Object(b.jsx)("div",{className:"addList"}),Object(b.jsx)("div",{className:"addList",children:this.state.company.length>0?this.state.company.map((function(t,a){return Object(b.jsxs)("div",{className:t.id==e.state.companyName?"selected newitem companyBtn":"newitem companyBtn",onClick:function(a){return e.itemClick(a,t,"\u516c\u53f8")},children:[Object(b.jsx)("input",{value:t.company_name,maxLength:"20",disabled:!(t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u516c\u53f8"==e.state.vistype),onChange:function(a){return e.changeval(a,t,"\u516c\u53f8")}}),t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u516c\u53f8"==e.state.vistype?Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.cancelbtnFn(a,t,"\u516c\u53f8")},children:"\u53d6\u6d88"}),Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.savebtnFn(a,t,"\u516c\u53f8")},children:"\u4fdd\u5b58"})]}):Object(b.jsxs)("p",{children:[1!=t.id?Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.delbtnFn(a,t,"\u516c\u53f8")},children:"\u5220\u9664"}):null,Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.editbtnFn(a,t,"\u516c\u53f8")},children:"\u7f16\u8f91"})]})]},a)})):Object(b.jsx)("div",{className:"nullempty",children:"\u6682\u65e0\u6570\u636e\uff0c\u8bf7\u6dfb\u52a0\u5427\uff01"})})]})}),Object(b.jsx)(p.a,{type:"nested",title:"\u90e8\u95e8",className:"carditem",children:Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{className:"newadd",onClick:function(t){return e.addItem(t,"departmentBtn")},children:"+\u65b0\u5efa\u90e8\u95e8"}),Object(b.jsx)("div",{className:"addList"}),Object(b.jsx)("div",{className:"addList",children:this.state.departmentData.length>0?this.state.departmentData.map((function(t,a){return Object(b.jsxs)("div",{className:t.id==e.state.departmentName?"selected newitem departmentBtn":"newitem departmentBtn",onClick:function(a){return e.itemClick(a,t,"\u90e8\u95e8")},children:[Object(b.jsx)("input",{value:t.department_name,maxLength:"20",disabled:!(t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u90e8\u95e8"==e.state.vistype),onChange:function(a){return e.changeval(a,t,"\u90e8\u95e8")}}),t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u90e8\u95e8"==e.state.vistype?Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.cancelbtnFn(a,t,"\u90e8\u95e8")},children:"\u53d6\u6d88"}),Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.savebtnFn(a,t,"\u90e8\u95e8")},children:"\u4fdd\u5b58"})]}):Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.delbtnFn(a,t,"\u90e8\u95e8")},children:"\u5220\u9664"}),Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.editbtnFn(a,t,"\u90e8\u95e8")},children:"\u7f16\u8f91"})]})]},a)})):this.state.departmentName?Object(b.jsx)("div",{className:"nullempty",children:"\u6682\u65e0\u6570\u636e\uff0c\u8bf7\u6dfb\u52a0\u5427\uff01"}):null})]})}),Object(b.jsx)(p.a,{type:"nested",title:"\u5c97\u4f4d",className:"carditem",children:Object(b.jsxs)("div",{children:[Object(b.jsx)("p",{className:"newadd",onClick:function(t){return e.addItem(t,"postBtn")},children:"+\u65b0\u5efa\u5c97\u4f4d"}),Object(b.jsx)("div",{className:"addList"}),Object(b.jsx)("div",{className:"addList",children:this.state.post.length>0?this.state.post.map((function(t,a){return Object(b.jsxs)("div",{className:t.id==e.state.jobName?"selected newitem postBtn":"newitem postBtn",onClick:function(a){return e.itemClick(a,t,"\u5c97\u4f4d")},children:[Object(b.jsx)("input",{value:t.job_name,maxLength:"20",disabled:!(t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u5c97\u4f4d"==e.state.vistype),onChange:function(a){return e.changeval(a,t,"\u5c97\u4f4d")}}),t.id==e.state.visibleId&&"\u7f16\u8f91"==e.state.opertip&&"\u5c97\u4f4d"==e.state.vistype?Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.cancelbtnFn(a,t,"\u5c97\u4f4d")},children:"\u53d6\u6d88"}),Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.savebtnFn(a,t,"\u5c97\u4f4d")},children:"\u4fdd\u5b58"})]}):Object(b.jsxs)("p",{children:[Object(b.jsx)("span",{className:"del\r ",onClick:function(a){return e.delbtnFn(a,t,"\u5c97\u4f4d")},children:"\u5220\u9664"}),Object(b.jsx)("span",{className:"operation\r ",onClick:function(a){return e.editbtnFn(a,t,"\u5c97\u4f4d")},children:"\u7f16\u8f91"})]})]})})):Object(b.jsx)("div",{className:"nullempty",children:"\u6682\u65e0\u6570\u636e\uff0c\u8bf7\u6dfb\u52a0\u5427\uff01"})})]})})]})})})}}]),a}(u.a.Component)),as=(a(336),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onCheck=function(e,t){n.setState({checkedKeys:e}),t.top.length==n.state.menu_data.length&&0!=t.top.length?n.setState({checked:!0}):n.setState({checked:!1})},n.handleChange=function(e){var t=[];e.target.checked&&n.state.menu_data.forEach((function(e){t.push(e.id),e.children&&e.children.forEach((function(e){t.push(e.id),e.children&&e.children.forEach((function(e){t.push(e.id)}))}))})),n.setState({checked:e.target.checked,checkedKeys:t})},n.state={checkedKeys:[],disabledCheckedKeys:[],menu_data:[],menuList:{},checkLength:"",checked:!1},n}return Object(y.a)(a,[{key:"getMenuFn",value:function(){var e=this,t=sessionStorage.getItem("subaid");Object(s.Zb)(t).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.filter((function(e){return e.children.length>0}));if(0==e.props.enum){e.setState({checked:!0});var i=[];n.forEach((function(e){i.push(e.id),e.children&&e.children.forEach((function(e){i.push(e.id),e.children&&e.children.forEach((function(e){i.push(e.id)}))}))})),e.setState({checkedKeys:i})}else e.setState({checked:!0}),n.forEach((function(t){if(-1==e.props.rules.indexOf(t.id))return e.setState({checked:!1}),!1})),e.setState({checkedKeys:e.props.rules});e.setState({menu_data:n})}))}))}},{key:"componentWillMount",value:function(){this.getMenuFn()}},{key:"render",value:function(){var e=this.state,t=e.checkedKeys,a=e.disabledCheckedKeys;return Object(b.jsxs)("div",{id:"treedom",children:[Object(b.jsxs)("div",{className:"role-tips",children:[Object(b.jsx)("span",{children:"\u89d2\u8272\u6743\u9650\uff08\u5c06\u4f1a\u5728\u76ee\u524d\u767b\u5f55\u8d26\u53f7\u7ba1\u7406\u8303\u56f4\u5185\u914d\u7f6e\u6743\u9650\uff09"}),Object(b.jsx)("div",{className:"role-check",children:Object(b.jsx)(k.a,{checked:this.state.checked,onChange:this.handleChange,children:"\u6240\u6709\u6743\u9650"})})]}),Object(b.jsx)(Ai.a,{checkable:!0,size:"medium",data:this.state.menu_data,onCheck:this.onCheck,checkedKeys:t,disabledCheckedKeys:a})]})}}]),a}(u.a.Component)),ns=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onUploadError=function(e,t){"overMaxAmount"===e?(h.a.clear(),h.a.error("\u6700\u591a\u53ef\u4e0a\u4f20 ".concat(t.maxAmount," \u5f20\u56fe\u7247"))):"overMaxSize"===e&&(h.a.clear(),h.a.error("\u56fe\u7247\u5927\u5c0f\u4e0d\u80fd\u8d85\u8fc7 ".concat(t.formattedMaxSize,"b")))},n.state={model:{user_name:"",mobile:"",password:"",real_name:"",company:"",deparment:"",post:""},companyList:[],departmentList:[],departmentJob:[],roleList:[],headImg:"",pwdtype:"text",defaultFileList:[{src:""}],disabled:!1,id:"",ruleId:[]},n}return Object(y.a)(a,[{key:"componentWillMount",value:function(){var e=this;this.getCompanyFn();var t=JSON.parse(sessionStorage.getItem("company"));t||this.getCompanyFn(),this.getRoleFn();var a=this.props;if(a&&1==a.enumer){var n,i,c,o;this.setState({pwdtype:"password"});var r=Object(ye.a)(a.rowData),l={user_name:r.user_name,mobile:r.mobile,password:"yxtx2021",real_name:r.real_name,company:t.find((function(e){return e.key==r.company_id})),deparment:{key:null===(n=r.department)||void 0===n?void 0:n.id,text:null===(i=r.department)||void 0===i?void 0:i.department_name},post:{key:null===(c=r.job)||void 0===c?void 0:c.id,text:null===(o=r.job)||void 0===o?void 0:o.job_name}},d=a.rowData.rule.map((function(e){return e.id}));this.setState({ruleId:d});var u={};u.src=r.head,this.setState({model:l,disabled:!0,defaultFileList:[u],id:r.id,headImg:r.head}),l.company&&l.company.key&&Object(s.eb)({company_id:l.company.key}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.department_name}}));e.setState({departmentList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){})),l.deparment.key&&Object(s.fb)({department_id:l.deparment.key}).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.job_name}}));e.setState({departmentJob:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}}},{key:"changeKind",value:function(){this.setState({pwdtype:"password"})}},{key:"submit",value:function(){var e=this.refs.form1.validator(),t=this.refs.roletree.state.checkedKeys,a=this.state.model,n=this;e?ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:0==n.props.enumer?Object(b.jsxs)("p",{children:["\u662f\u5426\u65b0\u589e",Object(b.jsxs)("b",{children:["[",a.user_name,"]"]}),"\u8d26\u53f7\uff1f"]}):Object(b.jsxs)("p",{children:["\u662f\u5426\u4fee\u6539",Object(b.jsxs)("b",{children:["[",a.user_name,"]"]}),"\u8d26\u53f7\u4fe1\u606f\uff1f"]}),onConfirm:function(){var e={user_name:a.user_name,password:a.password,job_id:a.post.key,real_name:a.real_name,mobile:a.mobile,assist_user_id:sessionStorage.getItem("subaid"),rule:t};if(n.state.headImg&&(e.head=n.state.headImg),0==n.props.enumer)Object(s.oc)(e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/system/subaccount-list"),sessionStorage.setItem("pathname2","/home/system/subaccount-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}));else{var i=n.state.id;delete e.password,e.head=n.state.headImg,Object(s.Fc)(i,e).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),setTimeout((function(){window.location.replace("#/home/system/subaccount-list"),sessionStorage.setItem("pathname2","/home/system/subaccount-list")}),1e3)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},onCancel:this.onCancel,className:"questModal",parentComponent:this}):(h.a.clear(),h.a.error("\u8bf7\u5b8c\u5584\u8868\u5355\u6570\u636e"))}},{key:"onUploadChange",value:function(e){var t=this;if(e&&e.length>0){var a=new FormData;a.append("file",e[0].file),a.append("path","account_avatar"),Object(s.sd)(a).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({headImg:e.path}),h.a.clear(),h.a.success(a)}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else t.setState({headImg:""})}},{key:"onCompanyChange",value:function(e){if(!e){var t=this.state.model;t.deparment="",t.post="",this.setState({model:t})}var a=this,n=this.state.model;if(n.company=e,this.setState({model:n}),e){var i=this.state.model;i.deparment="",i.post="",a.setState({departmentJob:[],departmentList:[],model:i}),Object(s.eb)({company_id:e.key}).then((function(e){Object(s.cc)(e,(function(e,t){var n=e.map((function(e){return{key:e.id,text:e.department_name}}));a.setState({departmentList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}else a.setState({departmentJob:[],departmentList:[]})}},{key:"onDepartmentChange",value:function(e){var t=this;if(!e){var a=this.state.model;a.post="",this.setState({model:a})}var n=this,i=this.state.model;i.deparment=e,this.setState({model:i,departmentJob:[]}),e?Object(s.fb)({department_id:e.key}).then((function(e){Object(s.cc)(e,(function(e,a){var i=e.map((function(e){return{key:e.id,text:e.job_name}})),s=t.state.model;s.post="",n.setState({model:s,departmentJob:i})}),(function(e){h.a.error(e)}))})).catch((function(e){})):n.setState({departmentJob:[]})}},{key:"onPostChange",value:function(e){var t=this.state.model;t.post=e,this.setState({model:t})}},{key:"getCompanyFn",value:function(){var e=this;Object(s.ab)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.map((function(e){return{key:e.id,text:e.company_name}}));sessionStorage.setItem("company",JSON.stringify(n)),e.setState({companyList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"changeType",value:function(e){this.setState({pwdtype:e})}},{key:"getRoleFn",value:function(){var e=this;Object(s.Fb)().then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data.map((function(e){return{key:e.id,text:e.role_name}}));e.setState({roleList:n})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"cancel",value:function(){ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsx)("p",{children:"\u662f\u5426\u53d6\u6d88\u672c\u6b21\u64cd\u4f5c\uff1f"}),onConfirm:function(){window.location.replace("#/home/system/subaccount-list"),sessionStorage.setItem("pathname2","/home/system/subaccount-list")},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{children:[Object(b.jsx)(p.a,{style:{width:"100%"},title:this.props.title,children:Object(b.jsxs)("div",{id:"addaccinfo",children:[Object(b.jsxs)(o.a,{model:this.state.model,rules:{account:[{type:"required",message:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"}],phone:[{type:"required",message:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7"},{type:"regExp",message:"\u624b\u673a\u53f7\u683c\u5f0f\u4e0d\u6b63\u786e",reg:"^[1][3,4,5,6,7,8,9][0-9]{9}$"}]},ref:"form1",className:"addform",children:[Object(b.jsx)(c.a,{labelname:"\u8d26\u53f7",prop:"account",id:"account",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.user_name=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.user_name="",e.setState({model:a})},value:this.state.model.user_name,placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7",labelWidth:"0px",maxLength:12,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:" \u624b\u673a\u53f7",prop:"phone",id:"phone",children:Object(b.jsx)(r.a,{kind:"tel",onChange:function(t){var a=e.state.model;a.mobile=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.mobile="",e.setState({model:a})},value:this.state.model.mobile,placeholder:"\u8bf7\u8f93\u5165\u624b\u673a\u53f7",labelWidth:"0px",maxLength:11,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5bc6\u7801",id:"pwd",required:"",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.password=t,e.setState({model:a})},onfocusFn:function(t){return e.changeKind()},markedShow:function(t){e.changeType(t)},kind:this.state.pwdtype,disabled:this.state.disabled,onClearItem:function(t){var a=e.state.model;a.password="",e.setState({model:a})},value:this.state.model.password,placeholder:"\u8bf7\u8f93\u5165\u5bc6\u7801",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u771f\u5b9e\u59d3\u540d",required:"",children:Object(b.jsx)(r.a,{onChange:function(t){var a=e.state.model;a.real_name=t,e.setState({model:a})},onClearItem:function(t){var a=e.state.model;a.real_name="",e.setState({model:a})},value:this.state.model.real_name,placeholder:"\u8bf7\u8f93\u5165\u771f\u5b9e\u59d3\u540d",labelWidth:"0px",maxLength:16,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{id:"company",labelname:"\u5c97\u4f4d",myClassName:"sel1",required:"",children:Object(b.jsx)(ne.a,{options:this.state.companyList,placeholder:"\u8bf7\u9009\u62e9\u516c\u53f8",value:this.state.model.company,onChange:function(t){e.onCompanyChange(t),Rt.a.emit("change","company",t)}})}),Object(b.jsx)(c.a,{id:"deparment",myClassName:"sel2",labelwidth:"0px",required:"",children:Object(b.jsx)(ne.a,{options:this.state.departmentList,placeholder:"\u8bf7\u9009\u62e9\u90e8\u95e8",popupWidth:"360px",value:this.state.model.deparment,onChange:function(t){e.onDepartmentChange(t),Rt.a.emit("change","deparment",t)}})}),Object(b.jsx)(c.a,{id:"post",myClassName:"sel2 sel3",labelwidth:"0px",children:Object(b.jsx)(ne.a,{options:this.state.departmentJob,placeholder:"\u8bf7\u9009\u62e9\u5c97\u4f4d",popupWidth:"360px",value:this.state.model.post,onChange:function(t){e.onPostChange(t),Rt.a.emit("change","post",t)}})}),Object(b.jsx)(c.a,{required:"",labelname:"\u8bbe\u7f6e\u6743\u9650",myClassName:"rolechoose",id:"station",children:Object(b.jsx)(as,{ref:"roletree",rules:this.state.ruleId,enum:this.props.enumer})})]}),Object(b.jsxs)("div",{className:"mypic",children:[Object(b.jsx)("b",{children:"\u5934\u50cf"}),Object(b.jsx)("div",{className:"changepic dflexac",children:""==this.state.defaultFileList[0].src?Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,onError:this.onUploadError}):Object(b.jsx)(jt.a,{className:"zent-image-upload-demo",maxSize:512e3,tips:"\u5efa\u8bae\u5c3a\u5bf8 80*80\uff0c\u56fe\u7247\u4e0d\u8d85\u8fc7 500kb",maxAmount:1,onChange:function(t){e.onUploadChange(t)},onUpload:this.onUpload,defaultFileList:this.state.defaultFileList,onError:this.onUploadError})})]})]})}),Object(b.jsxs)("div",{className:"mt24",children:[Object(b.jsx)(m.a,{type:"primary",onClick:this.submit.bind(this),children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",htmlType:"reset",onClick:this.cancel.bind(this),children:"\u53d6\u6d88"})]})]})}}]),a}(u.a.Component),is=(a(337),function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={pagetitle:"\u65b0\u5efa\u5b50\u8d26\u53f7",rowData:{},enumer:1},n}return Object(y.a)(a,[{key:"componentWillMount",value:function(){var e=JSON.parse(sessionStorage.getItem("breaknav"))[0].pagetitle,t=e.includes("\u65b0\u5efa")?0:1,a=JSON.parse(sessionStorage.getItem("dataInfo"));this.setState({pagetitle:e+"\u5b50\u8d26\u53f7",rowData:a,enumer:t})}},{key:"render",value:function(){return Object(b.jsx)("div",{id:"accadd",className:"maincenter",children:Object(b.jsx)("div",{className:"addaccount",children:Object(b.jsx)(ns,{enumer:this.state.enumer,rowData:this.state.rowData,title:this.state.pagetitle})})})}}]),a}(u.a.Component));a(338);function ss(e,t){return e!==t.getSectionValue("password").password?{name:"passwordEqual",message:"\u4e24\u6b21\u586b\u5199\u7684\u5bc6\u7801\u4e0d\u4e00\u81f4"}:null}var cs=function(e){var t=sa.a.useForm(ca.b.View),a=u.a.useState("password"),n=Object(i.a)(a,2),c=n[0],o=n[1],r=u.a.useState("password"),l=Object(i.a)(r,2),d=l[0],p=l[1],f=u.a.useCallback((function(t){var a=t.getValue();if(a){var n=Object(ye.a)(a);Object(s.Kc)(e.id,n).then((function(t){Object(s.cc)(t,(function(t,a){h.a.clear(),h.a.success(a),e.visibleShow(!1)}),(function(e){h.a.clear(),h.a.error(t.data.message)}))})).catch((function(e){}))}}),[]);return Object(b.jsxs)(sa.a,{form:t,layout:"horizontal",scrollToError:!0,onSubmit:f,children:[Object(b.jsx)(oa.a,{name:"password",label:"\u65b0\u5bc6\u7801",className:"selfpwd",required:!0,after:Object(b.jsx)(w.a,{type:"password"==c?"eye-o":"closed-eye",onClick:function(){o("password"==c?"text":"password")}}),helpDesc:"",validators:[ra.b.required("\u8bf7\u8f93\u5165\u65b0\u5bc6\u7801"),ra.b.pattern(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/,"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210\uff0c(\u5b57\u6bcd\u533a\u5206\u5927\u5c0f\u5199)")],notice:"6-16\u4f4d\u5b57\u7b26,\u6570\u5b57+\u5b57\u6bcd\u7ec4\u6210\uff0c\u5b57\u6bcd(\u533a\u5206\u5927\u5c0f\u5199)",props:{type:"password"==c?"password":"text",maxLength:16,autoComplete:"new-password"}}),Object(b.jsx)(oa.a,{name:"old_password",label:"\u786e\u8ba4\u5bc6\u7801",className:"selfpwd",required:!0,after:Object(b.jsx)(w.a,{type:"password"==d?"eye-o":"closed-eye",onClick:function(){p("password"==d?"text":"password")}}),notice:"\u5fc5\u987b\u4e0e\u65b0\u5bc6\u7801\u8f93\u5165\u4e00\u81f4",validators:[ra.b.required("\u8bf7\u786e\u8ba4\u5bc6\u7801"),ss],props:{type:"password"==d?"password":"text",maxLength:16,autoComplete:"new-password"}}),Object(b.jsxs)("p",{className:"dflexajce",children:[Object(b.jsx)(m.a,{type:"primary",htmlType:"submit",children:"\u786e\u5b9a"}),",",Object(b.jsx)(m.a,{onClick:function(){e.visibleShow(!1)},children:"\u53d6\u6d88"})]})]})},os=[{title:"\u8d26\u53f7",name:"user_name",prop:"user_name",type:"normal",width:"10%"},{title:"\u624b\u673a\u53f7",prop:"mobile",name:"mobile",width:"10%",type:"normal"},{title:"\u5c97\u4f4d",name:"job.job_name",type:"normal",prop:"job.job_name",width:"10%"},{title:"\u59d3\u540d",name:"real_name",type:"normal",prop:"real_name",width:"10%"},{title:"\u72b6\u6001",width:"10%",type:"slot",name:"name",prop:"status"},{title:"\u521b\u5efa\u65f6\u95f4",name:"create_time",prop:"create_time",width:"20%",type:"normal"},{title:"\u64cd\u4f5c",prop:"opearo",name:"opearo",type:"slot",width:"20%"}],rs=function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).onChange=function(e){n.setState(e)},n.onConfirm=function(){},n.onCancel=function(){},n.setVisible=function(e){n.setState({visible:e})},n.getChildrenMsg=function(e,t){n.setState({visible:t})},n.state={checkedSmall:!0,tableHeight:600,visible:!1,tabList:[{title:"\u5b50\u8d26\u53f7\u5217\u8868"}],accList:[],page:1,limit:10,total:0,search:"",id:""},n}return Object(y.a)(a,[{key:"clickFn",value:function(){sessionStorage.setItem("pathname2","/home/system/subaccount-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u65b0\u5efa",items:[{path:"/home/system/subaccount-list",name:"\u5b50\u8d26\u53f7\u7ba1\u7406"},{path:"/home/system/subaccount-add",name:"\u65b0\u5efa\u5b50\u8d26\u53f7"}]}])),window.open("#/home/system/subaccount-add")}},{key:"onSwitchChange",value:function(e,t){var a=this,n={status:0==t.status?1:0};ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426",0==t.status?"\u542f\u7528":"\u505c\u7528",Object(b.jsxs)("b",{children:["[",t.user_name,"]"]}),"\u8d26\u53f7\uff1f"]}),onConfirm:function(){Object(s.Cc)(t.id,n).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),window.location.href.includes("aid")?a.getsubAppointFn():a.getAccountFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"changeState",value:function(e,t){var a=this,n=Object(ta.a)(a.state.accoutdata,(function(e){return e.id==t.id}));a.state.accoutdata[n].status=e,a.setState({accoutdata:a.state.accoutdata})}},{key:"delFn",value:function(e,t){var a=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",t.user_name,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.r)(t.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t),window.location.href.includes("aid")?a.getsubAppointFn():a.getAccountFn()}),(function(e){h.a.error(e)}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"editFn",value:function(e,t){var a=this;Object(s.ab)().then((function(e){Object(s.cc)(e,(function(e,t){var n=e.map((function(e){return{key:e.id,text:e.company_name}}));sessionStorage.setItem("company",JSON.stringify(n)),a.props.history.push("/home/system/subaccount-add"),window.open("#/home/system/subaccount-add")}),(function(e){h.a.error(e)}))})).catch((function(e){})),sessionStorage.setItem("pathname2","/home/system/subaccount-add");sessionStorage.setItem("breaknav",JSON.stringify([{pagetitle:"\u7f16\u8f91",items:[{path:"/home/system/subaccount-list",name:"\u5b50\u8d26\u53f7\u7ba1\u7406"},{path:"/home/system/subaccount-add",name:"\u7f16\u8f91\u5b50\u8d26\u53f7"}]}])),sessionStorage.setItem("dataInfo",JSON.stringify(t))}},{key:"resetpwd",value:function(e,t){this.setState({visible:!0,id:t.id})}},{key:"getsubAppointFn",value:function(){var e=this,t=e.state,a=t.page,n=t.limit,i=t.search,c={page:a,limit:n};i&&(c.search=i),Object(s.ac)(sessionStorage.getItem("subaid"),c).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data,i=t.total;e.setState({accList:n,total:i})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"getAccountFn",value:function(){var e=this,t=e.state,a=t.page,n=t.limit,i=t.search,c={page:a,limit:n};i&&(c.search=i),Object(s.Kb)(c).then((function(t){Object(s.cc)(t,(function(t,a){var n=t.data,i=t.total;e.setState({accList:n,total:i})}),(function(e){h.a.error(e)}))})).catch((function(e){}))}},{key:"pageChange",value:function(e){var t=this;this.setState({page:e}),window.location.href.includes("aid")?setTimeout((function(){t.getsubAppointFn()}),10):setTimeout((function(){t.getAccountFn()}),10)}},{key:"countChange",value:function(e){var t=this;this.setState({page:1,limit:e}),window.location.href.includes("aid")?setTimeout((function(){t.getsubAppointFn()}),10):setTimeout((function(){t.getAccountFn()}),10)}},{key:"iptsureFn",value:function(){var e=this;window.location.href.includes("aid")?(this.setState({page:1}),setTimeout((function(){e.getsubAppointFn()}),300)):(this.setState({page:1}),setTimeout((function(){e.getAccountFn()}),300))}},{key:"componentWillMount",value:function(){var e;(this.setState({tableHeight:window.innerHeight-390}),window.location.href.includes("aid"))?this.getsubAppointFn():(sessionStorage.setItem("subaid",null===(e=JSON.parse(sessionStorage.getItem("userInfo")))||void 0===e?void 0:e.id),this.getAccountFn())}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e,t){t.search==this.state.search||this.state.search||(window.location.href.includes("aid")?this.getsubAppointFn():this.getAccountFn())}},{key:"sureFn",value:function(){}},{key:"render",value:function(){var e=this;return Object(b.jsxs)("div",{id:"accountlist",children:[Object(b.jsx)(It,{tabs:this.state.tabList,children:Object(b.jsxs)("div",{className:"acctable",children:[Object(b.jsxs)("div",{className:"accountable dflexj",children:[Object(b.jsx)(m.a,{type:"primary",icon:"plus",onClick:this.clickFn.bind(this),children:"\u65b0\u5efa\u5b50\u8d26\u53f7"}),Object(b.jsx)(r.a,{onChange:function(t){return e.setState({search:t})},value:this.state.search,wordSearch:this.iptsureFn.bind(this),icon:"search",placeholder:"\u8bf7\u8f93\u5165\u59d3\u540d\u3001\u624b\u673a\u53f7\u67e5\u8be2",countShow:!1,height:"36px",width:"260px",onClearItem:function(t){e.setState({search:""})},alignment:"left"})]}),Object(b.jsx)("div",{className:"table-container",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.accList,Column:os,maxheight:this.state.tableHeight,isMultiple:!1,dataCount:this.state.total,countbarVisible:!1,isSwitch:!1,page:this.state.page,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"status"==t?Object(b.jsx)(S.a,{size:"small",checked:0!=a.status,onChange:function(t){e.onSwitchChange(t,a)}}):"opearo"==t?Object(b.jsxs)("span",{children:[Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.editFn(t,a)},children:"\u7f16\u8f91"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.delFn(t,a)},children:"\u5220\u9664"}),Object(b.jsx)("span",{className:"grid-link",onClick:function(t){return e.resetpwd(t,a)},children:"\u91cd\u7f6e\u5bc6\u7801"})]}):void 0}})})]})}),Object(b.jsx)(ge.a,{visible:this.state.visible,className:"questModal",onClose:function(){return e.setVisible(!1)},title:"\u91cd\u7f6e\u5bc6\u7801",children:Object(b.jsx)("div",{children:Object(b.jsx)(cs,{visibleShow:function(t){return e.setVisible(t)},id:this.state.id})})})]})}}]),a}(u.a.Component),ls=(a(339),[{title:"\u7f29\u7565\u56fe",name:"thumb",prop:"thumb",type:"slot",width:"10%"},{title:"\u6807\u9898",prop:"title",name:"title",width:"auto",type:"normal"},{title:"\u6743\u91cd",prop:"sort",name:"sort",type:"normal",width:"auto"},{title:"\u66f4\u65b0\u65f6\u95f4",prop:"update_time",name:"update_time",type:"normal",width:"auto"},{title:"\u521b\u5efa\u4eba",prop:"user_name",name:"user_name",type:"normal",width:"auto"},{title:"\u64cd\u4f5c",prop:"edit",name:"edit",type:"slot",width:"auto"}]),ds=[{path:"/home/exchangepage",component:$a},{path:"/home/plan-message",component:function(){var e=Object(Pt.f)(),t=Object(U.a)({tableData:[],backupTableData:[],tabs:[{title:"\u63d0\u793a\u5217\u8868"}],planId:sessionStorage.getItem("plan_id")}),a=Object(i.a)(t,2),c=a[0],o=a[1];function l(e){switch(e){case 0:return"\u901a\u7528";case 1:return"\u5151\u6362\u7801";case 2:return"\u7acb\u51cf\u91d1";case 3:return"\u7ea2\u5305"}}return Object(d.useEffect)((function(){Object(s.V)(c.planId).then((function(e){Object(s.cc)(e,(function(e,t){o({tableData:Object(ye.a)(e),backupTableData:Object(ye.a)(e)})}),(function(e){h.a.error(e)}))}))}),[]),Object(b.jsxs)("div",{className:"planMessages",children:[Object(b.jsx)(It,{tabs:c.tabs,children:Object(b.jsx)(q,{spliteColor:"#fff",isShowPageBar:!1,isSwitch:!1,isMultiple:!1,countbarVisible:!1,tableData:c.tableData,Column:[{title:"\u8303\u56f4",prop:"type",name:"type",type:"slot",width:"200px"},{title:"\u89e6\u53d1\u539f\u56e0",name:"message_reason",prop:"message_reason",type:"normal",width:"300px"},{title:"\u53ef\u7528\u53d8\u91cf",name:"label",prop:"label",type:"slot",width:"300px"},{title:"\u9ed8\u8ba4\u63d0\u793a",name:"default",prop:"default",type:"normal",width:"auto"},{title:"\u66f4\u65b0\u63d0\u793a",prop:"updateCustomize",name:"updateCustomize",type:"slot",width:"500px"}],maxheight:670,ComponentHandler:function(e,t){return"type"===e?Object(b.jsx)("p",{children:l(t.type)}):"updateCustomize"===e?Object(b.jsx)(r.a,{onChange:function(e){t.customize=e,o(Object(n.a)({},c))},onClearItem:function(){t.customize="",o(Object(n.a)({},c))},value:t.customize,placeholder:"\u8bf7\u8f93\u5165\uff08\u53d8\u91cf\u4f7f\u7528 ${xx} \u683c\u5f0f\u3002\uff09",labelWidth:"0px",countShow:!1,maxLength:50,disabled:t.readOnly,height:"36px",width:"400px",alignment:"left"}):"label"===e?Object(b.jsx)("div",{children:t.label.length?t.label.map((function(e){return Object(b.jsxs)("p",{className:"variable",children:[e.name,": ",Object(b.jsx)("span",{children:e.index})]},e.index)})):"-"}):void 0}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){var t=[];c.tableData.map((function(e){c.backupTableData.map((function(a){if(e.message_index===a.message_index&&e.customize!==a.customize){var n=e.message_index,i=e.uuid,s=e.customize;t.push({message_index:n,uuid:i,customize:s})}}))})),Object(s.pc)(t,c.planId).then((function(t){Object(s.cc)(t,(function(a,n){h.a.success(t.message),e.push("/home/plan-list/")}),(function(e){h.a.error(t.message)}))}))},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return window.history.go(-1)},children:"\u53d6\u6d88"})]})]})}},{path:"/home/plan-defineButton",component:function(){var e=Object(Pt.f)(),t=Object(U.a)({tableData:[],tabs:[{title:"\u6587\u6848\u5217\u8868"}],planId:sessionStorage.getItem("plan_id")}),a=Object(i.a)(t,2),c=a[0],o=a[1];return Object(d.useEffect)((function(){Object(s.db)(c.planId).then((function(e){Object(s.cc)(e,(function(e,t){o({tableData:Object(ye.a)(e)})}),(function(e){h.a.error(e)}))}))}),[]),Object(b.jsxs)("div",{className:"planMessages",children:[Object(b.jsx)(It,{tabs:c.tabs,children:Object(b.jsx)(q,{spliteColor:"#fff",isShowPageBar:!1,isSwitch:!1,isMultiple:!1,countbarVisible:!1,tableData:c.tableData,Column:[{title:"\u8303\u56f4",prop:"text",name:"text",type:"normal",width:"400px"},{title:"\u9ed8\u8ba4\u6309\u94ae\u6587\u6848",name:"default",prop:"default",type:"normal",width:"auto"},{title:"\u81ea\u5b9a\u4e49\u6309\u94ae\u6587\u6848",prop:"custom",name:"custom",type:"slot",width:"auto"}],maxheight:670,ComponentHandler:function(e,t){if("custom"===e)return Object(b.jsx)(r.a,{onChange:function(e){t.custom=e,o(Object(n.a)({},c))},onClearItem:function(){t.custom="",o(Object(n.a)({},c))},value:t.custom,placeholder:"\u8bf7\u8f93\u5165\u6309\u94ae\u6587\u6848",labelWidth:"0px",countShow:!1,maxLength:6,disabled:t.readOnly,height:"36px",width:"400px",alignment:"left"})}})}),Object(b.jsxs)("div",{className:"button_box",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){Object(s.qd)(c.planId,{button_conf:c.tableData}).then((function(t){Object(s.cc)(t,(function(a,n){h.a.success(t.message),e.push("/home/plan-list/")}),(function(e){h.a.error(t.message)}))}))},children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return window.history.go(-1)},children:"\u53d6\u6d88"})]})]})}},{path:"/home/settlementList",component:In},{path:"/home/packageDetail",component:Fn},{path:"/home/mytempMould",component:an},{path:"/home/myexchangetemplate",component:Xa},{path:"/home/order-list",component:_n},{path:"/home/download-orderlist",component:cn},{path:"/home/bm-download-orderlist",component:rn},{path:"/home/order-addetails",component:kn},{path:"/home/plan",component:wi},{path:"/home/plan-list",component:Si},{path:"/home/plan-qrcode",component:Ci},{path:"/home/plan-create",component:Qn},{path:"/home/plan-edit",component:$n},{path:"/home/plan-edit-copy",component:Zn},{path:"/home/key-list",component:pi},{path:"/home/plan-keyList",component:_i},{path:"/home/key-addEdit",component:ni},{path:"/home/key-detail",component:oi},{path:"/home/key-log",component:li},{path:"/home/system/account-add",component:Di},{path:"/home/system/subaccount-list",component:rs},{path:"/home/system/subaccount-add",component:is},{path:"/home/system/role-list",component:Xi},{path:"/home/system/role-add",component:$i},{path:"/home/system/station",component:ts},{path:"/home/system/customize",component:Ei},{path:"/home/system/menu",component:Ui},{path:"/home/system/my-mould",component:function(e){Object(_.a)(a,e);var t=Object(v.a)(a);function a(e){var n;return Object(g.a)(this,a),(n=t.call(this,e)).state={distdata:[],total:0,combinedValue:[],page:1,limit:10,tabList:[{title:"\u7cfb\u7edf\u6a21\u677f\u5217\u8868"}],DateTime:"",key_word:"",tableHeight:600,dataCount:0},n}return Object(y.a)(a,[{key:"componentDidUpdate",value:function(e,t){t.key_word==this.state.key_word||this.state.key_word||this.sureFn()}},{key:"sureFn",value:function(){this.setState({page:1,limit:10});var e={page:1,limit:10,title:this.state.key_word};this.getTableList(e)}},{key:"editFn",value:function(e,t){sessionStorage.setItem("mouldType",0),sessionStorage.setItem("pageInfo",JSON.stringify(t)),sessionStorage.setItem("isSort",1),window.location.href="/#/edittemplate"}},{key:"getTableList",value:function(e){var t=this;Object(s.Mb)(e).then((function(e){Object(s.cc)(e,(function(e,a){t.setState({dataCount:e.total,distdata:e.data})}),(function(e){}))})).catch((function(e){}))}},{key:"componentWillMount",value:function(){this.setState({tableHeight:window.innerHeight-390});var e={page:this.state.page,limit:this.state.limit};this.state.combinedValue&&this.state.combinedValue[0]&&(e.begin_time=this.state.combinedValue[0],e.end_time=this.state.combinedValue[1]),this.getTableList(e)}},{key:"countChange",value:function(e){this.setState({page:1,limit:e});var t={page:1,limit:e};this.getTableList(t)}},{key:"pageChange",value:function(e){this.setState({page:e});var t={page:e,limit:this.state.limit};this.state.key_word&&(t.title=this.state.key_word),this.getTableList(t)}},{key:"newTemplate",value:function(e){sessionStorage.setItem("mouldType",0),sessionStorage.removeItem("pageInfo"),sessionStorage.removeItem("editorConfig"),window.location.href="/#/edittemplate"}},{key:"delFn",value:function(e,t){var a=this,n=this;ee.a.confirm({type:"warning",closeBtn:!0,title:"\u786e\u8ba4\u64cd\u4f5c",content:Object(b.jsxs)("p",{children:["\u662f\u5426\u5220\u9664",Object(b.jsxs)("b",{children:["[",t.title,"]"]}),"\uff1f"]}),onConfirm:function(){Object(s.B)(t.id).then((function(e){Object(s.cc)(e,(function(e,t){h.a.clear(),h.a.success(t);var i={page:a.state.page,limit:a.state.limit,title:a.state.key_word};n.getTableList(i)}),(function(e){}))})).catch((function(e){}))},onCancel:this.onCancel,className:"questModal",parentComponent:this})}},{key:"render",value:function(){var e=this,t=this.state;t.current,t.pageSize;return Object(b.jsx)("div",{id:"exchangecodelist",children:Object(b.jsxs)(It,{tabs:this.state.tabList,children:[Object(b.jsxs)("div",{className:"codetable dflexj",children:[Object(b.jsxs)(m.a,{type:"primary",icon:"plus",onClick:function(t){e.newTemplate(t)},children:[" ","\u65b0\u589e\u6a21\u677f"," "]}),Object(b.jsx)(r.a,{onClearItem:function(t){e.setState({key_word:""})},wordSearch:this.sureFn.bind(this),onChange:function(t){return e.setState({key_word:t})},value:this.state.key_word,icon:"search",placeholder:"\u8bf7\u8f93\u5165\u5173\u952e\u5b57\u8fdb\u884c\u5339\u914d\u67e5\u8be2",countShow:!1,height:"36px",width:"260px",alignment:"left"})]}),Object(b.jsx)("div",{className:"code-table",children:Object(b.jsx)(q,{spliteColor:"#fff",tableData:this.state.distdata,Column:ls,maxheight:this.state.tableHeight,countbarVisible:!1,isSwitch:!1,page:this.state.page,dataCount:this.state.dataCount,isMultiple:!1,pageChange:function(t){e.pageChange(t)},countChange:function(t){e.countChange(t)},checkChange:function(e){},ComponentHandler:function(t,a){return"thumb"==t?Object(b.jsx)(ma.a,{trigger:"hover",position:"right-center",content:Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"375px",transform:"scale(.8)"}}),children:Object(b.jsx)("img",{src:a.thumb,alt:"",style:{width:"30px",height:"30px"}})}):"edit"==t?Object(b.jsxs)("span",{children:[Object(b.jsxs)("a",{className:"grid-link",onClick:function(t){e.editFn(t,a)},children:[" ","\u7f16\u8f91"," "]})," ",Object(b.jsxs)("a",{onClick:function(t){e.delFn(t,a)},className:"grid-link",children:[" ","\u5220\u9664"," "]})]}):void 0}})})]})})}}]),a}(u.a.Component)},{path:"/home/distributor-list",component:pa},{path:"/home/distributor-add",component:Zt},{path:"/home/distributor-edit",component:Zt},{path:"/home/distributor-merchant",component:function(){var e,t,a,u,f,j,g=Object(U.a)({loading:!1,apiMode:[],reseller_id:0,merchant_id:"",pos_id:"",app_id:"",store_id:"",public_key:"",private_key:"",merchant_public_key:"",secret_key:"",notify_url:"",status:1,api_mode:2,subscribe_event:[],marketEvent:[]}),y=Object(i.a)(g,2),_=y[0],v=y[1],x=Object(d.useRef)();return Object(d.useEffect)((function(){var e=JSON.parse(sessionStorage.getItem("merchant")),t=e.merchant,a=e.id;Object(s.S)().then((function(e){var i=e.data;v(Object(n.a)({apiMode:i,reseller_id:a},t))})),Object(s.ad)().then((function(e){var t=e.data;v({marketEvent:t})}))}),[]),Object(b.jsxs)("div",{className:"maincenter",children:[Object(b.jsx)(p.a,{style:{width:"100%"},title:"\u66f4\u65b0\u4fe1\u606f",children:Object(b.jsx)("div",{className:"adddistributor merchantForm",children:Object(b.jsxs)(o.a,{model:_,rules:{merchant_id:[{type:"required",message:"\u8bf7\u8f93\u5165\u5546\u6237\u7f16\u53f7"}],public_key:[{type:"required",message:"\u8bf7\u8f93\u5165\u516c\u94a5"}],private_key:[{type:"required",message:"\u8bf7\u8f93\u5165\u79c1\u94a5"}],app_id:[{type:"required",message:"\u8bf7\u8f93\u5165\u5e94\u7528ID"}],pos_id:[{type:"required",message:"\u8bf7\u8f93\u5165\u5e73\u53f0ID"}],store_id:[{type:"required",message:"\u8bf7\u8f93\u5165\u5e97\u94faID"}],secret_key:[{type:"required",message:"\u8bf7\u8f93\u5165SM4\u79d8\u94a5"}],merchant_public_key:[{type:"required",message:"\u8bf7\u8f93\u5165\u5546\u6237\u516c\u94a5"}],notify_url:[{type:"required",message:"\u8bf7\u8f93\u5165\u5546\u6237\u56de\u8c03\u901a\u77e5\u7f51\u5173\u5730\u5740"},{type:"regExp",message:"\u8bf7\u8f93\u5165\u5408\u6cd5\u7684\u56de\u8c03\u901a\u77e5\u7f51\u5173\u5730\u5740",reg:/(https?|ftp|file):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/%=~_|]/}]},ref:x,children:[Object(b.jsx)(c.a,{labelname:"\u5546\u6237\u7f16\u53f7",prop:"merchant_id",children:Object(b.jsx)(r.a,{onChange:function(e){return v({merchant_id:e})},onClearItem:function(){return v({merchant_id:""})},countShow:!1,value:_.merchant_id,placeholder:"\u8bf7\u8f93\u5165\u5546\u6237\u7f16\u53f7",labelWidth:"0px",maxLength:100,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5e73\u53f0ID",prop:"pos_id",children:Object(b.jsx)(r.a,{onChange:function(e){return v({pos_id:e})},onClearItem:function(){return v({pos_id:""})},countShow:!1,value:_.pos_id,placeholder:"\u8bf7\u8f93\u5165\u5e73\u53f0ID",labelWidth:"0px",maxLength:100,height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"APP-ID",prop:"app_id",children:Object(b.jsx)(r.a,{onChange:function(e){return v({app_id:e})},onClearItem:function(){return v({app_id:""})},countShow:!1,value:_.app_id,placeholder:"\u8bf7\u8f93\u5165APPID",labelWidth:"0px",maxLength:100,height:"36px",width:"520px",alignment:"left"})}),null!==(e=_.apiMode)&&void 0!==e&&null!==(t=e.filter((function(e){return e.key===_.api_mode}))[0])&&void 0!==t&&t.store_id?Object(b.jsx)(c.a,{labelname:"\u5e97\u94faID",prop:"store_id",children:Object(b.jsx)(r.a,{onChange:function(e){return v({store_id:e})},onClearItem:function(){return v({store_id:""})},countShow:!1,value:_.store_id,placeholder:"\u8bf7\u8f93\u5165\u5e97\u94faID",labelWidth:"0px",maxLength:100,height:"36px",width:"520px",alignment:"left"})}):null,null!==(a=_.apiMode)&&void 0!==a&&null!==(u=a.filter((function(e){return e.key===_.api_mode}))[0])&&void 0!==u&&u.secret_key?Object(b.jsx)(c.a,{labelname:"SM4\u79d8\u94a5",prop:"secret_key",children:Object(b.jsx)(r.a,{onChange:function(e){return v({secret_key:e})},onClearItem:function(){return v({secret_key:""})},countShow:!1,value:_.secret_key,placeholder:"\u8bf7\u8f93\u5165SM4\u79d8\u94a5",labelWidth:"0px",height:"36px",width:"520px",alignment:"left"})}):null,Object(b.jsxs)(c.a,{labelname:"\u79c1\u94a5",prop:"private_key",children:[Object(b.jsx)(Le.a,{type:"textarea",onChange:function(e){var t=e.target;return v({private_key:t.value})},value:_.private_key,placeholder:"\u8bf7\u8f93\u5165\u79c1\u94a5",readOnly:!0,labelWidth:"0px",width:"520px",alignment:"left"}),Object(b.jsx)("p",{className:"tips",children:"* \u6b64\u5bc6\u94a5\u4e3a\u5185\u90e8\u4fe1\u606f\uff0c\u8bf7\u52ff\u5bf9\u5916\u63d0\u4f9b\u3002"})]}),Object(b.jsx)(c.a,{labelname:"\u516c\u94a5",prop:"public_key",children:Object(b.jsxs)("div",{className:"flex",children:[Object(b.jsx)(Le.a,{type:"textarea",onChange:function(e){var t=e.target;return v({public_key:t.value})},value:_.public_key,readOnly:!0,placeholder:"\u8bf7\u8f93\u5165\u516c\u94a5",labelWidth:"0px",width:"520px",alignment:"left"}),Object(b.jsx)(zt.a,{text:_.public_key})]})}),Object(b.jsx)(c.a,{labelname:"",required:"",children:Object(b.jsx)(ma.a,{trigger:"hover",content:"\u5bc6\u94a5\u53d7 \u201c\u5bf9\u63a5\u7c7b\u578b\u201d \u5f71\u54cd",children:Object(b.jsx)(m.a,{type:"primary",onClick:function(){Object(s.O)({api_mode:_.api_mode}).then((function(e){var t=e.data;v(Object(n.a)({},t))}))},children:"\u91cd\u65b0\u83b7\u53d6\u5bc6\u94a5"})})}),Object(b.jsx)(c.a,{labelname:"\u5546\u6237\u516c\u94a5",prop:"merchant_public_key",children:Object(b.jsx)(Le.a,{type:"textarea",onChange:function(e){var t=e.target;return v({merchant_public_key:t.value})},value:_.merchant_public_key,placeholder:"\u8bf7\u8f93\u5165\u5546\u6237\u516c\u94a5",labelWidth:"0px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5546\u6237\u56de\u8c03\u901a\u77e5\u7f51\u5173\u5730\u5740",prop:"notify_url",children:Object(b.jsx)(r.a,{onChange:function(e){return v({notify_url:e})},onClearItem:function(){return v({notify_url:""})},countShow:!1,value:_.notify_url,placeholder:"\u8bf7\u8f93\u5165\u7f51\u5173\u5730\u5740",labelWidth:"0px",height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5546\u6237\u72b6\u6001",children:Object(b.jsxs)(te.a,{onChange:function(e){var t=e.target;return v({status:t.value})},value:_.status,children:[Object(b.jsx)(ae.a,{value:1,children:"\u6b63\u5e38"}),Object(b.jsx)(ae.a,{value:2,children:"\u7981\u7528"})]})}),Object(b.jsx)(c.a,{labelname:"\u5bf9\u63a5\u7c7b\u578b",prop:"api_mode",children:Object(b.jsx)(te.a,{onChange:function(e){var t=e.target;v({api_mode:t.value})},value:_.api_mode,children:null===(f=_.apiMode)||void 0===f?void 0:f.map((function(e){return Object(b.jsx)(ae.a,{value:e.key,children:e.label},e.key)}))})}),Object(b.jsx)(c.a,{labelname:"\u8ba2\u9605\u4e8b\u4ef6",prop:"subscribe_event",required:"",children:Object(b.jsx)(k.a.Group,{value:_.subscribe_event,onChange:function(e){return v({subscribe_event:e})},children:null===(j=_.marketEvent)||void 0===j?void 0:j.map((function(e){return Object(b.jsx)(k.a,{value:e.event,children:e.name})}))})})]})})}),Object(b.jsxs)("div",{className:"distributorbtn",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){if(x.current.validator()){v({loading:!0});var e=Object(l.a)(_,["reseller_id","loading"]);Object(s.ld)(_.reseller_id,e).then((function(e){var t=e.code,a=e.message;if(200===t){h.a.success("\u4fdd\u5b58\u6210\u529f");var n=setTimeout((function(){window.history.go(-1),v({loading:!1}),clearTimeout(n)}),1e3)}else v({loading:!1}),h.a.success(a)})).catch((function(e){var t=e.message;v({loading:!1}),h.a.success(t)}))}},loading:_.loading,children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return window.history.back()},children:"\u53d6\u6d88"})]})]})}},{path:"/home/exchangecode-list",component:Wa},{path:"/home/combining-list",component:Ya},{path:"/home/exchange-addcommodity",component:ja},{path:"/home/system/account-list",component:qi},{path:"/home/exchangecode-exchangecodeAdd",component:Da},{path:"/home/combiningAdd",component:Aa},{path:"/home/coupon-list",component:Wt},{path:"/home/coupon-add-edit",component:Dt},{path:"/home/coupon-commodity",component:Ht},{path:"/home/callback-message",component:function(){var e=Object(d.useRef)(),t=Object(d.useState)({voucher_status_notify:"",voucher_receive_notify:"",loading:!1}),a=Object(i.a)(t,2),u=a[0],f=a[1],j=sessionStorage.getItem("callBackId"),g=Number(sessionStorage.getItem("callBackType"));return Object(d.useEffect)((function(){!function(){var e={reseller_id:"",plan_id:"",key_batch_id:""};switch(g){case 1:e.reseller_id=j;break;case 2:e.plan_id=j;break;case 3:e.key_batch_id=j}Object(s.Wc)(e).then((function(e){var t=e.data,a=t.voucher_notify_url,i=t.voucher_receive_url;f(Object(n.a)(Object(n.a)({},u),{},{voucher_status_notify:a,voucher_receive_notify:i}))}))}()}),[]),Object(b.jsxs)("div",{className:"maincenter",children:[Object(b.jsx)(p.a,{style:{width:"100%"},title:"\u8bbe\u7f6e\u56de\u8c03\u57df\u540d",children:Object(b.jsx)("div",{className:"adddistributor merchantForm",children:Object(b.jsxs)(o.a,{model:u,ref:e,children:[Object(b.jsx)(c.a,{labelname:"\u5238\u72b6\u6001\u901a\u77e5\u5730\u5740",prop:"voucher_status_notify",required:"",children:Object(b.jsx)(r.a,{onChange:function(e){return f(Object(n.a)(Object(n.a)({},u),{},{voucher_status_notify:e}))},onClearItem:function(){return f(Object(n.a)(Object(n.a)({},u),{},{voucher_status_notify:""}))},countShow:!1,value:u.voucher_status_notify,placeholder:"\u8bf7\u8f93\u5165\u5238\u72b6\u6001\u901a\u77e5\u5730\u5740",labelWidth:"0px",height:"36px",width:"520px",alignment:"left"})}),Object(b.jsx)(c.a,{labelname:"\u5238\u9886\u53d6\u901a\u77e5\u5730\u5740",prop:"voucher_receive_notify",required:"",children:Object(b.jsx)(r.a,{onChange:function(e){return f(Object(n.a)(Object(n.a)({},u),{},{voucher_receive_notify:e}))},onClearItem:function(){return f(Object(n.a)(Object(n.a)({},u),{},{voucher_receive_notify:""}))},countShow:!1,value:u.voucher_receive_notify,placeholder:"\u8bf7\u8f93\u5165\u5238\u9886\u53d6\u901a\u77e5\u5730\u5740",labelWidth:"0px",height:"36px",width:"520px",alignment:"left"})})]})})}),Object(b.jsxs)("div",{className:"distributorbtn",children:[Object(b.jsx)(m.a,{type:"primary",onClick:function(){var e=/(https?|ftp|file):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/%=~_|]/,t=u.voucher_status_notify,a=u.voucher_receive_notify;if(t&&!e.test(t))return h.a.warn("\u8bf7\u5165\u5408\u6cd5\u7684\u5238\u72b6\u6001\u901a\u77e5\u5730\u5740\uff01");if(a&&!e.test(a))return h.a.warn("\u8bf7\u5165\u5408\u6cd5\u7684\u5238\u9886\u53d6\u901a\u77e5\u5730\u5740\uff01");f({loading:!0});var n=Object(l.a)(u,["loading"]);switch(g){case 1:n.reseller_id=j,Object(s.md)(n).then((function(e){var t=e.code,a=e.message;if(200===t){h.a.success(a);var n=null;n=setTimeout((function(){window.history.go(-1),clearTimeout(n)}),1e3)}else h.a.error(a);f({loading:!1})}));break;case 2:n.plan_id=j,Object(s.kd)(n).then((function(e){var t=e.code,a=e.message;if(200===t){h.a.success(a);var n=null;n=setTimeout((function(){window.history.go(-1),clearTimeout(n)}),1e3)}else h.a.error(a);f({loading:!1})}));break;case 3:n.key_batch_id=j,Object(s.jd)(n).then((function(e){var t=e.code,a=e.message;if(200===t){h.a.success(a);var n=null;n=setTimeout((function(){window.history.go(-1),clearTimeout(n)}),1e3)}else h.a.error(a);f({loading:!1})}))}},loading:u.loading,children:"\u63d0\u4ea4"}),Object(b.jsx)(m.a,{type:"normal",onClick:function(){return window.history.back()},children:"\u53d6\u6d88"})]})]})}}],us=["/home/extension","/home/plan-create","/home/mytempMould","/home/edittemplate"],hs=[{id:14,icon:"",title:"\u7cfb\u7edf\u7ba1\u7406",level:1,router:"/system",children:[{id:20,title:"\u8d26\u53f7\u7ba1\u7406",level:5,router:"/home/system/account-list",code:["get-auth-admin"]},{id:23,title:"\u83dc\u5355\u7ba1\u7406",level:5,router:"/home/system/menu",code:["get-auth-menu-tree"]},{id:22,title:"\u5c97\u4f4d\u7ba1\u7406",level:5,router:"/home/system/station",code:["get-auth-departmentjob"]},{id:21,title:"\u89d2\u8272\u7ba1\u7406",level:5,router:"/home/system/role-list",code:["get-auth-adminrole"]},{id:24,title:"\u5b9a\u5236\u5316\u6a21\u677f",level:5,router:"/home/system/customize",code:["post-plan-theme-custom"]},{id:133,title:"\u7cfb\u7edf\u8425\u9500\u6a21\u677f",level:5,router:"/home/system/my-mould",code:["get-plan-theme-system"]},{id:138,title:"\u5b50\u8d26\u53f7\u7ba1\u7406",level:5,router:"/home/system/subaccount-list",children:[{id:140,title:"\u8d26\u53f7\u5217\u8868",level:5,router:"/home/system/subaccount-list",code:["get-auth-admin-sonindex"]}]}]},{id:15,icon:"",title:"\u5206\u9500\u5546\u7ba1\u7406",level:1,router:"/home/distributor-list",children:[{id:65,title:"\u5206\u9500\u5546\u5217\u8868",level:5,router:"/home/distributor-list",code:["get-reseller"]}]},{id:16,icon:"",title:"\u8425\u9500\u8ba1\u5212\u7ba1\u7406",level:1,router:"/home/plan-list",children:[{id:75,title:"\u8425\u9500\u8ba1\u5212\u5217\u8868",level:5,router:"/home/plan-list",code:["get-plan"]},{id:184,title:"Keys\u67e5\u8be2",level:5,router:"/home/plan-keyList",code:["get-keys"]},{id:214,title:"\u4e8c\u7ef4\u7801\u5c0f\u5de5\u5177",level:5,router:"/home/plan-qrcode",code:["qrcodetool"]}]},{id:17,icon:"",title:"\u5151\u6362\u7801\u7ba1\u7406",level:1,router:"/home/exchangecode-list",children:[{id:82,title:"\u5151\u6362\u7801\u5217\u8868",level:5,router:"/home/exchangecode-list",code:["get-codes"]},{id:188,title:"\u7ec4\u5408\u5546\u54c1\u5217\u8868",level:5,router:"/home/combining-list",code:["get-codes"]}]},{id:195,icon:"",title:"\u4f18\u60e0\u5238\u7ba1\u7406",level:1,router:"/home/coupon-list",children:[{id:196,title:"\u4f18\u60e0\u5238\u5217\u8868",level:5,router:"/home/coupon-list",code:["get-coupon"]}]},{id:18,icon:"",title:"\u843d\u5730\u9875\u7ba1\u7406",level:1,router:"/home/exchangepage",children:[{id:118,title:"\u843d\u5730\u9875\u5217\u8868",level:5,router:"/home/exchangepage",code:["get-plan-theme"]},{id:119,title:"\u6211\u7684\u6a21\u677f",level:5,router:"/home/myexchangetemplate",code:["get-plan-theme"]},{id:175,title:"\u6a21\u677f\u4e2d\u5fc3",level:5,router:"/home/mytempMould",code:["get-plan-theme-getthemetype"]}]},{id:19,icon:"",title:"\u8ba2\u5355\u7ba1\u7406",level:1,router:"/home/order-list",children:[{id:98,title:"\u8ba2\u5355\u5217\u8868",level:5,router:"/home/order-list",code:["get-order"]},{id:202,title:"\u5305\u7801\u7ed3\u7b97\u8ba2\u5355\u5217\u8868",level:5,router:"/home/settlementList",code:["get-settlement_order-list"]},{id:215,title:"\u8ba2\u5355\u4e0b\u8f7d\u5217\u8868",level:5,router:"/home/download-orderlist",code:["order_download_list"]},{id:216,title:"\u5305\u7801\u8ba2\u5355\u4e0b\u8f7d\u5217\u8868",level:5,router:"/home/bm-download-orderlist",code:["bm-download-orderlist"]}]}]},532:function(e,t,a){},615:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return _}));var n=a(24),i=a(25),s=a(28),c=a(26),o=a(27),r=a(60),l=a(340),d=a(527),u=a(507),h=[];function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.map((function(e){e.children&&e.children.length?p(e.children):e.code&&(Object(d.a)(h,e.code).length?e.auth=!0:e.auth=!1)}))}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.map((function(e){if(e.auth){var a=e.id,n=e.title,i=e.icon,s=e.router,c=e.level,o=e.children;t.push({id:a,title:n,icon:i,router:s,level:c,children:o?m(o):void 0})}})),t}function b(e){h=e;var t=Object(u.a)(l.c);return p(t),function(e){e.map((function(e){e.children.map((function(e){var t;e.children&&(e.auth=!(null===(t=e.children)||void 0===t||!t.filter((function(e){return e.auth})).length))}))})),e.map((function(e){var t;e.auth=!(null===(t=e.children)||void 0===t||!t.filter((function(e){return e.auth})).length)}))}(t),m(t)}var f=a(0),j=a(472),g=a(258),y=(a(532),a(1)),_=function(e){Object(c.a)(a,e);var t=Object(o.a)(a);function a(e){var i;return Object(n.a)(this,a),(i=t.call(this,e)).getQuery=function(e){return(e.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((function(e,t){return e[t.slice(0,t.indexOf("="))]=t.slice(t.indexOf("=")+1),e}),{})},window.react=Object(s.a)(i),i}return Object(i.a)(a,[{key:"componentWillMount",value:function(){var e=this.getQuery(this.props.location.search),t=e.token,a=e.head;if(t)return sessionStorage.setItem("authorization",t),void this.onSubmit(t,a);this.toUnifiedLogin()}},{key:"toUnifiedLogin",value:function(){setTimeout((function(){window.location.href="".concat("https://user.1688sup.com/#/login","?url=").concat(encodeURIComponent(window.location.href))}),1500)}},{key:"getAccountList",value:function(){Object(r.Tb)().then((function(e){e?sessionStorage.setItem("isEarlyWarningMan",!0):sessionStorage.setItem("isEarlyWarningMan",!1)}))}},{key:"onSubmit",value:function(e,t){var a=this;Object(r.zc)({authorization:e,head:t}).then((function(e){Object(r.cc)(e,(function(e,t){Object(r.R)().then((function(e){Object(r.cc)(e,(function(e,t){sessionStorage.setItem("enmu",JSON.stringify(e))}))})),Object(r.X)().then((function(e){var n=b(e.codes);if(j.a.clear(),j.a.success(t),a.getProductList(),a.getAccountList(),sessionStorage.setItem("showflag",!0),n&&n.length>0){var i,s=n.findIndex((function(e){return"\u7cfb\u7edf\u7ba1\u7406"===e.title}));-1!==s?(n[s].children=n[s].children.filter((function(e){return"\u5b9a\u5236\u5316\u6a21\u677f"!==e.title})),sessionStorage.setItem("activeMenu",JSON.stringify(n))):sessionStorage.setItem("activeMenu",JSON.stringify(n));var c=n.filter((function(e){return 16==e.id}));if(c&&(null===(i=c[0])||void 0===i?void 0:i.children.length)>0)sessionStorage.setItem("linkshowname","\u8425\u9500\u8ba1\u5212\u7ba1\u7406"),sessionStorage.setItem("pathname2","/home/plan-list"),sessionStorage.setItem("menulinklist",JSON.stringify(c[0].children)),setTimeout((function(){a.props.history.replace("/home/plan-list")}),1e3);else try{n.forEach((function(e){e.children&&e.children.length>0?e.children.forEach((function(t){if(5==t.level)throw sessionStorage.setItem("pathname2",t.router),sessionStorage.setItem("linkshowname",e.title),sessionStorage.setItem("menulinklist",JSON.stringify(e.children)),setTimeout((function(){a.props.history.replace(t.router)}),1e3),"\u7ec8\u6b62\u5faa\u73af"})):(j.a.clear(),j.a.warn("\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u914d\u7f6e\u6743\u9650\u83dc\u5355"))}))}catch(o){}}else j.a.clear(),j.a.warn("\u8bf7\u5148\u8054\u7cfb\u7ba1\u7406\u5458\u914d\u7f6e\u6743\u9650\u83dc\u5355")}))}),(function(t){-2==e.code||j.a.clear(),j.a.error(e.message)}))})).catch((function(e){}))}},{key:"getProductList",value:function(){Object(r.Ab)().then((function(e){Object(r.cc)(e,(function(e,t){sessionStorage.setItem("updatetime",Date.now()),sessionStorage.setItem("productsList",JSON.stringify(e.data))}),(function(e){}))}))}},{key:"render",value:function(){return Object(y.jsx)("div",{className:"loginPage",children:Object(y.jsx)(g.a,{className:"loading",icon:"circle",iconText:"\u62fc\u547d\u8df3\u8f6c\u4e2d \xb7\xb7\xb7\xb7",loading:!0,iconSize:30})})}}]),a}(f.Component)}}]);