Commit a1299346 by 无尘

fix: 修改编辑月指标

parent 9c0e4863
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:47:17
* @LastEditors: 无尘
* @LastEditTime: 2020-11-12 11:19:24
* @LastEditTime: 2020-11-23 10:17:38
-->
<template>
<div class="common-app-right" style="padding: 20px 0;color: #303133">
......@@ -12,7 +12,7 @@
<el-form-item label="门店名称">{{ form.storeName || '--' }}</el-form-item>
<el-form-item label="指标额">
{{ parseFloat(form.performanceValue).toFixed(2) }}
<el-button type="text" @click="dialogVisible=true">修改</el-button>
<el-button type="text" @click="modMonthTarget">修改</el-button>
</el-form-item>
<el-form-item label="指标类型">{{ [ '业绩指标日权重', '业绩指标日指标' ][form.performanceSubType - 1] }}</el-form-item>
<el-form-item label="">
......@@ -68,7 +68,7 @@
:closable="false">
</el-alert>
<el-form :model="targetForm" ref="targetForm" hide-required-asterisk label-width="175px">
<el-form :model="targetForm" ref="targetForm" hide-required-asterisk label-width="175px" @submit.native.prevent>
<el-form-item
prop="value"
:rules="[
......@@ -158,6 +158,13 @@ export default {
// }
// },
methods: {
// 修改月指标
modMonthTarget() {
const that = this;
that.targetForm.value = parseFloat(that.form.performanceValue).toFixed(2);
that.dialogVisible = true;
},
// 初始化表格
init() {
let { date, flag, performanceType, performanceYm, performanceSubType, storeInfoId } = this.form;
......@@ -194,20 +201,22 @@ export default {
},
// 修改月指标
confirmMonthTarget() {
this.$refs.targetForm.validate(valid => {
const that = this;
that.$refs.targetForm.validate(valid => {
if (!valid) return;
const { performanceYm, performanceType, storeInfoId } = this.form;
const { performanceYm, performanceType, storeInfoId } = that.form;
let params = {
...this.haoban,
...that.haoban,
performanceYm,
performanceType,
storeInfoId,
performanceValue: this.targetForm.value
performanceValue: that.targetForm.value
};
changeStorePerformanceMonth(params, { headers: { sign: this.brandId } })
changeStorePerformanceMonth(params, { headers: { sign: that.brandId } })
.then(res => {
// 重新设置指标额
that.form.performanceValue = params.performanceValue;
});
});
},
......
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