This commit is contained in:
parent
dc4071eea6
commit
df25270f48
|
|
@ -297,8 +297,16 @@ export default {
|
|||
this.selectedItems=[]
|
||||
this.getItemList()
|
||||
},
|
||||
// 弹窗组件的methods中
|
||||
selectable(row) {
|
||||
return !this.existingItems.some(item => item.id === row.id)
|
||||
// 条件1:库存为0时不可选
|
||||
if (row.inStockNum <= 0) return false;
|
||||
// 条件2:已在主表中存在的不可选(根据实际业务唯一标识判断,如id/devCode)
|
||||
const isExisted = this.existingItems.some(item => {
|
||||
// 请根据实际业务调整唯一标识的对比逻辑,比如devCode + devType
|
||||
return item.id === row.id || item.devCode === row.devCode;
|
||||
});
|
||||
return !isExisted;
|
||||
},
|
||||
onSelectionChange(selection) {
|
||||
this.selectedItems = selection
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@
|
|||
</el-card>
|
||||
</el-row>
|
||||
|
||||
<ApproveDialog ref="approveDialog" />
|
||||
<ApproveDialog ref="approveDialog"
|
||||
:existing-items="tableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 200px"
|
||||
style="width: 220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 200px"
|
||||
style="width: 220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
|
|||
Loading…
Reference in New Issue