更新录入合卷分卷添加选择分类
This commit is contained in:
@@ -83,7 +83,21 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品选择(仅当选择了成品库区时显示) -->
|
||||
<!-- 物品类型选择 -->
|
||||
<view class="form-item form-item-optional">
|
||||
<text class="form-label-optional">物品类型</text>
|
||||
<view
|
||||
class="picker-input"
|
||||
@click="showItemTypePicker()"
|
||||
>
|
||||
<text class="picker-text" :class="{ 'picker-placeholder': !itemType }">
|
||||
{{ itemType === 'product' ? '成品' : itemType === 'raw_material' ? '原料' : '请选择物品类型' }}
|
||||
</text>
|
||||
<text class="picker-arrow">▼</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 产品选择(仅当选择了成品类型时显示) -->
|
||||
<view class="form-item form-item-optional" v-if="itemType === 'product'">
|
||||
<text class="form-label-optional">选择产品</text>
|
||||
<view
|
||||
@@ -97,7 +111,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 原材料选择(仅当选择了原材料库区时显示) -->
|
||||
<!-- 原材料选择(仅当选择了原料类型时显示) -->
|
||||
<view class="form-item form-item-optional" v-if="itemType === 'raw_material'">
|
||||
<text class="form-label-optional">选择原材料</text>
|
||||
<view
|
||||
@@ -248,6 +262,26 @@
|
||||
</scroll-view>
|
||||
</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="itemType === 'product'">✓</text>
|
||||
</view>
|
||||
<view class="warehouse-item" @click="selectItemType('raw_material')">
|
||||
<text class="warehouse-name">原料</text>
|
||||
<text class="warehouse-check" v-if="itemType === 'raw_material'">✓</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -497,15 +531,33 @@ export default {
|
||||
this.warehouseName = warehouse.warehouseName;
|
||||
this.warehouseKeyword = warehouse.warehouseName;
|
||||
this.closeWarehousePicker();
|
||||
},
|
||||
|
||||
// 显示物品类型选择器
|
||||
showItemTypePicker() {
|
||||
this.$refs.itemTypePopup.open();
|
||||
},
|
||||
|
||||
// 关闭物品类型选择器
|
||||
closeItemTypePicker() {
|
||||
this.$refs.itemTypePopup.close();
|
||||
},
|
||||
|
||||
// 选择物品类型
|
||||
selectItemType(type) {
|
||||
// 设置物品类型
|
||||
this.itemType = type;
|
||||
// 清空之前选择的物品
|
||||
this.itemId = undefined;
|
||||
this.selectedProductName = '';
|
||||
this.selectedRawMaterialName = '';
|
||||
|
||||
// 根据库区ID判断类型:999为成品库,其他为原材料库
|
||||
if (warehouse.warehouseId === 999) {
|
||||
// 成品库,显示产品选择器
|
||||
this.itemType = 'product';
|
||||
this.closeItemTypePicker();
|
||||
|
||||
// 根据类型自动弹出对应的选择器
|
||||
if (type === 'product') {
|
||||
this.showProductPicker();
|
||||
} else {
|
||||
// 其他库区,显示原材料选择器
|
||||
this.itemType = 'raw_material';
|
||||
} else if (type === 'raw_material') {
|
||||
this.showRawMaterialPicker();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user