|
|
|
@ -1,30 +1,30 @@ |
|
|
|
var network = require("../../../utils/net.js") |
|
|
|
var timechage = require("../../../utils/dateTimeUtil.js") |
|
|
|
var app = getApp() |
|
|
|
var orderID=0; |
|
|
|
var orderID = 0; |
|
|
|
|
|
|
|
function load(that, ID) { |
|
|
|
let method = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/Load'; |
|
|
|
let params = [ID]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
let DepartmentWorkFlow_Detail_Name = res.result.DepartmentWorkFlow_Detail_Name |
|
|
|
let istrue = false; |
|
|
|
if (DepartmentWorkFlow_Detail_Name == "初始") { |
|
|
|
istrue = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (res.result.Customer_Name!=null){ |
|
|
|
if (res.result.Customer_Name != null) { |
|
|
|
var accountcustomerNew = [{ |
|
|
|
ID: res.result.Customer_ID, |
|
|
|
Name: res.result.Customer_Name |
|
|
|
}] |
|
|
|
} |
|
|
|
let accountUnitNew=[{ |
|
|
|
let accountUnitNew = [{ |
|
|
|
ID: res.result.AccountingUnit_ID, |
|
|
|
Name: res.result.AccountingUnit_Name |
|
|
|
}] |
|
|
|
|
|
|
|
let departmentNew =[{ |
|
|
|
let departmentNew = [{ |
|
|
|
ID: res.result.Department_ID, |
|
|
|
Name: res.result.Department_Name |
|
|
|
}] |
|
|
|
@ -56,7 +56,7 @@ function load(that, ID) { |
|
|
|
|
|
|
|
function setDetails(that, ary) { |
|
|
|
let array = [] |
|
|
|
let billMoney=0; |
|
|
|
let billMoney = 0; |
|
|
|
for (var i = 0; i < ary.length; i++) { |
|
|
|
billMoney = billMoney + ary[i].Value |
|
|
|
let data = ""; |
|
|
|
@ -69,7 +69,7 @@ function setDetails(that, ary) { |
|
|
|
Value: ary[i].Value, |
|
|
|
Customer_Name: ary[i].Customer_Name, |
|
|
|
Date: data, |
|
|
|
ID:ary[i].ID, |
|
|
|
ID: ary[i].ID, |
|
|
|
DmoTypeID: ary[i].DmoTypeID |
|
|
|
} |
|
|
|
array.push(dmo) |
|
|
|
@ -90,7 +90,7 @@ function GetAccountCustomer(that, inputValue) { |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
accountcustomer: res.result |
|
|
|
@ -108,7 +108,7 @@ function GetAccountingUnit(that, inputValue) { |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
accountUnit: res.result |
|
|
|
@ -126,7 +126,7 @@ function GetDepartment(that, inputValue) { |
|
|
|
"PageIndex": 0, |
|
|
|
"PageSize": 100 |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
currency: res.result, |
|
|
|
department: res.result |
|
|
|
@ -140,7 +140,7 @@ function GetDepartment(that, inputValue) { |
|
|
|
function GetCustomerAccountingUnitBalance(that, accoutUnitId, customerId) { |
|
|
|
let method = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetCustomerAccountingUnitBalance"; |
|
|
|
let params = [accoutUnitId, customerId]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
that.setData({ |
|
|
|
requestMoney: res.result, |
|
|
|
guaranteeMoney: res.result + that.data.allBillMoney |
|
|
|
@ -179,35 +179,66 @@ Page({ |
|
|
|
requestMoney: 0, |
|
|
|
allBillMoney: 0, |
|
|
|
array: [], |
|
|
|
showView: false |
|
|
|
showView: false, |
|
|
|
winHeight: 0 |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
onLoad: function(options) { |
|
|
|
var that = this; |
|
|
|
let ID = Number(options.ID); |
|
|
|
orderID =ID; |
|
|
|
orderID = ID; |
|
|
|
wx.setNavigationBarTitle({ |
|
|
|
title: '业务担保单No.'+ID, |
|
|
|
title: '业务担保单No.' + ID, |
|
|
|
}) |
|
|
|
load(that, ID) |
|
|
|
wx.getSystemInfo({ |
|
|
|
|
|
|
|
success: function(res) { |
|
|
|
that.setData({ |
|
|
|
winHeight: res.windowHeight |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
|
onReady: function () { |
|
|
|
}, |
|
|
|
onReady: function() {}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
onShow: function () { |
|
|
|
onShow: function() { |
|
|
|
var tmpData = app.globalData.billInfo |
|
|
|
var oldData = this.data.array |
|
|
|
if (oldData.length > 0) { |
|
|
|
tmpData.forEach(function (item, index, arrSelf) { |
|
|
|
var has = false |
|
|
|
for (var j = 0; j < oldData.length; j++) { |
|
|
|
if (oldData[j].DmoTypeID == item.DmoTypeID && oldData[j].BillID == item.BillID) { |
|
|
|
has = true; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!has) { |
|
|
|
oldData.push(item) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
oldData = tmpData |
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
array: app.globalData.billInfoUp |
|
|
|
array: oldData |
|
|
|
}) |
|
|
|
app.globalData.billInfo = [] |
|
|
|
|
|
|
|
let billMoney = 0; |
|
|
|
if (this.data.array != null || this.data.array != "") { |
|
|
|
for (var i = 0; i < this.data.array.length; i++) { |
|
|
|
@ -223,41 +254,41 @@ Page({ |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|
onHide: function () { |
|
|
|
onHide: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
*/ |
|
|
|
onUnload: function () { |
|
|
|
app.globalData.billInfoUp = []; |
|
|
|
onUnload: function() { |
|
|
|
app.globalData.billInfo = []; |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
|
*/ |
|
|
|
onPullDownRefresh: function () { |
|
|
|
onPullDownRefresh: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
*/ |
|
|
|
onReachBottom: function () { |
|
|
|
onReachBottom: function() { |
|
|
|
|
|
|
|
}, |
|
|
|
bindguaranteeDateChange: function (e) { |
|
|
|
bindguaranteeDateChange: function(e) { |
|
|
|
this.setData({ |
|
|
|
guaranteedate: e.detail.value |
|
|
|
}) |
|
|
|
}, |
|
|
|
bindpayDateChange: function (e) { |
|
|
|
bindpayDateChange: function(e) { |
|
|
|
this.setData({ |
|
|
|
paydate: e.detail.value |
|
|
|
}) |
|
|
|
}, |
|
|
|
addBills: function (e) { |
|
|
|
addBills: function(e) { |
|
|
|
let accountCustomerId = this.data.accountcustomer[this.data.accountcustomerIndex].ID; |
|
|
|
if (accountCustomerId == 0) { |
|
|
|
wx.showToast({ |
|
|
|
@ -266,10 +297,10 @@ Page({ |
|
|
|
return; |
|
|
|
} |
|
|
|
wx.navigateTo({ |
|
|
|
url: '/pages/guaranteebillUp/guaranteebill?customerid=' + accountCustomerId, |
|
|
|
url: '../selectbill/selectbill?customerid=' + accountCustomerId, |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteItem: function (e) { |
|
|
|
deleteItem: function(e) { |
|
|
|
let idx = e.currentTarget.dataset.idx; |
|
|
|
app.globalData.billInfoUp.splice(idx, 1) |
|
|
|
this.setData({ |
|
|
|
@ -287,7 +318,7 @@ Page({ |
|
|
|
guaranteeMoney: billMoney + this.data.requestMoney |
|
|
|
}) |
|
|
|
}, |
|
|
|
submitForm: function (e) { |
|
|
|
submitForm: function(e) { |
|
|
|
let accountCustomerId = this.data.accountcustomer[this.data.accountcustomerIndex].ID; |
|
|
|
let accountUnitId = this.data.accountUnit[this.data.accountUnitIndex].ID; |
|
|
|
let departmentId = this.data.department[this.data.departmentIndex].ID; |
|
|
|
@ -310,14 +341,14 @@ Page({ |
|
|
|
|
|
|
|
let detailsArray = []; |
|
|
|
for (var i = 0; i < this.data.array.length; i++) { |
|
|
|
let id =0; |
|
|
|
if(this.data.array[i].ID!=null){ |
|
|
|
let id = 0; |
|
|
|
if (this.data.array[i].ID != null) { |
|
|
|
id = this.data.array[i].ID |
|
|
|
} |
|
|
|
var dmo = { |
|
|
|
BillID: this.data.array[i].BillID, |
|
|
|
DmoTypeID: this.data.array[i].DmoTypeID, |
|
|
|
ID:id |
|
|
|
ID: id |
|
|
|
} |
|
|
|
detailsArray.push(dmo) |
|
|
|
} |
|
|
|
@ -333,27 +364,26 @@ Page({ |
|
|
|
"GuaranteeMoney": this.data.guaranteeMoney, |
|
|
|
"Details": detailsArray |
|
|
|
}]; |
|
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
network.transfer_request(method, params, function(res) { |
|
|
|
if (res.result == null) { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '修改成功,是否返回上级列表', |
|
|
|
success: function (res) { |
|
|
|
if (res.cancel) { |
|
|
|
} else { |
|
|
|
success: function(res) { |
|
|
|
if (res.cancel) {} else { |
|
|
|
app.globalData.billInfoUp = []; |
|
|
|
wx.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: function (res) { } |
|
|
|
fail: function(res) {} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
powerDrawer: function (e) { |
|
|
|
powerDrawer: function(e) { |
|
|
|
let that = this; |
|
|
|
let x = e.currentTarget.dataset.x; |
|
|
|
if (x == "结账客户") { |
|
|
|
@ -366,7 +396,7 @@ Page({ |
|
|
|
let currentStatu = e.currentTarget.dataset.statu; |
|
|
|
this.util(currentStatu) |
|
|
|
}, |
|
|
|
itemclick: function (e) { |
|
|
|
itemclick: function(e) { |
|
|
|
var that = this; |
|
|
|
var name = e.currentTarget.dataset.name; |
|
|
|
var id = e.currentTarget.dataset.id; |
|
|
|
@ -394,7 +424,7 @@ Page({ |
|
|
|
showModalStatus: false, |
|
|
|
}) |
|
|
|
}, |
|
|
|
select: function (e) { |
|
|
|
select: function(e) { |
|
|
|
var that = this; |
|
|
|
var which = e.currentTarget.dataset.item; |
|
|
|
var value = e.detail.value; |
|
|
|
@ -408,7 +438,7 @@ Page({ |
|
|
|
GetDepartment(that, value) |
|
|
|
} |
|
|
|
}, |
|
|
|
util: function (currentStatu) { |
|
|
|
util: function(currentStatu) { |
|
|
|
/* 动画部分 */ |
|
|
|
// 第1步:创建动画实例
|
|
|
|
var animation = wx.createAnimation({ |
|
|
|
@ -429,7 +459,7 @@ Page({ |
|
|
|
}) |
|
|
|
|
|
|
|
// 第5步:设置定时器到指定时候后,执行第二组动画
|
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function() { |
|
|
|
// 执行第二组动画
|
|
|
|
animation.opacity(1).rotateX(0).step(); |
|
|
|
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
|
|
|
|
|