/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/dist/"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 708); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return REF_FOR_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPONENT_UID_KEY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isVue3; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return nextTick; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return extend; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(100); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_functional_data_merge__ = __webpack_require__(1402); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0_vue__["default"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1_vue_functional_data_merge__["a"]; }); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // --- Constants --- var COMPONENT_UID_KEY = '_uid'; var isVue3 = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].version.startsWith('3'); var REF_FOR_KEY = isVue3 ? 'ref_for' : 'refInFor'; var ALLOWED_FIELDS_IN_DATA = ['class', 'staticClass', 'style', 'attrs', 'props', 'domProps', 'on', 'nativeOn', 'directives', 'scopedSlots', 'slot', 'key', 'ref', 'refInFor']; var extend = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].extend.bind(__WEBPACK_IMPORTED_MODULE_0_vue__["default"]); if (isVue3) { var originalExtend = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].extend; var KNOWN_COMPONENTS = ['router-link', 'transition', 'transition-group']; var originalVModelDynamicCreated = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].vModelDynamic.created; var originalVModelDynamicBeforeUpdate = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].vModelDynamic.beforeUpdate; // See https://github.com/vuejs/vue-next/pull/4121 for details __WEBPACK_IMPORTED_MODULE_0_vue__["default"].vModelDynamic.created = function (el, binding, vnode) { originalVModelDynamicCreated.call(this, el, binding, vnode); if (!el._assign) { el._assign = function () {}; } }; __WEBPACK_IMPORTED_MODULE_0_vue__["default"].vModelDynamic.beforeUpdate = function (el, binding, vnode) { originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode); if (!el._assign) { el._assign = function () {}; } }; extend = function patchedBootstrapVueExtend(definition) { if (_typeof(definition) === 'object' && definition.render && !definition.__alreadyPatched) { var originalRender = definition.render; definition.__alreadyPatched = true; definition.render = function (h) { var patchedH = function patchedH(tag, dataObjOrChildren, rawSlots) { var slots = rawSlots === undefined ? [] : [Array.isArray(rawSlots) ? rawSlots.filter(Boolean) : rawSlots]; var isTag = typeof tag === 'string' && !KNOWN_COMPONENTS.includes(tag); var isSecondArgumentDataObject = dataObjOrChildren && _typeof(dataObjOrChildren) === 'object' && !Array.isArray(dataObjOrChildren); if (!isSecondArgumentDataObject) { return h.apply(void 0, [tag, dataObjOrChildren].concat(slots)); } var attrs = dataObjOrChildren.attrs, props = dataObjOrChildren.props, restData = _objectWithoutProperties(dataObjOrChildren, ["attrs", "props"]); var normalizedData = _objectSpread(_objectSpread({}, restData), {}, { attrs: attrs, props: isTag ? {} : props }); if (tag === 'router-link' && !normalizedData.slots && !normalizedData.scopedSlots) { // terrible workaround to fix router-link rendering with compat vue-router normalizedData.scopedSlots = { $hasNormal: function $hasNormal() {} }; } return h.apply(void 0, [tag, normalizedData].concat(slots)); }; if (definition.functional) { var _ctx$children, _ctx$children$default; var ctx = arguments[1]; var patchedCtx = _objectSpread({}, ctx); patchedCtx.data = { attrs: _objectSpread({}, ctx.data.attrs || {}), props: _objectSpread({}, ctx.data.props || {}) }; Object.keys(ctx.data || {}).forEach(function (key) { if (ALLOWED_FIELDS_IN_DATA.includes(key)) { patchedCtx.data[key] = ctx.data[key]; } else if (key in ctx.props) { patchedCtx.data.props[key] = ctx.data[key]; } else if (!key.startsWith('on')) { patchedCtx.data.attrs[key] = ctx.data[key]; } }); var IGNORED_CHILDREN_KEYS = ['_ctx']; var children = ((_ctx$children = ctx.children) === null || _ctx$children === void 0 ? void 0 : (_ctx$children$default = _ctx$children.default) === null || _ctx$children$default === void 0 ? void 0 : _ctx$children$default.call(_ctx$children)) || ctx.children; if (children && Object.keys(patchedCtx.children).filter(function (k) { return !IGNORED_CHILDREN_KEYS.includes(k); }).length === 0) { delete patchedCtx.children; } else { patchedCtx.children = children; } patchedCtx.data.on = ctx.listeners; return originalRender.call(this, patchedH, patchedCtx); } return originalRender.call(this, patchedH); }; } return originalExtend.call(this, definition); }.bind(__WEBPACK_IMPORTED_MODULE_0_vue__["default"]); } var nextTick = __WEBPACK_IMPORTED_MODULE_0_vue__["default"].nextTick; /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return prefixPropName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return unprefixPropName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return suffixPropName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return makeProp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return copyProps; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return pluckProps; }); /* unused harmony export makePropConfigurable */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return makePropsConfigurable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasPropFunction; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants_props__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_deep__ = __webpack_require__(112); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config__ = __webpack_require__(77); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__identity__ = __webpack_require__(28); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__inspect__ = __webpack_require__(10); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__object__ = __webpack_require__(8); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__string__ = __webpack_require__(23); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // Prefix a property var prefixPropName = function prefixPropName(prefix, value) { return prefix + Object(__WEBPACK_IMPORTED_MODULE_6__string__["j" /* upperFirst */])(value); }; // Remove a prefix from a property var unprefixPropName = function unprefixPropName(prefix, value) { return Object(__WEBPACK_IMPORTED_MODULE_6__string__["d" /* lowerFirst */])(value.replace(prefix, '')); }; // Suffix can be a falsey value so nothing is appended to string // (helps when looping over props & some shouldn't change) // Use data last parameters to allow for currying var suffixPropName = function suffixPropName(suffix, value) { return value + (suffix ? Object(__WEBPACK_IMPORTED_MODULE_6__string__["j" /* upperFirst */])(suffix) : ''); }; // Generates a prop object var makeProp = function makeProp() { var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_0__constants_props__["a" /* PROP_TYPE_ANY */]; var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; var requiredOrValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; var validator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; var required = requiredOrValidator === true; validator = required ? validator : requiredOrValidator; return _objectSpread(_objectSpread(_objectSpread({}, type ? { type: type } : {}), required ? { required: required } : Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["o" /* isUndefined */])(value) ? {} : { default: Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["j" /* isObject */])(value) ? function () { return value; } : value }), Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["o" /* isUndefined */])(validator) ? {} : { validator: validator }); }; // Copies props from one array/object to a new array/object // Prop values are also cloned as new references to prevent possible // mutation of original prop object values // Optionally accepts a function to transform the prop name var copyProps = function copyProps(props) { var transformFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_3__identity__["a" /* identity */]; if (Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["a" /* isArray */])(props)) { return props.map(transformFn); } var copied = {}; for (var prop in props) { /* istanbul ignore else */ if (Object(__WEBPACK_IMPORTED_MODULE_5__object__["g" /* hasOwnProperty */])(props, prop)) { // If the prop value is an object, do a shallow clone // to prevent potential mutations to the original object copied[transformFn(prop)] = Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["j" /* isObject */])(props[prop]) ? Object(__WEBPACK_IMPORTED_MODULE_5__object__["b" /* clone */])(props[prop]) : props[prop]; } } return copied; }; // Given an array of properties or an object of property keys, // plucks all the values off the target object, returning a new object // that has props that reference the original prop values var pluckProps = function pluckProps(keysToPluck, objToPluck) { var transformFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_3__identity__["a" /* identity */]; return (Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["a" /* isArray */])(keysToPluck) ? keysToPluck.slice() : Object(__WEBPACK_IMPORTED_MODULE_5__object__["h" /* keys */])(keysToPluck)).reduce(function (memo, prop) { memo[transformFn(prop)] = objToPluck[prop]; return memo; }, {}); }; // Make a prop object configurable by global configuration // Replaces the current `default` key of each prop with a `getComponentConfig()` // call that falls back to the current default value of the prop var makePropConfigurable = function makePropConfigurable(prop, key, componentKey) { return _objectSpread(_objectSpread({}, Object(__WEBPACK_IMPORTED_MODULE_1__clone_deep__["a" /* cloneDeep */])(prop)), {}, { default: function bvConfigurablePropDefault() { var value = Object(__WEBPACK_IMPORTED_MODULE_2__config__["c" /* getComponentConfig */])(componentKey, key, prop.default); return Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["f" /* isFunction */])(value) ? value() : value; } }); }; // Make a props object configurable by global configuration // Replaces the current `default` key of each prop with a `getComponentConfig()` // call that falls back to the current default value of the prop var makePropsConfigurable = function makePropsConfigurable(props, componentKey) { return Object(__WEBPACK_IMPORTED_MODULE_5__object__["h" /* keys */])(props).reduce(function (result, key) { return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, makePropConfigurable(props[key], key, componentKey))); }, {}); }; // Get function name we use in `makePropConfigurable()` // for the prop default value override to compare // against in `hasPropFunction()` var configurablePropDefaultFnName = makePropConfigurable({}, '', '').default.name; // Detect wether the given value is currently a function // and isn't the props default function var hasPropFunction = function hasPropFunction(fn) { return Object(__WEBPACK_IMPORTED_MODULE_4__inspect__["f" /* isFunction */])(fn) && fn.name && fn.name !== configurablePropDefaultFnName; }; /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { true ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() }(this, (function () { 'use strict'; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return ( input instanceof Array || Object.prototype.toString.call(input) === '[object Array]' ); } function isObject(input) { // IE8 will treat undefined and null as object if it wasn't for // input != null return ( input != null && Object.prototype.toString.call(input) === '[object Object]' ); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return ( typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]' ); } function isDate(input) { return ( input instanceof Date || Object.prototype.toString.call(input) === '[object Date]' ); } function map(arr, fn) { var res = [], i, arrLen = arr.length; for (i = 0; i < arrLen; ++i) { res.push(fn(arr[i], i)); } return res; } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false, }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function isValid(m) { var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime()); if (isNowValid) { flags = getParsingFlags(m); parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }); isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } return m._isValid; } function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = (hooks.momentProperties = []), updateInProgress = false; function copyConfig(to, from) { var i, prop, val, momentPropertiesLen = momentProperties.length; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentPropertiesLen > 0) { for (i = 0; i < momentPropertiesLen; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return ( obj instanceof Moment || (obj != null && obj._isAMomentObject != null) ); } function warn(msg) { if ( hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn ) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key, argLen = arguments.length; for (i = 0; i < argLen; i++) { arg = ''; if (typeof arguments[i] === 'object') { arg += '\n[' + i + '] '; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ': ' + arguments[0][key] + ', '; } } arg = arg.slice(0, -2); // Remove trailing comma and space } else { arg = arguments[i]; } args.push(arg); } warn( msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } function set(config) { var prop, i; for (i in config) { if (hasOwnProp(config, i)) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. // TODO: Remove "ordinalParse" fallback in next major release. this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if ( hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) ) { // make sure changes to properties don't modify parent config res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } var defaultCalendar = { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }; function calendar(key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return ( (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber ); } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken(token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal( func.apply(this, arguments), token ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var defaultLongDateFormat = { LTS: 'h:mm:ss A', LT: 'h:mm A', L: 'MM/DD/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY h:mm A', LLLL: 'dddd, MMMM D, YYYY h:mm A', }; function longDateFormat(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper .match(formattingTokens) .map(function (tok) { if ( tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd' ) { return tok.slice(1); } return tok; }) .join(''); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate() { return this._invalidDate; } var defaultOrdinal = '%d', defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace('%d', number); } var defaultRelativeTime = { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', w: 'a week', ww: '%d weeks', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var aliases = { D: 'date', dates: 'date', date: 'date', d: 'day', days: 'day', day: 'day', e: 'weekday', weekdays: 'weekday', weekday: 'weekday', E: 'isoWeekday', isoweekdays: 'isoWeekday', isoweekday: 'isoWeekday', DDD: 'dayOfYear', dayofyears: 'dayOfYear', dayofyear: 'dayOfYear', h: 'hour', hours: 'hour', hour: 'hour', ms: 'millisecond', milliseconds: 'millisecond', millisecond: 'millisecond', m: 'minute', minutes: 'minute', minute: 'minute', M: 'month', months: 'month', month: 'month', Q: 'quarter', quarters: 'quarter', quarter: 'quarter', s: 'second', seconds: 'second', second: 'second', gg: 'weekYear', weekyears: 'weekYear', weekyear: 'weekYear', GG: 'isoWeekYear', isoweekyears: 'isoWeekYear', isoweekyear: 'isoWeekYear', w: 'week', weeks: 'week', week: 'week', W: 'isoWeek', isoweeks: 'isoWeek', isoweek: 'isoWeek', y: 'year', years: 'year', year: 'year', }; function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = { date: 9, day: 11, weekday: 11, isoWeekday: 11, dayOfYear: 4, hour: 13, millisecond: 16, minute: 14, month: 8, quarter: 7, second: 15, weekYear: 1, isoWeekYear: 1, week: 5, isoWeek: 5, year: 1, }; function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function (a, b) { return a.priority - b.priority; }); return units; } var match1 = /\d/, // 0 - 9 match2 = /\d\d/, // 00 - 99 match3 = /\d{3}/, // 000 - 999 match4 = /\d{4}/, // 0000 - 9999 match6 = /[+-]?\d{6}/, // -999999 - 999999 match1to2 = /\d\d?/, // 0 - 99 match3to4 = /\d\d\d\d?/, // 999 - 9999 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 match1to3 = /\d{1,3}/, // 0 - 999 match1to4 = /\d{1,4}/, // 0 - 9999 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 matchUnsigned = /\d+/, // 0 - inf matchSigned = /[+-]?\d+/, // -inf - inf matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99 match1to2HasZero = /^([1-9]\d|\d)/, // 0-99 regexes; regexes = {}; function addRegexToken(token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape( s .replace('\\', '') .replace( /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; } ) ); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } function absFloor(number) { if (number < 0) { // -0 -> 0 return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } var tokens = {}; function addParseToken(token, callback) { var i, func = callback, tokenLen; if (typeof token === 'string') { token = [token]; } if (isNumber(callback)) { func = function (input, array) { array[callback] = toInt(input); }; } tokenLen = token.length; for (i = 0; i < tokenLen; i++) { tokens[token[i]] = func; } } function addWeekParseToken(token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : '+' + y; }); addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } // HOOKS hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear() { return isLeapYear(this.year()); } function makeGetSet(unit, keepTime) { return function (value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { if (!mom.isValid()) { return NaN; } var d = mom._d, isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds(); case 'Seconds': return isUTC ? d.getUTCSeconds() : d.getSeconds(); case 'Minutes': return isUTC ? d.getUTCMinutes() : d.getMinutes(); case 'Hours': return isUTC ? d.getUTCHours() : d.getHours(); case 'Date': return isUTC ? d.getUTCDate() : d.getDate(); case 'Day': return isUTC ? d.getUTCDay() : d.getDay(); case 'Month': return isUTC ? d.getUTCMonth() : d.getMonth(); case 'FullYear': return isUTC ? d.getUTCFullYear() : d.getFullYear(); default: return NaN; // Just in case } } function set$1(mom, unit, value) { var d, isUTC, year, month, date; if (!mom.isValid() || isNaN(value)) { return; } d = mom._d; isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value)); case 'Seconds': return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value)); case 'Minutes': return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value)); case 'Hours': return void (isUTC ? d.setUTCHours(value) : d.setHours(value)); case 'Date': return void (isUTC ? d.setUTCDate(value) : d.setDate(value)); // case 'Day': // Not real // return void (isUTC ? d.setUTCDay(value) : d.setDay(value)); // case 'Month': // Not used because we need to pass two variables // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value)); case 'FullYear': break; // See below ... default: return; // Just in case } year = value; month = mom.month(); date = mom.date(); date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date; void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date)); } // MOMENTS function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length; for (i = 0; i < prioritizedLen; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } function mod(n, x) { return ((n % x) + x) % x; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - ((modMonth % 7) % 2); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // PARSING addRegexToken('M', match1to2, match1to2NoLeadingZero); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format) { if (!m) { return isArray(this._months) ? this._months : this._months['standalone']; } return isArray(this._months) ? this._months[m.month()] : this._months[ (this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone' ][m.month()]; } function localeMonthsShort(m, format) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[ MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' ][m.month()]; } function handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort( mom, '' ).toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp( '^' + this.months(mom, '').replace('.', '') + '$', 'i' ); this._shortMonthsParse[i] = new RegExp( '^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i' ); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName) ) { return i; } else if ( strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName) ) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth(mom, value) { if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (!isNumber(value)) { return mom; } } } var month = value, date = mom.date(); date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month)); void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date)); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, 'Month'); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, '_monthsShortRegex')) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, '_monthsRegex')) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); shortP = regexEscape(this.monthsShort(mom, '')); longP = regexEscape(this.months(mom, '')); shortPieces.push(shortP); longPieces.push(longP); mixedPieces.push(longP); mixedPieces.push(shortP); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._monthsShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); } function createDate(y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date; // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } function createUTCDate(y) { var date, args; // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear, }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear, }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // PARSING addRegexToken('w', match1to2, match1to2NoLeadingZero); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2, match1to2NoLeadingZero); addRegexToken('WW', match1to2, match2); addWeekParseToken( ['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); } ); // HELPERS // LOCALES function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } // MOMENTS function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } function parseIsoWeekday(input, locale) { if (typeof input === 'string') { return locale.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } // LOCALES function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[ m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone' ]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin( mom, '' ).toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort( mom, '' ).toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp( '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i' ); this._shortWeekdaysParse[i] = new RegExp( '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i' ); this._minWeekdaysParse[i] = new RegExp( '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i' ); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName) ) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = get(this, 'Day'); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, '_weekdaysRegex')) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, '_weekdaysShortRegex')) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, '_weekdaysMinRegex')) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, '')); shortp = regexEscape(this.weekdaysShort(mom, '')); longp = regexEscape(this.weekdays(mom, '')); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._weekdaysShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); this._weekdaysMinStrictRegex = new RegExp( '^(' + minPieces.join('|') + ')', 'i' ); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return ( '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return ( '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem( this.hours(), this.minutes(), lowercase ); }); } meridiem('a', true); meridiem('A', false); // PARSING function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2, match1to2HasZero); addRegexToken('h', match1to2, match1to2NoLeadingZero); addRegexToken('k', match1to2, match1to2NoLeadingZero); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('kk', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['k', 'kk'], function (input, array, config) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM(input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return (input + '').toLowerCase().charAt(0) === 'p'; } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, // Setting the hour should keep the time, because the user explicitly // specified which hour they want. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. getSetHour = makeGetSet('Hours', true); function localeMeridiem(hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse, }; // internal storage for locale config files var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if ( next && next.length >= j && commonPrefix(split, next) >= j - 1 ) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; } function isLocaleNameSane(name) { // Prevent names that look like filesystem paths, i.e contain '/' or '\' // Ensure name is available and function returns boolean return !!(name && name.match('^[^/\\\\]*$')); } function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name) ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; __webpack_require__(946)("./" + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if (typeof console !== 'undefined' && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn( 'Locale ' + key + ' not found. Did you forget to load it?' ); } } } return globalLocale._abbr; } function defineLocale(name, config) { if (config !== null) { var locale, parentConfig = baseConfig; config.abbr = name; if (locales[name] != null) { deprecateSimple( 'defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' ); parentConfig = locales[name]._config; } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { parentConfig = locales[config.parentLocale]._config; } else { locale = loadLocale(config.parentLocale); if (locale != null) { parentConfig = locale._config; } else { if (!localeFamilies[config.parentLocale]) { localeFamilies[config.parentLocale] = []; } localeFamilies[config.parentLocale].push({ name: name, config: config, }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config)); if (localeFamilies[name]) { localeFamilies[name].forEach(function (x) { defineLocale(x.name, x.config); }); } // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { // Update existing child locale in-place to avoid memory-leaks locales[name].set(mergeConfigs(locales[name]._config, config)); } else { // MERGE tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); if (tmpLocale == null) { // updateLocale is called for creating a new locale // Set abbr so it will have a name (getters return // undefined otherwise). config.abbr = name; } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; } // backwards compat for now: also set the locale getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function getLocale(key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function listLocales() { return keys(locales); } function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if ( getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE) ) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false], ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/], ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60, }; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDatesLen; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimesLen; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } function extractFromRFC2822Strings( yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr ) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10), ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2000 + year; } else if (year <= 999) { return 1900 + year; } return year; } function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^()]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { if (weekdayStr) { // TODO: Replace the vanilla JS Date object with an independent day-of-week check. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date( parsedInput[0], parsedInput[1], parsedInput[2] ).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config).weekdayMismatch = true; config._isValid = false; return false; } } return true; } function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { // the only allowed military tz is Z return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } // date and time from ref 2822 format function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings( match[4], match[3], match[2], match[5], match[6], match[7] ); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } } // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } if (config._strict) { config._isValid = false; } else { // Final attempt, use Input Fallback hooks.createFromInputFallback(config); } } hooks.createFromInputFallback = deprecate( 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(hooks.now()); if (config._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate(), ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray(config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if ( config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0 ) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if ( config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0 ) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply( null, input ); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if ( config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday ) { getParsingFlags(config).weekdayMismatch = true; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults( w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year ); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. week = defaults(w.w, curWeek.week); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from beginning of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to beginning of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form hooks.RFC_2822 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; tokenLen = tokens.length; for (i = 0; i < tokenLen; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice( string.indexOf(parsedInput) + parsedInput.length ); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if ( config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0 ) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap( config._locale, config._a[HOUR], config._meridiem ); // handle era era = getParsingFlags(config).era; if (era !== null) { config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); } configFromArray(config); checkOverflow(config); } function meridiemFixWrap(locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length; if (configfLen === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < configfLen; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if ( scoreToBeat == null || currentScore < scoreToBeat || validFormatFound ) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i), dayOrDate = i.day === undefined ? i.date : i.day; config._a = map( [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); } ); configFromArray(config); } function createFromConfig(config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig(config) { var input = config._i, format = config._f; config._locale = config._locale || getLocale(config._l); if (input === null || (format === undefined && input === '')) { return createInvalid({ nullInput: true }); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config._d = input; } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else { configFromInput(config); } if (!isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (isUndefined(input)) { config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (isObject(input)) { configFromObject(config); } else if (isNumber(input)) { // from milliseconds config._d = new Date(input); } else { hooks.createFromInputFallback(config); } } function createLocalOrUTC(input, format, locale, strict, isUTC) { var c = {}; if (format === true || format === false) { strict = format; format = undefined; } if (locale === true || locale === false) { strict = locale; locale = undefined; } if ( (isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0) ) { input = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } } ), prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min() { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max() { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +new Date(); }; var ordering = [ 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', ]; function isDurationValid(m) { var key, unitHasDecimal = false, i, orderLen = ordering.length; for (key in m) { if ( hasOwnProp(m, key) && !( indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])) ) ) { return false; } } for (i = 0; i < orderLen; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; // only allow non-integers for smallest unit } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } function isValid$1() { return this._isValid; } function createInvalid$1() { return createDuration(NaN); } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ( (dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) ) { diffs++; } } return diffs + lengthDiff; } // FORMATTING function offset(token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(), sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return ( sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2) ); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || '').match(matcher), chunk, parts, minutes; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; minutes = +(parts[1] * 60) + toInt(parts[2]); return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } function getDateOffset(m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset()); } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset(input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract( this, createDuration(input - offset, 'm'), 1, false ); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === 'string') { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime() { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal() { return this.isValid() ? !this._isUTC : false; } function isUtcOffset() { return this.isValid() ? this._isUTC : false; } function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months, }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if ((match = aspNetRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match }; } else if ((match = isoRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), w: parseIso(match[4], sign), d: parseIso(match[5], sign), h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign), }; } else if (duration == null) { // checks for null or undefined duration = {}; } else if ( typeof duration === 'object' && ('from' in duration || 'to' in duration) ) { diffRes = momentsDifference( createLocal(duration.from), createLocal(duration.to) ); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, '_isValid')) { ret._isValid = input._isValid; } return ret; } createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, 'M'); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple( name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' ); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (months) { setMonth(mom, get(mom, 'Month') + months * isAdding); } if (days) { set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); } if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days || months); } } var add = createAdder(1, 'add'), subtract = createAdder(-1, 'subtract'); function isString(input) { return typeof input === 'string' || input instanceof String; } // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined function isMomentInput(input) { return ( isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined ); } function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms', ], i, property, propertyLen = properties.length; for (i = 0; i < propertyLen; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function (item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function getCalendarFormat(myMoment, now) { var diff = myMoment.diff(now, 'days', true); return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; } function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { if (!arguments[0]) { time = undefined; formats = undefined; } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = undefined; } } // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf('day'), format = hooks.calendarFormat(this, sod) || 'sameElse', output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); return this.format( output || this.localeData().calendar(format, this, createLocal(now)) ); } function clone() { return new Moment(this); } function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween(from, to, units, inclusivity) { var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || '()'; return ( (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)) ); } function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return ( this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf() ); } } function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case 'year': output = monthDiff(this, that) / 12; break; case 'month': output = monthDiff(this, that); break; case 'quarter': output = monthDiff(this, that) / 3; break; case 'second': output = (this - that) / 1e3; break; // 1000 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst default: output = this - that; } return asFloat ? output : absFloor(output); } function monthDiff(a, b) { if (a.date() < b.date()) { // end-of-month calculations work correct when the start month has more // days than the end month. return -monthDiff(b, a); } // difference in months var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString() { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment( m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) .toISOString() .replace('Z', formatMoment(m, 'Z')); } } return formatMoment( m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } /** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function inspect() { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment', zone = '', prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } prefix = '[' + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; datetime = '-MM-DD[T]HH:mm:ss.SSS'; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ to: this, from: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData() { return this._locale; } var MS_PER_SECOND = 1000, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; } function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year(), 0, 1); break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3), 1 ); break; case 'month': time = startOfDate(this.year(), this.month(), 1); break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() ); break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) ); break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date()); break; case 'hour': time = this._d.valueOf(); time -= mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ); break; case 'minute': time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case 'second': time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year() + 1, 0, 1) - 1; break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3) + 3, 1 ) - 1; break; case 'month': time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() + 7 ) - 1; break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7 ) - 1; break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case 'hour': time = this._d.valueOf(); time += MS_PER_HOUR - mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ) - 1; break; case 'minute': time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case 'second': time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; } function unix() { return Math.floor(this.valueOf() / 1000); } function toDate() { return new Date(this.valueOf()); } function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; } function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds(), }; } function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function isValid$2() { return isValid(this); } function parsingFlags() { return extend({}, getParsingFlags(this)); } function invalidAt() { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; } addFormatToken('N', 0, 0, 'eraAbbr'); addFormatToken('NN', 0, 0, 'eraAbbr'); addFormatToken('NNN', 0, 0, 'eraAbbr'); addFormatToken('NNNN', 0, 0, 'eraName'); addFormatToken('NNNNN', 0, 0, 'eraNarrow'); addFormatToken('y', ['y', 1], 'yo', 'eraYear'); addFormatToken('y', ['yy', 2], 0, 'eraYear'); addFormatToken('y', ['yyy', 3], 0, 'eraYear'); addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); addRegexToken('N', matchEraAbbr); addRegexToken('NN', matchEraAbbr); addRegexToken('NNN', matchEraAbbr); addRegexToken('NNNN', matchEraName); addRegexToken('NNNNN', matchEraNarrow); addParseToken( ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) { var era = config._locale.erasParse(input, token, config._strict); if (era) { getParsingFlags(config).era = era; } else { getParsingFlags(config).invalidEra = input; } } ); addRegexToken('y', matchUnsigned); addRegexToken('yy', matchUnsigned); addRegexToken('yyy', matchUnsigned); addRegexToken('yyyy', matchUnsigned); addRegexToken('yo', matchEraYearOrdinal); addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); addParseToken(['yo'], function (input, array, config, token) { var match; if (config._locale._eraYearOrdinalRegex) { match = input.match(config._locale._eraYearOrdinalRegex); } if (config._locale.eraYearOrdinalParse) { array[YEAR] = config._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time date = hooks(eras[i].since).startOf('day'); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case 'undefined': eras[i].until = +Infinity; break; case 'string': // truncate time date = hooks(eras[i].until).startOf('day').valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format) { case 'N': case 'NN': case 'NNN': if (abbr === eraName) { return eras[i]; } break; case 'NNNN': if (name === eraName) { return eras[i]; } break; case 'NNNNN': if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } } function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ''; } function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ''; } function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ''; } function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.clone().startOf('day').valueOf(); if ( (eras[i].since <= val && val <= eras[i].until) || (eras[i].until <= val && val <= eras[i].since) ) { return ( (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset ); } } return this.year(); } function erasNameRegex(isStrict) { if (!hasOwnProp(this, '_erasNameRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, '_erasAbbrRegex')) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, '_erasNarrowRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } function matchEraAbbr(isStrict, locale) { return locale.erasAbbrRegex(isStrict); } function matchEraName(isStrict, locale) { return locale.erasNameRegex(isStrict); } function matchEraNarrow(isStrict, locale) { return locale.erasNarrowRegex(isStrict); } function matchEraYearOrdinal(isStrict, locale) { return locale._eraYearOrdinalRegex || matchUnsigned; } function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { erasName = regexEscape(eras[i].name); erasAbbr = regexEscape(eras[i].abbr); erasNarrow = regexEscape(eras[i].narrow); namePieces.push(erasName); abbrPieces.push(erasAbbr); narrowPieces.push(erasNarrow); mixedPieces.push(erasName); mixedPieces.push(erasAbbr); mixedPieces.push(erasNarrow); } this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); this._erasNarrowRegex = new RegExp( '^(' + narrowPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken( ['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); } ); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy ); } function getSetISOWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.isoWeek(), this.isoWeekday(), 1, 4 ); } function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + (this.month() % 3)); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // PARSING addRegexToken('D', match1to2, match1to2NoLeadingZero); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { // TODO: Remove "ordinalParse" fallback in next major release. return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); } // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // PARSING addRegexToken('m', match1to2, match1to2HasZero); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // PARSING addRegexToken('s', match1to2, match1to2HasZero); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token, getSetMillisecond; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr() { return this._isUTC ? 'UTC' : ''; } function getZoneName() { return this._isUTC ? 'Coordinated Universal Time' : ''; } var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== 'undefined' && Symbol.for != null) { proto[Symbol.for('nodejs.util.inspect.custom')] = function () { return 'Moment<' + this.format() + '>'; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate( 'dates accessor is deprecated. Use date instead.', getSetDayOfMonth ); proto.months = deprecate( 'months accessor is deprecated. Use month instead', getSetMonth ); proto.years = deprecate( 'years accessor is deprecated. Use year instead', getSetYear ); proto.zone = deprecate( 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone ); proto.isDSTShifted = deprecate( 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted ); function createUnix(input) { return createLocal(input * 1000); } function createInZone() { return createLocal.apply(null, arguments).parseZone(); } function preParsePostFormat(string) { return string; } var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = []; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; } function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); } function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } getSetGlobalLocale('en', { eras: [ { since: '0001-01-01', until: +Infinity, offset: 1, name: 'Anno Domini', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: 'Before Christ', narrow: 'BC', abbr: 'BC', }, ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = toInt((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); // Side effect imports hooks.lang = deprecate( 'moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale ); hooks.langData = deprecate( 'moment.langData is deprecated. Use moment.localeData instead.', getLocale ); var mathAbs = Math.abs; function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function add$1(input, value) { return addSubtract$1(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if ( !( (milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0) ) ) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths(days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return (days * 4800) / 146097; } function monthsToDays(months) { // the reverse of daysToMonths return (months * 146097) / 4800; } function as(units) { if (!this.isValid()) { return NaN; } var days, months, milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'quarter' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); switch (units) { case 'month': return months; case 'quarter': return months / 3; case 'year': return months / 12; } } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week': return days / 7 + milliseconds / 6048e5; case 'day': return days + milliseconds / 864e5; case 'hour': return days * 24 + milliseconds / 36e5; case 'minute': return days * 1440 + milliseconds / 6e4; case 'second': return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } function makeAs(alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'), asSeconds = makeAs('s'), asMinutes = makeAs('m'), asHours = makeAs('h'), asDays = makeAs('d'), asWeeks = makeAs('w'), asMonths = makeAs('M'), asQuarters = makeAs('Q'), asYears = makeAs('y'), valueOf$1 = asMilliseconds; function clone$1() { return createDuration(this); } function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + 's']() : NaN; } function makeGetter(name) { return function () { return this.isValid() ? this._data[name] : NaN; }; } var milliseconds = makeGetter('milliseconds'), seconds = makeGetter('seconds'), minutes = makeGetter('minutes'), hours = makeGetter('hours'), days = makeGetter('days'), months = makeGetter('months'), years = makeGetter('years'); function weeks() { return absFloor(this.days() / 7); } var round = Math.round, thresholds = { ss: 44, // a few seconds to seconds s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month/week w: null, // weeks to month M: 11, // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { var duration = createDuration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = (seconds <= thresholds.ss && ['s', seconds]) || (seconds < thresholds.s && ['ss', seconds]) || (minutes <= 1 && ['m']) || (minutes < thresholds.m && ['mm', minutes]) || (hours <= 1 && ['h']) || (hours < thresholds.h && ['hh', hours]) || (days <= 1 && ['d']) || (days < thresholds.d && ['dd', days]); if (thresholds.w != null) { a = a || (weeks <= 1 && ['w']) || (weeks < thresholds.w && ['ww', weeks]); } a = a || (months <= 1 && ['M']) || (months < thresholds.M && ['MM', months]) || (years <= 1 && ['y']) || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set the rounding function for relative time strings function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof roundingFunction === 'function') { round = roundingFunction; return true; } return false; } // This function allows you to set a threshold for relative time strings function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; } function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale, output; if (typeof argWithSuffix === 'object') { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === 'boolean') { withSuffix = argWithSuffix; } if (typeof argThresholds === 'object') { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } function toISOString$1() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; totalSign = total < 0 ? '-' : ''; ymSign = sign(this._months) !== sign(total) ? '-' : ''; daysSign = sign(this._days) !== sign(total) ? '-' : ''; hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; return ( totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '') ); } var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate( 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1 ); proto$2.lang = lang; // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); //! moment.js hooks.version = '2.30.1'; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats hooks.HTML5_FMT = { DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // DATE: 'YYYY-MM-DD', // TIME: 'HH:mm', // TIME_SECONDS: 'HH:mm:ss', // TIME_MS: 'HH:mm:ss.SSS', // WEEK: 'GGGG-[W]WW', // MONTH: 'YYYY-MM', // }; return hooks; }))); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(945)(module))) /***/ }), /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PROP_TYPE_ANY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return PROP_TYPE_ARRAY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return PROP_TYPE_BOOLEAN; }); /* unused harmony export PROP_TYPE_DATE */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return PROP_TYPE_FUNCTION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return PROP_TYPE_NUMBER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return PROP_TYPE_OBJECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return PROP_TYPE_REG_EXP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return PROP_TYPE_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return PROP_TYPE_ARRAY_FUNCTION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return PROP_TYPE_ARRAY_OBJECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return PROP_TYPE_ARRAY_OBJECT_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return PROP_TYPE_ARRAY_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return PROP_TYPE_BOOLEAN_NUMBER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return PROP_TYPE_BOOLEAN_NUMBER_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return PROP_TYPE_BOOLEAN_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return PROP_TYPE_DATE_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return PROP_TYPE_FUNCTION_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return PROP_TYPE_NUMBER_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return PROP_TYPE_NUMBER_OBJECT_STRING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return PROP_TYPE_OBJECT_FUNCTION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return PROP_TYPE_OBJECT_STRING; }); // General types var PROP_TYPE_ANY = undefined; var PROP_TYPE_ARRAY = Array; var PROP_TYPE_BOOLEAN = Boolean; var PROP_TYPE_DATE = Date; var PROP_TYPE_FUNCTION = Function; var PROP_TYPE_NUMBER = Number; var PROP_TYPE_OBJECT = Object; var PROP_TYPE_REG_EXP = RegExp; var PROP_TYPE_STRING = String; // Multiple types var PROP_TYPE_ARRAY_FUNCTION = [PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION]; var PROP_TYPE_ARRAY_OBJECT = [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT]; var PROP_TYPE_ARRAY_OBJECT_STRING = [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING]; var PROP_TYPE_ARRAY_STRING = [PROP_TYPE_ARRAY, PROP_TYPE_STRING]; var PROP_TYPE_BOOLEAN_NUMBER = [PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER]; var PROP_TYPE_BOOLEAN_NUMBER_STRING = [PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER, PROP_TYPE_STRING]; var PROP_TYPE_BOOLEAN_STRING = [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING]; var PROP_TYPE_DATE_STRING = [PROP_TYPE_DATE, PROP_TYPE_STRING]; var PROP_TYPE_FUNCTION_STRING = [PROP_TYPE_FUNCTION, PROP_TYPE_STRING]; var PROP_TYPE_NUMBER_STRING = [PROP_TYPE_NUMBER, PROP_TYPE_STRING]; var PROP_TYPE_NUMBER_OBJECT_STRING = [PROP_TYPE_NUMBER, PROP_TYPE_OBJECT, PROP_TYPE_STRING]; var PROP_TYPE_OBJECT_FUNCTION = [PROP_TYPE_OBJECT, PROP_TYPE_FUNCTION]; var PROP_TYPE_OBJECT_STRING = [PROP_TYPE_OBJECT, PROP_TYPE_STRING]; /***/ }), /* 4 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NAME_ALERT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NAME_ASPECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NAME_AVATAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return NAME_AVATAR_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return NAME_BADGE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return NAME_BREADCRUMB; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return NAME_BREADCRUMB_ITEM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return NAME_BREADCRUMB_LINK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return NAME_BUTTON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return NAME_BUTTON_CLOSE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return NAME_BUTTON_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return NAME_BUTTON_TOOLBAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return NAME_CALENDAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return NAME_CARD; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return NAME_CARD_BODY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return NAME_CARD_FOOTER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return NAME_CARD_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return NAME_CARD_HEADER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return NAME_CARD_IMG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return NAME_CARD_IMG_LAZY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return NAME_CARD_SUB_TITLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return NAME_CARD_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return NAME_CARD_TITLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return NAME_CAROUSEL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return NAME_CAROUSEL_SLIDE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return NAME_COL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return NAME_COLLAPSE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return NAME_CONTAINER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return NAME_DROPDOWN; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return NAME_DROPDOWN_DIVIDER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return NAME_DROPDOWN_FORM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return NAME_DROPDOWN_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return NAME_DROPDOWN_HEADER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return NAME_DROPDOWN_ITEM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return NAME_DROPDOWN_ITEM_BUTTON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return NAME_DROPDOWN_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return NAME_EMBED; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "M", function() { return NAME_FORM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "O", function() { return NAME_FORM_CHECKBOX; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return NAME_FORM_CHECKBOX_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return NAME_FORM_DATALIST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "R", function() { return NAME_FORM_DATEPICKER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return NAME_FORM_FILE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "T", function() { return NAME_FORM_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return NAME_FORM_INPUT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "V", function() { return NAME_FORM_INVALID_FEEDBACK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "W", function() { return NAME_FORM_RADIO; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "X", function() { return NAME_FORM_RADIO_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Y", function() { return NAME_FORM_RATING; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_0", function() { return NAME_FORM_ROW; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_1", function() { return NAME_FORM_SELECT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_2", function() { return NAME_FORM_SELECT_OPTION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_3", function() { return NAME_FORM_SELECT_OPTION_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_4", function() { return NAME_FORM_SPINBUTTON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_5", function() { return NAME_FORM_TAG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_6", function() { return NAME_FORM_TAGS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_7", function() { return NAME_FORM_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_8", function() { return NAME_FORM_TEXTAREA; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_9", function() { return NAME_FORM_TIMEPICKER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_10", function() { return NAME_FORM_VALID_FEEDBACK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_11", function() { return NAME_ICON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_12", function() { return NAME_ICONSTACK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_13", function() { return NAME_ICON_BASE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_14", function() { return NAME_IMG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_15", function() { return NAME_IMG_LAZY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_16", function() { return NAME_INPUT_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_17", function() { return NAME_INPUT_GROUP_ADDON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_18", function() { return NAME_INPUT_GROUP_APPEND; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_19", function() { return NAME_INPUT_GROUP_PREPEND; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_20", function() { return NAME_INPUT_GROUP_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_21", function() { return NAME_JUMBOTRON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_22", function() { return NAME_LINK; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_23", function() { return NAME_LIST_GROUP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_24", function() { return NAME_LIST_GROUP_ITEM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_25", function() { return NAME_MEDIA; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_26", function() { return NAME_MEDIA_ASIDE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_27", function() { return NAME_MEDIA_BODY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_28", function() { return NAME_MODAL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_29", function() { return NAME_MSG_BOX; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_30", function() { return NAME_NAV; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_31", function() { return NAME_NAVBAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_32", function() { return NAME_NAVBAR_BRAND; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_33", function() { return NAME_NAVBAR_NAV; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_34", function() { return NAME_NAVBAR_TOGGLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_35", function() { return NAME_NAV_FORM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_36", function() { return NAME_NAV_ITEM; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_37", function() { return NAME_NAV_ITEM_DROPDOWN; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_38", function() { return NAME_NAV_TEXT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_39", function() { return NAME_OVERLAY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_40", function() { return NAME_PAGINATION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_41", function() { return NAME_PAGINATION_NAV; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_42", function() { return NAME_POPOVER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_46", function() { return NAME_PROGRESS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_47", function() { return NAME_PROGRESS_BAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_48", function() { return NAME_ROW; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_49", function() { return NAME_SIDEBAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_50", function() { return NAME_SKELETON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_51", function() { return NAME_SKELETON_ICON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_52", function() { return NAME_SKELETON_IMG; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_53", function() { return NAME_SKELETON_TABLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_54", function() { return NAME_SKELETON_WRAPPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_55", function() { return NAME_SPINNER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_56", function() { return NAME_TAB; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_57", function() { return NAME_TABLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_58", function() { return NAME_TABLE_CELL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_59", function() { return NAME_TABLE_LITE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_60", function() { return NAME_TABLE_SIMPLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_61", function() { return NAME_TABS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_63", function() { return NAME_TBODY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_64", function() { return NAME_TFOOT; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_65", function() { return NAME_TH; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_66", function() { return NAME_THEAD; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_67", function() { return NAME_TIME; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_68", function() { return NAME_TOAST; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_69", function() { return NAME_TOASTER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_71", function() { return NAME_TOOLTIP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_74", function() { return NAME_TR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return NAME_COLLAPSE_HELPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "N", function() { return NAME_FORM_BUTTON_LABEL_CONTROL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Z", function() { return NAME_FORM_RATING_STAR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_43", function() { return NAME_POPOVER_HELPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_44", function() { return NAME_POPOVER_TEMPLATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_45", function() { return NAME_POPPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_62", function() { return NAME_TAB_BUTTON_HELPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_70", function() { return NAME_TOAST_POP; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_72", function() { return NAME_TOOLTIP_HELPER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_73", function() { return NAME_TOOLTIP_TEMPLATE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_75", function() { return NAME_TRANSITION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_76", function() { return NAME_TRANSPORTER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_77", function() { return NAME_TRANSPORTER_TARGET; }); // Component names var NAME_ALERT = 'BAlert'; var NAME_ASPECT = 'BAspect'; var NAME_AVATAR = 'BAvatar'; var NAME_AVATAR_GROUP = 'BAvatarGroup'; var NAME_BADGE = 'BBadge'; var NAME_BREADCRUMB = 'BBreadcrumb'; var NAME_BREADCRUMB_ITEM = 'BBreadcrumbItem'; var NAME_BREADCRUMB_LINK = 'BBreadcrumbLink'; var NAME_BUTTON = 'BButton'; var NAME_BUTTON_CLOSE = 'BButtonClose'; var NAME_BUTTON_GROUP = 'BButtonGroup'; var NAME_BUTTON_TOOLBAR = 'BButtonToolbar'; var NAME_CALENDAR = 'BCalendar'; var NAME_CARD = 'BCard'; var NAME_CARD_BODY = 'BCardBody'; var NAME_CARD_FOOTER = 'BCardFooter'; var NAME_CARD_GROUP = 'BCardGroup'; var NAME_CARD_HEADER = 'BCardHeader'; var NAME_CARD_IMG = 'BCardImg'; var NAME_CARD_IMG_LAZY = 'BCardImgLazy'; var NAME_CARD_SUB_TITLE = 'BCardSubTitle'; var NAME_CARD_TEXT = 'BCardText'; var NAME_CARD_TITLE = 'BCardTitle'; var NAME_CAROUSEL = 'BCarousel'; var NAME_CAROUSEL_SLIDE = 'BCarouselSlide'; var NAME_COL = 'BCol'; var NAME_COLLAPSE = 'BCollapse'; var NAME_CONTAINER = 'BContainer'; var NAME_DROPDOWN = 'BDropdown'; var NAME_DROPDOWN_DIVIDER = 'BDropdownDivider'; var NAME_DROPDOWN_FORM = 'BDropdownForm'; var NAME_DROPDOWN_GROUP = 'BDropdownGroup'; var NAME_DROPDOWN_HEADER = 'BDropdownHeader'; var NAME_DROPDOWN_ITEM = 'BDropdownItem'; var NAME_DROPDOWN_ITEM_BUTTON = 'BDropdownItemButton'; var NAME_DROPDOWN_TEXT = 'BDropdownText'; var NAME_EMBED = 'BEmbed'; var NAME_FORM = 'BForm'; var NAME_FORM_CHECKBOX = 'BFormCheckbox'; var NAME_FORM_CHECKBOX_GROUP = 'BFormCheckboxGroup'; var NAME_FORM_DATALIST = 'BFormDatalist'; var NAME_FORM_DATEPICKER = 'BFormDatepicker'; var NAME_FORM_FILE = 'BFormFile'; var NAME_FORM_GROUP = 'BFormGroup'; var NAME_FORM_INPUT = 'BFormInput'; var NAME_FORM_INVALID_FEEDBACK = 'BFormInvalidFeedback'; var NAME_FORM_RADIO = 'BFormRadio'; var NAME_FORM_RADIO_GROUP = 'BFormRadioGroup'; var NAME_FORM_RATING = 'BFormRating'; var NAME_FORM_ROW = 'BFormRow'; var NAME_FORM_SELECT = 'BFormSelect'; var NAME_FORM_SELECT_OPTION = 'BFormSelectOption'; var NAME_FORM_SELECT_OPTION_GROUP = 'BFormSelectOptionGroup'; var NAME_FORM_SPINBUTTON = 'BFormSpinbutton'; var NAME_FORM_TAG = 'BFormTag'; var NAME_FORM_TAGS = 'BFormTags'; var NAME_FORM_TEXT = 'BFormText'; var NAME_FORM_TEXTAREA = 'BFormTextarea'; var NAME_FORM_TIMEPICKER = 'BFormTimepicker'; var NAME_FORM_VALID_FEEDBACK = 'BFormValidFeedback'; var NAME_ICON = 'BIcon'; var NAME_ICONSTACK = 'BIconstack'; var NAME_ICON_BASE = 'BIconBase'; var NAME_IMG = 'BImg'; var NAME_IMG_LAZY = 'BImgLazy'; var NAME_INPUT_GROUP = 'BInputGroup'; var NAME_INPUT_GROUP_ADDON = 'BInputGroupAddon'; var NAME_INPUT_GROUP_APPEND = 'BInputGroupAppend'; var NAME_INPUT_GROUP_PREPEND = 'BInputGroupPrepend'; var NAME_INPUT_GROUP_TEXT = 'BInputGroupText'; var NAME_JUMBOTRON = 'BJumbotron'; var NAME_LINK = 'BLink'; var NAME_LIST_GROUP = 'BListGroup'; var NAME_LIST_GROUP_ITEM = 'BListGroupItem'; var NAME_MEDIA = 'BMedia'; var NAME_MEDIA_ASIDE = 'BMediaAside'; var NAME_MEDIA_BODY = 'BMediaBody'; var NAME_MODAL = 'BModal'; var NAME_MSG_BOX = 'BMsgBox'; var NAME_NAV = 'BNav'; var NAME_NAVBAR = 'BNavbar'; var NAME_NAVBAR_BRAND = 'BNavbarBrand'; var NAME_NAVBAR_NAV = 'BNavbarNav'; var NAME_NAVBAR_TOGGLE = 'BNavbarToggle'; var NAME_NAV_FORM = 'BNavForm'; var NAME_NAV_ITEM = 'BNavItem'; var NAME_NAV_ITEM_DROPDOWN = 'BNavItemDropdown'; var NAME_NAV_TEXT = 'BNavText'; var NAME_OVERLAY = 'BOverlay'; var NAME_PAGINATION = 'BPagination'; var NAME_PAGINATION_NAV = 'BPaginationNav'; var NAME_POPOVER = 'BPopover'; var NAME_PROGRESS = 'BProgress'; var NAME_PROGRESS_BAR = 'BProgressBar'; var NAME_ROW = 'BRow'; var NAME_SIDEBAR = 'BSidebar'; var NAME_SKELETON = 'BSkeleton'; var NAME_SKELETON_ICON = 'BSkeletonIcon'; var NAME_SKELETON_IMG = 'BSkeletonImg'; var NAME_SKELETON_TABLE = 'BSkeletonTable'; var NAME_SKELETON_WRAPPER = 'BSkeletonWrapper'; var NAME_SPINNER = 'BSpinner'; var NAME_TAB = 'BTab'; var NAME_TABLE = 'BTable'; var NAME_TABLE_CELL = 'BTableCell'; var NAME_TABLE_LITE = 'BTableLite'; var NAME_TABLE_SIMPLE = 'BTableSimple'; var NAME_TABS = 'BTabs'; var NAME_TBODY = 'BTbody'; var NAME_TFOOT = 'BTfoot'; var NAME_TH = 'BTh'; var NAME_THEAD = 'BThead'; var NAME_TIME = 'BTime'; var NAME_TOAST = 'BToast'; var NAME_TOASTER = 'BToaster'; var NAME_TOOLTIP = 'BTooltip'; var NAME_TR = 'BTr'; // Helper component names var NAME_COLLAPSE_HELPER = 'BVCollapse'; var NAME_FORM_BUTTON_LABEL_CONTROL = 'BVFormBtnLabelControl'; var NAME_FORM_RATING_STAR = 'BVFormRatingStar'; var NAME_POPOVER_HELPER = 'BVPopover'; var NAME_POPOVER_TEMPLATE = 'BVPopoverTemplate'; var NAME_POPPER = 'BVPopper'; var NAME_TAB_BUTTON_HELPER = 'BVTabButton'; var NAME_TOAST_POP = 'BVToastPop'; var NAME_TOOLTIP_HELPER = 'BVTooltip'; var NAME_TOOLTIP_TEMPLATE = 'BVTooltipTemplate'; var NAME_TRANSITION = 'BVTransition'; var NAME_TRANSPORTER = 'BVTransporter'; var NAME_TRANSPORTER_TARGET = 'BVTransporterTarget'; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(22); var core = __webpack_require__(60); var hide = __webpack_require__(50); var redefine = __webpack_require__(51); var ctx = __webpack_require__(61); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // extend global if (target) redefine(target, key, out, type & $export.U); // export if (exports[key] != out) hide(exports, key, exp); if (IS_PROTO && expProto[key] != out) expProto[key] = out; } }; global.core = core; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /* 6 */ /***/ (function(module, exports) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function(useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if(item[2]) { return "@media " + item[2] + "{" + content + "}"; } else { return content; } }).join(""); }; // import a list of modules into the list list.i = function(modules, mediaQuery) { if(typeof modules === "string") modules = [[null, modules, ""]]; var alreadyImportedModules = {}; for(var i = 0; i < this.length; i++) { var id = this[i][0]; if(typeof id === "number") alreadyImportedModules[id] = true; } for(i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { if(mediaQuery && !item[2]) { item[2] = mediaQuery; } else if(mediaQuery) { item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra Modified by Evan You @yyx990803 */ var hasDocument = typeof document !== 'undefined' if (typeof DEBUG !== 'undefined' && DEBUG) { if (!hasDocument) { throw new Error( 'vue-style-loader cannot be used in a non-browser environment. ' + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." ) } } var listToStyles = __webpack_require__(916) /* type StyleObject = { id: number; parts: Array } type StyleObjectPart = { css: string; media: string; sourceMap: ?string } */ var stylesInDom = {/* [id: number]: { id: number, refs: number, parts: Array<(obj?: StyleObjectPart) => void> } */} var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) var singletonElement = null var singletonCounter = 0 var isProduction = false var noop = function () {} var options = null var ssrIdKey = 'data-vue-ssr-id' // Force single-tag solution on IE6-9, which has a hard limit on the # of "); newWin.document.write(""); newWin.document.write("
" + '
' + '
' + // first col '
' + "" + this.$header_name + "" + "
" + this.$header_address + "
" + this.$header_contact + "
" + "
" + // "
" + '
' + "SERVICE ORDER FORM" + "
" + "
" + '
' + //row1 '
' + "Project Description: " + this.Job_Order.project_description + "" + "
" + '
' + "Control #: " + this.Job_Order.jo_num + "" + "
" + "
" + //end row1 "
" + '
' + "CLIENT INFORMATION" + "
" + "
" + // '
' + //row2 '
' + "Account Name:" + "
" + '
' + this.Job_Order.client.name + linetransfer + "," + this.Job_Order.client.contact + "
" + "
" + //end row2 // '
' + //row2 '
' + "Address:" + "
" + '
' + location + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Started:" + "
" + '
' + this.Job_Order.date_started_formated + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Finished:" + "
" + '
' + this.Job_Order.date_finished_formated + "
" + "
" + //end row2 // "
" + '
' + "SERVICE REPORT" + "
" + "
" + //SERVICE REPORT ----- SERVICE REPORT ----- SERVICE REPORT----- SERVICE REPORT '
' + //row2 '
' + "Dctech Area:" + "
" + '
' + this.Job_Order.client.branch.area.name + "
" + "
" + //end row2 // '
' + //row2 '
' + "Cable Category:" + "
" + '
' + this.Job_Order.cable_category + "
" + "
" + //end row2 // '
' + //row2 '
' + "Estimated Distance(m):" + "
" + '
' + this.Job_Order.foc_length + "
" + "
" + //end row2 // '
' + //row2 '
' + "Actual Distance(m):" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Rx Power:" + "
" + '
' + "" + "
" + "
" + //end row2 // "
" + '
' + "
" + "
" + // "
" + //Engineer In-Charge: '
' + //row2 '
' + "Engineer In-Charge:" + "
" + '
' + engineer_in_charge_sign + this.Job_Order.engineer.user.name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + // "
" + //Contractor/Lineman: '
' + //row2 '
' + "Contractor/Lineman:" + "
" + '
' + "" + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + '
' + //row1 '
' + "
Prepared by:
" + prepare_sign + "
" + '
' + "
Approved by:
" + approve_sign + "
" + "
" + //end row1 // "
" + '
' + //row1 '
' + '' + this.Job_Order.prepare_engineer.user.name + "" + "
" + '
' + '' + this.Job_Order.approve_engineer.user.name + "" + "
" + "
" + //end row1 // '
' + //row1 '
' + this.Job_Order.prepare_engineer.position + "
" + '
' + this.Job_Order.approve_engineer.position + "
" + "
" + //end row1 // "
" + '
' + "
Noted by:
" + note_sign + "
" + // // "
" + '
' + '' + this.Job_Order.note_engineer.user.name + "" + "
" + '
' + "" + this.Job_Order.note_engineer.position + "" + "
" + "
" + // end first col // // // // //second '
' + // second col '
' + "" + this.$header_name + "" + "
" + this.$header_address + "
" + this.$header_contact + "
" + "
" + '
' + "SERVICE ORDER FORM" + "
" + "
" + '
' + //row1 '
' + "Project Description: " + this.Job_Order.project_description + "" + "
" + '
' + "Control #: " + this.Job_Order.jo_num + "" + "
" + "
" + //end row1 "
" + '
' + "CLIENT INFORMATION" + "
" + "
" + // '
' + //row2 '
' + "Account Name:" + "
" + '
' + this.Job_Order.client.name + linetransfer + "," + this.Job_Order.client.contact + "
" + "
" + //end row2 // '
' + //row2 '
' + "Address:" + "
" + '
' + location + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Started:" + "
" + '
' + this.Job_Order.date_started_formated + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Finished:" + "
" + '
' + this.Job_Order.date_finished_formated + "
" + "
" + //end row2 // "
" + '
' + "SERVICE REPORT" + "
" + "
" + //SERVICE REPORT ----- SERVICE REPORT ----- SERVICE REPORT----- SERVICE REPORT '
' + //row2 '
' + "Dctech Area:" + "
" + '
' + this.Job_Order.client.branch.area.name + "
" + "
" + //end row2 // '
' + //row2 '
' + "Cable Category:" + "
" + '
' + this.Job_Order.cable_category + "
" + "
" + //end row2 // '
' + //row2 '
' + "Estimated Distance (m)" + "
" + '
' + this.Job_Order.foc_length + "
" + "
" + //end row2 // '
' + //row2 '
' + "Actual Distance (m)" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Rx Power:" + "
" + '
' + "" + "
" + "
" + //end row2 // "
" + '
' + "
" + "
" + // "
" + //Engineer In-Charge: '
' + //row2 '
' + "Engineer In-Charge:" + "
" + '
' + engineer_in_charge_sign + this.Job_Order.engineer.user.name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + // "
" + //Contractor/Lineman: '
' + //row2 '
' + "Contractor/Lineman:" + "
" + '
' + "" + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + '
' + //row1 '
' + "Prepared by:" + prepare_sign + "
" + '
' + "Approved by:" + approve_sign + "
" + "
" + //end row1 // "
" + '
' + //row1 '
' + '' + this.Job_Order.prepare_engineer.user.name + "" + "
" + '
' + '' + this.Job_Order.approve_engineer.user.name + "" + "
" + "
" + //end row1 // '
' + //row1 '
' + this.Job_Order.prepare_engineer.position + "
" + '
' + this.Job_Order.approve_engineer.position + "
" + "
" + //end row1 // "
" + '
' + "Noted by:" + note_sign + "
" + // // "
" + '
' + '' + this.Job_Order.note_engineer.user.name + "" + "
" + '
' + "" + this.Job_Order.note_engineer.position + "" + "
" + "
" + // end second col // "
" + "
"); newWin.document.write(""); newWin.alert("If the print preview doesn't " + "show please disable ad blocker or manually press the Ctrl+p. And don't forget to close this page"); newWin.print(); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Error", "Client does not have a branch.Please check account.", "error"); } }, fnExcelReport: function fnExcelReport(tbl) { this.currentPage = 1; this.perPage = this.totalRows; this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; //tab_text=tab_text+""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); this.perPage = 6; return sa; }.bind(this), 1000); }); }, testshit: function testshit() { this.$bvModal.show("modalMultipleFilterForAll"); }, addRemarks_clicked: function addRemarks_clicked() { var _this9 = this; if (this.remarksText != "") { var data = { ticket_id: this.Job_Order.id, user_id: this.user.id, remarks: this.remarksText, form_type: "contractor", ticketType: "6" }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this9.remarksText = ""; _this9.Job_Order.remarks_log = response.body; console.log(response.body); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the remarks text area"); } }, addComments_clicked: function addComments_clicked(id, i, stor) { var _this10 = this; if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.Job_Order.id, ticketType: "6" }; this.$http.post("api/TicketCommentsLog", data).then(function (response) { // this.commentsText[i] = ""; // this.commentsText = ""; _this10.commentsText[i] = ""; _this10.Job_Order.remarks_log = response.body; _this10.$global.scrollComment(i, 2); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the comments text area"); } }, searchClient: function searchClient(query) { this.isLoading = true; if (query != "") { this.$http.get("api/searchClient/" + this.user.region_id + "/" + query).then(function (response) { // console.log(response.body); this.clientOptions = response.body; this.isLoading = false; }); } else { this.isLoading = false; } }, search: function search(query) { console.log(this.searchby, query); this.doSearch = true; this.clientOptions = []; this.currentItem = 0; if (query != "" && query != "." && query != null) { var escape_string = query.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.search_loading = true; this.$http.get("api/jobOrder/search/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); this.clientOptions = response.body.items; if (response.body.count > 10) { this.clientOptions.push({ contact: "*** Show all " + response.body.count + " results...", details: "*** Show all " + response.body.count + " results...", jo_num: "*** Show all " + response.body.count + " results...", job_order_location: "*** Show all " + response.body.count + " results...", location: "*** Show all " + response.body.count + " results...", name: "*** Show all " + response.body.count + " results..." }); } this.search_loading = false; }); } else { this.doSearch = false; this.search_loading = false; this.clientOptions = []; } }, searchItem: function searchItem(item) { if (item.name.substring(0, 3) != "***") { if (this.searchby == "clients.name") this.tblFilter_copy = item.name;else if (this.searchby == "details") this.tblFilter_copy = item.details;else if (this.searchby == "clients.location") this.tblFilter_copy = item.location;else if (this.searchby == "job_orders.location") this.tblFilter_copy = item.job_order_location;else if (this.searchby == "job_orders.jo_num") this.tblFilter_copy = item.jo_num; } else { if (this.searchby == "job_orders.jo_num") this.tblFilter_copy = "[" + this.searchby + "] - " + this.tblFilter_copy; } this.search_data(); }, searchSuggestions: function searchSuggestions(item) { if (this.searchby == "clients.name") return item.name;else if (this.searchby == "details") return item.details;else if (this.searchby == "clients.location") return item.location;else if (this.searchby == "job_orders.location") return item.job_order_location;else if (this.searchby == "job_orders.jo_num") return item.jo_num.toString().substring(0, 3) != "***" ? item.jo_num + " - " + item.name : item.jo_num; }, nextItem: function nextItem(event) { if (event.keyCode == 38 && this.clientOptions.length > 1) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem > 0) { this.currentItem--; } } else if (event.keyCode == 40 && this.currentItem < this.clientOptions.length) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem < this.clientOptions.length - 1) { this.currentItem++; } } if (event.keyCode == 13 && this.clientOptions.length != 0) this.searchItem(this.clientOptions[this.currentItem]); } } }); /***/ }), /* 459 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_filter_vue__ = __webpack_require__(460); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_66d0b262_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_filter_vue__ = __webpack_require__(1003); function injectStyle (ssrContext) { __webpack_require__(999) __webpack_require__(1001) } var normalizeComponent = __webpack_require__(9) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-66d0b262" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_filter_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_66d0b262_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_filter_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 460 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: { data: { type: Object }, filterDone: { type: Function } }, components: { multiselect: __WEBPACK_IMPORTED_MODULE_3_vue_multiselect___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a }, data: function data() { return { connection_status_list: [{ id: "up", name: "Up" }, { id: "down", name: "Down" }, { id: "intermittent", name: "Intermittent" }], user: [], users: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); }, methods: { load: function load() { this.$http.get("api/user").then(function (response) { this.users = response.body; }); }, filter_ok: function filter_ok() { this.filterDone(); } } }); /***/ }), /* 461 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "area.name", label: "Area", sortable: true }, { key: "area.region.name", label: "Region", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50, 100], branch: { name: "", user_id_rm: "", user_id_visor: "" }, user: [], areas: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.tblisBusy = true; this.$http.get("api/Branch").then(function (response) { console.log(response.body); this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); this.$http.get("api/area").then(function (response) { this.areas = response.body; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_branch) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_branch) { this.$bvModal.show("modalEdit"); this.branch = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.branch.user_id = _this.user.id; _this.branch.user_name = _this.user.name; _this.$http.post("api/Branch", _this.branch).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.branch.name = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$http.put("api/Branch/" + _this2.branch.id, _this2.branch).then(function (response) { _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_branch) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this branch permanently", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Branch/" + _this3.branch.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Delete!", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Branch", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 462 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "rm_name", label: "RM name", sortable: true }, { key: "visor_name", label: "Visor name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50, 100], region: { name: "", user_id_rm: "", user_id_visor: "" }, user: [], users: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.items = this.$global.getRegion(); console.log(this.items); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.getUsers(); this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { getUsers: function getUsers() { this.$http.get("api/user").then(function (response) { this.users = response.body; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_region) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_region) { this.$bvModal.show("modalEdit"); this.region = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.region.user_id = _this.user.id; _this.region.user_name = _this.user.name; _this.$http.post("api/Region", _this.region).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.region.name = ""; _this.$global.setRegion(response.body); _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { _this.tblisBusy = false; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$http.put("api/Region/" + _this2.region.id, _this2.region).then(function (response) { _this2.items = response.body; _this2.$global.setRegion(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_region) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this region permanently", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Region/" + _this3.region.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); _this3.$global.setRegion(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Delete!", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Region", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 463 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sweetalert2__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: true, fields: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "description", sortable: true }, { key: "IP", sortable: true }, { key: "user_id", sortable: true }, { key: "role_id", sortable: true }, { key: "version_command", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], bucket: { name: "" }, ssh_items: [], ssh_tblFilter: "", ssh_tblisBusy: false, ssh_totalRows: 0, ssh_output: "", ssh: { bucket: {}, command: "" }, user: [], roles: [], cidr: [], cidr_selected: { id: 0, value: "" }, subnet: { ip: "", cidr: "", details: "" }, subnetField: [{ key: "ip", sortable: true }, { key: "cidr", sortable: true }, { key: "details", sortable: true }, { key: "actions" }], subnet_item: [], table_results: [], editPerRow: { name: false, description: false, IP: false, user_id: false, role_id: false, version_command: false, username: false, password: false }, userBwRoles: [], bucket_roles: ["role_network_admin", "role_network_core", "role_noc", "role_subscription", "role_network_access", "role_support", "role_automation", "role_tech_support"], migrate: [[{ "10.20.3.1": { serial: "RLG4AFEF9F1", bucket: "202.137.112.6", sname: "leah_soriano_bw1" } }], [{ "10.20.3.2": { serial: "RLG4AFEF9F2", bucket: "202.137.112.6", sname: "soriano_bw1" } }], [{ "10.20.3.3": { serial: "RLG4AFEF9F2", bucket: "202.137.112.6", sname: "soriano_bw1" } }]], old_bucket_actions: [], old_bucket_command: {}, new_bucket_actions: [], new_bucket_command: {} }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); //load buckets this.user = this.$global.getUser(); console.log(this.user); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load: function load() { var _this = this; var buck_commands = [{ name: "Add subscription", //0 value: "subscription --add ", role: "role_automation, role_subscription", param: [{ label: "Subscription name", command: "", value: "", type: "text" }, { label: "Description", command: " --desc ", value: "", type: "text" }, { label: "Package", command: " --package_name ", value: "", type: "text" }, { label: "Client Name", command: " --cname ", value: "", type: "text" }] }, { name: "Show subscription", //1 value: "subscription --show ", role: "all", param: [{ label: "Subscription name", command: "", value: "", type: "text" }] }, { name: "Add client", //2 value: "client --add ", role: "role_automation, role_subscription", param: [{ label: "Subscription name", command: "", value: "", type: "text" }, { label: "Description", command: " --cname ", value: "", type: "text" }, { label: "Contact", command: " --contact ", value: "", type: "text" }, { label: "Account #", command: " --acctnum ", value: "", type: "text" }, { label: "Remarks", command: " --remarks ", value: "", type: "text" }] }, { name: "IP assign", //3 value: "ip --assign ", role: "role_automation, role_network_access, role_noc", param: [{ label: "IP", command: "", value: "", type: "text" }, { label: "Subscription name", command: " --subscription_name ", value: "", type: "text" }] }, { name: "Add bandwidth ", //4 value: "bandwidth --add ", role: "role_automation, role_network_access, role_noc", param: [{ label: "Bandwidth Name", command: "", value: "", type: "text" }, { label: "Description", command: " --desc ", value: "", type: "text" }, { label: "max_down", command: " --max_down ", value: "", type: "number" }, { label: "max_up", command: " --max_up ", value: "", type: "number" }, { label: "min_down", command: " --min_down ", value: "", type: "number" }, { label: "min_up", command: " --min_up ", value: "", type: "number" }] }, { name: "Add package", //5 value: "package --add ", role: "role_automation, role_network_access, role_noc", param: [{ label: "Package Name", command: "", value: "", type: "text" }, { label: "Description", command: " --desc ", value: "", type: "text" }, { label: "Bandwidth Name", command: " --bandwidth_name ", value: "", type: "text" }, { label: "Private IP", command: " --private_ip ", value: "", type: "number" }, { label: "Public IP", command: " --public_ip ", value: "", type: "number" }] }, { name: "Show package", //6 value: "package --show ", role: "all", param: [{ label: "Package name", command: "", value: "", type: "text" }] }, { name: "Show bandwidth", //7 value: "bandwidth --show ", role: "all", param: [{ label: "Bandwidth name", command: "", value: "", type: "text" }] }, { name: "IP unassign", //8 value: "ip --unassign ", role: "role_automation, role_network_access, role_noc", param: [{ label: "IP", command: "", value: "", type: "text" }, { label: "Subscription name", command: " --subscription_name ", value: "", type: "text" }] }, { name: "Delete subscription", //9 value: "subscription --delete ", role: "role_automation, role_subscription", param: [{ label: "Subscription name", command: "", value: "", type: "text" }] }, { name: "Delete client", //10 value: "client --delete ", role: "role_automation, role_subscription", param: [{ label: "Client name", command: "", value: "", type: "text" }] }]; //var buck_commands_new = [ this.new_bucket_actions = [{ name: "Autoprov delete", //0 value: "autoprov --delete ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "Unlock Reason", command: " --provision_unlock_reason IS ", value: "1111", type: "text" }] }, { name: "SSID", //1 value: "onuprov --show ", role: "all", param: [{ label: "ONU serial", command: " --onu_name ", value: "", type: "text" }, { label: "ONUSERV name", command: " --onuserv_name ", value: "", type: "text" }] }, { name: "Autoprov Lock", //2 value: "provision --lock ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }] }, { name: "Autoprov Unlock", //3 value: "provision --unlock ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "Unlock Reason", command: " --provision_unlock_reason IS ", value: "1111", type: "text" }] }, { name: "Provision Show", //4 value: "provision --show", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }] }, { name: "ONUSERV Show", //5 value: "onuserv --show ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }] }, { name: "IP show", //6 value: "ip --show ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }] }, { name: "BWPROV show", //7 value: "bwprov --show ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }] }, { name: "bandwidth show", //8 value: "bandwidth --show ", role: "all", param: [{ label: "Bandwidth Name", command: " --bandwidth_name ", value: "", type: "text" }] }, { name: "BWPROV assign", //8 value: "bwprov --assign ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "Bandwidth Name", command: " --bandwidth_name ", value: "", type: "text" }] }, { name: "BWPROV assign cls", //8 value: "bwprov --assign_cls ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "IP Name", command: " --ip_name ", value: "", type: "text" }] }, { name: "BWPROV unassign cls", //8 value: "bwprov --unassign_cls ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "IP Name", command: " --ip_name ", value: "", type: "text" }] }, //vlan --assign_cls --vlan_iplist --vlanint_name --provision_name { name: "VLAN assign cls", //8 value: "vlan --assign_cls ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "vlan_iplist ", command: " --vlan_iplist ", value: "", type: "text" }, { label: "vlanint_name ", command: " --vlanint_name ", value: "", type: "text" }] }, //vlan --unassign_cls --vlan_iplist --provision_name { name: "VLAN unassign cls", //8 value: "vlan --unassign_cls ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "vlan_iplist ", command: " --vlan_iplist ", value: "", type: "text" }] }, //cnicip --add --cnicip_name --provision_name { name: "CNIICIP ADD", value: "cnicip --add ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "cnicip_name ", command: " --cnicip_name ", value: "", type: "text" }] }, //cnicip --delete --cnicip_name { name: "CNIICIP DELETE", value: "cnicip --delete ", role: "all", param: [{ label: "cnicip_name ", command: " --cnicip_name ", value: "", type: "text" }] }, //route --add --route_name --route_gateway --provision_name { name: "ROUTE ADD", value: "route --add ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "route_name ", command: " --route_name ", value: "", type: "text" }, { label: "route_gateway ", command: " --route_gateway ", value: "", type: "text" }] }, //route --delete --route_name --provision_name { name: "ROUTE DELETE", value: "cnicip --delete ", role: "all", param: [{ label: "Provision Name", command: " --provision_name ", value: "", type: "text" }, { label: "route_name ", command: " --route_name ", value: "", type: "text" }] }, { name: "ntools ping", value: "ntools -q -c 5 ", role: "all", param: [{ label: "IP ", command: " --ping ", value: "", type: "text" }] }]; this.$http.get("api/Bucket").then(function (response) { _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; }); this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); var g_roles = this.$keycloak.tokenParsed.group; console.log(this.bucket_roles); this.userBwRoles = g_roles.filter(function (element) { return _this.bucket_roles.includes(element.split("/").pop()); }); console.log(this.userBwRoles); if (this.userBwRoles.length > 0) { this.user.user_roles = ""; this.userBwRoles.forEach(function (elem, idx, array) { elem = elem.replace("/", ""); if (idx == 0) this.user.user_role = elem; this.user.user_roles += elem; if (idx != array.length - 1) { this.user.user_roles += ":"; } //add command base on role buck_commands.forEach(function (com_val) { if (com_val.role == "all") if (!this.old_bucket_actions.includes(com_val)) { this.old_bucket_actions.push(com_val); } if (com_val.role.includes(elem)) { if (!this.old_bucket_actions.includes(com_val)) { this.old_bucket_actions.push(com_val); } } }.bind(this)); // if (elem == "role_subscription") { // this.old_bucket_actions.push(buck_commands[0]); // this.old_bucket_actions.push(buck_commands[1]); // } // if (elem == "role_tech_support") { // this.old_bucket_actions.push(buck_commands[1]); // this.old_bucket_actions.push(buck_commands[6]); // this.old_bucket_actions.push(buck_commands[7]); // } }.bind(this)); } else { this.user.user_role = null; this.user.user_roles = null; } }, customeBucketText: function customeBucketText(bucket) { return bucket.IP + " - " + bucket.name + " - " + bucket.description; }, mousemove: function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_bucket) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_bucket) { this.bucket = item; this.bucket.state = "update"; this.bucket.password = ""; this.subnet_item = this.bucket.subnet; for (var i = 1; i <= 32; i++) { this.cidr.push({ id: i, value: i.toString() }); }this.$bvModal.show("modalAdd"); } }, btnCreate: function btnCreate() { var _this2 = this; if (this.bucket.password != this.bucket.confirmPassword) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ text: "Password and confirm password does not match" }); return 0; } this.$validator.validateAll().then(function (result) { if (result) { _this2.$root.$emit("pageLoading"); _this2.tblisBusy = true; _this2.bucket.user_id_log = _this2.user.id; _this2.bucket.user_name_log = _this2.user.name; _this2.$http.post("api/Bucket", _this2.bucket).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.bucket.name = ""; _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; _this2.$root.$emit("pageLoaded"); _this2.$bvModal.hide("modalAdd"); }).catch(function (response) { _this2.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnUpdate: function btnUpdate() { var _this3 = this; console.log("asdasdasd"); this.$validator.validateAll().then(function (result) { if (result) { _this3.$root.$emit("pageLoading"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.bucket.user_id_log = _this3.user.id; _this3.bucket.user_name_log = _this3.user.name; _this3.$http.put("api/Bucket/" + _this3.bucket.id, _this3.bucket).then(function (response) { _this3.items = response.body; _this3.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this4 = this; if (this.roles.delete_bucket) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.items = []; _this4.tblisBusy = true; _this4.$http.delete("api/Bucket/" + _this4.bucket.id).then(function (response) { _this4.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Bucket", icon: "warning", buttons: true, dangerMode: true }); } }, submit_command: function submit_command() { var _this5 = this; this.$root.$emit("pageLoading"); this.ssh.user_id_log = this.user.id; this.ssh.user_name_log = this.user.name; // this.ssh.command = this.old_bucket_command.value; // //format command // this.old_bucket_command.param.forEach(param => { // this.ssh.command += param.command + param.value; // }); this.$http.post("api/Bucket/ssh_command", this.ssh).then(function (response) { _this5.$root.$emit("pageLoaded"); console.log(response.body); _this5.ssh_items = _this5.ssh_items.concat(response.body.table); _this5.ssh_items = _this5.uniq_fast(_this5.ssh_items); _this5.ssh_totalRows = _this5.ssh_items.length; _this5.ssh_output = response.body.message; }).catch(function (response) { console.log(response.body); _this5.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, fnExcelReport: function fnExcelReport(tbl) { this.$global.excelReportCSV(tbl, "Bucket Table", this); }, uniq_fast: function uniq_fast(a) { var seen = {}; var out = []; var len = a.length; var j = 0; for (var i = 0; i < len; i++) { var item = a[i].name; if (seen[item] !== 1) { seen[item] = 1; out[j++] = a[i]; } } return out; }, btnAddSubnet: function btnAddSubnet() { var _this6 = this; this.$validator.validateAll("subnet_form").then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this6.subnet.bucket_id = _this6.bucket.id; _this6.subnet.cidr = _this6.cidr_selected.value; _this6.subnet.user_id_log = _this6.user.id; _this6.subnet.user_name_log = _this6.user.name; _this6.$http.post("api/Subnet", _this6.subnet).then(function (response) { _this6.items = response.body.bucket.original; _this6.subnet_item = response.body.subnet.original[0].subnet; _this6.subnet = { ip: "", cidr: "", details: "" }; _this6.cidr_selected = {}; _this6.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnRemoveSubnet: function btnRemoveSubnet(item) { var _this7 = this; console.log("eeeE", item); if (this.roles.delete_bucket) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { item.user_id_log = _this7.user.id; item.user_name_log = _this7.user.name; _this7.$http.post("api/Subnet/destroy1", item).then(function (response) { console.log(response.body); _this7.items = response.body.bucket.original; _this7.subnet_item = response.body.subnet.original[0].subnet; _this7.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { _this7.tblisBusy = false; _this7.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Subnet", icon: "warning", buttons: true, dangerMode: true }); } }, closeTable: function closeTable(index) { this.table_results.splice(index, 1); }, submit_command_new1: function submit_command_new1() { var _this8 = this; if (this.ssh.bucket.version_command != 3) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Only version 3 bucket work here");else if (!this.ssh.command.includes("--unlock")) { //check bucket hash expire this.$root.$emit("pageLoading"); var checklogin = true; var bucket_token = this.user.bucket_token; if (bucket_token.length > 0) { bucket_token.forEach(function (token) { if (token.bucket_id == _this8.ssh.bucket.id) { var today = new Date(); var expire_date = new Date(token.expire); // var diff = Math.abs(expire_date - today); // var diff1 = Math.abs(today - expire_date); // var diffMins = Math.floor((diff/1000)/60); // console.log("today: " + today + " expire: " + expire_date + " diffMins: " + diffMins + " diff:" + diff+ " diff1:" + diff1); if (today < expire_date) { checklogin = false; } } }); } console.log(checklogin); this.$root.$emit("pageLoaded"); if (checklogin) { this.user.password = "aaaa"; __WEBPACK_IMPORTED_MODULE_2_sweetalert2___default.a.fire({ title: "Bucket Authentication", text: "please input your password to execute bucket command", input: "password", showCancelButton: true, confirmButtonText: "Execute", showLoaderOnConfirm: true, preConfirm: function preConfirm(pass) { // this.user.user_id =this.user.id; // this.user.username =this.user.email; // this.user.password =pass; _this8.user.password = pass; _this8.$root.$emit("pageLoading"); _this8.user.user_id = _this8.user.id; _this8.user.username = _this8.user.email; _this8.ssh.user = _this8.user; _this8.$http.post("api/Bucket/userBucketCommand", _this8.ssh).then(function (response) { console.log(response.body); _this8.$root.$emit("pageLoaded"); if (response.body.data.original != null) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()(response.body.data.original.error); } else { _this8.table_results.unshift(response.body.data); } _this8.user.bucket_token = response.body.user_bucket_token; }).catch(function (response) { console.log(response.body); _this8.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, allowOutsideClick: function allowOutsideClick() { return !Swal.isLoading(); } }); } else { this.$root.$emit("pageLoading"); this.user.user_id = this.user.id; this.user.username = this.user.email; this.ssh.user = this.user; console.log(this.ssh); this.$http.post("api/Bucket/userBucketCommand", this.ssh).then(function (response) { console.log(response.body); _this8.$root.$emit("pageLoaded"); _this8.table_results.unshift(response.body.data); _this8.user.bucket_token = response.body.user_bucket_token; }).catch(function (response) { console.log(response.body); _this8.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Unlock command can't be executed here."); }, submit_command_new: function submit_command_new() { var _this9 = this; if (this.ssh.bucket.version_command != 3) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Only version 3 bucket work here");else if (!this.ssh.command.includes("--unlock")) { //check bucket hash expire this.$root.$emit("pageLoading"); this.$root.$emit("pageLoading"); this.user.user_id = this.user.id; this.user.username = this.user.email; this.ssh.user = this.user; console.log(this.ssh); this.$http.post("api/Bucket/userBucketCommand", this.ssh).then(function (response) { console.log(response.body); _this9.$root.$emit("pageLoaded"); _this9.table_results.unshift(response.body.data); _this9.user.bucket_token = response.body.user_bucket_token; }).catch(function (response) { console.log(response.body); _this9.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Unlock command can't be executed here."); }, reset: function reset() { this.editPerRow = { name: false, description: false, IP: false, user_id: false, role_id: false, version_command: false, username: false, password: false }; this.bucket = { name: "" }; }, update_per_row: function update_per_row(row, data) { var _this10 = this; if (row == "password") { if (this.bucket.password != this.bucket.confirmPassword) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ text: "Password and confirm password does not match" }); return 0; } } var update = { id: this.bucket.id, data: data, row: row, user_id_log: this.user.id, user_name_log: this.user.name }; this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/update_per_row", update).then(function (response) { console.log(response.body); _this10.items = response.body; _this10.editPerRow = { name: false, description: false, IP: false, user_id: false, role_id: false, version_command: false, username: false, password: false }; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this10.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this10.$root.$emit("pageLoaded"); }); }, executeCommand: function executeCommand() { var _this11 = this; //check bucket hash expire this.ssh.user_id_log = this.user.id; this.ssh.user_name_log = this.user.name; this.ssh.command = this.new_bucket_command.value; //format command this.new_bucket_command.param.forEach(function (param) { _this11.ssh.command += param.command + param.value; }); console.log(this.ssh); this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/adminBucketCommand", this.ssh).then(function (response) { console.log(response.body); _this11.$root.$emit("pageLoaded"); _this11.table_results.unshift(response.body.data); }).catch(function (response) { console.log(response.body); _this11.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } } }); /***/ }), /* 464 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "region.name", label: "Region", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50, 100], regions: "", area: { name: "", region_id: null }, buckettblisBusy: false, bucketField: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "IP", sortable: true }, { key: "actions" }], bucketItems: [], buckets: [], bucketSelected: "", user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { var _this = this; this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/area").then(function (response) { this.items = response.body; this.totalRows = this.items.length; }); this.$http.get("api/Region").then(function (response) { this.regions = response.body; }); this.$http.get("api/Bucket").then(function (response) { _this.buckets = response.body; }); }, bucketCustomText: function bucketCustomText(item) { return item.name + " - " + item.IP; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_area) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_area) { this.bucketItems = []; this.$bvModal.show("modalEdit"); this.area = item; this.bucketItems = item.bucket; } }, btnAddBucketInArea: function btnAddBucketInArea() { var _this2 = this; //console.log(this.area); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.area.user_id = _this2.user.id; _this2.area.user_name = _this2.user.name; _this2.area.bucketToAdd = _this2.bucketSelected; _this2.$http.post("api/area/AddBucket", _this2.area).then(function (response) { console.log(response.body); _this2.bucketItems = response.body.bucket; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnRemoveBucketInArea: function btnRemoveBucketInArea(item) { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var param = { user_id: _this3.user.id, user_name: _this3.user.name, bucket_id: item.id, area_id: _this3.area.id }; _this3.area.user_id = _this3.user.id; _this3.area.user_name = _this3.user.name; _this3.area.bucketToAdd = _this3.bucketSelected; _this3.$http.post("api/area/RemoveBucket", param).then(function (response) { console.log(response.body); _this3.bucketItems = response.body.bucket; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Removed!", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnCreate: function btnCreate() { var _this4 = this; this.$validator.validateAll().then(function (result) { if (result) { _this4.tblisBusy = true; _this4.area.user_id = _this4.user.id; _this4.area.user_name = _this4.user.name; _this4.$http.post("api/area", _this4.area).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this4.area.name = ""; _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; _this4.$bvModal.hide("modalAdd"); }).catch(function (response) { console.log(response.body); _this4.tblisBusy = false; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnUpdate: function btnUpdate() { var _this5 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.area.user_id = _this5.user.id; _this5.area.user_name = _this5.user.name; _this5.$http.put("api/area/" + _this5.area.id, _this5.area).then(function (response) { _this5.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this5.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this6 = this; if (this.roles.delete_area) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this6.items = []; _this6.tblisBusy = true; _this6.$http.delete("api/area/" + _this6.area.id).then(function (response) { _this6.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this6.items = response.body; _this6.totalRows = _this6.items.length; _this6.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a area", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 465 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "branch.name", label: "Branch", sortable: true }, { key: "branch.area.name", label: "Area", sortable: true }, { key: "branch.area.region.name", label: "Region", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50, 100], town: { name: "", user_id_rm: "", user_id_visor: "" }, user: [], branch: [], roles: [], buckettblisBusy: false, bucketField: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "IP", sortable: true }, { key: "pivot.status", label: "status", sortable: true }, { key: "actions" }], oltField: [{ key: "id", sortable: true }, { key: "belongs_to_node.name", sortable: true }, { key: "name", sortable: true }, { key: "ip", sortable: true }, { key: "pivot.status", label: "status", sortable: true }, { key: "actions" }], bucketItems: [], buckets: [], bucketSelected: "", olttblisBusy: false, oltItems: [], olts: [], oltSelected: "" }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { var _this = this; this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.tblisBusy = true; this.$http.get("api/Town").then(function (response) { console.log(response.body); this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); this.$http.get("api/Branch").then(function (response) { this.branch = response.body; }); this.$http.get("api/Bucket").then(function (response) { _this.buckets = response.body; }); this.$http.get("api/olt").then(function (response) { _this.olts = response.body; console.log(_this.olts); }); }, bucketCustomText: function bucketCustomText(item) { return item.name + " - " + item.IP; }, oltCustomText: function oltCustomText(item) { return item.belongs_to_node.name + " - " + item.name + " - " + item.ip; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_branch) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_branch) { this.bucketItems = []; this.oltItems = []; this.$bvModal.show("modalEdit"); this.town = item; this.bucketItems = item.bucket; this.oltItems = item.olt; console.log(this.town); } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnAddBucketInTown: function btnAddBucketInTown() { var _this2 = this; //console.log(this.area); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.town.user_id = _this2.user.id; _this2.town.user_name = _this2.user.name; _this2.town.bucketToAdd = _this2.bucketSelected; _this2.$http.post("api/town/AddBucket", _this2.town).then(function (response) { console.log(response.body); _this2.bucketItems = response.body.bucket; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnRemoveBucketInTown: function btnRemoveBucketInTown(item) { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var param = { user_id: _this3.user.id, user_name: _this3.user.name, bucket_id: item.id, town_id: _this3.town.id }; _this3.town.user_id = _this3.user.id; _this3.town.user_name = _this3.user.name; _this3.town.bucketToAdd = _this3.bucketSelected; _this3.$http.post("api/town/RemoveBucket", param).then(function (response) { console.log(response.body); _this3.bucketItems = response.body.bucket; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Removed!", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnActiveBucketInTown: function btnActiveBucketInTown(item) { var _this4 = this; console.log(item); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var param = { user_id: _this4.user.id, user_name: _this4.user.name, bucket_id: item.id, town_id: _this4.town.id }; _this4.tblisBusy = true; _this4.$http.post("api/town/ActiveBucketInTown", param).then(function (response) { console.log(response.body); _this4.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Assigned!", "", "success"); _this4.$bvModal.hide("modalEdit"); _this4.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnAddOLTInTown: function btnAddOLTInTown() { var _this5 = this; //console.log(this.area); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.town.user_id = _this5.user.id; _this5.town.user_name = _this5.user.name; _this5.town.oltToAdd = _this5.oltSelected; _this5.$http.post("api/town/AddOLT", _this5.town).then(function (response) { console.log(response.body); _this5.oltItems = response.body.olt; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnRemoveOLTInTown: function btnRemoveOLTInTown(item) { var _this6 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var param = { user_id: _this6.user.id, user_name: _this6.user.name, olt_id: item.id, town_id: _this6.town.id }; _this6.town.user_id = _this6.user.id; _this6.town.user_name = _this6.user.name; _this6.town.oltToAdd = _this6.oltSelected; _this6.$http.post("api/town/RemoveOLT", param).then(function (response) { console.log(response.body); _this6.oltItems = response.body.olt; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Removed!", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnActiveOLTInTown: function btnActiveOLTInTown(item) { var _this7 = this; console.log(item); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var param = { user_id: _this7.user.id, user_name: _this7.user.name, olt_id: item.id, town_id: _this7.town.id }; _this7.tblisBusy = true; _this7.$http.post("api/town/ActiveOLTInTown", param).then(function (response) { console.log(response.body); _this7.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Assigned!", "", "success"); _this7.$bvModal.hide("modalEdit"); _this7.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnCreate: function btnCreate() { var _this8 = this; this.$validator.validateAll().then(function (result) { if (result) { _this8.tblisBusy = true; _this8.town.user_id = _this8.user.id; _this8.town.user_name = _this8.user.name; _this8.$http.post("api/Town", _this8.town).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this8.town.name = ""; _this8.items = response.body; _this8.totalRows = _this8.items.length; _this8.tblisBusy = false; _this8.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this8.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this9 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this9.$http.put("api/Town/" + _this9.town.id, _this9.town).then(function (response) { _this9.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this9.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this10 = this; if (this.roles.delete_branch) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this town permanently", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this10.items = []; _this10.tblisBusy = true; _this10.$http.delete("api/Town/" + _this10.town.id).then(function (response) { _this10.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Delete!", "", "success").then(function (value) { _this10.items = response.body; _this10.totalRows = _this10.items.length; _this10.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Town", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 466 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_vue_modal_fsr_vue__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_vue_modal_update_dop_vue__ = __webpack_require__(1031); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modal_vue_modal_encode_modem_vue__ = __webpack_require__(469); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modal_vue_client_modals_vue__ = __webpack_require__(101); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_sweetalert2__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__modal_vue_modal_customer_subs_modification_vue__ = __webpack_require__(1040); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__modal_vue_modal_activity_ticket_filter_vue__ = __webpack_require__(1046); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_axios__ = __webpack_require__(125); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_axios__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default.a, modal_fsr: __WEBPACK_IMPORTED_MODULE_3__modal_vue_modal_fsr_vue__["a" /* default */], client_modals: __WEBPACK_IMPORTED_MODULE_6__modal_vue_client_modals_vue__["a" /* default */], modal_update_dop: __WEBPACK_IMPORTED_MODULE_4__modal_vue_modal_update_dop_vue__["a" /* default */], modal_encode_modem: __WEBPACK_IMPORTED_MODULE_5__modal_vue_modal_encode_modem_vue__["a" /* default */], modal_activity_ticket_filter: __WEBPACK_IMPORTED_MODULE_9__modal_vue_modal_activity_ticket_filter_vue__["a" /* default */], client_modify_subs: __WEBPACK_IMPORTED_MODULE_8__modal_vue_modal_customer_subs_modification_vue__["a" /* default */] }, data: function data() { return { cModalData: { field: 0, items: [] }, tblisBusy: true, fields: [{ key: "action", label: "Action", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "id", label: "Ticket #", sortable: true }, { key: "ticket_type.name", label: "Ticket Type", sortable: true }, { key: "account_details", label: "Account Details" }, { key: "bucket_details", label: "Bucket Details" }, { key: "client.status", label: "Status", sortable: true }, { key: "client.package.mrr", label: "MRR", sortable: true }, { key: "client.branch.name", label: "Branch", sortable: true }, { key: "created_by.name", label: "Created By", sortable: true }, { key: "aging", label: "Aging", sortable: true }, { key: "packageOld", label: "Old Package", sortable: true }, { key: "date_applied", sortable: true }, { key: "created_at", sortable: true }], items: [], items_copy: [], tblFilter: null, searchby: "clients.name", searchby_list: [{ name: "Account Number", id: "clients.acc_no" }, { name: "Account Name", id: "clients.name" }, { name: "Ticket number", id: "activity_tickets.id" }, { name: "Ticket type", id: "activity_ticket_types.name" }, { name: "Status", id: "activity_tickets.status" }, { name: "Completed", id: "activity_tickets.status" }, { name: "Pending", id: "activity_tickets.status" }, { name: "Verification", id: "activity_tickets.status" }], totalRows: 1, currentPage: 1, perPage: 50, pageOptions: [20, 50, 100, 250], showVerifyBtn: false, verifySelected: [], user: [], roles: [], state_role: "", fsr_data: { user: { email: "" } }, editTicket: { packageToUpdate: { name: "" }, packageOld: {}, aging: "", check: false, client: [], client_id: "", created_at: "", created_by: [], id: "", remarks: "", state: "", status: "", ticket_type: "", ticket_type_id: "", updated_at: "", updated_by: "" }, remarksText: "", commentsText: [], bill_modi_fields: [{ key: "selected" }, { key: "date" }, { key: "description" }, { key: "price", label: "Amount" }, { key: "balance", label: "Balance" }, { key: "price_update", label: "Amount Update" }, { key: "balance_update", label: "Balance Update" }], bill_modi_items: [], bill_modi_tblisBusy: false, packageToUpdate: {}, packageOld: {}, selectedEmails_DOP: [{ email: "amgt@dctechmicro.com", name: "Account Management" }], dop_details: { OTC: 0, cashBond: 0, fp: 0, staggered: 0, amount_pay: 0, OTCPay: 0, balance: 0, numMonths: 0, or_number: "", pay_method_Selected: { id: "", name: "" }, isPayOnline: false, bank_code_selected: { id: 0, code: "", amount: 0, date: "" }, billing_date: "", package_type_name: "", permonth: "", remarks: "", email_note: "", receive_pay_data: { client_id: "", payment_method_id: "", banking_payment_code_id: "", amount: 0, val: 0, date: "", or_number: "", remarks: "", isPayOnline: false } }, bucket_list_per_area: [], bucket_desc_list: [], verify_bucket_selected: {}, verify_bucket_desc_selected: null, ssh_switch_local: false, clientOptions: [], doSearch: false, search_loading: false, currentItem: 0, stock_modems: null, activity_ticket: { client: {} }, client_data: {}, bucket_data: {}, jo_data: {}, package_data: {}, package_type_data: {}, item_clicked: null, isLoading: false, onu_details: null, errorMessage: "", onu_details_fields: [{ key: "onu_name" }, { key: "provision_name" }, { key: "status" }, { key: "action" }], maxText: 450, msg: "", showSending: false, showSent: false, showFailed: false }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); console.log(this.user); if (this.roles.admin) { var temp = { key: "state", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { var _this = this; this.load(); this.load_item(); this.$root.$on("update_item_activity_ticket", function (item) { _this.items = item.items; _this.tblisBusy = false; _this.totalRows = item.items.length; }); }, updated: function updated() {}, methods: { load_item: function load_item() { var _this2 = this; this.tblisBusy = true; if (this.roles.helpdesk) this.state_role = "helpdesk"; if (this.roles.account_management) this.state_role = "am"; if (this.roles.accounting) this.state_role = "accounting"; if (this.roles.logistics) this.state_role = "logistics"; if (this.roles.accounting && this.roles.helpdesk && this.roles.account_management && this.roles.logistics) this.state_role = "admin";else if (this.user.role_group.name == "accounting admin") { this.state_role = "accounting admin"; } else if (this.user.role_group.name == "am admin") { this.state_role = "am admin"; } this.$http.get("api/ActivityTicket/subIndex/" + this.state_role).then(function (response) { console.log("1111", response.body); _this2.items = response.body.items; _this2.items_copy = response.body.items; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; }); }, load: function load() { this.$nextTick(function () { this.$root.$emit("clearNav"); setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarActivityTicket").style.backgroundColor = "#2196f3"; }, 100); }); if (this.$ssh_switch == "enabled") { this.ssh_switch_local = true; } else { this.ssh_switch_local = false; } var def_user_email = { email: this.user.email + this.user.subdomain, name: this.user.name }; this.$mail_copy_on_activation.push(def_user_email); }, bucketCustomText: function bucketCustomText(item) { return item.name + " - " + item.IP; }, bucketDescCustomText: function bucketDescCustomText(item) { return item.name + " - " + item.desc; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { console.log(item); this.editTicket = item; if (this.editTicket.ticket_type_id == "4" || this.editTicket.ticket_type_id == "5") { if (this.editTicket.status != "Completed" && this.editTicket.status != "Update Billing") this.editTicket.packageOld = item.client.package; } this.$bvModal.show("modalViewJO"); }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, filter_data: function filter_data(by, filter) { this.searchby = by; this.tblFilter = filter; this.search_data(); }, search_data: function search_data() { var _this3 = this; this.$root.$emit("pageLoading"); var escape_string = this.tblFilter.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.tblisBusy = true; this.$http.get("api/ActivityTicket/search_data/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); _this3.items = response.body.items; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; _this3.doSearch = false; _this3.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this3.tblisBusy = false; _this3.$root.$emit("pageLoaded"); }); }, filterClear: function filterClear() { this.tblFilter = ""; this.items = this.items_copy; this.totalRows = this.items.length; }, fnExcelReport: function fnExcelReport(tbl) { this.currentPage = 1; this.perPage = this.totalRows; this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; //tab_text=tab_text+""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); this.perPage = 50; return sa; }.bind(this), 1000); }); }, btnChangeStatus: function btnChangeStatus(item, type, status, state) { var _this4 = this; console.log(this.ssh_switch_local); console.log(item); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var _dataa; _this4.tblisBusy = true; var errorText = ""; var dataa = (_dataa = { id: item.client_id, client: item.client, row: "status", state: state, status: status, type: type, user_id: _this4.user.id, user_email: _this4.user.email + _this4.user.subdomain, user_name: _this4.user.name, ssh_switch: _this4.ssh_switch_local, activity_ticket: item, role: _this4.state_role }, _defineProperty(_dataa, "ssh_switch", _this4.ssh_switch_local), _defineProperty(_dataa, "client_name", item.client.name), _defineProperty(_dataa, "remarks", item.remarks), _defineProperty(_dataa, "sendTo", _this4.$network_email), _defineProperty(_dataa, "CCTO", [{ email: _this4.user.email + _this4.user.subdomain, name: _this4.user.name }, { email: "pbismonte@dctechmicro.com", name: "peter" }]), _dataa); _this4.$root.$emit("pageLoading"); if (item.ticket_type_id == 10 && item.status == "Verification" && item.state == "network") { if (_this4.ssh_switch_local == false) { var add_on = JSON.parse(item.remarks); _this4.$http.post("api/MrrAddon", add_on).then(function (response) { console.log(response.body); }).catch(function (response) { console.log(response); errorText = "error: " + response.body.error; }); } else { errorText = "Can't execute. SSH is disabled."; } } if (item.ticket_type_id == 7 && item.status == "Verification" && item.state == "technical") { var line_transfer = JSON.parse(item.remarks); console.log(line_transfer); item.client.lng = line_transfer.lng; item.client.lat = line_transfer.lat; item.client.location = line_transfer.address; _this4.$http.put("api/Client/" + item.client_id, item.client).then(function (response) { console.log(response.body); }).catch(function (response) { errorText = "error: " + response.body.error; console.log("error:", response.body.error); }); } if (errorText == "") { _this4.$http // .post("api/ActivityTicket/updateClientStatus", dataa) .post("api/ActivityTicket/updateClientStatus", dataa).then(function (response) { console.log(response.body); _this4.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this4.items_copy = response.body.items; if (_this4.tblFilter != null) _this4.search_data();else _this4.items = response.body.items; _this4.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this4.tblisBusy = false; _this4.$root.$emit("pageLoaded"); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: errorText, icon: "error", dangerMode: true }); _this4.$root.$emit("pageLoaded"); } } }); }, btnChangePackage: function btnChangePackage(item, type) { var _this5 = this; console.log(item); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.$root.$emit("pageLoading"); item.updated_by = _this5.user.id; item.state = "accounting"; item.status = "Update Billing"; item.user_name = _this5.user.name; item.user_id = _this5.user.id; item.role = _this5.state_role; _this5.updateActivityTicket(item, item.id); } }); }, getTempDiscon: function getTempDiscon() { var _this6 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this6.$root.$emit("pageLoading"); var data = { user_id: _this6.user.id, user_name: _this6.user.name, role: _this6.state_role }; _this6.tblisBusy = true; _this6.$http.post("api/ActivityTicket/getTempDiscon", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this6.items = response.body.items; _this6.tblisBusy = false; _this6.$root.$emit("pageLoaded"); }); } }); }, checkVerify: function checkVerify() { var _this7 = this; this.verifySelected = []; this.showVerifyBtn = false; this.items.forEach(function (item) { if (item.check == true) { _this7.showVerifyBtn = true; _this7.verifySelected.push(item); } }); }, btnVerify: function btnVerify() { var _this8 = this; console.log(this.verifySelected); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this8.tblisBusy = false; var dataa = { user_id: _this8.user.id, user_name: _this8.user.name, role: _this8.state_role, verifySelected: _this8.verifySelected }; _this8.$root.$emit("pageLoading"); _this8.$http.post("api/ActivityTicket/verify", dataa).then(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this8.$root.$emit("pageLoaded"); if (_this8.tblFilter != null) _this8.search_data();else _this8.items = response.body.items; _this8.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this8.tblisBusy = false; _this8.$root.$emit("pageLoaded"); }); } }); }, addRemarks_clicked: function addRemarks_clicked() { var _this9 = this; if (this.remarksText != "") { var data = { ticket_id: this.editTicket.id, user_id: this.user.id, user_name: this.user.name, remarks: this.remarksText, form_type: "jobOrder", ticketType: "4" }; console.log(data); this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this9.remarksText = ""; _this9.editTicket.remarks_log = response.body; console.log(response.body); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please add some text in the remarks text area"); } }, addComments_clicked: function addComments_clicked(id, i, replies) { var _this10 = this; if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.editTicket.id, ticketType: "4" }; this.$http.post("api/TicketCommentsLog", data).then(function (response) { _this10.commentsText[i] = ""; _this10.editTicket.remarks_log = response.body; _this10.$global.scrollComment(i, 2); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please add some text in the comments text area"); } }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, btnAddendumSigned: function btnAddendumSigned() { var _this11 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this11.$root.$emit("pageLoading"); _this11.editTicket.updated_by = _this11.user.id; if (_this11.editTicket.ticket_type_id != 7) { if (_this11.editTicket.ticket_type_id == 4 || _this11.editTicket.ticket_type_id == 5) { if (_this11.editTicket.client.bucket.version_command == 3) { _this11.editTicket.status = "Update Billing"; _this11.editTicket.state = "accounting"; } else { _this11.editTicket.status = "Pending"; _this11.editTicket.state = "helpdesk"; } } else if (_this11.editTicket.ticket_type_id == 3) { _this11.editTicket.status = "Complete"; _this11.editTicket.state = "all"; } else { _this11.editTicket.status = "Pending"; _this11.editTicket.state = "helpdesk"; } } else { _this11.editTicket.status = "Verification"; _this11.editTicket.state = "technical"; } _this11.editTicket.user_name = _this11.user.name; _this11.editTicket.user_email = _this11.user.email + _this11.user.subdomain; _this11.editTicket.user_id = _this11.user.id; _this11.editTicket.role = _this11.state_role; _this11.editTicket.sendTo = _this11.$technical_email; _this11.editTicket.CCTO = [{ email: _this11.user.email + _this11.user.subdomain, name: _this11.user.name }, { email: "rnaupan@dctechmicro.com", name: "Reymart" }]; if (_this11.editTicket.ticket_type_id == 3) _this11.btnChangeStatus(_this11.editTicket, "Active", "Completed", "all");else _this11.updateActivityTicket(_this11.editTicket, _this11.editTicket.id); } }); }, retryChangePackage: function retryChangePackage(data, id) { var _this12 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Retry change package?", text: data.status, icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { data.user_name = _this12.user.name; data.user_email = _this12.user.email + _this12.user.subdomain; data.packageOld = data.client.package; data.user_id = _this12.user.id; data.updated_by = _this12.user.id; data.role = _this12.state_role; _this12.$root.$emit("pageLoading"); _this12.updateActivityTicket(data, id); } }); }, updateActivityTicket: function updateActivityTicket(data, id) { var _this13 = this; this.tblisBusy = true; this.$http.put("api/ActivityTicket/" + id, data).then(function (response) { console.log(response.body); if (_this13.tblFilter != null) _this13.search_data();else _this13.items = response.body.items; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this13.$root.$emit("pageLoaded"); _this13.items = response.body.items; _this13.tblisBusy = false; }).catch(function (response) { console.log(response.body); if (_this13.tblFilter != null) _this13.search_data();else _this13.items = _this13.items_copy; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this13.tblisBusy = false; _this13.$root.$emit("pageLoaded"); }); }, btnGetSoa: function btnGetSoa() { var _this14 = this; this.$bvModal.show("modalUpdateBilling"); this.bill_modi_tblisBusy = true; this.$http.post("api/Billing/soa/" + this.editTicket.client_id + "/wholebill").then(function (response) { console.log(response.body); var itemTemp = []; response.body.forEach(function (i, index) { var desc = ""; if (i.description != null) { desc = i.description; } else { desc = i.remarks; } var temp = { id: i.id, date: i.date, OR: i.or_number, item: i.item, description: desc, AMT_CHRG: i.price, AMT_PAID: i.amount, balance: i.balance, balance_sum: i.balanceSum }; itemTemp.push(temp); }); _this14.bill_modi_items = itemTemp; _this14.bill_modi_tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this14.tblisBusy = false; }); }, btnUpdateSoa: function btnUpdateSoa(item) { var _this15 = this; item.packageOld = item.client.package; this.editTicket = item; this.packageToUpdate = item.packageToUpdate; console.log(this.editTicket); this.$bvModal.show("modalUpdateBilling"); this.bill_modi_tblisBusy = true; this.$http.post("api/Billing/to_pay/" + item.client_id + "/wholebill").then(function (response) { console.log(response.body); var itemTemp = []; response.body.forEach(function (i, index) { var datenow = new Date(); var date = new Date(i.date); i.price_update = item.packageToUpdate.mrr; i.balance_update = item.packageToUpdate.mrr; if (date >= datenow) { i.selected = true; } else i.selected = false; var temp = { id: i.id, selected: i.selected, date: i.date, description: i.description, amount: i.price, balance: i.balance, amount_update: i.price_update, balance_update: i.balance_update }; itemTemp.push(temp); }); _this15.bill_modi_items = itemTemp; _this15.bill_modi_tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this15.bill_modi_tblisBusy = false; }); }, updateSOAOK: function updateSOAOK() { var _this16 = this; this.tblisBusy = true; var dataa = { id: this.editTicket.client_id, data: { package_id: this.packageToUpdate.id, mrr: this.packageToUpdate.mrr, package_type_id: this.packageToUpdate.package_type_id, soa_items: this.bill_modi_items }, user_id: this.user.id, user_name: this.user.name, activity_ticket_id: this.editTicket.id, role: this.state_role }; this.$http.post("api/ActivityTicket/updateSOA", dataa).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this16.$bvModal.hide("modalUpdateBilling"); _this16.$root.$emit("pageLoaded"); if (_this16.tblFilter != null) _this16.search_data();else _this16.items = response.body.items; _this16.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this16.tblisBusy = false; _this16.$root.$emit("pageLoaded"); }); }, viewAttachment: function viewAttachment(file) { window.open(this.$img_path + "attachments/" + file); }, btnUpdateContract: function btnUpdateContract() { var _this17 = this; console.log(this.editTicket); __WEBPACK_IMPORTED_MODULE_7_sweetalert2___default.a.fire({ title: "Contract Verified!", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this17.tblisBusy = true; _this17.$root.$emit("pageLoading"); var item = _this17.editTicket; item.ssh_switch = _this17.ssh_switch_local; item.user_id = _this17.user.id; item.user_name = _this17.user.name; item.user_email = _this17.user.email; item.role = _this17.state_role; item.bucket_selected = _this17.verify_bucket_selected; item.net_selected = _this17.verify_bucket_desc_selected; item.activity_ticket_id = item.id; _this17.$http.post("api/ActivityTicket/NewClientVerified", item).then(function (response) { console.log(response.body); _this17.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); if (_this17.tblFilter != null) _this17.search_data();else _this17.items = response.body.items; _this17.tblisBusy = false; _this17.$bvModal.hide("modalViewJO"); _this17.$bvModal.hide("modalCreateSubscription"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this17.tblisBusy = false; _this17.$root.$emit("pageLoaded"); }); } }); }, btnAMVerify: function btnAMVerify(item) { var _this18 = this; this.editTicket = item; console.log(this.editTicket); if (this.ssh_switch_local == false && //dapat true ni. gi false lang for testing this.editTicket.client.package_type_id == 4) { this.$root.$emit("pageLoading"); this.$http.get("api/Town/" + this.editTicket.client.town_id) //get bucket assign by town .then(function (response) { if (response.body.bucket.length > 0) { console.log(response.body.bucket); this.bucket_list_per_area = response.body.bucket; this.$bvModal.show("modalCreateSubscription"); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("The Area Set to this client has no Bucket " + "\nPlease Contact the network team to add bucket in the area"); } this.$root.$emit("pageLoaded"); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "Manual Bucket Assignment", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (email) { if (email) { _this18.tblisBusy = true; _this18.$root.$emit("pageLoading"); var item = _this18.editTicket; item.ssh_switch = _this18.ssh_switch_local; item.user_id = _this18.user.id; item.user_name = _this18.user.name; item.user_email = _this18.user.email; item.role = _this18.state_role; item.bucket_selected = _this18.verify_bucket_selected; item.net_selected = _this18.verify_bucket_desc_selected; item.sendTo = _this18.$network_email; item.CCTO = [{ email: _this18.user.email + _this18.user.subdomain, name: _this18.user.name }, { email: "rnaupan@dctechmicro.com", name: "Reymart" }]; console.log("dddd", item); _this18.$http.post("api/ActivityTicket/NewClientVerified", item).then(function (response) { console.log(response.body); _this18.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Success", text: "", icon: "success", dangerMode: true }); _this18.items = response.body.items; _this18.tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this18.tblisBusy = false; _this18.$root.$emit("pageLoaded"); }); } }); } }, getBucketDesc: function getBucketDesc() { var _this19 = this; //verify_bucket_selected this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/getBucketDesc", this.verify_bucket_selected).then(function (response) { console.log(response.body.items); if (response.body.items.length > 0) { this.bucket_desc_list = response.body.items; } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("no data fetch"); } this.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this19.tblisBusy = false; _this19.$root.$emit("pageLoaded"); }); }, btnUpdateDOP: function btnUpdateDOP(item_source) { var item = item_source.client; item.activity_ticket_id = item_source.id; // this.selectedEmails_DOP = []; // this.selectedEmails_DOP.push({ // email: "amgt@dctechmicro.com", // name: "Account Management", // }); // this.selectedEmails_DOP.push({ // email: item.sales.user.email + item.sales.user.subdomain, // name: item.sales.user.name, // }); // this.selectedEmails_DOP.push({ // email: item.region.user.email + item.region.user.subdomain, // name: item.region.user.name, // }); if (item.OTC == null) item.OTC = 0; if (item.package == null) item.package = {}; if (item.package.mrr == null) item.package.mrr = 0; if (item.payment_method_id == null) item.payment_method_id = ""; if (item.or_number == null) item.or_number = ""; if (item.billing_date == null) item.billing_date = ""; // if (item.amount_pay == null) item.amount_pay = 0; item.cashBond = item.package.mrr; item.fp = item.OTC + item.package.mrr; this.dop_details = item; // this.dop_details.OTCPay = 0; // this.dop_details.balance = 0; console.log(this.dop_details); this.$bvModal.show("modalUpdateDOP"); }, btnDelete: function btnDelete() { var _this20 = this; if (this.roles.delete_job_order) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this20.editTicket.role = _this20.state_role; _this20.editTicket.user_id = _this20.user.id; _this20.editTicket.user_name = _this20.user.name; _this20.tblisBusy = true; _this20.$root.$emit("pageLoading"); _this20.$http.post("api/ActivityTicket/destroy1", _this20.editTicket).then(function (response) { console.log(response.body); _this20.$bvModal.hide("modalViewJO"); if (_this20.tblFilter != null) _this20.search_data();else _this20.items = response.body.items; _this20.totalRows = _this20.items.length; _this20.tblisBusy = false; _this20.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { _this20.tblisBusy = false; _this20.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Job Order", icon: "warning", buttons: true, dangerMode: true }); } }, search: function search(query) { console.log(query); this.doSearch = true; this.clientOptions = []; this.currentItem = 0; if (query != "" && query != "." && query != null) { var escape_string = query.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.search_loading = true; this.$http.get("api/ActivityTicket/search/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); this.clientOptions = response.body.items; if (response.body.count > 10 && (this.searchby == "clients.acc_no" || this.searchby == "clients.name" || this.searchby == "activity_tickets.id")) { this.clientOptions.push({ contact: "*** Show all " + response.body.count + " results...", details: "*** Show all " + response.body.count + " results...", jo_num: "*** Show all " + response.body.count + " results...", job_order_location: "*** Show all " + response.body.count + " results...", location: "*** Show all " + response.body.count + " results...", name: "*** Show all " + response.body.count + " results...", acc_no: "*** Show all " + response.body.count + " results...", ticket_number: "*** Show all " + response.body.count + " results..." }); } this.search_loading = false; }); } else { this.doSearch = false; this.search_loading = false; this.clientOptions = []; } }, searchItem: function searchItem(item) { if (item.name.substring(0, 3) != "***") { if (this.searchby == "clients.acc_no") this.tblFilter = item.acc_no;else if (this.searchby == "clients.name") this.tblFilter = item.name;else if (this.searchby == "activity_ticket_types.name") this.tblFilter = item.activity_ticket_type_name;else if (this.searchby == "activity_tickets.id") this.tblFilter = item.ticket_number.toString();else if (this.searchby == "activity_tickets.status") this.tblFilter = item.status; } this.search_data(); }, searchSuggestions: function searchSuggestions(item) { if (this.searchby == "clients.acc_no") return item.acc_no;else if (this.searchby == "clients.name") return item.name;else if (this.searchby == "activity_ticket_types.name") return item.activity_ticket_type_name;else if (this.searchby == "activity_tickets.id") return item.ticket_number.toString().substring(0, 3) != "***" ? item.ticket_number + " - " + item.activity_ticket_type_name : item.ticket_number;else if (this.searchby == "activity_tickets.status") return item.status; }, nextItem: function nextItem(event) { if (event.keyCode == 38 && this.clientOptions.length > 1) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem > 0) { this.currentItem--; } } else if (event.keyCode == 40 && this.currentItem < this.clientOptions.length) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem < this.clientOptions.length - 1) { this.currentItem++; } } if (event.keyCode == 13 && this.clientOptions.length != 0) this.searchItem(this.clientOptions[this.currentItem]); }, changeStatus: function changeStatus(status, id) { var _this21 = this; var data = { status: status, id: id, client: this.editTicket.client_id }; this.$http.post("api/ActivityTicket/changeAttachStatus", data).then(function (response) { console.log(response.body); _this21.editTicket.client.client_attachment = response.body; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this21.tblisBusy = false; _this21.$root.$emit("pageLoaded"); }); }, btnEncodeModem: function btnEncodeModem(item) { var _this22 = this; this.$root.$emit("pageLoading"); this.$http.get("api/StockModem/getStockModems/" + item.client.area_id).then(function (response) { _this22.stock_modems = response.body; if (["CORP", "ENT"].includes(item.client.package_type.name)) item.chk_vlan = false;else item.chk_vlan = true; _this22.activity_ticket = item; _this22.activity_ticket.role = _this22.state_role; console.log(_this22.activity_ticket); _this22.$root.$emit("pageLoaded"); _this22.$bvModal.show("modalEncodeModem"); }); }, modify_sub: function modify_sub(item) { var _this23 = this; this.activity_ticket = item; this.bucket_data = item.client.bucket; this.client_data = item.client; var onu = null; if (item.client.stock_modem != null) { onu = item.client.stock_modem.serial; } this.jo_data = { id: item.id, created_at: item.created_at, created_by: item.created_by.name, reference_type: item.reference_type, reference_no: item.reference_no, result: item.result, note: item.note, onu: onu }; this.package_data = item.client.package; this.package_type_data = item.client.package_type; this.item_clicked = item; console.log(item); this.$http.get("api/StockModem/getStockModems/" + item.client.area_id).then(function (response) { _this23.stock_modems = response.body; console.log(_this23.stock_modems); _this23.$bvModal.show("modalModifySubscription"); }); }, btnDiscon: function btnDiscon(item) { var _this24 = this; __WEBPACK_IMPORTED_MODULE_7_sweetalert2___default.a.fire({ title: "Disconnect Client?", type: "warning", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { var _data; var data = (_data = { id: item.client.id, client: item.client, row: "status", user_id: _this24.user.id, created_by: _this24.user.id, type: "Disconnected", status: "Completed", state: "all", activity_ticket: item }, _defineProperty(_data, "user_id", _this24.user.id), _defineProperty(_data, "user_email", _this24.user.email + _this24.user.subdomain), _defineProperty(_data, "user_name", _this24.user.name), _defineProperty(_data, "ssh_switch", _this24.ssh_switch_local), _defineProperty(_data, "role", _this24.state_role), _data); _this24.$root.$emit("pageLoading"); _this24.$http.post("api/ActivityTicket/updateClientStatus", data).then(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Disconnected!", "", "success"); if (_this24.tblFilter != null) _this24.search_data();else _this24.items = response.body.items; _this24.$bvModal.hide("modalUpdateBilling"); _this24.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); _this24.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, loadStatus: function loadStatus(acc_no, bucket) { var _this25 = this; this.isLoading = true; var data = { acc_no: acc_no, bucket: bucket }; this.$http.post("api/ActivityTicket/loadStatus", data).then(function (response) { console.log(response.body); _this25.onu_details = response.body; _this25.isLoading = false; }).catch(function (response) { console.log(response); _this25.errorMessage = "Error message: " + response.body.message; _this25.isLoading = false; }); }, executeCommand: function executeCommand(onu_details, bucket) { var _this26 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this26.$root.$emit("pageLoading"); if (onu_details.status == "PROVP") { var data = { activity_ticket_id: _this26.editTicket.id, bucket: bucket, client: _this26.editTicket.client, client_id: _this26.editTicket.client.id, user_id: _this26.user.id, user_email: _this26.user.email + _this26.user.subdomain, user_name: _this26.user.name, flag: "true", inst_remarks: "", sendTo: _this26.$mail_recipient_on_activation, CCTO: _this26.$mail_copy_on_activation, ssh_switch: _this26.ssh_switch_local, activated_date: new Date().getFullYear().toString() + "-" + ("0" + (parseInt(new Date().getMonth()) + 1)).slice(-2).toString() + "-" + new Date().getDate().toString(), subscription_name: _this26.editTicket.client.acc_no, role: _this26.state_role }; console.log(data); _this26.$http.post("api/clientDetail/activationChecker", data).then(function (response) { console.log(response); _this26.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Activated!", "", "success"); if (_this26.tblFilter != null) _this26.search_data();else _this26.items = response.body.items; _this26.totalRows = _this26.items.length; _this26.tblisBusy = false; _this26.$root.$emit("pageLoaded"); _this26.$bvModal.hide("modalViewJO"); }).catch(function (response) { _this26.tblisBusy = false; _this26.$root.$emit("pageLoaded"); console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } else { var data = { onu_details: onu_details, bucket: bucket, client: _this26.editTicket.client }; _this26.$http.post("api/ActivityTicket/executeCommand", data).then(function (response) { console.log(response.body); _this26.onu_details = response.body; _this26.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); _this26.onu_details = response.body; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this26.$root.$emit("pageLoaded"); }); } } }); }, reset: function reset() { this.onu_details = null; this.errorMessage = ""; }, mousemove: function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } }, acctHeadApproval: function acctHeadApproval(item) { var status = ""; var state = ""; if (item.ticket_type_id != 3) { status = "AM Head Approval"; state = "am admin"; this.btnChangeStatus(item, "AM Head Approval", status, state); } else { if (item.remarks.includes("and EOC")) { status = "AM Head Approval"; state = "am admin"; this.btnChangeStatus(item, "AM Head Approval", status, state); } else { status = "Complete"; state = "all"; this.btnChangeStatus(item, "Active", status, state); } } }, btnRevert: function btnRevert(id) { var _this27 = this; __WEBPACK_IMPORTED_MODULE_7_sweetalert2___default.a.fire({ title: "Revert to Encode Modem?", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this27.tblisBusy = true; _this27.$root.$emit("pageLoading"); var data = _defineProperty({ id: id, role: _this27.state_role, user_id: _this27.user.id, status: _this27.editTicket.status, acc_no: _this27.editTicket.client.acc_no, stock_id: _this27.editTicket.client.stock_id, bucket: _this27.editTicket.client.bucket }, "user_id", _this27.user.id); _this27.$http.post("api/ActivityTicket/revertToEncodeModem", data).then(function (response) { _this27.$bvModal.hide("modalViewJO"); _this27.tblisBusy = false; _this27.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this27.$root.$emit("pageLoaded"); }); } }); }, assign_modem: function assign_modem(modem) { var _this28 = this; modem.client = this.activity_ticket.client; modem.activity_ticket_id = this.activity_ticket.id; modem.user_region_id = this.user.region_id; modem.user_id = this.user.id; modem.user_name = this.user.name; modem.user_email = this.user.email; if (this.activity_ticket.client.package.bandwidth_min == null && this.activity_ticket.client.package.bandwidth_max == null) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("The Package assigned in client has no max speed and cir please update the package first");else { if (this.activity_ticket.client.bucket_id != null) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this28.$root.$emit("pageLoading"); var param = { accountNo: _this28.activity_ticket.client.acc_no, clientName: _this28.activity_ticket.client.name, olt: modem.olt_selected.ip, serialNumber: modem.serial, macAddress: modem.mac, privateIp: _this28.activity_ticket.client.package.private_ip, publicIp: _this28.activity_ticket.client.package.public_ip, packageType: _this28.activity_ticket.client.package.name, upstream: _this28.activity_ticket.client.package.bandwidth_max, downstream: _this28.activity_ticket.client.package.bandwidth_min }; if (modem.backend_selected == "BW") { _this28.$http.post("api/Client/encodeModem", modem).then(function (response) { console.log(response); if (_this28.tblFilter != null) _this28.search_data();else _this28.load_item(); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this28.$bvModal.hide("modalEncodeModem"); _this28.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this28.$root.$emit("pageLoaded"); }); } else { var data_param = { hive_param: param, activity_ticket_id: _this28.editTicket.id, bucket: _this28.editTicket.client.bucket, client: _this28.editTicket.client, client_id: _this28.editTicket.client.id, user_id: _this28.user.id, user_email: _this28.user.email + _this28.user.subdomain, user_name: _this28.user.name, flag: "true", inst_remarks: "", sendTo: _this28.$mail_recipient_on_activation, CCTO: _this28.$mail_copy_on_activation, ssh_switch_local: false, activated_date: new Date().getFullYear().toString() + "-" + ("0" + (parseInt(new Date().getMonth()) + 1)).slice(-2).toString() + "-" + new Date().getDate().toString(), subscription_name: _this28.editTicket.client.acc_no, role: _this28.state_role }; _this28.$http // .post(this.$hive_base_url + "/executeProvision", data) .post("api/clientDetail/activateHiveProvision", data_param).then(function (response) { console.log(response); // if (this.tblFilter != null) this.search_data(); // else this.load_item(); _this28.$bvModal.hide("modalEncodeModem"); _this28.$root.$emit("pageLoaded"); if (response.body.error != null) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Error", response.body.error, "error"); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); } }).catch(function (response) { console.log("/executeProvision : error :"); console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this28.$root.$emit("pageLoaded"); }); } } }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("No bucket assign"); } } }, sendSMS: function sendSMS() { var _this29 = this; this.showSent = false; this.showFailed = false; this.showSending = true; var contact = []; if (this.editTicket.status == "Batch Migrate") { var clients = JSON.parse(this.editTicket.remarks); for (var i = 0; i < clients.length; i++) { contact.push({ name: clients[i].name, contact: clients[i].contact }); } } else { var contact = [{ name: this.editTicket.client.name, contact: this.editTicket.client.contact }]; } var data = { number: contact, msg: this.msg }; console.log(data); this.$http.post("api/Ticket/sendText", data).then(function (response) { console.log(response.body); if (response.body.message == "sent successfully") { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Message Sent Successfully!"); _this29.showSending = false; _this29.showSent = true; } else { _this29.showFailed = true; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Sending Failed!"); } }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this29.showFailed = true; }); }, btnMigrate: function btnMigrate(item) { var _this30 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "Bucket migration", icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this30.$root.$emit("pageLoading"); item.user_id = _this30.user.id; item.user_name = _this30.user.name; item.user_email = _this30.user.email; item.role = _this30.state_role; item.migrateClients = []; if (item.status == "Batch Migrate") { item.migrateClients = JSON.parse(item.remarks); } else { item.migrateClients.push(item.client); } _this30.$http.post("api/ActivityTicket/migrate", item).then(function (response) { _this30.$root.$emit("pageLoaded"); console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Migrated", text: "", icon: "success", dangerMode: true }); if (_this30.tblFilter != null) _this30.search_data();else _this30.load_item(); }).catch(function (response) { _this30.$root.$emit("pageLoaded"); console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnSendSSID: function btnSendSSID(item) { var _this31 = this; console.log(item); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "Send SSID and SSID password", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this31.$root.$emit("pageLoading"); item.migrateClients = []; if (item.remarks == null) item.migrateClients.push(item.client);else item.migrateClients = JSON.parse(item.remarks); _this31.$http.post("api/ActivityTicket/sendSSID", item).then(function (response) { console.log(response.body); _this31.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()(response.body); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body, text: "", icon: "error", dangerMode: true }); _this31.tblisBusy = false; _this31.$root.$emit("pageLoaded"); }); } }); } } }); /***/ }), /* 467 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a }, data: function data() { return { user: {}, roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); }, mounted: function mounted() {}, methods: { printElement: function printElement(id) { // window.print(); // this.$htmlToPaper("printFSR"); var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); } } }); /***/ }), /* 468 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_multiselect__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: { data: { type: Object }, reload_item: { type: Function }, filter: { type: String }, search_data: { type: Function } }, components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default.a }, data: function data() { return { user: {}, roles: [], Emails: [], pay_method: [], bank_code: [], AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, selectedEmailsCC_DOP: [], selectedEmails_DOP: [], pay_method_Selected: { id: "", name: "" }, bank_code_selected: { id: 0, code: "", amount: 0, date: "" }, receive_pay_data: { client_id: "", payment_method_id: "", banking_payment_code_id: "", amount: 0, val: 0, date: "", or_number: "", remarks: "", isPayOnline: false }, withVat: false, amount_pay: 0 }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); }, mounted: function mounted() {}, computed: { OTCPay: function OTCPay() { this.data.OTCPay = this.amount_pay - this.data.cashBond; // console.log( // this.data.OTCPay + // " asd " + // this.data.cashBond + // " asd " + // this.data.amount_pay // ); return this.data.OTCPay; }, balance: function balance() { if (this.OTCPay != null && this.data.OTC != null) { this.data.balance = this.data.OTC - this.OTCPay; return this.data.balance; } else return 0; }, permonth: function permonth() { if (this.data.staggered == "0") this.data.numMonths = 1; this.data.permonth = Math.round(this.balance / this.data.numMonths); return this.data.permonth; } }, methods: { load: function load() { var _this = this; this.$http.get("api/getEmails").then(function (response) { this.Emails = response.body; }); this.$http.get("api/Paymethod").then(function (response) { _this.pay_method = response.body; }); this.$http.get("api/BankCode").then(function (response) { _this.bank_code = response.body; }); this.selectedEmails_DOP = this.$mail_recipient_on_otc; this.selectedEmailsCC_DOP = this.$mail_copy_on_otc; }, onChangeWithVat: function onChangeWithVat() { console.log("1"); if (this.withVat) { console.log("2"); this.data.cashBond = (this.data.package.mrr / 1.12).toFixed(2); //this.data.cashBond = this.data.package.mrr / 1.12; this.data.fp = parseFloat(this.data.OTC) + parseFloat(this.data.cashBond); console.log(this.data.cashBond); } else { console.log("3"); this.data.cashBond = this.data.package.mrr; this.data.fp = this.data.OTC + this.data.package.mrr; } }, getBankCode: function getBankCode(code) { return code.code + " - " + code.date + " - " + code.amount; }, onChangeSelectPayMethod: function onChangeSelectPayMethod() { this.data.payment_method_id = this.pay_method_Selected.id; this.receive_pay_data.payment_method_id = this.pay_method_Selected.id; if (this.pay_method_Selected.id == 30 || this.pay_method_Selected.id == 31 || this.pay_method_Selected.id == 32 || this.pay_method_Selected.id == 34 || this.pay_method_Selected.id == 39 || this.pay_method_Selected.id == 40 || this.pay_method_Selected.id == 41 || this.pay_method_Selected.id == 48) { this.data.isPayOnline = true; this.receive_pay_data.isPayOnline = true; } else { this.data.isPayOnline = false; this.receive_pay_data.isPayOnline = false; } }, onChangeBankCode: function onChangeBankCode() { this.amount_pay = this.bank_code_selected.amount; this.data.banking_payment_code_id = this.bank_code_selected.id; this.data.billing_date = this.bank_code_selected.date; this.data.balance = this.data.OTC - this.OTCPay; if (this.balance > 0) { this.data.permonth = Math.round(this.balance / this.data.numMonths); } }, updateDOP: function updateDOP() { var _this2 = this; console.log(this.data); var chk = 0; if (this.data.staggered != 2) { if (this.data.payment_method_id == "" || this.data.payment_method_id == null) { chk++; swal("Please select/reselect payment method"); return 0; } if (this.data.or_number == "") { chk++; swal("OR Number is Required"); return 0; } if (this.data.billing_date == "") { chk++; swal("Date of payment is Required"); return 0; } if (this.amount_pay == 0) { chk++; swal("Amount must be greater than zero"); return 0; } if (this.data.staggered == 1) { if (this.data.numMonths <= 0) { chk++; swal("Months to pay must be greater than zero."); return 0; } if (this.data.balance <= 0) { chk++; swal("Balance must be greater than zero to staggered"); return 0; } } } if (this.data.staggered == 2) { if (this.data.numMonths > 0) { if (this.data.OTC <= 0) { chk++; swal("Client OTC must be greater than zero to staggered in no cash out"); return 0; } } } if (chk == 0) swal({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$root.$emit("pageLoading"); _this2.data.amount_pay = _this2.amount_pay; _this2.data.withVat = _this2.withVat; _this2.data.user_region_id = _this2.user.region_id; _this2.data.user_id = _this2.user.id; _this2.data.user_name = _this2.user.name; _this2.data.user_email = _this2.user.email; _this2.data.sendTo = _this2.selectedEmails_DOP; _this2.data.CCTO = _this2.selectedEmailsCC_DOP; _this2.$http.post("api/Client/updateDOP", _this2.data).then(function (response) { console.log(response.body); if (_this2.filter != null) _this2.search_data();else _this2.reload_item(); //this.items = response.body.items; //comment dyud dapat ni siya swal("Updated", "", "success"); _this2.$bvModal.hide("modalUpdateDOP"); _this2.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this2.$root.$emit("pageLoaded"); }); } }); } } }); /***/ }), /* 469 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_encode_modem_vue__ = __webpack_require__(470); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_81ce809c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_encode_modem_vue__ = __webpack_require__(1039); function injectStyle (ssrContext) { __webpack_require__(1037) } var normalizeComponent = __webpack_require__(9) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-81ce809c" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_encode_modem_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_81ce809c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_encode_modem_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 470 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuex__ = __webpack_require__(122); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: { stock_modems: { type: Array }, client_area_id: { type: Number }, assign_modem: { type: Function } }, components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default.a }, data: function data() { return { stock_modem: { area_id: 0, client: {}, mac: "", serial: "", stock_id: "" }, backend_selected: "BW", olt_selected: {}, item_stock_modem: { stock_id: "", serial: "", mac: "", area_id: 0 }, area: [], dataIsChanged: 0, stock_modem_list: [], item_stock_modem_list: [], back_end_list: [{ name: "BW", value: "BW" }, { name: "Hive Connect", value: "Hive Connect" }] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); }, mounted: function mounted() { this.load(); }, computed: _extends({}, Object(__WEBPACK_IMPORTED_MODULE_2_vuex__["c" /* mapGetters */])({ olt_list: "olts/getOlts" }), { stock_modem_loaded1: function stock_modem_loaded1() { if (this.dataIsChanged == 0) { if (this.stock_modems != null) { this.stock_modem_list = this.stock_modems; this.item_stock_modem.area_id = this.client_area_id; } } else { this.stock_modem_list = this.item_stock_modem_list; } return this.stock_modem_list; } }), methods: _extends({}, Object(__WEBPACK_IMPORTED_MODULE_2_vuex__["b" /* mapActions */])({ // }), { load: function load() { var _this = this; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this.$http.get("api/area").then(function (response) { this.area = response.body; }); //this.olt_list = await this.setOlts(); case 1: case "end": return _context.stop(); } } }, _callee, _this); }))(); }, btnSubmit: function btnSubmit() { this.stock_modem.backend_selected = this.backend_selected; this.stock_modem.olt_selected = this.olt_selected; this.stock_modem.olt = this.olt_selected.ip; this.assign_modem(this.stock_modem); }, btnSubmit_old: function btnSubmit_old() { // this.stock_modem.client = this.activity_ticket.client; // this.stock_modem.activity_ticket_id = this.activity_ticket.id; // this.stock_modem.user_region_id = this.user.region_id; // this.stock_modem.user_id = this.user.id; // this.stock_modem.user_name = this.user.name; // this.stock_modem.user_email = this.user.email; // //this.stock_modem.chk_vlan = this.activity_ticket.chk_vlan; // console.log(this.stock_modem); // if ( // this.activity_ticket.client.package.bandwidth_min == null && // this.activity_ticket.client.package.bandwidth_max == null // ) // swal( // "The Package assigned in client has no max speed and cir please update the package first" // ); // else { // if (this.activity_ticket.client.bucket_id != null) { // swal({ // title: "Are you sure?", // text: "", // icon: "warning", // buttons: ["No", "Yes"], // dangerMode: true // }).then(update => { // if (update) { // this.$root.$emit("pageLoading"); // this.$http // .post("api/Client/encodeModem", this.stock_modem) // .then(response => { // console.log(response); // if (this.filter != null) this.search_data(); // else this.reload_item(); // swal("Updated", "", "success"); // this.$bvModal.hide("modalEncodeModem"); // this.$root.$emit("pageLoaded"); // }) // .catch(response => { // console.log(response.body); // swal({ // title: response.body.error, // text: "", // icon: "error", // dangerMode: true // }); // this.$root.$emit("pageLoaded"); // }); // } // }); // } else { // swal("No bucket assign"); // } // } }, openAddStockModem: function openAddStockModem(item) { this.$bvModal.show("modalAddStockModem"); }, btnAddStockModem: function btnAddStockModem() { var _this2 = this; this.item_stock_modem.user_id = this.user.id; this.item_stock_modem.user_name = this.user.name; this.$http.post("api/StockModem", this.item_stock_modem).then(function (response) { swal("Created", "", "success"); _this2.item_stock_modem_list = response.body; _this2.dataIsChanged = 1; _this2.$bvModal.hide("modalAddStockModem"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this2.$refs.name.focus(); } }); }); }, reset: function reset() { this.item_stock_modemstock_id = ""; this.item_stock_modem.serial = ""; this.item_stock_modem.mac = ""; }, customSerial: function customSerial(serial) { return serial.serial + " - " + serial.mac + " - " + serial.stock_id; }, customOltName: function customOltName(olt) { return olt.name + " - " + olt.ip; } }) }); /***/ }), /* 471 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_sweetalert2__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_multiselect__); var _methods; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["item", "client", "bucket", "jo", "package", "package_type", "stock_modems", "reload_item", "filter", "search_data"], components: { multiselect: __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a }, data: function data() { return { user: {}, roles: [], cidr_list: [{ name: "/32" }, { name: "/31" }, { name: "/30" }, { name: "/29" }, { name: "/28" }, { name: "/27" }, { name: "/26" }, { name: "/25" }, { name: "/24" }], iptype_list: [{ name: "private_ip" }, { name: "public_ip" }], arp_type_list: [{ name: "ready" }, { name: "static" }, { name: "discovery" }], onuserve_type_list: [{ name: "IP_Routed" }, { name: "IP_Bridged" }], serve_table_list: [], vlan_table_list: [], ip_table_list: [], ip_assign_OBJ: { sequence_no: "", ip: "", cidr: "/32", network: "", iptype: "", status: "new" }, ip_unassign_obj: { ip: "", status: "new" }, ip_arp_obj: { sequence_no: "", ip: "", arp_type: "", mac: "", status: "new" }, ip_arp_dynamic_obj: { ip: "", status: "new" }, vlan_assign_OBJ: { sequence_no: "", vlan: "", iplist: null, range_class: "", status: "new" }, vlan_unassign_OBJ: { vlan: "", status: "new" }, onuserve_add_OBJ: { sequence_no: "", type: "", parameter: "", status: "new" }, onuserve_edit_OBJ: { sequence_no: "", id: "", type: "", parameter: "", status: "new" }, parameters: [], tokenParsed: null, jo_to_approve: [], item_stock_modem: { stock_id: "", serial: "", mac: "", area_id: 0 }, area: [], dataIsChanged: 0, stock_modem_list: [], item_stock_modem_list: [], modemSelected: null, remarksText: "", commentsText: [], userBwRoles: [], bucket_roles: ["role_network_admin", "role_network_core", "role_noc", "role_subscription", "role_network_access", "role_support", "role_automation", "role_tech_support"] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.tokenParsed = this.$keycloak.tokenParsed; console.log(this.tokenParsed); if (this.client.package_type_id == "4") { this.vlan_assign_OBJ.range_class = "2"; } else { this.vlan_assign_OBJ.range_class = "1"; } this.load(); }, mounted: function mounted() {}, computed: { executeVisible: function executeVisible() { //boolean kung naay pending sa jo_approver e hide ang execute na button var temp = 0; if (this.item.jo_approver.length > 0) { this.item.jo_approver.forEach(function (jo_role) { if (jo_role.status == "Pending") { //NOTE anyone can execute basta wala lay pending sa jo_approver temp++; } }); if (temp > 0) return false;else { if (this.item.status == "Modification") return true;else return false; } } else return false; }, acceptVisible: function acceptVisible() { var _this = this; //boolean check kung naa ba e approve sa jo_approver, kung naa e visible ang button var temp = 0; this.jo_to_approve = []; console.log("this.item.jo_approver.length " + this.item.jo_approver.length); if (this.item.jo_approver.length > 0) this.item.jo_approver.forEach(function (jo_role) { var g_role = _this.tokenParsed.group; //console.log(g_role); if (g_role != null) { if (g_role.filter(function (s) { return s.includes(jo_role.role); }).length > 0 && jo_role.status == "Pending") { temp++; _this.jo_to_approve.push(jo_role); } } }); console.log("temp val: " + temp); if (temp > 0) return true;else return false; }, stock_modem_loaded: function stock_modem_loaded() { if (this.dataIsChanged == 0) { if (this.stock_modems != null) { this.stock_modem_list = this.stock_modems; this.item_stock_modem.area_id = this.client.area_id; } } else { this.stock_modem_list = this.item_stock_modem_list; } return this.stock_modem_list; } }, methods: (_methods = { // calling of modals load: function load() { var _this2 = this; this.$http.get("api/area").then(function (response) { this.area = response.body; }); var g_roles = this.$keycloak.tokenParsed.group; this.userBwRoles = g_roles.filter(function (element) { return _this2.bucket_roles.includes(element.split("/").pop()); }); }, modify_onuserve: function modify_onuserve(item) { console.log(item); this.onuserve_edit_OBJ = item; this.onuserve_edit_OBJ.status = "modify"; this.$bvModal.show("modalONU_edit"); }, arp_IP: function arp_IP(item) { this.ip_arp_obj.ip = item.name; this.$bvModal.show("modalIP_arp"); }, // commands cmd_assign_IP: function cmd_assign_IP() { var _this3 = this; console.log(this.ip_assign_OBJ); this.parameters = []; var par1 = ""; var par2 = ""; var par3 = ""; var par4 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par4); par4 = par4.replace(/:\s*/g, " "); if (this.ip_assign_OBJ.iptype != "") { par1 = "--iptype_name:" + this.ip_assign_OBJ.iptype + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); } if (this.ip_assign_OBJ.network != "") { par2 = "--net_name:" + this.ip_assign_OBJ.network + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); } if (this.ip_assign_OBJ.cidr != "/32") { if (this.ip_assign_OBJ.ip != "") { par3 = "--ip_cidr" + " " + this.ip_assign_OBJ.ip + this.ip_assign_OBJ.cidr + " "; var temp1 = "ip:" + this.ip_assign_OBJ.ip; var temp2 = "cidr:" + this.ip_assign_OBJ.cidr; this.parameters.push(temp1, temp2); } if (this.ip_assign_OBJ.ip == "") { par3 = "--ip_autocidr:" + this.ip_assign_OBJ.cidr + " "; this.parameters.push(par3); par3 = par3.replace(/:\s*/g, " "); } } if (this.ip_assign_OBJ.cidr == "/32") { if (this.ip_assign_OBJ.ip != "") { par3 = this.ip_assign_OBJ.ip + " "; var temp1 = "ip:" + this.ip_assign_OBJ.ip; this.parameters.push(temp1); } } var data = { activity_ticket_id: this.jo.id, command: "ip --assign" + " " + par1 + par2 + par3 + par4, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created IP Assign", role: "role_subscription", approver_status: "Pending", new_temp: this.ip_assign_OBJ, old_temp: this.ip_assign_OBJ.old_data }; this.$root.$emit("pageLoading"); if (this.ip_assign_OBJ.status == "new") { this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this3.item.cmd_execution = response.body.commands; _this3.item.history = response.body.history; _this3.item.jo_approver = response.body.approvers; _this3.$bvModal.hide("modalIP_assign"); }); this.$root.$emit("pageLoaded"); } else { data.action = "Updated IP Assign Sequence #" + this.ip_assign_OBJ.old_data.sequence_no; this.$http.put("api/CMD/" + this.jo.id, data).then(function (response) { console.log(response.body); _this3.item.cmd_execution = response.body.commands; _this3.item.history = response.body.history; _this3.item.jo_approver = response.body.approvers; _this3.$bvModal.hide("modalIP_assign"); _this3.$root.$emit("pageLoaded"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this3.$root.$emit("pageLoaded"); }); } }, cmd_unassign_ip: function cmd_unassign_ip(item) { var _this4 = this; console.log(item); swal({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this4.parameters = []; var param1 = "--ip_name:" + " " + item.name + " "; _this4.parameters.push(param1); param1 = param1.replace(/:\s*/g, " "); var param2 = "--provision_name" + " " + _this4.client.acc_no + " "; _this4.parameters.push(param2); param2 = param2.replace(/:\s*/g, " "); var data = { activity_ticket_id: _this4.jo.id, command: "ip --unassign" + " " + param1 + param2, parameters: _this4.parameters, user_id: _this4.user.id, activity: "Subscription Modification", action: "Created IP Unassign", role: "role_subscription", approver_status: "Pending" }; _this4.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this4.item.cmd_execution = response.body.commands; _this4.item.history = response.body.history; _this4.item.jo_approver = response.body.approvers; _this4.$root.$emit("pageLoaded"); }); } }); }, cmd_arp_ip: function cmd_arp_ip() { var _this5 = this; console.log(this.ip_arp_obj); var par1 = ""; var par2 = ""; this.parameters = []; if (this.ip_arp_obj.arp_type != "") { par1 = "--ip_arp:" + this.ip_arp_obj.arp_type + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); } if (this.ip_arp_obj.mac != "") { par2 = "--ip_mac:" + this.ip_arp_obj.mac + " "; this.parameters.push(par2); // par2 = par2.replace(/:\s*/g, " "); par2 = "--ip_mac " + this.ip_arp_obj.mac + " "; } var par3 = "--ip_name:" + this.ip_arp_obj.ip + " "; this.parameters.push(par3); par3 = par3.replace(/:\s*/g, " "); var par4 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par4); par4 = par4.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "ip --arp" + " " + par1 + par3 + par2 + par4, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created IP Arp", role: "role_subscription", approver_status: "Pending", new_temp: this.ip_arp_obj, old_temp: this.ip_arp_obj.old_data }; this.$root.$emit("pageLoading"); if (this.ip_arp_obj.status == "new") { this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this5.item.cmd_execution = response.body.commands; _this5.item.history = response.body.history; _this5.item.jo_approver = response.body.approvers; _this5.$bvModal.hide("modalIP_arp"); }); this.$root.$emit("pageLoaded"); } else { data.action = "Updated IP Arp Sequence #" + this.ip_arp_obj.old_data.sequence_no; this.$http.put("api/CMD/" + this.jo.id, data).then(function (response) { console.log(response.body); _this5.item.cmd_execution = response.body.commands; _this5.item.history = response.body.history; _this5.item.jo_approver = response.body.approvers; _this5.$bvModal.hide("modalIP_arp"); _this5.$root.$emit("pageLoaded"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this5.$root.$emit("pageLoaded"); }); } }, cmd_arp_dynamic_IP: function cmd_arp_dynamic_IP(item) { var _this6 = this; console.log(item); this.parameters = []; var par1 = "--ip_name:" + item.name + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); var par2 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "ip --arp_dynamic" + " " + par1 + par2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created IP Arp dynamic", role: "role_subscription", approver_status: "Pending" }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this6.item.cmd_execution = response.body.commands; _this6.item.history = response.body.history; _this6.item.jo_approver = response.body.approvers; }); this.$root.$emit("pageLoaded"); }, cmd_brprov_assign_cls: function cmd_brprov_assign_cls(item) { var _this7 = this; console.log(item); //bwprov --assign_cls --ip_name --provision_name this.parameters = []; var par1 = "--ip_name:" + item.name + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); var par2 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "bwprov --assign_cls " + par1 + par2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created BWPROV ASSIGN CLS", role: "role_network_access", approver_status: "Pending" }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this7.item.cmd_execution = response.body.commands; _this7.item.history = response.body.history; _this7.item.jo_approver = response.body.approvers; }); this.$root.$emit("pageLoaded"); }, cmd_brprov_unassign_cls: function cmd_brprov_unassign_cls(item) { var _this8 = this; console.log(item); //bwprov --assign_cls --ip_name --provision_name this.parameters = []; var par1 = "--ip_name:" + item.name + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); var par2 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "bwprov --unassign_cls " + par1 + par2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created BWPROV UNASSIGN CLS", role: "role_network_access", approver_status: "Pending" }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this8.item.cmd_execution = response.body.commands; _this8.item.history = response.body.history; _this8.item.jo_approver = response.body.approvers; }); this.$root.$emit("pageLoaded"); }, cmd_assign_vlan: function cmd_assign_vlan() { var _this9 = this; var par1 = ""; var par2 = ""; var par3 = ""; this.parameters = []; if (this.vlan_assign_OBJ.vlan != "") { par1 = "--vlanint_name:" + this.vlan_assign_OBJ.vlan + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); } else { if (this.vlan_assign_OBJ.range_class != "") { par3 = "--vlanint_class:" + this.vlan_assign_OBJ.range_class + " "; this.parameters.push(par3); par3 = par3.replace(/:\s*/g, " "); } } if (this.vlan_assign_OBJ.iplist != null) { // Extract the "name" values var names = this.vlan_assign_OBJ.iplist.map(function (item) { return item.name; }); // Join the names into a single string with commas var formattedNames = names.join(","); par2 = "--vlan_iplist:" + formattedNames + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); } var par4 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par4); par4 = par4.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "vlan --assign" + " " + par2 + par1 + par3 + par4, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created Vlan Assign", role: "role_subscription", approver_status: "Pending", new_temp: this.vlan_assign_OBJ, old_temp: this.vlan_assign_OBJ.old_data }; this.$root.$emit("pageLoading"); if (this.vlan_assign_OBJ.status == "new") { this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this9.item.cmd_execution = response.body.commands; _this9.item.history = response.body.history; _this9.item.jo_approver = response.body.approvers; _this9.$bvModal.hide("modalVlan_assign"); }); this.$root.$emit("pageLoaded"); } else { data.action = "Updated VLAN Assign Sequence #" + this.vlan_assign_OBJ.old_data.sequence_no; this.$http.put("api/CMD/" + this.jo.id, data).then(function (response) { console.log(response.body); _this9.item.cmd_execution = response.body.commands; _this9.item.history = response.body.history; _this9.item.jo_approver = response.body.approvers; _this9.$bvModal.hide("modalVlan_assign"); _this9.$root.$emit("pageLoaded"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this9.$root.$emit("pageLoaded"); }); } }, cmd_unassign_vlan: function cmd_unassign_vlan(item) { var _this10 = this; console.log(item); this.parameters = []; var par1 = "--vlanint_name:" + item.vlanint_name + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); var par2 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "vlan --unassign" + " " + par1 + par2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created Vlan Unassign", role: "role_subscription", approver_status: "Pending" }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this10.item.cmd_execution = response.body.commands; _this10.item.history = response.body.history; _this10.item.jo_approver = response.body.approvers; _this10.$root.$emit("pageLoaded"); }); }, cmd_vlan_assign_cls: function cmd_vlan_assign_cls(item) { var _this11 = this; console.log(item); //vlan --assign_cls --vlan_iplist --vlanint_name --provision_name this.parameters = []; var par1 = "--vlanint_name:" + item.vlanint_name + " "; this.parameters.push(par1); par1 = par1.replace(/:\s*/g, " "); var par2 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(par2); par2 = par2.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "vlan --assign_cls" + " " + par1 + par2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Created Vlan Unassign", role: "role_subscription", approver_status: "Pending" }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this11.item.cmd_execution = response.body.commands; _this11.item.history = response.body.history; _this11.item.jo_approver = response.body.approvers; _this11.$root.$emit("pageLoaded"); }); }, cmd_onuser_add: function cmd_onuser_add() { var _this12 = this; console.log(this.jo); //if (this.jo.onu != null) { var param_name = ""; this.parameters = []; if (this.onuserve_add_OBJ.type == "IP_Routed") { param_name = "ip"; } else { param_name = "vlan"; } var param1 = "--onuserv_parameters:" + param_name; this.parameters.push(param1); param1 = param1.replace(/:\s*/g, " "); var param2 = "--provision_name" + " " + this.client.acc_no + " "; this.parameters.push(param2); param2 = param2.replace(/:\s*/g, " "); var param3 = "--onuserv_type:" + this.onuserve_add_OBJ.type + " "; this.parameters.push(param3); param3 = param3.replace(/:\s*/g, " "); var param4 = "--onu_name: " + (this.modemSelected == null ? this.jo.onu : this.modemSelected) + " "; this.parameters.push(param4); param4 = param4.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "onuserv --add" + " " + param1 + "," + this.onuserve_add_OBJ.parameter + " " + param2 + param3 + param4, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Add Onuserve", role: "role_subscription", approver_status: "Pending", new_temp: this.onuserve_add_OBJ, old_temp: this.onuserve_add_OBJ.old_data }; this.$root.$emit("pageLoading"); if (this.onuserve_add_OBJ.status == "new") { this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this12.item.cmd_execution = response.body.commands; _this12.item.history = response.body.history; _this12.item.jo_approver = response.body.approvers; _this12.$bvModal.hide("modalIP_assign"); }); this.$root.$emit("pageLoaded"); } else { data.action = "Updated Onuserve Sequence #" + this.onuserve_add_OBJ.old_data.sequence_no; this.$http.put("api/CMD/" + this.jo.id, data).then(function (response) { console.log(response.body); _this12.item.cmd_execution = response.body.commands; _this12.item.history = response.body.history; _this12.item.jo_approver = response.body.approvers; _this12.$bvModal.hide("modalIP_assign"); _this12.$root.$emit("pageLoaded"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this12.$root.$emit("pageLoaded"); }); } this.$bvModal.hide("modalONU_add"); //} else swal("Please select stock modem first!"); }, cmd_edit_onuserve: function cmd_edit_onuserve() { var _this13 = this; console.log(this.onuserve_edit_OBJ); var param_name = ""; this.parameters = []; if (this.onuserve_edit_OBJ.type == "IP_Routed") { param_name = "ip,"; } else { param_name = "vlan,"; } var param1 = "--onuserv_parameters:" + param_name + this.onuserve_edit_OBJ.parameter + " "; this.parameters.push(param1); param1 = param1.replace(/:\s*/g, " "); var param2 = "--onu_name: " + this.jo.onu + " "; this.parameters.push(param2); param2 = param2.replace(/:\s*/g, " "); var param3 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(param3); param3 = param3.replace(/:\s*/g, " "); var param4 = "--onuserv_name:" + this.onuserve_edit_OBJ.onuserv_id + " "; this.parameters.push(param4); param4 = param4.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "onuserv --edit" + " " + param4 + param3 + param1 + param2, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Edit Onuserve", role: "role_subscription", approver_status: "Pending", new_temp: this.onuserve_edit_OBJ, old_temp: this.onuserve_edit_OBJ.old_data }; this.$root.$emit("pageLoading"); if (this.ip_assign_OBJ.status == "new") { this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this13.item.cmd_execution = response.body.commands; _this13.item.history = response.body.history; _this13.item.jo_approver = response.body.approvers; _this13.$bvModal.hide("modalIP_assign"); }); this.$root.$emit("pageLoaded"); } else { data.action = "Updated Edit Onuserve Sequence #" + this.ip_assign_OBJ.old_data.sequence_no; this.$http.put("api/CMD/" + this.jo.id, data).then(function (response) { console.log(response.body); _this13.item.cmd_execution = response.body.commands; _this13.item.history = response.body.history; _this13.item.jo_approver = response.body.approvers; _this13.$bvModal.hide("modalIP_assign"); _this13.$root.$emit("pageLoaded"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this13.$root.$emit("pageLoaded"); }); } this.$bvModal.hide("modalONU_edit"); }, cmd_onuser_delete: function cmd_onuser_delete(item) { var _this14 = this; console.log(item); this.parameters = []; var param1 = "--onuserv_name:" + item.onuserv_id + " "; this.parameters.push(param1); param1 = param1.replace(/:\s*/g, " "); var param2 = "--onu_name: " + item.onu_name + " "; this.parameters.push(param2); param2 = param2.replace(/:\s*/g, " "); var param3 = "--provision_name:" + this.client.acc_no + " "; this.parameters.push(param3); param3 = param3.replace(/:\s*/g, " "); var data = { activity_ticket_id: this.jo.id, command: "onuserv --delete" + " " + param1 + param2 + param3, parameters: this.parameters, user_id: this.user.id, activity: "Subscription Modification", action: "Delete Onuserve", role: "role_subscription", approver_status: "Pending" }; this.$http.post("api/CMD", data).then(function (response) { console.log(response.body); _this14.item.cmd_execution = response.body.commands; _this14.item.history = response.body.history; _this14.item.jo_approver = response.body.approvers; }); }, // load tables load_IPtable: function load_IPtable() { var _this15 = this; console.log("load_ip_table"); this.bucket.acc_no = this.client.acc_no; console.log(this.bucket); this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/ipshow", this.bucket).then(function (response) { console.log(response); _this15.ip_table_list = response.body; _this15.item.cmd_execution.forEach(function (item) { console.log("1"); if (item.bucket_cmd.includes("ip --assign") && item.status == "Pending") { console.log("2"); var temp10 = {}; temp10.name = "_ip" + item.sequence_no; var parameter = item.parameters.split(","); parameter.forEach(function (item1) { if (item1.includes("ip:")) { var temp = item1.split(":"); temp10.name = temp[1]; } if (item1.includes("--iptype_name:")) { var temp = item1.split(":"); temp10.iptype_name = temp[1]; } if (item1.includes("--net_name:")) { var temp = item1.split(":"); temp10.net_name = temp[1]; } }); console.log(temp10); _this15.ip_table_list.push(temp10); } }); _this15.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this15.$root.$emit("pageLoaded"); }); }, load_Vlantable: function load_Vlantable() { var _this16 = this; console.log("load_vlan_table"); this.bucket.acc_no = this.client.acc_no; console.log(this.bucket); this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/vlanshow", this.bucket).then(function (response) { console.log(response); _this16.vlan_table_list = response.body; _this16.item.cmd_execution.forEach(function (item) { console.log("1"); if (item.bucket_cmd.includes("vlan --assign") && item.status == "Pending") { console.log("2"); var temp10 = {}; temp10.vlanint_name = "_vlan" + item.sequence_no; var parameter = item.parameters.split(","); parameter.forEach(function (item1) { if (item1.includes("vlanint_name:", "vlan_iplist:")) { var temp = item1.split(":"); temp10.vlanint_name = temp[1]; } }); console.log(temp10); _this16.vlan_table_list.push(temp10); } }); _this16.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this16.$root.$emit("pageLoaded"); }); }, load_Servetable: function load_Servetable() { var _this17 = this; console.log("load_service_table"); this.bucket.acc_no = this.client.acc_no; console.log(this.bucket); this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/serveshow", this.bucket).then(function (response) { console.log(response); _this17.serve_table_list = response.body; _this17.item.cmd_execution.forEach(function (item) { if (item.bucket_cmd.includes("onuserv --add") && item.status == "Pending") { var temp10 = {}; temp10.onuserv_id = "_sv" + item.sequence_no; var parameter = item.parameters.split(","); parameter.forEach(function (item1) { if (item1.includes("onuserv_type:")) { var temp = item1.split(":"); temp10.type = temp[1]; } }); console.log(temp10); _this17.serve_table_list.push(temp10); } }); _this17.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this17.$root.$emit("pageLoaded"); }); }, // edit per row modify_row: function modify_row(item) { var _this18 = this; console.log(item); if (item.bucket_cmd.includes("ip --assign")) { var parameter = item.parameters.split(","); parameter.forEach(function (item) { if (item.includes("ip:")) { var temp = item.split(":"); _this18.ip_assign_OBJ.ip = temp[1]; } if (item.includes("cidr:")) { var temp = item.split(":"); _this18.ip_assign_OBJ.cidr = temp[1]; } if (item.includes("--iptype_name:")) { var temp = item.split(":"); _this18.ip_assign_OBJ.iptype = temp[1]; } if (item.includes("--net_name:")) { var temp = item.split(":"); _this18.ip_assign_OBJ.network = temp[1]; } }); this.ip_assign_OBJ.sequence_no = item.sequence_no; this.ip_assign_OBJ.status = "edit"; this.ip_assign_OBJ.old_data = item; this.$bvModal.show("modalIP_assign"); } else if (item.bucket_cmd.includes("onuserv --edit")) { var _parameter = item.parameters.split(","); _parameter.forEach(function (item) { var temp = item.split(":"); if (item.includes("ip:")) { _this18.onuserve_edit_OBJ.type = "IP_Routed"; } else if (item.includes("vlan:")) { _this18.onuserve_edit_OBJ.type = "IP_Bridged"; } _this18.onuserve_edit_OBJ.parameter = temp[1]; }); this.onuserve_edit_OBJ.sequence_no = item.sequence_no; this.onuserve_edit_OBJ.status = "edit"; this.onuserve_edit_OBJ.old_data = item; console.log("details below"); console.log(this.onuserve_edit_OBJ); this.$bvModal.show("modalONU_edit"); } else if (item.bucket_cmd.includes("vlan --assign")) { var _parameter2 = item.parameters.split(","); _parameter2.forEach(function (item) { if (item.includes("vlanint_name:")) { var temp = item.split(":"); _this18.vlan_assign_OBJ.vlan = temp[1]; } if (item.includes("vlan_iplist:")) { var temp = item.split(":"); _this18.vlan_assign_OBJ.iplist = temp[1]; } if (item.includes("vlanint_class:")) { var temp = item.split(":"); _this18.vlan_assign_OBJ.range_class = temp[1]; } }); this.vlan_assign_OBJ.sequence_no = item.sequence_no; this.vlan_assign_OBJ.status = "edit"; this.vlan_assign_OBJ.old_data = item; console.log("details below"); console.log(this.vlan_assign_OBJ); this.$bvModal.show("modalVlan_assign"); } else if (item.parameters.includes("--ip_arp")) { var _parameter3 = item.parameters.split(","); _parameter3.forEach(function (item) { if (item.includes("--ip arp:")) { var temp = item.split(":"); _this18.ip_arp_obj.arp_type = temp[1]; } if (item.includes("--ip_mac:")) { var temp = item.split(":"); _this18.ip_arp_obj.mac = temp[1]; } if (item.includes("--ip_name:")) { var temp = item.split(":"); _this18.ip_arp_obj.ip = temp[1]; } }); this.ip_arp_obj.sequence_no = item.sequence_no; this.ip_arp_obj.status = "edit"; this.ip_arp_obj.old_data = item; this.ip_arp_obj.old_data = item; console.log("details below"); console.log(this.ip_arp_obj); this.$bvModal.show("modalIP_arp"); } else if (item.bucket_cmd.includes("onuserv --add")) { var _parameter4 = item.parameters.split(","); _parameter4.forEach(function (item) { if (item.includes("--onuserv_type:")) { var temp = item.split(":"); _this18.onuserve_add_OBJ.type = temp[1]; } }); this.onuserve_add_OBJ.sequence_no = item.sequence_no; this.onuserve_add_OBJ.status = "edit"; this.onuserve_add_OBJ.old_data = item; console.log("details below"); console.log(this.onuserve_add_OBJ); this.$bvModal.show("modalONU_add"); } }, delete_row: function delete_row(item) { var _this19 = this; var data = { details: item, id: item.id, sequence_no: item.sequence_no, user_id: this.user.id, user_name: this.user.name, activity_ticket_id: item.activity_ticket_id }; this.$root.$emit("pageLoading"); this.$http.post("api/CMD/destroy1", data).then(function (response) { _this19.$root.$emit("pageLoaded"); console.log(response.body); swal("", "Item has been deleted", "success"); _this19.item.cmd_execution = response.body.commands; _this19.item.history = response.body.history; _this19.item.jo_approver = response.body.approvers; }).catch(function (response) { console.log(response); _this19.$root.$emit("pageLoading"); swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); }, reset: function reset(modal) { if (modal == "modalIP_assign") { this.ip_assign_OBJ = { ip: "", cidr: "/32", network: "", iptype: "", status: "new" }; this.parameters = []; } else if (modal == "modalONU_edit") { this.onuserve_edit_OBJ = { id: "", type: "", parameter: "", status: "new" }; } else if (modal == "modalIP_assign") { this.ip_arp_obj = { ip: "", arp_type: "", mac: "", parameter: "", status: "new" }; } else if (modal == "modalVlan_assign") { this.vlan_assign_OBJ = { vlan: "", iplist: null, range_class: "", parameter: "", status: "new" }; } else if (modal == "modalONU_add") { this.onuserve_add_OBJ = { type: "", parameter: "", vlan: "", iplist: null, range_class: "", status: "new" }; } }, resetTable: function resetTable() { this.dataIsChanged = 0; this.serve_table_list = []; this.vlan_table_list = []; this.ip_table_list = []; }, btnAccept: function btnAccept() { var _this20 = this; console.log("btnAccept"); var temp = { activity_ticket_id: this.jo.id, data: this.jo_to_approve, user: this.user }; console.log(temp); swal({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this20.$root.$emit("pageLoading"); _this20.$http.post("api/Bucket/acceptCommand", temp).then(function (response) { console.log(response); swal("Command/s Approved!"); _this20.item.jo_approver = response.body; _this20.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this20.$root.$emit("pageLoaded"); }); } }); }, btnExecute: function btnExecute() { var _this21 = this; console.log(this.item); swal({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var temp = { data: _this21.item, user: _this21.user }; console.log(temp); _this21.$root.$emit("pageLoading"); _this21.$http.post("api/Bucket/executeCommand", temp).then(function (response) { console.log(response); _this21.item.cmd_execution = response.body.commands; if (response.body.status_complete == "yes") _this21.item.status = "Complete"; swal("Executed!"); _this21.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response); swal({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this21.$root.$emit("pageLoaded"); }); } }); // Swal2.fire({ // title: 'Are you sure? You want to execute all the command', // text: "please input your password to execute bucket command", // input: 'password', // showCancelButton: true, // confirmButtonText: 'Execute', // showLoaderOnConfirm: true, // preConfirm: (pass) => { // this.user.user_id =this.user.id; // this.user.username =this.user.email; // this.user.password =pass; // }, // allowOutsideClick: () => !Swal.isLoading() // }).then((result) => { // if (result.isConfirmed) { // Swal.fire({ // title: `${result.value.login}'s avatar`, // imageUrl: result.value.avatar_url // }) // } // }); }, customSerial: function customSerial(serial) { return serial.serial + " - " + serial.mac + " - " + serial.stock_id; }, openAddStockModem: function openAddStockModem(item) { this.$bvModal.show("modalAddStockModem1"); }, btnAddStockModem: function btnAddStockModem() { var _this22 = this; this.item_stock_modem.user_id = this.user.id; this.item_stock_modem.user_name = this.user.name; this.$http.post("api/StockModem", this.item_stock_modem).then(function (response) { swal("Created", "", "success"); _this22.item_stock_modem_list = response.body; _this22.dataIsChanged = 1; _this22.$bvModal.hide("modalAddStockModem1"); }).catch(function (response) { swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this22.$refs.name.focus(); } }); }); } }, _defineProperty(_methods, "reset", function reset() { this.item_stock_modem = { stock_id: "", serial: "", mac: "" }; }), _defineProperty(_methods, "addRemarks_clicked", function addRemarks_clicked() { var _this23 = this; if (this.remarksText != "") { var data = { ticket_id: this.item.id, user_id: this.user.id, remarks: this.remarksText, form_type: "csmf", ticketType: "7" }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this23.remarksText = ""; _this23.item.remarks_log_csmf = response.body; console.log(response.body); }); } else { swal("Please add some text in the remarks text area"); } }), _defineProperty(_methods, "addComments_clicked", function addComments_clicked(id, i, stor) { var _this24 = this; if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.item.id, ticketType: "7" }; this.$http.post("api/TicketCommentsLog", data).then(function (response) { _this24.commentsText[i] = ""; _this24.item.remarks_log_csmf = response.body; _this24.$global.scrollComment(i, 2); }); } else { swal("Please add some text in the comments text area"); } }), _defineProperty(_methods, "btnDisapprove", function btnDisapprove(item) { var _this25 = this; __WEBPACK_IMPORTED_MODULE_4_sweetalert2___default.a.fire({ title: "Disapprove remarks", input: "textarea", inputPlaceholder: "Type your message here...", inputAttributes: { "aria-label": "Type your message here", required: true }, inputValidator: function inputValidator(value) { if (value === "") { return "Please add remarks!"; } }, showCancelButton: true, preConfirm: function preConfirm(remarks) { var data = { ticket_id: item.id, user_id: _this25.user.id, remarks: remarks, form_type: "csmf", ticketType: "7" }; return _this25.$http.post("api/TicketRemarksLog", data).then(function (response) { if (!response.ok) { throw new Error(response.statusText); } _this25.item.remarks_log_csmf = response.body; console.log("123123", response); return response.json(); }).catch(function (error) { __WEBPACK_IMPORTED_MODULE_4_sweetalert2___default.a.showValidationMessage("Request failed: " + error); }); }, allowOutsideClick: function allowOutsideClick() { return !__WEBPACK_IMPORTED_MODULE_4_sweetalert2___default.a.isLoading(); } }).then(function (result) { console.log(result); if (result) { var _data; _this25.$root.$emit("pageLoading"); var data = (_data = { id: item.client.id, client: item.client, row: "status", user_id: _this25.user.id, created_by: _this25.user.id, type: "Disapprove CSMF", status: "Disapproved", state: "all", activity_ticket: item }, _defineProperty(_data, "user_id", _this25.user.id), _defineProperty(_data, "user_email", _this25.user.email + _this25.user.subdomain), _defineProperty(_data, "user_name", _this25.user.name), _defineProperty(_data, "ssh_switch", _this25.ssh_switch_local), _defineProperty(_data, "role", _this25.state_role), _data); _this25.$http.post("api/ActivityTicket/updateClientStatus", data).then(function (response) { console.log(response); if (_this25.filter != null) _this25.search_data();else _this25.reload_item(); _this25.$root.$emit("pageLoaded"); swal("Disapproved!", "", "success"); }).catch(function (response) { console.log(response.body); _this25.$root.$emit("pageLoaded"); swal({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }), _defineProperty(_methods, "mousemove", function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } // console.log(scrol.scrollLeft); // console.log(e.clientX); // console.log(window.innerWidth); }), _methods) }); /***/ }), /* 472 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_5_vue_rangedate_picker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default.a }, data: function data() { return { cbFilter: { ticket_type: false, status: false, state: false, date_applied: false, created_at: false, data: { ticket_type_id: 0, status: "", state: "", date_applied: { from: null, to: null }, created_at: { from: null, to: null } } }, ticket_types: [], statuses: [{ name: "Update DOP" }, { name: "AM verification" }, { name: "Upgrade" }, { name: "Downgrade" }, { name: "Check Balance" }, { name: "Acct. Head Approval" }, { name: "AM Head Approval" }, { name: "Addendum" }, { name: "Pending" }, { name: "Update Billing" }, { name: "Temp Discon" }, { name: "On Hold" }, { name: "Disconnected" }, { name: "Active" }, { name: "Completed" }], states: [{ name: "accounting" }, { name: "helpdesk" }, { name: "am" }, { name: "Acct. Head Approval" }, { name: "AM Head Approval" }], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); }, methods: { load: function load() { this.$http.get("api/ActivityTicketType").then(function (response) { this.ticket_types = response.body; }); }, filter_ok: function filter_ok() { var _this = this; console.log(this.cbFilter); this.$root.$emit("pageLoading"); this.$http.post("api/ActivityTicket/multipleFilter", this.cbFilter).then(function (response) { console.log(response.body); _this.$root.$emit("pageLoaded"); _this.$root.$emit("update_item_activity_ticket", response.body); _this.$bvModal.hide("modalMultipleFilterActivityTicket"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this.$root.$emit("pageLoaded"); }); }, select_date_change: function select_date_change(txt, event) { if (txt == "date_activated_from") { this.cbFilter.data.date_activated.from = this.formatDateMDY(event); } else if (txt == "date_activated_to") { this.cbFilter.data.date_activated.to = this.formatDateMDY(event); } else if (txt == "created_at_from") { this.cbFilter.data.created_at.from = this.formatDateMDY(event); } else if (txt == "created_at_to") { this.cbFilter.data.created_at.to = this.formatDateMDY(event); } }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); } } }); /***/ }), /* 473 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function bind(fn, thisArg) { return function wrap() { var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } return fn.apply(thisArg, args); }; }; /***/ }), /* 474 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(49); function encode(val) { return encodeURIComponent(val). replace(/%3A/gi, ':'). replace(/%24/g, '$'). replace(/%2C/gi, ','). replace(/%20/g, '+'). replace(/%5B/gi, '['). replace(/%5D/gi, ']'); } /** * Build a URL by appending params to the end * * @param {string} url The base of the url (e.g., http://www.google.com) * @param {object} [params] The params to be appended * @returns {string} The formatted url */ module.exports = function buildURL(url, params, paramsSerializer) { /*eslint no-param-reassign:0*/ if (!params) { return url; } var serializedParams; if (paramsSerializer) { serializedParams = paramsSerializer(params); } else if (utils.isURLSearchParams(params)) { serializedParams = params.toString(); } else { var parts = []; utils.forEach(params, function serialize(val, key) { if (val === null || typeof val === 'undefined') { return; } if (utils.isArray(val)) { key = key + '[]'; } else { val = [val]; } utils.forEach(val, function parseValue(v) { if (utils.isDate(v)) { v = v.toISOString(); } else if (utils.isObject(v)) { v = JSON.stringify(v); } parts.push(encode(key) + '=' + encode(v)); }); }); serializedParams = parts.join('&'); } if (serializedParams) { var hashmarkIndex = url.indexOf('#'); if (hashmarkIndex !== -1) { url = url.slice(0, hashmarkIndex); } url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; } return url; }; /***/ }), /* 475 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Update an Error with the specified config, error code, and response. * * @param {Error} error The error to update. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The error. */ module.exports = function enhanceError(error, config, code, request, response) { error.config = config; if (code) { error.code = code; } error.request = request; error.response = response; error.isAxiosError = true; error.toJSON = function toJSON() { return { // Standard message: this.message, name: this.name, // Microsoft description: this.description, number: this.number, // Mozilla fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, // Axios config: this.config, code: this.code, status: this.response && this.response.status ? this.response.status : null }; }; return error; }; /***/ }), /* 476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(49); var settle = __webpack_require__(1058); var cookies = __webpack_require__(1059); var buildURL = __webpack_require__(474); var buildFullPath = __webpack_require__(1060); var parseHeaders = __webpack_require__(1063); var isURLSameOrigin = __webpack_require__(1064); var createError = __webpack_require__(477); var defaults = __webpack_require__(145); var Cancel = __webpack_require__(146); module.exports = function xhrAdapter(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { var requestData = config.data; var requestHeaders = config.headers; var responseType = config.responseType; var onCanceled; function done() { if (config.cancelToken) { config.cancelToken.unsubscribe(onCanceled); } if (config.signal) { config.signal.removeEventListener('abort', onCanceled); } } if (utils.isFormData(requestData)) { delete requestHeaders['Content-Type']; // Let the browser set it } var request = new XMLHttpRequest(); // HTTP basic authentication if (config.auth) { var username = config.auth.username || ''; var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); } var fullPath = buildFullPath(config.baseURL, config.url); request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS request.timeout = config.timeout; function onloadend() { if (!request) { return; } // Prepare the response var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; var response = { data: responseData, status: request.status, statusText: request.statusText, headers: responseHeaders, config: config, request: request }; settle(function _resolve(value) { resolve(value); done(); }, function _reject(err) { reject(err); done(); }, response); // Clean up request request = null; } if ('onloadend' in request) { // Use onloadend if available request.onloadend = onloadend; } else { // Listen for ready state to emulate onloadend request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) { return; } // The request errored out and we didn't get a response, this will be // handled by onerror instead // With one exception: request that using file: protocol, most browsers // will return status as 0 even though it's a successful request if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { return; } // readystate handler is calling before onerror or ontimeout handlers, // so we should call onloadend on the next 'tick' setTimeout(onloadend); }; } // Handle browser request cancellation (as opposed to a manual cancellation) request.onabort = function handleAbort() { if (!request) { return; } reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request request = null; }; // Handle low level network errors request.onerror = function handleError() { // Real errors are hidden from us by the browser // onerror should only fire if it's a network error reject(createError('Network Error', config, null, request)); // Clean up request request = null; }; // Handle timeout request.ontimeout = function handleTimeout() { var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; var transitional = config.transitional || defaults.transitional; if (config.timeoutErrorMessage) { timeoutErrorMessage = config.timeoutErrorMessage; } reject(createError( timeoutErrorMessage, config, transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', request)); // Clean up request request = null; }; // Add xsrf header // This is only done if running in a standard browser environment. // Specifically not if we're in a web worker, or react-native. if (utils.isStandardBrowserEnv()) { // Add xsrf header var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; if (xsrfValue) { requestHeaders[config.xsrfHeaderName] = xsrfValue; } } // Add headers to the request if ('setRequestHeader' in request) { utils.forEach(requestHeaders, function setRequestHeader(val, key) { if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { // Remove Content-Type if data is undefined delete requestHeaders[key]; } else { // Otherwise add header to the request request.setRequestHeader(key, val); } }); } // Add withCredentials to request if needed if (!utils.isUndefined(config.withCredentials)) { request.withCredentials = !!config.withCredentials; } // Add responseType to request if needed if (responseType && responseType !== 'json') { request.responseType = config.responseType; } // Handle progress if needed if (typeof config.onDownloadProgress === 'function') { request.addEventListener('progress', config.onDownloadProgress); } // Not all browsers support upload events if (typeof config.onUploadProgress === 'function' && request.upload) { request.upload.addEventListener('progress', config.onUploadProgress); } if (config.cancelToken || config.signal) { // Handle cancellation // eslint-disable-next-line func-names onCanceled = function(cancel) { if (!request) { return; } reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); request.abort(); request = null; }; config.cancelToken && config.cancelToken.subscribe(onCanceled); if (config.signal) { config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); } } if (!requestData) { requestData = null; } // Send the request request.send(requestData); }); }; /***/ }), /* 477 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var enhanceError = __webpack_require__(475); /** * Create an Error with the specified message, config, error code, request and response. * * @param {string} message The error message. * @param {Object} config The config. * @param {string} [code] The error code (for example, 'ECONNABORTED'). * @param {Object} [request] The request. * @param {Object} [response] The response. * @returns {Error} The created error. */ module.exports = function createError(message, config, code, request, response) { var error = new Error(message); return enhanceError(error, config, code, request, response); }; /***/ }), /* 478 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isCancel(value) { return !!(value && value.__CANCEL__); }; /***/ }), /* 479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(49); /** * Config-specific merge-function which creates a new config-object * by merging two configuration objects together. * * @param {Object} config1 * @param {Object} config2 * @returns {Object} New object resulting from merging config2 to config1 */ module.exports = function mergeConfig(config1, config2) { // eslint-disable-next-line no-param-reassign config2 = config2 || {}; var config = {}; function getMergedValue(target, source) { if (utils.isPlainObject(target) && utils.isPlainObject(source)) { return utils.merge(target, source); } else if (utils.isPlainObject(source)) { return utils.merge({}, source); } else if (utils.isArray(source)) { return source.slice(); } return source; } // eslint-disable-next-line consistent-return function mergeDeepProperties(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(config1[prop], config2[prop]); } else if (!utils.isUndefined(config1[prop])) { return getMergedValue(undefined, config1[prop]); } } // eslint-disable-next-line consistent-return function valueFromConfig2(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(undefined, config2[prop]); } } // eslint-disable-next-line consistent-return function defaultToConfig2(prop) { if (!utils.isUndefined(config2[prop])) { return getMergedValue(undefined, config2[prop]); } else if (!utils.isUndefined(config1[prop])) { return getMergedValue(undefined, config1[prop]); } } // eslint-disable-next-line consistent-return function mergeDirectKeys(prop) { if (prop in config2) { return getMergedValue(config1[prop], config2[prop]); } else if (prop in config1) { return getMergedValue(undefined, config1[prop]); } } var mergeMap = { 'url': valueFromConfig2, 'method': valueFromConfig2, 'data': valueFromConfig2, 'baseURL': defaultToConfig2, 'transformRequest': defaultToConfig2, 'transformResponse': defaultToConfig2, 'paramsSerializer': defaultToConfig2, 'timeout': defaultToConfig2, 'timeoutMessage': defaultToConfig2, 'withCredentials': defaultToConfig2, 'adapter': defaultToConfig2, 'responseType': defaultToConfig2, 'xsrfCookieName': defaultToConfig2, 'xsrfHeaderName': defaultToConfig2, 'onUploadProgress': defaultToConfig2, 'onDownloadProgress': defaultToConfig2, 'decompress': defaultToConfig2, 'maxContentLength': defaultToConfig2, 'maxBodyLength': defaultToConfig2, 'transport': defaultToConfig2, 'httpAgent': defaultToConfig2, 'httpsAgent': defaultToConfig2, 'cancelToken': defaultToConfig2, 'socketPath': defaultToConfig2, 'responseEncoding': defaultToConfig2, 'validateStatus': mergeDirectKeys }; utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { var merge = mergeMap[prop] || mergeDeepProperties; var configValue = merge(prop); (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); }); return config; }; /***/ }), /* 480 */ /***/ (function(module, exports) { module.exports = { "version": "0.25.0" }; /***/ }), /* 481 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_vue_node_marker_click_vue__ = __webpack_require__(482); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], modal_node_marker_click: __WEBPACK_IMPORTED_MODULE_2__modal_vue_node_marker_click_vue__["a" /* default */] }, data: function data() { return { tblisBusy: true, fields: [{ key: "name", sortable: true }, { key: "lat", sortable: true }, { key: "lng", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [20, 50, 100], item: { name: "", lat: "", lng: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); }, mounted: function mounted() { var _this = this; this.load(); this.$root.$on("delete_node", function (index) { _this.items.splice(index, 1); }); }, updated: function updated() {}, methods: { load: function load() { var _this2 = this; this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarCalendar").style.backgroundColor = ""; document.getElementById("navbarTicket").style.backgroundColor = ""; document.getElementById("navbarInstallation").style.backgroundColor = ""; document.getElementById("navbarMap").style.backgroundColor = ""; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; document.getElementById("navbarAccounts").style.backgroundColor = ""; }, 100); }); this.$http.get("api/Node").then(function (response) { console.log(response.body); _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.operator) { return "elClr cursorPointer"; } else return "elClr"; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.operator) { item.index = index; item.wit = item.marker_type; item.isMap = false; this.item = item; console.log(this.item); if (this.item.wit == "node") this.$bvModal.show("modal_node_marker_click"); } }, openModal: function openModal(modal) { this.$bvModal.show(modal); this.clearData(); }, clearData: function clearData() { this.item = { id: null, name: "", lat: "", lng: "" }; }, btnCreate: function btnCreate() { var _this3 = this; this.$validator.validateAll().then(function (result) { if (result) { _this3.$root.$emit("pageLoading"); _this3.tblisBusy = true; _this3.item.user_id = _this3.user.id; _this3.item.user_name = _this3.user.name; _this3.$http.post("api/Node", _this3.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this3.clearData(); _this3.items.push(response.body); _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; _this3.$bvModal.hide("modalAdd"); _this3.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this3.$root.$emit("pageLoaded"); }); } }); }, btnUpdate: function btnUpdate() { var _this4 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this4.$root.$emit("pageLoading"); _this4.item.user_id = _this4.user.id; _this4.item.user_name = _this4.user.name; _this4.$http.put("api/Node/" + _this4.item.id, _this4.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this4.$bvModal.hide("modalAdd"); _this4.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this4.$root.$emit("pageLoaded"); }); } }); } }); }, btnDelete: function btnDelete() { var _this5 = this; if (this.roles.delete_olt) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.items = []; _this5.tblisBusy = true; _this5.$http.delete("api/Node/" + _this5.item.id).then(function (response) { _this5.$bvModal.hide("modalEdit"); _this5.$global.setRegion(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this5.items = response.body; _this5.totalRows = _this5.items.length; _this5.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete an Node", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 482 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_marker_click_vue__ = __webpack_require__(483); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ba9fbbe_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_marker_click_vue__ = __webpack_require__(1079); function injectStyle (ssrContext) { __webpack_require__(1073) } var normalizeComponent = __webpack_require__(9) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-8ba9fbbe" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_marker_click_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ba9fbbe_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_marker_click_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 483 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_splitter_port_list_vue__ = __webpack_require__(1075); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { modal_splitter_port_list: __WEBPACK_IMPORTED_MODULE_2__modal_splitter_port_list_vue__["a" /* default */], "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], olt_field: [{ key: "name" }, { key: "ip" }, { key: "action" }], olt_item: [], olt: { isNew: true, name: "", ip: "", node_id: "" }, item: {}, olt_tblisBusy: false, closure_types: [], latlng: "", lnglat: "", coor_type: 3, coor_type_list: [{ id: 1, name: "lat and lng" }, { id: 2, name: "(lat,lng):" }, { id: 3, name: "(lng,lat):" }], lcp_field: [{ key: "name", label: "Attached To" }, { key: "splitter_type_id", formatter: function formatter(value) { if (value == "3") return "NAP";else if (value == "4") return "LCP";else return value; }, label: "Splitter Type" }, { key: "attached_port", label: "PON #", sortable: true }, { key: "port_type" }, { key: "status" }, { key: "action" }], lcps: [], lcp_tblisBusy: false, lcp: { closure: { isNew: null, name: "", closure_type_id: "", lat: "", lng: "", coor_type: 1 }, isNew: true, attach_to: "", attach_id: "", splitter_type_id: "4", port_type: "1x8", parent: "olt", parent_id: "", attached_port: 0, status: "" }, lcp_attach_to_list: [{ id: "closure", name: "Closure/DP" }, { id: "Cabinet", name: "cabinet" }, { id: "node", name: "Node" }], lcp_port_type_list: [{ id: "1x4", name: "1x4" }, { id: "1x8", name: "1x8" }, { id: "1x16", name: "1x16" }], port_types: [{ name: "1x16", id: "1x16" }, { name: "1x8", id: "1x8" }, { name: "1x4", id: "1x4" }], status_list: [{ name: "Active", id: "Active" }, { name: "Not Active", id: "Not Active" }], closures: [], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); this.olt_item = this.data.olts; }, mounted: function mounted() { var _this = this; this.$root.$on("update_lcp", function (lcp) { _this.lcp = lcp; }); }, methods: { load: function load() { var _this2 = this; this.$http.get("api/ClosureType").then(function (response) { _this2.closure_types = response.body; }); this.$http.get("api/Closure").then(function (response) { _this2.closures = response.body; }); }, save_data: function save_data() { var _this3 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; this.data.lat = this.data.position.lat; this.data.lng = this.data.position.lng; this.$http.post("api/Node", this.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this3.data.save = true; _this3.$bvModal.hide("modal_node_marker_click"); console.log(response.body); _this3.$root.$emit("update_node", response.body, _this3.data.index); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, update_node: function update_node() { var _this4 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this4.data.user_id = _this4.user.id; _this4.data.user_name = _this4.user.name; _this4.data.lat = _this4.data.position.lat; _this4.data.lng = _this4.data.position.lng; _this4.$http.put("api/Node/" + _this4.data.id, _this4.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this4.$bvModal.hide("modal_node_marker_click"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, delete_node: function delete_node() { var _this5 = this; console.log(this.data); if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.$http.delete("api/Node/" + _this5.data.id).then(function (response) { _this5.$bvModal.hide("modal_node_marker_click"); _this5.$root.$emit("delete_node", _this5.data.index); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Closure Type", icon: "warning", buttons: true, dangerMode: true }); } }, insert_hardfiber: function insert_hardfiber() { this.$root.$emit("draw_line", this.data); this.$bvModal.hide("modal_closure_marker_click"); }, olt_tblRowClicked: function olt_tblRowClicked(item, index, event) { this.$bvModal.show("modalAddOLT"); this.olt = item; this.olt.isNew = false; console.log(this.olt); }, lcp_tblRowClicked: function lcp_tblRowClicked(item, index, event) { var _this6 = this; console.log(item); this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.id).then(function (response) { _this6.lcp = response.body; _this6.lcp.item = item; _this6.lcp.splitters_field = [{ key: "port_number", label: "Port#", sortable: true }, { key: "attach_to", label: "Attached To", sortable: true }, { key: "los", label: "LOS", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "port_status", label: "Port", sortable: true }, { key: "action", label: "Action", sortable: true }]; console.log(_this6.lcp); _this6.$bvModal.show("modal_splitter_port_list"); _this6.$root.$emit("pageLoaded"); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true // }); // this.$root.$emit("pageLoaded"); // }); this.$root.$emit("pageLoaded"); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.operator) { return "elClr cursorPointer"; } else return "elClr"; }, deleteOLT: function deleteOLT(row) { var _this7 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Do you really want to delete this item?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this7.$http.delete("api/olt/" + row.item.id).then(function (response) { _this7.data.olts.splice(row.index, 1); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, activate_splitter: function activate_splitter(row) { var _this8 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { row.item.status = "Active"; _this8.$http.put("api/Splitter/" + row.item.id, row.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, updateMarker_add: function updateMarker_add(txt, caller) { if (caller == "node") { if (txt == "latlng") { var temp = this.latlng.split(","); this.data.position.lat = parseFloat(temp[0]); this.data.position.lng = parseFloat(temp[1]); } if (txt == "lnglat") { var temp = this.lnglat.split(","); this.data.position.lat = parseFloat(temp[1]); this.data.position.lng = parseFloat(temp[0]); } } if (caller == "lcp") { if (txt == "latlng") { var temp = this.latlng.split(","); this.lcp.closure.lat = parseFloat(temp[0]); this.lcp.closure.lng = parseFloat(temp[1]); } if (txt == "lnglat") { var temp = this.lnglat.split(","); this.lcp.closure.lat = parseFloat(temp[1]); this.lcp.closure.lng = parseFloat(temp[0]); } } }, clearData: function clearData(txt) { if (txt == "olt") { this.olt = { isNew: true, name: "", ip: "", node_id: "" }; } if (txt == "lcp") { this.lcp = { closure: { isNew: null, name: "", closure_type_id: "", lat: "", lng: "", coor_type: 1 }, isNew: true, attach_to: "", attach_id: "", splitter_type_id: "4", port_type: "1x8", parent: "olt", parent_id: "", attached_port: 0, status: "Active" }; } }, openModal: function openModal(modal) { if (modal == "modalAddOLT") this.clearData("olt"); if (modal == "modalAddLCP") this.clearData("lcp"); this.$bvModal.show(modal); }, btnCreateOLT: function btnCreateOLT() { var _this9 = this; this.$validator.validateAll().then(function (result) { if (result) { _this9.$root.$emit("pageLoading"); _this9.olt_tblisBusy = true; _this9.olt.user_id = _this9.user.id; _this9.olt.user_name = _this9.user.name; _this9.olt.node_id = _this9.data.id; _this9.$http.post("api/olt", _this9.olt).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this9.data.olts = response.body; _this9.clearData("olt"); _this9.olt_tblisBusy = false; _this9.$root.$emit("pageLoaded"); _this9.$bvModal.hide("modalAddOLT"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this9.olt_tblisBusy = false; _this9.$root.$emit("pageLoaded"); }); } }); }, btnUpdateOLT: function btnUpdateOLT() { var _this10 = this; console.log(this.olt); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this10.olt.user_id = _this10.user.id; _this10.olt.user_name = _this10.user.name; _this10.$http.put("api/olt/" + _this10.olt.id, _this10.olt).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this10.$bvModal.hide("modalAddOLT"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnCreateLCP: function btnCreateLCP() { var _this11 = this; console.log(this.lcp); this.lcp.parent_id = this.olt.id; var insertOK = "no"; if (this.lcp.attach_to == "closure") { if (this.lcp.closure.isNew != null) { if (this.lcp.closure.isNew == 0) { if (this.lcp.closure.name != "" && this.lcp.closure.closure_type_id != "" && this.lcp.closure.lat != "" && this.lcp.closure.lng != "") insertOK = "yes";else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please fill up all the necessary fields"); } else { if (this.lcp.attach_id != "") insertOK = "yes";else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please select closure name"); } } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please select new or existing closure"); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("for now the available attach lcp is in the closure/DP."); if (insertOK == "yes") { this.$root.$emit("pageLoading"); this.lcp.user_id = this.user.id; this.lcp.user_name = this.user.name; this.$http.post("api/Splitter/modiStore", this.lcp).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this11.olt.splitter_lcp = response.body; _this11.$root.$emit("pageLoaded"); _this11.$bvModal.hide("modalAddLCP"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this11.$root.$emit("pageLoaded"); }); } }, btnUpdateLCP: function btnUpdateLCP() {}, deleteSplitter: function deleteSplitter(row) { var _this12 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Do you really want to delete this item?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this12.items = []; _this12.tblisBusy = true; _this12.$http.delete("api/Splitter/" + row.item.id).then(function (response) { _this12.data.splitter_closure.splice(row.index, 1); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } } }); /***/ }), /* 484 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data", "splitters_field"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], patch_type: [{ name: "Hard fiber core", id: "hardfiber_core" }, { name: "Drop Fiber (Client)", id: "Client" }], clients: [], clientSelected: { id: "", region_id: "", package_type: { name: "" } }, naps: {}, nap: { attach_to: "", attach_id: "", splitter_type_id: "3", port_type: "1x8", parent: "splitter", parent_id: "", status: "Active" }, nap_attach_to_list: [{ id: "closure", name: "Closure/DP" }, { id: "Cabinet", name: "cabinet" }, { id: "node", name: "Node" }], port_types: [{ name: "1x16", id: "1x16" }, { name: "1x8", id: "1x8" }, { name: "1x4", id: "1x4" }], status_list: [{ name: "Active", id: "Active" }, { name: "Not Active", id: "Not Active" }], latlng: "", lnglat: "", coor_type: 3, coor_type_list: [{ id: 1, name: "lat and lng" }, { id: 2, name: "(lat,lng):" }, { id: 3, name: "(lng,lat):" }], splitters_field_nap: [{ key: "port_number", label: "Port#", sortable: true }, { key: "going", label: "Going To", sortable: true }, { key: "name", label: "Name", sortable: true }, { key: "los", label: "LOS", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "port_status", label: "Port", sortable: true }, { key: "action", label: "Action", sortable: true }], closures: [], los: "", port_clicked: "", patch_type_selected: "", splitters_port_item: [], splitters_port_tblisBusy: false, splitters_port_nap_tblisBusy: false, closure_types: [], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); this.loadClients(); this.splitters_item = this.data.splitter_closure; }, mounted: function mounted() { var _this = this; this.$root.$on("update_naps", function (naps) { _this.naps = naps; }); }, methods: { load: function load() { var _this2 = this; this.$http.get("api/ClosureType").then(function (response) { _this2.closure_types = response.body; }); this.$http.get("api/Closure").then(function (response) { _this2.closures = response.body; }); }, loadClients: function loadClients() { this.$http.get("api/getClients/" + this.user.region_id).then(function (response) { this.clients = response.body; }); }, getClientDesc: function getClientDesc(client) { return client.name + " - " + client.region_name; }, save_data: function save_data() { var _this3 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; this.data.lat = this.data.position.lat; this.data.lng = this.data.position.lng; this.$http.post("api/Closure", this.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this3.data.save = true; _this3.$bvModal.hide("modal_closure_marker_click"); console.log(response.body); _this3.$root.$emit("update_closure", response.body, _this3.data.index); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, update_closure: function update_closure() { var _this4 = this; console.log(this.data); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this4.data.user_id = _this4.user.id; _this4.data.user_name = _this4.user.name; _this4.data.lat = _this4.data.position.lat; _this4.data.lng = _this4.data.position.lng; _this4.$http.put("api/Closure/" + _this4.data.id, _this4.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this4.$bvModal.hide("modal_closure_marker_click"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, delete_closure: function delete_closure() { var _this5 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.$http.delete("api/Closure/" + _this5.data.id).then(function (response) { _this5.$bvModal.hide("modal_closure_marker_click"); _this5.$root.$emit("delete_closure", _this5.data.index); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Closure Type", icon: "warning", buttons: true, dangerMode: true }); } }, splitters_port_tblRowClicked: function splitters_port_tblRowClicked(item, index, event) { var _this6 = this; console.log(item); if (item.name != "VACANT") { this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.going_id).then(function (response) { console.log(response.body); _this6.naps = response.body; _this6.naps.item = item; _this6.$bvModal.show("modal_splitter_port_list_nap"); _this6.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this6.$root.$emit("pageLoaded"); }); } }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.rm) { return "elClr cursorPointer"; } else return "elClr"; }, btnPatch: function btnPatch(item) { this.port_clicked = item; this.$bvModal.show("modal_attach_port"); }, btnPatch_OK: function btnPatch_OK() { var _this7 = this; var going_id = "0"; if (this.patch_type_selected == "Client") going_id = this.clientSelected.id; var val = { splitter_id: this.port_clicked.splitter_id, port_number: this.port_clicked.port_number, going: this.patch_type_selected, going_id: going_id, los: this.los }; // console.log(val); this.$http.post("api/SplitterPort", val).then(function (response) { if (response.body == "Error") { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client is patched to another port!", "Please unpatched client to it's existing port.", "warning"); _this7.$bvModal.hide("modal_attach_port"); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Patched", "", "success"); _this7.$bvModal.hide("modal_attach_port"); _this7.$bvModal.hide("modal_splitter_port_list_nap"); } }); }, unpatch: function unpatch(id) { var _this8 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this8.$http.delete("api/Splitter/" + id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this8.$bvModal.hide("modal_attach_port"); _this8.$bvModal.hide("modal_splitter_port_list_nap"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete", icon: "warning", buttons: true, dangerMode: true }); } }, unpatchClient: function unpatchClient(id) { var _this9 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this9.$http.delete("api/SplitterPort/" + id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this9.$bvModal.hide("modal_attach_port"); _this9.$bvModal.hide("modal_splitter_port_list_nap"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete", icon: "warning", buttons: true, dangerMode: true }); } }, change_port_status: function change_port_status(row, stat) { var _this10 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { row.item.port_status = stat; _this10.$http.put("api/SplitterPort/" + row.item.id, row.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnInsertNap: function btnInsertNap(item) { this.port_clicked = item; this.nap = { closure: { isNew: null, name: "", closure_type_id: "", lat: "", lng: "", coor_type: 1 }, splitter_port: { splitter_id: "", port_number: 0, going: "splitter", going_id: 0, los: 0 }, attach_to: "", attach_id: "", splitter_type_id: "3", port_type: "1x8", parent: "splitter", parent_id: "", status: "Active" }; this.$bvModal.show("modal_attach_nap"); }, btnCreateNap: function btnCreateNap() { var _this11 = this; this.nap.parent_id = this.data.item.id; this.nap.attached_port = this.port_clicked.port_number; this.nap.splitter_port.splitter_id = this.data.item.id; this.nap.splitter_port.port_number = this.port_clicked.port_number; this.nap.splitter_port.going_id = 0; //get after insert splitter this.nap.splitter_port.los = this.los; var insertOK = "no"; if (this.nap.attach_to == "closure") { if (this.nap.closure.isNew != null) { if (this.nap.closure.isNew == 0) { if (this.nap.closure.name != "" && this.nap.closure.closure_type_id != "" && this.nap.closure.lat != "" && this.nap.closure.lng != "") insertOK = "yes";else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please fill up all the necessary fields"); } else { if (this.nap.attach_id != "") insertOK = "yes";else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please select closure name"); } } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please select new or existing closure"); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("for now the available attach nap is in the closure/DP."); if (insertOK == "yes") { this.$root.$emit("pageLoading"); this.nap.user_id = this.user.id; this.nap.user_name = this.user.name; this.$http.post("api/Splitter/modiStore", this.nap).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this11.$bvModal.hide("modal_splitter_port_list"); _this11.$bvModal.hide("modal_attach_nap"); _this11.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this11.$root.$emit("pageLoaded"); }); } } } }); /***/ }), /* 485 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuex__ = __webpack_require__(122); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "belongs_to_node.name", label: "Node", sortable: true }, { key: "name", sortable: true }, { key: "ip", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], ponFields: [{ key: "pon", sortable: true }, { key: "area", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }, { key: "actions" }], items: [], ponItems: [], tblFilter: null, totalRows: 1, ponTotalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], olt: { node_id: 0, name: "", ip: "" }, OLTSelected: {}, PONEdit: { pon: "", area: "" }, user: [], roles: [], create_PON: { olt_id: "", pon: "", area: "" }, node: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, computed: _extends({}, Object(__WEBPACK_IMPORTED_MODULE_2_vuex__["c" /* mapGetters */])({ olt_list: "olts/getOlts", node_list: "nodes/getNodes" })), created: function created() { this.roles = this.$global.getRoles(); // this.items = this.$global.getOLT(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarCalendar").style.backgroundColor = ""; document.getElementById("navbarTicket").style.backgroundColor = ""; document.getElementById("navbarInstallation").style.backgroundColor = ""; document.getElementById("navbarMap").style.backgroundColor = ""; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; document.getElementById("navbarAccounts").style.backgroundColor = ""; }, 100); }); //this.$http.get("api/Node").then(response => { this.node = this.node_list; //}); //this.$http.get("api/olt").then(response => { // console.log(response.body); this.items = this.olt_list; this.totalRows = this.items.length; this.tblisBusy = false; //}); }, tblRowClassPON: function tblRowClassPON(item, type) { if (!item) return;else return "elClr"; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_olt) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { console.log(item); if (this.roles.update_olt) { this.$bvModal.show("modalEdit"); this.olt = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, openModalViewPONS: function openModalViewPONS(items) { this.ponTotalRows = 0; this.tblisBusy = true; this.OLTSelected = items; this.$bvModal.show("modalPON"); this.loadPONS(); }, OpenModalEditPON: function OpenModalEditPON(item, index, button) { this.PONEdit = item; this.$bvModal.show("editPONMODAL"); }, btnUpdatePON: function btnUpdatePON() { var _this = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this.PONEdit.user_id = _this.user.id; _this.PONEdit.user_name = _this.user.name; _this.$http.put("api/pon/" + _this.PONEdit.id, _this.PONEdit).then(function (response) { _this.ponItems = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this.$bvModal.hide("editPONMODAL"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, deletePON: function deletePON(item, index, button) { var _this2 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this2.tblisBusy = true; _this2.$http.get("api/pon/" + item.id + "/" + item.olt_id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this2.ponItems = response.body; _this2.ponTotalRows = response.body.length; _this2.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this2.tblisBusy = false; } }); }); } }); }, loadPONS: function loadPONS() { var _this3 = this; this.$http.get("api/pon/" + this.OLTSelected.id).then(function (response) { _this3.ponItems = response.body; _this3.ponTotalRows = response.body.length; _this3.tblisBusy = false; }); }, btnCreate: function btnCreate() { var _this4 = this; this.$validator.validateAll().then(function (result) { if (result) { _this4.tblisBusy = true; _this4.olt.user_id = _this4.user.id; _this4.olt.user_name = _this4.user.name; _this4.$http.post("api/olt", _this4.olt).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; _this4.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this4.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this5 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.olt.user_id = _this5.user.id; _this5.olt.user_name = _this5.user.name; _this5.$http.put("api/olt/" + _this5.olt.id, _this5.olt).then(function (response) { _this5.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this5.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this6 = this; if (this.roles.delete_olt) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this6.items = []; _this6.tblisBusy = true; _this6.$http.delete("api/olt/" + _this6.olt.id).then(function (response) { _this6.$bvModal.hide("modalEdit"); _this6.$global.setRegion(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this6.items = response.body; _this6.totalRows = _this6.items.length; _this6.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete an OLT", icon: "warning", buttons: true, dangerMode: true }); } }, btnAddPON: function btnAddPON() { var _this7 = this; this.$validator.validateAll().then(function (result) { if (result) { _this7.tblisBusy = true; _this7.create_PON.olt_id = _this7.OLTSelected.id; _this7.create_PON.user_id = _this7.user.id; _this7.create_PON.user_name = _this7.user.name; _this7.$http.post("api/pon", _this7.create_PON).then(function (response) { _this7.ponItems = response.body; _this7.ponTotalRows = response.body.length; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("PON", "Added successfully", "success"); _this7.create_PON = { olt_id: "", pon: "", area: "" }; _this7.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this7.$refs.name.focus(); } }); }); } }); }, reset: function reset() { this.olt = { node_id: 0, name: "", ip: "" }; } } }); /***/ }), /* 486 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue2_google_maps__ = __webpack_require__(198); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue2_google_maps___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue2_google_maps__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sweetalert2__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__ = __webpack_require__(102); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_print_or_vue__ = __webpack_require__(1115); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__modal_vue_client_modals_vue__ = __webpack_require__(101); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__modal_vue_modal_client_filter_vue__ = __webpack_require__(202); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__modal_vue_modal_fsr_vue__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__accounting_soa_vue__ = __webpack_require__(498); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__modal_vue_modal_encode_modem_vue__ = __webpack_require__(469); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { multiselect: __WEBPACK_IMPORTED_MODULE_6_vue_multiselect___default.a, "date-picker": __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_1_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_5_pretty_checkbox_vue_radio___default.a, "rangedate-picker": __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker___default.a, modal_print_or: __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_print_or_vue__["a" /* default */], modal_client_filter: __WEBPACK_IMPORTED_MODULE_12__modal_vue_modal_client_filter_vue__["a" /* default */], client_modals: __WEBPACK_IMPORTED_MODULE_11__modal_vue_client_modals_vue__["a" /* default */], modal_fsr: __WEBPACK_IMPORTED_MODULE_13__modal_vue_modal_fsr_vue__["a" /* default */], modal_encode_modem: __WEBPACK_IMPORTED_MODULE_15__modal_vue_modal_encode_modem_vue__["a" /* default */], soa: __WEBPACK_IMPORTED_MODULE_14__accounting_soa_vue__["a" /* default */] }, data: function data() { var _editClient; return { jsfile: null, cModalData: { field: 0, items: [] }, oltSelected: {}, modemSelected: {}, editBranchSelected: {}, branchSelected: {}, areaSelected: {}, regionSelected: {}, towns: [], tblisBusy: true, fields: [], items: [], items_copy: [], tblFilter: null, tblFilter_copy: null, totalRows: "", currentPage: 1, perPage: 10, pageOptions: [5, 10, 20, 50, 100], sched_field: [{ key: "act", label: "Action", sortable: true }, { key: "id", sortable: true }, { key: "client_detail_id", sortable: true }, { key: "ticket_id", sortable: true }, { key: "team_id", sortable: true }, { key: "target_date", sortable: true }, { key: "type", sortable: true }, { key: "status", sortable: true }], sched_items: [], editSched: { id: "", client_detail_id: "", ticekt_id: "", team_id: "", target_date: "", type: "", status: "" }, colOldAccount: false, colAdd: false, colContact: false, colOLT: false, colSales: false, colSalesAgent: false, colReferral: false, colPON: false, colModem: false, colMacAdd: false, colVlan: false, colIpAssigned: false, colDateAssigned: false, colPackage: false, colProtocol: false, colRegion: false, cableCategoryOption: [{ id: "Drop Fiber", name: "Drop Fiber" }, { id: "Hard Fiber", name: "Hard Fiber" }, { id: "UTP", name: "Unshielded twisted pair (UTP)" }], otcOption: [{ id: "Paid", name: "Paid" }, { id: "", name: "Not Paid" }], editClient: (_editClient = { package: { name: "", max_speed: "", cir: "", mrr: "" }, remarks: "", attachments: [], package_type: { name: "" }, sales: { user: { name: "" } }, sales_agent: { name: "" }, engineer: { name: "" }, _area: { name: "" }, town: { name: "", branch: { name: "", area: { name: "", region: { name: "" } } } }, bucket: { IP: "" }, staggered: 0, re_email: false, id: "", account_no: "", name: "", owner_name: "", contact_person: "", email_add: "", sales_id: {}, referral: "", engineers_id: {}, location: "", contact: "", package_id: "", OTC: 0, aging: null, term: "", modem_id: "" }, _defineProperty(_editClient, "package_type", {}), _defineProperty(_editClient, "communication_protocol", ""), _defineProperty(_editClient, "olt_id", ""), _defineProperty(_editClient, "date_activated", ""), _defineProperty(_editClient, "remarks", ""), _defineProperty(_editClient, "OTCPay", 0), _defineProperty(_editClient, "amount_pay", 0), _defineProperty(_editClient, "cashBond", 0), _defineProperty(_editClient, "balance", 0), _defineProperty(_editClient, "olt", { id: 0, node_id: "", name: "", ip: "" }), _editClient), client: { isNew: "0", isNewOwner: "val", re_email: false, account_no: "", name: "", owner_name: "", contact_person: "", business_type: "", email_add: "", OTC: 0, foc_length: 0, sales_agent_id: 0, referral: "", aging: null, term: "", sales_id: "", engineers_id: "", bucket_id: null, subscription_name: null, status: null, date_activated: null, location: "", contact: "", package_id: null, communication_protocol: "Internet", package_type: {}, wfc: false, email_note: "", branch: {}, town: {}, olt: {} }, engineer: { id: "", name: "", position: "" }, salesInCharge: { id: "", name: "", email: "" }, packAdd: { package_id: "", max_speed: "", cir: "", mrr: 0 }, packEdit: { name: "", package_id: "", max_speed: "", cir: "" }, updateClientList: { re_email: false, acc_no: false, name: false, owner_name: false, contact_person: false, contact: false, email_add: false, location: false, package: false, OTC: false, term: false, sales: false, engineers: false, modem: false, modem_mac_address: false, branch: false, ip: false, date_assign: false, status: false, wfc: false, owner_contact_number: false, owner_email_add: false, owner_address: false, owner_birth_date: false, owner_gender: false, owner_work: false, town: false, olt: false }, protocolOption: [{ id: "Internet", name: "Internet" }, { id: "Intranet", name: "Intranet" }], statusOption: [{ name: "Active" }, { name: "New" }, { name: "Disconnected" }, { name: "On Hold" }, { name: "Temp Discon" }, { name: "Cancelled" }], sales_agent: [], packages: [], packageTypes: [], sales: [], techsales: [], modems: [], business_types: [], user: [], client_contacts: [], client_emailadresses: [], olts: { name: "", ip: "" }, RPDateoptions: { format: "YYYY-MM-DD", useCurrent: true, minDate: new Date(new Date().getTime() - 4 * 24 * 60 * 60 * 1000), maxDate: new Date() }, totalNearToExpire: 0, totalExpired: 0, totalWFC: 0, totalWFS: 0, totalNoContract: 0, totalNoDOP: 0, datenow: new Date(), selectedEmails: [{ email: "cnc@dctechmicro.com", name: "Credit and Collection" }, { email: "amgt@dctechmicro.com", name: "Account Management" }, { email: "r11-tech@dctechmicro.com", name: "Region 11 Technical " }], selectedEmailsCC: [{ email: "srevilla@dctechmicro.com", name: "Sandra Revilla" }], selectedEmails_DOP: [{ email: "amgt@dctechmicro.com", name: "Account Management" }], selectedEmailsCC_DOP: [{ email: "r11-cnc@dctechmicro.com", name: "R11 Credit and Collection" }], Emails: [], map: null, coordinates: { lat: 0, lng: 0 }, markers: [{ position: { lat: 0, lng: 0 } }], markers_edit: [{ position: { lat: 0, lng: 0 } }], latitude: 0, longitude: 0, latlng: "", lnglat: "", searchby_list: [{ name: "Old Account No", id: "account_no" }, { name: "New Account No", id: "acc_no" }, { name: "Account Name", id: "name" }, { name: "Owner Name", id: "owner_name" }, { name: "Address", id: "location" }, { name: "Contact", id: "contact" }, { name: "Package Type", id: "package_type_id" }, { name: "Status", id: "status" }, { name: "Date Activated", id: "date_activated" }, { name: "MAC", id: "mac" }, { name: "Serial", id: "serial" }, { name: "ID", id: "id" }], searchby: "name", isLoading: false, pay_method: [], bank_code: [], buckets: [], bank_code_selected: { id: 0, code: "", amount: 0, date: "" }, pay_method_Selected: { id: "", name: "" }, receive_pay_data: { client_id: "", payment_method_id: "", banking_payment_code_id: "", amount: 0, val: 0, date: null, or_number: "", remarks: "", isPayOnline: false }, withVat: false, rp_fields: [{ key: "selected" }, { key: "date" }, { key: "description" }, { key: "price", label: "ORIG AMT" }, { key: "balance", label: "AMT DUE." }, { key: "payment", label: "PAYMENT" }], total_to_pay: 0, amount_applied: 0, rp_items: [], rp_tblisBusy: false, billRange: "month", selectedToPay: [], print_or_data: { item: [], client_name: "", client_location: "", amountInWord: "", amount: 0, totalSales: 0, wht: 0, vatable: 0, vat: 0 }, bill_modi_fields: [{ key: "selected" }, { key: "date" }, { key: "description" }, { key: "price", label: "Amount" }, { key: "balance", label: "Balance" }, { key: "price_update", label: "Amount Update" }, { key: "balance_update", label: "Balance Update" }], bill_modi_items: [], bill_modi_tblisBusy: false, editPerRow: { //editPerRowSoruce acc_no: false, name: false, owner_name: false, contact_person: false, contact: false, email_add: false, location: false, package: false, package_type: false, OTC: false, term: false, sales: false, agent: false, referral: false, engineers: false, branch: false, bucket: false, ip: false, subscription: false, status: false, remarks: false, wfc: false, coordinates: false, owner_contact_number: false, owner_email_add: false, owner_address: false, owner_birth_date: false, owner_gender: false, owner_work: false, town: false, olt: false }, roles: [], filterIn: null, cbFilter: null, deletedAcc: false, remarksText: "", commentsText: [], billings_to_export: [], item_row_click: { user: { email: "" } }, selectedFile: null, attachData: { attachment: null, type: null, other_type: null, description: null }, AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, attachTypeList: [{ name: "Application Form" }, { name: "Contract" }, { name: "Proof of Billing" }, { name: "Valid ID" }, { name: "Others" }], client_attachments: [], replaced_attachments: {}, subscription_info: {}, owner_data: [], owner_list: [], owner: { name: "", contact_number: "", email_add: "" }, owner_contacts: [], owner_emailadresses: [], genders: [{ name: "Male" }, { name: "Female" }], isLoadingOwner: false, editOwner: false, clientOptions: [], doSearch: false, search_loading: false, currentItem: 0, stock_modems: [], olt: [], modif_type_list: [{ name: "IP Rental" }, { name: "Package Discount" }, { name: "Server" }, { name: "Switch" }, { name: "Modem" }, { name: "Router" }, { name: "Domain" }, { name: "Hosting" }, { name: "Others" }], modif_details: { client_id: null, add_on: null, operation: "Addition", type: "Number", description: "", amount: 0, span: "Permanent", date_effective: "", date_end: "", reference_type: "", reference_no: "", note: "" }, reference_type_list: [{ name: "CHD Ticket" }, { name: "RT Ticket" }, { name: "Others" }], serve_table_list: [], vlan_table_list: [], ip_table_list: [], payment_type_list: [{ id: 1, name: "Cash Bond" }, { id: 2, name: "Advance Payment" }, { id: 3, name: "OTC" }, { id: 4, name: "Line Transfer" }, { id: 5, name: "Reconnection Fee" }, { id: 6, name: "Admin Fee" }, { id: 7, name: "IP Adress" }, { id: 8, name: "MRR" }], payment_type: { id: "", name: "" }, rp_remarks_temp: "" }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { var _this = this; this.roles = this.$global.getRoles(); this.packageTypes = this.$global.getPackageTypes(); this.sales = this.$global.getSales(); this.techsales = this.$global.getEngineer(); this.user = this.$global.getUser(); if (this.roles.admin) { var temp = { key: "sched", label: "Schedule" }; this.fields.push(temp); var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } this.$getLocation({}).then(function (coordinates) { _this.coordinates = coordinates; _this.markers[0].position = coordinates; _this.client.lat = coordinates.lat; _this.client.lng = coordinates.lng; }).catch(function (error) { var coor = { lat: 7.040641, lng: 125.577053 }; _this.coordinates = coor; _this.markers[0].position = coor; _this.client.lat = _this.coordinates.lat; _this.client.lng = _this.coordinates.lng; }); }, mounted: function mounted() { var _this2 = this; this.changeColDisplay(""); this.load(); this.$root.$on("update_item_client", function (item, filt) { _this2.items = item.items; _this2.billings_to_export = item.billings; _this2.data = item.data; _this2.tblisBusy = false; _this2.totalRows = item.items.length; _this2.filterIn = "multi"; _this2.cbFilter = filt; _this2.updateCounts(item); }); }, updated: function updated() {}, computed: { OTCPay: function OTCPay() { this.editClient.OTCPay = this.editClient.amount_pay - this.editClient.cashBond; return this.editClient.OTCPay; }, balance: function balance() { if (this.OTCPay != null && this.editClient.OTC != null) { this.editClient.balance = this.editClient.OTC - this.OTCPay; return this.editClient.balance; } else return 0; }, permonth: function permonth() { if (this.editClient.staggered == "0") this.editClient.numMonths = 1; this.editClient.permonth = Math.round(this.balance / this.editClient.numMonths); return this.editClient.permonth; }, rp_remarks: { get: function get() { if (this.payment_type.name != "" && this.receive_pay_data.remarks != "") return this.payment_type.name + " - " + this.receive_pay_data.remarks;else { if (this.payment_type.name != "") return this.payment_type.name + " - ";else return this.receive_pay_data.remarks; } } } }, methods: { load: function load() { var _this3 = this; this.deletedAcc = false; this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/Client/subIndex/" + this.user.region_id).then(function (response) { _this3.items = response.body.items; _this3.billings_to_export = response.body.billings; _this3.items_copy = _this3.items; _this3.updateCounts(response.body); _this3.$root.$emit("pageLoaded"); }); this.$http.get("api/getEmails").then(function (response) { _this3.Emails = response.body; }); this.$http.get("api/BusinessType").then(function (response) { _this3.business_types = response.body; }); this.$http.get("api/Town").then(function (response) { _this3.towns = response.body; }); this.$http.get("api/Paymethod").then(function (response) { _this3.pay_method = response.body; }); this.$http.get("api/BankCode").then(function (response) { _this3.bank_code = response.body; }); this.$http.get("api/Bucket").then(function (response) { _this3.buckets = response.body; }); this.$http.get("api/showAvailable").then(function (response) { _this3.packages = response.body; }); this.updateClientList = this.user.update_client_role; this.$http.get("api/olt").then(function (response) { _this3.olt = response.body; }); }, getBankCode: function getBankCode(code) { return code.code + " - " + code.date + " - " + code.amount; }, packageText: function packageText(text) { return text.name + " SPD:" + text.bandwidth_max + " CIR:" + text.bandwidth_min + " MRR:" + text.mrr; }, onChangeBankCode: function onChangeBankCode() { this.editClient.amount_pay = this.bank_code_selected.amount; this.editClient.banking_payment_code_id = this.bank_code_selected.id; this.editClient.billing_date = this.bank_code_selected.date; this.editClient.balance = this.editClient.OTC - this.OTCPay; if (this.balance > 0) { this.editClient.permonth = Math.round(this.balance / this.editClient.numMonths); } }, onChangeBankCode_RP: function onChangeBankCode_RP() { this.receive_pay_data.date = this.bank_code_selected.date; this.receive_pay_data.amount = this.bank_code_selected.amount; this.receive_pay_data.banking_payment_code_id = this.bank_code_selected.id; this.calculateToPay(); }, rp_remarks_onchange: function rp_remarks_onchange() { if (this.receive_pay_data.remarks != "" && !this.receive_pay_data.remarks.includes(this.payment_type.name) || this.receive_pay_data.name != "" && !this.receive_pay_data.remarks.includes(this.payment_type.name)) this.receive_pay_data.remarks = this.rp_remarks; }, updateCounts: function updateCounts(data) { this.totalNearToExpire = data.countNearExpire; this.totalExpired = data.countExpire; this.totalWFC = data.countWFC; this.totalWFS = data.countWFS; this.totalNoContract = data.countNoContract; this.totalNoDOP = data.countNoDOP; this.totalRows = this.items.length; this.tblisBusy = false; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else return "elClr cursorPointer"; //if (item.status === 'awesome') return 'table-success' }, onFiltered: function onFiltered(filteredItems) { // Trigger pagination to update the number of buttons/pages due to filtering this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { console.log(item); this.client_attachments = []; this.markers_edit[0].position = this.coordinates; this.packEdit = { package_id: "", max_speed: "", cir: "" }; item.modem_id = parseInt(item.modem_id); item.package_id = parseInt(item.package_id); if (item.package != null) { this.packEdit = item.package; if (this.packEdit.max_speed == null) this.packEdit.max_speed = "(Package assigned has no max speed)"; if (this.packEdit.cir == null) this.packEdit.cir = "(Package assigned has no cir)"; } else { item.package = { name: "" }; } this.setEditClient(item); if (item.lat != null) { this.markers_edit[0].position.lat = parseFloat(item.lat); this.markers_edit[0].position.lng = parseFloat(item.lng); this.latlng = this.editClient.lat + "," + this.editClient.lng; this.lnglat = this.editClient.lng + "," + this.editClient.lat; } this.selectedEmails = []; this.selectedEmails.push({ email: "cnc@dctechmicro.com", name: "Credit and Collection" }); this.selectedEmails.push({ email: "amgt@dctechmicro.com", name: "Account Management" }); if (item.sales != null) { this.selectedEmails.push({ email: item.sales.user.email, name: item.sales.user.name }); this.sales_agent = item.sales.agent; } this.$bvModal.show("modalEdit"); }, setEditClient: function setEditClient(item) { if (item.bucket == null) item.bucket = {}; if (item.sales_agent == null) item.sales_agent = {}; this.editClient = item; this.editClient.rm_remarks = ""; if (item.sales != null) { this.editClient._sales = item.sales; } else this.editClient._sales = {}; if (item.engineer != null) this.editClient.tech = item.engineer;else this.editClient.tech = {}; if (item.area != null) this.editClient._area = item.area;else this.editClient._area = {}; if (item.region != null) this.editClient._region = item.region;else this.editClient._region = {}; if (item.client_owner_id != null) this.editClient.client_owner_id = item.client_owner_id;else this.editClient.client_owner_id = null; }, onChangeEditclient: function onChangeEditclient() { var _this4 = this; console.log(this.packEdit); this.editClient.package = this.packEdit; this.editClient.package_id = this.packEdit.id; if (this.packEdit != null) { if (this.packEdit.max_speed == null) this.packEdit.max_speed = "(The Package you select has no max speed)"; if (this.packEdit.cir == null) this.packEdit.cir = "(The Package you select has no cir)"; } this.$bvModal.show("modalUpdateBilling"); this.bill_modi_tblisBusy = true; this.$http.post("api/Billing/to_pay/" + this.editClient.id + "/wholebill").then(function (response) { var temp = response.body; temp.forEach(function (item, index) { var datenow = new Date(); var date = new Date(item.date); item.price_update = _this4.packEdit.mrr; item.balance_update = _this4.packEdit.mrr; if (date >= datenow) { item.isSelected = true; } }); _this4.bill_modi_items = temp; _this4.bill_modi_tblisBusy = false; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this4.bill_modi_tblisBusy = false; }); }, btnCreate: function btnCreate() { var _this5 = this; console.log(this.client.package_type.id); if (this.client_attachments == 0 && this.client.isNew != 1) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Warning!", "Please attach client requirements", "warning"); } else this.$validator.validateAll().then(function (result) { if (result) { if (_this5.client.package_id != null) { if (_this5.client.salesInCharge_email != null) { if (_this5.client.engineer_name != null) { if (_this5.client.package_type.id != null) { if (_this5.client.town_id != null) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure do you want to create this account?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.tblisBusy = true; _this5.$root.$emit("pageLoading"); _this5.client.user_id = _this5.user.id; _this5.client.user_name = _this5.user.name; _this5.client.user_email = _this5.user.email; _this5.client.name = _this5.client.name.toUpperCase(); _this5.client.owner_name = _this5.owner.name.toUpperCase(); _this5.client.location = _this5.client.location.toUpperCase(); _this5.client.contact_person = _this5.client.contact_person.toUpperCase(); _this5.client.referral = _this5.client.referral.toUpperCase(); _this5.client.client_attachments = _this5.client_attachments; _this5.client.packagetype = _this5.client.package_type.name; _this5.client.package_type_id = _this5.client.package_type.id; _this5.client.owner = _this5.owner; _this5.client.owner.name = _this5.owner.name.toUpperCase(); _this5.client.owner.address = _this5.owner.address.toUpperCase(); _this5.client.owner.work = _this5.owner.work.toUpperCase(); _this5.selectedEmails.push({ email: _this5.client.salesInCharge_email, name: _this5.client.salesInCharge_name }); // this.client.sendTo = this.selectedEmails; // this.client.CCTO = this.selectedEmailsCC; if (_this5.client_contacts.length > 0) { for (var x = 0; x < _this5.client_contacts.length; x++) { _this5.client.contact += ", " + _this5.client_contacts[x].contact; } } if (_this5.client_emailadresses.length > 0) { for (var _x = 0; _x < _this5.client_emailadresses.length; _x++) { _this5.client.email_add += ", " + _this5.client_emailadresses[_x].email; } } if (_this5.owner_contacts.length > 0) { for (var _x2 = 0; _x2 < _this5.owner_contacts.length; _x2++) { _this5.client.owner.contact_number += ", " + _this5.owner_contacts[_x2].contact; } } if (_this5.owner_emailadresses.length > 0) { for (var _x3 = 0; _x3 < _this5.owner_emailadresses.length; _x3++) { _this5.client.owner.email_add += ", " + _this5.owner_emailadresses[_x3].email; } } console.log(_this5.client); if (_this5.client.isNew == 1) _this5.client.contract = _this5.formatDate(new Date()); _this5.$http.post(_this5.$root2 + "api/Client", _this5.client).then(function (response) { // console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Created", "", "success"); _this5.salesInCharge = { id: "", name: "", email: "" }; _this5.engineer = { id: "", name: "", position: "" }; _this5.packAdd = { package_id: "" }; _this5.owner = { name: "", contact_number: "", email_add: "" }; _this5.reset(); _this5.items = response.body.items; console.log("eee", response); _this5.totalRows = response.body.items.length; _this5.tblisBusy = false; _this5.$root.$emit("pageLoaded"); _this5.$bvModal.hide("modalAdd"); _this5.updateCounts(response.body); }).catch(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this5.tblisBusy = false; _this5.$root.$emit("pageLoaded"); }); } }); } else __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select/reselect town"); } else __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select package type"); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select tech sales in-charge"); } } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select sales in-charge"); } } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select package"); } } }); }, updateClient: function updateClient() { var _this6 = this; console.log(this.editClient); this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this6.$root.$emit("pageLoading"); _this6.editClient.user_region_id = _this6.user.region_id; _this6.editClient.user_id = _this6.user.id; _this6.editClient.user_name = _this6.user.name; _this6.editClient.user_email = _this6.user.email; _this6.editClient.sendTo = _this6.selectedEmails; _this6.editClient.CCTO = _this6.selectedEmailsCC; _this6.editClient.salesInCharge_name = _this6.editClient.sales.user.name; _this6.editClient.packagetype = _this6.editClient.package_type.name; _this6.editClient.packCode = _this6.editClient.package.name; _this6.editClient.packSpeed = _this6.editClient.package.max_speed; _this6.editClient.packCIR = _this6.editClient.package.cir; _this6.editClient.packMRR = _this6.editClient.package.mrr; _this6.editClient.engineer_name = _this6.editClient.engineer.name; _this6.editClient.email_note = _this6.editClient.remarks; _this6.$http.put("api/Client/" + _this6.editClient.id, _this6.editClient).then(function (response) { //this.items = response.body.items; comment dyud dapat ni siya console.log(response.body); _this6.updateCounts(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this6.$bvModal.hide("modalEdit"); _this6.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this6.$root.$emit("pageLoaded"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please complete all the input requirements", "", "info"); } }); }, deleteClient: function deleteClient() { var _this7 = this; if (this.roles.delete_client) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this7.tblisBusy = true; _this7.$root.$emit("pageLoading"); var data = { user_id: _this7.user.id, user_name: _this7.user.name, id: _this7.editClient.id, region_id: _this7.user.region_id, filterIn: _this7.filterIn, cbFilter: _this7.cbFilter, searchby: _this7.searchby, tblFilter: _this7.tblFilter_copy }; _this7.$http.post("api/Client/destroy1", data).then(function (response) { console.log(response.body); _this7.$bvModal.hide("modalEdit"); _this7.data = response.body.data; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Deleted", "", "success"); _this7.items = response.body.items; _this7.totalRows = response.body.items.length; _this7.tblisBusy = false; _this7.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this7.tblisBusy = false; _this7.$root.$emit("pageLoaded"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a client", icon: "warning", buttons: true, dangerMode: true }); } }, openModalDOP: function openModalDOP(item) { var _this8 = this; console.log(item); this.selectedEmails_DOP = []; this.setEditClient(item); this.selectedEmails_DOP.push({ email: "amgt@dctechmicro.com", name: "Account Management" }); if (item.sales != null) this.selectedEmails_DOP.push({ email: item.sales.user.email + item.sales.user.subdomain, name: item.sales.user.name }); this.selectedEmails_DOP.push({ email: item.region.user.email + item.region.user.subdomain, name: item.region.user.name }); if (item.OTC == null) item.OTC = 0; if (item.package == null) item.package = {}; if (item.package.mrr == null) item.package.mrr = 0; if (item.payment_method_id == null) item.payment_method_id = ""; if (item.or_number == null) item.or_number = ""; if (item.billing_date == null) item.billing_date = ""; if (item.amount_pay == null) item.amount_pay = 0; if (this.withVat) { item.cashBond = (item.package.mrr / 1.12).toFixed(2); item.fp = parseFloat(item.OTC) + parseFloat(item.cashBond); } else { item.cashBond = item.package.mrr; item.fp = item.OTC + item.package.mrr; } this.$http.get("api/BankCode").then(function (response) { _this8.bank_code = response.body; }); this.$bvModal.show("modalDOP"); }, openModalReceivePayment: function openModalReceivePayment(item) { this.receive_pay_data.client_id = item.id; this.$bvModal.show("modalReceivePayment"); this.total_to_pay = 0; this.amount_applied = 0; this.print_or_data = { item: [], client_name: item.name, client_location: item.location, amountInWord: "", amount: 0, totalSales: 0, wht: 0, vatable: 0, vat: 0, date: null }; this.billRangeChange(); }, openModalWHT: function openModalWHT(item) { this.receive_pay_data.client_id = item.id; this.$bvModal.show("modalWHT"); this.total_to_pay = 0; this.amount_applied = 0; this.billRangeChange(); }, openModalSoa: function openModalSoa(item) { var _this9 = this; this.$root.$emit("pageLoading"); this.$bvModal.show("modalSOA"); this.editClient = item; setTimeout(function () { _this9.$refs.refsoa.soaChild(); _this9.$refs.refsoa.onChangeSelectClient(); _this9.$root.$emit("pageLoaded"); }, 200); }, openModalAddOns: function openModalAddOns(item) { var _this10 = this; this.$root.$emit("pageLoading"); this.$http.get("api/MrrAddon/" + item.id).then(function (response) { console.log(response.body); //this.bank_code = response.body; _this10.cModalData.field = 6; _this10.cModalData.items = response.body; _this10.editClient = item; _this10.$bvModal.show("modalAddOnsTable"); _this10.$root.$emit("pageLoaded"); }); }, updateDOP: function updateDOP() { var _this11 = this; console.log(this.selectedEmails_DOP); var chk = 0; if (this.editClient.staggered != 2) { if (this.editClient.payment_method_id == "" || this.editClient.payment_method_id == null) { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select/reselect payment method"); return 0; } if (this.editClient.or_number == "") { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("OR Number is Required"); return 0; } if (this.editClient.billing_date == "") { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Date of payment is Required"); return 0; } if (this.editClient.amount_pay == 0) { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Amount must be greater than zero"); return 0; } if (this.editClient.staggered == 1 && this.editClient.numMonths == null) { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Months to pay is required."); return 0; } } if (chk == 0) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this11.$root.$emit("pageLoading"); _this11.editClient.user_region_id = _this11.user.region_id; _this11.editClient.user_id = _this11.user.id; _this11.editClient.user_name = _this11.user.name; _this11.editClient.user_email = _this11.user.email; _this11.editClient.sendTo = _this11.selectedEmails_DOP; _this11.editClient.CCTO = _this11.selectedEmailsCC_DOP; _this11.$http.post("api/Client/updateDOP", _this11.editClient).then(function (response) { _this11.items = response.body.items; //comment dyud dapat ni siya _this11.totalNoDOP--; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this11.$bvModal.hide("modalDOP"); _this11.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this11.$root.$emit("pageLoaded"); }); } }); }, updateContract: function updateContract(item) { var _this12 = this; __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "Update Contract", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "do you want to send email?", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { item.sendEmail = true; } else { item.sendEmail = false; } _this12.$root.$emit("pageLoading"); item.user_region_id = _this12.user.region_id; item.user_id = _this12.user.id; item.user_name = _this12.user.name; item.user_email = _this12.user.email; item.sendTo = [{ email: "cnc@dctechmicro.com", name: "Credits and Collection" }]; item.CCTO = [{ email: _this12.user.email + _this12.user.subdomain, name: _this12.user.name }]; _this12.$http.post("api/Client/updateContract", item).then(function (response) { _this12.items = response.body.items; _this12.totalNoContract--; _this12.$bvModal.hide("modalEdit"); _this12.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); }); }); } }); }, updateSubscription: function updateSubscription(item, index) { var _this13 = this; __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "Update Subscription", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this13.$root.$emit("pageLoading"); item.user_region_id = _this13.user.region_id; item.user_id = _this13.user.id; item.user_name = _this13.user.name; _this13.$http.post("api/Client/updateSubscription", item).then(function (response) { _this13.items = response.body.items; _this13.totalWFS--; _this13.$bvModal.hide("modalEdit"); _this13.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); }); } }); }, openModalAdd: function openModalAdd() { this.$bvModal.show("modalAdd"); this.client_attachments = []; // this.$refs.gmapclient.$mapPromise.then(map => { // this.map = map; // }); }, openModalSched: function openModalSched(item) { var _this14 = this; this.sched_items = []; this.$bvModal.show("modalManageSched"); this.$http.post("api/getSched", item).then(function (response) { _this14.sched_items = response.body.installation; _this14.sched_items = _this14.sched_items.concat(response.body.ticket); }); }, openModalEditSched: function openModalEditSched(item) { this.editSched = item; this.$bvModal.show("modalEditSched"); }, openModalPrintOR: function openModalPrintOR() { var options = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; this.print_or_data.totalSales = this.amount_applied; this.print_or_data.totalSales_copy = this.amount_applied; this.print_or_data.item = this.selectedToPay; this.print_or_data.amount = this.amount_applied; this.print_or_data.amount_copy = this.amount_applied; this.print_or_data.date = this.receive_pay_data.date; var converter = __webpack_require__(496); this.print_or_data.amountInWord = converter.toWords(this.amount_applied); this.print_or_data.vatable = Math.round(this.print_or_data.amount / 1.12); this.print_or_data.vat = Number(Math.round(this.print_or_data.vatable * 0.12)).toLocaleString("en", options); this.print_or_data.vatable = Number(this.print_or_data.vatable).toLocaleString("en", options); this.print_or_data.amount = Number(this.print_or_data.amount).toLocaleString("en", options); this.print_or_data.totalSales = Number(this.print_or_data.totalSales).toLocaleString("en", options); this.$bvModal.show("modalPreviewOR"); }, deleteSched: function deleteSched(item) { var _this15 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this15.$http.delete("api/Schedule/" + item.id).then(function (response) { _this15.$bvModal.hide("modalManageSched"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Deleted", "", "success"); }); } }); }, btnUpdateSched: function btnUpdateSched() { var _this16 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this16.$http.put("api/Schedule/" + _this16.editSched.id, _this16.editSched).then(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this16.$bvModal.hide("modalManageSched"); }); } }); }, getBucketDesc: function getBucketDesc(bucket) { return bucket.name + " - " + bucket.IP; }, getOltDesc: function getOltDesc(olt) { return olt.name + " - " + olt.ip; }, onChangeAddclient: function onChangeAddclient() { this.client.package_id = this.packAdd.id; if (this.packAdd.max_speed == null) this.packAdd.max_speed = "(The Package you select has no max speed)"; if (this.packAdd.cir == null) this.packAdd.cir = "(The Package you select has no cir)"; this.client.packCode = this.packAdd.name; this.client.packMRR = this.packAdd.mrr; this.client.total_mrr = this.packAdd.mrr; this.client.packSpeed = this.packAdd.max_speed; this.client.packCIR = this.packAdd.cir; this.client.package_type = this.packAdd.package_type; }, onChangeAddEngineer: function onChangeAddEngineer() { this.client.engineers_id = this.engineer.id; this.client.engineer_name = this.engineer.name; }, onChangeSalesInCharge: function onChangeSalesInCharge() { this.client.sales_agent_id = null; this.sales_agent = this.salesInCharge.agent; this.client.sales_id = this.salesInCharge.id; this.client.salesInCharge_name = this.salesInCharge.name; this.client.salesInCharge_email = this.salesInCharge.email; }, changeColDisplay: function changeColDisplay(check) { if (check == "export") { this.fields = [{ key: "account_no" }, { key: "acc_no", label: "New Account No." }, { key: "name", label: "Account Name" }, { key: "region.name", label: "Region" }, { key: "branch.name", label: "Branch" }, { key: "location", label: "Address" }, { key: "contact" }, { key: "email_add", label: "Email" }, { key: "package.name", label: "Package" }, { key: "package_type.name", label: "Type" }, { key: "package.mrr", label: "MRR" }, { key: "total_mrr", label: "Total MRR" }, { key: "OTC", label: "OTC" }, { key: "sales.user.name", label: "Sales" }, { key: "sales_agent.name", label: "Sales Agent" }, { key: "referral" }, { key: "bucket.IP" }, { key: "subscription_name" }, { key: "status" }, { key: "date_activate" }, { key: "termExpire" }, { key: "termStatus" }, { key: "created_at" }]; } else { this.fields = [ // { key: "account_no", sortable: true }, { key: "action", label: "Action", sortable: true }, // { key: "acc_no", label: "New Account No.", sortable: true }, { key: "account_details", label: "Account Details" }, { key: "bucket_details", label: "Bucket Details" }, // { key: "name", label: "Account Name", sortable: true }, { key: "branch.name", label: "Branch", sortable: true }, // { // key: "location", // label: "Address", // formatter: (value) => { // if (value.length > 40) return value.slice(0, 40) + "..."; // else return value; // }, // sortable: true, // }, // { key: "contact", sortable: true }, // { key: "email_add", label: "Email", sortable: true }, { key: "package_type.name", label: "Type", sortable: true }, { key: "total_mrr", label: "MRR", sortable: true }, { key: "OTC", label: "OTC", sortable: true }]; if ("colOldAccount" == check) { this.colOldAccount = !this.colOldAccount; } if (this.colOldAccount) { var temp = { key: "account_no", label: "Old Account No.", sortable: true }; this.fields.unshift(temp); } if ("colSales" == check) { this.colSales = !this.colSales; } if (this.colSales) { var temp = { key: "sales.user.name", label: "Sales", sortable: true }; this.fields.push(temp); } if ("colSalesAgent" == check) { this.colSalesAgent = !this.colSalesAgent; } if (this.colSalesAgent) { var temp = { key: "sales_agent.name", label: "Sales Agent", sortable: true }; this.fields.push(temp); } if ("colReferral" == check) { this.colReferral = !this.colReferral; } if (this.colReferral) { var temp = { key: "referral", label: "Referral", sortable: true }; this.fields.push(temp); } if ("colModem" == check) { this.colModem = !this.colModem; } if (this.colModem) { var temp = { key: "modem.name", label: "Modem", sortable: true }; this.fields.push(temp); } if ("colMacAdd" == check) { this.colMacAdd = !this.colMacAdd; } if (this.colMacAdd) { var temp = { key: "modem_mac_address", label: "Mac Add.", sortable: true }; this.fields.push(temp); } if ("colIpAssigned" == check) { this.colIpAssigned = !this.colIpAssigned; } if (this.colIpAssigned) { var temp = { key: "ip_assigned", sortable: true }; this.fields.push(temp); } if ("colDateAssigned" == check) { this.colDateAssigned = !this.colDateAssigned; } if (this.colDateAssigned) { var temp = { key: "date_assigned", sortable: true }; this.fields.push(temp); } if ("colPackage" == check) { this.colPackage = !this.colPackage; } if (this.colPackage) { var temp = { key: "package.name", label: "Package", sortable: true }; this.fields.push(temp); } if ("colProtocol" == check) { this.colProtocol = !this.colProtocol; } if (this.colProtocol) { var temp = { key: "communication_protocol", label: "Protocol", sortable: true }; this.fields.push(temp); } if ("colRegion" == check) { this.colRegion = !this.colRegion; } if (this.colRegion) { var temp = { key: "region.name", label: "Region", sortable: true }; this.fields.push(temp); } var extra = { key: "status", label: "Status", sortable: true }; this.fields.push(extra); var extra = { key: "date_activate", sortable: true }; this.fields.push(extra); var extra = { key: "termExpire", label: "Term Expire", sortable: true }; this.fields.push(extra); var extra = { key: "termStatus", label: "Term Status", sortable: true }; this.fields.push(extra); var temp = { key: "created_at", label: "Created At", sortable: true }; this.fields.push(temp); if (this.user.id == 1) { var temp = { key: "sched", label: "Schedule" }; this.fields.push(temp); var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } } }, fnExcelReport: function fnExcelReport(tbl) { this.changeColDisplay("export"); this.currentPage = 1; this.perPage = this.totalRows; this.$global.excelReportCSV(tbl, "Ticket Table", this); this.$nextTick(function () { setTimeout(function () { this.changeColDisplay(""); this.perPage = 10; }.bind(this), 2000); }); /* this.$nextTick(function () { setTimeout( function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; //tab_text=tab_text+""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand( "SaveAs", true, "Say Thanks" ); } //other browser not tested on IE 11 // var sa = window.open( // "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet," + // encodeURIComponent(tab_text) // ); else var sa = window.open( "data:application/vnd.ms-excel," + encodeURIComponent(tab_text) ); this.perPage = 10; this.changeColDisplay(""); return sa; }.bind(this), 1000 ); }); */ }, filterClick: function filterClick(txt) { this.tblisBusy = true; if (txt == "dop") { this.$http.get("api/Client/filterNoDOP/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } else if (txt == "wfc") { this.$http.get("api/Client/filterWFC/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } else if (txt == "wfs") { this.$http.get("api/Client/filterWFS/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } else if (txt == "contract") { this.$http.get("api/Client/filterNoContract/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } else if (txt == "expired") { this.$http.get("api/Client/filterExpired/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } else if (txt == "cease") { this.$http.get("api/Client/filterCease/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.billings_to_export = response.body.billings; this.totalRows = this.items.length; this.tblisBusy = false; }); } }, clearFilter: function clearFilter() { this.tblFilter = ""; this.tblFilter_copy = ""; this.items = this.items_copy; this.totalRows = this.items.length; }, mousemove: function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } }, inputDatePrevOnly: function inputDatePrevOnly(date) { var datenow = new Date(); var date = new Date(date); if (date > datenow) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Ops.", "Please select present or previous dates only", "warning"); this.editClient.aging = null; this.editClient.billing_date = null; this.client.aging = null; } }, formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, updateActivatedDateClicked: function updateActivatedDateClicked(bvModalEvt) { var _this17 = this; bvModalEvt.preventDefault(); if (this.editClient.rm_remarks != "") { this.editClient.user_region_id = this.user.region_id; this.editClient.user_id = this.user.id; this.editClient.user_name = this.user.name; this.$http.post("api/updateDateActivated", this.editClient).then(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this17.$bvModal.hide("modalChangeDateActivated"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); }); } else __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Remarks is required", "", "warning"); }, calculateOTC: function calculateOTC() { console.log(this.client.cable_category); if (this.client.foc_length > 0 && this.client.cable_category != "") { var cableadd = 0; var addpermeter = 35; var addbycat = 3360; var minLength = 150; if (this.client.cable_category == "Drop Fiber") { addpermeter = 35; addbycat = 3360; minLength = 150; } if (this.client.cable_category == "Hard Fiber") { addpermeter = 120; addbycat = 33600; minLength = 250; } if (this.client.foc_length > minLength) cableadd = (this.client.foc_length - minLength) * addpermeter; var otc = cableadd + addbycat; this.client.OTC = otc; } }, addContactField: function addContactField(contact) { if (contact == "owner") { if (this.owner_contacts.length > 1) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Maximum contact number reached");else this.owner_contacts.push({ contact: null }); } else { if (this.client_contacts.length > 1) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Maximum contact number reached");else this.client_contacts.push({ contact: null }); } }, removeContactField: function removeContactField(contact, index) { if (contact == "owner") this.owner_contacts.splice(index, 1);else this.client_contacts.splice(index, 1); }, addEmailField: function addEmailField(email) { if (email == "owner") { if (this.owner_emailadresses.length > 1) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Maximum Email Address reached");else this.owner_emailadresses.push({ contact: null }); } else { if (this.client_emailadresses.length > 1) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Maximum Email Address reached");else this.client_emailadresses.push({ contact: null }); } }, removeEmailField: function removeEmailField(email, index) { if (email == "owner") this.owner_emailadresses.splice(index, 1);else this.client_emailadresses.splice(index, 1); }, search_data: function search_data() { var _this18 = this; if (this.searchby == "account_no") { var temp = { key: "account_no", label: "Old Account No.", sortable: true }; this.fields.unshift(temp); } if (this.tblFilter_copy != "") { this.$root.$emit("pageLoading"); var escape_string = this.tblFilter_copy.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.$http.get("api/Client/search_data/" + this.searchby + "/" + escape_string + "/" + this.deletedAcc).then(function (response) { _this18.items = response.body.items; _this18.billings_to_export = response.body.billings; _this18.filterIn = "search"; _this18.totalRows = _this18.items.length; _this18.doSearch = false; _this18.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this18.$root.$emit("pageLoaded"); console.log(response); }); } }, onChangeSelectPayMethod: function onChangeSelectPayMethod() { this.editClient.payment_method_id = this.pay_method_Selected.id; this.receive_pay_data.payment_method_id = this.pay_method_Selected.id; this.receive_pay_data.amount = 0; this.bank_code_selected = {}; this.amount_applied = 0; if (this.pay_method_Selected.id == 30 || this.pay_method_Selected.id == 31 || this.pay_method_Selected.id == 32 || this.pay_method_Selected.id == 34 || this.pay_method_Selected.id == 39 || this.pay_method_Selected.id == 40 || this.pay_method_Selected.id == 41 || this.pay_method_Selected.id == 48) { this.editClient.isPayOnline = true; this.receive_pay_data.isPayOnline = true; } else { this.editClient.isPayOnline = false; this.receive_pay_data.isPayOnline = false; } }, onChangeWithVat: function onChangeWithVat() { if (this.withVat) { this.editClient.cashBond = (this.editClient.package.mrr / 1.12).toFixed(2); this.editClient.fp = parseFloat(this.editClient.OTC) + parseFloat(this.editClient.cashBond); } else { this.editClient.cashBond = this.editClient.package.mrr; this.editClient.fp = this.editClient.OTC + this.editClient.package.mrr; } }, receivePayment_OK: function receivePayment_OK() { var _this19 = this; console.log(this.receive_pay_data); var chk = 0; // if (this.payment_type.name == "") { // chk++; // swal("Please add payment type."); // return 0; // } if (this.receive_pay_data.payment_method_id == "") { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please select/reselect payment method"); return 0; } // if (this.receive_pay_data.remarks == "") { // chk++; // swal("Please add remarks first."); // return 0; // } if (this.receive_pay_data.or_number == "") { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("OR Number is Required"); return 0; } if (this.receive_pay_data.date == null) { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Date is Required"); return 0; } if (this.receive_pay_data.amount == 0) { chk++; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Amount must be greater than zero"); return 0; } // if (this.amount_applied != this.receive_pay_data.amount) { // chk++; // swal("Amount applied must be equals to amount pay"); // return 0; // } //without select if (chk == 0) __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", focusConfirm: true, text: "", icon: "warning", buttons: ["No", "Yes"] }).then(function (update) { if (update) { _this19.$root.$emit("pageLoading"); _this19.receive_pay_data.user_id = _this19.user.id; _this19.receive_pay_data.user_name = _this19.user.name; _this19.receive_pay_data.selectedToPay = _this19.selectedToPay; _this19.$http.post("api/storePaymentWithoutSelectPayment", _this19.receive_pay_data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Saved", "", "success"); _this19.$bvModal.hide("modalReceivePayment"); _this19.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this19.$root.$emit("pageLoaded"); }); } }); // if (chk == 0) // swal({ // title: "Are you sure?", // focusConfirm: true, // text: "", // icon: "warning", // buttons: ["No", "Yes"], // }).then((update) => { // if (update) { // this.$root.$emit("pageLoading"); // this.receive_pay_data.user_id = this.user.id; // this.receive_pay_data.user_name = this.user.name; // this.receive_pay_data.selectedToPay = this.selectedToPay; // this.$http // .post("api/CustomerPayment", this.receive_pay_data) // .then((response) => { // console.log(response.body); // swal("Saved", "", "success"); // this.$bvModal.hide("modalReceivePayment"); // this.$root.$emit("pageLoaded"); // }) // .catch((response) => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true, // }); // this.$root.$emit("pageLoaded"); // }); // } // }); }, wht_OK: function wht_OK() { var _this20 = this; console.log(this.receive_pay_data); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", focusConfirm: true, text: "", icon: "warning", buttons: ["No", "Yes"] }).then(function (update) { if (update) { _this20.$root.$emit("pageLoading"); _this20.receive_pay_data.description = "WHT - " + _this20.receive_pay_data.description; _this20.receive_pay_data.user_id = _this20.user.id; _this20.receive_pay_data.user_name = _this20.user.name; _this20.receive_pay_data.selectedToPay = _this20.selectedToPay; _this20.$http.post("api/WHT", _this20.receive_pay_data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Saved", "", "success"); _this20.$bvModal.hide("modalWHT"); _this20.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this20.$root.$emit("pageLoaded"); }); } }); }, billRangeChange: function billRangeChange() { var _this21 = this; //this.receive_pay_data.amount = 0; this.rp_tblisBusy = true; this.amount_applied = 0; this.$http.post("api/Billing/to_pay/" + this.receive_pay_data.client_id + "/" + this.billRange).then(function (response) { console.log(response.body); _this21.rp_items = response.body; _this21.rp_tblisBusy = false; _this21.calculateToPay(); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this21.rp_tblisBusy = false; }); }, onRowSelectedToPay: function onRowSelectedToPay(items) { this.selectedToPay = items; console.log(this.selectedToPay); this.calculateToPay(); }, tblToPayRowClicked: function tblToPayRowClicked(item, index, event) { if (item.isSelected == true) this.$nextTick(function () { setTimeout(item.isSelected = false, 400); setTimeout(item.payment = 0, 400); }); console.log(item); }, calculateToPay: function calculateToPay() { var _this22 = this; this.total_to_pay = 0; this.amount_applied = 0; var amount = parseFloat(this.receive_pay_data.amount); this.rp_items.forEach(function (element) { _this22.total_to_pay += element.balance; if (amount >= element.balance) { _this22.amount_applied = _this22.amount_applied + element.balance; amount = amount - element.balance; element.payment = 0; } else { element.payment = element.balance - amount; _this22.amount_applied = _this22.amount_applied + amount; amount = 0; } }); // this.selectedToPay.forEach(item => { // this.total_to_pay += item.balance; // item.isSelected = true; // if (amount >= item.balance) { // this.amount_applied = this.amount_applied + item.balance; // amount = amount - item.balance; // item.payment = 0; // } else { // item.payment = item.balance - amount; // this.amount_applied = this.amount_applied + amount; // amount = 0; // } // }); }, onRowSelectedToPayTax: function onRowSelectedToPayTax(items) { this.selectedToPay = items; this.calculateToPayTax(); }, calculateToPayTax: function calculateToPayTax() { var _this23 = this; this.total_to_pay = 0; var amount = parseFloat(this.receive_pay_data.val); this.selectedToPay.forEach(function (item) { item.isSelected = true; if (amount >= item.balance) { _this23.total_to_pay = _this23.total_to_pay + item.balance; item.payment = item.balance; } else { item.payment = amount; _this23.total_to_pay = _this23.total_to_pay + amount; } }); this.receive_pay_data.amount = this.total_to_pay; }, updateClientPerRow: function updateClientPerRow(row, value) { var _this24 = this; console.log(value); this.$root.$emit("pageLoading"); var data = value; if (row == "name") { data = value.toUpperCase(); this.editClient.name = data; } if (row == "owner_name") { data = value.toUpperCase(); this.editClient.owner_name = data; } if (row == "location") { data = value.toUpperCase(); this.editClient.location = data; } if (row == "contact_person") { data = value.toUpperCase(); this.editClient.contact_person = data; } if (row == "referral") { data = value.toUpperCase(); this.editClient.referral = data; } if (row == "sales_id") { this.editClient.sales = value; data = value.id; this.sales_agent = value.agent; } if (row == "engineers_id") { this.editClient.engineer.name = value.name; data = value.id; } if (row == "sales_agent_id") { this.editClient.sales_agent.name = value.name; data = value.id; } if (row == "package_type_id") { this.editClient.package_type.name = value.name; data = value.id; } if (row == "branch") { //editBranchSelected this.editClient.branch = value; data = { branch_id: value.id, area_id: value.area.id, region_id: value.area.region.id }; } if (row == "town") { //editBranchSelected this.editClient.town = value; data = { town_id: value.id, branch_id: value.branch.id, area_id: value.branch.area.id, region_id: value.branch.area.region.id }; } if (row == "package_code") { data = { package_id: this.packEdit.id, mrr: this.packEdit.mrr, soa_items: this.bill_modi_items }; } if (row == "coordinates") { var temp = this.latlng.split(","); this.editClient.lat = temp[0]; this.editClient.lng = temp[1]; this.latlng = this.editClient.lat + "," + this.editClient.lng; this.markers_edit[0].position.lat = parseFloat(this.editClient.lat); this.markers_edit[0].position.lng = parseFloat(this.editClient.lng); data = { lat: parseFloat(this.editClient.lat), lng: parseFloat(this.editClient.lng) }; } if (row == "owner") { data = { id: this.editClient.owner.id, name: this.editClient.owner.name.toUpperCase(), contact_number: this.editClient.owner.contact_number, email_add: this.editClient.owner.email_add, address: this.editClient.owner.address.toUpperCase(), birth_date: this.editClient.owner.birth_date, gender: this.editClient.owner.gender, work: this.editClient.owner.work.toUpperCase(), edit_owner_name: this.editPerRow.owner_name }; console.log(data); } if (row == "olt_id") { this.editClient.olt = value; data = { olt_id: value.id }; console.log(data); } var dataa = { id: this.editClient.id, row: row, data: data, user_id: this.user.id, user_name: this.user.name, user_region_id: this.user.region_id }; console.log(dataa); this.$http.post("api/Client/update_per_row", dataa).then(function (response) { console.log(response.body); _this24.editClient = response.body[0][0]; _this24.items = response.body[1].original.items; _this24.billings_to_export = response.body[1].original.billings; _this24.items_copy = _this24.items; _this24.updateCounts(response.body[1]); _this24.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this24.$bvModal.hide("modalUpdateBilling"); _this24.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this24.tblisBusy = false; _this24.$root.$emit("pageLoaded"); }); }, updateClientDetailsPerRow: function updateClientDetailsPerRow(row, value) { var _this25 = this; console.log(value); var data = value; var id = value; if (row == "wfc") { data = value; id = this.editClient.client_detail.id; } var data = { id: id, row: row, data: data, user_id: this.user.id, user_name: this.user.name }; this.$root.$emit("pageLoading"); this.$http.post("api/clientDetail/update_per_row", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this25.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this25.tblisBusy = false; _this25.$root.$emit("pageLoaded"); }); }, cancelClient: function cancelClient() { var _this26 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this26.editClient.user_id = _this26.user.id; _this26.editClient.user_name = _this26.user.name; _this26.$root.$emit("pageLoading"); _this26.$http.post("api/Client/cancelClient", _this26.editClient).then(function (response) { _this26.$root.$emit("pageLoaded"); _this26.items = response.body.items; _this26.totalRows = _this26.items.length; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this26.$bvModal.hide("modalEdit"); console.log(response.body); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this26.tblisBusy = false; _this26.$root.$emit("pageLoaded"); }); } }); }, openColumnSettings: function openColumnSettings() { this.$bvModal.show("modalColumnSettings"); }, showDeleted: function showDeleted() { this.deletedAcc = true; this.clientOptions = []; this.tblFilter_copy = ""; this.$root.$emit("pageLoading"); if (this.deletedAcc == true) { this.$http.get("api/Client/cancelled/" + this.user.region_id).then(function (response) { console.log(response.body); this.items = response.body.items; this.items_copy = this.items; this.totalRows = this.items.length; this.$root.$emit("pageLoaded"); }); } }, reload_data: function reload_data() { this.deletedAcc = false; this.$root.$emit("pageLoading"); this.load(); }, retrieveClient: function retrieveClient() { var _this27 = this; console.log("retrieving. . ."); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this27.$http.post("api/Client/retrieveClient", _this27.editClient).then(function (response) { _this27.items = response.body.items; _this27.totalRows = _this27.items.length; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this27.$bvModal.hide("modalEdit"); // console.log(response.body); }).catch(function (response) { console.log(response); }); } }); }, addClientChangeBranch: function addClientChangeBranch() { console.log(this.client.town); this.client.town_id = this.client.town.id; this.client.branch_id = this.client.town.branch.id; this.client.area_id = this.client.town.branch.area.id; this.client.region_id = this.client.town.branch.area.region.id; this.client.bucket_id = this.client.town.bucket_id; this.branchSelected = this.client.town.branch; this.areaSelected = this.client.town.branch.area; this.regionSelected = this.client.town.branch.area.region; console.log(this.regionSelected); }, addRemarks_clicked: function addRemarks_clicked() { var _this28 = this; if (this.remarksText != "") { var data = { ticket_id: this.editClient.id, user_id: this.user.id, user_name: this.user.name, remarks: this.remarksText, form_type: "client", ticketType: "2" }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this28.remarksText = ""; _this28.editClient.remarks_log = response.body; console.log(response.body); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please add some text in the remarks text area"); } }, addComments_clicked: function addComments_clicked(id, i, stor) { var _this29 = this; // console.log(id); if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.editClient.id, ticketType: "2" }; // stor.push(data); // console.log(data); this.$http.post("api/TicketCommentsLog", data).then(function (response) { // this.commentsText[i] = ""; // console.log(response.body); _this29.commentsText[i] = ""; _this29.editClient.remarks_log = response.body; _this29.$global.scrollComment(i, 2); }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Please add some text in the comments text area"); } }, RequestActivity: function RequestActivity(item, type) { var _this30 = this; console.log(item); var msg = ""; var type_id = ""; if (type == "Change Package") { this.setEditClient(item); this.$bvModal.show("modalChangePackage"); } else { if (type == "Temp Discon") { msg = "Temporary Disconnection for this client?"; type_id = 1; } if (type == "On Hold") { msg = "On Hold for this client?"; type_id = 9; } if (type == "Activate") { msg = "Activation for this client?"; type_id = 3; } if (type == "Discon") { msg = "Permanent Disconnection for this client? (this will delete the client's provision)"; type_id = 2; } if (type_id == 3) { this.openModalReactivate(item); } else if (type_id == 1) { this.openModalTempDiscon(item); } else { if (type_id != 9) var data = { ticket_type_id: type_id, client_id: item.id, user_id: this.user.id, created_by: this.user.id, status: "Check Balance", state: "accounting" };else var data = { ticket_type_id: type_id, client_id: item.id, user_id: this.user.id, created_by: this.user.id, status: "Pending", state: "helpdesk" }; __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "Request for " + msg + "", type: "warning", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this30.$root.$emit("pageLoading"); _this30.$http.post("api/ActivityTicket", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Requested!", "", "success"); _this30.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); _this30.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } } }, autoBill: function autoBill(item) { var _this31 = this; if (item.email_add == null) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Warning!", "This client has no email!", "warning"); } else { __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "Auto-generate billing for this client?", type: "info", html: "IMPORTANT REMINDER ! " + "
" + "

The system depends on the encoded information.
Before you proceed, please make sure the client:

" + "

- is activated

" + "

- email address is accurate

" + "

- has existing and accurate Ledger

", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this31.tblisBusy = true; _this31.$root.$emit("pageLoading"); var data = { user_region_id: _this31.user.region_id, user_id: _this31.user.id, user_name: _this31.user.name, client_id: item.id, filterIn: _this31.filterIn, cbFilter: _this31.cbFilter, searchby: _this31.searchby, tblFilter: _this31.tblFilter_copy }; _this31.$http.post("api/Client/updateAutoBill", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this31.items = response.body.items; _this31.totalRows = response.body.items.length; _this31.tblisBusy = false; _this31.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response); }); } }); } }, stopAutoBill: function stopAutoBill(id) { var _this32 = this; __WEBPACK_IMPORTED_MODULE_3_sweetalert2___default.a.fire({ title: "Stop auto-generate billing for this client?", type: "info", html: "", showCloseButton: true, showCancelButton: true, focusConfirm: false, confirmButtonText: '', confirmButtonAriaLabel: "Thumbs up, great!", cancelButtonText: '', cancelButtonAriaLabel: "Thumbs down" }).then(function (update) { if (update.value) { _this32.tblisBusy = true; _this32.$root.$emit("pageLoading"); var item = { user_region_id: _this32.user.region_id, user_id: _this32.user.id, user_name: _this32.user.name, client_id: id, filterIn: _this32.filterIn, cbFilter: _this32.cbFilter, searchby: _this32.searchby, tblFilter: _this32.tblFilter_copy }; _this32.$http.post("api/Client/updateAutoBill", item).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this32.items = response.body.items; _this32.totalRows = response.body.items.length; _this32.tblisBusy = false; _this32.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response); }); } }); }, fileChange: function fileChange(e, index) { var _this33 = this; var fileName = e.target.files[0].name; this.attachData.file_ext = fileName.split(".").pop(); // console.log(this.attachData.file_ext); var fileReader = new FileReader(); fileReader.readAsDataURL(e.target.files[0]); fileReader.onload = function (e) { _this33.client_attachments[index].attachment = e.target.result; }; }, replacementFile: function replacementFile(e) { var _this34 = this; var fileName = e.target.files[0].name; this.attachData.file_ext = fileName.split(".").pop(); // console.log(this.attachData.file_ext); var fileReader = new FileReader(); fileReader.readAsDataURL(e.target.files[0]); fileReader.onload = function (e) { _this34.replaced_attachments.attachment = e.target.result; }; }, addMoreAttachment: function addMoreAttachment() { this.client_attachments.push({ type: null, selectedFile: null, other_type: null, attachment: null, description: null }); }, removeAttachment: function removeAttachment(index) { this.client_attachments.splice(index, 1); }, viewAttachment: function viewAttachment(file) { window.open(this.$img_path + "attachments/" + file); }, replaceAttachment: function replaceAttachment(item) { console.log(item); this.replaced_attachments = item; this.$bvModal.show("modalReplaceAttachment"); }, deleteAttachment: function deleteAttachment(id) { var _this35 = this; console.log(id); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { var data = { user_id: _this35.user.id, user_name: _this35.user.name, client_id: _this35.editClient.id, id: id }; _this35.$http.post(_this35.$root2 + "api/Client/destroyAttachment", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Deleted", "", "warning"); _this35.editClient.client_attachment = response.body; _this35.client_attachments = []; _this35.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this35.tblisBusy = false; _this35.$root.$emit("pageLoaded"); }); } }); }, updateAttachment: function updateAttachment() { var _this36 = this; var data = { id: this.replaced_attachments.id, client_id: this.replaced_attachments.client_id, attachment: this.replaced_attachments.attachment }; this.$http.post(this.$root2 + "api/Client/replaceAttachment", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this36.editClient.client_attachment = response.body; _this36.client_attachments = []; _this36.$bvModal.hide("modalReplaceAttachment"); _this36.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this36.tblisBusy = false; _this36.$root.$emit("pageLoaded"); }); }, saveAttachments: function saveAttachments() { var _this37 = this; var data = { client_id: this.editClient.id, attachments: this.client_attachments }; this.$root.$emit("pageLoading"); this.$http.post(this.$root2 + "api/Client/saveAttachment", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this37.editClient.client_attachment = response.body; _this37.client_attachments = []; _this37.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this37.tblisBusy = false; _this37.$root.$emit("pageLoaded"); }); }, openModalReactivate: function openModalReactivate(item) { this.cModalData = item; this.$bvModal.show("modalReActivate"); }, openModalTempDiscon: function openModalTempDiscon(item) { this.cModalData = item; this.$bvModal.show("modalTempDiscon"); }, openModalLineTransfer: function openModalLineTransfer(item) { this.cModalData = item; this.$bvModal.show("modalLineTransfer"); }, reset: function reset() { var _editClient2; this.serve_table_list = []; this.vlan_table_list = []; this.ip_table_list = []; this.owner = { name: "", contact_number: "", email_add: "" }; this.editClient = (_editClient2 = { package: { name: "", max_speed: "", cir: "", mrr: "" }, remarks: "", attachments: [], package_type: { name: "" }, sales: { user: { name: "" } }, sales_agent: { name: "" }, engineer: { name: "" }, _area: { name: "" }, town: { name: "", branch: { name: "", area: { name: "", region: { name: "" } } } }, bucket: { IP: "" }, staggered: 0, re_email: false, id: "", account_no: "", name: "", owner_name: "", contact_person: "", email_add: "", sales_id: {}, referral: "", engineers_id: {}, location: "", contact: "", package_id: "", OTC: 0, aging: null, term: "", modem_id: "" }, _defineProperty(_editClient2, "package_type", {}), _defineProperty(_editClient2, "communication_protocol", ""), _defineProperty(_editClient2, "olt_id", ""), _defineProperty(_editClient2, "date_activated", ""), _defineProperty(_editClient2, "remarks", ""), _defineProperty(_editClient2, "OTCPay", 0), _defineProperty(_editClient2, "amount_pay", 0), _defineProperty(_editClient2, "cashBond", 0), _defineProperty(_editClient2, "balance", 0), _defineProperty(_editClient2, "owner", { name: "", contact_number: "", email_add: "" }), _defineProperty(_editClient2, "olt", { id: 0, node_id: "", name: "", ip: "" }), _editClient2); this.client.isNewOwner = "val"; this.editOwner = false; this.editPerRow = { //editPerRowSoruce acc_no: false, name: false, owner_name: false, contact_person: false, contact: false, email_add: false, location: false, package: false, package_type: false, OTC: false, term: false, sales: false, agent: false, referral: false, engineers: false, branch: false, bucket: false, ip: false, subscription: false, status: false, remarks: false, wfc: false, coordinates: false, owner_contact_number: false, owner_email_add: false, owner_address: false, owner_birth_date: false, owner_gender: false, owner_work: false, town: false, olt: false }; }, searchOwner: function searchOwner(query) { this.isLoadingOwner = true; if (query != "") { this.$http.get("api/searchOwner/" + query).then(function (response) { console.log(response.body); this.owner_list = response.body; this.isLoadingOwner = false; }); } else { this.isLoadingOwner = false; } }, btnUpdateOwner: function btnUpdateOwner() { var _this38 = this; this.$validator.validateAll().then(function (result) { if (result) { _this38.$root.$emit("pageLoading"); _this38.editClient.user_id = _this38.user.id; _this38.editClient.user_name = _this38.user.name; _this38.editClient.user_region_id = _this38.user.region_id; _this38.editClient.owner_name = _this38.owner.name.toUpperCase(); _this38.editClient.owner = _this38.owner; _this38.editClient.owner.name = _this38.owner.name.toUpperCase(); _this38.editClient.owner.address = _this38.owner.address.toUpperCase(); _this38.editClient.owner.work = _this38.owner.work.toUpperCase(); _this38.editClient.isNewOwner = _this38.client.isNewOwner; _this38.$http.post("api/updateOwner", _this38.editClient).then(function (response) { console.log(response.body); _this38.editClient = response.body[0][0]; _this38.items = response.body[1].original.items; _this38.billings_to_export = response.body[1].original.billings; _this38.items_copy = _this38.items; _this38.updateCounts(response.body[1]); console.log(_this38.editClient); _this38.client.isNewOwner = "val"; _this38.editOwner = false; _this38.$root.$emit("pageLoaded"); // this.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Updated Successfully", text: "", icon: "success", dangerMode: true }); }).catch(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); }); } }); }, search: function search(query) { this.doSearch = true; this.clientOptions = []; this.currentItem = 0; if (query != "" && query != "." && query != null) { var escape_string = query.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.search_loading = true; this.$http.get("api/Client/search/" + this.user.region_id + "/" + this.searchby + "/" + escape_string + "/" + this.deletedAcc).then(function (response) { console.log(response.body); this.clientOptions = response.body.items; if (response.body.count > 10) { this.clientOptions.push({ name: "*** Show all " + response.body.count + " results...", account_no: "*** Show all " + response.body.count + " results...", acc_no: "*** Show all " + response.body.count + " results...", owner_name: "*** Show all " + response.body.count + " results...", address: "*** Show all " + response.body.count + " results...", contact: "*** Show all " + response.body.count + " results...", package_type_id: "*** Show all " + response.body.count + " results...", status: "*** Show all " + response.body.count + " results...", date_activated: "*** Show all " + response.body.count + " results...", id: "*** Show all " + response.body.count + " results...", mac: "*** Show all " + response.body.count + " results...", serial: "*** Show all " + response.body.count + " results..." }); } this.search_loading = false; }); } else { this.doSearch = false; this.search_loading = false; this.clientOptions = []; } }, searchItem: function searchItem(item) { if (item.name.substring(0, 3) != "***") { if (this.searchby == "name") this.tblFilter_copy = item.name;else if (this.searchby == "account_no") this.tblFilter_copy = item.account_no;else if (this.searchby == "acc_no") this.tblFilter_copy = item.acc_no;else if (this.searchby == "owner_name") this.tblFilter_copy = item.owner_name;else if (this.searchby == "location") this.tblFilter_copy = item.address;else if (this.searchby == "contact") this.tblFilter_copy = item.contact;else if (this.searchby == "package_type_id") this.tblFilter_copy = item.package_type_id;else if (this.searchby == "status") this.tblFilter_copy = item.status;else if (this.searchby == "date_activated") this.tblFilter_copy = item.date_activated;else if (this.searchby == "mac") this.tblFilter_copy = item.mac;else if (this.searchby == "serial") this.tblFilter_copy = item.serial;else if (this.searchby == "id") this.tblFilter_copy = item.id; } else { if (this.searchby == "id") this.tblFilter_copy = "[" + this.searchby + "] - " + this.tblFilter_copy; if (this.searchby == "owner_name") this.tblFilter_copy = "[" + this.searchby + "] - " + this.tblFilter_copy; } this.search_data(); }, searchSuggestions: function searchSuggestions(item) { if (this.searchby == "name") return item.name;else if (this.searchby == "account_no") return item.account_no;else if (this.searchby == "acc_no") return item.acc_no;else if (this.searchby == "owner_name") return item.owner_name;else if (this.searchby == "location") return item.address;else if (this.searchby == "contact") return item.contact;else if (this.searchby == "package_type_id") return item.package_type_id;else if (this.searchby == "status") return item.status;else if (this.searchby == "date_activated") return item.date_activated;else if (this.searchby == "mac") return item.mac;else if (this.searchby == "serial") return item.serial;else if (this.searchby == "id") return item.id.toString().substring(0, 3) != "***" ? item.id + " - " + item.name : item.id; }, nextItem: function nextItem(event) { if (event.keyCode == 38 && this.clientOptions.length > 1) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem > 0) { this.currentItem--; } } else if (event.keyCode == 40 && this.currentItem < this.clientOptions.length) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem < this.clientOptions.length - 1) { this.currentItem++; } } if (event.keyCode == 13 && this.clientOptions.length != 0) this.searchItem(this.clientOptions[this.currentItem]); }, btnsubmitModifySub: function btnsubmitModifySub() { var _this39 = this; this.$root.$emit("pageLoading"); this.modif_details.client = this.editClient; this.modif_details.client_id = this.editClient.id; this.modif_details.user_id = this.user.id; this.modif_details.user_name = this.user.name; this.modif_details.user_email = this.user.email; this.modif_details.ssh_switch = this.ssh_switch_local; if (this.modif_details.span == "Permanent") this.modif_details.date_end = null; var tempJson = { client_id: this.modif_details.client_id, add_on: this.modif_details.add_on, add_on_type: this.modif_details.span, date_effective: this.modif_details.date_effective, reference_type: this.modif_details.reference_type, reference_no: this.modif_details.reference_no, note: this.modif_details.note, date_end: this.modif_details.date_end, operation: this.modif_details.operation, type: this.modif_details.type, amount: this.modif_details.amount, description: this.modif_details.description, user_id: this.user.id, user_name: this.user.name, user_email: this.user.email }; var data = { ticket_type_id: 11, client_id: this.editClient.id, user_id: this.user.id, created_by: this.user.id, updated_by: this.user.id, remarks: JSON.stringify(tempJson), status: "Modification", state: "all", date_applied: new Date(), reference_type: this.modif_details.reference_type, reference_no: this.modif_details.reference_no, note: this.modif_details.note }; console.log(data, "Send to Internal Job Order for Approval"); this.$http.post("api/ActivityTicket", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Requested!", "", "success"); _this39.$bvModal.hide("modal-modify-subs"); _this39.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); _this39.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, load_IPtable: function load_IPtable() { var _this40 = this; console.log("load_ip_table"); console.log(this.editClient); this.editClient.bucket.acc_no = this.editClient.acc_no; this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/ipshow", this.editClient.bucket).then(function (response) { console.log(response); _this40.ip_table_list = response.body; _this40.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this40.$root.$emit("pageLoaded"); }); }, load_Vlantable: function load_Vlantable() { var _this41 = this; console.log("load_vlan_table"); this.editClient.bucket.acc_no = this.editClient.acc_no; this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/vlanshow", this.editClient.bucket).then(function (response) { console.log(response); _this41.vlan_table_list = response.body; _this41.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this41.$root.$emit("pageLoaded"); }); }, load_Servetable: function load_Servetable() { var _this42 = this; console.log("load_service_table"); this.editClient.bucket.acc_no = this.editClient.acc_no; this.$root.$emit("pageLoading"); this.$http.post("api/Bucket/serveshow", this.editClient.bucket).then(function (response) { console.log(response); _this42.serve_table_list = response.body; _this42.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this42.$root.$emit("pageLoaded"); }); }, customSerial: function customSerial(serial) { return serial.serial + " - " + serial.mac + " - " + serial.stock_id; }, excludeAutoDiscon: function excludeAutoDiscon(client_id, exclude_autodiscon) { var _this43 = this; __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this43.$root.$emit("pageLoading"); var data = { user_id: _this43.user.id, user_name: _this43.user.name, user_email: _this43.user.email, exclude_autodiscon: exclude_autodiscon }; _this43.$http.put("api/Client/excludeAutoDiscon/" + client_id, data).then(function (response) { if (_this43.tblFilter_copy != null) _this43.search_data();else { _this43.items = response.body.items; _this43.items_copy = _this43.items; } __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Updated", "", "success"); _this43.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body, text: "", icon: "error", dangerMode: true }); _this43.tblisBusy = false; _this43.$root.$emit("pageLoaded"); }); } }); }, send_ssid: function send_ssid() { var _this44 = this; console.log(this.editClient); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "Send SSID and SSID password", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this44.$root.$emit("pageLoading"); _this44.$http.post("api/user/sendSSID", _this44.editClient).then(function (response) { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()(response.body); _this44.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: response.body, text: "", icon: "error", dangerMode: true }); _this44.tblisBusy = false; _this44.$root.$emit("pageLoaded"); }); } }); }, autoProvision: function autoProvision() { var _this45 = this; console.log(this.editClient); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you sure?", text: "Auto provision client", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { _this45.$root.$emit("pageLoading"); _this45.$http.post("api/testAutoProvision", _this45.editClient).then(function (response) { console.log(response.body); _this45.$root.$emit("pageLoaded"); }).catch(function (error) { console.log(error.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: error.body, text: "", icon: "error", dangerMode: true }); _this45.tblisBusy = false; _this45.$root.$emit("pageLoaded"); }); } }); }, AssignModemClicked: function AssignModemClicked() { var _this46 = this; console.log(this.editClient); this.$root.$emit("pageLoading"); this.$http.get("api/StockModem/getStockModems/" + this.editClient.area_id).then(function (response) { _this46.stock_modems = response.body; _this46.$root.$emit("pageLoaded"); _this46.$bvModal.show("modalEncodeModem"); }); }, assign_modem: function assign_modem(modem) { this.updateClientPerRow("stock_id", modem); console.log(modem); //aaaa }, selectFileMigrate: function selectFileMigrate() { document.getElementById("inputJSFile").click(); }, selectFileRecon: function selectFileRecon() { document.getElementById("inputJSFileRecon").click(); }, readFile: function readFile() { var _this47 = this; var file = this.$refs.inputJSFile.files[0]; var reader = new FileReader(); if (file.name.includes(".txt")) { reader.onload = function (res) { _this47.jsfile = JSON.parse(res.target.result); document.getElementById("inputJSFile").value = ""; _this47.$refs.inputJSFileForm.reset(); _this47.formatJSFile(); }; reader.onerror = function (err) { return console.log(err); }; reader.readAsText(file); } }, readFileRecon: function readFileRecon() { var _this48 = this; //console.log("readFileRecon"); var file = this.$refs.inputJSFileRecon.files[0]; var reader = new FileReader(); if (file.name.includes(".txt")) { reader.onload = function (res) { console.log(res); _this48.jsfile = res.target.result; console.log(_this48.jsfile); document.getElementById("inputJSFileRecon").value = ""; _this48.$refs.inputReconForm.reset(); _this48.formatJSFileRecon(); }; reader.onerror = function (err) { return console.log(err); }; reader.readAsText(file); } }, formatJSFileRecon: function formatJSFileRecon() { var _this49 = this; this.$root.$emit("pageLoading"); var dataArray = this.jsfile.split('\n'); var temp = { user_id_log: this.user.id, user_name_log: this.user.name, sname: dataArray }; this.$http.post("api/Bucket/reconcile", temp).then(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()(response.body); _this49.$root.$emit("pageLoaded"); }); }, formatJSFile: function formatJSFile() { var _this50 = this; this.$root.$emit("pageLoading"); var formattedData = this.jsfile.map(function (obj) { var key = Object.keys(obj)[0]; // Get the key of the object var _obj$key = obj[key], ip = _obj$key.ip, bucket = _obj$key.bucket, serial = _obj$key.serial, tags = _obj$key.tags, vlan = _obj$key.vlan; // Get the properties var sname = key.replace("_" + bucket, ""); // Remove the bucket part from the key // Convert the tags array to a string var tagsString = tags.join(', '); // Return the transformed object return { sname: sname, ip: ip, bucket: bucket, serial: serial, vlan: vlan, tags: tagsString }; }); //console.log(formattedData); var temp = { user_id_log: this.user.id, user_name_log: this.user.name, data: formattedData }; this.$http.post("api/Bucket/storeJSFile", temp).then(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()(response.body); _this50.$root.$emit("pageLoaded"); }); }, migrateClicked: function migrateClicked(item) { var _this51 = this; this.$root.$emit("pageLoading"); var checker = this.migrateChecker(item); if (checker == "ok") { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Are you certain?", text: "Are you certain you want to create a job order for migration for this client?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { var data = { ticket_type_id: 12, client_id: item.id, user_id: _this51.user.id, created_by: _this51.user.id, updated_by: _this51.user.id, remarks: "", status: "new migration", state: "all", date_applied: new Date(), reference_type: "", reference_no: "", note: "" }; _this51.$http.post("api/ActivityTicket", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("Job order created!", "", "success"); _this51.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); _this51.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()({ text: checker, icon: "error" }); this.$root.$emit("pageLoaded"); } }, migrateChecker: function migrateChecker(item) { if (item.bucket_id != null) { if (item.bucket.version_command == 3) { // if(item.stock_id != null) // { if (item.package.bandwidth_max != null && item.package.bandwidth_min != null) { return "ok"; } else return "This client's assigned package has not been updated."; // } // else // return "There is no ONU assigned to this client."; } else return "An outdated version of the bucket server is the one that this client has been given."; } else return "No bucket is assigned to this client."; } } }); /***/ }), /* 487 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @class MapElementMixin * * Extends components to include the following fields: * * @property $map The Google map (valid only after the promise returns) * * * */ exports.default = { inject: { '$mapPromise': { default: 'abcdef' } }, provide: function provide() { var _this = this; // Note: although this mixin is not "providing" anything, // components' expect the `$map` property to be present on the component. // In order for that to happen, this mixin must intercept the $mapPromise // .then(() =>) first before its component does so. // // Since a provide() on a mixin is executed before a provide() on the // component, putting this code in provide() ensures that the $map is // already set by the time the // component's provide() is called. this.$mapPromise.then(function (map) { _this.$map = map; }); return {}; } }; /***/ }), /* 488 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ((function (x) { return x.default || x; })(__webpack_require__(1098))); /***/ }), /* 489 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ((function (x) { return x.default || x; })(__webpack_require__(1103))); /***/ }), /* 490 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = TwoWayBindingWrapper; /** * When you have two-way bindings, but the actual bound value will not equal * the value you initially passed in, then to avoid an infinite loop you * need to increment a counter every time you pass in a value, decrement the * same counter every time the bound value changed, but only bubble up * the event when the counter is zero. * Example: Let's say DrawingRecognitionCanvas is a deep-learning backed canvas that, when given the name of an object (e.g. 'dog'), draws a dog. But whenever the drawing on it changes, it also sends back its interpretation of the image by way of the @newObjectRecognized event. new TwoWayBindingWrapper((increment, decrement, shouldUpdate) => { this.$watch('identifiedObject', () => { // new object passed in increment() }) this.$deepLearningBackend.on('drawingChanged', () => { recognizeObject(this.$deepLearningBackend) .then((object) => { decrement() if (shouldUpdate()) { this.$emit('newObjectRecognized', object.name) } }) }) }) */ function TwoWayBindingWrapper(fn) { var counter = 0; fn(function () { counter += 1; }, function () { counter = Math.max(0, counter - 1); }, function () { return counter === 0; }); } /***/ }), /* 491 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ((function (x) { return x.default || x; })(__webpack_require__(1108))); /***/ }), /* 492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _bindProps = __webpack_require__(126); var _simulateArrowDown = __webpack_require__(493); var _simulateArrowDown2 = _interopRequireDefault(_simulateArrowDown); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {};for (var i in obj) { if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i]; }return target; } var props = { bounds: { type: Object }, defaultPlace: { type: String, default: '' }, componentRestrictions: { type: Object, default: null }, types: { type: Array, default: function _default() { return []; } }, placeholder: { required: false, type: String }, className: { required: false, type: String }, label: { required: false, type: String, default: null }, selectFirstOnEnter: { require: false, type: Boolean, default: false } }; exports.default = { mounted: function mounted() { var _this = this; var input = this.$refs.input; // Allow default place to be set input.value = this.defaultPlace; this.$watch('defaultPlace', function () { input.value = _this.defaultPlace; }); this.$gmapApiPromiseLazy().then(function () { var options = (0, _bindProps.getPropsValues)(_this, props); if (_this.selectFirstOnEnter) { (0, _simulateArrowDown2.default)(_this.$refs.input); } if (typeof google.maps.places.Autocomplete !== 'function') { throw new Error('google.maps.places.Autocomplete is undefined. Did you add \'places\' to libraries when loading Google Maps?'); } _this.autoCompleter = new google.maps.places.Autocomplete(_this.$refs.input, options); var placeholder = props.placeholder, place = props.place, defaultPlace = props.defaultPlace, className = props.className, label = props.label, selectFirstOnEnter = props.selectFirstOnEnter, rest = _objectWithoutProperties(props, ['placeholder', 'place', 'defaultPlace', 'className', 'label', 'selectFirstOnEnter']); // eslint-disable-line (0, _bindProps.bindProps)(_this, _this.autoCompleter, rest); _this.autoCompleter.addListener('place_changed', function () { _this.$emit('place_changed', _this.autoCompleter.getPlace()); }); }); }, created: function created() { console.warn('The PlaceInput class is deprecated! Please consider using the Autocomplete input instead'); // eslint-disable-line no-console }, props: props }; /***/ }), /* 493 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // This piece of code was orignally written by amirnissim and can be seen here // http://stackoverflow.com/a/11703018/2694653 // This has been ported to Vanilla.js by GuillaumeLeclerc exports.default = function (input) { var _addEventListener = input.addEventListener ? input.addEventListener : input.attachEvent; function addEventListenerWrapper(type, listener) { // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected, // and then trigger the original listener. if (type === 'keydown') { var origListener = listener; listener = function (event) { var suggestionSelected = document.getElementsByClassName('pac-item-selected').length > 0; if (event.which === 13 && !suggestionSelected) { var simulatedEvent = document.createEvent('Event'); simulatedEvent.keyCode = 40; simulatedEvent.which = 40; origListener.apply(input, [simulatedEvent]); } origListener.apply(input, [event]); }; } _addEventListener.apply(input, [type, listener]); } input.addEventListener = addEventListenerWrapper; input.attachEvent = addEventListenerWrapper; }; /***/ }), /* 494 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ((function (x) { return x.default || x; })(__webpack_require__(1113))); /***/ }), /* 495 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { items: [], datenow: new Date(), user: {}, item: { changeTin: false, tin: "(TIN)", changeBstyle: false, bstyle: "(Business Style)", changeWHT: false, wht: 0, wht_copy: "0.00", changeTotalSales: false }, roles: [] }; }, created: function created() { this.roles = this.$global.getRoles(); this.datenow = this.formatDateMDY(this.datenow); this.user = this.$global.getUser(); }, methods: { formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, fnExcelReport: function fnExcelReport(tbl) { this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); return sa; }.bind(this), 1000); }); }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, EmailElement: function EmailElement(id) { var _this = this; console.log(this.data); var email = this.data.client.email; if (email == null) email = this.data.client.email_add; var data = { subject: "Statement of Account as of " + this.data.due_date, msg: document.getElementById(id).innerHTML, user_email: this.user.name, user_name: this.user.email, sendTo: [], CCTO: [{ email: this.user.email, name: this.user.name }, { email: "r11cnc.dctech@gmail.com", name: "CNC R11" }] }; if (email == null) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client selected has no email address");else { var tempEmail = email.split(", "); for (var i = 0; i < tempEmail.length; ++i) { data.sendTo.push({ email: tempEmail[i], name: this.data.client.name }); } this.$http.post("api/Billing/emailSOA", data).then(function (response) { if (response.body == "ok") __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Email Sent!");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Send Failed"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this.tblisBusy = false; }); } }, changeTin: function changeTin() { this.item.changeTin = !this.item.changeTin; }, changeBstyle: function changeBstyle() { this.item.changeBstyle = !this.item.changeBstyle; }, changeWHT: function changeWHT() { this.item.changeWHT = !this.item.changeWHT; this.calculateAmount(); }, changeTotalSales: function changeTotalSales() { this.item.changeTotalSales = !this.item.changeTotalSales; this.calculateAmount(); }, calculateAmount: function calculateAmount() { var options = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; this.data.amount_copy = this.data.totalSales_copy - this.item.wht; var converter = __webpack_require__(496); this.data.amountInWord = converter.toWords(this.data.amount_copy); this.data.vatable = Math.round(this.data.amount_copy / 1.12); this.data.vat = Number(Math.round(this.data.vatable * 0.12)).toLocaleString("en", options); this.data.vatable = Number(this.data.vatable).toLocaleString("en", options); this.data.amount = Number(this.data.amount_copy).toLocaleString("en", options); this.data.totalSales = Number(this.data.totalSales_copy).toLocaleString("en", options); this.item.wht_copy = Number(this.item.wht).toLocaleString("en", options); } } }); /***/ }), /* 496 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/*! * Number-To-Words util * @version v1.2.4 * @link https://github.com/marlun78/number-to-words * @author Martin Eneqvist (https://github.com/marlun78) * @contributors Aleksey Pilyugin (https://github.com/pilyugin),Jeremiah Hall (https://github.com/jeremiahrhall),Adriano Melo (https://github.com/adrianomelo),dmrzn (https://github.com/dmrzn) * @license MIT */ !function(){"use strict";var e="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this,t=9007199254740991;function f(e){return!("number"!=typeof e||e!=e||e===1/0||e===-1/0)}function l(e){return"number"==typeof e&&Math.abs(e)<=t}var n=/(hundred|thousand|(m|b|tr|quadr)illion)$/,r=/teen$/,o=/y$/,i=/(zero|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)$/,s={zero:"zeroth",one:"first",two:"second",three:"third",four:"fourth",five:"fifth",six:"sixth",seven:"seventh",eight:"eighth",nine:"ninth",ten:"tenth",eleven:"eleventh",twelve:"twelfth"};function h(e){return n.test(e)||r.test(e)?e+"th":o.test(e)?e.replace(o,"ieth"):i.test(e)?e.replace(i,a):e}function a(e,t){return s[t]}var u=10,d=100,p=1e3,v=1e6,b=1e9,y=1e12,c=1e15,g=9007199254740992,m=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],w=["zero","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function x(e,t){var n,r=parseInt(e,10);if(!f(r))throw new TypeError("Not a finite number: "+e+" ("+typeof e+")");if(!l(r))throw new RangeError("Input is not a safe number, it’s either too large or too small.");return n=function e(t){var n,r,o=arguments[1];if(0===t)return o?o.join(" ").replace(/,$/,""):"zero";o||(o=[]);t<0&&(o.push("minus"),t=Math.abs(t));t<20?(n=0,r=m[t]):t 0 && value != item.Amount) return "Applied " + value;else return value; } }], tblisBusy_import_rp: false, totalRows: 1, pay_method_Selected: { id: "", name: "" }, clientOptions: [], isLoading: false, billingItemOptions: [], soa_preview: { id: "(save to get number)", client: { name: "", address: "", account_no: "" } } }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); this.load(); if (this.roles.accounting) { this.fields.unshift({ key: "check", sortable: true }); } //if (this.roles.update_soa) { if (this.roles.admin) { this.fields.unshift({ key: "id", sortable: true }); //this.fields.push({ key: "payment_id", sortable: true }); this.fields_billstate.unshift({ key: "id", sortable: true }); } }, mounted: function mounted() { var _this2 = this; this.$root.$on("reloadBillStatement", function () { _this2.billStateChange(); }); this.$root.$on("update_soa_item", function (item, filt) { _this2.clientSelected = {}; _this2.items = item; var temp = { key: "client.name", label: "Name", sortable: true }; _this2.fields.splice(1, 0, temp); _this2.cbFilter = filt; if (_this2.items != null) _this2.totalRows = item.length; }); }, updated: function updated() {}, methods: { soaChild: function soaChild() { this.clientSelected = this.client; }, load: function load() { var _this3 = this; this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountingMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounting").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/Paymethod").then(function (response) { _this3.pay_method = response.body; }); this.$http.get("api/BillingItem").then(function (response) { _this3.billingItemOptions = response.body; }); }, getClientDesc: function getClientDesc(client) { return client.name + " - " + client.region_name; }, onChangeSelectClient: function onChangeSelectClient() { var _this4 = this; if (this.clientSelected != null) { this.tblisBusy = true; this.$http.post("api/Billing/soa/" + this.clientSelected.id + "/" + this.billRange).then(function (response) { console.log(_this4.fields); console.log(response); for (var i = 0; i < _this4.fields.length; i++) { if (_this4.fields[i].label == "Name") { _this4.fields.splice(i, 1); break; } }_this4.items = response.body; _this4.tblisBusy = false; console.log("eeee", _this4.items); if (_this4.billStateShow == true) _this4.billStateChange(); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error + " " + response.body.message, // icon: "error", // dangerMode: true // }); // this.tblisBusy = false; // }); } }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.accounting) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.accounting) { //if (item.tbl_name != "ticket") { this.$bvModal.show("modalEditSOA"); this.soa_edit = item; if (item.item) this.soa_edit.item = parseInt(item.item); //} } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this5 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.tblisBusy = true; _this5.bill.user_id = _this5.user.id; _this5.bill.user_name = _this5.user.name; console.log(_this5.bill); _this5.$http.post("api/Billing", _this5.bill).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); var idtemp = _this5.bill.client_id.id; _this5.bill = { client_id: idtemp, date: new Date(), item: "", description: "", price: 0, balance: 0 }; _this5.items = []; _this5.tblisBusy = false; _this5.$bvModal.hide("modalAddBill"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this5.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this6 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this6.soa_edit.user_id = _this6.user.id; _this6.soa_edit.user_name = _this6.user.name; if (_this6.soa_edit.tbl_name == "customer_payment") { _this6.soa_edit.remarks = _this6.soa_edit.description; } _this6.$http.post("api/Billing/updateSOA", _this6.soa_edit).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this6.$bvModal.hide("modalEditSOA"); _this6.onChangeSelectClient(); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnDelete: function btnDelete() { var _this7 = this; if (this.roles.accounting) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this7.soa_edit.user_id = _this7.user.id; _this7.soa_edit.user_name = _this7.user.name; _this7.$http.post("api/Billing/deleteSOA", _this7.soa_edit).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this7.onChangeSelectClient(); _this7.$bvModal.hide("modalEditSOA"); }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a method", icon: "warning", buttons: true, dangerMode: true }); } }, btnDelSelected: function btnDelSelected() { var _this8 = this; // console.log(this.delSelected); if (this.roles.accounting) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { var temp = { user_id: _this8.user.id, user_name: _this8.user.name, data: _this8.delSelected }; _this8.$http.post("api/Billing/deleteMultiSOA", temp).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this8.onChangeSelectClient(); }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a method", icon: "warning", buttons: true, dangerMode: true }); } }, billRangeChange: function billRangeChange() { if (this.clientSelected.id != "") { this.onChangeSelectClient(); } }, checkPreview: function checkPreview() { var _this9 = this; this.delSelected = []; this.checked_item_preview = { client: this.clientSelected, data: [], amount_due: 0, amount_due_1: 0, vatable: 0, vatable_1: 0, vat: 0, vat_1: 0, ewt: 0, netOfVat: 0, due_date: null, id: "(save to get number)", saved: false }; this.showPrevBtn = false; var due_date; var sub_balance = 0; var summary_balance = 0; var options = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; this.checked_item_preview.amount_due = 0; this.checked_item_preview.amount_due_1 = 0; this.items.forEach(function (item) { if (item.check == true) { if (item.balance == null) item.balance = 0; if (item.amountFormated != null) { var temp = parseFloat(item.amountFormated.replace(/,/g, "")); temp = temp * (0 - 1); item.sub_amount = temp.toLocaleString("en", options); } if (item.price != null) { sub_balance += item.balance; summary_balance += item.price; } if (item.amount != null) { sub_balance -= item.amount; summary_balance -= item.amount; } item.sub_balance = Number(sub_balance).toLocaleString("en", options); item.summary_balance = Number(summary_balance).toLocaleString("en", options); _this9.checked_item_preview.data.push(item); _this9.showPrevBtn = true; var selected = { id: item.id, tbl_name: item.tbl_name }; _this9.delSelected.push(selected); due_date = item.date; } }); this.checked_item_preview.amount_due = sub_balance; this.checked_item_preview.amount_due_1 = summary_balance; this.checked_item_preview.summary_balance_total = summary_balance; //this.checked_item_preview.id = new Date().valueOf(); this.checked_item_preview.due_date = this.formatDateMDY(due_date); this.checked_item_preview.vatable = this.checked_item_preview.amount_due / 1.12; this.checked_item_preview.vatable_1 = this.checked_item_preview.amount_due_1 / 1.12; this.checked_item_preview.ewt = this.checked_item_preview.vatable * 0.02; this.checked_item_preview.netOfVat = this.checked_item_preview.amount_due - this.checked_item_preview.ewt; this.checked_item_preview.ewt_1 = this.checked_item_preview.vatable * 0.02; this.checked_item_preview.netOfVat_1 = this.checked_item_preview.amount_due_1 - this.checked_item_preview.ewt_1; this.checked_item_preview.vat = Number(this.checked_item_preview.vatable * 0.12).toLocaleString("en", options); this.checked_item_preview.vat_1 = Number(this.checked_item_preview.vatable_1 * 0.12).toLocaleString("en", options); this.checked_item_preview.vatable = Number(this.checked_item_preview.vatable).toLocaleString("en", options); this.checked_item_preview.vatable_1 = Number(this.checked_item_preview.vatable_1).toLocaleString("en", options); this.checked_item_preview.amount_due = Number(this.checked_item_preview.amount_due).toLocaleString("en", options); this.checked_item_preview.amount_due_1 = Number(this.checked_item_preview.amount_due_1).toLocaleString("en", options); this.checked_item_preview.summary_balance_total = Number(this.checked_item_preview.summary_balance_total).toLocaleString("en", options); this.checked_item_preview.ewt = Number(this.checked_item_preview.ewt).toLocaleString("en", options); this.checked_item_preview.ewt_1 = Number(this.checked_item_preview.ewt_1).toLocaleString("en", options); this.checked_item_preview.netOfVat = Number(this.checked_item_preview.netOfVat).toLocaleString("en", options); this.checked_item_preview.netOfVat_1 = Number(this.checked_item_preview.netOfVat_1).toLocaleString("en", options); console.log(this.checked_item_preview); }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, billStateChange: function billStateChange() { var _this10 = this; this.tblisBusy_billstate = true; if (this.billStateShow == true) { this.$http.post("api/Billing/getBillStateList", this.clientSelected).then(function (response) { _this10.items_billstate = response.body; _this10.tblisBusy_billstate = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this10.$refs.name.focus(); } }); }); } }, tblRowClicked_billstate: function tblRowClicked_billstate(item, index, event) { this.checked_item_preview = { client: { name: "", address: "", account_no: "" }, data: [], amount_due: 0, vatable: 0, ewt: 0, netOfVat: 0, vat: 0, due_date: null }; item.client.address = item.client.location; item.saved = true; var options = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; if (item.type == "billstate") { item.amount_due_1 = item.amount_due; item.vatable_1 = parseFloat(item.amount_due.replace(/,/g, "")) / 1.12; item.ewt_1 = item.vatable_1 * 0.02; item.netOfVat_1 = parseFloat(item.amount_due.replace(/,/g, "")) - item.ewt_1; item.vat_1 = Number(item.vatable_1 * 0.12).toLocaleString("en", options); item.vatable_1 = Number(item.vatable_1).toLocaleString("en", options); item.ewt_1 = Number(item.ewt_1).toLocaleString("en", options); item.netOfVat_1 = Number(item.netOfVat_1).toLocaleString("en", options); var summary_balance = 0; item.data.forEach(function (item) { item.amountFormated = item.balanceFormated; if (item.balanceFormated == "") summary_balance += parseFloat(item.priceFormated.replace(/,/g, ""));else summary_balance -= parseFloat(item.balanceFormated.replace(/,/g, "")); item.summary_balance = Number(summary_balance).toLocaleString("en", options); }); } else { item.vatable = parseFloat(item.amount_due.replace(/,/g, "")) / 1.12; item.ewt = item.vatable * 0.02; item.netOfVat = parseFloat(item.amount_due.replace(/,/g, "")) - item.ewt; item.vat = Number(item.vatable * 0.12).toLocaleString("en", options); item.vatable = Number(item.vatable).toLocaleString("en", options); item.ewt = Number(item.ewt).toLocaleString("en", options); item.netOfVat = Number(item.netOfVat).toLocaleString("en", options); var sub_balance = 0; item.data.forEach(function (item) { if (item.balanceFormated == " ") sub_balance += parseFloat(item.priceFormated.replace(/,/g, ""));else sub_balance += parseFloat(item.balanceFormated.replace(/,/g, "")); item.sub_balance = Number(sub_balance).toLocaleString("en", options); }); } this.checked_item_preview = item; // this.$bvModal.show("modalSoaPrintBillState"); if (item.type == "billstate") this.$bvModal.show("modalSoaPrintBillState");else this.$bvModal.show("modalSoaPrintPreview"); }, btnPreview: function btnPreview() { var _this11 = this; console.log(this.clientSelected); this.$root.$emit("pageLoading"); this.$http.post("api/Billing/genBillstatement", this.clientSelected).then(function (response) { console.log(response.body); _this11.soa_preview = response.body; _this11.$bvModal.show("modalSoaPrintPreview"); _this11.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this11.tblisBusy = false; _this11.$root.$emit("pageLoaded"); }); }, btnGenerateBill: function btnGenerateBill() { var _this12 = this; console.log(this.gen_bill); this.$http.post("api/Billing/generateBill", this.gen_bill).then(function (response) { _this12.generated_bill = response.body; console.log(_this12.generated_bill); }); }, btnInsertGenBill: function btnInsertGenBill() { var _this13 = this; var data = { bill: this.generated_bill }; this.$http.post("api/Billing/insertGeneratedBill", data).then(function (response) { console.log(response); _this13.$bvModal.hide("modalGenerateBill"); _this13.onChangeSelectClient(); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Done"); }); }, selectFile: function selectFile() { document.getElementById("fileSelect").click(); }, previewFiles: function previewFiles(e) { var files = e.target.files, f = files[0]; var reader = new FileReader(); reader.onload = function (e) { var _this14 = this; var data = new Uint8Array(e.target.result); var workbook = XLSX.read(data, { type: "array" }); var sheetName = workbook.SheetNames[0]; /* DO SOMETHING WITH workbook HERE */ var worksheet = workbook.Sheets[sheetName]; console.log(XLSX.utils.sheet_to_json(worksheet)); this.items_import_rp = XLSX.utils.sheet_to_json(worksheet); this.items_import_rp.forEach(function (element) { //element.Date = element.Date; element.Date = _this14.$global.excelDateToJSDate(element.Date); element.amount_applied_return = 0; // const temp = element.Description.split("/"); // element.Remarks = temp[2]; // element.account_name = temp[1]; // element.bill_statement_id = temp[0]; }); this.$bvModal.show("modalImportRP"); document.getElementById("fileSelect").value = null; }.bind(this); reader.readAsArrayBuffer(f); }, btnPay: function btnPay(base_ref) { var _this15 = this; if (this.pay_method_Selected.id != null) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { var data = { payments: _this15.items_import_rp, base_ref: base_ref, user_id: _this15.user.id, payment_method_id: _this15.pay_method_Selected.id }; _this15.$root.$emit("pageLoading"); _this15.$http.post("api/CustomerPayment/storePayment", data).then(function (response) { _this15.items_import_rp = response.body.payments; _this15.$root.$emit("pageLoaded"); console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Done"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: response.body.error, text: "", icon: "error", dangerMode: true }); _this15.tblisBusy = false; _this15.$root.$emit("pageLoaded"); }); } }); } }, searchClient: function searchClient(query) { this.isLoading = true; if (query != "") { this.$http.get("api/searchClient/" + this.user.region_id + "/" + query).then(function (response) { // console.log(response.body); this.clientOptions = response.body; this.isLoading = false; }); } else { this.isLoading = false; } }, exportTable: function exportTable() { var _this16 = this; if (!this.items[0].client) { var temp = []; this.items.forEach(function (element) { element.client = { name: _this16.clientSelected.name }; temp.push(element); }); this.items = temp; } this.cModalData.field = 7; this.cModalData.items = this.items; this.$global.excelReportCSV("genTable1", "soa", this); } } }); /***/ }), /* 500 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__packages_qrious_min_js__ = __webpack_require__(1131); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__packages_qrious_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__packages_qrious_min_js__); function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "date-picker": __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default.a }, data: function data() { return { soa_footer: "soa_potar", items: [], datenow: new Date(), user: {}, contacts: [], email_data: { subject: "Statement of Account as of ", msg: "", user_email: "", user_name: "", sendTo: [], CCTO: [], togmail: "yes", emailSender: "default" }, modiView: { data: { due_date: "" }, due_date: false }, AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, emailSenderData: { email: "", pass: "" }, qrDataURL: "", roles: [] }; }, created: function created() { var _this = this; this.roles = this.$global.getRoles(); this.datenow = this.formatDateMDY(this.datenow); this.user = this.$global.getUser(); if (this.$global.getSoaEmail() != null) { this.emailSenderData.email = this.$global.getSoaEmail(); this.emailSenderData.pass = this.$global.getSoaEmailPass(); } this.$http.get("api/getClientEmail").then(function (response) { _this.contacts = response.body; // console.log(this.contacts); // console.log(response.body); }); this.soa_footer = __webpack_require__(501); }, watch: { // data: { // immediate: true, // handler(newData, oldData) { // if ( // newData && // newData.client.acc_no && // newData.client.name && // newData.total_bill // ) { // this.qrCall(); // } // } // } }, methods: { qrCall: function qrCall() { var _this2 = this; return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return _this2.generateQRCode(_this2.data); case 2: _this2.qrDataURL = _context.sent; case 3: case "end": return _context.stop(); } } }, _callee, _this2); }))(); }, generateQRCode: function generateQRCode(data) { console.log("data", data); console.log("called"); var qrData = { accountNumber: data.client.acc_no, accountName: data.client.name, amount: data.total_bill }; var qrDataString = JSON.stringify(qrData); var qr = new __WEBPACK_IMPORTED_MODULE_7__packages_qrious_min_js___default.a({ value: qrDataString, size: 100 // Adjust the size as needed }); return qr.toDataURL(); }, formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, fnExcelReport: function fnExcelReport(tbl) { this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); return sa; }.bind(this), 1000); }); }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); //$printSection.remove(); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, readyEmailData: function readyEmailData(id, gmail) { var email = this.data.client.email; if (email == null) email = this.data.client.email_add; this.email_data.subject = "Billing Statement No. " + this.data.id; this.email_data.msg = document.getElementById(id).innerHTML; this.email_data.user_email = this.user.name; this.email_data.user_name = this.user.email; this.email_data.CCTO = [{ email: this.user.email + this.user.subdomain, name: this.user.name }]; this.email_data.sendTo = []; if (email == null) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client selected has no email address");else { var tempEmail = email.split(", "); for (var i = 0; i < tempEmail.length; ++i) { this.email_data.sendTo.push({ email: tempEmail[i], name: this.data.client.name }); } this.$bvModal.show("modal_select_recipientttt"); } }, EmailElement: function EmailElement(id, gmail) { var _this3 = this; this.email_data.emailSenderDataE = this.emailSenderData.email; this.email_data.emailSenderDataP = this.emailSenderData.pass; //console.log(this.emailSenderData); this.$root.$emit("pageLoading"); //console.log(this.email_data); this.$http.post("api/Billing/emailSOA", this.email_data).then(function (response) { console.log(response.body); _this3.$root.$emit("pageLoaded"); _this3.$global.setSoaEmail(_this3.emailSenderData.email); _this3.$global.setSoaEmailPass(_this3.emailSenderData.pass); if (response.body.includes("ok")) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Email Sent!");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Send Failed"); }).catch(function (response) { _this3.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this3.tblisBusy = false; }); }, saveStatement: function saveStatement() { var _this4 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; this.data.type = "preview"; console.log(this.data); this.$http.post("api/Billing/storeBillStatement", this.data).then(function (response) { console.log(response.body); _this4.data.saved = true; _this4.data.id = response.body.id; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Saved! you can now print or email this statement now."); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); }); }, addTagInSendTo: function addTagInSendTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.sendTo.push(tag); }, addTagInCCTo: function addTagInCCTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.CCTO.push(tag); }, changeDueDate: function changeDueDate() { this.modiView.due_date = !this.modiView.due_date; }, changeDueDateOK: function changeDueDateOK() { this.modiView.due_date = !this.modiView.due_date; this.data.due_date = this.formatDateMDY(this.modiView.data.due_date); console.log(this.modiView.data.due_date); }, btnDelState: function btnDelState() { var _this5 = this; if (this.roles.accounting) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.data.user_id = _this5.user.id; _this5.data.user_name = _this5.user.name; _this5.data.bill = _this5.data.id; _this5.$http.post("api/Billing/deleteBillState", _this5.data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) {}); _this5.$bvModal.hide("modalSoaPrintPreview"); _this5.$root.$emit("reloadBillStatement"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a method", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 501 */ /***/ (function(module, exports) { module.exports = "

PAYMENT REMINDER

* Previous Charges must be fully paid IMMEDIATELY and Current Charges must be fully paid ON    or BEFORE THE DUE DATE indicated in this bill to prevent service interruptions.
* NON-PAYMENT OF ACCOUNTS SHALL BE SUBJECT FOR TEMPORARY DISCONNECTION
   FIVE (5) DAYS FROM DUE DATE WITHOUT PRIOR NOTICE.
* RECONNECTION FEE of P1,120.00 will be charged if payment was made 15 days after disconnection.
   DISREGARD THIS STATEMENT IF PAYMENT HAS BEEN MADE.

PAYMENT OPTION

   * For check payments, Please make checks payable to DATACONNECT NETWORK SERVICES, INC.
    Pay with CASH or CHECK to one of our designated branches.

   * Fund transfer to our DATACONNECT bank accounts using GCASH or MOBILE BANKING APPS.

      - SECURITY BANK : Account Name - Dataconnect Network Services, Inc.
                     Account Number: 00-000-43337-102

      - UNION BANK: Account Name - Dataconnect Network Services Inc
                     Account Number: 000-310-034-425

      - METROBANK: Account Name - Dataconnect Network Services Inc
                     Account Number: 286-728-651-8520


   * Online and digital payment options

      - Dragon Pay ( Instructions) (Pay here )
      - GCASH App
      - Union Bank App (Need to have a Union Bank account.)
      - Pay thru 7/11 Store
      - CliQQ Mobile App - You can download CliQQ app from Appstore or Playstore.

* FOR MORE INQUIRIES, PLEASE CALL :
   Mobile Hotline Number: 0919 - 056 - 0950
   Telephone: (082) 221 - 2380 LOCAL 1111, 1113, 1128
   FB Page: DCTECH HELPDESK

* For billing concerns and proof of payment kindly email to : r11cnc.dctech@gmail.com

'THIS DOCUMENT IS NOT VALID FOR CLAIMING INPUT TAXES'

Thank you for having business with us. We are happy to serve you more.

"; /***/ }), /* 502 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "date-picker": __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default.a }, data: function data() { return { items: [], datenow: new Date(), user: {}, contacts: [], email_data: { subject: "Statement of Account as of ", msg: "", user_email: "", user_name: "", sendTo: [], CCTO: [], togmail: "yes", emailSender: "default" }, modiView: { data: { due_date: "" }, due_date: false }, AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, emailSenderData: { email: "", pass: "" }, roles: [] }; }, created: function created() { var _this = this; this.roles = this.$global.getRoles(); this.datenow = this.formatDateMDY(this.datenow); this.user = this.$global.getUser(); if (this.$global.getSoaEmail() != null) { this.emailSenderData.email = this.$global.getSoaEmail(); this.emailSenderData.pass = this.$global.getSoaEmailPass(); } this.$http.get("api/getClientEmail").then(function (response) { _this.contacts = response.body; // console.log(this.contacts); // console.log(response.body); }); }, methods: { formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, fnExcelReport: function fnExcelReport(tbl) { this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); return sa; }.bind(this), 1000); }); }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, readyEmailData: function readyEmailData(id, gmail) { console.log(id); var email = this.data.client.email; if (email == null) email = this.data.client.email_add; this.email_data.subject = "Billing Statement No. " + this.data.id; this.email_data.msg = document.getElementById(id).innerHTML; this.email_data.user_email = this.user.name; this.email_data.user_name = this.user.email; this.email_data.CCTO = [{ email: this.user.email, name: this.user.name }]; this.email_data.sendTo = []; var tempEmail = email.split(", "); for (var i = 0; i < tempEmail.length; ++i) { this.email_data.sendTo.push({ email: tempEmail[i], name: this.data.client.name }); } this.$bvModal.show("modal_select_recipient"); }, EmailElement: function EmailElement(id, gmail) { var _this2 = this; this.email_data.emailSenderDataE = this.emailSenderData.email; this.email_data.emailSenderDataP = this.emailSenderData.pass; console.log(this.emailSenderData); this.$root.$emit("pageLoading"); console.log(this.email_data); this.$http.post("api/Billing/emailSOA", this.email_data).then(function (response) { console.log(response.body); _this2.$root.$emit("pageLoaded"); _this2.$global.setSoaEmail(_this2.emailSenderData.email); _this2.$global.setSoaEmailPass(_this2.emailSenderData.pass); if (response.body.includes("ok")) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Email Sent!");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Send Failed"); }).catch(function (response) { _this2.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this2.tblisBusy = false; }); }, saveStatement: function saveStatement() { var _this3 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; console.log(this.data); this.$http.post("api/Billing/storeBillStatement", this.data).then(function (response) { console.log(response.body); _this3.data.saved = true; _this3.data.id = response.body.id; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Saved! you can now print or email this statement now."); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); }); }, addTagInSendTo: function addTagInSendTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.sendTo.push(tag); }, addTagInCCTo: function addTagInCCTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.CCTO.push(tag); }, changeDueDate: function changeDueDate() { this.modiView.due_date = !this.modiView.due_date; }, changeDueDateOK: function changeDueDateOK() { this.modiView.due_date = !this.modiView.due_date; this.data.due_date = this.formatDateMDY(this.modiView.data.due_date); console.log(this.modiView.data.due_date); }, btnDelState: function btnDelState() { var _this4 = this; if (this.roles.accounting) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.data.user_id = _this4.user.id; _this4.data.user_name = _this4.user.name; _this4.data.bill = _this4.data.id; _this4.$http.post("api/Billing/deleteBillState", _this4.data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) {}); _this4.$bvModal.hide("modalSoaPrintPreview"); _this4.$root.$emit("reloadBillStatement"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a method", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 503 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "date-picker": __WEBPACK_IMPORTED_MODULE_5_vue_bootstrap_datetimepicker___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_6_vue_rangedate_picker___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default.a }, data: function data() { return { soa_footer: "soa_potar", items: [], datenow: new Date(), user: {}, contacts: [], email_data: { subject: "Statement of Account as of ", msg: "", user_email: "", user_name: "", sendTo: [], CCTO: [], togmail: "yes", emailSender: "default" }, modiView: { data: { due_date: "" }, due_date: false }, AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, emailSenderData: { email: "", pass: "" }, roles: [] }; }, created: function created() { var _this = this; this.roles = this.$global.getRoles(); this.datenow = this.formatDateMDY(this.datenow); this.user = this.$global.getUser(); if (this.$global.getSoaEmail() != null) { this.emailSenderData.email = this.$global.getSoaEmail(); this.emailSenderData.pass = this.$global.getSoaEmailPass(); } this.$http.get("api/getClientEmail").then(function (response) { _this.contacts = response.body; // console.log(this.contacts); // console.log(response.body); }); this.soa_footer = __webpack_require__(501); }, methods: { formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, fnExcelReport: function fnExcelReport(tbl) { this.$nextTick(function () { setTimeout(function () { var tab_text = ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); return sa; }.bind(this), 1000); }); }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, printElement: function printElement(id) { var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); }, readyEmailData: function readyEmailData(id, gmail) { var email = this.data.client.email; if (email == null) email = this.data.client.email_add; this.email_data.subject = "Billing Statement No. " + this.data.id; this.email_data.msg = document.getElementById(id).innerHTML; this.email_data.user_email = this.user.name; this.email_data.user_name = this.user.email; this.email_data.CCTO = [{ email: this.user.email + this.user.subdomain, name: this.user.name }]; this.email_data.sendTo = []; if (email == null) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client selected has no email address");else { var tempEmail = email.split(", "); for (var i = 0; i < tempEmail.length; ++i) { this.email_data.sendTo.push({ email: tempEmail[i], name: this.data.client.name }); } this.$bvModal.show("modal_select_recipientttt"); } }, EmailElement: function EmailElement(id, gmail) { var _this2 = this; this.email_data.emailSenderDataE = this.emailSenderData.email; this.email_data.emailSenderDataP = this.emailSenderData.pass; console.log(this.emailSenderData); this.$root.$emit("pageLoading"); console.log(this.email_data); this.$http.post("api/Billing/emailSOA", this.email_data).then(function (response) { console.log(response.body); _this2.$root.$emit("pageLoaded"); _this2.$global.setSoaEmail(_this2.emailSenderData.email); _this2.$global.setSoaEmailPass(_this2.emailSenderData.pass); if (response.body.includes("ok")) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Email Sent!");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Send Failed"); }).catch(function (response) { _this2.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this2.tblisBusy = false; }); }, saveStatement: function saveStatement() { var _this3 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; this.data.type = "billstate"; console.log(this.data); this.$http.post("api/Billing/storeBillStatement", this.data).then(function (response) { console.log(response.body); _this3.data.saved = true; _this3.data.id = response.body.id; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Saved! you can now print or email this statement now."); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); }); }, addTagInSendTo: function addTagInSendTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.sendTo.push(tag); }, addTagInCCTo: function addTagInCCTo(newTag) { var tag = { name: newTag, email: newTag }; this.contacts.push(tag); this.email_data.CCTO.push(tag); }, changeDueDate: function changeDueDate() { this.modiView.due_date = !this.modiView.due_date; }, changeDueDateOK: function changeDueDateOK() { this.modiView.due_date = !this.modiView.due_date; this.data.due_date = this.formatDateMDY(this.modiView.data.due_date); console.log(this.modiView.data.due_date); }, btnDelState: function btnDelState() { var _this4 = this; if (this.roles.accounting) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.data.user_id = _this4.user.id; _this4.data.user_name = _this4.user.name; _this4.data.bill = _this4.data.id; _this4.$http.post("api/Billing/deleteBillState", _this4.data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) {}); _this4.$bvModal.hide("modalSoaPrintPreview"); _this4.$root.$emit("reloadBillStatement"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a method", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 504 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_multiselect__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_1_pretty_checkbox_vue_check___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default.a }, data: function data() { return { cbFilter: { region: false, area: false, branch: false, date: false, item: false, description: false, data: { region_id: 0, area_id: [], branch_id: 0, date: "", item: "", description: "" } }, region: null, area: null, branch: null }; }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); this.load(); }, methods: { load: function load() { var _this = this; this.$http.get("api/Region").then(function (response) { _this.region = response.body; console.log(_this.branch); }); this.$http.get("api/area").then(function (response) { _this.area = response.body; console.log(_this.branch); }); this.$http.get("api/Branch").then(function (response) { _this.branch = response.body; console.log(_this.branch); }); }, filter_ok: function filter_ok() { var _this2 = this; console.log(this.cbFilter); this.$root.$emit("pageLoading"); this.$http.post("api/Billing/multipleFilter", this.cbFilter).then(function (response) { console.log(response); _this2.$root.$emit("pageLoaded"); _this2.$root.$emit("update_soa_item", response.body, _this2.cbFilter); _this2.$bvModal.hide("modalMultipleFilterSOA"); }); }, checkAreas: function checkAreas() { var _this3 = this; this.$http.get("api/checkAreas/" + this.cbFilter.data.region_id).then(function (response) { console.log(response.body); _this3.cbFilter.data.area_id = response.body; _this3.cbFilter.area = true; }); } } }); /***/ }), /* 505 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sweetalert2__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "position", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], engineer: { engineer_id: "", name: "", position: "", signature: "" }, user: [], roles: [], accounts: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.items = this.$global.getEngineer(); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/user").then(function (response) { this.accounts = response.body; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_engineer) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_engineer) { this.$bvModal.show("modalEdit"); this.engineer = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.engineer.user_id = _this.user.id; _this.engineer.user_name = _this.user.name; _this.$http.post("api/Engineer", _this.engineer).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); console.log(response.body); _this.engineer = { engineer_id: "", name: "", position: "", signature: "" }; _this.$global.setEngineer(response.body); _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", focusConfirm: true, text: "", icon: "warning", buttons: ["No", "Yes"] }).then(function (update) { if (update) { _this2.engineer.user_id = _this2.user.id; _this2.engineer.user_name = _this2.user.name; _this2.$http.put("api/Engineer/" + _this2.engineer.id, _this2.engineer).then(function (response) { _this2.$global.setEngineer(response.bod); _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_engineer) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Engineer/" + _this3.engineer.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); _this3.$global.setEngineer(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Engineer", icon: "warning", buttons: true, dangerMode: true }); } }, imageChange: function imageChange(e) { var _this4 = this; if (e != null) if (e.target.files[0].size > 5000000) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("File selected are too large", "File must be less than 5MB"); this.engineer.signature = ""; this.$refs["userimg"].reset(); } else { var fileReader = new FileReader(); fileReader.readAsDataURL(e.target.files[0]); fileReader.onload = function (e) { _this4.engineer.signature = e.target.result; }; } } } }); /***/ }), /* 506 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], modem: { name: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.tblisBusy = true; this.$http.get("api/Modem").then(function (response) { this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_modem) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_modem) { this.$bvModal.show("modalEdit"); this.modem.id = item.id; this.modem.name = item.name; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.modem.user_id = _this.user.id; _this.modem.user_name = _this.user.name; _this.$http.post("api/Modem", _this.modem).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.modem.name = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.modem.user_id = _this2.user.id; _this2.modem.user_name = _this2.user.name; _this2.$http.put("api/Modem/" + _this2.modem.id, _this2.modem).then(function (response) { _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_modem) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Modem/" + _this3.modem.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Modem", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 507 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], contractor: { name: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.tblisBusy = true; this.$http.get("api/Contractor").then(function (response) { this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_client_details) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_client_details) { this.$bvModal.show("modalEdit"); this.contractor.id = item.id; this.contractor.name = item.name; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.contractor.user_id = _this.user.id; _this.contractor.user_name = _this.user.name; _this.$http.post("api/Contractor", _this.contractor).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.contractor.name = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.contractor.user_id = _this2.user.id; _this2.contractor.user_name = _this2.user.name; _this2.$http.put("api/Contractor/" + _this2.contractor.id, _this2.contractor).then(function (response) { _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_client_details) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Contractor/" + _this3.contractor.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a contractor", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 508 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { multiselect: __WEBPACK_IMPORTED_MODULE_2_vue_multiselect___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_check___default.a, "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "package_type.name", label: "Package type", sortable: true }, { key: "bandwidth_max", label: "Max Speed" }, { key: "bandwidth_min", label: "CIR", sortable: true }, { key: "mrr", label: "MRR", sortable: true }, { key: "private_ip", label: "Private IP", formatter: function formatter(value) { return value == 0 ? "" : value; } }, { key: "public_ip", label: "Public IP", formatter: function formatter(value) { return value == 0 ? "" : value; } }, { key: "vlan_class", label: "Vlan Class", formatter: function formatter(value) { return value == 1 ? 1 : value; } }, { key: "lan_net", label: "Lan Network", sortable: true }, { key: "end_date", label: "Promo End Date", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], pack: { name: "", package_type_id: "", max_speed: "", cir: "", mrr: "", end_date: "", bucket_selected: {}, bandwidth_selected: {}, bandwidth: "", description: "", num_max_speed: 0, num_cir: 0, selectedMaxSpeed: null, selectedCIRSpeed: null, public_ip: 0, private_ip: 0, vlan_class: 0, lan_net: null }, packageTypes: [], user: [], roles: [], AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, bucket_items: [], ssh_switch_local: true, newBandwidth: "true", bandwidth_item: [], selectedBucket: {}, speed: [{ value: "1", text: "Kbps" }, { value: "2", text: "Mbps" }, { value: "3", text: "Gbps" }], public_ip_list: [{ id: 0, value: 0 }], edit: { selectedMaxSpeed: { value: "1", text: "Kbps" }, selectedCIRSpeed: { value: "1", text: "Kbps" } }, lan_net_list: [{ value: "/24" }, { value: "/25" }, { value: "/26" }, { value: "/27" }, { value: "/28" }, { value: "/29" }] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.packageTypes = this.$global.getPackageTypes(); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); }, updated: function updated() {}, computed: { cir_edit: { get: function get() { return this.convertSpeed(this.pack.bandwidth_min, this.edit.selectedCIRSpeed.text); }, set: function set(newValue) { this.pack.bandwidth_min = newValue; } }, max_speed_edit: { get: function get() { return this.convertSpeed(this.pack.bandwidth_max, this.edit.selectedMaxSpeed.text); }, set: function set(newValue) { this.pack.bandwidth_max = newValue; } } }, methods: { load: function load() { var _this = this; this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/Package").then(function (response) { console.log("data1:", response.body); this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); this.$http.get("api/Bucket").then(function (response) { _this.bucket_items = response.body; _this.pack.bucket_selected = _this.bucket_items; }); if (this.$ssh_switch == "enabled") { this.ssh_switch_local = true; } else { this.ssh_switch_local = true; } var num = 1; for (var i = 1; i <= 9; i++) { this.public_ip_list.push({ id: i, value: num }); num *= 2; } }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_package) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_package) { this.$bvModal.show("modalEdit"); this.pack = item; this.pack.package_type_id = item.package_type.id; this.pack.num_max_speed = this.pack.bandwidth_max; this.pack.num_cir = this.pack.bandwidth_min; if (this.pack.vlan_class != null) this.pack.vlan = true; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this2 = this; console.log("btnCreate:", this.pack); if (this.pack.public_ip + this.pack.private_ip > 0) { if (this.ssh_switch_local == true) { this.$validator.validateAll().then(function (result) { if (result) { _this2.pack.max_speed_kbps = _this2.convertToKbps(_this2.pack.num_max_speed, _this2.pack.selectedMaxSpeed); _this2.pack.cir_kbps = _this2.convertToKbps(_this2.pack.num_cir, _this2.pack.selectedCIRSpeed); if (_this2.pack.vlan == true && (_this2.pack.package_type_id == 4 || _this2.pack.package_type_id == 1)) _this2.pack.vlan_class = 2;else if (_this2.pack.vlan == true && (_this2.pack.package_type_id == 2 || _this2.pack.package_type_id == 3)) _this2.pack.vlan_class = 1;else _this2.pack.vlan_class = null; if (parseInt(_this2.pack.max_speed_kbps) >= parseInt(_this2.pack.cir_kbps)) { _this2.$root.$emit("pageLoading"); _this2.tblisBusy = true; _this2.pack.user_id = _this2.user.id; _this2.pack.user_name = _this2.user.name; _this2.pack.ssh_switch = _this2.ssh_switch_local; console.log(_this2.pack); _this2.$http.post("api/Package", _this2.pack).then(function (response) { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()("Created", "", "success"); console.log(response.body); _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; _this2.$root.$emit("pageLoaded"); _this2.$bvModal.hide("modalAdd"); _this2.pack = { name: "", package_type_id: "", max_speed: "", cir: "", mrr: "", end_date: "", //bucket_selected: {}, bandwidth: "", description: "", num_max_speed: 0, num_cir: 0, selectedMaxSpeed: null, selectedCIRSpeed: null }; }).catch(function (response) { _this2.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } else { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: "Max speed should be greater than or equal to CIR", icon: "error", dangerMode: true }); } } }); } else { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: "Can't execute. SSH is disabled.", icon: "error", dangerMode: true }); } } else __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ text: "Please add a number of IP" }); }, btnUpdate: function btnUpdate() { var _this3 = this; if (this.pack.public_ip + this.pack.private_ip > 0) { this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.pack.max_speed_kbps = _this3.convertToKbps(_this3.pack.num_max_speed, _this3.edit.selectedMaxSpeed.text); _this3.pack.cir_kbps = _this3.convertToKbps(_this3.pack.num_cir, _this3.edit.selectedCIRSpeed.text); if (_this3.pack.vlan == true && (_this3.pack.package_type_id == 4 || _this3.pack.package_type_id == 1)) _this3.pack.vlan_class = 2;else if (_this3.pack.vlan == true && (_this3.pack.package_type_id == 2 || _this3.pack.package_type_id == 3)) _this3.pack.vlan_class = 1;else _this3.pack.vlan_class = null; if (parseInt(_this3.pack.max_speed_kbps) >= parseInt(_this3.pack.cir_kbps)) { _this3.pack.user_id = _this3.user.id; _this3.pack.user_name = _this3.user.name; _this3.pack.bandwidth_max = _this3.pack.max_speed_kbps; _this3.pack.bandwidth_min = _this3.pack.cir_kbps; _this3.$http.put("api/Package/" + _this3.pack.id, _this3.pack).then(function (response) { _this3.items = response.body; __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()("Updated", "", "success"); _this3.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } else { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: "Max speed should be greater than or equal to CIR", icon: "error", dangerMode: true }); } } }); } }); } else __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ text: "Please add a number of IP" }); }, btnDelete: function btnDelete() { var _this4 = this; if (this.roles.delete_package) { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.tblisBusy = true; _this4.$http.delete("api/Package/" + _this4.pack.id).then(function (response) { _this4.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()("Deleted", "", "success").then(function (value) { _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; _this4.pack = { name: "", package_type_id: "", max_speed: "", cir: "", mrr: "" }; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this4.tblisBusy = false; } }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_5_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Package", icon: "warning", buttons: true, dangerMode: true }); } }, getBandwidth: function getBandwidth() { var _this5 = this; this.pack.bandwidth = ""; this.bandwidth_item = []; this.pack.bandwidth_selected = {}; console.log(this.selectedBucket); this.$http.post("api/getBandwidth", this.selectedBucket).then(function (response) { _this5.bandwidth_item = response.body; console.log(_this5.bandwidth_item); }); }, convertToKbps: function convertToKbps(speed, selected) { if (selected == "Mbps") return speed * 1000;else if (selected == "Gbps") return speed * 1000000;else return speed; }, convertSpeed: function convertSpeed(speed, selected) { if (selected == "Gbps") return speed / 1000000;else if (selected == "Mbps") return speed / 1000;else if (selected == "Kbps") return speed; }, reset: function reset() { this.pack = { name: "", package_type_id: "", max_speed: "", cir: "", mrr: "", end_date: "", bucket_selected: {}, bandwidth_selected: {}, bandwidth: "", description: "", num_max_speed: 0, num_cir: 0, selectedMaxSpeed: null, selectedCIRSpeed: null, public_ip: 0, private_ip: 0 }; this.edit = { selectedMaxSpeed: { value: "1", text: "Kbps" }, selectedCIRSpeed: { value: "1", text: "Kbps" } }; } } }); /***/ }), /* 509 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], pack: { name: "" }, roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.items = this.$global.getPackageTypes(); }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_package_type) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_package_type) { this.$bvModal.show("modalEdit"); this.pack.id = item.id; this.pack.name = item.name; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.$http.post("api/PackageType", _this.pack).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.pack.name = ""; _this.$global.setPackageTypes(response.body); _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$http.put("api/PackageType/" + _this2.pack.id, _this2.pack).then(function (response) { _this2.items = response.body; _this2.$global.setPackageTypes(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_package_type) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.tblisBusy = true; _this3.$http.delete("api/PackageType/" + _this3.pack.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); _this3.$global.setPackageTypes(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this3.tblisBusy = false; } }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Package type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 510 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], business_type: { name: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.load_item(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load_item: function load_item() { var _this = this; this.$http.get("api/BusinessType").then(function (response) { _this.items = response.body; _this.totalRows = _this.items.length; }); }, load: function load() { this.$nextTick(function () { this.$root.$emit("clearNav"); setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_business_type) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_business_type) { this.$bvModal.show("modalEdit"); this.business_type = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { _this2.tblisBusy = true; _this2.business_type.user_id = _this2.user.id; _this2.business_type.user_name = _this2.user.name; _this2.$http.post("api/BusinessType", _this2.business_type).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.business_type.name = ""; _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; _this2.$bvModal.hide("modalAdd"); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true // }); // }); } }); }, btnUpdate: function btnUpdate() { var _this3 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.business_type.user_id = _this3.user.id; _this3.business_type.user_name = _this3.user.name; _this3.$http.put("api/BusinessType/" + _this3.business_type.id, _this3.business_type).then(function (response) { _this3.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this3.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this4 = this; if (this.roles.delete_business_type) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.items = []; _this4.tblisBusy = true; _this4.$http.delete("api/BusinessType/" + _this4.business_type.id).then(function (response) { _this4.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Business Type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 511 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "email", sortable: true }, { key: "quota", sortable: true }, { key: "status", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], sales: { user: { name: "" }, quota: 0 }, statuses: [{ name: "active" }, { name: "inactive" }], user: [], users: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.items = this.$global.getSales(); console.log(this.items); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.getUsers(); this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { getUsers: function getUsers() { this.$http.get("api/user").then(function (response) { this.users = response.body; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_sales) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_sales) { this.$bvModal.show("modalEdit"); this.sales = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.sales.user_id_log = _this.user.id; _this.sales.user_name_log = _this.user.name; _this.$http.post("api/Sales", _this.sales).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.sales.name = ""; _this.$global.setSales(response.body); _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); _this.tblisBusy = false; } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.sales.user_id_update = _this2.user.id; _this2.sales.user_name_update = _this2.user.name; _this2.$http.put("api/Sales/" + _this2.sales.id, _this2.sales).then(function (response) { _this2.items = response.body; _this2.$global.setSales(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_sales) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/Sales/" + _this3.sales.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); _this3.$global.setSales(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Sales", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 512 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_vue_modal_agent_report_vue__ = __webpack_require__(1184); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], agentReport: __WEBPACK_IMPORTED_MODULE_2__modal_vue_modal_agent_report_vue__["a" /* default */] }, data: function data() { return { tblisBusy: true, fields: [{ key: "sales_name", sortable: true }, { key: "name", sortable: true }, { key: "quota", sortable: true }, { key: "status", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], item: {}, statuses: [{ name: "active" }, { name: "inactive" }], sales: [], user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.sales = this.$global.getSales(); this.roles = this.$global.getRoles(); console.log(this.sales); this.user = this.$global.getUser(); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/sales_agent").then(function (response) { this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_sales) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_sales) { this.$bvModal.show("modalAdd"); this.item = item; this.item.state = "update"; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.item.user_id_log = _this.user.id; _this.item.user_name_log = _this.user.name; _this.$http.post("api/sales_agent", _this.item).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.item = {}; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); _this.tblisBusy = false; } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.item.user_id_update = _this2.user.id; _this2.item.user_name_update = _this2.user.name; _this2.$http.put("api/sales_agent/" + _this2.item.id, _this2.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_sales) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/sales_agent/" + _this3.item.id).then(function (response) { _this3.$bvModal.hide("modalAdd"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a sales agent", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 513 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a }, data: function data() { return { tblisBusy: false, fields: [{ key: "sales_agent.name", label: "Agent Name", sortable: true }, { key: "name", label: "Client Name", sortable: true }, { key: "date_activated", label: "Date Activated", formatter: function formatter(value, key, item) { if (item.date_activated != null) { var rawDate = new Date(item.date_activated); var date = rawDate.toDateString(); return date; } else { return " "; } }, sortable: true }, { key: "package.mrr", label: "MRR", sortable: true }], data: {}, items: [], tblFilter: "", selectedDate: null, roles: [], agents: [], selected_agent: 0, AppliedDateoptions: { format: "YYYY-MM", useCurrent: false }, selected: {}, formattedFirst: "", formattedSecond: "", agent: "", quota: 0, total_mrr: 0, no_clients: null, hit_rate: null, bonus: 0, first: 0, second: 0, third: 0, secondDec: 0, thirdDec: 0, firstNov: 0, secondNov: 0, total: 0 }; }, created: function created() { this.roles = this.$global.getRoles(); this.getAgents(); var temp = { id: 0, name: "All Agents" }; this.agents.unshift(temp); }, methods: { getAgents: function getAgents() { this.$http.get("api/sales_agent").then(function (response) { this.agents = response.body; }); }, select_agent_change: function select_agent_change() { if (this.selectedDate != null && this.selected_agent != null) { var rawDate = new Date(this.selectedDate); var date = rawDate.toDateString(); var month = rawDate.toLocaleString("default", { month: "long" }); // var year = rawDate.getFullYear(); this.formattedFirst = month.toUpperCase(); this.callList(); } }, callList: function callList() { var _this = this; console.log(this.selectedDate); this.tblisBusy = true; this.selected.date = this.selectedDate; this.selected.agent = this.selected_agent; this.$http.post("api/agent_report", this.selected).then(function (response) { var formatter = new Intl.NumberFormat("en-US"); console.log(response.body); _this.items = response.body.data; _this.quota = formatter.format(response.body.quota); _this.total_mrr = formatter.format(response.body.total_mrr); _this.no_clients = response.body.total_clients; _this.hit_rate = response.body.hit_rate; _this.first = formatter.format(response.body.first); _this.second = formatter.format(response.body.second); _this.third = formatter.format(response.body.third); _this.secondDec = formatter.format(response.body.secondDec); _this.thirdDec = formatter.format(response.body.thirdDec); _this.firstNov = formatter.format(response.body.firstNov); _this.secondNov = formatter.format(response.body.secondNov); _this.bonus = formatter.format(response.body.bonus); _this.total = formatter.format(response.body.total); _this.tblisBusy = false; }); } } }); /***/ }), /* 514 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__ = __webpack_require__(102); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modal_vue_modal_inst_filter_vue__ = __webpack_require__(1192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__modal_vue_scheduler_closure_marker_vue__ = __webpack_require__(1198); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__modal_vue_client_modals_vue__ = __webpack_require__(101); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__modal_vue_modal_fsr_vue__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_saf_vue__ = __webpack_require__(1205); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { scheduler_closure_marker: __WEBPACK_IMPORTED_MODULE_7__modal_vue_scheduler_closure_marker_vue__["a" /* default */], "date-picker": __WEBPACK_IMPORTED_MODULE_4_vue_bootstrap_datetimepicker___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], modal_inst_filter: __WEBPACK_IMPORTED_MODULE_6__modal_vue_modal_inst_filter_vue__["a" /* default */], "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, client_modals: __WEBPACK_IMPORTED_MODULE_8__modal_vue_client_modals_vue__["a" /* default */], modal_fsr: __WEBPACK_IMPORTED_MODULE_9__modal_vue_modal_fsr_vue__["a" /* default */], modal_saf: __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_saf_vue__["a" /* default */] }, data: function data() { var _ref; return _ref = { cModalData: { field: 0, items: [] }, packages: [], editClient: {}, user: [], teams: [], doneLoad: true, tblisBusy: false, sortBy: "", sortDesc: "", fields: [], items: [], items_copy: [], buckets: [], tblFilter: null, tblFilter_copy: null, totalRows: 1, currentPage: 1, perPage: 50, pageOptions: [6, 10, 20, 50, 100], client_details: { id_update: "", client_id: "", otc: "", contract: "", mapping_status: true, cable_category: "", foc_length: "", pole_no: "", contractor_id: "", foc_layout: { id: "Pending", name: "Pending" }, foc_schedule: "", layout_remarks: "", modem_status: false, applied_date: "", inst_remarks: "", inst_remarks_temp: "", target_date: "", status: "", layout_status: "", aging: null, client: { name: "", location: "", contact: "" } }, clientSelected: { id: "", region_id: "" }, client_update_target_date: { client: {}, contractor_name: "", date_only: false, team_only: false, client_detail_id: "", target_date: "", region_id: "", team_id: "", type: "installation", name: "" }, client_update_activated_date_chkdate: false, client_update_activated_date: { client: {}, client_id: "", activated_date: "", name: "" }, bucket_selected: { id: "", name: "" }, clients: [], sales: [], engineers: [], regions: [], focLayoutOption: [{ id: "Completed", name: "Completed" }, { id: "Outdoor layout done", name: "Outdoor layout done" }, { id: "Indoor layout done", name: "Indoor layout done" }, { id: "With Client Issue", name: "With Client Issue" }, { id: "Pending", name: "Pending" }, { id: "Cancelled", name: "Cancelled" }], contractors: [], layoutStatOption: [{ id: "M1", name: "M1" }, { id: "M2", name: "M2" }, { id: "MM2", name: "MM2" }, { id: "M3", name: "M3" }], otcOption: [{ id: "Paid", name: "Paid" }, { id: "Promo", name: "Promo" }, { id: "Billing", name: "Billing" }, { id: "Waived", name: "Waived" }, { id: "NTP", name: "NTP" }, { id: "Waiting for C&C advisory", name: "Waiting for C&C advisory" }], cableCategoryOption: [{ id: "Drop Fiber", name: "Drop Fiber" }, { id: "Hard Fiber", name: "Hard Fiber" }, { id: "UTP", name: "Unshielded twisted pair (UTP)" }], AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, datenow: new Date(), dateTomorrow: new Date(), dateYesterday: new Date(), daypass: 0, roles: [], colLocation: false, colPackage: false, colRegion: false, colModem: false, colProtocol: false, colCableCat: false, colFOCLength: false, colSales: false, colTech: false, job_order: { id: null, jo_num: null, client_id: null, name: "", cable_category: "", foc_length: "", region_id: null, region_id1: null, project_description: "Installation", started: null, engineer_in_charge: "", prepare: 3, approve: 2, note: 1 }, View_Job_Order_Id_selected: "", View_Job_Order_Id: "", View_Job_Order_Id_region: "", View_Job_Order: {}, View_Job_Order_All: { client: { name: "" }, job_order: { client_id: null, region: { id: "", name: "" }, region_id: null, project_description: null, started: null, engineer_in_charge: "", prepare: null, approve: null, note: null, finished: null, copy_finished: "" } }, otp: "", otp_input: "", instFormType: "0", totalWFC: 0, totalWCI: 0, totalNeedAssign: 0, total_no_foc_layout_sched: 0, reloader_counter: 0, reloader_interval: [], searchby_list: [{ name: "Account Name", id: "clients.name" }, { name: "Address", id: "clients.location" }, { name: "Contact", id: "clients.contact" }, { name: "ID", id: "client_details.id" }], searchby: "clients.name", closures: [], coordinates: { lat: 0, lng: 0 }, markers: [{ position: { lat: 0, lng: 0 } }], markers_edit: [], remarksText: "", commentsText: [], cbFilter: null }, _defineProperty(_ref, "cbFilter", { data: {} }), _defineProperty(_ref, "filterIn", null), _defineProperty(_ref, "showTable", false), _defineProperty(_ref, "pendingTrend", 0), _defineProperty(_ref, "activatedTrend", 0), _defineProperty(_ref, "window_position", { lat: 0, lng: 0 }), _defineProperty(_ref, "window_details", { name: "", type: "", closure_type_id: 0 }), _defineProperty(_ref, "marker", { position: { lat: 7.0688182, lng: 125.59859859999999 }, client: "" }), _defineProperty(_ref, "fsr_data", { user: { email: "" } }), _defineProperty(_ref, "saf_data", { user: { email: "" } }), _defineProperty(_ref, "email_switch_local", false), _defineProperty(_ref, "ssh_switch_local", true), _defineProperty(_ref, "clientOptions", []), _defineProperty(_ref, "doSearch", false), _defineProperty(_ref, "search_loading", false), _defineProperty(_ref, "currentItem", 0), _ref; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { var _this = this; this.user = this.$global.getUser(); console.log("mao na"); console.log(this.user); this.dateTomorrow.setDate(this.dateTomorrow.getDate() + 1); this.dateTomorrow = this.formatDate(this.dateTomorrow); this.dateYesterday.setDate(this.dateYesterday.getDate() - 1); this.dateYesterday = this.formatDate(this.dateYesterday); this.datenow = this.formatDate(this.datenow); this.sales = this.$global.getSales(); this.engineers = this.$global.getEngineer(); this.roles = this.$global.getRoles(); this.teams = this.$global.getTeam(); this.regions = this.$global.getRegion(); this.changeColDisplay(""); this.loadClients(); this.$getLocation({}).then(function (coordinates) { _this.coordinates = coordinates; }).catch(function (error) { var coor = { lat: 7.040641, lng: 125.577053 }; _this.coordinates = coor; }); }, mounted: function mounted() { var _this2 = this; this.load(); this.getCountNoti(); this.$root.$on("update_item", function (item, filt) { _this2.showTable = true; _this2.items = item; _this2.cbFilter = filt; _this2.filterIn = "multi"; if (_this2.items != null) _this2.totalRows = item.length; }); }, updated: function updated() {}, computed: { nearClosure: function nearClosure() { var _this3 = this; if (this.markers_edit.length > 0) { var retVal = []; this.closures.forEach(function (item) { var latMax = _this3.markers_edit[0].position.lat + 0.005; var latMin = _this3.markers_edit[0].position.lat - 0.005; var lngMax = _this3.markers_edit[0].position.lng + 0.005; var lngMin = _this3.markers_edit[0].position.lng - 0.005; if (item.position.lat > latMin && item.position.lat < latMax && item.position.lng > lngMin && item.position.lng < lngMax) { item.position = { lat: parseFloat(item.lat), lng: parseFloat(item.lng) }; item.marker_type = "closure"; retVal.push(item); } }); return retVal; } else return []; } }, methods: { load: function load() { var _this4 = this; if (this.$email_activation_switch == "enabled") { this.email_switch_local = true; } else { this.email_switch_local = false; } if (this.$ssh_switch == "enabled") { this.ssh_switch_local = true; } else { this.ssh_switch_local = true; } var def_user_email = { email: this.user.email + this.user.subdomain, name: this.user.name }; this.$mail_copy_on_activation.push(def_user_email); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarCalendar").style.backgroundColor = ""; document.getElementById("navbarTicket").style.backgroundColor = ""; document.getElementById("navbarMap").style.backgroundColor = ""; document.getElementById("navbarInstallation").style.backgroundColor = "#2196f3"; document.getElementById("navbarComponents").style.backgroundColor = ""; document.getElementById("navbarAccounts").style.backgroundColor = ""; }, 100); }); this.$http.get("api/Bucket").then(function (response) { _this4.buckets = response.body; }); this.$http.post("api/clientDetail/getTrend/" + this.user.region_id).then(function (response) { console.log(response.body); _this4.pendingTrend = response.body.pendingTrend; _this4.activatedTrend = response.body.activatedTrend; }); this.$http.get("api/Contractor").then(function (response) { this.contractors = response.body; }); this.reload_data(); }, reload_data: function reload_data() { var _this5 = this; this.showTable = true; if (this.tblisBusy == false) { this.tblisBusy = true; this.reloader_counter = 0; this.$http.get("api/Engineer").then(function (response) { this.$global.setEngineer(response.body); this.engineers = response.body; this.reloader_counter++; }); this.$http.get("api/Region").then(function (response) { this.$global.setRegion(response.body); this.regions = response.body; this.reloader_counter++; }); this.$http.get("api/team").then(function (response) { this.$global.setTeam(response.body); this.teams = response.body; this.reloader_counter++; }); this.$http.get("api/clientDetail/subIndex/" + this.user.region_id).then(function (response) { console.log(response.body); this.items = response.body; this.totalRows = this.items.length; this.items_copy = this.items; this.reloader_counter++; }); this.$http.post("api/clientDetail/getTrend/" + this.user.region_id).then(function (response) { console.log(response.body); _this5.pendingTrend = response.body.pendingTrend; _this5.activatedTrend = response.body.activatedTrend; }); this.reloader_interval = setInterval(this.reloader_breaker, 100); } }, reloader_breaker: function reloader_breaker() { if (this.reloader_counter == 4) { this.tblisBusy = false; clearInterval(this.reloader_interval); } }, loadClients: function loadClients() { var _this6 = this; this.$http.get("api/getClients/" + this.user.region_id).then(function (response) { this.clients = response.body; }); this.$http.get("api/Closure").then(function (response) { _this6.closures = response.body; }); }, getClientDesc: function getClientDesc(client) { if (this.instFormType == "transfer") return client.name + " - " + client.region_name + " - Line Transfer";else return client.name + " - " + client.region_name; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else return "elClr cursorPointer"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { this.markers_edit = []; this.remarksText = ""; console.log(item); //+0.005 this.client_details = item; this.client_details.region_id = this.user.region_id; this.client_details.foc_sched_copy = item.foc_schedule; if (item.inst_remarks == null) this.client_details.inst_remarks = ""; this.client_details.inst_remarks_temp = ""; if (item.client.lat != null && item.client.lng != null) { var coor = { position: { lat: parseFloat(item.client.lat), lng: parseFloat(item.client.lng) } }; this.coordinates = coor.position; this.markers_edit.push(coor); this.client_details.lat = item.client.lat; this.client_details.lng = item.client.lng; } this.$bvModal.show("modalEdit"); //gmapclient // const cityCircle = new google.maps.Circle({ // strokeColor: "#FF0000", // strokeOpacity: 0.8, // strokeWeight: 2, // fillColor: "#FF0000", // fillOpacity: 0.35, // gmapclient, // center: this.markers_edit.position, // radius: 300 // }); }, //thead-class tblHeadClicked: function tblHeadClicked(key, field, event) { if (key == "status1.target_date") { this.sortDesc = !this.sortDesc; this.sortBy = "targetDateSort"; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, OpenModalAdd: function OpenModalAdd() { this.client_details = { client_id: "", otc: "", mapping_status: true, cable_category: "", foc_length: "", contractor_id: "", foc_layout: "", modem_status: false, applied_date: "", target_date: "", status: "", layout_status: "", aging: null, client: { name: "", location: "", contact: "" } }; this.$bvModal.show("modalAdd"); }, btnCreate: function btnCreate() { var _this7 = this; this.$validator.validateAll().then(function (result) { if (result) { _this7.$root.$emit("pageLoading"); _this7.tblisBusy = true; // if ( // this.client_details.otc == "Paid" || // this.client_details.otc == "Promo" || // this.client_details.otc == "Billing" || // this.client_details.otc == "Waived" || // this.client_details.otc == "NTP" // ) { // this.client_details.aging = this.formatDate(new Date()); // } //this.client_details.region_id = this.user.region_id; _this7.client_details.user_id = _this7.user.id; _this7.client_details.user_name = _this7.user.name; _this7.client_details.line_transfer = _this7.instFormType; _this7.$http.post("api/ClientDetail", _this7.client_details).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this7.client_details.client_id = ""; _this7.client_details.otc = ""; _this7.client_details.mapping_status = true; _this7.client_details.cable_category = ""; _this7.client_details.foc_length = ""; _this7.client_details.contractor_id = ""; _this7.client_details.foc_layout = ""; _this7.client_details.modem_status = false; _this7.client_details.applied_date = ""; _this7.client_details.inst_remarks = ""; _this7.client_details.inst_remarks_temp = ""; _this7.client_details.layout_status = ""; _this7.client_details.aging = null; _this7.items = response.body; _this7.totalRows = _this7.items.length; _this7.$root.$emit("pageLoaded"); _this7.tblisBusy = false; _this7.getCountNoti(); _this7.$bvModal.hide("modalAdd"); }).catch(function (response) { _this7.tblisBusy = false; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnUpdate: function btnUpdate() { var _this8 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this8.$root.$emit("pageLoading"); if (_this8.client_details.inst_remarks_temp != "") { if (_this8.client_details.inst_remarks != "") _this8.client_details.inst_remarks += ",\n"; _this8.client_details.inst_remarks += "-Remarks: " + _this8.client_details.inst_remarks_temp; } _this8.client_details.user_id = _this8.user.id; _this8.client_details.user_name = _this8.user.name; _this8.client_details.filterIn = _this8.filterIn; _this8.client_details.cbFilter = _this8.cbFilter; _this8.client_details.searchby = _this8.searchby; _this8.client_details.tblFilter = _this8.tblFilter_copy; _this8.$http.put("api/ClientDetail/" + _this8.client_details.id, _this8.client_details).then(function (response) { _this8.items = response.body; // this.filterIn = null; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this8.$bvModal.hide("modalEdit"); _this8.getCountNoti(); _this8.$root.$emit("pageLoaded"); }); } }); } }); }, btnDelete: function btnDelete() { var _this9 = this; if (this.roles.delete_client_details) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this9.tblisBusy = true; _this9.$root.$emit("pageLoading"); var data = { id: _this9.client_details.id, region_id: _this9.user.region_id, user_id: _this9.user.id, user_name: _this9.user.name, filterIn: _this9.filterIn, cbFilter: _this9.cbFilter, searchby: _this9.searchby, tblFilter: _this9.tblFilter_copy }; _this9.$http.post("api/clientDetail/destroy1", data).then(function (response) { console.log(response.body); _this9.$bvModal.hide("modalEdit"); _this9.items = response.body; _this9.totalRows = _this9.items.length; _this9.tblisBusy = false; _this9.$root.$emit("pageLoaded"); _this9.getCountNoti(); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { _this9.tblisBusy = false; _this9.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Schedule", icon: "warning", buttons: true, dangerMode: true }); } }, wfcClicked: function wfcClicked(item, index, button) { var _this10 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "", text: "Confirmed for schedule?", icon: "info", buttons: ["No", "Yes"] }).then(function (yes) { if (yes) { _this10.tblisBusy = true; item.user_id = _this10.user.id; item.user_name = _this10.user.name; item.user_region_id = _this10.user.region_id; _this10.$http.put("api/clientDetail/clientConfirm/" + item.id, item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Confirmed", "", "success").then(function (value) { _this10.items = response.body; _this10.totalRows = _this10.items.length; _this10.tblisBusy = false; _this10.getCountNoti(); }); }).catch(function (response) { _this10.tblisBusy = false; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, updateDateClicked: function updateDateClicked(bvModalEvt) { var _this11 = this; bvModalEvt.preventDefault(); this.$validator.validateAll().then(function (result) { if (result) { if (_this11.client_update_target_date.target_date != "" || _this11.client_update_target_date.team_only != "") { // if ( // this.formatDate(this.client_update_target_date.target_date) >= // this.datenow // ) if (_this11.client_update_target_date.team_id != "" || _this11.client_update_target_date.date_only == true) { if (_this11.client_update_target_date.inst_remarks_temp != "") { if (_this11.client_update_target_date.inst_remarks != "") _this11.client_update_target_date.inst_remarks += ",\n"; _this11.client_update_target_date.inst_remarks += "-Change schedule remarks: " + _this11.client_update_target_date.inst_remarks_temp; } _this11.updateTargetDate(); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ops.", "Please select team", "warning"); // else // swal("Ops.", "Please select present or future dates only", "warning"); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ops.", "Please select date first", "warning"); } }); }, updateTargetDate: function updateTargetDate() { var _this12 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"] }).then(function (yes) { if (yes) { _this12.tblisBusy = true; _this12.$root.$emit("pageLoading"); _this12.client_update_target_date.user_id = _this12.user.id; _this12.client_update_target_date.user_name = _this12.user.name; _this12.client_update_target_date.filterIn = _this12.filterIn; _this12.client_update_target_date.cbFilter = _this12.cbFilter; _this12.client_update_target_date.searchby = _this12.searchby; _this12.client_update_target_date.tblFilter = _this12.tblFilter_copy; _this12.$http.post("api/clientDetail/updateTargetDate", _this12.client_update_target_date).then(function (response) { console.log(response); _this12.$bvModal.hide("modal-update-target-date"); _this12.tblisBusy = false; // this.filterIn = null; _this12.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success").then(function (value) { _this12.items = response.body; _this12.totalRows = _this12.items.length; _this12.getCountNoti(); }); }).catch(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this12.tblisBusy = false; _this12.$root.$emit("pageLoaded"); }); } }); }, updateActivatedDateClicked: function updateActivatedDateClicked(bvModalEvt) { var _this13 = this; bvModalEvt.preventDefault(); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"] }).then(function (yes) { if (yes) { _this13.$root.$emit("pageLoading"); if (_this13.client_update_activated_date.inst_remarks_temp != "") { if (_this13.client_update_activated_date.inst_remarks != "") _this13.client_update_activated_date.inst_remarks += ",\n"; _this13.client_update_activated_date.inst_remarks += "-Activate Remarks: " + _this13.client_update_activated_date.inst_remarks_temp; } _this13.tblisBusy = true; _this13.client_update_activated_date.bucket = _this13.bucket_selected; _this13.client_update_activated_date.user_id = _this13.user.id; _this13.client_update_activated_date.user_email = _this13.user.email; _this13.client_update_activated_date.user_name = _this13.user.name; _this13.client_update_activated_date.otp_input = _this13.otp_input; _this13.client_update_activated_date.filterIn = _this13.filterIn; _this13.client_update_activated_date.cbFilter = _this13.cbFilter; _this13.client_update_activated_date.searchby = _this13.searchby; _this13.client_update_activated_date.tblFilter = _this13.tblFilter_copy; _this13.client_update_activated_date.sendTo = _this13.$mail_recipient_on_activation; _this13.client_update_activated_date.CCTO = _this13.$mail_copy_on_activation; _this13.client_update_activated_date.email_switch = _this13.email_switch_local; _this13.client_update_activated_date.ssh_switch = _this13.ssh_switch_local; _this13.$http.post("api/clientDetail/activationChecker", _this13.client_update_activated_date).then(function (response) { console.log(response.body); _this13.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Activated!", "", "success"); _this13.items = response.body; _this13.totalRows = _this13.items.length; _this13.tblisBusy = false; _this13.$bvModal.hide("modal-update-activated-date"); _this13.getCountNoti(); }).catch(function (response) { _this13.tblisBusy = false; _this13.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); // } else swal("Wrong! activation code", "", "warning"); }, openModalUpdateTargetDate: function openModalUpdateTargetDate(item) { // console.log(item); this.client_update_target_date.item = item; if (item.contractor != null) this.client_update_target_date.contractor_name = item.contractor.name;else this.client_update_target_date.contractor_name = ""; this.client_update_target_date.current_target_date = null; this.client_update_target_date.date_only = false; this.client_update_target_date.team_only = false; this.client_update_target_date.current_target_date = item.target_date; this.client_update_target_date.target_date = ""; this.client_update_target_date.team_id = ""; this.client_update_target_date.client_detail_id = item.id; this.client_update_target_date.region_id = this.user.region_id; this.client_update_target_date.name = item.client.name; if (item.inst_remarks == null) this.client_update_target_date.inst_remarks = "";else this.client_update_target_date.inst_remarks = item.inst_remarks; this.client_update_target_date.inst_remarks_temp = ""; this.$bvModal.show("modal-update-target-date"); console.log(this.client_update_target_date); }, openModalUpdateActivatedDate: function openModalUpdateActivatedDate(item) { //this.otp = this.generateOTP(); this.client_update_activated_date = item; this.client_update_activated_date.activated_date = ""; if (item.inst_remarks == null) this.client_update_activated_date.inst_remarks = ""; this.client_update_activated_date.inst_remarks_temp = ""; this.client_update_activated_date.name = item.client.name; this.client_update_activated_date.email = item.email_add; if (this.client_update_activated_date.client.bucket != null) this.bucket_selected = this.client_update_activated_date.client.bucket; this.client_update_activated_date.subscription_name = this.client_update_activated_date.client.subscription_name; console.log(this.client_update_activated_date); this.$bvModal.show("modal-update-activated-date"); }, openModalViewJobOrder: function openModalViewJobOrder(item) { this.View_Job_Order_Id_selected = item.job_order.jo_num; this.View_Job_Order_Id = item.job_order.id; this.$bvModal.show("modal-view-job-order"); console.log(item); this.View_Job_Order_All = item; if (item.job_order.contractor_id == null) { if (item.contractor != null) { this.View_Job_Order_All.job_order.contractor_id = item.contractor_id; this.View_Job_Order_All.contractor_name = item.contractor.name; } else this.View_Job_Order_All.contractor_name = ""; } else { this.View_Job_Order_All.contractor_name = item.job_order.contractor.name; this.View_Job_Order_All.job_order.contractor_id = item.job_order.contractor_id; } this.View_Job_Order_All.copy_finished = item.job_order.finished; //console.log(this.View_Job_Order_All.job_order); this.doneLoad = true; }, formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, btnDeleteJO: function btnDeleteJO() { var _this14 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this14.items = []; _this14.tblisBusy = true; var data = { id: _this14.View_Job_Order_Id, region_id: _this14.user.region_id, user_id: _this14.user.id, user_name: _this14.user.name }; _this14.$http.post("api/clientDetail/destroyJobOrder", data).then(function (response) { _this14.$bvModal.hide("modal-view-job-order"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this14.items = response.body; _this14.totalRows = _this14.items.length; _this14.tblisBusy = false; }); }).catch(function (response) { _this14.tblisBusy = false; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnUpdateJO: function btnUpdateJO() { var _this15 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"] }).then(function (yes) { if (yes) { _this15.View_Job_Order_All.update_in = "schedule"; _this15.$http.put("api/JobOrder/" + _this15.View_Job_Order_Id, _this15.View_Job_Order_All.job_order).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this15.$bvModal.hide("modal-view-job-order"); }); } }); }, changeColDisplay: function changeColDisplay(check) { this.fields = [ //number joborder { key: "job_order.jo_num", label: "Job #", sortable: true }, { key: "status1.target_date", label: "Installation Date" }, { key: "account_details", label: "Account Details", thClass: "acc-details" // formatter: (value, key, item) => { // if (item.line_transfer) // return item.client.name + " - Line Transfer"; // else return item.client.name; // }, }, { key: "client.branch.name", label: "Branch", sortable: true }, { key: "contractor.name", label: "Contractor", sortable: true }, { key: "foc_layout", label: "Contractor Status", sortable: true // { // key: "layout_remarks", // label: "Layout Remarks", // sortable: true, // }, // { // key: "client.lat", // label: "Coordinates", // sortable: true, // formatter: (value, key, item) => { // if (item.client.lat != null && item.client.lng != null) // return item.client.lat + " ," + item.client.lng; // }, // }, }]; this.fields.push(temp); if ("colLocation" == check) { this.colLocation = !this.colLocation; } if (this.colLocation) { var temp = { key: "client.location", label: "Location", sortable: true }; this.fields.push(temp); } if ("colPackage" == check) { this.colPackage = !this.colPackage; } if (this.colPackage) { var temp = { key: "client.package.name", label: "Package", sortable: true }; this.fields.push(temp); } if ("colRegion" == check) { this.colRegion = !this.colRegion; } if (this.colRegion) { var temp = { key: "client.brach.area.region.name", label: "Region", sortable: true }; this.fields.push(temp); } if ("colModem" == check) { this.colModem = !this.colModem; } if ("colProtocol" == check) { this.colProtocol = !this.colProtocol; } if (this.colProtocol) { var temp = { key: "client.communication_protocol", label: "Protocol", sortable: true }; this.fields.push(temp); } if ("colFOCLength" == check) { this.colFOCLength = !this.colFOCLength; } if (this.colFOCLength) { var temp = { key: "foc_length", label: "Length", sortable: true }; this.fields.push(temp); } if ("colSales" == check) { this.colSales = !this.colSales; } if (this.colSales) { var temp = { key: "client.sales.user.name", label: "Sales", sortable: true }; this.fields.push(temp); } if ("colTech" == check) { this.colTech = !this.colTech; } if (this.colTech) { var temp = { key: "client.engineer.user.name", label: "Tech Sales", sortable: true }; this.fields.push(temp); } extra = { key: "client.contract", label: "Contract", // formatter: (value) => { // if (check == "export") { // if (value != null) return "O"; // else return "X"; // } else { // if (value != null) return ''; // else return ''; // } // }, sortable: true }; this.fields.push(extra); var extra = { key: "modem_status", label: "Modem Status", formatter: function formatter(value, key) { if (value == 1) return "Verified";else return "No Modem"; } }; this.fields.push(extra); var extra = { key: "aging", label: "OTC", sortable: true }; this.fields.push(extra); if ("colCableCat" == check) { this.colCableCat = !this.colCableCat; } if (this.colCableCat) { var temp = { key: "cable_category", label: "FOC.", sortable: true }; this.fields.push(temp); } // extra = { key: "foc_schedule", label: "FOC Schedule", sortable: true }; // this.fields.push(extra); // extra = { key: "foc_layout", label: "Contractor stat.", sortable: true }; // extra = { key: "layout_status", label: "layout stat.", sortable: true }; // this.fields.push(extra); // extra = { // key: "modem_status", // label: "Modem", // formatter: value => { // if (check == "export") { // if (value == 1) return "O"; // else return "X"; // } else { // if (value == 1) return ''; // else return ''; // } // }, // sortable: true // }; // this.fields.push(extra); extra = { key: "agingCount", label: "Aging", sortable: true }; this.fields.push(extra); // if (this.roles.admin) { // var temp = { // key: "foc_duration", // label: "FOC Planning Duration", // sortable: true, // }; // this.fields.push(temp); // } //extra = { key: "foc_check_red", label: "foc_check_red", sortable: true }; //this.fields.push(extra); extra = { key: "created_at", sortable: true }; this.fields.push(extra); extra = { key: "date_activated", label: "Action", sortable: true }; this.fields.push(extra); if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, printPreview: function printPreview() { console.log(this.View_Job_Order_All); if (this.View_Job_Order_All.client.branch != null) { var newWin = window.open(""); var linetransfer = " - Line Transfer"; if (this.View_Job_Order_All.line_transfer == 1) linetransfer = " - Line Transfer";else linetransfer = ""; newWin.document.write(""); newWin.document.write('"); newWin.document.write(""); newWin.document.write("
" + '
' + '
' + // first col '
' + "" + this.$header_name + "" + "
" + this.$header_address + "
" + this.$header_contact + "
" + "
" + "
" + '
' + "SERVICE ORDER FORM" + "
" + "
" + '
' + //row1 '
' + "Project Description: " + this.View_Job_Order_All.job_order.project_description + "" + "
" + '
' + "Control #: " + this.View_Job_Order_Id_selected + "" + "
" + "
" + //end row1 "
" + '
' + "CLIENT INFORMATION" + "
" + "
" + // '
' + //row2 '
' + "Account Name:" + "
" + '
' + this.View_Job_Order_All.client.name + linetransfer + "," + this.View_Job_Order_All.client.contact + "
" + "
" + //end row2 // '
' + //row2 '
' + "Account No.:" + "
" + '
' + this.View_Job_Order_All.client.acc_no + "
" + "
" + //end row2 // '
' + //row2 '
' + "Address:" + "
" + '
' + this.View_Job_Order_All.client.location + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Started:" + "
" + '
' + this.View_Job_Order_All.job_order_started + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Finished:" + "
" + '
' + this.View_Job_Order_All.job_order_finished + "
" + "
" + //end row2 // "
" + '
' + "SERVICE REPORT" + "
" + "
" + //SERVICE REPORT ----- SERVICE REPORT ----- SERVICE REPORT----- SERVICE REPORT '
' + //row2 '
' + "Dctech Area:" + "
" + '
' + this.View_Job_Order_All.client.branch.area.name + "
" + "
" + //end row2 // '
' + //row2 '
' + "Cable Category:" + "
" + '
' + this.View_Job_Order_All.job_order.cable_category + "
" + "
" + //end row2 // '
' + //row2 '
' + "Estimated Distance(m):" + "
" + '
' + this.View_Job_Order_All.job_order.foc_length + "
" + "
" + //end row2 // '
' + //row2 '
' + "Actual Distance(m):" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Rx Power:" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Mac:" + "
" + '
' + (this.View_Job_Order_All.client.stock_modem != null ? this.View_Job_Order_All.client.stock_modem.mac : "") + "
" + "
" + //end row2 // '
' + //row2 '
' + "Serial:" + "
" + '
' + (this.View_Job_Order_All.client.stock_modem != null ? this.View_Job_Order_All.client.stock_modem.serial : "") + "
" + "
" + //end row2 // "
" + '
' + "
" + "
" + "
" + //Engineer In-Charge: '
' + //row2 '
' + "Engineer In-Charge:" + "
" + '
' + this.View_Job_Order_All.job_order.engineer.user.name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + "
" + //Contractor/Lineman: '
' + //row2 '
' + "Contractor/Lineman:" + "
" + '
' + this.View_Job_Order_All.contractor_name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + '
' + //row1 '
' + "Prepared by:" + "
" + '
' + "Approved by:" + "
" + "
" + //end row1 // "
" + '
' + //row1 '
' + '' + this.View_Job_Order_All.job_order.prepare_engineer.name + "" + "
" + '
' + '' + this.View_Job_Order_All.job_order.approve_engineer.name + "" + "
" + "
" + //end row1 // '
' + //row1 '
' + this.View_Job_Order_All.job_order.prepare_engineer.position + "
" + '
' + this.View_Job_Order_All.job_order.approve_engineer.position + "
" + "
" + //end row1 // "
" + '
' + "Noted by:" + "
" + // // "
" + '
' + '' + this.View_Job_Order_All.job_order.note_engineer.name + "" + "
" + '
' + "" + this.View_Job_Order_All.job_order.note_engineer.position + "" + "
" + "
" + // end first col // // // // //second '
' + // second col '
' + "" + this.$header_name + "" + "
" + this.$header_address + "
" + this.$header_contact + "
" + "
" + "
" + '
' + "SERVICE ORDER FORM" + "
" + "
" + '
' + //row1 '
' + "Project Description: " + this.View_Job_Order_All.job_order.project_description + "" + "
" + '
' + "Control #: " + this.View_Job_Order_Id_selected + "" + "
" + "
" + //end row1 "
" + '
' + "CLIENT INFORMATION" + "
" + "
" + // '
' + //row2 '
' + "Account Name:" + "
" + '
' + this.View_Job_Order_All.client.name + linetransfer + "," + this.View_Job_Order_All.client.contact + "
" + "
" + //end row2 // '
' + //row2 '
' + "Account No.:" + "
" + '
' + this.View_Job_Order_All.client.acc_no + "
" + "
" + //end row2 // '
' + //row2 '
' + "Address:" + "
" + '
' + this.View_Job_Order_All.client.location + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Started:" + "
" + '
' + this.View_Job_Order_All.job_order_started + "
" + "
" + //end row2 // '
' + //row2 '
' + "Date Finished:" + "
" + '
' + this.View_Job_Order_All.job_order_finished + "
" + "
" + //end row2 // "
" + '
' + "SERVICE REPORT" + "
" + "
" + //SERVICE REPORT ----- SERVICE REPORT ----- SERVICE REPORT----- SERVICE REPORT '
' + //row2 '
' + "Dctech Area:" + "
" + '
' + this.View_Job_Order_All.client.branch.area.name + "
" + "
" + //end row2 // '
' + //row2 '
' + "Cable Category:" + "
" + '
' + this.View_Job_Order_All.job_order.cable_category + "
" + "
" + //end row2 // '
' + //row2 '
' + "Estimated Distance(m)" + "
" + '
' + this.View_Job_Order_All.job_order.foc_length + "
" + "
" + //end row2 // '
' + //row2 '
' + "Actual Distance(m)" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Rx Power:" + "
" + '
' + "" + "
" + "
" + //end row2 // '
' + //row2 '
' + "Mac:" + "
" + '
' + (this.View_Job_Order_All.client.stock_modem != null ? this.View_Job_Order_All.client.stock_modem.mac : "") + "
" + "
" + //end row2 // '
' + //row2 '
' + "Serial:" + "
" + '
' + (this.View_Job_Order_All.client.stock_modem != null ? this.View_Job_Order_All.client.stock_modem.serial : "") + "
" + "
" + //end row2 // "
" + '
' + "
" + "
" + "
" + //Engineer In-Charge: '
' + //row2 '
' + "Engineer In-Charge:" + "
" + '
' + this.View_Job_Order_All.job_order.engineer.user.name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + "
" + //Contractor/Lineman: '
' + //row2 '
' + "Contractor/Lineman:" + "
" + '
' + this.View_Job_Order_All.contractor_name + "
" + "
" + '
' + '
' + "" + "
" + '
' + "Signature over Printed Name" + "
" + "
" + //end row2 // "
" + '
' + //row1 '
' + "Prepared by:" + "
" + '
' + "Approved by:" + "
" + "
" + //end row1 // "
" + '
' + //row1 '
' + '' + this.View_Job_Order_All.job_order.prepare_engineer.name + "" + "
" + '
' + '' + this.View_Job_Order_All.job_order.approve_engineer.name + "" + "
" + "
" + //end row1 // '
' + //row1 '
' + this.View_Job_Order_All.job_order.prepare_engineer.position + "
" + '
' + this.View_Job_Order_All.job_order.approve_engineer.position + "
" + "
" + //end row1 // "
" + '
' + "Noted by:" + "
" + // // "
" + '
' + '' + this.View_Job_Order_All.job_order.note_engineer.name + "" + "
" + '
' + "" + this.View_Job_Order_All.job_order.note_engineer.position + "" + "
" + "
" + // end second col // "
" + "
"); newWin.document.write(""); newWin.alert("If the print preview doesn't " + "show please disable ad blocker or manually press the Ctrl+p. And don't forget to close this page"); newWin.print(); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Error", "This client has no branch, please update the branch of the client first.", "error"); } //newWin.close(); }, dateDiffInDays: function dateDiffInDays(a, b) { var dt1 = new Date(b); var dt2 = new Date(a); return Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate())) / (1000 * 60 * 60 * 24)); }, onChangeClientId: function onChangeClientId() { var _this16 = this; if (this.instFormType == "1") { this.client_details.client_id = this.clientSelected.id; this.client_details.region_id = this.user.region_id; } else { this.$http.get("api/client_has_sched/" + this.clientSelected.id).then(function (response) { if (response.body != 0) { if (response.body.status == "finished") __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()('"' + _this16.clientSelected.name + '" is already activated');else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()('"' + _this16.clientSelected.name + '" is already in the schedule list'); _this16.clientSelected = { id: "", region_id: "" }; } else { _this16.client_details.client_id = _this16.clientSelected.id; _this16.client_details.region_id = _this16.user.region_id; } }); } }, fnExcelReport: function fnExcelReport(tbl) { this.cModalData.field = 5; this.cModalData.items = this.items; this.$global.excelReportCSV("genTable1", "client installation", this); //this.excelReportCSV("genTable1", "client installation"); }, mousemove: function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } // console.log(scrol.scrollLeft); // console.log(e.clientX); // console.log(window.innerWidth); }, generateOTP: function generateOTP() { var string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var OTP = ""; var len = string.length; for (var i = 0; i < 6; i++) { OTP += string[Math.floor(Math.random() * len)]; } return OTP; }, sendOTP: function sendOTP(item) { var _this17 = this; this.otp = this.generateOTP(); var data = { otp: this.otp, id: item.id, email: item.email_add, client_name: item.name, contact: item.contact }; this.$root.$emit("pageLoading"); this.$http.post("api/send_mail_otp", data).then(function (response) { console.log(response.body); _this17.$root.$emit("pageLoaded"); if (response.body.error_string == null) __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Activation code sent", "", "success");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Text message Error: " + response.body.error_string, "", "error"); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: response.body, text: "", icon: "error", dangerMode: true }); }); }, filterChange: function filterChange(txt) { var _this18 = this; if (txt == "Filter: wci") { this.cbFilter.foc_layout_status = true; this.cbFilter.data.foc_layout = "With Client Issue"; console.log(this.cbFilter); this.$root.$emit("pageLoading"); this.$http.post("api/clientDetail/multipleFilter", this.cbFilter).then(function (response) { _this18.$root.$emit("pageLoaded"); _this18.showTable = true; _this18.items = response.body; _this18.totalRows = _this18.items.length; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this18.$root.$emit("pageLoaded"); }); } else { this.showTable = true; this.items = this.items_copy; this.totalRows = this.items.length; this.tblFilter = txt; } }, getCountNoti: function getCountNoti() { var _this19 = this; this.totalWFC = 0; this.totalWCI = 0; this.totalNeedAssign = 0; this.total_no_foc_layout_sched = 0; this.items.forEach(function (item) { if (item.status == null) _this19.totalWFC += 1; if (item.target_date == null && item.status != null) _this19.totalNeedAssign += 1; if (item.foc_plan_duration == null) _this19.total_no_foc_layout_sched += 1; }); }, clearFilter: function clearFilter() { this.tblFilter = ""; this.tblFilter_copy = ""; this.items = this.items_copy; this.totalRows = this.items.length; }, loadTable: function loadTable() { this.showTable = true; this.items = this.items_copy; this.totalRows = this.items.length; }, search_data: function search_data() { var _this20 = this; if (this.tblFilter_copy != "") { this.$root.$emit("pageLoading"); this.showTable = true; var escape_string = this.tblFilter_copy.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.$http.get("api/clientDetail/search_data/" + this.searchby + "/" + escape_string).then(function (response) { _this20.filterIn = "search"; _this20.items = response.body; _this20.totalRows = _this20.items.length; _this20.doSearch = false; _this20.$root.$emit("pageLoaded"); }).catch(function (response) { console.log(response); }); } }, addRemarks_clicked: function addRemarks_clicked() { var _this21 = this; if (this.remarksText != "") { var data = { ticket_id: this.client_details.id, user_id: this.user.id, remarks: this.remarksText, form_type: "installation", ticketType: "5" }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this21.remarksText = ""; _this21.client_details.remarks_log = response.body; console.log(response.body); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the remarks text area"); } }, addComments_clicked: function addComments_clicked(id, i, stor) { var _this22 = this; if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.client_details.id, ticketType: "5" }; this.$http.post("api/TicketCommentsLog", data).then(function (response) { // this.commentsText[i] = ""; // this.commentsText = ""; _this22.commentsText[i] = ""; _this22.client_details.remarks_log = response.body; _this22.$global.scrollComment(i, 2); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the comments text area"); } }, getBucketDesc: function getBucketDesc(bucket) { return bucket.name + " - " + bucket.IP; }, hideTable: function hideTable() { this.showTable = false; }, map_clicked: function map_clicked(event) { // var coor = { lat: event.latLng.lat(), lng: event.latLng.lng() }; console.log(coor); }, openWindow: function openWindow(event, marker, index, wit) { var _this23 = this; this.window_details = marker; this.$root.$emit("pageLoading"); this.$http.get("api/Closure/" + marker.id).then(function (response) { // console.log(response.body); _this23.window_details = response.body; _this23.window_details.client_id = _this23.client_details.client_id; _this23.window_details.client_name = _this23.client_details.client.name; console.log("openWindow function in closure"); _this23.$bvModal.show("scheduler_closure_marker"); _this23.$root.$emit("pageLoaded"); }); // this.$bvModal.show("scheduler_closure_marker"); // this.$root.$emit("pageLoaded"); }, openColumnSettings: function openColumnSettings() { this.$bvModal.show("modalColumnSettings"); }, dpchange_date: function dpchange_date() { var dt1 = new Date(); var dt2 = new Date(this.client_update_activated_date.activated_date); if (dt1.getTime() < dt2.getTime()) { this.client_update_activated_date_chkdate = true; } else { this.client_update_activated_date_chkdate = false; } }, btnFSR: function btnFSR() { this.fsr_data = { id: this.client_details.id, name: this.client_details.client.name, contact_person: this.client_details.client.contact_person, location: this.client_details.client.location, contact: this.client_details.client.contact, complaint: "FTTH INSTALLATION" }; this.$bvModal.show("modalFSRPrintPreview"); }, btnSAF: function btnSAF() { this.fsr_data = { id: this.client_details.id, name: this.client_details.client.name, contact_person: this.client_details.client.contact_person, location: this.client_details.client.location, contact: this.client_details.client.contact, complaint: "FTTH INSTALLATION" }; this.$bvModal.show("modalSAFPrintPreview"); }, search: function search(query) { console.log(query); this.doSearch = true; this.clientOptions = []; this.currentItem = 0; if (query != "" && query != "." && query != null) { var escape_string = query.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.search_loading = true; this.$http.get("api/clientDetail/search/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); this.clientOptions = response.body.items; if (response.body.count > 10) { this.clientOptions.push({ client_detail_id: "*** Show all " + response.body.count + " results...", contact: "*** Show all " + response.body.count + " results...", location: "*** Show all " + response.body.count + " results...", name: "*** Show all " + response.body.count + " results..." }); } this.search_loading = false; }); } else { this.doSearch = false; this.search_loading = false; this.clientOptions = []; } }, searchItem: function searchItem(item) { if (item.name.substring(0, 3) != "***") { if (this.searchby == "clients.name") this.tblFilter_copy = item.name;else if (this.searchby == "clients.location") this.tblFilter_copy = item.location;else if (this.searchby == "clients.contact") this.tblFilter_copy = item.contact;else if (this.searchby == "client_details.id") this.tblFilter_copy = item.client_detail_id; } else { if (this.searchby == "client_details.id") this.tblFilter_copy = "[" + this.searchby + "] - " + this.tblFilter_copy; } this.search_data(); }, searchSuggestions: function searchSuggestions(item) { if (this.searchby == "clients.name") return item.name;else if (this.searchby == "clients.location") return item.location;else if (this.searchby == "clients.contact") return item.contact;else if (this.searchby == "client_details.id") return item.client_detail_id.toString().substring(0, 3) != "***" ? item.client_detail_id + " - " + item.name : item.client_detail_id; }, nextItem: function nextItem(event) { if (event.keyCode == 38 && this.clientOptions.length > 1) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem > 0) { this.currentItem--; } } else if (event.keyCode == 40 && this.currentItem < this.clientOptions.length) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem < this.clientOptions.length - 1) { this.currentItem++; } } if (event.keyCode == 13 && this.clientOptions.length != 0) this.searchItem(this.clientOptions[this.currentItem]); }, undoActivation: function undoActivation(item) { var _this24 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Warning", text: "Undo Activation?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (value) { if (value) { var undoActivation = { client_id: item.client.id, account_no: item.client.account_no, bucket: item.client.bucket, filterIn: _this24.filterIn, cbFilter: _this24.cbFilter, searchby: _this24.searchby, tblFilter: _this24.tblFilter_copy, user_id: _this24.user.id }; _this24.tblisBusy = true; _this24.$root.$emit("pageLoading"); _this24.$http.post("api/clientDetail/undoActivation", undoActivation).then(function (response) { console.log(response); _this24.items = response.body; _this24.totalRows = _this24.items.length; _this24.tblisBusy = false; _this24.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Successful!", "", "success"); }).catch(function (error) { console.log(error); _this24.tblisBusy = false; _this24.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: error.body, icon: "danger" }); }); } }); } } }); /***/ }), /* 515 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_multiselect__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_4_vue_rangedate_picker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a, multiselect: __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default.a }, data: function data() { return { cbFilter: { region: false, area: false, address: false, package: false, sales: false, installation_date: false, foc_schedule: false, aging: false, contract: false, otc: false, layout_status: false, date_activated: false, date_activated_type: null, created: false, contractor: false, foc_layout_status: false, data: { region_id: 0, area_id: [], address: "", package_id: 0, sales_id: 0, contractor_id: 0, foc_layout: 0, installation_date: { from: null, to: null }, foc_schedule_date: null, aging: { from: null, to: null }, // contract: null, otc: null, layout_status: null, date_activated: { from: null, to: null }, created: { from: null, to: null }, contract: { from: null, to: null } } }, contract_list: [{ name: "Done", id: "Done" }, { name: "Undone", id: "Undone" }], otc_list: [{ name: "Paid", id: "Paid" }, { name: "Unpaid", id: "Unpaid" }], layoutStatOption: [{ id: "M1", name: "M1" }, { id: "M2", name: "M2" }, { id: "MM2", name: "MM2" }, { id: "M3", name: "M3" }], packages: [], regions: [], sales_list: [], contractor_list: [], focLayoutOption: [{ id: "Completed", name: "Completed" }, { id: "Outdoor layout done", name: "Outdoor layout done" }, { id: "Indoor layout done", name: "Indoor layout done" }, { id: "With Client Issue", name: "With Client Issue" }, { id: "Pending", name: "Pending" }, { id: "Cancelled", name: "Cancelled" }], areas: [], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.regions = this.$global.getRegion(); this.sales_list = this.$global.getSales(); this.load(); }, methods: { load: function load() { var _this = this; this.$http.get("api/area").then(function (response) { _this.areas = response.body; }); this.$http.get("api/Package").then(function (response) { this.packages = response.body; }); this.$http.get("api/Contractor").then(function (response) { this.contractor_list = response.body; }); }, filter_ok: function filter_ok() { var _this2 = this; this.$root.$emit("pageLoading"); this.$http.post("api/clientDetail/multipleFilter", this.cbFilter).then(function (response) { _this2.$root.$emit("pageLoaded"); console.log(response.body); _this2.$root.$emit("update_item", response.body, _this2.cbFilter); _this2.$bvModal.hide("modalMultipleFilter"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this2.$root.$emit("pageLoaded"); }); }, select_date_change: function select_date_change(txt, event) { if (txt == "from") { this.cbFilter.data.installation_date.from = this.formatDateMDY(event); } else if (txt == "to") { this.cbFilter.data.installation_date.to = this.formatDateMDY(event); } else if (txt == "foc_schedule") { this.cbFilter.data.foc_schedule_date = this.formatDateMDY(event); } else if (txt == "agingfrom") { this.cbFilter.data.aging.from = this.formatDateMDY(event); } else if (txt == "agingto") { this.cbFilter.data.aging.to = this.formatDateMDY(event); } else if (txt == "date_activated_from") { this.cbFilter.data.date_activated.from = this.formatDateMDY(event); } else if (txt == "date_activated_to") { this.cbFilter.data.date_activated.to = this.formatDateMDY(event); } else if (txt == "date_created_from") { this.cbFilter.data.created.from = this.formatDateMDY(event); } else if (txt == "date_created_to") { this.cbFilter.data.created.to = this.formatDateMDY(event); } else if (txt == "date_contract_from") { this.cbFilter.data.contract.from = this.formatDateMDY(event); } else if (txt == "date_contract_to") { this.cbFilter.data.contract.to = this.formatDateMDY(event); } }, formatDateMDY: function formatDateMDY(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; var mstring = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."]; return [mstring[month - 1], day, year].join(" "); }, checkAreas: function checkAreas() { var _this3 = this; this.$http.get("api/checkAreas/" + this.cbFilter.data.region_id).then(function (response) { console.log(response.body); _this3.cbFilter.data.area_id = response.body; _this3.cbFilter.area = true; }); } } }); /***/ }), /* 516 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_add_splitter_vue__ = __webpack_require__(517); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //import modal_splitter_port_list from "./modal_splitter_port_list.vue"; /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { modal_add_splitter: __WEBPACK_IMPORTED_MODULE_2__modal_add_splitter_vue__["a" /* default */], "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], splitters_field: [{ key: "splitter_type.name", label: "Splitter Type" }, { key: "port_type" }, { key: "status" }], splitters_field_nap: [{ key: "port_number", label: "Port#", sortable: true }, { key: "going", label: "Going To", sortable: true }, { key: "name", label: "Name", sortable: true }, { key: "los", label: "LOS", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "port_status", label: "Port", sortable: true }, { key: "action", label: "Action", sortable: true }], splitters_item: [], item: {}, splitters_tblisBusy: false, splitters_port_nap_tblisBusy: false, closure_types: [], latlng: "", user: [], roles: [], napTable: false, naps: [], port_clicked: "", los: 0, patch_type_selected: "" }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); this.splitters_item = this.data.splitter_closure; }, mounted: function mounted() { var _this = this; this.$root.$on("update_naps", function (naps) { _this.naps = naps; }); console.log(this.data); }, methods: { load: function load() { var _this2 = this; this.$http.get("api/ClosureType").then(function (response) { _this2.closure_types = response.body; }); }, splitters_tblRowClicked: function splitters_tblRowClicked(item, index, event) { var _this3 = this; console.log(item); if (item.splitter_type.name == "LCP") { this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.id).then(function (response) { console.log(response.body); console.log("function splitters_tblRowClicked in LCP"); _this3.item = response.body; _this3.item.item = item; _this3.item.splitters_field = [{ key: "port_number", label: "Port#", sortable: true }, { key: "los", label: "LOS", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "port_status", label: "Port", sortable: true }, { key: "action", label: "Action", sortable: true }]; _this3.$root.$emit("update_lcp", _this3.item); // this.$bvModal.show("modal_splitter_port_list"); _this3.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this3.$root.$emit("pageLoaded"); }); } if (item.splitter_type.name == "NAP") { this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.id).then(function (response) { console.log(response.body); console.log("function splitters_tblRowClicked in NAP"); _this3.item = response.body; _this3.item.item = item; _this3.$root.$emit("update_naps", _this3.item); // this.$bvModal.show("modal_splitter_port_list_nap"); _this3.$root.$emit("pageLoaded"); _this3.napTable = true; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this3.$root.$emit("pageLoaded"); }); } this.napTable = false; }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.rm) { return "elClr cursorPointer"; } else return "elClr"; }, reset: function reset() { this.napTable = false; this.los = 0; }, btnPatch: function btnPatch(item) { this.port_clicked = item; this.$bvModal.show("modal_patch_port"); }, btnPatch_OK: function btnPatch_OK() { var _this4 = this; var val = { splitter_id: this.port_clicked.splitter_id, port_number: this.port_clicked.port_number, going: "Client", going_id: this.data.client_id, los: this.los }; console.log(val); this.$http.post("api/SplitterPort", val).then(function (response) { console.log(response.body); if (response.body == "Error") { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client is patched to another port!", "Please unpatched client to it's existing port.", "warning"); _this4.$bvModal.hide("modal_patch_port"); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Patched", "", "success"); _this4.$bvModal.hide("modal_patch_port"); _this4.$bvModal.hide("scheduler_closure_marker"); } }); }, unpatchClient: function unpatchClient(id) { var _this5 = this; console.log(id); if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.$http.delete("api/SplitterPort/" + id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this5.$bvModal.hide("modal_patch_port"); _this5.$bvModal.hide("scheduler_closure_marker"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete", icon: "warning", buttons: true, dangerMode: true }); } }, change_port_status: function change_port_status(row, stat) { var _this6 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { row.item.port_status = stat; _this6.$http.put("api/SplitterPort/" + row.item.id, row.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } } }); /***/ }), /* 517 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_add_splitter_vue__ = __webpack_require__(518); /* unused harmony namespace reexport */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_73a4275c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_add_splitter_vue__ = __webpack_require__(1203); function injectStyle (ssrContext) { __webpack_require__(1201) } var normalizeComponent = __webpack_require__(9) /* script */ /* template */ /* template functional */ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-73a4275c" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_add_splitter_vue__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_73a4275c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_add_splitter_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) /* harmony default export */ __webpack_exports__["a"] = (Component.exports); /***/ }), /* 518 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], item: { splitter_type_id: "", port_type: "", status: "Not Active" }, splitter_types: [], port_types: [{ name: "1x16", id: "1x16" }, { name: "1x8", id: "1x8" }, { name: "1x4", id: "1x4" }], status_list: [{ name: "Active", id: "Active" }, { name: "Not Active", id: "Not Active" }], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); }, methods: { load: function load() { var _this = this; this.$http.get("api/SplitterType").then(function (response) { _this.splitter_types = response.body; }); }, save_data: function save_data() { var _this2 = this; this.item.user_id = this.user.id; this.item.user_name = this.user.name; this.item.attach_to = this.data.wit; this.item.attach_id = this.data.id; this.$http.post("api/Splitter", this.item).then(function (response) { console.log(response.body); console.log(_this2.data.splitter_closure); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.data.splitter_closure = response.body; _this2.$bvModal.hide("modal_add_splitter"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, update_closure: function update_closure() { var _this3 = this; console.log(this.data); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.data.user_id = _this3.user.id; _this3.data.user_name = _this3.user.name; _this3.data.lat = _this3.data.position.lat; _this3.data.lng = _this3.data.position.lng; _this3.$http.put("api/Closure/" + _this3.data.id, _this3.data).then(function (response) { console.log(response.body); console.log(_this3.data.splitter_closure); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this3.data.splitter_closure = response.body; _this3.$bvModal.hide("modal_closure_marker_click"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, delete_closure: function delete_closure() { var _this4 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.$http.delete("api/Closure/" + _this4.data.id).then(function (response) { _this4.$bvModal.hide("modal_closure_marker_click"); _this4.$root.$emit("delete_closure", _this4.data.index); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Closure Type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 519 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "date-picker": __WEBPACK_IMPORTED_MODULE_1_vue_bootstrap_datetimepicker___default.a, "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a }, data: function data() { return { user: {}, roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); }, mounted: function mounted() {}, methods: { printElement: function printElement(id) { // window.print(); // this.$htmlToPaper("printFSR"); var elem = document.getElementById(id); var domClone = elem.cloneNode(true); var $printSection = document.getElementById("printSection"); if (!$printSection) { var $printSection = document.createElement("div"); $printSection.id = "printSection"; document.body.appendChild($printSection); } $printSection.innerHTML = ""; $printSection.appendChild(domClone); window.print(); } } }); /***/ }), /* 520 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue2_google_maps__ = __webpack_require__(198); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue2_google_maps___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue2_google_maps__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_vue_closure_marker_click_vue__ = __webpack_require__(1213); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_vue_node_marker_click_vue__ = __webpack_require__(482); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modal_vue_modal_add_hardfiber_vue__ = __webpack_require__(1217); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { modal_closure_marker_click: __WEBPACK_IMPORTED_MODULE_3__modal_vue_closure_marker_click_vue__["a" /* default */], modal_node_marker_click: __WEBPACK_IMPORTED_MODULE_4__modal_vue_node_marker_click_vue__["a" /* default */], modal_add_hardfiber: __WEBPACK_IMPORTED_MODULE_5__modal_vue_modal_add_hardfiber_vue__["a" /* default */], "model-list-select": __WEBPACK_IMPORTED_MODULE_1_vue_search_select__["ModelListSelect"] }, data: function data() { return { map: null, map_zoom: 13, search_coor: "", coordinates: { lat: 0, lng: 0 }, selection: [], markers: [], tempPath: [], closures: [], marker: { position: { lat: 7.0688182, lng: 125.59859859999999 } }, marker_search_coor: [], shape: { coords: [5, 5, 10, 15, 15, 15, 15, 10], type: "poly" }, pathMarkers: [], window_open: false, window_position: { lat: 0, lng: 0 }, window_details: { name: "", type: "", closure_type_id: 0 }, open: ["public"], booleanAddPath: false, add_hard_details: {}, hardfiber_coordinates: [], store_redo: [], user: [], roles: [], items: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { var _this = this; this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.$getLocation({ enableHighAccuracy: true }).then(function (coordinates) { console.log("got coor"); console.log(coordinates); _this.coordinates = coordinates; // this.markers[0].position = this.coordinates; }).catch(function (error) { console.log("no coor"); var coor = { lat: 7.040641, lng: 125.577053 }; _this.coordinates = coor; }); //console.log(this.markers[0].position); }, mounted: function mounted() { var _this2 = this; this.load(); this.$refs.gmap1.$mapPromise.then(function (map) { _this2.map = map; }); this.$root.$on("delete_closure", function (item) { _this2.items = item; }); this.$root.$on("update_closures", function (item) { _this2.closures = item; }); this.$root.$on("update_closure", function (item, index) { _this2.closures.push(item); _this2.markers.splice(index, 1); }); this.$root.$on("delete_node", function (index) { _this2.nodes.splice(index, 1); }); this.$root.$on("update_node", function (item, index) { _this2.nodes.push(item); _this2.markers.splice(index, 1); }); this.$root.$on("draw_line", function (item) { _this2.add_hard_details.end1 = item.wit; _this2.add_hard_details.end1_id = item.id; _this2.tempPath = []; _this2.store_redo = []; var coor = { lat: item.position.lat, lng: item.position.lng }; _this2.tempPath.push(coor); _this2.booleanAddPath = true; _this2.window_open = false; document.getElementById("floating-panel").style.display = "inline"; document.getElementById("btnUndo").disabled = true; document.getElementById("btnRedo").disabled = true; }); this.$root.$on("call_undo", function () { _this2.undo_path(); }); this.$root.$on("update_hardfiber_coordinates", function (item) { console.log(item); console.log(_this2.hardfiber_coordinates); _this2.hardfiber_coordinates.push(item); document.getElementById("floating-panel").style.display = "none"; _this2.tempPath = []; _this2.booleanAddPath = false; _this2.window_open = false; }); }, computed: { mapCoordinates: function mapCoordinates() { if (!this.map) { return { lat: 0, lng: 0 }; } return { lat: this.map.getCenter().lat(), lng: this.map.getCenter().lng() // lat: this.map // .getCenter() // .lat() // .toFixed(4), // lng: this.map // .getCenter() // .lng() // .toFixed(4) }; }, treeview_item: function treeview_item() { return this.getNodes(this.items); }, client_marker: function client_marker() { if (this.selection.length > 0) { var retVal = []; this.selection.forEach(function (item) { if (item.file == "user") { item.position = { lat: item.lat, lng: item.lng }; item.marker_type = "client"; retVal.push(item); } }); return retVal; } else return []; }, closure_markers: function closure_markers() { if (this.selection.length > 0) { var retVal = []; this.selection.forEach(function (item) { if (item.file == "closure") { if (retVal.some(function (ret) { return ret.name === item.name; })) { // } else { item.position = { lat: item.lat, lng: item.lng }; //item.draggable = true; item.marker_type = "closure"; retVal.push(item); } } }); return retVal; } else return []; }, nodes: function nodes() { if (this.selection.length > 0) { var retVal = []; this.selection.forEach(function (item) { if (item.file == "node") { item.position = { lat: item.lat, lng: item.lng }; item.marker_type = "node"; retVal.push(item); } }); return retVal; } else return []; }, sum_report: function sum_report() { if (this.selection.length > 0) { var retVal = { dp: 0, ports: 0, occupancy: "0%", occupied: 0, vacant: 0 }; this.selection.forEach(function (item) { if (item.file == "closure" && item.icon != "lcp") retVal.dp += 1; if (item.occupied_port != null) retVal.occupied += item.occupied_port; if (item.total_port != null) retVal.ports += item.total_port; if (item.vacant_port != null) retVal.vacant += item.vacant_port; }); if (retVal.ports > 0) { retVal.occupancy = retVal.occupied / retVal.ports * 100; //round off dari retVal.occupancy = retVal.occupancy.toFixed(2) + "%"; } return retVal; } else return { dp: 0, ports: 0, occupancy: "0%", occupied: 0, vacant: 0 }; } }, methods: { test: function test() { console.log("dari"); console.log(this.closure_markers); }, load: function load() { var _this3 = this; this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarCalendar").style.backgroundColor = ""; document.getElementById("navbarTicket").style.backgroundColor = ""; document.getElementById("navbarInstallation").style.backgroundColor = ""; document.getElementById("navbarMap").style.backgroundColor = "#2196f3"; document.getElementById("navbarComponents").style.backgroundColor = ""; document.getElementById("navbarAccounts").style.backgroundColor = ""; }, 100); }); this.$http.get("api/Closure").then(function (response) { _this3.closures = response.body; }); this.$http.get("api/Node").then(function (response) { _this3.items = response.body; console.log(response.body); }); this.$http.get("api/HardfiberCoordinate").then(function (response) { _this3.hardfiber_coordinates = response.body; }); }, getNodes: function getNodes(items) { var _this4 = this; return items.map(function (item) { return { id: item.sub_id, name: item.name, file: item.file, lat: item.lat, lng: item.lng, real_id: item.id, draggable: false, save: true, type: item.type, closure_id: item.closure_id, icon: item.icon, nap_count: item.nap_count ? item.nap_count : null, occupied_port: item.occupied_port ? item.occupied_port : null, total_port: item.total_port ? item.total_port : null, vacant_port: item.vacant_port ? item.vacant_port : null, children: item.children ? _this4.getNodes(item.children) : [] }; }); }, updateCoordinates: function updateCoordinates(position, index, name) { console.log(position); if (name == "markers") { this.markers[index].position.lat = position.lat(); this.markers[index].position.lng = position.lng(); } if (name == "closures") { this.closures[index].position.lat = position.lat(); this.closures[index].position.lng = position.lng(); } this.window_open = false; }, openWindow: function openWindow(event, marker, index, wit) { var _this5 = this; this.window_position = event; marker.index = index; marker.wit = marker.marker_type; marker.isMap = true; this.window_details = marker; //console.log(marker); if (this.booleanAddPath) { if (marker.save) this.window_open = true; } else { if (this.window_details.wit == "closure") { if (marker.save) { this.$root.$emit("pageLoading"); this.$http.get("api/Closure/" + marker.closure_id).then(function (response) { _this5.window_details = response.body; console.log(_this5.window_details); console.log("openWindow function in closure"); _this5.$bvModal.show("modal_closure_marker_click"); _this5.$root.$emit("pageLoaded"); }); } else { this.$bvModal.show("modal_closure_marker_click"); } } if (this.window_details.wit == "node") { if (marker.save) { this.$root.$emit("pageLoading"); this.$http.get("api/Node/" + marker.real_id).then(function (response) { _this5.window_details = response.body; console.log(_this5.window_details); _this5.$bvModal.show("modal_node_marker_click"); _this5.$root.$emit("pageLoaded"); }); } else { this.$bvModal.show("modal_node_marker_click"); } } } }, addClosure: function addClosure() { var new_marker = { position: { lat: this.mapCoordinates.lat, lng: this.mapCoordinates.lng }, name: "untitled", type: "", save: false, marker_type: "closure" }; this.markers.push(new_marker); }, map_clicked: function map_clicked(event) { // var coor = { lat: event.latLng.lat(), lng: event.latLng.lng() }; if (this.booleanAddPath) this.add_point_in_temp_path(coor); }, add_point_in_temp_path: function add_point_in_temp_path(coor) { this.tempPath.push(coor); document.getElementById("map_hint1").style.display = "none"; document.getElementById("map_hint2").style.display = "inline"; this.store_redo = []; document.getElementById("btnRedo").disabled = true; if (this.tempPath.length > 1) { document.getElementById("btnUndo").disabled = false; } else document.getElementById("btnUndo").disabled = true; }, undo_path: function undo_path() { if (this.tempPath.length > 1) { var temp = [].concat(_toConsumableArray(this.tempPath)); this.store_redo.push(temp); this.tempPath.splice(this.tempPath.length - 1, 1); document.getElementById("btnRedo").disabled = false; if (this.tempPath.length == 1) document.getElementById("btnUndo").disabled = true; } }, redo_path: function redo_path() { //console.log(this.store_redo[this.store_redo.length - 1]); //console.log(this.tempPath); if (this.store_redo.length > 0) { this.tempPath = this.store_redo[this.store_redo.length - 1]; this.store_redo.splice(this.store_redo.length - 1, 1); document.getElementById("btnUndo").disabled = false; if (this.store_redo.length == 0) document.getElementById("btnRedo").disabled = true; } }, cancel_path: function cancel_path() { this.tempPath = []; this.store_redo = []; this.booleanAddPath = false; this.window_open = false; document.getElementById("floating-panel").style.display = "none"; }, attach_fiber: function attach_fiber() { console.log(this.window_details); var coor = { lat: this.window_position.lat(), lng: this.window_position.lng() }; this.add_point_in_temp_path(coor); this.add_hard_details.end2 = this.window_details.wit; this.add_hard_details.end2_id = this.window_details.id; this.add_hard_details.coordinates = this.tempPath; this.add_hard_details.type = ""; this.$bvModal.show("modal_add_hardfiber"); }, addNode: function addNode() { var new_marker = { position: { lat: this.mapCoordinates.lat, lng: this.mapCoordinates.lng }, name: "untitled", save: false, marker_type: "node" }; this.markers.push(new_marker); }, marker_view_clicked: function marker_view_clicked() { if (this.window_details.wit == "closure") this.$bvModal.show("modal_closure_marker_click"); }, treeview_dblclick: function treeview_dblclick(item) { console.log(item); if (item.lat != null) { if (item.lat != 0) { this.map.setZoom(19); this.map.setCenter({ lat: parseFloat(item.lat), lng: parseFloat(item.lng) }); } else __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("no coordinates"); } else __WEBPACK_IMPORTED_MODULE_2_sweetalert___default()("no coordinates"); }, search_coordinates: function search_coordinates() { if (this.search_coor != null) { this.marker_search_coor = []; var temp = this.search_coor.split(","); this.map.setZoom(19); this.map.setCenter({ lat: parseFloat(temp[0]), lng: parseFloat(temp[1]) }); var new_marker = { position: { lat: this.mapCoordinates.lat, lng: this.mapCoordinates.lng }, name: this.search_coor, type: "", save: false, marker_type: "search_coor" }; this.marker_search_coor.push(new_marker); } } } }); /***/ }), /* 521 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_add_splitter_vue__ = __webpack_require__(517); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //import modal_splitter_port_list from "./modal_splitter_port_list.vue"; /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { modal_add_splitter: __WEBPACK_IMPORTED_MODULE_2__modal_add_splitter_vue__["a" /* default */], "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_3_vue_rangedate_picker___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], splitters_field: [{ key: "splitter_type.name", label: "Splitter Type" }, { key: "port_type" }, { key: "status" }, { key: "action" }], splitters_item: [], item: {}, splitters_tblisBusy: false, closure_types: [], latlng: "", user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); this.splitters_item = this.data.splitter_closure; }, methods: { load: function load() { var _this = this; this.$http.get("api/ClosureType").then(function (response) { _this.closure_types = response.body; }); }, save_data: function save_data() { var _this2 = this; this.data.user_id = this.user.id; this.data.user_name = this.user.name; this.data.lat = this.data.position.lat; this.data.lng = this.data.position.lng; this.$http.post("api/Closure", this.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.data.save = true; _this2.$bvModal.hide("modal_closure_marker_click"); console.log(response.body); _this2.$root.$emit("update_closure", response.body, _this2.data.index); }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); }, update_closure: function update_closure() { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.data.user_id = _this3.user.id; _this3.data.user_name = _this3.user.name; _this3.$http.put("api/Closure/" + _this3.data.id, _this3.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this3.$bvModal.hide("modal_closure_marker_click"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, delete_closure: function delete_closure() { var _this4 = this; console.log(this.data); if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.$root.$emit("pageLoading"); _this4.$http.delete("api/Closure/" + _this4.data.id).then(function (response) { _this4.$root.$emit("pageLoaded"); _this4.$root.$emit("delete_closure", response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this4.$bvModal.hide("modal_closure_marker_click"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this4.$root.$emit("pageLoaded"); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Closure Type", icon: "warning", buttons: true, dangerMode: true }); } }, splitters_tblRowClicked: function splitters_tblRowClicked(item, index, event) { var _this5 = this; console.log(item); if (item.splitter_type.name == "LCP") { this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.id).then(function (response) { console.log(response.body); _this5.item = response.body; _this5.item.item = item; _this5.item.splitters_field = [{ key: "port_number", label: "Port#", sortable: true }, { key: "los", label: "LOS", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "port_status", label: "Port", sortable: true }, { key: "action", label: "Action", sortable: true }]; _this5.$root.$emit("update_lcp", _this5.item); _this5.$bvModal.show("modal_splitter_port_list"); _this5.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this5.$root.$emit("pageLoaded"); }); } if (item.splitter_type.name == "NAP") { this.$root.$emit("pageLoading"); this.$http.get("api/SplitterPort/" + item.id).then(function (response) { console.log(response.body); console.log("function splitters_tblRowClicked in NAP"); _this5.item = response.body; _this5.item.item = item; _this5.$root.$emit("update_naps", _this5.item); _this5.$bvModal.show("modal_splitter_port_list_nap"); _this5.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this5.$root.$emit("pageLoaded"); }); } }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.rm) { return "elClr cursorPointer"; } else return "elClr"; }, insert_hardfiber: function insert_hardfiber() { this.$root.$emit("draw_line", this.data); this.$bvModal.hide("modal_closure_marker_click"); }, deleteSplitter: function deleteSplitter(row) { var _this6 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Do you really want to delete this item?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this6.items = []; _this6.tblisBusy = true; _this6.$http.delete("api/Splitter/" + row.item.id).then(function (response) { _this6.data.splitter_closure.splice(row.index, 1); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, activate_splitter: function activate_splitter(row) { var _this7 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { row.item.status = "Active"; _this7.$http.put("api/Splitter/" + row.item.id, row.item).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, updateMarker_add: function updateMarker_add(txt) { if (txt == "latlng") { var temp = this.latlng.split(","); this.data.position.lat = parseFloat(temp[0]); this.data.position.lng = parseFloat(temp[1]); } if (txt == "lnglat") { var temp = this.latlng.split(","); this.data.position.lat = parseFloat(temp[1]); this.data.position.lng = parseFloat(temp[0]); } } } }); /***/ }), /* 522 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ props: ["data"], components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { buffer_color: [{ no: 1, color: "blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }], core_color: [{ no: 1, color: "Blue" }, { no: 2, color: "Orange" }, { no: 3, color: "Green" }, { no: 4, color: "Brown" }, { no: 5, color: "Slate" }, { no: 6, color: "White" }, { no: 7, color: "Red" }, { no: 8, color: "Black" }, { no: 9, color: "Yellow" }, { no: 10, color: "Violet" }, { no: 11, color: "Rose" }, { no: 12, color: "Aqua" }], hardfiber_core_type_list: [{ name: "12 core", id: "12 core" }, { name: "24 core", id: "24 core" }, { name: "48 core", id: "48 core" }], user: [], roles: [] }; }, created: function created() { this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.load(); }, methods: { load: function load() {}, save_data: function save_data() { var _this = this; this.$http.post("api/Hardfiber", this.data).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Attached", "", "success"); _this.$bvModal.hide("modal_add_hardfiber"); var temp = { coor: _this.data.coordinates, hardfiber_id: response.body }; _this.$root.$emit("update_hardfiber_coordinates", temp); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true // }); // }); }, close_modal: function close_modal() { this.$bvModal.hide("modal_add_hardfiber"); this.$root.$emit("call_undo"); } } }); /***/ }), /* 523 */ /***/ (function(module, exports, __webpack_require__) { var map = { "./1.png": 1222, "./1111.png": 1223, "./11111.png": 1224, "./dctech-fibergigaband logo (new).png": 1225, "./email_logo.png": 1226, "./favicon-32x32.png": 1227, "./favicon-96x96.png": 1228, "./faviconasd-96x96.png": 1229, "./high.png": 1230, "./info_system logo.png": 1231, "./lcp.png": 1232, "./logo inet.png": 1233, "./logo inet1.png": 1234, "./logo inet2.png": 296, "./logout.png": 297, "./marker_closure.png": 1235, "./marker_node.png": 203, "./marker_user.png": 204, "./nap0.png": 1236, "./nap1.png": 1237, "./nap11.png": 1238, "./nap2.png": 1239, "./nap3.png": 1240, "./nap4.png": 1241, "./nap5.png": 1242, "./nap6.png": 1243, "./nap7.png": 1244, "./nap8.png": 1245 }; function webpackContext(req) { return __webpack_require__(webpackContextResolve(req)); }; function webpackContextResolve(req) { var id = map[req]; if(!(id + 1)) // check for number or string throw new Error("Cannot find module '" + req + "'."); return id; }; webpackContext.keys = function webpackContextKeys() { return Object.keys(map); }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; webpackContext.id = 523; /***/ }), /* 524 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], closure_type: { name: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.load_item(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load_item: function load_item() { var _this = this; this.$http.get("api/ClosureType").then(function (response) { _this.items = response.body; _this.totalRows = _this.items.length; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.rm) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.rm) { this.$bvModal.show("modalEdit"); this.closure_type = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { _this2.tblisBusy = true; _this2.closure_type.user_id = _this2.user.id; _this2.closure_type.user_name = _this2.user.name; _this2.$http.post("api/ClosureType", _this2.closure_type).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.closure_type.name = ""; _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; _this2.$bvModal.hide("modalAdd"); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true // }); // }); } }); }, btnUpdate: function btnUpdate() { var _this3 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.closure_type.user_id = _this3.user.id; _this3.closure_type.user_name = _this3.user.name; _this3.$http.put("api/ClosureType/" + _this3.closure_type.id, _this3.closure_type).then(function (response) { _this3.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this3.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this4 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.items = []; _this4.tblisBusy = true; _this4.$http.delete("api/ClosureType/" + _this4.closure_type.id).then(function (response) { _this4.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Closure Type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 525 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], splitter_type: { name: "" }, user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.load_item(); this.user = this.$global.getUser(); }, mounted: function mounted() { this.load(); }, updated: function updated() {}, methods: { load_item: function load_item() { var _this = this; this.$http.get("api/SplitterType").then(function (response) { _this.items = response.body; _this.totalRows = _this.items.length; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.rm) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.rm) { this.$bvModal.show("modalEdit"); this.splitter_type = item; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { _this2.tblisBusy = true; _this2.splitter_type.user_id = _this2.user.id; _this2.splitter_type.user_name = _this2.user.name; _this2.$http.post("api/SplitterType", _this2.splitter_type).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this2.splitter_type.name = ""; _this2.items = response.body; _this2.totalRows = _this2.items.length; _this2.tblisBusy = false; _this2.$bvModal.hide("modalAdd"); }); // .catch(response => { // swal({ // title: "Error", // text: response.body.error, // icon: "error", // dangerMode: true // }); // }); } }); }, btnUpdate: function btnUpdate() { var _this3 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this3.splitter_type.user_id = _this3.user.id; _this3.splitter_type.user_name = _this3.user.name; _this3.$http.put("api/SplitterType/" + _this3.splitter_type.id, _this3.splitter_type).then(function (response) { _this3.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this3.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this4 = this; if (this.roles.rm) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this4.items = []; _this4.tblisBusy = true; _this4.$http.delete("api/SplitterType/" + _this4.splitter_type.id).then(function (response) { _this4.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this4.items = response.body; _this4.totalRows = _this4.items.length; _this4.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Splitter Type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 526 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: false, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], activity: { name: "" }, roles: [], user: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); console.log(); }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$nextTick(function () { this.$root.$emit("clearNav"); setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarActivityTicket").style.backgroundColor = "#2196f3"; }, 100); }); this.tblisBusy = true; this.$http.get("api/ActivityTicketType").then(function (response) { this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_package_type) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_package_type) { this.$bvModal.show("modalEdit"); this.activity.id = item.id; this.activity.name = item.name; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.activity.user_id = _this.user.id; _this.activity.user_name = _this.user.name; _this.$root.$emit("pageLoading"); _this.$http.post("api/ActivityTicketType", _this.activity).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.activity.name = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); _this.$root.$emit("pageLoaded"); }).catch(function (response) { _this.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$root.$emit("pageLoading"); _this2.activity.user_id = _this2.user.id; _this2.activity.user_name = _this2.user.name; _this2.$http.put("api/ActivityTicketType/" + _this2.activity.id, _this2.activity).then(function (response) { console.log(response.body); _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); _this2.$root.$emit("pageLoaded"); }).catch(function (response) { _this2.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_package_type) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.$root.$emit("pageLoading"); _this3.tblisBusy = true; _this3.activity.user_id = _this3.user.id; _this3.activity.user_name = _this3.user.name; _this3.$http.delete("api/ActivityTicketType/" + _this3.activity.id).then(function (response) { console.log(response.body); _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success"); _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; _this3.$root.$emit("pageLoaded"); }).catch(function (response) { _this3.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a type", icon: "warning", buttons: true, dangerMode: true }); } } } }); /***/ }), /* 527 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_vue_modal_mac_manage_device_vue__ = __webpack_require__(1261); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__modal_vue_modal_mac_manage_deployment_vue__ = __webpack_require__(1265); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__modal_vue_modal_mac_manage_location_vue__ = __webpack_require__(1269); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { BtnManageDevice: __WEBPACK_IMPORTED_MODULE_2__modal_vue_modal_mac_manage_device_vue__["a" /* default */], BtnManageDeploy: __WEBPACK_IMPORTED_MODULE_3__modal_vue_modal_mac_manage_deployment_vue__["a" /* default */], BtnManageLocation: __WEBPACK_IMPORTED_MODULE_4__modal_vue_modal_mac_manage_location_vue__["a" /* default */], "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"] }, data: function data() { return { tblisBusy: true, fields: [{ key: "pmx_ip", label: "PMX IP", sortable: true }, { key: "ip", label: "IP", sortable: true }, { key: "mac_desc", label: "Description", sortable: true }, { key: "port_desc", label: "Port Descrption", sortable: true }, { key: "mac_address_main", label: "MAC Address", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 20, pageOptions: [10, 20, 50, 100], addItem: { pmx_ip: "", ip: "", mac_desc: "", port_desc: "", location: {}, deploy: {}, device: {} }, editItem: { pmx_ip: "", ip: "", mac_desc: "", port_desc: "" }, location_list: [], deploy_list: [], device_list: [], filter_location: "", filter_deploy: "", filter_device: "", user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.load(); this.user = this.$global.getUser(); this.roles = this.$global.getRoles(); this.loadlist(); }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/MacTable").then(function (response) { this.items = response.body; this.totalRows = this.items.length; this.tblisBusy = false; }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else return "elClr cursorPointer"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { this.$bvModal.show("modalEdit"); this.editItem = item; }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; console.log(this.addItem); this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.$http.post("api/MacTable", _this.addItem).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.tblisBusy = false; } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$http.put("api/MacTable/" + _this2.editItem.id, _this2.editItem).then(function (response) { _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, clearFilter: function clearFilter() { this.tblFilter = ""; this.filter_location = ""; this.filter_deploy = ""; this.filter_device = ""; }, filterChange: function filterChange() { this.tblFilter = "D6:7E:C" + this.filter_location; if (this.filter_deploy != "") this.tblFilter += ":" + this.filter_deploy; if (this.filter_device != "") this.tblFilter += this.filter_device; }, loadlist: function loadlist() { this.$http.get("api/MacLocation").then(function (response) { this.location_list = response.body; }); this.$http.get("api/DeviceType").then(function (response) { this.device_list = response.body; }); this.$http.get("api/MacDeploymentIdentifier").then(function (response) { this.deploy_list = response.body; }); } } }); /***/ }), /* 528 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { tblisBusy: false, device_field: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "hex_number" }, { key: "actions" }], device_items: [], addDevice: { name: "", hex_number: "" }, editDevice: { name: "", hex_number: "" }, user: [], roles: [] }; }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); this.load(); }, methods: { load: function load() { this.$http.get("api/DeviceType").then(function (response) { this.device_items = response.body; }); }, btnAddDevice: function btnAddDevice() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.addDevice.user_id = _this.user.id; _this.addDevice.user_name = _this.user.name; _this.$http.post("api/DeviceType", _this.addDevice).then(function (response) { _this.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); _this.addDevice.name = ""; _this.addDevice.hex_number = ""; _this.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this.tblisBusy = false; }); } }); }, UpdateDevice: function UpdateDevice() { var _this2 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this Device?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.tblisBusy = true; _this2.editDevice.user_id = _this2.user.id; _this2.editDevice.user_name = _this2.user.name; _this2.$http.put("api/DeviceType/" + _this2.editDevice.id, _this2.editDevice).then(function (response) { _this2.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this2.$bvModal.hide("ModalEditDevice"); _this2.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this2.tblisBusy = false; }); } }); }, OpenModalEditDevice: function OpenModalEditDevice(item, index, button) { this.editDevice = item; this.$bvModal.show("ModalEditDevice"); }, delDevice: function delDevice(item, index, button) { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this Device", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.tblisBusy = true; _this3.$http.delete("api/DeviceType/" + item.id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this3.device_items = response.body; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this3.tblisBusy = false; } }); }); } }); } } }); /***/ }), /* 529 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { tblisBusy: false, device_field: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "hex_number" }, { key: "actions" }], device_items: [], addDevice: { name: "", hex_number: "" }, editDevice: { name: "", hex_number: "" }, user: [], roles: [] }; }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); this.load(); }, methods: { load: function load() { this.$http.get("api/MacDeploymentIdentifier").then(function (response) { this.device_items = response.body; }); }, btnAddDevice: function btnAddDevice() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.addDevice.user_id = _this.user.id; _this.addDevice.user_name = _this.user.name; _this.$http.post("api/MacDeploymentIdentifier", _this.addDevice).then(function (response) { _this.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); _this.addDevice.name = ""; _this.addDevice.hex_number = ""; _this.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this.tblisBusy = false; }); } }); }, UpdateDevice: function UpdateDevice() { var _this2 = this; console.log(this.editDevice); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this Identifier?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.tblisBusy = true; _this2.editDevice.user_id = _this2.user.id; _this2.editDevice.user_name = _this2.user.name; _this2.$http.put("api/MacDeploymentIdentifier/" + _this2.editDevice.id, _this2.editDevice).then(function (response) { _this2.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this2.$bvModal.hide("ModalEditDeploy"); _this2.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this2.tblisBusy = false; }); } }); }, OpenModalEditDevice: function OpenModalEditDevice(item, index, button) { this.editDevice = item; this.$bvModal.show("ModalEditDeploy"); }, delDevice: function delDevice(item, index, button) { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this Identifier", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.tblisBusy = true; _this3.$http.delete("api/MacDeploymentIdentifier/" + item.id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this3.device_items = response.body; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this3.tblisBusy = false; } }); }); } }); } } }); /***/ }), /* 530 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { tblisBusy: false, device_field: [{ key: "id", sortable: true }, { key: "name", sortable: true }, { key: "hex_number" }, { key: "actions" }], device_items: [], addDevice: { name: "", hex_number: "" }, editDevice: { name: "", hex_number: "" }, user: [], roles: [] }; }, created: function created() { this.roles = this.$global.getRoles(); this.user = this.$global.getUser(); this.load(); }, methods: { load: function load() { this.$http.get("api/MacLocation").then(function (response) { this.device_items = response.body; }); }, btnAddDevice: function btnAddDevice() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.addDevice.user_id = _this.user.id; _this.addDevice.user_name = _this.user.name; _this.$http.post("api/MacLocation", _this.addDevice).then(function (response) { _this.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Added", "", "success"); _this.addDevice.name = ""; _this.addDevice.hex_number = ""; _this.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this.tblisBusy = false; }); } }); }, UpdateDevice: function UpdateDevice() { var _this2 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this Location?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.tblisBusy = true; _this2.editDevice.user_id = _this2.user.id; _this2.editDevice.user_name = _this2.user.name; _this2.$http.put("api/MacLocation/" + _this2.editDevice.id, _this2.editDevice).then(function (response) { _this2.device_items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this2.$bvModal.hide("ModalEditLocation"); _this2.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this2.tblisBusy = false; }); } }); }, OpenModalEditDevice: function OpenModalEditDevice(item, index, button) { this.editDevice = item; this.$bvModal.show("ModalEditLocation"); }, delDevice: function delDevice(item, index, button) { var _this3 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this Location", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.tblisBusy = true; _this3.$http.delete("api/MacLocation/" + item.id).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this3.device_items = response.body; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this3.tblisBusy = false; } }); }); } }); } } }); /***/ }), /* 531 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "rangedate-picker": __WEBPACK_IMPORTED_MODULE_2_vue_rangedate_picker___default.a }, data: function data() { return { tblisBusy: true, fields: [{ key: "name", sortable: true }, { key: "user.name", label: "Team Leader", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }, { key: "action", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], team: { name: "", user_id: "" }, selectedTeam: {}, selected_date_from: "", selected_date_to: "", summary_tblisBusy: false, summary_fields: [{ key: "date" }, { key: "plan" }, { key: "done" }, { key: "done_percent" }, { key: "pending" }, { key: "pending_percent" }], summary_items: [], selected_date_from1: "", selected_date_to1: "", summary_tblisBusy1: false, summary_fields1: [{ key: "id" }, { key: "name" }, { key: "TDATE" }, { key: "TYPE" }], summary_items1: [], users: [], user: [], roles: [] }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.roles = this.$global.getRoles(); this.getItem(); this.user = this.$global.getUser(); //this.items = this.$global.getPackageTypes(); }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { getItem: function getItem() { this.$http.get("api/team").then(function (response) { console.log(response.body); this.items = response.body; this.tblisBusy = false; this.totalRows = this.items.length; }); this.$http.get("api/user").then(function (response) { this.users = response.body; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarComponents").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_team) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { if (this.roles.update_team) { this.$bvModal.show("modalEdit"); this.team = item; } }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.tblisBusy = true; _this.$http.post("api/team", _this.team).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.team.name = ""; _this.team.user_id = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this.$refs.name.focus(); } }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$http.put("api/team/" + _this2.team.id, _this2.team).then(function (response) { _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, btnDelete: function btnDelete() { var _this3 = this; if (this.roles.delete_package_type) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.tblisBusy = true; _this3.$http.delete("api/team/" + _this3.team.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this3.tblisBusy = false; } }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a Package type", icon: "warning", buttons: true, dangerMode: true }); } }, openModalSummary: function openModalSummary(item) { this.selectedTeam = item; this.$bvModal.show("modalSelectDate"); }, onDateSelected: function onDateSelected(daterange) { var _this4 = this; this.selected_date_from = this.formatDate(daterange.start); if (daterange.end == null) daterange.end = daterange.start; this.selected_date_to = this.formatDate(daterange.end); this.$http.put("api/team/summary/" + this.selectedTeam.id, daterange).then(function (response) { _this4.summary_items = response.body; _this4.$bvModal.show("modalSummary"); _this4.$bvModal.hide("modalSelectDate"); }); }, onDateSelectedAccounts: function onDateSelectedAccounts(daterange) { var _this5 = this; this.selected_date_from1 = this.formatDate(daterange.start); if (daterange.end == null) daterange.end = daterange.start; this.selected_date_to1 = this.formatDate(daterange.end); this.$http.post("api/team/summary_accounts", daterange).then(function (response) { _this5.summary_items1 = response.body.inst; _this5.summary_items1 = _this5.summary_items1.concat(response.body.ticket); _this5.$bvModal.show("modalSummaryAccounts"); _this5.$bvModal.hide("modalSelectDateForAccount"); }); }, formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, fnExcelReport: function fnExcelReport(tbl) { this.$nextTick(function () { setTimeout(function () { var tab_text = "" + this.selectedTeam.name + " Summary, From: " + this.selected_date_from + "To: " + this.selected_date_to + ""; var textRange; var j = 0; var tab = document.getElementById(tbl); // id of table for (j = 0; j < tab.rows.length; j++) { tab_text = tab_text + tab.rows[j].innerHTML + ""; //tab_text=tab_text+""; } tab_text = tab_text + "
"; tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // If Internet Explorer txtArea1.document.open("txt/html", "replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); var sa = txtArea1.document.execCommand("SaveAs", true, "Say Thanks to Sumit.xls"); } //other browser not tested on IE 11 else var sa = window.open("data:application/vnd.ms-excel," + encodeURIComponent(tab_text)); return sa; }.bind(this), 1000); }); } } }); /***/ }), /* 532 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_multiselect__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { multiselect: __WEBPACK_IMPORTED_MODULE_4_vue_multiselect___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a }, data: function data() { return { tblisBusy: true, fields: [{ key: "name", sortable: true }, { key: "email", sortable: true }, { key: "branch.name", label: "Branch", formatter: function formatter(value, key, item) { if (item.branch_id == "0") { if (item.branch == null) return "All"; } else { if (item.branch == null) return "No Branch";else return item.branch.name; } }, sortable: true }, { key: "role_group.name", label: "Role Group", sortable: true }, { key: "status", label: "Status", sortable: true }, { key: "created_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], user: { id: "", branch_id: "", name: "", email: "", subdomain: "@dctechmicro.com", password: "dctech123", password2: "dctech123", role_group_id: "", withHDRole: false, withSalesRole: false, withAccountingRole: false, withSchedulerRole: false, withRMRole: false }, checkRoleHD: true, checkRoleSales: true, checkRoleAccounting: true, checkRoleScheduler: true, checkRoleRM: true, branches: [], roles: [], role_groups: [], editRoles: { id: "", roles: { create_account: false, update_account: false, delete_account: false, create_client: false, update_client: false, delete_client: false, create_client_details: false, update_client_details: false, delete_client_details: false, create_package_type: false, update_package_type: false, delete_package_type: false, create_package: false, update_package: false, delete_package: false, create_modem: false, update_modem: false, delete_modem: false, create_engineer: false, update_engineer: false, delete_engineer: false, create_sales: false, update_sales: false, delete_sales: false, create_branch: false, update_branch: false, delete_branch: false, create_job_order: false, update_job_order: false, delete_job_order: false, create_ticket: false, update_ticket: false, delete_ticket: false, create_ticket_status: false, update_ticket_status: false, delete_ticket_status: false, create_olt: false, update_olt: false, delete_olt: false, create_pon: false, update_pon: false, delete_pon: false, create_event: false, update_event: false, delete_event: false, create_team: false, update_team: false, delete_team: false, create_area: false, update_area: false, delete_area: false, viewer: false, assign_team: false, assign_date: false, accounting: false, helpdesk: false, operator: false, role: false, rm: false, network: false, admin: false, sendcvc: false, sales: false, account_management: false, create_business_type: false, update_business_type: false, delete_business_type: false, create_bill: false, update_soa: false, delete_soa: false, create_bankcode: false, update_bankcode: false, delete_bankcode: false, receive_payment: false, create_wht: false, create_bucket: false, update_bucket: false, delete_bucket: false, create_region: false, update_region: false, delete_region: false } }, user_login: {} }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.getUsers(); this.getRoleGroups(); this.roles = this.$global.getRoles(); this.user_login = this.$global.getUser(); if (this.user_login.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { getUsers: function getUsers() { this.$http.get("api/user").then(function (response) { this.items = response.body; this.tblisBusy = false; this.totalRows = this.items.length; }); }, getRoleGroups: function getRoleGroups() { this.$http.get("api/RoleGroup").then(function (response) { this.role_groups = response.body; this.tblisBusy = false; this.totalRows = this.items.length; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); this.$http.get("api/Branch").then(function (response) { this.branches = response.body; var temp = { id: 0, name: "All(can view all tickets and schedule in all branches)" }; this.branches.unshift(temp); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_account) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { console.log(item); if (this.roles.update_account) { this.$bvModal.show("modalEdit"); this.user = item; this.user.password = "dctech123"; this.user.password2 = "dctech123"; this.editRoles.id = item.id; this.editRoles.roles = item.roleList; this.editRoles.roless = item.roles; } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.$root.$emit("pageLoading"); _this.$http.post("api/user", _this.user).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.user.name = ""; _this.user.branch_id = ""; _this.user.email = ""; _this.user.subdomain = "@dctechmicro.com"; _this.user.password = "dctech123"; _this.user.password2 = "dctech123"; _this.user.role_group_id = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); _this.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { _this.$root.$emit("pageLoaded"); }); }); } }); }, updateUser: function updateUser() { var _this2 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$root.$emit("pageLoading"); _this2.$http.put("api/user/" + _this2.user.id, _this2.user).then(function (response) { console.log(response.body); _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalEdit"); _this2.$bvModal.hide("modalResetPass"); _this2.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { _this2.$root.$emit("pageLoaded"); }); }); } }); } }); }, deleteUser: function deleteUser() { var _this3 = this; if (this.roles.delete_account) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this3.items = []; _this3.tblisBusy = true; _this3.$http.delete("api/user/" + _this3.user.id).then(function (response) { _this3.$bvModal.hide("modalEdit"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted", "", "success").then(function (value) { _this3.items = response.body; _this3.totalRows = _this3.items.length; _this3.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Opss.", text: "You are not allow to delete a user", icon: "warning", buttons: true, dangerMode: true }); } }, updateRoles: function updateRoles() { var _this4 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this4.$root.$emit("pageLoading"); _this4.$http.post("api/user/updateRoles", _this4.editRoles).then(function (response) { _this4.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this4.$bvModal.hide("modalRoles"); _this4.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { _this4.$root.$emit("pageLoaded"); }); }); } }); }, role_checked: function role_checked() { if (this.user.withHDRole || this.user.withSalesRole || this.user.withAccountingRole || this.user.withSchedulerRole || this.user.withRMRole) { this.checkRoleHD = false; this.checkRoleSales = false; this.checkRoleAccounting = false; this.checkRoleScheduler = false; this.checkRoleRM = false; if (this.user.withHDRole) this.checkRoleHD = true; if (this.user.withSalesRole) this.checkRoleSales = true; if (this.user.withAccountingRole) this.checkRoleAccounting = true; if (this.user.withSchedulerRole) this.checkRoleScheduler = true; if (this.user.withRMRole) this.checkRoleRM = true; } else { this.checkRoleHD = true; this.checkRoleSales = true; this.checkRoleAccounting = true; this.checkRoleScheduler = true; this.checkRoleRM = true; } }, roleChecker: function roleChecker(role) { this.editRoles.roles = { create_account: false, update_account: false, delete_account: false, create_client: false, update_client: false, delete_client: false, create_client_details: false, update_client_details: false, delete_client_details: false, create_package_type: false, update_package_type: false, delete_package_type: false, create_package: false, update_package: false, delete_package: false, create_modem: false, update_modem: false, delete_modem: false, create_engineer: false, update_engineer: false, delete_engineer: false, create_sales: false, update_sales: false, delete_sales: false, create_branch: false, update_branch: false, delete_branch: false, create_job_order: false, update_job_order: false, delete_job_order: false, create_ticket: false, update_ticket: false, delete_ticket: false, create_ticket_status: false, update_ticket_status: false, delete_ticket_status: false, create_olt: false, update_olt: false, delete_olt: false, create_pon: false, update_pon: false, delete_pon: false, create_event: false, update_event: false, delete_event: false, create_team: false, update_team: false, delete_team: false, create_area: false, update_area: false, delete_area: false, viewer: false, assign_team: false, assign_date: false, accounting: false, helpdesk: false, operator: false, role: false, rm: false, network: false, admin: false, sendcvc: false, sales: false, account_management: false, create_business_type: false, update_business_type: false, delete_business_type: false, create_bill: false, update_soa: false, delete_soa: false, create_bankcode: false, update_bankcode: false, delete_bankcode: false, receive_payment: false, create_wht: false, create_bucket: false, update_bucket: false, delete_bucket: false, create_region: false, update_region: false, delete_region: false }; if (role == "hd") { this.editRoles.roles.update_package_type = true; this.editRoles.roles.update_package = true; this.editRoles.roles.update_modem = true; this.editRoles.roles.create_ticket = true; this.editRoles.roles.update_ticket = true; this.editRoles.roles.update_olt = true; this.editRoles.roles.update_pon = true; } else if (role == "sales") { this.editRoles.roles.update_client = true; // this.editRoles.roles.create_package_type = true; // this.editRoles.roles.update_package_type = true; // this.editRoles.roles.create_package = true; // this.editRoles.roles.update_package = true; // this.editRoles.roles.create_engineer = true; // this.editRoles.roles.update_engineer = true; // this.editRoles.roles.create_sales = true; // this.editRoles.roles.update_sales = true; // this.editRoles.roles.sales = true; // this.editRoles.roles.create_business_type = true; // this.editRoles.roles.update_business_type = true; } else if (role == "accounting") { this.editRoles.roles.update_client = true; this.editRoles.roles.accounting = true; this.editRoles.roles.create_bill = true; this.editRoles.roles.receive_payment = true; this.editRoles.roles.create_wht = true; } else if (role == "scheduler") { this.editRoles.roles.create_client_details = true; this.editRoles.roles.update_client_details = true; this.editRoles.roles.create_modem = true; this.editRoles.roles.update_modem = true; this.editRoles.roles.create_engineer = true; this.editRoles.roles.update_engineer = true; this.editRoles.roles.create_sales = true; this.editRoles.roles.update_sales = true; this.editRoles.roles.create_job_order = true; this.editRoles.roles.update_job_order = true; this.editRoles.roles.create_team = true; this.editRoles.roles.update_team = true; this.editRoles.roles.assign_team = true; this.editRoles.roles.assign_date = true; this.editRoles.roles.operator = true; this.editRoles.roles.sendcvc = true; } else if (role == "rm") { this.editRoles.roles.create_account = true; this.editRoles.roles.update_account = true; this.editRoles.roles.create_client_details = true; this.editRoles.roles.update_client_details = true; this.editRoles.roles.create_package_type = true; this.editRoles.roles.update_package_type = true; this.editRoles.roles.create_package = true; this.editRoles.roles.update_package = true; this.editRoles.roles.create_modem = true; this.editRoles.roles.update_modem = true; this.editRoles.roles.create_engineer = true; this.editRoles.roles.update_engineer = true; this.editRoles.roles.create_sales = true; this.editRoles.roles.update_sales = true; this.editRoles.roles.create_region = true; this.editRoles.roles.update_region = true; this.editRoles.roles.create_job_order = true; this.editRoles.roles.update_job_order = true; this.editRoles.roles.create_ticket = true; this.editRoles.roles.update_ticket = true; this.editRoles.roles.create_ticket_status = true; this.editRoles.roles.update_ticket_status = true; this.editRoles.roles.create_olt = true; this.editRoles.roles.update_olt = true; this.editRoles.roles.create_pon = true; this.editRoles.roles.update_pon = true; this.editRoles.roles.create_event = true; this.editRoles.roles.update_event = true; this.editRoles.roles.create_team = true; this.editRoles.roles.update_team = true; this.editRoles.roles.assign_team = true; this.editRoles.roles.assign_date = true; this.editRoles.roles.operator = true; this.editRoles.roles.rm = true; this.editRoles.roles.sendcvc = true; this.editRoles.roles.create_business_type = true; this.editRoles.roles.update_business_type = true; } } } }); /***/ }), /* 533 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio__); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_radio___default.a }, data: function data() { return { tblisBusy: true, fields: [{ key: "name", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], items: [], tblFilter: null, totalRows: 1, currentPage: 1, perPage: 10, pageOptions: [10, 20, 50], role_group: { name: "", roles: { create_account: false, update_account: false, delete_account: false, create_client: false, update_client: false, delete_client: false, create_client_details: false, update_client_details: false, delete_client_details: false, create_package_type: false, update_package_type: false, delete_package_type: false, create_package: false, update_package: false, delete_package: false, create_modem: false, update_modem: false, delete_modem: false, create_engineer: false, update_engineer: false, delete_engineer: false, create_sales: false, update_sales: false, delete_sales: false, create_branch: false, update_branch: false, delete_branch: false, create_job_order: false, update_job_order: false, delete_job_order: false, create_ticket: false, update_ticket: false, delete_ticket: false, create_ticket_status: false, update_ticket_status: false, delete_ticket_status: false, create_olt: false, update_olt: false, delete_olt: false, create_pon: false, update_pon: false, delete_pon: false, create_event: false, update_event: false, delete_event: false, create_team: false, update_team: false, delete_team: false, create_area: false, update_area: false, delete_area: false, viewer: false, assign_team: false, assign_date: false, accounting: false, helpdesk: false, operator: false, role: false, rm: false, network: false, admin: false, sendcvc: false, sales: false, account_management: false, create_business_type: false, update_business_type: false, delete_business_type: false, create_bill: false, update_soa: false, delete_soa: false, create_bankcode: false, update_bankcode: false, delete_bankcode: false, receive_payment: false, create_wht: false, create_bucket: false, update_bucket: false, delete_bucket: false, create_region: false, update_region: false, delete_region: false, logistics: false } }, roles: [], editRoles: { id: "", roles: { create_account: false, update_account: false, delete_account: false, create_client: false, update_client: false, delete_client: false, create_client_details: false, update_client_details: false, delete_client_details: false, create_package_type: false, update_package_type: false, delete_package_type: false, create_package: false, update_package: false, delete_package: false, create_modem: false, update_modem: false, delete_modem: false, create_engineer: false, update_engineer: false, delete_engineer: false, create_sales: false, update_sales: false, delete_sales: false, create_branch: false, update_branch: false, delete_branch: false, create_job_order: false, update_job_order: false, delete_job_order: false, create_ticket: false, update_ticket: false, delete_ticket: false, create_ticket_status: false, update_ticket_status: false, delete_ticket_status: false, create_olt: false, update_olt: false, delete_olt: false, create_pon: false, update_pon: false, delete_pon: false, create_event: false, update_event: false, delete_event: false, create_team: false, update_team: false, delete_team: false, create_area: false, update_area: false, delete_area: false, viewer: false, assign_team: false, assign_date: false, accounting: false, helpdesk: false, operator: false, role: false, rm: false, network: false, admin: false, sendcvc: false, sales: false, account_management: false, create_business_type: false, update_business_type: false, delete_business_type: false, create_bill: false, update_soa: false, delete_soa: false, create_bankcode: false, update_bankcode: false, delete_bankcode: false, receive_payment: false, create_wht: false, create_bucket: false, update_bucket: false, delete_bucket: false, create_region: false, update_region: false, delete_region: false, logistics: false } }, user_login: {}, roleList: { // sample: true, } }; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.getRoleGroups(); this.roles = this.$global.getRoles(); this.user_login = this.$global.getUser(); if (this.user_login.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, mounted: function mounted() { this.load(); this.totalRows = this.items.length; }, updated: function updated() {}, methods: { getRoleGroups: function getRoleGroups() { this.$http.get("api/RoleGroup").then(function (response) { this.items = response.body; this.tblisBusy = false; this.totalRows = this.items.length; }); }, load: function load() { this.$root.$emit("clearNav"); this.$nextTick(function () { setTimeout(function () { document.getElementById("accountsMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarAccounts").style.backgroundColor = "#2196f3"; }, 100); }); }, tblRowClass: function tblRowClass(item, type) { if (!item) return;else if (this.roles.update_account) { return "elClr cursorPointer"; } else return "elClr"; }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { this.$bvModal.show("modalEdit"); this.editRoles = item; this.editRoles.id = item.id; this.editRoles.roles = item.roleList; this.editRoles.roless = item.roles; }, reset: function reset() { this.role_group.roles = this.roleList; }, btnCreate: function btnCreate() { var _this = this; this.$validator.validateAll().then(function (result) { if (result) { _this.$root.$emit("pageLoading"); _this.$http.post("api/RoleGroup", _this.role_group).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Created", "", "success"); _this.role_group.name = ""; _this.items = response.body; _this.totalRows = _this.items.length; _this.tblisBusy = false; _this.$bvModal.hide("modalAdd"); _this.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { _this.$root.$emit("pageLoaded"); }); }); } }); }, btnUpdate: function btnUpdate() { var _this2 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this2.$root.$emit("pageLoading"); _this2.$http.put("api/RoleGroup/" + _this2.editRoles.id, _this2.editRoles).then(function (response) { console.log(response.body); _this2.items = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success"); _this2.$bvModal.hide("modalRoles"); _this2.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { _this2.$root.$emit("pageLoaded"); }); }); } }); } } }); /***/ }), /* 534 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select__ = __webpack_require__(11); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_search_select___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_search_select__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_sweetalert___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_sweetalert__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__ = __webpack_require__(30); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_input__ = __webpack_require__(535); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_input___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_input__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect__ = __webpack_require__(31); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vue_multiselect__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sweetalert2__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_sweetalert2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_sweetalert2__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__ = __webpack_require__(102); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_pc_bootstrap4_datetimepicker_build_css_bootstrap_datetimepicker_css__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker__ = __webpack_require__(26); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_ticket_filter_vue__ = __webpack_require__(536); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__modal_vue_modal_client_filter_vue__ = __webpack_require__(202); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__modal_vue_modal_ticket_group_vue__ = __webpack_require__(538); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_vue_upload_drop_images__ = __webpack_require__(205); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__modal_vue_modal_fsr_vue__ = __webpack_require__(124); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_jspdf__ = __webpack_require__(541); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_jspdf___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15_jspdf__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_html2canvas__ = __webpack_require__(543); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_html2canvas___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_16_html2canvas__); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ components: { //"json-excel": JsonExcel, multiselect: __WEBPACK_IMPORTED_MODULE_5_vue_multiselect___default.a, "date-picker": __WEBPACK_IMPORTED_MODULE_7_vue_bootstrap_datetimepicker___default.a, "model-list-select": __WEBPACK_IMPORTED_MODULE_0_vue_search_select__["ModelListSelect"], modal_ticket_filter: __WEBPACK_IMPORTED_MODULE_10__modal_vue_modal_ticket_filter_vue__["a" /* default */], modal_client_filter: __WEBPACK_IMPORTED_MODULE_11__modal_vue_modal_client_filter_vue__["a" /* default */], modal_ticket_group: __WEBPACK_IMPORTED_MODULE_12__modal_vue_modal_ticket_group_vue__["a" /* default */], "p-check": __WEBPACK_IMPORTED_MODULE_2_pretty_checkbox_vue_check___default.a, "p-input": __WEBPACK_IMPORTED_MODULE_3_pretty_checkbox_vue_input___default.a, "p-radio": __WEBPACK_IMPORTED_MODULE_4_pretty_checkbox_vue_radio___default.a, "rangedate-picker": __WEBPACK_IMPORTED_MODULE_9_vue_rangedate_picker___default.a, UploadImages: __WEBPACK_IMPORTED_MODULE_13_vue_upload_drop_images__["a" /* default */], jsPDF: __WEBPACK_IMPORTED_MODULE_15_jspdf___default.a, Swal2: __WEBPACK_IMPORTED_MODULE_6_sweetalert2___default.a, modal_fsr: __WEBPACK_IMPORTED_MODULE_14__modal_vue_modal_fsr_vue__["a" /* default */] }, data: function data() { var _ref; return _ref = { isShowing: false, slide: 0, sliding: null, show: false, tblisBusy: true, sortBy: "updated_at", sortDesc: true, statfield: [{ key: "name", label: "Status", sortable: true }, { key: "actions", label: "Actions" }], compField: [{ key: "name", label: "Complaint", sortable: true }, { key: "actions", label: "Actions" }], advField: [{ key: "name", label: "Template", sortable: true }, { key: "actions", label: "Actions" }], Status_Ticket: [], areas: [], ticketStat: { name: "" }, ticketComp: { name: "" }, manageAdv: { name: "", content: "" }, StattotalRows: 1, ComptotalRows: 1, AdvtotalRows: 1, fields: [{ key: "client.name", label: "Account Name", sortable: true }, { key: "compname", label: "Complaint", sortable: true }, { key: "action", label: "Action", sortable: true }, { key: "remarks", label: "Remarks", sortable: true }, { key: "statname", label: "Status", sortable: true }, { key: "technical_assigned", label: "Consolidated Tech", sortable: true }, { key: "created_at", sortable: true }, { key: "updated_at", sortable: true }], datenow: new Date(), dateTomorrow: new Date(), dateYesterday: new Date(), items: [], items_copy: [], tblFilter: null, tblFilter_copy: "", totalRows: 1, currentPage: 1, perPage: 50, pageOptions: [5, 10, 20, 50, 100], ticket: { ticketType: "1", client_id: "", region_id: "", user_id: "", complain: "", findings: "", action: "", remarks: "", Status_Ticket_id: "", area_id: "0", connection_status: null, team_assigned: "", technical_assigned: "", target_date: null, selected_trouble: [], attachments: [], complaint_new: null, bwmon: "", cacti: "", device: "", loss: "", downtime: "", multipleClients: [], clientRegion: null }, editTicket: { client_id: "", complain: "", findings: "", action: "", remarks: "", team_assigned: "", Status_Ticket_id: "", technical_assigned: "", downtime_hours: "", client: { name: "", location: "", contact: "" }, user: { name: "" }, selected_trouble: [], attachments: [], complaint_new: "", bwmon: "", cacti: "", device: "", loss: "", downtime: "", rep_findings: "", rep_action: "", rebatable: "" }, ticketGroup: { client_id: "", complain: "", findings: "", action: "", remarks: "", team_assigned: "", Status_Ticket_id: "", technical_assigned: "", downtime_hours: "", client: { name: "", location: "", contact: "" }, user: { name: "" }, selected_trouble: [], attachments: [], complaint_new: "", bwmon: "", cacti: "", device: "", loss: "", downtime: "", rep_findings: "", rep_action: "", rebatable: "" }, status_id_update: "", comp_id_update: "", adv_id_update: "", clients: [], roles: [], colConStatus: false, colAction: false, colRemarks: false, colTechAsign: false, colCreatedBy: true, colCreated: false, colUpdatedAt: false, colDateFixed: false, clientSelected: { id: "", region_id: "", package_type: { name: "" }, area_id: "0" }, AppliedDateoptions: { format: "YYYY-MM-DD", useCurrent: false }, DateTimeOptions: { format: "YYYY-MM-DD HH:mm", useCurrent: false, showClear: true, showClose: true }, user: [], totalPendings: 0, totalUrgents: 0, totalTechVisit: 0, totalITND: 0, totalTransfer: 0, totalDowntime: 0, totalObservation: 0, data: [], totalRebates: 0, packEdit: { package_id: "", package_type_id: "" }, editClient: { id: "", package_id: "", package_type_id: "" }, teams: [], packages: [], packageTypes: [], complaint_list: [], editChangeClient: false, ticket_update_target_date: { date_only: false, team_only: false, ticket_id: "", target_date: "", region_id: "", team_id: "", type: "ticket", name: "" }, rebate: { from: "", to: "", mrr: 0, days: 30, rate: 0, downtimeRate: 0, payable: 0, totalHour: 0 }, Addrebate: { from: "", to: "", totalHour: 0 }, reloader_counter: 0, reloader_interval: [], searchby_list: [{ name: "Ticket ID(last 4 digit)", id: "tickets.id" }, { name: "Group Ticket ID(last 2-4 digit)", id: "ticket_groups.id" }, { name: "Account Name", id: "clients.name" }, { name: "Ticket Group Name", id: "ticket_groups.downtime" }, { name: "Complaint", id: "complaint_lists.name" }, { name: "Findings", id: "findings" }, { name: "Consolidated Tech", id: "technical_assigned" }, { name: "Others", id: "tickets.complain" }], time: [{ name: "24 Hours", id: "1" }, { name: "48 Hours", id: "2" }, { name: "All", id: "3" }], searchby: "clients.name", trendTime: "", trendregion: "", remarksText: "", commentsText: [], remarks_id: "", selectedTemp: "", connection_status_list: [{ id: "up", name: "Up" }, { id: "down", name: "Down" }, { id: "slow", name: "Slow" }, { id: "intermittent", name: "Intermittent" }], complaints_new: [], emailTicketItem: [], ticket_exist: false, ticket_num: 0, selectedContacts: [], contacts: [], recipients: "", maxText: 450, msg: "", filterData: "table", selected_trouble: [], attachments: [], showSending: false, showSent: false, showFailed: false, regions: [], ref: [11769, 11768, 11767, 11766, 11765, 1136, 108, 57], clientRef: ["Client", "CDO Client", "Digos Clients", "Tagum Clients", "Gensan Client", "Butuan Client", "Valencia Client", "SanFranz Client"], clientRegions: [{ id: "108", name: "Davao Clients" }, { id: "11765", name: "CDO Clients" }, { id: "57", name: "Digos Clients" }, { id: "1136", name: "Tagum Clients" }, { id: "11766", name: "Gensan Clients" }, { id: "11767", name: "Butuan Clients" }, { id: "11768", name: "Valencia Clients" }, { id: "11769", name: "San Franz Clients" }], progressBar: false, templates: [], preview: "", filterIn: null, cbFilter: null, daterange: "", showComment: false, retRemarks: "", iPrev: 0, existTickets: [], delDetails: [], selectedClientRebates: [], date_effective: "", fsr_data: { user: { email: "" } }, addedClients: [] }, _defineProperty(_ref, "editChangeClient", false), _defineProperty(_ref, "clientField", [{ key: "client.name", label: "Name", sortable: true }, { key: "actions", label: "Actions" }]), _defineProperty(_ref, "clientOptions", []), _defineProperty(_ref, "isLoading", false), _defineProperty(_ref, "doSearch", false), _defineProperty(_ref, "search_loading", false), _defineProperty(_ref, "currentItem", 0), _defineProperty(_ref, "history_data", ""), _ref; }, beforeCreate: function beforeCreate() { this.$global.loadJS(); }, created: function created() { this.user = this.$global.getUser(); this.packageTypes = this.$global.getPackageTypes(); this.dateTomorrow.setDate(this.dateTomorrow.getDate() + 1); this.dateTomorrow = this.formatDate(this.dateTomorrow); this.dateYesterday.setDate(this.dateYesterday.getDate() - 1); this.dateYesterday = this.formatDate(this.dateYesterday); this.datenow = this.formatDate(this.datenow); this.regions = this.$global.getRegion(); this.roles = this.$global.getRoles(); this.teams = this.$global.getTeam(); this.Status_Ticket = this.$global.getTicketStatus(); this.changeColDisplay("colCreated"); this.loadClients(); this.loadComplaints(); this.loadTemplates(); }, mounted: function mounted() { var _this = this; this.load(); this.loadComplaints(); this.loadTemplates(); this.totalRows = this.items.length; this.StattotalRows = this.Status_Ticket.length; this.$root.$on("update_ticket_list", function (item, filt) { _this.items = item.items; _this.totalPendings = item.pendingCount; _this.totalUrgents = item.urgentCount; _this.totalTechVisit = item.techVisitCount; _this.totalTransfer = item.transferCount; _this.totalDowntime = item.downtimeCount; _this.totalObservation = item.observationCount; _this.totalITND = item.itndCount; _this.data = item.data; _this.reloader_counter++; _this.tblisBusy = false; _this.totalRows = _this.items.length; _this.filterIn = "multi"; _this.cbFilter = filt; }); this.$root.$on("add_data_to_recipient", function (item) { var items = item.items; items.forEach(function (item) { if (item.contact != null) { var temp = item.contact.split(","); temp.forEach(function (contact) { contact = contact.replace(/\/-/g, ""); if (contact.length == 11) { var data = { contact: contact, name: item.name }; _this.selectedContacts.push(data); } }); } }); }); this.$root.$on("add_data_to_client_ticket", function (item) { var items = item.items; items.forEach(function (item) { var data = { id: item.id, name: item.name }; _this.ticket.multipleClients.push(data); console.log(_this.ticket.multipleClients); }); }); }, updated: function updated() {}, methods: { load: function load() { var _this2 = this; this.$nextTick(function () { setTimeout(function () { document.getElementById("componentMenu").className = "customeDropDown dropdown-menu"; document.getElementById("navbarCalendar").style.backgroundColor = ""; document.getElementById("navbarTicket").style.backgroundColor = "#2196f3"; document.getElementById("navbarMap").style.backgroundColor = ""; document.getElementById("navbarInstallation").style.backgroundColor = ""; document.getElementById("navbarComponents").style.backgroundColor = ""; document.getElementById("navbarAccounts").style.backgroundColor = ""; }, 100); }); this.$http.post("api/getComplaint").then(function (response) { _this2.complaint_list = response.body; }); this.$http.get("api/area").then(function (response) { _this2.areas = response.body; }); this.$http.get("api/getContacts").then(function (response) { _this2.contacts = response.body; // console.log(response.body); }); this.$http.get("api/Package").then(function (response) { this.packages = response.body; }); this.$http.get("api/Ticket/subIndex/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.items_copy = response.body.items; this.totalPendings = response.body.pendingCount; this.totalUrgents = response.body.urgentCount; this.totalTechVisit = response.body.techVisitCount; this.totalTransfer = response.body.transferCount; this.totalDowntime = response.body.downtimeCount; this.totalObservation = response.body.observationCount; this.totalITND = response.body.itndCount; this.data = response.body.data; this.reloader_counter++; this.tblisBusy = false; this.totalRows = this.items.length; }); }, loadComplaints: function loadComplaints() { var _this3 = this; this.$http.get("api/ComplaintList").then(function (response) { _this3.complaints_new = response.body; _this3.ComptotalRows = _this3.complaints_new.length; }); }, loadClients: function loadClients() { this.$http.get("api/getClients/" + this.user.region_id).then(function (response) { this.clients = response.body; }); }, loadTemplates: function loadTemplates() { var _this4 = this; this.$http.get("api/Advisory").then(function (response) { _this4.templates = response.body; _this4.AdvtotalRows = _this4.templates.length; }); }, getClientDesc: function getClientDesc(client) { return client.name + " - " + client.region_name; }, reload_data: function reload_data() { if (this.tblisBusy == false) { this.tblisBusy = true; this.reloader_counter = 0; this.$http.get("api/Package").then(function (response) { this.packages = response.body; this.reloader_counter++; }); this.$http.get("api/PackageType").then(function (response) { this.$global.setPackageTypes(response.body); this.packageTypes = response.body; this.reloader_counter++; }); this.$http.get("api/TicketStatus").then(function (response) { this.$global.setTicketStatus(response.body); this.Status_Ticket = response.body; this.reloader_counter++; }); this.$http.get("api/Ticket/subIndex/" + this.user.region_id).then(function (response) { this.items = response.body.items; this.totalPendings = response.body.pendingCount; this.totalUrgents = response.body.urgentCount; this.totalTechVisit = response.body.techVisitCount; this.totalITND = response.body.itndCount; this.totalTransfer = response.body.transferCount; this.totalDowntime = response.body.downtimeCount; this.totalObservation = response.body.observationCount; this.data = response.body.data; this.reloader_counter++; }); this.$http.get("api/getClients/" + this.user.region_id).then(function (response) { this.clients = response.body; this.reloader_counter++; }); this.reloader_interval = setInterval(this.reloader_breaker, 100); } }, reloader_breaker: function reloader_breaker() { if (this.reloader_counter == 5) { this.tblisBusy = false; clearInterval(this.reloader_interval); } }, delStatus: function delStatus(item, index, button) { var _this5 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this Status", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this5.tblisBusy = true; _this5.$http.delete("api/TicketStatus/" + item.id).then(function (response) { _this5.$global.setTicketStatus(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this5.Status_Ticket = response.body; _this5.StattotalRows = _this5.Status_Ticket.length; _this5.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this5.tblisBusy = false; } }); }); } }); }, tblRowClass: function tblRowClass(Status_Ticket, type) { if (!Status_Ticket) return;else if (this.roles.update_ticket) { return "elClr cursorPointer"; } else return "elClr"; }, StattblRowClass: function StattblRowClass(Status_Ticket, type) { if (!Status_Ticket) return;else if (this.roles.update_statTicket) { return "elClr cursorPointer"; } else return "elClr"; }, ComptblRowClass: function ComptblRowClass(complaints_new, type) { if (!complaints_new) return;else if (this.roles.update_statTicket) { return "elClr cursorPointer"; } else return "elClr"; }, // AdvtblRowclass(templates, type) { // if (!templates) return; // else if (this.roles.update_statTicket) { // return "elClr cursorPointer"; // } else return "elClr"; // }, tblHeadClass: function tblHeadClass(item, type) { if (!item) return;else { return "elClr"; } }, StatonFiltered: function StatonFiltered(StatfilteredItems) { this.StattotalRows = StatfilteredItems.length; this.currentPage = 1; }, ComponFiltered: function ComponFiltered(CompfilteredItems) { this.ComptotalRows = CompfilteredItems.length; this.currentPage = 1; }, AdvonFiltered: function AdvonFiltered(AdvfilteredItems) { this.AdvtotalRows = AdvfilteredItems.length; this.currentPage = 1; }, onFiltered: function onFiltered(filteredItems) { this.totalRows = filteredItems.length; this.currentPage = 1; }, tblRowClicked: function tblRowClicked(item, index, event) { this.preview = ""; this.editTicket = item; console.log(this.editTicket); this.editChangeClient = false; this.commentsText = new Array(this.editTicket.remarks_log.length); var text = item.ticket_id; var result = text.includes("GRP"); if (result == true) { console.log("ticket group"); this.editTicket.ticketType = "3"; console.log(item); } else { console.log("individual"); this.editTicket.ticketType = "1"; console.log(item); } this.$bvModal.show("modalEditTicket"); // for adding client rebates this.selectedClientRebates.splice(0); var client = { id: item.client_id, name: item.client.name, package_mrr: null }; this.selectedClientRebates.push(client); }, addClientGroup: function addClientGroup() { var _this6 = this; this.addedClients.forEach(function (item) { var data = { ticket_group_id: _this6.editTicket.id, client_id: item.id, client: item }; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Client Added", "success"); _this6.editTicket.ticket_group_client.push(data); _this6.addedClients = []; }); }, removeClient: function removeClient(id) { for (var index = 0; index < this.editTicket.ticket_group_client.length; index++) { if (this.editTicket.ticket_group_client[index].client_id == id) { this.editTicket.ticket_group_client.splice(index, 1); } } }, handleOk: function handleOk(bvModalEvt) { bvModalEvt.preventDefault(); }, btnCreate: function btnCreate() { var _this7 = this; this.ticket.user_id = this.user.id; this.ticket.user_name = this.user.name; this.$validator.validateAll().then(function (result) { if (result) { _this7.tblisBusy = true; _this7.$root.$emit("pageLoading"); _this7.$http.post(_this7.$root2 + "api/Ticket", _this7.ticket).then(function (response) { console.log(response.body); _this7.ticket = { ticketType: "1", client_id: "", region_id: "", user_id: "", complain: "", findings: "", action: "", complaint_new: null, bwmon: "", device: "", loss: "", downtime: "", cacti: "", remarks: "", Status_Ticket_id: "", area_id: "0", connection_status: null, team_assigned: "", report: "", technical_assigned: "", target_date: null, selected_trouble: [], attachments: [], multipleClients: [], clientRegion: null }; _this7.items = response.body.items; _this7.items_copy = response.body.items; _this7.totalRows = _this7.items.length; _this7.$bvModal.hide("modalAddTicket"); _this7.tblisBusy = false; _this7.$root.$emit("pageLoaded"); _this7.totalPendings = response.body.pendingCount; _this7.totalUrgents = response.body.urgentCount; _this7.totalTechVisit = response.body.techVisitCount; _this7.totalITND = response.body.itndCount; _this7.totalTransfer = response.body.transferCount; _this7.totalDowntime = response.body.downtimeCount; _this7.totalObservation = response.body.observationCount; _this7.data = response.body.data; _this7.clientSelected = { id: "", area_id: "0", region_id: "", package_type: { name: "" } }; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ticket", "Added successfully", "success"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this7.tblisBusy = false; _this7.$root.$emit("pageLoaded"); }); } }); }, btnDelete: function btnDelete() { var _this8 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this Ticket permanently", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this8.items = []; _this8.tblisBusy = true; _this8.$root.$emit("pageLoading"); var data = { id: _this8.editTicket.id, region: _this8.user.region_id, filterIn: _this8.filterIn, cbFilter: _this8.cbFilter, searchby: _this8.searchby, tblFilter: _this8.tblFilter_copy, start: _this8.daterange.start, end: _this8.daterange.end, ticketType: _this8.editTicket.ticketType, user_id: _this8.user.id, user_name: _this8.user.name }; _this8.$http.post("api/Ticket/deleteTicket", data).then(function (response) { console.log(response.body); _this8.$bvModal.hide("modalEditTicket"); _this8.items_copy = response.body.items; _this8.totalPendings = response.body.pendingCount; _this8.totalUrgents = response.body.urgentCount; _this8.totalTechVisit = response.body.techVisitCount; _this8.totalITND = response.body.itndCount; _this8.totalTransfer = response.body.transferCount; _this8.totalDowntime = response.body.downtimeCount; _this8.totalObservation = response.body.observationCount; _this8.data = response.body.data; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this8.items = response.body.items; _this8.totalRows = _this8.items.length; _this8.tblisBusy = false; _this8.$root.$emit("pageLoaded"); }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, btnUpdate: function btnUpdate() { var _this9 = this; this.editTicket.updated_by = this.user.name; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this Ticket?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this9.$root.$emit("pageLoading"); _this9.editTicket.region_id = _this9.user.region_id; _this9.editTicket.user_name = _this9.user.name; _this9.editTicket.attachments = _this9.ticket.attachments; _this9.editTicket.filterIn = _this9.filterIn; _this9.editTicket.cbFilter = _this9.cbFilter; _this9.editTicket.searchby = _this9.searchby; _this9.editTicket.tblFilter = _this9.tblFilter_copy; _this9.editTicket.start = _this9.daterange.start; _this9.editTicket.end = _this9.daterange.end; _this9.$http.put(_this9.$root2 + "api/Ticket/" + _this9.editTicket.id, _this9.editTicket).then(function (response) { _this9.items = response.body.items; _this9.items_copy = response.body.items; // this.filterIn = null; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this9.$bvModal.hide("modalEditTicket"); _this9.totalPendings = response.body.pendingCount; _this9.totalUrgents = response.body.urgentCount; _this9.totalTechVisit = response.body.techVisitCount; _this9.totalITND = response.body.itndCount; _this9.totalTransfer = response.body.transferCount; _this9.totalDowntime = response.body.downtimeCount; _this9.totalObservation = response.body.observationCount; _this9.data = response.body.data; _this9.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this9.$root.$emit("pageLoaded"); }); } }); } }); }, openModalUpdateTargetDate: function openModalUpdateTargetDate(item) { if (this.roles.update_ticket) { this.ticket_update_target_date.team_only = false; this.ticket_update_target_date.date_only = false; this.ticket_update_target_date.target_date = ""; this.ticket_update_target_date.current_target_date = item.target_date; this.ticket_update_target_date.team_id = ""; this.ticket_update_target_date.ticket_id = item.id; this.ticket_update_target_date.region_id = this.user.region_id; this.ticket_update_target_date.name = item.name; this.$bvModal.show("modal-update-target-date"); } }, updateDateClicked: function updateDateClicked(bvModalEvt) { bvModalEvt.preventDefault(); if (this.ticket_update_target_date.target_date != "" || this.ticket_update_target_date.team_only == true) { if (this.formatDate(this.ticket_update_target_date.target_date) >= this.datenow) { if (this.ticket_update_target_date.team_id != "" || this.ticket_update_target_date.date_only == true) { this.updateTargetDate(); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ops.", "Please select team", "warning"); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ops.", "Please select present or future dates only", "warning"); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Ops.", "Please select date first", "warning"); }, updateTargetDate: function updateTargetDate() { var _this10 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "", icon: "info", buttons: ["No", "Yes"] }).then(function (yes) { if (yes) { _this10.tblisBusy = true; _this10.$root.$emit("pageLoading"); _this10.ticket_update_target_date.user_id = _this10.user.id; _this10.ticket_update_target_date.user_name = _this10.user.name; _this10.ticket_update_target_date.filterIn = _this10.filterIn; _this10.ticket_update_target_date.cbFilter = _this10.cbFilter; _this10.ticket_update_target_date.searchby = _this10.searchby; _this10.ticket_update_target_date.tblFilter = _this10.tblFilter_copy; _this10.$http.post("api/Ticket/updateTargetDate", _this10.ticket_update_target_date).then(function (response) { _this10.$bvModal.hide("modal-update-target-date"); _this10.items_copy = response.body.items; _this10.tblisBusy = false; _this10.$root.$emit("pageLoaded"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated", "", "success").then(function (value) { _this10.items = response.body.items; _this10.totalRows = _this10.items.length; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); }, OpenModalEmailTicket: function OpenModalEmailTicket() { var _this11 = this; this.$http.post("api/Ticket/emailTicket").then(function (response) { console.log(response.body); _this11.emailTicketItem = response.body.items; _this11.$bvModal.show("modalEmailTicket"); }).catch(function (response) { console.log(response); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); }, OpenModeleditStat: function OpenModeleditStat(item, index, button) { this.status_id_update = item.id; this.$bvModal.show("editStatmodal"); }, OpenModeleditComp: function OpenModeleditComp(item, index, button) { this.comp_id_update = item.id; this.$bvModal.show("editCompmodal"); }, OpenModeleditAdv: function OpenModeleditAdv(item, index, button) { this.loadTemplates(); this.adv_id_update = item.id; this.manageAdv.name = item.name; this.manageAdv.content = item.content; this.$bvModal.show("editAdvmodal"); }, btnAddStat: function btnAddStat() { var _this12 = this; this.$validator.validateAll().then(function (result) { if (result) { _this12.ticketStat.user_id = _this12.user.id; _this12.ticketStat.user_name = _this12.user.name; _this12.$http.post("api/TicketStatus", _this12.ticketStat).then(function (response) { _this12.Status_Ticket = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Status", "Added successfully", "success"); _this12.ticketStat.name = ""; _this12.$global.setTicketStatus(response.body); _this12.StattotalRows = _this12.Status_Ticket.length; _this12.$bvModal.hide("modalAddStat"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, StatbtnUpdate: function StatbtnUpdate() { var _this13 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this status?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this13.tblisBusy = true; _this13.ticketStat.user_id = _this13.user.id; _this13.ticketStat.user_name = _this13.user.name; _this13.$http.put("api/TicketStatus/" + _this13.status_id_update, _this13.ticketStat).then(function (response) { _this13.Status_Ticket = response.body; _this13.$global.setTicketStatus(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this13.$bvModal.hide("editStatmodal"); _this13.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, changeColDisplay: function changeColDisplay(check) { this.fields = [ // { // key: "mTicket_id", // label: "Ticket No.", // sortable: true, // formatter: (value) => { // return "" + value + ""; // }, // }, { key: "statname", label: "Status", sortable: true, formatter: function formatter(value) { if (value == "Close") return ' Fixed ';else if (value == "For Rebates") return ' For Rebates ';else if (value == "Pending") return ' Pending ';else if (value == "For ITND") return ' For ITND ';else if (value == "Urgent") return ' Urgent ';else if (value == "For Tech Visit") return ' For tech visit ';else if (value == "Modem/Line Transfer") return ' Modem/Line Transfer ';else return value; } }, { key: "target_date", label: "Target Date", sortable: true }, { key: "aging", label: "Aging", sortable: true }, { key: "diffHuman", label: "Downtime", sortable: true }, { key: "account_details", label: "Ticket Details" }, // { key: "group_name", label: "Ticket Group", sortable: true }, { key: "area_name", label: "Area", formatter: function formatter(value, key, item) { if (value == null && !item.ticket_id.includes("GRP")) { if (item.client.area != null) return item.client.area.name;else return ""; } else { return value; } }, sortable: true // { // key: "client.location", // label: "Address", // formatter: (value) => { // var temp = ""; // if (value != null) { // if (value.length > 50) temp = "..."; // return value.slice(0, 50) + temp; // } else return ""; // }, // }, }]; if ("forExport" == check) { var temp = { key: "client_name", label: "Client Name", formatter: function formatter(value, key, item) { if (item.ticket_group_client == null) { return item.client.name; } else { var temp = ""; item.ticket_group_client.forEach(function (e) { temp += e.client.name + ", "; }); return temp; } } }; this.fields.push(temp); var temp = { key: "compname", label: "Complaint" }; this.fields.push(temp); var temp4 = { key: "technical_assigned", label: "Consolidated Tech", sortable: true }; this.fields.push(temp4); var findings = { key: "rep_findings", label: "Findings", sortable: true }; this.fields.push(findings); var action = { key: "rep_action", label: "Action", sortable: true }; this.fields.push(action); var date_time_fixed = { key: "date_time_fixed", label: "Date Time Fixed", sortable: true }; this.fields.push(date_time_fixed); var downtime_hours = { key: "downtime_hours", label: "Downtime Hours", sortable: true }; this.fields.push(downtime_hours); var created_at = { key: "created_at", sortable: true }; this.fields.push(created_at); var updated_at = { key: "updated_at", sortable: true }; this.fields.push(updated_at); } else { if ("colConStatus" == check) { this.colConStatus = !this.colConStatus; } if (this.colConStatus) this.fields.splice(1, 0, { key: "connection_status", label: "Con. Status", sortable: true, formatter: function formatter(value) { if (value == "up") return ' UP ';else if (value == "down") return ' DOWN ';else if (value == "intermittent") return ' INTERMITTENT ';else return value; } }); // var temp = { // key: "compname", // label: "Complaint", // }; // this.fields.push(temp); if ("colAction" == check) { this.colAction = !this.colAction; } if (this.colAction) { var temp = { key: "action", label: "Action", formatter: function formatter(value) { var temp = ""; if (value != null) { if (value.length > 50) temp = "..."; return value.slice(0, 50) + temp; } else return ""; } }; this.fields.push(temp); } if ("colRemarks" == check) { this.colRemarks = !this.colRemarks; } if (this.colRemarks) { var temp = { key: "remarks", label: "Remarks", formatter: function formatter(value) { var temp = ""; if (value != null) { if (value.length > 50) temp = "..."; return value.slice(0, 50) + temp; } else return ""; } }; this.fields.push(temp); } if ("colTechAsign" == check) { this.colTechAsign = !this.colTechAsign; } if (this.colTechAsign) { var temp = { key: "technical_assigned", label: "Consolidated Tech", sortable: true }; this.fields.push(temp); } if ("colCreatedBy" == check) { this.colCreatedBy = !this.colCreatedBy; } if (this.colCreatedBy) { var temp = { key: "user.name", label: "Created By", sortable: true }; this.fields.push(temp); } if ("colCreated" == check) { this.colCreated = !this.colCreated; } if (this.colCreated) { var temp = { key: "created_at", label: "Created At", sortable: true }; this.fields.push(temp); } if ("colUpdatedAt" == check) { this.colUpdatedAt = !this.colUpdatedAt; } if (this.colUpdatedAt) { var temp = { key: "updated_at", label: "Updated At", sortable: true }; this.fields.push(temp); } } if (this.user.id == 1) { var temp = { key: "id", label: "ID", sortable: true }; this.fields.push(temp); } }, onChangeSelectClientEdit: function onChangeSelectClientEdit() { var _this14 = this; console.log("11111"); if (this.clientSelected != null) { if (this.clientSelected.id != null) { this.$http.get("api/checkTicket/" + this.clientSelected.id).then(function (response) { console.log(response.body); var except = [108, 11767, 11765, 57, 11766, 11769, 1136, 11768]; if (response.body.ticket == null) { _this14.ticket_exist = false; _this14.editTicket.area_id = response.body.area; console.log("ok"); } else { if (except.includes(_this14.clientSelected.id)) { _this14.ticket_exist = false; console.log("ddddd"); } else { _this14.ticket_exist = true; _this14.ticket_num = response.body.ticket.ticket_id + "" + response.body.ticket.id; console.log("aaaaa"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Warning!", "You have entered client with pending ticket, please check " + _this14.ticket_num, "warning"); } _this14.editTicket.area_id = response.body.area; } }); } if (this.clientSelected.package_type_name == null) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Warning", text: "This account has no package type, Do you want to add package type to this account?", icon: "warning", buttons: ["No", "Yes"] }).then(function (value) { if (value) { _this14.editClient.id = _this14.clientSelected.id; _this14.$bvModal.show("modalUpdatePackage"); _this14.clientSelected = { id: "", region_id: "", package_type: { name: "" } }; } else { _this14.clientSelected = { id: "", region_id: "", package_type: { name: "" } }; } }); } else { // console.log(this.clientSelected); // const dt1 = new Date(); this.editTicket.client_id = this.clientSelected.id; this.editTicket.region_id = this.clientSelected.region_id; // this.editTicket.ticket_id = // this.clientSelected.package_type_name + // dt1.getFullYear().toString() + // ("0" + (dt1.getMonth() + 1)).slice(-2) + // ("0" + dt1.getDate()).slice(-2); } } }, onChangeSelectClient: function onChangeSelectClient() { var _this15 = this; if (this.clientSelected != null) { if (this.clientSelected.id != null) { this.$http.get("api/checkTicket/" + this.clientSelected.id).then(function (response) { console.log(response.body); var except = [108, 11767, 11765, 57, 11766, 11769, 1136, 11768]; if (response.body.ticket == null) { _this15.ticket_exist = false; _this15.ticket.area_id = response.body.area; console.log("ok"); } else { if (except.includes(_this15.clientSelected.id)) { _this15.ticket_exist = false; console.log("ddddd"); } else { _this15.ticket_exist = true; _this15.ticket_num = response.body.ticket.ticket_id + "" + response.body.ticket.id; console.log("aaaaa"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Warning!", "You have entered client with pending ticket, please check " + _this15.ticket_num, "warning"); } _this15.ticket.area_id = response.body.area; } }); } if (this.clientSelected.package_type_name == null) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Warning", text: "This account has no package type, Do you want to add package type to this account?", icon: "warning", buttons: ["No", "Yes"] }).then(function (value) { if (value) { _this15.editClient.id = _this15.clientSelected.id; _this15.$bvModal.show("modalUpdatePackage"); _this15.clientSelected = { id: "", region_id: "", package_type: { name: "" } }; } else { _this15.clientSelected = { id: "", region_id: "", package_type: { name: "" } }; } }); } else { var dt1 = new Date(); this.ticket.client_id = this.clientSelected.id; this.ticket.region_id = this.clientSelected.region_id; this.ticket.ticket_id = this.clientSelected.package_type_name + dt1.getFullYear().toString() + ("0" + (dt1.getMonth() + 1)).slice(-2) + ("0" + dt1.getDate()).slice(-2); } } }, onDateSelected: function onDateSelected(daterange) { var _this16 = this; this.filterIn = null; this.daterange = daterange; this.$root.$emit("pageLoading"); daterange.region_id = this.user.region_id; // this.tblisBusy = true; this.$http.post("api/Ticket/filterByDate", daterange).then(function (response) { _this16.filterIn = "date"; _this16.items = response.body.items; _this16.totalRows = _this16.items.length; // this.tblisBusy = false; _this16.$root.$emit("pageLoaded"); }); }, formatDate: function formatDate(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("-"); }, formatDateDefualt: function formatDateDefualt(date) { var d = new Date(date), month = "" + (d.getMonth() + 1), day = "" + d.getDate(), year = d.getFullYear(); if (month.length < 2) month = "0" + month; if (day.length < 2) day = "0" + day; return [year, month, day].join("/"); }, filterChange: function filterChange(txt) { var _this17 = this; this.filterIn = null; this.$root.$emit("pageLoading"); if (txt == "0") { this.$http.post("api/Ticket/getDowntime").then(function (response) { console.log(response.body); _this17.items = response.body.items; _this17.totalRows = _this17.items.length; _this17.filterIn = "downtime"; _this17.$root.$emit("pageLoaded"); }); } else { this.$http.get("api/Ticket/search_data/Status_Ticket_id/" + txt).then(function (response) { _this17.filterIn = "badge"; _this17.tblFilter_copy = txt; _this17.items = response.body.items; _this17.totalRows = _this17.items.length; _this17.$root.$emit("pageLoaded"); }); } }, // downtimeTickets() { // this.filterIn = "downtime"; // this.$root.$emit("pageLoading"); // this.$http.post("api/Ticket/getDowntime").then((response) => { // console.log(response.body); // this.items = response.body.items; // this.totalRows = this.items.length; // this.filterIn = "downtime"; // this.$root.$emit("pageLoaded"); // }); // }, filterClear: function filterClear() { this.tblFilter = ""; this.tblFilter_copy = ""; this.items = this.items_copy; this.totalRows = this.items.length; }, dateDiffInDays: function dateDiffInDays(a, b) { var dt1 = new Date(b); var dt2 = new Date(a); return Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate())) / (1000 * 60 * 60 * 24)); }, fnExcelReport: function fnExcelReport(tbl) { this.changeColDisplay("forExport"); this.currentPage = 1; this.perPage = this.totalRows; this.$global.excelReportCSV(tbl, "Ticket Table", this); // this.$nextTick(function () { // setTimeout( // function () { // var tab_text = ""; // var textRange; // var j = 0; // var tab = document.getElementById(tbl); // id of table // for (j = 0; j < tab.rows.length; j++) { // tab_text = tab_text + tab.rows[j].innerHTML + ""; // //tab_text=tab_text+""; // } // tab_text = tab_text + "
"; // tab_text = tab_text.replace(/]*>|<\/A>/g, ""); //remove if u want links in your table // tab_text = tab_text.replace(/]*>/gi, ""); // remove if u want images in your table // tab_text = tab_text.replace(/]*>|<\/input>/gi, ""); // reomves input params // var ua = window.navigator.userAgent; // var msie = ua.indexOf("MSIE "); // if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { // // If Internet Explorer // txtArea1.document.open("txt/html", "replace"); // txtArea1.document.write(tab_text); // txtArea1.document.close(); // txtArea1.focus(); // var sa = txtArea1.document.execCommand( // "SaveAs", // true, // "Say Thanks to Sumit.xls" // ); // } //other browser not tested on IE 11 // else // var sa = window.open( // "data:application/vnd.ms-excel," + encodeURIComponent(tab_text) // ); // this.changeColDisplay(""); // this.perPage = 50; // return sa; // }.bind(this), // 1000 // ); // }); this.$nextTick(function () { setTimeout(function () { this.changeColDisplay(""); this.perPage = 50; }.bind(this), 3000); }); }, onChangeEditclient: function onChangeEditclient() { this.editClient.package_id = this.packEdit.id; this.editClient.package_type_id = this.packEdit.package_type.id; }, btnUpdatePackage: function btnUpdatePackage(element) { var _this18 = this; if (this.editClient.package_type_id != "") { element.target.disabled = true; this.$http.post("api/updatePackage", this.editClient).then(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Updated!", "Please re select account", "success"); element.target.disabled = false; _this18.clients = response.body; _this18.$bvModal.hide("modalUpdatePackage"); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("", "Please select a package first", "info"); } }, autocomplete: function autocomplete(inp, arr, dat) { var currentFocus; /*execute a function when someone writes in the text field:*/ var thisisthis = this; inp.addEventListener("input", function (e) { var a, b, i, val = this.value; /*close any already open lists of autocompleted values*/ closeAllLists(); if (!val) { return false; } currentFocus = -1; /*create a DIV element that will contain the items (values):*/ a = document.createElement("DIV"); a.setAttribute("id", this.id + "autocomplete-list"); a.setAttribute("class", "autocomplete-items"); /*append the DIV element as a child of the autocomplete container:*/ this.parentNode.appendChild(a); /*for each item in the array...*/ for (i = 0; i < arr.length; i++) { /*check if the item starts with the same letters as the text field value:*/ if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) { /*create a DIV element for each matching element:*/ b = document.createElement("DIV"); /*make the matching letters bold:*/ b.innerHTML = "" + arr[i].substr(0, val.length) + ""; b.innerHTML += arr[i].substr(val.length); /*insert a input field that will hold the current array item's value:*/ b.innerHTML += ""; b.addEventListener("click", function (e) { /*insert the value for the autocomplete text field:*/ inp.value = this.getElementsByTagName("input")[0].value; if (dat == "createticket") thisisthis.ticket.complain = this.getElementsByTagName("input")[0].value; if (dat == "editticket") thisisthis.editTicket.complain = this.getElementsByTagName("input")[0].value; closeAllLists(); }); a.appendChild(b); } } }); inp.addEventListener("keydown", function (e) { var x = document.getElementById(this.id + "autocomplete-list"); if (x) x = x.getElementsByTagName("div"); if (e.keyCode == 40) { currentFocus++; addActive(x); } else if (e.keyCode == 38) { currentFocus--; addActive(x); } else if (e.keyCode == 13) { /*If the ENTER key is pressed, prevent the form from being submitted,*/ e.preventDefault(); if (currentFocus > -1) { /*and simulate a click on the "active" item:*/ if (x) x[currentFocus].click(); } } }); function addActive(x) { /*a function to classify an item as "active":*/ if (!x) return false; /*start by removing the "active" class on all items:*/ removeActive(x); if (currentFocus >= x.length) currentFocus = 0; if (currentFocus < 0) currentFocus = x.length - 1; /*add class "autocomplete-active":*/ x[currentFocus].classList.add("autocomplete-active"); } function removeActive(x) { /*a function to remove the "active" class from all autocomplete items:*/ for (var i = 0; i < x.length; i++) { x[i].classList.remove("autocomplete-active"); } } function closeAllLists(elmnt) { var x = document.getElementsByClassName("autocomplete-items"); for (var i = 0; i < x.length; i++) { if (elmnt != x[i] && elmnt != inp) { x[i].parentNode.removeChild(x[i]); } } } document.addEventListener("click", function (e) { closeAllLists(e.target); }); }, btnRebates: function btnRebates() { this.rebate.mrr = 0; this.rebate.days = 30; this.rebate.downtimeRate = 0; this.rebate.payable = 0; this.rebate.totalHour = this.editTicket.downtime_hours; var rate = 0; var totalHr = this.editTicket.downtime_hours; if (totalHr > 24) { while (totalHr > 24) { rate++; totalHr -= 24; } } if (totalHr >= 15) { rate++; totalHr = 0; } if (totalHr >= 12) { rate += 0.8; totalHr = 0; } if (totalHr >= 9) { rate += 0.6; totalHr = 0; } if (totalHr >= 6) { rate += 0.4; totalHr = 0; } if (totalHr >= 3) { rate += 0.2; totalHr = 0; } if (totalHr >= 0.5) { rate += 0.1; totalHr = 0; } this.rebate.rate = rate; this.$bvModal.show("modalCalculateRebates"); }, calculateRebates: function calculateRebates() { this.rebate.downtimeRate = this.rebate.mrr / this.rebate.days * this.rebate.rate; this.rebate.payable = this.rebate.mrr - this.rebate.downtimeRate; // this.$http.post("api/CalculateRebates", this.rebate).then(response => { // //console.log(response.body); // this.rebate.totalHour = response.body.totalHour; // this.rebate.rate = response.body.rate; // this.rebate.downtimeRate = response.body.downtimeRate; // this.rebate.payable = response.body.payable; // }); }, countHours: function countHours(date1, date2) { var dt1 = new Date(date1); var dt2 = new Date(date2); var hours = Math.abs(dt1 - dt2) / 36e5; return hours.toFixed(1); }, btnAddRebates: function btnAddRebates() { this.Addrebate.id = this.editTicket.id; this.Addrebate.totalHour = 0; // this.Addrebate.from = this.editTicket.created_at; // this.Addrebate.to = this.editTicket.updated_at; this.$bvModal.show("modalAddRebates"); // this.calculateHours(); // console.log(this.Addrebate); }, calculateHours: function calculateHours() { this.Addrebate.totalHour = this.countHours(this.Addrebate.from, this.Addrebate.to); }, AddRebates_ok: function AddRebates_ok() { var _this19 = this; this.tblisBusy = true; this.Addrebate.region_id = this.user.region_id; this.$http.post("api/updateRebates", this.Addrebate).then(function (response) { _this19.items = response.body.items; _this19.items_copy = response.body.items; _this19.totalPendings = response.body.pendingCount; _this19.totalUrgents = response.body.urgentCount; _this19.totalTechVisit = response.body.techVisitCount; _this19.totalITND = response.body.itndCount; _this19.totalTransfer = response.body.transferCount; _this19.totalDowntime = response.body.downtimeCount; _this19.totalObservation = response.body.observationCount; _this19.data = response.body.data; _this19.$bvModal.hide("modalAddRebates"); _this19.$bvModal.hide("modalEditTicket"); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("", "Rebate added", "success"); _this19.tblisBusy = false; }); }, mousemove: function mousemove(e) { var scrol = document.getElementById("scrollmenuContainer"); var wth = window.innerWidth - 200; if (wth < e.clientX) { scrol.scrollLeft += 5; } if (200 > e.clientX) { scrol.scrollLeft -= 5; } // console.log(scrol.scrollLeft); // console.log(e.clientX); // console.log(window.innerWidth); }, search_data: function search_data() { var _this20 = this; if (this.tblFilter_copy != "") { this.$root.$emit("pageLoading"); var escape_string = this.tblFilter_copy.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.filterIn = null; // this.tblisBusy = true; this.$http.get("api/Ticket/search_data/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); _this20.filterIn = "search"; _this20.items = response.body.items; _this20.totalRows = _this20.items.length; _this20.doSearch = false; _this20.tblisBusy = false; _this20.$root.$emit("pageLoaded"); }); } }, addRemarks_clicked: function addRemarks_clicked() { var _this21 = this; if (this.remarksText != "") { var data = { ticket_id: this.editTicket.id, user_id: this.user.id, remarks: this.remarksText, form_type: "ticket", ticketType: this.editTicket.ticketType }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this21.remarksText = ""; _this21.editTicket.remarks_log = response.body; console.log(response.body); }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the remarks text area"); } }, addComments_clicked: function addComments_clicked(id, i, stor) { var _this22 = this; if (this.commentsText[i] != "") { var data = { remarks_id: id, user_id: this.user.id, user: this.user, comments: this.commentsText[i], ticket_id: this.editTicket.id, ticketType: this.editTicket.ticketType }; // stor.push(data); this.$http.post("api/TicketCommentsLog", data).then(function (response) { // this.commentsText = []; // this.commentsText = ""; _this22.editTicket.remarks_log = response.body; }); } else { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Please add some text in the comments text area"); } }, updateremarksss: function updateremarksss() { var _this23 = this; this.$root.$emit("pageLoading"); this.$http.post("api/TicketRemarksLog/moveTicketRemarks").then(function (response) { console.log(response.body); _this23.$root.$emit("pageLoaded"); }); }, datetimeChange: function datetimeChange() { var hours = Math.abs(new Date(this.editTicket.created_at) - new Date(this.editTicket.date_time_fixed)) / 36e5; this.editTicket.downtime_hours = hours; }, Add_to_SOA: function Add_to_SOA() { var _this24 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Add rebated to SOA?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this24.$root.$emit("pageLoading"); _this24.editTicket.region_id = _this24.user.region_id; _this24.editTicket.user_name = _this24.user.name; _this24.editTicket.to_soa = 1; _this24.$http.put("api/Ticket/" + _this24.editTicket.id, _this24.editTicket).then(function (response) { _this24.items = response.body.items; _this24.items_copy = response.body.items; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this24.$bvModal.hide("modalEditTicket"); _this24.$root.$emit("pageLoaded"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this24.$root.$emit("pageLoaded"); }); } }); }, EmailElement: function EmailElement(id) { var _this25 = this; //sad var bodymsg = document.getElementById(id).innerHTML; this.$bvModal.hide("modalEmailTicket"); __WEBPACK_IMPORTED_MODULE_6_sweetalert2___default.a.fire({ title: "Enter passcode to send", input: "password", showCancelButton: true, confirmButtonText: "Ok" }).then(function (value) { console.log(value); if (value.value == "send") { var data = { subject: "(Beta)List of tickets that has no connection", msg: bodymsg, user_email: _this25.user.name, user_name: _this25.user.email, sendTo: [{ email: "gquisido@dctechmicro.com", name: "Glenn T. Quisido" }], CCTO: [{ email: _this25.user.email, name: _this25.user.name }, { email: "egdoromal@dctechmicro.com", name: "Elric Guy Doromal" }, { email: "earawiran@dctechmicro.com", name: "Edward Ellie V. Arawiran" }] }; console.log(data); _this25.$http.post("api/Billing/emailSOA", data).then(function (response) { if (response.body == "ok") __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Email Sent!");else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Send Failed"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error + " " + response.body.message, icon: "error", dangerMode: true }); _this25.tblisBusy = false; }); } else __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Wrong password"); }); }, send: function send() { var _this26 = this; this.showSent = false; this.showFailed = false; this.showSending = true; this.$bvModal.hide("modalSendText"); var data = { number: this.selectedContacts, msg: this.msg }; this.$http.post("api/Ticket/sendText", data).then(function (response) { console.log(response.body); if (response.body.message == "sent successfully") { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Message Sent Successfully!"); _this26.showSending = false; _this26.showSent = true; } else { _this26.showFailed = true; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Sending Failed!"); } }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); _this26.showFailed = true; }); }, addTag: function addTag(newTag) { var tag = { name: newTag, contact: newTag }; this.contacts.push(tag); this.selectedContacts.push(tag); }, handleImages: function handleImages(e) { var _this27 = this; this.ticket.attachments = []; e.forEach(function (item) { var fileReader = new FileReader(); fileReader.readAsDataURL(item); fileReader.onload = function (item) { _this27.ticket.attachments.push(item.target.result); console.log(_this27.ticket.attachments); }; }); }, generateTrend: function generateTrend() { var _this28 = this; console.log(this.trendTime); var trend = { trendTime: this.trendTime, trendregion: this.trendregion }; this.$http.post("api/getTrend", trend).then(function (response) { console.log(response.body); _this28.totalPendings = response.body.pendingCount; _this28.totalUrgents = response.body.urgentCount; _this28.totalTechVisit = response.body.techVisitCount; _this28.totalTransfer = response.body.transferCount; _this28.totalDowntime = response.body.downtimeCount; _this28.totalObservation = response.body.observationCount; _this28.totalITND = response.body.itndCount; }); }, clearTrend: function clearTrend() { this.trendregion = ""; this.trendTime = 3; this.$http.get("api/Ticket/subIndex/" + this.user.region_id).then(function (response) { console.log(response.body.data); this.totalPendings = response.body.pendingCount; this.totalUrgents = response.body.urgentCount; this.totalTechVisit = response.body.techVisitCount; this.totalITND = response.body.itndCount; this.totalTransfer = response.body.transferCount; this.totalDowntime = response.body.downtimeCount; this.totalObservation = response.body.observationCount; this.data = response.body.data; this.reloader_counter++; }); }, btnAddComp: function btnAddComp() { var _this29 = this; this.$validator.validateAll().then(function (result) { if (result) { _this29.ticketComp.user_id = _this29.user.id; _this29.ticketComp.user_name = _this29.user.name; _this29.$http.post("api/ComplaintList", _this29.ticketComp).then(function (response) { _this29.complaints_new = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Complaint", "Added successfully", "success"); _this29.ticketComp.name = ""; _this29.ComptotalRows = _this29.complaints_new.length; _this29.$bvModal.hide("modalAddComp"); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, CompbtnUpdate: function CompbtnUpdate() { var _this30 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this complaint?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this30.tblisBusy = true; _this30.ticketComp.user_id = _this30.user.id; _this30.ticketComp.user_name = _this30.user.name; _this30.$http.put("api/ComplaintList/" + _this30.comp_id_update, _this30.ticketComp).then(function (response) { _this30.complaints_new = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this30.$bvModal.hide("editCompmodal"); _this30.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, delComp: function delComp(item, index, button) { var _this31 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this complaint", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this31.tblisBusy = true; _this31.$http.delete("api/ComplaintList/" + item.id).then(function (response) { _this31.complaints_new = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this31.complaints_new = response.body; _this31.ComptotalRows = _this31.complaints_new.length; _this31.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this31.tblisBusy = false; } }); }); } }); }, btnAddAdv: function btnAddAdv() { var _this32 = this; this.$validator.validateAll().then(function (result) { if (result) { _this32.manageAdv.user_id = _this32.user.id; _this32.manageAdv.user_name = _this32.user.name; _this32.$http.post("api/Advisory", _this32.manageAdv).then(function (response) { _this32.templates = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Template", "Added successfully", "success"); _this32.AdvtotalRows = _this32.templates.length; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } _this32.manageAdv.name = ""; _this32.manageAdv.content = ""; }); }, AdvbtnUpdate: function AdvbtnUpdate() { var _this33 = this; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this template?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this33.tblisBusy = true; _this33.manageAdv.user_id = _this33.user.id; _this33.manageAdv.user_name = _this33.user.name; _this33.$http.put("api/Advisory/" + _this33.adv_id_update, _this33.manageAdv).then(function (response) { _this33.templates = response.body; _this33.manageAdv.name = ""; _this33.manageAdv.content = ""; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Update!", "", "success"); _this33.$bvModal.hide("editAdvmodal"); _this33.tblisBusy = false; }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) {} }); }); } }); } }); }, delAdv: function delAdv(item, index, button) { var _this34 = this; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you really want to delete this template", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (willDelete) { if (willDelete) { _this34.tblisBusy = true; _this34.$http.delete("api/Advisory/" + item.id).then(function (response) { _this34.templates = response.body; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Deleted!", "", "success").then(function (value) { _this34.templates = response.body; _this34.AdvtotalRows = _this34.templates.length; _this34.tblisBusy = false; }); }).catch(function (response) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }).then(function (value) { if (value) { _this34.tblisBusy = false; } }); }); } }); }, selectTemp: function selectTemp() { var _this35 = this; if (this.selectedTemp != null) { var temp = { template: this.selectedTemp }; console.log(temp); this.$http.post("api/getTemplate", temp).then(function (response) { console.log(response.body); if (response.body.length > 1) { _this35.msg = response.body; } // this.msg = response.body; }); } }, clearTemp: function clearTemp() { this.selectedTemp = ""; this.msg = ""; }, previewImg: function previewImg(item) { console.log(item); this.preview = item; }, resetRecipients: function resetRecipients() { this.selectedContacts = []; }, resetField: function resetField() { this.msg = ""; }, reopen: function reopen() { var _this36 = this; var data = { ticket_id: this.editTicket.id, user_id: this.user.id, remarks: "RE-OPENED TICKET DETAILS" + "\n" + "FINDINGS:" + this.editTicket.rep_findings + "\n" + "ACTIONS:" + this.editTicket.rep_action + "\n" + "CONSOLIDATED TECH:" + this.editTicket.technical_assigned + "\n" + "DATE FIXED:" + this.editTicket.date_time_fixed + "\n" }; this.$http.post("api/TicketRemarksLog", data).then(function (response) { _this36.remarksText = ""; _this36.editTicket.rep_findings = " "; _this36.editTicket.rep_action = " "; _this36.editTicket.technical_assigned = " "; _this36.editTicket.date_time_fixed = " "; _this36.editTicket.downtime_hours = " "; _this36.editTicket.remarks_log = response.body; _this36.btnUpdate(); console.log(response.body); }); }, checkClients: function checkClients() { var _this37 = this; console.log(this.ticket.multipleClients); this.ticket.multipleClients.forEach(function (item) { _this37.$http.get("api/checkTicket/" + item.id).then(function (response) { console.log(response.body); var except = [108, 11767, 11765, 57, 11766, 11769, 1136, 11768]; if (response.body.ticket == null) { _this37.ticket_exist = false; console.log("ok"); } else { if (except.includes(item.id)) { _this37.ticket_exist = false; } else { _this37.ticket_exist = true; _this37.existTickets = response.body.ticket.ticket_id + "" + response.body.ticket.id; __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Warning!", "You have entered client with pending ticket, please check " + _this37.existTickets, "warning"); } } }); var dt1 = new Date(); _this37.ticket.ticket_id = item.package_type_name + dt1.getFullYear().toString() + ("0" + (dt1.getMonth() + 1)).slice(-2) + ("0" + dt1.getDate()).slice(-2); }); }, addClient: function addClient(newTag) { var tag = { name: newTag, id: this.ticket.clientRegion, package_type_name: "RES" }; this.clients.push(tag); this.ticket.multipleClients.push(tag); this.ticket.complain = ""; }, duplicateTicket: function duplicateTicket() { console.log(this.duplicate); console.log(this.editTicket); this.$bvModal.show("modalAddTicket"); this.$bvModal.hide("modalEditTicket"); // duplicated data this.ticket.complaint_new = this.editTicket.complaint_new; this.ticket.connection_status = this.editTicket.connection_status; this.ticket.Status_Ticket_id = this.editTicket.Status_Ticket_id; this.ticket.cacti = this.editTicket.cacti; this.ticket.selected_trouble = this.editTicket.selected_trouble; this.ticket.bwmon = this.editTicket.bwmon; this.ticket.cacti = this.editTicket.cacti; this.ticket.device = this.editTicket.device; }, clearClients: function clearClients() { this.selected = []; }, saveRebates: function saveRebates() { var _this38 = this; this.$validator.validateAll().then(function (result) { if (result) { var data = { user_id: _this38.user.id, user_name: _this38.user.name, ticket_no: _this38.editTicket.id, clients: _this38.selectedClientRebates, downtime: _this38.editTicket.downtime_hours, date_effective: _this38.date_effective }; _this38.$http.post("api/Rebates", data).then(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()("Rebates", "Added successfully", "success"); _this38.$bvModal.hide("modalRebates"); _this38.date_effective = ""; }).catch(function (response) { console.log(response.body); __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Error", text: response.body.error, icon: "error", dangerMode: true }); }); } }); }, btnFSR: function btnFSR() { this.fsr_data = { id: this.editTicket.id, name: this.editTicket.client.name, contact_person: this.editTicket.client.contact_person, location: this.editTicket.client.location, contact: this.editTicket.client.contact, complaint: this.editTicket.compname }; this.$bvModal.show("modalFSRPrintPreview"); }, btnExport: function btnExport() { var _this39 = this; var pdf = new __WEBPACK_IMPORTED_MODULE_15_jspdf___default.a(); var element = document.getElementById("toPDF"); var width = element.style.width; var height = element.style.height; __WEBPACK_IMPORTED_MODULE_16_html2canvas___default()(element).then(function (canvas) { var image = canvas.toDataURL("image/png"); pdf.addImage(image, "JPEG", 15, 40, width, height); pdf.save(_this39.editTicket.mTicket_id + "_" + _this39.editTicket.client.name + ".pdf"); }); }, searchClient: function searchClient(query) { this.isLoading = true; if (query != "") { this.$http.get("api/searchClient/" + this.user.region_id + "/" + query).then(function (response) { // console.log(response.body); this.clientOptions = response.body; this.isLoading = false; }); } else { this.isLoading = false; } }, search: function search(query) { console.log(query); this.doSearch = true; this.clientOptions = []; this.currentItem = 0; if (query != "" && query != "." && query != null) { var escape_string = query.toString().replace(/\//g, "***sl4sh***").replace(/\#/g, "***h4sht4g***"); this.search_loading = true; this.$http.get("api/Ticket/search/" + this.searchby + "/" + escape_string).then(function (response) { console.log(response.body); this.clientOptions = response.body.items; if (response.body.count > 10) { this.clientOptions.push({ id: "*** Show all " + response.body.count + " results...", client_name: "*** Show all " + response.body.count + " results...", complaint_list_name: "*** Show all " + response.body.count + " results...", findings: "*** Show all " + response.body.count + " results...", technical_assigned: "*** Show all " + response.body.count + " results...", complain: "*** Show all " + response.body.count + " results...", ticket_group_id: "*** Show all " + response.body.count + " results...", ticket_group_name: "*** Show all " + response.body.count + " results..." }); } this.search_loading = false; }); } else { this.doSearch = false; this.search_loading = false; this.clientOptions = []; } }, searchItem: function searchItem(item) { if (item.client_name.substring(0, 3) != "***") { if (this.searchby == "tickets.id") this.tblFilter_copy = item.id;else if (this.searchby == "clients.name") this.tblFilter_copy = item.client_name;else if (this.searchby == "complaint_lists.name") this.tblFilter_copy = item.complaint_list_name;else if (this.searchby == "findings") this.tblFilter_copy = item.findings;else if (this.searchby == "technical_assigned") this.tblFilter_copy = item.technical_assigned;else if (this.searchby == "tickets.complain") this.tblFilter_copy = item.complain;else if (this.searchby == "ticket_groups.id") this.tblFilter_copy = item.ticket_group_id;else if (this.searchby == "ticket_groups.downtime") this.tblFilter_copy = item.ticket_group_name; } this.search_data(); }, searchSuggestions: function searchSuggestions(item) { if (this.searchby == "tickets.id") return item.id;else if (this.searchby == "clients.name") return item.client_name;else if (this.searchby == "complaint_lists.name") return item.complaint_list_name;else if (this.searchby == "findings") return item.findings;else if (this.searchby == "technical_assigned") return item.technical_assigned;else if (this.searchby == "tickets.complain") return item.complain;else if (this.searchby == "ticket_groups.id") return item.ticket_group_id;else if (this.searchby == "ticket_groups.downtime") return item.ticket_id + " - " + item.downtime; }, nextItem: function nextItem(event) { if (event.keyCode == 38 && this.clientOptions.length > 1) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem > 0) { this.currentItem--; } } else if (event.keyCode == 40 && this.currentItem < this.clientOptions.length) { if (this.currentItem === null) { this.currentItem = 0; } else if (this.currentItem < this.clientOptions.length - 1) { this.currentItem++; } } if (event.keyCode == 13 && this.clientOptions.length != 0) this.searchItem(this.clientOptions[this.currentItem]); }, seemore: function seemore(item) { this.history_data = item.data; this.$bvModal.show("modal-details"); } } }); /***/ }), /* 535 */ /***/ (function(module, exports, __webpack_require__) { /*! * pretty-checkbox-vue v1.1.9 * (c) 2017-2018 Hamed Ehtesham * Released under the MIT License. */ !function(e,t){ true?module.exports=t():"function"==typeof define&&define.amd?define("PrettyInput",[],t):"object"==typeof exports?exports.PrettyInput=t():e.PrettyInput=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function i(s){if(t[s])return t[s].exports;var n=t[s]={i:s,l:!1,exports:{}};return e[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:s})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){var s=i(1)(i(2),i(3),!1,null,null,null);s.options.__file="src/PrettyInput.vue",e.exports=s.exports},function(e,t){e.exports=function(e,t,i,s,n,r){var o,a=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(o=e,a=e.default);var h,l="function"==typeof a?a.options:a;if(t&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0),i&&(l.functional=!0),n&&(l._scopeId=n),r?(h=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},l._ssrRegister=h):s&&(h=s),h){var d=l.functional,f=d?l.render:l.beforeCreate;d?(l._injectStyles=h,l.render=function(e,t){return h.call(t),f(e,t)}):l.beforeCreate=f?[].concat(f,h):[h]}return{esModule:o,exports:a,options:l}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"pretty-input",model:{prop:"modelValue",event:"change"},props:{type:String,name:String,value:{},modelValue:{},trueValue:{},falseValue:{},checked:{},disabled:{},required:{},indeterminate:{},color:String,offColor:String,hoverColor:String,indeterminateColor:String,toggle:{},hover:{},focus:{}},data:function(){return{m_checked:void 0,default_mode:!1}},computed:{_type:function(){return this.$options.input_type?this.$options.input_type:this.type?this.type:"checkbox"},shouldBeChecked:function(){return void 0!==this.modelValue?"radio"===this._type?this.modelValue===this.value:this.modelValue instanceof Array?this.modelValue.includes(this.value):this._trueValue?this.modelValue===this.trueValue:"string"==typeof this.modelValue||!!this.modelValue:void 0===this.m_checked?this.m_checked="string"==typeof this.checked||!!this.checked:this.m_checked},_disabled:function(){return"string"==typeof this.disabled||!!this.disabled},_required:function(){return"string"==typeof this.required||!!this.required},_indeterminate:function(){return"string"==typeof this.indeterminate||!!this.indeterminate},_trueValue:function(){return"string"==typeof this.trueValue?this.trueValue:!!this.trueValue},_falseValue:function(){return"string"==typeof this.falseValue?this.falseValue:!!this.falseValue},_toggle:function(){return"string"==typeof this.toggle||!!this.toggle},_hover:function(){return"string"==typeof this.hover||!!this.hover},_focus:function(){return"string"==typeof this.focus||!!this.focus},classes:function(){return{pretty:!0,"p-default":this.default_mode,"p-round":"radio"===this._type&&this.default_mode,"p-toggle":this._toggle,"p-has-hover":this._hover,"p-has-focus":this._focus,"p-has-indeterminate":this._indeterminate}},onClasses:function(){var e={state:!0,"p-on":this._toggle};return this.color&&(e["p-"+this.color]=!0),e},offClasses:function(){var e={state:!0,"p-off":!0};return this.offColor&&(e["p-"+this.offColor]=!0),e},hoverClasses:function(){var e={state:!0,"p-is-hover":!0};return this.hoverColor&&(e["p-"+this.hoverColor]=!0),e},indeterminateClasses:function(){var e={state:!0,"p-is-indeterminate":!0};return this.indeterminateColor&&(e["p-"+this.indeterminateColor]=!0),e}},watch:{checked:function(e){this.m_checked=e},indeterminate:function(e){this.$refs.input.indeterminate=e}},mounted:function(){this.$vnode.data&&!this.$vnode.data.staticClass&&(this.default_mode=!0),this._indeterminate&&(this.$refs.input.indeterminate=!0),this.$el.setAttribute("p-"+this._type,"")},methods:{updateInput:function(e){if("radio"!==this._type){this.$emit("update:indeterminate",!1);var t=e.target.checked;if(this.m_checked=t,this.modelValue instanceof Array){var i=[].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t { // this.commentsText[i] = ""; // console.log(response.body); // }); // } else { // swal("Please add some text in the comments text area"); // } }, removeClient: function removeClient(id) { // console.log(id); for (var index = 0; index < this.data.ticket_group_client.length; index++) { if (this.data.ticket_group_client[index].client_id == id) { this.data.ticket_group_client.splice(index, 1); } } }, btnUpdate: function btnUpdate() { var _this5 = this; this.data.ticketType = "3"; this.data.updated_by = this.user.name; this.data.attachments = this.data.attachments; this.$validator.validateAll().then(function (result) { if (result) { __WEBPACK_IMPORTED_MODULE_1_sweetalert___default()({ title: "Are you sure?", text: "Do you want to Update this Ticket?", icon: "warning", buttons: ["No", "Yes"], dangerMode: true }).then(function (update) { if (update) { _this5.$http.put("api/Ticket/" + _this5.data.id, _this5.data).then(function (response) { console.log(response.body); // this.$root.$emit( // "update_ticket_list", // response.body, // this.data.cbFilter // ); }); } }); } }); } } }); /***/ }), /* 540 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /* harmony default export */ __webpack_exports__["a"] = ({ name: "VueUploadImages", // vue component name data: function data() { return { error: "", files: [], dropped: 0, Imgs: [] }; }, props: { max: Number, uploadMsg: String, maxError: String, fileError: String, clearAll: String }, methods: { dragOver: function dragOver() { this.dropped = 2; }, dragLeave: function dragLeave() {}, drop: function drop(e) { var status = true; var files = Array.from(e.dataTransfer.files); if (e && files) { files.forEach(function (file) { if (file.type.startsWith("image") === false) status = false; }); if (status == true) { if (this.$props.max && files.length + this.files.length > this.$props.max) { this.error = this.$props.maxError ? this.$props.maxError : "Maximum files is" + this.$props.max; } else { var _files; (_files = this.files).push.apply(_files, _toConsumableArray(files)); this.previewImgs(); } } else { this.error = this.$props.fileError ? this.$props.fileError : "Unsupported file type"; } } this.dropped = 0; }, append: function append() { this.$refs.uploadInput.click(); }, readAsDataURL: function readAsDataURL(file) { return new Promise(function (resolve, reject) { var fr = new FileReader(); fr.onload = function () { resolve(fr.result); }; fr.onerror = function () { reject(fr); }; fr.readAsDataURL(file); }); }, deleteImg: function deleteImg(index) { this.Imgs.splice(index, 1); this.files.splice(index, 1); this.$emit("changed", this.files); this.$refs.uploadInput.value = null; }, previewImgs: function previewImgs(event) { var _files2, _this = this; if (this.$props.max && event && event.currentTarget.files.length + this.files.length > this.$props.max) { this.error = this.$props.maxError ? this.$props.maxError : "Maximum files is" + this.$props.max; return; } if (this.dropped == 0) (_files2 = this.files).push.apply(_files2, _toConsumableArray(event.currentTarget.files)); this.error = ""; this.$emit("changed", this.files); var readers = []; if (!this.files.length) return; for (var i = 0; i < this.files.length; i++) { readers.push(this.readAsDataURL(this.files[i])); } Promise.all(readers).then(function (values) { _this.Imgs = values; }); }, reset: function reset() { this.$refs.uploadInput.value = null; this.Imgs = []; this.files = []; this.$emit("changed", this.files); } } }); /***/ }), /* 541 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, process) {var __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_RESULT__;var __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;!function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define(e):t.jsPDF=e()}(this,function(){"use strict";var t,y,e,I,i,o,a,h,C,T,d,p,F,n,r,s,c,P,E,q,g,m,w,l,v,b,x,S,u,k,_,f,A,O,B,R,j,D,M,U,N,z,L,H,W,G,V,Y,X,J,K,Q,Z,vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$=function(pt){var gt="1.3",mt={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};function wt(o){var a={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;a.hasOwnProperty(t)||(a[t]={});var r=Math.random().toString(35);return a[t][r]=[e,!!n],r},this.unsubscribe=function(t){for(var e in a)if(a[e][t])return delete a[e][t],!0;return!1},this.publish=function(t){if(a.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1),n=[];for(var r in a[t]){var i=a[t][r];try{i[0].apply(o,e)}catch(t){pt.console&&console.error("jsPDF PubSub Error",t.message,t)}i[1]&&n.push(r)}n.length&&n.forEach(this.unsubscribe)}}}function yt(t,e,n,r){var i={};"object"===(void 0===t?"undefined":vt(t))&&(t=(i=t).orientation,e=i.unit||e,n=i.format||n,r=i.compress||i.compressPdf||r),e=e||"mm",n=n||"a4",t=(""+(t||"P")).toLowerCase();(""+n).toLowerCase();var K,w,y,o,u,v,a,s,h,c,l,f=!!r&&"function"==typeof Uint8Array,Q=i.textColor||"0 g",d=i.drawColor||"0 G",Z=i.fontSize||16,$=i.charSpace||0,tt=i.R2L||!1,et=i.lineHeight||1.15,p=i.lineWidth||.200025,g="00000000000000000000000000000000",m=2,b=!1,x=[],nt={},S={},k=0,_=[],A=[],I=[],C=[],T=[],F=0,P=0,E=0,q={title:"",subject:"",author:"",keywords:"",creator:""},O={},rt=new wt(O),B=i.hotfixes||[],R=function(t){var e,n=t.ch1,r=t.ch2,i=t.ch3,o=t.ch4,a=(t.precision,"draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof n&&"#"!==n.charAt(0)){var s=new RGBColor(n);s.ok&&(n=s.toHex())}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var h=parseInt(n.substr(1),16);n=h>>16&255,r=h>>8&255,i=255&h}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=N(n/255)+" "+a[0];break;case 3:default:e=z(n/255)+" "+a[0]}else if(void 0===o||"object"===(void 0===o?"undefined":vt(o))){if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[N(n/255),N(r/255),N(i/255),a[1]].join(" ");break;default:case 3:e=[z(n/255),z(r/255),z(i/255),a[1]].join(" ")}o&&0===o.a&&(e=["255","255","255",a[1]].join(" "))}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[N(n),N(r),N(i),N(o),a[2]].join(" ");break;case 3:default:e=[z(n),z(r),z(i),z(o),a[2]].join(" ")}return e},j=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},n=t.getTimezoneOffset(),r=n<0?"+":"-",i=Math.floor(Math.abs(n/60)),o=Math.abs(n%60),a=[r,e(i),"'",e(o),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),a].join("")},D=function(t){var e;return void 0===(void 0===t?"undefined":vt(t))&&(t=new Date),e="object"===(void 0===t?"undefined":vt(t))&&"[object Date]"===Object.prototype.toString.call(t)?j(t):/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|\-0[0-9]|\-1[0-1])\'(0[0-9]|[1-5][0-9])\'?$/.test(t)?t:j(new Date),c=e},M=function(t){var e=c;return"jsDate"===t&&(e=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),a=parseInt(t.substr(14,2),10);parseInt(t.substr(16,2),10),parseInt(t.substr(20,2),10);return new Date(e,n,r,i,o,a,0)}(c)),e},U=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),g=t},N=function(t){return t.toFixed(2)},z=function(t){return t.toFixed(3)},it=function(t){t="string"==typeof t?t:t.toString(),b?_[o].push(t):(E+=t.length+1,C.push(t))},L=function(){return x[++m]=E,it(m+" 0 obj"),m},H=function(t){it("stream"),it(t),it("endstream")},W=function(){for(var t in it("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),it("/Font <<"),nt)nt.hasOwnProperty(t)&&it("/"+t+" "+nt[t].objectNumber+" 0 R");it(">>"),it("/XObject <<"),rt.publish("putXobjectDict"),it(">>")},G=function(){!function(){for(var t in nt)nt.hasOwnProperty(t)&&(e=nt[t],rt.publish("putFont",{font:e,out:it,newObject:L}),!0!==e.isAlreadyPutted&&(e.objectNumber=L(),it("<<"),it("/Type /Font"),it("/BaseFont /"+e.postScriptName),it("/Subtype /Type1"),"string"==typeof e.encoding&&it("/Encoding /"+e.encoding),it("/FirstChar 32"),it("/LastChar 255"),it(">>"),it("endobj")));var e}(),rt.publish("putResources"),x[2]=E,it("2 0 obj"),it("<<"),W(),it(">>"),it("endobj"),rt.publish("postPutResources")},V=function(t,e,n){S.hasOwnProperty(e)||(S[e]={}),S[e][n]=t},Y=function(t,e,n,r){var i="F"+(Object.keys(nt).length+1).toString(10),o=nt[i]={id:i,postScriptName:t,fontName:e,fontStyle:n,encoding:r,metadata:{}};return V(i,e,n),rt.publish("addFont",o),i},ot=function(t,e){return function(t,e){var n,r,i,o,a,s,h,c,l;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&nt[K].metadata&&nt[K].metadata[i]&&nt[K].metadata[i].encoding&&(o=nt[K].metadata[i].encoding,!a&&nt[K].encoding&&(a=nt[K].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(h=!1,s=[],n=0,r=t.length;n>8&&(h=!0);t=s.join("")}for(n=t.length;void 0===h&&0!==n;)t.charCodeAt(n-1)>>8&&(h=!0),n--;if(!h)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(l),s.push(c-(l<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},X=function(){(function(t,e){var n="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();mt.hasOwnProperty(r)&&(t=mt[r][0]/w,e=mt[r][1]/w)}if(Array.isArray(t)&&(e=t[1],t=t[0]),n){switch(n.substr(0,1)){case"l":t>"),it("endobj"),e=_[t].join("\n"),L(),f){for(n=[],r=e.length;r--;)n[r]=e.charCodeAt(r);o=a.from(e),(i=new Deflater(6)).append(new Uint8Array(n)),e=i.flush(),(n=new Uint8Array(e.length+6)).set(new Uint8Array([120,156])),n.set(e,2),n.set(new Uint8Array([255&o,o>>8&255,o>>16&255,o>>24&255]),e.length+2),e=String.fromCharCode.apply(null,n),it("<>")}else it("<>");H(e),it("endobj")}x[1]=E,it("1 0 obj"),it("<>"),it("endobj"),rt.publish("postPutPages")}(),function(){rt.publish("putAdditionalObjects");for(var t=0;t>"),it("endobj"),L(),it("<<"),function(){switch(it("/Type /Catalog"),it("/Pages 1 0 R"),s||(s="fullwidth"),s){case"fullwidth":it("/OpenAction [3 0 R /FitH null]");break;case"fullheight":it("/OpenAction [3 0 R /FitV null]");break;case"fullpage":it("/OpenAction [3 0 R /Fit]");break;case"original":it("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+s;"%"===t.substr(t.length-1)&&(s=parseInt(s)/100),"number"==typeof s&&it("/OpenAction [3 0 R /XYZ null null "+N(s)+"]")}switch(h||(h="continuous"),h){case"continuous":it("/PageLayout /OneColumn");break;case"single":it("/PageLayout /SinglePage");break;case"two":case"twoleft":it("/PageLayout /TwoColumnLeft");break;case"tworight":it("/PageLayout /TwoColumnRight")}a&&it("/PageMode /"+a),rt.publish("putCatalog")}(),it(">>"),it("endobj");var t,e=E,n="0000000000";for(it("xref"),it("0 "+(m+1)),it(n+" 65535 f "),t=1;t<=m;t++){var r=x[t];it("function"==typeof r?(n+x[t]()).slice(-10)+" 00000 n ":(n+x[t]).slice(-10)+" 00000 n ")}return it("trailer"),it("<<"),it("/Size "+(m+1)),it("/Root "+m+" 0 R"),it("/Info "+(m-1)+" 0 R"),it("/ID [ <"+g+"> <"+g+"> ]"),it(">>"),it("startxref"),it(""+e),it("%%EOF"),b=!0,C.join("\n")},ht=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e},ct=function(){for(var t=st(),e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},lt=function(){return new Blob([ct()],{type:"application/pdf"})},ut=((l=function(t,e){var n="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(st()):0;switch(t){case void 0:return st();case"save":if("object"===("undefined"==typeof navigator?"undefined":vt(navigator))&&navigator.getUserMedia&&(void 0===pt.URL||void 0===pt.URL.createObjectURL))return O.output("dataurlnewwindow");bt(lt(),e),"function"==typeof bt.unload&&pt.setTimeout&&setTimeout(bt.unload,911);break;case"arraybuffer":return ct();case"blob":return lt();case"bloburi":case"bloburl":return pt.URL&&pt.URL.createObjectURL(lt())||void 0;case"datauristring":case"dataurlstring":return n;case"dataurlnewwindow":var r=pt.open(n);if(r||"undefined"==typeof safari)return r;case"datauri":case"dataurl":return pt.document.location.href=n;default:throw new Error('Output type "'+t+'" is not supported.')}}).foo=function(){try{return l.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!pt.console)throw new Error(n);pt.console.error(n,t),pt.alert&&alert(n)}},(l.foo.bar=l).foo),ft=function(t){return!0===Array.isArray(B)&&-1":")")):"[object Array]"===Object.prototype.toString.call(y[H])&&(W=parseFloat(y[H][1]).toFixed(2),G=parseFloat(y[H][2]).toFixed(2),V=(r?"<":"(")+y[H][0]+(r?">":")"),Y=1),void 0!==D&&void 0!==D[H]&&(X=D[H]+" Tw\n"),0!==k.length&&0===H?t.push(X+k.join(" ")+" "+W+" "+G+" Tm\n"+V):1===Y||0===Y&&0===H?t.push(X+W+" "+G+" Td\n"+V):t.push(X+V);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var J="BT\n/"+K+" "+Z+" Tf\n"+(Z*s).toFixed(2)+" TL\n"+Q+"\n";return J+=a,J+=t,it(J+="ET"),h},O.lstext=function(t,e,n,r){console.warn("jsPDF.lstext is deprecated");for(var i=0,o=t.length;i, https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike * 2012 Willow Systems Corporation, willow-systems.com * 2012 Pablo Hess, https://github.com/pablohess * 2012 Florian Jenett, https://github.com/fjenett * 2013 Warren Weckesser, https://github.com/warrenweckesser * 2013 Youssef Beddad, https://github.com/lifof * 2013 Lee Driscoll, https://github.com/lsdriscoll * 2013 Stefan Slonevskiy, https://github.com/stefslon * 2013 Jeremy Morel, https://github.com/jmorel * 2013 Christoph Hartmann, https://github.com/chris-rock * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 James Makes, https://github.com/dollaruw * 2014 Diego Casorran, https://github.com/diegocr * 2014 Steven Spungin, https://github.com/Flamenco * 2014 Kenneth Glassey, https://github.com/Gavvers * * Licensed under the MIT License * * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco */ /** * jsPDF AcroForm Plugin Copyright (c) 2016 Alexander Weidt, * https://github.com/BiggA94 * * Licensed under the MIT License. http://opensource.org/licenses/mit-license */ !function(n,t){var l,a,e=1,r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},s=function(t){return t*(e/1)},h=function(t){var e=new I,n=N.internal.getHeight(t)||0,r=N.internal.getWidth(t)||0;return e.BBox=[0,0,r.toFixed(2),n.toFixed(2)],e},i=function(t,e,n){t=t||0;var r=1;if(r<<=e-1,1==(n=n||1))t=t|r;else t=t&~r;return t},o=function(t,e,n){n=n||1.3,t=t||0;return 1==e.readOnly&&(t=i(t,1)),1==e.required&&(t=i(t,2)),1==e.noExport&&(t=i(t,3)),1==e.multiline&&(t=i(t,13)),e.password&&(t=i(t,14)),e.noToggleToOff&&(t=i(t,15)),e.radio&&(t=i(t,16)),e.pushbutton&&(t=i(t,17)),e.combo&&(t=i(t,18)),e.edit&&(t=i(t,19)),e.sort&&(t=i(t,20)),e.fileSelect&&1.4<=n&&(t=i(t,21)),e.multiSelect&&1.4<=n&&(t=i(t,22)),e.doNotSpellCheck&&1.4<=n&&(t=i(t,23)),1==e.doNotScroll&&1.4<=n&&(t=i(t,24)),e.richText&&1.4<=n&&(t=i(t,25)),t},u=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o={};return Array.isArray(e)?(e[0]=s(e[0]),e[1]=s(e[1]),e[2]=s(e[2]),e[3]=s(e[3])):(e=s(e),n=s(n),r=s(r),i=s(i)),o.lowerLeft_X=e||0,o.lowerLeft_Y=s(a)-n-i||0,o.upperRight_X=e+r||0,o.upperRight_Y=s(a)-n||0,[o.lowerLeft_X.toFixed(2),o.lowerLeft_Y.toFixed(2),o.upperRight_X.toFixed(2),o.upperRight_Y.toFixed(2)]},f=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,r=c(t,n);e.push("/Tx BMC"),e.push("q"),e.push("/F1 "+r.fontSize.toFixed(2)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push("BT"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var i=new h(t);return i.stream=e.join("\n"),i}},c=function(t,e,i,n){n=n||12,i=i||"helvetica";var r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" "),a=n,s=N.internal.getHeight(t)||0;s=s<0?-s:s;var h=N.internal.getWidth(t)||0;h=h<0?-h:h;var c=function(t,e,n){if(t+1=o.length-1;if(!x||S){if(x||S){if(S)g=b;else if(t.multiline&&s<(l+2)*(y+2)+2)continue t}else{if(!t.multiline)continue t;if(s<(l+2)*(y+2)+2)continue t;g=b}for(var k="",_=p;_<=g;_++)k+=o[_]+" ";switch(k=" "==k.substr(k.length-1)?k.substr(0,k.length-1):k,m=A(k,a+"px",i).width,t.Q){case 2:f=h-m-2;break;case 1:f=(h-m)/2;break;case 0:default:f=2}e+=f.toFixed(2)+" "+d.toFixed(2)+" Td\n",e+="("+k+") Tj\n",e+=-f.toFixed(2)+" 0 Td\n",d=-(a+2),m=0,p=g+1,y++,w=""}else w+=" "}break}return r.text=e,r.fontSize=a,r},A=function(t,e,n){n=n||"helvetica";var r=l.internal.getFont(n),i=l.getStringUnitWidth(t,{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:l.getStringUnitWidth("3",{font:r,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},d={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){for(var t in l.internal.acroformPlugin.acroFormDictionaryRoot.Fields){var e=l.internal.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&m.call(l,e)}},g=function(t){l.internal.acroformPlugin.printedOut&&(l.internal.acroformPlugin.printedOut=!1,l.internal.acroformPlugin.acroFormDictionaryRoot=null),l.internal.acroformPlugin.acroFormDictionaryRoot||x.call(l),l.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},m=function(t){var e={type:"reference",object:t};l.annotationPlugin.annotations[l.internal.getPageInfo(t.page).pageNumber].push(e)},w=function(){void 0!==l.internal.acroformPlugin.acroFormDictionaryRoot?l.internal.write("/AcroForm "+l.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},y=function(){l.internal.events.unsubscribe(l.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete l.internal.acroformPlugin.acroFormDictionaryRoot._eventID,l.internal.acroformPlugin.printedOut=!0},v=function(t){var e=!t;t||(l.internal.newObjectDeferredBegin(l.internal.acroformPlugin.acroFormDictionaryRoot.objId),l.internal.out(l.internal.acroformPlugin.acroFormDictionaryRoot.getString()));t=t||l.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t){var r=t[n],i=r.Rect;r.Rect&&(r.Rect=u.call(this,r.Rect)),l.internal.newObjectDeferredBegin(r.objId);var o=r.objId+" 0 obj\n<<\n";if("object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getContent&&(o+=r.getContent()),r.Rect=i,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);o+="/AP << /N "+a+" >>\n",l.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){for(var s in o+="/AP << ",r.appearanceStreamContent){var h=r.appearanceStreamContent[s];if(o+="/"+s+" ",o+="<< ",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var c;"function"==typeof(c=h[n])&&(c=c.call(this,r)),o+="/"+n+" "+c+" ",0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c)}else"function"==typeof(c=h)&&(c=c.call(this,r)),o+="/"+n+" "+c+" \n",0<=l.internal.acroformPlugin.xForms.indexOf(c)||l.internal.acroformPlugin.xForms.push(c);o+=" >>\n"}o+=">>\n"}o+=">>\nendobj\n",l.internal.out(o)}e&&b.call(this,l.internal.acroformPlugin.xForms)},b=function(t){for(var e in t){var n=e,r=t[e];l.internal.newObjectDeferredBegin(r&&r.objId);var i="";"object"===(void 0===r?"undefined":vt(r))&&"function"==typeof r.getString&&(i=r.getString()),l.internal.out(i),delete t[n]}},x=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(l=this,T.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(d)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");e=l.internal.scaleFactor,a=l.internal.pageSize.getHeight(),l.internal.acroformPlugin.acroFormDictionaryRoot=new C,l.internal.acroformPlugin.acroFormDictionaryRoot._eventID=l.internal.events.subscribe("postPutResources",y),l.internal.events.subscribe("buildDocument",p),l.internal.events.subscribe("putCatalog",w),l.internal.events.subscribe("postPutPages",v),l.internal.acroformPlugin.isInitialized=!0}},S=function(t){if(Array.isArray(t)){var e=" [";for(var n in t){e+=t[n].toString(),e+=n>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="\nendstream\n"),t+="endobj\n"},_.prototype.getContent=function(){var t="";return t+=function(t){var e="",n=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in n){var i=n[r],o=t[i];o&&(Array.isArray(o)?e+="/"+i+" "+S(o)+"\n":e+=o instanceof _?"/"+i+" "+o.objId+" 0 R\n":"/"+i+" "+o+"\n")}return e}(this)};var I=function(){var e;_.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo,Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==e?e.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(t){e=t.trim()},get:function(){return e||null}})};r(I,_);var C=function(){_.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0>"},YesPushDown:function(t){var e=h(t),n=[],r=l.internal.getFont("zapfdingbats","normal").id;t.Q=1;var i=c(t,"3","ZapfDingbats",50);return n.push("0.749023 g"),n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+i.fontSize.toFixed(2)+" Tf 0 g"),n.push("BT"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=h(t),n=l.internal.getFont("zapfdingbats","normal").id,r=[];t.Q=1;var i=N.internal.getHeight(t),o=N.internal.getWidth(t),a=c(t,"3","ZapfDingbats",.9*i);return r.push("1 g"),r.push("0 0 "+o.toFixed(2)+" "+i.toFixed(2)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+(o-1).toFixed(2)+" "+(i-1).toFixed(2)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+n+" "+a.fontSize.toFixed(2)+" Tf 0 g"),r.push(a.text),r.push("ET"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=N.RadioButton.Circle.YesNormal,e.D[t]=N.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4;r*=.9;var i=N.internal.Bezier_C;return n.push("q"),n.push("1 0 0 1 "+N.internal.getWidth(t)/2+" "+N.internal.getHeight(t)/2+" cm"),n.push(r+" 0 m"),n.push(r+" "+r*i+" "+r*i+" "+r+" 0 "+r+" c"),n.push("-"+r*i+" "+r+" -"+r+" "+r*i+" -"+r+" 0 c"),n.push("-"+r+" -"+r*i+" -"+r*i+" -"+r+" 0 -"+r+" c"),n.push(r*i+" -"+r+" "+r+" -"+r*i+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C,a=r*N.internal.Bezier_C;return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=h(t),n=[],r=N.internal.getWidth(t)<=N.internal.getHeight(t)?N.internal.getWidth(t)/4:N.internal.getHeight(t)/4,i=2*(r*=.9),o=i*N.internal.Bezier_C;return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+(N.internal.getWidth(t)/2).toFixed(2)+" "+(N.internal.getHeight(t)/2).toFixed(2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:N.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=N.RadioButton.Cross.YesNormal,e.D[t]=N.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=h(t),n=[],r=N.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"),n.push("W"),n.push("n"),n.push(r.x1.x.toFixed(2)+" "+r.x1.y.toFixed(2)+" m"),n.push(r.x2.x.toFixed(2)+" "+r.x2.y.toFixed(2)+" l"),n.push(r.x4.x.toFixed(2)+" "+r.x4.y.toFixed(2)+" m"),n.push(r.x3.x.toFixed(2)+" "+r.x3.y.toFixed(2)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=h(t),n=N.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"),r.push("f"),r.push("q"),r.push("1 1 "+(N.internal.getWidth(t)-2).toFixed(2)+" "+(N.internal.getHeight(t)-2).toFixed(2)+" re"),r.push("W"),r.push("n"),r.push(n.x1.x.toFixed(2)+" "+n.x1.y.toFixed(2)+" m"),r.push(n.x2.x.toFixed(2)+" "+n.x2.y.toFixed(2)+" l"),r.push(n.x4.x.toFixed(2)+" "+n.x4.y.toFixed(2)+" m"),r.push(n.x3.x.toFixed(2)+" "+n.x3.y.toFixed(2)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=h(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+N.internal.getWidth(t).toFixed(2)+" "+N.internal.getHeight(t).toFixed(2)+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){return"/F1 0 Tf 0 g"}};N.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,n,r=N.internal.getWidth(t),i=N.internal.getHeight(t),o=(n=i)<(e=r)?n:e;return{x1:{x:(r-o)/2,y:(i-o)/2+o},x2:{x:(r-o)/2+o,y:(i-o)/2},x3:{x:(r-o)/2,y:(i-o)/2},x4:{x:(r-o)/2+o,y:(i-o)/2+o}}}},N.internal.getWidth=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[2])),e},N.internal.getHeight=function(t){var e=0;return"object"===(void 0===t?"undefined":vt(t))&&(e=s(t.Rect[3])),e},n.addField=function(t){return x.call(this),t instanceof M?this.addTextField.call(this,t):t instanceof F?this.addChoiceField.call(this,t):t instanceof O?this.addButton.call(this,t):t instanceof j?g.call(this,t):t&&g.call(this,t),t.page=l.internal.getCurrentPageInfo().pageNumber,this},n.addButton=function(t){x.call(this);var e=t||new T;e.FT="/Btn",e.Ff=o(e.Ff,t,l.internal.getPDFVersion()),g.call(this,e)},n.addTextField=function(t){x.call(this);var e=t||new T;e.FT="/Tx",e.Ff=o(e.Ff,t,l.internal.getPDFVersion()),g.call(this,e)},n.addChoiceField=function(t){x.call(this);var e=t||new T;e.FT="/Ch",e.Ff=o(e.Ff,t,l.internal.getPDFVersion()),g.call(this,e)},"object"==(void 0===t?"undefined":vt(t))&&(t.ChoiceField=F,t.ListBox=P,t.ComboBox=E,t.EditBox=q,t.Button=O,t.PushButton=B,t.RadioButton=R,t.CheckBox=D,t.TextField=M,t.PasswordField=U,t.AcroForm={Appearance:N}),n.AcroFormChoiceField=F,n.AcroFormListBox=P,n.AcroFormComboBox=E,n.AcroFormEditBox=q,n.AcroFormButton=O,n.AcroFormPushButton=B,n.AcroFormRadioButton=R,n.AcroFormCheckBox=D,n.AcroFormTextField=M,n.AcroFormPasswordField=U,n.AcroForm={ChoiceField:F,ListBox:P,ComboBox:E,EditBox:q,Button:O,PushButton:B,RadioButton:R,CheckBox:D,TextField:M,PasswordField:U}}($.API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global),$.API.addHTML=function(t,p,g,s,m){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof p&&(s=p,m=g),"function"==typeof s&&(m=s,s=null),"function"!=typeof m&&(m=function(){});var e=this.internal,w=e.scaleFactor,y=e.pageSize.getWidth(),v=e.pageSize.getHeight();if((s=s||{}).onrendered=function(h){p=parseInt(p)||0,g=parseInt(g)||0;var t=s.dim||{},c=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},s.margin),e=t.h||Math.min(v,h.height/w),l=t.w||Math.min(y,h.width/w)-p,u=s.format||"JPEG",f=s.imageCompression||"SLOW";if(h.height>v-c.top-c.bottom&&s.pagesplit){var d=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?c.top:g,i.left=0!==n?c.left:p,o=(y-c.left-c.right)*w=h.width)break;this.addPage()}else s=[a=d(h,0,n,t,e),i.left,i.top,a.width/w,a.height/w,u,null,f],this.addImage.apply(this,s);if((n+=e)>=h.height)break;this.addPage()}m(l,n,null,s)}.bind(this);if("CANVAS"===h.nodeName){var r=new Image;r.onload=n,r.src=h.toDataURL("image/png"),h=r}else n()}else{var i=Math.random().toString(35),o=[h,p,g,l,e,u,i,f];this.addImage.apply(this,o),m(l,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"!=typeof rasterizeHTML){var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||y*w,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})}return null}, /** @preserve * jsPDF addImage plugin * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ * 2013 Chris Dowling, https://github.com/gingerchris * 2013 Trinh Ho, https://github.com/ineedfat * 2013 Edwin Alejandro Perez, https://github.com/eaparango * 2013 Norah Smith, https://github.com/burnburnrocket * 2014 Diego Casorran, https://github.com/diegocr * 2014 James Robb, https://github.com/jamesbrobb * * */ function(b){var x="addImage_",h={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]};b.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in h)for(i=h[a],n=0;n>"),"trns"in e&&e.trns.constructor==Array){for(var o="",a=0,s=e.trns.length;a>"),i(e.data),r("endobj"),"smask"in e){var h="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,c={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:h,data:e.smask};"f"in e&&(c.f=e.f),t.call(this,c)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+e.pal.length+">>"),i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))),r("endobj"))},S=function(){var t=this.internal.collections[x+"images"];for(var e in t)n.call(this,t[e])},k=function(){var t,e=this.internal.collections[x+"images"],n=this.internal.write;for(var r in e)n("/I"+(t=e[r]).i,t.n,"0","R")},_=function(t){return"function"==typeof b["process"+t.toUpperCase()]},A=function(t){return"object"===(void 0===t?"undefined":vt(t))&&1===t.nodeType},I=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var n=""+t.getAttribute("src");if(0===n.indexOf("data:image/"))return n;!e&&/\.png(?:[?#].*)?$/i.test(n)&&(e="png")}if("CANVAS"===t.nodeName)var r=t;else{(r=document.createElement("canvas")).width=t.clientWidth||t.width,r.height=t.clientHeight||t.height;var i=r.getContext("2d");if(!i)throw"addImage requires canvas to be supported by browser.";i.drawImage(t,0,0,r.width,r.height)}return r.toDataURL("png"==(""+e).toLowerCase()?"image/png":"image/jpeg")},C=function(t,e){var n;if(e)for(var r in e)if(t===e[r].alias){n=e[r];break}return n};b.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"},b.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},b.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},b.sHashCode=function(t){return t=t||"",Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)},b.isString=function(t){return"string"==typeof t},b.validateStringAsBase64=function(t){var e=!0;return(t=t||"").length%4!=0&&(e=!1),!1===/[A-Za-z0-9\/]+/.test(t.substr(0,t.length-2))&&(e=!1),!1===/[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==/.test(t.substr(-2))&&(e=!1),e},b.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+)$/g.exec(t)},b.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},b.isArrayBuffer=function(t){return!!this.supportsArrayBuffer()&&t instanceof ArrayBuffer},b.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&("undefined"!=typeof Uint32Array&&(t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array))},b.binaryStringToUint8Array=function(t){for(var e=t.length,n=new Uint8Array(e),r=0;r>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},b.createImageInfo=function(t,e,n,r,i,o,a,s,h,c,l,u,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o),h&&(d.dp=h),c&&(d.trns=c),l&&(d.pal=l),u&&(d.smask=u),f&&(d.p=f),d},b.addImage=function(t,e,n,r,i,o,a,s,h){var c="";if("string"!=typeof e){var l=o;o=i,i=r,r=n,n=e,e=l}if("object"===(void 0===t?"undefined":vt(t))&&!A(t)&&"imageData"in t){var u=t;t=u.imageData,e=u.format||e,n=u.x||n||0,r=u.y||r||0,i=u.w||i,o=u.h||o,a=u.alias||a,s=u.compression||s,h=u.rotation||u.angle||h}if(isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var f,d,p,g,m,w,y,v=function(){var t=this.internal.collections[x+"images"];return t||(this.internal.collections[x+"images"]=t={},this.internal.events.subscribe("putResources",S),this.internal.events.subscribe("putXobjectDict",k)),t}.call(this);if(!(f=C(t,v))&&(A(t)&&(t=I(t,e)),(null==(y=a)||0===y.length)&&(a="string"==typeof(w=t)&&b.sHashCode(w)),!(f=C(a,v)))){if(this.isString(t)&&(""!==(c=this.convertStringToImageData(t))?t=c:void 0!==(c=this.loadImageFile(t))&&(t=c)),e=this.getImageFileTypeByImageData(t,e),!_(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(f=this["process"+e.toUpperCase()](t,(m=0,(g=v)&&(m=Object.keys?Object.keys(g).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(g)),m),a,((p=s)&&"string"==typeof p&&(p=p.toUpperCase()),p in b.image_compression?p:b.image_compression.NONE),d)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var h=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(n=h[0],r=h[1],a[o]=i,s){s*=Math.PI/180;var u=Math.cos(s),f=Math.sin(s),d=function(t){return t.toFixed(4)},p=[d(u),d(f),d(-1*f),d(u),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,f,f.i,v,h),this},b.convertStringToImageData=function(t){var e,n="";this.isString(t)&&(null!==(e=this.extractInfoFromBase64DataURI(t))?b.validateStringAsBase64(e[3])&&(n=atob(e[3])):b.validateStringAsBase64(t)&&(n=atob(t)));return n};var c=function(t,e){return t.subarray(e,e+5)};b.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>",c.content=m;var f=c.objId+" 0 R";m="<>";else if(h.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},t.link=function(t,e,n,r,i){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},t.getLineHeight=function(){return this.internal.getLineHeight()},function(t){var a=Object.keys({ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",fa:"Persian","fa-IR":"Persian/Iran",ur:"Urdu"}),u={1569:[65152],1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1572:[65157,65158],1573:[65159,65160,65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166,65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,65193],1584:[65195,65196,65195],1585:[65197,65198,65197],1586:[65199,65200,65199],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,65261],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395,64394],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},f={1570:[65269,65270,65269,65270],1571:[65271,65272,65271,65272],1573:[65273,65274,65273,65274],1575:[65275,65276,65275,65276]},d={1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1573:[65159,65160,65159,65160],1575:[65165,65166,65165,65166]},p={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},e=[1570,1571,1573,1575],n=[1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688],o=0,s=1,h=2,c=3;function g(t){return void 0!==t&&void 0!==u[t.charCodeAt(0)]}function l(t){return void 0!==t&&0<=n.indexOf(t.charCodeAt(0))}function m(t){return void 0!==t&&0<=e.indexOf(t.charCodeAt(0))}function w(t){return g(t)&&2<=u[t.charCodeAt(0)].length}function y(t,e,n,r){return g(t)?(r=r||{},u=Object.assign(u,r),!w(t)||!g(e)&&!g(n)||!g(n)&&l(e)||l(t)&&!g(e)||l(t)&&m(e)||l(t)&&l(e)?(u=Object.assign(u,d),o):g(i=t)&&4==u[i.charCodeAt(0)].length&&g(e)&&!l(e)&&g(n)&&w(n)?(u=Object.assign(u,d),c):l(t)||!g(n)?(u=Object.assign(u,d),s):(u=Object.assign(u,d),h)):-1;var i}var v=t.processArabic=function(t,e){t=t||"",e=e||!1;var n,r,i,o="",a=0,s=0,h="",c="",l="";for(a=0;a>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},( /** * jsPDF Canvas PlugIn * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv * * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ e=$.API).events.push(["initialized",function(){this.canvas.pdf=this}]),e.canvas={getContext:function(t){return(this.pdf.context2d._canvas=this).pdf.context2d},childNodes:[]},Object.defineProperty(e.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.getContext("2d").pageWrapX=t+1}}),Object.defineProperty(e.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.getContext("2d").pageWrapY=t+1}}), /** ==================================================================== * jsPDF Cell plugin * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br * 2013 Lee Driscoll, https://github.com/lsdriscoll * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria * 2014 James Hall, james@parall.ax * 2014 Diego Casorran, https://github.com/diegocr * * * ==================================================================== */ I=$.API,C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},T=1,d=function(t,e,n,r,i){C={x:t,y:e,w:n,h:r,ln:i}},p=function(){return C},F={left:0,top:0,bottom:0},I.setHeaderFunction=function(t){h=t},I.getTextDimensions=function(e){i=this.internal.getFont().fontName,o=this.table_font_size||this.internal.getFontSize(),a=this.internal.getFont().fontStyle;var t,n,r=19.049976/25.4;(n=document.createElement("font")).id="jsPDFCell";try{n.style.fontStyle=a}catch(t){n.style.fontWeight=a}n.style.fontSize=o+"pt",n.style.fontFamily=i;try{n.textContent=e}catch(t){n.innerText=e}return document.body.appendChild(n),t={w:(n.offsetWidth+1)*r,h:(n.offsetHeight+1)*r},document.body.removeChild(n),t},I.cellAddPage=function(){var t=this.margins||F;this.addPage(),d(t.left,t.top,void 0,void 0),T+=1},I.cellInitialize=function(){C={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},T=1},I.cell=function(t,e,n,r,i,o,a){var s=p(),h=!1;if(void 0!==s.ln)if(s.ln===o)t=s.x+s.w,e=s.y;else{var c=this.margins||F;s.y+s.h+r+13>=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(),h=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=p().y+p().h,h&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var l=0;l=this.pageBreaks[r]){e++,0===this.lastBreak&&n++;var i=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r],n+=Math.floor(i/this.pageWrapY)}if(0===this.lastBreak)n+=Math.floor(t/this.pageWrapY)+1;return n+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var n=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"lt",x:t=n[0],y:e=n[1]};this.path.push(r)},bezierCurveTo:function(t,e,n,r,i,o){var a;t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),i=this._wrapX(i),o=this._wrapY(o),i=(a=this._matrix_map_point(this.ctx._transform,[i,o]))[0],o=a[1];var s={type:"bct",x1:t=(a=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=a[1],x2:n=(a=this._matrix_map_point(this.ctx._transform,[n,r]))[0],y2:r=a[1],x:i,y:o};this.path.push(s)},quadraticCurveTo:function(t,e,n,r){var i;t=this._wrapX(t),e=this._wrapY(e),n=this._wrapX(n),r=this._wrapY(r),n=(i=this._matrix_map_point(this.ctx._transform,[n,r]))[0],r=i[1];var o={type:"qct",x1:t=(i=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=i[1],x:n,y:r};this.path.push(o)},arc:function(t,e,n,r,i,o){if(t=this._wrapX(t),e=this._wrapY(e),!this._matrix_is_identity(this.ctx._transform)){var a=this._matrix_map_point(this.ctx._transform,[t,e]);t=a[0],e=a[1];var s=this._matrix_map_point(this.ctx._transform,[0,0]),h=this._matrix_map_point(this.ctx._transform,[0,n]);n=Math.sqrt(Math.pow(h[0]-s[0],2)+Math.pow(h[1]-s[1],2))}var c={type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,anticlockwise:o};this.path.push(c)},drawImage:function(t,e,n,r,i,o,a,s,h){void 0!==o&&(e=o,n=a,r=s,i=h),e=this._wrapX(e),n=this._wrapY(n);var c,l=this._matrix_map_rect(this.ctx._transform,{x:e,y:n,w:r,h:i}),u=(this._matrix_map_rect(this.ctx._transform,{x:o,y:a,w:s,h:h}),/data:image\/(\w+).*/i.exec(t));c=null!=u?u[1]:"png",this.pdf.addImage(t,c,l.x,l.y,l.w,l.h)},_matrix_multiply:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],h=n*t[0]+r*t[2],c=i*t[0]+o*t[2],l=a*t[0]+s*t[2]+t[4];return r=n*t[1]+r*t[3],o=i*t[1]+o*t[3],s=a*t[1]+s*t[3]+t[5],[n=h,r,i=c,o,a=l,s]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=Math.sqrt(e*e+n*n),a=(e/=o)*r+(n/=o)*i;r-=e*a,i-=n*a;var s=Math.sqrt(r*r+i*i);return a/=s,e*(i/=s)>"),s.push(">>");var h="MASK"+s.objId;this.pdf.internal.addGraphicsState(h,s.objId);var c="/"+h+" gs";n.splice(0,0,"q"),n.splice(1,0,c),n.push("Q"),window.outIntercept=a;break;default:var l="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];l&&this.pdf.internal.out(l+" gs")}var u=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(u=this.ctx._fillOpacity),r){var f=this.pdf.internal.newObject2();f.push("<>");h="GS_O_"+f.objId;this.pdf.internal.addGraphicsState(h,f.objId),this.pdf.internal.out("/"+h+" gs")}for(var d=this.path,p=0;p>"),e.push(">>");var n="MASK"+e.objId;this.pdf.internal.addGraphicsState(n,e.objId);var r="/"+n+" gs";this.pdf.internal.out(r)}else console.log("jsPDF v2 not enabled")},clip:function(){if(0i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=P(n),x=i.x,S=12/i.pdf.internal.scaleFactor,k=(b["margin-left"]+b["padding-left"])*S,_=(b["margin-right"]+b["padding-right"])*S,A=(b["margin-top"]+b["padding-top"])*S,I=(b["margin-bottom"]+b["padding-bottom"])*S;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-_:x+=k,i.pdf.addImage(y,x,i.y+A,n.width,n.height),y=void 0,"right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!B[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===b.float?-n.width-k-_:0,i.y+n.height+A+I,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y]*?>/gi,""),c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(h=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",h.innerHTML='