diff --git a/app.json b/app.json index fdf791a..5a7b087 100644 --- a/app.json +++ b/app.json @@ -35,6 +35,7 @@ "pages/agent/focus-list/index", "pages/agent/order-detail/index", "pages/agent/appointment/index", + "pages/agent/select-list/index", "pages/agent/result/index", "pages/moment/index/index", "pages/moment/new-list/index", diff --git a/pages/agent/select-list/index.js b/pages/agent/select-list/index.js new file mode 100644 index 0000000..5c13dd2 --- /dev/null +++ b/pages/agent/select-list/index.js @@ -0,0 +1,65 @@ +// pages/process/order-list/index.js +import Scene from '../../index/scene' +import { getPeymentList } from "../../../api/saas" +const util = require('../../../utils/util') +const app = getApp() + +Scene({ + // * 页面的初始数据 + data: { + height: app.globalData.fragmentHeight, + loading: true, + requesting: false, + finished: false, + orderList: [], + form: { + pageNum: 1, + pageSize: 10 + }, + lastTime: null + }, + // * 生命周期函数--监听页面加载 + onLoad: function (options) { + this.setData({ height: app.globalData.fragmentHeight }) + this.fetchOrderList() + }, + onRefreshList: function (isame) { + if (this.data.requesting) { + return + } + this.setData({ orderList: [], ['form.pageNum']: 1, ['form.isSameCustomer']: isame == 1 ? 1 : 0, loading: true, finished: false }) + this.fetchOrderList() + }, + //1:待定价,2:待过皮重,3:待过磅审核,4:待付款,5:已完成 + fetchOrderList: function () { + if (this.data.requesting || this.data.finished) { + return + } + this.data.requesting = true + getPeymentList(this.data.form).then(result => { + if (result.data && result.data.records.length) { + var respList = result.data.records + let nowList = `orderList[${this.data.orderList.length}]` + var num = this.data.form.pageNum + var finished = ((num - 1) * this.data.form.pageSize + respList.length) >= result.data.total + this.setData({ [nowList]: respList, ['form.pageNum']: (num + 1), finished, requesting: false, loading: false }) + } else { + this.setData({ finished: true, requesting: false, loading: false }) + } + }).catch(err => { + this.setData({ requesting: false, loading: false }) + util.showToast(err) + }).finally(() => { + this.refresh = this.refresh || this.selectComponent('#refresh') + this.refresh.setRefresh(false) + }) + }, + lookItem: function (e) { + var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] + const channel = this.getOpenerEventChannel() + channel.emit('onCallback', { what: 62, detail: item }) + wx.navigateBack() + + } + +}) \ No newline at end of file diff --git a/pages/agent/select-list/index.json b/pages/agent/select-list/index.json new file mode 100644 index 0000000..a120622 --- /dev/null +++ b/pages/agent/select-list/index.json @@ -0,0 +1,10 @@ +{ + "usingComponents": { + "refresh-view": "/components/refresh-view/index", + "van-cell": "/components/cell/index", + "van-image": "/components/image/index", + "van-divider": "/components/divider/index", + "van-loading": "/components/loading/index", + "notification": "/pages/message/notification/index" + } +} \ No newline at end of file diff --git a/pages/agent/select-list/index.wxml b/pages/agent/select-list/index.wxml new file mode 100644 index 0000000..92bd043 --- /dev/null +++ b/pages/agent/select-list/index.wxml @@ -0,0 +1,33 @@ + + + + 选择代卖单 + + + + + + + + + {{loading? '正在加载' : '暂无数据'}} + + + + + + + {{item.name || ''}} + {{item.mobile || ('卡号:' + item.cardNo)}} + + + + + + + + {{finished?'到底啦~':'加载中...'}} + + + + \ No newline at end of file diff --git a/pages/agent/select-list/index.wxss b/pages/agent/select-list/index.wxss new file mode 100644 index 0000000..bc19567 --- /dev/null +++ b/pages/agent/select-list/index.wxss @@ -0,0 +1,7 @@ +/* pages/process/order-list/index.wxss */ +.item-content{ + padding: 20rpx 32rpx 20rpx 0rpx; + border-bottom:1rpx solid #f3f3f3; + margin-left:32rpx; + align-items: flex-start; +} \ No newline at end of file diff --git a/pages/login/index.js b/pages/login/index.js index 5e46729..27e6c38 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -128,7 +128,7 @@ Page({ }) return } - // headerFactoryId(app.userInfo.factoryId) + headerFactoryId(app.userInfo.factoryId) // wx.redirectTo({ url: '/pages/agent/result/index' }) wx.redirectTo({ url: '/pages/index/index' }) } else { diff --git a/pages/storage/order-create/index.js b/pages/storage/order-create/index.js index f95e867..a5a81ca 100644 --- a/pages/storage/order-create/index.js +++ b/pages/storage/order-create/index.js @@ -58,25 +58,26 @@ Scene({ }) } }, - chooseFactory: function(){ + chooseList: function(e){ + console.log(e.currentTarget.id == 'orderId') var that = this - wx.navigateTo({ - url: `/pages/home/factory-list/index?type=1`, - events: { - onCallback: (data) => { - if (data.what == 140) { - if(data.detail.paperMillId){ - that.data.form.deliveryChannelType = 2 - that.data.form.factoryDeliveryChannelId = data.detail.paperMillId - } else { - that.data.form.deliveryChannelType = 1 - that.data.form.factoryDeliveryChannelId = data.detail.id - } - that.setData({ ['form.factoryName']: data.detail.name }) - } - } - } - }) + // wx.navigateTo({ + // url: `/pages/home/factory-list/index?type=1`, + // events: { + // onCallback: (data) => { + // if (data.what == 140) { + // if(data.detail.paperMillId){ + // that.data.form.deliveryChannelType = 2 + // that.data.form.factoryDeliveryChannelId = data.detail.paperMillId + // } else { + // that.data.form.deliveryChannelType = 1 + // that.data.form.factoryDeliveryChannelId = data.detail.id + // } + // that.setData({ ['form.factoryName']: data.detail.name }) + // } + // } + // } + // }) }, showPlate: function (e) { this.keyboard = this.keyboard || this.selectComponent('#wux-keyboard') diff --git a/pages/storage/order-create/index.wxml b/pages/storage/order-create/index.wxml index 8f990c3..bc1980c 100644 --- a/pages/storage/order-create/index.wxml +++ b/pages/storage/order-create/index.wxml @@ -1,11 +1,22 @@ - 出货信息 + 出货订单 - + + 出货信息 + + + + + 关联代卖单 + + {{form.factoryName || '请选择代卖订单'}} + + + * @@ -14,7 +25,7 @@ {{form.factoryName || '请选择收货方'}} - + * @@ -30,7 +41,7 @@ placeholder="请输入纸品包数" value="{{form.packageQuantity || ''}}" bindinput="bindInput" /> - + *