|
@@ -14,15 +14,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { log } from '@antv/g2plot/lib/utils';
|
|
|
export default {
|
|
|
props: ['data'],
|
|
|
data () {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
deplist:[],
|
|
|
- result:'',
|
|
|
- selectArr:[]
|
|
|
+ result:[],
|
|
|
+ selectArr:[],
|
|
|
+ brandids:[]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
itemclassnum: node['itemclassnum'],
|
|
|
children: []
|
|
|
}
|
|
|
- if(elNode.sa_brandid) elNode.disabled = true
|
|
|
+ // if(elNode.sa_brandid) elNode.disabled = true
|
|
|
if (node.subdep && node.subdep.length > 0) {
|
|
|
// 如果存在子节点
|
|
|
for (var index = 0; index < node.subdep.length; index++) {
|
|
@@ -96,15 +96,13 @@ export default {
|
|
|
return arr
|
|
|
},
|
|
|
async submit() {
|
|
|
- console.log(this.selectArr.length)
|
|
|
- console.log(this.sys_enterpriseid)
|
|
|
- console.log(this.data)
|
|
|
if(this.selectArr.length == 0) return
|
|
|
let res = await this.$api.requested({
|
|
|
"id": 20220924134302,
|
|
|
"content": {
|
|
|
"sys_enterpriseid": this.data.sys_enterpriseid, //企业id
|
|
|
- "itemclassid":this.result
|
|
|
+ "itemclassid":this.result,
|
|
|
+ "sa_brandids":this.brandids
|
|
|
},
|
|
|
})
|
|
|
console.log(res);
|
|
@@ -115,16 +113,22 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
change(data) {
|
|
|
- let temp = JSON.parse(JSON.stringify(data))
|
|
|
- temp.forEach(item => {
|
|
|
- item.shift()
|
|
|
- })
|
|
|
- let temp2 = []
|
|
|
- temp.forEach(item => {
|
|
|
- temp2.push(...item)
|
|
|
- })
|
|
|
- temp2 = [...new Set(temp2)]
|
|
|
- this.result = temp2
|
|
|
+ let node = this.$refs['select'].getCheckedNodes()
|
|
|
+ this.brandids = node.filter(e=>{
|
|
|
+ if (!e.parent) {
|
|
|
+ return e
|
|
|
+ }
|
|
|
+ }).map(e=>{
|
|
|
+ return e.data.sa_brandid
|
|
|
+ })
|
|
|
+
|
|
|
+ this.result = node.filter(e=>{
|
|
|
+ if (e.parent) {
|
|
|
+ return e
|
|
|
+ }
|
|
|
+ }).map(e=>{
|
|
|
+ return e.data.itemclassid
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|