You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

282 lines
8.1 KiB

function tan(ty){
if(ty=='d'){
var p= document.getElementById('facility');
var newfacility='<div class="form-group">'
+'<div class="col-md-3">'
+'<input type="text" name="id" id="id" maxlength="20" >'
+'</div>'
+'<div class="col-md-3">'
+'<input class="paymentdates" type="date" name="paymentdate" id="paymentdate">'
+'</div>'
+'<div class="col-md-3">'
+'<input class="receivableamounts" type="text" name="receivableamount" id="receivableamount">'
+'</div>'
+'<div class="col-md-3">'
+'<input class="paidamounts" type="text" name="paidamount" id="paidamount">'
+' </div>'
+' </div>';
p.innerHTML+=newfacility;
}else if(ty=='q'){
var p= document.getElementById('review');
var choosesigner=document.getElementById('choosesigner');
var res=choosesigner.innerHTML;
var newreview='<div class="form-group">' +
'<div class="col-md-6">' +
'<select name="signrole" id="signrole" class="signrole" style="margin-top: 10px">' +
'<option value="直属主管(经理)">直属主管(经理)</option>' +
'<option value="直属主管(总监)">直属主管(总监)</option>' +
'<option value="評估部門(管理部專人)">評估部門(管理部專人)</option>' +
'<option value="总经理">總經理</option>' +
'</select>' +
'</div>' +
'<div class="col-md-6" id="choosesigner">' +
'<select name="signer" id="choosesigner" class="signer" style="margin-top: 10px">'+
res+
'</select>' +
'</div>' +
'</div>';
p.innerHTML+=newreview;
}
else{
alert('非法操作')
}
}
function tijiao(){
//作番号
var facilitynoslist = [];
$(".facilitynos").each(function () {
facilitynoslist.push($(this).val());
});
console.log('11111');
console.log(facilitynoslist);
console.log('22222');
console.log('数据');
//重量
var weightslist = [];
$(".weights").each(function () {
weightslist.push($(this).val());
});
//停数
var numberofstopslist=[];
$(".numberofstops").each(function () {
numberofstopslist.push($(this).val());
});
//楼层数
var numberoffloorslist=[];
$(".numberoffloors").each(function () {
numberoffloorslist.push($(this).val());
});
//开门方式
var opentypeslist=[];
$(".opentypes").each(function () {
opentypeslist.push($(this).val());
});
//速度
var speedslist=[];
$(".speeds").each(function () {
speedslist.push($(this).val());
});
//维护形态
var repairtypeslist=[];
$(".repairtypes").each(function () {
repairtypeslist.push($(this).val());
});
//地址
var addressslist=[];
$(".addresss").each(function () {
addressslist.push($(this).val());
});
//经度
var longitudeslist=[];
$(".longitudes").each(function () {
longitudeslist.push($(this).val());
});
//维度
var latitudeslist=[];
$(".latitudes").each(function () {
latitudeslist.push($(this).val());
});
//维护工号
var repaireridslist=[];
$(".repairerids").each(function () {
repaireridslist.push($(this).val());
});
//维护人员姓名
var repairernameslist=[];
$(".repairernames").each(function () {
repairernameslist.push($(this).val());
});
//合约号
var contractno = $('.contractno').val();
//客户编号
var customerid = $('.customerid').val();
//建档人
var creater = $('.creater').val();
//创建时间
var create_at = $('.create_at').val();
var type = $('.type').val();
var url = "facilityapi.php";
//提交创建
$.ajax({
method: 'post',
url: url,
data: {
facilitynos: JSON.stringify(facilitynoslist),
weights: JSON.stringify(weightslist),
numberofstops:JSON.stringify(numberofstopslist),
numberoffloors:JSON.stringify(numberoffloorslist),
opentypes:JSON.stringify(opentypeslist),
speeds:JSON.stringify(speedslist),
repairtypes:JSON.stringify(repairtypeslist),
addresss:JSON.stringify(addressslist),
longitudes:JSON.stringify(longitudeslist),
latitudes:JSON.stringify(latitudeslist),
repairerids:JSON.stringify(repaireridslist),
repairernames:JSON.stringify(repairernameslist),
type:type,
contractno:contractno,
customerid:customerid,
creater:creater,
create_at:create_at
},
success: function (data) {
var res=eval('('+data+')');
if(res.code=='200'){
window.location.href='custom-create-schedule.php?accountid='+customerid+'&contractno='+contractno;
}else{
alert('添加失败');
}
}
});
}
function tijiaosch(){
//作番号
var facilitynoslist = [];
$(".facilitynos").each(function () {
facilitynoslist.push($(this).val());
});
//保养套餐
var combonoslist=[];
$(".combonos").each(function () {
combonoslist.push($(this).val());
});
//保养日期duedates
var duedateslist=[];
$(".duedates").each(function () {
duedateslist.push($(this).val());
});
//保养工号
var repaireridslist=[];
$(".repairerids").each(function () {
repaireridslist.push($(this).val());
});
//保养人姓名
var repairernameslist=[];
$(".repairernames").each(function () {
repairernameslist.push($(this).val());
});
//合约号
var contractno = $('.contractno').val();
//建档人
var creater = $('.creater').val();
//创建时间
var create_at = $('.create_at').val();
var type = $('.type').val();
var url = "scheduleapi.php";
//提交创建
$.ajax({
method: 'post',
url: url,
data: {
facilitynos: JSON.stringify(facilitynoslist),
combonos:JSON.stringify(combonoslist),
duedates:JSON.stringify(duedateslist),
repairerids:JSON.stringify(repaireridslist),
repairernames:JSON.stringify(repairernameslist),
type:type,
contractno:contractno,
creater:creater,
create_at:create_at
},
success: function (data) {
var res=eval('('+data+')');
if(res.code=='200'){
window.location.href='custom-create.php';
}else{
alert('添加失败,请检查数据');
}
}
});
}
function show(id){
//removeClass
var t = document.getElementById('account');//选取id为test的div元素
t.style.display = 'none';// 隐藏选择的元素
t.style.display = 'block';// 以块级样式显示
}
function login(){
var account = $('.account').val();
var password = $('.password').val();
var url = "loginapi.php";
$.ajax({
method: 'post',
url: url,
data: {
account:account,
password:password
},
success: function (data) {
console.log('返回的结果');
res=eval("("+data+")");
console.log(res);
if(res.code=='200'){
var token=res.token;
var name=res.name;
var account=res.account;
window.localStorage.setItem("name",name);
window.localStorage.setItem("token",token);
window.localStorage.setItem("account",account);
window.location.href='pricereview-index.php?account='+account;
}else{
window.location.href='login.php?errno=1';
}
}
});
}
function settoken(v){
window.localStorage.setItem("token",v);
}
function gettoken(v){
window.localStorage.getItem("token");
}