<template>
  <view class="orderDetail">
    <!-- 头部 -->
    <view class="orderDetail_header">
      <view class="orderDetail_header_item" v-for="tab in tabs" :key="tab.id" :class="{active:tab.id === selectedTab}"
        @click="debouncedChangeTab(tab.id)">
        {{tab.name}}
      </view>
    </view>
    <!-- tab -->
    <!-- 工单信息 -->
    <view class="orderDetail_info" v-show="selectedTab === 1">
      <scroll-view scroll-y class="orderDetail_infoItem" v-if="orderInfo.id">
        <view class="orderDetail_infoItem_header">
          <view class="orderDetail_infoItem_header_title">
            <view class="icon"></view>
            <view class="taskNameAndWorkerName">
              <text class="taskName"
                v-if="orderInfo.taskType">{{orderInfo.isHalfInspect === 1? "半程陪检": orderInfo.taskType.taskName}}</text>
            </view>
          </view>
          <text class="orderDetail_infoItem_header_more">{{orderInfo.gdcode}}</text>
        </view>
        <view class="orderDetail_infoItem_item">
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">状态</text>
            <text class="orderDetail_infoItem_item_value" v-if="orderInfo.gdState">{{orderInfo.gdState.name}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">工单日期</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.startTime || '暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">总耗时</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.showTimeNum || '暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">申请科室</text>
            <text
              class="orderDetail_infoItem_item_value">{{orderInfo.createDeptDTO?(deptDisplay==2?orderInfo.createDeptDTO.deptalias:orderInfo.createDeptDTO.dept):'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">起点科室</text>
            <text
              class="orderDetail_infoItem_item_value">{{orderInfo.startDept?(deptDisplay==2?orderInfo.startDept.deptalias:orderInfo.startDept.dept):'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
            <text class="orderDetail_infoItem_item_name">中间科室</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.middleDept || '暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">目标科室</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.endDepts}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">支助人员</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.worker?orderInfo.worker.name:'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">联系电话</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.worker?orderInfo.worker.phone:'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
            <text class="orderDetail_infoItem_item_name">陪同情况</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.isAccompany==1?'需要医护陪同':'无需医护陪同'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者其他服务业务']">
            <text class="orderDetail_infoItem_item_name">预约时间</text>
            <text class="orderDetail_infoItem_item_value"
              v-if="orderInfo.yyjdTime">{{orderInfo.yyjdTime|formatDate('MM-dd HH:mm')}}</text>
            <text class="orderDetail_infoItem_item_value" v-else>暂无</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['患者陪检业务']">
            <text class="orderDetail_infoItem_item_name">是否半程陪检</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.isHalfInspect===1?'是':'否'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.drugs && orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['药品配送业务']">
            <text class="orderDetail_infoItem_item_name">药包编码</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.drugs.packid || '暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.staticDistri && orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['静配配送']">
            <text class="orderDetail_infoItem_item_name">药包编码</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.staticDistri.packid || '暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务'] || orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']">
            <text class="orderDetail_infoItem_item_name">预计接收</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.expectReceiveNum||'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务'] || orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']">
            <text class="orderDetail_infoItem_item_name">实际接收</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.actualReceiveNum||'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content">
            <text class="orderDetail_infoItem_item_name">是否加急</text>
            <text class="orderDetail_infoItem_item_value" v-if="orderInfo.emergencyType">
              {{(orderInfo.emergencyType.value == 2 || orderInfo.emergencyType.value == 3)?'是':'否'}}
            </text>
          </view>
          <view class="orderDetail_infoItem_item_content"
            v-if="orderInfo.workOrderRemark && (orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['临时标本业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['标本轮巡业务']||orderInfo.taskType.associationType.value === ASSOCIATION_TYPES['其他临床服务'])">
            <text class="orderDetail_infoItem_item_name">备注信息</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.workOrderRemark||'暂无'}}</text>
          </view>
          <view class="orderDetail_infoItem_item_content" v-if="orderInfo.specialCloseReason">
            <text class="orderDetail_infoItem_item_name">特殊情况关闭原因</text>
            <text class="orderDetail_infoItem_item_value">{{orderInfo.specialCloseReason||'暂无'}}</text>
          </view>
        </view>
      </scroll-view>
    </view>
    <!-- 流程信息 -->
    <view class="orderDetail_info" v-show="selectedTab === 2">
      <scroll-view scroll-y class="orderDetail_infoItem" v-if="logList.length">
        <view class="orderDetail_infoItem_header">
          <view class="orderDetail_infoItem_header_title">
            <view class="icon"></view>
            <view class="taskNameAndWorkerName">
              <text class="taskName">流程信息</text>
            </view>
          </view>
        </view>
        <view class="orderDetail_infoItem_item process">
          <view class="orderDetail_process_item" v-for="(step,i) in logList" :key="i">
            <view class="step_infoStart">
              <view class="step_name">{{step.operationName}}</view>
              <view class="step_time" v-if="step.record && step.record[0]">
                {{step.record[0].operationTime|formatDate('MM-dd HH:mm')}}
              </view>
            </view>
            <view class="step_icon pda pda-icon_liucheng"
              :class="{'active':(step.record&&step.record[0]&&step.record[0].operationTime)}"></view>
            <view class="step_infoEnd">
              <view class="step_overtime" v-if="i!=0&&step.record&&step.record.length">
                耗时{{filterTime(step.record)}}
              </view>
              <view class="step_dept" v-if="step.record&&step.record[0]&&step.record[0].dept">
                <text v-for="(dept,index) in step.record"
                  :key="index">{{dept?(deptDisplay == 2?dept.deptalias:dept.dept)+',':''}}</text>
              </view>
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
    <!-- 业务信息 -->
    <view class="orderDetail_info" v-show="selectedTab === 3">
      <scroll-view scroll-y class="orderDetail_infoItem">
        <view class="orderDetail_infoItem_header">
          <view class="orderDetail_infoItem_header_title">
            <view class="icon"></view>
            <view class="taskNameAndWorkerName">
              <text class="taskName">业务信息</text>
            </view>
          </view>
        </view>
        <!-- 检查信息 -->
        <view class="orderDetail_infoItem_item business business_inspect"
          v-if="orderInfo.taskType&&(orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['患者陪检业务'] || orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['患者其他服务业务'])">
          <!-- 患者信息 -->
          <view class="inspect_info" v-if="orderInfo.patient">
            <view class="inspect_info_block">
              <view class="inspect_info_left">
                <block v-if="orderInfo.patient.illnessState">
                  <view class="inspect_info_icon red" v-if="orderInfo.patient.illnessState.value === '2'">危</view>
                  <view class="inspect_info_icon red" v-else-if="orderInfo.patient.illnessState.value === '3'">重</view>
                </block>
                <block v-if="orderInfo.patient.careLevel">
                  <view class="inspect_info_icon red" v-if="orderInfo.patient.careLevel.value === '0'">特</view>
                  <view class="inspect_info_icon red" v-else-if="orderInfo.patient.careLevel.value === '1'">1</view>
                  <view class="inspect_info_icon green" v-else-if="orderInfo.patient.careLevel.value === '2'">2</view>
                  <view class="inspect_info_icon green" v-else-if="orderInfo.patient.careLevel.value === '3'">3</view>
                </block>
                <view class="inspect_info_name">{{orderInfo.patient.patientName}}</view>
              </view>
              <view class="inspect_info_right">
                {{orderInfo.patient.bedNum}}床
              </view>
            </view>
            <view class="inspect_info_block">
              <view class="inspect_info_left">
                {{orderInfo.patient.patientCode}}
              </view>
              <view class="inspect_info_right"
                v-if="orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['患者陪检业务']">
                待检{{orderInfo.checkList.length}}
              </view>
            </view>
          </view>
          <!-- 检查信息 -->
          <block v-if="orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['患者陪检业务']">
            <view class="inspect_item" v-for="item in orderInfo.checkList" :key="item.id"
              @click="toDetail(item.id,'inspect')">
              <view class="inspect_item_name">
                {{item.inspectName||'暂无'}}
              </view>
              <view class="inspect_item_info">
                <view class="inspect_item_dept">
                  {{item.execDept?(deptDisplay==2?item.execDept.deptalias:item.execDept.dept):'暂无'}}
                </view>
                <view class="inspect_item_number">
                  叫号信息 {{item.reservationNumber || '暂无'}}
                </view>
              </view>
              <view class="inspect_item_yytime">
                预约时间{{item.yyTime || '暂无'}}
              </view>
            </view>
          </block>
        </view>
        <!-- 标本信息 -->
        <view class="orderDetail_infoItem_item business business_specimen"
          v-if="orderInfo.taskType&&(orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['临时标本业务'] || orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['标本轮巡业务'])">
          <view class="inspect_specimen">
            <uni-table stripe emptyText="暂无更多数据">
              <!-- 表头行 -->
              <uni-tr class="th">
                <uni-th align="center" width="68">标本类型</uni-th>
                <uni-th align="center" width="71">标本编码</uni-th>
                <uni-th align="center" width="66">状态</uni-th>
                <uni-th align="center" width="71">科室</uni-th>
              </uni-tr>
              <!-- 表格数据行 -->
              <uni-tr v-for="data in orderInfo.specimenSet" :key="data.id" @click.native="toDetail(data.id,'specimen')">
                <uni-td align="center">{{data.stype?data.stype.name:'暂无'}}</uni-td>
                <uni-td align="center">{{data.scode || '暂无'}}</uni-td>
                <uni-td align="center">{{data.speState?data.speState.name:'暂无'}}</uni-td>
                <uni-td align="center" class="td" v-if="data.checkDept">
                  {{deptDisplay==2?data.checkDept.deptalias:data.checkDept.dept}}
                  <image class="urgent" v-if="data.urgent == 1" src="../../static/imgs/icon_ji.png" mode="widthFix">
                  </image>
                </uni-td>
                <uni-td align="center" class="td" v-else>
                  暂无
                  <image class="urgent" v-if="data.urgent == 1" src="../../static/imgs/icon_ji.png" mode="widthFix">
                  </image>
                </uni-td>
              </uni-tr>
            </uni-table>
          </view>
        </view>
        <!-- 药品信息 -->
        <view class="orderDetail_infoItem_item business business_drugsBag"
          v-if="orderInfo.taskType&&(orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['药品配送业务'] || orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['静配配送'])">
          <!-- 检查信息 -->
          <block v-if="orderInfo.drugs&&orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['药品配送业务']">
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                发药单号
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.drugs.packid || '暂无'}}
              </view>
            </view>
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                发药科室
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.drugs.launch?(deptDisplay == 2?orderInfo.drugs.launch.deptalias:orderInfo.drugs.launch.dept):'暂无'}}
              </view>
            </view>
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                状态
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.drugs.drugsState?orderInfo.drugs.drugsState.name:'暂无'}}
              </view>
            </view>
          </block>
          <block v-if="orderInfo.staticDistri&&orderInfo.taskType.associationType.value==ASSOCIATION_TYPES['静配配送']">
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                发药单号
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.staticDistri.packid || '暂无'}}
              </view>
            </view>
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                发药科室
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.staticDistri.launch?(deptDisplay == 2?orderInfo.staticDistri.launch.deptalias:orderInfo.staticDistri.launch.dept):'暂无'}}
              </view>
            </view>
            <view class="drugsBag_item">
              <view class="drugsBag_item_name">
                状态
              </view>
              <view class="drugsBag_item_value">
                {{orderInfo.staticDistri.drugsState?orderInfo.staticDistri.drugsState.name:'暂无'}}
              </view>
            </view>
          </block>
        </view>
      </scroll-view>
    </view>
    <!-- 底部 -->
    <seiminFooterBtn :btns="btns"></seiminFooterBtn>
    <seiminModel ref="seiminModel"></seiminModel>
  </view>
</template>

<script>
  import {
    debounce
  } from 'lodash/function';
  import {
    reqFetchData,
    reqFetchWorkOrderLog,
  } from "../../request/api.js";
  import {
    mapState
  } from "vuex";
  import {
    GDSTATE
  } from "../../utils/enum.gdstate.js";
  import {
    ASSOCIATION_TYPES
  } from "../../utils/enum.association_types.js";
  import {
    showAppraise,
    openRecallModal,
    openExecModal,
    showJiaji,
  } from "../../utils/index.js";
  export default {
    data() {
      return {
        debouncedChangeTab: null,
        // 路由传参
        queryParams: {},
        // 关联类型
        ASSOCIATION_TYPES,
        // 选项卡
        tabs: [{
            id: 1,
            name: '工单信息'
          },
          {
            id: 2,
            name: '流程信息'
          },
          {
            id: 3,
            name: '业务信息'
          },
        ],
        // 当前选中的tab
        selectedTab: 1,
        // 工单信息
        orderInfo: {},
        // 流程信息
        logList: [],
        //底部按钮
        btns: [],
      };
    },
    computed: {
      ...mapState('other', ["deptDisplay"]),
    },
    methods: {
      init(queryParams) {
        this.queryParams = queryParams;
        this.changeTab(1);
      },
      // 跳转详情
      toDetail(id, associationType) {
        uni.navigateTo({
          url: `/pages/detail/detail?id=${id}&associationType=${associationType}`
        })
      },
      // 格式化时分秒
      // （时间小于一分钟则显示秒，时间大于一分钟则显示分钟数，如超出一小时则显示小时和分钟。）time单位:秒
      formatTime(time) {
        let timeStr = "";
        if (time >= 0 && time < 60) {
          // 秒
          timeStr = time + "秒";
        } else if (time >= 60 && time < 3600) {
          // 分钟
          timeStr = Math.floor(time / 60) + "分钟";
        } else if (time >= 3600) {
          // 时 + 分
          let h = "";
          let m = "";
          h = Math.floor(time / 3600) + "小时";
          m = time % 3600 >= 60 ? Math.floor((time % 3600) / 60) + "分钟" : "";
          timeStr = h + m;
        }
        return timeStr;
      },
      // 计算流程信息耗时
      filterTime(step) {
        let num = 0;
        step.forEach((e) => {
          num += e.difTime;
        });
        return this.formatTime(num / 1000);
      },
      // 切换tab
      changeTab(id) {
        this.selectedTab = id;
        switch (id) {
          case 1:
            this.getInfo(this.queryParams);
            break;
          case 2:
            this.getProcess(this.queryParams);
            break;
          case 3:
            break;
        }
      },
      //获取工单信息数据
      getInfo(queryParams) {
        uni.showLoading({
          mask: true,
          title: '加载中',
        })
        reqFetchData('api', 'workOrder', queryParams.id).then(res => {
          uni.hideLoading();
          if (res.status == 200) {
            // 检查科室处理
            if (res.data.middleDept) {
              //有检查科室的话
              res.data.middleDept = res.data.middleDept.map(v => {
                return this.deptDisplay == 2 ? v.deptalias : v.dept;
              }).toString();
            }
            // 终点科室处理
            res.data.endDepts = res.data.endDepts.map(v => {
              return this.deptDisplay == 2 ? v.deptalias : v.dept;
            }).toString();
            // 工单信息
            this.orderInfo = res.data;
            //底部按钮处理
            let btns = [{
              name: "回到列表",
              type: "default",
              click: () => {
                uni.navigateTo({
                  url: "/pages/orderList/orderList",
                });
              },
            }];
            let newOrder = this.orderInfo;
            if (newOrder.gdState.value == GDSTATE['待抢单'] ||
              newOrder.gdState.value == GDSTATE['待接单'] ||
              newOrder.gdState.value == GDSTATE['待到达'] ||
              newOrder.gdState.value == GDSTATE['定时预约'] ||
              newOrder.gdState.value == GDSTATE['待评价']) {

              if (newOrder.gdState.value == GDSTATE['待评价']) {
                //评价按钮
                btns.push({
                  name: "评价",
                  type: "primary",
                  click: () => {
                    showAppraise.call(this, newOrder.id, () => {
                      this.$refs.seiminModel.close();
                      uni.navigateTo({
                        url: "/pages/orderList/orderList",
                      });
                    });
                  },
                })
              }

              if (newOrder.gdState.value == GDSTATE['待抢单'] ||
                newOrder.gdState.value == GDSTATE['待接单'] ||
                newOrder.gdState.value == GDSTATE['待到达'] ||
                newOrder.gdState.value == GDSTATE['定时预约']) {
                //撤销按钮
                btns.push({
                  name: "撤销",
                  type: "primary",
                  click: () => {
                    openRecallModal.call(this, newOrder.id, () => {
                      this.$refs.seiminModel.close();
                      uni.navigateTo({
                        url: "/pages/orderList/orderList",
                      });
                    });
                  },
                })
              }

              if (newOrder.gdState.value == GDSTATE['定时预约']) {
                //立即执行按钮
                btns.push({
                  name: "立即执行",
                  type: "primary",
                  click: () => {
                    openExecModal.call(this, newOrder.id, () => {
                      this.$refs.seiminModel.close();
                      uni.navigateTo({
                        url: "/pages/orderList/orderList",
                      });
                    });
                  },
                })
              }

              if ((newOrder.gdState.value == GDSTATE['待抢单'] ||
                  newOrder.gdState.value == GDSTATE['待到达']) &&
                newOrder.taskType.allowUrgent == 1 &&
                !newOrder.urgentDetails) {
                //加急按钮
                btns.push({
                  name: "加急",
                  type: "primary",
                  click: () => {
                    showJiaji.call(this, newOrder.id, () => {
                      this.$refs.seiminModel.close();
                      uni.navigateTo({
                        url: "/pages/orderList/orderList",
                      });
                    });
                  },
                })
              }
            }
            // 按钮赋值
            this.btns = btns;
          } else {
            this.btns = [{
              name: "回到列表",
              type: "default",
              click: () => {
                uni.navigateTo({
                  url: "/pages/orderList/orderList",
                });
              },
            }, ];
            this.$refs.seiminModel.show({
              skin: 'toast',
              icon: 'error',
              content: '请求失败',
            })
          }
        })
      },
      //获取流程信息数据
      getProcess(queryParams) {
        uni.showLoading({
          mask: true,
          title: '加载中',
        })
        reqFetchWorkOrderLog(queryParams.id).then(res => {
          uni.hideLoading();
          if (res.status == 200) {
            // 流程信息
            this.logList = res.data;
          } else {
            this.$refs.seiminModel.show({
              skin: 'toast',
              icon: 'error',
              content: '请求失败',
            })
          }
        })
      },
    },
    onLoad(queryParams) {
      console.log(queryParams);
      this.init(queryParams);
    },
    created() {
      this.debouncedChangeTab = debounce(this.changeTab, 166);
    },
    beforeDestroy() {
      this.debouncedChangeTab.cancel()
    }
  }
</script>

<style lang="scss" scoped>
  .orderDetail {
    padding-bottom: 108rpx;

    // 头部
    .orderDetail_header {
      position: fixed;
      z-index: 98;
      width: 100%;
      height: 88rpx;
      background-color: #fff;
      color: #333;
      @include flex;

      .orderDetail_header_item {
        flex: 1;
        font-size: 32rpx;
        @include border(right);
        @include border(bottom);
        @include flex(center, center);

        &:last-of-type {
          border-right: none;
        }

        &.active {
          color: $defaultColor;
          border-bottom: 4rpx solid $defaultColor;
        }
      }
    }

    // tab
    // 工单详情
    .orderDetail_info {
      padding: 108rpx 24rpx 0;

      .orderDetail_infoItem {
        width: 702rpx;
        height: calc(100vh - 340rpx);
        background-color: #fff;
        margin-top: 8rpx;
        border-radius: 8rpx;
        position: relative;
        padding: 0 24rpx;
        font-size: 32rpx;
        @include border;
        @include semicircle(#f9fafb, 82rpx);
        @include flex(flex-start, stretch, column);

        .ji,
        .jiaji {
          width: 60rpx;
          position: absolute;
          right: 0;
          top: 0;
        }

        .orderDetail_infoItem_header {
          height: 86rpx;
          @include border($directive:bottom, $style:dashed);
          @include flex(space-between, center);

          .orderDetail_infoItem_header_title {
            color: #333;
            flex: 1;
            @include flex(flex-start, center);

            .icon {
              width: 10rpx;
              height: 46rpx;
              border-radius: 2rpx;
              background-color: #F0F6ED;
              @include btn_background;
            }

            .taskNameAndWorkerName {
              flex: 1;
              @include flex;

              .taskName {
                max-width: 10em;
                margin-left: 8rpx;
                font-size: 38rpx;
                font-weight: bold;
                @include clamp;
              }
            }
          }

          .orderDetail_infoItem_header_more {
            color: #333;
            font-weight: bold;
            font-size: 38rpx;
            @include clamp;
          }
        }

        .orderDetail_infoItem_item {
          padding-top: 12rpx;
          padding-bottom: 12rpx;
          color: #333;
          font-size: 30rpx;
          flex: 1;
          @include border(bottom);
          @include flex(flex-start, stretch, column);

          &.process {
            padding-top: 90rpx;
            padding-bottom: 90rpx;
          }

          &:last-of-type {
            border-bottom: none;
          }

          // 工单信息
          .orderDetail_infoItem_item_content {
            margin-top: 20rpx;
            @include flex(space-between, stretch);

            .orderDetail_infoItem_item_name {
              font-size: 34rpx;
              color: #666;
              max-width: 4em;
            }

            .orderDetail_infoItem_item_value {
              font-size: 38rpx;
              color: #333;
              font-weight: bold;
              max-width: 420rpx;
              text-align: justify;
              word-break: break-all;
            }
          }

          // 流程信息
          .orderDetail_process_item {
            min-height: 120rpx;
            line-height: 50rpx;
            color: #333;
            @include flex(center);

            &:last-of-type {
              .step_icon {
                &::after {
                  display: none;
                }
              }
            }

            .step_infoStart {
              font-size: 28rpx;
              flex: 1;
              @include flex(flex-end);

              .step_time {
                margin-left: 16rpx;
              }
            }

            .step_icon {
              font-size: 38rpx;
              margin-left: 30rpx;
              margin-right: 30rpx;
              position: relative;
              color: #E5E9ED;

              &.active {
                color: #07863C;
              }

              &::after {
                content: '';
                position: absolute;
                top: 60rpx;
                left: 18rpx;
                width: 1px;
                height: calc(100% - 70rpx);
                background-color: #DDE1E5;
              }
            }

            .step_infoEnd {
              font-size: 34rpx;
              flex: 1;
              padding-bottom: 16rpx;
            }
          }

          // 业务信息-检查
          &.business_inspect {
            .inspect_info {
              font-size: 34rpx;
              color: #333;
              padding-top: 20rpx;
              padding-bottom: 20rpx;
              @include border($directive:bottom, $style:dashed);

              .inspect_info_block {
                height: 60rpx;
                @include flex(space-between, center);

                .inspect_info_left {
                  @include flex;

                  .inspect_info_icon {
                    width: 50rpx;
                    height: 50rpx;
                    line-height: 50rpx;
                    border-radius: 50%;
                    font-size: 28rpx;
                    margin-right: 8rpx;
                    @include flex(center, center);

                    &.green {
                      color: $defaultColor;
                      border: 1px solid $defaultColor;
                      background-color: rgba(73, 184, 86, 0.1);
                    }

                    &.red {
                      color: #FF3B53;
                      border: 1px solid #FF3B53;
                      background-color: #FFE8EB;
                    }
                  }

                  .inspect_info_name {
                    font-weight: bold;
                  }
                }

                .inspect_info_right {
                  font-weight: bold;
                }
              }
            }

            .inspect_item {
              color: #333;
              font-size: 34rpx;
              line-height: 48rpx;
              padding-top: 26rpx;
              padding-bottom: 26rpx;
              @include border($directive:bottom, $style:dashed);

              .inspect_item_name {
                font-weight: bold;
              }

              .inspect_item_yytime {
                font-weight: bold;
              }

              .inspect_item_info {
                margin-top: 16rpx;
                margin-bottom: 16rpx;
                @include flex(space-between, center);

                .inspect_item_dept {
                  flex: 1;
                  word-break: break-all;
                  @include clamp;
                }

                .inspect_item_number {
                  flex: 1;
                  text-align: right;
                  word-break: break-all;
                  @include clamp;
                }
              }
            }
          }

          // 业务信息-标本
          &.business_specimen {
            font-size: 34rpx;

            .th {
              background-color: red;
              @include btn_background;

              th {
                color: #fff;
              }
            }

            .td {
              position: relative;

              .urgent {
                width: 60rpx;
                position: absolute !important;
                right: 0;
                top: 0;
              }
            }

            .table--border {
              border: none;
            }

            ::v-deep .uni-table {
              min-width: 0;
            }

            ::v-deep .uni-table-td {
              word-break: break-all;
            }
          }

          // 业务信息-药品
          &.business_drugsBag {
            .drugsBag_item {
              color: #333;
              font-size: 34rpx;
              margin-top: 20rpx;
              @include flex(space-between, center);

              .drugsBag_item_name {}

              .drugsBag_item_value {
                font-weight: bold;
              }
            }
          }
        }
      }
    }
  }
</style>
