zhangjq
2026-01-17 bf466e6e1261e1b3d7640a223a274cb43bf1cd02
合同收费页面修改
1个文件已修改
118 ■■■■ 已修改文件
public/pages/property/contractCreateFee/contractCreateFee.js 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/contractCreateFee/contractCreateFee.js
@@ -17,6 +17,8 @@
    var DEFAULT_ROW = 10;
    // 缓存搜索条件的键名
    var TEMP_SEARCH = 'contractCreateFeeSearch';
    // 组件实例引用
    var $that = {};
    
    vc.extends({
        data: {
@@ -58,7 +60,7 @@
         * 功能:检查缓存数据并加载合同列表
         */
        _initMethod: function () {
            $that = vc.component; // 添加这一行来定义 $that 变量
            $that = vc.component; // 初始化 $that 变量
            // 检查是否有缓存数据
            let _tempData = vc.getData(TEMP_SEARCH);
            if (_tempData == null) {
@@ -98,41 +100,55 @@
             * @param {number} _row - 每页记录数
             */
            listContract: function (_page, _row) {
            // 设置分页参数
            $that.contractCreateFeeInfo.conditions.page = _page;
            $that.contractCreateFeeInfo.conditions.row = _row;
            // 设置小区编号
            $that.contractCreateFeeInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
            // 去除查询条件中的空格
            $that.contractCreateFeeInfo.conditions.contractName = $that.contractCreateFeeInfo.conditions.contractName.trim();
            $that.contractCreateFeeInfo.conditions.contractNameLike = $that.contractCreateFeeInfo.conditions.contractNameLike.trim();
            $that.contractCreateFeeInfo.conditions.contractCode = $that.contractCreateFeeInfo.conditions.contractCode.trim();
            $that.contractCreateFeeInfo.conditions.contractType = $that.contractCreateFeeInfo.conditions.contractType.trim();
            // 深拷贝查询条件
            let _conditions = JSON.parse(JSON.stringify($that.contractCreateFeeInfo.conditions));
            let param = {
                params: _conditions
            };
            // 发送GET请求查询合同列表
            vc.http.apiGet('/contract/queryContract',
                param,
                function (json, res) {
                    try {
                        var listContractData = JSON.parse(json);
                        // 更新合同数据
                        $that.contractCreateFeeInfo.total = listContractData.total;
                        $that.contractCreateFeeInfo.records = listContractData.records;
                        $that.contractCreateFeeInfo.contracts = listContractData.data;
                        // 初始化分页组件
                        vc.emit('pagination', 'init', {
                            total: $that.contractCreateFeeInfo.records,
                            dataCount: $that.contractCreateFeeInfo.total,
                            currentPage: _page
                        });
                        // 保存搜索条件到缓存
                        $that.saveTempSearchData();
                    } catch (e) {
                        console.error('数据解析失败:', e);
                // 设置分页参数
                $that.contractCreateFeeInfo.conditions.page = _page;
                $that.contractCreateFeeInfo.conditions.row = _row;
                // 设置小区编号
                $that.contractCreateFeeInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
                // 去除查询条件中的空格
                $that.contractCreateFeeInfo.conditions.contractName = $that.contractCreateFeeInfo.conditions.contractName.trim();
                $that.contractCreateFeeInfo.conditions.contractNameLike = $that.contractCreateFeeInfo.conditions.contractNameLike.trim();
                $that.contractCreateFeeInfo.conditions.contractCode = $that.contractCreateFeeInfo.conditions.contractCode.trim();
                $that.contractCreateFeeInfo.conditions.contractType = $that.contractCreateFeeInfo.conditions.contractType.trim();
                // 深拷贝查询条件
                let _conditions = JSON.parse(JSON.stringify($that.contractCreateFeeInfo.conditions));
                let param = {
                    params: _conditions
                };
                // 发送GET请求查询合同列表
                vc.http.apiGet('/contract/queryContract',
                    param,
                    function (json, res) {
                        try {
                            var listContractData = JSON.parse(json);
                            // 更新合同数据
                            $that.contractCreateFeeInfo.total = listContractData.total;
                            $that.contractCreateFeeInfo.records = listContractData.records;
                            $that.contractCreateFeeInfo.contracts = listContractData.data;
                            // 初始化分页组件
                            vc.emit('pagination', 'init', {
                                total: $that.contractCreateFeeInfo.records,
                                dataCount: $that.contractCreateFeeInfo.total,
                                currentPage: _page
                            });
                            // 保存搜索条件到缓存
                            $that.saveTempSearchData();
                        } catch (e) {
                            console.error('数据解析失败:', e);
                            // 初始化空数据
                            $that.contractCreateFeeInfo.total = 0;
                            $that.contractCreateFeeInfo.records = 1;
                            $that.contractCreateFeeInfo.contracts = [];
                            // 初始化分页组件
                            vc.emit('pagination', 'init', {
                                total: 1,
                                dataCount: 0,
                                currentPage: _page
                            });
                        }
                    },
                    function (errInfo, error) {
                        console.error('请求失败处理:', errInfo, error);
                        // 初始化空数据
                        $that.contractCreateFeeInfo.total = 0;
                        $that.contractCreateFeeInfo.records = 1;
@@ -144,22 +160,8 @@
                            currentPage: _page
                        });
                    }
                },
                function (errInfo, error) {
                    console.error('请求失败处理:', errInfo, error);
                    // 初始化空数据
                    $that.contractCreateFeeInfo.total = 0;
                    $that.contractCreateFeeInfo.records = 1;
                    $that.contractCreateFeeInfo.contracts = [];
                    // 初始化分页组件
                    vc.emit('pagination', 'init', {
                        total: 1,
                        dataCount: 0,
                        currentPage: _page
                    });
                }
            );
        },
                );
            },
            /**
             * 查看合同费用详情
             * @param {object} _contract - 合同对象
@@ -214,7 +216,7 @@
             * @param {object} _room - 房间信息
             */
            _printOwnOrder: function (_room) {
                vc.jumpToPage('print.html#/pages/property/printOweFee?roomId=' + _room.roomId)
                vc.jumpToPage('print.html#/pages/property/printOweFee?roomId=' + _room.roomId);
            },
            /**
             * 打开手动收费详情模型
@@ -224,7 +226,7 @@
                let _data = {
                    roomId: _room.roomId,
                    communityId: vc.getCurrentCommunity().communityId
                }
                };
                // 重新同步房屋欠费
                vc.http.apiPost(
                    '/feeManualCollection/saveFeeManualCollection',
@@ -292,15 +294,15 @@
             * @param {boolean} _isMore - 是否批量创建
             */
            _openContractCreateFeeAddModal: function (_room, _isMore) {
                console.log("look here")
                console.log(_room)
                console.log(_isMore)
                console.log("look here");
                console.log(_room);
                console.log(_isMore);
                // 触发合同创建费用添加组件的打开事件
                vc.emit('contractCreateFeeAdd', 'openContractCreateFeeAddModal', {
                    isMore: _isMore,
                    contract: _room
                });
            },
            }
            /*
            // 打开导入弹窗
            _importContract: function () {