| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- 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);
- },
- // {"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
- })
- })
- },
- onReady() {
- this.selectComponent("#ListBox").setHeight(".top", this);
- },
- startSearch({
- detail
- }) {
- if (detail == this.data.content.where.condition) return;
- this.data.content.where.condition = detail;
- this.getList(true);
- },
- /* 取消搜索 */
- onClear() {
- this.data.content.where.condition = "";
- this.getList(true);
- },
- openFiltrate() {
- this.setData({
- filtrate: true
- })
- },
- /* 处理筛选 */
- 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)
- },
- })
|