sd-minio-upfile
Version:
1,425 lines (1,310 loc) • 68.2 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("gs-start-approval", [], factory);
else if(typeof exports === 'object')
exports["gs-start-approval"] = factory();
else
root["gs-start-approval"] = factory();
})(typeof self !== 'undefined' ? self : this, function() {
return /******/ (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 = 3);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (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 + ' */';
}
/***/ }),
/* 1 */
/***/ (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__(7)
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
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 () {}
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
module.exports = function (parentId, list, _isProduction) {
isProduction = _isProduction
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sd_user_selector__ = __webpack_require__(11);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_sd_user_selector___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_sd_user_selector__);
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"); }); }; }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// import userSelector from '../../../src/components/start-approval/start-approval'
/* harmony default export */ __webpack_exports__["a"] = ({
name: 'start-approval',
props: {
businessId: {
type: String,
default: ''
},
operType: {
type: String,
default: '1' //新增 0 编辑 1
},
formId: {
type: String,
default: '' //1858415537667837952
},
msgTit: {
type: String,
default: ''
},
msgUrl: {
type: String,
default: ''
},
sponsor: {
type: String,
default: ''
},
sponsorOrg: {
type: String,
default: ''
},
module: {
type: String,
default: ''
},
variables: {
type: Object,
default: function _default() {
return {};
}
},
platform: {
type: String,
default: 'pc'
},
definition: {
type: Array,
default: function _default() {
return [];
}
},
beforeOpen: {
// 打开启动流程组件钱事件
type: Function,
default: null
},
startUpSuccess: {
type: Function,
default: null
},
beforeSatrtUp: {
type: Function,
default: null
},
error: {
type: Function,
default: null
},
isDelProcInst: {
// 流程启动失败是否删除流程实例
type: Boolean,
default: true
},
delProcInstCallback: {
type: Function,
default: null
},
showcc: {
type: Boolean,
default: true
},
tit: {
type: String,
default: '提交审批'
},
bindEvent: {
type: Boolean,
default: true
},
orgCode: {
type: String,
default: ''
},
assigneeUserId: {
type: String,
default: ''
},
assigneeUserName: {
type: String,
default: ''
},
assigneeOrgId: {
type: String,
default: ''
},
assigneeOrgName: {
type: String,
default: ''
},
assigneeAreaId: {
type: String,
default: ''
},
assigneeAreaName: {
type: String,
default: ''
},
extraOrgId: {
type: String,
default: ''
},
extraRegId: {
type: String,
default: ''
},
selectUsers: {
type: String,
default: ''
},
extraCityId: {
type: String,
default: ''
},
showCbyj: {
type: Boolean,
default: false
},
approvalContent: {
type: String,
default: ''
}
},
components: {
userSelector: __WEBPACK_IMPORTED_MODULE_0_sd_user_selector__["userSelector"]
},
data: function data() {
return {
bootData: {},
isInitData: false,
openStatus: false,
nodeName: '部门',
loading: false,
indeterminate: false,
checkAll: true,
bpmDefinition: [],
orgUserList: [],
actDefKey: '',
actDefName: '',
orgId: '',
userList: [],
candidateUsers: [],
csldList: [], // 抄送领导
selectedUser: '',
selectNode: '',
nextNodeList: [],
// 所选择的节点是否需要法制审核
selectNodeSffzsh: false,
formValidate: {
approvalContent: this.approvalContent
},
orgArr: [],
selectOrgArr: [],
formArr: [],
formData: {},
ProcessVarObj: {}
};
},
mounted: function mounted() {
if (this.bindEvent && this.$slots.func) {
this.reference = this.$slots.func[0].elm;
this.reference.addEventListener('click', this.openStartApproval);
}
},
watch: {
approvalContent: function approvalContent(value) {
this.formValidate.approvalContent = value;
}
},
methods: {
openStartApproval: function openStartApproval() {
var _this = this;
if (this.beforeOpen) {
this.beforeOpen().then(function (data) {
if (data) {
_this.formId ? _this.getForm() : _this.initData();
}
});
} else {
this.formId ? this.getForm() : this.initData();
}
},
getFormField: function getFormField() {
var _this2 = this;
if (this.formId) {
this.$store.dispatch('postRequest', { url: '/bsp-com/com/form/getFormFieldByFormId', params: { formId: this.formId } }).then(function (resp) {
if (resp.success) {
if (resp.data && resp.data.length > 0) {
resp.data.forEach(function (item) {
if (item.isMain == '1') {
_this2.formArr = item.children;
var obj = {};
var keyName = '';
_this2.formArr.forEach(function (ele) {
if (ele.isProcessVar && ele.isProcessVar == '1') {
keyName = ele.fieldName;
obj[keyName] = _this2.formData[ele.fieldName];
}
});
_this2.ProcessVarObj = obj;
}
});
_this2.initData();
} else {
_this2.initData();
}
}
});
}
},
getForm: function getForm() {
var _this3 = this;
var params = {
operType: this.operType,
formId: this.formId,
businessId: this.businessId
};
this.$store.dispatch('postRequest', { url: '/bsp-com/com/form/handle/getFormData', params: params }).then(function (resp) {
if (resp.success) {
console.log(resp, resp.success, 'resp.data');
_this3.formData = resp.formData;
_this3.getFormField();
} else {
_this3.warnSwal('文书模版加载出错。原因:' + resp.msg);
}
});
},
initData: function initData() {
// 清空抄送人员
this.csldList = [];
if (this.isInitData) {
this.openStatus = true;
} else {
if (this.definition.length < 1) {
this.warnSwal('未设置流程。');
return;
}
if (this.businessId === '') {
this.warnSwal('未设置业务编号[businessId]。');
return;
}
if (this.module === '') {
this.warnSwal('未设置模块名称[module]。');
return;
}
this.bootData = {
definition: this.definition,
businessId: this.businessId,
fApp: this.module,
fXxpt: this.platform,
variables: this.variables,
zbrUserId: this.sponsor,
zbrOrgId: this.sponsorOrg,
msgUrl: this.msgUrl,
msgTit: this.msgTit,
assigneeUserId: this.assigneeUserId,
assigneeUserName: this.assigneeUserName,
assigneeOrgId: this.assigneeOrgId,
assigneeOrgName: this.assigneeOrgName,
assigneeAreaId: this.assigneeAreaId,
assigneeAreaName: this.assigneeAreaName
};
this.initDefiniton(this.bootData.definition);
}
},
warnSwal: function warnSwal(msg, callback) {
this.$Modal.warning({
title: '温馨提示',
content: msg
});
},
// 判断所选择的节点是否需要法制审核
justFzshNextNode: function justFzshNextNode() {
var _this4 = this;
if (this.selectNode) {
this.$store.dispatch('postRequest', { url: '/bsp-bpm/bpm/nodeSetting/isFzsh', params: { defKey: this.actDefKey, nodeId: this.selectNode } }).then(function (resp) {
if (resp.success) {
// 是否需要法制审核
_this4.selectNodeSffzsh = resp.sffzsh;
}
});
}
},
initDefiniton: function initDefiniton(bpmDefinition) {
if (bpmDefinition.length < 1) {
this.warnSwal('未配置流程。');
return;
}
this.bpmDefinition = bpmDefinition;
this.actDefKey = bpmDefinition[0].defKey;
this.actDefName = bpmDefinition[0].name;
this.getOrgUserList(this.actDefKey, null, this.bootData.assigneeUserId);
},
getOrgUserList: function getOrgUserList(actDefKey, actInstId, userId) {
var _this5 = this;
// if (!userId) userId = this.$store.state.common.idCard;
var url = '';
var param = {};
var formProcessVar = '';
this.formId ? formProcessVar = JSON.stringify(this.ProcessVarObj) : '';
if (actInstId) {
// 审批过程获取用户信息
url = '/bsp-bpm/bpm/approveProcess/getApproveUser';
param = { actInstId: actInstId, userId: userId, formProcessVar: formProcessVar };
} else {
url = '/bsp-bpm/bpm/approveProcess/getStartApproveUser';
param = {
defKey: actDefKey,
startUserId: userId,
startRegId: this.bootData.assigneeAreaId,
startOrgId: this.bootData.assigneeOrgId,
extraOrgId: this.extraOrgId,
extraRegId: this.extraRegId,
extraCityId: this.extraCityId,
zbrUserId: this.bootData.zbrUserId,
zbrOrgId: this.bootData.zbrOrgId,
formProcessVar: formProcessVar
};
}
this.$store.dispatch('postRequest', { url: url, params: param }).then(function (data) {
if (data.success && data.data.length > 0) {
_this5.openStatus = true;
_this5.isInitData = true;
var nodeData = data.data[0];
if (nodeData.nodeType == 'exclusiveGateway') {
_this5.nextNodeList = nodeData.orgUserList;
// 默认选中第一个节点
// this.selectNode = this.nextNodeList[0].nodeId
// this.nodeName = this.nextNodeList[0].nodeName
// this.orgUserList = this.nextNodeList[0].orgUser
// this.clearCheckbox()
// 判断所选择的节点是否需要法制审核
// this.justFzshNextNode()
return;
}
// 当下一节点不是排它网关时
_this5.selectNode = nodeData.nodeId;
// 判断下一节点是否需要法制审核
// this.justFzshNextNode()
var orgUserList = nodeData.orgUserList;
_this5.orgArr = orgUserList;
// 默认选中第一项
if (orgUserList && orgUserList.length > 0) {
var selectOrg = _this5.getSelectOrg(orgUserList, _this5.extraOrgId, _this5.extraRegId);
_this5.orgSelectEvent({
label: selectOrg.orgName,
value: selectOrg.orgId
}, true);
_this5.selectOrgArr = [];
_this5.selectOrgArr.push(selectOrg.orgId);
}
} else {
_this5.warnSwal(data.msg);
}
});
},
onSelectNode: function onSelectNode(nodeId) {
var _this6 = this;
this.nextNodeList.forEach(function (item) {
if (item.nodeId == nodeId) {
_this6.orgArr = item.orgUser;
}
});
// 清空单位值,清空复选框
/* this.orgUserList = []
this.selectOrgArr = [] */
// 默认选中第一项
if (this.orgArr && this.orgArr.length > 0) {
this.orgSelectEvent({
label: this.orgArr[0].orgName,
value: this.orgArr[0].orgId
});
this.selectOrgArr = [];
this.selectOrgArr.push(this.orgArr[0].orgId);
}
// 判断所选择的节点是否需要法制审核
// this.justFzshNextNode()
},
getSelectOrg: function getSelectOrg(orgUserList, extraOrgId, extraRegId) {
var extraOrgIdArr = extraOrgId ? extraOrgId.split(',') : [];
var extraRegionIdArr = extraRegId ? extraRegId.split(',') : [];
// 先根据机构id匹配
for (var i in extraOrgIdArr) {
var matchOrgIdVal = extraOrgIdArr[i];
for (var j in orgUserList) {
var item = orgUserList[j];
if (matchOrgIdVal === item['orgId']) {
return item;
}
}
}
// 根据机构id没有匹配到时再根据区域id匹配
for (var _i in extraRegionIdArr) {
var matchRegionId = extraRegionIdArr[_i];
for (var _j in orgUserList) {
var _item = orgUserList[_j];
if (matchRegionId === _item['regId']) {
return _item;
}
}
}
// 都没匹配到就默认第一个
return orgUserList[0];
},
orgSelectEvent: function orgSelectEvent(option, selectTag) {
var _this7 = this;
var index = this.orgArr.findIndex(function (item) {
return item.orgId == option.value;
});
this.orgUserList = [];
this.candidateUsers = [];
this.orgUserList.push(this.orgArr[index]);
// 默认全选
this.indeterminate = false;
this.checkAll = true;
if (this.selectUsers && selectTag) {
var selectUsersArr = this.selectUsers.split(',');
this.orgArr[index].user.map(function (item) {
return selectUsersArr.forEach(function (ele) {
if (item.userIdCard == ele) {
_this7.candidateUsers.push(item.userIdCard + '_' + item.orgCode);
}
});
});
// 如果默认人员不存在 设置全选
if (this.candidateUsers && this.candidateUsers.length == 0) {
this.orgArr[index].user.map(function (item) {
return _this7.candidateUsers.push(item.userIdCard + '_' + item.orgCode);
});
}
if (this.candidateUsers.length == this.orgArr[index].user.length) {
this.indeterminate = false;
this.checkAll = true;
} else {
this.indeterminate = true;
this.checkAll = false;
}
} else {
this.orgArr[index].user.map(function (item) {
return _this7.candidateUsers.push(item.userIdCard + '_' + item.orgCode);
});
}
// this.orgArr[index].user.map(item => this.candidateUsers.push(item.userIdCard + '_' + item.orgCode))
},
onSelectFlow: function onSelectFlow(data) {
var actDefKey = data.value;
var index = this.bpmDefinition.findIndex(function (item) {
return item.defKey == actDefKey;
});
if (index > -1) {
this.actDefKey = this.bpmDefinition[index].defKey;
this.actDefName = this.bpmDefinition[index].name;
}
// 清空单位值,清空复选框
this.orgArr = [];
this.orgUserList = [];
this.candidateUsers = [];
this.selectOrgArr = [];
this.nextNodeList = [];
this.selectNode = '';
this.getOrgUserList(this.actDefKey, null, this.bootData.assigneeUserId);
},
convertCandidateUsers: function convertCandidateUsers() {
return this.candidateUsers.map(function (item) {
var array = item.split('_');
return {
idCard: array[0],
orgCode: array[1]
};
});
},
convertCsldbh: function convertCsldbh() {
return this.csldList.map(function (item) {
return {
idCard: item.idCard,
orgCode: item.orgCode
};
});
},
submit: function submit() {
var _this8 = this;
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
var exParam, param;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
exParam = {
actDefKey: _this8.actDefKey,
candidateUsers: _this8.convertCandidateUsers(),
csldbh: _this8.convertCsldbh()
};
_this8.formId ? exParam.formProcessVar = JSON.stringify(_this8.ProcessVarObj) : '';
_this8.bootData.variables.nextNodeId = _this8.selectNode;
param = Object.assign(_this8.bootData, exParam);
if (_this8.showCbyj) {
param.approvalContent = _this8.formValidate.approvalContent;
}
_this8.$store.dispatch('postRequest', {
url: '/bsp-bpm/bpm/approveProcess/startProcess',
params: { processCmd: JSON.stringify(param) }
}).then(function (data) {
if (data.success) {
console.log(data.data, data.data.bpmTrail.taskId, 'data.datadata.datadata.data.bpmProcinst.actDefId');
var bmpData = {
actDefId: data.data.bpmProcinst.actDefId,
businessId: data.data.bpmProcinst.businessId,
actInstId: data.data.bpmProcinst.actInstId,
taskId: data.data.bpmTrail.taskId, //成功回调新增taskId
defId: data.data.bpmProcinst.defId,
defKey: data.data.defKey
};
if (_this8.startUpSuccess) {
_this8.startUpSuccess(bmpData).then(function (d) {
_this8.loading = false;
if (d) {
_this8.cancel();
_this8.isInitData = false;
} else {
// 删除流程示例
if (_this8.isDelProcInst) {
var _that = _this8;
_that.deleteProcInst(bmpData.actInstId, function (dd) {
if (_that.delProcInstCallback) {
_that.delProcInstCallback(dd);
}
});
}
}
});
} else {
_this8.cancel();
_this8.isInitData = false;
_this8.$Modal.success({
title: '温馨提示',
content: '流程启动成功。'
});
}
} else {
alert(data.msg);
_this8.loading = false;
if (_this8.error) {
_this8.error(data);
} else {
_this8.$Modal.error({
title: '温馨提示',
content: data.msg
});
}
}
});
case 6:
case 'end':
return _context.stop();
}
}
}, _callee, _this8);
}))();
},
handleCheckAll: function handleCheckAll() {
var _this9 = this;
if (this.indeterminate) {
this.checkAll = false;
} else {
this.checkAll = !this.checkAll;
}
this.indeterminate = false;
if (this.checkAll) {
this.orgUserList.forEach(function (item) {
item.user.forEach(function (item) {
_this9.candidateUsers.push(item.userIdCard + '_' + item.orgCode);
});
});
} else {
this.candidateUsers = [];
}
},
checkAllGroupChange: function checkAllGroupChange(data) {
var count = 0;
this.orgUserList.forEach(function (item) {
item.user.forEach(function (item) {
count++;
});
});
if (data.length === count) {
this.indeterminate = false;
this.checkAll = true;
} else if (data.length > 0) {
this.indeterminate = true;
this.checkAll = false;
} else {
this.indeterminate = false;
this.checkAll = false;
}
},
cancel: function cancel() {
this.openStatus = false;
this.loading = false;
this.isInitData = false;
},
start: function start(name) {
var _this10 = this;
this.$refs[name].validate(function (valid) {
if (valid) {
if (!_this10.customizeValidate()) return;
_this10.loading = true;
if (_this10.beforeSatrtUp) {
_this10.beforeSatrtUp(_this10.actDefKey, _this10.convertCandidateUsers()).then(function (data) {
if (data) {
_this10.submit();
} else {
_this10.loading = false;
}
});
} else {
_this10.submit();
}
} else {
_this10.$Notice.error({
title: '错误提示',
desc: '表单验证不通过'
});
}
});
},
// 自定义验证
customizeValidate: function customizeValidate() {
var validate = true;
/* if (!this.actDefKey) {
this.$Modal.warning({
title: '温馨提示',
content: '请选择审批流程。'
})
validate = false
} */
if (!this.selectNode) {
this.$Modal.warning({
title: '错误提示',
content: '审核节点不能为空'
});
validate = false;
} else if (!this.candidateUsers || this.candidateUsers.length === 0) {
this.$Modal.warning({
title: '温馨提示',
content: '请选择审批人。'
});
validate = false;
}
return validate;
},
// 删除抄送人
csld_close: function csld_close(idx) {
this.csldList.splice(idx, 1);
},
// 选择抄送人回调
policeConfirm: function policeConfirm(policeList) {
this.csldList = policeList;
var _that = this;
_that.selectedUser = '';
_that.csldList.map(function (item, index) {
if (index != 0) {
_that.selectedUser += ',';
}
_that.selectedUser += item.idCard;
});
},
deleteProcInst: function deleteProcInst(actInstId, callback) {
this.$store.dispatch('postRequest', { url: '/bsp-bpm/bpm/procinst/deleteByActInstIds', params: { actInstIds: actInstId } }).then(function (data) {
if (callback) {
callback(data);
}
});
}
}
});
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__start_approval_vue__ = __webpack_require__(4);
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "startApproval", function() { return __WEBPACK_IMPORTED_MODULE_0__start_approval_vue__["a"]; });
var Plugin = {
install: function install(Vue) {
Vue.component('start-approval', __WEBPACK_IMPORTED_MODULE_0__start_approval_vue__["a" /* default */]);
}
};
/* harmony default export */ __webpack_exports__["default"] = (Plugin);
/***/ }),
/* 4 */
/***/ (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_modules_iview_loader_index_js_ref_5_start_approval_vue__ = __webpack_require__(2);
/* unused harmony namespace reexport */
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b150bb1c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_start_approval_vue__ = __webpack_require__(12);
function injectStyle (ssrContext) {
__webpack_require__(5)
__webpack_require__(8)
}
var normalizeComponent = __webpack_require__(10)
/* script */
/* template */
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-b150bb1c"
/* 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_modules_iview_loader_index_js_ref_5_start_approval_vue__["a" /* default */],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_b150bb1c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_start_approval_vue__["a" /* default */],
__vue_template_functional__,
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(6);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(1)("ed29c6ce", content, true);
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(0)(false);
// imports
// module
exports.push([module.i, ".uni-ctnt[data-v-b150bb1c]{padding:5px 0 20px;position:relative}.uni-ctnt .checkAll[data-v-b150bb1c]{margin-top:10px;max-height:100px;position:absolute;left:-75px}.uni-sel[data-v-b150bb1c]{display:flex}.uni-sel>.sel[data-v-b150bb1c]{width:80%}.uni-sel>.check[data-v-b150bb1c]{width:20%;margin-left:20px}.uni-list[data-v-b150bb1c]{margin-top:10px;max-height:200px;overflow:auto;width:500px}.bsp-flow-modal .bsp-flow-modal-title[data-v-b150bb1c]{height:40px;background:#2b5fda;width:100%;text-indent:1em;color:#fff;line-height:40px;font-size:15px}.bsp-flow-people-ctnt>div[data-v-b150bb1c]{display:inline-block}.bsp-flow-modal [data-v-b150bb1c]::-webkit-scrollbar{width:5px;height:1px}.bsp-flow-modal [data-v-b150bb1c]::-webkit-scrollbar-thumb{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,.2);background:#c9c9c9}.bsp-flow-modal [data-v-b150bb1c]::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0,0,0,.2);border-radius:4px;background:#ededed}.cancle-button[data-v-b150bb1c],.submit-button[data-v-b150bb1c]{min-width:60px;font-size:14px;border-radius:0}.cancle-button[data-v-b150bb1c]{border:1px solid #2b5fd9;color:#2b5fd9;background-color:#fff}.submit-button[data-v-b150bb1c]{border:1px solid #2b5fd9;color:#fff;background-color:#2b5fd9}.tip-container[data-v-b150bb1c]{margin-top:10px;background-color:#f2f6fc;padding:16px}.tip-container .tip-title[data-v-b150bb1c]{font-size:16px;font-weight:700;padding-right:10px}.tip-container .tip-warning[data-v-b150bb1c]{color:#e60012;font-weight:16px}.tip-container p[data-v-b150bb1c]{font-size:16px;margin:20px}", ""]);
// exports
/***/ }),
/* 7 */
/***/ (function(module, exports) {
/**
* Translates the list format produced by css-loader into something
* easier to manipulate.
*/
module.exports = function listToStyles (parentId, list) {
var styles = []
var newStyles = {}
for (var i = 0; i < list.length; i++) {
var item = list[i]
var id = item[0]
var css = item[1]
var media = item[2]
var sourceMap = item[3]
var part = {
id: parentId + ':' + i,
css: css,
media: media,
sourceMap: sourceMap
}
if (!newStyles[id]) {
styles.push(newStyles[id] = { id: id, parts: [part] })
} else {
newStyles[id].parts.push(part)
}
}
return styles
}
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(9);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(1)("114b6bfb", content, true);
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(0)(false);
// imports
// module
exports.push([module.i, ".bsp-flow-modal .ivu-modal-header{padding:0}.bsp-flow-modal .ivu-icon-ios-close{font-size:32px}.bsp-flow-modal .ivu-tag-text{font-size:16px}.bsp-flow-modal .ivu-tag-dot{padding:0 8px}.bsp-flow-modal .ivu-tag-dot-inner{margin-right:2px}.bsp-flow-modal .ivu-tag .ivu-icon-ios-close{font-size:18px;top:1px;margin-left:4px!important}.bsp-flow-modal .ivu-form .ivu-form-item-label{font-size:16px}.bsp-flow-modal textarea.ivu-input{font-size:16px;height:80px}.bsp-flow-modal .ivu-form-item-error-tip{position:inherit}.bsp-flow-modal .bsp-sel-user .ivu-icon-md-add{font-size:18px}.bsp-flow-modal .bsp-sel-user>.ivu-icon+span,.bsp-flow-modal .bsp-sel-user>span+.ivu-icon{margin-left:0;font-size:16px}.bsp-flow-modal .ivu-select-input{font-size:16px}.bsp-flow-modal .ivu-select-item{font-size:16px!important}.bsp-flow-modal .ivu-checkbox-wrapper{font-size:16px}.bsp-flow-modal .ivu-form-item{margin-bottom:0;padding-bottom:10px}.bsp-flow-modal .ivu-modal-body{max-height:450px;overflow-y:auto;overflow-x:hidden}.bsp-flow-modal .ivu-modal-footer{height:50px;line-height:50px;padding:0 12px}", ""]);
// exports
/***/ }),
/* 10 */
/***/ (function(module, exports) {
/* globals __VUE_SSR_CONTEXT__ */
// IMPORTANT: Do NOT use ES2015 features in this file.
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.
module.exports = function normalizeComponent (
rawScriptExports,
compiledTemplate,
functionalTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */
) {
var esModule
var scriptExports = rawScriptExports = rawScriptExports || {}
// ES6 modules interop
var type = typeof rawScriptExports.default
if (type === 'object' || type === 'function') {
esModule = rawScriptExports
scriptExports = rawScriptExports.default
}
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (compiledTemplate) {
options.render = compiledTemplate.render
options.staticRenderFns = compiledTemplate.staticRenderFns
options._compiled = true
}
// functional template
if (functionalTemplate) {
options.functional = true
}
// scopedId
if (scopeId) {
options._scopeId = 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 = injectStyles
}
if (hook) {
var functional = options.functional
var existing = functional
? options.render
: options.beforeCreate
if (!functional) {
// inject component registration as beforeCreate hook
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
} else {
// for template-only hot-reload because in that case the render fn doesn't
// go through the normalizer
options._injectStyles = hook
// register for functioal component in vue file
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return existing(h, context)
}
}
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}
}
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
!function(e,t){ true?module.exports=t():"function"==typeof define&&define.amd?define("sd-user-selector",[],t):"object"==typeof exports?exports["sd-user-selector"]=t():e["sd-user-selector"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(a){if(s[a])return s[a].exports;var r=s[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var s={};return t.m=e,t.c=s,t.d=function(e,s,a){t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=1)}([function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"user-selector",props:{value:{type:String,default:""},text:{type:String,default:""},tit:{type:String,default:"民警选择"},returnField:{type:String,default:"idCard"},button:{type:String,default:"选 择"},numExp:{type:String,default:""},orgCode:{type:String,default:""},bindEvent:{type:Boolean,default:!0},msg:String,disabled:{type:Boolean,default:!1},defaultSearchText:{type:Boolean,default:!1}},data:function(){return{loaded:!1,showText:this.text,title:"用户选择",modal:!1,showmModal:!1,orgId:"",condition:"",hasOthers:!1,selectedIdCardArr:[],selectedList:[],policeList:[],policeCache:[],reference:null,timer:null}},watch:{value:function(e){this.loaded||this.getPoliceByFieldData(this.value)}},mounted:function(){this.bindEvent&&this.$slots.func&&(this.reference=this.$slots.func[0].elm,this.reference.addEventListener("click",this.openDialog))},beforeDestroy:function(){this.reference&&this.reference.removeEventListener("click",this.changeVisiable,!1)},methods:{openDialog:function(){this.orgId=this.orgCode?this.orgCode:this.$store.state.common.orgCode,this.getPoliceData(),this.getPoliceByFieldData(this.value),this.showmModal=!0,this.modal=!0},clearData:function(){this.$emit("input",""),this.$emit("update:text",""),this.$emit("onClear")},getPoliceData:function(){var e=this,t=this.orgId;this.hasOthers&&(t=""),this.policeList=[],this.$store.dispatch("postRequest",{url:"/bsp-uac/uac/user/getOptionalPolice",params:{orgId:t,condition:this.condition}}).then(function(t){t.success?(e.policeList=t.data,e.policeCache=t.data):console.log(t.msg)})},getPoliceByFieldData:function(e){var t=this,s=this;if(""==e)return this.loaded=!0,this.selectedIdCardArr=[],this.selectedList=[],!1;this.$store.dispatch("postRequest",{url:"/bsp-uac/uac/user/getByFieldData",params:{field:this.returnField,value:e}}).then(function(e){e.success?(t.loaded=!0,s.selectedList=e.data,void 0!=s.selectedList&&null!=s.selectedList&&(t.selectedIdCardArr=[],s.selectedList.forEach(function(e,s){if(t.selectedIdCardArr.push(e.idCard),!t.showText&&t.defaultSearchText){var a=[],r=[];t.selectedList.forEach(function(e){a.push(e.name),r.push(e[t.returnField])}),t.textValue=a.join(","),t.$emit("update:text",t.textValue),t.showText=t.textValue}}))):t.$Modal.warning({title:"温馨提示",content:e.msg})})},onKeyUp:function(){var e=this,t=e.condition;e.timer&&clearInterval(e.timer),e.timer=setInterval(function(){t===e.condition&&(e.searchData(),clearInterval(e.timer))},500)},changeOrg:function(){this.getPoliceData()},searchData:function(){var e=this;this.hasOthers?this.getPoliceData():(this.policeList=[],this.policeCache.forEach(function(t,s){var a=e.condition;if(""!=a){if(-1!=t.name.indexOf(a)||-1!=t.loginId.indexOf(a)||-1!=t.idCard.toUpperCase().indexOf(a.toUpperCase()))return e.policeList.push(t),!0}else e.policeList=e.policeCache}))},selectPolice:function(e,t){var s=this.selectedIdCardArr.indexOf(t.idCard);if(-1!=s){if(this.selectedIdCardArr.splice(s,1),this.selectedList=this.selectedList.filter(function(e){return e.idCard!=t.idCard}),0==this.selectedList.length)return!1}else"num==1"===this.numExp&&(this.selectedIdCardArr=[],this.selectedList=[]),this.selectedIdCardArr.push(t.idCard),this.selectedList.push(t)},cancelSelected:function(e,t){this.selectedList.splice(t,1);var s=this.selectedIdCardArr.indexOf(e.idCard);-1!=s&&this.selectedIdCardArr.splice(s,1)},ok:function ok(){var _this5=this;if(0==this.selectedList.length)return this.$Modal.warning({title:"温馨提示",content:"请选择民警"}),!1;var num=this.selectedList.length;if(this.numExp&&!eval(this.numExp))return this.$Modal.warning({title:"温馨提示",content:this.msg}),!1;var names=[],ids=[];this.selectedList.forEach(function(e){names.push(e.name),ids.push(e[_this5.returnField])}),this.$emit("input",ids.join(",")),this.textValue=names.join(","),this.$emit("update:text",this.textValue),this.showText=this.textValue,this.$emit("onSelect",this.selectedList),this.cancel(!1)},cancel:function(e){this.modal=!1,this.selectedIdCardArr=[],this.selectedList=[],e&&this.$emit("onCancel")},focus:function(){this.$refs.input.focus()}}}},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=s(2);s.d(t,"userSelector",function(){return a.a});var r={install:function(e){e.component("user-selector",a.a)}};t.default=r},function(e,t,s){"use strict";function a(e){s(3)}var r=s(0),i=s(9),n=s(8),o=a,l=n(r.a,i.a,!1,o,"data-v-3b8ba31c",null);t.a=l.exports},function(e,t,s){var a=s(4);"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);s(6)("4a26f82f",a,!0,{})},function(e,t,s){t=e.exports=s(5)(!1),t.push([e.i,'[data-v-3b8ba31c] .user-selector-modal .ivu-modal-body,[data-v-3b8ba31c] .user-selector-modal .ivu-modal-header{padding:0!important}[data-v-3b8ba31c] .user-selector-modal .ivu-modal-footer{padding:8px 18px}[data-v-3b8ba31c] .user-selector-modal .ivu-modal-footer .ivu-btn>span{font-size:16px}[data-v-3b8ba31c] .user-selector-modal .ivu-input{font-size:16px;height:32px;line-height:1.5}[data-v-3b8ba31c] .user-selector-modal .ivu-checkbox-wrapper.ivu-checkbox-large{font-size:16px}[data-v-3b8ba31c] .user-selector-input .ivu-input-icon{right:66px;font-size:20px}[data-v-3b8ba31c] .user-selector-input .ivu-input{font-size:16px}[data-v-3b8ba31c] .user-selector-modal .ivu-icon-ios-close{font-size:32px;line-height:40px}[data-v-3b8ba31c] .user-selector-input .ivu-input-search{font-size:15px;padding:0!important;width:70px;max-width:70px}.user-selector-modal .bsp-warp[data-v-3b8ba31c]{margin:5px}.user-selector-modal .bsp-user-search-box[data-v-3b8ba31c]{display:flex;margin-top:10px;padding-left:5px}.user-selector-modal .bsp-user-search-box>input[data-v-3b8ba31c]{margin-left:0;width:38%;height:30px;border:1px solid