|
|
@@ -16,11 +16,24 @@ Page({
|
|
|
idname: "itemid", //idkey
|
|
|
showName: "itemname",
|
|
|
privacyFieldC: [],
|
|
|
- cardno: null
|
|
|
+ cardno: null,
|
|
|
+ showAll: false,
|
|
|
+ isInit: false
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
+ let tableid = 984;
|
|
|
+ try {
|
|
|
+ tableid = wx.getStorageSync('auth').wAccessoriesApplication.tables.productlist.tableid;
|
|
|
+ console.log("tableid", tableid)
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error)
|
|
|
+ }
|
|
|
+
|
|
|
if (options.params) {
|
|
|
let params = JSON.parse(options.params);
|
|
|
+ params.content.tableid = tableid;
|
|
|
+ params.content.where.tablefilter = {};
|
|
|
if (!params.content.pageNumber || !params.content.pageTotal) {
|
|
|
params.content.pageNumber = 1;
|
|
|
params.content.pageTotal = 1;
|
|
|
@@ -38,11 +51,13 @@ Page({
|
|
|
"content": {
|
|
|
"itemid": cardno.itemid,
|
|
|
"sa_orderid": _Http.sa_orderid,
|
|
|
+ tableid,
|
|
|
pageNumber: 1,
|
|
|
pageTotal: 1,
|
|
|
pageSize: 20,
|
|
|
where: {
|
|
|
condition: "",
|
|
|
+ tablefilter: {}
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
@@ -79,12 +94,14 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
- if (res.pageNumber == 1 && res.data.length == 0 && params.id == '2025080511204503') {
|
|
|
- this.setData({
|
|
|
- params: this.data.copyParams
|
|
|
- })
|
|
|
- this.getList(true)
|
|
|
- return;
|
|
|
+ if (!this.data.isInit) {
|
|
|
+ if (res.pageNumber == 1 && res.data.length == 0 && params.id == '2025080511204503') {
|
|
|
+ this.setData({
|
|
|
+ params: this.data.copyParams
|
|
|
+ })
|
|
|
+ this.getList(true)
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
const CNY = num => currency(num, {
|
|
|
symbol: "¥",
|
|
|
@@ -105,7 +122,7 @@ Page({
|
|
|
if (newPrice) value.newPrice = CNY(value[newPrice] || 0);
|
|
|
value.brandName = value.brand.map(name => name.brandname)
|
|
|
value.tradefields = value.tradefield.map(name => name.tradefield)
|
|
|
- value.qty = value.orderminqty || 1;
|
|
|
+ value.qty = value.orderminqty || value.qty || 1;
|
|
|
value.width = 0;
|
|
|
value.length = 0;
|
|
|
if (value.iscustomsize) value.customText = getCustomText(value);
|
|
|
@@ -116,7 +133,8 @@ Page({
|
|
|
'params.content.pageTotal': res.pageTotal,
|
|
|
'params.content.total': res.total,
|
|
|
list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ isInit: true
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -208,23 +226,32 @@ Page({
|
|
|
showmenu: true
|
|
|
})
|
|
|
},
|
|
|
- /* 开始搜索 */
|
|
|
- startSearch({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
|
|
|
- if (detail == condition) return;
|
|
|
+ changeShowAll() {
|
|
|
+ let that = this;
|
|
|
this.setData({
|
|
|
- 'content.where.condition': detail,
|
|
|
- 'params.content.where.condition': detail
|
|
|
- });
|
|
|
+ showAll: !this.data.showAll
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ that.selectComponent("#ListBox").setHeight(!this.data.showAll ? ".total1" : ".total", that);
|
|
|
+ }, 350)
|
|
|
+ },
|
|
|
+ onInput(e) {
|
|
|
+ let detail = e.detail,
|
|
|
+ name = e.currentTarget.dataset.name,
|
|
|
+ condition = this.data.params.content.where.tablefilter[name];
|
|
|
+ if (detail == condition) return;
|
|
|
+ this.data.params.content.where.tablefilter[name] = detail
|
|
|
+ },
|
|
|
+ /* 开始搜索 */
|
|
|
+ startSearch() {
|
|
|
this.getList(true);
|
|
|
},
|
|
|
/* 取消搜索 */
|
|
|
- onClear() {
|
|
|
+ onClear(e) {
|
|
|
+ let name = e.currentTarget.dataset.name;
|
|
|
+ this.data.params.content.where.tablefilter[name] = ''
|
|
|
this.setData({
|
|
|
- 'content.where.condition': "",
|
|
|
- 'params.content.where.condition': ""
|
|
|
+ params: this.data.params
|
|
|
});
|
|
|
this.getList(true);
|
|
|
},
|
|
|
@@ -266,9 +293,9 @@ Page({
|
|
|
} = e.currentTarget.dataset;
|
|
|
let item = this.data.list[index];
|
|
|
if (e.type == 'plus') {
|
|
|
- item.qty += (item.orderaddqty) - 0
|
|
|
+ item.qty += (item.orderaddqty || 1) - 0
|
|
|
} else {
|
|
|
- item.qty -= item.orderaddqty
|
|
|
+ item.qty -= item.orderaddqty || 1
|
|
|
}
|
|
|
this.setData({
|
|
|
[`list[${index}]`]: item
|