goodsOutbound.wxml 13.9 KB
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="page goods-outbound">
  <view class="status-wrap">
    <view class="status-item" wx:for="{{ statusList }}" wx:key="index">
      <view class="info {{ item.active && item.type==1 ? 'active' : '' }}">
        <view class="circle-box">
          <view class="circle">
            <image wx:if="{{item.active}}" class="status-img" src="{{IMG_URL}}equity/review_icon.png" mode="aspectFit"></image>
            <image wx:if="{{item.type==2}}" class="status-img" src="{{IMG_URL}}equity/review_success_icon.png" mode="aspectFit"></image>
            <view wx:if="{{!item.active && item.type < 2}}" class="circle_text">{{index + 1}}</view>
          </view>
        </view>
        <view class="name" style="color: {{item.active || item.type > 1 ? '#292D33' : '#999EA8'}}">{{item.name}}</view>
      </view>
      <view class="line {{item.type == 2 ? 'line_color' : ''}}" wx:if="{{index!=statusList.length-1}}"></view>
    </view>
  </view>

  <view class="content">
    <block wx:if="{{ currentStep === 0 }}">
      <view class="card goods-card">
        <view class="card-title">商品信息</view>
        <view class="goods-item">
          <view class="goods-item__top">
            <view class="bullet"></view>
            <view class="goods-title text-hide">{{ goodsInfo.upgradeGoodsAlias || goodsInfo.goodsName || goodsInfo.upgradeGoodsName || goodsInfo.packageName || '-' }}</view>
            <view class="goods-multi">x{{ goodsInfo.number || '-' }}</view>
          </view>
          <view class="goods-item__desc text-hide">
            库存{{ goodsInfo.stock !== undefined && goodsInfo.stock !== null && goodsInfo.stock !== '' ? (goodsInfo.stock + '米/件') : '-' }}
          </view>
        </view>
        <view class="box">
          <view class="box-item">
            <view class="label">UID</view>
            <view class="value">{{ goodsInfo.upgradeGoodsCommodityCode || '-' }}</view>
            <view class="copy" wx:if="{{ goodsInfo.upgradeGoodsCommodityCode }}" bindtap="setCopyData" data-content="{{ goodsInfo.upgradeGoodsCommodityCode }}">
              <image src="{{ IMG_URL }}equity/copy.png" class="copy-icon" mode="aspectFit"></image>
            </view>
          </view>
          <view class="box-item">
            <view class="label">产品编码</view>
            <view class="value">{{ goodsInfo.upgradeGoodsCustomCode || '-' }}</view>
            <view class="copy" wx:if="{{ goodsInfo.upgradeGoodsCustomCode }}" bindtap="setCopyData" data-content="{{ goodsInfo.upgradeGoodsCustomCode }}">
              <image src="{{ IMG_URL }}equity/copy.png" class="copy-icon" mode="aspectFit"></image>
            </view>
          </view>
          <view class="box-item">
            <view class="label">规格</view>
            <view class="value">{{ goodsInfo.specification || '-' }}</view>
			<view class="copy" wx:if="{{ goodsInfo.specification }}" bindtap="setCopyData" data-content="{{ goodsInfo.specification }}">
              <image src="{{ IMG_URL }}equity/copy.png" class="copy-icon" mode="aspectFit"></image>
            </view>
          </view>
        </view>
      </view>

      <view class="card method-card">
        <view class="method-shell">
          <view class="method-tabbar" wx:if="{{ showMethodTabs }}">
            <view class="method-tabs {{ currentMethod === 'scan' ? 'is-left-active' : 'is-right-active' }}">
              <view class="tab {{ currentMethod === 'scan' ? 'active is-left' : '' }}" bindtap="switchMethod" data-method="scan">
                <text class="tab-text">扫码出库</text>
              </view>
              <view class="tab {{ currentMethod === 'manual' ? 'active is-right' : '' }}" bindtap="switchMethod" data-method="manual">
                <text class="tab-text">手动输入</text>
              </view>
            </view>
          </view>

          <view class="method-panel {{ showMethodTabs ? 'has-tabbar' : '' }}" style="border-radius: {{currentMethod == 'scan' ? '0 24rpx 24rpx 24rpx' : '24rpx 0 24rpx 24rpx'}};">
            <block wx:if="{{ currentMethod === 'scan' }}">
              <view class="scan-area">
                <block wx:if="{{ scanList && scanList.length }}">
                  <view class="scan-list">
                    <block wx:for="{{ scanList }}" wx:key="uniqueCode">
                      <view class="scan-item">
                        <view class="scan-row">
                          <view class="scan-label">ID</view>
                          <view class="scan-value text-hide">{{ item.uniqueCode || '-' }}</view>
                          <view class="scan-copy" wx:if="{{ item.uniqueCode }}" bindtap="setCopyData" data-content="{{ item.uniqueCode }}">
                            <image src="{{ IMG_URL }}equity/copy.png" class="icon" mode="aspectFit"></image>
                          </view>
                        </view>
                        <view class="scan-row">
                          <view class="scan-label">标签库存</view>
                          <view class="scan-value">{{ item.stock != null ? item.stock : '-' }}</view>
                        </view>
                      </view>
                    </block>
                  </view>
                  <view class="scan-action" catchtap="onScan">扫一扫</view>
                </block>
                <block wx:else>
                  <view class="scan-circle">
                    <view class="circle-inner" catch:tap="onScan">
                      <image src="{{ IMG_URL }}scan-icon.png" mode="aspectFit" />
                    </view>
                  </view>
                  <view class="scan-tip">手机扫描产品标签,并输入出库数据进行出库</view>
                  <view class="scan-action" catchtap="onScan">扫一扫</view>
                </block>
              </view>
            </block>

            <block wx:else>
              <view class="inner-section">
                <view class="inner-title">出库信息</view>
                <view class="outbound-card inner-outbound">
                  <view class="field">
                    <view class="field-label">
                      <text class="required">*</text>
                      本次出库数量
                    </view>
                    <view class="field-control {{ !formEditable ? 'disabled' : '' }}">
                      <input class="field-input" value="{{ outboundNum }}" placeholder="输入数字" disabled="{{ !formEditable }}" bindinput="onOutboundNumInput" />
                      <view class="field-unit">米/件</view>
                    </view>
                    <view class="field-error" wx:if="{{ outboundNumError }}">{{ outboundNumError }}</view>
                  </view>

                  <view class="field">
                    <view class="field-label">
                      <text class="required">*</text>
                      出库备注
                    </view>
                    <view class="field-textarea-wrap {{ !formEditable ? 'disabled' : '' }}">
                      <textarea class="field-textarea" value="{{ remark }}" placeholder="请输入(200字以内)" maxlength="200" disabled="{{ !formEditable }}" bindinput="onOutboundRemarkInput"></textarea>
                    </view>
                  </view>

                  <view class="field">
                    <view class="field-label">
                      <text class="required">*</text>
                      出库时间
                    </view>
                    <view class="field-control {{ !formEditable ? 'disabled' : '' }}" bindtap="openOutboundTimePicker">
                      <view class="field-date {{ outBoundTime ? '' : 'placeholder' }}">{{ outBoundTime || '选择日期' }}</view>
                      <image class="field-date-icon" src="{{ IMG_URL }}date-time-select-icon.png" mode="aspectFit"></image>
                    </view>
                  </view>
                </view>
              </view>
            </block>
          </view>
        </view>
      </view>

      <view class="card outbound-card" wx:if="{{ currentMethod === 'scan' }}">
        <view class="card-title">出库信息</view>

        <view class="field">
          <view class="field-label">
            <text class="required">*</text>
            本次出库数量
          </view>
          <view class="field-control {{ !formEditable ? 'disabled' : '' }}">
            <input class="field-input" value="{{ outboundNum }}" placeholder="输入数字" disabled="{{ !formEditable }}" bindinput="onOutboundNumInput" />
            <view class="field-unit">米/件</view>
          </view>
          <view class="field-error" wx:if="{{ outboundNumError }}">{{ outboundNumError }}</view>
        </view>

        <view class="field">
          <view class="field-label">
            <text class="required">*</text>
            出库备注
          </view>
          <view class="field-textarea-wrap {{ !formEditable ? 'disabled' : '' }}">
            <textarea class="field-textarea" value="{{ remark }}" placeholder="请输入(200字以内)" maxlength="200" disabled="{{ !formEditable }}" bindinput="onOutboundRemarkInput"></textarea>
          </view>
        </view>
      </view>
    </block>

    <block wx:elif="{{ currentStep === 1 }}">
      <view class="card goods-card">
        <view class="card-title">商品信息</view>
        <view class="goods-item">
          <view class="goods-item__top">
            <view class="bullet"></view>
            <view class="goods-title text-hide">{{ goodsInfo.upgradeGoodsAlias || goodsInfo.goodsName || goodsInfo.upgradeGoodsName || goodsInfo.packageName || '-' }}</view>
            <view class="goods-multi">x{{ goodsInfo.number || '-' }}</view>
          </view>
          <view class="goods-item__desc text-hide">
            库存{{ goodsInfo.stock !== undefined && goodsInfo.stock !== null && goodsInfo.stock !== '' ? (goodsInfo.stock + '米/件') : '-' }}
          </view>
        </view>
      </view>

      <view class="card">
        <view class="card-title">出库信息</view>
        <view class="info-list">
          <view class="info-row">
            <view class="label">本次出库数量</view>
            <view class="value">{{ goodsInfo.materialsUsed }}米/件</view>
          </view>
          <view class="info-row">
            <view class="label">出库备注</view>
            <view class="value text-hide">{{ goodsInfo.outboundRemark || '-' }}</view>
          </view>
          <view class="info-row">
            <view class="label">出库时间</view>
            <view class="value">{{ goodsInfo.outboundTimeStr }}</view>
          </view>
        </view>
      </view>

      <view class="card construction-card">
        <view class="card-title">施工信息</view>
        <view class="field">
          <view class="field-label">
            开始施工时间
            <text class="required">*</text>
          </view>
          <view class="field-control" bindtap="openStartTimePicker">
            <view class="field-date {{ startConstructionTime ? '' : 'placeholder' }}">{{ startConstructionTime || '选择日期' }}</view>
            <image class="field-date-icon" src="{{ IMG_URL }}date-time-select-icon.png" mode="aspectFit"></image>
          </view>
        </view>
        <view class="field">
          <view class="field-label">
            结束施工时间
          </view>
          <view class="field-control" bindtap="openEndTimePicker">
            <view class="field-date {{ endConstructionTime ? '' : 'placeholder' }}">{{ endConstructionTime || '选择日期' }}</view>
            <image class="field-date-icon" src="{{ IMG_URL }}date-time-select-icon.png" mode="aspectFit"></image>
          </view>
        </view>
      </view>

      <view class="card">
        <view class="card-title">施工图片 <text class="sub">至少1张,最多9张</text></view>
        <view class="image-box">
          <block wx:for="{{ pictureList }}" wx:key="index">
            <view class="img-item">
              <view class="img-wrap" catchtap="onPreviewImg" data-index="{{ index }}">
                <image class="img" src="{{ item }}" mode="aspectFill" />
                <image class="del" catchtap="onDeleteImg" data-index="{{ index }}" src="{{ IMG_URL }}zy_paf_del_icon.png" mode="aspectFit" />
              </view>
            </view>
          </block>
          <view class="img-item add" wx:if="{{ pictureList.length < 9 }}" bindtap="onUploadImg">
            <view class="plus">+</view>
            <view class="count">({{ pictureList.length }}/9)</view>
          </view>
        </view>
      </view>
    </block>
  </view>

  <view class="bottom-bar">
    <block wx:if="{{ currentStep === 0 }}">
      <view class="btn ghost" catchtap="onCancel">取消</view>
      <view class="btn primary {{ permissionsLoaded && !canOutboundGoods ? 'disabled' : '' }}" catchtap="onConfirmOutbound">确认出库</view>
    </block>
    <block wx:elif="{{ currentStep === 1 }}">
      <view class="btn ghost" catchtap="onPrevStep">上一步</view>
      <view class="btn primary {{ permissionsLoaded && !canSubmitConstruction ? 'disabled' : '' }}" catchtap="onSubmitPictures">提交施工图</view>
    </block>
    <block wx:else>
      <view class="btn primary" catchtap="onDone">完成</view>
    </block>
  </view>
  <time-select show="{{ outBoundTimeVisible }}" title="出库时间" defaultTime="{{ outBoundTime }}" isStartTime="{{ true }}" bind:confirm="onOutboundTimeConfirm" bindcancel="onClosePicker" />
  <time-select show="{{ startTimeVisible }}" title="开始施工时间" defaultTime="{{ startConstructionTime }}" isStartTime="{{ true }}" endTime="{{ endConstructionTime }}" bind:confirm="onStartTimeConfirm" bindcancel="onClosePicker" />
  <time-select show="{{ endTimeVisible }}" title="结束施工时间" defaultTime="{{ endConstructionTime || endConstructionTimePickerDefault }}" isStartTime="{{ false }}" startTime="{{ startConstructionTime }}" bind:confirm="onEndTimeConfirm" bindcancel="onClosePicker" />
</view>