proNameFromId: function(_id) {
    let matched = this.allPros.filter(_pro => {
        return _pro.id === _id;
    });
    if(matched && matched.length) {
        matched = matched[0];
        return [matched.name_last, matched.name_first].filter(Boolean).join(', ');
    }
    return '-';
},

showProUpdatePopup: function(_name, _proToUpdate, _item) {
    closeStagPopup();
    this.proToUpdate = _proToUpdate
    this.popupItem =JSON.parse(JSON.stringify(_item))
    let self = this;
    Vue.nextTick(function() {
        showStagPopup('{{$ticketType}}-pro-update-popup', true);
    });
},

updateTicketPro: function() {
    let self  = this;
    let form = $('#{{$ticketType}}App form').first();
    if(!form[0].checkValidity()) {
        form[0].reportValidity();
        return false;
    }

    showMask();
    let payload = this.popupItem;
    payload.newProUid = self.newProUid;

    $.post(
        '/api/ticket/update' + self.proToUpdate +'Pro',
        payload,
        function(_data) {
            console.log(_data);
            fastReload();
        },
        'json');

    return false;
},



setIsEntryErrorToTrue: function(_item){
    showMask();
    $.post('/api/ticket/setIsEntryErrorToTrue', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    });
},

setIsEntryErrorToFalse: function(_item){
    showMask();
    $.post('/api/ticket/setIsEntryErrorToFalse', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

signAsAssignedPro: function(_item){
    showMask();
    $.post('/api/ticket/signAsAssignedPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

undoSignAsAssignedPro: function(_item){
    showMask();
    $.post('/api/ticket/undoSignAsAssignedPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

signAsManagerPro: function(_item){
    showMask();
    $.post('/api/ticket/signAsManagerPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

undoSignAsManagerPro: function(_item){
    showMask();
    $.post('/api/ticket/undoSignAsManagerPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

signAsOrderingPro: function(_item){
    showMask();
    $.post('/api/ticket/signAsOrderingPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

undoSignAsOrderingPro: function(_item){
    showMask();
    $.post('/api/ticket/undoSignAsOrderingPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

signAsInitiatingPro: function(_item){
    showMask();
    $.post('/api/ticket/signAsInitiatingPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
},

undoSignAsInitiatingPro: function(_item){
    showMask();
    $.post('/api/ticket/undoSignAsInitiatingPro', {
        uid:_item.uid
    }, function(_data){
        fastReload();
    })
}
