|
@@ -6,40 +6,47 @@ Page({
|
|
* 页面的初始数据
|
|
* 页面的初始数据
|
|
*/
|
|
*/
|
|
data: {
|
|
data: {
|
|
- param:{
|
|
|
|
|
|
+ param: {
|
|
"id": "20230206161703",
|
|
"id": "20230206161703",
|
|
- "version":1,
|
|
|
|
|
|
+ "version": 1,
|
|
"content": {
|
|
"content": {
|
|
- "pageSize":20,
|
|
|
|
- "pageNumber":1,
|
|
|
|
- "sa_serviceorderid":0,
|
|
|
|
- "sa_orderid":0,
|
|
|
|
- "where":{
|
|
|
|
- "condition":""
|
|
|
|
|
|
+ "pageSize": 20,
|
|
|
|
+ "pageNumber": 1,
|
|
|
|
+ "sa_serviceorderid": 0,
|
|
|
|
+ "isAll": 1, // 1-服务单产品,0-产品库
|
|
|
|
+ "sa_orderid": 0,
|
|
|
|
+ "where": {
|
|
|
|
+ "condition": ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- value:'',
|
|
|
|
- list:[],
|
|
|
|
- selection:[]
|
|
|
|
|
|
+ value: '',
|
|
|
|
+ list: [],
|
|
|
|
+ selection: []
|
|
},
|
|
},
|
|
- search (data) {
|
|
|
|
|
|
+ tabChange(e) {
|
|
|
|
+ this.data.param.content.isAll = e.detail.title == '产品库' ? '0' : '1';
|
|
|
|
+ this.data.param.content.pageNumber = 1;
|
|
|
|
+ this.listData()
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ search(data) {
|
|
this.data.param.content.where.condition = data.detail.value
|
|
this.data.param.content.where.condition = data.detail.value
|
|
this.data.list = []
|
|
this.data.list = []
|
|
this.data.param.content.pageNumber = 1
|
|
this.data.param.content.pageNumber = 1
|
|
-
|
|
|
|
this.listData()
|
|
this.listData()
|
|
},
|
|
},
|
|
- clear () {
|
|
|
|
|
|
+ clear() {
|
|
this.data.param.content.where.condition = ''
|
|
this.data.param.content.where.condition = ''
|
|
this.data.list = []
|
|
this.data.list = []
|
|
this.data.param.content.pageNumber = 1
|
|
this.data.param.content.pageNumber = 1
|
|
},
|
|
},
|
|
- async listData () {
|
|
|
|
|
|
+ async listData() {
|
|
const res = await api._post(this.data.param)
|
|
const res = await api._post(this.data.param)
|
|
|
|
+ console.log(res)
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
this.setData({
|
|
this.setData({
|
|
- list:this.data.list.concat(res.data)
|
|
|
|
|
|
+ list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
@@ -54,12 +61,12 @@ Page({
|
|
selection: event.detail.value,
|
|
selection: event.detail.value,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- refresh () {
|
|
|
|
|
|
+ refresh() {
|
|
this.setData({
|
|
this.setData({
|
|
- selection:[]
|
|
|
|
|
|
+ selection: []
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- onConfirm () {
|
|
|
|
|
|
+ onConfirm() {
|
|
let pages = getCurrentPages();
|
|
let pages = getCurrentPages();
|
|
let prePage = pages[pages.length - 2];
|
|
let prePage = pages[pages.length - 2];
|
|
prePage.getAdd(this.data.selection)
|
|
prePage.getAdd(this.data.selection)
|
|
@@ -71,39 +78,11 @@ Page({
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
let pages = getCurrentPages();
|
|
let pages = getCurrentPages();
|
|
let prePage = pages[pages.length - 2];
|
|
let prePage = pages[pages.length - 2];
|
|
- this.data.param.content.sa_serviceorderid = prePage.data.sa_serviceorderid
|
|
|
|
- this.data.param.content.sa_orderid = prePage.data.sa_orderid
|
|
|
|
|
|
+ this.data.param.content.sa_serviceorderid = prePage.data.sa_serviceorderid || prePage.data.billData.sa_serviceorderid
|
|
|
|
+ this.data.param.content.sa_orderid = prePage.data.sa_orderid || prePage.data.billData.sa_orderid
|
|
this.listData()
|
|
this.listData()
|
|
},
|
|
},
|
|
|
|
|
|
- /**
|
|
|
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
|
- */
|
|
|
|
- onReady() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 生命周期函数--监听页面显示
|
|
|
|
- */
|
|
|
|
- onShow() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 生命周期函数--监听页面隐藏
|
|
|
|
- */
|
|
|
|
- onHide() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 生命周期函数--监听页面卸载
|
|
|
|
- */
|
|
|
|
- onUnload() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
*/
|
|
@@ -117,14 +96,7 @@ Page({
|
|
* 页面上拉触底事件的处理函数
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
*/
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
- this.data.param.content.pageNumber ++
|
|
|
|
|
|
+ this.data.param.content.pageNumber++
|
|
this.listData()
|
|
this.listData()
|
|
},
|
|
},
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 用户点击右上角分享
|
|
|
|
- */
|
|
|
|
- onShareAppMessage() {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
})
|
|
})
|