Browse Source

开票明细查询暂交

master
zmh 2 years ago
parent
commit
c0975ab380
  1. 28
      api/app/lib/controllers/report/achievement.js
  2. 3
      api/app/lib/routes/report/index.js
  3. 13
      web/client/src/sections/business/actions/achievement-report.js
  4. 9
      web/client/src/sections/business/containers/performanceReport/contractDetails.jsx
  5. 75
      web/client/src/sections/business/containers/performanceReport/invoicingDetails.jsx
  6. 9
      web/client/src/utils/webapi.js

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

@ -283,8 +283,36 @@ async function getContractDetail(ctx) {
ctx.body = { name: 'FindError', message: '查询合同明细表数据失败' } ctx.body = { name: 'FindError', message: '查询合同明细表数据失败' }
} }
} }
/**
* 查询开票明细表数据
* @param {*} ctx ctx ctx.query:{keywordTarget-关键字项keyword-关键字内容limit-页宽, page-页码}
*/
async function getInvoicingDetail(ctx) {
try {
const { models } = ctx.fs.dc;
const { keywordTarget, keyword, limit, page } = ctx.query;
const where = {};
if (keywordTarget && keyword) {
where[keywordTarget] = { $iLike: `%${keyword}%` };
}
let invoiceDetail = await models.InvoiceDetail.findAndCountAll({
where: where,
offset: Number(page) * Number(limit),
limit: Number(limit),
order: [['id', 'DESC']]
});
ctx.status = 200
ctx.body = invoiceDetail;
} catch (error) {
ctx.fs.logger.error(`path:${ctx.path},error:${error}`)
ctx.status = 400;
ctx.body = { name: 'FindError', message: '查询开票明细表数据失败' }
}
}
module.exports = { module.exports = {
getReceivedDetail,//回款 getReceivedDetail,//回款
getAchievementDetail,//业绩 getAchievementDetail,//业绩
getContractDetail, getContractDetail,
getInvoicingDetail
} }

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

@ -18,4 +18,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/contract/detail'] = { content: '查询合同明细表', visible: false }; app.fs.api.logAttr['GET/contract/detail'] = { content: '查询合同明细表', visible: false };
router.get('/contract/detail', achieve.getContractDetail); router.get('/contract/detail', achieve.getContractDetail);
app.fs.api.logAttr['GET/invoicing/detail'] = { content: '查询开票明细表', visible: false };
router.get('/invoicing/detail', achieve.getInvoicingDetail);
}; };

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

@ -39,4 +39,17 @@ export function getContractDetail(query) {
msg: { option: "查询合同明细表" }, msg: { option: "查询合同明细表" },
reducer: { name: "ContractDetail", params: { noClear: true } }, reducer: { name: "ContractDetail", params: { noClear: true } },
}); });
}
//查询开票明细表
export function getInvoicingDetail(query) {
return (dispatch) => basicAction({
type: "get",
dispatch: dispatch,
actionType: "GET_INVOICING_DETAIL",
query: query,
url: `${ApiTable.getInvoicingDetail}`,
msg: { option: "查询开票明细表" },
reducer: { name: "InvoicingDetail", params: { noClear: true } },
});
} }

9
web/client/src/sections/business/containers/performanceReport/contractDetails.jsx

@ -23,6 +23,7 @@ const ContractDetails = (props) => {
const [exportUrl, setExportUrl] = useState(''); const [exportUrl, setExportUrl] = useState('');
const page = useRef(query.page); const page = useRef(query.page);
const scroll = useMemo(() => ({}), []);
const CONTRACTDETAILS = "contractDetails"; const CONTRACTDETAILS = "contractDetails";
const renderColumns = (columnKeys) => { const renderColumns = (columnKeys) => {
@ -108,7 +109,6 @@ const ContractDetails = (props) => {
} }
}) })
} }
const scroll = useMemo(() => ({}), []);
return ( return (
<> <>
<div style={{ padding: '0px 12px' }}> <div style={{ padding: '0px 12px' }}>
@ -160,9 +160,10 @@ const ContractDetails = (props) => {
onClick={() => { setImportModalV(true); }}> onClick={() => { setImportModalV(true); }}>
导入 导入
</div> </div>
<div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18 }} onClick={() => { <div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18, cursor: "pointer" }}
exportAllData() onClick={() => {
}}> exportAllData()
}}>
导出全部 导出全部
</div> </div>
</div> </div>

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

@ -1,6 +1,6 @@
import React, { useEffect, useState, useRef, useMemo } from 'react'; import React, { useEffect, useState, useRef, useMemo } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Select, Input, Button, Table, Pagination, Skeleton } from '@douyinfe/semi-ui'; import { Select, Input, Button, Table, Pagination, Skeleton, Toast, } from '@douyinfe/semi-ui';
import { SkeletonScreen, Setup } from "$components"; import { SkeletonScreen, Setup } from "$components";
import { IconSearch } from '@douyinfe/semi-icons'; import { IconSearch } from '@douyinfe/semi-icons';
import ImportInvoicingDetailsModal from './importInvoicingDetailsModal'; import ImportInvoicingDetailsModal from './importInvoicingDetailsModal';
@ -10,7 +10,7 @@ import moment from 'moment'
const InvoicingDetails = (props) => { const InvoicingDetails = (props) => {
const { dispatch, actions } = props const { dispatch, actions } = props
const { } = actions; const { businessManagement } = actions;
const [keywordTarget, setKeywordTarget] = useState('contractNo'); const [keywordTarget, setKeywordTarget] = useState('contractNo');
const [keyword, setKeyword] = useState('');// const [keyword, setKeyword] = useState('');//
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
@ -20,6 +20,11 @@ const InvoicingDetails = (props) => {
const [setup, setSetup] = useState(false);// const [setup, setSetup] = useState(false);//
const [setupp, setSetupp] = useState([]);// const [setupp, setSetupp] = useState([]);//
const [exportUrl, setExportUrl] = useState('');
const page = useRef(query.page);
const scroll = useMemo(() => ({}), []);
const INVOICINGDETAILS = "invoicingDetails"; const INVOICINGDETAILS = "invoicingDetails";
const renderColumns = (columnKeys) => { const renderColumns = (columnKeys) => {
let columns = []; let columns = [];
@ -52,6 +57,7 @@ const InvoicingDetails = (props) => {
) )
: ""; : "";
attribute(); attribute();
getInvoicingDetailData();
}, []); }, []);
// //
function attribute() { function attribute() {
@ -66,9 +72,16 @@ const InvoicingDetails = (props) => {
} }
setSetupp(newColumns); setSetupp(newColumns);
} }
useEffect(() => {
}, [query]) function getInvoicingDetailData(param) {
let queryParam = param || query;
dispatch(businessManagement.getInvoicingDetail({ keywordTarget, keyword, ...queryParam })).then(r => {
if (r.success) {
setTableData(r.payload?.data?.rows);
setLimits(r.payload?.data?.count);
}
})
}
function handleRow(record, index) {// function handleRow(record, index) {//
if (index % 2 === 0) { if (index % 2 === 0) {
return { return {
@ -80,7 +93,22 @@ const InvoicingDetails = (props) => {
return {}; return {};
} }
} }
const scroll = useMemo(() => ({}), []);
const exportAllData = () => {
dispatch(businessManagement.getInvoicingDetail({ limit: 1, page: 0 })).then((res) => {
if (res.success) {
if (res.payload.data.count) {
let url = `export/invoicing/detail?token=${user.token}&timestamp=${moment().valueOf()}`
setExportUrl(url);
} else {
Toast.info({
content: '暂无可导出的数据',
duration: 3,
})
}
}
})
}
return ( return (
<> <>
<div style={{ padding: '0px 12px' }}> <div style={{ padding: '0px 12px' }}>
@ -120,6 +148,7 @@ const InvoicingDetails = (props) => {
<Button theme='solid' type='primary' style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }} <Button theme='solid' type='primary' style={{ width: 80, borderRadius: 2, height: 32, background: '#DBECFF', color: '#005ABD' }}
onClick={() => { onClick={() => {
setQuery({ limit: 10, page: 0 }) setQuery({ limit: 10, page: 0 })
getInvoicingDetailData({ limit: 10, page: 0 })
}}>查询</Button> }}>查询</Button>
</div> </div>
<div style={{ display: 'flex', marginRight: 20 }}> <div style={{ display: 'flex', marginRight: 20 }}>
@ -130,7 +159,10 @@ const InvoicingDetails = (props) => {
onClick={() => { setImportModalV(true); }}> onClick={() => { setImportModalV(true); }}>
导入 导入
</div> </div>
<div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18 }}> <div style={{ padding: '6px 20px', background: '#00BA85', color: '#FFFFFF', fontSize: 14, marginLeft: 18, cursor: "pointer" }}
onClick={() => {
exportAllData()
}}>
导出全部 导出全部
</div> </div>
</div> </div>
@ -185,20 +217,25 @@ const InvoicingDetails = (props) => {
setImportModalV(false); setImportModalV(false);
}} /> : '' }} /> : ''
} }
{
exportUrl ? <iframe src={`/_api/${exportUrl}`} style={{ display: 'none' }} /> : ''
}
</div> </div>
{setup ? ( {
<Setup setup ? (
tableType={INVOICINGDETAILS} <Setup
tableList={tableList} tableType={INVOICINGDETAILS}
length={19} tableList={tableList}
close={() => { length={19}
setSetup(false); close={() => {
attribute(); setSetup(false);
}} attribute();
/> }}
) : ( />
"" ) : (
)} ""
)
}
</> </>
) )
} }

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

@ -24,10 +24,11 @@ export const ApiTable = {
getReceivedDetail: 'detail/received/back', getReceivedDetail: 'detail/received/back',
getAchievementDetail: 'detail/achievement', getAchievementDetail: 'detail/achievement',
getContractDetail: 'contract/detail', getContractDetail: 'contract/detail',
getInvoicingDetail: 'invoicing/detail',
}; };
export const RouteTable = { export const RouteTable = {
apiRoot: "/api/root", apiRoot: "/api/root",
fileUpload: "/_upload/new", fileUpload: "/_upload/new",
cleanUpUploadTrash: "/_upload/cleanup", cleanUpUploadTrash: "/_upload/cleanup",
getServiceUrl: '/_service/url' getServiceUrl: '/_service/url'
}; };

Loading…
Cancel
Save