@@ -232,12 +232,12 @@ const selectProject=(row,index)=>{
//先选择人员, 再选择项目: 再添加一行,重复操作
const projectIdArray = formData.value.tableData.map(item => item.projectId)
const researchPersonnelIdArray = formData.value.tableData.map(item => item.researchPersonnelId)
- console.log('projectIdArray',projectIdArray)
- console.log('researchPersonnelIdArray',researchPersonnelIdArray)
+ // console.log('projectIdArray',projectIdArray)
+ // console.log('researchPersonnelIdArray',researchPersonnelIdArray)
const projectNumObj = getSelectProjectAndResearchPersonnelNum(projectIdArray)
const researchPersonnelNumObj = getSelectProjectAndResearchPersonnelNum(researchPersonnelIdArray)
let repeatProjectName=getProjectName(row.projectId)
- console.log('currentRow.value',currentRow.value)
+ // console.log('currentRow.value',currentRow.value)
for (let researchPersonnelIdKey in researchPersonnelNumObj) {//先判断人员是否重复
if(currentRow.value.projectId){
if(researchPersonnelNumObj[researchPersonnelIdKey]>1){
@@ -263,21 +263,52 @@ const selectProject=(row,index)=>{
// }
// }
}
-const selectedResearchPersonnel = (select) => {
- if (!select || select.length === 0) {
- return
+const researchPersonnelPickerCancel = (select) => {
+ console.log('select',select)
+ if(select.length>0){
+ formData.value.tableData?.forEach((item, index) => {
+ if (index === currentIndex.value) {
+ item.researchPersonnelId = select[0].id
+ item.researchPersonnel = select[0].name
+ item.companyName = select[0].companyName
+ item.accountType = select[0].accountType
+ }
+ })
+ }else{
+ formData.value.tableData?.forEach((item, index) => {
+ if (index === currentIndex.value) {
+ item.researchPersonnelId = ''
+ item.researchPersonnel = ''
+ item.companyName = ''
+ item.accountType = ''
+ }
+ })
+ }
+}
+
+const selectedResearchPersonnel = (select) => {
+ if(select.length>0){
+ formData.value.tableData?.forEach((item, index) => {
+ if (index === currentIndex.value) {
+ item.researchPersonnelId = select[0].id
+ item.researchPersonnel = select[0].name
+ item.companyName = select[0].companyName
+ item.accountType = select[0].accountType
+ }
+ })
+ }else{
+ formData.value.tableData?.forEach((item, index) => {
+ if (index === currentIndex.value) {
+ item.researchPersonnelId = ''
+ item.researchPersonnel = ''
+ item.companyName = ''
+ item.accountType = ''
+ }
+ })
}
- formData.value.tableData.forEach((item, index) => {
- if (index === currentIndex.value) {
- item.researchPersonnelId = select[0].id
- item.researchPersonnel = select[0].name
- item.companyName = select[0].companyName
- item.accountType = select[0].accountType
- }
- })
//以下是为" 同一项目下,同一人不能分摊多次 "
- const projectIdArray = formData.value.tableData.map(item => item.projectId)
- const researchPersonnelIdArray = formData.value.tableData.map(item => item.researchPersonnelId)
+ const projectIdArray = formData.value.tableData?.map(item => item.projectId)
+ const researchPersonnelIdArray = formData.value.tableData?.map(item => item.researchPersonnelId)
const projectNumObj = getSelectProjectAndResearchPersonnelNum(projectIdArray)
const researchPersonnelNumObj = getSelectProjectAndResearchPersonnelNum(researchPersonnelIdArray)
let repeatProjectName=''
diff --git a/src/views/project-demand/summary/add.vue b/src/views/project-demand/summary/add.vue
index 8fcf704..60214e5 100644
--- a/src/views/project-demand/summary/add.vue
+++ b/src/views/project-demand/summary/add.vue
@@ -173,11 +173,11 @@
{{ optionalChargeLeadershipList.length !== 0 ? '更改' : '请选择' }}
-
- {{ item.name }}
+
+ {{ item.name }}{{index != optionalChargeLeadershipList?.length - 1 ? ',' : ''}}
-
+
@@ -365,7 +365,7 @@ const handleShowOptionalChargeLeadershipPicker = () => {
optionalChargeLeadershipPickerRef.value.showUserPicker()
}
-const optionalChargeLeaderPickerOk = (userList) => {
+const optionalChargeLeaderPickerOkOrCancel = (userList) => {
optionalChargeLeadershipList.value = userList
}
diff --git a/src/views/project-management/implementation/phase.vue b/src/views/project-management/implementation/phase.vue
index 3d562f6..87b7d98 100644
--- a/src/views/project-management/implementation/phase.vue
+++ b/src/views/project-management/implementation/phase.vue
@@ -8,7 +8,7 @@
-
+
{
return null
}
}
-const selected = (select) => {
+const ccPersonPickerOkOrCancel = (select) => {
+ console.log('select',select)
userList.value = select
}
const handleSubmit = async () => {
diff --git a/src/views/project-management/implementation/updateTable.vue b/src/views/project-management/implementation/updateTable.vue
index 0736c22..5aa427c 100644
--- a/src/views/project-management/implementation/updateTable.vue
+++ b/src/views/project-management/implementation/updateTable.vue
@@ -69,7 +69,6 @@
-
提交
返回
@@ -78,12 +77,9 @@