module.exports =
/******/ (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, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// 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 = 167);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent (
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier, /* server only */
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
        injectStyles.call(
          this,
          (options.functional ? this.parent : this).$root.$options.shadowRoot
        )
      }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 167:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/aos-flow/src/main.vue?vue&type=template&id=559fd22e&
var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c("div", { staticClass: "aos-flow" }, [
    _c("div", { staticClass: "aos-flow__body" }, [
      [
        "countersign",
        "return-countersign",
        "hangup",
        "turnto",
        "transfer"
      ].indexOf(_vm.actionType) < 0
        ? _c("div", { staticClass: "aos-flow__type" }, [
            _vm.actionType === "reject" &&
            _vm.showReject &&
            _vm.rejectActivitys.length > 0
              ? _c("div", { staticClass: "aos-flow__part" }, [
                  _c("span", { staticClass: "aos-flow__message-title" }, [
                    _vm._v("退回至")
                  ])
                ])
              : _vm._e(),
            _vm.actionType === "reject" &&
            _vm.showReject &&
            _vm.rejectActivitys.length > 0
              ? _c(
                  "div",
                  { staticClass: "aos-flow__part aos-flow__part-message" },
                  [
                    _c(
                      "div",
                      [
                        _c(
                          "el-select",
                          {
                            staticClass: "aos-flow-reject-group",
                            attrs: { clearable: "" },
                            model: {
                              value: _vm.rejectNode,
                              callback: function($$v) {
                                _vm.rejectNode = $$v
                              },
                              expression: "rejectNode"
                            }
                          },
                          _vm._l(_vm.rejectActivitys, function(item) {
                            return _c("el-option", {
                              key: item.activityId,
                              staticClass: "aos-flow-reject-radio",
                              attrs: {
                                value: item.activityId,
                                label: item.activityName
                              }
                            })
                          }),
                          1
                        )
                      ],
                      1
                    )
                  ]
                )
              : _vm._e(),
            _vm._m(0),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    autosize: { minRows: 2 },
                    placeholder: "请在此输入审批意见"
                  },
                  model: {
                    value: _vm.outMessage,
                    callback: function($$v) {
                      _vm.outMessage = $$v
                    },
                    expression: "outMessage"
                  }
                })
              ],
              1
            ),
            _vm.showInnerMessage
              ? _c("div", { staticClass: "aos-flow__part" }, [
                  _c("span", { staticClass: "aos-flow__flow-message-title" }, [
                    _vm._v("内部意见")
                  ])
                ])
              : _vm._e(),
            _vm.showInnerMessage
              ? _c(
                  "div",
                  { staticClass: "aos-flow__part aos-flow__part-message" },
                  [
                    _c("el-input", {
                      attrs: {
                        type: "textarea",
                        autosize: { minRows: 2 },
                        placeholder: "请在此输入内部意见"
                      },
                      model: {
                        value: _vm.message,
                        callback: function($$v) {
                          _vm.message = $$v
                        },
                        expression: "message"
                      }
                    })
                  ],
                  1
                )
              : _vm._e(),
            _vm.showConditionMessage && _vm.actionType !== "reject"
              ? _c("div", { staticClass: "aos-flow__part" }, [
                  _c("span", { staticClass: "aos-flow__flow-message-title" }, [
                    _vm._v("有条件通过意见")
                  ])
                ])
              : _vm._e(),
            _vm.showConditionMessage && _vm.actionType !== "reject"
              ? _c(
                  "div",
                  { staticClass: "aos-flow__part aos-flow__part-message" },
                  [
                    _c("el-input", {
                      attrs: {
                        type: "textarea",
                        autosize: { minRows: 2 },
                        placeholder: "请在此输入有条件通过意见"
                      },
                      model: {
                        value: _vm.conditionMessage,
                        callback: function($$v) {
                          _vm.conditionMessage = $$v
                        },
                        expression: "conditionMessage"
                      }
                    })
                  ],
                  1
                )
              : _vm._e(),
            _c(
              "div",
              { staticClass: "aos-flow__images aos-flow__part-message" },
              [
                _c(
                  "el-upload",
                  {
                    staticClass: "aos-flow__upload",
                    attrs: {
                      drag: "",
                      multiple: "",
                      "file-list": _vm.filesList,
                      action: "/bpm/api/task/upload/" + _vm.taskId,
                      "on-success": _vm.handleUploadSuccess,
                      "before-remove": _vm.handleBeforeRemove
                    }
                  },
                  [
                    _c("i", {
                      staticClass: "el-icon-upload",
                      staticStyle: { "font-size": "40px", margin: "0" }
                    }),
                    _c(
                      "div",
                      {
                        staticClass: "el-upload__text",
                        staticStyle: { "font-size": "12px", margin: "0 8px" }
                      },
                      [
                        _vm._v("将文件拖到此处或"),
                        _c("em", [_vm._v("点击上传")])
                      ]
                    )
                  ]
                )
              ],
              1
            )
          ])
        : _vm._e(),
      _vm.actionType === "countersign"
        ? _c("div", { staticClass: "aos-flow__type aos-flow__countersign" }, [
            _vm._m(1),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    autosize: { minRows: 2 },
                    placeholder: "请在此输入加签说明"
                  },
                  model: {
                    value: _vm.countersignMessage,
                    callback: function($$v) {
                      _vm.countersignMessage = $$v
                    },
                    expression: "countersignMessage"
                  }
                })
              ],
              1
            ),
            _vm._m(2),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [_c("el-select")],
              1
            )
          ])
        : _vm._e(),
      _vm.actionType === "return-countersign"
        ? _c(
            "div",
            { staticClass: "aos-flow__type aos-flow__return-countersign" },
            [
              _vm._m(3),
              _c(
                "div",
                { staticClass: "aos-flow__part aos-flow__part-message" },
                [
                  _c("el-input", {
                    attrs: {
                      type: "textarea",
                      autosize: { minRows: 2 },
                      placeholder: "请在此输入回复加签说明"
                    },
                    model: {
                      value: _vm.returnCountersignMessage,
                      callback: function($$v) {
                        _vm.returnCountersignMessage = $$v
                      },
                      expression: "returnCountersignMessage"
                    }
                  })
                ],
                1
              )
            ]
          )
        : _vm._e(),
      _vm.actionType === "hangup"
        ? _c("div", { staticClass: "aos-flow__type aos-flow__hangup" }, [
            _vm._m(4),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    autosize: { minRows: 2 },
                    placeholder: "请在此输入挂起原因"
                  },
                  model: {
                    value: _vm.hangUpMessage,
                    callback: function($$v) {
                      _vm.hangUpMessage = $$v
                    },
                    expression: "hangUpMessage"
                  }
                })
              ],
              1
            )
          ])
        : _vm._e(),
      _vm.actionType === "turnto"
        ? _c("div", { staticClass: "aos-flow__type aos-flow__turnto" }, [
            _vm._m(5),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    autosize: { minRows: 2 },
                    placeholder: "请在此输入转办说明"
                  },
                  model: {
                    value: _vm.turntoMessage,
                    callback: function($$v) {
                      _vm.turntoMessage = $$v
                    },
                    expression: "turntoMessage"
                  }
                })
              ],
              1
            ),
            _vm._m(6),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c(
                  "el-select",
                  {
                    attrs: { placeholder: "请选择" },
                    model: {
                      value: _vm.turnToUser,
                      callback: function($$v) {
                        _vm.turnToUser = $$v
                      },
                      expression: "turnToUser"
                    }
                  },
                  _vm._l(_vm.turnTowardUsers, function(item) {
                    return _c("el-option", {
                      key: item.id,
                      attrs: { label: item.name, value: item.id }
                    })
                  }),
                  1
                )
              ],
              1
            )
          ])
        : _vm._e(),
      _vm.actionType === "transfer"
        ? _c("div", { staticClass: "aos-flow__type aos-flow__turnto" }, [
            _vm._m(7),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-input", {
                  attrs: {
                    type: "textarea",
                    autosize: { minRows: 2 },
                    placeholder: "请输入转移说明"
                  },
                  model: {
                    value: _vm.transferData.reason,
                    callback: function($$v) {
                      _vm.$set(_vm.transferData, "reason", $$v)
                    },
                    expression: "transferData.reason"
                  }
                })
              ],
              1
            ),
            _c(
              "div",
              { staticClass: "aos-flow__part aos-flow__part-message" },
              [
                _c("el-switch", {
                  staticStyle: { display: "block" },
                  attrs: {
                    "active-color": "#13ce66",
                    "inactive-color": "#ff4949",
                    "active-text": "候选人",
                    "inactive-text": "候选组"
                  },
                  on: { change: _vm.handleTransferTypeChange },
                  model: {
                    value: _vm.transferData.type,
                    callback: function($$v) {
                      _vm.$set(_vm.transferData, "type", $$v)
                    },
                    expression: "transferData.type"
                  }
                })
              ],
              1
            ),
            _vm.transferData.type
              ? _c("div", { staticClass: "aos-flow__part" }, [
                  _c("span", { staticClass: "aos-flow__message-title" }, [
                    _vm._v("候选人")
                  ])
                ])
              : _vm._e(),
            _vm.transferData.type
              ? _c(
                  "div",
                  { staticClass: "aos-flow__part aos-flow__part-message" },
                  [
                    _c("aos-ref", {
                      attrs: {
                        refCode: "user",
                        value: _vm.transferData.candidateUsers,
                        editable: true,
                        multiple: true,
                        placeholder: "请选择候选人员"
                      },
                      on: { change: _vm.handelCandidateUsersChange }
                    })
                  ],
                  1
                )
              : _vm._e(),
            !_vm.transferData.type
              ? _c("div", { staticClass: "aos-flow__part" }, [
                  _c("span", { staticClass: "aos-flow__message-title" }, [
                    _vm._v("候选组")
                  ])
                ])
              : _vm._e(),
            !_vm.transferData.type
              ? _c(
                  "div",
                  { staticClass: "aos-flow__part aos-flow__part-message" },
                  [
                    _c("aos-ref", {
                      attrs: {
                        refCode: "bpm_group_ref",
                        value: _vm.transferData.candidateGroups,
                        editable: true,
                        placeholder: "请选择候选组"
                      },
                      on: { change: _vm.handelCandidateGroupsChange }
                    })
                  ],
                  1
                )
              : _vm._e()
          ])
        : _vm._e()
    ]),
    _c("div", { staticClass: "aos-flow__footer" }, [
      [
        "countersign",
        "return-countersign",
        "hangup",
        "turnto",
        "reject",
        "transfer"
      ].indexOf(_vm.actionType) < 0
        ? _c(
            "div",
            [
              _c(
                "el-button",
                {
                  attrs: { type: "success", loading: _vm.loading },
                  on: { click: _vm.agreeEvent }
                },
                [_vm._v("通过")]
              ),
              _vm.showReject
                ? _c(
                    "el-button",
                    {
                      staticClass: "aos-flow__footer-button",
                      attrs: { type: "warning", loading: _vm.loading },
                      on: { click: _vm.rejectEvent }
                    },
                    [_vm._v("退回")]
                  )
                : _vm._e(),
              !_vm.showReject && _vm.showTurnto
                ? _c(
                    "el-button",
                    {
                      staticClass: "aos-flow__footer-button",
                      attrs: {
                        loading: _vm.loading,
                        "&&": "",
                        "!showTransfer": ""
                      },
                      on: { click: _vm.handleTurnTo }
                    },
                    [_vm._v("转办")]
                  )
                : _vm._e(),
              !_vm.showReject && !_vm.showTurnto && _vm.showTransfer
                ? _c(
                    "el-button",
                    {
                      staticClass: "aos-flow__footer-button",
                      attrs: { loading: _vm.loading },
                      on: { click: _vm.handleTransfer }
                    },
                    [_vm._v("转移")]
                  )
                : _vm._e(),
              _c(
                "el-dropdown",
                {
                  staticClass: "aos-flow__footer-button",
                  attrs: { type: "primary", trigger: "click" },
                  on: { command: _vm.handleMoreCommand }
                },
                [
                  _c("el-button", [
                    _vm._v("\n          更多"),
                    _c("i", {
                      staticClass: "el-icon-arrow-down el-icon--right"
                    })
                  ]),
                  _c(
                    "el-dropdown-menu",
                    { attrs: { slot: "dropdown" }, slot: "dropdown" },
                    [
                      _vm.showReject && _vm.showTurnto && !_vm.showTransfer
                        ? _c(
                            "el-dropdown-item",
                            { attrs: { command: "turnto" } },
                            [_vm._v("转办")]
                          )
                        : _vm._e(),
                      _vm.showReject && _vm.showTransfer && !_vm.showTurnto
                        ? _c(
                            "el-dropdown-item",
                            { attrs: { command: "transfer" } },
                            [_vm._v("转移")]
                          )
                        : _vm._e(),
                      _vm.showRefuse
                        ? _c(
                            "el-dropdown-item",
                            {
                              attrs: {
                                command: "refuse",
                                disabled: _vm.loading
                              }
                            },
                            [_vm._v("拒绝")]
                          )
                        : _vm._e(),
                      _c("el-dropdown-item", { attrs: { command: "hangup" } }, [
                        _vm._v("挂起")
                      ])
                    ],
                    1
                  )
                ],
                1
              )
            ],
            1
          )
        : _c(
            "div",
            { staticClass: "aos-flow__footer-inline" },
            [
              _c("el-button", { on: { click: _vm.handleInlineBack } }, [
                _vm._v("返回")
              ]),
              _c(
                "el-button",
                {
                  staticClass: "aos-flow__footer-button",
                  attrs: { type: "primary", loading: _vm.loading },
                  on: { click: _vm.handleInlineSubmit }
                },
                [_vm._v("确定")]
              )
            ],
            1
          )
    ])
  ])
}
var staticRenderFns = [
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__flow-message-title" }, [
        _vm._v("审批意见")
      ])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [
        _vm._v("加签说明")
      ])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [_vm._v("加签人")])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [
        _vm._v("回复加签说明")
      ])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [
        _vm._v("挂起原因")
      ])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [
        _vm._v("转办说明")
      ])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [_vm._v("转办人")])
    ])
  },
  function() {
    var _vm = this
    var _h = _vm.$createElement
    var _c = _vm._self._c || _h
    return _c("div", { staticClass: "aos-flow__part" }, [
      _c("span", { staticClass: "aos-flow__message-title" }, [
        _vm._v("转移说明")
      ])
    ])
  }
]
render._withStripped = true


// CONCATENATED MODULE: ./packages/aos-flow/src/main.vue?vue&type=template&id=559fd22e&

// EXTERNAL MODULE: external "lodash/cloneDeep"
var cloneDeep_ = __webpack_require__(7);
var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(cloneDeep_);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/aos-flow/src/main.vue?vue&type=script&lang=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 */ var mainvue_type_script_lang_js_ = ({
  name: 'AosFlow',
  props: {
    // 表单状态判断,true为表单已处理好,false为表单未处理好
    operation: {
      type: Boolean
    },
    // 表单未处理好的提示信息
    operationMessage: {
      type: String,
      default: '当前表单未处理'
    },
    // 是否显示操作按钮
    disabled: {
      type: Boolean,
      default: false
    },
    // 是否显示意见框
    showMessage: {
      type: Boolean,
      default: false
    },
    // 点击操作之前
    beforeAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    // 点击同意操作之前
    agreeBeforeAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    rejectBeforeAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    refuseBeforeAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    // 点击提交按钮之前触发事件
    submitBeforeAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    // 同意时是否走agreeBeforeAction方法
    agreeBefore: {
      type: Boolean,
      default: false
    },
    // // 驳回是否走rejectBeforeAction方法
    // rejectBefore: {
    //   type: Boolean,
    //   default: false
    // },
    // // 拒绝是否走refuseBeforeAction方法
    // refuseBefore: {
    //   type: Boolean,
    //   default: false
    // },
    // 提交时是否走submitBeforeAgree方法
    submitBefore: {
      type: Boolean,
      default: false
    },
    // 返回按钮返回的URL,默认返回任务中心
    backRouter: {
      type: String,
      default: '/bpm/task'
    },
    // 提交确认成功之后跳转的页面
    confirmBackRouter: {
      type: String,
      default: '/bpm/task'
    },
    // 是否显示返回按钮
    showBackBtn: {
      type: Boolean,
      default: true
    },
    // 显示的风格,horizontal:水平 vertical: 垂直
    showType: {
      type: String,
      default: 'horizontal'
    },
    // agreeBeforeAction方法:false同步请求,true有异步请求
    agreeAsyncHttp: {
      type: Boolean,
      default: false
    },
    // 控制refuseBeforeAction方法为同步还是异步： 
    refuseAsyncHttp: {
      type: Boolean,
      default: false
    },
    rejectAsyncHttp: {
      type: Boolean,
      default: false
    },
    // 是否自动触发提交,true为自动提交
    autoOperate: {
      type: Boolean,
      default: true
    },
    // 是否自动触发驳回
    autoReject: {
      type: Boolean,
      default: true
    },
    // 是否自动触发拒绝
    autoRefuse: {
      type: Boolean,
      default: true
    },
    // 是否水平版 自动拒绝
    autoHorizontalRefuse: {
      type: Boolean,
      default: true
    },
    // 水平版拒绝前的校验函数
    beforeHorizantalRefuseAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    // 是否水平版 自动驳回
    autoHorizontalReject: {
      type: Boolean,
      default: true
    },
    // 水平版驳回前的校验函数
    beforeHorizantalRejectAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    },
    autoSubmit: {
      type: Boolean,
      default: true
    },
    // 弹框 点击确认前事件
    beforeSubmitAction: {
      type: Function,
      default: function _default() {
        return true;
      }
    }

  },
  data: function data() {
    return {
      showFlow: false, // 是否显示流程审批按钮
      active: 0,
      showReject: false, //是否显示驳回按钮
      showRefuse: false, // 是否显示拒绝按钮
      rejectActivitys: '', // 驳回信息(包含环节等)
      refuseReasons: [], // 拒绝原因
      rejectReasons: [], // 驳回原因
      completeReasons: [], // 通过原因
      completeGroupReasons: {}, // 通过的组原因
      refuseGroupReasons: {}, // 通过的组原因
      rejectGroupReasons: {}, // 通过的组原因
      reasonList: [], //原因
      reasonGroupObject: {}, //组原因
      taskId: '', // 当前任务id
      processInstanceId: '', //流程id
      startEndMessage: '', // 审批开始结束信息
      showHistory: false, // 显示历史信息
      taskDetail: '', // 任务详细
      historyDetailList: '', // 历史审批意见,
      translateHistoryDetailList: '', // 转换过类型的历史审批意见
      messageTitle: '', //意见dailog名称
      operationType: true, // 操作的类型,true为通过,false为驳回
      // showMessage: false, // 是否显示意见dialog 改为双向数据绑定
      message: '', // 内部意见
      conditionMessage: '', //有条件通过意见
      outMessage: '', //外部意见
      reason: '', // 选择的原因
      rejectNode: '', //驳回节点
      auditRecord: '', // 审批意见
      messageSuccess: false, // 通过或拒绝是否成功
      approvalCheckedType: '',
      rejectType: '',
      showApprovalMessage: false, // 切换审批和审批意见,默认为审批
      approvalType: '', // 当前审批类型
      reverse: false,
      dialogImageUrl: '', // 图片的url
      dialogVisible: false, // 图片预览
      filesList: [],
      activeItemIndex: '',
      moreActionList: [{
        label: '转办',
        key: 'turnto'
      }, {
        label: '驳回',
        key: 'reject'
      }, {
        lable: '加签',
        key: 'countersign'
      }, {
        label: '挂起',
        key: 'hangup'
      }],
      actionType: '',
      hangUpMessage: '',
      turntoMessage: '',
      returnCountersignMessage: '',
      countersignMessage: '',
      transferMessage: '',
      showTurnto: false,
      showTransfer: false,
      turnTowardUsers: [],
      turnToUser: '',
      // 是否显示内部意见
      showInnerMessage: false,
      // 是否显示有条件通过意见
      showConditionMessage: false,
      loading: false,
      transferData: {
        type: true,
        reason: '',
        transferTaskName: '',
        candidateUsers: '',
        candidateGroups: ''
      }
    };
  },

  methods: {
    handleTransferTypeChange: function handleTransferTypeChange(val) {
      if (val) {
        this.transferData.candidateGroups = '';
      } else {
        this.transferData.candidateUsers = '';
      }
    },
    handelCandidateUsersChange: function handelCandidateUsersChange(val) {
      this.transferData.candidateUsers = val;
      this.transferData.candidateGroups = '';
    },
    handelCandidateGroupsChange: function handelCandidateGroupsChange(val) {
      this.transferData.candidateUsers = '';
      this.transferData.candidateGroups = val;
    },
    handleInlineBack: function handleInlineBack() {
      this.actionType = '';
      this.hangUpMessage = '';
      this.turntoMessage = '';
      this.returnCountersignMessage = '';
      this.countersignMessage = '';
    },
    handleMoreCommand: function handleMoreCommand(commond) {
      this.actionType = commond;
      if (commond === 'refuse') {
        this.refuseEvent();
      }
    },
    handleTurnTo: function handleTurnTo() {
      this.actionType = 'turnto';
    },
    handleTransfer: function handleTransfer() {
      this.actionType = 'transfer';
    },
    handleInlineSubmit: function handleInlineSubmit() {
      if (this.actionType === 'hangup') {
        this.handleHangUp();
      } else if (this.actionType === 'reject') {
        this.handleRejectEvent();
      } else if (this.actionType === 'turnto') {
        this.turnToEvent();
      }if (this.actionType === 'transfer') {
        this.transferEvent();
      }
    },
    handleRejectEvent: function handleRejectEvent() {
      this.handleApprovalCheckChange(1);
      if (!this.rejectNode) {
        this.$message({
          type: 'error',
          message: '请选择退回环节'
        });
        return;
      }
      this.handleVerticalSubmitMessage();
    },
    handleHangUp: function handleHangUp() {
      var _this = this;

      this.$confirm('确认挂起？', '提示').then(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
        var submitData;
        return regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _context.prev = 0;
                submitData = {
                  reason: _this.hangUpMessage,
                  taskId: _this.taskId,
                  userId: '',
                  auditRecord: '',
                  innerRemind: '',
                  remind: ''
                };

                _this.loading = true;
                _context.next = 5;
                return _this.hangup(submitData);

              case 5:
                _this.loading = false;
                _this.$message({
                  type: 'success',
                  message: '挂起成功'
                });
                _this.$emit('hangup');
                _this.$utils.removeCurrentTab(_this.$route);
                _this.handleEmitRefresh();
                _this.$router.push(_this.backRouter);
                _context.next = 17;
                break;

              case 13:
                _context.prev = 13;
                _context.t0 = _context['catch'](0);

                console.error(_context.t0);
                _this.loading = false;

              case 17:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this, [[0, 13]]);
      })));
    },
    hangup: function hangup(data) {
      return this.$http({
        url: '/bpm/api/task-suspendeda-ctivate',
        method: 'post',
        data: data
      }).then(function (res) {
        return res;
      });
    },
    turnToEvent: function turnToEvent() {
      var _this2 = this;

      this.$confirm('确认转办？', '提示').then(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
        var submitData;
        return regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.prev = 0;
                submitData = {
                  reason: _this2.turntoMessage,
                  taskId: _this2.taskId,
                  auditRecord: '',
                  innerRemind: '',
                  remind: '',
                  userId: '',
                  turnTowardUserId: _this2.turnToUser
                };

                _this2.loading = true;
                _context2.next = 5;
                return _this2.turnto(submitData);

              case 5:
                _this2.$message({
                  type: 'success',
                  message: '转办成功'
                });
                _this2.loading = false;
                _this2.$emit('turnto');
                _this2.$utils.removeCurrentTab(_this2.$route);
                _this2.handleEmitRefresh();
                _this2.$router.push(_this2.backRouter);
                _context2.next = 17;
                break;

              case 13:
                _context2.prev = 13;
                _context2.t0 = _context2['catch'](0);

                console.error(_context2.t0);
                _this2.loading = false;

              case 17:
              case 'end':
                return _context2.stop();
            }
          }
        }, _callee2, _this2, [[0, 13]]);
      })));
    },
    turnto: function turnto(data) {
      return this.$http({
        url: '/bpm/api/task-turn-toward',
        method: 'post',
        data: data
      }).then(function (res) {
        return res;
      });
    },
    transferEvent: function transferEvent() {
      var _this3 = this;

      this.$confirm('确认转移？', '提示').then(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
        var submitData;
        return regeneratorRuntime.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                _context3.prev = 0;
                submitData = cloneDeep_default()(_this3.transferData);

                submitData.taskId = _this3.taskId;
                submitData.candidateGroups = submitData.candidateGroups ? submitData.candidateGroups.split(',') : [];
                submitData.candidateUsers = submitData.candidateUsers ? submitData.candidateUsers.split(',') : [];
                delete submitData.type;
                _this3.loading = true;
                _context3.next = 9;
                return _this3.transfer(submitData);

              case 9:
                _this3.$message({
                  type: 'success',
                  message: '转移发起成功'
                });
                _this3.loading = false;
                _this3.$emit('transfer');
                _this3.$utils.removeCurrentTab(_this3.$route);
                _this3.handleEmitRefresh();
                _this3.$router.push(_this3.backRouter);
                _context3.next = 21;
                break;

              case 17:
                _context3.prev = 17;
                _context3.t0 = _context3['catch'](0);

                console.error(_context3.t0);
                _this3.loading = false;

              case 21:
              case 'end':
                return _context3.stop();
            }
          }
        }, _callee3, _this3, [[0, 17]]);
      })));
    },
    transfer: function transfer(data) {
      return this.$http({
        url: '/bpm/api/task-transfer',
        method: 'post',
        data: data
      }).then(function (res) {
        return res;
      });
    },
    getImageList: function getImageList() {
      var _this4 = this;

      this.$http({
        url: '/bpm/api/task/files/' + this.taskId,
        method: 'get'
      }).then(function (res) {
        _this4.filesList = res.data;
        if (_this4.filesList && _this4.filesList.length > 0) {
          _this4.filesList.forEach(function (item) {
            var message = JSON.parse(item.message);
            var url = '/bpm/api/task/file-download/' + _this4.taskId + '/' + item.id;
            item.name = message.fileName + message.fileSuffix;
            item.url = url;
          });
        }
      }).catch(function () {
        _this4.$message({
          type: 'error',
          message: '获取流程附件出错'
        });
      });
    },

    // 图片删除
    handleRemove: function handleRemove(file, fileList) {
      console.log(file, fileList);
    },

    // 图片预览
    handlePictureCardPreview: function handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleUploadSuccess: function handleUploadSuccess(response, file, fileLis) {
      this.getImageList();
    },
    handleOnRemove: function handleOnRemove(file) {
      return this.$http({
        url: '/bpm/api/task/file-delete/' + this.taskId + '/' + file.id,
        method: 'post'
      }).then(function (res) {
        return res;
      });
    },
    handleBeforeRemove: function handleBeforeRemove(file) {
      var _this5 = this;

      return new Promise(function (resolve, reject) {
        _this5.$confirm('确认删除当前附件？', '删除提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
          return regeneratorRuntime.wrap(function _callee4$(_context4) {
            while (1) {
              switch (_context4.prev = _context4.next) {
                case 0:
                  _context4.prev = 0;
                  _context4.next = 3;
                  return _this5.handleOnRemove(file);

                case 3:
                  _this5.getImageList();
                  _this5.$message({
                    type: 'success',
                    message: '删除流程附件成功'
                  });
                  resolve(true);
                  _context4.next = 12;
                  break;

                case 8:
                  _context4.prev = 8;
                  _context4.t0 = _context4['catch'](0);

                  reject(false);
                  _this5.$message({
                    type: 'error',
                    message: '删除流程附件出错'
                  });

                case 12:
                case 'end':
                  return _context4.stop();
              }
            }
          }, _callee4, _this5, [[0, 8]]);
        }))).catch(function () {
          reject(false);
        });
      });
    },
    handleImageMouseOut: function handleImageMouseOut(index) {
      this.activeItemIndex = '';
    },
    handleImageMouseOver: function handleImageMouseOver(index) {
      this.activeItemIndex = index;
    },
    handleViewImage: function handleViewImage(item) {
      this.dialogVisible = true;
      this.dialogImageUrl = '/bpm/api/task/file-download/' + this.taskId + '/' + item.id;
    },
    handleViewTimeLineImage: function handleViewTimeLineImage(url) {
      this.dialogVisible = true;
      this.dialogImageUrl = url;
    },
    handleDownload: function handleDownload(item) {
      var a = document.createElement('a');
      if (typeof a.download === 'undefined') {
        var newUrl = window.location.protocol + "//" + window.location.host + '/bpm/api/task/file-download/' + this.taskId + '/' + item.id;
        window.open(newUrl);
      }
    },
    handleDeleteImage: function handleDeleteImage(item) {
      var _this6 = this;

      this.$confirm('确认删除当前附件？', '删除提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function () {
        _this6.$http({
          url: '/bpm/api/task/file-delete/' + _this6.taskId + '/' + item.id,
          method: 'delete'
        }).then(function (res) {
          _this6.getImageList();
        }).catch(function () {
          _this6.$message({
            type: 'error',
            message: '删除流程附件出错'
          });
        });
      });
    },

    // 切换到审批
    changeType: function changeType() {
      this.showApprovalMessage = false;
    },

    // 原因选择 
    handleReasonChange: function handleReasonChange(val) {
      this.reason = val;
    },

    // 获取驳回是否显示按钮,以及驳回的id
    getConfig: function getConfig() {
      var _this7 = this;

      this.$http({
        method: 'get',
        url: '/bpm/api/task-opconfig/' + this.taskId
      }).then(function (res) {
        if (res.status === 200) {
          var resData = res.data;
          if (resData.refuseAble) {
            _this7.showRefuse = true;
          }
          if (resData.reasonAble) {
            _this7.showConditionMessage = true;
          }
          if (resData.innerRemindAble) {
            _this7.showInnerMessage = true;
          }
          _this7.rejectReasons = resData.rejectReasons;
          if (resData.completeReasons) {
            _this7.completeReasons = resData.completeReasons;
          }
          if (resData.completeGroupReasons) {
            _this7.completeGroupReasons = resData.completeGroupReasons;
          }
          if (resData.refuseReasons) {
            _this7.refuseReasons = resData.refuseReasons;
          }
          if (resData.refuseGroupReasons) {
            _this7.refuseGroupReasons = resData.refuseGroupReasons;
          }
          if (resData.canRejectNodes) {
            _this7.rejectActivitys = resData.canRejectNodes;
            if (_this7.rejectActivitys && _this7.rejectActivitys.length > 0) {
              _this7.rejectNode = _this7.rejectActivitys[0].activityId;
            }
            _this7.showReject = true;
          } else {
            _this7.showReject = false;
          }
          if (resData.rejectGroupReasons) {
            _this7.rejectGroupReasons = resData.rejectGroupReasons;
          }
          if (resData.canTurnTowardUsers) {
            _this7.showTurnto = true;
            _this7.turnTowardUsers = resData.canTurnTowardUsers;
          } else {
            _this7.showTurnto = false;
          }
          if (resData.transferTaskAble) {
            _this7.showTransfer = true;
            _this7.showTurnto = false;
          } else {
            _this7.showTransfer = false;
          }
        }
      }).catch(function () {
        _this7.$message({
          type: 'error',
          message: '请求流程按钮配置出错'
        });
      });
    },


    // 获取任务详细
    getTaskDetail: function getTaskDetail() {
      var _this8 = this;

      this.$http({
        method: 'get',
        url: '/bpm/api/task/info/' + this.taskId
      }).then(function (res) {
        if (res.data) {
          _this8.taskDetail = res.data;
        }
      }).catch(function () {
        _this8.$message({
          type: 'error',
          message: '请求任务详细出错'
        });
      });
    },
    getTaskId: function getTaskId() {
      if (this.$route.query && this.$route.query.taskId) {
        this.taskId = this.$route.query.taskId;
        this.showFlow = true;
        this.getConfig();
        // this.getTaskDetail();
      }
      if (this.$route.query && this.$route.query.processInstanceId) {
        this.processInstanceId = this.$route.query.processInstanceId;
      }
    },
    handleAgreeBeforeAction: function handleAgreeBeforeAction() {
      if (this.operation) {
        if (this.showType === 'horizontal') {
          this.$emit('update:showMessage', true);
        }
      } else {
        this.$message({
          type: 'info',
          message: this.operationMessage
        });
      }
      if (!!this.agreeBeforeAction && this.agreeAsyncHttp) {
        return this.agreeBeforeAction;
      } else {
        if (!this.agreeBeforeAction()) {
          return false;
        }
        return true;
      }
    },
    handleBeforeAction: function handleBeforeAction() {
      if (!this.beforeAction()) {
        return false;
      }
      if (this.operation) {
        if (this.showType === 'horizontal') {
          this.$emit('update:showMessage', true);
        }
      } else {
        this.$message({
          type: 'info',
          message: this.operationMessage
        });
      }
      return true;
    },
    agreeEvent: function agreeEvent() {
      this.handleApprovalCheckChange(0);
      this.handleVerticalSubmitMessage();
    },
    refuseEvent: function refuseEvent() {
      this.handleApprovalCheckChange(2);
      this.handleVerticalSubmitMessage();
    },
    rejectEvent: function rejectEvent() {
      this.actionType = 'reject';
      // this.handleApprovalCheckChange(1)
      // if(!this.rejectNode){
      //   this.$message({
      //     type:'error',
      //     message: '请选择退回环节'
      //   })
      //   return;
      // }
      // this.handleVerticalSubmitMessage()
    },

    // 选择的审批类型: 0:通过,1:驳回,2:拒绝
    handleApprovalCheckChange: function handleApprovalCheckChange(label) {
      this.approvalCheckedType = label;
      if (label === 0) {
        this.handleAgree();
      } else if (label === 1) {
        this.handleReject();
      } else if (label === 2) {
        this.handleRefuse();
      }
      // this.reason = '';
      // this.auditRecord = '';
      // this.rejectNode = '';
      this.$emit('approval-change', label);
    },

    // 点击通过按钮
    handleAgree: function handleAgree() {
      this.approvalType = 'agree';
      if (this.showType === 'horizontal') {
        this.$emit("change", 'submit');
        if (this.submitBefore) {
          this.submitBeforeAction();
        } else {
          this.handleBeforeAction();
        }
      } else {
        this.$emit("change", 'agree');
        this.reasonList = this.completeReasons;
        this.reasonGroupObject = this.completeGroupReasons;
        this.operationType = true;
      }
    },

    // 点击退回驳回按钮
    handleReject: function handleReject() {
      this.approvalType = 'reject';
      if (this.showType === 'horizontal') {
        this.$emit("change", 'back');
        // if(this.handleBeforeAction()){
        this.reasonList = this.rejectReasons;
        this.reasonGroupObject = this.rejectGroupReasons;
        this.messageTitle = "退回";
        this.operationType = false;
        this.$emit('update:showMessage', true);
        // this.handleSubmitMessage();
        // }
      } else {
        this.$emit("change", 'reject');
        this.reasonList = this.rejectReasons;
        this.reasonGroupObject = this.rejectGroupReasons;
        this.messageTitle = "驳回";
        this.operationType = false;
      }
    },

    // 点击拒绝按钮
    handleRefuse: function handleRefuse() {
      this.approvalType = 'refuse';
      this.$emit("change", 'refuse');
      if (this.showType === 'horizontal') {
        if (this.handleBeforeAction()) {
          this.reasonList = this.refuseReasons;
          this.reasonGroupObject = this.refuseGroupReasons;
          this.messageTitle = "拒绝";
          // this.$emit('update:showMessage',true);
        }
      } else {
        this.reasonList = this.refuseReasons;
        this.reasonGroupObject = this.refuseGroupReasons;
      }
    },
    handleBack: function handleBack() {
      this.$utils.removeCurrentTab(this.$route);
      this.handleEmitRefresh();
      this.$router.push(this.confirmBackRouter);
    },
    handleEmitRefresh: function handleEmitRefresh() {
      this.$eventBus.emit('refresh');
    },

    // 关闭意见
    handleCloseMessage: function handleCloseMessage() {
      // this.$confirm('确认关闭?','关闭',{
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning',
      // }).then(() => {
      this.$emit('update:showMessage', false);
      // });
    },
    handleVerticalSubmitMessage: function handleVerticalSubmitMessage() {
      var _this9 = this;

      if (this.reasonGroupObject && Object.keys(this.reasonGroupObject).length > 0 || this.reasonList && this.reasonList.length > 0) {
        var message = void 0;
        if (this.approvalType === 'agree') {
          message = '请选择通过原因';
        } else if (this.approvalType === 'reject') {
          message = '请选择驳回原因';
        } else if (this.approvalType === 'refuse') {
          message = '请选择拒绝原因';
        }
        if (!this.reason) {
          this.$message({
            type: 'error',
            message: message
          });
          return;
        }
      }
      // if(!this.outMessage){
      //     this.$message({
      //       type: 'error',
      //       message: '请输入审批意见'
      //     });
      //     return;
      //   }
      // if(!this.message){
      //   this.$message({
      //     type: 'error',
      //     message: '请输入内部意见'
      //   });
      //   return;
      // }
      if (this.agreeBefore && this.approvalType === 'agree') {
        if (this.autoOperate) {
          this.loading = true;
          if (this.agreeAsyncHttp) {
            this.agreeBeforeAction().then(function (valid) {
              if (valid) {
                _this9.handleSubmitMessage();
              } else {
                _this9.loading = false;
              }
            });
          } else {
            if (this.handleAgreeBeforeAction()) {
              this.handleSubmitMessage();
            } else {
              this.loading = false;
            }
          }
        } else {
          this.handleAgreeBeforeAction();
        }
      }
      if (this.approvalType === 'reject') {
        if (this.autoReject) {
          this.loading = true;
          if (this.rejectAsyncHttp) {
            this.rejectBeforeAction().then(function (valid) {
              if (valid) {
                _this9.handleSubmitMessage();
              } else {
                _this9.loading = false;
              }
            });
          } else {
            if (this.rejectBeforeAction()) {
              this.handleSubmitMessage();
            } else {
              this.loading = false;
            }
          }
        } else {
          this.rejectBeforeAction();
        }
      }
      if (this.approvalType === 'refuse') {
        if (this.autoRefuse) {
          this.loading = true;
          if (this.refuseAsyncHttp) {
            this.refuseBeforeAction().then(function (valid) {
              if (valid) {
                _this9.handleSubmitMessage();
              } else {
                _this9.loading = false;
              }
            });
          } else {
            if (this.refuseBeforeAction()) {
              this.handleSubmitMessage();
            } else {
              this.loading = false;
            }
          }
        } else {
          this.refuseBeforeAction();
        }
      }
    },
    handleHorizontalSubmitMessage: function handleHorizontalSubmitMessage() {
      if (this.approvalType === 'agree') {
        if (!this.autoSubmit) {
          this.beforeSubmitAction();
        } else {
          this.handleSubmitMessage();
        }
      }
      if (this.approvalType === 'refuse') {
        if (!this.autoHorizontalRefuse) {
          this.beforeHorizantalRefuseAction();
        } else {
          this.handleSubmitMessage();
        }
      }
      if (this.approvalType === 'reject') {
        if (!this.autoHorizontalReject) {
          this.beforeHorizantalRejectAction();
        } else {
          this.handleSubmitMessage();
        }
      }
    },
    handleSubmitMessage: function handleSubmitMessage() {
      var _this10 = this;

      this.loading = true;
      var submit = this.submitMessage();
      window.Promise.all([submit]).then(function () {
        _this10.loading = false;
        _this10.$emit('after-action', _this10.messageSuccess);
        if (_this10.messageSuccess) {
          _this10.$utils.removeCurrentTab(_this10.$route);
          _this10.handleEmitRefresh();
          _this10.$router.push(_this10.backRouter);
        }
      }).catch(function (error) {
        console.log(error);
        _this10.loading = false;
      });
    },

    // 意见提交,operationType: true 通过
    submitMessage: function submitMessage() {
      var _this11 = this;

      var url = void 0;
      var submitData = {};
      // let success = false;
      if (this.showType === 'horizontal') {
        if (this.approvalType === 'agree') {
          url = '/bpm/api/task-complete';
          submitData = {
            auditRecord: this.auditRecord,
            innerRemind: this.message,
            remind: this.outMessage,
            reason: this.conditionMessage,
            taskId: this.taskId
          };
        } else if (this.approvalType === 'reject') {
          url = '/bpm/api/task-reject';
          submitData = {
            targetActivityId: this.rejectActivitys[0].activityId,
            remind: this.outMessage,
            taskId: this.taskId
          };
        } else if (this.approvalType === 'refuse') {
          url = '/bpm/api/task-refuse';
          submitData = {
            remind: this.outMessage,
            taskId: this.taskId
          };
        }
      } else {
        if (this.reasonGroupObject && Object.keys(this.reasonGroupObject).length > 0 || this.reasonList && this.reasonList.length > 0) {
          var message = void 0;
          if (this.approvalType === 'agree') {
            message = '请选择通过原因';
          } else if (this.approvalType === 'reject') {
            message = '请选择驳回原因';
          } else if (this.approvalType === 'refuse') {
            message = '请选择拒绝原因';
          }
          if (!this.reason) {
            this.$message({
              type: 'error',
              message: message
            });
            return;
          }
        }
        // if(!this.message){
        //   this.$message({
        //     type: 'error',
        //     message: '请输入内部意见'
        //   });
        //   return;
        // }
        // if(!this.outMessage){
        //   this.$message({
        //     type: 'error',
        //     message: '请输入外部意见'
        //   });
        //   return;
        // }
        if (this.approvalType === 'agree') {
          url = '/bpm/api/task-complete';
          submitData = {
            auditRecord: this.auditRecord,
            innerRemind: this.message,
            remind: this.outMessage,
            reason: this.conditionMessage,
            taskId: this.taskId
          };
        } else if (this.approvalType === 'reject') {
          url = '/bpm/api/task-reject';
          submitData = {
            auditRecord: this.auditRecord,
            innerRemind: this.message,
            remind: this.outMessage,
            targetActivityId: this.rejectNode,
            reason: this.reason,
            taskId: this.taskId
          };
        } else if (this.approvalType === 'refuse') {
          url = '/bpm/api/task-refuse';
          submitData = {
            auditRecord: this.auditRecord,
            innerRemind: this.message,
            remind: this.outMessage,
            reason: this.reason,
            taskId: this.taskId
          };
        }
      }

      return this.$http({
        method: 'post',
        url: url,
        data: submitData
      }).then(function (res) {
        if (res.status === 200) {
          var successMessage = '';
          if (_this11.approvalType === 'agree') {
            if (_this11.showType === 'horizontal') {
              successMessage = "提交成功";
            } else {
              successMessage = "通过成功";
            }
          } else if (_this11.approvalType === 'reject') {
            if (_this11.showType === 'horizontal') {
              successMessage = "退回成功";
              _this11.$emit('update:showMessage', false);
            } else {
              successMessage = "驳回成功";
            }
          } else {
            successMessage = "拒绝成功";
          }
          _this11.$message({
            type: 'success',
            message: successMessage
          });
          _this11.messageSuccess = true;
        }
      }).catch(function () {
        var errorMessage = '';
        if (_this11.approvalType === 'agree') {
          if (_this11.showType === 'horizontal') {
            errorMessage = "提交失败";
          } else {
            errorMessage = "通过失败";
          }
        } else if (_this11.approvalType === 'reject') {
          if (_this11.showType === 'horizontal') {
            errorMessage = "退回失败";
          } else {
            errorMessage = "驳回失败";
          }
        } else {
          errorMessage = "拒绝失败";
        }
        _this11.$message({
          type: 'error',
          message: errorMessage
        });
        _this11.messageSuccess = false;
      });
    }
  },
  created: function created() {
    this.getTaskId();
    this.getImageList();
  }
});
// CONCATENATED MODULE: ./packages/aos-flow/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);

// CONCATENATED MODULE: ./packages/aos-flow/src/main.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "packages/aos-flow/src/main.vue"
/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/aos-flow/index.js

main.install = function (Vue) {
  Vue.component(main, main.name);
};
/* harmony default export */ var aos_flow = __webpack_exports__["default"] = (main);

/***/ }),

/***/ 7:
/***/ (function(module, exports) {

module.exports = require("lodash/cloneDeep");

/***/ })

/******/ });