|
@@ -38,6 +38,7 @@ export default {
|
|
|
selectThis:() => this
|
|
|
}
|
|
|
},
|
|
|
+ inject:['sys_enterpriseid'],
|
|
|
props: {
|
|
|
default: {
|
|
|
type: Boolean,
|
|
@@ -54,32 +55,47 @@ export default {
|
|
|
"content": {
|
|
|
"pageNumber": 1,
|
|
|
"pageSize": 20,
|
|
|
+ "sys_enterpriseid":this.sys_enterpriseid(),
|
|
|
"where": {
|
|
|
"condition": ""
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
this.fields = res1.data
|
|
|
- this.field_act = res1.data[0].sys_enterprise_tradefieldid
|
|
|
+ if (this.fields.length) {
|
|
|
+ this.field_act = res1.data[0].sys_enterprise_tradefieldid
|
|
|
+ } else {
|
|
|
+ this.field_act = 0
|
|
|
+ }
|
|
|
},
|
|
|
async queryBrands () {
|
|
|
- const res = await this.$api.requested({
|
|
|
- "id": "20220924163702",
|
|
|
- "content": {
|
|
|
- "pageSize":1000,
|
|
|
- "where":{
|
|
|
- "condition":""
|
|
|
+ return new Promise(async (re,rej) => {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20220924163702",
|
|
|
+ "content": {
|
|
|
+ "pageSize":1000,
|
|
|
+ "sys_enterpriseid":this.sys_enterpriseid(),
|
|
|
+ "where":{
|
|
|
+ "condition":""
|
|
|
+ }
|
|
|
}
|
|
|
+ })
|
|
|
+ this.brands = res.data
|
|
|
+ if (this.brands.length) {
|
|
|
+ this.brand_act = res.data[0].sa_brandid
|
|
|
+ this.clickBrand(res.data[0].sa_brandid)
|
|
|
+ } else {
|
|
|
+ this.brand_act = 0
|
|
|
+ this.clickBrand(this.brand_act)
|
|
|
}
|
|
|
+ re()
|
|
|
})
|
|
|
- this.brands = res.data
|
|
|
- this.brand_act = res.data[0].sa_brandid
|
|
|
- this.clickBrand(res.data[0].sa_brandid)
|
|
|
+
|
|
|
},
|
|
|
|
|
|
async queryClass () {
|
|
|
const res = await this.$api.requested({
|
|
|
- "id":"20220922110403","content":{"sa_brandid":this.brand_act,where:{istool:0}}
|
|
|
+ "id":"20220922110403","content":{"sa_brandid":this.brand_act,"sys_enterpriseid":this.sys_enterpriseid(),where:{istool:0}}
|
|
|
})
|
|
|
console.log(res.data,'pop')
|
|
|
this.itemclass = res.data[0].ttemclass
|
|
@@ -87,6 +103,7 @@ export default {
|
|
|
clickBrand (id) {
|
|
|
this.brand_act = id ? id : 0
|
|
|
this.queryClass()
|
|
|
+ this.$emit('brandChange',[this.brand_act])
|
|
|
},
|
|
|
clickField (item) {
|
|
|
this.field_act = item ? item.sys_enterprise_tradefieldid : ''
|
|
@@ -102,12 +119,9 @@ export default {
|
|
|
this.$refs.tree.class_act = 0
|
|
|
this.$emit('onClassChange',item)
|
|
|
}
|
|
|
- console.log('分类单机出发');
|
|
|
-
|
|
|
|
|
|
},
|
|
|
change(n) {
|
|
|
- console.log('分类单机出发2');
|
|
|
this.$emit('onClassChange',n)
|
|
|
},
|
|
|
clearSearch() {
|