<import-sjs from='../../../utils/index/utils.sjs' name='util'>
  <view class="page">
    <view class="main" onTap="clickAudio">
      <top-title urlPath='../../../' titleText="访客记录" />
      <!--<view class="tip"><image
          mode="scaleToFill"
          src="https://tx.hz-hanghui.com:8088/yx-fyzd/file/upload/imagesnew/static/settings/tip.png"
          class="tip-icon"
        />
        可以刷身份证签离</view> -->
      <view class="content">
        <view class="search-box flex1">
          <view class="flex">
            <view class="over1">
              <view class="search-item">
                <text>姓名：</text>
                <input
                  class="input m-r"
                  value="{{searchForm.data.name}}"
                  onInput="getVal"
                  data-key="name"
                  placeholder="姓名"
                  placeholder-class="time-placeholder"
                />
              </view>
              <view class="search-item">
                <text>身份证号：</text>
                <input
                  class="input m-r"
                  value="{{searchForm.data.idNumber}}"
                  onInput="getVal"
                  data-key="idNumber"
                  placeholder="身份证号"
                  placeholder-class="time-placeholder"
                />
              </view>
              <view class="search-item">
                <text>手机号：</text>
                <input
                  class="input m-r"
                  value="{{searchForm.data.phone}}"
                  onInput="getVal"
                  data-key="phone"
                  placeholder="手机号"
                  placeholder-class="time-placeholder"
                />
              </view>
              <view style="display: inline-block;">
                <picker
                  value="{{searchForm.data.isSignOut}}"
                  range="{{signOutList}}"
                  range-key="name"
                  onChange='getVal'
                  data-key="isSignOut"
                >
                  <view class="search-item flex">
                    <text>是否签离：</text>
                    <view class="{{searchForm.data.isSignOutName?'input m-r ':'input m-r time-placeholder'}}">
                      {{searchForm.data.isSignOutName?searchForm.data.isSignOutName:'是否签离'}}
                    </view>
                  </view>
                </picker>
              </view>
              <view class="search-item wid1 flex">
                <text>来访时间：</text>
                <view
                  class="{{searchForm.data.startTime?'input wid-time':'input wid-time time-placeholder'}}"
                  onTap="datePicker"
                  data-key="startTime"
                >
                  {{searchForm.data.startTime ? searchForm.data.startTime : '起始时间'}}
                </view>
                <view class="pad">
                  至
                </view>
                <view
                  class="{{searchForm.data.endTime?'input wid-time':'input wid-time time-placeholder'}}"
                  onTap="datePicker"
                  data-key="endTime"
                >
                  {{searchForm.data.endTime ? searchForm.data.endTime : '结束时间'}}
                </view>
              </view>
            </view>


            <view class="flex1">
              <view class="inquire  magnify" onTap="getTable">查询</view>
              <view class="clear  magnify" onTap="clearFun">清空</view>
            </view>
          </view>
          <image
            class="close"
            mode="scaleToFill"
            src="https://tx.hz-hanghui.com:8088/yx-fyzd/file/upload/imagesnew/static/settings/close.png"
            onTap="closeFun"
          />
        </view>

        <view class="table">
          <view class="flex3">
            <view class="table-tit">
              <view class="table-item one m-l-one">序号</view>
              <view class="table-item two">姓名</view>
              <view class="table-item three">身份证号</view>
              <view class="table-item four">手机号</view>
              <view class="table-item five">来访单位</view>
              <view class="table-item eight">受访人</view>
              <view class="table-item nine">受访部门</view>
              <view class="table-item ten">来访&签离时间</view>
              <view class="table-item twelve">来访&签离地点</view>
              <view class="table-item six">车牌</view>
              <view class="table-item seven">事由</view>
            </view>
            <view a:for="{{ tableList }}" class="table-content">
              <view class="table-item col one">
                {{(index+1+((searchForm.pageNum-1)*searchForm.pageSize))}}
              </view>
              <view class="table-item col two">
                {{util.desensitization(item.name,1,2,'VisitorLog',1,notDesensitizedColumn)}}
              </view>
              <view class="table-item col three">
                {{util.desensitization(item.idNumber,6,14,'VisitorLog',2,notDesensitizedColumn)}}
              </view>
              <view class="table-item col  four">
                {{util.desensitization(item.phone,3,7,'VisitorLog',3,notDesensitizedColumn)}}
              </view>
              <view class="table-item col five ">{{item.company}}</view>
              <view class="table-item col eight">{{item.visiteeXm}}</view>
              <view class="table-item col nine">{{item.visiteeBm}}</view>
              <view class="table-item col ten">
                <view a:if="{{ item.startTime }}">
                  来：{{item.startTime}}
                </view>
                <view a:if="{{ item.signOutTime }}">
                  离：{{item.signOutTime}}
                </view>
              </view>
              <view class="table-item col twelve">
                <view a:if="{{ item.machineId }}">
                  来：{{item.registerAddress}}【{{item.machineId}}】
                </view>
                <view a:if="{{ item.signOutSn }}">
                  离：{{item.signOutAddress}}【{{item.signOutSn}}】
                </view>
              </view>
              <view class="table-item col six">{{item.carno}}</view>
              <view class="table-item col seven">{{item.reason}}</view>
              <view
                a:if="{{ !item.isSignOut }}"
                class="eleven magnify"
                onTap="signOff"
                data-item="{{item}}"
                data-index="{{index}}"
              >
                签离
              </view>
            </view>
          </view>
          <tail-tip total='{{total}}' pageNum='{{pageNum}}'>
          </tail-tip>
        </view>
        <view a:if="{{ total>0 }}" class="bottom flex1">
          <view class="previous" onTap="previousFun">上一页</view>
          <view class="next" onTap="nextFun">下一页</view>
          <view class="total">共{{total}}条记录【 {{searchForm.pageNum}}/{{allPageNum}}】</view>
        </view>
      </view>
    </view>
  </view>
