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.
 

226 lines
5.3 KiB

var network = require("../../../utils/net.js")
var timechage = require("../../../utils/dateTimeUtil.js")
var app = getApp()
var customerid=0;
function getBillForDetail777(that,id){
let method = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetBillForDetail";
let params = [id,777];
network.transfer_request(method, params, function (res) {
let array=[];
for(var i=0;i<res.result.length;i++){
var dmo={
BillTypeID: res.result[i].BillTypeID,
BillTypeName: res.result[i].BillTypeName,
Customer_Name: res.result[i].Customer_Name,
ID:res.result[i].ID,
Money: res.result[i].Money,
Date: timechage.formatTimeTwo(res.result[i].Date.substring(6, 19), 'Y-M-D')
}
array.push(dmo)
}
that.setData({
arrayOut:array
})
})
}
function getBillForDetail792(that, id) {
let method = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetBillForDetail";
let params = [id, 792];
network.transfer_request(method, params, function (res) {
let array = [];
for (var i = 0; i < res.result.length; i++) {
var dmo = {
BillTypeID: res.result[i].BillTypeID,
BillTypeName: res.result[i].BillTypeName,
Customer_Name: res.result[i].Customer_Name,
ID: res.result[i].ID,
Money: res.result[i].Money,
Date: timechage.formatTimeTwo(res.result[i].Date.substring(6, 19), 'Y-M-D')
}
array.push(dmo)
}
that.setData({
arrayCheck: array
})
})
}
function getBillForDetail776(that, id) {
let method = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/BusinessGuaranteeRpc/GetBillForDetail";
let params = [id, 776];
network.transfer_request(method, params, function (res) {
let array = [];
for (var i = 0; i < res.result.length; i++) {
var dmo = {
BillTypeID: res.result[i].BillTypeID,
BillTypeName: res.result[i].BillTypeName,
Customer_Name: res.result[i].Customer_Name,
ID: res.result[i].ID,
Money: res.result[i].Money,
Date: timechage.formatTimeTwo(res.result[i].Date.substring(6, 19), 'Y-M-D')
}
array.push(dmo)
}
that.setData({
arrayBill: array
})
})
}
Page({
/**
* 页面的初始数据
*/
data: {
winWidth: 0,
winHeight: 0,
// tab切换
currentTab: 0,
arrayOut:[],
arrayCheck: [],
arrayBill:[],
arrayOutChoseID:[],
arrayCheckChoseID:[],
arrayBillChoseID:[]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
customerid = Number(options.customerid)
var that = this;
/**
* 获取系统信息
*/
wx.getSystemInfo({
success: function (res) {
that.setData({
winWidth: res.windowWidth,
winHeight: res.windowHeight
});
}
});
getBillForDetail777(that, customerid)
getBillForDetail792(that, customerid)
getBillForDetail776(that, customerid)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
checkboxOutChange:function(e){
this.setData({
arrayOutChoseID:e.detail.value
})
},
checkboxCheckChange:function(e){
this.setData({
arrayCheckChoseID: e.detail.value
})
},
checkboxBillChange:function(e){
this.setData({
arrayBillChoseID: e.detail.value
})
},
submitForm:function(e){
let choseOut=[]
for (var i = 0; i < this.data.arrayOutChoseID.length;i++){
for(var j=0;j<this.data.arrayOut.length;j++){
if (Number(this.data.arrayOutChoseID[i]) == this.data.arrayOut[j].ID){
choseOut.push(this.data.arrayOut[j])
}
}
}
let choseCheck =[]
for (var i = 0; i < this.data.arrayCheckChoseID.length; i++) {
for (var j = 0; j < this.data.arrayCheck.length; j++) {
if (Number(this.data.arrayCheckChoseID[i]) == this.data.arrayCheck[j].ID) {
choseCheck.push(this.data.arrayCheck[j])
}
}
}
let choseBill =[]
for (var i = 0; i < this.data.arrayBillChoseID.length; i++) {
for (var j = 0; j < this.data.arrayBill.length; j++) {
if (Number(this.data.arrayBillChoseID[i]) == this.data.arrayBill[j].ID) {
choseBill.push(this.data.arrayBill[j])
}
}
}
choseOut = choseOut.concat(choseCheck).concat(choseBill)
app.globalData.billInfo = app.globalData.billInfo.concat(choseOut)
wx.navigateBack({
delta: 1
})
},
/**
* 滑动切换tab
*/
bindChange: function (e) {
var that = this;
that.setData({
currentTab: e.detail.current
});
},
/**
* 点击tab切换
*/
swichNav: function (e) {
var that = this;
if (this.data.currentTab === e.target.dataset.current) {
return false;
} else {
that.setData({
currentTab: e.target.dataset.current
})
}
},
})