|  |  | 
 |  |  |             prop="drname" | 
 |  |  |             width="120" | 
 |  |  |           /> | 
 |  |  |  | 
 |  |  |           <el-table-column | 
 |  |  |             label="是否存在任务" | 
 |  |  |             align="center" | 
 |  |  |             key="serverState" | 
 |  |  |             prop="serverState" | 
 |  |  |             width="100" | 
 |  |  |           > | 
 |  |  |             <template slot-scope="scope"> | 
 |  |  |               <span | 
 |  |  |                 :style="{ | 
 |  |  |                   color: scope.row.serverState == 1 ? 'green' : 'gray', | 
 |  |  |                 }" | 
 |  |  |               > | 
 |  |  |                 {{ scope.row.serverState == 1 ? "是" : "无" }} | 
 |  |  |               </span> | 
 |  |  |             </template> | 
 |  |  |           </el-table-column> | 
 |  |  |           <el-table-column | 
 |  |  |             label="操作" | 
 |  |  |             fixed="right" | 
 |  |  | 
 |  |  |                   <span>{{ formatTime(scope.row.createTime) }}</span> | 
 |  |  |                 </template> | 
 |  |  |               </el-table-column> | 
 |  |  |               <template #empty> | 
 |  |  |                 <div class="empty-message"> | 
 |  |  |                   <i class="el-icon-warning"></i> | 
 |  |  |                   <span>患者科室无匹配服务</span> | 
 |  |  |                 </div> | 
 |  |  |               </template> | 
 |  |  |             </el-table> | 
 |  |  |           </div> | 
 |  |  |         </el-col> | 
 |  |  | 
 |  |  |         this.$modal.msgWarning("请至少选中1名患者"); | 
 |  |  |         return; | 
 |  |  |       } | 
 |  |  |       // 检查选中的患者中是否有已有任务的 | 
 |  |  |       const hasTaskPatients = this.userList.filter( | 
 |  |  |         (item) => this.ids.includes(item.patid) && item.serverState == 1 | 
 |  |  |       ); | 
 |  |  |  | 
 |  |  |       if (hasTaskPatients.length > 0) { | 
 |  |  |         const patientNames = hasTaskPatients.map((p) => p.patname).join("、"); | 
 |  |  |         this.$modal.msgError( | 
 |  |  |           `选中的患者 ${patientNames} 已有任务,无法重复添加` | 
 |  |  |         ); | 
 |  |  |         return; | 
 |  |  |       } | 
 |  |  |       // 获取选中患者的科室信息(用于校验同一科室) | 
 |  |  |       const patientDepts = new Set(); | 
 |  |  |       let deptcode = ""; | 
 |  |  | 
 |  |  |         // 遍历选中的患者,逐个调用接口 | 
 |  |  |         for (const patient of this.selectedPatients) { | 
 |  |  |           const params = { | 
 |  |  |             taskId: this.selectedTask.taskId, | 
 |  |  |             taskid: this.selectedTask.taskid, | 
 |  |  |             taskName: this.selectedTask.taskName, | 
 |  |  |             serviceType: this.selectedTask.serviceType, | 
 |  |  |             sendstate:2, | 
 |  |  |             ...patient, | 
 |  |  |             age: "", | 
 |  |  |           }; |