//承包合同预审
|
var currentUserName;
|
var tabIndex;
|
var $projectid;
|
initData = function () {
|
if (window.sysid === '') {
|
$.ajax({
|
url: "/ContractPretrial/InitData",
|
async: false,
|
cache: false,
|
dataType: "json",
|
success: function (data) {
|
currentUserName = data.CurrentUserName;
|
$("#oa_contractpretrial_Code").val(data.Code);
|
}
|
});
|
var $title = "承包合同预审(" + currentUserName + ")";
|
$("#oa_contractpretrial_PartyB").val("浙江坤德创新岩土工程有限公司");
|
$("#oa_contractpretrial_Title").val($title);
|
}
|
addCSS();
|
//合同金额
|
addInputUnit($("#oa_contractpretrial_Amount"), "元", "back");
|
}
|
|
//选择客户
|
$(document).on("click", "input[name='oa_contractpretrial.PartyA']", function () {
|
layer.open({
|
type: 2,
|
title: '客户单位',
|
shadeClose: true,
|
shade: 0.4,
|
area: ['90%', '90%'],
|
content: "/Customer/Index"
|
});
|
});
|
|
SetCustomer = function (mId, mName, mContactName, mContactPhone) {
|
$('input[name="oa_contractpretrial.PartyA"]').val(mName);
|
$('input[name="oa_contractpretrial.PartyADeputy"]').val(mContactName);
|
layer.closeAll();
|
}
|
|
//动态添加CSS样式
|
function addCSS() {
|
var str_style = 'td{ position:relative;}\
|
.bl{position: relative;}\
|
.bl .back {position: absolute;top: 0;right: 5px;display: inline-block;}\
|
.bl .backdtl {position: absolute;top: 2px;right:10px;display: inline-block;}';
|
|
if (document.all) { // document.createStyleSheet(url)
|
window.style = str_style;
|
document.createStyleSheet("javascript:style");
|
} else { //document.createElement(style)
|
var style = document.createElement('style');
|
style.type = 'text/css';
|
style.innerHTML = str_style;
|
document.getElementsByTagName('HEAD').item(0).appendChild(style);
|
}
|
}
|
|
//在input后添加元div
|
function addInputUnit($input, unit, className) {
|
var div = createDivUnit(unit, className);
|
$input.after(div);
|
$input.parent().addClass("bl");
|
}
|
//创建div元
|
function createDivUnit(unit, className) {
|
var div = document.createElement("div");
|
div.className = className;
|
div.innerHTML = unit;
|
return div;
|
}
|
|
|
getQueryVariable = function (parameter) {
|
var query = window.location.search.substring(1);
|
var vars = query.split("&");
|
for (var i = 0; i < vars.length; i++) {
|
var pair = vars[i].split("=");
|
if (pair[0] === parameter) { return pair[1]; }
|
}
|
return "";
|
}
|
|
Array.prototype.Contains = function (val) {
|
for (var i = 0; i < this.length; i++) {
|
if (this[i] == val) {
|
return true;
|
}
|
}
|
return false;
|
};
|