sku规格删除时,对应的sku也需要删除

master
cl 5 years ago
parent b9ce7daab4
commit 18f8099e6d

@ -69,6 +69,10 @@ export default {
propName: '',
selectValues: []
},
type: 0,
tagItemName: '',
tagName: '',
tagNameIndex: 0,
tagItemInputs: [],
// sku
// tags: [],
@ -77,6 +81,8 @@ export default {
//
dbTagValues: [],
specs: [], // 使
maxValueId: 0, // id
maxPropId: 0, // id
initing: false
}
},
@ -87,6 +93,22 @@ export default {
params: this.$http.adornParams()
}).then(({data}) => {
this.dbTags = data
if (data) {
this.maxPropId = Math.max.apply(Math, data.map(item => { return item.propId }))
} else {
this.maxPropId = 0
}
})
this.$http({
url: this.$http.adornUrl(`/prod/spec/listSpecMaxValueId`),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
if (data) {
this.maxValueId = data
} else {
this.maxValueId = 0
}
})
},
props: {
@ -322,6 +344,9 @@ export default {
},
// --
handleTagClose (tagIndex, tagItemIndex) {
this.tagName = this.skuTags[tagIndex].tagName
this.tagNameIndex = tagIndex
this.tagItemName = this.skuTags[tagIndex].tagItems[tagItemIndex].propValue
if (this.skuTags[tagIndex].tagItems.length === 1) {
return
}

@ -123,4 +123,15 @@ public class SpecController {
prodPropService.deleteProdPropAndValues(id, ProdPropRule.SPEC.value(), SecurityUtils.getSysUser().getShopId());
return ResponseEntity.ok().build();
}
/**
* id
*/
@GetMapping("/listSpecMaxValueId")
public ResponseEntity<Long> listSpecMaxValueId() {
ProdPropValue propValue = prodPropValueService.getOne(new LambdaQueryWrapper<ProdPropValue>()
.orderByDesc(ProdPropValue::getValueId).last("limit 1"));
return ResponseEntity.ok(Objects.isNull(propValue) ? 0L : propValue.getValueId());
}
}

Loading…
Cancel
Save