270 lines
10 KiB
Plaintext
270 lines
10 KiB
Plaintext
<scroll-view class="page safe-bottom" scroll-y type="list">
|
|
<view class="header">
|
|
<view class="report-title-row">
|
|
<view class="report-title-main">
|
|
<text class="title">下班报工</text>
|
|
<text class="subtitle">按模具和设备填写产量,提交后进入审核</text>
|
|
</view>
|
|
<view wx:if="{{remainingText}}" class="countdown-pill">
|
|
<text class="countdown-label">剩余</text>
|
|
<text class="countdown-value">{{remainingText}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<block wx:if="{{draft}}">
|
|
<view class="card">
|
|
<view class="row">
|
|
<view>
|
|
<text class="label">上班打卡时间</text>
|
|
<text class="value">{{draft.startAtText}}</text>
|
|
</view>
|
|
<view class="text-right">
|
|
<text class="label">下班打卡时间</text>
|
|
<text class="value">{{draft.endAtText}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="divider"></view>
|
|
<view class="row">
|
|
<text class="muted">考勤点</text>
|
|
<text class="value">{{draft.attendancePointName || '-'}}</text>
|
|
</view>
|
|
<view class="divider"></view>
|
|
<view class="row">
|
|
<text class="muted">报工时长</text>
|
|
<text class="value">{{draft.durationMinutes}} 分钟</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view
|
|
wx:for="{{draft.deviceBlocks}}"
|
|
wx:key="blockKey"
|
|
wx:for-index="blockIndex"
|
|
wx:for-item="block"
|
|
class="card device-card"
|
|
>
|
|
<view class="row device-head">
|
|
<view>
|
|
<text class="label">模具名称</text>
|
|
<text class="value">{{block.moldDisplayName || block.moldName || block.deviceNo}}</text>
|
|
<text wx:if="{{block.attendancePointName}}" class="subtitle">考勤点 {{block.attendancePointName}}</text>
|
|
<text class="subtitle">累计工时 {{block.durationMinutes || 0}} 分钟</text>
|
|
</view>
|
|
<button
|
|
wx:if="{{block.canAddItem}}"
|
|
class="btn mini secondary add-product-btn"
|
|
data-block-index="{{blockIndex}}"
|
|
bindtap="addItem"
|
|
>
|
|
+
|
|
</button>
|
|
</view>
|
|
|
|
<view wx:if="{{!block.options.length}}" class="list-empty">该模具暂无产品</view>
|
|
|
|
<view
|
|
wx:for="{{block.items}}"
|
|
wx:key="index"
|
|
wx:for-index="itemIndex"
|
|
wx:for-item="reportItem"
|
|
class="item-box {{reportItem.isMultiPerson || reportItem.isContinuousDie ? 'multi-item-box' : ''}} {{reportItem.isMultiPerson && reportItem.isContinuousDie ? 'stacked-item-box' : ''}}"
|
|
>
|
|
<text wx:if="{{reportItem.isMultiPerson}}" class="multi-item-stamp">多人协作</text>
|
|
<text wx:if="{{reportItem.isContinuousDie}}" class="continuous-item-stamp {{reportItem.isMultiPerson ? 'lower-item-stamp' : ''}}">连续模</text>
|
|
<view class="row">
|
|
<text class="pill primary">报工 {{itemIndex + 1}}</text>
|
|
<button
|
|
wx:if="{{block.items.length > 1}}"
|
|
class="btn mini secondary"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
bindtap="removeItem"
|
|
>
|
|
删除
|
|
</button>
|
|
</view>
|
|
|
|
<view class="form-item">
|
|
<text class="label">开始工作时间</text>
|
|
<view class="readonly">{{reportItem.startAtText || '-'}}</view>
|
|
</view>
|
|
|
|
<view wx:if="{{reportItem.isMisc}}" class="misc-auto-box">
|
|
<text class="label">处理杂活</text>
|
|
<text class="value">系统自动生成该报工卡片,只记录本段工时,杂活事项由管理员审核时备注。</text>
|
|
<text class="subtitle">累计工时 {{block.durationMinutes || 0}} 分钟</text>
|
|
</view>
|
|
|
|
<view wx:if="{{!reportItem.isMisc}}" class="form-item">
|
|
<text class="label">设备号</text>
|
|
<picker
|
|
wx:if="{{block.equipmentOptions.length}}"
|
|
mode="selector"
|
|
range="{{block.equipmentOptions}}"
|
|
range-key="displayName"
|
|
value="{{reportItem.deviceIndex}}"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
bindchange="onDeviceChange"
|
|
>
|
|
<view class="picker {{reportItem.deviceError ? 'field-error' : ''}}">{{reportItem.deviceNo || '请选择设备号'}}</view>
|
|
</picker>
|
|
<view wx:else class="readonly {{reportItem.deviceError ? 'field-error' : ''}}">暂无可选设备</view>
|
|
</view>
|
|
|
|
<view wx:if="{{!reportItem.isMisc}}" class="form-item">
|
|
<text class="label">材料库存批次号</text>
|
|
<picker
|
|
wx:if="{{reportItem.rawMaterialBatchOptions.length}}"
|
|
mode="selector"
|
|
range="{{reportItem.rawMaterialBatchOptions}}"
|
|
value="{{reportItem.rawMaterialBatchIndex}}"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
bindchange="onRawMaterialBatchChange"
|
|
>
|
|
<view class="picker {{reportItem.rawMaterialBatchError ? 'field-error' : ''}}">{{reportItem.rawMaterialBatchNo || '请选择材料库存批次号'}}</view>
|
|
</picker>
|
|
<view wx:else class="readonly">暂无可选材料库存批次号</view>
|
|
</view>
|
|
|
|
<view wx:if="{{reportItem.isContinuousDie}}" class="form-item">
|
|
<text class="label">换料次数</text>
|
|
<input
|
|
class="input number-input {{reportItem.changeoverCountError ? 'field-error' : ''}}"
|
|
type="number"
|
|
value="{{reportItem.changeoverCount}}"
|
|
placeholder="请输入换料次数"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
data-field="changeoverCount"
|
|
bindinput="onQtyInput"
|
|
/>
|
|
</view>
|
|
|
|
<view wx:if="{{!reportItem.isMisc}}" class="readonly-grid">
|
|
<view>
|
|
<text class="label">产品名称</text>
|
|
<text class="value">{{reportItem.productName || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">考勤点</text>
|
|
<text class="value">{{reportItem.attendancePointName || block.attendancePointName || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">项目号</text>
|
|
<text class="value">{{reportItem.projectNo || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">物料编码</text>
|
|
<text class="value">{{reportItem.materialCode || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">工序</text>
|
|
<text class="value">{{reportItem.process || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">冲压方式</text>
|
|
<text class="value">{{reportItem.stampingMethod || '-'}}</text>
|
|
</view>
|
|
<view>
|
|
<text class="label">标准节拍</text>
|
|
<text class="value">{{reportItem.standardBeat || 0}} 秒</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{!reportItem.isMisc}}" class="qty-grid">
|
|
<view class="form-item">
|
|
<text class="label">成品数量</text>
|
|
<input
|
|
class="input number-input"
|
|
type="number"
|
|
value="{{reportItem.goodQty}}"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
data-field="goodQty"
|
|
bindinput="onQtyInput"
|
|
/>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">不良数量</text>
|
|
<input
|
|
class="input number-input"
|
|
type="number"
|
|
value="{{reportItem.defectQty}}"
|
|
data-block-index="{{blockIndex}}"
|
|
data-item-index="{{itemIndex}}"
|
|
data-field="defectQty"
|
|
bindinput="onQtyInput"
|
|
/>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<button class="btn primary full submit-btn" disabled="{{continuing}}" bindtap="submit">提交报工</button>
|
|
<button
|
|
class="btn secondary full continue-work-btn"
|
|
disabled="{{submitting || continuing}}"
|
|
bindtap="continueWork"
|
|
>
|
|
{{continuing ? '处理中' : '继续上班'}}
|
|
</button>
|
|
</block>
|
|
</scroll-view>
|
|
|
|
<view wx:if="{{confirmVisible}}" class="confirm-mask" catchtap="cancelConfirm">
|
|
<view class="confirm-panel" catchtap="noop">
|
|
<text class="confirm-title">确认提交报工</text>
|
|
<view class="confirm-lines">
|
|
<view class="confirm-line">
|
|
<text class="confirm-label">模具</text>
|
|
<text class="confirm-value">{{confirmSummary.deviceText}}</text>
|
|
</view>
|
|
<view class="confirm-line">
|
|
<text class="confirm-label">成品数量</text>
|
|
<text class="confirm-value">{{confirmSummary.totalGood}}</text>
|
|
</view>
|
|
<view class="confirm-line">
|
|
<text class="confirm-label">不良数量</text>
|
|
<text class="confirm-value">{{confirmSummary.totalDefect}}</text>
|
|
</view>
|
|
<view class="confirm-line">
|
|
<text class="confirm-label">审核说明</text>
|
|
<text class="confirm-value">{{confirmSummary.note}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="confirm-actions">
|
|
<button class="btn secondary confirm-btn" bindtap="cancelConfirm">取消</button>
|
|
<button class="btn primary confirm-btn" disabled="{{submitting}}" bindtap="confirmSubmit">{{submitting ? '提交中' : '确定'}}</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{addStartVisible}}" class="confirm-mask" catchtap="cancelAddStart">
|
|
<view class="confirm-panel add-start-panel" catchtap="noop">
|
|
<text class="confirm-title">新增产品开始时间</text>
|
|
<view class="form-item">
|
|
<text class="label">开始日期</text>
|
|
<picker mode="date" value="{{addStartForm.date}}" bindchange="onAddStartDateChange">
|
|
<view class="picker">{{addStartForm.date}}</view>
|
|
</picker>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">开始时间</text>
|
|
<picker
|
|
mode="multiSelector"
|
|
range="{{timeOptions}}"
|
|
value="{{addStartForm.timeValue}}"
|
|
bindchange="onAddStartTimeChange"
|
|
>
|
|
<view class="picker">{{addStartForm.timeText}}</view>
|
|
</picker>
|
|
</view>
|
|
<view class="confirm-actions">
|
|
<button class="btn secondary confirm-btn" bindtap="cancelAddStart">取消</button>
|
|
<button class="btn primary confirm-btn" bindtap="confirmAddStart">确定新增</button>
|
|
</view>
|
|
</view>
|
|
</view>
|