zoukankan      html  css  js  c++  java
  • Layui在A页面打开B页面,在B打开C,如何在关闭了C之后刷新B

    selectOption() {
                  var screen = admin.screen();
                  var width, height;
                  if (screen > 3) {
                      width = '70%';
                      height = '80%';
                  } else if (screen == 3) {
                      width = '85%';
                      height = '90%';
                  } else {
                      width = '95%';
                      height = '90%';
                  }
                  var uuid = laiease.utils.generateUUID();
                  layer.open({
                      type: 2,
                      title: '选择薪酬项',
                      content: 'optionselect.html?programId=' + activeData.program.programId + '&uuid=' + uuid,
                      area: [width, height],
                      btn: ['添加薪酬项','确定', '取消'],
                      btn1: function(index, layero){
                          var width, height;
                          width = '95%';
                          height = '90%';
                          layer.open({
                              type: 2,
                              title: '选择薪酬项',
                              content: '../option/optionsetting.html',
                              area: [width, height],
                              btn: ['确定', '取消'],
                              yes: function (index, layero) {
                                  layer.closeAll('loading');
                                  layer.close(index); //关闭弹层
                                  //刷新子页面
                                  $(window.document).find("iframe")[0].contentWindow.location.reload(true);
                              }
                          });
                      },
                      btn2: function (index, layero) {
                          var iframeWindow = window['layui-layer-iframe' + index];
                          var checkStatus = iframeWindow.layui.table.checkStatus('option-table'),
                              checkData = checkStatus.data; //得到选中的数据
                          if (checkData.length === 0) {
                              return layer.msg('请至少选择一条数据!', {icon: 5, shift: 6});
                          } else if (checkData.length === 1) {
                              var verifyData = checkData[0];
                              if (verifyData.parentId == '0') {
                                  return layer.msg('请至少选择一条数据,请选择具体子项目!', {icon: 5, shift: 6});
                              }
                          }
                          var data = {
                              optionList: checkData,
                              programId: activeData.program.programId
                          }
                          layer.load(2, {shade: 0.2});
                          admin.req({
                              type: 'post',
                              data: data,
                              url: laiease.webServer + '/web/programItems/saveSelectedOption',
                              done: function (res) {
                                  if (res.data.status) {
                                      layer.closeAll('loading');
                                      layer.close(index); //关闭弹层
                                      layer.msg('添加成功', {icon: 1});
                                      table.reload('program-item-table', {page: {curr: 1}});
                                  } else {
                                      layer.msg('添加失败', {icon: 5});
                                  }
                              }
                          });
                      }
                  });
              },
    
  • 相关阅读:
    加了一句话
    由于数据库 'XXX' 离线,无法打开该数据库。
    Linux命令list
    js 数组去重
    JSON.parse(JSON.stringify()) 实现对对象的深度拷贝,从而互不影响
    docker
    Node child_process Study.2
    node assert模块 Study.1
    git 合并本地分支到远程分支
    Vue 项目搭建
  • 原文地址:https://www.cnblogs.com/ttty/p/13683613.html
Copyright © 2011-2022 走看看