弹框改造

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

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

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

@ -251,6 +251,7 @@ export default {
columnOptions: columnOptions.join(','),
paramList
}
debugger
getDataInterfaceDataSelect(this.interfaceId, query).then(res => {
this.list = res.data.list
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>
</template>
<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"
:formData="dataForm" :templateJson="interfaceRes.subjectproductblacklistproductId"
placeholder="请选择"
@ -144,7 +144,10 @@
:field="'productId'+scope.$index" interfaceId="519505017699307077" :pageSize="20"
:columnOptions="subjectproductblacklistproductIdcolumnOptions" clearable
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</JnpfPopupSelect> -->
<JnpfInput v-model="scope.row.name" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -181,7 +184,11 @@
</template>
</el-table-column>
</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')">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
@ -194,6 +201,7 @@
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
<ProductGoodsBox v-if="goodsBoxVisible" ref="goodsBox" @refreshDataList="initList" />
</div>
</template>
@ -232,9 +240,10 @@
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import ProductGoodsBox from '@/views/extend/customer/subjectbasic/ProductGoodsBox'
export default {
mixins: [comMixin],
components: {},
components: { ProductGoodsBox },
props: [],
data() {
return {
@ -254,6 +263,7 @@
setting: {},
eventType: '',
userBoxVisible: false,
goodsBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
@ -1450,6 +1460,27 @@
goBack() {
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() {
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