zhangjq
2026-01-18 fbb141768d08dbea8d1324f7fe54b43598bb7bd2
Z2数据导入功能测试
2个文件已删除
5个文件已修改
6个文件已添加
374 ■■■■■ 已修改文件
public/import/中华东波清临时停车费模版.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/中华东波清住宅物业费导入新模版.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/中华东波清商铺物业费导入新模板.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/中华东波清地下停车费模版.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/中华东波清地面停车费.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/中华东波清白单流水汇总模版.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/住宅物业费 导入新模板.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/import/商铺物业费 导入新模板 .xlsx 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/carCreateFee/carCreateFee.html 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/carCreateFee/carCreateFee.js 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/feeConfigManage/feeConfigManage.html 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/feeConfigManage/feeConfigManage.js 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/pages/property/flowchartManage/flowchartManage.html 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/import/Öлª¶«²¨ÇåÁÙʱͣ³µ·ÑÄ£°æ.xlsx
Binary files differ
public/import/Öлª¶«²¨ÇåסլÎïÒµ·Ñµ¼ÈëÐÂÄ£°æ.xlsx
Binary files differ
public/import/Öлª¶«²¨ÇåÉÌÆÌÎïÒµ·Ñµ¼ÈëÐÂÄ£°å.xlsx
Binary files differ
public/import/Öлª¶«²¨Ç嵨ÏÂÍ£³µ·ÑÄ£°æ.xlsx
Binary files differ
public/import/Öлª¶«²¨ÇåµØÃæÍ£³µ·Ñ.xlsx
Binary files differ
public/import/Öлª¶«²¨Çå°×µ¥Á÷Ë®»ã×ÜÄ£°æ.xlsx
Binary files differ
public/import/סլÎïÒµ·Ñ µ¼ÈëÐÂÄ£°å.xlsx
Binary files differ
public/import/ÉÌÆÌÎïÒµ·Ñ µ¼ÈëÐÂÄ£°å .xlsx
Binary files differ
public/pages/property/carCreateFee/carCreateFee.html
@@ -83,6 +83,10 @@
                    v-on:click="_openCarCreateFeeAddModal(null,true)">
                        <vc:i18n name="批量创建" namespace="carCreateFee"></vc:i18n>
                </button>
                <button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
                    v-on:click="_importCarData()">
                        <vc:i18n name="数据导入" namespace="carCreateFee"></vc:i18n>
                </button>
                <!-- <button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
                    v-on:click="_toBuyCarMonthCard()">
                        <vc:i18n name="购买月卡" namespace="carCreateFee"></vc:i18n>
@@ -159,4 +163,63 @@
    <vc:create path="property/carCreateFeeAdd"></vc:create>
    <vc:create path="property/exportCarFeeImportExcel"></vc:create>
    <vc:create path="property/doImportCreateFee"></vc:create>
    <!-- è½¦è¾†æ•°æ®å¯¼å…¥å¼¹çª— -->
    <div class="modal fade" id="importCarDataModal" tabindex="-1" role="dialog" aria-labelledby="importCarDataModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="importCarDataModalLabel">车辆数据导入</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="ibox-content">
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">选择文件</label>
                                <div class="col-sm-10">
                                    <div class="custom-file">
                                        <input id="carExcelFile" ref="carExcelFile" type="file"
                                               class="custom-file-input form-control" name="carExcelFile"
                                               v-on:change="getCarExcelFile($event)" accept=".xls,.xlsx,.csv">
                                        <label for="carExcelFile" class="custom-file-label">
                                            {{carCreateFeeInfo.excelFile==''?'必填,请选择数据文件':carCreateFeeInfo.excelFile.name}}
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">导入类型</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="carCreateFeeInfo.importAdapt">
                                        <option value="importOwnerCarV2">地面/地下停车费</option>
                                        <option value="importCarInout">临时停车费</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">下载模板</label>
                                <div class="col-sm-10">
                                    <div v-if="carCreateFeeInfo.importAdapt == 'importOwnerCarV2'">
                                        è¯·å…ˆä¸‹è½½ <a href="/import/中华东波清地面停车费.xlsx" target="_blank">地面停车费导入新模板</a> æˆ– <a href="/import/中华东波清地下停车费模版.xlsx" target="_blank">地下停车费导入新模板</a>
                                        <span>准备数据后,上传导入</span>
                                    </div>
                                    <div v-else-if="carCreateFeeInfo.importAdapt == 'importCarInout'">
                                        è¯·å…ˆä¸‹è½½ <a href="/import/临时停车费导入模板.xlsx" target="_blank">临时停车费导入模板</a>
                                        <span>准备数据后,上传导入</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" v-on:click="_importCarDataSubmit()">导入</button>
                </div>
            </div>
        </div>
    </div>
</div>
public/pages/property/carCreateFee/carCreateFee.js
@@ -17,6 +17,8 @@
                state: '',
                num: '',
                moreCondition: false,
                excelFile: '',
                importAdapt: 'importOwnerCarV2',
                conditions: {
                    psId: '',
                    ownerName: '',
@@ -111,6 +113,106 @@
            },
            _openDoCreateRoomFee: function () {
                vc.emit('doImportCreateFee', 'openDoImportCreateFeeModal', {})
            },
            // æ‰“开导入弹窗
            _importCarData: function () {
                // ä½¿ç”¨åŽŸç”ŸJavaScript方式打开弹窗,避免jQuery选择器问题
                var modal = document.getElementById('importCarDataModal');
                if (modal) {
                    // æ£€æŸ¥æ˜¯å¦æœ‰Bootstrap Modal实例
                    if (window.$ && $.fn.modal) {
                        // å¦‚æžœjQuery和Bootstrap Modal可用,使用jQuery方式
                        $('#importCarDataModal').modal('show');
                    } else {
                        // å¦åˆ™å°è¯•原生方式
                        modal.style.display = 'block';
                        modal.classList.add('show');
                    }
                } else {
                    console.error('导入弹窗元素未找到');
                    vc.toast('导入功能初始化失败,请刷新页面重试');
                }
            },
            // èŽ·å–å¯¼å…¥æ–‡ä»¶
            getCarExcelFile: function (e) {
                vc.component.carCreateFeeInfo.excelFile = e.target.files[0];
            },
            // å¯¼å…¥è½¦è¾†æ•°æ®
            _importCarDataSubmit: function () {
                // æ£€æŸ¥æ˜¯å¦é€‰æ‹©äº†æ–‡ä»¶
                if (!vc.component.carCreateFeeInfo.excelFile || vc.component.carCreateFeeInfo.excelFile == '') {
                    vc.toast('请选择导入文件');
                    return;
                }
                // æ·»åŠ æ–‡ä»¶éªŒè¯
                if (!vc.component._checkFileValid(vc.component.carCreateFeeInfo.excelFile)) {
                    return;
                }
                // æž„建FormData,使用后端要求的参数格式
                var param = new FormData();
                param.append('uploadFile', vc.component.carCreateFeeInfo.excelFile); // åŽç«¯è¦æ±‚的文件名参数
                param.append('communityId', vc.getCurrentCommunity().communityId); // å°åŒºç¼–号
                param.append('importAdapt', vc.component.carCreateFeeInfo.importAdapt); // åŽç«¯æä¾›çš„导入适配器
                param.append('userId', vc.getData('/userInfo/userId')); // æ“ä½œå‘˜å·¥ç¼–号
                // æ˜¾ç¤ºå¯¼å…¥è¿›åº¦æç¤º
                vc.toast('正在导入中,请稍候...');
                // ä½¿ç”¨åŽç«¯æä¾›çš„完整接口地址
                vc.http.upload(
                    '/callComponent/upload/assetImport/importData', // åŽç«¯æŒ‡å®šçš„完整接口地址
                    param,
                    {
                        emulateJSON: true,
                        headers: {
                            "Content-Type": "multipart/form-data"
                        }
                    },
                    function (json, res) {
                        try {
                            var _json = JSON.parse(json);
                            if (_json.code === 0) {
                                $('#importCarDataModal').modal('hide');
                                vc.toast('导入成功,共导入 ' + _json.data + ' æ¡æ•°æ®');
                                vc.component.listCars(vc.component.currentPage, DEFAULT_ROW);
                                // æ¸…空文件选择
                                vc.component.carCreateFeeInfo.excelFile = '';
                                $('#carExcelFile').val('');
                                return;
                            }
                            vc.toast(_json.msg || '导入失败', 10000);
                        } catch (e) {
                            console.error('导入响应解析错误:', e);
                            vc.toast('导入失败:数据解析错误', 10000);
                        }
                    },
                    function (errInfo, error) {
                        console.error('导入请求失败:', errInfo, error);
                        vc.toast('导入失败:' + (errInfo || '网络错误'), 10000);
                    }
                );
            },
            // æ–‡ä»¶éªŒè¯æ–¹æ³•
            _checkFileValid: function (_file) {
                // éªŒè¯æ–‡ä»¶ç±»åž‹
                const fileName = _file.name;
                const fileExt = fileName.split('.').pop().toLowerCase();
                const acceptTypes = ['xlsx', 'xls', 'csv'];
                if (!acceptTypes.includes(fileExt)) {
                    vc.toast('文件类型不支持,请选择 xlsx、xls æˆ– csv æ ¼å¼æ–‡ä»¶');
                    return false;
                }
                // éªŒè¯æ–‡ä»¶å¤§å°ï¼ˆ20MB)
                const maxSize = 20 * 1024 * 1024;
                if (_file.size > maxSize) {
                    vc.toast('文件大小不能超过 20MB');
                    return false;
                }
                return true;
            }
        }
    });
public/pages/property/feeConfigManage/feeConfigManage.html
@@ -109,9 +109,14 @@
                            </span>
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddFeeConfigModal()"
                            v-if="vc.hasPrivilege('502022022571930560')">
                            <vc:i18n name="添加" namespace="feeConfigManage"></vc:i18n>
                        </button>
                                v-if="vc.hasPrivilege('502022022571930560')">
                                <vc:i18n name="添加" namespace="feeConfigManage"></vc:i18n>
                            </button>
                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openImportFeeConfigModal()"
                                v-if="vc.hasPrivilege('502022022571930560')">
                                <i class="fa fa-upload"></i>
                                <span>数据导入</span>
                            </button>
                    </div>
                </div>
                <div class="ibox-content">
@@ -234,4 +239,65 @@
        <vc:create path="property/editFeeConfig"></vc:create>
        <vc:create path="property/deleteFeeConfig"></vc:create>
    </div>
    <!-- æ•°æ®å¯¼å…¥æ¨¡æ€æ¡† -->
    <div class="modal fade" id="importFeeConfigModal" tabindex="-1" role="dialog" aria-labelledby="importFeeConfigModalLabel">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="importFeeConfigModalLabel">物业费导入</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group row" style="margin-top:20px">
                        <label class="col-sm-3 col-form-label">
                            <span class="c-red">*</span>
                            <vc:i18n name="选择文件" namespace="importExcel"></vc:i18n>
                        </label>
                        <div class="col-sm-9">
                            <div class="custom-file">
                                <input id="excelTemplate" type="file" class="custom-file-input form-control" name="excelTemplate"
                                       v-on:change="getFile($event)" accept=".xls,.xlsx">
                                <label for="excelTemplate" class="custom-file-label">
                                    {{excelFile==null?'必填,请选择数据文件':excelFile.name}}
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group row" style="margin-top:20px">
                        <label class="col-sm-3 col-form-label">
                            <span class="c-red">*</span>
                            <vc:i18n name="导入类型" namespace="importExcel"></vc:i18n>
                        </label>
                        <div class="col-sm-9">
                            <select class="custom-select" v-model="feeConfigManageInfo.importType">
                                <option value="residential">住宅物业费</option>
                                <option value="commercial">商铺物业费</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group row" style="margin-top:20px">
                        <label class="col-sm-3 col-form-label">
                            <vc:i18n name="模板下载" namespace="importExcel"></vc:i18n>
                        </label>
                        <div class="col-sm-9">
                            <div v-if="feeConfigManageInfo.importType == 'residential'">
                                è¯·å…ˆä¸‹è½½ <a href="/import/中华东波清住宅物业费导入新模版.xlsx.xlsx" target="_blank">住宅物业费导入模板</a> å‡†å¤‡æ•°æ®åŽï¼Œä¸Šä¼ å¯¼å…¥
                            </div>
                            <div v-else-if="feeConfigManageInfo.importType == 'commercial'">
                                è¯·å…ˆä¸‹è½½ <a href="/import/中华东波清商铺物业费导入新模板.xlsx" target="_blank">商铺物业费导入模板</a> å‡†å¤‡æ•°æ®åŽï¼Œä¸Šä¼ å¯¼å…¥
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        <vc:i18n name="取消" namespace="common"></vc:i18n>
                    </button>
                    <button type="button" class="btn btn-primary" v-on:click="_importFeeConfigData">
                        <vc:i18n name="导入" namespace="importExcel"></vc:i18n>
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
public/pages/property/feeConfigManage/feeConfigManage.js
@@ -24,6 +24,7 @@
                billTypes: [],
                isDefaults: [],
                curPage: DEFAULT_PAGE,
                importType: 'residential',
                conditions: {
                    configId: '',
                    secondaryFeeTypeCd: '',
@@ -35,7 +36,8 @@
                    paymentCd: '',
                    deductFrom: ''
                }
            }
            },
            excelFile: null,
        },
        _initMethod: function() {
            $that._initDicts(); // åˆå§‹åŒ–字典数据
@@ -196,6 +198,73 @@
            // },
            _openFeeConfigDetail: function(_feeConfig) {
                window.open('/#/pages/fee/feeConfigDetail?configId=' + _feeConfig.configId)
            },
            // èŽ·å–æ–‡ä»¶
            getFile: function(e) {
                var files = e.target.files;
                if (files.length === 0) {
                    return;
                }
                $that.excelFile = files[0];
            },
            // æ‰“开导入模态框
            _openImportFeeConfigModal: function() {
                $that.excelFile = null;
                $('#importFeeConfigModal').modal('show');
            },
            // æ£€æŸ¥æ–‡ä»¶ç±»åž‹
            checkFileType: function(fileType) {
                var arrType = ['xlsx', 'xls'];
                return arrType.indexOf(fileType) > -1;
            },
            // æ£€æŸ¥æ–‡ä»¶å¤§å°
            checkFileSize: function(fileSize) {
                return fileSize < 20 * 1024 * 1024; // 20MB
            },
            // å¯¼å…¥è´¹ç”¨é…ç½®æ•°æ®
            _importFeeConfigData: function() {
                if (!$that.excelFile) {
                    vc.toast('请选择要导入的文件');
                    return;
                }
                // éªŒè¯æ–‡ä»¶ç±»åž‹
                if (!vc.component.checkFileType($that.excelFile.name.split('.')[1])) {
                    vc.toast('不是有效的Excel格式');
                    return;
                }
                // éªŒè¯æ–‡ä»¶å¤§å°
                if (!vc.component.checkFileSize($that.excelFile.size)) {
                    vc.toast('Excel文件大小不能超过20M');
                    return;
                }
                var formData = new FormData();
                formData.append('uploadFile', $that.excelFile);
                formData.append('importAdapt', 'importRoomOwnerV2');
                formData.append('communityId', vc.getCurrentCommunity().communityId);
                formData.append('userId', vc.getLoginUser().userId);
                var param = {
                    url: '/callComponent/upload/assetImport/importData',
                    data: formData,
                    contentType: false,
                    processData: false,
                    type: 'post',
                    success: function(json, res) {
                        var _json = JSON.parse(json);
                        if (_json.code === 0) {
                            vc.toast('导入成功');
                            $('#importFeeConfigModal').modal('hide');
                            // åˆ·æ–°æ•°æ®
                            $that._listFeeConfigs($that.feeConfigManageInfo.curPage, DEFAULT_ROWS);
                        } else {
                            vc.toast(_json.msg);
                        }
                    },
                    error: function(errInfo, error) {
                        console.log('请求失败处理');
                        vc.toast('导入失败,请检查文件格式');
                    }
                };
                vc.http.request(param);
            }
        }
    });
public/pages/property/flowchartManage/flowchartManage.html
@@ -74,8 +74,13 @@
            <div>
                <div class="text-right">
                    <button type="button" class="btn btn-primary btn-sm"
                        v-on:click="_importPropertyFeeData()">
                        <i class="fa fa-upload"></i>
                        <vc:i18n name="导入物业费" namespace="flowchartManageOwner"></vc:i18n>
                    </button>
                    <button type="button" class="btn btn-primary btn-sm" style="margin-left:10px"
                        v-on:click="_exportflowchartManageOwnerExcel()">
                        <i class="fa fa-plus"></i>
                        <i class="fa fa-download"></i>
                        <vc:i18n name="导出" namespace="flowchartManageOwner"></vc:i18n>
                    </button>
                </div>
@@ -1119,4 +1124,63 @@
            </div> -->
        </div>
    </div>
    <!-- ç‰©ä¸šè´¹æ•°æ®å¯¼å…¥å¼¹çª— -->
    <div class="modal fade" id="importPropertyFeeDataModal" tabindex="-1" role="dialog" aria-labelledby="importPropertyFeeDataModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="importPropertyFeeDataModalLabel">物业费数据导入</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="ibox-content">
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">选择文件</label>
                                <div class="col-sm-10">
                                    <div class="custom-file">
                                        <input id="propertyFeeExcelFile" ref="propertyFeeExcelFile" type="file"
                                               class="custom-file-input form-control" name="propertyFeeExcelFile"
                                               v-on:change="getPropertyFeeExcelFile($event)" accept=".xls,.xlsx,.csv">
                                        <label for="propertyFeeExcelFile" class="custom-file-label">
                                            {{flowchartFee.excelFile==''?'必填,请选择数据文件':flowchartFee.excelFile.name}}
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">导入类型</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="flowchartFee.importAdapt">
                                        <option value="importOwnerPropertyFeeV2">住宅物业费</option>
                                        <option value="importShopPropertyFeeV2">商铺物业费</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">下载模板</label>
                                <div class="col-sm-10">
                                    <div v-if="flowchartFee.importAdapt == 'importOwnerPropertyFeeV2'">
                                        è¯·å…ˆä¸‹è½½ <a href="/import/住宅物业费导入模板.xlsx" target="_blank">住宅物业费导入模板</a>
                                        <span>准备数据后,上传导入</span>
                                    </div>
                                    <div v-else-if="flowchartFee.importAdapt == 'importShopPropertyFeeV2'">
                                        è¯·å…ˆä¸‹è½½ <a href="/import/商铺物业费导入模板.xlsx" target="_blank">商铺物业费导入模板</a>
                                        <span>准备数据后,上传导入</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" v-on:click="_importPropertyFeeDataSubmit()">导入</button>
                </div>
            </div>
        </div>
    </div>
</div>