Commit c918d10c by 无尘

fix: 修改导购指标

parent 89c7d41d
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-11-12 10:48:40 * @Date: 2020-11-12 10:48:40
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-11-20 12:22:45 * @LastEditTime: 2020-11-20 14:51:29
--> -->
<template> <template>
<div class="common-app-right"> <div class="common-app-right">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</el-alert> </el-alert>
<div class="saler-set-title flex flex-space-between m-b-15"> <div class="saler-set-title flex flex-space-between m-b-15">
<div class="colorFirst"> <div class="colorFirst">
<span>{{ clerkObj.yearMonth }}</span><span class="p-l-18">{{ clerkObj.storeName }}</span> <span>{{ clerkObj.performanceYm }}</span><span class="p-l-18">{{ clerkObj.storeName }}</span>
</div> </div>
</div> </div>
<div class="saler-set-table"> <div class="saler-set-table">
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<el-table-column label="月指标"> <el-table-column label="月指标">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-input class="w-120 p-l-8" maxlength="50" v-model="scope.row.clerkPerformance" placeholder="请输入" :disabled="clerkObj.settingAble == 0 || scope.row.bindFlag == 0" @blur="value => inputPerformance(value, scope.$index, scope.row)"> <el-input class="w-120 p-l-8" maxlength="50" v-model="scope.row.performanceValue" placeholder="请输入" :disabled="clerkObj.settingAble == 0 || scope.row.bindFlag == 0" @blur="value => inputPerformance(value, scope.$index, scope.row)">
<i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 12px;"></i> <i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 12px;"></i>
</el-input> </el-input>
</div> </div>
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
</el-table-column> </el-table-column>
<el-table-column label="总计 >= 门店月指标" width="418px"> <el-table-column label="总计 >= 门店月指标" width="418px">
<template > <template >
<div><span class="font-14 color-606266 text-left">总计</span><span class=" p-l-175 font-14 color-606266 text-left">门店月指标</span></div> <div><span class="font-14 color-606266 text-left">导购总计</span><span class=" p-l-175 font-14 color-606266 text-left">门店月指标</span></div>
<div style="margin-top: 4px;"> <div style="margin-top: 4px;">
<el-input class="w-161" v-model="performanceSum" disabled> <el-input class="w-161" v-model="performanceSum" disabled>
<i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 10px;"></i> <i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 10px;"></i>
</el-input> </el-input>
<span class="p-l-10 p-r-10"> &gt;= </span> <span class="p-l-10 p-r-10"> &gt;= </span>
<el-input class="w-161 p-l-8" maxlength="50" v-model="clerkObj.storePerformance" placeholder="请输入指标值" disabled> <el-input class="w-161 p-l-8" maxlength="50" v-model="clerkObj.storePerformance" placeholder="指标值" disabled>
<i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 16px;"></i> <i slot="prefix" style="font-style: normal;position: absolute;top: 4px;left: 16px;"></i>
</el-input> </el-input>
</div> </div>
...@@ -78,16 +78,13 @@ export default { ...@@ -78,16 +78,13 @@ export default {
data() { data() {
return { return {
tableH: window.screen.availHeight - 464 - 126, tableH: window.screen.availHeight - 464 - 126,
activeTab: '1', tableData: [],
activeBrand: this.brandId, // 商户(品牌) id
operationStaffName: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).staffDTO['staffName'] : '',
activeId: '4',
tableData: [ {}, {} ],
performanceSum: '0.00', // 总指标 performanceSum: '0.00', // 总指标
clerkObj: { clerkObj: {
storeId: '', storeInfoId: '',
storeName: '', storeName: '',
yearMonth: '', performanceYm: '',
performanceSubType: '',
settingAble: 1, settingAble: 1,
storePerformance: 0 storePerformance: 0
}, },
...@@ -95,13 +92,16 @@ export default { ...@@ -95,13 +92,16 @@ export default {
}; };
}, },
mounted() { mounted() {
let that = this; const that = this;
this.$emit('showTab', '/target-list'); that.$emit('showTab', '/target-list');
let bread = [ { name: '指标管理', path: '/target-list' }, { name: '查看门店', path: '/target-store' }, { name: '完善导购指标' } ]; const { tab, applicationId, performanceYm, storeInfoId, storeName } = that.$route.query;
let bread = [ { name: '指标管理', path: `/target-list?tab=${tab}&applicationId=${applicationId}` }, { name: '查看门店', path: `/target-store?tab=${tab}&applicationId=${applicationId}` }, { name: '完善导购指标' } ];
// 修改面包屑 // 修改面包屑
this.$emit('change-nav', bread); that.$emit('change-nav', bread);
if (!!that.brandId) { if (!!that.brandId) {
that.clerkObj.performanceYm = performanceYm;
that.clerkObj.storeInfoId = storeInfoId;
that.clerkObj.storeName = storeName;
that.getData(); that.getData();
} }
}, },
...@@ -131,18 +131,18 @@ export default { ...@@ -131,18 +131,18 @@ export default {
*/ */
inputPerformance: function(val, index, row) { inputPerformance: function(val, index, row) {
const that = this; const that = this;
row.clerkPerformance = !!Number(row.clerkPerformance.replace(/[^\d.]/g, '')) ? row.clerkPerformance.replace(/[^\d+(.\d+)]/g, '') : ''; row.performanceValue = !!Number(row.performanceValue.replace(/[^\d.]/g, '')) ? row.performanceValue.replace(/[^\d+(.\d+)]/g, '') : '';
row.clerkPerformance = Number(row.clerkPerformance).toFixed(2); row.performanceValue = Number(row.performanceValue).toFixed(2);
let sumData = 0; let sumData = 0;
that.tableData.forEach(ele => { that.tableData.forEach(ele => {
sumData += Number(ele.clerkPerformance); sumData += Number(ele.performanceValue);
}); });
that.performanceSum = Number(sumData).toFixed(2); that.performanceSum = Number(sumData).toFixed(2);
that.diffData(); that.diffData();
}, },
diffData() { diffData() {
let that = this; const that = this;
let dataFlag = Number(that.performanceSum) > Number(that.clerkObj.storePerformance) || Number(that.performanceSum) == Number(that.clerkObj.storePerformance); let dataFlag = Number(that.performanceSum) > Number(that.clerkObj.storePerformance) || Number(that.performanceSum) == Number(that.clerkObj.storePerformance);
if (!dataFlag) { if (!dataFlag) {
that.equalFlag = false; that.equalFlag = false;
...@@ -168,20 +168,17 @@ export default { ...@@ -168,20 +168,17 @@ export default {
}); });
return false; return false;
} }
const data = { that.postSave();
clerkPerformanceList: that.tableData,
storePerformance: that.clerkObj.storePerformance,
operationStaffName: that.operationStaffName
};
that.postSave(data);
}, 500), }, 500),
postSave(data) { postSave() {
const that = this; const that = this;
const para = { const para = {
enterpriseId: that.activeBrand, enterpriseId: that.brandId,
storeId: that.clerkObj.storeId, storeInfoId: that.clerkObj.storeInfoId,
yearMonth: that.clerkObj.yearMonth, performanceYear: that.clerkObj.performanceYm.split('-')[0],
performance: JSON.stringify(data) performanceYm: that.clerkObj.performanceYm,
performanceType: that.$route.query.performanceType,
dataJson: JSON.stringify(that.tableData)
}; };
changeStorePerformanceClerk(para) changeStorePerformanceClerk(para)
.then(res => { .then(res => {
...@@ -205,24 +202,25 @@ export default { ...@@ -205,24 +202,25 @@ export default {
getData() { getData() {
const that = this; const that = this;
const para = { const para = {
enterpriseId: that.activeBrand, enterpriseId: that.brandId,
storeId: that.clerkObj.storeId, storeInfoId: that.clerkObj.storeInfoId,
yearMonth: that.clerkObj.yearMonth performanceYm: that.clerkObj.performanceYm,
performanceType: that.$route.query.performanceType,
performanceSubType: that.$route.query.performanceSubType
}; };
getStorePerformanceClerk(para) getStorePerformanceClerk(para)
.then(res => { .then(res => {
if (res.code == '0000') { if (res.code == '0000') {
if (!!res.result.clerkPerformanceList && !!res.result.clerkPerformanceList.length) { if (!!res.result && !!res.result.length) {
res.result.clerkPerformanceList.forEach(ele => { res.result.forEach(ele => {
ele.clerkPerformance = Number(ele.clerkPerformance).toFixed(2); ele.performanceValue = Number(ele.performanceValue).toFixed(2);
}); });
that.tableData = res.result.clerkPerformanceList || []; that.tableData = res.result || [];
} }
res.result.storePerformance = Number(res.result.storePerformance).toFixed(2); that.clerkObj.storePerformance = Number(that.$route.query.perfromanceValue).toFixed(2);
that.clerkObj = res.result;
let allSum = 0; let allSum = 0;
that.tableData.forEach(ele => { that.tableData.forEach(ele => {
allSum += Number(ele.clerkPerformance); allSum += Number(ele.performanceValue);
}); });
that.performanceSum = Number(allSum).toFixed(2); that.performanceSum = Number(allSum).toFixed(2);
return; return;
...@@ -241,9 +239,9 @@ export default { ...@@ -241,9 +239,9 @@ export default {
brandId: function(newData, oldData) { brandId: function(newData, oldData) {
const that = this; const that = this;
if (!!newData) { if (!!newData) {
that.activeBrand = newData; that.clerkObj.performanceYm = that.$route.query.performanceYm;
that.clerkObj.yearMonth = that.$route.query.yearMonth; that.clerkObj.storeInfoId = that.$route.query.storeInfoId;
that.clerkObj.storeId = that.$route.query.storeId; that.clerkObj.storeName = that.$route.query.storeName;
that.getData(); that.getData();
} }
} }
...@@ -251,7 +249,7 @@ export default { ...@@ -251,7 +249,7 @@ export default {
}; };
</script> </script>
<style type="text/scss" lang="scss" scoped> <style type="text/less" lang="less" scoped>
.task-set-content { .task-set-content {
box-sizing: border-box; box-sizing: border-box;
.w-105 { .w-105 {
......
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