275 lignes
10 KiB
Plaintext
275 lignes
10 KiB
Plaintext
${zhiqim_manager_breadcrumb("考试题库")}
|
|
${Styles.htmlOverflowHidden()}
|
|
${Scripts.src(zhiqim_uploadlarge.js)}
|
|
<script>
|
|
|
|
var upload;
|
|
Z.onload(function()
|
|
{
|
|
upload = new Z.UploadLarge();
|
|
initUploader("MaterialFile", '${customPath}', "uploadingFileList", upload);
|
|
});
|
|
|
|
//初始化文件上传组件
|
|
function initUploader(fileType, path, dropWrap, upload)
|
|
{
|
|
upload.elem = "upload_" + fileType;
|
|
upload.contextPath = "${context.getContextPath()}";
|
|
upload.showResult = false;
|
|
upload.fileCopy = true;
|
|
upload.multiSelect = true;
|
|
upload.dropWrap = dropWrap;
|
|
upload.multiDisplayType = 0;
|
|
upload.setFileDir(path);
|
|
upload.onSelected = function(fileName, fileLength)
|
|
{
|
|
var questionsId = Z("#questionsId:checked").val();
|
|
if (Z("#questionsId:checked").length <= 0)
|
|
{
|
|
Z.alert("请选择订单");
|
|
return false;
|
|
}
|
|
this.setFileName(questionsId + "-" + fileName);
|
|
};
|
|
upload.onCompleted = function(fileList, uploadedList)
|
|
{
|
|
var questionsId = Z("#questionsId:checked").val();
|
|
for(var i = 0; i < uploadedList.length; i++)
|
|
{//保存附件信息
|
|
var fileModle = uploadedList[i]
|
|
var ajax = new Z.Ajax();
|
|
ajax.setSync();
|
|
ajax.setClassName("QuestionsFilePresenter");
|
|
ajax.setMethodName("uploadQuestionsFile");
|
|
ajax.addParam(questionsId);
|
|
ajax.addParam(fileModle.fileId);
|
|
ajax.addParam(fileType);
|
|
ajax.setFailureAlert();
|
|
ajax.setSuccess(function(responseText)
|
|
{
|
|
var obj = Z.J.toObject(this.responseText);
|
|
var items = obj.attaList;
|
|
Z("#CustomFileList").html("");//清除历史数据
|
|
|
|
var html = "";
|
|
for (var i=0;i<items.length;i++)
|
|
{
|
|
var obj = items[i];
|
|
html += "<div id='ck_"+obj.attaId+"' onclick='Z(this).find(\"zcover>i.z-checkbox\").click()' class='z-pointer z-pd-b4 z-text-ellipsis' style='width:370px' title='" + obj.fileName +"'>";
|
|
html += "<input name='" + fileType +"_str' class='z-checkbox' data-role='z-checkbox' data-class='z-blue' type='checkbox' value ='" + obj.attaId +"'/>"+obj.fileName;
|
|
html += "</div>";
|
|
}
|
|
Z("#CustomFileList").htmlc(html);
|
|
});
|
|
ajax.execute();
|
|
}
|
|
|
|
Z("#"+upload.dropWrap).html("");//清空上传列表信息
|
|
|
|
};
|
|
upload.execute();
|
|
}
|
|
|
|
//添加订单
|
|
function designOrderQuestionsAdd()
|
|
{
|
|
var designRequirements = Z("#designRequirements").val();
|
|
var dialog = new Z.Dialog();
|
|
dialog.title = "添加考试订单";
|
|
dialog.url = "configQuestionsAdd.htm";
|
|
dialog.width = 640;
|
|
dialog.height = 300;
|
|
dialog.execute();
|
|
}
|
|
|
|
//修改订单
|
|
function designOrderQuestionsModify(){
|
|
|
|
var questionsId = Z.FM.getChecked("questionsId");
|
|
if(Z.V.isEmpty(questionsId)){
|
|
Z.alert("请选择一个订单");
|
|
return;
|
|
}
|
|
var dialog = new Z.Dialog();
|
|
dialog.title = "订单["+questionsId+"]编辑";
|
|
dialog.url = "/configQuestionsModify.htm?questionsId="+questionsId;
|
|
dialog.width = 640;
|
|
dialog.height = 200;
|
|
dialog.execute();
|
|
|
|
}
|
|
|
|
//删除订单
|
|
function doDesignOrderQuestionsDelete(){
|
|
var questionsId = Z.FM.getChecked("questionsId");
|
|
if(Z.V.isEmpty(questionsId)){
|
|
Z.alert("请选择一个订单");
|
|
return;
|
|
}
|
|
var ajax = new Z.Ajax();
|
|
ajax.setClassName("ConfigQuestionsAction");
|
|
ajax.setMethodName("designOrderQuestionsDelete");
|
|
ajax.addParam("questionsId", questionsId);
|
|
ajax.setFailureAlert();
|
|
ajax.setSuccess(function() {
|
|
Z.success("删除成功", function(){
|
|
parent.location.reload();
|
|
parent.Z.Dialog.close();
|
|
});
|
|
});
|
|
ajax.execute();
|
|
}
|
|
|
|
//显示客户文件列表
|
|
function showOrderCustomFileList(questionsId)
|
|
{
|
|
var ajax = new Z.Ajax();
|
|
ajax.setClassName("QuestionsFilePresenter");
|
|
ajax.setMethodName("showMaterialFileList");
|
|
ajax.addParam("questionsId", questionsId);
|
|
ajax.setFailureAlert();
|
|
ajax.setSuccess(function(responseText)
|
|
{
|
|
var obj = Z.J.toObject(responseText);
|
|
var attaList = obj.attaList;
|
|
var html = "";
|
|
for (var i=0;i<attaList.length;i++)
|
|
{
|
|
var obj = attaList[i];
|
|
html += "<div id='ck_"+obj.attaId+"' class='z-pointer z-pd-b4 z-text-ellipsis' onclick='Z(this).find(\"zcover>i.z-checkbox\").click()' style='width:370px' title='" + obj.fileName +"'>";
|
|
html += "<input name='MaterialFile_str' class='z-checkbox' data-role='z-checkbox' data-class='z-blue' type='checkbox' value ='" + obj.attaId +"'/>"+obj.fileName;
|
|
html += "</div>";
|
|
}
|
|
|
|
Z("#CustomFileList").htmlc(html);
|
|
});
|
|
ajax.execute();
|
|
}
|
|
|
|
function doDownFile(){
|
|
var attaIds = Z.FM.getCheckBoxValue("MaterialFile_str", "");
|
|
if (Z.V.isEmpty(attaIds))
|
|
{
|
|
Z.alert("请选择需要下载的素材");
|
|
return ;
|
|
}
|
|
|
|
var mainFrame = parent.parent.document.getElementById("mainFrame");
|
|
var mainSrc = mainFrame.src;
|
|
var prefix = Z.l.protocol + "//" + Z.l.host ;
|
|
var element1 = document.createElement("a");
|
|
element1.href = prefix+"/downQuestionsFile.htm?attaId=" + attaIds;
|
|
Z.L.href(prefix+"/downQuestionsFile.htm?attaId=" + attaIds, zCallFrame);
|
|
}
|
|
|
|
//删除文件
|
|
function doDeleteFile(fileType)
|
|
{
|
|
var attaIds = Z.FM.getCheckBoxValue("MaterialFile_str", "");
|
|
if (Z.V.isEmpty(attaIds))
|
|
{
|
|
Z.alert("请选择需要删除的素材");
|
|
return ;
|
|
}
|
|
var ajax = new Z.Ajax();
|
|
ajax.setClassName("QuestionsFilePresenter");
|
|
ajax.setMethodName("deleteMaterialFile");
|
|
ajax.addParam(attaIds);
|
|
ajax.setFailure(function(s){Z.alert(s);});
|
|
ajax.setSuccess(function(){
|
|
var ids = attaIds.split(",");
|
|
for (var i=0; i<ids.length; i++)
|
|
{
|
|
var el = Z("#ck_"+ids[i]);
|
|
el.remove();
|
|
}
|
|
});
|
|
ajax.execute();
|
|
}
|
|
|
|
</script>
|
|
|
|
${zhiqim_manager_breadcrumb("订单列表")}
|
|
${zhiqim_manager_content()}
|
|
|
|
<#-- 导航 -->
|
|
<div data-role="z-tabnav" class="z-tabnav-main z-mg-b20 ${zmr_color_class}">
|
|
<nav>
|
|
<ul>
|
|
<li class="z-active">考核订单列表</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
|
|
<#-- 左侧功能 -->
|
|
<div id="left" class="z-overflow-y-auto z-overflow-x-hidden z-relative-left">
|
|
<#-- 查询条件 -->
|
|
${zhiqim_manager_title("查询条件")}
|
|
<form name="theForm" action="designOrderQuestions.htm" method="post">
|
|
<table class="z-table z-bordered z-pd6 z-bg-white">
|
|
<tr>
|
|
<td> 设计要求:<input name="designRequirements" type="text" class="${zmr_color_class} z-input z-w160" value="${designRequirements}" placeholder="输入关键字"></td>
|
|
<td width="800px">
|
|
<button class="z-blue z-button" ><i class="z-font z-query"></i>查询</button>
|
|
<button type="button" class="z-button" onclick="Z.Forms.clearForm(this.form);">清空</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
|
|
<#-- 操作功能 -->
|
|
<div class="z-w100p z-mg-t10 z-mg-b3">
|
|
<button type="button" class="z-button z-blue" onclick="designOrderQuestionsAdd();"><i class="z-font z-add"></i>添加订单</button>
|
|
<button type="button" class="z-button z-blue" onclick="designOrderQuestionsModify();"><i class="z-font z-modify"></i>修改订单</button>
|
|
<button type="button" class="z-button z-red" onclick="doDesignOrderQuestionsDelete();"><i class="z-font z-delete"></i>删除订单</button>
|
|
</div>
|
|
|
|
<#-- 列表 -->
|
|
<div class="z-overflow-auto z-bd-r">
|
|
<table class="z-table z-bordered z-h40-tr z-pd5 zi-bd-r-none z-bg-white z-text-center" style="width:1220px">
|
|
<tr bgcolor="${zmr_thead_bgcolor}">
|
|
<td width="5">选择</td>
|
|
<td width="120">设计要求</td>
|
|
<td width="40">操作员</td>
|
|
<td width="20">最后修改时间</td>
|
|
</tr>
|
|
<#if pageResult.total() == 0>
|
|
<tr valign="middle" class="z-text-center z-bg-white z-h40">
|
|
${zhiqim_manager_no_record(9 "暂时没有数据")}
|
|
</tr>
|
|
</#if>
|
|
<#for item : pageResult.list()>
|
|
<tr class="z-pointer bgcolor="${zhiqim_manager_tr_bg(item_index)}" ${zhiqim_manager_tr_click_radio()}>
|
|
<td><input id="questionsId" name="questionsId" class="z-radio" data-role="z-radio" data-class=" ${zmr_color_class}" value="${item.getQuestionsId()}" type="radio" onclick="Z.E.stop();showOrderCustomFileList('${item.getQuestionsId()}')"></td>
|
|
<td>${item.getDesignRequirements()}</td>
|
|
<td>${item.getUpdateOperator()}</td>
|
|
<td>${Sqls.toDateTimeString(item.getModificationTime())}</td>
|
|
</tr>
|
|
</#for>
|
|
</table>
|
|
</div>
|
|
${zhiqim_manager_paging(pageResult, "designOrderQuestions.htm")}
|
|
</div>
|
|
${zhiqim_manager_content_end()}
|
|
|
|
<#-- 右侧信息&客户素材-->
|
|
<div class="z-fixed z-pd10 z-bd z-bg-white z-h100p z-overflow-y-auto z-overflow-x-hidden" style="top:0;right:0;width:450px;z-index:50">
|
|
<table class="z-table z-pd10 z-bordered z-w100p" style="margin-top:20px;">
|
|
<tr class="z-h40" bgcolor="${zmr_thead_bgcolor}">
|
|
<td>
|
|
<input type="checkbox" class="z-checkbox" data-role="z-checkbox" data-class="${zmr_color_class}" onclick="Z.FM.doSelectCheckBox('MaterialFile_str', this.checked);" ><b class="z-pd4">订单素材</b>
|
|
<button id="upload_MaterialFile" class="z-button z-mg-l20 ${zmr_color_class} z-mg-r6">添加</button>
|
|
<button id="doUpload" class="z-button z-mg-l2 z-cyan z-mg-r2" onclick="upload.upload()">开始上传</button>
|
|
<button class="z-button z-orange z-mg-l6" onclick="doDownFile();">下载</button>
|
|
<button class="z-button z-red z-mg-l6 z-mg-r6" onclick="doDeleteFile();">删除</button>
|
|
</td>
|
|
</tr>
|
|
<tr class="z-h40" >
|
|
<td class="z-pd-l10">
|
|
<#--客户素材列表-->
|
|
<div class="z-overflow-y-auto" style="width:400px" id="uploadingFileList"></div>
|
|
<div class="z-overflow-y-auto z-h120 z-w100p" id="CustomFileList"></div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div> |