Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

宁成龙 / dataIntegration

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
Normal viewHistoryPermalink
Switch branch/tag
  • dataIntegration
  • public
  • assets
  • js
  • payable
  • payableDetail.js
payableDetail.js 7.06 KB
Edit
宁成龙's avatar
Initial commit
7166432c
 
宁成龙 committed 2 years ago
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
layui.config({}).extend({
    xmSelect: './xmSelect'
}).use(['form', 'table', 'admin', 'index', 'laydate', 'xmSelect'], function () {
    var index = layui.index;
    var form = layui.form;
    var table = layui.table;
    var admin = layui.admin;
    var laydate = layui.laydate;
    layui.form.render();

    var payable_id = getQueryVariable('id');
    var company_id = window.company_id;
    if (company_id == 1){
        var cols_list = [[
            {type: 'checkbox', fixed: true},
            {field: 'goods_sn', title: '商品编码', width: 150},
            {field: 'goods_name', title: '型号', width: 150},
            {field: 'brand_name', title: '品牌', width: 150},
            {
                field: 'goods_number', title: '数量', width: 60,  templet: function (row) {
                    return '<div style="text-align: right;">' + row.goods_number + '</div>'
                }
            },
            {field: 'price_without_tax', title: '采购单价(未税)', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.price_without_tax + '</div>'
                }},
            {field: 'price_in_tax', title: '采购单价(含税)', width: 110,templet: function (row) {
                    return '<div style="text-align: right;">' + row.price_in_tax + '</div>'
                }},
            // {field: 'amounts_payable_unit', title: '小计', width: 110,
            // templet: function (row) {
            //     return '<div style="text-align: right;">' + row.amounts_payable_unit + '</div>'
            // }},
            {field: 'real_price_without_tax', title: '实际单价(未税)', width: 110,templet: function (row) {
                    return '<div style="text-align: right;">' + row.real_price_without_tax + '</div>'
                }},
            {field: 'real_price_in_tax', title: '实际单价(含税)', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.real_price_in_tax + '</div>'
                }},
            {field: 'amounts_payable_unit', title: '应付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.amounts_payable_unit + '</div>'
                }},
            {field: 'paid_amount', title: '已付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.paid_amount + '</div>'
                }},
            {field: 'no_pay_amount', title: '未付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.no_pay_amount + '</div>'
                }},
            {field: 'in_pay_amount', title: '付款中金额', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.in_pay_amount + '</div>'
                }},
            {field: 'invoiced_amount', title: '已开票总金额', width: 120,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.invoiced_amount + '</div>'
                }},
            {field: 'tax_amount', title: '税额', width: 80,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.tax_amount + '</div>'
                }},
            {field: 'amount_unit', title: '金额', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.amount_unit + '</div>'
                }},
            {field: 'pay_name', title: '付款方式', width: 80},
            {field: 'item_payable_time', title: '应付时间', width: 120},
            {field: 'rela_purchase_sn', title: '采购单号', width: 200}
        ]];
    } else {
        var cols_list = [[
            {type: 'checkbox', fixed: true},
            {field: 'goods_sn', title: '商品编码', width: 150},
            {field: 'goods_name', title: '型号', width: 150},
            {field: 'brand_name', title: '品牌', width: 150},
            {
                field: 'goods_number', title: '数量', width: 60,  templet: function (row) {
                    return '<div style="text-align: right;">' + row.goods_number + '</div>'
                }
            },
            {field: 'price_without_tax', title: '采购单价(未税)', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.price_without_tax + '</div>'
                }},
            {field: 'real_price_without_tax', title: '实际单价(未税)', width: 110,templet: function (row) {
                    return '<div style="text-align: right;">' + row.real_price_without_tax + '</div>'
                }},
            {field: 'amounts_payable_unit', title: '应付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.amounts_payable_unit + '</div>'
                }},
            {field: 'paid_amount', title: '已付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.paid_amount + '</div>'
                }},
            {field: 'no_pay_amount', title: '未付金额', width: 100,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.no_pay_amount + '</div>'
                }},
            {field: 'in_pay_amount', title: '付款中金额', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.in_pay_amount + '</div>'
                }},
            {field: 'invoiced_amount', title: '已开票总金额', width: 120,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.invoiced_amount + '</div>'
                }},
            {field: 'tax_amount', title: '税额', width: 80,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.tax_amount + '</div>'
                }},
            {field: 'amount_unit', title: '金额', width: 110,
                templet: function (row) {
                    return '<div style="text-align: right;">' + row.amount_unit + '</div>'
                }},
            {field: 'pay_name', title: '付款方式', width: 80},
            {field: 'item_payable_time', title: '应付时间', width: 120},
            {field: 'rela_purchase_sn', title: '采购单号', width: 200}
        ]];
    }

    //列表
    table.render({
        elem: '#list',
        url: '/api/payable/getPayableItems',
        page: true,
        method: 'post',
        where: {
            payable_id: payable_id
        },
        size: 'sm',
        cols: cols_list,
        limit: 10,
        limits: [10, 20, 50, 100, 200],
        parseData: LayUiTableParseData,
        done: function (res, curr, count) {
            //监听checkbox
            checkGo(table, "list", res.data);
        }
    });


});