回收价加校验

master
CJYXTX\27961 7 months ago
parent 0df94f6fbd
commit 4b455601f7

@ -30,6 +30,9 @@ import jnpf.util.*;
import java.util.*; import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/** /**
* *
* nxPrice * nxPrice
@ -50,8 +53,10 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
private NxPriceProductService nxPriceProductService; private NxPriceProductService nxPriceProductService;
@Autowired @Autowired
private NxPriceRecycleService nxPriceRecycleService; private NxPriceRecycleService nxPriceRecycleService;
@Autowired @Resource
private NxPriceMapper nxPriceMapper; private NxPriceMapper nxPriceMapper;
@Override @Override
public List<NxPriceEntity> getList(NxPricePagination nxPricePagination){ public List<NxPriceEntity> getList(NxPricePagination nxPricePagination){
return getTypeList(nxPricePagination,nxPricePagination.getDataType()); return getTypeList(nxPricePagination,nxPricePagination.getDataType());
@ -496,14 +501,28 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
//主表字段验证 //主表字段验证
//子表字段验证 //子表字段验证
if (form.getNxPriceProductList()==null||form.getNxPriceProductList().size()==0){ if (form.getNxPriceProductList()==null||form.getNxPriceProductList().size()==0){
return "商品名称不能为空"; return "商品名称不能为空";
} }
if (form.getNxPriceRecycleList()==null||form.getNxPriceProductList().size()==0){ if (form.getNxPriceRecycleList()==null||form.getNxPriceProductList().size()==0){
return "回收站不能为空"; return "回收站不能为空";
} }
try {
NxPriceProductModel nxPriceProductModel =new NxPriceProductModel();
String recoveryPrice;
for (NxPriceProductModel model:form.getNxPriceProductList()){
nxPriceProductModel.setRecoveryPrice(model.getRecoveryPrice());
recoveryPrice =model.getRecoveryPrice();
if (recoveryPrice==null){
return "回收价是必填项";
}else if (recoveryPrice.equals("0")){
return "回收价不能等于0";
}
}
}catch (Exception e){
return "回收价不能等于0且要必填";
}
return countRecover; return countRecover;
} }
/** /**

@ -120,6 +120,7 @@
>{{ $t("login.logIn") }}</el-button >{{ $t("login.logIn") }}</el-button
> >
<div class="foot"> <div class="foot">
<!-- <div class="register" @click="handleRegsiter"></div> -->
<div class="register" @click="handleRegsiter"></div> <div class="register" @click="handleRegsiter"></div>
<div class="line"></div> <div class="line"></div>
<div class="forget" @click="handleForget"></div> <div class="forget" @click="handleForget"></div>

@ -191,7 +191,7 @@
</el-table-column> </el-table-column>
<el-table-column label="回收价" prop="recoveryPrice"> <el-table-column label="回收价" prop="recoveryPrice">
<template slot="header" v-if="false"> <template slot="header" v-if="true">
<span class="required-sign">*</span>回收价 <span class="required-sign">*</span>回收价
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
@ -439,7 +439,7 @@ export default {
currVmodel: "", currVmodel: "",
dataForm: { dataForm: {
priceCode: undefined, priceCode: undefined,
buinessId: [], buinessId: undefined,
priceType: "1", priceType: "1",
creatorUserId: undefined, creatorUserId: undefined,
creatorTime: undefined, creatorTime: undefined,
@ -473,6 +473,13 @@ export default {
trigger: "change", trigger: "change",
}, },
], ],
productId: [
{
required: true,
message: "请至少选择一个",
trigger: "change",
},
],
}, },
priceTypeOptions: [{ fullName: "回收价", id: "1" }], priceTypeOptions: [{ fullName: "回收价", id: "1" }],
priceTypeProps: { label: "fullName", value: "id" }, priceTypeProps: { label: "fullName", value: "id" },

Loading…
Cancel
Save