0) {
+ let hour_0 = Number(this.startTime[0].substring(0, 2));
+ let hour_1 = Number(this.startTime[1].substring(0, 2));
+ if (hour_0 >= 12 || hour_1 >= 12) {
+ this.$message.error("请选择00:00:00-11:59:59时间段的时间");
+ this.startTime = null;
+ return false;
+ }
+ this.dataForm.moStartTime = this.startTime[0];
+ this.dataForm.moEndTime = this.startTime[1];
+ }
+ },
+ endTimeChange() {
+ if (Array.isArray(this.endTime) && this.endTime.length > 0) {
+ let hour_0 = Number(this.endTime[0].substring(0, 2));
+ let hour_1 = Number(this.endTime[1].substring(0, 2));
+ if (hour_0 < 12 || hour_1 < 12) {
+ this.$message.error("请选择12:00:00-23:59:59时间段的时间");
+ this.endTime = null;
+ return false;
+ }
+ this.dataForm.afStartTime = this.endTime[0];
+ this.dataForm.afEndTime = this.endTime[1];
+ }
+ },
+ closeSubmit() {
+ this.$emit("closeDialog");
},
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义
initMap() {
// 定义地图中心点坐标
- let _this = this
- var center = new window.TMap.LatLng(_this.dataForm.latitude, _this.dataForm.longitude);
+ let _this = this;
+ var center = new window.TMap.LatLng(
+ _this.dataForm.latitude,
+ _this.dataForm.longitude
+ );
// 定义map变量,调用 TMap.Map() 构造函数创建地图
map = new window.TMap.Map(document.getElementById("map_app"), {
center: center, // 设置地图中心点坐标
@@ -381,9 +453,9 @@ export default {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.getInfo();
- }else{
- this.dataForm.ongitude = "120.38945519"
- this.dataForm.latitude = "36.0722275"
+ } else {
+ this.dataForm.ongitude = "120.38945519";
+ this.dataForm.latitude = "36.0722275";
this.initMap();
}
});
@@ -407,26 +479,31 @@ export default {
// 表单提交
dataFormSubmitHandle: debounce(
function () {
- this.$refs['dataForm'].validate((valid) => {
+ this.$refs["dataForm"].validate((valid) => {
if (!valid) {
- return false
+ return false;
}
- this.$http[!this.dataForm.id ? 'post' : 'put']('/epmetuser/icPointVaccinesInoculation/', this.dataForm).then(({ data: res }) => {
- if (res.code !== 0) {
- return this.$message.error(res.msg)
- }
- this.$message({
- message: this.$t('prompt.success'),
- type: 'success',
- duration: 500,
- onClose: () => {
- this.visible = false
- this.$emit('refreshDataList')
- this.closeSubmit()
+ this.$http[!this.dataForm.id ? "post" : "put"](
+ "/epmetuser/icPointVaccinesInoculation/",
+ this.dataForm
+ )
+ .then(({ data: res }) => {
+ if (res.code !== 0) {
+ return this.$message.error(res.msg);
}
+ this.$message({
+ message: this.$t("prompt.success"),
+ type: "success",
+ duration: 500,
+ onClose: () => {
+ this.visible = false;
+ this.$emit("refreshDataList");
+ this.closeSubmit();
+ },
+ });
})
- }).catch(() => {})
- })
+ .catch(() => {});
+ });
},
1000,
{ leading: true, trailing: false }
@@ -435,10 +512,10 @@ export default {
};