|
@@ -1,5 +1,5 @@
|
|
const _Http = getApp().globalData.http;
|
|
const _Http = getApp().globalData.http;
|
|
-
|
|
|
|
|
|
+let sys_enterpriseid = null;
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
istool: 0, //0商品 1工具
|
|
istool: 0, //0商品 1工具
|
|
@@ -36,6 +36,21 @@ Page({
|
|
this.getTradefie();
|
|
this.getTradefie();
|
|
this.getOptionTypeSelect();
|
|
this.getOptionTypeSelect();
|
|
},
|
|
},
|
|
|
|
+ /* 业务员选择角色 */
|
|
|
|
+ selsectedRole(e) {
|
|
|
|
+ wx.navigateTo({
|
|
|
|
+ url: './selected/index',
|
|
|
|
+ })
|
|
|
|
+ getApp().globalData.handleSelect = this.handleRole.bind(this);
|
|
|
|
+ },
|
|
|
|
+ handleRole(e) {
|
|
|
|
+ this.setData({
|
|
|
|
+ buttonText: e.enterprisename
|
|
|
|
+ });
|
|
|
|
+ sys_enterpriseid = e.sys_enterpriseid;
|
|
|
|
+ this.getBrand();
|
|
|
|
+ wx.navigateBack();
|
|
|
|
+ },
|
|
/* 获取系统分类 */
|
|
/* 获取系统分类 */
|
|
getOptionTypeSelect() {
|
|
getOptionTypeSelect() {
|
|
_Http.basic({
|
|
_Http.basic({
|
|
@@ -122,18 +137,36 @@ Page({
|
|
},
|
|
},
|
|
/* 获取品牌 */
|
|
/* 获取品牌 */
|
|
getBrand() {
|
|
getBrand() {
|
|
|
|
+ let content = {
|
|
|
|
+ "pageSize": 999,
|
|
|
|
+ };
|
|
|
|
+ if (sys_enterpriseid) content.sys_enterpriseid = sys_enterpriseid;
|
|
_Http.basic({
|
|
_Http.basic({
|
|
"id": 20220924163702,
|
|
"id": 20220924163702,
|
|
- "content": {
|
|
|
|
- "pageSize": 999,
|
|
|
|
- }
|
|
|
|
|
|
+ content
|
|
}).then(res => {
|
|
}).then(res => {
|
|
console.log("查询品牌", res)
|
|
console.log("查询品牌", res)
|
|
- if (res.data.length) this.setData({
|
|
|
|
- brandList: res.data,
|
|
|
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
|
+ title: res.msg,
|
|
|
|
+ icon: "none"
|
|
});
|
|
});
|
|
- this.data.brand = res.data[0];
|
|
|
|
- this.getTypeList();
|
|
|
|
|
|
+ if (res.data.length != 0) {
|
|
|
|
+ this.setData({
|
|
|
|
+ brandList: res.data,
|
|
|
|
+ });
|
|
|
|
+ this.data.brand = res.data[0];
|
|
|
|
+ this.getTypeList();
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '未查询到授权品牌',
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ this.setData({
|
|
|
|
+ brandList: [],
|
|
|
|
+ list: [],
|
|
|
|
+ typeList: []
|
|
|
|
+ })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
/* 切换品牌 */
|
|
/* 切换品牌 */
|
|
@@ -143,15 +176,17 @@ Page({
|
|
},
|
|
},
|
|
/* 获取分类 */
|
|
/* 获取分类 */
|
|
getTypeList() {
|
|
getTypeList() {
|
|
|
|
+ let content = {
|
|
|
|
+ sa_brandid: this.data.brand.sa_brandid,
|
|
|
|
+ where: {
|
|
|
|
+ istool: 0, //默认0,不是工具,1表示工具
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (sys_enterpriseid) content.sys_enterpriseid = sys_enterpriseid;
|
|
_Http.basic({
|
|
_Http.basic({
|
|
"id": "20220922110403",
|
|
"id": "20220922110403",
|
|
"pageSize": 1000,
|
|
"pageSize": 1000,
|
|
- "content": {
|
|
|
|
- "sa_brandid": this.data.brand.sa_brandid,
|
|
|
|
- where: {
|
|
|
|
- "istool": 0, //默认0,不是工具,1表示工具
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ content
|
|
}).then(res => {
|
|
}).then(res => {
|
|
console.log("营销类别", res)
|
|
console.log("营销类别", res)
|
|
|
|
|
|
@@ -183,6 +218,7 @@ Page({
|
|
content.brandids = [this.data.brand.sa_brandid];
|
|
content.brandids = [this.data.brand.sa_brandid];
|
|
content.where.itemclassid = this.data.cType.itemclassid;
|
|
content.where.itemclassid = this.data.cType.itemclassid;
|
|
content.where.tradefield = this.data.tradefieid;
|
|
content.where.tradefield = this.data.tradefieid;
|
|
|
|
+ if (sys_enterpriseid) content.sys_enterpriseid = sys_enterpriseid;
|
|
_Http.basic({
|
|
_Http.basic({
|
|
"id": 20220926142203,
|
|
"id": 20220926142203,
|
|
content
|
|
content
|