祖安之光
2025-08-07 41193d186d157937ba052e73dd04c12018e9ecab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<view class="box">
  <!-- 自定义导航栏 -->
  <view class="navBarBox fix">
    <!-- 状态栏占位 -->
    <view class="statusBar" style="padding-top: {{statusBarHeight}}px;"></view>
    <!-- 真正的导航栏内容 -->
    <view class="navBar">
      <view class="barText">记录查询</view>
    </view>
  </view>
  
  <!-- 页面内容 -->
  <!-- <toast id="uToast"></toast> -->
  
  <view class="m-p-15">
    <view class="searchBar">
      <view class="u-input">
        <!-- <icon type="scan" color="#2979ff" size="28" bindtap="scanCode"></icon> -->
        <text class="iconfont icon-saoma" catchtap="scanCode" style="color: #2979ff;font-size: 26px;"></text>
        <input 
          placeholder="请输入或扫描二维码编号进行搜索" 
          value="{{searchContent}}" 
          bindinput="onSearchInput"
        />
        <button 
          type="primary" 
          class="searchBtn" 
          size="mini" 
          bindtap="getList"
        >溯源查询</button>
      </view>
    </view>
    
    <view class="productCard" wx:if="{{dataList && dataList.length>0}}">
      <view wx:if="{{dataList[0].hazmatBasic}}">
        <view>名称:<text style="color: #2979ff">{{dataList[0].hazmatBasic?dataList[0].hazmatBasic.name:''}}({{dataList[0].hazmatBasic?dataList[0].hazmatBasic.productSn :''}})</text></view>
        <view>条码:<text style="color: #2979ff">{{dataList[0].code}}</text></view>
      </view>
      <view wx:if="{{dataList[0].productBasic}}">
        <view>名称:{{dataList[0].productBasic?dataList[0].productBasic.name:''}}({{dataList[0].productBasic?dataList[0].productBasic.productSn :''}})</view>
        <view>条码:{{dataList[0].code}}</view>
      </view>
    </view>
    
    <view class="cardList" wx:if="{{dataList && dataList.length>0}}">
      <view class="card-i" wx:for="{{dataList}}" wx:key="index">
        <view class="card-i-l">
          <view>
            <icon type="waiting" color="#2979ff" size="18" style="margin-right: 4px"></icon>
            {{item.updateTime}}
          </view>
          <view wx:if="{{item.user}}">
            <text wx:if="{{item.user.department}}">{{item.user.department?item.user.department.name:''}} 的 </text>
            <text style="font-weight: bold;margin-right: 6rpx;color:#2979ff">{{item.user.name}}</text>
              进行了
            <span style="margin-left: 6rpx;" class="{{item.num>=0?'green':'red'}}">
              {{item.state==0?'入库':item.state==1?'取用':item.state==2?'归还':item.state==3?'标签作废':item.state==4?'用尽登记':item.state==5?'销售':item.state==6?'零头入库':'--'}}
            </span>
          </view>
        </view>
        <view wx:if="{{item.hazmatBasic}}" class="card-i-r {{item.num>=0?'green':'red'}}">
          <text wx:if="{{item.num > 0}}">+</text>{{item.num}}{{item.hazmatBasic.unit}}
        </view>
        <view wx:if="{{item.productBasic}}" class="card-i-r {{item.num>=0?'green':'red'}}">
          <text wx:if="{{item.num > 0}}">+</text>{{item.num}}{{item.productBasic.unit}}
        </view>
      </view>
    </view>
    
    <view wx:else style="margin-top: 200rpx">
      <empty mode="list" text="通过条码搜索记录"></empty>
    </view>
  </view>
  
  <tab-bar currentPagePath="{{page}}"></tab-bar>
</view>