JhHardwareWRS/pages/manageEquipment/manageEquipment.wxml
2026-06-24 15:19:14 +08:00

94 lines
3.9 KiB
Plaintext

<scroll-view
class="page safe-bottom"
scroll-y
type="list"
refresher-enabled
refresher-triggered="{{refreshing}}"
bindrefresherrefresh="onPullDownRefresh"
>
<view class="header">
<text class="title">设备管理</text>
<text class="subtitle">维护员工报工可选择的设备号和设备类型</text>
</view>
<view class="card">
<button class="btn primary full add-btn" bindtap="openCreate">新增设备</button>
</view>
<view class="equipment-filter-card">
<input class="input search" placeholder="搜索考勤点、设备号、类型、备注" value="{{keyword}}" bindinput="onKeywordInput" />
<picker
range="{{filterAttendancePointLabels}}"
value="{{filterAttendancePointIndex}}"
bindchange="onFilterAttendancePointChange"
>
<view class="picker filter-picker">{{filterAttendancePointLabels[filterAttendancePointIndex] || '全部考勤点'}}</view>
</picker>
</view>
<view wx:if="{{!rows.length}}" class="list-empty">暂无设备</view>
<view wx:for="{{rows}}" wx:key="uniqueKey" wx:for-index="index" class="card equipment-card">
<view class="row">
<view class="row-left">
<text class="value">{{item.deviceNo}}</text>
<text class="subtitle">考勤点 {{item.attendancePointName || '-'}}</text>
<text class="subtitle">{{item.remark || '暂无备注'}}</text>
</view>
<text class="pill primary">{{item.deviceType || '冲压设备'}}</text>
</view>
<view class="button-row">
<button class="btn secondary full" data-index="{{index}}" bindtap="edit">编辑</button>
<button class="btn danger full" data-index="{{index}}" bindtap="remove">删除</button>
</view>
</view>
<view class="button-row pager-row" wx:if="{{rows.length}}">
<button class="btn secondary pager-nav" bindtap="prevPage" disabled="{{page <= 1}}">上一页</button>
<view class="page-jump-control">
<input class="page-jump-input" type="number" confirm-type="done" value="{{pageInput}}" bindinput="onPageInput" bindconfirm="jumpToPage" />
<text class="page-total-label">/ {{totalPages}}</text>
<text class="page-jump-action" bindtap="jumpToPage">跳</text>
</view>
<button class="btn secondary pager-nav" bindtap="nextPage" disabled="{{page >= totalPages}}">下一页</button>
</view>
</scroll-view>
<view wx:if="{{formVisible}}" class="modal-mask" catchtap="closeForm">
<view class="modal-panel" catchtap="noop">
<view class="modal-head">
<text class="modal-title">{{formTitle}}</text>
<button class="btn mini secondary modal-close" bindtap="clearForm">清空</button>
</view>
<view class="form-item">
<text class="label">考勤点</text>
<picker
wx:if="{{attendancePoints.length}}"
range="{{attendancePointLabels}}"
value="{{attendancePointIndex}}"
bindchange="onAttendancePointChange"
>
<view class="picker">{{form.attendancePointName || '请选择考勤点'}}</view>
</picker>
<view wx:else class="readonly">暂无可选考勤点</view>
</view>
<view class="form-item">
<text class="label">设备号</text>
<input class="input" value="{{form.deviceNo}}" data-field="deviceNo" bindinput="onInput" />
</view>
<view class="form-item">
<text class="label">设备类型</text>
<picker range="{{deviceTypeOptions}}" value="{{form.deviceType === '清洗设备' ? 1 : 0}}" bindchange="onDeviceTypeChange">
<view class="picker">{{form.deviceType || '冲压设备'}}</view>
</picker>
</view>
<view class="form-item">
<text class="label">备注</text>
<textarea class="textarea" value="{{form.remark}}" data-field="remark" bindinput="onInput"></textarea>
</view>
<view class="button-row">
<button class="btn secondary full" bindtap="closeForm">关闭</button>
<button class="btn primary full" bindtap="save">保存设备</button>
</view>
</view>
</view>