|
@@ -1,66 +1,102 @@
|
|
|
-// packageA/deliveryConfirmation/index.js
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
Page({
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
data: {
|
|
|
-
|
|
|
+ list: [],
|
|
|
+ filtrate: false,
|
|
|
+ "content": {
|
|
|
+ "nocache": true,
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 20,
|
|
|
+ "pageTotal": 1,
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+ },
|
|
|
+ filtratelist: [{
|
|
|
+ label: "红蓝字",
|
|
|
+ index: null,
|
|
|
+ showName: "name", //显示字段
|
|
|
+ valueKey: "rb", //返回Key
|
|
|
+ selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: [{
|
|
|
+ name: "红字",
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ name: "蓝字",
|
|
|
+ value: 1
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
+ label: "是否收货",
|
|
|
+ index: null,
|
|
|
+ showName: "name", //显示字段
|
|
|
+ valueKey: "isreceiver", //返回Key
|
|
|
+ selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
|
|
|
+ value: "", //选中值
|
|
|
+ list: [{
|
|
|
+ name: "未收货",
|
|
|
+ value: 0
|
|
|
+ }, {
|
|
|
+ name: "已收货",
|
|
|
+ value: 1
|
|
|
+ }]
|
|
|
+ }]
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
- */
|
|
|
- onReady() {
|
|
|
-
|
|
|
+ // {"id":20230719154303,"content":{"st_stockbillid":"1","pageNumber":1,"pageSize":20,"where":{"condition":""}},"accesstoken":"cc80c07dec16ecad16b9e71eac20b05d","systemappid":372}
|
|
|
+ getList(init = false) {
|
|
|
+ if (init.detail != undefined) init = init.detail;
|
|
|
+ let content = this.data.content;
|
|
|
+ if (init) content.pageNumber = 1;
|
|
|
+ if (content.pageNumber > content.pageTotal) return;
|
|
|
+ _Http.basic({
|
|
|
+ id: 2025061311114103,
|
|
|
+ content: content
|
|
|
+ }).then(res => {
|
|
|
+ console.log("到货列表", res)
|
|
|
+ this.selectComponent('#ListBox').RefreshToComplete();
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ total: res.total,
|
|
|
+ list: (res.pageNumber == 1) ? res.data : this.data.list.concat(res.data),
|
|
|
+ 'content.pageNumber': res.pageNumber + 1,
|
|
|
+ 'content.pageTotal': res.pageTotal
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
- */
|
|
|
- onShow() {
|
|
|
-
|
|
|
+ onReady() {
|
|
|
+ this.selectComponent("#ListBox").setHeight(".top", this);
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
- */
|
|
|
- onHide() {
|
|
|
-
|
|
|
+ startSearch({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ if (detail == this.data.content.where.condition) return;
|
|
|
+ this.data.content.where.condition = detail;
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
- */
|
|
|
- onUnload() {
|
|
|
-
|
|
|
+ /* 取消搜索 */
|
|
|
+ onClear() {
|
|
|
+ this.data.content.where.condition = "";
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
- */
|
|
|
- onPullDownRefresh() {
|
|
|
-
|
|
|
+ openFiltrate() {
|
|
|
+ this.setData({
|
|
|
+ filtrate: true
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 页面上拉触底事件的处理函数
|
|
|
- */
|
|
|
- onReachBottom() {
|
|
|
-
|
|
|
+ /* 处理筛选 */
|
|
|
+ handleFilter(e) {
|
|
|
+ e.detail.condition = this.data.content.where.condition;
|
|
|
+ e.detail.begindate = e.detail.startdate
|
|
|
+ this.setData({
|
|
|
+ "content.where": e.detail
|
|
|
+ })
|
|
|
+ console.log("this.data.content", this.data.content)
|
|
|
+ this.getList(true)
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户点击右上角分享
|
|
|
- */
|
|
|
- onShareAppMessage() {
|
|
|
-
|
|
|
- }
|
|
|
})
|