fix:计算系数
This commit is contained in:
parent
77aa24c19e
commit
979ad5870d
|
@ -2372,7 +2372,7 @@ const routes = [
|
|||
"name": "formula",
|
||||
"path": "/enm_base/formula",
|
||||
"meta": {
|
||||
"title": "计算公式",
|
||||
"title": "计算系数",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["enm_base"]
|
||||
},
|
||||
|
|
|
@ -1,104 +1,61 @@
|
|||
<template>
|
||||
<el-container class="page-user">
|
||||
<el-aside style="width: 240px">
|
||||
<el-container>
|
||||
<el-main class="nopadding">
|
||||
<el-menu class="menu" :default-active="page">
|
||||
<el-menu-item-group
|
||||
v-for="group in menu"
|
||||
:key="group.groupName"
|
||||
:title="group.groupName"
|
||||
>
|
||||
<el-menu-item
|
||||
v-for="item in group.list"
|
||||
:key="item.component"
|
||||
:index="item.component"
|
||||
@click="openPage"
|
||||
>
|
||||
<el-icon v-if="item.icon"
|
||||
><component :is="item.icon"
|
||||
/></el-icon>
|
||||
<template #title>
|
||||
<span>{{ item.title }}</span>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
</el-menu>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-aside>
|
||||
<el-container>
|
||||
<el-main>
|
||||
<Suspense>
|
||||
<template #default>
|
||||
<component :is="page" />
|
||||
</template>
|
||||
<template #fallback>
|
||||
<el-skeleton :rows="3" />
|
||||
</template>
|
||||
</Suspense>
|
||||
<el-card header="计算系数" shadow="hover">
|
||||
<el-form>
|
||||
<el-form-item label="料号系数">
|
||||
<el-input-number
|
||||
v-model="form.enm_lhxs"
|
||||
controls-position="right"
|
||||
placeholder="料号系数"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="saveLoading"
|
||||
@click="submitForm"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineAsyncComponent } from "vue";
|
||||
|
||||
export default {
|
||||
name: "userCenter",
|
||||
components: {
|
||||
calculate: defineAsyncComponent(() =>
|
||||
import("./settings/calculate.vue")
|
||||
),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
menu: [
|
||||
{
|
||||
groupName: "配置",
|
||||
list: [
|
||||
{
|
||||
icon: "el-icon-platform",
|
||||
title: "计算系数",
|
||||
component: "calculate",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
userData: {},
|
||||
page: "calculate",
|
||||
saveLoading: false,
|
||||
form: {
|
||||
enm_lhxs: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
//路由跳转进来 判断from是否有特殊标识做特殊处理
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next((vm) => {
|
||||
if (from.is) {
|
||||
//删除特殊标识,防止标签刷新重复执行
|
||||
delete from.is;
|
||||
//执行特殊方法
|
||||
vm.$alert("路由跳转过来后含有特殊标识,做特殊处理", "提示", {
|
||||
type: "success",
|
||||
center: true,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
this.getSysConfig();
|
||||
},
|
||||
methods: {
|
||||
openPage(item) {
|
||||
this.page = item.index;
|
||||
},
|
||||
|
||||
getSysConfig() {
|
||||
this.$API.system.config.getInfo.req().then((res) => {
|
||||
this.form = res.base;
|
||||
this.form = res.enm;
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.saveLoading = true;
|
||||
let obj = {};
|
||||
obj.enm = this.form;
|
||||
this.$API.system.config.updateInfo
|
||||
.req(obj)
|
||||
.then((res) => {
|
||||
this.saveLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.saveLoading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-main>
|
||||
<el-card header="计算系数" shadow="hover">
|
||||
<el-form>
|
||||
<el-form-item label="料号系数">
|
||||
<el-input-number
|
||||
v-model="form.enm_lhxs"
|
||||
controls-position="right"
|
||||
placeholder="料号系数"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="saveLoading"
|
||||
@click="submitForm"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
saveLoading: false,
|
||||
form: {
|
||||
enm_lhxs: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getSysConfig();
|
||||
},
|
||||
methods: {
|
||||
getSysConfig() {
|
||||
this.$API.system.config.getInfo.req().then((res) => {
|
||||
this.form = res.enm;
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.saveLoading = true;
|
||||
this.$API.system.config.updateInfo
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.saveLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.saveLoading = false;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue