diff --git a/src/pages/toolsLedger/toolsLedger.vue b/src/pages/toolsLedger/toolsLedger.vue
index 6e10343..66d6de0 100644
--- a/src/pages/toolsLedger/toolsLedger.vue
+++ b/src/pages/toolsLedger/toolsLedger.vue
@@ -45,7 +45,7 @@
v-for="(spec, specIndex) in category.specs"
:key="specIndex"
class="equipment-item"
- @click="showDetail(category.name, spec)"
+ @click="showDetail(category.name , spec)"
>
{{ category.name }}
@@ -135,7 +135,8 @@ const getList = async () => {
model: model.typeModelName,
quantity: model.storeNum || 0,
manageType: model.manageType,
- buyPrice: model.buyPrice
+ buyPrice: model.buyPrice,
+ typeId: model.typeId
}
})
}
@@ -155,11 +156,22 @@ const getList = async () => {
}
const showDetail = (categoryName, spec) => {
- console.log('查看详情:', categoryName, spec)
- uni.navigateTo({
- url: '/pages/toolsLedger/toolsLedgerDetails'
- })
+ console.log('查看详情:', spec.typeId, spec.manageType);
+ const qty = parseFloat(spec.quantity);
+
+ if (spec.manageType === '编码' && !isNaN(qty) && qty > 0) {
+ uni.navigateTo({
+ url: '/pages/toolsLedger/toolsLedgerDetails?typeId=' + spec.typeId,
+ });
+ } else {
+ uni.showModal({
+ title: `${categoryName}\n${spec.model}`,
+ content: `当前库存数量: ${!isNaN(qty) && qty >= 0 ? qty : 0}`,
+ showCancel: false
+ });
+ }
}
+