Files
electricity_bill_calc_wx/pages/readingHistory/components/editModal/index.js
2025-09-16 17:35:49 +08:00

84 lines
1.7 KiB
JavaScript

// pages/workBench/components/tenement/components/bindMeter/index.js
// 0015980101
import { bindMeter, } from "../../../../service/tenement"
import { getWorkMeterDetail } from "../../../../service/meter"
import { alertInfo, alertSuccess } from "../../../../utils/index";
import request from "../../../../utils/request"
import dayjs from "../../../../utils/dayjs"
const { OK } = request
Component({
/**
* 组件的属性列表
*/
properties: {
visible: Boolean,
title: String,
timeProps: String,
numberProps: String,
id: String
},
observers: {
"timeProps": function(newValue) {
this.setData({
time: newValue
})
},
"numberProps": function(newValue) {
this.setData({
number: newValue
})
},
},
/**
* 组件的初始数据
*/
data: {
dateTimeShow: false,
},
/**
* 组件的方法列表
*/
methods: {
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
// this.triggerEvent("close")
},
onClose() {
this.setData({
show: false,
title: "",
type: "",
})
},
onChange(e) {
const { name } = e.currentTarget.dataset;
this.setData({
[name]: e.detail
})
},
async onSubmit() {
const { time, number } = this.data;
if (time == null || number == null) {
alertInfo("请正确填写后保存")
return;
}
this.triggerEvent("ok")
},
dateTimeConfirm(e) {
this.setData({ time: e.detail.time, dateTimeShow: false })
},
dateTimeCancal(e) {
this.setData({ dateTimeShow: false })
},
onTimeFocus() {
this.setData({ dateTimeShow: true })
}
}
})