修改字符串格式的数字为“”的时候接口报错的问题和装表的时候未过滤已装电表的问题
This commit is contained in:
@@ -222,7 +222,7 @@ Component({
|
|||||||
},
|
},
|
||||||
async onSearchInventoryMeter() {
|
async onSearchInventoryMeter() {
|
||||||
const { searchText = "", park, filterBind } = this.data;
|
const { searchText = "", park, filterBind } = this.data;
|
||||||
const { code, message, data: parks = [] } = await getInventoryMeter({keyword: searchText, park, isNeedBind: !filterBind, a : 1});
|
const { code, message, data: parks = [] } = await getInventoryMeter({keyword: searchText, park, isNeedBind: !filterBind, status: 1});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -70,11 +70,11 @@ Component({
|
|||||||
tenement,
|
tenement,
|
||||||
{
|
{
|
||||||
code: meter,
|
code: meter,
|
||||||
overall:overall? Number(overall) : overall,
|
overall:overall? Number(overall) : (overall === "" ? null : overall),
|
||||||
critical : critical ? Number(critical) : critical,
|
critical : critical ? Number(critical) : (critical === "" ? null : critical),
|
||||||
peak: peak ? Number(peak) : peak,
|
peak: peak ? Number(peak) : (peak === "" ? null : peak),
|
||||||
valley : valley ? Number(valley) : valley,
|
valley : valley ? Number(valley) : (valley === "" ? null : valley),
|
||||||
deepValley : deepValley ? Number(deepValley) : deepValley,
|
deepValley : deepValley ? Number(deepValley) : (deepValley === "" ? null : deepValley),
|
||||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ Component({
|
|||||||
tenement,
|
tenement,
|
||||||
meterId,
|
meterId,
|
||||||
{
|
{
|
||||||
overall:overall? Number(overall) : overall,
|
overall:overall? Number(overall) : (overall === "" ? null : overall),
|
||||||
critical : critical ? Number(critical) : critical,
|
critical : critical ? Number(critical) : (critical === "" ? null : critical),
|
||||||
peak: peak ? Number(peak) : peak,
|
peak: peak ? Number(peak) : (peak === "" ? null : peak),
|
||||||
valley : valley ? Number(valley) : valley,
|
valley : valley ? Number(valley) : (valley === "" ? null : valley),
|
||||||
deepValley: deepValley ? Number(deepValley) : deepValley,
|
deepValley: deepValley ? Number(deepValley) : (deepValley === "" ? null : deepValley),
|
||||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
});
|
});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
|
|||||||
@@ -428,7 +428,13 @@ Page({
|
|||||||
const { code, data, message } = await installMeter({
|
const { code, data, message } = await installMeter({
|
||||||
park, meterSn: meter, address, building, meterBox, meterType,
|
park, meterSn: meter, address, building, meterBox, meterType,
|
||||||
ratio, area, card, collectionA, collectionB, collectionC,
|
ratio, area, card, collectionA, collectionB, collectionC,
|
||||||
tenement, sharp, peak, flat, valley, overall, url, sn
|
tenement,
|
||||||
|
sharp: sharp === "" ? null : sharp,
|
||||||
|
peak: peak === "" ? null : peak,
|
||||||
|
flat: flat === "" ? null : flat,
|
||||||
|
valley: valley === "" ? null : valley,
|
||||||
|
overall: overall === "" ? null : overall,
|
||||||
|
url, sn
|
||||||
})
|
})
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ Component({
|
|||||||
tenement,
|
tenement,
|
||||||
{
|
{
|
||||||
code: meter,
|
code: meter,
|
||||||
overall:overall? Number(overall) : overall,
|
overall:overall? Number(overall) : (overall === "" ? null : overall),
|
||||||
critical : critical ? Number(critical) : critical,
|
critical : critical ? Number(critical) : (critical === "" ? null : critical),
|
||||||
peak: peak ? Number(peak) : peak,
|
peak: peak ? Number(peak) : (peak === "" ? null : peak),
|
||||||
flat: flat ? Number(flat) : flat,
|
flat: flat ? Number(flat) : (flat === "" ? null : flat),
|
||||||
valley : valley ? Number(valley) : valley,
|
valley : valley ? Number(valley) : (valley === "" ? null : valley),
|
||||||
deepValley: deepValley ? Number(deepValley) : deepValley,
|
deepValley: deepValley ? Number(deepValley) : (deepValley === "" ? null : deepValley),
|
||||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -81,12 +81,12 @@ Component({
|
|||||||
tenement,
|
tenement,
|
||||||
meterId,
|
meterId,
|
||||||
{
|
{
|
||||||
overall:overall? Number(overall) : overall,
|
overall:overall? Number(overall) : (overall === "" ? null : overall),
|
||||||
critical : critical ? Number(critical) : critical,
|
critical : critical ? Number(critical) : (critical === "" ? null : critical),
|
||||||
peak: peak ? Number(peak) : peak,
|
peak: peak ? Number(peak) : (peak === "" ? null : peak),
|
||||||
flat: flat ? Number(flat) : flat,
|
flat: flat ? Number(flat) : (flat === "" ? null : flat),
|
||||||
valley : valley ? Number(valley) : valley,
|
valley : valley ? Number(valley) : (valley === "" ? null : valley),
|
||||||
deepValley: deepValley ? Number(deepValley) : deepValley,
|
deepValley: deepValley ? Number(deepValley) : (deepValley === null ? "" : deepValley),
|
||||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
});
|
});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user