Browse Source

(*)业绩明细字段优化

master
wuqun 2 years ago
parent
commit
f0ef5f9f48
  1. 2
      .vscode/launch.json
  2. 12
      api/app/lib/controllers/report/achievement.js
  3. 6
      web/client/src/sections/business/constants/index.js
  4. 2
      web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx
  5. 2
      web/client/src/sections/business/containers/performanceReport/backMoneyDetails.jsx

2
.vscode/launch.json

@ -45,7 +45,7 @@
"-g postgres://FashionAdmin:123456@10.8.30.36:5432/data_center", "-g postgres://FashionAdmin:123456@10.8.30.36:5432/data_center",
"--redisHost localhost", "--redisHost localhost",
"--redisPort 6379", "--redisPort 6379",
"--apiEmisUrl http://10.8.30.103:14000", // "--apiEmisUrl http://localhost:14000", //
// "--apiEmisUrl http://10.8.30.161:1111", // // "--apiEmisUrl http://10.8.30.161:1111", //
// //
// //

12
api/app/lib/controllers/report/achievement.js

@ -102,7 +102,7 @@ async function exportReceivedDetail(ctx, dataList) {
exportData.push(item) exportData.push(item)
} }
const fileName = `回款明细表_${moment().format('YYYYMMDDHHmmss')}` + '.xlsx' const fileName = `回款明细表_${moment().format('YYYYMMDDHHmmss')}` + '.xlsx'
const filePath = await simpleExcelDown({ data: exportData, header, fileName: fileName }) const filePath = await simpleExcelDown({ data: exportData, header, fileName: fileName, needIndexCell: false })
const fileData = fs.readFileSync(filePath); const fileData = fs.readFileSync(filePath);
ctx.status = 200; ctx.status = 200;
ctx.set('Content-Type', 'application/x-xls'); ctx.set('Content-Type', 'application/x-xls');
@ -225,20 +225,20 @@ async function exportAchievementDetail(ctx, dataList) {
title: '是否可复制的业务路径', title: '是否可复制的业务路径',
key: 'reproducible', key: 'reproducible',
}, { }, {
title: '省外业务1.1', title: '省外业务',
key: 'outProvince', key: 'outProvince',
}, { }, {
title: '复购业务1.05', title: '复购业务',
key: 'repurchase', key: 'repurchase',
}, { }, {
title: '可复制的业务路径1.1', title: '可复制的业务路径',
key: 'isreproduce', key: 'isreproduce',
}] }]
const { utils: { simpleExcelDown } } = ctx.app.fs; const { utils: { simpleExcelDown } } = ctx.app.fs;
let exportData = [] let exportData = []
for (let { dataValues: item } of dataList) { for (let { dataValues: item } of dataList) {
item.isApproval = item.isApproval ? '是' : '否'; item.isApproval = JSON.stringify(item.isApproval) === 'null' ? '-' : item.isApproval ? '是' : '否';
item.reproducible = item.reproducible ? '是' : '否'; item.reproducible = JSON.stringify(item.reproducible) === 'null' ? '-' : item.reproducible ? '是' : '否';
exportData.push(item) exportData.push(item)
} }
const fileName = `业绩明细表_${moment().format('YYYYMMDDHHmmss')}` + '.xlsx' const fileName = `业绩明细表_${moment().format('YYYYMMDDHHmmss')}` + '.xlsx'

6
web/client/src/sections/business/constants/index.js

@ -116,7 +116,7 @@ export const achievementColumnKeys = {
cusAttribute: '客户属性', cusAttribute: '客户属性',
repurchaseCount: '复购次数', repurchaseCount: '复购次数',
reproducible: '是否可复制的业务路径', reproducible: '是否可复制的业务路径',
outProvince: '省外业务1.1', outProvince: '省外业务',
repurchase: '复购业务1.05', repurchase: '复购业务',
isreproduce: '可复制的业务路径1.1', isreproduce: '可复制的业务路径',
} }

2
web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx

@ -46,7 +46,7 @@ const AchievementDetails = (props) => {
switch (key) { switch (key) {
default: default:
columns.push({ columns.push({
title: columnKeys[key], dataIndex: key, key: key, width: 130, title: columnKeys[key], dataIndex: key, key: key, width: 120,
render: (text, record) => ['isApproval', 'reproducible'].indexOf(key) != -1 ? JSON.stringify(text) === 'null' ? '-' : text ? '是' : '否' render: (text, record) => ['isApproval', 'reproducible'].indexOf(key) != -1 ? JSON.stringify(text) === 'null' ? '-' : text ? '是' : '否'
: text === 0 ? text : text ? text : '-' : text === 0 ? text : text ? text : '-'
}); });

2
web/client/src/sections/business/containers/performanceReport/backMoneyDetails.jsx

@ -45,7 +45,7 @@ const BackMoneyDetails = (props) => {
switch (key) { switch (key) {
default: default:
columns.push({ columns.push({
title: columnKeys[key], dataIndex: key, key: key, width: 130, title: columnKeys[key], dataIndex: key, key: key, width: 115,
render: (text, record) => text === 0 ? text : text ? text : '-' render: (text, record) => text === 0 ? text : text ? text : '-'
}); });
break; break;

Loading…
Cancel
Save