| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
- <%@include file="/context/mytags.jsp" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>按工时结算add页面</title>
- <style>
- .ui-button {
- display: inline-block;
- padding: 2px 2px;
- margin-bottom: 0;
- font-size: 8px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- .click_btu {
- cursor: pointer;
- }
- .unclick_btu {
- /*cursor: no-drop;*/
- }
- .disabled_box {
- background-color: #00000000 !important;
- color: #393937 !important;
- border: none !important;
- /*cursor: no-drop;*/
- }
- select:hover {
- cursor: pointer;
- }
- select[disabled] {
- background-color: #00000000 !important;
- border: none !important;
- color: #393937 !important;
- cursor: no-drop;
- }
- #tBusActivitiOvertimeDetail {
- overflow-x: scroll !important;
- }
- .formtable {
- display: flex;
- }
- .formtable tr {
- display: flex;
- flex-wrap: wrap;
- align-content: center;
- align-items: center;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <script src="webpage/cn/com/lzt/useractiviti/select_user_tools.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $(".tabs-wrap").css('width', '100%');
- $.Datatype.checkHour = function (val, obj, frm) {
- var msg = true;
- return msg;
- }
- });
- //获取页面类型
- var pageType = '${pageType}';
- //文件暂存对象
- var fileListInfo = []
- // add-刘梦祥-2021年11月10日18:09:56-数据渲染逻辑优化,文件渲染获取逻辑
- $(() => {
- if (pageType === 'Update' || pageType === 'Detail') {
- if ('${tBusActivitiOvertimePage.attachment}' != null && '${tBusActivitiOvertimePage.attachment}' != '') {
- fileListInfo = JSON.parse(JSON.stringify(${tBusActivitiOvertimePage.attachment}))
- changeFileListDom()
- } else {
- changeFileListDom()
- }
- }
- if (pageType === 'Detail') {
- $('select').attr('disabled', 'disabled');
- $('input').attr('disabled', 'disabled');
- }
- })
- // add-刘梦祥-2021年11月10日18:10:04-自定义上传文件回调函数
- function uploadSuccess(response) {
- if (response.success) {
- var fileList = $('#attachment')
- var fileListVar = fileList.val()
- //去重
- if (fileListVar.indexOf(response.attributes.name) !== -1) {
- //重复的话直接return
- return;
- } else {
- //得到返回的文件名和请求路径
- var fileInfo = {name: response.attributes.name, url: response.attributes.url}
- //总集合加入元素
- fileListInfo.push(fileInfo)
- //更新提示文件列表
- changeFileListDom()
- }
- }
- }
- //add-刘梦祥-2021年11月10日18:10:21-根据fileListInfo对象更新input绑定框中的值
- function changeAttachment() {
- $('#attachment').val(JSON.stringify(fileListInfo))
- }
- //add-刘梦祥-2021年11月10日18:10:28-更新提示文件列表
- function changeFileListDom() {
- //首先清空提示文件列表
- $('#fileListInfoDom').empty();
- //值不为空的话
- if (fileListInfo.length > 0) {
- fileListInfo.forEach((item, index) => {
- //生成临时标签
- var jspDomStr = `<div class="fileInfoItemBox"><div class="fileName">` + item.name + `</div>--文件上传成功--`
- if (pageType === 'Detail') {
- jspDomStr += `<a class="down" href="${webRoot}/` + item.url + `" download="` + item.name + `">下载</a>`;
- } else {
- jspDomStr += `<span class="del" onclick="deleteFile(` + index + `)">删除</span>`;
- }
- jspDomStr += `</div>`;
- //追加到显示的dom元素中
- $('#fileListInfoDom').append(jspDomStr)
- })
- }
- // 根据fileListInfo对象更新input绑定框中的值
- changeAttachment()
- }
- //add-刘梦祥-2021年11月10日18:10:40-删除文件操作
- function deleteFile(index) {
- fileListInfo.splice(index, 1)
- changeFileListDom()
- }
- var _t;
- function overTimeopenSameDepartUserSelect() {
- _t = $(this);
- //获取用户的科室id信息
- var departId = $('#departId').val();
- selectUserByDepart(departId, '选择加班员工', callbacSameDepartUserSelect);
- }
- function callbacSameDepartUserSelect(selectedRows) {
- var one = selectedRows[0];
- var userid = one.id;
- var realName = one.realName;
- // 获取员工时,同时获取科室信息
- var orgCode = one.orgIds;
- _t.val(realName);
- _t.parent().find('[name$="userid"]').val(userid);
- var index = getIndex(_t.attr('name'));
- $('#departId' + index).val(orgCode);
- $('#compensate' + index).change();
- }
- function moneySelectChange() {
- var val = $(this).find(':selected').val();
- var name = $(this).attr('name');
- var index = getIndex(name);
- var money = $('#money' + index);
- if (val == 'exchange') {//调休
- money.val(0);
- money.attr('readonly', 'readonly');
- changeTotalMoney();
- //显示用户调休账户余额
- var userId = $('#userid' + index).val();
- if (userId) {
- var month = $('#month').val();
- $.post('tBExchangeAccountController.do?getAccountBalance', {
- userId: userId,
- year: month
- }, function (d) {
- $('#exchangeAccountLeft' + index).val(d);
- });
- }
- } else {//加班费
- money.removeAttr('readonly');
- $('#exchangeAccountLeft' + index).val('');
- // changeMoney(index);
- }
- }
- function getIndex(name) {
- var indexStart = name.indexOf('[');
- var indexEnd = name.indexOf(']');
- var index = name.substr(indexStart + 1, (indexEnd - indexStart - 1));
- return index;
- }
- function overTimeBindStartTimeClick() {
- WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss'});
- }
- function overTimeBindEndTimeClick() {
- WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm:ss'});
- }
- function changeMonth() {
- $('#add_tBusActivitiOvertimeDetail_table').html('');
- changeTotalMoney();
- changeTotalTime();
- }
- </script>
- </head>
- <body style="overflow-x: hidden;">
- <%--处理回调--%>
- <c:set var="_callback">
- <c:choose>
- <c:when test="${in_process}">@Overridecallback</c:when>
- <c:otherwise>callback</c:otherwise>
- </c:choose>
- </c:set>
- <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tiptype="1"
- action="tBusActivitiOvertimeController.do?doAdd"
- callback="${_callback}" beforeSubmit="beforeSubmit">
- <input id="id" name="id" type="hidden" value="${tBusActivitiOvertimePage.id }"/>
- <input id="pagePath" name="pagePath" type="hidden" value="${pagePath}"/>
- <input id="overtimeSettlementType" name="overtimeSettlementType" type="hidden" value="${overtimeSettlementType}"/>
- <%-- 部门id--%>
- <input name="departId" id="departId" type="hidden"
- value="${empty tBusActivitiOvertimePage.departId?param.departId:tBusActivitiOvertimePage.departId}"/>
- <input type="hidden" name="depName" id="depName"
- value="${empty tBusActivitiOvertimePage.depName?param.depName:tBusActivitiOvertimePage.depName}"/>
- <t:tabs id="tt" iframe="false" tabPosition="top" fit="false">
- <t:tab href="tBusActivitiOvertimeController.do?tBusActivitiOvertimeDetailList&id=${tBusActivitiOvertimePage.id}&in_process=${in_process}&pagePath=${empty pagePath ? '' : pagePath}&flag=${param.flag}&overtimeSettlementType=${overtimeSettlementType}"
- icon="icon-search" title="加班明细" id="tBusActivitiOvertimeDetail"></t:tab>
- </t:tabs>
- <%-- 下部附加信息--%>
- <table cellpadding="0" cellspacing="1" class="formtable">
- <tr>
- <c:if test="${in_process}">
- <td align="right">
- <label class="Validform_label">申请人:</label>
- </td>
- <td class="value">
- ${tBusActivitiOvertimePage.createName}
- </td>
- </c:if>
- <td align="right">
- <label class="Validform_label">科室:</label>
- </td>
- <td class="value">
- <t:dictSelect field="departId" type="list"
- id="departId" dictTable="t_s_depart" dictField="id" dictText="departname" dictCondition=" where org_type != '1' "
- defaultVal="${empty tBusActivitiOvertimePage.departId?param.departId:tBusActivitiOvertimePage.departId}"
- hasLabel="false"
- readonly="readonly"
- datatype="*" title="科室"></t:dictSelect>
- </td>
- <td align="right">
- <label class="Validform_label">加班人数合计:</label>
- </td>
- <td class="value">
- <input id="userCount" name="userCount" type="number" style="width: 70px" class="inputxt disabled_box"
- datatype="*"
- readonly="readonly"
- value="${empty tBusActivitiOvertimePage.userCount ? 0 : tBusActivitiOvertimePage.userCount}"
- />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">加班人数合计</label>
- </td>
- <c:if test="${overtimeSettlementType == '1'}">
- <td align="right">
- <label class="Validform_label">加班时长总计:</label>
- </td>
- <td class="value">
- <input id="totalHour" name="totalHour" type="text" style="width: 70px" class="inputxt disabled_box"
- readonly="readonly"
- value="${empty tBusActivitiOvertimePage.totalHour ? 0 :tBusActivitiOvertimePage.totalHour}"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">加班时长总计</label>
- </td>
- </c:if>
- <c:if test="${overtimeSettlementType == '2'}">
- <td align="right">
- <label class="Validform_label">加班吨数总计:</label>
- </td>
- <td class="value">
- <input id="totalTons" name="totalTons" type="text" style="width: 70px" class="inputxt disabled_box"
- readonly="readonly"
- value="${empty tBusActivitiOvertimePage.totalTons? 0 :tBusActivitiOvertimePage.totalTons}"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">加班吨数总计</label>
- </td>
- </c:if>
- <%--<td align="right" style="display: none;">
- <label class="Validform_label">加班费总计:</label>
- </td>
- <td class="value" style="display: none;">
- <input id="totalMoney" name="totalMoney" type="text" style="width: 70px" class="inputxt disabled_box"
- readonly="readonly" ignore="ignore"
- value="${empty tBusActivitiOvertimePage.totalMoney?0:tBusActivitiOvertimePage.totalMoney}"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">总金额</label>
- </td>--%>
- <td align="right">
- <label class="Validform_label">加班结算方式:</label>
- </td>
- <td class="value">
- <t:dictSelect field="overtimeSettlementType" type="list"
- typeGroupCode="overtime_settlement_type" defaultVal="${overtimeSettlementType}"
- hasLabel="false" divClass="disabled_box"
- readonly="readonly"
- datatype="*" title="加班结算方式"></t:dictSelect>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">加班结算方式</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">附件:</label>
- </td>
- <td class="value" align="left" colspan="3">
- <%-- 暂存文件信息--%>
- <textarea name="attachment" id="attachment" style="width:200px;height: 70px;display: none;"
- class="inputxt">${tBusActivitiOvertimePage.attachment}</textarea>
- <%-- 上传按钮--%>
- <t:webUploader auto="true"
- url="cgUploadController.do?ajaxSaveFile"
- extensions="xls,xlsx,doc,docx,png,jpg,jpeg,pdf"
- duplicate="true"
- name="requestSummary"
- callback="uploadSuccess"
- showHis="false"
- fileNumLimit="10"
- displayTxt="false"
- nullMsg="附件不可为空"></t:webUploader>
- <%--自定义显示文件列表--%>
- <div id="fileListInfoDom">
- <p>支持xls,xlsx,doc,docx,png,jpg,jpeg,pdf格式的文件,文件不超过10Mb!</p>
- </div>
- </td>
- <td align="right">
- <span color="red" class="requiredIcon">*</span>
- <label class="Validform_label">加班原因:</label>
- </td>
- <td class="value" colspan="10">
- <textarea id="reason" class="inputxt" style="width:100%;height:60px" name="reason"
- datatype="*">${tBusActivitiOvertimePage.reason }</textarea>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">加班原因</label>
- </td>
- </tr>
- </table>
- </t:formvalid>
- <!-- 添加 附表明细 模版 -->
- <table style="display:none">
- <tbody id="add_tBusActivitiOvertimeDetail_table_template">
- <tr>
- <td align="center">
- <div style="width: 25px;" name="xh"></div>
- </td>
- <td align="center"><input style="width:20px;" type="checkbox" name="ck"/></td>
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].userid" id="userid#index#" maxlength="32" type="hidden"
- class="inputxt" datatype="*"/>
- <input name="tBusActivitiOvertimeDetailList[#index#].realName" id="realName#index#" placeholder="点击选择加班员工"
- maxlength="32" type="text" readonly="readonly" class="inputxt click_btu"/>
- <label class="Validform_label" style="display: none;">加班员工</label>
- </td>
- <td align="left">
- <t:dictSelect field="tBusActivitiOvertimeDetailList[#index#].departId" type="list"
- id="departId#index#"
- readonly="readonly"
- dictTable="t_s_depart" dictField="id" dictText="departname" dictCondition=" where org_type != '1' " defaultVal="${poVal.departId }" hasLabel="false"
- datatype="*" title="科室"></t:dictSelect>
- <label class="Validform_label" style="display: none;">科室</label>
- </td>
- <td align="left">
- <t:dictSelect field="tBusActivitiOvertimeDetailList[#index#].overtimeType" type="list"
- id="overtimeType#index#"
- typeGroupCode="overtime_type" defaultVal="${poVal.overtimeType }" hasLabel="false"
- onchange="changeOvertimeType(this)"
- datatype="*" title="加班类型"></t:dictSelect>
- <label class="Validform_label" style="display: none;">加班类型</label>
- </td>
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].startTime" id="startTime#index#" maxlength="32"
- type="text" class="Wdate click_btu" style="width:150px;" readonly placeholder="请选择加班开始时间"
- onchange="datejisuanOnOverTime(this)"
- />
- <label class="Validform_label" style="display: none;">加班开始时间</label>
- </td>
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].endTime" id="endTime#index#" maxlength="32" type="text"
- class="Wdate click_btu" style="width:150px;" placeholder="请选择加班结束时间" readonly
- onchange="datejisuanOnOverTime(this)"
- />
- <label class="Validform_label" style="display: none;">加班结束时间</label>
- </td>
- <c:if test="${overtimeSettlementType == '1'}">
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].hour" id="hour#index#" maxlength="32" type="text"
- placeholder="0" value="${poVal.hour}"
- class="inputxt unclick_btu disabled_box" style="width:120px;" datatype="d"/>
- <%--<span>0小时</span>--%>
- <label class="Validform_label" style="display: none;">加班时长</label>
- </td>
- <td align="left">
- <t:dictSelect field="tBusActivitiOvertimeDetailList[#index#].compensate" type="list"
- id="compensate#index#"
- typeGroupCode="overtime_compensate" hasLabel="false" title="补偿方式"
- onchange="changeCompensate2(this)"
- defaultVal="${empty poVal.compensate ? 'money' : poVal.compensate}"
- datatype="*"></t:dictSelect>
- <label class="Validform_label" style="display: none;">补偿方式</label>
- </td>
- </c:if>
- <c:if test="${overtimeSettlementType == '2'}">
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].pickupTruckNumber" id="pickupTruckNumber#index#"
- maxlength="32" type="text"
- class="inputxt" style="width:120px;" datatype="d" onchange="setTotalMoney(this)" value="0"/>
- <label class="Validform_label" style="display: none;">清运车数</label>
- </td>
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].keepUpTonNumber" id="keepUpTonNumber#index#"
- maxlength="32" type="text"
- class="inputxt" style="width:120px;" datatype="d" onchange="setTotalMoney(this)" value="0"/>
- <label class="Validform_label" style="display: none;">清运吨数</label>
- </td>
- <%--<td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].unitPrice" id="unitPrice#index#" maxlength="32"
- type="text"
- class="inputxt" style="width:120px;" datatype="d" onchange="setTotalMoney(this)" value="0"/>
- <label class="Validform_label" style="display: none;">单价</label>
- </td>--%>
- </c:if>
- <%--<td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].money" id="money#index#" maxlength="32" type="text"
- class="inputxt" style="width:120px;" datatype="d,fix2"
- value="0"
- <c:if test="${overtimeSettlementType == '2'}">readonly="readonly"</c:if>
- onchange="changeTotalMoney()"
- />
- <label class="Validform_label" style="display: none;">加班费</label>
- </td>--%>
- <td align="left">
- <input name="tBusActivitiOvertimeDetailList[#index#].remark" maxlength="255" id="remake#index#" type="text"
- class="inputxt"
- style="width:300px;"/>
- <label class="Validform_label" style="display: none;">备注</label>
- </td>
- </tr>
- </tbody>
- </table>
- <table style="width: 100%">
- <tr>
- <td style="text-align:center;">
- <%@include file="../view_submit_buttons.jsp" %>
- </td>
- </tr>
- </table>
- </body>
- <script src="webpage/cn/com/lzt/useractiviti/overtime/tBusActivitiOvertime.js"></script>
- <script>
- function datejisuanOnOverTime(obj) {
- var index = getIndex($(obj).attr('name'));
- var startTime = $("#startTime" + index).val();
- var endTime = $("#endTime" + index).val();
- if (startTime && endTime) {
- var hours = diffTime(startTime, endTime);
- var hourInput = $('#hour' + index);
- hourInput.val(hours);
- changeTotalTime();
- }
- }
- //add-刘梦祥-2021年11月28日15:25:20-(添加事件:当用户选择加班类型后触发事件)
- function changeOvertimeType(obj) {
- var index = getIndex($(obj).attr('name'));
- var value = $(obj).val()
- var compensate = $('#compensate' + index);
- if (value !== "weekend_on_duty") {
- compensate.attr('disabled', 'disabled');
- compensate.val("money");
- } else {
- compensate.removeAttr('disabled');
- }
- changeCompensateByValue(index, value);
- }
- //add-刘梦祥-2021年11月28日15:52:43-(添加事件:当用户选择调休时,加班费为0)
- function changeCompensate2(obj) {
- var index = getIndex($(obj).attr('name'));
- var value = $(obj).val()
- var money = $('#money' + index)
- if (value === "exchange") {
- money.val(0);
- money.attr('value', 0);
- money.attr('disabled', 'disabled');
- money.addClass('disabled_box');
- } else {
- money.removeAttr('disabled');
- money.removeClass('disabled_box');
- }
- }
- function changeCompensateByValue(index, value) {
- var money = $('#money' + index)
- if (value === "exchange") {
- money.attr('disabled', 'disabled');
- money.addClass('disabled_box')
- money.val("0");
- } else {
- money.removeAttr('disabled');
- money.removeClass('disabled_box')
- }
- }
- //add-刘梦祥-2021年11月11日09:37:16-(添加方法当按吨数计算的时候根据清运车数、清运吨数、单价计算加班费)
- function setTotalMoney(obj) {
- var index = getIndex($(obj).attr('name'));
- var pickupTruckNumber = Number($("#pickupTruckNumber" + index).val());
- var keepUpTonNumber = Number($("#keepUpTonNumber" + index).val());
- var unitPrice = Number($("#unitPrice" + index).val());
- //计算加班总吨数
- var totalTons = 0;
- $('input[name$="keepUpTonNumber"]').each(function () {
- var keepUpTonNumber = $(this).val();
- if (keepUpTonNumber) {
- totalTons += parseFloat(keepUpTonNumber);
- }
- });
- totalTons = totalTons.toFixed(1);
- $('#totalTons').val(totalTons);
- //计算当前员工的加班费和总加班费
- if (pickupTruckNumber && keepUpTonNumber && unitPrice) {
- var moneyItem = $('#money' + index);
- moneyItem.val(pickupTruckNumber * keepUpTonNumber * unitPrice);
- changeTotalMoney()
- }
- }
- function changeTotalTime() {
- var totalHour = 0;
- $('input[name$="hour"]').each(function () {
- var hour = $(this).val();
- if (hour) {
- totalHour += parseFloat(hour);
- }
- })
- $('#totalHour').val(totalHour);
- }
- // delete-刘梦祥-2021年11月10日17:04:00-(注释补偿方式为调休时的请求)
- // function changeMoney(index) {
- // var select = $('#compensate' + index);
- // var selectVal = select.find(":selected").val();
- // if (selectVal == 'money') {//加班费
- // var hour = $('#hour' + index).val();
- // var userId = $('#userid' + index).val();
- // if (hour) {
- // $.post('tBusActivitiOvertimeController.do?getBaseHourWage', {userId: userId}, function (d) {
- // var money = parseFloat(hour) * d * 1.5;
- // $('#money' + index).val(money.toFixed(1));
- // changeTotalMoney();
- // });
- // }
- // }
- // }
- function changeTotalMoney() {
- var totalMoney = 0;
- $('input[name$="money"]').each(function () {
- var money = $(this).val();
- if (money) {
- totalMoney += parseFloat(money);
- }
- });
- totalMoney = totalMoney.toFixed(1);
- $('#totalMoney').val(totalMoney);
- $('#totalMoneyText').html(totalMoney + "元");
- }
- function diffmm(startDate, endDate) {
- var diff = Date.parse(endDate.replace(/-/g, "/")) - Date.parse(startDate.replace(/-/g, "/"));//时间差的毫秒数
- return Math.round(diff / (60 * 1000));
- }
- function diffTime(startDate, endDate) {
- var diff = Date.parse(endDate.replace(/-/g, "/")) - Date.parse(startDate.replace(/-/g, "/"));//时间差的毫秒数
- //计算出相差天数
- var days = Math.floor(diff / (24 * 3600 * 1000));
- //计算出小时数
- var leftHour = diff % (3600 * 1000) / 3600 / 1000; //计算小时后剩余的毫秒数
- if (leftHour >= 0.5) {
- leftHour = 0.5;
- } else {
- leftHour = 0;
- }
- var hours = Math.floor(diff / (3600 * 1000)) + leftHour;
- if (hours < 0) {
- hours = 0;
- }
- return hours;
- }
- function beforeSubmit() {
- var length = $('#tt').find('input[name$="userid"]').length;
- if (length == 0) {
- tip('请添加加班用户');
- return false;
- }
- changeTotalTime();
- changeTotalMoney();
- return true;
- }
- </script>
- <style>
- table {
- width: calc(100% - 10px) !important;
- }
- /*文件列表文字样式*/
- .fileInfoItemBox {
- display: flex;
- align-items: center;
- width: 300px;
- color: #67C23A;
- }
- /*文件列表文字样式*/
- .fileName {
- width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- color: #999;
- text-decoration: underline;
- }
- /*文件列表下载按钮样式*/
- .down {
- cursor: pointer;
- color: #67C23A;
- }
- .down:hover {
- cursor: pointer;
- color: #67C23A;
- }
- .down:active {
- cursor: pointer;
- color: #67C23A;
- }
- /*文件列表删除按钮样式*/
- .del {
- cursor: pointer;
- color: #F56C6C;
- }
- .del:hover {
- cursor: pointer;
- color: #F56C6C;
- }
- .del:active {
- cursor: pointer;
- color: #F56C6C;
- }
- </style>
|