update: 新增收货产品价格比较
This commit is contained in:
parent
a2eaa00117
commit
447d9ab591
|
@ -83,8 +83,10 @@ const handleInput = (e: any, item: any) => {
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const minPrice = parseFloat(model1.formData.minPrice)
|
||||||
|
const maxPrice = parseFloat(model1.formData.maxPrice)
|
||||||
if (item.key === "maxPrice") {
|
if (item.key === "maxPrice") {
|
||||||
if (model1.formData.minPrice > model1.formData.maxPrice) {
|
if (minPrice > maxPrice) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${item.name}应小于${model1.formData.maxPrice}`,
|
title: `${item.name}应小于${model1.formData.maxPrice}`,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
|
@ -93,10 +95,10 @@ const handleInput = (e: any, item: any) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.key === "commonPrice") {
|
if (item.key === "commonPrice") {
|
||||||
if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) {
|
if (minPrice > -1 && maxPrice > -1) {
|
||||||
if (
|
if (
|
||||||
temp < model1.formData.minPrice ||
|
!(temp >= minPrice &&
|
||||||
temp > model1.formData.maxPrice
|
temp <= maxPrice)
|
||||||
) {
|
) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${item.name}应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
title: `${item.name}应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
||||||
|
@ -253,16 +255,20 @@ const check = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (model1.formData.minPrice > model1.formData.maxPrice) {
|
const minPrice = parseFloat(model1.formData.minPrice)
|
||||||
|
const maxPrice = parseFloat(model1.formData.maxPrice)
|
||||||
|
if (minPrice > maxPrice) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `最低价应小于${model1.formData.maxPrice}`,
|
title: `最低价应小于${model1.formData.maxPrice}`,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (model1.formData.minPrice > -1 && model1.formData.maxPrice > -1) {
|
|
||||||
|
if (minPrice > -1 &&maxPrice > -1) {
|
||||||
|
|
||||||
const temp = model1.formData.commonPrice;
|
const temp = model1.formData.commonPrice;
|
||||||
if (temp < model1.formData.minPrice || temp > model1.formData.maxPrice) {
|
if (!(temp >= minPrice && temp <= maxPrice)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `常用价格应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
title: `常用价格应在${model1.formData.minPrice}-${model1.formData.maxPrice}之间`,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
|
@ -270,7 +276,6 @@ const save = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(model1.formData);
|
|
||||||
check().then((res) => {
|
check().then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
startSave();
|
startSave();
|
||||||
|
|
Loading…
Reference in New Issue