1
huanghongfeng
14 小时以前 9c3ee278c31a79e2e36b635651cef0b2dd431260
´úÂë¹ÜÀí/WCS/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js
@@ -28,41 +28,32 @@
                    let rows = this.getSelectRows();
                    console.log('选中的数据行:', rows);
                    if (rows.length === 0 || rows.length > 1) {0
                    if (rows.length === 0 || rows.length > 1) {
                        0
                        return this.$message.warning('请选择一条数据');
                    } else if (rows.length === 1) {
                        let selectRow = rows;
                        let selectRow = rows[0];
                        let Id = selectRow.map(item => item.taskId);
                        console.log('任务ID列表:', Id);
                        // éåŽ†çŠ¶æ€æ•°ç»„ï¼Œåˆ¤æ–­æ˜¯å¦æœ‰ä¸ç¬¦åˆæ¡ä»¶çš„çŠ¶æ€
                        //   for (let i = 0; i < statusList.length; i++) {
                        //     const status = statusList[i];
                        //     if (status === 2 || status === 3 || status === 4) {
                        //       this.$message.error('执行中任务无法取消');
                        //       return;
                        //     }
                        //   }
                        // æ˜¾ç¤ºç¡®è®¤æ¡†ï¼Œè®©ç”¨æˆ·ç¡®è®¤æ˜¯å¦æ‰§è¡Œæ“ä½œ
                        this.$confirm('确定要手动完成选中的' + selectRow.map(item => item.taskNum) + '任务号吗?', '操作确认', {
                        this.$confirm('确定要手动完成选中的' + selectRow.taskNum + '任务号吗?', '操作确认', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning' // è­¦å‘Šç±»åž‹ï¼Œæ˜¾ç¤ºé»„色图标
                        }).then(() => {
                            // ç”¨æˆ·ç‚¹å‡»"确定"后执行的逻辑
                            http.post('api/Task/CompletedManually', Id).then(res => {
                                if (res && res.status) {
                                    this.$message.success(res.message || '手动完成任务成功!');
                                } else {
                                    this.$message.error(res.message || '手动完成任务失败!');
                                }
                            }).catch(() => {
                                this.$message.error('请求失败,请稍后重试');
                            });
                            var CompletionType = 1;
                            http.post(`api/Task/CompletedManually?id=${selectRow.taskId}`).then(res => {
                                    if (res && res.status) {
                                        this.$message.success(res.message || '手动完成任务成功!');
                                        this.search();
                                    } else {
                                        this.$message.error(res.message || '手动完成任务失败!');
                                    }
                                }).catch(() => {
                                    this.$message.error('请求失败,请稍后重试');
                                });
                        }).catch(() => {
                            // ç”¨æˆ·ç‚¹å‡»"取消"后执行的逻辑(通常是提示取消操作)
                            this.$message.info('已取消手动完成任务');
@@ -82,7 +73,7 @@
                    console.log('选中的数据行:', rows);
                    if (rows.length === 0 || rows.length > 1) {
                        return this.$message.warning('请选择最少一条数据');
                        return this.$message.warning('请选择一条数据');
                    }
                    if (rows.length === 1) {
                        let selectRow = rows;
@@ -102,6 +93,7 @@
                            ).then(res => {
                                if (res && res.status) {
                                    this.$message.success(res.message || '取消任务成功!');
                                    this.search();
                                } else {
                                    this.$message.error(res.message || '取消任务失败!');
                                }
@@ -157,6 +149,7 @@
                },
                click: (row) => {
                    this.$refs.gridBody.open(row);
                }
            });
            this.maxBtnLength = 11;