|
|
|
|
@ -5,202 +5,107 @@
|
|
|
|
|
<!-- 操作按钮区 -->
|
|
|
|
|
<view class="action-row">
|
|
|
|
|
<view class="action-btn scan-btn" @click="handleScan">
|
|
|
|
|
<view class="btn-icon-wrap">
|
|
|
|
|
<text class="iconfont icon-scan btn-icon"></text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn-icon-wrap"><text class="iconfont icon-scan btn-icon"></text></view>
|
|
|
|
|
<text class="btn-text">扫备件码</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="action-btn select-btn" @click="handleSelectSparepart">
|
|
|
|
|
<view class="btn-icon-wrap">
|
|
|
|
|
<text class="iconfont icon-device btn-icon"></text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn-icon-wrap"><text class="iconfont icon-device btn-icon"></text></view>
|
|
|
|
|
<text class="btn-text">选择备件</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 已选备件 -->
|
|
|
|
|
<view v-if="selectedSparepart.id" class="sparepart-section">
|
|
|
|
|
<!-- 出库信息 -->
|
|
|
|
|
<view class="form-section">
|
|
|
|
|
<!-- 出库时间 -->
|
|
|
|
|
<view class="section-title-bar">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">已选备件</text>
|
|
|
|
|
<text class="section-title"><text class="required">*</text>出库时间</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="sparepart-card">
|
|
|
|
|
<view class="card-top">
|
|
|
|
|
<view class="card-image-wrap">
|
|
|
|
|
<image
|
|
|
|
|
v-if="sparepartImage"
|
|
|
|
|
:src="sparepartImage"
|
|
|
|
|
class="card-image"
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
/>
|
|
|
|
|
<view v-else class="card-image-empty">
|
|
|
|
|
<text class="empty-img-icon">📦</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="card-info-right">
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
<text class="info-label">备件名称:</text>
|
|
|
|
|
<text class="info-name">{{ textValue(selectedSparepart.name) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
<text class="info-label">规格:</text>
|
|
|
|
|
<text class="info-value">{{ textValue(selectedSparepart.standard || selectedSparepart.deviceSpec) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info-item">
|
|
|
|
|
<text class="info-label">当前库存:</text>
|
|
|
|
|
<text class="info-value stock-highlight">{{ textValue(selectedSparepart.stock) }}{{ textUnit(selectedSparepart.minStockUnitName) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<picker mode="date" :value="outboundDate" @change="handleDateChange">
|
|
|
|
|
<view class="form-row-card">
|
|
|
|
|
<text :class="{ placeholder: !outboundDate }">{{ outboundDate || '请选择出库时间' }}</text>
|
|
|
|
|
<text class="form-row-arrow">▼</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="card-bottom">
|
|
|
|
|
<view class="detail-row two-col">
|
|
|
|
|
<view class="detail-col">
|
|
|
|
|
<text class="detail-label">采购单位:</text>
|
|
|
|
|
<text class="detail-value">{{ textValue(selectedSparepart.purchaseUnitName) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="detail-col">
|
|
|
|
|
<text class="detail-label">库存单位:</text>
|
|
|
|
|
<text class="detail-value">{{ textValue(selectedSparepart.unitName || selectedSparepart.minStockUnitName) }}</text>
|
|
|
|
|
</picker>
|
|
|
|
|
|
|
|
|
|
<!-- 经办人 -->
|
|
|
|
|
<view class="section-title-bar" style="padding-top: 24rpx;">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title"><text class="required">*</text>经办人</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="form-row-card" @click="toggleOperatorDropdown">
|
|
|
|
|
<text :class="{ placeholder: !selectedOperator }">{{ selectedOperator ? selectedOperator.label : '请选择经办人' }}</text>
|
|
|
|
|
<text class="form-row-arrow">▼</text>
|
|
|
|
|
<view v-if="showOperatorDropdown" class="dropdown-panel">
|
|
|
|
|
<scroll-view scroll-y class="dropdown-scroll">
|
|
|
|
|
<view v-for="item in operatorOptions" :key="item.value" class="dropdown-item" :class="{ active: selectedOperator?.value === item.value }" @click.stop="handleSelectOperator(item)">
|
|
|
|
|
<text class="dropdown-item-text">{{ item.label }}</text>
|
|
|
|
|
<text v-if="selectedOperator?.value === item.value" class="dropdown-check">✓</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="detail-row">
|
|
|
|
|
<text class="detail-label">换算关系:</text>
|
|
|
|
|
<text class="detail-value">1{{ textValue(selectedSparepart.purchaseUnitName) }}={{ textValue(selectedSparepart.purchaseUnitConvertQuantity) }}{{ stockUnitLabel(selectedSparepart) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="!operatorOptions.length" class="dropdown-empty">暂无数据</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 出库用途 -->
|
|
|
|
|
<!-- 备注 -->
|
|
|
|
|
<view class="section-title-bar" style="padding-top: 24rpx;">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">出库用途</text>
|
|
|
|
|
<text class="section-title">备注</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="purpose-card">
|
|
|
|
|
<view
|
|
|
|
|
class="purpose-item"
|
|
|
|
|
:class="{ active: selectedPurpose === 'repair' }"
|
|
|
|
|
@click="setPurpose('repair')"
|
|
|
|
|
>
|
|
|
|
|
<text class="iconfont icon-repair purpose-icon"></text>
|
|
|
|
|
<text class="purpose-text">维修领用</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="purpose-item"
|
|
|
|
|
:class="{ active: selectedPurpose === 'maintain' }"
|
|
|
|
|
@click="setPurpose('maintain')"
|
|
|
|
|
>
|
|
|
|
|
<text class="iconfont icon-shield purpose-icon"></text>
|
|
|
|
|
<text class="purpose-text">保养领用</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="form-row-card remark-card">
|
|
|
|
|
<textarea v-model="remark" class="remark-textarea" placeholder="请输入备注信息" placeholder-class="remark-placeholder" :maxlength="500" auto-height />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 关联信息(维修领用/保养领用) -->
|
|
|
|
|
<view v-if="selectedPurpose === 'repair' || selectedPurpose === 'maintain'" class="section-title-bar" style="padding-top: 24rpx;">
|
|
|
|
|
<!-- 附件 -->
|
|
|
|
|
<view class="section-title-bar" style="padding-top: 24rpx;">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">关联信息</text>
|
|
|
|
|
<text class="section-title">附件</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="selectedPurpose === 'repair' || selectedPurpose === 'maintain'" class="select-row-card warehouse-area-card">
|
|
|
|
|
<view class="warehouse-area-rows">
|
|
|
|
|
<view class="warehouse-area-row">
|
|
|
|
|
<text class="warehouse-area-label">关联设备</text>
|
|
|
|
|
<view class="warehouse-area-dropdown" @click="toggleDeviceDropdown">
|
|
|
|
|
<view class="dropdown-input">
|
|
|
|
|
<text :class="['dropdown-value', { placeholder: !selectedDevice }]">{{ selectedDevice ? selectedDevice.label : '请选择' }}</text>
|
|
|
|
|
<text class="dropdown-arrow">▼</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="showDeviceDropdown" class="dropdown-panel">
|
|
|
|
|
<scroll-view scroll-y class="dropdown-scroll">
|
|
|
|
|
<view v-for="item in deviceOptions" :key="item.value" class="dropdown-item" :class="{ active: selectedDevice?.value === item.value }" @click.stop="handleSelectDevice(item)">
|
|
|
|
|
<text class="dropdown-item-text">{{ item.label }}</text>
|
|
|
|
|
<text v-if="selectedDevice?.value === item.value" class="dropdown-check">✓</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="!deviceOptions.length" class="dropdown-empty">暂无设备数据</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="attachment-area">
|
|
|
|
|
<view class="attachment-list">
|
|
|
|
|
<view v-for="(file, idx) in attachmentList" :key="idx" class="attachment-file-item">
|
|
|
|
|
<view class="file-icon"><text class="file-icon-text">{{ getFileIcon(file.name) }}</text></view>
|
|
|
|
|
<view class="file-info">
|
|
|
|
|
<text class="file-name">{{ file.name }}</text>
|
|
|
|
|
<text class="file-size">{{ formatFileSize(file.size) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="file-delete" @click="removeAttachment(idx)"><text class="delete-icon-sm">✕</text></view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="warehouse-area-row">
|
|
|
|
|
<text class="warehouse-area-label">{{ selectedPurpose === 'repair' ? '维修单号' : '保养单号' }}</text>
|
|
|
|
|
<view class="warehouse-area-dropdown" @click="toggleOrderDropdown">
|
|
|
|
|
<view class="dropdown-input">
|
|
|
|
|
<text :class="['dropdown-value', { placeholder: !currentOrder }]">{{ currentOrder ? currentOrder.label : '请选择' }}</text>
|
|
|
|
|
<text class="dropdown-arrow">▼</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="showOrderDropdown" class="dropdown-panel">
|
|
|
|
|
<scroll-view scroll-y class="dropdown-scroll">
|
|
|
|
|
<view v-for="item in currentOrderOptions" :key="item.value" class="dropdown-item" :class="{ active: currentOrder?.value === item.value }" @click.stop="handleSelectOrder(item)">
|
|
|
|
|
<text class="dropdown-item-text">{{ item.label }}</text>
|
|
|
|
|
<text v-if="currentOrder?.value === item.value" class="dropdown-check">✓</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="!currentOrderOptions.length" class="dropdown-empty">{{ selectedPurpose === 'repair' ? '暂无维修单' : '暂无保养单' }}</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="attachment-add-file" @click="handleAddAttachment">
|
|
|
|
|
<text class="add-text">选取文件</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 出库数量 -->
|
|
|
|
|
<view class="qty-section">
|
|
|
|
|
<view class="section-title-bar">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">出库数量</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="qty-input-card">
|
|
|
|
|
<view class="form-field">
|
|
|
|
|
<text class="form-label">出库数量</text>
|
|
|
|
|
<input
|
|
|
|
|
v-model="outboundQty"
|
|
|
|
|
class="form-input"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
confirm-type="done"
|
|
|
|
|
/>
|
|
|
|
|
<text class="form-suffix-text">单位:{{ textValue(selectedSparepart.purchaseUnitName) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="convert-row">
|
|
|
|
|
<text class="convert-label-inline">折算后库存数量:</text>
|
|
|
|
|
<text class="convert-value-inline">{{ calculatedStock }}</text>
|
|
|
|
|
<text class="convert-unit-inline">{{ stockUnitLabel(selectedSparepart) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="convert-formula-inline">
|
|
|
|
|
{{ outboundQty || 0 }}{{ textValue(selectedSparepart.purchaseUnitName) }} × {{ textValue(selectedSparepart.purchaseUnitConvertQuantity) }}{{ stockUnitLabel(selectedSparepart) }} = {{ calculatedStock }}{{ stockUnitLabel(selectedSparepart) }}
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 经办人 -->
|
|
|
|
|
<view class="section-title-bar" style="padding-top: 24rpx;">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">经办人</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="select-row-card" @click="toggleOperatorDropdown">
|
|
|
|
|
<view class="full-dropdown">
|
|
|
|
|
<text :class="{ placeholder: !selectedOperator }">
|
|
|
|
|
{{ selectedOperator ? selectedOperator.label : '请选择经办人' }}
|
|
|
|
|
</text>
|
|
|
|
|
<text class="dropdown-arrow">▼</text>
|
|
|
|
|
<!-- 出库清单 -->
|
|
|
|
|
<view class="sparepart-section">
|
|
|
|
|
<view class="section-title-bar">
|
|
|
|
|
<view class="section-bar-line"></view>
|
|
|
|
|
<text class="section-title">出库清单({{ itemList.length }})</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="itemList.length" class="item-list">
|
|
|
|
|
<view v-for="(item, idx) in itemList" :key="idx" class="item-card">
|
|
|
|
|
<view class="item-delete-top" @click="removeItem(idx)"><text class="delete-icon">✕</text></view>
|
|
|
|
|
<view class="item-left">
|
|
|
|
|
<view class="item-image-wrap">
|
|
|
|
|
<image v-if="item._sparepart && getItemImage(item._sparepart)" :src="getItemImage(item._sparepart)" class="item-image" mode="aspectFill" />
|
|
|
|
|
<text v-else class="item-image-empty">📦</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="item-info">
|
|
|
|
|
<text class="item-name">{{ item.productName }}</text>
|
|
|
|
|
<text class="item-spec">{{ item.productBarCode || '-' }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="showOperatorDropdown" class="dropdown-panel">
|
|
|
|
|
<scroll-view scroll-y class="dropdown-scroll">
|
|
|
|
|
<view
|
|
|
|
|
v-for="item in operatorOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
class="dropdown-item"
|
|
|
|
|
:class="{ active: selectedOperator?.value === item.value }"
|
|
|
|
|
@click.stop="handleSelectOperator(item)"
|
|
|
|
|
>
|
|
|
|
|
<text class="dropdown-item-text">{{ item.label }}</text>
|
|
|
|
|
<text v-if="selectedOperator?.value === item.value" class="dropdown-check">✓</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="!operatorOptions.length" class="dropdown-empty">暂无数据</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
<view class="item-right">
|
|
|
|
|
<view class="item-qty-row">
|
|
|
|
|
<text class="item-qty-label">出库数量</text>
|
|
|
|
|
<text class="item-qty-value">{{ item.inputCount }}{{ item.purchaseUnitName }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 空状态 -->
|
|
|
|
|
<view v-else class="empty-wrap">
|
|
|
|
|
<text class="empty-text">请扫码或选择备件</text>
|
|
|
|
|
<view v-else class="empty-wrap"><text class="empty-text">请扫码或选择备件</text></view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 底部操作栏 -->
|
|
|
|
|
@ -212,500 +117,197 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, computed } from 'vue'
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import { onShow, onHide } from '@dcloudio/uni-app'
|
|
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
|
import NavBar from '@/components/common/NavBar.vue'
|
|
|
|
|
import { getSimpleUserList } from '@/api/mes/moldget'
|
|
|
|
|
import { getDeviceLedgerList } from '@/api/mes/moldoperate'
|
|
|
|
|
import { getEquipmentRepairListByDeviceId, getEquipmentMaintenanceByDeviceId } from '@/api/mes/equipment'
|
|
|
|
|
import { getDvRepairPage } from '@/api/mes/dvrepair'
|
|
|
|
|
import { createSparepartOutbound } from '@/api/mes/sparepartOutbound'
|
|
|
|
|
import { getSparepartDetail } from '@/api/mes/sparepart'
|
|
|
|
|
import { getSimpleUserList } from '@/api/mes/moldget'
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
|
|
const selectedSparepart = ref({})
|
|
|
|
|
const outboundQty = ref(null)
|
|
|
|
|
const selectedPurpose = ref('repair')
|
|
|
|
|
|
|
|
|
|
function setPurpose(value) {
|
|
|
|
|
selectedPurpose.value = value
|
|
|
|
|
// 切换用途时清空关联信息
|
|
|
|
|
selectedDevice.value = null
|
|
|
|
|
selectedRepairOrder.value = null
|
|
|
|
|
selectedMaintainOrder.value = null
|
|
|
|
|
repairOrderOptions.value = []
|
|
|
|
|
maintainOrderOptions.value = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 关联信息 - 设备下拉
|
|
|
|
|
const deviceOptions = ref([])
|
|
|
|
|
const selectedDevice = ref(null)
|
|
|
|
|
const showDeviceDropdown = ref(false)
|
|
|
|
|
|
|
|
|
|
// 维修单下拉
|
|
|
|
|
const repairOrderOptions = ref([])
|
|
|
|
|
const selectedRepairOrder = ref(null)
|
|
|
|
|
|
|
|
|
|
// 保养单下拉
|
|
|
|
|
const maintainOrderOptions = ref([])
|
|
|
|
|
const selectedMaintainOrder = ref(null)
|
|
|
|
|
|
|
|
|
|
// 通用的订单下拉显示状态(根据当前用途自动切换)
|
|
|
|
|
const showOrderDropdown = ref(false)
|
|
|
|
|
const currentOrder = computed(() =>
|
|
|
|
|
selectedPurpose.value === 'repair' ? selectedRepairOrder.value : selectedMaintainOrder.value
|
|
|
|
|
)
|
|
|
|
|
const currentOrderOptions = computed(() =>
|
|
|
|
|
selectedPurpose.value === 'repair' ? repairOrderOptions.value : maintainOrderOptions.value
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 经办人下拉
|
|
|
|
|
const operatorOptions = ref([])
|
|
|
|
|
const itemList = ref([])
|
|
|
|
|
const outboundDate = ref(formatDate(new Date()))
|
|
|
|
|
const selectedOperator = ref(null)
|
|
|
|
|
const operatorOptions = ref([])
|
|
|
|
|
const showOperatorDropdown = ref(false)
|
|
|
|
|
const remark = ref('')
|
|
|
|
|
const attachmentList = ref([])
|
|
|
|
|
|
|
|
|
|
// 备件图片(后端返回 images 字段,逗号分隔多图 URL,取第一张)
|
|
|
|
|
const sparepartImage = computed(() => {
|
|
|
|
|
const images = selectedSparepart.value.images
|
|
|
|
|
if (!images) return ''
|
|
|
|
|
if (Array.isArray(images)) return String(images[0] || '')
|
|
|
|
|
return String(images).split(',')[0]?.trim() || ''
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 折算后库存数量
|
|
|
|
|
const calculatedStock = computed(() => {
|
|
|
|
|
const qty = Number(outboundQty.value) || 0
|
|
|
|
|
const ratio = Number(selectedSparepart.value.purchaseUnitConvertQuantity) || 0
|
|
|
|
|
return qty * ratio
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function textValue(v) {
|
|
|
|
|
if (v === 0) return '0'
|
|
|
|
|
if (v == null) return '-'
|
|
|
|
|
const s = String(v).trim()
|
|
|
|
|
return s || '-'
|
|
|
|
|
}
|
|
|
|
|
function formatDate(date) { const y = date.getFullYear(); const m = String(date.getMonth() + 1).padStart(2, '0'); const d = String(date.getDate()).padStart(2, '0'); return `${y}-${m}-${d}` }
|
|
|
|
|
function handleDateChange(e) { outboundDate.value = e.detail.value }
|
|
|
|
|
function getItemImage(sparepart) { if (!sparepart.images) return ''; if (Array.isArray(sparepart.images)) return String(sparepart.images[0] || ''); return String(sparepart.images).split(',')[0]?.trim() || '' }
|
|
|
|
|
|
|
|
|
|
function textUnit(v) {
|
|
|
|
|
if (v === 0) return '0'
|
|
|
|
|
if (v == null) return ''
|
|
|
|
|
return String(v).trim()
|
|
|
|
|
}
|
|
|
|
|
function handleCancel() { getApp().globalData._sparepartOutboundItems = []; uni.navigateBack() }
|
|
|
|
|
|
|
|
|
|
function stockUnitLabel(item) {
|
|
|
|
|
return item.unitName || item.minStockUnitName || '个'
|
|
|
|
|
function handleSelectSparepart() {
|
|
|
|
|
getApp().globalData._sparepartSelectFrom = 'outbound'
|
|
|
|
|
uni.navigateTo({ url: '/pages_function/pages/sparepartInbound/sparepartSelect' })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleScan() {
|
|
|
|
|
uni.scanCode({
|
|
|
|
|
onlyFromCamera: true,
|
|
|
|
|
scanType: ['barCode', 'qrCode'],
|
|
|
|
|
success: (res) => {
|
|
|
|
|
console.log('扫码结果:', res.result)
|
|
|
|
|
uni.showToast({ title: '扫码成功: ' + res.result, icon: 'none' })
|
|
|
|
|
onlyFromCamera: false, scanType: ['barCode', 'qrCode'],
|
|
|
|
|
success: async (res) => {
|
|
|
|
|
const code = (res.result || '').trim()
|
|
|
|
|
if (!code) return
|
|
|
|
|
let sparepartId = null
|
|
|
|
|
if (code.toUpperCase().startsWith('SPARE-')) sparepartId = code.replace(/SPARE-/i, '')
|
|
|
|
|
else { const idMatch = code.match(/(\d+)$/); if (idMatch) sparepartId = idMatch[1] }
|
|
|
|
|
if (!sparepartId) { uni.showToast({ title: '无法识别备件码', icon: 'none' }); return }
|
|
|
|
|
try {
|
|
|
|
|
const apiRes = await getSparepartDetail(sparepartId)
|
|
|
|
|
const detail = apiRes?.data || apiRes
|
|
|
|
|
if (detail && detail.id) {
|
|
|
|
|
getApp().globalData._sparepartFromScan = true
|
|
|
|
|
getApp().globalData._sparepartBeforeConfirm = detail
|
|
|
|
|
uni.navigateTo({ url: '/pages_function/pages/sparepartOutbound/sparepartConfirm' })
|
|
|
|
|
} else { uni.showToast({ title: '未找到备件: ' + sparepartId, icon: 'none' }) }
|
|
|
|
|
} catch (e) { console.error(e); uni.showToast({ title: '扫码失败', icon: 'none' }) }
|
|
|
|
|
},
|
|
|
|
|
fail: () => {
|
|
|
|
|
uni.showToast({ title: '扫码失败', icon: 'none' })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleCancel() {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleSelectSparepart() {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages_function/pages/sparepartInbound/sparepartSelect'
|
|
|
|
|
fail: () => { uni.showToast({ title: '扫码失败', icon: 'none' }) }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 设备下拉
|
|
|
|
|
function toggleDeviceDropdown() {
|
|
|
|
|
showDeviceDropdown.value = !showDeviceDropdown.value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleSelectDevice(item) {
|
|
|
|
|
selectedDevice.value = item
|
|
|
|
|
showDeviceDropdown.value = false
|
|
|
|
|
// 切换设备时清空之前的订单选择
|
|
|
|
|
selectedRepairOrder.value = null
|
|
|
|
|
selectedMaintainOrder.value = null
|
|
|
|
|
repairOrderOptions.value = []
|
|
|
|
|
maintainOrderOptions.value = []
|
|
|
|
|
// 根据当前用途加载对应订单
|
|
|
|
|
if (selectedPurpose.value === 'repair') {
|
|
|
|
|
loadRepairOrders(item.deviceCode)
|
|
|
|
|
} else {
|
|
|
|
|
loadMaintainOrders(item.deviceCode)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function loadDevices() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await getDeviceLedgerList({ pageNo: 1, pageSize: 100 })
|
|
|
|
|
const data = res && res.data !== undefined ? res.data : res
|
|
|
|
|
let list = []
|
|
|
|
|
if (Array.isArray(data)) { list = data }
|
|
|
|
|
else if (data && Array.isArray(data.data)) { list = data.data }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.list)) { list = data.data.list }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.rows)) { list = data.data.rows }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.records)) { list = data.data.records }
|
|
|
|
|
else if (data && Array.isArray(data.list)) { list = data.list }
|
|
|
|
|
else if (data && Array.isArray(data.rows)) { list = data.rows }
|
|
|
|
|
else if (data && Array.isArray(data.records)) { list = data.records }
|
|
|
|
|
deviceOptions.value = list.map((d) => ({
|
|
|
|
|
value: d.id,
|
|
|
|
|
label: d.name || d.deviceName || d.deviceCode || String(d.id || ''),
|
|
|
|
|
deviceCode: d.deviceCode || d.code || '', // 用于查询维修单
|
|
|
|
|
deviceName: d.name || d.deviceName || ''
|
|
|
|
|
}))
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadDevices error', e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 订单下拉(维修单/保养单)——根据当前用途自动切换
|
|
|
|
|
function toggleOrderDropdown() {
|
|
|
|
|
if (!selectedDevice.value) return
|
|
|
|
|
showOrderDropdown.value = !showOrderDropdown.value
|
|
|
|
|
}
|
|
|
|
|
function removeItem(idx) { itemList.value.splice(idx, 1); getApp().globalData._sparepartOutboundItems = [...itemList.value] }
|
|
|
|
|
|
|
|
|
|
function handleSelectOrder(item) {
|
|
|
|
|
if (selectedPurpose.value === 'repair') {
|
|
|
|
|
selectedRepairOrder.value = item
|
|
|
|
|
} else {
|
|
|
|
|
selectedMaintainOrder.value = item
|
|
|
|
|
}
|
|
|
|
|
showOrderDropdown.value = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 保养单列表(根据设备编码加载)
|
|
|
|
|
async function loadMaintainOrders(deviceCode) {
|
|
|
|
|
if (!deviceCode) {
|
|
|
|
|
const deviceId = selectedDevice.value?.value
|
|
|
|
|
if (deviceId) await loadMaintainOrdersById(deviceId)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
// 保养单用设备ID接口,暂不支持设备编码
|
|
|
|
|
const deviceId = selectedDevice.value?.value
|
|
|
|
|
if (deviceId) await loadMaintainOrdersById(deviceId)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadMaintainOrders error', e)
|
|
|
|
|
}
|
|
|
|
|
// 经办人
|
|
|
|
|
function toggleOperatorDropdown() { showOperatorDropdown.value = !showOperatorDropdown.value }
|
|
|
|
|
function handleSelectOperator(item) { selectedOperator.value = item; showOperatorDropdown.value = false }
|
|
|
|
|
async function loadOperators() {
|
|
|
|
|
try { const res = await getSimpleUserList(); const data = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : []); operatorOptions.value = data.map((u) => ({ value: u.id || u.userId, label: u.nickname || u.userName || u.name || String(u.id || '') })) } catch (e) { }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function loadMaintainOrdersById(deviceId) {
|
|
|
|
|
if (!deviceId) return
|
|
|
|
|
try {
|
|
|
|
|
const res = await getEquipmentMaintenanceByDeviceId(deviceId)
|
|
|
|
|
const data = res && res.data !== undefined ? res.data : res
|
|
|
|
|
let list = []
|
|
|
|
|
if (Array.isArray(data)) { list = data }
|
|
|
|
|
else if (data && Array.isArray(data.data)) { list = data.data }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.list)) { list = data.data.list }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.rows)) { list = data.data.rows }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.records)) { list = data.data.records }
|
|
|
|
|
else if (data && Array.isArray(data.list)) { list = data.list }
|
|
|
|
|
else if (data && Array.isArray(data.rows)) { list = data.rows }
|
|
|
|
|
else if (data && Array.isArray(data.records)) { list = data.records }
|
|
|
|
|
maintainOrderOptions.value = list.map((m) => ({
|
|
|
|
|
value: m.id,
|
|
|
|
|
label: m.maintenanceCode || m.code || m.maintenanceNo || m.no || String(m.id || '')
|
|
|
|
|
}))
|
|
|
|
|
console.log('保养单列表:', JSON.stringify(maintainOrderOptions.value))
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadMaintainOrdersById error', e)
|
|
|
|
|
}
|
|
|
|
|
// 附件
|
|
|
|
|
function getFileIcon(fileName) { const ext = (fileName || '').split('.').pop()?.toLowerCase(); const m = { pdf: '📄', doc: '📝', docx: '📝', xls: '📊', xlsx: '📊', ppt: '📽', pptx: '📽', txt: '📃', zip: '📦', rar: '📦', jpg: '🖼', jpeg: '🖼', png: '🖼', gif: '🖼' }; return m[ext] || '📎' }
|
|
|
|
|
function formatFileSize(bytes) { if (!bytes) return '0 B'; if (bytes < 1024) return bytes + ' B'; if (bytes < 1048576) return (bytes / 1024).toFixed(1) + ' KB'; return (bytes / 1048576).toFixed(1) + ' MB' }
|
|
|
|
|
function handleAddAttachment() {
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
plus.gallery.pick((res) => { const files = (res?.files || []).map(f => ({ name: f.name || 'unknown', size: f.size || 0, path: f })); attachmentList.value.push(...files) }, (e) => {}, { filter: 'all', multiple: true, maximum: 9 - attachmentList.value.length })
|
|
|
|
|
// #endif
|
|
|
|
|
// #ifndef APP-PLUS
|
|
|
|
|
uni.chooseImage({ count: 9 - attachmentList.value.length, sizeType: ['compressed'], sourceType: ['album', 'camera'], success: (res) => { res.tempFilePaths.forEach(path => { const parts = path.split('/'); const name = parts[parts.length - 1] || 'image.jpg'; attachmentList.value.push({ name, size: 0, path }) }) } })
|
|
|
|
|
// #endif
|
|
|
|
|
}
|
|
|
|
|
function removeAttachment(idx) { attachmentList.value.splice(idx, 1) }
|
|
|
|
|
|
|
|
|
|
// 维修单列表(用分页接口获取所有状态的维修单)
|
|
|
|
|
async function loadRepairOrders(deviceCode) {
|
|
|
|
|
if (!deviceCode) {
|
|
|
|
|
// 如果没有设备编码,尝试用设备ID调用旧接口
|
|
|
|
|
const deviceId = selectedDevice.value?.value
|
|
|
|
|
if (deviceId) await loadRepairOrdersById(deviceId)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
const res = await getDvRepairPage({ machineryCode: deviceCode, pageNo: 1, pageSize: 100 })
|
|
|
|
|
const root = res && res.data !== undefined ? res.data : res
|
|
|
|
|
let list = []
|
|
|
|
|
if (Array.isArray(root)) { list = root }
|
|
|
|
|
else if (root && Array.isArray(root.data)) { list = root.data }
|
|
|
|
|
else if (root && root.data && Array.isArray(root.data.list)) { list = root.data.list }
|
|
|
|
|
else if (root && root.data && Array.isArray(root.data.rows)) { list = root.data.rows }
|
|
|
|
|
else if (root && root.data && Array.isArray(root.data.records)) { list = root.data.records }
|
|
|
|
|
else if (root && Array.isArray(root.list)) { list = root.list }
|
|
|
|
|
else if (root && Array.isArray(root.rows)) { list = root.rows }
|
|
|
|
|
repairOrderOptions.value = list.map((r) => ({
|
|
|
|
|
value: r.id,
|
|
|
|
|
label: r.repairCode || r.repairName || r.subjectName || String(r.id || '')
|
|
|
|
|
}))
|
|
|
|
|
console.log('维修单列表(分页):', JSON.stringify(repairOrderOptions.value))
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadRepairOrdersByDeviceCode error', e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
async function handleSubmit() {
|
|
|
|
|
if (!itemList.value.length) { uni.showToast({ title: '请先添加备件', icon: 'none' }); return }
|
|
|
|
|
if (!outboundDate.value) { uni.showToast({ title: '请选择出库时间', icon: 'none' }); return }
|
|
|
|
|
if (!selectedOperator.value) { uni.showToast({ title: '请选择经办人', icon: 'none' }); return }
|
|
|
|
|
|
|
|
|
|
// 完全对齐 Web 端格式:13位毫秒时间戳 + stockUserId
|
|
|
|
|
const outTime = outboundDate.value ? new Date(outboundDate.value.replace(/-/g, '/')).getTime() : Date.now()
|
|
|
|
|
|
|
|
|
|
let totalCount = 0
|
|
|
|
|
const items = itemList.value.map(item => {
|
|
|
|
|
totalCount += Number(item.count) || 0
|
|
|
|
|
const it = {
|
|
|
|
|
warehouseId: item.warehouseId || null,
|
|
|
|
|
areaId: item.areaId || null,
|
|
|
|
|
productId: item.productId,
|
|
|
|
|
count: Number(item.count) || 0,
|
|
|
|
|
outUsageType: String(item.outUsageType || 3)
|
|
|
|
|
}
|
|
|
|
|
if (item.repairId) it.repairId = Number(item.repairId)
|
|
|
|
|
if (item.repairDeviceId) it.repairDeviceId = Number(item.repairDeviceId)
|
|
|
|
|
if (item.maintenanceId) it.maintenanceId = Number(item.maintenanceId)
|
|
|
|
|
return it
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 兜底:用设备ID查(如果设备编码不存在)
|
|
|
|
|
async function loadRepairOrdersById(deviceId) {
|
|
|
|
|
if (!deviceId) return
|
|
|
|
|
try {
|
|
|
|
|
const res = await getEquipmentRepairListByDeviceId(deviceId)
|
|
|
|
|
const data = res && res.data !== undefined ? res.data : res
|
|
|
|
|
let list = []
|
|
|
|
|
if (Array.isArray(data)) { list = data }
|
|
|
|
|
else if (data && Array.isArray(data.data)) { list = data.data }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.list)) { list = data.data.list }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.rows)) { list = data.data.rows }
|
|
|
|
|
else if (data && data.data && Array.isArray(data.data.records)) { list = data.data.records }
|
|
|
|
|
else if (data && Array.isArray(data.list)) { list = data.list }
|
|
|
|
|
else if (data && Array.isArray(data.rows)) { list = data.rows }
|
|
|
|
|
else if (data && Array.isArray(data.records)) { list = data.records }
|
|
|
|
|
repairOrderOptions.value = list.map((r) => ({
|
|
|
|
|
value: r.id,
|
|
|
|
|
label: r.repairName || r.repairCode || r.subjectName || String(r.id || '')
|
|
|
|
|
}))
|
|
|
|
|
console.log('维修单列表(设备ID):', JSON.stringify(repairOrderOptions.value))
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadRepairOrdersById error', e)
|
|
|
|
|
const submitData = {
|
|
|
|
|
isCode: true,
|
|
|
|
|
outTime: outTime,
|
|
|
|
|
responserId: Number(selectedOperator.value.value),
|
|
|
|
|
status: 0,
|
|
|
|
|
totalCount: totalCount,
|
|
|
|
|
totalPrice: 0,
|
|
|
|
|
remark: remark.value || '',
|
|
|
|
|
items: items
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggleOperatorDropdown() {
|
|
|
|
|
showOperatorDropdown.value = !showOperatorDropdown.value
|
|
|
|
|
}
|
|
|
|
|
if (attachmentList.value.length) { submitData.fileUrl = String(attachmentList.value[0]?.path || '') }
|
|
|
|
|
|
|
|
|
|
function handleSelectOperator(item) {
|
|
|
|
|
selectedOperator.value = item
|
|
|
|
|
showOperatorDropdown.value = false
|
|
|
|
|
}
|
|
|
|
|
console.log('=== 出库提交 ===')
|
|
|
|
|
console.log(JSON.stringify(submitData))
|
|
|
|
|
|
|
|
|
|
async function loadOperators() {
|
|
|
|
|
uni.showLoading({ title: '提交中...', mask: true })
|
|
|
|
|
try {
|
|
|
|
|
const res = await getSimpleUserList()
|
|
|
|
|
const data = Array.isArray(res) ? res : (Array.isArray(res?.data) ? res.data : [])
|
|
|
|
|
operatorOptions.value = data.map((u) => ({
|
|
|
|
|
value: u.id || u.userId,
|
|
|
|
|
label: u.nickname || u.userName || u.name || String(u.id || '')
|
|
|
|
|
}))
|
|
|
|
|
await createSparepartOutbound(submitData)
|
|
|
|
|
uni.hideLoading(); getApp().globalData._sparepartOutboundItems = []
|
|
|
|
|
uni.showToast({ title: t('functionCommon.createSuccess'), icon: 'success' })
|
|
|
|
|
setTimeout(() => uni.navigateBack(), 1500)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('loadOperators error', e)
|
|
|
|
|
uni.hideLoading(); const msg = e?.message || e?.data?.msg || e?.response?.data?.msg || t('functionCommon.saveFailed')
|
|
|
|
|
console.error('出库提交失败:', e, JSON.stringify(e))
|
|
|
|
|
uni.showToast({ title: String(msg).substring(0, 50), icon: 'none' })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleSubmit() {
|
|
|
|
|
if (!selectedSparepart.value.id) {
|
|
|
|
|
uni.showToast({ title: '请先选择备件', icon: 'none' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!outboundQty.value || Number(outboundQty.value) <= 0) {
|
|
|
|
|
uni.showToast({ title: '请输入出库数量', icon: 'none' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!selectedOperator.value) {
|
|
|
|
|
uni.showToast({ title: '请选择经办人', icon: 'none' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (!selectedPurpose.value) {
|
|
|
|
|
uni.showToast({ title: '请选择出库用途', icon: 'none' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// TODO: 调用出库提交接口(后续补充)
|
|
|
|
|
uni.showToast({ title: t('functionCommon.createSuccess'), icon: 'success' })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onShow(async () => {
|
|
|
|
|
const selectResult = getApp().globalData?._sparepartSelectResult
|
|
|
|
|
if (selectResult) {
|
|
|
|
|
selectedSparepart.value = selectResult
|
|
|
|
|
// 补充获取备件详情(含供应商、图片等)
|
|
|
|
|
if (selectResult.id) {
|
|
|
|
|
try {
|
|
|
|
|
const res = await getSparepartDetail(selectResult.id)
|
|
|
|
|
const detail = res?.data || res
|
|
|
|
|
if (detail && detail.suppliers) {
|
|
|
|
|
selectedSparepart.value = { ...selectedSparepart.value, ...detail }
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error('获取备件详情失败:', e)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
outboundQty.value = null
|
|
|
|
|
getApp().globalData._sparepartSelectResult = null
|
|
|
|
|
}
|
|
|
|
|
loadOperators()
|
|
|
|
|
loadDevices()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onHide(() => {
|
|
|
|
|
showOperatorDropdown.value = false
|
|
|
|
|
showDeviceDropdown.value = false
|
|
|
|
|
showOrderDropdown.value = false
|
|
|
|
|
})
|
|
|
|
|
onShow(() => { const items = getApp().globalData?._sparepartOutboundItems; if (Array.isArray(items)) itemList.value = [...items]; loadOperators() })
|
|
|
|
|
onHide(() => { showOperatorDropdown.value = false })
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-container {
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
background: #f5f6f8;
|
|
|
|
|
padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 20rpx;
|
|
|
|
|
padding: 20rpx 24rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action-btn {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 12rpx;
|
|
|
|
|
height: 96rpx;
|
|
|
|
|
border-radius: 12rpx;
|
|
|
|
|
background: #1f4b79;
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
|
|
.btn-icon-wrap { width: 44rpx; height: 44rpx; display: flex; align-items: center; justify-content: center; }
|
|
|
|
|
.btn-icon { font-size: 36rpx; color: #fff; }
|
|
|
|
|
.btn-text { font-size: 28rpx; font-weight: 600; color: #fff; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sparepart-section { padding: 0; }
|
|
|
|
|
.page-container { min-height: 100vh; background: #f5f6f8; padding-bottom: calc(120rpx + env(safe-area-inset-bottom)); }
|
|
|
|
|
.action-row { display: flex; gap: 20rpx; padding: 20rpx 24rpx; }
|
|
|
|
|
.action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12rpx; height: 96rpx; border-radius: 12rpx; background: #1f4b79; color: #fff; font-size: 28rpx; font-weight: 600; .btn-icon-wrap { width: 44rpx; height: 44rpx; display: flex; align-items: center; justify-content: center; } .btn-icon { font-size: 36rpx; color: #fff; } .btn-text { font-size: 28rpx; font-weight: 600; color: #fff; } }
|
|
|
|
|
.form-section { padding-bottom: 16rpx; }
|
|
|
|
|
.section-title-bar { display: flex; align-items: center; gap: 10rpx; padding: 24rpx 24rpx 18rpx; }
|
|
|
|
|
.section-bar-line { width: 6rpx; height: 32rpx; border-radius: 3rpx; background: #2563eb; flex-shrink: 0; }
|
|
|
|
|
.section-title { font-size: 30rpx; font-weight: 700; color: #1a1a1a; }
|
|
|
|
|
.required { color: #ef4444; margin-right: 2rpx; }
|
|
|
|
|
.form-row-card { position: relative; display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 16rpx; padding: 26rpx 24rpx; margin: 0 24rpx 16rpx; box-shadow: 0 4rpx 16rpx rgba(15,23,42,0.04); font-size: 28rpx; color: #374151; .placeholder { color: #9ca3af; } }
|
|
|
|
|
.form-row-arrow { font-size: 20rpx; color: #999; flex-shrink: 0; }
|
|
|
|
|
|
|
|
|
|
.sparepart-card {
|
|
|
|
|
background: #fff; border-radius: 16rpx; padding: 24rpx; margin: 0 24rpx 20rpx;
|
|
|
|
|
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.04);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-top { display: flex; position: relative; }
|
|
|
|
|
.card-image-wrap {
|
|
|
|
|
width: 160rpx; height: 160rpx; border-radius: 12rpx; overflow: hidden;
|
|
|
|
|
background: #f8fafc; border: 1rpx solid #f0f0f0; flex-shrink: 0; margin-right: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.card-image { width: 100%; height: 100%; }
|
|
|
|
|
.card-image-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f8fafc; }
|
|
|
|
|
.empty-img-icon { font-size: 56rpx; opacity: 0.3; }
|
|
|
|
|
|
|
|
|
|
.card-info-right { flex: 1; min-width: 0; }
|
|
|
|
|
.info-item { display: flex; align-items: center; margin-bottom: 8rpx; }
|
|
|
|
|
.info-label { font-size: 26rpx; color: #6b7280; flex-shrink: 0; }
|
|
|
|
|
.info-name { font-size: 30rpx; font-weight: 700; color: #0f172a; }
|
|
|
|
|
.info-value { font-size: 26rpx; color: #374151; &.stock-highlight { color: #2563eb; font-weight: 500; } }
|
|
|
|
|
|
|
|
|
|
.card-bottom { margin-top: 20rpx; padding-top: 20rpx; border-top: 1rpx solid #f0f0f0; }
|
|
|
|
|
.detail-row { display: flex; align-items: center; margin-bottom: 14rpx;
|
|
|
|
|
&:last-child { margin-bottom: 0; }
|
|
|
|
|
&.two-col { justify-content: space-between; }
|
|
|
|
|
}
|
|
|
|
|
.detail-col { display: flex; align-items: center; flex: 1; }
|
|
|
|
|
.detail-label { font-size: 24rpx; color: #9ca3af; flex-shrink: 0; }
|
|
|
|
|
.detail-value { font-size: 24rpx; color: #4b5563; }
|
|
|
|
|
|
|
|
|
|
/* ====== 出库用途 ====== */
|
|
|
|
|
.purpose-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 20rpx;
|
|
|
|
|
margin: 0 24rpx 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.purpose-card { display: flex; gap: 20rpx; margin: 0 24rpx 20rpx; }
|
|
|
|
|
.purpose-item { flex: 1; display: flex; align-items: center; justify-content: center; height: 92rpx; background: #fff; border: 2rpx solid #e5e7eb; border-radius: 14rpx; font-size: 28rpx; color: #6b7280; &.active { border-color: #2563eb; background: #eff6ff; color: #2563eb; font-weight: 600; } }
|
|
|
|
|
|
|
|
|
|
.purpose-item {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 12rpx;
|
|
|
|
|
height: 92rpx;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border: 2rpx solid #e5e7eb;
|
|
|
|
|
border-radius: 14rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #6b7280;
|
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
|
border-color: #2563eb;
|
|
|
|
|
background: #eff6ff;
|
|
|
|
|
color: #2563eb;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.purpose-icon {
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qty-section { margin-top: 4rpx; }
|
|
|
|
|
.qty-input-card {
|
|
|
|
|
background: #fff; border-radius: 16rpx; padding: 24rpx; margin: 0 24rpx;
|
|
|
|
|
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.04);
|
|
|
|
|
}
|
|
|
|
|
.form-field { display: flex; flex-direction: column; gap: 12rpx; }
|
|
|
|
|
.form-label { font-size: 26rpx; color: #4b5563; font-weight: 500; }
|
|
|
|
|
.form-input { width: 100%; height: 88rpx; padding: 0 24rpx; font-size: 28rpx; color: #374151; background: #f8fafc; border-radius: 14rpx; box-sizing: border-box; }
|
|
|
|
|
.form-suffix-text { display: block; margin-top: 10rpx; font-size: 24rpx; color: #9ca3af; }
|
|
|
|
|
|
|
|
|
|
.convert-row { margin-top: 20rpx; padding-top: 20rpx; border-top: 1rpx solid #f0f0f0; display: flex; align-items: center; }
|
|
|
|
|
.convert-label-inline { font-size: 26rpx; color: #6b7280; }
|
|
|
|
|
.convert-value-inline { font-size: 36rpx; font-weight: 700; color: #1f2937; margin-left: auto; }
|
|
|
|
|
.convert-unit-inline { font-size: 24rpx; color: #64748b; margin-left: 8rpx; }
|
|
|
|
|
.convert-formula-inline { margin-top: 10rpx; font-size: 22rpx; color: #9ca3af; }
|
|
|
|
|
|
|
|
|
|
.select-row-card {
|
|
|
|
|
position: relative; display: flex; align-items: center; justify-content: space-between;
|
|
|
|
|
background: #fff; border-radius: 16rpx; padding: 24rpx; margin: 0 24rpx 20rpx;
|
|
|
|
|
box-shadow: 0 4rpx 16rpx rgba(15, 23, 42, 0.04);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.warehouse-area-rows { width: 100%; display: flex; flex-direction: column; gap: 16rpx; }
|
|
|
|
|
.warehouse-area-row { display: flex; align-items: center; }
|
|
|
|
|
.warehouse-area-label { width: 120rpx; font-size: 26rpx; color: #6b7280; flex-shrink: 0; }
|
|
|
|
|
.warehouse-area-dropdown { flex: 1; min-width: 0; position: relative;
|
|
|
|
|
.dropdown-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; margin-top: 4rpx; background: #fff; border: 1rpx solid #e0e0e0; border-radius: 12rpx; box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.15); overflow: hidden; }
|
|
|
|
|
}
|
|
|
|
|
.warehouse-area-card { align-items: flex-start; }
|
|
|
|
|
|
|
|
|
|
.full-dropdown {
|
|
|
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
|
|
|
width: 100%; font-size: 28rpx; color: #374151;
|
|
|
|
|
.placeholder { color: #9ca3af; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dropdown-input { display: flex; align-items: center; height: 64rpx; padding: 0 20rpx; border: 1rpx solid #e0e0e0; border-radius: 10rpx; background: #f9fafb; }
|
|
|
|
|
.dropdown-value { flex: 1; font-size: 27rpx; color: #333; &.placeholder { color: #bbb; } }
|
|
|
|
|
.dropdown-arrow { font-size: 20rpx; color: #999; flex-shrink: 0; }
|
|
|
|
|
.dropdown-panel { position: absolute; top: 68rpx; left: 0; right: 0; z-index: 99; background: #fff; border: 1rpx solid #e0e0e0; border-radius: 12rpx; box-shadow: 0 8rpx 30rpx rgba(0, 0, 0, 0.1); overflow: hidden; }
|
|
|
|
|
.dropdown-scroll { max-height: 360rpx; }
|
|
|
|
|
.dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 20rpx 24rpx; border-bottom: 1rpx solid #f0f0f0;
|
|
|
|
|
&:last-child { border-bottom: 0; }
|
|
|
|
|
&.active { background: #f0f5ff; }
|
|
|
|
|
}
|
|
|
|
|
.dropdown-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; margin-top: 4rpx; background: #fff; border: 1rpx solid #e0e0e0; border-radius: 12rpx; box-shadow: 0 8rpx 30rpx rgba(0,0,0,0.1); overflow: hidden; }
|
|
|
|
|
.dropdown-scroll { height: 360rpx; }
|
|
|
|
|
.dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 20rpx 24rpx; border-bottom: 1rpx solid #f0f0f0; &:last-child { border-bottom: 0; } &.active { background: #f0f5ff; } }
|
|
|
|
|
.dropdown-item-text { font-size: 27rpx; color: #333; }
|
|
|
|
|
.dropdown-check { font-size: 28rpx; color: #2563eb; font-weight: 700; }
|
|
|
|
|
.dropdown-empty { padding: 32rpx; text-align: center; color: #999; font-size: 26rpx; }
|
|
|
|
|
|
|
|
|
|
.empty-wrap { padding: 160rpx 24rpx; text-align: center; }
|
|
|
|
|
.remark-card { padding: 20rpx 24rpx; }
|
|
|
|
|
.remark-textarea { width: 100%; min-height: 120rpx; font-size: 27rpx; color: #374151; line-height: 1.6; box-sizing: border-box; }
|
|
|
|
|
.remark-placeholder { color: #bbb; }
|
|
|
|
|
|
|
|
|
|
.attachment-area { padding: 0 24rpx 16rpx; }
|
|
|
|
|
.attachment-list { display: flex; flex-direction: column; gap: 12rpx; }
|
|
|
|
|
.attachment-file-item { display: flex; align-items: center; gap: 16rpx; background: #fff; border-radius: 12rpx; padding: 18rpx 20rpx; box-shadow: 0 2rpx 8rpx rgba(15,23,42,0.03); }
|
|
|
|
|
.file-icon { width: 72rpx; height: 72rpx; border-radius: 10rpx; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
|
|
|
|
.file-icon-text { font-size: 36rpx; }
|
|
|
|
|
.file-info { flex: 1; min-width: 0; }
|
|
|
|
|
.file-name { font-size: 26rpx; color: #1f2937; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
|
.file-size { font-size: 22rpx; color: #9ca3af; margin-top: 4rpx; display: block; }
|
|
|
|
|
.file-delete { width: 48rpx; height: 48rpx; border-radius: 24rpx; background: #fee2e2; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
|
|
|
|
|
.delete-icon-sm { font-size: 22rpx; color: #dc2626; }
|
|
|
|
|
.attachment-add-file { display: flex; align-items: center; justify-content: center; height: 88rpx; background: #fff; border: 2rpx dashed #cbd5e1; border-radius: 12rpx; }
|
|
|
|
|
.add-text { font-size: 26rpx; color: #6b7280; }
|
|
|
|
|
|
|
|
|
|
.sparepart-section { padding: 0; }
|
|
|
|
|
.item-list { padding: 0 24rpx; }
|
|
|
|
|
.item-card { position: relative; display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 14rpx; padding: 20rpx; margin-bottom: 16rpx; box-shadow: 0 2rpx 12rpx rgba(15,23,42,0.04); }
|
|
|
|
|
.item-delete-top { position: absolute; top: 10rpx; right: 10rpx; width: 40rpx; height: 40rpx; border-radius: 20rpx; background: #fee2e2; display: flex; align-items: center; justify-content: center; z-index: 1; .delete-icon { font-size: 20rpx; color: #dc2626; } }
|
|
|
|
|
.item-left { display: flex; align-items: center; flex: 1; min-width: 0; padding-right: 36rpx; }
|
|
|
|
|
.item-image-wrap { width: 80rpx; height: 80rpx; border-radius: 10rpx; overflow: hidden; background: #f8fafc; border: 1rpx solid #f0f0f0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
|
|
|
|
|
.item-image { width: 100%; height: 100%; }
|
|
|
|
|
.item-image-empty { font-size: 36rpx; opacity: 0.3; }
|
|
|
|
|
.item-info { margin-left: 16rpx; flex: 1; min-width: 0; }
|
|
|
|
|
.item-name { font-size: 28rpx; font-weight: 600; color: #1a1a1a; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
|
.item-spec { font-size: 24rpx; color: #9ca3af; margin-top: 6rpx; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
|
.item-right { display: flex; flex-direction: column; align-items: flex-end; margin-left: 16rpx; flex-shrink: 0; padding-right: 50rpx; }
|
|
|
|
|
.item-qty-row { display: flex; flex-direction: column; align-items: flex-end; }
|
|
|
|
|
.item-qty-label { font-size: 22rpx; color: #9ca3af; }
|
|
|
|
|
.item-qty-value { font-size: 28rpx; font-weight: 700; color: #2563eb; margin-top: 4rpx; }
|
|
|
|
|
.empty-wrap { padding: 160rpx 0; text-align: center; }
|
|
|
|
|
.empty-text { font-size: 28rpx; color: #94a3b8; }
|
|
|
|
|
|
|
|
|
|
.bottom-actions {
|
|
|
|
|
position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 18rpx;
|
|
|
|
|
padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom));
|
|
|
|
|
background: #ffffff; box-shadow: 0 -8rpx 24rpx rgba(15, 23, 42, 0.06); z-index: 99;
|
|
|
|
|
}
|
|
|
|
|
.bottom-btn { flex: 1; height: 84rpx; line-height: 84rpx; text-align: center; border-radius: 16rpx; font-size: 30rpx; font-weight: 600;
|
|
|
|
|
&:active { opacity: 0.85; }
|
|
|
|
|
}
|
|
|
|
|
.bottom-actions { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 18rpx; padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8rpx 24rpx rgba(15,23,42,0.06); z-index: 99; }
|
|
|
|
|
.bottom-btn { flex: 1; height: 84rpx; line-height: 84rpx; text-align: center; border-radius: 16rpx; font-size: 30rpx; font-weight: 600; &:active { opacity: 0.85; } }
|
|
|
|
|
.cancel-btn { background: #eef2f7; color: #475569; }
|
|
|
|
|
.confirm-btn { background: #1f4b79; color: #ffffff; }
|
|
|
|
|
</style>
|
|
|
|
|
|