var mmg; function initGrid(){ var h = WST.pageHeight(); var cols = [ {title:'店铺编号', name:'shopSn', width: 30,sortable: true}, {title:'店铺账号', name:'loginName',width: 60,sortable: true}, {title:'店铺名称', name:'shopName',width: 120,sortable: true}, {title:'店主姓名', name:'shopkeeper',width: 40,hidden: true,sortable: true}, {title:'店主联系电话', name:'telephone',width: 30,hidden: true,sortable: true}, {title:'店铺地址', name:'shopAddress',width:300 }, {title:'所属公司', name:'shopCompany',width: 60,hidden: true}, {title:'营业状态', name:'shopAtive' ,width: 20,sortable: true,renderer: function (val,item,rowIndex){ return (item['shopAtive']==1)?" 营业中":" 休息中"; }}, {title:'操作', name:'' ,width:150, align:'center', renderer: function(val,item,rowIndex){ var h = ""; if(WST.GRANT.DPGL_02)h += "修改 "; if(WST.GRANT.DPGL_03 && item['shopId']!=1)h += "删除 "; h += "商家资金"; return h; }} ]; mmg = $('.mmg').mmGrid({height: (h-85),indexCol: true, cols: cols,method:'POST',nowrap:true, url: WST.U('admin/shops/pageQuery'), fullWidthRows: true, autoLoad: true, remoteSort:true , sortName: 'shopSn', sortStatus: 'desc', plugins: [ $('#pg').mmPaginator({}) ] }); } function loadGrid(){ var params = WST.getParams('.j-ipt'); params.areaIdPath = WST.ITGetAllAreaVals('areaId1','j-areas').join('_'); params.page = 1; mmg.load(params); } function initApplyGrid(){ var h = WST.pageHeight(); var cols = [ {title:'申请人账号', name:'loginName', width: 30}, {title:'店铺名称', name:'shopName',width:100 }, {title:'所属公司', name:'shopCompany',width:100 }, {title:'申请联系人', name:'applyLinkMan',width:30 }, {title:'申请联系人电话', name:'applyLinkTel',width:30 }, {title:'对接商城招商人员', name:'applyLinkTel' ,width:50,renderer: function (val,item,rowIndex){ return (item['isInvestment']==1)?item['investmentStaff']:'-'; }}, {title:'申请日期', name:'applyTime' }, {title:'申请状态', name:'applyStatus' ,width:30,renderer: function (val,item,rowIndex){ if(item['applyStatus']==1){ return " 待处理"; }else if(item['applyStatus']==2){ return " 申请成功"; }else{ return " 申请失败"; } }}, {title:'操作', name:'' ,width:80, align:'center', renderer: function(val,item,rowIndex){ var h = ""; if(WST.GRANT.DPSQ_04)h += "操作 "; if(item['applyStatus']==-1 || item['applyStatus'] == 1){ if(WST.GRANT.DPSQ_03)h += "删除 "; } return h; }} ]; mmg = $('.mmg').mmGrid({height: (h-85),indexCol: true, cols: cols,method:'POST',nowrap:true, url: WST.U('admin/shops/pageQueryByApply'), fullWidthRows: true, autoLoad: true, plugins: [ $('#pg').mmPaginator({}) ] }); } function loadApplyGrid(){ var params = WST.getParams('.j-ipt'); params.areaIdPath = WST.ITGetAllAreaVals('areaId1','j-areas').join('_'); params.page = 1; mmg.load(params); } function toHandle(id){ location.href = WST.U('admin/shops/toHandleApply','id='+id); } function toDelApply(id){ var box = WST.confirm({content:"您确定要彻底删除该店铺申请信息吗?",yes:function(){ var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000}); $.post(WST.U('admin/shops/delApply'),{id:id},function(data,textStatus){ layer.close(loading); var json = WST.toAdminJson(data); if(json.status=='1'){ WST.msg("操作成功",{icon:1}); layer.close(box); grid.reload(); }else{ WST.msg(json.msg,{icon:2}); } }); }}); } function initStopGrid(){ var h = WST.pageHeight(); var cols = [ {title:'店铺编号', name:'shopSn', width: 30}, {title:'店铺账号', name:'loginName', width: 60}, {title:'店铺名称', name:'shopName',width: 120}, {title:'店主姓名', name:'shopkeeper',width: 40,hidden: true}, {title:'店主联系电话', name:'telephone',hidden: true}, {title:'店铺地址', name:'shopAddress',width:350 }, {title:'所属公司', name:'shopCompany',hidden: true }, {title:'操作', name:'' ,width:80, align:'center', renderer: function(val,item,rowIndex){ var h = ""; h += "修改 "; h += "删除 "; return h; }} ]; mmg = $('.mmg').mmGrid({height: (h-85),indexCol: true, cols: cols,method:'POST',nowrap:true, url: WST.U('admin/shops/pageStopQuery'), fullWidthRows: true, autoLoad: true, plugins: [ $('#pg').mmPaginator({}) ] }); } function loadStopGrid(){ var params = WST.getParams('.j-ipt'); params.areaIdPath = WST.ITGetAllAreaVals('areaId1','j-areas').join('_'); params.page = 1; mmg.load(params); } var initTab2 = false,initTab3 = false; function initUpload(isEdit){ if(!isEdit){ legalCertificateImgUpload(); businessLicenceImgUpload(); bankAccountPermitImgUpload(); organizationCodeUpload(); taxRegistrationCertificateUpload(); taxpayerQualificationUpload(); }else{ var element = layui.element; element.on('tab(msgTab)', function(data){ if(data.index==1){ if(initTab2)return; initTab2 = true; legalCertificateImgUpload(); businessLicenceImgUpload(); bankAccountPermitImgUpload(); organizationCodeUpload(); }else if(data.index==2){ if(initTab3)return; initTab3 = true; taxRegistrationCertificateUpload(); taxpayerQualificationUpload(); } }); } } function legalCertificateImgUpload (){ WST.upload({ pick:'#legalCertificateImgPicker', formData: {dir:'shops'}, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, callback:function(f){ var json = WST.toAdminJson(f); if(json.status==1){ $('#legalCertificateImgMsg').empty().hide(); $('#legalCertificateImgPreview').attr('src',WST.conf.ROOT+"/"+json.savePath+json.thumb).show(); $('#legalCertificateImgPreview_a').attr('href',WST.conf.ROOT+"/"+json.savePath+json.name); $('#legalCertificateImg').val(json.savePath+json.name); $('#msg_legalCertificateImg').hide(); } }, progress:function(rate){ $('#legalCertificateImgMsg').show().html('已上传'+rate+"%"); } }); } function businessLicenceImgUpload(){ WST.upload({ pick:'#businessLicenceImgPicker', formData: {dir:'shops'}, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, callback:function(f){ var json = WST.toAdminJson(f); if(json.status==1){ $('#businessLicenceImgMsg').empty().hide(); $('#businessLicenceImgPreview').attr('src',WST.conf.ROOT+"/"+json.savePath+json.thumb).show(); $('#businessLicenceImgPreview_a').attr('href',WST.conf.ROOT+"/"+json.savePath+json.name); $('#businessLicenceImg').val(json.savePath+json.name); $('#msg_businessLicenceImg').hide(); } }, progress:function(rate){ $('#businessLicenceImgMsg').show().html('已上传'+rate+"%"); } }); } function bankAccountPermitImgUpload(){ WST.upload({ pick:'#bankAccountPermitImgPicker', formData: {dir:'shops'}, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, callback:function(f){ var json = WST.toAdminJson(f); if(json.status==1){ $('#bankAccountPermitImgMsg').empty().hide(); $('#bankAccountPermitImgPreview').attr('src',WST.conf.ROOT+"/"+json.savePath+json.thumb).show(); $('#bankAccountPermitImgPreview_a').attr('href',WST.conf.ROOT+"/"+json.savePath+json.name); $('#bankAccountPermitImg').val(json.savePath+json.name); $('#msg_bankAccountPermitImg').hide(); } }, progress:function(rate){ $('#bankAccountPermitImgMsg').show().html('已上传'+rate+"%"); } }); } function organizationCodeUpload(){ WST.upload({ pick:'#organizationCodeImgPicker', formData: {dir:'shops'}, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, callback:function(f){ var json = WST.toAdminJson(f); if(json.status==1){ $('#organizationCodeImgMsg').empty().hide(); $('#organizationCodeImgPreview').attr('src',WST.conf.ROOT+"/"+json.savePath+json.thumb).show(); $('#organizationCodeImgPreview_a').attr('href',WST.conf.ROOT+"/"+json.savePath+json.name); $('#organizationCodeImg').val(json.savePath+json.name); $('#msg_organizationCodeImg').hide(); } }, progress:function(rate){ $('#organizationCodeImgMsg').show().html('已上传'+rate+"%"); } }); } function taxRegistrationCertificateUpload(){ var uploader = WST.upload({ pick:'#taxRegistrationCertificateImgPicker', formData: {dir:'shops'}, accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, fileNumLimit:3, callback:function(f,file){ var json = WST.toAdminJson(f); if(json.status==1){ $('#taxRegistrationCertificateImgMsg').empty().hide(); var tdiv = $("
"); var btn = $('