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