|
|
|
@ -23,7 +23,7 @@ let props = defineProps({ |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let copyerVisible = ref(false) |
|
|
|
const flowFactorList = ref<any[]>([]); |
|
|
|
|
|
|
|
let conditionVisible = ref(false) |
|
|
|
@ -56,6 +56,11 @@ watch(conditionsConfig1, (val:any) => { |
|
|
|
conditionConfig.value = val.priorityLevel |
|
|
|
? conditionsConfig.value.conditionNodes[val.priorityLevel - 1] |
|
|
|
: { nodeUserList: [], conditionList: [] } |
|
|
|
if(conditionConfig.value.conditionList){ |
|
|
|
// tableList.value = conditionsConfig.conditionList |
|
|
|
tableList.value = conditionConfig.value.conditionList |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
watch(visible,(val:any)=>{ |
|
|
|
@ -63,14 +68,14 @@ watch(visible,(val:any)=>{ |
|
|
|
if(flowFactor.length>0){ |
|
|
|
flowFactor.forEach(ites=>{ |
|
|
|
flowFactorList.value.push({ |
|
|
|
id:ites.id, |
|
|
|
name:ites.name, |
|
|
|
keyid:ites.keyid, |
|
|
|
type:ites.type, |
|
|
|
isok:ites.isok, |
|
|
|
isCheckbox:ites.isCheckbox, |
|
|
|
options:ites.options |
|
|
|
}) |
|
|
|
id:ites.id, |
|
|
|
name:ites.name, |
|
|
|
keyid:ites.keyid, |
|
|
|
type:ites.type, |
|
|
|
isok:ites.isok, |
|
|
|
isCheckbox:ites.isCheckbox, |
|
|
|
options:ites.options |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
if(props.isFormFlow){ |
|
|
|
@ -80,7 +85,7 @@ watch(visible,(val:any)=>{ |
|
|
|
} |
|
|
|
gainNodeFactor(sendData) |
|
|
|
.then(({data}) =>{ |
|
|
|
console.log("......>",data) |
|
|
|
// console.log("......>",data) |
|
|
|
if(data.length > 0){ |
|
|
|
data.forEach(item=>{ |
|
|
|
flowFactorList.value.push({ |
|
|
|
@ -103,11 +108,6 @@ watch(visible,(val:any)=>{ |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const closeDrawer = (val?:any) => { |
|
|
|
initFactor() |
|
|
|
setCondition(false) |
|
|
|
@ -125,11 +125,13 @@ const pickFactor = (val:any) => { |
|
|
|
tableList.value.forEach(item=>{ |
|
|
|
tableKeyAry.push(item.factorid) |
|
|
|
}) |
|
|
|
let filefName = 0 |
|
|
|
let types = 0 |
|
|
|
let options = new Array |
|
|
|
let isCheckbox = false |
|
|
|
flowFactorList.value.forEach(item=>{ |
|
|
|
if(item.keyid == val){ |
|
|
|
filefName=item.name |
|
|
|
item.isok=true |
|
|
|
types = item.type |
|
|
|
options = item.options |
|
|
|
@ -149,15 +151,22 @@ const pickFactor = (val:any) => { |
|
|
|
item.type = types |
|
|
|
item.options = options |
|
|
|
item.isCheckbox = isCheckbox |
|
|
|
item.name=filefName |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log("tableList--->",tableList.value,val,types); |
|
|
|
// console.log("tableList--->",tableList.value,val,types); |
|
|
|
} |
|
|
|
//添加条件 |
|
|
|
const addFactorCondition = () => { |
|
|
|
let currLent = tableList.value.length |
|
|
|
let tableKeyAry = new Array |
|
|
|
if(currLent > 0){ |
|
|
|
tableList.value.forEach(item=>{ |
|
|
|
tableKeyAry.push(item.factorid) |
|
|
|
}) |
|
|
|
} |
|
|
|
if(currLent < flowFactorList.value.length){ |
|
|
|
tableList.value.push({id:currLent+1,factorid:"",type:0}) |
|
|
|
tableList.value.push({id:currLent+1,name:"",factorid:"",type:0,isok:false,isCheckbox:true,options:[],answers:[],customFields:[]}) |
|
|
|
if(currLent+1 >= flowFactorList.value.length){ |
|
|
|
maxFactor.value = true |
|
|
|
}else{ |
|
|
|
@ -172,6 +181,15 @@ const addFactorCondition = () => { |
|
|
|
isDelField.value = false |
|
|
|
} |
|
|
|
|
|
|
|
if(tableKeyAry.length>0){ |
|
|
|
flowFactorList.value.forEach(item=>{ |
|
|
|
if(tableKeyAry.includes(item.keyid)){ |
|
|
|
item.isok=true |
|
|
|
}else{ |
|
|
|
item.isok=false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
const initFactor = () => { |
|
|
|
maxFactor.value = false |
|
|
|
@ -210,23 +228,122 @@ const delTiaoJian = (val:any) => { |
|
|
|
} |
|
|
|
} |
|
|
|
const saveCondition = () => { |
|
|
|
let isError = false |
|
|
|
if(tableList.value.length>0){ |
|
|
|
for (var i = 0; i < tableList.value.length; i++) { |
|
|
|
var {name,type,options,nodeUserList,answers,isCheckbox,customFields} = tableList.value[i] |
|
|
|
console.log("conditionConfig.conditionList--1->",name); |
|
|
|
console.log("conditionConfig.conditionList--2->",type); |
|
|
|
console.log("conditionConfig.conditionList--3->",options); |
|
|
|
console.log("conditionConfig.conditionList--4->",nodeUserList); |
|
|
|
console.log("conditionConfig.conditionList--5->",answers); |
|
|
|
console.log("conditionConfig.conditionList--6->",isCheckbox); |
|
|
|
console.log("conditionConfig.conditionList--7->",customFields); |
|
|
|
switch(type){ |
|
|
|
case 1: |
|
|
|
if(nodeUserList){ |
|
|
|
if(nodeUserList.length <= 0){ |
|
|
|
isError = true |
|
|
|
} |
|
|
|
}else{ |
|
|
|
isError = true |
|
|
|
} |
|
|
|
|
|
|
|
conditionConfig.conditionList = tableList.value |
|
|
|
console.log("conditionConfig.conditionList--->",conditionConfig.conditionList,tableList); |
|
|
|
// var a = conditionsConfig.value.conditionNodes.splice(PriorityLevel.value - 1, 1)//截取旧下标 |
|
|
|
// conditionsConfig.value.conditionNodes.splice(conditionConfig.value.priorityLevel - 1, 0, a[0])//填充新下标 |
|
|
|
// conditionsConfig.value.conditionNodes.map((item, index) => { |
|
|
|
// item.priorityLevel = index + 1 |
|
|
|
// }); |
|
|
|
// for (var i = 0; i < conditionsConfig.value.conditionNodes.length; i++) { |
|
|
|
// conditionsConfig.value.conditionNodes[i].error = $func.conditionStr(conditionsConfig.value, i) == "请设置条件" && i != conditionsConfig.value.conditionNodes.length - 1 |
|
|
|
// } |
|
|
|
// setConditionsConfig({ |
|
|
|
// value: conditionsConfig.value, |
|
|
|
// flag: true, |
|
|
|
// id: conditionsConfig1.value.id |
|
|
|
// }) |
|
|
|
closeDrawer() |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
if(customFields.length <= 0){ |
|
|
|
isError = true |
|
|
|
}else{ |
|
|
|
customFields.forEach((item:any)=>{ |
|
|
|
if(item.wordfield == "" || item.wordfield == null){ |
|
|
|
isError = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
if(answers.length > 0){ |
|
|
|
if(!Array.isArray(answers)){ |
|
|
|
tableList.value[i].answers=[answers] |
|
|
|
} |
|
|
|
}else{ |
|
|
|
isError = true |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
isError = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(isError){ |
|
|
|
ElNotification({ |
|
|
|
title: '温馨提示!', |
|
|
|
message: '判断条件未赋值!', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
conditionConfig.value.conditionList = tableList.value |
|
|
|
// console.log("conditionConfig.conditionList--1->",conditionConfig.value); |
|
|
|
// console.log("conditionConfig.conditionList--2->",conditionConfig.value.conditionList); |
|
|
|
// console.log("conditionConfig.conditionList--3->",conditionsConfig1); |
|
|
|
var a = conditionsConfig.value.conditionNodes.splice(PriorityLevel.value - 1, 1)//截取旧下标 |
|
|
|
conditionsConfig.value.conditionNodes.splice(conditionConfig.value.priorityLevel - 1, 0, a[0])//填充新下标 |
|
|
|
conditionsConfig.value.conditionNodes.map((item, index) => { |
|
|
|
item.priorityLevel = index + 1 |
|
|
|
}); |
|
|
|
for (var i = 0; i < conditionsConfig.value.conditionNodes.length; i++) { |
|
|
|
conditionsConfig.value.conditionNodes[i].error = $func.conditionStr(conditionsConfig.value, i) == "请设置条件" && i != conditionsConfig.value.conditionNodes.length - 1 |
|
|
|
} |
|
|
|
setConditionsConfig({ |
|
|
|
value: conditionsConfig.value, |
|
|
|
flag: true, |
|
|
|
id: conditionsConfig1.value.id |
|
|
|
}) |
|
|
|
closeDrawer() |
|
|
|
} |
|
|
|
} |
|
|
|
//选择成员或角色 |
|
|
|
const addOrEditUser = (val:any) => { |
|
|
|
copyerVisible.value = true; |
|
|
|
checkedList.value = val |
|
|
|
} |
|
|
|
//保存选中得数据 |
|
|
|
const sureCopyer = (data) => { |
|
|
|
// console.log("保存选中人",data) |
|
|
|
// copyerConfig.value.nodeUserList = data; |
|
|
|
copyerVisible.value = false; |
|
|
|
if(tableList.value.length > 0){ |
|
|
|
tableList.value.forEach(item=>{ |
|
|
|
if(item.factorid == "applicant" && item.type == 1){ |
|
|
|
item.nodeUserList = data |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
//添加自定义条件 |
|
|
|
const addCustomFields = () =>{ |
|
|
|
if(tableList.value.length > 0){ |
|
|
|
tableList.value.forEach(item=>{ |
|
|
|
if(item.factorid == "customFields" && item.type == 2){ |
|
|
|
item.customFields.push({ |
|
|
|
wordfield:"", |
|
|
|
optType:"1", |
|
|
|
leftval:"" |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log("添加自定义条件",tableList) |
|
|
|
} |
|
|
|
//自定义字段改变选项 |
|
|
|
const myoptChhange = (val:any) =>{ |
|
|
|
console.log("添加自定义条件",val) |
|
|
|
} |
|
|
|
//删除自定义字段条件 |
|
|
|
const delCuresTiaoJian = (val:any,old:any) => { |
|
|
|
if(old.length>0){ |
|
|
|
old.splice(val,1) |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<template> |
|
|
|
@ -259,33 +376,69 @@ const saveCondition = () => { |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<template v-if="itemw.type==1"> |
|
|
|
<el-button type="primary" style="margin-bottom:0px" >添加/修改成员</el-button> |
|
|
|
<el-button type="primary" style="margin-bottom:0px" @click="addOrEditUser(itemw.nodeUserList)">添加/修改成员</el-button> |
|
|
|
<p class="selected_list"> |
|
|
|
<el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag><el-tag closable type="info" effect="plain" class="tag_us">演员1</el-tag> |
|
|
|
<el-tag v-for="(item_us,index_us) in itemw.nodeUserList" :key="index_us" closable type="info" effect="plain" class="tag_us" @close="$func.removeEle(itemw.nodeUserList,item_us,'targetId')">{{item_us.name}}</el-tag> |
|
|
|
</p> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template v-if="itemw.type==2"> |
|
|
|
<el-row v-for="(itemCustomFields,index) in itemw" :key="index" :gutter="5"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-input v-model="itemCustomFields.wordfield" placeholder="判断关键字"></el-input> |
|
|
|
</el-col> |
|
|
|
<el-row v-for="(itemCustomFields,index) in itemw.customFields" :key="index" style="margin-bottom:10px" :gutter="5"> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-input v-model="itemCustomFields.wordfield" placeholder="判断关键字"></el-input> |
|
|
|
</el-col> |
|
|
|
<el-col :span="itemCustomFields.optType != 6?7:16"> |
|
|
|
<el-select v-model="itemCustomFields.optType" class="selectInfo" @change="myoptChhange($event,itemCustomFields)"> |
|
|
|
<el-select v-model="itemCustomFields.optType" class="selectInfo" style="width:100%"> |
|
|
|
<el-option |
|
|
|
v-for="itemSel in optTypes" |
|
|
|
:key="itemSel.value" |
|
|
|
:label="itemSel.label" |
|
|
|
:value="itemSel.value" |
|
|
|
> |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col v-if="itemCustomFields.optType != 6" :span="9"> |
|
|
|
<el-input v-model="itemCustomFields.leftval" placeholder="请输入值"></el-input> |
|
|
|
</el-col> |
|
|
|
<el-input v-model="itemCustomFields.leftval" type="text" placeholder="请输入" /> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1"> |
|
|
|
<el-icon color="#E6A23C" size="20px" class="delIcon" @click="delCuresTiaoJian(index,itemw.customFields)"><CircleClose /></el-icon> |
|
|
|
</el-col> |
|
|
|
<el-col v-if="itemCustomFields.optType == 6" :span="24"> |
|
|
|
<el-row :gutter="5" style="margin-top:10px"> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-input v-model="itemCustomFields.leftval" type="text" placeholder="请输入" /> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-select v-model="itemCustomFields.leftoptType"> |
|
|
|
<el-option |
|
|
|
v-for="itemSel in opt1s" |
|
|
|
:key="itemSel.value" |
|
|
|
:label="itemSel.label" |
|
|
|
:value="itemSel.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="cuiZhi_junZhong"> |
|
|
|
<span>{{ itemCustomFields.wordfield }}</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-select v-model="itemCustomFields.rightoptType"> |
|
|
|
<el-option |
|
|
|
v-for="itemSel in opt1s" |
|
|
|
:key="itemSel.value" |
|
|
|
:label="itemSel.label" |
|
|
|
:value="itemSel.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="5"> |
|
|
|
<el-input v-model="itemCustomFields.rightval" type="text" placeholder="请输入" /> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-button type="warning" style="margin-top:10px" >添加条件</el-button> |
|
|
|
<el-button type="warning" style="margin-top:0px" @click="addCustomFields">添加条件</el-button> |
|
|
|
</template> |
|
|
|
<template v-if="itemw.type==3"> |
|
|
|
<el-radio-group v-if="!itemw.isCheckbox" v-model="itemw.answers"> |
|
|
|
@ -296,7 +449,7 @@ const saveCondition = () => { |
|
|
|
</el-checkbox-group> |
|
|
|
</template> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1"><el-icon v-if="isDelField" color="#FF0000" size="20px" class="delIcon" @click="delTiaoJian(itemw)"><CircleClose /></el-icon></el-col> |
|
|
|
<el-col :span="1"><el-icon color="#FF0000" size="20px" class="delIcon" @click="delTiaoJian(itemw)"><CircleClose /></el-icon></el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
@ -308,6 +461,15 @@ const saveCondition = () => { |
|
|
|
<el-button @click="closeDrawer">取 消</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<employees-role-dialog |
|
|
|
v-model:visible="copyerVisible" |
|
|
|
:data="checkedList" |
|
|
|
:is-department="true" |
|
|
|
@change="sureCopyer" |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
</el-drawer> |
|
|
|
</template> |
|
|
|
<style lang="less"> |
|
|
|
@ -444,4 +606,12 @@ const saveCondition = () => { |
|
|
|
margin:5px 5px 4px 0px; |
|
|
|
} |
|
|
|
} |
|
|
|
.cuiZhi_junZhong { |
|
|
|
text-align:center; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
margin: auto; |
|
|
|
overflow:hidden; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|