wlzboy
6 天以前 09e6dc3fb7266620fafb5e341808a8eb36e080a1
ruoyi-ui/src/views/task/general/detail.vue
@@ -8,7 +8,7 @@
      
      <!-- 基本信息 -->
      <el-descriptions title="基本信息" :column="2" border>
        <el-descriptions-item label="任务编号">{{ taskDetail.taskCode }}</el-descriptions-item>
        <el-descriptions-item label="任务编号">{{ taskDetail.showTaskCode }}</el-descriptions-item>
        <el-descriptions-item label="任务类型">
          <dict-tag :options="dict.type.sys_task_type" :value="taskDetail.taskType"/>
        </el-descriptions-item>
@@ -33,11 +33,11 @@
      <!-- 急救转运任务扩展信息 -->
      <el-descriptions v-if="taskDetail.taskType === 'EMERGENCY_TRANSFER' && taskDetail.emergencyInfo" title="急救转运信息" :column="2" border style="margin-top: 20px;">
        <el-descriptions-item label="联系人">
          <span v-if="taskDetail.emergencyInfo.contactPerson">{{ taskDetail.emergencyInfo.contactPerson }}</span>
          <span v-if="taskDetail.emergencyInfo.patientContact">{{ taskDetail.emergencyInfo.patientContact }}</span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="联系电话">
          <span v-if="taskDetail.emergencyInfo.contactPhone">{{ taskDetail.emergencyInfo.contactPhone }}</span>
          <span v-if="taskDetail.emergencyInfo.patientPhone">{{ taskDetail.emergencyInfo.patientPhone }}</span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="患者姓名">
@@ -53,7 +53,7 @@
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="病情描述" :span="2">
          <span v-if="taskDetail.emergencyInfo.illnessDescription">{{ taskDetail.emergencyInfo.illnessDescription }}</span>
          <span v-if="taskDetail.emergencyInfo.patientCondition">{{ taskDetail.emergencyInfo.patientCondition }}</span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
      </el-descriptions>
@@ -78,6 +78,12 @@
        <el-descriptions-item label="服务单号">
          <span v-if="taskDetail.emergencyInfo.legacyServiceOrdId">
            <el-tag type="primary" size="small">{{ taskDetail.emergencyInfo.legacyServiceOrdId }}</el-tag>
          </span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="服务单编码">
          <span v-if="taskDetail.emergencyInfo.serviceCode">
            <el-tag type="success" size="small">{{ taskDetail.emergencyInfo.serviceCode }}</el-tag>
          </span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
@@ -110,6 +116,12 @@
          </span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="调度单编码">
          <span v-if="taskDetail.emergencyInfo.dispatchCode">
            <el-tag type="success" size="small">{{ taskDetail.emergencyInfo.dispatchCode }}</el-tag>
          </span>
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
        <el-descriptions-item label="调度单同步时间">
          <span v-if="taskDetail.emergencyInfo.dispatchSyncTime">{{ parseTime(taskDetail.emergencyInfo.dispatchSyncTime) }}</span>
          <span v-else style="color: #C0C4CC;">--</span>
@@ -119,6 +131,166 @@
          <span v-else style="color: #C0C4CC;">--</span>
        </el-descriptions-item>
      </el-descriptions>
      <!-- 支付信息(仅急救转运任务显示) -->
      <el-card v-if="taskDetail.taskType === 'EMERGENCY_TRANSFER' && paymentInfo" class="box-card" style="margin-top: 20px;">
        <div slot="header" class="clearfix">
          <span>支付信息</span>
        </div>
        <!-- 支付概览 -->
        <el-descriptions :column="3" border>
          <el-descriptions-item label="基本价格">
            <span style="color: #409EFF; font-weight: bold;">¥{{ paymentInfo.transferPrice || '0.00' }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="附加费用总额">
            <span style="color: #E6A23C; font-weight: bold;">¥{{ paymentInfo.additionalAmount || '0.00' }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="总金额">
            <span style="color: #67C23A; font-weight: bold;">¥{{ paymentInfo.totalAmount || '0.00' }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="已支付金额">
            <span style="color: #67C23A; font-weight: bold;">¥{{ paymentInfo.paidAmount || '0.00' }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="剩余未付金额">
            <span style="color: #F56C6C; font-weight: bold;">¥{{ getRemainingAmount() }}</span>
          </el-descriptions-item>
          <el-descriptions-item label="支付状态">
            <el-tag v-if="getRemainingAmount() <= 0" type="success" size="small">
              <i class="el-icon-success"></i> 已结清
            </el-tag>
            <el-tag v-else-if="paymentInfo.paidAmount > 0" type="warning" size="small">
              <i class="el-icon-warning"></i> 部分支付
            </el-tag>
            <el-tag v-else type="info" size="small">
              <i class="el-icon-warning"></i> 未支付
            </el-tag>
          </el-descriptions-item>
        </el-descriptions>
        <!-- 附加费用明细 -->
        <div style="margin-top: 20px;">
          <h4 style="margin-bottom: 10px;">附加费用明细</h4>
          <el-table :data="paymentInfo.additionalFees" border>
            <el-table-column label="费用类型" align="center" prop="feeType" width="120">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.task_additional_fee_type" :value="scope.row.feeType"/>
              </template>
            </el-table-column>
            <el-table-column label="费用名称" align="center" prop="feeName" />
            <el-table-column label="单价" align="center" prop="unitAmount" width="120">
              <template slot-scope="scope">
                <span>¥{{ scope.row.unitAmount }}</span>
              </template>
            </el-table-column>
            <el-table-column label="数量" align="center" prop="quantity" width="80" />
            <el-table-column label="小计" align="center" prop="totalAmount" width="120">
              <template slot-scope="scope">
                <span style="color: #E6A23C; font-weight: bold;">¥{{ scope.row.totalAmount }}</span>
              </template>
            </el-table-column>
            <el-table-column label="同步状态" align="center" width="120">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.syncStatus === 0" type="info" size="small">
                  <i class="el-icon-warning"></i> 未同步
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 1" type="warning" size="small">
                  <i class="el-icon-loading"></i> 同步中
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 2" type="success" size="small">
                  <i class="el-icon-success"></i> 同步成功
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 3" type="danger" size="small">
                  <i class="el-icon-error"></i> 同步失败
                </el-tag>
                <span v-else style="color: #C0C4CC;">--</span>
              </template>
            </el-table-column>
            <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip>
              <template slot-scope="scope">
                <span v-if="scope.row.remark">{{ scope.row.remark }}</span>
                <span v-else style="color: #C0C4CC;">--</span>
              </template>
            </el-table-column>
          </el-table>
          <!-- 空状态提示 -->
          <div v-if="!paymentInfo.additionalFees || paymentInfo.additionalFees.length === 0" style="text-align: center; padding: 40px 0; color: #909399;">
            <i class="el-icon-document" style="font-size: 48px; display: block; margin-bottom: 12px;"></i>
            <span>暂无附加费用</span>
          </div>
        </div>
        <!-- 已支付记录 -->
        <div style="margin-top: 20px;">
          <h4 style="margin-bottom: 10px;">已支付记录</h4>
          <el-table :data="paymentInfo.paidPayments" border>
            <el-table-column label="商户订单号" align="center" prop="outTradeNo" width="200" show-overflow-tooltip />
            <el-table-column label="支付金额" align="center" prop="settlementAmount" width="120">
              <template slot-scope="scope">
                <span style="color: #67C23A; font-weight: bold;">¥{{ scope.row.settlementAmount }}</span>
              </template>
            </el-table-column>
            <el-table-column label="支付方式" align="center" prop="paymentMethod" width="120">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.task_payment_method" :value="scope.row.paymentMethod"/>
              </template>
            </el-table-column>
            <el-table-column label="支付状态" align="center" prop="payStatus" width="120">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.payStatus === 'PAID'" type="success" size="small">
                  <i class="el-icon-success"></i> 已支付
                </el-tag>
                <el-tag v-else-if="scope.row.payStatus === 'PENDING'" type="warning" size="small">
                  <i class="el-icon-time"></i> 待支付
                </el-tag>
                <el-tag v-else-if="scope.row.payStatus === 'FAILED'" type="danger" size="small">
                  <i class="el-icon-error"></i> 失败
                </el-tag>
                <el-tag v-else type="info" size="small">
                  {{ scope.row.payStatus }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="交易号" align="center" prop="tradeNo" width="150" show-overflow-tooltip />
            <el-table-column label="支付时间" align="center" prop="payTime" width="180">
              <template slot-scope="scope">
                <span v-if="scope.row.payTime">{{ parseTime(scope.row.payTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                <span v-else style="color: #C0C4CC;">--</span>
              </template>
            </el-table-column>
            <el-table-column label="同步状态" align="center" width="120">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.syncStatus === 0" type="info" size="small">
                  <i class="el-icon-warning"></i> 未同步
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 1" type="warning" size="small">
                  <i class="el-icon-loading"></i> 同步中
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 2" type="success" size="small">
                  <i class="el-icon-success"></i> 同步成功
                </el-tag>
                <el-tag v-else-if="scope.row.syncStatus === 3" type="danger" size="small">
                  <i class="el-icon-error"></i> 同步失败
                </el-tag>
                <span v-else style="color: #C0C4CC;">--</span>
              </template>
            </el-table-column>
            <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip>
              <template slot-scope="scope">
                <span v-if="scope.row.remark">{{ scope.row.remark }}</span>
                <span v-else style="color: #C0C4CC;">--</span>
              </template>
            </el-table-column>
          </el-table>
          <!-- 空状态提示 -->
          <div v-if="!paymentInfo.paidPayments || paymentInfo.paidPayments.length === 0" style="text-align: center; padding: 40px 0; color: #909399;">
            <i class="el-icon-document" style="font-size: 48px; display: block; margin-bottom: 12px;"></i>
            <span>暂无支付记录</span>
          </div>
        </div>
      </el-card>
      <!-- 福祉车任务扩展信息 -->
      <el-descriptions v-if="taskDetail.taskType === 'WELFARE' && taskDetail.welfareInfo" title="福祉车服务信息" :column="2" border style="margin-top: 20px;">
@@ -146,11 +318,53 @@
      </el-descriptions>
      <!-- 操作按钮 -->
      <div style="margin-top: 20px; text-align: center;">
      <!-- <div style="margin-top: 20px; text-align: center;">
        <el-button type="primary" @click="handleEdit" v-hasPermi="['task:general:edit']">编辑任务</el-button>
        <el-button type="success" @click="handleAssign" v-hasPermi="['task:general:assign']">分配任务</el-button>
        <el-button type="warning" @click="handleStatusChange" v-hasPermi="['task:general:status']">状态变更</el-button>
        <el-button type="info" @click="handleVehicleAssign" v-hasPermi="['task:general:assign']">分配车辆</el-button>
      </div> -->
    </el-card>
    <!-- 执行人员列表 -->
    <el-card class="box-card" style="margin-top: 20px;">
      <div slot="header" class="clearfix">
        <span>执行人员</span>
      </div>
      <el-table :data="taskDetail.assignees" v-loading="assigneeLoading">
        <el-table-column label="序号" align="center" width="60">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="姓名" align="center" prop="userName">
          <template slot-scope="scope">
            <span>{{ scope.row.userName }}</span>
            <el-tag v-if="scope.row.isPrimary === '1'" type="warning" size="mini" style="margin-left: 8px;">
              <i class="el-icon-star-on"></i> 负责人
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="角色类型" align="center" prop="userType" width="120">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.userType === 'driver'" type="primary" size="small">司机</el-tag>
            <el-tag v-else-if="scope.row.userType === 'doctor'" type="success" size="small">医生</el-tag>
            <el-tag v-else-if="scope.row.userType === 'nurse'" type="info" size="small">护士</el-tag>
            <el-tag v-else type="" size="small">{{ scope.row.userType }}</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          </template>
        </el-table-column>
      </el-table>
      <!-- 空状态提示 -->
      <div v-if="!taskDetail.assignees || taskDetail.assignees.length === 0" style="text-align: center; padding: 40px 0; color: #909399;">
        <i class="el-icon-user" style="font-size: 48px; display: block; margin-bottom: 12px;"></i>
        <span>暂无执行人员</span>
      </div>
    </el-card>
@@ -261,6 +475,74 @@
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <!-- 附加费用列表 -->
    <el-card class="box-card" style="margin-top: 20px;">
      <div slot="header" class="clearfix">
        <span>附加费用列表</span>
      </div>
      <el-table :data="additionalFeeList" v-loading="feeLoading">
        <el-table-column label="费用类型" align="center" prop="feeType" width="120">
          <template slot-scope="scope">
            <dict-tag :options="dict.type.task_additional_fee_type" :value="scope.row.feeType"/>
          </template>
        </el-table-column>
        <el-table-column label="费用名称" align="center" prop="feeName" />
        <el-table-column label="单价" align="center" prop="unitAmount" width="120">
          <template slot-scope="scope">
            <span>¥{{ scope.row.unitAmount }}</span>
          </template>
        </el-table-column>
        <el-table-column label="数量" align="center" prop="quantity" width="80" />
        <el-table-column label="总金额" align="center" prop="totalAmount" width="120">
          <template slot-scope="scope">
            <span style="color: #E6A23C; font-weight: bold;">¥{{ scope.row.totalAmount }}</span>
          </template>
        </el-table-column>
        <el-table-column label="同步状态" align="center" width="120">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.syncStatus === 0" type="info" size="small">
              <i class="el-icon-warning"></i> 未同步
            </el-tag>
            <el-tag v-else-if="scope.row.syncStatus === 1" type="warning" size="small">
              <i class="el-icon-loading"></i> 同步中
            </el-tag>
            <el-tag v-else-if="scope.row.syncStatus === 2" type="success" size="small">
              <i class="el-icon-success"></i> 同步成功
            </el-tag>
            <el-tag v-else-if="scope.row.syncStatus === 3" type="danger" size="small">
              <i class="el-icon-error"></i> 同步失败
            </el-tag>
            <span v-else style="color: #C0C4CC;">--</span>
          </template>
        </el-table-column>
        <el-table-column label="同步时间" align="center" prop="syncTime" width="180">
          <template slot-scope="scope">
            <span v-if="scope.row.syncTime">{{ parseTime(scope.row.syncTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
            <span v-else style="color: #C0C4CC;">--</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createdTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="创建者" align="center" prop="createdBy" width="100" />
        <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip>
          <template slot-scope="scope">
            <span v-if="scope.row.remark">{{ scope.row.remark }}</span>
            <span v-else style="color: #C0C4CC;">--</span>
          </template>
        </el-table-column>
      </el-table>
      <!-- 空状态提示 -->
      <div v-if="!additionalFeeList || additionalFeeList.length === 0" style="text-align: center; padding: 40px 0; color: #909399;">
        <i class="el-icon-document" style="font-size: 48px; display: block; margin-bottom: 12px;"></i>
        <span>暂无附加费用</span>
      </div>
    </el-card>
    <!-- 操作日志 -->
@@ -456,13 +738,13 @@
</template>
<script>
import { getTask, updateTask, assignTask, changeTaskStatus, uploadAttachment, deleteAttachment, getTaskVehicles, getAvailableVehicles, assignVehiclesToTask, unassignVehicleFromTask } from "@/api/task";
import { getTask, updateTask, assignTask, changeTaskStatus, uploadAttachment, deleteAttachment, getTaskVehicles, getAvailableVehicles, assignVehiclesToTask, unassignVehicleFromTask, getPaymentInfo } from "@/api/task";
import { listUser } from "@/api/system/user";
import { getToken } from "@/utils/auth";
export default {
  name: "TaskDetail",
  dicts: ['sys_task_type', 'sys_task_status', 'sys_vehicle_type', 'sys_task_vehicle_status', 'sys_user_sex', 'hospital_department', 'sys_attachment_category'],
  dicts: ['sys_task_type', 'sys_task_status', 'sys_vehicle_type', 'sys_task_vehicle_status', 'sys_user_sex', 'hospital_department', 'sys_attachment_category', 'task_additional_fee_type', 'task_payment_method'],
  data() {
    return {
      // 任务详情
@@ -502,6 +784,12 @@
      // 加载状态
      vehicleLoading: false,
      attachmentLoading: false,
      feeLoading: false,
      assigneeLoading: false,
      // 附加费用列表
      additionalFeeList: [],
      // 支付信息
      paymentInfo: null,
      // 上传相关
      uploadUrl: process.env.VUE_APP_BASE_API + "/task/attachment/upload/" + (new URLSearchParams(window.location.search).get('taskId') || ''),
      uploadHeaders: {
@@ -545,6 +833,7 @@
  created() {
    this.getTaskDetail();
    this.getUserList();
    this.getAdditionalFeeList();
    // 初始化上传URL
    this.uploadUrl = process.env.VUE_APP_BASE_API + "/task/attachment/upload/" + this.$route.params.taskId;
  },
@@ -553,8 +842,41 @@
    getTaskDetail() {
      getTask(this.$route.params.taskId).then(response => {
        this.taskDetail = response.data;
        // 任务详情加载完成后,加载支付信息
        // console.log("TaskDetail", this.taskDetail);
        this.loadPaymentInfo();
      });
    },
    /** 获取附加费用列表 */
    getAdditionalFeeList() {
      this.feeLoading = true;
      getPaymentInfo(this.$route.params.taskId).then(response => {
        this.additionalFeeList = response.data.additionalFees || [];
        this.feeLoading = false;
      }).catch(() => {
        this.feeLoading = false;
      });
    },
    /** 加载支付信息 */
    loadPaymentInfo() {
      //EMERGENCY_TRANSFER
      if (this.taskDetail.taskType === 'EMERGENCY_TRANSFER') {
        getPaymentInfo(this.$route.params.taskId).then(response => {
          // console.log("PaymentInfo", response.data);
          this.paymentInfo = response.data;
        }).catch(() => {
          this.paymentInfo = null;
        });
      }
    },
    /** 计算剩余未付金额 */
    getRemainingAmount() {
      if (!this.paymentInfo) return '0.00';
      const total = parseFloat(this.paymentInfo.totalAmount || 0);
      const paid = parseFloat(this.paymentInfo.paidAmount || 0);
      const remaining = total - paid;
      return remaining > 0 ? remaining.toFixed(2) : '0.00';
    },
    /** 获取用户列表 */
    getUserList() {
      listUser().then(response => {