Lijy преди 1 седмица
родител
ревизия
e373ebcdbf
променени са 1 файла, в които са добавени 71 реда и са изтрити 1 реда
  1. 71 1
      fhKeeper/formulahousekeeper/timesheet_mld/src/views/team/index.vue

+ 71 - 1
fhKeeper/formulahousekeeper/timesheet_mld/src/views/team/index.vue

@@ -945,6 +945,27 @@
                 <el-button type="primary" @click="specialHolidaysChange()">{{ $t('btn.determine') }}</el-button>
             </div>
         </el-dialog>
+
+      <!-- La转移 -->
+      <el-dialog title="工作计划转移" :visible.sync="laTransferVisable" width="650px" :top="'60px'" :before-close="handleClose">
+        <div>
+          <div style="font-size: 18px;padding-bottom: 10px">该用户担任LA创建了工作计划,请选择项目的工作计转移人</div>
+          <el-table :data="laTransferData" style="width: 100%" height="50vh">
+            <el-table-column prop="projectName" label="转移项目"></el-table-column>
+            <el-table-column prop="date" label="转移至人员" width="180">
+              <template slot-scope="scope">
+                <el-select v-model="scope.row.toUserId" filterable placeholder="请选择" size="small">
+                  <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                </el-select>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="laTransferVisable = false">取 消</el-button>
+          <el-button type="primary" @click="confirmTransferLa()">确 定</el-button>
+        </span>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -1269,6 +1290,10 @@ export default {
       userGroupId: '',
       userGroupVisable: false,
       userGroupLoading: false,
+
+      // La转移
+      laTransferVisable: false,
+      laTransferData: {},
     };
   },
   watch: {
@@ -2345,7 +2370,16 @@ export default {
               //项目复核人需要转移为其他人 
               this.userInActiveForm.userId = this.deactiveUser.id;
               this.projectReviewerSelectDialog = true;
-          }else {
+          } else if (res.code == 'task') {
+            this.laTransferData = (res.data || []).map(item => {
+              return {
+                ...item,
+                toUserId: '',
+                userId: this.deactiveUser.id
+              }
+            })
+            this.laTransferVisable = true
+          } else {
             //新的模式
             this.userInActiveForm.userId = this.deactiveUser.id;
             this.reportAuditorSelectDialog = true;
@@ -4040,6 +4074,42 @@ export default {
         }
       },
       error => { this.userGroupLoading = false });
+    },
+
+    confirmTransferLa() {
+      const list = this.laTransferData.filter(item => !item.toUserId)
+      if((list || []).length > 0) {
+        const projectNaoes = list.map(item => item.projectName).join(',')
+        this.$message({message: `【${projectNaoes}】项目请选择转移至人员`, type: "error"});
+        return
+      }
+
+      const userId = this.laTransferData[0].userId
+      const inactiveDate = this.deactiveDate
+      const json = JSON.stringify((this.laTransferData || []).map(item => {
+        return {
+          projectId: item.id,
+          toUserId: item.toUserId
+        }
+      }))
+
+      this.http.post("/user/deactiveAndTransferTask", {
+        id: userId,
+        inactiveDate,
+        json
+      },
+      res => {
+        if (res.code == "ok") {
+          this.$message({
+              message: this.$t('caoZuoChengGong'),
+              type: "success"
+          });
+          this.deactiveDialog = false
+          this.laTransferVisable = false
+          this.searchList()
+        }
+      }
+      )
     }
   },
   mounted() {