gydx_2024_qin 1 hónapja
szülő
commit
668fc20de3
1 módosított fájl, 22 hozzáadás és 16 törlés
  1. 22 16
      src/views/enterprise/createProject.vue

+ 22 - 16
src/views/enterprise/createProject.vue

@@ -60,7 +60,7 @@
               <input
                 type="text"
                 v-model="row.name"
-                :disabled="!row.isEditing"
+                :disabled="!row.isEditing || row.outnum > 0 || isReferenceTable(activeButtonId) || row.pronumDisabled"
 
                 :class="isReferenceTable(activeButtonId)? 'readonly-input' : ''"
                 :style="row.inputStyle"
@@ -71,7 +71,7 @@
               <input
                 type="text"
                 v-model="row.pronum"
-                :disabled="!row.isEditing "
+                :disabled="!row.isEditing || row.outnum > 0 || isReferenceTable(activeButtonId) || row.pronumDisabled"
 
                 :class="isReferenceTable(activeButtonId)? 'readonly-input' : ''"
                 :style="row.inputStyle"
@@ -116,12 +116,12 @@
     <div style="margin-left: 20px;" class="righttab">
       <div class="right-tables-wrapper" style="overflow-y: auto; max-height: 80vh;">
         <div v-for="(rightTable, rightTableIndex) in rightTables" :key="rightTableIndex"
-             :class="'right-table-container-' + rightTableIndex" @click="setActiveRightTable(rightTableIndex)"
+             :class="'right-table-container-' + rightTableIndex"
              style="margin-top: 5px; width: 1110px; background-color: #f0f0f0; border-radius: 10px;"
         >
           <div style="display: flex; align-items: center;">
             <input type="radio" name="rightTableIndex" :value="rightTableIndex+1" v-model="rightTable.isChecked"
-                   @click="showInfo(rightTableIndex)"
+                   @click="showInfo(rightTableIndex), setActiveRightTable(rightTableIndex)"
                    style="width: 20px; height: 20px; margin-right: 10px;"
             />
             <div class="content" style="flex: 1;">
@@ -597,6 +597,7 @@ export default {
           return
         }
         const newItem = {
+          id: '',
           num: this.rightTables[selectedRightTableIndex].data.length + 1,
           name: row.name,
           pronum: row.pronum,
@@ -619,16 +620,17 @@ export default {
           console.log('这是添加', res)
           this.rightTableId = res.data
           console.log("这是this.teamCode",this.teamCode)
-
-          initGroup(this.teamCode).then(res => {
-            console.log("这是查到的小组的数据",res)
-            this.loadInitialData(res)
-          })
+          newItem.id = res.data
+          console.log('这是+对应的数据详情', newItem)
+          this.rightTables[selectedRightTableIndex].data.push(newItem)
+          this.$set(this.rightTables, selectedRightTableIndex, this.rightTables[selectedRightTableIndex])
+          this.increaseOutnum(rowIndex)
+          // initGroup(this.teamCode).then(res => {
+          //   console.log("这是查到的小组的数据",res)
+          //   this.loadInitialData(res)
+          // })
         })
-        console.log('这是+对应的数据详情', newItem)
-        this.rightTables[selectedRightTableIndex].data.push(newItem)
-        this.$set(this.rightTables, selectedRightTableIndex, this.rightTables[selectedRightTableIndex])
-        this.increaseOutnum(rowIndex)
+
       }
     },
     increaseOutnum(rowIndex) {
@@ -707,11 +709,15 @@ export default {
     handleMinusClick(index, rightTableIndex) {
       console.log('被删除的数据详情', this.rightTables[rightTableIndex].data[index])
       let id = this.rightTables[rightTableIndex].data[index].id
-      if (id === '' || id === null || id === undefined) {
-        id = this.rightTableId
-      }
+      // if (id === '' || id === null || id === undefined) {
+      //   id = this.rightTableId
+      // }
       delInstance(id).then(response => {
         console.log('这是删除', response)
+        // initGroup(this.teamCode).then(res => {
+        //   console.log("这是查到的小组的数据",res)
+        //   this.loadInitialData(res)
+        // })
       })
       this.rightTables[rightTableIndex].data.splice(index, 1)
       this.rightTables[rightTableIndex].data.forEach((item, newIndex) => {