|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
batchRemoveDetailAttribute, batchSaveDetailAttribute, |
|
|
|
batchUpdateDetailAttribute, |
|
|
|
queryQuoteDetailAttribute, |
|
|
|
queryQuoteDetailAttributeItem |
|
|
|
@ -131,8 +132,13 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
// 保存属性 |
|
|
|
// console.log(this.dataList) |
|
|
|
batchUpdateDetailAttribute(this.dataList).then(({data})=>{ |
|
|
|
let params = this.dataList.map(item => { |
|
|
|
return{ |
|
|
|
...item, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
}) |
|
|
|
batchUpdateDetailAttribute(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.handleQueryOther(); |
|
|
|
@ -182,6 +188,46 @@ export default { |
|
|
|
handleItemSelectionChange(val){ |
|
|
|
this.selectionList = val; |
|
|
|
}, |
|
|
|
handleAddAttribute(){ |
|
|
|
if (this.selectionList.length === 0){ |
|
|
|
this.$message.warning("请先选择属性"); |
|
|
|
return |
|
|
|
} |
|
|
|
let params = this.selectionList.map(item => { |
|
|
|
return{ |
|
|
|
...item, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
}) |
|
|
|
batchSaveDetailAttribute(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.handleQueryOther(); |
|
|
|
this.handleQueryAttributeItem(); |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleRemoveAttribute(){ |
|
|
|
if (this.selectionDataList.length === 0){ |
|
|
|
this.$message.warning("请先选择属性"); |
|
|
|
return |
|
|
|
} |
|
|
|
batchRemoveDetailAttribute(this.selectionDataList).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$message.success(data.msg); |
|
|
|
this.handleQueryOther(); |
|
|
|
this.handleQueryAttributeItem(); |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
if (this.quoteDetail && this.quoteDetail.id){ |
|
|
|
@ -289,10 +335,10 @@ export default { |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 10px;padding: 1px"> |
|
|
|
<div style="margin-top: 200px;margin-left: 18px"> |
|
|
|
<el-button type="primary" >添加>></el-button> |
|
|
|
<el-button type="primary" @click="handleAddAttribute">添加>></el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 15px;margin-left: 18px"> |
|
|
|
<el-button type="primary" >删除<<</el-button> |
|
|
|
<el-button type="primary" @click="handleRemoveAttribute">删除<<</el-button> |
|
|
|
</div> |
|
|
|
</el-main> |
|
|
|
<el-main style="width: 350px;padding: 1px"> |
|
|
|
|