From c485ef645246b31fe2bb7bcc1393d7549bc28e30 Mon Sep 17 00:00:00 2001
From: long <18782126717@163.com>
Date: Fri, 11 Nov 2022 18:24:57 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=81=E7=A8=8B=E4=BA=BA?=
=?UTF-8?q?=E5=91=98=E9=85=8D=E7=BD=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/jeecgbiz/JSelectUserByDep.vue | 2 +
src/views/activiti/ProcessModelList.vue | 104 ++++++++++++------
.../activiti/form/ProcessUdgetPlanForm.vue | 28 +++--
src/views/activiti/mixins/activitiMixin.js | 4 +-
4 files changed, 96 insertions(+), 42 deletions(-)
diff --git a/src/components/jeecgbiz/JSelectUserByDep.vue b/src/components/jeecgbiz/JSelectUserByDep.vue
index 5d8f44a..3558bed 100644
--- a/src/components/jeecgbiz/JSelectUserByDep.vue
+++ b/src/components/jeecgbiz/JSelectUserByDep.vue
@@ -95,8 +95,10 @@
// this.id = idmp.substring(1)
}
+
// this.$emit("orgCodeTxt",this.orgCodeTxt,this.id)
this.$emit("change", this.userIds)
+ this.$emit("submitUsers", this.userIds)
}
}
}
diff --git a/src/views/activiti/ProcessModelList.vue b/src/views/activiti/ProcessModelList.vue
index 86456fd..8d96415 100644
--- a/src/views/activiti/ProcessModelList.vue
+++ b/src/views/activiti/ProcessModelList.vue
@@ -15,7 +15,7 @@
-
+
@@ -123,11 +123,11 @@
启用
禁用
- 节点设置
+ 审批人员
- 转为模型
-
- 编辑
+
+
+ 配置表单
删除
@@ -148,12 +148,12 @@
-
+
请选择
@@ -163,7 +163,7 @@
- 预览表单
+
-
+
@@ -191,7 +191,7 @@
-
+
+
+ <!– 0角色 1用户 2部门 3发起人 4发起人的部门负责人–>
根据角色选择
直接选择人员
部门
@@ -246,17 +248,17 @@
-
-
+ -->
+
-
+
+
-
+
-
+
@@ -388,6 +390,8 @@
visible:false,
formComponent : null
},
+ isClose:false,
+ isIndex:0,
lcTypeF:[],
dataList: [],
updateRow: {}
@@ -440,10 +444,12 @@
this.current=0,
this.spryTypes=[],
this.spry={}
+ this.isIndex=0;
},
/*编辑流程节点*/
change_steps(node,index){
+ this.isIndex=index+1;
this.spryTypes = [];
console.log('onChange:', node);
this.current = index;
@@ -483,8 +489,10 @@
if (this.spry.formVariables) this.spryTypes.push('6');
},
spryType(types){
+ /* alert(types)*/
/* 0角色 1用户 2部门 3发起人 4发起人的部门负责人 5部门负责人*/
// this.spryTypes = types;
+ alert(this.spryTypes.indexOf('0'))
if (this.spryTypes.indexOf('0')==-1) this.spry.roleIds = '';
if (this.spryTypes.indexOf('1')==-1) this.spry.userIds = '';
if (this.spryTypes.indexOf('2')==-1) this.spry.departmentIds = '';
@@ -497,24 +505,37 @@
console.log("this.spry",this.spry)
},
- sprySubmit() {
+ submitUsers(val){
+ this.spry.userIds=val;
+ console.log(val,"-=-=-=-=-=-=-=-=>")
var _this = this;
- if (this.spryTypes.length==0){
+ if (!this.spry.userIds){
_this.$message.error("必须选择审批人!");
return;
}
- _this.confirmLoading = true;
+ // _this.confirmLoading = true;
this.spry.nodeId = this.editNode.id;
this.spry.procDefId = this.editNode.procDefId;
+
this.postFormAction(_this.url.editNodeUser,this.spry).then(res => {
if (res.success) {
- _this.$message.success("操作成功");
/*保存成功后回显数据*/
- _this.getNodeData(_this.updateRow);
+ _this.getNodeData(_this.updateRow);
}else {
_this.$message.error(res.message);
}
- }).finally(() => _this.confirmLoading = false);
+ });
+ },
+ //提交并保存
+ sprySubmit() {
+ console.log(this.nodeList.length,this.isIndex,"---------------->")
+ if(this.nodeList.length==this.isIndex){
+ this.$message.success("操作成功");
+ this.closeNode();
+ this.loadData(1);
+
+ }
+ console.log("最后的操作",this.spry)
},
/*节点设置*/
getNodeData(row){
@@ -525,9 +546,26 @@
}).then(res => {
if (res.success) {
// 转换null为""
- _this.nodeList = res.result||[];
- console.log("_this.nodeList",_this.nodeList);
- if (_this.nodeList.length>0){
+
+ console.log("res.result",res.result);
+ let arry=[];
+ for (let i = 0; i < res.result.length; i++) {
+ if (i!=0&&i!=res.result.length-1){
+ arry.push(res.result[i])
+ }
+ }
+ _this.nodeList=arry;
+ if (arry.length==this.isIndex){
+ console.log(this.isIndex,"我想要的")
+ }
+ if (arry.length>0){
+ console.log(_this.nodeList[0])
+ if(!this.nodeList.length==this.isIndex){
+ if (_this.nodeList[0].users[0]){
+ console.log(_this.nodeList[0].users[0])
+ this.spry.userIds=_this.nodeList[0].users[0].username;
+ }
+ }
_this.editNode = _this.nodeList[_this.current];
console.log(_this.current,_this.editNode)
_this.showProcessNodeEdit = true;
@@ -724,6 +762,7 @@
var logType = that.queryParam.logType;
that.queryParam = {}; //清空查询区域参数
that.queryParam.logType = logType;
+ that.queryParam.zx=true;
that.loadData(this.ipagination.current);
},
onDateChange: function (value, dateString) {
@@ -738,7 +777,8 @@
filter_categoryId(v,r) {
// console.log(v,r)
return r.categoryId == v;
- }
+ },
+
}
}
diff --git a/src/views/activiti/form/ProcessUdgetPlanForm.vue b/src/views/activiti/form/ProcessUdgetPlanForm.vue
index 4721bf0..3ee7ba8 100644
--- a/src/views/activiti/form/ProcessUdgetPlanForm.vue
+++ b/src/views/activiti/form/ProcessUdgetPlanForm.vue
@@ -157,7 +157,7 @@
保存
-
+ 提交申请
取消
@@ -489,7 +489,7 @@
url: {
add: '/hy/processUdgetPlan/add',
edit: '/hy/processUdgetPlan/edit',
- fromTableApply:'/actBusiness/fromTableApply',
+ addFromTableApply:'/hy/processUdgetPlan/addFromTableApply',
queryById: '/hy/processUdgetPlan/queryById',
selectdeparment:'/sys/selectByUser',
descriptionRakeUrl: "/description/processDescription/list",
@@ -1016,17 +1016,23 @@
//计算总价
for (let i = 0; i < formData.processUdgetPlanMaterialList.length; i++) {
this.materialAmount=this.materialAmount+ formData.processUdgetPlanMaterialList[i].materialAmount;
+ if (i==0){
+ this.describes=formData.processUdgetPlanMaterialList[i].materialName
+ }else {
+ this.describes=this.describes+"---"+formData.processUdgetPlanMaterialList[i].materialName
+ }
+
}
formData.fileId = getStringArry(formData.fileId)
formData.materialPrice=this.materialPrice;
formData.materialAmount=this.materialAmount;
-
+ formData.describes=this.describes;
if (new Date(formData.createTime).getTime()/100>new Date(formData.needTime).getTime()/100){
this.$message.error("需求时间不能小于当前流程发起时间")
return;
}
console.log(this.materialAmount,'采购总价')
- console.log(formData,'表单数据')
+
console.log(this.opinion,'流程说明')
this.form.validateFields((err, values) => {
if (!err) {
@@ -1034,13 +1040,19 @@
formData.procDeTitle = this.processData.name;
formData.title=this.processData.description;
if (!formData.tableName)formData.tableName = this.processData.businessTable;
+ var url = this.url.addFromTableApply;
+ let method='post';
+ if (!this.isNew){
+ url = this.url.fromTableApply;
+ method='put';
+ }
this.btndisabled = true;
- console.log(formData,'申请数据')
- httpAction(this.url.fromTableApply,formData,'post').then((res)=>{
+ console.log(formData,'表单数据')
+ httpAction(url,formData,method).then((res)=>{
if (res.success){
- this.$message.success("申请成功!")
+ //this.$message.success("保存成功!")
//todo 将表单的数据传给父组件
- this.$emit('close',formData)
+ this.$emit('afterSubmit',formData)
}else {
this.$message.error(res.message)
}
diff --git a/src/views/activiti/mixins/activitiMixin.js b/src/views/activiti/mixins/activitiMixin.js
index fed2575..40420e1 100644
--- a/src/views/activiti/mixins/activitiMixin.js
+++ b/src/views/activiti/mixins/activitiMixin.js
@@ -18,12 +18,12 @@ export const activitiMixin = {
/*todo 所有的流程表单,组件化注册,在此维护*/
allFormComponent:function(){
return [
- {
+ /* {
text:'测试流程表单',
routeName:'@/views/activiti/form/demoForm',
component:() => import(`@/views/activiti/form/demoForm`),
businessTable:'test_demo'
- },
+ },*/
{
text:'预算计划采购流程',
routeName:'@/views/activiti/form/ProcessUdgetPlan',