| | |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-check" @click="handleApprove(scope.row)" |
| | | v-if="scope.row.reportStatus == '2' && scope.row.delFlag == 0">确认</el-button> |
| | | <!-- 移除转运按钮 --> |
| | | <el-button v-if="scope.row.serviceTransport.length" size="mini" type="primary" |
| | | @click="goToTransportDetail(scope.row.name)">查看转运单</el-button> |
| | | <el-button v-if=" |
| | | scope.row.reportStatus == 3 && |
| | | !scope.row.serviceTransport.length && |
| | | scope.row.isTransport == 2 |
| | | " size="mini" type="success" @click="Createatransferorder(scope.row)">创建转运单</el-button> |
| | | <el-button |
| | | size="mini" |
| | | icon="el-icon-truck" |
| | | :type="getTransportStatustype(scope.row)" |
| | | @click="handleTransport(scope.row)" |
| | | v-if="shouldShowTransportButton(scope.row)" |
| | | :disabled="!canGoToTransport(scope.row)" |
| | | > |
| | | {{ getTransportButtonText(scope.row) }} |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | return "未知"; |
| | | }, |
| | | |
| | | /** 判断是否需要显示转运按钮 */ |
| | | shouldShowTransportButton(row) { |
| | | // 除已归档案例外均显示转运按钮 |
| | | return row.reportStatus != "4"; |
| | | }, |
| | | |
| | | /** 判断是否可以跳转到转运单 */ |
| | | canGoToTransport(row) { |
| | | return row.isTransport == "2" && row.serviceTransport; |
| | | }, |
| | | |
| | | /** 获取转运按钮文本 */ |
| | | getTransportButtonText(row) { |
| | | if (row.isTransport == "2") { |
| | | if ( |
| | | row.serviceTransport && |
| | | Array.isArray(row.serviceTransport) && |
| | | row.serviceTransport.length > 0 |
| | | ) { |
| | | return "查看转运单"; |
| | | } else { |
| | | return "创建转运单"; |
| | | } |
| | | } |
| | | return "无需转运"; |
| | | }, |
| | | |
| | | /** 获取转运按钮样式 */ |
| | | getTransportStatustype(row) { |
| | | if (row.isTransport == "1") { |
| | | return "info"; |
| | | } |
| | | if ( |
| | | row.serviceTransport && |
| | | Array.isArray(row.serviceTransport) && |
| | | row.serviceTransport.length > 0 |
| | | ) { |
| | | return "primary"; |
| | | } |
| | | return "success"; |
| | | }, |
| | | |
| | | /** 处理转运操作 */ |
| | | async handleTransport(row) { |
| | | try { |
| | | const caseData = row; |
| | | if (caseData.isTransport == "2") { |
| | | if ( |
| | | caseData.serviceTransport && |
| | | Array.isArray(caseData.serviceTransport) && |
| | | caseData.serviceTransport.length > 0 |
| | | ) { |
| | | // 已有转运单,跳转到转运单详情页 |
| | | this.goToTransportDetail(caseData.name); |
| | | } else { |
| | | // 没有转运单,跳转到创建转运单页面 |
| | | this.Createatransferorder(caseData); |
| | | } |
| | | } else { |
| | | this.$message.warning("该案例不需要转运"); |
| | | } |
| | | } catch (error) { |
| | | console.error("获取案例信息失败:", error); |
| | | this.$message.error("获取案例信息失败"); |
| | | } |
| | | }, |
| | | |
| | | /** 跳转到创建转运单页面 */ |
| | | Createatransferorder(res) { |
| | | console.log(res); |