|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
<dialog-base class="dialog-body" ref="baseDialog" title="添加新批次">
|
|
|
+ <view class="prompt">
|
|
|
+ <text>请选择批次再确认</text>
|
|
|
+ </view>
|
|
|
<view :class="{'list-container':true, 'selected':isSelected(item)}" @click="handleSelection(item,index)"
|
|
|
v-for="(item, index) in form" :key="item.id">
|
|
|
<view class="list-title"><text class="label">批次号:{{item.lotCode}}</text></view>
|
|
@@ -21,7 +24,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="add-btn-container uni-row">
|
|
|
- <button type="primary" class="btn" @click="handleConfirm">确认</button>
|
|
|
+ <button type="primary" class="btn" @click="handleConfirm" :disabled="flag">确认</button>
|
|
|
</view>
|
|
|
</dialog-base>
|
|
|
</template>
|
|
@@ -37,6 +40,7 @@
|
|
|
const form = ref({})
|
|
|
const emit = defineEmits(['submit'])
|
|
|
const selection = ref([])
|
|
|
+ const flag = ref(true)
|
|
|
|
|
|
const open = (data) => {
|
|
|
// console.log(dialog.value)
|
|
@@ -51,7 +55,7 @@
|
|
|
defineExpose({
|
|
|
open
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
function handleScanCode() {
|
|
|
uni.scanCode({
|
|
|
onlyFromCamera: true,
|
|
@@ -77,6 +81,7 @@
|
|
|
selection.value.push(item); // 选中
|
|
|
}
|
|
|
console.log(selection.value, "selection");
|
|
|
+ flag.value = selection.value.length > 0 ? false : true;
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -88,13 +93,18 @@
|
|
|
.dialog-body {
|
|
|
overflow: auto;
|
|
|
.list-title {
|
|
|
- margin: 40rpx 0 20rpx 0;
|
|
|
+ margin: 20rpx 0 20rpx 0;
|
|
|
|
|
|
.label {
|
|
|
font-size: 32rpx;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .prompt{
|
|
|
+ color: #999;
|
|
|
+ margin: 8rpx auto 0;
|
|
|
+ }
|
|
|
|
|
|
.list-container {
|
|
|
width: 100%;
|