Commit 34d63e2b by 无尘

fix: 修改保存导购

parent d49034af
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:47:17
* @LastEditors: 无尘
* @LastEditTime: 2020-11-26 14:37:35
* @LastEditTime: 2020-11-26 18:01:52
-->
<template>
<div class="common-app-right" style="padding: 20px 0;color: #303133">
......@@ -52,7 +52,7 @@
<li v-for="(item, i) in tableData" :key="i">
<div>{{ item.performanceDay }}</div>
<el-input-number v-model="item.performanceValue" :disabled="disableSetting" :precision="2" :controls="false" :max="999999999" style="width: 80px;margin-left:40px;margin-top:5px"></el-input-number>
<el-input-number v-model="item.performanceValue" :disabled="disableSetting" :precision="2" :controls="false" :max="99999999" style="width: 80px;margin-left:40px;margin-top:5px"></el-input-number>
</li>
<!-- 补充空白 -->
......@@ -85,7 +85,7 @@
指标额
</span>
<el-input v-model="targetForm.value" style="width: 289px">
<el-input v-model="targetForm.value" maxlength="11" style="width: 289px" @blur="value => inputPerformance(value)">
<span slot="prefix" style="color:#303133;padding-left:5px"></span>
</el-input>
</el-form-item>
......@@ -175,6 +175,16 @@ export default {
this.$store.dispatch('clearStoreData');
},
methods: {
/**
* @description:输入
* @param {Function} val
* @author: 无尘
*/
inputPerformance: function(val) {
const that = this;
that.targetForm.value = !!Number(that.targetForm.value.replace(/[^\d.]/g, '')) ? that.targetForm.value.replace(/[^\d+(.\d+)]/g, '') : '';
that.targetForm.value = Number(that.targetForm.value).toFixed(2) > 99999999.99 ? 99999999.99 : Number(that.targetForm.value).toFixed(2);
},
// 修改月指标
modMonthTarget() {
const that = this;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:48:40
* @LastEditors: 无尘
* @LastEditTime: 2020-11-26 10:52:29
* @LastEditTime: 2020-11-26 18:02:46
-->
<template>
<div class="common-app-right">
......@@ -30,7 +30,7 @@
<el-table-column label="月指标">
<template slot-scope="scope">
<div>
<el-input class="w-120 p-l-8" maxlength="50" v-model="scope.row.performanceValue" placeholder="请输入" :disabled="disableSetting" @blur="value => inputPerformance(value, scope.$index, scope.row)">
<el-input class="w-120 p-l-8" maxlength="11" v-model="scope.row.performanceValue" placeholder="请输入" :disabled="disableSetting" @blur="value => inputPerformance(value, scope.$index, scope.row)">
<i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 12px;"></i>
</el-input>
</div>
......@@ -136,7 +136,7 @@ export default {
inputPerformance: function(val, index, row) {
const that = this;
row.performanceValue = !!Number(row.performanceValue.replace(/[^\d.]/g, '')) ? row.performanceValue.replace(/[^\d+(.\d+)]/g, '') : '';
row.performanceValue = Number(row.performanceValue).toFixed(2);
row.performanceValue = Number(row.performanceValue).toFixed(2) > 99999999.99 ? 99999999.99 : Number(row.performanceValue).toFixed(2);;
let sumData = 0;
that.tableData.forEach(ele => {
sumData += Number(ele.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