Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2021-10-25 08:33:08 +08:00
commit f60e05703f
4 changed files with 72 additions and 36 deletions

View File

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

View File

@ -797,10 +797,14 @@
if (!filList.length) { if (!filList.length) {
return return
} }
debugger;
console.log(filList)
filList.map((k) => { filList.map((k) => {
let filte = that.logs.filter(item=>{ 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; let str = '处理人:'+filte[0].participant_.name;
strList.push(str) strList.push(str)

View File

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