Excel表格数据导入

效果图

1)、点击导入,弹出导入窗口

2)、excel表格

3)、导入结果

4)、解析失败数据

具体实现

html文件

<button type="button" class="btn btn-success"  ng-click="meterManagement.importMeterPage()" ng-disabled="meterManagement.hiddenmeterManagement">导入仪表</button>
<script type="text/ng-template" id="importMeter">
    <div cg-busy="{promise:meterManagement.importPromise,message:'加载中,请稍后...',templateUrl:'/property-manager-web/app/views/common/template/loading-template.html'}">
        <h3 class="text-center">导入仪表数据</h3>
        <uib-tabset active="activeForm" style="background:#FFF">
            <uib-tab index="0" heading="普通导入">
                <form class="form-horizontal" id="addform" name="addform" novalidate enctype="multipart/form-data">
                    <fieldset>
                        <div style="padding:10px 10%; align:center;">
                            <div class="bs-callout bs-callout-info col-sm-12">
                                <h4>注意事项</h4>
                                <p><span class="small-tip">上传Excel的文件类型只支持.xls和.xlsx,文件大小在1M以内</span></p>
                            </div>     
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="importname"><span style="color:red">*</span>名称:</label>
                            <div class="col-sm-4">
                                <input class="form-control" id="importName" name="importName" ng-model="meterImport.importName" placeholder="为本次数据定义名称" required maxlength="100"/>
                                <span style="color:red"  ng-show="addform.importName.$dirty && addform.importName.$invalid">请为本次数据定义名称</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" for="file"><span style="color:red">*</span>请选择Excel文件:</label>
                            <div class="col-sm-4">
                                <input type="file" id="importFile" name="importFile" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
                            </div>
                        </div>
                        <div class="ngdialog-buttons mt">
                            <button type="submit" ng-disabled="meterManagement.hiddenmeterManagement" class="ngdialog-button ngdialog-button-primary" ng-click="meterManagement.importMeterForm(meterImport)">提交</button>
                            <button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="closeThisDialog()">关闭</button>
                        </div>
                    </fieldset>
                </form>
            </uib-tab>
        </u
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值