|
@@ -1,13 +1,14 @@
|
|
|
<template>
|
|
|
<m-dialog ref="dialog" title="系数管理" v-bind="$attrs">
|
|
|
<template #button-after>
|
|
|
- <m-button type="success" @click="onOpen('sandboxCalculateRefs')">选择数据开始测算</m-button>
|
|
|
+ <m-button type="success" @click="onStart">开始测算</m-button>
|
|
|
</template>
|
|
|
- <el-form v-loading="loading" label-width="100px">
|
|
|
- <el-form-item label="名称">
|
|
|
+ <m-form ref="form" v-loading="loading" label-width="100px" :items="formItems" v-model="formValues">
|
|
|
+ <template #name>
|
|
|
<el-tag color="primary">{{ itemData.title }}</el-tag>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="系数管理">
|
|
|
+ </template>
|
|
|
+ <template #[`month.after`]>* 请选择数据所在月份进行测算</template>
|
|
|
+ <template #param>
|
|
|
<m-card shadow="never">
|
|
|
<template v-if="items.length" v-slot:default>
|
|
|
<el-tabs v-model="activeNames" >
|
|
@@ -60,8 +61,9 @@
|
|
|
<m-empty description="尚未配置系数"></m-empty>
|
|
|
</template>
|
|
|
</m-card>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </template>
|
|
|
+ </m-form>
|
|
|
+
|
|
|
<SandboxCalculate ref="sandboxCalculateRefs" append-to-body @issue="$emit('issue', $event)"></SandboxCalculate>
|
|
|
</m-dialog>
|
|
|
</template>
|
|
@@ -83,7 +85,33 @@ export default {
|
|
|
activeNames: null,
|
|
|
loading: false,
|
|
|
itemData: {},
|
|
|
- items: []
|
|
|
+ items: [],
|
|
|
+ formItems: [
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'name'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数据月份',
|
|
|
+ prop: 'month',
|
|
|
+ type: 'datePicker',
|
|
|
+ options: {
|
|
|
+ clearable: false,
|
|
|
+ type: 'month',
|
|
|
+ format: 'yyyy-MM',
|
|
|
+ valueFormat: 'yyyy-MM',
|
|
|
+ placeholder: '选择查询月份'
|
|
|
+ },
|
|
|
+ rules: [
|
|
|
+ { required: true, message: '请选择数据月份', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '系数管理',
|
|
|
+ prop: 'param'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ formValues: {}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -121,8 +149,13 @@ export default {
|
|
|
this.loading = false
|
|
|
}
|
|
|
},
|
|
|
- onOpen (ref) {
|
|
|
- this.$refs[ref]?.open && this.$refs[ref].open(this.itemData)
|
|
|
+ onStart () {
|
|
|
+ this.$refs.form.validate(valid => {
|
|
|
+ if (!valid) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.sandboxCalculateRefs.open(this.itemData, this.formValues.month)
|
|
|
+ })
|
|
|
}
|
|
|
// async onSure () {
|
|
|
// const query = {
|