Commit 13817988 authored by xuke's avatar xuke

提交-能源消耗

parent 440306ff
......@@ -2,7 +2,7 @@
import { ref, onMounted, getCurrentInstance, reactive, nextTick } from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
import axios from "axios";
import { Search, Document } from "@element-plus/icons-vue";
import { Search, Minus, Document } from "@element-plus/icons-vue";
import {
getOrganizationStructureInterface
} from "@/api/scheduling";
......@@ -87,11 +87,14 @@ const config = reactive({
const handleSearch = () => {
config.supplyType = formInline.keyWord;
config.supplyType = [`${config.supplyType}`];
getEnergyData(),
(formEnergy.value.energyType = ""),
ElMessage.success("获取数据成功");
getEnergyData()
};
// 重置按钮
const handleReset = () => {
formInline.keyWord = ""
}
const timeFormat = (time) => {
var time = new Date(time);
var year = time.getFullYear();
......@@ -100,7 +103,7 @@ const timeFormat = (time) => {
function add(m) {
return m < 10 ? "0" + m : m;
}
return year + '/' + add(month) + '/' + add(date) + ' 0:00:00'
return year + '/' + add(month) + '/' + add(date)
}
//表单校验规则
......@@ -111,9 +114,7 @@ const rules = reactive({
],
record: [
{ required: true, message: "能源用度是必选项", trigger: "blur" },
{ pattern: /^(-?[0-9]+(\.[0-9]+)?){1,10}$/, message: "能源用度必须输入1-10位数字", trigger: "blur" },
{ min: 1, max: 10, message: '能源用度必须是 1-10位的数字', trigger: 'blur' }
{ pattern: /^(\d{1,10})$/, "message": "能源用度是 1-10位正整数", trigger: "blur" }
],
recordDate: [{ required: true, message: "日期是必选项" }],
});
......@@ -288,6 +289,10 @@ onMounted(() => {
<Search style="width: 1em; height: 1em; margin-right: 8px" />
查询
</el-button>
<el-button type="primary" @click="handleReset">
<Minus style="width: 1em; height: 1em; margin-right: 8px" />
重置
</el-button>
<el-button type="primary" @click="handleAdd">
<Document style="width: 1em; height: 1em; margin-right: 8px" />
新增
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment