|
@@ -11,7 +11,8 @@ Page({
|
|
|
result: [], //返回结果
|
|
|
radio: false, //是否为单选
|
|
|
idname: "sa_accountclassid", //idkey
|
|
|
- showName: "accountname"
|
|
|
+ showName: "accountname",
|
|
|
+ subvalues: []
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
if (options.params) {
|
|
@@ -24,12 +25,48 @@ Page({
|
|
|
params
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
this.setData({
|
|
|
radio: options.radio ? true : false,
|
|
|
idname: options.idname || this.data.idname,
|
|
|
showName: options.showName || this.data.showName,
|
|
|
});
|
|
|
- this.getList()
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ if (options.tradefield) {
|
|
|
+ let domainrelatedaccounts = wx.getStorageSync('domainrelatedaccounts');
|
|
|
+ if (domainrelatedaccounts.length) {
|
|
|
+ query()
|
|
|
+ } else {
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "sysmanage.develop.optiontype.optiontype",
|
|
|
+ "method": "optiontypeselect",
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 9999,
|
|
|
+ "typename": "domainrelatedaccounts"
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("查询领域对应列表", res)
|
|
|
+ if (res.msg == '成功' && res.data.length) {
|
|
|
+ domainrelatedaccounts = res.data;
|
|
|
+ wx.setStorageSync('domainrelatedaccounts', domainrelatedaccounts)
|
|
|
+ query()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function query() {
|
|
|
+ let item = domainrelatedaccounts.find(v => v.value == options.tradefield);
|
|
|
+ that.setData({
|
|
|
+ subvalues: item ? item.subvalues : []
|
|
|
+ })
|
|
|
+ that.getList()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.getList()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
getList(init = false) {
|
|
|
//init 用于初始化分页
|
|
@@ -37,7 +74,8 @@ Page({
|
|
|
let params = this.data.params;
|
|
|
if (init) params.content.pageNumber = 1
|
|
|
if (params.content.pageNumber > params.content.pageTotal) return;
|
|
|
-
|
|
|
+ let subvalues = this.data.subvalues;
|
|
|
+ if (subvalues.length) params.pageSize = 9999
|
|
|
_Http.basic(params).then(res => {
|
|
|
console.log("选择账户列表", res)
|
|
|
this.selectComponent('#ListBox').RefreshToComplete();
|
|
@@ -45,6 +83,7 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
+ if (subvalues.length) res.data = res.data.filter(v => subvalues.includes(v.sa_accountclassid + ""))
|
|
|
res.data = res.data.map(v => {
|
|
|
v.balance = CNY(v.balance)
|
|
|
v.creditquota = CNY(v.creditquota)
|