| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <style>
- body{ text-align:center}
- .div{ margin:0 auto; width:600px; height:300px; border:5px solid #F00}
- </style>
- <script>
- function doCancel()
- {//取消
- Z("#divImg").remove()
- }
- function doSubmit()
- {
- var designer = '${designer}';
- var content = Z("#content").val();
- var qcAwardedTypeId;
- var qcTypeId = document.getElementsByName("qcTypeId");
- for(var i=0;i<qcTypeId.length;i++){
- if(qcTypeId[i].checked){
- qcAwardedTypeId = qcTypeId[i].value;
- }
- }
- if (Z.Validates.isEmpty(qcAwardedTypeId))
- {
- Z.alert("请选择加分类型");
- return;
- }
- if (Z.Validates.isEmpty(content))
- {
- Z.alert("请填写加分描述");
- return;
- }
- var data = Z("#imgData").text();
- if(data == "")
- {
- Z.alert("请将加分凭证粘贴在空白区域");
- return;
- }
-
- var ajax = new Z.Ajax();
- ajax.setClassName("QcOrderPresenter");
- ajax.setMethodName("doApplyScore");
- ajax.addParam("data", data);
- ajax.addParam("designer", designer);
- ajax.addParam("content", content);
- ajax.addParam("qcTypeId", qcAwardedTypeId);
- ajax.setFailureAlert();
- ajax.setSuccess(function(){
- Z.success("提交成功",function(){parent.location.reload();parent.Z.Dialog.close();});
- });
- ajax.setLoading("qcPersonal", '正在提交', {disabled:true});
- ajax.execute();
- }
- (function(){
- var imgReader = function( item ){
- var blob = item.getAsFile(),
- reader = new FileReader();
- // 读取文件后将其显示在网页中
- reader.onload = function(e){
- var img = new Image();
- var result = e.target.result;
- Z("#imgData").text(result);
- img.src = result;
- img.id = "divImg";
- Z("#imgSrc").append(img);
- };
- // 读取文件
- reader.readAsDataURL(blob);
- };
- window.addEventListener( 'paste', function(e){
- // 添加到事件对象中的访问系统剪贴板的接口
- var clipboardData = e.clipboardData,
- i = 0,
- items, item, types;
- if(clipboardData){
- items = clipboardData.items;
- if( !items ){
- return;
- }
- item = items[0];
- // 保存在剪贴板中的数据类型
- types = clipboardData.types || [];
- for( ; i < types.length; i++ ){
- if( types[i] === 'Files' ){
- item = items[i];
- break;
- }
- }
- // 判断是否为图片数据
- if( item && item.kind === 'file' && item.type.match(/^image\//i) ){
- imgReader( item );
- }
- }
- });
- })();
- </script>
- ${zhiqim_manager_content()}
- <input type="hidden" id="designId" name="designId" value="${order.getDesignId()}">
- <table class="z-table z-bordered-line z-pd6 z-bg-white z-text-left z-mg-b10">
- <tr class="z-h40">
- <label style="float: left;font-size: 18px;padding: 25px 0px 0px 10px;">加分类型 : </label>
- <div style="width: 700px;height: 41px;position: relative;top: 25px;">
- <ul>
- <#for item : awardedTypeList>
- <li style="display: inline;float: left;padding-left:15px;"><label><input name="qcTypeId" type="radio" data-role="z-radio" data-class="${zmr_color_class}" value="${item.getQcTypeId()}" <#if item_index ==0>checked</#if>> ${item.getQcAwardedName()}</label></li>
- </#for>
- </ul>
- </div>
- </tr>
- <tr class="z-h40">
- <td>
- <textarea id="content" class="z-textarea z-w100p z-h100" placeholder="申请加分描述"></textarea>
- </td>
- </tr>
- </table>
- <div style="display:none" id="imgData"></div>
- <div id="imgSrc"></div>
- <#-- 操作 -->
- <div class="z-absolute z-w100p z-h60 z-text-center z-bg-gray z-pd10" style="bottom:0;left:0">
- <button type="button" id="doSubmit" class="z-button z-large z-w150 ${zmr_color_class}" onclick="doSubmit();">提交</button>
- <button type="button" class="z-button z-large z-w100" onclick="parent.Z.Dialog.close();">关闭</button></td>
- </div>
- ${zhiqim_manager_content_end()}
|