why.xingtongworld.com项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

789 lines
34 KiB

<link href="{$yf_theme_path}/public/css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{$yf_theme_path}/public/js/skin/WdatePicker.css" >
<script type="text/javascript" src="{$yf_theme_path}/public/js/wdatepicker.js"></script>
<script src="{$yf_theme_path}/public/js/jquery.js"></script>
<script src='{$yf_theme_path}/public/js/bootstrap.js'></script>
<script src="{$yf_theme_path}/index/Public/Js/jquery-ui-1.10.3.min.js"></script>
<script src="{$yf_theme_path}/index/Public/Js/jquery.ui.widget.js"></script>
<script src="{$yf_theme_path}/index/Public/Js/jquery.fileupload.js"></script>
<script src="{$yf_theme_path}/index/Public/Js/layer/layer.js"></script>
<script src="{$yf_theme_path}/index/Public/Js/base.js"></script>
<style>
.apply{font-size:1.1rem;}
.control-label{line-height:2.8em;}
.form-horizontal .form-group{margin-right: -10px;margin-left: -10px;}
.attachment-select-trigger{border: 1px dashed #C3C9D0;text-align: center;width: 100%;background-color: rgba(255,255,255,0.65);color: #848484 }
.progress-bar {position: absolute;top: 0;bottom: 0;left: 0;right: 0;background-color: #99D6FF;}
.attachment {position: relative;overflow: hidden;width: 100%;border: 1px solid #E9E9E9;margin-bottom: 6px;}
.actions {position: relative;margin-top: 11px;padding-right: 10px;}
form .info .preview-area,form .info .status {float: none !important;display: inline-block;vertical-align:top}
form .info .status .file-name {max-width:100px}
form .attachment-select-trigger label i {display: table-cell;vertical-align: middle;width: 25px}
form .attachment-field {border: 0;position:relative;margin-bottom: 0}
.attachment-field input[type=file] {height: 100%;width:84%;z-index: 1;cursor: pointer;position: absolute;top: 1px;left: 1px;margin: 0;opacity: 0;filter: alpha(opacity=0);}
.attachment-field .error {color: #FF3824;vertical-align: middle}
.attachment-select-trigger {border: 1px dashed #C3C9D0;text-align: center;width: 100%;background-color: rgba(255,255,255,0.65)}
.attachment-select-trigger:hover, .attachment-select-trigger.drag-over {background-color: #E6F5FF}
.attachment-select-trigger:hover {background-color: rgba(255,255,255,0.65)}
.attachment-select-trigger:active {background-color: #E6F5FF}
.attachment-select-trigger label {margin: 0;display: table;width: 100%}
.attachment-select-trigger label .plus {font-size: 24px;line-height: 1;width: 36px;display: table-cell;vertical-align: middle}
.attachment-select-trigger label .select-text-wrapper {display: table-cell;vertical-align: middle}
.attachment-select-trigger label .select-text {padding: 11px 10px 10px 0;text-align: left;line-height: 1.4;display: table-cell;vertical-align: middle}
.preview-area {width: 28px;height: 28px;margin: 5px;position: relative}
.preview-area .preview {position: absolute;left: 0;top: 0;background: white}
.preview-area .preview img {border-radius: 2px;width: 28px;height: 28px}
.status {position: relative;margin-top: 11px}
.status .file-name {max-width: 280px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;vertical-align: middle}
.status .file-name.error {display: block}
.actions {position: relative;margin-top: 11px;padding-right: 10px}
.actions label {display: inline}
.actions .delete-link {color: #FF7466}
.actions .rechoose-link {color: #009AFF}
.control-label{padding-top:0px !important;margin-bottom:0px !important;}
.form-group{margin-bottom:10px;}
input[type=radio],input[type="checkbox"],.checkbox{margin-top:0px !important;margin-bottom:0px;}
@media screen and (max-width: 480px) {
#pForm .col-xs-2,#pForm .col-xs-10{padding-left:3px;padding-right:3px;}
#pForm .col-xs-2{width:22%;}
#pForm .col-xs-10{width:77.6%;}
#pForm .form-control{padding:3px 6px;height:28px;}
.attachment-select-trigger label .select-text{font-size:0.6rem;padding:6px 5px 5px 0;font-weight:normal;}
}
</style>
<h3 class="text-center" style="margin-top:20px;margin-bottom:15px">拟转让标的清单</h3>
<div class="apply" style="padding:0px 10px;">
<form class="form-horizontal" id="pForm" method="post" action="#" style="padding:0px 10px;width:97%;margin-bottom:0px;">
<div class="form-group">
<label class="col-xs-2 control-label">标的名称<i style="color:red">*</i></label>
<div class="col-xs-10">
<input type="text" class="form-control" name="name" value="">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">标的简介</label>
<div class="col-xs-10">
<input type="text" class="form-control" name="info" value="">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">数据类型<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='padding-left:0px;display:inline-block;padding-left:0px;'>
<label>
<input type="radio" name="type" id="type1" value="1" checked> 文化资源数据
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="type" id="type2" value="2"> 文化数字内容
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">资源类别<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate1" checked value="1"> 图片
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate2" value="2"> 音频
</label>
</div>
<div class="checkbox" style='padding-left:0px;margin-left:10px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate3" value="3"> 视频
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate4" value="4"> 电子文档
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate5" value="5"> 三维全景
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="cate" id="cate6" value="6"> 其他
</label>
</div>
<div class="checkbox" style='margin-left:0px;padding-left:0px;display:inline-block;'>
<label>
<input type="text" name="dcother" id="dcother" value="" style="width:120px;">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">权属来源<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="source" id="source1" checked value="1"> 自创
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="source" id="source2" value="2"> 受让
</label>
</div>
<div class="checkbox" style='padding-left:0px;margin-left:10px;display:inline-block;'>
<label>
<input type="radio" name="source" id="source3" value="3"> 被授权
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="source" id="source4" value="4"> 其他
</label>
</div>
<div class="checkbox" style='margin-left:0px;padding-left:0px;display:inline-block;'>
<label>
<input type="text" name="dsother" id="dsother" value="" style="width:120px;">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">权属证明文件<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="owner" id="owner1" checked value="1"> 开发委托协议
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="owner" id="owner2" value="2"> 授权委托书
</label>
</div>
<div class="checkbox" style='padding-left:0px;margin-left:10px;display:inline-block;'>
<label>
<input type="radio" name="owner" id="owner3" value="3"> 版权登记证明
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="owner" id="owner4" value="4"> 其他
</label>
</div>
<div class="checkbox" style='margin-left:0px;padding-left:0px;display:inline-block;'>
<label>
<input type="text" name="doother" id="doother" value="" style="width:120px;">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">交易方式<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="pay" id="pay1" checked value="1"> 转让
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="pay" id="pay2" value="2"> 普通授权
</label>
</div>
<div class="checkbox" style='padding-left:0px;margin-left:10px;display:inline-block;'>
<label>
<input type="radio" name="pay" id="pay3" value="3"> 排他授权
</label>
</div>
<div class="checkbox" style='margin-left:10px;padding-left:0px;display:inline-block;'>
<label>
<input type="radio" name="pay" id="pay4" value="4"> 独占授权
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">报价(RMB)<i style="color:red">*</i></label>
<div class="col-xs-10">
<input type="text" name="price" id="price" value="" placeholder="可填区间价格">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">授权年限</label>
<div class="col-xs-10">
<input type="text" name="year" id="year" value="" >
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">权利类型<br/>(可多选)<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right1" value="1"> 复制权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right2" value="2"> 发行权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right3" value="3"> 出租权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right4" value="4"> 展览权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right5" value="5"> 改编权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right6" value="6"> 表演权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right7" value="7"> 放映权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right8" value="8"> 广播权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right9" value="9"> 摄制权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right10" value="10"> 翻译权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right11" value="11"> 汇编权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right12" value="12"> 信息网络传播权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="right[]" id="right13" value="13"> 其他
</label>
</div>
<div class="checkbox" style='margin-left:0px;padding-left:0px;display:inline-block;'>
<label>
<input type="text" name="drother" id="drother" value="" style="width:120px;">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">可应用场景<br/>(可多选)<i style="color:red">*</i></label>
<div class="col-xs-10" style="padding-top:8px;">
<div class="checkbox" style='display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence1" value="1"> 软件开发
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence2" value="2"> 文化数字内容服务
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence3" value="3">互联网生活服务平台
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence4" value="4"> 可穿戴智能设备制造权
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence5" value="5"> 广播影视节目制作
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence6" value="6"> 文化娱乐休闲服务
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence7" value="7"> 玩具制造
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence8" value="8"> 动漫游戏
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence9" value="9"> 教育
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence10" value="10"> 服装
</label>
</div>
<div class="checkbox" style='margin-left:10px;display:inline-block;'>
<label>
<input type="checkbox" name="sence[]" id="sence11" value="11"> 其他
</label>
</div>
<div class="checkbox" style='margin-left:0px;padding-left:0px;display:inline-block;'>
<label>
<input type="text" name="sother" id="sother" value="" style="width:120px;">
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label">文件上传<i style="color:red">*</i></label>
<div class="col-xs-10">
<div id="posters" style="min-height:60px">
<div class="attachment-field">
<input type="file" name="allpicbtn" id="allpicbtn" class="jquery-file-upload-file-input" >
<input type="hidden" name="files" id="files" class="picfield">
<div class="attachments"></div>
<div class="attachment-select-trigger">
<label><div class="plus">+</div><div class="select-text-wrapper">
<div class="select-text">上传标的开发委托协议、授权委托书、版权登记证明、其他等(可上传JPG、PNG、MP3、MP4、PDF等格式文件,文件大小不超过20M,最多10张)</div>
</div></label>
</div>
<div class="attachment-error-message"></div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<input type="hidden" name="capitalid" id="id">
<input type="hidden" name="id" id="id">
<div class="col-xs-5 col-xs-offset-1"><button type="button" class="btn btn-danger closebtn" style="width:100%">取消</button></div>
<div class="col-xs-5"><button type="button" class="btn btn-danger submitbtn" style="width:100%">保存</button></div>
</div>
</div>
</form>
<br/>
</div>
<script>
function change(limit){
var size = "";
if(limit < 0.1 * 1024){ //小于0.1KB,则转化成B
size = limit.toFixed(2) + "B"
}else if(limit < 0.1 * 1024 * 1024){ //小于0.1MB,则转化成KB
size = (limit/1024).toFixed(2) + "KB"
}else if(limit < 0.1 * 1024 * 1024 * 1024){ //小于0.1GB,则转化成MB
size = (limit/(1024 * 1024)).toFixed(2) + "MB"
}else{ //其它转化成GB
size = (limit/(1024 * 1024 * 1024)).toFixed(2) + "GB"
}
var sizeStr = size + ""; //转成字符串
var index = sizeStr.indexOf("."); //获取小数点处的索引
var dou = sizeStr.substr(index + 1 ,2) //获取小数点后两位的值
if(dou == "00"){ //判断后两位是否为00,如果是则删除00
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2)
}
return size;
}
function uploadPic(url,btn,input,current,num){
//插件jquery.fileupload.js
jQuery(btn).fileupload({
add: function (e, data) {
var acceptFileTypes = /^image\/(gif|jpe?g|png)$/i;
//文件类型判断
if(data.originalFiles[0]['type'].length && !acceptFileTypes.test(data.originalFiles[0]['type'])) {
tool.msg("上传文件类型不对");
return false;
}
data.submit();
},
url: url,
dataType: 'json',
done: function (e, data) {
var file=data.result;
tool.msg(file['msg']);
if(file['code']==1){
var pic=file['data']['path'];
if(num==1){
$(input).val(pic);
$(btn).val(pic);
}else{
var cur=$(input).val();
var ipic='';
if(cur)ipic=cur+';'+pic;
else ipic=pic;
$(input).val(ipic);
}
}else{
$(".attachments .attachment:last").remove();
}
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
var count=$(".attachments").eq(current).find(".attachment").length;
var curbar=current;
if(num>1){
curbar=count-1;
}
console.log('curbar:'+curbar);
$("#progressbar"+curbar).css({'width':progress+"%"});
if(progress==100){
$("#progressbar"+curbar).delay(500).fadeOut();
}
}
}).bind('fileuploadadd',function(e,data){
var file=data['files'][0];
var url = null;
if (window.createObjectURL != undefined) {
url = window.createObjectURL(file);
} else if (window.URL != undefined) {
url = window.URL.createObjectURL(file);
} else if (window.webkitURL != undefined) {
url = window.webkitURL.createObjectURL(file);
}
var name=file['name'];
var size=change(file['size']);
var count=$(".attachments").eq(current).find(".attachment").length;
var curbar=current;
if(num>1){
curbar=count;
}
console.log('curbar2:'+curbar,url,num);
if(/^blob/.test(url)){
var html='<div class="attachment clearfix">';
html+='<div class="progress-bar" id="progressbar'+curbar+'" role="progressbar" aria-valuenow="0" data-transitiongoal="100" aria-valuemin="0" aria-valuemax="100"></div>';
html+='<div class="info clearfix"><div class="preview-area pull-left"><div class="preview"><img src="'+url+'" width="100%" /></div></div>';
html+='<div class="status pull-left"><span class="file-name">'+name+'</span><span class="file-size-status">(<span class="file-size">'+size+'<span></span></span>)</span></div>';
html+='<div class="actions web-actions pull-right"><a data-role="cancel" class="delete-link" data-index="'+curbar+'" href="javascript:void(0)">删除</a></div></div></div>';
console.log('html:',html,current);
if(num==1){
$(".attachments").eq(current).html(html);
}else{
if(count>=num){
tool.msg("超过允许上传图片张数");
return false;
}
$(".attachments").eq(current).append(html);
}
}
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
}
function uploadFile(url,btn,input,current,num){
//插件jquery.fileupload.js
jQuery(btn).fileupload({
add: function (e, data) {
var acceptFileTypes = /^application\/(zip|x-zip-compressed|x-rar-compressed|octet-stream)$/i;
//文件类型判断
if(data.originalFiles[0]['type'].length && !acceptFileTypes.test(data.originalFiles[0]['type'])) {
tool.msg("上传文件类型不对");
return false;
}
data.submit();
},
url: url,
dataType: 'json',
done: function (e, data) {
var file=data.result;
tool.msg(file['msg']);
console.log('file',file);
if(file['code']==1){
var data=file['data'];
var filename=data['filename'];
var pic=data['path'];
console.log("file",file);
if(pic){
$(""+input).val(pic);
var parent=$(btn).parent(".attachment-field");
parent.find(".select-text").html("提供rar/zip格式(已上传:"+filename+")");
}
}
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
var parent=$(btn).parent(".attachment-field");
parent.find(".select-text").html("提供rar/zip格式(已上传"+progress+"%)");
}
}).bind('fileuploadadd',function(e,data){
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
}
$(function(){
var capindex="<?php echo input('index','');?>";
if(capindex!='undefined'&&capindex!=''){
capindex=parseInt(capindex);
var data=parent.$('#prolist tbody tr').eq(capindex).attr('data-json');
if(data!='undefined'){
$("#capitalid").val(capindex);
data=data.split("&");
var capital_type='';
var capchild='';
if(data.length){
for(var i=0;i<data.length;i++){
var row=data[i].split('=');
if(row.length==2){
if(row[0]=='sence[]'||row[0]=='sence'||row[0]=='right[]'||row[0]=='right'||row[0]=='cate'||row[0]=='source'||row[0]=='owner'||row[0]=='pay'||row[0]=='type'){
var key=row[0];
var ret=row[1];
console.log("capital arr",key,ret,row);
$("input[name='"+key+"']").each(function(){
var val=$(this).val();
if(ret.length>1){
console.log("val",val,ret.indexOf(val));
if(ret.indexOf(val)!=-1){
$(this).prop("checked",true);
}
}else{
if(val==ret){
$(this).prop("checked",true);
}
}
});
continue;
}
if(row[0]=='files'){
var pics=decodeURIComponent(row[1]);
if(pics){
$("input[name='"+row[0]+"']").val(pics);
pics=pics.split(';');
console.log("pics2",pics);
if(typeof pics=='object'&&pics.length){
for(var j=0;j<pics.length;j++){
if(pics[j]){
console.log("pic",pics[j]);
var html='<div class="attachment clearfix">';
html+='<div class="progress-bar" id="progressbar'+j+'" role="progressbar" aria-valuenow="0" data-transitiongoal="100" aria-valuemin="0" aria-valuemax="100"></div>';
html+='<div class="info clearfix"><div class="preview-area pull-left"><div class="preview"><img src="'+pics[j]+'" width="100%" /></div></div>';
html+='<div class="status pull-left"><span class="file-name">照片'+(j+1)+'</span></div>';
html+='<div class="actions web-actions pull-right"><a data-role="cancel" class="delete-link" data-index="'+j+'" href="javascript:void(0)">删除</a></div></div></div>';
$(".attachments").eq(0).append(html);
}
}
}
}
continue;
}
console.log("key",row[0]);
var robj=$("input[name='"+row[0]+"']");
var rlen=robj.length;
if(rlen&&row[0]!='capitalid'){
robj.val(row[1]);
console.log("key",row[0],row[1]);
continue;
}
}
}
}
}
}
$("body").delegate(".delete-link",'click',function(){
var parent=$(this).parents('.attachment-field');
var index=parent.find(this).index('.delete-link');
var pics=parent.find('.picfield').val();
if(pics){
pics=pics.split(';');
pics.splice(index,1);
pics=pics.join(';');
parent.find('.picfield').val(pics);
}
var parent=$(this).parents(".attachment");
parent.remove();
});
var url="{:url('upload',['key'=>'allpicbtn'])}";
uploadPic(url,"#allpicbtn","#files",0,10);
//注意:parent 是 JS 自带的全局对象,可用于操作父页面
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//关闭iframe
$('.closebtn').click(function(){
parent.layer.close(index);
});
$('.submitbtn').click(function(){
var capname = $('input[name="name"]').val();
var cate = $('[name="cate"]:checked').length;
var ctval = $('[name="cate"]:checked').val();
var dcother = $('[name="dcother"]').val();
var source = $('[name="source"]:checked').length;
var suval = $('[name="source"]:checked').val();
var dsother = $('[name="dsother"]').val();
var owner = $('[name="owner"]:checked').length;
var owval = $('[name="owner"]:checked').val();
var doother = $('[name="doother"]').val();
var pay = $('[name="pay"]:checked').length;
var payval=$('[name="pay"]').val();
console.log('payval',payval);
var price = $('#price').val();
var year = $('#year').val();
var right = $('[name="right[]"]:checked').length;
var drother = $('[name="drother"]').val();
var sence = $('[name="sence[]"]:checked').length;
var sother = $('[name="sother"]').val();
if(capname === ''){
parent.layer.msg('请填写标的名称');
return;
}
if(cate ===0){
parent.layer.msg('请选择资源类别');
return;
}
console.log("cate",ctval,dcother);
if(ctval ==6&&(typeof dcother=='undefined'||dcother==null||dcother=='')){
parent.layer.msg('请填写资源类别其他内容');
return;
}
if(source ===0){
parent.layer.msg('请选择权属来源');
return;
}
console.log("source",suval,dsother);
if(suval ==4&&(typeof dsother=='undefined'||dsother==null||dsother=='')){
parent.layer.msg('请填写权属来源其他内容');
return;
}
if(owner ===0){
parent.layer.msg('请选择权属证明文件');
return;
}
console.log("owner",owval,doother);
if(owval ==4&&(typeof doother=='undefined'||doother==null||doother=='')){
parent.layer.msg('请填写权属证明文件其他内容');
return;
}
if(pay ===0){
parent.layer.msg('请选择交易方式');
return;
}
if(price ===''){
parent.layer.msg('请填写报价');
return;
}
if(payval!=1&&year ===''){
parent.layer.msg('请填写授权年限');
return;
}
if(right ===0){
parent.layer.msg('请选择权利类型');
return;
}else{
var arrChk=$('[name="right[]"]:checked');
var chk=true;
$(arrChk).each(function(){
if(this.value==13){
console.log("right",right,drother);
if(typeof drother=='undefined'||drother==null||drother==''){
chk=false;
}
}
});
if(!chk){
parent.layer.msg('请填写权利类型其他内容');
return ;
}
}
if(sence ===0){
parent.layer.msg('请选择可应用场景');
return;
}else{
var arrChk=$('[name="sence[]"]:checked');
var chk=true;
$(arrChk).each(function(){
if(this.value==11){
console.log("sence",sence,sother);
if(typeof sother=='undefined'||sother==null||sother==''){
chk=false;
}
}
});
if(!chk){
parent.layer.msg('请填写可应用场景其他内容');
return ;
}
}
var val = $('input[name="files"]').val();
if(val === ''){
parent.layer.msg('请上传资产图片');
return;
}
var data=$("#pForm").serialize();
data=decodeURIComponent(data,true);
var type=$("[name='type']").val();
var captype='文化资源数据';
if(type==2){
captype='文化数字内容';
}
var len=parent.$('#prolist tbody tr').length+1;
var html='<tr data-json="'+data+'">';
if(capindex!==''){len=parseInt(capindex)+1}
var id="";
html+='<td style="padding:3px 0px;">'+len+'</td><td>'+capname+'</td><td>'+captype+'</td><td>'+price+'</td>';
if(id){
html+='<td><span class="listedstatus">未审核</span></td>';
}
html+='<td style="padding:3px 0px;">';
html+='<div style="width:42px;display:inline-block;margin-right:5px;"><div class="modeub edtproduct"><div class="leftbutton2"></div><div class="box_flex_1 centerbutton2 list_flex flex_center" style="cursor:pointer;">编辑</div><div class="rightbutton2"></div></div></div>';
html+='<div style="width:42px;display:inline-block;"><div class="modeub delproduct"><div class="leftbutton2"></div><div class="box_flex_1 centerbutton2 list_flex flex_center" style="cursor:pointer;">删除</div><div class="rightbutton2"></div></div></div>';
html+='</td></tr>';
if(capindex!==''){
console.log("capindex inter");
parent.$('#prolist tbody tr').eq(capindex).remove();
if(capindex>0){
parent.$('#prolist tbody tr').eq(capindex-1).after(html);
}else{
parent.$('#prolist tbody').prepend(html);
}
}else{
parent.$('#prolist tbody').append(html);
}
parent.layer.close(index);
});
})
</script>