弹框改造

jg-waiwang-pro
胡川虎 7 months ago
parent bc10dee3e8
commit d3609050e2

@ -47,7 +47,7 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
private UserProvider userProvider; private UserProvider userProvider;
@Autowired @Autowired
private ProductBusinessService productBusinessService; private ProductBusinessService productBusinessService;
@Autowired @Autowired
private ProductUnitService productUnitService; private ProductUnitService productUnitService;
@Override @Override
@ -155,152 +155,159 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
allRuleIDlist = allRuleList; allRuleIDlist = allRuleList;
} }
} }
boolean pcPermission = true; boolean pcPermission = true;
boolean appPermission = false; boolean appPermission = false;
if(isPc && pcPermission){ if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()){
Object productWarehouseObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productWarehouseQueryWrapper,ProductWarehouseEntity.class,productWarehousePagination.getMenuId(),"0")); Object productWarehouseObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productWarehouseQueryWrapper,ProductWarehouseEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productWarehouseObj)){ if (ObjectUtil.isEmpty(productWarehouseObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
productWarehouseQueryWrapper = (QueryWrapper<ProductWarehouseEntity>)productWarehouseObj; productWarehouseQueryWrapper = (QueryWrapper<ProductWarehouseEntity>)productWarehouseObj;
if( productWarehouseQueryWrapper.getExpression().getNormal().size()>0){ if( productWarehouseQueryWrapper.getExpression().getNormal().size()>0){
productWarehouseNum++; productWarehouseNum++;
} }
} }
Object productBusinessObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productBusinessQueryWrapper,ProductBusinessEntity.class,productWarehousePagination.getMenuId(),"0")); Object productBusinessObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productBusinessQueryWrapper,ProductBusinessEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productBusinessObj)){ if (ObjectUtil.isEmpty(productBusinessObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
productBusinessQueryWrapper = (QueryWrapper<ProductBusinessEntity>)productBusinessObj; productBusinessQueryWrapper = (QueryWrapper<ProductBusinessEntity>)productBusinessObj;
if( productBusinessQueryWrapper.getExpression().getNormal().size()>0){ if( productBusinessQueryWrapper.getExpression().getNormal().size()>0){
productBusinessNum++; productBusinessNum++;
} }
} }
Object productUnitObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productUnitQueryWrapper,ProductUnitEntity.class,productWarehousePagination.getMenuId(),"0")); Object productUnitObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productUnitQueryWrapper,ProductUnitEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productUnitObj)){ if (ObjectUtil.isEmpty(productUnitObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
productUnitQueryWrapper = (QueryWrapper<ProductUnitEntity>)productUnitObj; productUnitQueryWrapper = (QueryWrapper<ProductUnitEntity>)productUnitObj;
if( productUnitQueryWrapper.getExpression().getNormal().size()>0){ if( productUnitQueryWrapper.getExpression().getNormal().size()>0){
productUnitNum++; productUnitNum++;
} }
} }
} }
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object productWarehouseObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productWarehouseQueryWrapper,ProductWarehouseEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productWarehouseObj)){
return new ArrayList<>();
} else {
productWarehouseQueryWrapper = (QueryWrapper<ProductWarehouseEntity>)productWarehouseObj;
if( productWarehouseQueryWrapper.getExpression().getNormal().size()>0){
productWarehouseNum++;
}
} }
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object productWarehouseObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productWarehouseQueryWrapper,ProductWarehouseEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productWarehouseObj)){
return new ArrayList<>();
} else {
productWarehouseQueryWrapper = (QueryWrapper<ProductWarehouseEntity>)productWarehouseObj;
if( productWarehouseQueryWrapper.getExpression().getNormal().size()>0){
productWarehouseNum++;
}
}
Object productBusinessObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productBusinessQueryWrapper,ProductBusinessEntity.class,productWarehousePagination.getMenuId(),"0")); Object productBusinessObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productBusinessQueryWrapper,ProductBusinessEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productBusinessObj)){ if (ObjectUtil.isEmpty(productBusinessObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
productBusinessQueryWrapper = (QueryWrapper<ProductBusinessEntity>)productBusinessObj; productBusinessQueryWrapper = (QueryWrapper<ProductBusinessEntity>)productBusinessObj;
if( productBusinessQueryWrapper.getExpression().getNormal().size()>0){ if( productBusinessQueryWrapper.getExpression().getNormal().size()>0){
productBusinessNum++; productBusinessNum++;
} }
} }
Object productUnitObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productUnitQueryWrapper,ProductUnitEntity.class,productWarehousePagination.getMenuId(),"0")); Object productUnitObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(productUnitQueryWrapper,ProductUnitEntity.class,productWarehousePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(productUnitObj)){ if (ObjectUtil.isEmpty(productUnitObj)){
return new ArrayList<>(); return new ArrayList<>();
} else { } else {
productUnitQueryWrapper = (QueryWrapper<ProductUnitEntity>)productUnitObj; productUnitQueryWrapper = (QueryWrapper<ProductUnitEntity>)productUnitObj;
if( productUnitQueryWrapper.getExpression().getNormal().size()>0){ if( productUnitQueryWrapper.getExpression().getNormal().size()>0){
productUnitNum++; productUnitNum++;
} }
} }
} }
} }
if(isPc){ if(isPc){
if(ObjectUtil.isNotEmpty(productWarehousePagination.getCode())){ if(ObjectUtil.isNotEmpty(productWarehousePagination.getCode())){
productWarehouseNum++; productWarehouseNum++;
String value = productWarehousePagination.getCode() instanceof List ? String value = productWarehousePagination.getCode() instanceof List ?
JsonUtil.getObjectToString(productWarehousePagination.getCode()) : JsonUtil.getObjectToString(productWarehousePagination.getCode()) :
String.valueOf(productWarehousePagination.getCode()); String.valueOf(productWarehousePagination.getCode());
productWarehouseQueryWrapper.lambda().like(ProductWarehouseEntity::getCode,value); productWarehouseQueryWrapper.lambda().like(ProductWarehouseEntity::getCode,value);
} }
if(ObjectUtil.isNotEmpty(productWarehousePagination.getName())){ if(ObjectUtil.isNotEmpty(productWarehousePagination.getName())){
productWarehouseNum++; productWarehouseNum++;
String value = productWarehousePagination.getName() instanceof List ? String value = productWarehousePagination.getName() instanceof List ?
JsonUtil.getObjectToString(productWarehousePagination.getName()) : JsonUtil.getObjectToString(productWarehousePagination.getName()) :
String.valueOf(productWarehousePagination.getName()); String.valueOf(productWarehousePagination.getName());
productWarehouseQueryWrapper.lambda().like(ProductWarehouseEntity::getName,value); productWarehouseQueryWrapper.lambda().like(ProductWarehouseEntity::getName,value);
} }
if(ObjectUtil.isNotEmpty(productWarehousePagination.getProductTypeId())){ if(ObjectUtil.isNotEmpty(productWarehousePagination.getProductTypeId())){
productWarehouseNum++; productWarehouseNum++;
productWarehouseQueryWrapper.lambda().eq(ProductWarehouseEntity::getProductTypeId,productWarehousePagination.getProductTypeId());
}
productWarehouseQueryWrapper.lambda().eq(ProductWarehouseEntity::getProductTypeId,productWarehousePagination.getProductTypeId()); if(productWarehousePagination.getExcludeIdList() != null && productWarehousePagination.getExcludeIdList().size() > 0){
productWarehouseNum++;
productWarehouseQueryWrapper.lambda().notIn(ProductWarehouseEntity::getId,productWarehousePagination.getExcludeIdList());
} }
if(ObjectUtil.isNotEmpty(productWarehousePagination.getInventoryType())){ if(ObjectUtil.isNotEmpty(productWarehousePagination.getInventoryType())){
productWarehouseNum++; productWarehouseNum++;
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
try { try {
String[][] inventoryType = JsonUtil.getJsonToBean(productWarehousePagination.getInventoryType(),String[][].class); String[][] inventoryType = JsonUtil.getJsonToBean(productWarehousePagination.getInventoryType(),String[][].class);
for(int i=0;i<inventoryType.length;i++){ for(int i=0;i<inventoryType.length;i++){
if(inventoryType[i].length>0){ if(inventoryType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(inventoryType[i]))); idList.add(JsonUtil.getObjectToString(Arrays.asList(inventoryType[i])));
} }
} }
}catch (Exception e1){ }catch (Exception e1){
try { try {
List<String> inventoryType = JsonUtil.getJsonToList(productWarehousePagination.getInventoryType(),String.class); List<String> inventoryType = JsonUtil.getJsonToList(productWarehousePagination.getInventoryType(),String.class);
if(inventoryType.size()>0){ if(inventoryType.size()>0){
idList.addAll(inventoryType); idList.addAll(inventoryType);
} }
}catch (Exception e2){ }catch (Exception e2){
idList.add(String.valueOf(productWarehousePagination.getInventoryType())); idList.add(String.valueOf(productWarehousePagination.getInventoryType()));
} }
} }
productWarehouseQueryWrapper.lambda().and(t->{ productWarehouseQueryWrapper.lambda().and(t->{
idList.forEach(tt->{ idList.forEach(tt->{
t.like(ProductWarehouseEntity::getInventoryType, tt).or(); t.like(ProductWarehouseEntity::getInventoryType, tt).or();
}); });
}); });
} }
} }
if(productBusinessNum>0){ if(productBusinessNum>0){
List<String> productBusinessIdList = productBusinessService.list(productBusinessQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getProductId())).map(t->t.getProductId()).collect(Collectors.toList()); List<String> productBusinessIdList = productBusinessService.list(productBusinessQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getProductId())).map(t->t.getProductId()).collect(Collectors.toList());
long count = productBusinessService.count(); long count = productBusinessService.count();
if (count>0){ if (count>0){
intersectionList.add(productBusinessIdList); intersectionList.add(productBusinessIdList);
} }
AllIdList.addAll(productBusinessIdList); AllIdList.addAll(productBusinessIdList);
} }
total+=productBusinessNum; total+=productBusinessNum;
if(productUnitNum>0){ if(productUnitNum>0){
List<String> productUnitIdList = productUnitService.list(productUnitQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getProuctId())).map(t->t.getProuctId()).collect(Collectors.toList()); List<String> productUnitIdList = productUnitService.list(productUnitQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getProuctId())).map(t->t.getProuctId()).collect(Collectors.toList());
long count = productUnitService.count(); long count = productUnitService.count();
if (count>0){ if (count>0){
intersectionList.add(productUnitIdList); intersectionList.add(productUnitIdList);
} }
AllIdList.addAll(productUnitIdList); AllIdList.addAll(productUnitIdList);
} }
total+=productUnitNum; total+=productUnitNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList); List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){ if (total>0){
if (intersection.size()==0){ if (intersection.size()==0){
@ -308,7 +315,7 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
} }
productWarehouseQueryWrapper.lambda().in(ProductWarehouseEntity::getId, intersection); productWarehouseQueryWrapper.lambda().in(ProductWarehouseEntity::getId, intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)){ if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){ if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
@ -316,7 +323,7 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
List<String> finalAllSuperIDlist = allSuperIDlist; List<String> finalAllSuperIDlist = allSuperIDlist;
productWarehouseQueryWrapper.lambda().and(t->t.in(ProductWarehouseEntity::getId, finalAllSuperIDlist)); productWarehouseQueryWrapper.lambda().and(t->t.in(ProductWarehouseEntity::getId, finalAllSuperIDlist));
} }
//是否有数据过滤查询 //是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){ if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){ if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
@ -381,7 +388,7 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
@Override @Override
public List<ProductUnitEntity> getProductUnitList(String id,ProductWarehousePagination productWarehousePagination){ public List<ProductUnitEntity> getProductUnitList(String id,ProductWarehousePagination productWarehousePagination){
Map<String, Object> newtabMap=ProductWarehouseConstant.TABLEFIELDKEY.entrySet() Map<String, Object> newtabMap=ProductWarehouseConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey())); .stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="productUnit"; String tableName="productUnit";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString(); tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<ProductUnitEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<ProductUnitEntity> queryWrapper = new QueryWrapper<>();
@ -415,72 +422,72 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
id = form.getId(); id = form.getId();
} }
//主表字段验证 //主表字段验证
if(StringUtil.isEmpty(form.getName())){ if(StringUtil.isEmpty(form.getName())){
return "商品名称不能为空"; return "商品名称不能为空";
}
if(StringUtil.isEmpty(form.getSpec())){
return "商品规格不能为空";
}
if(StringUtil.isEmpty(form.getAvailableInventory())){
return "可售库存不能为空";
}
//副表字段验证
//子表字段验证
if (form.getProductUnitList()!=null){
for(ProductUnitModel t : form.getProductUnitList()){
if(StringUtil.isNotEmpty(t.getConversionRules())){
t.setConversionRules(t.getConversionRules().trim());
} }
if(StringUtil.isEmpty(form.getSpec())){ else{
return "商品规格不能为空"; return "商品单位-换算规则不能为空";
} }
if(StringUtil.isEmpty(form.getAvailableInventory())){ }
return "可售库存不能为空"; for(ProductUnitModel t : form.getProductUnitList()){
if(StringUtil.isNotEmpty(t.getProductUnitCode())){
t.setProductUnitCode(t.getProductUnitCode().trim());
} }
//副表字段验证 else{
//子表字段验证 return "商品单位-商品单位编码不能为空";
if (form.getProductUnitList()!=null){ }
for(ProductUnitModel t : form.getProductUnitList()){ }
if(StringUtil.isNotEmpty(t.getConversionRules())){ QueryWrapper<ProductUnitEntity> productUnitProductUnitCodeWrapper = new QueryWrapper<>();
t.setConversionRules(t.getConversionRules().trim()); List<String> ProductUnitCodeList = form.getProductUnitList().stream().filter(f->StringUtil.isNotEmpty(f.getProductUnitCode())).map(f -> f.getProductUnitCode()).collect(Collectors.toList());
} HashSet<String> ProductUnitCodeSet = new HashSet<>(ProductUnitCodeList);
else{ if(ProductUnitCodeSet.size() != ProductUnitCodeList.size()){
return "商品单位-换算规则不能为空"; countRecover = "商品单位-商品单位编码不能重复";
}
}
for(ProductUnitModel t : form.getProductUnitList()){
if(StringUtil.isNotEmpty(t.getProductUnitCode())){
t.setProductUnitCode(t.getProductUnitCode().trim());
}
else{
return "商品单位-商品单位编码不能为空";
}
}
QueryWrapper<ProductUnitEntity> productUnitProductUnitCodeWrapper = new QueryWrapper<>();
List<String> ProductUnitCodeList = form.getProductUnitList().stream().filter(f->StringUtil.isNotEmpty(f.getProductUnitCode())).map(f -> f.getProductUnitCode()).collect(Collectors.toList());
HashSet<String> ProductUnitCodeSet = new HashSet<>(ProductUnitCodeList);
if(ProductUnitCodeSet.size() != ProductUnitCodeList.size()){
countRecover = "商品单位-商品单位编码不能重复";
}
} }
}
return countRecover; return countRecover;
} }
/** /**
* () * ()
* @param id * @param id
* @param productWarehouseForm * @param productWarehouseForm
* @return * @return
*/ */
@Override @Override
@Transactional @Transactional
public void saveOrUpdate(ProductWarehouseForm productWarehouseForm,String id, boolean isSave) throws Exception{ public void saveOrUpdate(ProductWarehouseForm productWarehouseForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
productWarehouseForm = JsonUtil.getJsonToBean( productWarehouseForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ProductWarehouseConstant.getFormData(),productWarehouseForm),ProductWarehouseForm.class); generaterSwapUtil.swapDatetime(ProductWarehouseConstant.getFormData(),productWarehouseForm),ProductWarehouseForm.class);
ProductWarehouseEntity entity = JsonUtil.getJsonToBean(productWarehouseForm, ProductWarehouseEntity.class); ProductWarehouseEntity entity = JsonUtil.getJsonToBean(productWarehouseForm, ProductWarehouseEntity.class);
if(isSave){ if(isSave){
String mainId = id ; String mainId = id ;
entity.setCode(generaterSwapUtil.getBillNumber("productcode", false)); entity.setCode(generaterSwapUtil.getBillNumber("productcode", false));
entity.setBarCode(generaterSwapUtil.getBillNumber("productBarCode", false)); entity.setBarCode(generaterSwapUtil.getBillNumber("productBarCode", false));
entity.setCreatorTime(DateUtil.getNowDate()); entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId()); entity.setCreatorUserId(userInfo.getUserId());
entity.setId(mainId); entity.setId(mainId);
entity.setFlowId(productWarehouseForm.getFlowId()); entity.setFlowId(productWarehouseForm.getFlowId());
entity.setVersion(0); entity.setVersion(0);
}else{ }else{
entity.setCode(generaterSwapUtil.getBillNumber("productcode", false)); entity.setCode(generaterSwapUtil.getBillNumber("productcode", false));
entity.setBarCode(generaterSwapUtil.getBillNumber("productBarCode", false)); entity.setBarCode(generaterSwapUtil.getBillNumber("productBarCode", false));
entity.setCreatorTime(DateUtil.getNowDate()); entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId()); entity.setCreatorUserId(userInfo.getUserId());
entity.setFlowId(productWarehouseForm.getFlowId()); entity.setFlowId(productWarehouseForm.getFlowId());
} }
this.saveOrUpdate(entity); this.saveOrUpdate(entity);

@ -39,4 +39,7 @@ public class ProductWarehousePagination extends Pagination {
/** 存货类型 */ /** 存货类型 */
@JsonProperty("inventoryType") @JsonProperty("inventoryType")
private Object inventoryType; private Object inventoryType;
@JsonProperty("excludeIdList")
private List<String> excludeIdList;
} }

@ -251,6 +251,7 @@ export default {
columnOptions: columnOptions.join(','), columnOptions: columnOptions.join(','),
paramList paramList
} }
debugger
getDataInterfaceDataSelect(this.interfaceId, query).then(res => { getDataInterfaceDataSelect(this.interfaceId, query).then(res => {
this.list = res.data.list this.list = res.data.list
this.total = res.data.pagination.total this.total = res.data.pagination.total
@ -364,4 +365,4 @@ export default {
} }
} }
} }
</style> </style>

@ -0,0 +1,153 @@
<template>
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{$t('common.search')}}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{$t('common.reset')}}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="name" label="商品名称" align="left">
</el-table-column>
<el-table-column prop="code" label="商品编码" align="left">
</el-table-column>
<el-table-column prop="productTypeId" label="商品类型" align="left">
</el-table-column>
<el-table-column prop="shortName" label="商品简称" align="left">
</el-table-column>
<el-table-column prop="spec" label="商品规格" align="left">
</el-table-column>
<el-table-column prop="barCode" label="商品条码" align="left">
</el-table-column>
<el-table-column prop="inventoryType" label="存货类型" align="left">
</el-table-column>
<el-table-column prop="brandId" label="品牌" align="left">
</el-table-column>
<el-table-column prop="productCategoryId" label="商品分类" align="left">
</el-table-column>
<el-table-column prop="area" label="产地" align="left">
</el-table-column>
<el-table-column prop="firstSupplierId" label="首选供应商" align="left">
</el-table-column>
<el-table-column prop="deliveryType" label="配送方式" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{$t('common.cancelButton')}}</el-button>
<el-button type="primary" @click="select()">{{$t('common.confirmButton')}}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: []
}
},
methods: {
init(excludeIdList) {
this.visible = true
this.listLoading = true
if(excludeIdList){
this.excludeIdList = excludeIdList;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/ProductWarehouse/getList`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -135,7 +135,7 @@
<span class="required-sign" v-if="judgeRequired('subjectproductblacklistList-productId')">*</span> <span class="required-sign" v-if="judgeRequired('subjectproductblacklistList-productId')">*</span>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.productId" <!-- <JnpfPopupSelect v-model="scope.row.productId"
@change="changeData('subjectproductblacklist-productId',scope.$index)" :rowIndex="scope.$index" @change="changeData('subjectproductblacklist-productId',scope.$index)" :rowIndex="scope.$index"
:formData="dataForm" :templateJson="interfaceRes.subjectproductblacklistproductId" :formData="dataForm" :templateJson="interfaceRes.subjectproductblacklistproductId"
placeholder="请选择" placeholder="请选择"
@ -144,7 +144,10 @@
:field="'productId'+scope.$index" interfaceId="519505017699307077" :pageSize="20" :field="'productId'+scope.$index" interfaceId="519505017699307077" :pageSize="20"
:columnOptions="subjectproductblacklistproductIdcolumnOptions" clearable :columnOptions="subjectproductblacklistproductIdcolumnOptions" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}'>
</JnpfPopupSelect> </JnpfPopupSelect> -->
<JnpfInput v-model="scope.row.name" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template> </template>
</el-table-column> </el-table-column>
@ -181,7 +184,11 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="table-actions" @click="addsubjectproductblacklistList()" <!-- <div class="table-actions" @click="addsubjectproductblacklistList()"
v-if="!judgeWrite('subjectproductblacklistList')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
<div class="table-actions" @click="choice()"
v-if="!judgeWrite('subjectproductblacklistList')"> v-if="!judgeWrite('subjectproductblacklistList')">
<el-button type="text" icon="el-icon-plus">添加</el-button> <el-button type="text" icon="el-icon-plus">添加</el-button>
</div> </div>
@ -194,6 +201,7 @@
</el-form> </el-form>
</el-row> </el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" /> <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<ProductGoodsBox v-if="goodsBoxVisible" ref="goodsBox" @refreshDataList="initList" />
</div> </div>
</template> </template>
@ -232,9 +240,10 @@
import { import {
thousandsFormat thousandsFormat
} from "@/components/Generator/utils/index" } from "@/components/Generator/utils/index"
import ProductGoodsBox from '@/views/extend/customer/subjectbasic/ProductGoodsBox'
export default { export default {
mixins: [comMixin], mixins: [comMixin],
components: {}, components: { ProductGoodsBox },
props: [], props: [],
data() { data() {
return { return {
@ -254,6 +263,7 @@
setting: {}, setting: {},
eventType: '', eventType: '',
userBoxVisible: false, userBoxVisible: false,
goodsBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf: {}, currTableConf: {},
dataValueAll: {}, dataValueAll: {},
@ -1450,6 +1460,27 @@
goBack() { goBack() {
this.$emit('refresh') this.$emit('refresh')
}, },
choice() {
this.goodsBoxVisible = true
console.log('55555', this.dataForm.subjectproductblacklistList)
let excludeIdList = [];
for (let i = 0; i < this.dataForm.subjectproductblacklistList.length; i++) {
excludeIdList.push(this.dataForm.subjectproductblacklistList[i].productId);
}
this.$nextTick(() => {
this.$refs.goodsBox.init(excludeIdList)
})
},
initList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
let item = {
productId: e.id,
name: e.name
}
this.dataForm.subjectproductblacklistList.push(item)
}
},
clearData() { clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll)) this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
}, },

@ -0,0 +1,153 @@
<template>
<el-dialog title="选择商品" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input v-model="keyword" placeholder="请输入关键词查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{$t('common.search')}}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{$t('common.reset')}}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="name" label="商品名称" align="left">
</el-table-column>
<el-table-column prop="code" label="商品编码" align="left">
</el-table-column>
<el-table-column prop="productTypeId" label="商品类型" align="left">
</el-table-column>
<el-table-column prop="shortName" label="商品简称" align="left">
</el-table-column>
<el-table-column prop="spec" label="商品规格" align="left">
</el-table-column>
<el-table-column prop="barCode" label="商品条码" align="left">
</el-table-column>
<el-table-column prop="inventoryType" label="存货类型" align="left">
</el-table-column>
<el-table-column prop="brandId" label="品牌" align="left">
</el-table-column>
<el-table-column prop="productCategoryId" label="商品分类" align="left">
</el-table-column>
<el-table-column prop="area" label="产地" align="left">
</el-table-column>
<el-table-column prop="firstSupplierId" label="首选供应商" align="left">
</el-table-column>
<el-table-column prop="deliveryType" label="配送方式" align="left">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{$t('common.cancelButton')}}</el-button>
<el-button type="primary" @click="select()">{{$t('common.confirmButton')}}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: []
}
},
methods: {
init(excludeIdList) {
this.visible = true
this.listLoading = true
if(excludeIdList){
this.excludeIdList = excludeIdList;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/ProductWarehouse/getList`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>
Loading…
Cancel
Save