Browse Source

(*)回款和业绩明细表 数据查询

master
wuqun 2 years ago
parent
commit
76d564c9f4
  1. 2
      api/app/lib/controllers/report/achievement.js
  2. 8
      api/app/lib/routes/report/index.js
  3. 29
      web/client/src/sections/business/actions/achievement-report.js
  4. 4
      web/client/src/sections/business/actions/index.js
  5. 107
      web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx
  6. 75
      web/client/src/sections/business/containers/performanceReport/backMoneyDetails.jsx
  7. 5
      web/client/src/utils/webapi.js

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

@ -42,7 +42,7 @@ async function getAchievementDetail(ctx) {
if (keywordTarget == 'dep' && keyword) { if (keywordTarget == 'dep' && keyword) {
where.department = { $like: `%${keyword}%` } where.department = { $like: `%${keyword}%` }
} }
let res = await models.ReceivableDetail.findAndCountAll({ let res = await models.PerformanceDetail.findAndCountAll({
where: where, where: where,
offset: Number(page) * Number(limit), offset: Number(page) * Number(limit),
limit: Number(limit), limit: Number(limit),

8
api/app/lib/routes/report/index.js

@ -10,9 +10,9 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/sales/member/list'] = { content: '查询销售人员分布明细表', visible: false }; app.fs.api.logAttr['GET/sales/member/list'] = { content: '查询销售人员分布明细表', visible: false };
router.get('/sales/member/list', report.getSalersReport); router.get('/sales/member/list', report.getSalersReport);
app.fs.api.logAttr['GET/received/detail'] = { content: '查询回款明细表', visible: false }; app.fs.api.logAttr['GET/detail/received/back'] = { content: '查询回款明细表', visible: false };
router.get('/received/detail', achieve.getReceivedDetail); router.get('/detail/received/back', achieve.getReceivedDetail);
app.fs.api.logAttr['GET/achievement/detail'] = { content: '查询业绩明细表', visible: false }; app.fs.api.logAttr['GET/detail/achievement'] = { content: '查询业绩明细表', visible: false };
router.get('/achievement/detail', achieve.getAchievementDetail); router.get('/detail/achievement', achieve.getAchievementDetail);
}; };

29
web/client/src/sections/business/actions/achievement-report.js

@ -0,0 +1,29 @@
'use strict';
import { ApiTable, basicAction } from '$utils'
//回款明细表
export function getReceivedDetail(query) {
return (dispatch) => basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_RECEIVED_DETAIL",
query: query,
url: `${ApiTable.getReceivedDetail}`,
msg: { option: "查询回款明细表" },
reducer: { name: "ReceivedDetail", params: { noClear: true } },
});
}
//业绩明细表
export function getAchievementDetail(query) {
return (dispatch) => basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_ACHIEVEMENT_DETAIL",
query: query,
url: `${ApiTable.getAchievementDetail}`,
msg: { option: "查询业绩明细表" },
reducer: { name: "AchievementDetail", params: { noClear: true } },
});
}

4
web/client/src/sections/business/actions/index.js

@ -1,7 +1,9 @@
'use strict'; 'use strict';
import * as reserveItem from './reserve-item'; import * as reserveItem from './reserve-item';
import * as salersReport from './salers-report'; import * as salersReport from './salers-report';
import * as achievementReport from './achievement-report';
export default { export default {
...reserveItem, ...reserveItem,
...salersReport ...salersReport,
...achievementReport
} }

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

@ -7,6 +7,7 @@ import '../../style.less';
const AchievementDetails = (props) => { const AchievementDetails = (props) => {
const { dispatch, actions } = props const { dispatch, actions } = props
const { businessManagement } = actions
const [keywordTarget, setKeywordTarget] = useState('saler'); const [keywordTarget, setKeywordTarget] = useState('saler');
const [keyword, setKeyword] = useState('');// const [keyword, setKeyword] = useState('');//
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
@ -16,15 +17,29 @@ const AchievementDetails = (props) => {
function seachValueChange(value) { function seachValueChange(value) {
setKeyword(value) setKeyword(value)
} }
useEffect(() => {
getAchievementDetails()
}, []);
function getAchievementDetails() {
dispatch(businessManagement.getAchievementDetail({ keywordTarget, keyword, ...query })).then(r => {
if (r.success) {
setTableData(r.payload?.data?.rows);
setLimits(r.payload?.data?.count)
}
})
}
const columns = [{ const columns = [{
title: '收到合同日期', title: '收到合同日期',
dataIndex: 'year', dataIndex: 'recConDate',
key: 'year', key: 'recConDate',
width: 120, width: 120,
}, { }, {
title: '月份', title: '月份',
dataIndex: 'id', dataIndex: 'month',
key: 'id', key: 'month',
width: 120, width: 120,
}, { }, {
title: '部门', title: '部门',
@ -33,108 +48,108 @@ const AchievementDetails = (props) => {
width: 140, width: 140,
}, { }, {
title: '销售人员', title: '销售人员',
dataIndex: 'salers', dataIndex: 'sale',
key: 'salers', key: 'sale',
width: 140, width: 140,
}, { }, {
title: '客户名称', title: '客户名称',
dataIndex: 'name', dataIndex: 'customer',
key: 'name', key: 'customer',
width: 140, width: 140,
}, { }, {
title: '项目名称', title: '项目名称',
dataIndex: 'projectName', dataIndex: 'item',
key: 'projectName', key: 'item',
width: 140, width: 140,
}, { }, {
title: '合同金额', title: '合同金额',
dataIndex: 'money', dataIndex: 'amount',
key: 'money', key: 'amount',
width: 140, width: 140,
}, { }, {
title: '实际业绩', title: '实际业绩',
dataIndex: 'moneyAfterChange', dataIndex: 'realPerformance',
key: 'moneyAfterChange', key: 'realPerformance',
width: 140, width: 140,
}, { }, {
title: '考核业绩', title: '考核业绩',
dataIndex: 'backYear', dataIndex: 'assessmentPerformance',
key: 'backYear', key: 'assessmentPerformance',
width: 120, width: 120,
}, { }, {
title: '价格是否特批', title: '价格是否特批',
dataIndex: 'backDate', dataIndex: 'isApproval',
key: 'backDate', key: 'isApproval',
width: 120, width: 120,
}, { }, {
title: '特批折算比例', title: '特批折算比例',
dataIndex: 'backMoney', dataIndex: 'approvalProp',
key: 'backMoney', key: 'approvalProp',
width: 120, width: 120,
}, { }, {
title: '预支提成及委外费用', title: '预支提成及委外费用',
dataIndex: 'invoiceBack', dataIndex: 'cost',
key: 'invoiceBack', key: 'cost',
width: 140, width: 140,
}, { }, {
title: '业务线', title: '业务线',
dataIndex: 'leaveMoney', dataIndex: 'serviceLine',
key: 'leaveMoney', key: 'serviceLine',
width: 120, width: 120,
}, { }, {
title: '客户类型', title: '客户类型',
dataIndex: 'payConfirmTime', dataIndex: 'cusType',
key: 'payConfirmTime', key: 'cusType',
width: 140, width: 140,
}, { }, {
title: '行业', title: '行业',
dataIndex: 'thirdPayer', dataIndex: 'industry',
key: 'thirdPayer', key: 'industry',
width: 140, width: 140,
}, { }, {
title: '信息来源', title: '信息来源',
dataIndex: 'desc', dataIndex: 'source',
key: 'desc', key: 'source',
width: 120, width: 120,
}, { }, {
title: '项目类型', title: '项目类型',
dataIndex: 'leaveMoney', dataIndex: 'itemType',
key: 'leaveMoney', key: 'itemType',
width: 120, width: 120,
}, { }, {
title: '客户省份', title: '客户省份',
dataIndex: 'payConfirmTime', dataIndex: 'cusProvince',
key: 'payConfirmTime', key: 'cusProvince',
width: 140, width: 140,
}, { }, {
title: '客户属性', title: '客户属性',
dataIndex: 'thirdPayer', dataIndex: 'cusAttribute',
key: 'thirdPayer', key: 'cusAttribute',
width: 140, width: 140,
}, { }, {
title: '复购次数', title: '复购次数',
dataIndex: 'desc', dataIndex: 'repurchaseCount',
key: 'desc', key: 'repurchaseCount',
width: 120, width: 120,
}, { }, {
title: '是否可复制的业务路径', title: '是否可复制的业务路径',
dataIndex: 'leaveMoney', dataIndex: 'reproducible',
key: 'leaveMoney', key: 'reproducible',
width: 120, width: 120,
}, { }, {
title: '省外业务1.1', title: '省外业务1.1',
dataIndex: 'payConfirmTime', dataIndex: 'outProvince',
key: 'payConfirmTime', key: 'outProvince',
width: 140, width: 140,
}, { }, {
title: '复购业务1.05', title: '复购业务1.05',
dataIndex: 'thirdPayer', dataIndex: 'repurchase',
key: 'thirdPayer', key: 'repurchase',
width: 140, width: 140,
}, { }, {
title: '可复制的业务路径1.1', title: '可复制的业务路径1.1',
dataIndex: 'desc', dataIndex: 'isreproduce',
key: 'desc', key: 'isreproduce',
width: 120, width: 120,
}] }]
function handleRow(record, index) {// function handleRow(record, index) {//

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

@ -7,6 +7,7 @@ import '../../style.less';
const BackMoneyDetails = (props) => { const BackMoneyDetails = (props) => {
const { dispatch, actions } = props const { dispatch, actions } = props
const { businessManagement } = actions
const [keywordTarget, setKeywordTarget] = useState('contract'); const [keywordTarget, setKeywordTarget] = useState('contract');
const [keyword, setKeyword] = useState('');// const [keyword, setKeyword] = useState('');//
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
@ -16,6 +17,20 @@ const BackMoneyDetails = (props) => {
function seachValueChange(value) { function seachValueChange(value) {
setKeyword(value) setKeyword(value)
} }
useEffect(() => {
getBackMoneyDetails()
}, []);
function getBackMoneyDetails() {
dispatch(businessManagement.getReceivedDetail({ keywordTarget, keyword, ...query })).then(r => {
if (r.success) {
setTableData(r.payload?.data?.rows);
setLimits(r.payload?.data?.count)
}
})
}
const columns = [{ const columns = [{
title: '年度', title: '年度',
dataIndex: 'year', dataIndex: 'year',
@ -23,8 +38,8 @@ const BackMoneyDetails = (props) => {
width: 120, width: 120,
}, { }, {
title: '序号', title: '序号',
dataIndex: 'id', dataIndex: 'serialNo',
key: 'id', key: 'serialNo',
width: 120, width: 120,
}, { }, {
title: '编号', title: '编号',
@ -38,73 +53,73 @@ const BackMoneyDetails = (props) => {
width: 140, width: 140,
}, { }, {
title: '销售人员', title: '销售人员',
dataIndex: 'salers', dataIndex: 'sale',
key: 'salers', key: 'sale',
width: 140, width: 140,
}, { }, {
title: '合同编号', title: '合同编号',
dataIndex: 'contractNumber', dataIndex: 'contractNo',
key: 'contractNumber', key: 'contractNo',
width: 140, width: 140,
}, { }, {
title: '客户名称', title: '客户名称',
dataIndex: 'name', dataIndex: 'customer',
key: 'name', key: 'customer',
width: 140, width: 140,
}, { }, {
title: '项目名称', title: '项目名称',
dataIndex: 'projectName', dataIndex: 'item',
key: 'projectName', key: 'item',
width: 140, width: 140,
}, { }, {
title: '合同金额', title: '合同金额',
dataIndex: 'money', dataIndex: 'amount',
key: 'money', key: 'amount',
width: 140, width: 140,
}, { }, {
title: '变更后合同金额', title: '变更后合同金额',
dataIndex: 'moneyAfterChange', dataIndex: 'changeAmount',
key: 'moneyAfterChange', key: 'changeAmount',
width: 140, width: 140,
}, { }, {
title: '回款年份', title: '回款年份',
dataIndex: 'backYear', dataIndex: 'receivableYear',
key: 'backYear', key: 'receivableYear',
width: 120, width: 120,
}, { }, {
title: '回款日期', title: '回款日期',
dataIndex: 'backDate', dataIndex: 'receivableDate',
key: 'backDate', key: 'receivableDate',
width: 120, width: 120,
}, { }, {
title: '回款金额', title: '回款金额',
dataIndex: 'backMoney', dataIndex: 'receivableAmount',
key: 'backMoney', key: 'receivableAmount',
width: 120, width: 120,
}, { }, {
title: '开票-回款', title: '开票-回款',
dataIndex: 'invoiceBack', dataIndex: 'invoicedBack',
key: 'invoiceBack', key: 'invoicedBack',
width: 140, width: 140,
}, { }, {
title: '剩余合同金额', title: '剩余合同金额',
dataIndex: 'leaveMoney', dataIndex: 'remainConAmount',
key: 'leaveMoney', key: 'remainConAmount',
width: 120, width: 120,
}, { }, {
title: '收入确认时间', title: '收入确认时间',
dataIndex: 'payConfirmTime', dataIndex: 'incomeConfirmdate',
key: 'payConfirmTime', key: 'incomeConfirmdate',
width: 140, width: 140,
}, { }, {
title: '第三方付款单位', title: '第三方付款单位',
dataIndex: 'thirdPayer', dataIndex: 'thirdPayment',
key: 'thirdPayer', key: 'thirdPayment',
width: 140, width: 140,
}, { }, {
title: '备注', title: '备注',
dataIndex: 'desc', dataIndex: 'remark',
key: 'desc', key: 'remark',
width: 120, width: 120,
}] }]
function handleRow(record, index) {// function handleRow(record, index) {//

5
web/client/src/utils/webapi.js

@ -18,8 +18,11 @@ export const ApiTable = {
//项目报表 //项目报表
getReserveItemReport: "reserveItem/report/{type}", getReserveItemReport: "reserveItem/report/{type}",
//销售人员分布明细表
getSalesList: 'sales/member/list', getSalesList: 'sales/member/list',
//业绩报表
getReceivedDetail: 'detail/received/back',
getAchievementDetail: 'detail/achievement',
}; };
export const RouteTable = { export const RouteTable = {
apiRoot: "/api/root", apiRoot: "/api/root",

Loading…
Cancel
Save