更新录入合卷分卷添加选择分类
This commit is contained in:
@@ -33,14 +33,10 @@
|
||||
<text class="item-label">当前库区</text>
|
||||
<text class="item-value">{{ currentWarehouseName || '未分配' }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="materialDetail">
|
||||
<view class="info-item full-width" v-if="materialDetail">
|
||||
<text class="item-label">原材料</text>
|
||||
<text class="item-value">{{ materialDetail.rawMaterialName || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="materialDetail">
|
||||
<text class="item-label">规格</text>
|
||||
<text class="item-value">{{ materialDetail.specification || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -84,7 +80,7 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 库区选择 - 滚筒选择器 -->
|
||||
<!-- 库区选择 -->
|
||||
<view class="form-item form-item-optional">
|
||||
<text class="form-label-optional">目标库区</text>
|
||||
<view
|
||||
@@ -99,7 +95,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品选择(仅当选择了成品库区时显示) -->
|
||||
<!-- 物品类型选择 -->
|
||||
<view class="form-item form-item-optional">
|
||||
<text class="form-label-optional">物品类型</text>
|
||||
<view
|
||||
class="picker-input"
|
||||
@click="coilDetail.dataType !== 0 && showItemTypePicker()"
|
||||
:class="{ 'picker-input-disabled': coilDetail.dataType === 0 }"
|
||||
>
|
||||
<text class="picker-text" :class="{ 'picker-placeholder': !form.itemType }">
|
||||
{{ form.itemType === 'product' ? '成品' : form.itemType === 'raw_material' ? '原料' : '请选择物品类型' }}
|
||||
</text>
|
||||
<text class="picker-arrow" v-if="coilDetail.dataType !== 0">▼</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品选择(仅当选择了成品类型时显示) -->
|
||||
<view class="form-item form-item-optional" v-if="form.itemType === 'product'">
|
||||
<text class="form-label-optional">选择产品</text>
|
||||
<view
|
||||
@@ -114,7 +125,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 原材料选择(仅当选择了原材料库区时显示) -->
|
||||
<!-- 原材料选择(仅当选择了原料类型时显示) -->
|
||||
<view class="form-item form-item-optional" v-if="form.itemType === 'raw_material'">
|
||||
<text class="form-label-optional">选择原材料</text>
|
||||
<view
|
||||
@@ -271,6 +282,26 @@
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- 物品类型选择弹窗 -->
|
||||
<uni-popup ref="itemTypePopup" type="bottom">
|
||||
<view class="warehouse-popup">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">选择物品类型</text>
|
||||
<text class="popup-close" @click="closeItemTypePicker">✕</text>
|
||||
</view>
|
||||
<scroll-view class="popup-body" scroll-y>
|
||||
<view class="warehouse-item" @click="selectItemType('product')">
|
||||
<text class="warehouse-name">成品</text>
|
||||
<text class="warehouse-check" v-if="form.itemType === 'product'">✓</text>
|
||||
</view>
|
||||
<view class="warehouse-item" @click="selectItemType('raw_material')">
|
||||
<text class="warehouse-name">原料</text>
|
||||
<text class="warehouse-check" v-if="form.itemType === 'raw_material'">✓</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- BOM弹窗 -->
|
||||
<uni-popup ref="bomPopup" type="bottom">
|
||||
<view class="bom-popup">
|
||||
@@ -554,15 +585,33 @@ import { listProduct } from '@/api/wms/product.js'
|
||||
this.form.warehouseName = warehouse.warehouseName;
|
||||
this.currentWarehouseName = warehouse.warehouseName;
|
||||
this.closeWarehousePicker();
|
||||
},
|
||||
|
||||
// 显示物品类型选择器
|
||||
showItemTypePicker() {
|
||||
this.$refs.itemTypePopup.open();
|
||||
},
|
||||
|
||||
// 关闭物品类型选择器
|
||||
closeItemTypePicker() {
|
||||
this.$refs.itemTypePopup.close();
|
||||
},
|
||||
|
||||
// 选择物品类型
|
||||
selectItemType(type) {
|
||||
// 设置物品类型
|
||||
this.form.itemType = type;
|
||||
// 清空之前选择的物品
|
||||
this.form.itemId = undefined;
|
||||
this.selectedProductName = '';
|
||||
this.selectedRawMaterialName = '';
|
||||
|
||||
// 根据库区ID判断类型:999为成品库,其他为原材料库
|
||||
if (warehouse.warehouseId === 999) {
|
||||
// 成品库,显示产品选择器
|
||||
this.form.itemType = 'product';
|
||||
this.closeItemTypePicker();
|
||||
|
||||
// 根据类型自动弹出对应的选择器
|
||||
if (type === 'product') {
|
||||
this.showProductPicker();
|
||||
} else {
|
||||
// 其他库区,显示原材料选择器
|
||||
this.form.itemType = 'raw_material';
|
||||
} else if (type === 'raw_material') {
|
||||
this.showRawMaterialPicker();
|
||||
}
|
||||
},
|
||||
@@ -959,6 +1008,10 @@ import { listProduct } from '@/api/wms/product.js'
|
||||
padding: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
&.full-width {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
|
||||
Reference in New Issue
Block a user