WXL (wul)
8 小时以前 1feb410410781eb56159c8fdd856e68d2c23e0a4
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-333be849","chunk-41a1c5e1","chunk-6b0da98a"],{1523:function(t,e,a){"use strict";var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"call-center-container"},[a("div",{staticClass:"control-section"},[a("div",{staticClass:"phone-control-card"},[a("h3",{staticClass:"section-title"},[t._v("电话控制")]),a("div",{staticClass:"input-group"},[a("div",{staticClass:"form-field"},[a("label",{staticClass:"form-label"},[t._v("客户电话号码")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.customerPhone,expression:"customerPhone"}],staticClass:"phone-input",attrs:{type:"text",placeholder:"请输入电话号码",disabled:t.isCalling},domProps:{value:t.customerPhone},on:{input:function(e){e.target.composing||(t.customerPhone=e.target.value)}}})]),a("div",{staticClass:"button-group"},[a("button",{class:["call-btn",t.callButtonClass],attrs:{disabled:!t.canMakeCall},on:{click:t.handleCall}},[a("span",{staticClass:"btn-icon"},[t._v("📞")]),t._v(" "+t._s(t.callButtonText)+" ")]),a("button",{class:["seat-btn","logout",{"in-call":t.isInCall||t.isCalling}],attrs:{disabled:!t.canLogout},on:{click:t.handleSeatLogout}},[a("span",{staticClass:"btn-icon"},[t._v("🚪")]),t._v(" "+t._s(t.isInCall||t.isCalling?"强制签出":"签出")+" ")]),a("button",{staticClass:"hangup-btn",attrs:{disabled:!t.canHangup},on:{click:t.handleHangup}},[a("span",{staticClass:"btn-icon"},[t._v("📵")]),t._v(" 挂断 ")])])])]),a("div",{staticClass:"status-card"},[a("h3",{staticClass:"section-title"},[t._v("状态监控")]),a("div",{staticClass:"status-grid"},[a("div",{staticClass:"status-item"},[a("span",{staticClass:"status-label"},[t._v("座席状态:")]),a("span",{class:["status-indicator",t.seatStatusClass]},[a("span",{staticClass:"status-dot"}),t._v(" "+t._s(t.seatStatusText)+" ")])]),a("div",{staticClass:"status-item"},[a("span",{staticClass:"status-label"},[t._v("通话状态:")]),a("span",{class:["status-indicator",t.callStatusClass]},[a("span",{staticClass:"status-dot"}),t._v(" "+t._s(t.callStatusText)+" ")])]),t.callDuration?a("div",{staticClass:"status-item"},[a("span",{staticClass:"status-label"},[t._v("通话时长:")]),a("span",{staticClass:"duration-display"},[t._v(" ⏱️ "+t._s(t.callDuration)+" ")])]):t._e()])])]),a("div",{staticClass:"debug-section"},[a("el-collapse",{attrs:{accordion:""}},[a("el-collapse-item",{attrs:{name:"debug"}},[a("template",{slot:"title"},[a("div",{staticClass:"debug-header"},[a("span",{staticClass:"debug-title"},[t._v("呼叫调试日志")]),a("span",{staticClass:"debug-subtitle"},[t._v("点击查看详细通话信息")])])]),a("div",{staticClass:"debug-content"},[a("WebsocketDemo",{ref:"callComponent",staticClass:"call-component",attrs:{"customer-phone":t.customerPhone,"auto-login":!0},on:{"status-change":t.onSeatStatusChange,"call-status":t.onCallStatusChange,error:t.onCallError}})],1)],2)],1)],1)])},s=[],r=a("6ec7"),o=a("6932"),i=(a("618d"),a("cfee"),a("35f6"),a("ec4f"),a("72c7")),c={name:"CallCenterModal",components:{WebsocketDemo:i["default"]},props:{initialPhone:{type:String,default:""}},data:function(){return{customerPhone:"",isSeatLoggedIn:!1,callStatus:"idle",callStartTime:null,callDuration:"00:00",durationTimer:null,lastError:null}},computed:{isCalling:function(){return"calling"===this.callStatus},isInCall:function(){return"connected"===this.callStatus},canLogout:function(){return this.isSeatLoggedIn&&!this.isSeatLoggingOut},canMakeCall:function(){return this.isSeatLoggedIn&&this.customerPhone&&"idle"===this.callStatus&&!this.lastError},canHangup:function(){return this.isCalling||this.isInCall},callButtonClass:function(){return this.canMakeCall?this.isCalling?"calling":"idle":"disabled"},callButtonText:function(){return this.isCalling?"呼叫中...":this.isInCall?"通话中":"开始呼叫"},seatStatusClass:function(){return this.isSeatLoggedIn?"success":"error"},seatStatusText:function(){return this.isSeatLoggedIn?"已签入":"未签入"},callStatusClass:function(){switch(this.callStatus){case"connected":return"success";case"calling":return"warning";default:return"idle"}},callStatusText:function(){switch(this.callStatus){case"connected":return"通话中";case"calling":return"呼叫中";default:return"空闲"}}},watch:{initialPhone:{immediate:!0,handler:function(t){t&&(this.customerPhone=t)}}},methods:{handleCall:function(){this.canMakeCall&&(this.$refs.callComponent.callout(this.customerPhone),this.startCallTimer())},handleSeatLogout:function(){var t=this;return Object(o["a"])(Object(r["a"])().m((function e(){var a;return Object(r["a"])().w((function(e){while(1)switch(e.p=e.n){case 0:if(t.canLogout){e.n=1;break}return e.a(2);case 1:if(e.p=1,!t.isInCall&&!t.isCalling){e.n=3;break}return e.n=2,t.$confirm("确定要签出吗?签出将结束当前通话","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 2:return e.v,e.n=3,t.handleHangup();case 3:return console.log(2),e.n=4,t.$refs.callComponent.handleSeatLogout();case 4:console.log(3),t.isSeatLoggedIn=!1,t.$message.success("座席签出成功"),e.n=6;break;case 5:e.p=5,a=e.v,"cancel"!==a&&(console.error("签出失败:",a),t.$message.error("座席签出失败"));case 6:return e.a(2)}}),e,null,[[1,5]])})))()},handleHangup:function(){this.$refs.callComponent.hangup(),this.stopCallTimer(),this.callStatus="idle"},onSeatStatusChange:function(t){this.isSeatLoggedIn=t.isLoggedIn,t.isLoggedIn||(this.callStatus="idle",this.stopCallTimer())},onCallStatusChange:function(t){this.callStatus=t.status,"connected"==t.status?this.startCallTimer():"idle"==t.status&&this.stopCallTimer()},onCallError:function(t){this.lastError=t,this.$emit("error",t)},startCallTimer:function(){var t=this;this.callStartTime=new Date,this.durationTimer=setInterval((function(){if(t.callStartTime){var e=Math.floor((new Date-t.callStartTime)/1e3),a=Math.floor(e/60).toString().padStart(2,"0"),n=(e%60).toString().padStart(2,"0");t.callDuration="".concat(a,":").concat(n)}}),1e3)},stopCallTimer:function(){this.durationTimer&&(clearInterval(this.durationTimer),this.durationTimer=null),this.callDuration="00:00",this.callStartTime=null},handleSeatBusy:function(){this.$refs.callComponent.afk()},handleSeatReady:function(){this.$refs.callComponent.online()},handleHold:function(){this.$refs.callComponent.hold()},handleResume:function(){this.$refs.callComponent.holdresume()},setPhoneNumber:function(t){this.customerPhone=t},autoCall:function(t){var e=this;this.setPhoneNumber(t),this.$nextTick((function(){e.handleCall()}))}},beforeUnmount:function(){this.stopCallTimer(),this.isSeatLoggedIn&&this.handleSeatLogout().catch(console.error)}},l=c,u=(a("9bd4"),a("1805")),d=Object(u["a"])(l,n,s,!1,null,"f87ca330",null);e["a"]=d.exports},"401b":function(t,e,a){},"40d6":function(t,e,a){"use strict";a.d(e,"dc",(function(){return s})),a.d(e,"ec",(function(){return r})),a.d(e,"i",(function(){return o})),a.d(e,"V",(function(){return i})),a.d(e,"Vb",(function(){return c})),a.d(e,"kc",(function(){return l})),a.d(e,"Nb",(function(){return u})),a.d(e,"Ub",(function(){return d})),a.d(e,"D",(function(){return m})),a.d(e,"gb",(function(){return p})),a.d(e,"oc",(function(){return f})),a.d(e,"fb",(function(){return h})),a.d(e,"E",(function(){return g})),a.d(e,"rb",(function(){return b})),a.d(e,"cc",(function(){return v})),a.d(e,"zc",(function(){return k})),a.d(e,"ic",(function(){return S})),a.d(e,"hb",(function(){return y})),a.d(e,"K",(function(){return C})),a.d(e,"hc",(function(){return w})),a.d(e,"L",(function(){return O})),a.d(e,"u",(function(){return T})),a.d(e,"S",(function(){return _})),a.d(e,"Mb",(function(){return j})),a.d(e,"xb",(function(){return x})),a.d(e,"O",(function(){return D})),a.d(e,"G",(function(){return L})),a.d(e,"gc",(function(){return $})),a.d(e,"Eb",(function(){return I})),a.d(e,"q",(function(){return M})),a.d(e,"lb",(function(){return P})),a.d(e,"N",(function(){return R})),a.d(e,"wb",(function(){return W})),a.d(e,"o",(function(){return E})),a.d(e,"U",(function(){return N})),a.d(e,"Ib",(function(){return A})),a.d(e,"Rb",(function(){return B})),a.d(e,"X",(function(){return V})),a.d(e,"Qb",(function(){return q})),a.d(e,"v",(function(){return F})),a.d(e,"nb",(function(){return H})),a.d(e,"w",(function(){return X})),a.d(e,"W",(function(){return U})),a.d(e,"Pb",(function(){return z})),a.d(e,"Sb",(function(){return J})),a.d(e,"Y",(function(){return Z})),a.d(e,"x",(function(){return Y})),a.d(e,"ob",(function(){return Q})),a.d(e,"Zb",(function(){return G})),a.d(e,"db",(function(){return K})),a.d(e,"Yb",(function(){return tt})),a.d(e,"J",(function(){return et})),a.d(e,"A",(function(){return at})),a.d(e,"y",(function(){return nt})),a.d(e,"pb",(function(){return st})),a.d(e,"Z",(function(){return rt})),a.d(e,"Tb",(function(){return ot})),a.d(e,"Bb",(function(){return it})),a.d(e,"wc",(function(){return ct})),a.d(e,"Ab",(function(){return lt})),a.d(e,"Q",(function(){return ut})),a.d(e,"H",(function(){return dt})),a.d(e,"s",(function(){return mt})),a.d(e,"mb",(function(){return pt})),a.d(e,"P",(function(){return ft})),a.d(e,"zb",(function(){return ht})),a.d(e,"j",(function(){return gt})),a.d(e,"l",(function(){return bt})),a.d(e,"T",(function(){return vt})),a.d(e,"Gb",(function(){return kt})),a.d(e,"ib",(function(){return St})),a.d(e,"kb",(function(){return yt})),a.d(e,"tc",(function(){return Ct})),a.d(e,"jb",(function(){return wt})),a.d(e,"sc",(function(){return Ot})),a.d(e,"vc",(function(){return Tt})),a.d(e,"yc",(function(){return _t})),a.d(e,"uc",(function(){return jt})),a.d(e,"xc",(function(){return xt})),a.d(e,"rc",(function(){return Dt})),a.d(e,"qc",(function(){return Lt})),a.d(e,"Xb",(function(){return $t})),a.d(e,"cb",(function(){return It})),a.d(e,"I",(function(){return Mt})),a.d(e,"z",(function(){return Pt})),a.d(e,"qb",(function(){return Rt})),a.d(e,"bb",(function(){return Wt})),a.d(e,"Wb",(function(){return Et})),a.d(e,"mc",(function(){return Nt})),a.d(e,"ab",(function(){return At})),a.d(e,"Jb",(function(){return Bt})),a.d(e,"Kb",(function(){return Vt})),a.d(e,"d",(function(){return qt})),a.d(e,"e",(function(){return Ft})),a.d(e,"R",(function(){return Ht})),a.d(e,"Hb",(function(){return Xt})),a.d(e,"Fb",(function(){return Ut})),a.d(e,"Lb",(function(){return zt})),a.d(e,"jc",(function(){return Jt})),a.d(e,"F",(function(){return Zt})),a.d(e,"n",(function(){return Yt})),a.d(e,"m",(function(){return Qt})),a.d(e,"vb",(function(){return Gt})),a.d(e,"fc",(function(){return Kt})),a.d(e,"a",(function(){return te})),a.d(e,"sb",(function(){return ee})),a.d(e,"k",(function(){return ae})),a.d(e,"bc",(function(){return ne})),a.d(e,"yb",(function(){return se})),a.d(e,"r",(function(){return re})),a.d(e,"C",(function(){return oe})),a.d(e,"t",(function(){return ie})),a.d(e,"M",(function(){return ce})),a.d(e,"g",(function(){return le})),a.d(e,"f",(function(){return ue})),a.d(e,"h",(function(){return de})),a.d(e,"ub",(function(){return me})),a.d(e,"Ob",(function(){return pe})),a.d(e,"Db",(function(){return fe})),a.d(e,"tb",(function(){return he})),a.d(e,"ac",(function(){return ge})),a.d(e,"pc",(function(){return be})),a.d(e,"lc",(function(){return ve})),a.d(e,"B",(function(){return ke})),a.d(e,"Ac",(function(){return Se})),a.d(e,"eb",(function(){return ye})),a.d(e,"Cb",(function(){return Ce})),a.d(e,"nc",(function(){return we})),a.d(e,"p",(function(){return Oe})),a.d(e,"b",(function(){return Te})),a.d(e,"c",(function(){return _e}));var n=a("b775");function s(t){return Object(n["a"])({url:"/smartor/target/targetInfo",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/smartor/target/saveOrupdateIvrLibaTarget",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/smartor/serviceSubtaskDetail/countPatByTarget/"+t,method:"get"})}function i(t){return Object(n["a"])({url:"/smartor/target/remove/"+t,method:"get"})}function c(t){return Object(n["a"])({url:"/smartor/icd10/list",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/smartor/icd10/getInfo/"+t,method:"get"})}function u(t){return Object(n["a"])({url:"/smartor/baseopera/list",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/smartor/outicd10/list",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/smartor/outicd10/add",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/smartor/outicd10/remove/"+t,method:"get"})}function f(t){return Object(n["a"])({url:"/smartor/assort/selectIvrLibaTargetAssortList",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/smartor/assort/remove/"+t,method:"get"})}function g(t){return Object(n["a"])({url:"/smartor/assort/addtree",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/smartor/assort/edit",method:"post",data:t})}function v(t){return Object(n["a"])({url:"/smartor/target/list",method:"post",data:t})}function k(t){return Object(n["a"])({url:"/smartor/target/targetQuesMate",method:"post",data:t})}function S(t){return Object(n["a"])({url:"/smartor/script/list",method:"post",data:t})}function y(t){return Object(n["a"])({url:"/smartor/script/remove/"+t,method:"get"})}function C(t){return Object(n["a"])({url:"/smartor/script/saveOrUpdateScript",method:"post",data:t})}function w(t){return Object(n["a"])({url:"/smartor/script/selectInfoByCondition",method:"post",data:t})}function O(t){return Object(n["a"])({url:"/smartor/scriptassort/edit",method:"post",data:t})}function T(t){return Object(n["a"])({url:"/smartor/scriptassort/addtree",method:"post",data:t})}function _(t){return Object(n["a"])({url:"/smartor/scriptassort/remove/"+t,method:"get"})}function j(t){return Object(n["a"])({url:"/smartor/scriptassort/selectIvrLibaScriptAssortList",method:"post",data:t})}function x(t){return Object(n["a"])({url:"/smartor/template/list",method:"post",data:t})}function D(t){return Object(n["a"])({url:"/smartor/template/remove/"+t,method:"get"})}function L(t){return Object(n["a"])({url:"/smartor/template/saveOrUpdateScript",method:"post",data:t})}function $(t){return Object(n["a"])({url:"/smartor/template/selectInfoByCondition",method:"post",data:t})}function I(t){return Object(n["a"])({url:"/smartor/ivrTaskTemplate/getTemplateInfoByID/"+t,method:"get"})}function M(t){return Object(n["a"])({url:"/smartor/templateassort/addtree",method:"post",data:t})}function P(t){return Object(n["a"])({url:"/smartor/templateassort/edit",method:"post",data:t})}function R(t){return Object(n["a"])({url:"/smartor/templateassort/remove/"+t,method:"get"})}function W(t){return Object(n["a"])({url:"/smartor/templateassort/selectIvrLibaTemplateAssortList",method:"post",data:t})}function E(t){return Object(n["a"])({url:"/smartor/ivrTaskTemplate/saveOrUpdateTempScript",method:"post",data:t})}function N(t){return Object(n["a"])({url:"/smartor/ivrTaskTemplate/remove/"+t,method:"get"})}function A(t){return Object(n["a"])({url:"/smartor/ivrTaskTemplate/getInfo/"+t,method:"get"})}function B(t){return Object(n["a"])({url:"/smartor/extemplate/list",method:"post",data:t})}function V(t){return Object(n["a"])({url:"/smartor/extemplate/remove/"+t,method:"get"})}function q(t){return Object(n["a"])({url:"/smartor/extemplate/"+t,method:"get"})}function F(t){return Object(n["a"])({url:"/smartor/extemplate/add",method:"post",data:t})}function H(t){return Object(n["a"])({url:"/smartor/extemplate/edit",method:"post",data:t})}function X(t){return Object(n["a"])({url:"/smartor/category/add",method:"post",data:t})}function U(t){return Object(n["a"])({url:"/smartor/category/remove/"+t,method:"get"})}function z(t){return Object(n["a"])({url:"/smartor/category/list",method:"post",data:t})}function J(t){return Object(n["a"])({url:"/smartor/extemplatescript/list",method:"post",data:t})}function Z(t){return Object(n["a"])({url:"/smartor/extemplatescript/remove/"+t,method:"get"})}function Y(t){return Object(n["a"])({url:"/smartor/extemplatescript/add",method:"post",data:t})}function Q(t){return Object(n["a"])({url:"/smartor/extemplatescript/edit",method:"post",data:t})}function G(t){return Object(n["a"])({url:"/smartor/library/list",method:"post",data:t})}function K(t){return Object(n["a"])({url:"/smartor/library/remove/"+t,method:"get"})}function tt(t){return Object(n["a"])({url:"/smartor/library/selectInfoByCondition",method:"post",data:t})}function et(t){return Object(n["a"])({url:"/smartor/library/saveOrUpdateHeLibrary",method:"post",data:t})}function at(t){return Object(n["a"])({url:"/common/htmlContent",method:"post",data:t})}function nt(t){return Object(n["a"])({url:"/smartor/heLibraryAssort/addtree",method:"post",data:t})}function st(t){return Object(n["a"])({url:"/smartor/heLibraryAssort/edit",method:"post",data:t})}function rt(t){return Object(n["a"])({url:"/smartor/heLibraryAssort/remove/"+t,method:"get"})}function ot(t){return Object(n["a"])({url:"/smartor/heLibraryAssort/selectHeLibraryAssortList",method:"post",data:t})}a("b8cc");function it(t){return Object(n["a"])({url:"/smartor/svyLibTemplate/selectSvyLibTemplatelist",method:"post",data:t})}function ct(t){return Object(n["a"])({url:"smartor/svytemplateTask/selectInfoByCondition",method:"post",data:t})}function lt(t){return Object(n["a"])({url:"/smartor/svyLibTemplate/list",method:"get",params:t})}function ut(t){return Object(n["a"])({url:"/smartor/svyLibTemplate/remove/"+t,method:"get"})}function dt(t){return Object(n["a"])({url:"/smartor/svyLibTemplate/saveOrUpdateTemplate",method:"post",data:t})}function mt(t){return Object(n["a"])({url:"/smartor/svyLibTemplateCategory/addtree",method:"post",data:t})}function pt(t){return Object(n["a"])({url:"/smartor/svyLibTemplateCategory/edit",method:"post",data:t})}function ft(t){return Object(n["a"])({url:"/smartor/svyLibTemplateCategory/remove/"+t,method:"get"})}function ht(t){return Object(n["a"])({url:"/smartor/svyLibTemplateCategory/list",method:"post",data:t})}function gt(t){return Object(n["a"])({url:"/smartor/serviceSubtask/queryTaskByCondition",method:"post",data:t})}function bt(t){return Object(n["a"])({url:"/smartor/svytemplateTask/saveOrUpdateTaskTemp",method:"post",data:t})}function vt(t){return Object(n["a"])({url:"/smartor/svytemplateTask/remove/"+t,method:"get"})}function kt(t){return Object(n["a"])({url:"/smartor/svytemplateTask/"+t,method:"get"})}function St(t){return Object(n["a"])({url:"/smartor/td/add",method:"post",data:t})}function yt(t){return Object(n["a"])({url:"/smartor/td/list",method:"get",params:t})}function Ct(t){return Object(n["a"])({url:"/smartor/taskdept/list",method:"post",data:t})}function wt(t){return Object(n["a"])({url:"/smartor/td/remove/"+t,method:"get"})}function Ot(t){return Object(n["a"])({url:"/smartor/taskdept/remove/"+t,method:"get"})}function Tt(t){return Object(n["a"])({url:"/smartor/taskdiag/remove/".concat(t),method:"get"})}function _t(t){return Object(n["a"])({url:"/smartor/taskoper/remove/".concat(t),method:"get"})}function jt(t){return Object(n["a"])({url:"/smartor/taskdiag/list",method:"post",data:t})}function xt(t){return Object(n["a"])({url:"/smartor/taskoper/list",method:"post",data:t})}function Dt(t){return Object(n["a"])({url:"/smartor/serviceSubtaskDetail/editByCondition",method:"post",data:t})}function Lt(t){return Object(n["a"])({url:"/smartor/serviceSubtaskDetail/add",method:"post",data:t})}function $t(t){return Object(n["a"])({url:"/smartor/svyscript/list",method:"post",data:t})}function It(t){return Object(n["a"])({url:"/smartor/svyscript/remove/"+t,method:"get"})}function Mt(t){return Object(n["a"])({url:"/smartor/svyscript/saveOrUpdateScript",method:"post",data:t})}function Pt(t){return Object(n["a"])({url:"/smartor/svyLibScriptCategory/addtree",method:"post",data:t})}function Rt(t){return Object(n["a"])({url:"/smartor/svyLibScriptCategory/edit",method:"post",data:t})}function Wt(t){return Object(n["a"])({url:"/smartor/svyLibScriptCategory/remove/"+t,method:"get"})}function Et(t){return Object(n["a"])({url:"/smartor/svyLibScriptCategory/list",method:"post",data:t})}function Nt(t){return Object(n["a"])({url:"/smartor/serviceExternal/query360PatInfo",method:"post",data:t})}function At(t){return Object(n["a"])({url:"/smartor/serviceSubtask/remove/"+t,method:"get"})}function Bt(t){return Object(n["a"])({url:"/smartor/patarchive/getPatientInfo",method:"post",data:t})}function Vt(t){return Object(n["a"])({url:"/smartor/patarchive/getPatientInfoQC",method:"post",data:t})}function qt(t){return Object(n["a"])({url:"/smartor/serviceSubtask/insertOrUpdateTask",method:"post",data:t})}function Ft(t){return Object(n["a"])({url:"/smartor/serviceSubtask/update",method:"post",data:t})}function Ht(t){return Object(n["a"])({url:"/smartor/servicetask/remove/"+t,method:"get"})}function Xt(t){return Object(n["a"])({url:"/smartor/servicetask/list",method:"post",data:t})}function Ut(t){return Object(n["a"])({url:"/smartor/serviceSubtask/queryTaskByCondition",method:"post",data:t})}function zt(t){return Object(n["a"])({url:"/smartor/serviceSubtask/patItem",method:"post",data:t})}function Jt(t){return Object(n["a"])({url:"/smartor/serviceSubtask/getSubtaskByDiagname",method:"post",data:t})}function Zt(t){return Object(n["a"])({url:"/smartor/serviceSubtask/patItemByCondition",method:"post",data:t})}function Yt(t){return Object(n["a"])({url:"/smartor/ivrTaskTemplate/saveOrUpdateTempScript",method:"post",data:t})}function Qt(t){return Object(n["a"])({url:"/smartor/commonTask/taskSend",method:"post",data:t})}function Gt(t){return Object(n["a"])({url:"/smartor/servicetask/getScriptInfoByCondition",method:"post",data:t})}function Kt(t){return Object(n["a"])({url:"/smartor/outPath/getInfoByParam",method:"post",params:{param:t}})}function te(t){return Object(n["a"])({url:"/smartor/subtaskAnswer/saveQuestionCache",method:"post",data:t})}function ee(t){return Object(n["a"])({url:"/smartor/subtaskAnswer/getQuestionCache",method:"post",data:t})}function ae(t){return Object(n["a"])({url:"/smartor/subtaskAnswer/saveQuestionAnswer",method:"post",data:t})}function ne(t){return Object(n["a"])({url:"/smartor/subtaskAnswer/selectPatQuestionResult",method:"post",data:t})}function se(t){return Object(n["a"])({url:"/smartor/serviceSubtaskDetail/getPersonVoice",method:"post",data:t})}function re(t){return Object(n["a"])({url:"/smartor/serviceSubtaskDetail/batchAdd",method:"post",data:t})}function oe(t){return Object(n["a"])({url:"/smartor/serviceSubtask/addSubTaskAgain",method:"post",data:t})}function ie(t){return Object(n["a"])({url:"/smartor/serviceSubtask/addSubTask",method:"post",data:t})}function ce(t){return Object(n["a"])({url:"/smartor/import/remove/"+t,method:"get"})}function le(t){return Object(n["a"])({url:"/smartor/import/list",method:"post",data:t})}function ue(t){return Object(n["a"])({url:"/smartor/import/edit",method:"post",data:t})}function de(t){return Object(n["a"])({url:"/smartor/import/getInfo/"+t,method:"get"})}function me(t){return Object(n["a"])({url:"/smartor/patouthosp/selectPatMedOuthospCount",method:"post",data:t})}function pe(t){return Object(n["a"])({url:"/smartor/patinhosp/selectPatMedInhospListCount",method:"post",data:t})}function fe(t){return Object(n["a"])({url:"/smartor/serviceSubtask/getServiceStatistics",method:"post",data:t})}function he(t){return Object(n["a"])({url:"/smartor/patinhosp/getDeptRanking",method:"post",data:t})}function ge(t){return Object(n["a"])({url:"/smartor/organization/list",method:"get"})}function be(t){return Object(n["a"])({url:"/sms/send",method:"post",data:t})}a("c38a");function ve(t){return Object(n["a"])({url:"/smartor/satisfaction/list",method:"post",data:t})}function ke(t){return Object(n["a"])({url:"/smartor/satisfaction/batchinsert",method:"post",data:t})}function Se(t){return Object(n["a"])({url:"/smartor/satisfaction/edit",method:"post",data:t})}function ye(t){return Object(n["a"])({url:"/smartor/satisfaction/remove/"+t,method:"get"})}function Ce(t){return Object(n["a"])({url:"/smartor/servicetask/getScriptByCondition",method:"post",data:t})}function we(t){return Object(n["a"])({url:"/smartor/subtaskAnswer/saveMYDQuestionAnswer",method:"post",data:t})}function Oe(t){return Object(n["a"])({url:"/getDept/"+t,method:"get"})}function Te(){return Object(n["a"])({url:"/smartor/ServiceTelInfo/getList",method:"get",params:{orgid:localStorage.getItem("orgid")}})}function _e(t){return Object(n["a"])({url:"/smartor/ServiceTelInfo/setState",method:"get",params:t})}},"4ed2":function(t,e,a){"use strict";var n=a("6ec7"),s=a("6932"),r=a("fe77"),o=a("9222"),i=(a("8d03"),a("618d"),a("7103"),a("cfee"),a("8adb"),a("35f6"),a("46e6"),a("e8a6"),a("9519")),c=a.n(i),l=a("2e36"),u=function(){function t(){Object(r["a"])(this,t),this.ua=null,this.currentSession=null,this.onStatusChange=null,this.onCallStatusChange=null,this.onIncomingCall=null,this.isRegistered=!1,this.registrationTime=null}return Object(o["a"])(t,[{key:"init",value:function(t){var e=this;try{this.updateStatus("connecting","连接中;..."),this.ua=new c.a.UA({sockets:[new c.a.WebSocketInterface(t.wsUrl)],uri:t.sipUri,password:t.password,display_name:t.displayName,iceServers:[],register:!0,sessionExpires:1800,minSessionExpires:90,register_expires:300}),this.ua.start(),this.ua.on("registered",(function(){e.isRegistered=!0,e.registrationTime=Date.now(),console.log(e.registrationTime,"注册时间"),e.updateStatus("registered","已注册")})),this.ua.on("registrationFailed",(function(t){e.isRegistered=!1,e.updateStatus("failed","注册失败: ".concat(t.cause))})),this.ua.on("unregistered",(function(){e.isRegistered=!1;var t=Date.now();console.log(t,"注销时间"),e.updateStatus("disconnected","已注销")})),this.ua.on("disconnected",(function(){return e.updateStatus("disconnected","连接断开")})),this.ua.on("connected",(function(){return e.updateStatus("connecting","重新连接中...")})),this.ua.on("newRTCSession",(function(t){return e.handleIncomingCall(t.session)}))}catch(a){throw this.updateStatus("failed","初始化失败: ".concat(a.message)),console.error("SIP初始化失败:",a),a}}},{key:"canMakeCall",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;if(!this.isRegistered)return{canCall:!1,reason:"SIP未注册,无法呼叫"};var e=Date.now(),a=e-this.registrationTime;if(a<t){var n=t-a;return{canCall:!1,reason:"注册成功,资源加载中请等待 ".concat(Math.ceil(n/1e3)," 秒后再呼叫")}}return{canCall:!0,reason:""}}},{key:"makeCall",value:function(t){var e=this,a=this.canMakeCall(),n=a.canCall,s=a.reason;return n?new Promise((function(a,n){try{if(!e.ua)throw new Error("SIP客户端未初始化");if(!e.ua.isRegistered())throw new Error("SIP未注册,无法呼叫");var s={sessionTimers:!0,sessionTimersExpires:150,extraHeaders:["Accept: application/sdp"],mediaConstraints:{audio:!0,video:!1},rtcOfferConstraints:{offerToReceiveAudio:!0,offerToReceiveVideo:!1},eventHandlers:{progress:function(){return e.updateCallStatus("calling","呼叫中...")},failed:function(t){e.handleCallFailure(t,n)},ended:function(){return e.updateCallStatus("ended","通话结束")},confirmed:function(){e.updateCallStatus("connected","通话已接通"),a()}}};e.currentSession=e.ua.call("sip:".concat(t,"@192.168.10.124"),s),e.setupPeerConnection(e.currentSession),e.setupAudio(e.currentSession)}catch(r){e.updateCallStatus("failed","呼叫失败22: ".concat(r.message)),n(r)}})):(l["Message"].error(s),Promise.reject(new Error(s)))}},{key:"setupPeerConnection",value:function(t){var e=this;t.on("peerconnection",(function(t){var a=t.createOffer.bind(t);t.createOffer=function(){var t=Object(s["a"])(Object(n["a"])().m((function t(s){var r,o;return Object(n["a"])().w((function(t){while(1)switch(t.p=t.n){case 0:return t.p=0,t.n=1,a(s);case 1:return r=t.v,t.a(2,e.normalizeSDP(r));case 2:throw t.p=2,o=t.v,console.error("创建Offer失败:",o),o;case 3:return t.a(2)}}),t,null,[[0,2]])})));return function(e){return t.apply(this,arguments)}}()}))}},{key:"normalizeSDP",value:function(t){var e=t.sdp;return e=e.replace(/c=IN IP4.*\r\n/,"c=IN IP4 0.0.0.0\r\n"),e=e.replace(/m=audio \d+.*\r\n/,"m=audio 9 UDP/TLS/RTP/SAVPF 0 8\r\n"),e.includes("PCMU/8000")||(e+="a=rtpmap:0 PCMU/8000\r\n"),e.includes("PCMA/8000")||(e+="a=rtpmap:8 PCMA/8000\r\n"),e+="a=rtcp-mux\r\n",e+="a=sendrecv\r\n",console.log("标准化后的SDP:",e),new RTCSessionDescription({type:t.type,sdp:e})}},{key:"handleCallFailure",value:function(t,e){var a;if(422===(null===(a=t.response)||void 0===a?void 0:a.status_code)){var n,s=(null===(n=t.response.headers["Min-SE"])||void 0===n||null===(n=n[0])||void 0===n?void 0:n.raw)||"未知";console.error("服务器要求 Min-SE ≤ ".concat(s,",当前设置: 120"))}console.error("呼叫失败详情:",{cause:t.cause,message:t.message,response:t.response&&{status:t.response.status_code,reason:t.response.reason_phrase}});var r="呼叫失败";switch(t.cause){case"Incompatible SDP":r="媒体协商失败,请检查编解码器配置";break;case"488":case"606":r="对方设备不支持当前媒体配置";break;case"422":r="会话参数不满足服务器要求";break;default:r="呼叫失败3: ".concat(t.cause||t.message)}this.updateCallStatus("failed55",r),e(new Error(r))}},{key:"setupAudio",value:function(t){t.connection.addEventListener("addstream",(function(t){var e=document.getElementById("remoteAudio");e&&(e.srcObject=t.stream)}))}},{key:"endCall",value:function(){this.currentSession&&(this.currentSession.terminate(),this.updateCallStatus("ended","通话已结束"),this.currentSession=null)}},{key:"updateStatus",value:function(t,e){console.log("SIP状态更新: ".concat(t," - ").concat(e)),this.onStatusChange&&this.onStatusChange({type:t,text:e})}},{key:"updateCallStatus",value:function(t,e){console.log("通话状态更新: ".concat(t," - ").concat(e)),this.onCallStatusChange&&this.onCallStatusChange({type:t,text:e})}},{key:"handleIncomingCall",value:function(t){"incoming"===t.direction&&(console.log("来电:",t.remote_identity.uri.toString()),this.onIncomingCall&&this.onIncomingCall(t))}}])}();e["a"]=new u},"5e35":function(t,e,a){},"72c7":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"websocket-demo"},[a("div",[a("h3",[t._v("Websocket呼叫中心接口")]),a("div",{staticClass:"config-area"},[a("div",{staticClass:"status-indicator"},[a("span",{class:["status-dot",t.connectionStatus]}),t._v(" 连接状态: "+t._s(t.connectionText)+" "),a("span",{class:["status-dot",t.seatStatus]}),t._v(" 座席状态: "+t._s(t.seatStatusText)+" ")]),a("div",{staticClass:"input-group"},[a("label",[t._v("CTI_WS_URL")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.config.cti_ws_url,expression:"config.cti_ws_url"}],attrs:{type:"text",placeholder:"wss://your-server.com"},domProps:{value:t.config.cti_ws_url},on:{input:function(e){e.target.composing||t.$set(t.config,"cti_ws_url",e.target.value)}}}),a("label",[t._v("坐席工号")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.config.seatname,expression:"config.seatname"}],attrs:{type:"text",placeholder:t.randomNum},domProps:{value:t.config.seatname},on:{input:function(e){e.target.composing||t.$set(t.config,"seatname",e.target.value)}}}),a("label",[t._v("坐席分机")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.config.seatnum,expression:"config.seatnum"}],attrs:{type:"text",placeholder:t.randomNum},domProps:{value:t.config.seatnum},on:{input:function(e){e.target.composing||t.$set(t.config,"seatnum",e.target.value)}}}),a("label",[t._v("密码")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.config.password,expression:"config.password"}],attrs:{type:"text",placeholder:"123456"},domProps:{value:t.config.password},on:{input:function(e){e.target.composing||t.$set(t.config,"password",e.target.value)}}})]),a("div",{staticClass:"input-group"},[a("label",[t._v("外线号码")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.customerPhone,expression:"customerPhone"}],attrs:{type:"text",placeholder:"请输入电话号码"},domProps:{value:t.customerPhone},on:{input:function(e){e.target.composing||(t.customerPhone=e.target.value)}}}),a("label",[t._v("技能组")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.config.group,expression:"config.group"}],attrs:{type:"text",placeholder:"a3"},domProps:{value:t.config.group},on:{input:function(e){e.target.composing||t.$set(t.config,"group",e.target.value)}}})])]),a("div",{staticClass:"button-area"},[a("div",{staticClass:"button-row"},[a("button",{attrs:{disabled:!t.isConnected||t.isSeatLoggedIn},on:{click:t.handleSeatLogin}},[t._v(" 签入 ")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.handleSeatLogout}},[t._v(" 签出 ")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.callout}},[t._v("外呼")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.hangup}},[t._v("挂机")])]),a("div",{staticClass:"button-row"},[a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.afk}},[t._v("示忙")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.online}},[t._v("示闲")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.hold}},[t._v("保持")]),a("button",{attrs:{disabled:!t.isSeatLoggedIn},on:{click:t.holdresume}},[t._v(" 取消保持 ")])])]),a("h3",[t._v("协议日志区 "),a("button",{on:{click:t.testclear}},[t._v("清除")])]),a("div",{staticClass:"log-area"},[t._v(t._s(t.logs))])])])},s=[],r=a("f458"),o=a("5173"),i=a("6ec7"),c=a("6932"),l=(a("618d"),a("fb51"),a("7a82"),a("8ada"),a("e795"),a("cfee"),a("8adb"),a("35f6"),a("e8a6"),a("7184"),a("65bf"),a("40d6")),u={name:"WebsocketDemo",emits:["status-change","call-status","error"],props:{customerPhone:{type:String,default:""},autoLogin:{type:Boolean,default:!0}},data:function(){return{config:{cti_ws_url:"",seatname:"",seatnum:"",password:"123456",phone:"",uuid:"",other:"8001",group:"a3",paramid:"3"},randomNum:"",randomID:"",logs:"",ws:null,isConnected:!1,isSeatLoggedIn:!1,currentCallStatus:"idle",seatResourceAcquired:!1,reconnectAttempts:0,maxReconnectAttempts:5,heartbeatTimer:null}},computed:{connectionStatus:function(){return this.isConnected?"connected":"disconnected"},connectionText:function(){return this.isConnected?"已连接":"未连接"},seatStatus:function(){return this.isSeatLoggedIn?"logged-in":"logged-out"},seatStatusText:function(){return this.isSeatLoggedIn?"已签入":"未签入"}},watch:{customerPhone:function(t){this.config.phone=t},isSeatLoggedIn:function(t){this.$emit("status-change",{isLoggedIn:t,seatNumber:this.config.seatnum,status:t?"ready":"offline"})}},mounted:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){return Object(i["a"])().w((function(e){while(1)switch(e.n){case 0:return e.n=1,t.initializeSeatResource();case 1:t.initializeWebSocket();case 2:return e.a(2)}}),e)})))()},beforeUnmount:function(){this.cleanup()},methods:{initializeWebSocket:function(){var t=this;try{var e="https:"===window.location.protocol;if(this.config.cti_ws_url=e?"wss://9.208.2.190:8092/cal-api/":"ws://40.78.0.169:6688","undefined"===typeof window.WebSocket)return void this.addLog("错误: 浏览器不支持WebSocket");this.connectWebSocket()}catch(a){this.addLog("初始化WebSocket错误: ".concat(a.message)),setTimeout((function(){return t.connectWebSocket()}),2e3)}},initializeSeatResource:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){var a,n;return Object(i["a"])().w((function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Object(l["b"])();case 1:if(a=e.v,!(a.data&&a.data.length>0)){e.n=3;break}return t.randomNum=8e3,t.randomID=8e3,t.config.seatname=t.randomNum,t.config.seatnum=t.randomNum,e.n=2,t.startCallsetState();case 2:t.seatResourceAcquired=!0,t.addLog("座席号资源获取成功: ".concat(t.randomNum));case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.error("获取座席号失败:",n),t.addLog("错误: 获取座席号资源失败"),t.$emit("error",{type:"seat_acquisition_failed",error:n});case 5:return e.a(2)}}),e,null,[[0,4]])})))()},startCallsetState:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){var a;return Object(i["a"])().w((function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Object(l["c"])({id:t.randomID,state:1});case 1:t.addLog("座席号状态更新为使用中"),e.n=3;break;case 2:throw e.p=2,a=e.v,console.error("更新座席号状态失败:",a),a;case 3:return e.a(2)}}),e,null,[[0,2]])})))()},releaseSeatResource:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){var a;return Object(i["a"])().w((function(e){while(1)switch(e.p=e.n){case 0:if(!t.seatResourceAcquired||!t.randomID){e.n=4;break}return e.p=1,e.n=2,Object(l["c"])({id:t.randomID,state:0});case 2:t.addLog("座席号资源已释放"),t.seatResourceAcquired=!1,e.n=4;break;case 3:e.p=3,a=e.v,console.error("释放座席号失败:",a);case 4:return e.a(2)}}),e,null,[[1,3]])})))()},connectWebSocket:function(){var t=this;if(!this.ws||this.ws.readyState!==WebSocket.OPEN)if(this.reconnectAttempts>=this.maxReconnectAttempts)this.addLog("错误: 达到最大重连次数,停止重连");else try{var e=this.config.cti_ws_url;"https:"===window.location.protocol&&e.startsWith("ws://")&&(e=e.replace("ws://","wss://")),this.ws=new WebSocket(e),this.ws.onopen=function(){t.isConnected=!0,t.reconnectAttempts=0,t.addLog("WebSocket连接成功"),t.startHeartbeat(),t.autoLogin&&t.seatResourceAcquired&&setTimeout((function(){return t.handleSeatLogin()}),500)},this.ws.onmessage=function(e){t.handleWebSocketMessage(e)},this.ws.onclose=function(e){t.isConnected=!1,t.isSeatLoggedIn=!1,t.stopHeartbeat(),t.addLog("WebSocket连接关闭: ".concat(e.code," ").concat(e.reason)),t.reconnectAttempts<t.maxReconnectAttempts&&(t.reconnectAttempts++,setTimeout((function(){return t.connectWebSocket()}),3e3))},this.ws.onerror=function(e){t.addLog("WebSocket错误: ".concat(e.message))}}catch(a){this.addLog("连接WebSocket失败: ".concat(a.message)),setTimeout((function(){return t.connectWebSocket()}),3e3)}},handleWebSocketMessage:function(t){var e=this;try{if(t.data instanceof Blob){var a=new FileReader;a.onload=function(){try{var t=a.result;e.addLog("收到Blob消息: ".concat(t)),e.processWebSocketData(t)}catch(n){e.addLog("Blob数据处理错误: ".concat(n.message))}},a.readAsText(t.data)}else"string"===typeof t.data?(this.addLog("收到文本消息: ".concat(t.data)),this.processWebSocketData(t.data)):this.addLog("未知数据类型: ".concat(Object(o["a"])(t.data)))}catch(n){this.addLog("消息处理错误: ".concat(n.message))}},processWebSocketData:function(t){console.log(t,"消息1");try{var e=JSON.parse(t);console.log(e,"消息2"),"system"===e.cmd&&"keepalive"===e.action&&this.keepalive(e.seatname,e.seatnum),"calloutend"===e.action&&this.hangup(),"system"===e.cmd&&"seatlogin"===e.action&&(this.isSeatLoggedIn=!0,this.addLog("座席签入成功"),this.$emit("status-change",{isLoggedIn:!0,seatNumber:this.config.seatnum,status:"ready"})),"system"===e.cmd&&"seatlogout"===e.action&&(this.isSeatLoggedIn=!1,this.addLog("座席签出成功"),this.$emit("status-change",{isLoggedIn:!1,status:"offline"})),"control"===e.cmd&&"tp_callin"===e.action&&(this.config.uuid=e.uuid,this.addLog("自动设置UUID: ".concat(e.uuid)),this.$emit("call-status",{status:"incoming",uuid:e.uuid,phone:e.phone||"未知号码"})),"control"===e.cmd&&"callout"===e.action&&this.$emit("call-status",{status:e.status||"calling",uuid:e.uuid,phone:this.config.phone}),"control"===e.cmd&&"hangup"===e.action&&this.$emit("call-status",{status:"idle",uuid:e.uuid}),"control"===e.cmd&&e.status&&this.handleCallStatusChange(e)}catch(a){this.addLog("JSON解析错误: ".concat(a.message,", 原始数据: ").concat(t))}},handleCallStatusChange:function(t){var e={ringing:"振铃中",connected:"通话中",held:"已保持",ended:"通话结束"};this.addLog("通话状态: ".concat(e[t.status]||t.status)),this.$emit("call-status",{status:t.status,uuid:t.uuid,phone:t.phone||this.config.phone})},startHeartbeat:function(){var t=this;this.heartbeatTimer=setInterval((function(){t.isConnected&&t.isSeatLoggedIn&&t.keepalive(t.config.seatname,t.config.seatnum)}),3e4)},stopHeartbeat:function(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)},handleSeatLogin:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){var a,n,s,r,o;return Object(i["a"])().w((function(e){while(1)switch(e.n){case 0:if(t.seatResourceAcquired){e.n=1;break}return t.addLog("错误: 未获取座席号资源,无法签入"),e.a(2);case 1:if(a=t.config,n=a.seatname,s=a.seatnum,r=a.password,n&&s){e.n=2;break}return t.addLog("错误: 座席工号和分机号不能为空"),e.a(2);case 2:o={cmd:"system",action:"seatlogin",seatname:n,seatnum:s,password:r,timestamp:Date.now()},t.sendWebSocketMessage(o);case 3:return e.a(2)}}),e)})))()},handleSeatLogout:function(){var t=this;return Object(c["a"])(Object(i["a"])().m((function e(){var a,n,s,r;return Object(i["a"])().w((function(e){while(1)switch(e.n){case 0:a=t.config,n=a.seatname,s=a.seatnum,r={cmd:"system",action:"seatlogout",seatname:n,seatnum:s,timestamp:Date.now()},t.sendWebSocketMessage(r)&&(t.isSeatLoggedIn=!1,setTimeout((function(){return t.releaseSeatResource()}),1e3));case 1:return e.a(2)}}),e)})))()},disconnectWebSocket:function(){this.ws&&(this.ws.close(),this.ws=null,this.isConnected=!1,this.addLog("WebSocket已断开"))},sendWebSocketMessage:function(t){if(!this.isConnected||!this.ws)return this.addLog("错误: WebSocket未连接"),!1;try{var e="string"===typeof t?t:JSON.stringify(t);return this.ws.send(e),this.addLog("发送消息: ".concat(e)),!0}catch(a){return this.addLog("发送消息失败: ".concat(a.message)),!1}},validateParams:function(t,e){var a,n=Object(r["a"])(e);try{for(n.s();!(a=n.n()).done;){var s=a.value;if(!t[s]||""===t[s].toString().trim())return this.addLog("错误: ".concat(s," 不能为空")),!1}}catch(o){n.e(o)}finally{n.f()}return!0},seatlogin:function(){var t=this,e=this.config,a=e.seatname,n=e.seatnum,s=e.password;e.cti_ws_url;this.validateParams({seatname:a,seatnum:n},["seatname","seatnum"])&&(this.connectWebSocket(),setTimeout((function(){var e={cmd:"system",action:"seatlogin",seatname:a,seatnum:n,password:s,timestamp:Date.now()};t.sendWebSocketMessage(e)}),1e3))},seatlogout:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatname:e,seatnum:a},["seatname","seatnum"])){var n={cmd:"system",action:"seatlogout",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n),this.ws.close()}},afk:function(){var t={cmd:"system",action:"afk",seatname:this.config.seatname,seatnum:this.config.seatnum,timestamp:Date.now()};this.sendWebSocketMessage(t)},online:function(){var t={cmd:"system",action:"online",seatname:this.config.seatname,seatnum:this.config.seatnum,timestamp:Date.now()};this.sendWebSocketMessage(t)},pickup:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"control",action:"pickup",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},hangup:function(){var t={cmd:"control",action:"hangup",seatname:this.config.seatname,seatnum:this.config.seatnum,timestamp:Date.now()};this.sendWebSocketMessage(t)},callout:function(){var t=arguments,e=this;return Object(c["a"])(Object(i["a"])().m((function a(){var n,s,r;return Object(i["a"])().w((function(a){while(1)switch(a.n){case 0:if(n=t.length>0&&void 0!==t[0]?t[0]:null,s=n||e.customerPhone||e.config.phone,s){a.n=1;break}return e.addLog("错误: 被叫号码不能为空"),e.$emit("error",{type:"phone_number_required"}),a.a(2);case 1:if(e.isSeatLoggedIn){a.n=2;break}return e.addLog("错误: 座席未签入,无法外呼"),a.a(2);case 2:r={cmd:"control",action:"callout",phone:s,seatname:e.config.seatname,seatnum:e.config.seatnum,timestamp:Date.now()},e.sendWebSocketMessage(r),e.$emit("call-status",{status:"calling",phone:s});case 3:return a.a(2)}}),a)})))()},cleanup:function(){this.stopHeartbeat(),this.ws&&(this.ws.close(),this.ws=null),this.releaseSeatResource()},transfer:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone,s=t.uuid;if(this.validateParams({seatnum:a,phone:n,uuid:s},["seatnum","phone","uuid"])){var r={cmd:"control",action:"transfer",uuid:s,phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(r)}},transferresume:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone,s=t.uuid;if(this.validateParams({seatnum:a,phone:n,uuid:s},["seatnum","phone","uuid"])){var r={cmd:"control",action:"transferresume",uuid:s,phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(r)}},hold:function(){var t={cmd:"control",action:"hold",uuid:this.config.uuid,seatname:this.config.seatname,seatnum:this.config.seatnum,timestamp:Date.now()};this.sendWebSocketMessage(t)},holdresume:function(){var t={cmd:"control",action:"holdresume",uuid:this.config.uuid,seatname:this.config.seatname,seatnum:this.config.seatnum,timestamp:Date.now()};this.sendWebSocketMessage(t)},remove:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"remove",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},insert:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"insert",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},monitor:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"monitor",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},monitor_to_talk:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"monitor_to_talk",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},monitor_end:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"monitor_end",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},choosecall:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"choosecall",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},replacecall:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"replacecall",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},three:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.phone;if(this.validateParams({seatnum:a,phone:n},["seatnum","phone"])){var s={cmd:"control",action:"three",phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},handoff_ready:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"handoff_ready",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},handoff_call:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.other,s=t.uuid;if(this.validateParams({seatnum:a,other:n,uuid:s},["seatnum","other","uuid"])){var r={cmd:"control",action:"handoff_call",uuid:s,phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(r)}},handoff_resume:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"handoff_resume",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},handoff_transfer:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.other,s=t.uuid;if(this.validateParams({seatnum:a,other:n,uuid:s},["seatnum","other","uuid"])){var r={cmd:"control",action:"handoff_transfer",uuid:s,phone:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(r)}},handoff_three:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"handoff_three",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},record_start:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"record_start",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},record_stop:function(){var t=this.config,e=t.seatname,a=t.seatnum,n=t.uuid;if(this.validateParams({seatnum:a,uuid:n},["seatnum","uuid"])){var s={cmd:"control",action:"record_stop",uuid:n,seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(s)}},openseatlist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"openseatlist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},closeseatlist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"closeseatlist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},openqueues:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"openqueues",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},closequeues:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"closequeues",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},opencalllist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"opencalllist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},closecalllist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"closecalllist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},openroutelist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"openroutelist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},closeroutelist:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"status",action:"closeroutelist",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},seatlist:function(){var t=this.config.group;if(this.validateParams({group:t},["group"])){var e={cmd:"status",action:"seatlist",group:t,timestamp:Date.now()};this.sendWebSocketMessage(e)}},queues:function(){var t={cmd:"status",action:"queues",timestamp:Date.now()};this.sendWebSocketMessage(t)},calllist:function(){var t={cmd:"status",action:"calllist",timestamp:Date.now()};this.sendWebSocketMessage(t)},routelist:function(){var t={cmd:"status",action:"routelist",timestamp:Date.now()};this.sendWebSocketMessage(t)},batch:function(){var t=this.config.paramid;if(this.validateParams({paramid:t},["paramid"])){var e={cmd:"status",action:"batch",paramid:t,timestamp:Date.now()};this.sendWebSocketMessage(e)}},batch_start:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"system",action:"batch_start",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},batch_stop:function(){var t=this.config,e=t.seatname,a=t.seatnum;if(this.validateParams({seatnum:a},["seatnum"])){var n={cmd:"system",action:"batch_stop",seatname:e,seatnum:a,timestamp:Date.now()};this.sendWebSocketMessage(n)}},keepalive:function(t,e){var a={cmd:"system",action:"keepalive",seatname:t,seatnum:e,timestamp:Date.now()};this.sendWebSocketMessage(a)},testclear:function(){this.logs="",this.addLog("日志已清除")},addLog:function(t){var e=(new Date).toLocaleTimeString();this.logs+="[".concat(e,"] ").concat(t,"\n");var a=this.logs.split("\n");a.length>100&&(this.logs=a.slice(-50).join("\n"))}}},d=u,m=(a("8b3c"),a("1805")),p=Object(m["a"])(d,n,s,!1,null,"91586402",null);e["default"]=p.exports},"8b3c":function(t,e,a){"use strict";a("401b")},"958b":function(t,e,a){"use strict";a.d(e,"l",(function(){return s})),a.d(e,"n",(function(){return r})),a.d(e,"e",(function(){return o})),a.d(e,"d",(function(){return i})),a.d(e,"m",(function(){return c})),a.d(e,"g",(function(){return l})),a.d(e,"c",(function(){return u})),a.d(e,"j",(function(){return d})),a.d(e,"i",(function(){return m})),a.d(e,"a",(function(){return p})),a.d(e,"h",(function(){return f})),a.d(e,"k",(function(){return h})),a.d(e,"f",(function(){return g})),a.d(e,"b",(function(){return b}));var n=a("b775");a("c38a");function s(t){return Object(n["a"])({url:"/smartor/patarchive/patInfoByContion",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/smartor/patarchive/list",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/smartor/patarchive/saveOrUpdatePatInfo",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/smartor/patarchive/add",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/smartor/patarchive/getInfo/"+t,method:"get"})}function l(t){return Object(n["a"])({url:"/smartor/patarchive/remove/"+t,method:"get"})}function u(t){return Object(n["a"])({url:"/medicalhistory/add",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/medicalhistory/selectMedicalHistoryList",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/medicalhistory/edit",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/archivecontact/add",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/archivecontact/edit",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/archivecontact/selectPatArchivecontactList",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/archivecontact/remove/"+t,method:"get"})}function b(t){return Object(n["a"])({url:"/smartor/filterlist/add",method:"post",data:t})}},"9bd4":function(t,e,a){"use strict";a("fdb5")},dc26:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"Followupdetailspage",attrs:{id:"app-container"}},[a("div",{staticClass:"Followuserinfo"},[a("div",[a("div",{staticClass:"userinfo-text"},[a("div",{staticClass:"headline"},[a("div",[t._v("患者服务详情")]),a("div",{staticStyle:{"margin-left":"20px"}},[t.Whetherall?a("el-button",{attrs:{type:"success"},on:{click:function(e){return t.getTaskservelist(t.id)}}},[t._v("只展示本次服务信息")]):a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.getTaskservelist()}}},[t._v("查看患者全部服务")])],1),t.Whetherall?a("div",{staticClass:"merge-controls"},[a("el-button",{attrs:{type:"primary",disabled:t.selectedServices.length<2},on:{click:t.toggleMergeMode}},[t._v(" "+t._s(t.isMergeMode?"取消合并":"合并编辑问卷")+" ")]),t.isMergeMode?a("el-button",{attrs:{type:"success",disabled:t.selectedServices.length<2},on:{click:t.openMergeDialog}},[t._v(" 开始合并 (已选 "+t._s(t.selectedServices.length)+" 个服务) ")]):t._e()],1):t._e()])])]),a("div",[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.logsheetlist,"row-class-name":t.tableRowClassName,"max-height":350},on:{"selection-change":t.handleSelectionChange}},[t.Whetherall?a("el-table-column",{attrs:{type:"selection",width:"55",selectable:t.checkSelectable}}):t._e(),a("el-table-column",{attrs:{prop:"sendname",align:"center",label:"姓名",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"medium",type:"text"},on:{click:function(a){return t.gettoken360(e.row.sfzh,e.row.drcode,e.row.drname)}}},[a("span",{staticClass:"button-textsc"},[t._v(t._s(e.row.sendname))])])]}}])}),a("el-table-column",{attrs:{prop:"taskName",align:"center",width:"200","show-overflow-tooltip":"",label:"任务名称"}}),a("el-table-column",{attrs:{prop:"sendstate",align:"center",width:"200",label:"任务状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"primary","disable-transitions":!1}},[t._v("表单已领取")])],1):t._e(),2==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"primary","disable-transitions":!1}},[t._v("待随访")])],1):t._e(),3==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"success","disable-transitions":!1}},[t._v("表单已发送")])],1):t._e(),4==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"info","disable-transitions":!1}},[t._v("不执行")])],1):t._e(),5==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"danger","disable-transitions":!1}},[t._v("发送失败")])],1):t._e(),6==e.row.sendstate?a("div",[a("el-tag",{attrs:{type:"success","disable-transitions":!1}},[t._v("已完成")])],1):t._e()]}}])}),a("el-table-column",{attrs:{prop:"finishtime",align:"center",label:"随访完成时间",width:"200","show-overflow-tooltip":""}}),a("el-table-column",{key:"endtime",attrs:{label:"出院日期",width:"200",align:"center",prop:"endtime"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.formatTime(e.row.endtime)))])]}}])}),a("el-table-column",{key:"nurseName",attrs:{label:"责任护士",width:"120",align:"center",prop:"nurseName"}}),a("el-table-column",{key:"drname",attrs:{label:"主治医生",width:"120",align:"center",prop:"drname"}}),a("el-table-column",{key:"excep",attrs:{label:"结果状态",align:"center",prop:"excep",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("dict-tag",{attrs:{options:t.dict.type.sys_yujing,value:e.row.excep}})]}}])}),a("el-table-column",{key:"suggest",attrs:{label:"处理意见",align:"center",prop:"suggest",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("dict-tag",{attrs:{options:t.dict.type.sys_suggest,value:e.row.suggest}})]}}])}),a("el-table-column",{attrs:{prop:"templatename",align:"center",label:"服务模板",width:"200","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"remark",align:"center",label:"服务记录",width:"200","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"bankcardno",align:"center",label:"呼叫状态",width:"210"}}),a("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"200","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"medium",type:"text"},on:{click:function(a){return t.Seedetails(e.row)}}},[a("span",{staticClass:"button-zx"},[a("i",{staticClass:"el-icon-s-order"}),t._v("查看")])])]}}])})],1)],1)]),a("div",{staticClass:"action-container"},[a("div",{staticClass:"call-action"},[a("div",{staticClass:"call-container"},[t._m(0),a("div",[a("el-tabs",{attrs:{type:"border-card"},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{name:"wj"}},[a("span",{staticClass:"mulsz",attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-notebook-1"}),t._v(" 问卷随访结果")]),a("div",{staticClass:"CONTENT"},[a("div",{staticClass:"title"},[t._v(t._s(t.taskname?t.taskname:"问卷"))]),t.Voicetype?a("div",{staticClass:"preview-left"},t._l(t.tableDatatop,(function(e,n){return a("div",{key:e.id,staticClass:"topic-dev"},[e.targetvalue?a("div",[a("div",{staticClass:"dev-text"},[t._v(" "+t._s(n+1)+"、[单选]"),a("span",[t._v(t._s(e.questiontext))])]),a("div",{staticClass:"dev-xx"},[a("el-radio-group",{on:{change:function(a){return t.handleOptionChange(a,n,e.ivrTaskScriptTargetoptionList,e)}},model:{value:e.matchedtext,callback:function(a){t.$set(e,"matchedtext",a)},expression:"item.matchedtext"}},t._l(e.scriptResult,(function(e,n){return a("el-radio",{key:n,class:e.isabnormal?"red-star":"",attrs:{label:e}},[t._v(t._s(e))])})),1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.prompt,expression:"item.prompt"}]},[a("el-alert",{attrs:{title:e.prompt,type:"warning"}})],1)]):a("div",{key:n,staticClass:"scriptTopic-dev"},[a("div",{staticClass:"dev-text"},[t._v(" "+t._s(n+1)+"、[问答]"),a("span",[t._v(t._s(e.scriptContent))]),3==e.valueType?a("span",[t._v("(只能输入数字)")]):t._e()]),3==e.valueType?a("div",{staticClass:"dev-xx"},[a("el-input",{directives:[{name:"numeric-only",rawName:"v-numeric-only"}],attrs:{type:"text",placeholder:"请输入答案"},model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}})],1):a("div",{staticClass:"dev-xx"},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入答案",clearable:""},model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}})],1)])])})),0):a("div",{staticClass:"preview-left"},t._l(t.tableDatatop,(function(e,n){return a("div",{key:e.id,staticClass:"topic-dev"},[1!=e.scriptType||e.astrict?t._e():a("div",{key:n,class:t.getTopicClass(e)},[a("div",{staticClass:"dev-text"},[t._v(" "+t._s(n+1)+"、[单选]"),a("span",[t._v(t._s(e.scriptContent))])]),a("div",{staticClass:"dev-xx"},[a("el-radio-group",{model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}},t._l(e.svyTaskTemplateTargetoptions,(function(s,r){return a("el-radio",{key:r,class:t.getOptionClass(s),attrs:{label:s.optioncontent},nativeOn:{click:function(a){return a.preventDefault(),t.handleRadioToggle(e,n,e.svyTaskTemplateTargetoptions,s.optioncontent)}}},[t._v(t._s(s.optioncontent))])})),1)],1),e.showAppendInput||e.answerps?a("div",{staticClass:"append-input-container"},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入具体信息",clearable:""},model:{value:e.answerps,callback:function(a){t.$set(e,"answerps",a)},expression:"item.answerps"}})],1):t._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.prompt,expression:"item.prompt"}]},[a("el-alert",{attrs:{title:e.prompt,type:"warning"}})],1)]),2!=e.scriptType||e.astrict?t._e():a("div",{key:n,class:e.isabnormal?"scriptTopic-isabnormal":"scriptTopic-dev"},[a("div",{staticClass:"dev-text"},[t._v(" "+t._s(n+1)+"、[多选]"),a("span",[t._v(t._s(e.scriptContent))])]),a("div",{staticClass:"dev-xx"},[a("el-checkbox-group",{on:{change:function(a){return t.updateScore(a,n,e)}},model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}},t._l(e.svyTaskTemplateTargetoptions,(function(e,n){return a("el-checkbox",{key:n,class:e.isabnormal?"red-star":"",attrs:{label:e.optioncontent},on:{change:function(e){return t.$forceUpdate()}}},[t._v(" "+t._s(e.optioncontent)+" ")])})),1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.prompt&&e.scriptResult[0],expression:"item.prompt && item.scriptResult[0]"}]},[a("el-alert",{attrs:{title:e.prompt,type:"warning"}})],1)]),4!=e.scriptType||e.astrict?t._e():a("div",{key:n,staticClass:"scriptTopic-dev"},[a("div",{staticClass:"dev-text"},[t._v(" "+t._s(n+1)+"、[问答]"),a("span",[t._v(t._s(e.scriptContent))]),3==e.valueType?a("span",[t._v("(只能输入数字)")]):t._e()]),3==e.valueType?a("div",{staticClass:"dev-xx"},[a("el-input",{directives:[{name:"numeric-only",rawName:"v-numeric-only"}],attrs:{type:"text",placeholder:"请输入答案"},model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}})],1):a("div",{staticClass:"dev-xx"},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入答案",clearable:""},model:{value:e.scriptResult,callback:function(a){t.$set(e,"scriptResult",a)},expression:"item.scriptResult"}})],1)])])})),0),t.Voicetype?a("el-button",{attrs:{type:"primary"},on:{click:t.yuyingetdetail}},[t._v("保存服务详情")]):a("el-button",{attrs:{type:"primary"},on:{click:t.getdetail}},[t._v("保存服务详情")])],1)]),a("el-tab-pane",{attrs:{name:"yy"}},[a("span",{staticClass:"mulsz",attrs:{slot:"label"},slot:"label"},[a("i",{staticClass:"el-icon-headset"}),t._v(" 语音随访详情")]),a("div",{staticClass:"borderdiv"},[a("div",{staticClass:"title"},[t._v(t._s(t.taskname?t.taskname:"问卷"))]),a("div",{staticStyle:{display:"flex","text-align":"center","align-items":"center",color:"#59a0f0"}},[t._v(" 完整语音: "),a("mini-audio",{attrs:{"audio-source":t.voice?t.voice:"@assets/order/example.mp3"}})],1),a("div",{staticClass:"preview-left"},t._l(t.voiceDatatop,(function(e){return a("div",[a("div",{staticClass:"leftside"},[a("i",{staticClass:"el-icon-phone-outline"}),a("span",[t._v(t._s(e.questiontext))])]),a("div",{staticClass:"offside"},[a("i",{staticClass:"el-icon-user"}),a("div",{staticClass:"offside-value"},[a("el-input",{attrs:{type:"textarea",autosize:{minRows:1}},model:{value:e.asrtext,callback:function(a){t.$set(e,"asrtext",a)},expression:"item.asrtext"}}),a("div",[a("mini-audio",{attrs:{"audio-source":e.questionvoice?e.questionvoice:"@assets/order/example.mp3"}})],1)],1)])])})),0),t.Voicetype?a("el-button",{attrs:{type:"primary"},on:{click:t.yuyingetdetail}},[t._v("保存随访详情")]):a("el-button",{attrs:{type:"primary"},on:{click:t.getdetail}},[t._v("保存随访详情")])],1)])],1)],1)])]),a("div",{staticClass:"manual-action"},[a("div",{staticClass:"Followuserinfos"},[a("div",[a("el-form",{ref:"userform",attrs:{model:t.form,rules:t.userrules,"label-width":"120px"}},[a("div",{staticClass:"headline"},[a("div",[t._v("人工处理")]),a("div",{staticStyle:{margin:"0 30px"}},[a("el-button",{attrs:{type:"primary",plain:""},on:{click:function(e){return t.Editsingletasksonyic("")}}},[t._v("保存基础信息")])],1),a("div",[2!=this.form.isVisitAgain?a("el-button",{attrs:{type:"primary",round:""},on:{click:function(e){return t.sendAgain()}}},[t._v("再次随访")]):t._e()],1),a("div",{staticClass:"tag-selector-container"},[a("el-select",{staticStyle:{width:"150px","margin-right":"10px"},attrs:{placeholder:"请选择异常状态",clearable:""},model:{value:t.selectedTag,callback:function(e){t.selectedTag=e},expression:"selectedTag"}},t._l(t.tagOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}},[a("span",{staticStyle:{display:"flex","align-items":"center"}},[a("span",{staticClass:"color-indicator",style:{backgroundColor:e.color}}),a("span",[t._v(t._s(e.label))])])])})),1),t.selectedTag?a("div",{staticClass:"color-indicator selected-indicator",style:{backgroundColor:t.getSelectedTagColor()}}):t._e(),t.selectedTag?a("el-tooltip",{attrs:{effect:"light",content:t.getSelectedDescription(),placement:"top"}},[a("i",{staticClass:"el-icon-info tag-info-icon"})]):t._e()],1)]),a("el-row",[a("el-col",{attrs:{span:14}},[a("el-form-item",{attrs:{label:"联系电话"}},[a("el-input",{attrs:{placeholder:"联系电话缺失"},model:{value:t.userform.telcode,callback:function(e){t.$set(t.userform,"telcode",e)},expression:"userform.telcode"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-phone",disabled:!t.isValidPhone(t.userform.telcode)},on:{click:function(e){return t.handleCall(t.userform.telcode,"tel")}},slot:"append"})],1)],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:14}},[a("el-form-item",{attrs:{label:"联系人电话"}},[a("el-input",{attrs:{placeholder:"联系人电话缺失"},model:{value:t.userform.relativetelcode,callback:function(e){t.$set(t.userform,"relativetelcode",e)},expression:"userform.relativetelcode"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-phone",disabled:!t.isValidPhone(t.userform.relativetelcode)},on:{click:function(e){return t.handleCall(t.userform.relativetelcode,"relative")}},slot:"append"})],1)],1)],1),a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"联系人关系"}},[a("el-input",{attrs:{placeholder:"联系人关系缺失"},model:{value:t.userform.relation,callback:function(e){t.$set(t.userform,"relation",e)},expression:"userform.relation"}})],1)],1)],1),a("div",{staticClass:"call-controls"},[a("CallButton",{ref:"callButton",staticStyle:{display:"none"},attrs:{phoneNumber:t.currentPhoneNumber}}),"connected"===t.callStatus?a("div",{staticClass:"hangup-btn"},[a("el-button",{attrs:{type:"danger",icon:"el-icon-phone",loading:t.isEndingCall},on:{click:t.endCurrentCall}},[t._v(" 挂断电话 ")])],1):t._e(),"idle"!==t.callStatus?a("div",{staticClass:"call-status"},[a("el-alert",{attrs:{title:t.callStatusText,type:t.callStatusType,closable:!1,"show-icon":""}})],1):t._e()],1),"丽水市中医院"==t.orgname?a("el-form-item",{attrs:{label:"随访内容"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1):a("el-form-item",{attrs:{label:"随访记录"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1),"丽水市中医院"==t.orgname?a("el-form-item",{attrs:{label:"随访情况"}},[a("el-radio-group",{model:{value:t.form.taskSituation,callback:function(e){t.$set(t.form,"taskSituation",e)},expression:"form.taskSituation"}},t._l(t.cities,(function(e){return a("el-radio",{key:e.value,attrs:{label:e.value,value:e.value}},[t._v(t._s(e.label))])})),1)],1):t._e(),a("el-form-item",{attrs:{label:"处理意见"}},[a("div",[a("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(e){return t.Editsingletaskson("1")}}},[t._v("暂不处理")]),a("el-button",{attrs:{plain:"",type:"success"},on:{click:function(e){return t.Editsingletaskson("2")}}},[t._v("病情稳定")]),a("el-button",{attrs:{plain:"",type:"primary"},on:{click:function(e){return t.Editsingletaskson("3")}}},[t._v("通知就诊")]),a("el-button",{attrs:{plain:"",type:"info"},on:{click:function(e){return t.Editsingletaskson("5")}}},[t._v("中心随访")]),a("el-button",{attrs:{type:"primary",round:""},on:{click:t.sendAgainmsg}},[t._v("短信发送")])],1)])],1),a("div",{staticClass:"detailed"},[a("h3",[t._v("患者档案信息")]),a("el-form",{ref:"userform",attrs:{model:t.userform,"label-width":"100px"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"患者姓名",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入姓名",maxlength:"30"},model:{value:t.userform.name,callback:function(e){t.$set(t.userform,"name",e)},expression:"userform.name"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"性别",prop:"telcode"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.userform.sex,callback:function(e){t.$set(t.userform,"sex",e)},expression:"userform.sex"}},[a("el-option",{attrs:{label:"男",value:1}}),a("el-option",{attrs:{label:"女",value:2}})],1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"年龄",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入姓名",maxlength:"20"},model:{value:t.userform.age,callback:function(e){t.$set(t.userform,"age",e)},expression:"userform.age"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"联系方式",prop:"telcode"}},[a("el-input",{attrs:{placeholder:"请输入联系方式",maxlength:"20"},model:{value:t.userform.telcode,callback:function(e){t.$set(t.userform,"telcode",e)},expression:"userform.telcode"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"亲属联系方式",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入姓名",maxlength:"20"},model:{value:t.userform.relativetelcode,callback:function(e){t.$set(t.userform,"relativetelcode",e)},expression:"userform.relativetelcode"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"诊断名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入诊断",maxlength:"50"},model:{value:t.form.leavediagname,callback:function(e){t.$set(t.form,"leavediagname",e)},expression:"form.leavediagname"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"出生地",prop:"birthplace"}},[a("el-input",{attrs:{placeholder:"国、省、地市、区县、街道等详细信息",maxlength:"50"},model:{value:t.userform.birthplace,callback:function(e){t.$set(t.userform,"birthplace",e)},expression:"userform.birthplace"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"居住地",prop:"placeOfResidence"}},[a("el-input",{attrs:{placeholder:"国、省、地市、区县、街道等详细信息",maxlength:"50"},model:{value:t.userform.placeOfResidence,callback:function(e){t.$set(t.userform,"placeOfResidence",e)},expression:"userform.placeOfResidence"}})],1)],1)],1)],1)],1)],1)])])]),a("el-dialog",{attrs:{title:"短信发送",visible:t.smsDialogVisible},on:{"update:visible":function(e){t.smsDialogVisible=e}}},[a("el-form",{ref:"smsForm",attrs:{model:t.form,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"患者名称"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.sendname,callback:function(e){t.$set(t.form,"sendname",e)},expression:"form.sendname"}})],1),a("el-form-item",{attrs:{label:"年龄"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.age,callback:function(e){t.$set(t.form,"age",e)},expression:"form.age"}})],1),a("el-form-item",{attrs:{label:"电话"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.userform.telcode,callback:function(e){t.$set(t.userform,"telcode",e)},expression:"userform.telcode"}})],1),a("el-form-item",{attrs:{label:"科室"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.deptname,callback:function(e){t.$set(t.form,"deptname",e)},expression:"form.deptname"}})],1),a("el-form-item",{attrs:{label:"病区"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.leavehospitaldistrictname,callback:function(e){t.$set(t.form,"leavehospitaldistrictname",e)},expression:"form.leavehospitaldistrictname"}})],1),a("el-form-item",{attrs:{label:"短信内容"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.smsContent,callback:function(e){t.smsContent=e},expression:"smsContent"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.smsDialogVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.sendSms}},[t._v("确认发送")])],1)],1),a("el-dialog",{directives:[{name:"dialogDrags",rawName:"v-dialogDrags"}],attrs:{title:"患者再次随访",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{ref:"zcform",attrs:{rules:t.zcrules,model:t.form,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"任务名称"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.taskName,callback:function(e){t.$set(t.form,"taskName",e)},expression:"form.taskName"}})],1),a("el-form-item",{attrs:{label:"患者名称"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.sendname,callback:function(e){t.$set(t.form,"sendname",e)},expression:"form.sendname"}})],1),a("el-form-item",{attrs:{label:"年龄"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.age,callback:function(e){t.$set(t.form,"age",e)},expression:"form.age"}})],1),a("el-form-item",{attrs:{label:"科室"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.deptname,callback:function(e){t.$set(t.form,"deptname",e)},expression:"form.deptname"}})],1),a("el-form-item",{attrs:{label:"病区"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.leavehospitaldistrictname,callback:function(e){t.$set(t.form,"leavehospitaldistrictname",e)},expression:"form.leavehospitaldistrictname"}})],1),a("el-form-item",{attrs:{label:"出院时间"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{disabled:""},model:{value:t.form.endtime,callback:function(e){t.$set(t.form,"endtime",e)},expression:"form.endtime"}})],1),a("div",{staticClass:"headline"},[t._v("上次随访")]),a("el-divider"),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"随访方式"}},[a("el-select",{staticClass:"custom-disabled",attrs:{filterable:"","allow-create":"","default-first-option":"",disabled:"",placeholder:"请选择随访方式"},model:{value:t.form.visitType2,callback:function(e){t.$set(t.form,"visitType2",e)},expression:"form.visitType2"}},t._l(t.options,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"随访时间"}},[a("el-date-picker",{staticClass:"custom-disabled",attrs:{type:"date",disabled:"",placeholder:"选择日期","picker-options":t.pickerOptions,align:"right"},model:{value:t.form.date2,callback:function(e){t.$set(t.form,"date2",e)},expression:"form.date2"}})],1)],1)],1),a("el-form-item",{attrs:{label:"随访记录"}},[a("el-input",{staticClass:"custom-disabled",attrs:{type:"textarea",disabled:""},model:{value:t.form.remark2,callback:function(e){t.$set(t.form,"remark2",e)},expression:"form.remark2"}})],1),a("div",{staticClass:"headline"},[t._v("下次随访")]),a("el-divider"),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"随访方式",prop:"visitType"}},[a("el-select",{attrs:{filterable:"","allow-create":"","default-first-option":"",placeholder:"请选择随访方式(依出院时间计算)"},on:{change:t.visitChange},model:{value:t.form.visitType,callback:function(e){t.$set(t.form,"visitType",e)},expression:"form.visitType"}},t._l(t.options,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"随访时间",prop:"date1"}},[a("el-date-picker",{staticClass:"custom-disabled",attrs:{type:"date",placeholder:"选择日期","picker-options":t.pickerOptions,align:"right","value-format":"yyyy-MM-dd"},on:{change:t.checkFollowupDate},model:{value:t.form.date1,callback:function(e){t.$set(t.form,"date1",e)},expression:"form.date1"}})],1)],1)],1),a("el-form-item",{attrs:{label:"随访方式",prop:"resource"}},[a("el-radio-group",{model:{value:t.form.resource,callback:function(e){t.$set(t.form,"resource",e)},expression:"form.resource"}},[a("el-radio",{attrs:{label:"1"}},[t._v("本病区随访")]),a("el-radio",{attrs:{label:"2"}},[t._v("随访中心随访")])],1)],1),a("el-form-item",{attrs:{label:"随访记录"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"warning"},on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.setupsubtask}},[t._v("确认创建服务")])],1)],1),"景宁畲族自治县人民医院"==t.orgname?a("div",{staticClass:"main-content"},[a("el-dialog",{attrs:{title:"呼叫功能框",visible:t.CaldialogVisible,width:"60%"},on:{"update:visible":function(e){t.CaldialogVisible=e}}},[a("CallCenterLs",{ref:"CallCenterLs",attrs:{"initial-phone":t.currentPhoneNumber}})],1)],1):t._e()],1)},s=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"headline"},[a("div",[t._v("随访内容")])])}],r=a("025b"),o=(a("7520"),a("ec0b"),a("8d03"),a("618d"),a("9364"),a("9c42"),a("7103"),a("fb51"),a("2f82"),a("6678"),a("8081"),a("7a82"),a("e4d7"),a("6e70"),a("f24b"),a("9493"),a("c33f"),a("21b9"),a("16d2"),a("8ada"),a("a26b"),a("4a55"),a("e795"),a("cfee"),a("8adb"),a("283d"),a("a04b"),a("46e6"),a("f76b"),a("ec4f"),a("e8a6"),a("aad4"),a("21e8"),a("f160"),a("8e97"),a("1b56"),a("661f"),a("40d6")),i=a("958b"),c=a("0239"),l=a("1523"),u={components:{CallButton:c["a"],CallCenterLs:l["a"]},directives:{numericOnly:{bind:function(t,e,a){var n="INPUT"===t.tagName?t:t.querySelector("input");if(n){var s=function(t){var e=n.value,a=e.replace(/[^\d]/g,"");a!==e&&(n.value=a,n.dispatchEvent(new Event("input",{bubbles:!0})))},r=function(t){t.preventDefault();var e=t.clipboardData||window.clipboardData,a=e.getData("text"),s=a.replace(/[^\d]/g,""),r=n.selectionStart,o=n.selectionEnd;n.value=n.value.substring(0,r)+s+n.value.substring(o);var i=r+s.length;n.setSelectionRange(i,i),n.dispatchEvent(new Event("input",{bubbles:!0}))};n.addEventListener("input",s),n.addEventListener("paste",r),t._numericOnly={inputHandle:s,pasteHandle:r,inputEl:n}}else console.warn("v-numeric-only: 未找到input元素")},unbind:function(t){if(t._numericOnly){var e=t._numericOnly,a=e.inputHandle,n=e.pasteHandle,s=e.inputEl;s.removeEventListener("input",a),s.removeEventListener("paste",n),delete t._numericOnly}}}},dicts:["sys_normal_disable","sys_user_sex","sys_yujing","sys_suggest"],data:function(){var t=function(t,e,a){if(!e)return a(new Error("请输入联系电话"));setTimeout((function(){/^1[3-9]\d{9}$/.test(e)?a():a(new Error("请输入正确的11位手机号码"))}),300)};return{userid:"",currentPhoneNumber:"",callType:"",callStatus:"idle",isEndingCall:!1,CaldialogVisible:!1,currentCall:null,routeWatcher:null,lastRoutePath:this.$route.path,input:"今天身体还不错",radio:"2",taskname:"",activeName:"wj",voice:"",templateid:"",again:"",orgname:"",zcform:{},form:{},cities:[{label:"正常语音",value:"1"},{label:"患者拒接或拒访",value:"2"},{label:"面访或者接诊",value:"3"},{label:"微信随访",value:"4"},{label:"随访电话不正确",value:"5"},{label:"不宜随访被过滤",value:"6"},{label:"其他",value:"7"}],tableDatatop:[],voiceDatatop:[],dynamicTags:[],isMergeMode:!1,mergeDialogVisible:!1,selectedServices:[],selectedTag:"",tagOptions:[{value:"0",label:"正常",type:"normal",color:"#7ff5e1",description:"患者情况正常,无需特别关注"},{value:"1",label:"异常",type:"abnormal",color:"#f75c5c",description:"患者存在异常情况,需要重点关注"},{value:"2",label:"警告",type:"warning",color:"#fbfb4a",description:"患者情况需要警告注意,可能存在风险"}],zcrules:{resource:[{required:!0,message:"请选择随访方式",trigger:"change"}],date1:[{required:!0,message:"请选择随访时间",trigger:"blur"},{validator:function(t,e,a){if(!e)return a(new Error("请选择随访时间"));var n=new Date(e),s=new Date;if(n<s)return a(new Error("随访时间不能早于当前日期"));a()},trigger:"change"}]},userrules:{telcode:[{validator:t,trigger:"blur"}],relativetelcode:[{validator:t,trigger:"blur"}]},url:"http://9.208.2.190:8090/smartor/serviceExternal/query360PatInfo",postData:{XiaoXiTou:{FaSongFCSJC:"ZJHES",FaSongJGID:localStorage.getItem("orgid"),FaSongJGMC:localStorage.getItem("orgname"),FaSongSJ:"2025-01-09 17:29:36",FaSongXTJC:"SUIFANGXT",FaSongXTMC:"随访系统",XiaoXiID:"5FA92AFB-9833-4608-87C7-F56A654AC171",XiaoXiLX:"SC_LC_360STCX",XiaoXiMC:"360 视图查询",ZuHuID:localStorage.getItem("ZuHuID"),ZuHuMC:localStorage.getItem("orgname")},YeWuXX:{BingRenXX:{ZhengJianHM:"",ZhengJianLXDM:"01",ZhengJianLXMC:"居民身份证",ZuZhiJGID:localStorage.getItem("orgid"),ZuZhiJGMC:localStorage.getItem("orgname")},YongHuXX:{XiTongID:"SUIFANGXT",XiTongMC:"随访系统",YongHuID:localStorage.getItem("YongHuID"),YongHuXM:localStorage.getItem("YongHuXM"),ZuZhiJGID:localStorage.getItem("orgid"),ZuZhiJGMC:localStorage.getItem("orgname"),idp:"lyra"}}},pickerOptions:{disabledDate:function(t){return t.getTime()<Date.now()-864e5}},options:[{value:"七天后",label:"七天后"},{value:"15天后",label:"15天后"},{value:"一个月后",label:"一个月后"},{value:"三个月后",label:"三个月后"},{value:"六个月后",label:"六个月后"},{value:"一年后",label:"一年后"}],userform:{},smsDialogVisible:!1,smsContent:"",Whetherall:!0,dialogFormVisible:!1,Voicetype:0,visitCount:null,logsheetlist:[],topicobj:{},sendname:null,serviceType:null,id:null,taskid:null,patid:null}},computed:{callStatusText:function(){var t={idle:"准备呼叫",calling:"正在呼叫 ".concat(this.currentPhoneNumber,"..."),connected:"已接通 ".concat(this.currentPhoneNumber),ended:"通话已结束",failed:"呼叫失败"};return t[this.callStatus]},callStatusType:function(){var t={idle:"info",calling:"warning",connected:"success",ended:"info",failed:"error"};return t[this.callStatus]}},created:function(){this.taskid=this.$route.query.taskid,this.id=this.$route.query.id,this.sendname=this.$route.query.sendname,this.patid=this.$route.query.patid,this.again=this.$route.query.again,this.Voicetype=this.$route.query.Voicetype,this.visitCount=this.$route.query.visitCount,this.serviceType=this.$route.query.serviceType,this.orgname=localStorage.getItem("orgname"),this.getTaskservelist()},methods:{getTopicClass:function(t){return 1==t.isabnormal?"scriptTopic-isabnormal":2==t.isabnormal?"scriptTopic-warning":"scriptTopic-dev"},getOptionClass:function(t){return 1==t.isabnormal?"red-star":2==t.isabnormal?"yellow-star":""},getsearchrResults:function(t){var e=this;Object(o["bc"])({taskid:this.taskid,patid:this.patid,subId:t||this.id,isFinish:!1}).then((function(t){200===t.code&&(e.again&&t.data.upScriptResult&&t.data.upScriptResult.forEach((function(e){var a=t.data.scriptResult.find((function(t){return t.scriptContent===e.scriptContent}));a&&(a.scriptResult=e.scriptResult)})),e.tableDatatop=t.data.scriptResult,e.tableDatatop.forEach((function(t){2==t.scriptType&&(t.scriptResult=[]),t.scriptResultId&&2!=t.scriptType?(t.isoption=3,t.scriptResult=t.scriptResult):t.scriptResultId&&2==t.scriptType&&(t.scriptResult=t.scriptResult.split("&"),t.isoption=3)})),e.taskname=t.data.taskName,e.overdata())}))},gettoken360:function(t,e,a){var n=this;this.postData.YeWuXX.BingRenXX.ZhengJianHM=t,Object(o["mc"])(this.postData).then((function(t){t.data.url?window.open(t.data.url,"_blank"):n.$modal.msgWarning("360查询无结果")}))},getuserinfo:function(){var t=this,e={pid:Number(this.patid),allhosp:"0"};Object(i["l"])(e).then((function(e){e.rows[0]&&(t.userform=e.rows[0])})),Object(i["k"])({patid:this.patid}).then((function(e){t.tableData=e.rows,t.tableData.length&&(t.userform.relativetelcode=t.tableData[0].contactway,t.userform.relation=t.tableData[0].relation)}))},visitChange:function(t){if(!this.form.endtime)return this.$message.warning("请先确认出院时间"),this.form.visitType="",void this.$refs.zcform.clearValidate(["visitType"]);var e=new Date(this.form.endtime),a=new Date,n=new Date(e);if(t.includes("七天后")?n.setDate(e.getDate()+7):t.includes("15天后")?n.setDate(e.getDate()+15):t.includes("一个月后")?n.setMonth(e.getMonth()+1):t.includes("三个月后")?n.setMonth(e.getMonth()+3):t.includes("六个月后")?n.setMonth(e.getMonth()+6):t.includes("一年后")&&n.setFullYear(e.getFullYear()+1),n<a)return this.$message.warning("计算出的随访时间 ".concat(this.formatTime(n)," 已过期")),this.form.visitType="",void this.$refs.zcform.clearValidate(["visitType","date1"]);this.form.date1=this.formatTime(n),this.$refs.zcform.clearValidate(["date1"])},checkFollowupDate:function(t){if(console.log(t),!t)return this.form.date1="",void this.$refs.zcform.clearValidate(["date1"]);var e=new Date(t),a=new Date;e<a&&(this.$message.warning("随访时间不能早于当前日期"),this.form.date1="",this.$refs.zcform.validateField("date1"))},getPersonVoices:function(t){var e=this,a={taskid:this.taskid,patid:this.patid,subId:t||this.id};Object(o["yb"])(a).then((function(t){200==t.code&&(e.voiceDatatop=t.data.serviceSubtaskDetails,e.voice=t.data.voice,e.activeName="yy",e.taskname=t.data.taskName,e.tableDatatop=t.data.filteredDetails,e.tableDatatop.forEach((function(t){t.targetvalue?t.scriptResult=t.targetvalue.split("&"):t.scriptResult=[]})),e.tableDatatop.length||e.puttaskid(e.templateid))}))},puttaskid:function(t){var e=this;Object(o["Eb"])(t).then((function(t){200==t.code&&(e.tableDatatop=t.data.ivrTaskTemplateScriptVOList,e.tableDatatop.forEach((function(t){t.id=null,t.ivrTaskScriptTargetoptionList&&(t.targetvalue=1,t.questiontext=t.scriptContent,t.targetvalue=t.ivrTaskScriptTargetoptionList.map((function(t){return t.targetvalue})).join("&")),t.targetvalue?t.scriptResult=t.targetvalue.split("&"):t.scriptResult=[]})))}))},getdetail:function(){var t=this,e="",a=[];this.tableDatatop.forEach((function(n){if(3!=n.valueType||!n.scriptResult||/^\d+$/.test(n.scriptResult)){var s=n.svyTaskTemplateTargetoptions.find((function(t){return t.optioncontent==n.scriptResult}));s&&1!=e&&s.isabnormal&&(e=s.isabnormal,t.selectedTag=s.isabnormal),console.log(e,"excep");var r={asrtext:null,patid:t.patid,subId:t.id,taskid:t.taskid,scriptid:n.id,excep:e,questiontext:n.scriptContent,answerps:n.answerps||null};2==n.scriptType&&n.scriptResult[0]?r.asrtext=n.scriptResult.join("&"):2!=n.scriptType&&n.scriptResult&&(r.asrtext=n.scriptResult),3==n.isoption?a.push(Object(o["rc"])(r)):a.push(Object(o["qc"])(r))}else t.$message.error('问题 "'.concat(n.scriptContent,'" 必须输入数字'))})),Promise.all(a).then((function(e){e.forEach((function(e){200!==e.code&&t.$modal.error("修改失败")})),t.Editsingletasksonyic(6),t.$modal.confirm('任务保存成功是否针对患者:"'+t.userform.name+'"再次随访?',"确认",{confirmButtonText:"确定",cancelButtonText:"取消",showCancelButton:!0,dangerouslyUseHTMLString:!0,confirmButtonClass:"custom-confirm-button",cancelButtonClass:"custom-cancel-button"}).then((function(){document.querySelector("#app").scrollTo(0,0),t.formtidy(),t.dialogFormVisible=!0})).catch((function(){13==t.form.serviceType?1!=t.visitCount?t.$router.push({path:"/logisticsservice/zbAgain"}):t.$router.push({path:"/logisticsservice/record"}):2==t.form.serviceType&&(1!=t.visitCount?t.$router.push({path:"/logisticsservice/again"}):t.$router.push({path:"/followvisit/discharge"}))}))})).catch((function(t){console.error("发生错误:",t)}))},validatePhoneNumber:function(t){if(!t)return{isValid:!1,message:"请输入电话号码"};var e=/^1[3-9]\d{9}$/,a=/^0\d{2,3}-?\d{7,8}$/,n=/^\d{7,8}$/;return e.test(t)?{isValid:!0,type:"mobile"}:a.test(t)?{isValid:!0,type:"landline"}:n.test(t)?{isValid:!1,message:"本地号码请添加区号(如028-1234567)"}:{isValid:!1,message:"请输入正确的电话号码(手机号或带区号的固定电话)"}},isValidPhone:function(t){return this.validatePhoneNumber(t).isValid},handleCall:function(t,e){var a=this;this.isValidPhone(t)?(this.currentPhoneNumber=t,"景宁畲族自治县人民医院"!=this.orgname?(this.callType=e,this.callStatus="calling",this.$nextTick((function(){a.$refs.callButton.startCall(),a.$refs.callButton.$on("call-status-change",(function(t){a.handleCallStatusChange(t)}))}))):this.CaldialogVisible=!0):this.$message.error("请输入正确的手机号码")},handleCallStatusChange:function(t){console.log(t,"status"),this.callStatus=t.type,"connected"===t.type?this.currentCall={phone:this.currentPhoneNumber,type:this.callType,startTime:new Date}:"ended"!==t.type&&"failed"!==t.type||(this.currentCall=null),"failed"===t.type&&this.$message.error("呼叫失败: ".concat(t.text))},endCurrentCall:function(){var t=this;this.currentCall&&(this.isEndingCall=!0,this.$refs.callButton.endCall(),setTimeout((function(){t.isEndingCall=!1}),3e3))},yuyingetdetail:function(){var t=JSON.parse(JSON.stringify(this.tableDatatop));console.log(t,"dataToSubmit")},formtidy:function(){this.form.visitType2=this.form.visitType,this.form.date2=this.form.longSendTime,this.form.remark2=this.form.remark},setCurrentDate:function(){var t=new Date,e=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return"".concat(e,"-").concat(a,"-").concat(n)},getTaskservelist:function(t){var e=this;this.Whetherall=!t,Object(o["Lb"])({patid:this.patid,subId:t,pageSize:100}).then((function(t){if(200==t.code){e.form=t.rows[0].serviceSubtaskList.find((function(t){return t.id==e.id})),console.log(e.form,"serviceType"),e.logsheetlist=t.rows[0].serviceSubtaskList,e.templateid=e.form.templateid,e.selectedTag=e.form.excep;var a=new Date(e.form.longSendTime),n=new Date;n<a&&2==e.form.sendstate&&e.$confirm("当前服务未到发送时间请谨慎修改","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){})).catch((function(){})),e.getuserinfo()}e.Voicetype?e.getPersonVoices():e.getsearchrResults()}))},sendAgainmsg:function(){this.smsDialogVisible=!0},sendSms:function(){var t=this;Object(o["pc"])({phone:this.userform.telcode,content:this.smsContent}).then((function(e){200==e.code?(t.$modal.msgSuccess("发送成功"),t.smsDialogVisible=!1,t.smsContent=""):t.$modal.msgError("发送失败")})).catch((function(e){console.error("发送短信失败:",e),t.$modal.msgError("发送失败")}))},Editsingletaskson:function(t){var e=this,a={};Object(o["Lb"])({patid:this.patid,subId:this.id}).then((function(n){200==n.code&&(a=n.rows[0].serviceSubtaskList[0],a.suggest=t,Object(o["e"])(a).then((function(t){t.code&&(e.$modal.msgSuccess("服务记录成功"),e.getTaskservelist())})))}))},Editsingletasksonyic:function(t){var e=this,a={};Object(o["Lb"])({patid:this.patid,subId:this.id}).then((function(n){200==n.code&&(a=n.rows[0].serviceSubtaskList.find((function(t){return t.id==e.id})),a.remark=e.form.remark,a.taskSituation=e.form.taskSituation,a.excep=e.selectedTag,t&&(a.sendstate=t),Object(o["e"])(a).then((function(t){t.code&&(e.$modal.msgSuccess("服务修改成功"),Object(i["e"])(e.userform).then((function(t){200==t.code?e.$modal.msgSuccess("基础信息保存成功"):e.$modal.msgError("基础信息修改失败")})),e.getTaskservelist())})))}))},tableRowClassName:function(t){var e=t.row;t.rowIndex;return e.id==this.id?"warning-row":""},getSelectedTagType:function(){var t=this;if(!this.selectedTag)return"";var e=this.tagOptions.find((function(e){return e.value===t.selectedTag}));return e?e.type:""},getSelectedTagColor:function(){var t=this;if(!this.selectedTag)return"";var e=this.tagOptions.find((function(e){return e.value===t.selectedTag}));return e?e.color:""},getSelectedDescription:function(){var t=this;if(!this.selectedTag)return"";var e=this.tagOptions.find((function(e){return e.value===t.selectedTag}));return e?e.description:""},sendAgain:function(){document.querySelector("#app").scrollTo(0,0),this.formtidy(),this.dialogFormVisible=!0},Seedetails:function(t){var e=this;this.$modal.confirm('是否查看任务为"'+t.taskName+'"的服务详情数据?').then((function(){console.log(t,"rwo"),t.type,e.taskid=t.taskid,e.id=t.id,e.patid=t.patid,e.serviceType=t.serviceType,e.getTaskservelist()})).catch((function(){}))},aahandleOptionChange:function(t,e,a){var n=a.find((function(e){return e.optioncontent==t}));if(0==n.nextQuestion?this.tableDatatop=this.tableDatatop.reduce((function(t,a,n){return t.push(n>e?Object(r["a"])(Object(r["a"])({},a),{},{astrict:1}):a),t}),[]):this.tableDatatop=this.tableDatatop.reduce((function(t,a,n){return t.push(n>e?Object(r["a"])(Object(r["a"])({},a),{},{astrict:0}):a),t}),[]),this.Voicetype)var s=this.tableDatatop[e].ivrTaskScriptTargetoptionList.find((function(e){return e.optioncontent==t}));else s=this.tableDatatop[e].svyTaskTemplateTargetoptions.find((function(e){return e.optioncontent==t}));s.isabnormal?this.tableDatatop[e].isabnormal=!0:this.tableDatatop[e].isabnormal=!1,this.$forceUpdate()},handleRadioToggles:function(t,e){t.matchedtext||t.matchedtext,t.matchedtext==e?(this.$set(t,"matchedtext",""),t.showAppendInput=!1):this.$set(t,"matchedtext",e)},handleRadioToggle:function(t,e,a,n){t.scriptResult===n?(t.scriptResult="",t.showAppendInput=!1):(t.scriptResult=n,this.handleOptionChange(n,e,a,t))},handleOptionChange:function(t,e,a,n){console.log(t,e,a,n,"888"),document.activeElement&&document.activeElement.blur();var s=a.find((function(e){return e.optioncontent==t}));this.tableDatatop[e].isabnormal=s.isabnormal,this.tableDatatop[e].showAppendInput=1==s.appendflag,console.log(this.tableDatatop);var o=this.tableDatatop.slice(0,e).map((function(t,e){return t.astrict?e:-1})).filter((function(t){return-1!==t}));this.tableDatatop.map((function(t,e){return t.hiddenByEnd?e:-1})).filter((function(t){return-1!==t}));if(1==n.branchFlag)if(0==s.nextQuestion)this.tableDatatop=this.tableDatatop.map((function(t,a){return Object(r["a"])(Object(r["a"])({},t),{},{astrict:a>e,hiddenByEnd:a>e})}));else{var i=s.nextQuestion-1;this.tableDatatop=this.tableDatatop.map((function(t,a){return a<e?Object(r["a"])(Object(r["a"])({},t),{},{astrict:o.includes(a),hiddenByEnd:!1}):a===e||a===i||t.hiddenByEnd?Object(r["a"])(Object(r["a"])({},t),{},{astrict:0,hiddenByEnd:!1}):a>e&&a<i?Object(r["a"])(Object(r["a"])({},t),{},{astrict:1,hiddenByEnd:!1}):t}))}else this.tableDatatop=this.tableDatatop.map((function(t,a){return Object(r["a"])(Object(r["a"])({},t),{},{astrict:a===e+1?0:t.astrict,hiddenByEnd:a!==e+1&&t.hiddenByEnd})}));this.$forceUpdate()},overdata:function(){var t=this;this.tableDatatop.forEach((function(e,a){var n=e.svyTaskTemplateTargetoptions.find((function(t){return t.optioncontent==e.scriptResult}));n&&(n.isabnormal&&(t.tableDatatop[a].isabnormal=n.isabnormal),t.$forceUpdate())}))},setupsubtask:function(){var t=this;this.$refs["zcform"].validate((function(e){if(e){if(t.form.date1&&new Date(t.form.date1)<new Date)return t.$message.error("随访时间不能小于当前时间"),!1;t.form.remark=t.form.remark+"【"+t.getCurrentTime()+"】";var a=structuredClone(t.form);if(a.longSendTime=t.formatTime(a.date1),a.finishtime="",!a.resource)return void t.$modal.msgError("未选择随访方式");2==a.resource?(a.visitDeptCode=localStorage.getItem("deptCode"),a.visitDeptName="随访中心"):(a.visitDeptCode=a.deptcode,a.visitDeptName=a.deptname),a.sendstate=2,console.log(a.serviceType,"form.serviceType"),Object(o["C"])(a).then((function(e){200==e.code?(t.$modal.msgSuccess("创建成功"),13==a.serviceType?t.$router.push({path:"/logisticsservice/zbAgain"}):2==a.serviceType&&t.$router.push({path:"/logisticsservice/again"})):t.$modal.msgError("创建失败"),document.querySelector("#app").scrollTo(0,0),t.dialogFormVisible=!1}))}}))},getCurrentTime:function(){var t=new Date,e=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return"".concat(e,"-").concat(a,"-").concat(n," ").concat(s,":").concat(r,":").concat(o)},updateScore:function(t,e,a){},toggleMergeMode:function(){this.isMergeMode=!this.isMergeMode,this.isMergeMode||(this.selectedServices=[])},handleSelectionChange:function(t){this.selectedServices=t.filter((function(t){return!t.preachformson||!t.preachformson.includes("3")})).map((function(t){return{id:t.id,taskid:t.taskid,taskName:t.taskName,sendname:t.sendname}}))},checkSelectable:function(t,e){return 6!==t.sendstate},openMergeDialog:function(){this.selectedServices.length<2?this.$message.warning("请至少选择2个问卷服务进行合并"):this.mergeDialogVisible=!0},handleMergeSave:function(t){this.mergeDialogVisible=!1,this.isMergeMode=!1,this.selectedServices=[],t.successCount==t.totalCount?this.$message.success("成功保存 ".concat(t.successCount," 个问卷")):t.successCount>0?this.$message.warning("成功保存 ".concat(t.successCount," 个问卷,失败 ").concat(t.totalCount-t.successCount," 个")):this.$message.error("所有问卷保存失败"),this.getTaskservelist()}},beforeRouteLeave:function(t,e,a){this.$refs.callButton.cleanupResources(),this.$refs.CallCenterLs&&(console.log(1),this.$refs.CallCenterLs.handleSeatLogout()),a()}},d=u,m=(a("fa1b"),a("1805")),p=Object(m["a"])(d,n,s,!1,null,"b093c8de",null);e["default"]=p.exports},fa1b:function(t,e,a){"use strict";a("5e35")},fdb5:function(t,e,a){}}]);