// pages/createguarantee/createguarantee.js var network = require("../../../utils/net.js") var timechage = require("../../../utils/dateTimeUtil.js") var app = getApp() function GetAccountCustomer(that, inputValue) { let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountCustomer"; let params = [{ "InputValue": inputValue, "PageIndex": 0, "PageSize": 100 }]; network.transfer_request(method, params, function(res) { that.setData({ currency: res.result, accountcustomer: res.result }) }) that.setData({ which: "结账客户" }) } function GetAccountingUnit(that, inputValue) { let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetAccountingUnit"; let params = [{ "InputValue": inputValue, "PageIndex": 0, "PageSize": 100 }]; network.transfer_request(method, params, function(res) { that.setData({ currency: res.result, accountUnit: res.result }) }) that.setData({ which: "会计单位" }) } function GetDepartment(that, inputValue) { let method = "/MainSystem/B3MiniProgramRpc/Rpcs/BaseInfoRpc/GetDepartment"; let params = [{ "InputValue": inputValue, "PageIndex": 0, "PageSize": 100 }]; network.transfer_request(method, params, function(res) { that.setData({ currency: res.result, department: res.result }) }) that.setData({ which: "部门" }) } function GetCustomerAccountingUnitBalance(that,accoutUnitId, customerId) { let method = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetCustomerAccountingUnitBalance"; let params = [accoutUnitId, customerId]; network.transfer_request(method, params, function(res) { that.setData({ requestMoney:res.result, guaranteeMoney:res.result+that.data.allBillMoney }) }) } Page({ /** * 页面的初始数据 */ data: { currency: [], accountcustomerIndex: 0, accountcustomer: [{ ID: 0, Name: "请选择结账客户" }], accountUnitIndex: 0, accountUnit: [], departmentIndex: 0, department: [], guaranteedate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), paydate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), guaranteeMoney: '', requestMoney:0, allBillMoney:0, array: [] }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { this.setData({ accountUnit: [{ ID: app.globalData.AccountingUnit_ID, Name: app.globalData.AccountingUnit_Name }], department: [{ ID: app.globalData.Department_ID, Name: app.globalData.Department_Name }], }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { this.setData({ array: app.globalData.billInfo }) let billMoney=0; if(this.data.array!=null || this.data.array!=""){ for(var i =0;i