codeHandle

This commit is contained in:
shijing 2021-10-22 16:25:30 +08:00
parent f3f518aad6
commit f45005b843
4 changed files with 72 additions and 36 deletions

View File

@ -233,3 +233,10 @@ export function getCount(data) {
params:data
})
}
//工单代办数量
export function getCodes() {
return request({
url: `/wf/participant_from_code`,
method: 'get'
})
}

View File

@ -138,9 +138,23 @@
<el-option label="全部处理" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="部门" prop="participant" v-if="wfstate.participant_type==3">
<el-select style="width: 100%" v-model="participant" placeholder="请选择部门">
<el-option v-for="item in departments" :key="item.id" :label="item.name" :value="item.id">
<el-form-item label="角色" prop="participant" v-if="wfstate.participant_type==4">
<el-select style="width: 100%" v-model="participants" placeholder="请选择角色">
<el-option v-for="item in roles" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="过滤策略" prop="participant" v-if="wfstate.participant_type==4">
<el-select style="width: 100%" v-model="wfstate.filter_policy" placeholder="请选择过滤策略">
<el-option label="" value="0"></el-option>
<el-option label="和工单同属以及上级部门" value="1"></el-option>
<el-option label="和创建人同属以及上级部门" value="2"></el-option>
<el-option label="和上步处理人同属以及上级部门" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="代码选择" prop="participant" v-if="wfstate.participant_type==9">
<el-select style="width: 100%" v-model="participants" placeholder="请选择代码">
<el-option v-for="item in codes" :key="item.func" :label="item.name" :value="item.func">
</el-option>
</el-select>
</el-form-item>
@ -177,8 +191,10 @@
</div>
</template>
<script>
import {getWfStateList, createWfState, updateWfState, deleteWfState, getWfCustomfieldList} from "@/api/workflow";
import {getOrganizationList, getUserList} from "@/api/user";
import {getWfStateList, createWfState, updateWfState,
deleteWfState, getWfCustomfieldList , getCodes } from "@/api/workflow";
import { getUserList} from "@/api/user";
import { getRoleAll } from "@/api/role";
import checkPermission from "@/utils/permission";
const defaultwfstate = {
name: "",
@ -196,7 +212,7 @@
type: '',
enable_retreat: '',
participant_type: '',
participant: '',
filter_policy: '',
distribute_type: '',//分发类型
state_fields: {}//字段状态是否可写
},
@ -206,7 +222,8 @@
is_hidden: false,
enable_retreat: false,
staffs: [],
departments: [],
roles: [],
codes: [],
customfieldList: [],
/*wfstateList: {
count:0
@ -216,12 +233,13 @@
"0": '无处理',
"1": '个人',
"2": '多人',
"3": '部门',
// "3": '部门',
"4": '角色',
"5": '变量',
"6": '普通类型',
"7": '工单字段',
"8": '父工单字段',
// "5": '变量',
"6": '脚本',
"7": '工单的字段',
// "8": '父工单的字段',
"9": '代码获取',
},
options: [{
value: 0,
@ -243,26 +261,22 @@
value: 2,
label: '多人'
}
, {
value: 3,
label: '部门'
}
, {
value: 4,
label: '角色'
}
, {
value: 5,
label: '变量'
}
, {
value: 7,
label: '工单字段'
}
, {
value: 8,
label: '父工单字段'
}],
, {
value: 4,
label: '角色'
}
, {
value: 6,
label: '脚本'
}
, {
value: 7,
label: '工单的字段'
}
, {
value: 9,
label: '代码获取'
}],
display_form_str: [],
limit_expression: [],
dialogVisible: false,
@ -282,6 +296,9 @@
this.getUser();
this.getDepartment();
},
mounted(){
this.getCodes();
},
methods: {
checkPermission(value){
@ -314,12 +331,19 @@
})
},
getDepartment() {
getOrganizationList().then(res => {
getRoleAll().then(res => {
if (res.data) {
this.departments = res.data;
this.roles = res.data;
}
})
},
getCodes(){
getCodes().then(res=>{
// debugger;
// console.log(res);
this.codes = res.data;
})
},
//参与者类型变化
typeChange() {
this.participant = '';
@ -351,6 +375,7 @@
}
this.statusChange = arr;
this.wfstate.distribute_type = this.wfstate.distribute_type.toString();
this.wfstate.filter_policy = this.wfstate.filter_policy.toString();
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {

View File

@ -797,10 +797,14 @@
if (!filList.length) {
return
}
debugger;
console.log(filList)
filList.map((k) => {
let filte = that.logs.filter(item=>{
return item.state_.id = k.id;
return item.state == k.id;
})
debugger;
console.log(filte)
//每个
let str = '处理人:'+filte[0].participant_.name;
strList.push(str)

View File

@ -417,7 +417,7 @@
}
filList.map((k) => {
let filte = that.logs.filter(item=>{
return item.state_.id = k.id;
return item.state == k.id;
})
//每个
let str = '处理人:'+filte[0].participant_.name;