'use strict';

/**
 * 合同支付相关
 *
 * @author Mai
 * @date
 * @version
 */

const payType = {
    normal: 1,
    yf: 2,
    sf: 3,
    wc: 4
};
const payTemplate = [
    {order: 1, name: '本期应付', ptype: payType.yf, minus: false, expr: null, sexpr: null, rexpr: null},
    {order: 2, name: '本期实付', ptype: payType.sf, minus: false},
    {order: 3, name: '本期完成计量', ptype: payType.wc, minus: false, expr: 'bqwc'},
    {order: 4, name: '质量保证金', ptype: payType.normal, minus: true},
    {order: 5, name: '扣回开工预付款', ptype: payType.normal, minus: true, expr: '(bqwc/htj)*2*kgyfk', sexpr: 'htj*30%', rexpr: 'kgyfk'},
];

const calcBase = [
    {name: '签约合同价', code: 'htj'},
    {name: '暂列金额', code: 'zlje'},
    {name: '签约合同价(不含暂列金)', code: 'htjszl'},
    {name: '签约开工预付款', code: 'kgyfk'},
    {name: '签约材料预付款', code: 'clyfk'},
    {name: '本期完成计量', code: 'bqwc', limit: true},
    {name: '100章本期完成计量', code: 'ybbqwc', limit: true},
];

const chapterDetailType = {
    chapter: 1,
    withoutChapter: 21,
    gclSum: 11,
    xmjSum: 31,
    sum: 41
};

const deadlineType = {
    none: { value: 0, name: '无' },
    count: { value: 1, name: '计量期数' },
    tp: {
        value: 2, name: '计量金额',
        tpType: {
            gather: { value: 'gather', name: '累计完成计量金额'},
            contract: { value: 'contract', name: '累计合同计量金额'},
            qc: { value: 'qc', name: '累计变更计量金额'}
        },
    },
};

const chapterDetail = [
    {name: '清单 第100章 总则', cType: 1, serialNo: 1, filter: '^1[0-9]{2}-'},
    {name: '清单 第200章 路基', cType: 1, serialNo: 2, filter: '^2[0-9]{2}-'},
    {name: '清单 第300章 路面', cType: 1, serialNo: 3, filter: '^3[0-9]{2}-'},
    {name: '清单 第400章 桥梁、涵洞', cType: 1, serialNo: 4, filter: '^4[0-9]{2}-'},
    {name: '清单 第500章 隧道', cType: 1, serialNo: 5, filter: '^5[0-9]{2}-'},
    {name: '清单 第600章 安全设施及预埋管线', cType: 1, serialNo: 6, filter: '^6[0-9]{2}-'},
    {name: '清单 第700章 绿化及环境保护', cType: 1, serialNo: 7, filter: '^7[0-9]{2}-'},
    {name: '未计入章节清单合计', cType: 21, serialNo: 8},
    {name: '清单小计(A)', cType: 11, serialNo: 9},
    {name: '非清单项费用(B)', cType: 31, serialNo: 10},
    {name: '合计(C=A+B)', cType: 41, serialNo: 11},
];

module.exports = {
    payType,
    payTemplate,
    calcBase,
    chapterDetail,
    deadlineType,
};