Commit 1e7d9338 by 无尘

fix: 修改批量设置日指标

parent f9648d44
......@@ -4,14 +4,14 @@
* @Author: 无尘
* @Date: 2020-04-14 09:50:16
* @LastEditors: 无尘
* @LastEditTime: 2020-08-28 16:14:47
* @LastEditTime: 2020-11-24 13:43:30
-->
<!--
<contact-sync-dialog :sync-data="syncData"></contact-sync-dialog>
import contactSyncDialog from '@/components/company/contact-sync-dialog.vue';
-->
<template>
<el-dialog class="hide-header-dialog" center title="" :visible.sync="dialogVisible" width="600px" :before-close="handleClose">
<el-dialog class="hide-header-dialog" center title="" :visible.sync="dialogVisible" width="600px" :show-close="false" :before-close="handleClose">
<div class="m-b-20 text-center">
<div class="el-progress-bar" style="width:350px;margin: 0 auto;">
<div class="el-progress-bar__outer" style="height: 8px;">
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-09-21 15:37:51
* @LastEditTime: 2020-11-24 14:03:24
*/
import 'babel-polyfill';
import promise from 'es6-promise';
......@@ -19,6 +19,7 @@ import axios from 'axios';
import ElementUI from 'element-ui';
import App from './App.vue';
import router from './router';
import store from '@/store/index.js';
import { routes } from './router/routes.js';
import filters from '@/filters/index.js';
import { permission, itemPerm } from '@/utils/permission.js';
......@@ -54,6 +55,7 @@ permission({
/* eslint-disable no-new */
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app');
}
......
/*
* @Descripttion: 状态管理
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-24 14:03:43
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24 14:08:19
*/
import Vuex from 'vuex';
import Vue from 'vue';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
storeInfo: [], // 批量选择的门店信息
},
mutations: {
saveStore: (state, data) => {
state.storeInfo = data;
},
clearData: state => {
state.storeInfo = [];
},
},
actions: {
saveStoreInfo(context, data) {
context.commit('saveStore', data);
},
clearStoreData(context, data) {
context.commit('clearData');
}
}
});
......@@ -213,6 +213,7 @@ export default {
img {
max-width: 100%;
max-height: 100%;
border-radius: 8px;
}
&.no-logo {
background: #E4E7ED;
......
......@@ -4,18 +4,18 @@
* @Author: 无尘
* @Date: 2020-11-12 10:47:17
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24 09:25:51
* @LastEditTime: 2020-11-24 14:34:13
-->
<template>
<div class="common-app-right" style="padding: 20px 0;color: #303133">
<el-form :model="form" label-width="110px">
<el-form-item label="门店名称">{{ form.storeName || '--' }}</el-form-item>
<el-form-item label="指标额">
<el-form-item v-if="!form.multOpt" label="指标额">
{{ parseFloat(form.performanceValue).toFixed(2) }}
<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="">
<el-form-item v-if="!form.multOpt" label="">
<div class="content-data">
<span class="color2">月指标:¥ </span>
<span class="color1">{{ parseFloat(form.performanceValue).toFixed(2) }}</span>
......@@ -46,7 +46,7 @@
<li v-for="(item, i) in tableData" :key="i">
<div>{{ item.performanceDay }}</div>
<el-input-number v-model="item.performanceValue" :precision="2" :controls="false" style="width: 80px;margin-left:40px;margin-top:5px"></el-input-number>
<el-input-number v-model="item.performanceValue" :precision="2" :controls="false" :max="999999999" style="width: 80px;margin-left:40px;margin-top:5px"></el-input-number>
</li>
<!-- 补充空白 -->
......@@ -119,6 +119,7 @@ export default {
storeName: '',
performanceValue: 0,
flag: false, // true: 查看, false: 首次完善
multOpt: '', // 1:批量,
date: [ '', '' ]
},
loading: false,
......@@ -133,11 +134,17 @@ export default {
value: ''
},
dialogVisible: false,
haoban: {}
haoban: {},
};
},
created() {
this.form = JSON.parse(JSON.stringify(this.$route.query));
// 批量操作判断
if (!!this.$route.query.multOpt && this.$route.query.multOpt == 1) {
this.form.multOpt = 1;
}else {
this.form.multOpt = '';
}
const { staffName, staffId, wxEnterpriseId } = JSON.parse(localStorage.getItem('haoBanUser'));
this.haoban = { staffName, staffId, wxEnterpriseId };
......@@ -153,6 +160,9 @@ export default {
mounted() {
this.$emit('showTab', '/target-list');
},
beforeDestroy() {
this.$store.dispatch('clearStoreData');
},
methods: {
// 修改月指标
modMonthTarget() {
......@@ -164,7 +174,12 @@ export default {
// 初始化表格
init() {
const that = this;
let { date, flag, performanceType, performanceYm, performanceSubType, storeInfoId } = this.form;
if (that.$store.state.storeInfo.length) {
that.form.storeName = JSON.parse(JSON.stringify(that.$store.state.storeInfo)).map(ele=>ele.storeName).join(',');
that.form.storeInfoIds = JSON.parse(JSON.stringify(that.$store.state.storeInfo)).map(ele=>ele.storeInfoId).join(',');
delete that.form.storeInfoId;
}
let { date, flag, performanceType, performanceYm, performanceSubType, storeInfoId } = that.form;
date = date && date.length ? date : [ 2020, 1 ];
let week = new Date(date[0], date[1] - 1).getDay(); // 第一天周几
let days = that.days = new Date(date[0], date[1], 0).getDate(); // 一个月天数
......@@ -262,6 +277,7 @@ export default {
changeStorePerformanceDay(params, { headers: { sign: that.brandId } })
.then(res => {
that.$message.success('保存成功');
that.$store.dispatch('clearStoreData');
that.$router.go(-1);
})
.finally(() => that.loading = false);
......
......@@ -4,14 +4,14 @@
* @Author: 无尘
* @Date: 2020-11-09 10:05:27
* @LastEditors: 无尘
* @LastEditTime: 2020-11-20 15:38:05
* @LastEditTime: 2020-11-24 12:05:59
-->
<!-- -->
<template>
<div class="common-app-right">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="30px" class="demo-ruleForm" @submit.native.prevent>
<el-form-item label="" prop="days">
<span class="font-14 color-606266">下发时间当月,第 </span><el-input-number controls-position="right" class="w-100" v-model="ruleForm.days" placeholder="请输入" :step="1" :step-strictly="true" :min="1" :max="28"></el-input-number><span class="font-14 color-606266 p-l-10"></span>
<span class="font-14 color-606266">下发时间当月,第 </span><el-input-number controls-position="right" class="w-100" v-model="ruleForm.days" placeholder="请输入" :step="1" :step-strictly="true" :min="15" :max="28"></el-input-number><span class="font-14 color-606266 p-l-10"></span>
<span class="font-14 color-909399 p-l-35">注:如当月第28天下发,如果现在是1月份,即1月28号下发2月份指标。设置后次日生效</span>
</el-form-item>
<el-form-item>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-09 10:39:37
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:40:34
* @LastEditTime: 2020-11-24 14:20:31
-->
<template>
<div class="common-app-right">
......@@ -59,7 +59,7 @@
</div>
<el-select placeholder="批量操作" @change="batchOperation">
<el-select v-model="multValue" :disabled="search.performanceSubType == 2" placeholder="批量操作" @change="batchOperation">
<el-option label="完善日指标" :value="1"></el-option>
</el-select>
</div>
......@@ -221,6 +221,7 @@ export default {
flag: '',
},
multValue: '', // 批量完善日指标
multipleSelection: [],
tableData: [],
loading: false,
......@@ -278,11 +279,18 @@ export default {
.catch(() => this.tableData = [])
.finally(() => this.loading = false);
},
// 批量完善日指标
batchOperation(val) {
const that = this;
if (!that.multipleSelection.length) {
that.$message.warning('请选择门店');
that.multValue = '';
return false;
}
switch (val) {
case 1:
return this.$router.push({ path: '/edit-store-quota', query: { applicationId: this.applicationId } });
that.$store.dispatch('saveStoreInfo', that.multipleSelection);
return this.$router.push(`perfect-day-target?applicationId=${this.applicationId}&tab=${that.haoban.performanceType}&performanceYm=${that.haoban.performanceYm}&performanceSubType=${that.search.performanceSubType}&performanceType=${that.haoban.performanceType}&storeInfoId=&storeName=&performanceValue=0&flag=false&multOpt=1`);
case 3:
if (!this.multipleSelection || !this.multipleSelection.length) return this.$message.warning('请选择指标门店');
// 判断是否一致
......
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