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