¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="sheet"> |
| | | <!-- <div class="title">é£éåæ°é
ç½®</div> --> |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | :rules="rules" |
| | | label-width="120px" |
| | | class="demo-ruleForm" |
| | | > |
| | | <el-form-item label="é¢ç天æ°" prop="days" class="form_class"> |
| | | <el-input-number v-model="ruleForm.days" @change="handleChange" /> |
| | | </el-form-item> |
| | | <el-form-item class="form_class"> |
| | | <el-button type="primary" @click="submitForm">ä¿å</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { |
| | | queryConfigParams, |
| | | queryConfigParamsSave, |
| | | } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig"; |
| | | import { ElMessage } from "element-plus"; |
| | | const { proxy } = getCurrentInstance(); |
| | | // const { plate_plan_param } = proxy.useDict('plate_plan_param'); |
| | | const ruleForm = ref({ |
| | | days: null, |
| | | }); |
| | | const configParams = ref({}); |
| | | const rules = reactive({ |
| | | days: [ |
| | | { required: true, message: "请è¾å
¥é¢ç天æ°", trigger: "blur" }, |
| | | { |
| | | type: "number", |
| | | message: "请è¾å
¥ææçæ°å", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | }); |
| | | onMounted(async () => { |
| | | let config = await queryConfigParams("plate_plan_param"); |
| | | console.log(config.data, "configwudhuhfuw"); |
| | | ruleForm.value.days = config.data[0].dictValue*1; |
| | | configParams.value = config.data[0]; |
| | | // console.log(plate_plan_param.value[0].value,'plate_plan_paramplate_plan_param') |
| | | }); |
| | | // const submitForm = async (formEl) => { |
| | | // if (!formEl) return; |
| | | // await formEl.validate((valid, fields) => { |
| | | // if (valid) { |
| | | // console.log("submit!"); |
| | | // } else { |
| | | // console.log("error submit!", fields); |
| | | // } |
| | | // }); |
| | | // }; |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["ruleFormRef"].validate(async (valid) => { |
| | | if (valid) { |
| | | console.log(valid, "valid"); |
| | | const res = await queryConfigParamsSave({ |
| | | ...configParams.value, |
| | | dictValue: ruleForm.value.days*1, |
| | | }); |
| | | if (res.code == 200) { |
| | | ElMessage({ |
| | | message: "æ´æ°æå", |
| | | type: "success", |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | const resetForm = (formEl) => { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | const handleChange = (value) => { |
| | | console.log(value); |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .sheet { |
| | | // padding: 20px; |
| | | .title { |
| | | font-size: 16px; |
| | | color: #333; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #999; |
| | | } |
| | | .form_class { |
| | | margin-top: 20px; |
| | | } |
| | | } |
| | | </style> |