<!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">
|
<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>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<!--<style>
|
.main-btn { /*头部主按钮*/
|
padding: 0 2px; /*调整按钮左右空隙大小*/
|
height: 30px;
|
line-height: 30px;
|
}
|
|
.btn-title {
|
font-size: 16px;
|
}
|
/* 防止下拉框的下拉列表被隐藏---必须设置--- */
|
.layui-table-cell {
|
overflow: visible !important;
|
}
|
/* 使得下拉框与单元格刚好合适 */
|
td .layui-form-select {
|
margin-top: -10px;
|
margin-left: -15px;
|
margin-right: -15px;
|
}
|
|
.layui-form-item .layui-inline {
|
margin-top: 5px;
|
margin-bottom: 5px;
|
margin-right: 0px;
|
}
|
|
.layui-form-label {
|
width: 25%;
|
}
|
</style>-->
|
|
</head>
|
<body>
|
<div class="layui-fluid" style="padding: 0;">
|
<div class="layui-card" style="padding: 2px;background-color: #efefef;">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
|
<div style="padding: 2px; ">
|
<!--<button type="button" id="btnSearch" style="margin-left: 0px" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="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="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="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>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">反关闭</button>-->
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill" style="height:430px;">
|
<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;">附件信息</li>
|
<li lay-id="2" style="padding:1px;">其他信息</li>
|
</ul>
|
<div class="layui-tab-content">
|
<!--基本信息-->
|
<div class="layui-tab-item layui-show">
|
<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>
|
<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">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<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;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<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="HProNumber" name="HProNumber" id="HProNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" name="HProjectID" id="HProjectID" lay-verify="HProjectID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProNumber" id="btnSearchHProNumber" 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 style="color:red"> * </label></label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" lay-verify="HProjectStageName" name="HProjectStageName" id="HProjectStageName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" name="HProjectStageID" id="HProjectStageID" lay-verify="HProjectStageID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProjectStage" id="btnSearchHProjectStage" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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="HStageNote" name="HStageNote" id="HStageNote" 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" lay-verify="HRelationGoods" name="HRelationGoods" id="HRelationGoods">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-col-xs4 layui-inline">
|
<label class="layui-form-label">里程碑</label>
|
<div class="layui-input-inline">
|
<input type="checkbox" name="checkboxHIsKey" id="checkboxHIsKey" lay-skin="primary" lay-filter="checkboxHIsKey" value="true" title="是否里程碑">
|
<input type="hidden" value="false" name="HIsKey" id="HIsKey">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<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;">
|
<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;">汇报内容</label>
|
<div class="layui-input-block" style="margin-left: 120px; width: 200px;">
|
<input type="text" class="layui-input" lay-verify="HReportNote" name="HReportNote" id="HReportNote">
|
</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" lay-verify="HReportGoods" name="HReportGoods" id="HReportGoods">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<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="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;">
|
<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>
|
<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="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;">
|
<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;">本阶段业绩占比</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" lay-verify="HRate" name="HRate" id="HRate">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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">
|
</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>
|
<div class="layui-input-block" style="margin-left: 120px; width: 501px;">
|
<select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
|
<!--动态渲染组织-->
|
</select>
|
|
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" lay-verify="HMainSourceInterID" value="0">
|
<input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" lay-verify="HMainSourceEntryID" 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>
|
</div>
|
<!--附件信息-->
|
<div class="layui-tab-item">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<div class="layui-upload">
|
<button type="button" class="layui-btn" id="testList">选择文件</button><input class="layui-upload-file" type="file" accept="" name="file" multiple="">
|
|
|
<div class="layui-tab" lay-filter="tab-fileList">
|
<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;">已经上传</li>
|
</ul>
|
<div class="layui-tab-content">
|
<!--等待上传-->
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<div class="layui-upload-list">
|
<table class="layui-table">
|
<thead>
|
<tr>
|
<th>文件名</th>
|
<th>大小</th>
|
<th>状态</th>
|
<th>操作</th>
|
</tr>
|
</thead>
|
<tbody id="ProImgByList">
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</div>
|
<!--已经上传-->
|
<div class="layui-tab-item">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<div class="layui-upload-list">
|
<table class="layui-table">
|
<thead>
|
<tr>
|
<th>文件名</th>
|
<th>大小</th>
|
<th>状态</th>
|
<th>操作</th>
|
</tr>
|
</thead>
|
<tbody id="ProImgByList1">
|
</tbody>
|
</table>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!--其他信息-->
|
<div class="layui-tab-item">
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<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>
|
</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>
|
</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>
|
</div>
|
</div>
|
|
</div>
|
<div class="layui-row">
|
<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>
|
</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>
|
</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>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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>
|
</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>
|
</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>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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>
|
</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>
|
</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>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>上一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>下一行</button>-->
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
<!--项目阶段表:删除-->
|
<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="HIsPM">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HIsPM" lay-filter="HIsPM" id="HIsPM{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<script>
|
var optiondata = [];
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).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
|
, upload = layui.upload;
|
|
//模块名
|
var HModName = "PM_ProjectReportBill";
|
//表格渲染参数
|
var option = {}; //项目阶段表渲染参数
|
//记录组织的值
|
var HOrgIDBar = 0;
|
//获取参数
|
var params = getUrlVars();
|
var OperationType = params[params[0]]; //从参数中获取 数据类型 1添加 保存 2复制 3 编辑
|
var linterid = params[params[1]]; //从参数中获取 单据内码
|
var HProjectStageID = params[params[3]];
|
|
//#endregion
|
|
//#region 进入页面即加载
|
//#region 判断是否登录 未登录则跳到登录页
|
if (sessionStorage.login != "login") {
|
layer.confirm("登录失效,请重新登录!", {
|
icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
|
}, function () { window.location.href = "../../user/login.html"; });
|
}
|
//#endregion
|
|
//#region 判断并设置操作类型、页面初始化
|
if (OperationType == null || OperationType == 1) { //新增
|
////禁用组织选项
|
//$("#HOrgID").attr("disabled", true);
|
OperationType = 1;
|
//生成并设置主表的内码和单据号
|
createBillNo();
|
//初始化汇报人
|
getHEmpByHUserName();
|
|
//初始化制单人和制单时间
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
|
|
//初始化日期
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
//初始化项目阶段表
|
get_InitGrid1();
|
//文件选择初始化
|
PicUpload();
|
}
|
//else if (OperationType == 2) { //复制
|
// //禁用组织选项
|
// //$("#HOrgID").attr("disabled", true);
|
// RoadBillMain(linterid);
|
// $.ajax({
|
// url: GetWEBURL() + "/Web/GetMAXNum",
|
// type: "GET",
|
// async: false,
|
// data: { "HBillType": '4750' },
|
// success: function (d) {
|
// $("#HInterID").val(d.data[0].HInterID);
|
// $("#HBillNo").val(d.data[0].HBillNo);
|
// $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
// }
|
// });
|
//}
|
else if (OperationType == 3) {//如果修改则走下面 new //编辑
|
////禁用组织选项
|
//$("#HOrgID").attr("disabled", true);
|
//初始化项目阶段表
|
get_InitGrid1();
|
RoadBillMain(linterid);
|
//文件选择初始化
|
PicUpload();
|
//展示已上传的文件
|
getFileList_loaded();
|
} else if (OperationType == 4 && HProjectStageID != null) {
|
////禁用组织选项
|
//$("#HOrgID").attr("disabled", true);
|
OperationType = 4;
|
//生成并设置主表的内码和单据号
|
createBillNo();
|
|
//汇报人初始化
|
getHEmpByHUserName();
|
|
//初始化制单人和制单时间
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
|
|
//初始化日期
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
//初始化项目阶段表
|
get_InitGrid1();
|
//下推-页面设置
|
set_ProjectReport_Display();
|
//文件选择初始化
|
PicUpload();
|
}
|
//#endregion
|
|
//#region 初始化组织
|
Organ();
|
//#endregion
|
|
//#region 初始化表格
|
DisPlay_HideColumn();
|
//#endregion
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//#region 弹窗选择触发事件
|
//#region 选择项目代码按钮
|
form.on('submit(btnSearchHProNumber)', function () {
|
get_checkSearchHProNumber();
|
});
|
//#endregion
|
|
//#region 选择项目阶段按钮
|
form.on('submit(btnSearchHProjectStage)', function () {
|
get_checkSearchHProjectStage();
|
});
|
//#endregion
|
|
//#region 选择汇报人按钮
|
form.on('submit(btnSearchHReportEmp)', function () {
|
get_checkSearchHReportEmp();
|
});
|
//#endregion
|
|
//#region 选择抄送人按钮
|
form.on('submit(btnSearchHCopyEmp)', function () {
|
get_checkSearchHCopyEmp();
|
});
|
//#endregion
|
|
//#region 选择接收人按钮
|
form.on('submit(btnSearchHReceiveEmp)', function () {
|
get_checkSearchHReceiveEmp();
|
});
|
//#endregion
|
//#endregion
|
|
//#region 复选框触发事件
|
//#region 是否里程碑
|
form.on('checkbox(checkboxHIsKey)', function (data) {
|
$("#HIsKey").val(data.elem.checked);
|
});
|
//#endregion
|
|
//#region 项目经理
|
form.on('checkbox(HIsPM)', function (data) {
|
var elem = data.othis.parents('tr');
|
var dataindex = elem.attr("data-index");
|
$.each(option.data, function (index, value) {
|
if (value.LAY_TABLE_INDEX == dataindex) {
|
value.HIsPM = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//#endregion
|
//#endregion
|
|
//#region 操作按钮触发事件
|
//#region 保存提交
|
form.on('submit(btnSave)', function (data) {//提交
|
if (AllowLoadData(data)) {
|
set_AddNew(data);
|
}
|
});
|
//#endregion
|
|
//#region 退出
|
form.on('submit(btnEdit)', function (data) {
|
if (params[1] != null) {
|
Pub_Close(1);
|
} else if (params[1] == null) {
|
Pub_Close(2);
|
}
|
});
|
//#endregion
|
//#endregion
|
|
//#endregion
|
|
//#region 项目阶段表:头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
//新增行表格数据
|
var NewRow =
|
{
|
"RowID": (table.cache["mainTable"].length + 1) * 10
|
, 'HEmpID': '0'
|
, 'HEmpName': ''
|
, 'HIsPM': false
|
, 'HRate': '0'
|
, 'HAvgMoney': '0'
|
, 'HCountMoney': '0'
|
, 'HRemarkSub': ''
|
};
|
switch (obj.event) {
|
case 'btn-AddLine':
|
table.cache["mainTable"].push(NewRow);
|
option.data = table.cache["mainTable"];
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
break;
|
case 'btn-CopyLine':
|
var copydata = JSON.stringify(data);
|
if (data.length <= 0) {
|
layer.msg("请选择需要复制的一行!");
|
}
|
else if (data.length > 1) {
|
layer.msg("只能选择复制一行!");
|
}
|
else {
|
var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
|
var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
|
table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
|
option.data = table.cache["mainTable"];//将数据绑定到data上
|
table.render(option);//将数据渲染到表格上
|
CheckedSet_tableSub_Emp();
|
}
|
break;
|
//列设置
|
case 'set_HideColumn':
|
get_HideColumn();
|
break;
|
//上一行
|
case 'btn_up':
|
btn_up(data);
|
break;
|
//下一行
|
case 'btn_under':
|
btn_under(data);
|
break;
|
}
|
});
|
//#endregion
|
|
//#region 项目阶段表:行内事件
|
table.on('tool(mainTable)', function (obj) {
|
set_GridDelete(obj); //行内删除
|
set_GridCellCheck(obj); //行内快捷键筛选
|
});
|
//#endregion
|
|
//#region 子表:行内鼠标离开事件:检查项目阶段是否重复
|
table.on('edit(mainTable)', function (obj) {
|
})
|
//#endregion
|
|
|
//
|
form.on('submit(Cancel)', function () {
|
//sessionStorage["SourceFlag"] = false;
|
parent.location.href = "../../../views/index.html"
|
//window.close();//关闭当前页
|
})
|
|
|
|
|
//#region 监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
//#endregion
|
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//#region 获取组织
|
function Organ() {
|
//获取登录页组织列
|
var Organization = '';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
|
}
|
$("#HOrgID").append(Organization);
|
if (OperationType == 1) {
|
HOrgIDBar = sessionStorage["OrganizationID"];
|
}
|
$("#HOrgID").val(HOrgIDBar);
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
//#endregion
|
|
//#region 获取参数
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
//#endregion
|
|
//#region 生成单据号
|
function createBillNo() {
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
async: false,
|
type: "GET",
|
data: { "HBillType": '4752' },
|
success: function (d) {
|
//console.log(d.data);
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
}
|
});
|
}
|
//#endregion
|
|
//#region 子表初始化
|
function get_InitGrid1() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
//, page: true
|
//, limit: 500
|
//, limits: [50, 500, 5000, 50000]
|
, totalRow: true
|
, cellMinWidth: 120
|
, height: 400
|
, cols: [[
|
{ type: 'checkbox', totalRowText: '合计行' }
|
, { type: 'numbers', title: '序号', style: 'background-color: #f9f9f9;' }
|
, { field: 'RowID', title: '行号', hide: true, style: 'background-color: #f9f9f9;' } //行标识,用于下一行、上一行识别所在行
|
, { field: 'HEmpID', title: '成员ID', hide: true, style: 'background-color: #f9f9f9;' }
|
, { field: 'HEmpName', title: '成员', edit: 'text', event: "HEmpName" } //f7
|
, { field: 'HIsPM', title: '项目经理', templet: "#HIsPM" }
|
, { field: 'HRate', title: '项目占比', totalRow: true, edit: 'text'}
|
, { field: 'HAvgMoney', title: '分配业绩', totalRow: true, edit: 'text' }
|
, { field: 'HCountMoney', title: '提成', totalRow: true, edit: 'text' }
|
, { field: 'HRemarkSub', title: '备注', edit: 'text' }
|
, { fixed: 'right', title: '操作', toolbar: '#barDemo' }
|
]]
|
}
|
|
var rowdata = [
|
{
|
"RowID": 10
|
, 'HEmpID': '0'
|
, 'HEmpName': ''
|
, 'HIsPM': false
|
, 'HRate': '0'
|
, 'HAvgMoney': '0'
|
, 'HCountMoney': '0'
|
, 'HRemarkSub': ''
|
}
|
];
|
option.data = rowdata;
|
table.render(option);
|
}
|
//#endregion
|
|
//#region 项目代码选择页面
|
function get_checkSearchHProNumber() {
|
var HOrgID = $("#HOrgID").val();
|
//打开工程项目小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "工程项目列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../项目管理/工程项目/PM_ProjectBillList.html?openType=2&HOrgID=" + HOrgID, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//设置表头数据
|
//设置文本框值
|
$("#HProjectID").val(checkStatus.data[0].HInterID);
|
$("#HProNumber").val(checkStatus.data[0].项目代码);
|
$("#HProjectStageID").val(checkStatus.data[0].HProjectStageID);
|
$("#HProjectStageName").val(checkStatus.data[0].项目阶段);
|
$("#HStageNote").val(checkStatus.data[0].项目阶段详细内容);
|
$("#HPMGoodsID").val(checkStatus.data[0].HPMGoodsID);
|
$("#HRelationGoods").val(checkStatus.data[0].阶段相关交付物);
|
$("#HIsKey").val((checkStatus.data[0].里程碑=='Y'?true:false));
|
$("#HRate").val(checkStatus.data[0].阶段业绩占比);
|
|
$("#HMainSourceInterID").val(checkStatus.data[0].HInterID);
|
$("#HMainSourceEntryID").val(checkStatus.data[0].HEntryID);
|
$("#HMainSourceBillNo").val(checkStatus.data[0].单据号);
|
$("#HMainSourceBillType").val(checkStatus.data[0].单据类型);
|
|
|
|
//设置复选框选中状态
|
if ($("#HIsKey").val() == "true") {
|
$("#checkboxHIsKey").attr("checked", true);
|
form.render("checkbox");
|
} else {
|
$("#checkboxHIsKey").attr("checked", false);
|
form.render("checkbox");
|
}
|
//设置表体数据
|
var HBillInterID = checkStatus.data[0].HInterID;
|
get_NumberNum(HBillInterID);
|
layer.close(index);//关闭弹窗
|
}
|
, btn2: function (index, layero) { }
|
, end: function () {
|
get_NumberNum($("#HProjectID").val());
|
}
|
})
|
}
|
//#endregion
|
|
//#region 选择项目代码,带出子表数据
|
function get_NumberNum(HBillInterID) {
|
$.ajax({
|
url: GetWEBURL() + "/PM_ProjectBill/editInit",
|
type: "GET",
|
async: false,
|
data: { "HInterID": HBillInterID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
//获取数据库中该项目的项目成员数据
|
var tableSub_Emp = result.data[2];
|
//根据表体列,填充表体数据
|
var num = [];
|
for (var i = 0; i < tableSub_Emp.length; i++) {
|
var rowdata =
|
{
|
"RowID": (i + 1) * 10
|
, 'HEmpID': tableSub_Emp[i]["HEmployeeID"]
|
, 'HEmpName': tableSub_Emp[i]["HEmployeeName"]
|
, 'HIsPM': tableSub_Emp[i]["HIsPM"]
|
, 'HRate': tableSub_Emp[i]["HRate"]
|
, 'HAvgMoney': '0'
|
, 'HCountMoney': '0'
|
, 'HRemarkSub': ''
|
};
|
num.push(rowdata);
|
}
|
option.data = num;
|
table.render(option);
|
//设置复选框选中状态
|
for (var i = 0; i < tableSub_Emp.length; i++) {
|
if (tableSub_Emp[i].HIsPM) {
|
$('#HIsPM' + (i + 1)).attr("checked", true);
|
}
|
}
|
form.render('checkbox');
|
}
|
})
|
}
|
|
//#endregion
|
|
//#region 项目阶段选择页面
|
function get_checkSearchHProjectStage() {
|
var HOrgID = $("#HOrgID").val();
|
//打开项目阶段小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "项目阶段列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../项目管理/项目阶段/Gy_ProjectStage.html?openType=2&HOrgID=" + HOrgID, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
|
$("#HProjectStageID").val(checkStatus.data[0].HItemID);//项目阶段id
|
$("#HProjectStageName").val(checkStatus.data[0].阶段名称);//项目阶段名称
|
$("#HStageNote").val(checkStatus.data[0].项目阶段详细内容);//项目阶段详细内容
|
layer.close(index);//关闭弹窗
|
}
|
, btn2: function (index, layero) { }
|
, end: function () {
|
|
}
|
})
|
}
|
//#endregion
|
|
//#region 汇报人选择页面
|
function get_checkSearchHReportEmp() {
|
var HOrgID = $("#HOrgID").val();
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '员工表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HReport&HOrgID=' + HOrgID, 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HReportEmpID").val(checkStatus.data[0].HItemID);//客户id
|
$("#HReportEmpName").val(checkStatus.data[0].职员名称);//客户名称
|
if ($("#HReportEmpName").val() == "") {
|
$("#HReportEmpName").val(checkStatus.data[0].职员代码);
|
}
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
, end: function () { }
|
})
|
}
|
//#endregion
|
|
//#region 抄送人选择页面
|
function get_checkSearchHCopyEmp() {
|
//var HOrgID = $("#HOrgID").val();
|
//layer.open({
|
// type: 2//弹窗类型
|
// , skin: 'layui-layer-rim' //加上边框
|
// , area: ['90%', '90%']//大小
|
// , title: '员工表'//标题
|
// , shift: 2//弹出动画
|
// , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=2&HOrgID=' + HOrgID, 'yes']
|
// , btn: ['确定', '取消']
|
// , btn1: function (index, layero) {//按钮【按钮一】的回调
|
// var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
// var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
// if (checkStatus.data.length === 0) {
|
// return layer.msg('请选择数据');
|
// }
|
// //获取数据
|
// $("#HCopyEmp").val(checkStatus.data[0].职员名称);//抄送人名称
|
// if ($("#HCopyEmp").val() == "") {
|
// $("#HCopyEmp").val(checkStatus.data[0].职员代码);
|
// }
|
// layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
// }
|
// , btn2: function (index, layero) { }
|
//})
|
|
|
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '抄送人列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['80%', '80%'],
|
maxmin: true,
|
content: ['../../PublicPage/transfer.html', 'yes'],
|
btn: ['确定', '取消']
|
, btn1: function (index, layero) {
|
|
//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.transfer.getData('key123'); //获取已分配数量
|
if (checkStatus.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
var value = "";
|
var title = "";
|
for (var i = 0; i < checkStatus.length; i++) {
|
value += checkStatus[i].value + ",";
|
title += checkStatus[i].title + ",";
|
}
|
//去掉最后一个逗号(如果不需要去掉,就不用写)
|
if (value.length > 0) {
|
value = value.substr(0, value.length - 1);
|
title = title.substr(0, title.length - 1);
|
}
|
$("#HCopyEmp").val(title);
|
console.log(checkStatus, value, title);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
}
|
//#endregion
|
|
//#region 接收人选择页面
|
function get_checkSearchHReceiveEmp() {
|
var HOrgID = $("#HOrgID").val();
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '员工表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HReceive&HOrgID=' + HOrgID, 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HReceiveEmp").val(checkStatus.data[0].职员名称);//接收人名称
|
if ($("#HReceiveEmp").val() == "") {
|
$("#HReceiveEmp").val(checkStatus.data[0].职员代码);
|
}
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
, end: function () {
|
|
}
|
})
|
}
|
//#endregion
|
|
//#region 文件上传
|
function PicUpload() {
|
//多图片上传
|
//多文件列表示例
|
var ProImgByList = $('#ProImgByList')
|
, uploadListIns = upload.render({
|
elem: '#testList'
|
, url: GetWEBURL() + "/Cj_StationOutBill/UploadFile1"
|
, accept: 'file'
|
, multiple: true
|
, auto: false
|
//, bindAction: '#testListAction' //按扭绑定
|
, data: { "HBillNo": $("#HBillNo").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
|
, choose: function (obj) {
|
var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
|
//读取本地文件
|
obj.preview(function (index, file, result) {
|
var tr = $(['<tr id="upload-' + index + '">'
|
, '<td>' + file.name + '</td>'
|
, '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
|
, '<td>等待上传</td>'
|
, '<td>'
|
, '<button class="layui-btn layui-btn-xs demo-reload ">上传</button>'
|
, '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>'
|
, '</td>'
|
, '</tr>'].join(''));
|
|
//单个重传
|
tr.find('.demo-reload').on('click', function () {
|
obj.upload(index, file);
|
return false;
|
});
|
|
//删除
|
tr.find('.demo-delete').on('click', function () {
|
delete files[index]; //删除对应的文件
|
tr.remove();
|
uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
|
});
|
|
ProImgByList.append(tr);
|
});
|
}
|
, done: function (res, index, upload) {
|
if (res.code == 1) { //上传成功
|
var tr = ProImgByList.find('tr#upload-' + index)
|
, tds = tr.children();
|
tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
|
tds.eq(3).html(''); //清空操作
|
//tds.eq(3).find('.demo-reload').addClass('layui-hide'); //隐藏上传
|
|
//展示该单据全部上传的文件
|
getFileList_loaded();
|
return delete this.files[index]; //删除文件队列已经上传成功的文件
|
}
|
this.error(index, upload);
|
}
|
, error: function (index, upload) {
|
var tr = ProImgByList.find('tr#upload-' + index)
|
, tds = tr.children();
|
tds.eq(2).html('<span style="color: #FF5722;">上传失败[检查文件名及文件格式]</span>');
|
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示上传
|
}
|
});
|
}
|
//#endregion
|
|
//#region 编辑时,获取已上传的文件列表
|
function getFileList_loaded() {
|
var HBillNo = $("#HBillNo").val();
|
if (HBillNo != null || HBillNo != undefined) {
|
var ProImgByList = $('#ProImgByList1')
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationOutBill/Filelist',
|
async: false,
|
type: "GET",
|
data: { "HBillNo": HBillNo },
|
success: function (data1) {
|
if (data1.count == 1) {
|
var index = 0;
|
$('#ProImgByList1').empty();
|
for (var i = 0; i < data1.data.length; i++) {
|
var tr = $(['<tr id="upload-' + i + '">'
|
, '<td style="display:none">' + data1.data[i].HItemID + '</td>'
|
, '<td style="display:none">' + data1.data[i].HSourceBillNo + '</td>'
|
, '<td>' + data1.data[i].HFileName + '</td>'
|
, '<td>' + (data1.data[i].HFileSize / 1014).toFixed(1) + 'kb</td>'
|
, '<td style="color: #5FB878;">上传成功</td>'
|
, '<td style="display:none">' + data1.data[i].url + '</td>'
|
, '<td>'
|
, '<button class="layui-btn layui-btn-xs demo-dowload" type="button" id="deltefile" onclick="javascript:dowload(this)"><i class="layui-icon layui-icon-download-circle layuiadmin-button-btn"></i>下载</button>'
|
, '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" type="button" id="deltefile" onclick="javascript:toManager(this)"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>'
|
, '</td>'
|
, '</tr>'].join(''));
|
$('#ProImgByList1').append(tr);
|
}
|
} else {
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
}
|
//#endregion
|
|
|
|
//#region 保存HMaker
|
function set_AddNew(data) {
|
//获取子表数据
|
var num = [];
|
for (var i = 0; i < table.cache["mainTable"].length; i++) {
|
if (table.cache["mainTable"][i] != "") {
|
table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
|
num.push(table.cache["mainTable"][i])
|
}
|
}
|
//获取组织数据
|
data.field.HPRDORGID = sessionStorage["OrganizationID"];//组织
|
//转换里程碑数据
|
if (data.field.HIsKey == "true") {
|
data.field.HIsKey = 1;
|
} else {
|
data.field.HIsKey = 0;
|
}
|
//若为编辑-保存,则更新修改人和修改时间
|
if (OperationType == 3) {
|
data.field.HUpdater = sessionStorage["HUserName"];
|
data.field.HUpdaterDate = Format(new Date(), "yyyy-MM-dd");
|
$("#HUpdater").val(sessionStorage["HUserName"]);
|
$("#HUpdaterDate").val(Format(new Date(), "yyyy-MM-dd"));
|
}
|
//获取表头数据并序列化
|
var sMainStr = JSON.stringify(data.field); //主表数据
|
//子表数据序列化
|
var sSubStr = JSON.stringify(num);
|
|
//拼接序列化的数据
|
var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"];
|
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/PM_ProjectReportBill/AddBill",
|
async: true,
|
data: { "sMainSub": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
|
layer.close(index);
|
layer.msg("提交成功");
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 编辑 页面赋值
|
function RoadBillMain(linterid)//加载表头
|
{
|
$.ajax({
|
url: GetWEBURL() + "/PM_ProjectReportBill/editInit",
|
type: "GET",
|
async: false,
|
data: { "HInterID": linterid, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
var tableMain = result.data[0];
|
var tableSub = result.data[1];
|
var tableSub_Emp = result.data[2];
|
|
//主表 赋值
|
form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HInterID": tableMain[0]["HInterID"]
|
, "HBillNo": tableMain[0]["HBillNo"]
|
, "HDate": Format(new Date(tableMain[0]["HDate"]), "yyyy-MM-dd")
|
, "HProNumber": tableMain[0]["HProNumber"]
|
, "HProjectStageID": tableMain[0]["HProjectStageID"]
|
, "HProjectStageName": tableMain[0]["HProjectStageName"]
|
, "HStageNote": tableMain[0]["HStageNote"]
|
, "HRelationGoods": tableMain[0]["HRelationGoods"]
|
, "HIsKey": tableMain[0]["HIsKey"]
|
, "HReportEmpID": tableMain[0]["HReportEmpID"]
|
, "HReportEmpName": tableMain[0]["HReportEmpName"]
|
, "HReportNote": tableMain[0]["HReportNote"]
|
, "HReportGoods": tableMain[0]["HReportGoods"]
|
, "HReceiveEmp": tableMain[0]["HReceiveEmp"]
|
, "HCopyEmp": tableMain[0]["HCopyEmp"]
|
, "HRate": tableMain[0]["HRate"]
|
, "HOrgID": tableMain[0]["HOrgID"]
|
, "HRemark": tableMain[0]["HRemark"]
|
|
, "HMainSourceInterID": tableMain[0]["HMainSourceInterID"]
|
, "HMainSourceEntryID": tableMain[0]["HMainSourceEntryID"]
|
, "HMainSourceBillNo": tableMain[0]["HMainSourceBillNo"]
|
, "HMainSourceBillType": tableMain[0]["HMainSourceBillType"]
|
|
, "HMaker": tableMain[0]["HMaker"]
|
, "HUpdater": tableMain[0]["HUpdater"]
|
, "HChecker": tableMain[0]["HChecker"]
|
, "HMakerDate": tableMain[0]["HMakerDate"] == null ? "" : Format(new Date(tableMain[0]["HMakerDate"]), "yyyy-MM-dd")
|
, "HUpdaterDate": tableMain[0]["HUpdaterDate"] == null ? "" : Format(new Date(tableMain[0]["HUpdaterDate"]), "yyyy-MM-dd")
|
, "HCheckerDate": tableMain[0]["HCheckerDate"] == null ? "" : Format(new Date(tableMain[0]["HCheckerDate"]), "yyyy-MM-dd")
|
, "HCloseMan": tableMain[0]["HCloseMan"]
|
, "HDeleteMan": tableMain[0]["HDeleteMan"]
|
, "HBacker": tableMain[0]["HBacker"]
|
, "HCloseManDate": tableMain[0]["HCloseDate"] == null ? "" : Format(new Date(tableMain[0]["HCloseDate"]), "yyyy-MM-dd")
|
, "HDeleteManDate": tableMain[0]["HDeleteDate"] == null ? "" : Format(new Date(tableMain[0]["HDeleteDate"]), "yyyy-MM-dd")
|
, "HBackerDate": tableMain[0]["HBackerDate"] == null ? "" : Format(new Date(tableMain[0]["HBackerDate"]), "yyyy-MM-dd")
|
, "HBackRemark": tableMain[0]["HBackRemark"]
|
});
|
//若该阶段为里程碑,则设置里程碑复选框为选中
|
if (tableMain[0]["HIsKey"]) {
|
$("#checkboxHIsKey").attr("checked", true);
|
form.render("checkbox");
|
}
|
//组织的值HOrgID变化,重新渲染
|
HOrgIDBar = tableMain[0]["HOrgID"];
|
|
//子表
|
option.data = tableSub;
|
table.render(option);
|
//对子表中的项目经理复选框进行选中
|
for (var i = 0; i < tableSub.length; i++) {
|
if (tableSub[i].HIsPM) {
|
$('#HIsPM' + (i + 1)).attr("checked", true);
|
}
|
}
|
form.render('checkbox');
|
|
}
|
})
|
}
|
//#endregion
|
|
//#region 下推-页面赋值
|
function set_ProjectReport_Display() {
|
$.ajax({
|
url: GetWEBURL() + "/PM_ProjectBill/set_ProjectReport",
|
type: "GET",
|
async: false,
|
data: { "HInterID": linterid, "HProjectStageID": HProjectStageID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
var tableMain = result.data[0];
|
var tableSub = result.data[1];
|
|
//主表 赋值
|
form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HProjectID": tableMain[0]["HInterID"]
|
, "HProNumber": tableMain[0]["项目代码"]
|
, "HProjectStageID": tableMain[0]["HProjectStageID"]
|
, "HProjectStageName": tableMain[0]["项目阶段"]
|
, "HStageNote": tableMain[0]["项目阶段详细内容"]
|
, "HRelationGoods": tableMain[0]["阶段相关交付物"]
|
, "HIsKey": tableMain[0]["里程碑"]=="Y"?true:false
|
, "HRate": tableMain[0]["阶段业绩占比"]
|
, "HOrgID": tableMain[0]["HOrgID"]
|
|
, "HMainSourceInterID": tableMain[0]["HInterID"]
|
, "HMainSourceEntryID": tableMain[0]["HEntryID"]
|
, "HMainSourceBillNo": tableMain[0]["单据号"]
|
, "HMainSourceBillType": tableMain[0]["单据类型"]
|
});
|
//若该阶段为里程碑,则设置里程碑复选框为选中
|
if (tableMain[0]["里程碑"]=="Y") {
|
$("#checkboxHIsKey").attr("checked", true);
|
form.render("checkbox");
|
}
|
//组织的值HOrgID变化,重新渲染
|
HOrgIDBar = tableMain[0]["HOrgID"];
|
|
//子表
|
option.data = tableSub;
|
table.render(option);
|
//对子表中的项目经理复选框进行选中
|
for (var i = 0; i < tableSub.length; i++) {
|
if (tableSub[i].HIsPM) {
|
$('#HIsPM' + (i + 1)).attr("checked", true);
|
}
|
}
|
form.render('checkbox');
|
|
}
|
})
|
}
|
|
//#endregion
|
|
//#region 非空验证
|
function AllowLoadData(data) {
|
//#region 表头数据检验
|
if ($("#HBillNo").val() == "") {
|
layer.msg("单据号不能为空!");
|
return false;
|
}
|
if ($("#HDate").val() == "") {
|
layer.msg("日期不能为空!");
|
return false;
|
}
|
|
if ($("#HProNumber").val() == "0") {
|
layer.msg("项目代码未选择!");
|
return false;
|
}
|
if ($("#HProjectStageID").val() == "0") {
|
layer.msg("项目阶段未选择!");
|
return false;
|
}
|
if ($("#HReportEmpID").val() == "0") {
|
layer.msg("汇报人没有选择!");
|
return false;
|
}
|
|
//本阶段业绩占比格式检验
|
var HRate1 = $("#HRate").val() + "";
|
if (HRate1.substring(HRate1.length - 1, HRate1.length) == ".") {
|
layer.msg("本阶段业绩占比末尾不能为.!");
|
return;
|
} else {
|
var ref = /^[0-9]+\.?[0-9]*$/;
|
if (!ref.test(HRate1)) {
|
layer.msg("本阶段业绩占比请输正确入数字!");
|
return;
|
}
|
}
|
|
//#endregion
|
|
//#region 子表数据检验
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i] != "") {
|
//成员非空检验
|
if (option.data[i]["HEmpID"] == "0") {
|
layer.msg("第" + (i + 1) + "行:成员不能为空!");
|
return false;
|
}
|
|
//项目占比格式检验
|
var HRate = option.data[i]["HRate"] + "";
|
if (HRate.substring(HRate.length - 1, HRate.length) == ".") {
|
layer.msg("第" + (i + 1) + "行:项目占比末尾不能为.!");
|
return;
|
} else {
|
var ref = /^[0-9]+\.?[0-9]*$/;
|
if (!ref.test(HRate)) {
|
layer.msg("第" + (i + 1) + "行:项目占比请输入正确数字!");
|
return;
|
}
|
}
|
|
//业绩分配格式检验
|
var HAvgMoney = option.data[i]["HAvgMoney"] + "";
|
if (HAvgMoney.substring(HAvgMoney.length - 1, HAvgMoney.length) == ".") {
|
layer.msg("第" + (i + 1) + "行:分配业绩末尾不能为.!");
|
return;
|
} else {
|
var ref = /^[0-9]+\.?[0-9]*$/;
|
if (!ref.test(HAvgMoney)) {
|
layer.msg("第" + (i + 1) + "行:分配业绩请入输正确数字!");
|
return;
|
}
|
}
|
|
//提成格式检验
|
var HCountMoney = option.data[i]["HCountMoney"] + "";
|
if (HCountMoney.substring(HCountMoney.length - 1, HCountMoney.length) == ".") {
|
layer.msg("第" + (i + 1) + "行:提成末尾不能为.!");
|
return;
|
} else {
|
var ref = /^[0-9]+\.?[0-9]*$/;
|
if (!ref.test(HCountMoney)) {
|
layer.msg("第" + (i + 1) + "行:提成请入输正确数字!");
|
return;
|
}
|
}
|
}
|
}
|
//#endregion
|
|
//#region 子表关键字重复校验
|
var num = [];
|
for (var i = 0; i < option.data.length; i++) {
|
if ($.inArray(option.data[i]["HEmpID"], num) == -1) {
|
num.push(option.data[i]["HEmpID"]);
|
} else {
|
layer.msg("第" + (i + 1) + "行,成员:" + option.data[i]["HEmpName"] + "重复!");
|
return false;
|
}
|
}
|
//#endregion
|
return true;
|
}
|
//#endregion
|
|
//#region 项目阶段表头工具栏事件:上一行
|
function btn_up(data) {
|
if (data.length != 1) {
|
layer.msg("请选择一行数据!");
|
} else if (option.data[0]["RowID"] == data[0]["RowID"]) {
|
layer.msg("首行数据无法移动!");
|
} else {
|
var tables = [];
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["RowID"] == data[0]["RowID"]) {
|
tables.push(option.data[i - 1]);
|
data[0].LAY_CHECKED = true;
|
option.data[i - 1] = data[0];
|
option.data[i] = tables[0];
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
break;
|
}
|
}
|
}
|
}
|
//#endregion
|
|
//#region 项目阶段表头工具栏:下一行
|
function btn_under(data) {
|
if (data.length != 1) {
|
layer.msg("请选择一行数据!");
|
} else if (option.data[option.data.length - 1]["RowID"] == data[0]["RowID"]) {
|
layer.msg("末行数据无法移动!");
|
} else {
|
var tables = [];
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["RowID"] == data[0]["RowID"]) {
|
tables.push(option.data[i + 1]);
|
data[0].LAY_CHECKED = true;
|
option.data[i + 1] = data[0];
|
option.data[i] = tables[0];
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
break;
|
}
|
}
|
}
|
}
|
//#endregion
|
|
//#region 项目阶段表:删除指定行
|
function set_GridDelete(obj) {
|
var data = obj.data;
|
var rowIndex = $(obj.tr).attr("data-index");
|
if (obj.event === 'del') {
|
layer.confirm('真的删除行吗?', function (index) {
|
console.log("索引为:" + rowIndex);
|
if (rowIndex === '0') {
|
layer.msg('首行无法删除!!!');
|
} else {
|
var oldData = table.cache["mainTable"];
|
oldData.splice(obj.tr.data('index'), 1)
|
option.data = oldData;//将数据绑定到data上
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
layer.close(index);
|
}
|
});
|
}
|
}
|
//#endregion
|
|
//#region 子表:快捷键(F7)打开弹窗
|
function set_GridCellCheck(obj) {
|
$(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
|
if (event.key == "F7") {
|
//成员
|
if (obj.event == "HEmpName") {
|
var HOrgID = $("#HOrgID").val();
|
//打开员工列表小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "员工列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?openType=HEmp&HOrgID=' + HOrgID, 'yes']
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"HEmpID": checkStatus.data[0].HItemID
|
, "HEmpName": checkStatus.data[0].职员名称
|
})
|
layer.close(index);//关闭弹窗
|
}
|
, end: function () {
|
obj.update({
|
"HEmpID": optiondata[0].HItemID
|
, "HEmpName": optiondata[0].职员名称
|
})
|
}
|
})
|
}
|
obj.event = "";
|
return false;
|
}
|
})
|
}
|
//#endregion
|
|
//#region 项目成员表-刷新设置复选框状态
|
function CheckedSet_tableSub_Emp() {
|
var tableSub_Emp = option.data;
|
//对子表中的项目经理复选框进行选中
|
for (var i = 0; i < tableSub_Emp.length; i++) {
|
if (tableSub_Emp[i].HIsPM) {
|
$('#HIsPM' + (i + 1)).attr("checked", true);
|
}
|
}
|
form.render('checkbox');
|
}
|
//#endregion
|
|
//#region 隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
|
contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
|
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: [contentUrl, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//#endregion
|
//#region 显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
async: false,
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["行号","成员ID"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 2; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option.cols[0][i + 1]["style"] += "font-size:100%";
|
}
|
//设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
} else {
|
table.render(option);
|
CheckedSet_tableSub_Emp();
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
//#endregion
|
|
//#region 根据登录账户获取相应职员
|
function getHEmpByHUserName() {
|
var Czybm = sessionStorage["Czybm"];
|
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/PM_WorkTaskReportBill/getHEmpByHUserName',
|
type: "GET",
|
data: { "Czybm": Czybm, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
var HReportEmpID = result.data[0]["HEmpID"];
|
var HReportEmpName = result.data[0]["HEmpName"];
|
$("#HReportEmpID").val(HReportEmpID);
|
$("#HReportEmpName").val(HReportEmpName);
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
}
|
//#endregion
|
//#endregion
|
|
|
|
|
});
|
//#region 下载已上传的文件
|
function dowload(r) {
|
//得到当前所在行
|
var rows = r.parentNode.parentNode.rowIndex;
|
//得到所在行的第五列的内容:文件地址
|
var url = $("#ProImgByList1 tr:eq(" + (rows - 1) + ") td:eq(5)").html();
|
/*window.location.href = url;*/
|
window.open(url)
|
}
|
//#endregion
|
|
//#region 删除已上传的文件
|
function toManager(r) {
|
//得到当前所在行
|
var rows = r.parentNode.parentNode.rowIndex;
|
//得到所在行的第一列的内容:主键ID
|
var HItemID = $("#ProImgByList1 tr:eq(" + (rows - 1) + ") td:eq(0)").html();
|
//得到所在行的第二列的内容:单据号
|
var HSourceBillNo = $("#ProImgByList1 tr:eq(" + (rows - 1) + ") td:eq(1)").html();
|
//得到所在行的第三列的内容:文件名称
|
var HFileName = $("#ProImgByList1 tr:eq(" + (rows - 1) + ") td:eq(2)").html();
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
|
//删除已上传文件
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationOutBill/DeleteFilelist',
|
type: "GET",
|
data: { "HItemID": HItemID, "HSourceBillNo": HSourceBillNo, "HFileName": HFileName },
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.alert(data1.Message, { icon: 1 });
|
$("#ProImgByList1 tr").eq((rows - 1)).remove();
|
}
|
else {
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
}
|
//#endregion
|
|
//项目代码
|
function GetProjectBillValue(obj) {
|
$("#HProjectID").val(obj[0].HInterID);
|
$("#HProNumber").val(obj[0].项目代码);
|
$("#HProjectStageID").val(obj[0].HProjectStageID);
|
$("#HProjectStageName").val(obj[0].项目阶段);
|
$("#HStageNote").val(obj[0].项目阶段详细内容);
|
$("#HPMGoodsID").val(obj[0].HPMGoodsID);
|
$("#HRelationGoods").val(obj[0].阶段相关交付物);
|
$("#HIsKey").val((obj[0].里程碑 == 'Y' ? true : false));
|
$("#HRate").val(obj[0].阶段业绩占比);
|
|
$("#HMainSourceInterID").val(obj[0].HInterID);
|
$("#HMainSourceEntryID").val(obj[0].HEntryID);
|
$("#HMainSourceBillNo").val(obj[0].单据号);
|
$("#HMainSourceBillType").val(obj[0].单据类型);
|
|
|
}
|
|
//项目阶段
|
function GetProjectStageValue(obj) {
|
$("#HProjectStageID").val(obj[0].HItemID);//项目阶段id
|
$("#HProjectStageName").val(obj[0].阶段名称);//项目阶段名称
|
$("#HStageNote").val(obj[0].项目阶段详细内容);//项目阶段详细内容
|
}
|
|
//汇报人
|
function GetHReportValue (obj) {
|
$("#HReportEmpID").val(obj[0].HItemID);//客户id
|
$("#HReportEmpName").val(obj[0].职员名称);//客户名称
|
}
|
|
//接收人
|
function GetHReceiveValue(obj) {
|
$("#HReceiveEmp").val(obj[0].职员名称);//接收人名称
|
}
|
|
//员工
|
function GetHEmpValue(obj) {
|
optiondata = obj
|
}
|
</script>
|
</body>
|
</html>
|