| | |
| | | <el-input placeholder="流程模板" v-model="saveParam.modelName" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="流程名称" prop="processName"> |
| | | <el-input placeholder="流程名称" v-model="saveParam.processName"> |
| | | <el-input placeholder="流程名称" v-model="saveParam.template"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="流程描述"> |
| | |
| | | ids: 'ids', |
| | | flowTemplate: 'flowTemplate', |
| | | code: 'code', |
| | | type: 'type' |
| | | type: 'type', |
| | | btmtype:'btmtype' |
| | | } |
| | | } |
| | | } |
| | |
| | | }, |
| | | users:{ |
| | | handler(val){ |
| | | console.log('监听users',val) |
| | | this.collectParam.flowTaskUsers = val |
| | | }, |
| | | deep:true, |
| | |
| | | }, |
| | | parameter:{ |
| | | handler(newval,oldval){ |
| | | console.log('子',newval) |
| | | } |
| | | this.saveParam=newval; |
| | | }, |
| | | deep:true, |
| | | immediate:true |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | tags: [], |
| | | typeName: [], |
| | | collectParam: {}, |
| | | saveParam: this.setSaveParam(), |
| | | saveParam: {}, |
| | | users: [], |
| | | rules: { |
| | | processName: [ |
| | |
| | | }, |
| | | |
| | | mounted() { |
| | | console.log('---',this.parameter) |
| | | }, |
| | | created() { |
| | | console.log('parameter',this.parameter) |
| | | }, |
| | | methods: { |
| | | setSaveParam() { |
| | |
| | | processName: this.parameter[this.parameterKeys.flowTemplate], |
| | | topName: this.title, |
| | | ids: this.parameter[this.parameterKeys.ids], |
| | | oids: this.parameter[this.parameterKeys.ids], |
| | | btmtype:this.parameter[this.parameterKeys.btmtype], |
| | | vars:this.parameter['vars'] |
| | | } |
| | | }, |
| | |
| | | async apiInit() { |
| | | const response = await personnelInit({ type: this.parameter[this.parameterKeys.type], templateId: this.parameter[this.parameterKeys.code]}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.initFrom = response.data.data.user |
| | | this.tags = response.data.data.collect |
| | | const { modelKey, templateId, modelName } = response.data.data.flow |
| | |
| | | this.collectParam = { modelKey, templateId, flowTaskUsers: flowTaskUsers } |
| | | this.users = response.data.data.user |
| | | console.log(this.collectParam) |
| | | console.log('this.saveParam.before',this.saveParam) |
| | | this.saveParam = { ...this.saveParam, modelKey, templateId, modelName } |
| | | console.log('this.saveParam',this.saveParam) |
| | | if (this.tags.length !== 0) this.handleClickTag(this.tags[0]) |
| | | } |
| | | }, |
| | |
| | | async apiSave() { |
| | | try { |
| | | const len = this.collectParam.flowTaskUsers.length |
| | | console.log(this.collectParam.flowTaskUsers) |
| | | console.log(len == 0) |
| | | console.log(len != this.initFrom.length) |
| | | if (len == 0 && len != this.initFrom.length) { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "请选择节点!" |
| | | }); |
| | | } else { |
| | | const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids} = this.saveParam |
| | | const vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,...vars} |
| | | const {modelKey,modelName,processDesc,processName,templateId,topName,vars,ids,btmtype} = this.saveParam |
| | | let vals= {modelKey,modelName,processDesc,processName,templateId,topName,ids,btmtype,...vars} |
| | | vals.oids=ids; |
| | | const response = await personnelSave({ variables:vals, flowTaskUsers: this.collectParam.flowTaskUsers, }) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: response.data.msg |
| | | }); |
| | | this.$emit('onLoad') |
| | | this.done() |
| | | } |
| | | } |
| | | |
| | | } catch { |
| | | console.error('接口调用失败') |
| | | this.$message.error('接口调用失败') |
| | | } |
| | | }, |
| | | handleClickTag(event) { |
| | | console.log(event.flowTaskUsers) |
| | | |
| | | console.log(this.collectParam.flowTaskUsers) |
| | | let flowTaskUsers = this.collectParam.flowTaskUsers |
| | | this.collectParam.flowTaskUsers = flowTaskUsers.map((item, index) => { |
| | | for (let i = 0; i < event.flowTaskUsers.length; i++) { |
| | |
| | | // this.collectParam.flowTaskUsers = {...this.collectParam.flowTaskUsers,userId,userName} |
| | | }, |
| | | handleCloseTag(event) { |
| | | console.log(event) |
| | | this.canCollect(event.name) |
| | | }, |
| | | handleSelect(event, index) { |
| | | const res = this.typeName.find(item => item.userId === event) |
| | | const { userName } = res |
| | | console.log(this.users) |
| | | this.$set(this.users, index, { ... this.collectParam.flowTaskUsers[index], userName }) |
| | | // this.users[index] = { ... this.collectParam.flowTaskUsers[index], userName } |
| | | console.log(this.users) |
| | | }, |
| | | done() { |
| | | this.dialogVisible = false |