|
@@ -9,6 +9,7 @@ Page({
|
|
|
loading: false,
|
|
|
sa_brandid: null,
|
|
|
tradefield: null,
|
|
|
+ sa_accountclassid: 0,
|
|
|
brandList: [],
|
|
|
domainList: [],
|
|
|
type: "标准订单",
|
|
@@ -18,6 +19,7 @@ Page({
|
|
|
this.setData({
|
|
|
type: e.currentTarget.dataset.name
|
|
|
})
|
|
|
+ this.getAccList();
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.getOrderList()
|
|
@@ -30,7 +32,35 @@ Page({
|
|
|
if (this.data.userrole == '经销商') {
|
|
|
this.getBrand();
|
|
|
this.getDomain();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ let domainrelatedaccounts = wx.getStorageSync('domainrelatedaccounts');
|
|
|
+ if (domainrelatedaccounts.length) {
|
|
|
+ this.setData({
|
|
|
+ domainrelatedaccounts
|
|
|
+ })
|
|
|
+ } 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)
|
|
|
+ this.setData({
|
|
|
+ domainrelatedaccounts
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+ console.log(domainrelatedaccounts)
|
|
|
},
|
|
|
/* 获取品牌 */
|
|
|
getBrand(id) {
|
|
@@ -104,6 +134,7 @@ Page({
|
|
|
tradefield: res.data[0].tradefield,
|
|
|
skeletonShow: false
|
|
|
});
|
|
|
+ this.getAccList();
|
|
|
})
|
|
|
},
|
|
|
/* 选择领域 */
|
|
@@ -115,6 +146,46 @@ Page({
|
|
|
this.setData({
|
|
|
tradefield: item.tradefield
|
|
|
})
|
|
|
+ this.getAccList();
|
|
|
+ },
|
|
|
+ onSelectAcc(e) {
|
|
|
+ let {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ console.log(item)
|
|
|
+ this.setData({
|
|
|
+ sa_accountclassid: item.sa_accountclassid
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAccList() {
|
|
|
+ this.setData({
|
|
|
+ optionalAccount: [],
|
|
|
+ sa_accountclassid: 0
|
|
|
+ })
|
|
|
+ if (['标准订单', '特殊订单'].includes(this.data.type || '标准订单')) {
|
|
|
+ let tradefield = this.data.domainrelatedaccounts.find(v => v.value == this.data.tradefield);
|
|
|
+ if (tradefield) _Http.basic({
|
|
|
+ "id": 20221008134803,
|
|
|
+ "version": 1,
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageTotal": 1,
|
|
|
+ "pageSize": 9999,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "isused": 1,
|
|
|
+ "isnotspecialfund": this.data.type == '标准订单' ? 0 : 1, //是否专用
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("账户列表", res)
|
|
|
+ let list = res.data.filter(v => tradefield.subvalues.some(s => s == v.sa_accountclassid))
|
|
|
+ if (res.msg == '成功') this.setData({
|
|
|
+ optionalAccount: list,
|
|
|
+ sa_accountclassid: list.length ? list[0].sa_accountclassid : 0
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
submit() {
|
|
|
if (this.data.userrole == '业务员' && !this.data.agency.sys_enterpriseid) {
|
|
@@ -144,7 +215,8 @@ Page({
|
|
|
"sa_brandid": this.data.sa_brandid, //品牌ID
|
|
|
"type": this.data.type, //订单类型
|
|
|
"tradefield": this.data.tradefield, //必选
|
|
|
- sys_enterpriseid: this.data.agency.sys_enterpriseid
|
|
|
+ sys_enterpriseid: this.data.agency.sys_enterpriseid,
|
|
|
+ sa_accountclassid: this.data.sa_accountclassid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
this.setData({
|