包装管理

This commit is contained in:
2026-06-11 17:58:29 +08:00
parent 5b3fc66a36
commit 0f8d5f4f7d
7 changed files with 492 additions and 16 deletions
+23 -8
View File
@@ -16,18 +16,19 @@
</view>
<view class="info-item">
<text class="info-label"><text class="required">*</text>包装分类</text>
<u-input v-model="form.CategoryName" :clearable="false" type="select" placeholder="请选择" @click="handleShowCategory" />
<u-input v-model="form.CategoryName" :clearable="false" type="select" placeholder="请选择"
@click="handleShowCategory" />
</view>
</view>
<!-- 底部按钮 -->
<view class="bottom-btns">
<u-button class="btn-submit" size="medium" type="primary" @click="handleSave">保存</u-button>
<u-button size="medium" type="primary" @click="handleSave">保存</u-button>
</view>
<!-- 包装分类选择弹窗 -->
<nbd-select v-model="showCategory" v-model:model="selectedCategory" title="选择包装分类" :list="categoryList" label-key="label" value-key="value"
@confirm="handleCategoryConfirm" />
<nbd-select v-model="showCategory" v-model:model="selectedCategory" title="选择包装分类" :list="categoryList"
label-key="label" value-key="value" @confirm="handleCategoryConfirm" />
</view>
</template>
@@ -68,7 +69,10 @@
// ===== 弹窗 =====
const showCategory = ref(false)
const categoryList = ref([])
const selectedCategory = ref({ label: '', value: '' })
const selectedCategory = ref({
label: '',
value: ''
})
// ===== 选择事件 =====
const handleShowCategory = () => {
@@ -93,7 +97,10 @@
const getCategoryList = async () => {
try {
const res = await reqPackagingManage()
categoryList.value = Object.entries(res.data || {}).map(([label, value]) => ({ label, value }))
categoryList.value = Object.entries(res.data || {}).map(([label, value]) => ({
label,
value
}))
// 设置默认值为第一个
if (categoryList.value.length > 0 && !form.value.CategoryName) {
form.value.CategoryName = categoryList.value[0].label
@@ -106,6 +113,14 @@
// ===== 保存 =====
const handleSave = async () => {
setTimeout(() => {
uni.redirectTo({
url: '/pipe/packaging/detail?id' + res.data.id
})
}, 1500)
return
if (!form.value.StackingPosition) {
uni.showToast({
title: '请输入预制工作包',
@@ -138,7 +153,7 @@
})
setTimeout(() => {
uni.redirectTo({
url: '/pipe/packaging/detail?id'+res.data.id
url: '/pipe/packaging/detail?id' + res.data.id
})
}, 1500)
}
@@ -166,4 +181,4 @@
getPackagingNo()
getCategoryList()
})
</script>
</script>