|
@@ -2,22 +2,27 @@
|
|
|
<div :class="ui" class="hc-tasks-user">
|
|
|
<div class="tasks-user-box">
|
|
|
<div class="tag-user-list" @click="showModalClick">
|
|
|
- <!-- <template v-for="(item, index) in UserDataList" :key="index">
|
|
|
- <el-tag>{{ setCheckboxUserName(item) }}</el-tag>
|
|
|
- <HcIcon v-if="(UserDataList.length - 1) > index" name="arrow-right" ui="arrow-icon-tag" />
|
|
|
- </template> -->
|
|
|
- <template v-for="(item, index) in fixedBranchList" :key="index">
|
|
|
- <el-tag>{{ item.name }}</el-tag>
|
|
|
- <HcIcon v-if="(fixedBranchList.length - 1) > index" name="arrow-right" ui="arrow-icon-tag" />
|
|
|
+ <template v-if="isShowTaskName">
|
|
|
+ <template v-for="(item, index) in fixedBranchList" :key="index">
|
|
|
+ <el-tag>{{ item.name }}</el-tag>
|
|
|
+ <HcIcon v-if="(fixedBranchList.length - 1) > index" name="arrow-right" ui="arrow-icon-tag" />
|
|
|
+ </template>
|
|
|
+ <div v-if="fixedBranchList.length <= 0" class="tasks-placeholder">点击这里选择任务</div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <template v-for="(item, index) in UserDataList" :key="index">
|
|
|
+ <el-tag>{{ setCheckboxUserName(item) }}</el-tag>
|
|
|
+ <HcIcon v-if="(UserDataList.length - 1) > index" name="arrow-right" ui="arrow-icon-tag" />
|
|
|
+ </template>
|
|
|
+ <div v-if="UserDataList.length <= 0" class="tasks-placeholder">点击这里选择任务人</div>
|
|
|
</template>
|
|
|
- <div v-if="fixedBranchList.length <= 0" class="tasks-placeholder">点击这里选择任务人</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 选择任务人 -->
|
|
|
<el-dialog v-model="showModal" title="选择任务人" width="62rem" class="hc-modal-border hc-modal-nop" draggable destroy-on-close append-to-body>
|
|
|
<div class="hc-tasks-user-modal-content-box">
|
|
|
- <div v-if="UserDataList.length > 0 || isShowTaskName" class="tasks-name-box">
|
|
|
+ <div v-if="isShowTaskName" class="tasks-name-box">
|
|
|
<p class="mb-2">创建任务人流程</p>
|
|
|
<div class="flex pt-2">
|
|
|
<el-input v-model="taskNameinput" placeholder="请输入" size="default" class="mr-4" />
|
|
@@ -358,17 +363,20 @@ const sureSignUserLoading = ref(false)
|
|
|
const sureSignUserClick = () => {
|
|
|
console.log(fixedBranchList.value, 'fixedBranchList.value3333333')
|
|
|
let isEmptyuserIds = fixedBranchList.value.some(obj => obj.userIds === '')
|
|
|
- if (isEmptyuserIds) {
|
|
|
+ if (isEmptyuserIds && isShowTaskName) {
|
|
|
window.$message.warning('请选择对应的任务人员')
|
|
|
return
|
|
|
- } else if (fixedBranchList.value.length === 0) {
|
|
|
+ } else if (fixedBranchList.value.length === 0 && isShowTaskName.value) {
|
|
|
window.$message.warning('请选择对应的任务人员和任务名称')
|
|
|
return
|
|
|
} else {
|
|
|
let newUser = [], newUserId = [], users = ''
|
|
|
const dataList = deepClone(checkboxUserList.value)
|
|
|
UserDataList.value = dataList
|
|
|
-
|
|
|
+ if (dataList.length === 0 && !isShowTaskName.value) {
|
|
|
+ window.$message.warning('请选择对应的任务人员')
|
|
|
+ return
|
|
|
+ }
|
|
|
sureSignUserLoading.value = true
|
|
|
//封装数据
|
|
|
dataList.forEach(item => {
|
|
@@ -390,7 +398,8 @@ const sureSignUserClick = () => {
|
|
|
|
|
|
|
|
|
console.log(fixedBranchList.value, fixedBranchList.value)
|
|
|
- emit('change', fixedBranchList.value)
|
|
|
+
|
|
|
+ emit('change', newUser, newUserId, fixedBranchList.value)
|
|
|
|
|
|
}
|
|
|
|