<!--pages/production/production.wxml-->
<view class="production-container">
  <!-- 页面标题 -->
  <view class="page-title">生产管理</view>

  <!-- 牛只管理模块 -->
  <view class="management-section">
    <view class="section-header">
      <view class="section-title-bar"></view>
      <text class="section-title">牛只管理</text>
    </view>

    <view class="function-grid">
      <view class="function-item" bindtap="goCattleManage">
        <view class="function-icon cattle-archive">🐄</view>
        <text class="function-text">牛只档案</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="estrus-record">
        <view class="function-icon estrus-record">💗</view>
        <text class="function-text">发情记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="mating-record">
        <view class="function-icon mating-record">🧪</view>
        <text class="function-text">配种记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="pregnancy-check">
        <view class="function-icon pregnancy-check">📅</view>
        <text class="function-text">妊检记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="farrowing-record">
        <view class="function-icon farrowing-record">👶</view>
        <text class="function-text">分娩记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="weaning-record">
        <view class="function-icon weaning-record">✏️</view>
        <text class="function-text">断奶记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="pen-transfer">
        <view class="function-icon pen-transfer">🏠</view>
        <text class="function-text">转栏记录</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="pen-exit">
        <view class="function-icon pen-exit">🏠</view>
        <text class="function-text">离栏记录</text>
      </view>

      <view class="function-item" bindtap="goCattlePenSettings" data-animal="cattle" data-type="pen-settings">
        <view class="function-icon pen-settings">🏠</view>
        <text class="function-text">栏舍设置</text>
      </view>

      <view class="function-item" bindtap="goCattleBatchSettings" data-animal="cattle" data-type="batch-settings">
        <view class="function-icon batch-settings">📄</view>
        <text class="function-text">批次设置</text>
      </view>

      <view class="function-item" bindtap="onFunctionClick" data-animal="cattle" data-type="epidemic-warning">
        <view class="function-icon epidemic-warning">🛡️</view>
        <text class="function-text">防疫预警</text>
      </view>
    </view>
  </view>

  <!-- 猪档案管理模块 -->
  <view class="management-section">
    <view class="section-header">
      <view class="section-title-bar"></view>
      <text class="section-title">猪档案</text>
    </view>
    
    <view class="function-grid">
      <!-- 第一行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="archive">
        <view class="function-icon pig-archive">🐷</view>
        <text class="function-text">猪档案</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="estrus-record">
        <view class="function-icon estrus-record">💗</view>
        <text class="function-text">发情记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="mating-record">
        <view class="function-icon mating-record">🧪</view>
        <text class="function-text">配种记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="pregnancy-check">
        <view class="function-icon pregnancy-check">📅</view>
        <text class="function-text">妊检记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="farrowing-record">
        <view class="function-icon farrowing-record">👶</view>
        <text class="function-text">分娩记录</text>
      </view>
      
      <!-- 第二行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="weaning-record">
        <view class="function-icon weaning-record">✏️</view>
        <text class="function-text">断奶记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="pen-transfer">
        <view class="function-icon pen-transfer">🏠</view>
        <text class="function-text">转栏记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="pen-exit">
        <view class="function-icon pen-exit">🏠</view>
        <text class="function-text">离栏记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="pen-settings">
        <view class="function-icon pen-settings">🏠</view>
        <text class="function-text">栏舍设置</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="batch-settings">
        <view class="function-icon batch-settings">📄</view>
        <text class="function-text">批次设置</text>
      </view>
      
      <!-- 第三行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="pig" data-type="epidemic-warning">
        <view class="function-icon epidemic-warning">🛡️</view>
        <text class="function-text">防疫预警</text>
      </view>
    </view>
  </view>

  <!-- 羊只管理模块 -->
  <view class="management-section">
    <view class="section-header">
      <view class="section-title-bar"></view>
      <text class="section-title">羊只管理</text>
    </view>
    
    <view class="function-grid">
      <!-- 第一行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="archive">
        <view class="function-icon sheep-archive">🐑</view>
        <text class="function-text">羊档案</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="estrus-record">
        <view class="function-icon estrus-record">💗</view>
        <text class="function-text">发情记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="mating-record">
        <view class="function-icon mating-record">🧪</view>
        <text class="function-text">配种记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="pregnancy-check">
        <view class="function-icon pregnancy-check">📅</view>
        <text class="function-text">妊检记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="farrowing-record">
        <view class="function-icon farrowing-record">👶</view>
        <text class="function-text">分娩记录</text>
      </view>
      
      <!-- 第二行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="weaning-record">
        <view class="function-icon weaning-record">✏️</view>
        <text class="function-text">断奶记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="pen-transfer">
        <view class="function-icon pen-transfer">🏠</view>
        <text class="function-text">转栏记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="pen-exit">
        <view class="function-icon pen-exit">🏠</view>
        <text class="function-text">离栏记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="pen-settings">
        <view class="function-icon pen-settings">🏠</view>
        <text class="function-text">栏舍设置</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="batch-settings">
        <view class="function-icon batch-settings">📄</view>
        <text class="function-text">批次设置</text>
      </view>
      
      <!-- 第三行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="sheep" data-type="epidemic-warning">
        <view class="function-icon epidemic-warning">🛡️</view>
        <text class="function-text">防疫预警</text>
      </view>
    </view>
  </view>

  <!-- 家禽管理模块 -->
  <view class="management-section">
    <view class="section-header">
      <view class="section-title-bar"></view>
      <text class="section-title">家禽管理</text>
    </view>
    
    <view class="function-grid">
      <!-- 第一行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="archive">
        <view class="function-icon poultry-archive">🐔</view>
        <text class="function-text">家禽档案</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="pen-exit">
        <view class="function-icon pen-exit">🏠</view>
        <text class="function-text">离栏记录</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="pen-settings">
        <view class="function-icon pen-settings">🏠</view>
        <text class="function-text">栏舍设置</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="batch-settings">
        <view class="function-icon batch-settings">📄</view>
        <text class="function-text">批次设置</text>
      </view>
      
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="scan-entry">
        <view class="function-icon scan-entry">🏠</view>
        <text class="function-text">扫码录入</text>
      </view>
      
      <!-- 第二行 -->
      <view class="function-item" bindtap="onFunctionClick" data-animal="poultry" data-type="scan-print">
        <view class="function-icon scan-print">🏠</view>
        <text class="function-text">扫码打印</text>
      </view>
    </view>
  </view>

  <!-- 加载状态 -->
  <view wx:if="{{loading}}" class="loading-container">
    <view class="loading-spinner"></view>
    <text class="loading-text">加载中...</text>
  </view>
</view>
