ZaiZai 9 months ago
parent
commit
cc93d53120
1 changed files with 11 additions and 11 deletions
  1. 11 11
      src/views/project/detail/user.vue

+ 11 - 11
src/views/project/detail/user.vue

@@ -179,29 +179,29 @@ const getUserData = async () => {
 //将系统用户添加进来
 const addUserLoading = ref(false)
 const addUserTap = async () => {
-    /*const { id } = formModel.value
-    if (isNullES(id)) {
-        window?.$message?.warning('项目数据异常')
+    if (isNullES(userId.value)) {
+        window?.$message?.warning('请先选择用户再进行添加')
         return
     }
-    const { cId, rId } = searchForm.value
-    if (isNullES(rId)) {
-        window?.$message?.warning('请先选择维护人员角色再进行添加')
+    const search = searchForm.value
+    if (isNullES(search.rId)) {
+        window?.$message?.warning('请先选择岗位再进行添加')
         return
     }
     addUserLoading.value = true
+    const { pid, cid } = getObjValue(dataInfo.value)
     const list = [{
-        projectId: id,
-        contractId: isNullES(cId) ? undefined : cId,
+        projectId: pid,
+        contractId: cid,
         userId: userId.value,
-        roleId: rId,
+        roleId: search.rId,
     }]
-    const { code } = await contractApi.saveUserInfoByProject(list)
+    const { code } = await contractApi.saveUserInfoByProjectTow(list)
     addUserLoading.value = false
     if (code === 200) {
         window?.$message?.success('添加成功')
         getTableData().then()
-    }*/
+    }
 }
 
 //创建新用户