"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[3505],{11090:function(e,t,a){a.d(t,{Z:function(){return o}});var r=a(83910),n=a(44194),i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},s=a(54183),c=function(e,t){return n.createElement(s.Z,(0,r.Z)({},e,{ref:t,icon:i}))};var o=n.forwardRef(c)},2484:function(e,t,a){a.d(t,{Z:function(){return o}});var r=a(83910),n=a(44194),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},s=a(54183),c=function(e,t){return n.createElement(s.Z,(0,r.Z)({},e,{ref:t,icon:i}))};var o=n.forwardRef(c)},437:function(e,t,a){a.d(t,{GF:function(){return g},Nf:function(){return d},TM:function(){return p},XX:function(){return k},w_:function(){return h}});var r=a(90819),n=a.n(r),i=a(73193),s=a.n(i),c=a(89933),o=a.n(c),l=a(39497),u=a(14906);function d(e){return f.apply(this,arguments)}function f(){return(f=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/query/org",{method:"GET",params:s()({},t)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return m.apply(this,arguments)}function m(){return(m=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/create",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return(y=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/delete",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return x.apply(this,arguments)}function x(){return(x=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/approve",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return M.apply(this,arguments)}function M(){return(M=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/reject",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},34642:function(e,t,a){a.d(t,{EP:function(){return d},md:function(){return p},t7:function(){return h}});var r=a(90819),n=a.n(r),i=a(73193),s=a.n(i),c=a(89933),o=a.n(c),l=a(39497),u=a(14906);function d(e){return f.apply(this,arguments)}function f(){return(f=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/query/org",{method:"GET",params:s()({},t)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return m.apply(this,arguments)}function m(){return(m=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/create",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return(y=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/delete",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},89139:function(e,t,a){a.r(t),a.d(t,{default:function(){return K}});var r=a(73193),n=a.n(r),i=a(84176),s=a.n(i),c=a(10154),o=a.n(c),l=a(86222),u=a.n(l),d=a(90819),f=a.n(d),p=a(89933),m=a.n(p),h=a(45332),y=a.n(h),g=a(44194),x=a(81739),k=a(78578),M=a(63649),v=a(82770),q=a(86895),b=a(2907),j=a(80556),S=a(11090),w=a(54881),Z=a(2484),E=a(89246),A=a(14906),I=a(34642),L=a(98830),P=a(96596),C=a.n(P),T=a(19433),z=a(85245),R=a(32525),O=a(41196),F=a(59533),D=a(82864),N=a(40110),Y=a(40122),B=a(34201),_=a(79489),H=a(94447),X=a(437),J=a(39497),V=a(31549),W=R.Z.TextArea,G=function(e){var t=e.visible,a=e.onClose,r=e.record,n=e.onSuccess,i=(0,A.useIntl)(),s=O.Z.useForm(),c=y()(s,1)[0],o=(0,g.useState)(!1),l=y()(o,2),u=l[0],d=l[1],p=(0,L.u)((function(e){return e.currentOrg})),h=function(){var e=m()(f()().mark((function e(){var t,s,o;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.validateFields();case 3:return t=e.sent,d(!0),s={qualityCheckUid:null==r?void 0:r.uid,comment:t.comment,orgUid:null==p?void 0:p.uid},e.next=8,(0,X.TM)(s);case 8:200===(o=e.sent).code?(F.ZP.success(i.formatMessage({id:"quality.appeal.create.success",defaultMessage:"申诉提交成功"})),c.resetFields(),a(),null==n||n()):F.ZP.error(o.message||i.formatMessage({id:"quality.appeal.create.error",defaultMessage:"申诉提交失败"})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error("Create appeal error:",e.t0),F.ZP.error(i.formatMessage({id:"quality.appeal.create.error",defaultMessage:"申诉提交失败"}));case 16:return e.prev=16,d(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])})));return function(){return e.apply(this,arguments)}}(),k=function(){c.resetFields(),a()};return(0,V.jsx)(D.Z,{title:i.formatMessage({id:"quality.appeal.create",defaultMessage:"创建申诉"}),width:600,open:t,onClose:k,footer:(0,V.jsxs)("div",{style:{textAlign:"right"},children:[(0,V.jsx)(v.ZP,{onClick:k,style:{marginRight:8},children:i.formatMessage({id:"cancel"})}),(0,V.jsx)(v.ZP,{type:"primary",loading:u,onClick:h,children:i.formatMessage({id:"submit"})})]}),children:r&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.basic.info"}),size:"small",style:{marginBottom:16},children:(0,V.jsxs)(Y.Z,{column:2,size:"small",children:[(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.uid"}),children:r.uid}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.type"}),children:function(){var e=J.DMM[r.type]||"blue",t=r.type;switch(r.type){case J.fmk.ONLINE_SERVICE:t=i.formatMessage({id:"quality.check.type.onlineService"});break;case J.fmk.BOT:t=i.formatMessage({id:"quality.check.type.bot"});break;case J.fmk.CALL_CENTER:t=i.formatMessage({id:"quality.check.type.callCenter"});break;default:t=r.type||i.formatMessage({id:"quality.check.type.onlineService"})}return(0,V.jsx)(x.Z,{color:e,children:t})}()}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.createdAt"}),children:r.createdAt?C()(r.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.updatedAt"}),children:r.updatedAt?C()(r.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})}),(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.score.statistics"}),size:"small",style:{marginBottom:16},children:(0,V.jsxs)(B.Z,{gutter:16,children:[(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.totalScore"}),value:r.totalScore||0,valueStyle:{color:(r.totalScore||0)>=90?"#52c41a":(r.totalScore||0)>=80?"#1890ff":"#faad14",fontWeight:"bold"}})}),(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.bonusScore"}),value:r.bonusScore||0,valueStyle:{color:"#52c41a"}})}),(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.deductionScore"}),value:r.deductionScore||0,valueStyle:{color:"#ff4d4f"}})})]})}),r.indicators&&r.indicators.length>0&&(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.indicators.details",defaultMessage:"质检指标详情"}),size:"small",style:{marginBottom:16},children:(0,V.jsx)("div",{children:r.indicators.map((function(e,t){return(0,V.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:t=90?"#52c41a":e>=80?"#1890ff":"#faad14"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.bonusScore"}),dataIndex:"bonusScore",key:"bonusScore",width:80,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.bonusScore.tooltip"}),render:function(e){return(0,V.jsx)("span",{style:{color:"#52c41a"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.deductionScore"}),dataIndex:"deductionScore",key:"deductionScore",width:80,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.deductionScore.tooltip"}),render:function(e){return(0,V.jsx)("span",{style:{color:"#ff4d4f"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.qualityLevel"}),dataIndex:"qualityLevel",key:"qualityLevel",width:100,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.qualityLevel.tooltip"}),render:function(t){var a=J.S6D[t]||"default",r=t;switch(t){case J.YRj.EXCELLENT:r=e.formatMessage({id:"quality.check.qualityLevel.excellent"});break;case J.YRj.GOOD:r=e.formatMessage({id:"quality.check.qualityLevel.good"});break;case J.YRj.PASS:r=e.formatMessage({id:"quality.check.qualityLevel.pass"});break;case J.YRj.FAIL:r=e.formatMessage({id:"quality.check.qualityLevel.fail"});break;default:r=t||"-"}return(0,V.jsx)(x.Z,{color:a,children:r})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.indicators"}),dataIndex:"indicators",key:"indicators",width:400,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.indicators.tooltip"}),render:function(e,t){var a=t.indicators||[],r=a.length>3;return(0,V.jsx)(k.Z,{title:(0,V.jsx)("div",{children:a.map((function(e,t){return(0,V.jsx)("div",{style:{marginBottom:"4px"},children:(0,V.jsxs)(x.Z,{color:e.deduction?"red":"green",style:{marginRight:"4px"},children:[e.indicatorName,e.indicatorScore&&"(".concat(e.deduction?"-":"+").concat(e.indicatorScore,"分)")]})},t)}))}),placement:"topLeft",children:(0,V.jsxs)("div",{style:{cursor:"pointer"},children:[a.slice(0,3).map((function(e,t){return(0,V.jsxs)(x.Z,{color:e.deduction?"red":"green",style:{marginBottom:"2px",marginRight:"4px"},children:[e.indicatorName,e.indicatorScore&&"(".concat(e.deduction?"-":"+").concat(e.indicatorScore,"分)")]},t)})),r&&(0,V.jsxs)(x.Z,{color:"default",style:{marginBottom:"2px"},children:["+",a.length-3]})]})})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.comment"}),dataIndex:"comment",key:"comment",width:180,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.comment.tooltip"})},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.createdAt"}),dataIndex:"createdAt",key:"createdAt",width:180,valueType:"dateTime",hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.createdAt.tooltip"}),render:function(e,t){return t.createdAt?C()(t.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.updatedAt"}),dataIndex:"updatedAt",key:"updatedAt",width:180,valueType:"dateTime",hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.updatedAt.tooltip"}),render:function(e,t){return t.updatedAt?C()(t.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:e.formatMessage({id:"actions"}),valueType:"option",key:"option",width:180,fixed:"right",render:function(t,a,r,n){return[(0,V.jsx)("a",{onClick:function(){!function(e){_(e),D(!0)}(a)},children:e.formatMessage({id:"view"})},"view"),(0,V.jsx)("a",{onClick:function(){!function(e){te(e),K(!0)}(a)},children:e.formatMessage({id:"quality.appeal.create",defaultMessage:"申诉"})},"appeal"),(0,V.jsx)(M.Z,{title:e.formatMessage({id:"deleteTip"}),description:e.formatMessage({id:"quality.check.delete.confirm"},{uid:null==a?void 0:a.uid}),onConfirm:function(){return ae(a)},okText:e.formatMessage({id:"ok"}),cancelText:e.formatMessage({id:"cancel"}),children:(0,V.jsx)(v.ZP,{size:"small",type:"link",danger:!0,children:e.formatMessage({id:"delete"})})},"delete")]}}],ie={selectedRowKeys:i,onChange:function(e,t){c(e),h(t)}},se=function(){var t=m()(f()().mark((function t(a,r,i){var c,o,l,u,d,p,m,h;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("request:",a,r,i),T.yw.loading(e.formatMessage({id:"quality.check.loading"})),c=a.current,o=a.pageSize,l=s()(a,U),u=void 0,d=void 0,r&&Object.keys(r).length>0&&(p=Object.keys(r)[0],u=p,d="ascend"===r[p]?"ascend":"descend"),m=n()(n()({pageNumber:c-1,pageSize:o},l),{},{sortBy:u,sortDirection:d,orgUid:null==P?void 0:P.uid}),t.prev=7,t.next=10,(0,I.EP)(m);case 10:if(h=t.sent,console.log("queryQualityChecksByOrg response:",h.data,m),T.yw.destroy(),200!==h.code||!h.data){t.next=17;break}return t.abrupt("return",{data:h.data.content||[],success:!0,total:h.data.totalElements||0});case 17:return T.yw.error(h.message||e.formatMessage({id:"quality.check.fetch.error"})),t.abrupt("return",{data:[],success:!1,total:0});case 19:t.next=27;break;case 21:return t.prev=21,t.t0=t.catch(7),T.yw.destroy(),T.yw.error(e.formatMessage({id:"quality.check.fetch.error"})),console.error("Fetch quality checks error:",t.t0),t.abrupt("return",{data:[],success:!1,total:0});case 27:case"end":return t.stop()}}),t,null,[[7,21]])})));return function(e,a,r){return t.apply(this,arguments)}}();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E.Z,{columns:ne,actionRef:t,cardBordered:!0,rowSelection:ie,request:se,scroll:{x:2400},rowKey:"uid",search:{labelWidth:"auto"},pagination:{pageSize:10},dateFormatter:"string",headerTitle:e.formatMessage({id:"quality.check.management"}),toolBarRender:function(){return function(){var a=[];a.push((0,V.jsx)(v.ZP,{icon:(0,V.jsx)(j.Z,{}),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.reload()},children:e.formatMessage({id:"refresh"})},"refresh")),a.push((0,V.jsx)(v.ZP,{icon:(0,V.jsx)(S.Z,{}),type:"primary",onClick:function(){T.yw.info(e.formatMessage({id:"quality.check.export.info"}))},children:e.formatMessage({id:"export"})},"export"));var r=[];return i.length>0&&r.push({key:"batchDelete",icon:(0,V.jsx)(w.Z,{}),danger:!0,label:e.formatMessage({id:"quality.check.batch.delete"})+" (".concat(i.length,")"),onClick:function(){q.Z.confirm({title:e.formatMessage({id:"deleteTip"}),content:e.formatMessage({id:"quality.check.batch.delete.confirm"},{count:i.length}),onOk:re,okText:e.formatMessage({id:"ok"}),cancelText:e.formatMessage({id:"cancel"})})}}),r.length>0&&a.push((0,V.jsx)(b.Z,{menu:{items:r},placement:"bottom",children:(0,V.jsxs)(v.ZP,{type:i.length>0?"primary":"default",danger:i.length>0,children:[i.length>0?e.formatMessage({id:"quality.check.batch.operations"})+" (".concat(i.length,")"):e.formatMessage({id:"more.operations"}),(0,V.jsx)(Z.Z,{})]})},"batchOperations")),a}()}}),(0,V.jsx)(z.Z,{visible:F,onClose:function(){D(!1),_(null)},record:B}),(0,V.jsx)(G,{visible:W,onClose:function(){K(!1),te(null)},record:ee,onSuccess:function(){var e;null===(e=t.current)||void 0===e||e.reload()}})]})}}}]);