diff --git a/pages/guarantee/detail/detail.js b/pages/guarantee/detail/detail.js index 25f3e75..942df46 100644 --- a/pages/guarantee/detail/detail.js +++ b/pages/guarantee/detail/detail.js @@ -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(); // 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象 diff --git a/pages/guarantee/detail/detail.wxml b/pages/guarantee/detail/detail.wxml index cb348c3..b1c8596 100644 --- a/pages/guarantee/detail/detail.wxml +++ b/pages/guarantee/detail/detail.wxml @@ -1,83 +1,94 @@ - - 结账客户 - {{accountcustomer[accountcustomerIndex].Name}} - + + + 结账客户 + {{accountcustomer[accountcustomerIndex].Name}} + - - 会计单位 - {{accountUnit[accountUnitIndex].Name}} - + + 会计单位 + {{accountUnit[accountUnitIndex].Name}} + - - 部门 - {{department[departmentIndex].Name}} - + + 部门 + {{department[departmentIndex].Name}} + - - 担保日期 - - - {{guaranteedate}} - - - + + 担保日期 + + + {{guaranteedate}} + + + - - 承诺回款日期 - - - {{paydate}} - - - + + 承诺回款日期 + + + {{paydate}} + + + - - 担保金额 - {{guaranteeMoney}} - + + 担保金额 + {{guaranteeMoney}} + - - - 担保明细{{idx+1}} - - - {{item.DmoTypeIDName}}No.{{item.BillID}} - 金额:{{item.Value}} + + + 担保明细{{idx+1}} + + + {{item.DmoTypeIDName}}No.{{item.BillID}} + 金额:{{item.Value}} + + + {{item.Customer_Name}} + 日期:{{item.Date}} + + - - {{item.Customer_Name}} - 日期:{{item.Date}} + + + 删除 + - - - - 删除 - - - - + + - - - - - - - - - - - - - {{item.Name}} - - + + + + + + + + + + + + + {{item.Name}} + + + + 取消 - 取消 - + + \ No newline at end of file diff --git a/pages/guarantee/detail/detail.wxss b/pages/guarantee/detail/detail.wxss index 8d90478..0377fbe 100644 --- a/pages/guarantee/detail/detail.wxss +++ b/pages/guarantee/detail/detail.wxss @@ -1,9 +1,10 @@ /* pages/updataguarantee/updataguarantee.wxss */ + page { background: rgb(240, 239, 245); } -.twoitem{ +.twoitem { display: flex; flex-direction: row; justify-content: space-between; @@ -15,26 +16,17 @@ page { padding-bottom: 20rpx; } -.item_value{ +.item_value { width: 70%; - text-align: right + text-align: right; } -.item_value1{ +.item_value1 { width: 60%; - text-align: right + text-align: right; } .submit { - margin-top: 50rpx; - margin-bottom: 30rpx; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; -} - -.submit2 { margin-left: 5%; margin-top: 10%; width: 90%; @@ -43,11 +35,11 @@ page { background: linear-gradient(to right, #39c4fd, #539eef); } -.custmer_list{ +.custmer_list { margin-top: 20rpx; } -.custmer_list_view{ +.custmer_list_view { display: flex; flex-direction: column; padding-left: 5%; @@ -55,7 +47,7 @@ page { background: white; } -.itemview_h{ +.itemview_h { display: flex; flex-direction: row; justify-content: space-between; @@ -64,20 +56,21 @@ page { padding-bottom: 10rpx; } -.text_name{ +.text_name { font-size: 28rpx; color: rgb(136, 136, 136); } -.text_id{ +.text_id { font-size: 32rpx; color: rgb(48, 48, 48); } -.view_line_main{ - background: white +.view_line_main { + background: white; } -.view_line{ + +.view_line { width: 92%; height: 2rpx; margin-left: 4%; @@ -99,14 +92,11 @@ page { font-size: 30rpx; } -.tips{ +.tips { font-size: 26rpx; padding-top: 10rpx; } - - - .hide { display: none; } @@ -115,10 +105,6 @@ page { display: flex; } - - - - .drawer_screen { width: 100%; height: 100%; @@ -143,7 +129,6 @@ page { border-radius: 3px; } - .top { height: 20%; justify-content: center; @@ -164,7 +149,6 @@ page { overflow-y: scroll; /*超出父盒子高度可滚动*/ } - .btn_ok { padding: 10px; font: 20px "microsoft yahei"; @@ -173,7 +157,6 @@ page { color: #3cc51f; } - .grid1 { width: 100%; border-bottom: 1px solid #c3c3c3; @@ -184,4 +167,4 @@ page { .text3 { font-size: 18px; color: rgb(48, 48, 48); -} \ No newline at end of file +} diff --git a/pages/guarantee/newbill/newbill.js b/pages/guarantee/newbill/newbill.js index 7294fdb..c322bb7 100644 --- a/pages/guarantee/newbill/newbill.js +++ b/pages/guarantee/newbill/newbill.js @@ -58,13 +58,13 @@ function GetDepartment(that, inputValue) { }) } -function GetCustomerAccountingUnitBalance(that,accoutUnitId, customerId) { +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 + requestMoney: res.result, + guaranteeMoney: res.result + that.data.allBillMoney }) }) } @@ -91,9 +91,10 @@ Page({ paydate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), guaranteeMoney: '', - requestMoney:0, - allBillMoney:0, - array: [] + requestMoney: 0, + allBillMoney: 0, + array: [], + winHeight: 0 }, /** @@ -110,6 +111,16 @@ Page({ Name: app.globalData.Department_Name }], }) + var that = this + wx.getSystemInfo({ + + success: function(res) { + that.setData({ + winHeight: res.windowHeight + }); + } + + }); }, /** @@ -118,25 +129,50 @@ Page({ onReady: 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.billInfo + array: oldData }) - let billMoney=0; - if(this.data.array!=null || this.data.array!=""){ - for(var i =0;i - - 结账客户 - {{accountcustomer[accountcustomerIndex].Name}} - + + + 结账客户 + {{accountcustomer[accountcustomerIndex].Name}} + - - 会计单位 - {{accountUnit[accountUnitIndex].Name}} - + + 会计单位 + {{accountUnit[accountUnitIndex].Name}} + - - 部门 - {{department[departmentIndex].Name}} - + + 部门 + {{department[departmentIndex].Name}} + - - 担保日期 - - - {{guaranteedate}} - - - + + 担保日期 + + + {{guaranteedate}} + + + - - 承诺回款日期 - - - {{paydate}} - - - + + 承诺回款日期 + + + {{paydate}} + + + - - 担保金额 - {{guaranteeMoney}} - + + 担保金额 + {{guaranteeMoney}} + - - - 担保明细{{idx+1}} - - - {{item.BillTypeName}}No.{{item.ID}} - 金额:{{item.Money}} + + + 担保明细{{idx+1}} + + + {{item.DmoTypeIDName}}No.{{item.BillID}} + 金额:{{item.Value}} + + + {{item.Customer_Name}} + 日期:{{item.Date}} + - - {{item.Customer_Name}} - 日期:{{item.Date}} + + + 删除 + - - - - 删除 - - - - + + - - - - - - - - - - - - - {{item.Name}} - - + + + + + + + + + + + + + {{item.Name}} + + + + 取消 - 取消 - \ No newline at end of file + \ No newline at end of file diff --git a/pages/guarantee/newbill/newbill.wxss b/pages/guarantee/newbill/newbill.wxss index a28ab0b..774ccf1 100644 --- a/pages/guarantee/newbill/newbill.wxss +++ b/pages/guarantee/newbill/newbill.wxss @@ -26,8 +26,12 @@ page { } .submit { - margin-top: 50rpx; - margin-bottom: 30rpx; + margin-left: 5%; + margin-top: 10%; + width: 90%; + margin-right: 5%; + color: #fff; + background: linear-gradient(to right, #39c4fd, #539eef); } .custmer_list{ diff --git a/pages/guarantee/selectbill/selectbill.js b/pages/guarantee/selectbill/selectbill.js index 3392d8f..e68d916 100644 --- a/pages/guarantee/selectbill/selectbill.js +++ b/pages/guarantee/selectbill/selectbill.js @@ -11,13 +11,13 @@ function getBillForDetail777(that,id){ let array=[]; for(var i=0;i - + - No.{{item.ID}} - 金额:{{item.Money}} + No.{{item.BillID}} + 金额:{{item.Value}} {{item.Customer_Name}} @@ -39,11 +39,11 @@ - + - No.{{item.ID}} - 金额:{{item.Money}} + No.{{item.BillID}} + 金额:{{item.Value}} {{item.Customer_Name}} @@ -65,11 +65,11 @@ - + - No.{{item.ID}} - 金额:{{item.Money}} + No.{{item.BillID}} + 金额:{{item.Value}} {{item.Customer_Name}} diff --git a/pages/order/order.js b/pages/order/order.js index 63605da..2c0e535 100644 --- a/pages/order/order.js +++ b/pages/order/order.js @@ -3,7 +3,7 @@ var app = getApp(); var network = require("../../utils/net.js") var timechage = require("../../utils/dateTimeUtil.js") var PageIndex = 0 -var PageSize = 8 +var PageSize = 10 var getListPath = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/OrderRpc/GetList' function getList(that, PageIndex, PageSize) { @@ -58,14 +58,20 @@ Page({ */ data: { array: [], - arry: [] + arry: [], + scrollTop: 0, + scrollHeight: 0, + winHeight: 0 }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { - + var that = this; + PageIndex = 0 + PageSize = 10 + getList(that, PageIndex, PageSize) }, /** @@ -80,9 +86,13 @@ Page({ */ onShow: function() { var that = this; - PageIndex = 0 - PageSize = 8 - getList(that, PageIndex, PageSize) + wx.getSystemInfo({ + success: function (res) { + that.setData({ + winHeight: res.windowHeight + }); + } + }); }, /** @@ -112,19 +122,22 @@ Page({ * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { - console.log('00000-----------') + + }, + onReachBottom: function() { + + }, + refesh: function() { + console.log('00000-----------') var that = this; PageIndex = 0; PageSize = 10; getList(that, PageIndex, PageSize) wx.stopPullDownRefresh() //停止下拉刷新 }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function() { - console.log('baseUrl-----------') + //未审核订单滑动到底部加载 + scrollLower: function(event) { + console.log('111111-----------') var that = this; PageIndex = PageIndex + 1; PageSize = 10; @@ -146,6 +159,7 @@ Page({ setColor(that) }) }, + itemclick: function(e) { wx.navigateTo({ url: 'detail/detail?ID=' + e.currentTarget.dataset.data.ID, @@ -160,5 +174,11 @@ Page({ wx.navigateTo({ url: 'query/query', }) - } + }, + // 该方法绑定了页面滚动时的事件 + scroll: function(event) { + this.setData({ + scrollTop: event.detail.scrollTop + }); + }, }) \ No newline at end of file diff --git a/pages/order/order.json b/pages/order/order.json index 5bdde25..60cae6f 100644 --- a/pages/order/order.json +++ b/pages/order/order.json @@ -1,4 +1,5 @@ { "navigationBarTitleText": "订单列表", - "enablePullDownRefresh": true + "enablePullDownRefresh": true, + "onReachBottomDistance": 50 } \ No newline at end of file diff --git a/pages/order/order.wxml b/pages/order/order.wxml index 17dae6d..708e75b 100644 --- a/pages/order/order.wxml +++ b/pages/order/order.wxml @@ -1,5 +1,5 @@ - + @@ -15,6 +15,7 @@ - + + - \ No newline at end of file + \ No newline at end of file diff --git a/pages/order/order.wxss b/pages/order/order.wxss index 89f5a2b..f18cec6 100644 --- a/pages/order/order.wxss +++ b/pages/order/order.wxss @@ -1,7 +1,16 @@ /* pages/order/order.wxss */ page{ - background: rgb(240, 239, 245) + background: rgb(240, 239, 245); + height: 100%; } + + +.scroll-views { + width: 100%; + display: flex; + flex-direction: column; +} + .custmer_list{ margin-bottom: 10%; }