controller:
@PostMapping("/checkCount")
public ApiResult checkCount(@RequestBody PaymentMPriceInfo paymentMPriceInfo) {
return ApiResult.ok(paymentmpriceinfoservice.getOne(Wrappers.<PaymentMPriceInfo>lambdaQuery()
.eq(PaymentMPriceInfo::getGoodsType, paymentMPriceInfo.getGoodsType())
.eq(PaymentMPriceInfo::getHomeType, paymentMPriceInfo.getHomeType())
.eq(PaymentMPriceInfo::getModule, paymentMPriceInfo.getModule())
.eq(PaymentMPriceInfo::getCustomerType, paymentMPriceInfo.getCustomerType())
.eq(PaymentMPriceInfo::getContractYears, paymentMPriceInfo.getContractYears())
.eq(PaymentMPriceInfo::getStatus, paymentMPriceInfo.getStatus())
));
}
vue:
if (valid) {
if (this.opType === '1' || this.opType === '3') {
const res = await checkCount(this.addForm)
const { data } = res
if (data) {
this.$message({
type: 'error',
message: this.$t('pricecontrol.rules.goodsCheck')
})
return false
}
}
}
js:
export function checkCount(data) {
return request({
baseURL: 'http://localhost:****/****/',
url: `/PaymentMPriceInfo/checkCount`,
method: 'post',
data
})
}