| | |
| | | <template> |
| | | <el-dialog v-dialogDrag |
| | | append-to-body="true" |
| | | :close-on-click-modal="false" |
| | | :destroy-on-close="true" |
| | | :visible.sync="visible" |
| | | :width="width" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | style="margin-top: -10% !important;" |
| | | title="启动流程" |
| | | top="0" |
| | | style="margin-top: -10% !important;" |
| | | @close="dialogClose"> |
| | | |
| | | <el-form :model="saveParam" :rules="rules" class="demo-form-inline" label-position="left" label-width="auto"> |
| | |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <!-- <div class="btns-icon">--> |
| | | <!-- <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="btns-icon">--> |
| | | <!-- <el-button circle icon="el-icon-star-off" @click="handleCollect"></el-button>--> |
| | | <!-- </div>--> |
| | | <el-form :model="collectParam" class="demo-form-inline" label-position="left" label-width="auto"> |
| | | <el-form-item v-for="(item, index) in initFrom" :key="index" :label="item.taskName"> |
| | | <el-select v-model="collectParam.flowTaskUsers[index]['userId']" :placeholder="item.taskName" filterable |
| | | style="width: 100%;" @change="handleSelect($event, index)"> |
| | | <el-option v-for="(key, keyi) in typeName" :key="keyi" :label="key.userNames" |
| | | :value="key.userId"></el-option> |
| | | <el-form-item v-for="(item, index) in initFrom" :key="index" :label="`节点${index + 1}`"> |
| | | <el-select style="width: 100%;" filterable v-model="collectParam.flowTaskUsers[index]['userId']" |
| | | :placeholder="item.value" @change="handleSelect($event, index)"> |
| | | <el-option :label="key.name" :value="key.name" v-for="(key, keyi) in item.processNodes" |
| | | :key="keyi"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | |
| | | <script> |
| | | import {validatenull} from "@/util/validate"; |
| | | import {getTemplateByType, getAllProcessNode} from "@/api/base/startWork/index" |
| | | |
| | | export default { |
| | | name: "startWorkFlow", |
| | |
| | | typeName: [], // 流程节点option循环选项 |
| | | rules: { |
| | | processName: [ |
| | | { required: true, message: '流程名称不能为空', trigger: 'blur' }, |
| | | { min: 3, max: 50, message: '长度在 3 到 50 个字符', trigger: 'blur' } |
| | | {required: true, message: '流程名称不能为空', trigger: 'blur'}, |
| | | {min: 3, max: 50, message: '长度在 3 到 50 个字符', trigger: 'blur'} |
| | | ] |
| | | } |
| | | } |
| | |
| | | }, |
| | | parameter: { |
| | | handler(newval, oldval) { |
| | | this.saveParam = Object.assign({processName: '', processDesc: '' , }, newval); |
| | | this.saveParam = Object.assign({processName: '', processDesc: '',}, newval); |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | created() { |
| | | this.modelNameChange(); |
| | | this.getWorkByType(); |
| | | }, |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | // 获取流程模板信息 |
| | | getWorkByType() { |
| | | let params = { |
| | | type: '文档审签流程', |
| | | filterTemplate: "" |
| | | } |
| | | getTemplateByType(params).then(res => { |
| | | const data = res.data.data; |
| | | data.forEach(item => { |
| | | this.getProcessNode(item); |
| | | }) |
| | | this.initFrom = data; |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | }, |
| | | |
| | | // 请求流程节点 |
| | | getProcessNode(item) { |
| | | let params = { |
| | | processOid: item.attributes.oid, |
| | | maxSecret: -1 |
| | | } |
| | | getAllProcessNode(params).then(res => { |
| | | const nodes = res.data.data; |
| | | item.processNodes = nodes; |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | }, |
| | | |
| | | // 关闭弹窗 |
| | | dialogClose() { |
| | | this.visible = false; |
| | |
| | | }, |
| | | |
| | | handleConfirm() { |
| | | console.log(this.paramVOS) |
| | | console.log(this.initFrom); |
| | | }, |
| | | |
| | | // 流程名称初始化绑定 |
| | | modelNameChange(){ |
| | | // 流程名称初始化绑定 |
| | | modelNameChange() { |
| | | var userInfo = JSON.parse(localStorage.getItem('saber-userInfo')); |
| | | |
| | | if (this.paramVOS && this.paramVOS.modelName) { |
| | | this.saveParam.modelName = this.paramVOS.modelName; |
| | | } else if (userInfo.content && userInfo.content.userName) { |
| | | this.saveParam.modelName = userInfo.content.userName + '[启动流程]'; |
| | | this.saveParam.modelName = userInfo.content.userName + '启动流程'; |
| | | } else { |
| | | this.saveParam.modelName = ''; |
| | | } |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |