| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <title>任塿±æ¥</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <meta name="viewport" |
| | | content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all"> |
| | | <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script> |
| | |
| | | </style>--> |
| | | |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="layui-fluid" style="padding: 0;"> |
| | | <div class="layui-card" style="padding: 2px;background-color: #efefef;"> |
| | |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">æ°å¢</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">ä¿®æ¹</button>--> |
| | | |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">ä¿å</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">éåº</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" |
| | | lay-filter="btnSave" id="btnSave">ä¿å</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" |
| | | lay-filter="btnEdit" id="btnEdit">éåº</button> |
| | | <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">å®¡æ ¸</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">åå®¡æ ¸</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">å
³é</button> |
| | |
| | | <div class="layui-form-item" style="padding-top: 10px;"> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">åæ®å·<label style="color:red"> * </label></label> |
| | | <label class="layui-form-label" style="width: 85px;">åæ®å·<label |
| | | style="color:red"> * </label></label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly> |
| | | <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID"> |
| | | <input type="text" class="layui-input" name="HBillNo" |
| | | lay-verify="HBillNo" id="HBillNo" |
| | | style="background-color:#efefef4d;" readonly> |
| | | <input type="hidden" name="HInterID" id="HInterID" |
| | | lay-verify="HInterID"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">æ¥æ<label style="color:red"> * </label></label> |
| | | <label class="layui-form-label" style="width: 85px;">æ¥æ<label |
| | | style="color:red"> * </label></label> |
| | | <div class="layui-input-block" style="margin-left: 120px; width:180px;"> |
| | | <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;"> |
| | | <input type="date" class="layui-input" lay-verify="HDate" name="HDate" |
| | | id="HDate" style="padding-left: 80px;"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">æ±æ¥äºº<label style="color:red"> * </label></label> |
| | | <label class="layui-form-label" |
| | | style="width: 85px;padding: 9px 18px;">æ±æ¥äºº<label style="color:red"> * |
| | | </label></label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" lay-verify="HReportEmpName" name="HReportEmpName" id="HReportEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="hidden" name="HReportEmpID" id="HReportEmpID" lay-verify="HReportEmpID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHReportEmp" id="btnSearchHReportEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <input type="text" class="layui-input" lay-verify="HReportEmpName" |
| | | name="HReportEmpName" id="HReportEmpName" |
| | | style="background-color:#efefef4d;width: 60%;display: inline-block;" |
| | | readonly> |
| | | <input type="hidden" name="HReportEmpID" id="HReportEmpID" |
| | | lay-verify="HReportEmpID" value="0"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" |
| | | lay-submit="" lay-filter="btnSearchHReportEmp" |
| | | id="btnSearchHReportEmp" |
| | | style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">æ¥æ¶äºº</label> |
| | | <label class="layui-form-label" |
| | | style="width: 85px;padding: 9px 18px;">æ¥æ¶äºº</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" lay-verify="HReceiveEmp" name="HReceiveEmp" id="HReceiveEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="text" class="layui-input" lay-verify="HReceiveEmp" |
| | | name="HReceiveEmp" id="HReceiveEmp" |
| | | style="background-color:#efefef4d;width: 60%;display: inline-block;" |
| | | readonly> |
| | | <!--<input type="hidden" name="HPMEmpID" id="HPMEmpID" lay-verify="HPMEmpID" value="0">--> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHReceiveEmp" id="btnSearchHReceiveEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" |
| | | lay-submit="" lay-filter="btnSearchHReceiveEmp" |
| | | id="btnSearchHReceiveEmp" |
| | | style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">æé人</label> |
| | | <label class="layui-form-label" |
| | | style="width: 85px;padding: 9px 18px;">æé人</label> |
| | | <div class="layui-input-block" style="margin-left: 77px;"> |
| | | <input type="text" class="layui-input" lay-verify="HCopyEmp" name="HCopyEmp" id="HCopyEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly> |
| | | <input type="text" class="layui-input" lay-verify="HCopyEmp" |
| | | name="HCopyEmp" id="HCopyEmp" |
| | | style="background-color:#efefef4d;width: 60%;display: inline-block;" |
| | | readonly> |
| | | <!--<input type="hidden" name="HWorkEmpID" id="HWorkEmpID" lay-verify="HWorkEmpID" value="0">--> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHCopyEmp" id="btnSearchHCopyEmp" style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" |
| | | lay-submit="" lay-filter="btnSearchHCopyEmp" id="btnSearchHCopyEmp" |
| | | style="padding: 0 10px;float: right;margin-right: 3px;"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">夿³¨</label> |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 501px;"> |
| | | <input type="text" class="layui-input" lay-verify="HRemark" name="HRemark" id="HRemark"> |
| | | <input type="text" class="layui-input" lay-verify="HRemark" |
| | | name="HRemark" id="HRemark"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ç»ç»<label style="color:red"> * </label></label> |
| | | <label class="layui-form-label" style="width: 85px;">ç»ç»<label |
| | | style="color:red"> * </label></label> |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 501px;"> |
| | | <select name="HOrgID" id="HOrgID" lay-verify="HOrgID"> |
| | | <!--å¨ææ¸²æç»ç»--> |
| | |
| | | <div class="layui-row"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-block" style="margin-left: 120px; width: 501px;"> |
| | | <input type="hidden" name="HProID" id="HProID" lay-verify="HProID" value="0"> |
| | | <input type="hidden" name="HProjectStageID" id="HProjectStageID" lay-verify="HProjectStageID" value="0"> |
| | | <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" lay-verify="HMainSourceBillType" value=""> |
| | | <input type="hidden" name="HMainSourceBillNo" id="HMainSourceBillNo" lay-verify="HMainSourceBillNo" value=""> |
| | | <input type="hidden" name="HProID" id="HProID" lay-verify="HProID" |
| | | value="0"> |
| | | <input type="hidden" name="HProjectStageID" id="HProjectStageID" |
| | | lay-verify="HProjectStageID" value="0"> |
| | | <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" |
| | | lay-verify="HMainSourceBillType" value=""> |
| | | <input type="hidden" name="HMainSourceBillNo" id="HMainSourceBillNo" |
| | | lay-verify="HMainSourceBillNo" value=""> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å¶å人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HMaker" id="HMaker" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä¿®æ¹äºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HUpdater" id="HUpdater" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HUpdater" id="HUpdater" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å®¡æ ¸äºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HChecker" id="HChecker" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å¶åæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HMakerDate" id="HMakerDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HMakerDate" id="HMakerDate" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä¿®æ¹æ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HUpdaterDate" id="HUpdaterDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HUpdaterDate" |
| | | id="HUpdaterDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å®¡æ ¸æ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCheckerDate" id="HCheckerDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HCheckerDate" |
| | | id="HCheckerDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å
³é人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä½åºäºº</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">éå人</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HBacker" id="HBacker" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HBacker" id="HBacker" |
| | | style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">å
³éæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HCloseManDate" id="HCloseManDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HCloseManDate" |
| | | id="HCloseManDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">ä½åºæ¥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HDeleteManDate" id="HDeleteManDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HDeleteManDate" |
| | | id="HDeleteManDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">é忥æ</label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HBackerDate" id="HBackerDate" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HBackerDate" |
| | | id="HBackerDate" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 85px;">éååå </label> |
| | | <div class="layui-input-block" style="margin-left: 120px;"> |
| | | <input type="text" class="layui-input" name="HBackRemark" id="HBackRemark" style="background-color:#efefef4d;" readonly> |
| | | <input type="text" class="layui-input" name="HBackRemark" |
| | | id="HBackRemark" style="background-color:#efefef4d;" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <ul class="layui-tab-title" lay-filter="tab-all"> |
| | | <li lay-id="1" style="padding:1px;" class="layui-this">项ç®é¶æ®µ</li> |
| | | <li lay-id="2" style="padding:1px;" class="layui-this">éä»¶</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <!--å表--> |
| | |
| | | </div> |
| | | </script> |
| | | </div> |
| | | <!-- å表éä»¶ --> |
| | | <div class="layui-tab-item layui-show"> |
| | | <script type="text/html" id="toolbarAttachmentTable"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-ChooseFile"><i class="layui-icon layui-icon-form"></i>ä¸ä¼ éä»¶</button> --> |
| | | </div> |
| | | </script> |
| | | <table class="layui-hide" id="AttachmentTable" lay-filter="AttachmentTable"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | |
| | | <script type="text/html" id="barDemo"> |
| | | <!--<a class="layui-btn layui-btn-xs" lay-event="edit">ç¼è¾</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">å é¤</a> |
| | | </script> |
| | | |
| | | <!-- å表éä»¶ æä½æ --> |
| | | <script type="text/html" id="AttachmentOperate"> |
| | | <!-- ä¸ä¼ åæ¾ç¤º --> |
| | | <div {{d.uploadStatus==0 ? '' : 'style="display:none;"' }} class="waitUploaded"> |
| | | <a class="layui-btn layui-btn-xs" lay-event="fileSelect">éæ©æä»¶</a> |
| | | </div> |
| | | <!-- å¾
ä¸ä¼ æ¾ç¤º --> |
| | | <div {{d.uploadStatus==1 ? '' : 'style="display:none;"' }} class="preUploaded"> |
| | | <a class="layui-btn layui-btn-xs" lay-event="fileUpload">ä¸ä¼ æä»¶</a> |
| | | </div> |
| | | <!-- ä¸ä¼ åæ¾ç¤º --> |
| | | <div {{d.uploadStatus==2 ? '' : 'style="display:none;"' }} class="uploaded"> |
| | | <a class="layui-btn layui-btn-xs" lay-event="downloadFile">ä¸è½½</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delFile">å é¤</a> |
| | | </div> |
| | | </script> |
| | | |
| | | <!--å¤éæ¡ å®ææ è®°--> |
| | |
| | | base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | | index: 'lib/index' //主å
¥å£æ¨¡å |
| | | }).use(['index', 'form', 'laydate', 'table', 'element'], function () { |
| | | }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () { |
| | | //#region å
Œ
±åé |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | , element = layui.element |
| | | , upload = layui.upload |
| | | ; |
| | | |
| | | //模åå |
| | | var HModName = "PM_WorkTaskReportBill"; |
| | | //è¡¨æ ¼æ¸²æåæ° |
| | | var option = {}; //项ç®é¶æ®µè¡¨æ¸²æåæ° |
| | | // éä»¶è¡¨æ ¼æ¸²æåæ° |
| | | var attachmentOption = {}; |
| | | // æä»¶ä¸ä¼ ç»ä»¶ç»å®å®ä¾ |
| | | fileUploadInst = {} |
| | | //è®°å½ç»ç»çå¼ |
| | | var HOrgIDBar = 0; |
| | | //è·ååæ° |
| | |
| | | var linterid = params[params[1]]; //ä»åæ°ä¸è·å åæ®å
ç |
| | | var HEntryID = params[params[3]]; //ä»åæ°ä¸è·å åæ®å
ç |
| | | //var HProjectStageID = params[params[3]]; //é¶æ®µå
ç |
| | | |
| | | // éä»¶ä¸ä¼ ä¸´æ¶æä»¶ |
| | | var tempFileMap = {}; |
| | | |
| | | //å
¨å±åé |
| | | window.OptionData = []; |
| | |
| | | $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | //åå§å项ç®é¶æ®µè¡¨ |
| | | get_InitGrid(); |
| | | //åå§å é件表 |
| | | get_InitAttachmentGrid(); |
| | | |
| | | } |
| | | else if (OperationType == 2) { //æç任塿¨¡å䏿¨ |
| | |
| | | $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | //åå§å项ç®é¶æ®µè¡¨ |
| | | get_InitGrid(); |
| | | |
| | | //åå§å é件表 |
| | | get_InitAttachmentGrid(); |
| | | get_Display(); |
| | | } |
| | | else if (OperationType == 3) {//å¦æä¿®æ¹åèµ°ä¸é¢ new //ç¼è¾ |
| | |
| | | //$("#HOrgID").attr("disabled", true); |
| | | //åå§å项ç®é¶æ®µè¡¨ |
| | | get_InitGrid(); |
| | | //åå§å é件表 |
| | | get_InitAttachmentGrid(); |
| | | |
| | | RoadBillMain(linterid); |
| | | } else if (OperationType == 4) { //䏿¨ |
| | | //ç¦ç¨ç»ç»é项 |
| | |
| | | $("#HDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | //åå§å项ç®é¶æ®µè¡¨ |
| | | get_InitGrid(); |
| | | //åå§å é件表 |
| | | get_InitAttachmentGrid(); |
| | | //䏿¨-页é¢è®¾ç½® |
| | | set_WorkTaskReport(); |
| | | |
| | |
| | | , "HSourceBillNo": "" |
| | | , "HSourceBillType": "" |
| | | }; |
| | | |
| | | // æ°å»º éä»¶è¡æ°æ® |
| | | var attachmentNewRaw = { |
| | | "HWeekReportFileAddr": "" |
| | | , "HWeekReportFileName": "" |
| | | , "HWeekProDays": "0" |
| | | , "Size": "" |
| | | , "Status": "" |
| | | , "uploadStatus": 0 |
| | | } |
| | | switch (obj.event) { |
| | | case 'btn-AddLine': |
| | | table.cache["mainTable"].push(NewRow); |
| | | option.data = table.cache["mainTable"]; |
| | | table.render(option); |
| | | table.cache["AttachmentTable"].push(attachmentNewRaw); |
| | | attachmentOption.data = table.cache["AttachmentTable"] |
| | | table.render(attachmentOption); |
| | | |
| | | CheckedSet_tableSub(); |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | |
| | | table.cache["mainTable"].push(JSON.parse(copyrow));//å°å¤å¶çè¡å¼ºè½¬æjson追å å°è¡¨æ ¼ä¸ |
| | | option.data = table.cache["mainTable"];//å°æ°æ®ç»å®å°dataä¸ |
| | | table.render(option);//å°æ°æ®æ¸²æå°è¡¨æ ¼ä¸ |
| | | table.cache["AttachmentTable"].push(attachmentNewRaw); |
| | | attachmentOption.data = table.cache["AttachmentTable"] |
| | | table.render(attachmentOption); |
| | | CheckedSet_tableSub(); |
| | | |
| | | for (var i = 1; i <= option.data.length; i++) { |
| | |
| | | }) |
| | | //#endregion |
| | | |
| | | table.on('tool(AttachmentTable)', function (obj) { |
| | | var data = obj.data; // å½åè¡æ°æ® |
| | | var that = this; // å½åç¹å»çæé® |
| | | var tr = $(this).closest("tr"); |
| | | var index = tr.data("index"); |
| | | if (obj.event === 'fileUpload') { |
| | | // 夿æ¯å¦å·²éæ©æä»¶ |
| | | console.log(tempFileMap, index) |
| | | if (!tempFileMap[index]) { |
| | | layer.msg("请å
éæ©æä»¶ï¼"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | var formData = new FormData(); |
| | | formData.append("file", tempFileMap[index]); // 追å 已鿩çæä»¶ |
| | | formData.append("HNumber", $("#HBillNo").val()); |
| | | formData.append("HRemark", $("#HRemark").val()); |
| | | formData.append("HUserName", sessionStorage["HUserName"]); |
| | | |
| | | layer.load(); // å è½½ä¸ |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/PM_WorkTaskReportBill/UploadFile", |
| | | type: "POST", |
| | | data: formData, |
| | | contentType: false, |
| | | processData: false, |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.count == 1) { |
| | | // è·åè¡¨æ ¼ç¼å |
| | | var cache = table.cache['AttachmentTable']; |
| | | |
| | | cache[index].Status = "å·²ä¸ä¼ "; |
| | | cache[index].uploadStatus = 2; |
| | | cache[index].HWeekReportFileAddr = TransWebUrlToFileUrl(GetWEBURL(), res.data + cache[index].HWeekReportFileName) |
| | | |
| | | console.log(cache[index].HWeekReportFileAddr) |
| | | |
| | | table.reload('AttachmentTable', { |
| | | data: cache, |
| | | }); |
| | | |
| | | layer.msg("ä¸ä¼ æå"); |
| | | } else { |
| | | layer.msg("ä¸ä¼ 失败ï¼" + res.Message); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.closeAll('loading'); |
| | | layer.msg("ä¸ä¼ å¼å¸¸ï¼è¯·éè¯"); |
| | | } |
| | | }); |
| | | } else if (obj.event == 'downloadFile') { |
| | | // ä¸è½½æä»¶ |
| | | downloadFile(index) |
| | | |
| | | } else if (obj.event == 'delFile') { |
| | | // å é¤ç¼å |
| | | var cache = table.cache['AttachmentTable']; |
| | | |
| | | cache[index].HWeekReportFileAddr = ""; |
| | | cache[index].HWeekReportFileName = ""; |
| | | cache[index].Size = ""; |
| | | cache[index].Status = ""; |
| | | cache[index].HWeekProDays = 0; |
| | | cache[index].uploadStatus = 0; |
| | | |
| | | table.reload('AttachmentTable', { |
| | | data: cache, |
| | | }); |
| | | |
| | | layer.msg("å 餿å"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | // |
| | |
| | | //#endregion |
| | | |
| | | //#region æ¤é¡µé¢ææçæ¹æ³ |
| | | |
| | | function TransWebUrlToFileUrl(webUrl, fileAddr) { |
| | | webUrl = webUrl.substr(0, webUrl.length - 1) // å»é¤åä¸ä¸ª/ |
| | | lastbackSlashIndex = webUrl.lastIndexOf("/") |
| | | webUrl = webUrl.substr(0, lastbackSlashIndex) |
| | | return webUrl + "/" + fileAddr |
| | | } |
| | | |
| | | //#region |
| | | function downloadFile(index) { |
| | | var cache = table.cache['AttachmentTable']; |
| | | var row = cache[index]; |
| | | |
| | | // ä¼å
ä½¿ç¨æ¬å°ä¸´æ¶æä»¶ |
| | | if (tempFileMap[index]) { |
| | | const file = tempFileMap[index]; |
| | | const url = URL.createObjectURL(file); |
| | | const a = document.createElement('a'); |
| | | a.href = url; |
| | | a.download = file.name; |
| | | document.body.appendChild(a); |
| | | a.click(); |
| | | document.body.removeChild(a); |
| | | URL.revokeObjectURL(url); |
| | | return; |
| | | } |
| | | |
| | | if (row.HWeekReportFileAddr) { |
| | | var fileUrl = row.HWeekReportFileAddr; |
| | | |
| | | const a = document.createElement('a'); |
| | | a.href = fileUrl; |
| | | a.download = row.HWeekReportFileName; // æä»¶å |
| | | document.body.appendChild(a); |
| | | a.click(); |
| | | document.body.removeChild(a); |
| | | return; |
| | | } |
| | | |
| | | layer.msg('æ å¯ä¸è½½çæä»¶'); |
| | | } |
| | | //#endregion |
| | | |
| | | //#region è·åç»ç» |
| | | function Organ() { |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region å表é件表 åå§å |
| | | function get_InitAttachmentGrid() { |
| | | attachmentOption = { |
| | | elem: '#AttachmentTable', |
| | | toolbar: '#toolbarAttachmentTable' |
| | | , totalRow: true |
| | | , cellMinWidth: 120 |
| | | , height: 400 |
| | | , cols: [[ |
| | | { type: 'numbers', title: 'åºå·', style: 'background-color: #f9f9f9;' } |
| | | , { field: 'HWeekReportFileAddr', title: '人天åæä»¶è·¯å¾', hide: true, style: 'background-color: #f9f9f9;' } |
| | | , { field: 'HWeekReportFileName', title: '人天åæä»¶åç§°', style: 'background-color: #f9f9f9;' } |
| | | , { field: 'HWeekProDays', title: 'æ¬å¨å®æ½æ¶è人天', edit: true, style: 'background-color: #f9f9f9;' } |
| | | , { field: 'Size', title: 'æä»¶å¤§å°', style: 'background-color: #f9f9f9;' } |
| | | , { field: 'Status', title: 'ä¸ä¼ ç¶æ', style: 'background-color: #f9f9f9;' } |
| | | , { field: 'uploadStatus', title: 'ä¸ä¼ ç¶æä»£ç ', hide: true, style: 'background-color: #f9f9f9;' } |
| | | , { fixed: 'right', title: 'æä½', toolbar: '#AttachmentOperate' } |
| | | ]] |
| | | , done: function () { |
| | | bindUploadToTable(); |
| | | } |
| | | } |
| | | |
| | | var rowDataAttachment = [ |
| | | { |
| | | "HWeekReportFileAddr": "" |
| | | , "HWeekReportFileName": "" |
| | | , "HWeekProDays": "0" |
| | | , "Size": "" |
| | | , "Status": "" |
| | | , "uploadStatus": 0 |
| | | }, |
| | | ]; |
| | | |
| | | attachmentOption.data = rowDataAttachment; |
| | | table.render(attachmentOption); |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //#region 宿æ è®° |
| | | form.on('checkbox(HFinishFlag)', function (data) { |
| | | //è·å䏿æ¡éä¸çå¼ |
| | |
| | | } |
| | | }); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region èªå®ä¹è¡¨æ ¼ç»å®æä»¶ä¸ä¼ åè½ |
| | | function bindUploadToTable() { |
| | | // 1. éæ©æ¬å°æä»¶ï¼æªéæ© â å¾
ä¸ä¼ ï¼ |
| | | upload.render({ |
| | | elem: '[lay-event="fileSelect"]', |
| | | accept: 'file', |
| | | exts: 'doc|docx|xls|xlsx|pdf|zip|rar|txt', |
| | | auto: false, |
| | | choose: function (obj) { |
| | | var tr = this.item.parents('tr'); |
| | | var index = tr.data('index'); |
| | | var cache = table.cache['AttachmentTable']; |
| | | |
| | | // é¢è§æä»¶ä¿¡æ¯ |
| | | obj.preview(function (i, file) { |
| | | // åå
¥ä¸´æ¶æä»¶ |
| | | tempFileMap[index] = file; |
| | | |
| | | // æ´æ°è¡ç¶æ â å¾
ä¸ä¼ |
| | | cache[index].HWeekReportFileName = file.name; |
| | | cache[index].Size = (file.size / 1024).toFixed(2) + 'KB'; |
| | | cache[index].Status = "å¾
ä¸ä¼ "; |
| | | cache[index].uploadStatus = 1; |
| | | |
| | | table.reload('AttachmentTable', { data: cache }); |
| | | console.log(tempFileMap) |
| | | layer.msg('已鿩æä»¶ï¼è¯·ç¹å»ä¸ä¼ '); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ±æ¥äººéæ©é¡µé¢ |
| | |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | | if (table.cache["mainTable"][i] != "") { |
| | | table.cache["mainTable"][i].LAY_TABLE_INDEX = i; |
| | | // å并主表对象åé件表对象 |
| | | $.extend(true, table.cache["mainTable"][i], table.cache["AttachmentTable"][i]) |
| | | num.push(table.cache["mainTable"][i]) |
| | | } |
| | | } |
| | |
| | | //å表 èµå¼ |
| | | for (var i = 0; i < tableSub.length; i++) { |
| | | tableSub[i].RowID = (i + 1) * 10; |
| | | tableSub[i]["uploadStatus"] = tableSub[i]["HWeekReportFileName"] ? 2 : 0 |
| | | } |
| | | option.data = tableSub; |
| | | attachmentOption.data = tableSub; |
| | | table.render(option); |
| | | table.render(attachmentOption) |
| | | CheckedSet_tableSub(); |
| | | form.render('select'); |
| | | } |
| | |
| | | function set_WorkTaskReport() { |
| | | var data = getUrlVars_JSON().data; |
| | | var dataArray = []; |
| | | var AttachmentArray = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var NewRow = |
| | | { |
| | |
| | | , "HSourceBillNo": data[i].HSourceBillNo |
| | | , "HSourceBillType": data[i].HSourceBillType |
| | | }; |
| | | |
| | | var attachmentNewRaw = { |
| | | "HWeekReportFileAddr": "" |
| | | , "HWeekReportFileName": "" |
| | | , "HWeekProDays": "0" |
| | | , "Size": "" |
| | | , "Status": "" |
| | | , "uploadStatus": 0 |
| | | } |
| | | dataArray.push(NewRow); |
| | | AttachmentArray.push(attachmentNewRaw) |
| | | } |
| | | |
| | | option.data = dataArray; |
| | | table.render(option); |
| | | attachmentOption.data = AttachmentArray; |
| | | table.render(attachmentOption) |
| | | CheckedSet_tableSub(); |
| | | |
| | | |
| | |
| | | oldData.splice(obj.tr.data('index'), 1) |
| | | option.data = oldData;//å°æ°æ®ç»å®å°dataä¸ |
| | | table.render(option); |
| | | |
| | | var oldDataAttachment = table.cache['AttachmentTable']; |
| | | oldDataAttachment.splice(obj.tr.data('index'), 1) |
| | | attachmentOption.data = oldDataAttachment |
| | | table.render(attachmentOption) |
| | | |
| | | CheckedSet_tableSub(); |
| | | layer.close(index); |
| | | } |
| | |
| | | |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |