forked from kidgrow-microservices-platform

zhaoxiaohao
2020-11-17 b7265cdd6f3e1fbb0d428c27e5b5e29e34d56953
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html
@@ -275,113 +275,140 @@
        //回显医院基本数据
        let hospitalData = admin.getTempData('t_hospital');
        if (hospitalData != null) {
            form.val('recharge-form', hospitalData);
            $("#hospitalAreas").val(hospitalData.hospitalProvince + " " + hospitalData.hospitalCity + " " +
                hospitalData.hospitalArea);
        }
        //装载产品数据
        table.render({
            elem: '#product-table',
            url: config.base_server + 'api-opration/product/all',
            method: 'GET',
            cellMinWidth: 50,
            headers: {
                'Authorization': 'Bearer ' + config.getToken().access_token
            },
            page: false,
            where: {
                is_del: 0,
                enabled: 1
            },
            cols: [
                [{
                        field: 'proName',
                        sort: true,
                        width: 330,
                        title: '产品名称',
                        align: 'center',
                        fixed: 'left'
                    },
                    {
                        field: 'proType',
                        sort: true,
                        align: 'center',
                        width: 80,
                        templet: function (d) {
                            if (d.proType === 0)
                                return "试用"
                            else
                                return "正式"
                        },
                        title: '类型'
                    },
                    {
                        field: 'proTime',
                        width: 100,
                        title: '时长',
                        align: 'center',
                        templet: function (d) {
                            switch (d.proTimeUnit) {
                                case 0:
                                    return d.proTime + "天";
                                    break;
                                case 1:
                                    return d.proTime + "月";
                                    break;
                                case 2:
                                    return d.proTime + "年";
                                    break;
                            }
            admin.req('api-user/sysdepartment/getPayMes?departmentId=' + hospitalData.departmentId, {},
                function (data) {
                    layer.closeAll('loading');
                    if (0 === data.code) {
                        queryData = data.data;
                        if (queryData === true) {
                                admin.finishPopupCenter();
                            layer.msg("当前科室开通了单次支付功能,不能进行充值业务!", {
                                icon: 3,
                                time: 5000
                            });
                        } else {
                            form.val('recharge-form', hospitalData);
                            $("#hospitalAreas").val(hospitalData.hospitalProvince + " " + hospitalData
                                .hospitalCity + " " +
                                hospitalData.hospitalArea);
                            //装载产品数据
                            table.render({
                                elem: '#product-table',
                                url: config.base_server + 'api-opration/product/all',
                                method: 'GET',
                                cellMinWidth: 50,
                                headers: {
                                    'Authorization': 'Bearer ' + config.getToken().access_token
                                },
                                page: false,
                                where: {
                                    is_del: 0,
                                    enabled: 1
                                },
                                cols: [
                                    [{
                                            field: 'proName',
                                            sort: true,
                                            width: 330,
                                            title: '产品名称',
                                            align: 'center',
                                            fixed: 'left'
                                        },
                                        {
                                            field: 'proType',
                                            sort: true,
                                            align: 'center',
                                            width: 80,
                                            templet: function (d) {
                                                if (d.proType === 0)
                                                    return "试用"
                                                else
                                                    return "正式"
                                            },
                                            title: '类型'
                                        },
                                        {
                                            field: 'proTime',
                                            width: 100,
                                            title: '时长',
                                            align: 'center',
                                            templet: function (d) {
                                                switch (d.proTimeUnit) {
                                                    case 0:
                                                        return d.proTime + "天";
                                                        break;
                                                    case 1:
                                                        return d.proTime + "月";
                                                        break;
                                                    case 2:
                                                        return d.proTime + "年";
                                                        break;
                                                }
                                            }
                                        },
                                        {
                                            field: 'ailightCount',
                                            width: 100,
                                            align: 'center',
                                            title: '读片量'
                                        },
                                        {
                                            field: 'recordCount',
                                            width: 100,
                                            align: 'center',
                                            title: '报告量'
                                        },
                                        {
                                            field: 'beginTime',
                                            align: 'center',
                                            width: 120,
                                            title: '开始日期',
                                            event: "date"
                                        },
                                        {
                                            field: 'endTime',
                                            align: 'center',
                                            width: 120,
                                            title: '结束日期',
                                            event: "date"
                                        },
                                        {
                                            field: 'isShare',
                                            fixed: 'right',
                                            align: 'center',
                                            width: 100,
                                            templet: '#product-tpl-isShare',
                                            title: '共享'
                                        },
                                        {
                                            field: 'id',
                                            fixed: 'right',
                                            align: 'center',
                                            width: 100,
                                            toolbar: '#product-tpl-bar',
                                            title: '操作'
                                        }
                                    ]
                                ],
                                done: function (res) {
                                    permissionsInput(res, config);
                                }
                            });
                        }
                    },
                    {
                        field: 'ailightCount',
                        width: 100,
                        align: 'center',
                        title: '读片量'
                    },
                    {
                        field: 'recordCount',
                        width: 100,
                        align: 'center',
                        title: '报告量'
                    },
                    {
                        field: 'beginTime',
                        align: 'center',
                        width: 120,
                        title: '开始日期',
                        event: "date"
                    },
                    {
                        field: 'endTime',
                        align: 'center',
                        width: 120,
                        title: '结束日期',
                        event: "date"
                    },
                    {
                        field: 'isShare',
                        fixed: 'right',
                        align: 'center',
                        width: 100,
                        templet: '#product-tpl-isShare',
                        title: '共享'
                    },
                    {
                        field: 'id',
                        fixed: 'right',
                        align: 'center',
                        width: 100,
                        toolbar: '#product-tpl-bar',
                        title: '操作'
                    }
                ]
            ],
            done: function (res) {
                permissionsInput(res, config);
            }
        });
                    else
                    {
                        admin.finishPopupCenter();
                        layer.msg("验证医院科室数据异常!", {
                                icon: 2,
                                time: 3000
                            });
                    }
                }, 'get');
        }
        //待充值列表功能操作
        table.on('tool(product-table-temp)', function (obj) {
            if (obj.event === "del") {
@@ -403,7 +430,7 @@
                    format: "yyyy-MM-dd",
                    show: true,
                    done: function (value, date) {
                        var nowTr=obj.tr;
                        var nowTr = obj.tr;
                        if (field === "beginTime") {
                            var endTimes = getNowDate(data.proTime, data.proTimeUnit,
                                value);
@@ -430,6 +457,7 @@
                data.isShare = (data.isShare.indexOf("不") == 0) ? 0 : 1;
                if (!strUtil.isEmpty(data.beginTime) && !strUtil.isEmpty(data.endTime)) {
                    if (dateUtil.compareDate(data.endTime, data.beginTime)) {
                        data.id=data.id+'';
                        tempDataList(data);
                        waitRecharge();
                    } else {
@@ -538,8 +566,8 @@
                                        var listDetailData = new Array();
                                        $.each(listData, function (index, item) {
                                            var detailData = {
                                                orderId: orderData.id,
                                                proId: item.id,
                                                orderId: orderData.id+'',
                                                proId: item.id+'',
                                                proType: item.proType,
                                                proName: item.proName,
                                                isShare: item.isShare,
@@ -568,7 +596,7 @@
                                                            "");
                                                        layer.msg(data.msg, {
                                                            icon: 1,
                                                            time: 3000
                                                            time: 2000
                                                        }, function () {
                                                            admin
                                                                .finishPopupCenter();