• 上传附件导入,确认弹框取消后,无法上传附件


    今天遇到的一个问题

    功能描述:导入订单,上传文件,先校验系文件中要导入的订单系统中是否已经存在,如果有,就弹框提示,要不要导入,确定就继续导入,取消用户就重新修改上传。

    问题描述:点击取消之后,上传附件的控件无法再次点击

    HTML代码如下:

    <div id="divMain" style="70%">
        <div class="form-horizontal">
            <table class="table table-bordered table-striped" style="100%">
                <tbody>
                    <tr>
                        <td style="100px">
                            @Html.Factory().DropDownList().Enum("AgreementTypeEnum").NgModel("c.vm.IsAgreement")
                        </td>
                        <td>
                            <e2-file-uploader ng-model="c.vm.files" type=".xls,.xlsx,XLS,.XLSX" multiple="false" show-badge="false" upload-finished="c.Event.FileUploaded(file, response, status)">
                                <i class="fa fa-upload"></i>&nbsp;<font translate="Attachment"></font>
                            </e2-file-uploader>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    
    
        <div class="clearfix"></div>
        <div ng-if="(c.vm.SucceedCount>0 ||c.vm.FailedCount>0) && !c.vm.ErrorMessage">
            成功导入{{c.vm.SucceedCount}}条数据,失败{{c.vm.FailedCount}}条,<a href="{{ c.vm.FailedExcel}}" target="_parent">失败下载</a>
        </div>
        <div ng-if="(c.vm.SucceedCount ==0 && c.vm.FailedCount==0) && c.vm.ErrorMessage==undefined">
            没有可导入数据
        </div>
        <div>{{c.vm.ErrorMessage}}</div>
        </div>

    js代码如下:

    def.ContentState('Import', "id").Controller(['pb', 'pbui', 'serverVm', '$scope', '$timeout', '$stateParams', function (pb, pbui, serverVm, $scope, $timeout, $stateParams) {
        var c = pb.Super(this, serverVm, $scope, false);
        c.vm = { files: [], template: '../Template/ImportFormat/MyPo.xlsx', IsAgreement:"协议" };
    
        c.Event = {
            FileUploaded: function (file, response, status) {
                pbui.PutProcessing("divMain");
                c.vm.Items = [];
                var flag = false;
                if (c.vm.IsAgreement == "协议") {
                    flag = true;
                }
                pb.CallAction('/PO/MyPO/IsExistPONo', 'fileName=' + response.SavedFileName + "&IsAgreementOrder=" + flag, function (result) {
                    if (result.data != "") {
                        pbui.Confirm('ConfirmImportExistSamePONo', result.data).then(function () {
                            c.Event.Import(response, flag);
                        }, function () {
                                c.vm.files.splice(0, c.vm.files.length);
                                pbui.PutProcessing("");
                        })                    
                    }
                    else {
                        c.Event.Import(response, flag);
                    }
                });
            },
            Import: function ( response, flag) {
                  pb.CallAction('/PO/MyPO/Import', 'fileName=' + response.SavedFileName + "&IsAgreementOrder=" + flag, function (result) {
                    c.vm.files.splice(0, c.vm.files.length);
                    result.data = JSON.parse(result.data);
                    if (result.isRcResult) {
                        c.vm.FailedCount = result.data.FailedCount;
                        c.vm.SucceedCount = result.data.SucceedCount;
                        c.vm.FailedExcel = "../Download/DownloadAttachment?psSaveTo=&psOriginalFileName=POItem.xlsx&psSavedFileName=" + result.data.FailedExcel;
                        c.vm.ErrorMessage = result.data.ErrorMessage;
                    }
                    pbui.PutProcessing("");
                });
            }
        }
    }]);

    因为选择文件上传后会有一个正在加载对的遮罩层,点击取消后还一直在转圈

    pbui.PutProcessing("divMain");

    先是加了这个取消遮罩

    pbui.PutProcessing("");
  • 相关阅读:
    poj2346
    poj3748
    poj1205
    PostThreadMessage 使用注意问题
    CBitmap Detach DeleteObject关系
    音视频编码技术与格式大全
    利用 DirectShow 开发自己的 Filter
    VC+DirectShow对视频进行图片处理VC教程电脑教程之家.htm
    Directx报错01
    深圳超多维光电子有限公司
  • 原文地址:https://www.cnblogs.com/wmm-pcy/p/14479518.html
Copyright © 2020-2023  润新知