|
|
@ -194,6 +194,7 @@ export default { |
|
|
|
typeUnit: 20, |
|
|
|
typeUnit: 20, |
|
|
|
typeScrollTop: 0, |
|
|
|
typeScrollTop: 0, |
|
|
|
typeTimer: null, |
|
|
|
typeTimer: null, |
|
|
|
|
|
|
|
tableId: [], |
|
|
|
|
|
|
|
|
|
|
|
configVisible: false, |
|
|
|
configVisible: false, |
|
|
|
configChecked: [], |
|
|
|
configChecked: [], |
|
|
@ -266,11 +267,12 @@ export default { |
|
|
|
n.id = String(n.id) |
|
|
|
n.id = String(n.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(isConcat){ |
|
|
|
if(isConcat){ |
|
|
|
n.typePage++ |
|
|
|
|
|
|
|
n.children = n.children.concat(list) |
|
|
|
n.children = n.children.concat(list) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
n.children = list |
|
|
|
n.children = list |
|
|
|
|
|
|
|
n.tableLen = res.pageList.total |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
n.typePage++ |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
getType(){ |
|
|
|
getType(){ |
|
|
@ -458,45 +460,70 @@ export default { |
|
|
|
this.productName = '' |
|
|
|
this.productName = '' |
|
|
|
this.market = '' |
|
|
|
this.market = '' |
|
|
|
this.isDetail = false |
|
|
|
this.isDetail = false |
|
|
|
this.typeIndex = 1000 |
|
|
|
this.typeIndex = 100000 |
|
|
|
this.typeList = [] |
|
|
|
this.typeList = [] |
|
|
|
|
|
|
|
this.tableId = [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getIds(){ |
|
|
|
|
|
|
|
let list = this.$refs.type.getCheckedNodes() |
|
|
|
|
|
|
|
return new Promise((resolve,reject) => { |
|
|
|
|
|
|
|
let getLen = 0 |
|
|
|
|
|
|
|
list.map(n => { |
|
|
|
|
|
|
|
if(n.tableLen && n.tableLen > n.children.length) getLen++ |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
list.map((n,i) => { |
|
|
|
|
|
|
|
if(n.tableLen && n.tableLen > n.children.length){ |
|
|
|
|
|
|
|
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => { |
|
|
|
|
|
|
|
let tableList = res.pageList.records |
|
|
|
|
|
|
|
tableList.map(n => { |
|
|
|
|
|
|
|
this.tableId.push(String(n.id)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
getLen-- |
|
|
|
|
|
|
|
if(!getLen) resolve() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}else if(n.name && !this.tableId.includes(n.id)){ |
|
|
|
|
|
|
|
this.tableId.push(n.id) |
|
|
|
|
|
|
|
if(!getLen) resolve() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
confirm(){ |
|
|
|
confirm(){ |
|
|
|
if(!this.productName) return this.$message.warning('请输入数据产品名称') |
|
|
|
if(!this.productName) return this.$message.warning('请输入数据产品名称') |
|
|
|
if(!this.market) return this.$message.warning('请输入市场价格') |
|
|
|
if(!this.market) return this.$message.warning('请输入市场价格') |
|
|
|
if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字') |
|
|
|
if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字') |
|
|
|
let list = this.$refs.type.getCheckedNodes() |
|
|
|
if(!this.$refs.type.getCheckedNodes().length) return this.$message.warning('请选择数据') |
|
|
|
let tableId = [] |
|
|
|
|
|
|
|
list.map(n => { |
|
|
|
this.getIds().then(() => { |
|
|
|
if(n.name) tableId.push(n.id) |
|
|
|
let tableId = Array.from(new Set(this.tableId)) |
|
|
|
|
|
|
|
if(!tableId.length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
id: this.id, |
|
|
|
|
|
|
|
productName: this.productName, |
|
|
|
|
|
|
|
market: this.market, |
|
|
|
|
|
|
|
tableId: tableId.join(), |
|
|
|
|
|
|
|
userId: this.userId, |
|
|
|
|
|
|
|
userName: this.userName, |
|
|
|
|
|
|
|
createTime: '', |
|
|
|
|
|
|
|
orderNum: '', |
|
|
|
|
|
|
|
status: '', |
|
|
|
|
|
|
|
tableNum: tableId.length, |
|
|
|
|
|
|
|
updateTime: '', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.id){ |
|
|
|
|
|
|
|
this.$post(this.api.updateProduct,data).then(res => { |
|
|
|
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
|
|
|
this.productVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.$post(this.api.saveProduct,data).then(res => { |
|
|
|
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
|
|
|
this.productVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(!tableId.length) return this.$message.warning('请选择数据') |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
id: this.id, |
|
|
|
|
|
|
|
productName: this.productName, |
|
|
|
|
|
|
|
market: this.market, |
|
|
|
|
|
|
|
tableId: tableId.join(), |
|
|
|
|
|
|
|
userId: this.userId, |
|
|
|
|
|
|
|
userName: this.userName, |
|
|
|
|
|
|
|
createTime: '', |
|
|
|
|
|
|
|
orderNum: '', |
|
|
|
|
|
|
|
status: '', |
|
|
|
|
|
|
|
tableNum: tableId.length, |
|
|
|
|
|
|
|
updateTime: '', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.id){ |
|
|
|
|
|
|
|
this.$post(this.api.updateProduct,data).then(res => { |
|
|
|
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
|
|
|
this.productVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.$post(this.api.saveProduct,data).then(res => { |
|
|
|
|
|
|
|
this.$message.success('新增成功') |
|
|
|
|
|
|
|
this.productVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
configData(){ |
|
|
|
configData(){ |
|
|
|