|
@@ -13,6 +13,64 @@ const path = require('path');
|
|
|
let savePath;
|
|
|
const mockData = {};
|
|
|
|
|
|
+const testSetting1 = {
|
|
|
+ postData: {
|
|
|
+ account: 'fuqingqing',
|
|
|
+ project: 'P0505',
|
|
|
+ project_password: '123456',
|
|
|
+ },
|
|
|
+ define: {
|
|
|
+ enable: true,
|
|
|
+ setting: JSON.stringify({
|
|
|
+ title: '请选择汇总的标段',
|
|
|
+ type: 'final',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ select: {
|
|
|
+ tenders: [{tid: 2283}, {tid: 2281}],
|
|
|
+ type: 'final',
|
|
|
+ }
|
|
|
+};
|
|
|
+const testSetting2 = {
|
|
|
+ postData: {
|
|
|
+ account: 'zengpeiwen',
|
|
|
+ project: 'P1201',
|
|
|
+ project_password: '123456',
|
|
|
+ },
|
|
|
+ define: {
|
|
|
+ enable: true,
|
|
|
+ setting: JSON.stringify({
|
|
|
+ title: '请选择汇总的标段',
|
|
|
+ type: 'final',
|
|
|
+ })
|
|
|
+ },
|
|
|
+ select: {
|
|
|
+ tenders: [{tid: 2046}, {tid: 1942}, {tid: 2217}],
|
|
|
+ type: 'final',
|
|
|
+ }
|
|
|
+};
|
|
|
+const testSetting3 = {
|
|
|
+ postData: {
|
|
|
+ account: 'zengpeiwen',
|
|
|
+ project: 'P1201',
|
|
|
+ project_password: '123456',
|
|
|
+ },
|
|
|
+ define: {
|
|
|
+ enable: true,
|
|
|
+ setting: JSON.stringify({
|
|
|
+ "title": "请选择汇总的标段",
|
|
|
+ "type": "final",
|
|
|
+ "nameColWidth": 180,
|
|
|
+ "special": [
|
|
|
+ {"title": "估算", "key": "gu", "width": 60},
|
|
|
+ {"title": "概算", "key": "gai", "width": 60},
|
|
|
+ {"title": "预算", "key": "yu", "width": 60}
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ select: JSON.parse('{"tenders":[{"tid":1942},{"tid":2217},{"tid":2046},{"tid":2172,"gu":true},{"tid":2324,"gai":true},{"tid":2326,"yu":true}],"type":"final"}')
|
|
|
+};
|
|
|
+
|
|
|
const reportDataAnalysis = require('../../../app/lib/rpt_data_analysis');
|
|
|
|
|
|
describe('test/app/service/report_memory.test.js', () => {
|
|
@@ -60,31 +118,15 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_gather_stage_pay, "", "\t"), path.join(savePath, 'mem_gather_stage_pay_converse.json'));
|
|
|
});
|
|
|
// 汇总签约清单
|
|
|
- it('test getGatherStagePay', function* () {
|
|
|
+ it('test getGatherDealBills', function* () {
|
|
|
const ctx = app.mockContext();
|
|
|
- const postData = {
|
|
|
- account: 'zengpeiwen',
|
|
|
- project: 'P1201',
|
|
|
- project_password: '123456',
|
|
|
- };
|
|
|
+ const testSetting = testSetting3;
|
|
|
ctx.session = {};
|
|
|
- const loginResult = yield ctx.service.projectAccount.accountLogin(postData, 2);
|
|
|
+ const loginResult = yield ctx.service.projectAccount.accountLogin(testSetting.postData, 2);
|
|
|
assert(loginResult);
|
|
|
|
|
|
- const select = {
|
|
|
- tenders: [{tid: 2046}, {tid: 1942}, {tid: 2217}],
|
|
|
- type: 'final',
|
|
|
- };
|
|
|
- const define = {
|
|
|
- enable: true,
|
|
|
- setting: JSON.stringify({
|
|
|
- title: '请选择汇总的标段',
|
|
|
- type: 'final',
|
|
|
- })
|
|
|
- };
|
|
|
-
|
|
|
const data = {};
|
|
|
- data.mem_gather_deal_bills = yield ctx.service.rptGatherMemory.getGatherDealBills([], define, select);
|
|
|
+ data.mem_gather_deal_bills = yield ctx.service.rptGatherMemory.getGatherDealBills([], testSetting.define, testSetting.select);
|
|
|
yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_gather_deal_bills, "", "\t"), path.join(savePath, 'mem_gather_deal_bills.json'));
|
|
|
});
|
|
|
});
|