App端 冰雪填报 添加的物资 填报不能超过余额
This commit is contained in:
parent
75e7e6bfbe
commit
89ed889612
@ -153,9 +153,10 @@
|
||||
:key="material.rid"
|
||||
v-model="material.usageAmount"
|
||||
type="number"
|
||||
@input="checkMaterialAmount(material, index)"
|
||||
:label="material.wzmc"
|
||||
center
|
||||
placeholder="请输入数量"
|
||||
:placeholder="`余额: ${material.ye} `"
|
||||
>
|
||||
<template #extra>
|
||||
<span style="margin-right: 10px">{{ material.dw }}</span>
|
||||
@ -493,6 +494,7 @@ const addSelectedMaterials = () => {
|
||||
wzmc: material.wzmc,
|
||||
usageAmount: null,
|
||||
dw: material.dw,
|
||||
ye: material.ye,
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -500,6 +502,18 @@ const addSelectedMaterials = () => {
|
||||
checked.value = [];
|
||||
};
|
||||
|
||||
// 检查余额
|
||||
const checkMaterialAmount = (material, index) => {
|
||||
if (material.usageAmount > material.ye) {
|
||||
showToast({
|
||||
type: "fail",
|
||||
message: "输入数量不能超过物资余额",
|
||||
});
|
||||
// 设置为最大值
|
||||
form.yhzMaterialList[index].usageAmount = material.ye;
|
||||
}
|
||||
};
|
||||
|
||||
// 查询物资列表
|
||||
const getMaterialList = async (wzmc) => {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user