feat(supplier): 新增供应商管理模块功能
This commit is contained in:
parent
114f79f3ad
commit
f8a2627c99
@ -0,0 +1,8 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.model.supplier.SupplierEntity;
|
||||
|
||||
public interface SupplierMapper extends BaseMapper<SupplierEntity> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.model.supplier.SupplierEntity;
|
||||
import jnpf.model.supplier.SupplierForm;
|
||||
import jnpf.model.supplier.SupplierPagination;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupplierService extends IService<SupplierEntity> {
|
||||
List<SupplierEntity> getList(SupplierPagination supplierPagination);
|
||||
|
||||
SupplierEntity getInfo(String id);
|
||||
|
||||
void delete(SupplierEntity entity);
|
||||
|
||||
void create(SupplierEntity entity);
|
||||
|
||||
boolean update(String id, SupplierEntity entity);
|
||||
|
||||
String checkForm(SupplierForm form, int i);
|
||||
|
||||
void saveOrUpdate(SupplierForm supplierForm, String id, boolean isSave) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
package jnpf.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.mapper.SupplierMapper;
|
||||
import jnpf.model.supplier.SupplierEntity;
|
||||
import jnpf.model.supplier.SupplierForm;
|
||||
import jnpf.model.supplier.SupplierPagination;
|
||||
import jnpf.service.SupplierService;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, SupplierEntity> implements SupplierService {
|
||||
|
||||
@Resource
|
||||
private UserProvider userProvider;
|
||||
|
||||
@Override
|
||||
public List<SupplierEntity> getList(SupplierPagination supplierPagination) {
|
||||
LambdaQueryWrapper<SupplierEntity> supplierWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierNo())) {
|
||||
supplierWrapper.like(SupplierEntity::getSupplierNo, supplierPagination.getSupplierNo());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierName())) {
|
||||
supplierWrapper.like(SupplierEntity::getSupplierName, supplierPagination.getSupplierName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(supplierPagination.getSupplierType())) {
|
||||
supplierWrapper.eq(SupplierEntity::getSupplierType, supplierPagination.getSupplierType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(supplierPagination.getStatus())) {
|
||||
supplierWrapper.eq(SupplierEntity::getStatus, supplierPagination.getStatus());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(supplierPagination.getEnabledStatus())) {
|
||||
supplierWrapper.eq(SupplierEntity::getEnabledStatus, supplierPagination.getEnabledStatus());
|
||||
}
|
||||
|
||||
supplierWrapper.eq(SupplierEntity::getDeleteMark, 0);
|
||||
supplierWrapper.orderByDesc(SupplierEntity::getId);
|
||||
|
||||
if ("0".equals(supplierPagination.getDataType())) {
|
||||
Page<SupplierEntity> page = new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize());
|
||||
IPage<SupplierEntity> result = this.page(page, supplierWrapper);
|
||||
return supplierPagination.setData(result.getRecords(), result.getTotal());
|
||||
} else {
|
||||
return this.list(supplierWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupplierEntity getInfo(String id) {
|
||||
QueryWrapper<SupplierEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(SupplierEntity::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SupplierEntity entity) {
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(String id, SupplierEntity entity) {
|
||||
return this.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(SupplierEntity entity) {
|
||||
if (entity != null) {
|
||||
this.removeById(entity.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkForm(SupplierForm form, int i) {
|
||||
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
||||
String id = "";
|
||||
String countRecover = "";
|
||||
if (isUp) {
|
||||
id = String.valueOf(form.getId());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(form.getSupplierNo())) {
|
||||
LambdaQueryWrapper<SupplierEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SupplierEntity::getSupplierNo, form.getSupplierNo());
|
||||
if (isUp) {
|
||||
wrapper.ne(SupplierEntity::getId, id);
|
||||
}
|
||||
long count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
countRecover += "供应商编码已存在,请重新输入!";
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtil.isEmpty(form.getSupplierName())) {
|
||||
return "供应商名称不能为空";
|
||||
}
|
||||
|
||||
return countRecover;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(SupplierForm supplierForm, String id, boolean isSave) throws Exception {
|
||||
SupplierEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new SupplierEntity();
|
||||
}
|
||||
BeanUtils.copyProperties(supplierForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package jnpf.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.model.supplier.SupplierEntity;
|
||||
import jnpf.model.supplier.SupplierForm;
|
||||
import jnpf.model.supplier.SupplierPagination;
|
||||
import jnpf.service.SupplierService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Tag(name = "供应商主数据", description = "Supplier")
|
||||
@RestController
|
||||
@RequestMapping("/api/scm/supplier")
|
||||
public class SupplierController {
|
||||
|
||||
@Autowired
|
||||
private SupplierService supplierService;
|
||||
|
||||
@Operation(summary = "获取供应商列表")
|
||||
@PostMapping("/getList")
|
||||
public ActionResult getList(@RequestBody SupplierPagination supplierPagination) {
|
||||
List<SupplierEntity> list = supplierService.getList(supplierPagination);
|
||||
List<Map<String, Object>> realList = list.stream()
|
||||
.map(JsonUtil::entityToMap)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
PageListVO vo = new PageListVO();
|
||||
vo.setList(realList);
|
||||
PaginationVO page = JsonUtil.getJsonToBean(supplierPagination, PaginationVO.class);
|
||||
vo.setPagination(page);
|
||||
return ActionResult.success(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取供应商详情")
|
||||
@GetMapping("/{id}")
|
||||
public ActionResult info(@PathVariable("id") String id) {
|
||||
SupplierEntity entity = supplierService.getInfo(id);
|
||||
if (entity != null) {
|
||||
return ActionResult.success(JsonUtil.entityToMap(entity));
|
||||
}
|
||||
return ActionResult.fail("数据不存在");
|
||||
}
|
||||
|
||||
@Operation(summary = "新建供应商")
|
||||
@PostMapping
|
||||
public ActionResult create(@RequestBody @Valid SupplierForm supplierForm) {
|
||||
String b = supplierService.checkForm(supplierForm, 0);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
try {
|
||||
supplierService.saveOrUpdate(supplierForm, "", true);
|
||||
return ActionResult.success("新建成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("新建数据失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "更新供应商")
|
||||
@PutMapping("/{id}")
|
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid SupplierForm supplierForm) {
|
||||
supplierForm.setId(id);
|
||||
String b = supplierService.checkForm(supplierForm, 1);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
SupplierEntity entity = supplierService.getInfo(id);
|
||||
if (entity != null) {
|
||||
try {
|
||||
supplierService.saveOrUpdate(supplierForm, id, false);
|
||||
return ActionResult.success("更新成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("更新数据失败:" + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
return ActionResult.fail("更新失败,数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "删除供应商")
|
||||
@DeleteMapping("/{id}")
|
||||
public ActionResult delete(@PathVariable("id") String id) {
|
||||
SupplierEntity entity = supplierService.getInfo(id);
|
||||
if (entity != null) {
|
||||
try {
|
||||
supplierService.delete(entity);
|
||||
return ActionResult.success("删除成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("删除失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
return ActionResult.fail("删除失败,数据不存在");
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,96 @@
|
||||
package jnpf.model.supplier;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("tba_supplier")
|
||||
public class SupplierEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("supplier_no")
|
||||
private String supplierNo;
|
||||
|
||||
@TableField("supplier_name")
|
||||
private String supplierName;
|
||||
|
||||
@TableField("supplier_sim_name")
|
||||
private String supplierSimName;
|
||||
|
||||
@TableField("supplier_type")
|
||||
private String supplierType;
|
||||
|
||||
@TableField("supplier_reg")
|
||||
private String supplierReg;
|
||||
|
||||
@TableField("contact1")
|
||||
private String contact1;
|
||||
|
||||
@TableField("con_phone1")
|
||||
private String conPhone1;
|
||||
|
||||
@TableField("con_address1")
|
||||
private String conAddress1;
|
||||
|
||||
@TableField("contact2")
|
||||
private String contact2;
|
||||
|
||||
@TableField("con_phone2")
|
||||
private String conPhone2;
|
||||
|
||||
@TableField("con_address2")
|
||||
private String conAddress2;
|
||||
|
||||
@TableField("com_tax_number")
|
||||
private String comTaxNumber;
|
||||
|
||||
@TableField("account_region")
|
||||
private String accountRegion;
|
||||
|
||||
@TableField("account_bank")
|
||||
private String accountBank;
|
||||
|
||||
@TableField("account_no")
|
||||
private String accountNo;
|
||||
|
||||
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
|
||||
private String creatorUserId;
|
||||
|
||||
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
|
||||
private Date creatorTime;
|
||||
|
||||
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
|
||||
private String lastModifyUserId;
|
||||
|
||||
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date lastModifyTime;
|
||||
|
||||
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
|
||||
private String deleteUserId;
|
||||
|
||||
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
|
||||
private Date deleteTime;
|
||||
|
||||
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer deleteMark;
|
||||
|
||||
@TableField("f_flow_id")
|
||||
private String flowId;
|
||||
|
||||
@TableField("f_flow_task_id")
|
||||
private String flowTaskId;
|
||||
|
||||
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
|
||||
@TableField("enabled_status")
|
||||
private String enabledStatus;
|
||||
|
||||
@TableField("status")
|
||||
private String status;
|
||||
|
||||
@TableField("is_blacklist")
|
||||
private String isBlacklist;
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package jnpf.model.supplier;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SupplierForm {
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("supplierNo")
|
||||
private String supplierNo;
|
||||
|
||||
@JsonProperty("supplierName")
|
||||
private String supplierName;
|
||||
|
||||
@JsonProperty("supplierSimName")
|
||||
private String supplierSimName;
|
||||
|
||||
@JsonProperty("supplierType")
|
||||
private String supplierType;
|
||||
|
||||
@JsonProperty("supplierReg")
|
||||
private String supplierReg;
|
||||
|
||||
@JsonProperty("contact1")
|
||||
private String contact1;
|
||||
|
||||
@JsonProperty("conPhone1")
|
||||
private String conPhone1;
|
||||
|
||||
@JsonProperty("conAddress1")
|
||||
private String conAddress1;
|
||||
|
||||
@JsonProperty("contact2")
|
||||
private String contact2;
|
||||
|
||||
@JsonProperty("conPhone2")
|
||||
private String conPhone2;
|
||||
|
||||
@JsonProperty("conAddress2")
|
||||
private String conAddress2;
|
||||
|
||||
@JsonProperty("comTaxNumber")
|
||||
private String comTaxNumber;
|
||||
|
||||
@JsonProperty("accountRegion")
|
||||
private String accountRegion;
|
||||
|
||||
@JsonProperty("accountBank")
|
||||
private String accountBank;
|
||||
|
||||
@JsonProperty("accountNo")
|
||||
private String accountNo;
|
||||
|
||||
@JsonProperty("remark")
|
||||
private String remark;
|
||||
|
||||
@JsonProperty("enabledStatus")
|
||||
private String enabledStatus;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
@JsonProperty("isBlacklist")
|
||||
private String isBlacklist;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package jnpf.model.supplier;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jnpf.base.Pagination;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SupplierPagination extends Pagination {
|
||||
private String[] selectKey;
|
||||
private String json;
|
||||
private String dataType;
|
||||
private String superQueryJson;
|
||||
private String moduleId;
|
||||
private String menuId;
|
||||
|
||||
@JsonProperty("supplierNo")
|
||||
private String supplierNo;
|
||||
|
||||
@JsonProperty("supplierName")
|
||||
private String supplierName;
|
||||
|
||||
@JsonProperty("supplierType")
|
||||
private String supplierType;
|
||||
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
private String enabledStatus;
|
||||
|
||||
}
|
||||
@ -16,7 +16,7 @@ export const customerMaps = {
|
||||
export const customerOptions = {}
|
||||
for (const key in customerMaps) {
|
||||
const map = customerMaps[key]
|
||||
customerOptions[key] = Object.entries(map).map(([id, fullName]) => ({ id: Number(id), fullName }))
|
||||
customerOptions[key] = Object.entries(map).map(([id, fullName]) => ({ id: String(id), fullName }))
|
||||
}
|
||||
|
||||
// 获取显示名称
|
||||
|
||||
185
jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue
Normal file
185
jnpf-java-boot/jnpf-web/src/views/example/supplier/detail.vue
Normal file
@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<el-dialog title="供应商详情" :visible.sync="visible" :close-on-click-modal="false" width="1200px"
|
||||
class="JNPF-dialog JNPF-dialog_center long-title" lock-scroll>
|
||||
<el-form :model="detailData" label-width="100px" label-position="right" size="small" v-loading="formLoading">
|
||||
<el-divider content-position="left">基础信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input :value="detailData.supplierNo" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input :value="detailData.supplierName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="简称">
|
||||
<el-input :value="detailData.supplierSimName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商类型">
|
||||
<el-input :value="getSupplierTypeName(detailData.supplierType)" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商等级">
|
||||
<el-input :value="getSupplierRegName(detailData.supplierReg)" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司税号">
|
||||
<el-input :value="detailData.comTaxNumber" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">联系方式</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人1">
|
||||
<el-input :value="detailData.contact1" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话1">
|
||||
<el-input :value="detailData.conPhone1" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址1">
|
||||
<el-input :value="detailData.conAddress1" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人2">
|
||||
<el-input :value="detailData.contact2" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话2">
|
||||
<el-input :value="detailData.conPhone2" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址2">
|
||||
<el-input :value="detailData.conAddress2" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">银行信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户地区">
|
||||
<el-input :value="detailData.accountRegion" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行">
|
||||
<el-input :value="detailData.accountBank" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户账号">
|
||||
<el-input :value="detailData.accountNo" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">其他信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="启用状态">
|
||||
<el-input :value="detailData.enabledStatus == '1' ? '启用' : '未启用'" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商状态">
|
||||
<el-input :value="getStatusName(detailData.status)" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否黑名单">
|
||||
<el-input :value="detailData.isBlacklist == '1' ? '是' : '否'" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input :value="detailData.remark" type="textarea" :rows="2" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-divider content-position="left">操作信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建人">
|
||||
<el-input :value="detailData.createUserName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建时间">
|
||||
<el-input :value="detailData.creatorTime" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="修改人">
|
||||
<el-input :value="detailData.lastModifyUserName" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="修改时间">
|
||||
<el-input :value="detailData.lastModifyTime" :disabled="true"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSupplierInfo, getLabel } from "./supplier";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
formLoading: false,
|
||||
detailData: {},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.visible = true;
|
||||
this.formLoading = true;
|
||||
getSupplierInfo(id).then((res) => {
|
||||
this.detailData = res.data || {};
|
||||
this.formLoading = false;
|
||||
});
|
||||
},
|
||||
getSupplierTypeName(type) {
|
||||
return getLabel('supplierType', type);
|
||||
},
|
||||
getSupplierRegName(reg) {
|
||||
return getLabel('supplierReg', reg);
|
||||
},
|
||||
getStatusName(status) {
|
||||
return getLabel('supplierStatus', status);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
238
jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue
Normal file
238
jnpf-java-boot/jnpf-web/src/views/example/supplier/form.vue
Normal file
@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建供应商' : '编辑供应商'" :visible.sync="visible"
|
||||
:close-on-click-modal="false" width="1200px" class="JNPF-dialog JNPF-dialog_center long-title"
|
||||
lock-scroll>
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-divider content-position="left">基础信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supplierNo">
|
||||
<JnpfInput v-model="dataForm.supplierNo" placeholder="请输入供应商编码" clearable :disabled="!!dataForm.id" :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称" prop="supplierName">
|
||||
<JnpfInput v-model="dataForm.supplierName" placeholder="请输入供应商名称" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="简称" prop="supplierSimName">
|
||||
<JnpfInput v-model="dataForm.supplierSimName" placeholder="请输入简称" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商类型" prop="supplierType">
|
||||
<JnpfSelect v-model="dataForm.supplierType" placeholder="请选择" :options="supplierTypeOptions" :props="dictProps" clearable :style="{ width: '100%' }"></JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商等级" prop="supplierReg">
|
||||
<JnpfSelect v-model="dataForm.supplierReg" placeholder="请选择" :options="supplierRegOptions" :props="dictProps" clearable :style="{ width: '100%' }"></JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司税号" prop="comTaxNumber">
|
||||
<JnpfInput v-model="dataForm.comTaxNumber" placeholder="请输入公司税号" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="启用状态" prop="enabledStatus">
|
||||
<JnpfSelect v-model="dataForm.enabledStatus" placeholder="请选择" :options="enabledStatusOptions" :props="dictProps" clearable :style="{ width: '100%' }"></JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商状态" prop="status">
|
||||
<JnpfSelect v-model="dataForm.status" placeholder="请选择" :options="statusOptions" :props="dictProps" clearable :style="{ width: '100%' }"></JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否黑名单" prop="isBlacklist">
|
||||
<JnpfSelect v-model="dataForm.isBlacklist" placeholder="请选择" :options="isBlacklistOptions" :props="dictProps" clearable :style="{ width: '100%' }"></JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<JnpfTextarea v-model="dataForm.remark" placeholder="请输入备注" :autoSize="{ minRows: 2, maxRows: 4 }" type="textarea" :style="{ width: '100%' }"></JnpfTextarea>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider content-position="left">联系方式</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人1" prop="contact1">
|
||||
<JnpfInput v-model="dataForm.contact1" placeholder="请输入联系人" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话1" prop="conPhone1">
|
||||
<JnpfInput v-model="dataForm.conPhone1" placeholder="请输入联系电话" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址1" prop="conAddress1">
|
||||
<JnpfInput v-model="dataForm.conAddress1" placeholder="请输入联系地址" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系人2" prop="contact2">
|
||||
<JnpfInput v-model="dataForm.contact2" placeholder="请输入联系人" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系电话2" prop="conPhone2">
|
||||
<JnpfInput v-model="dataForm.conPhone2" placeholder="请输入联系电话" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系地址2" prop="conAddress2">
|
||||
<JnpfInput v-model="dataForm.conAddress2" placeholder="请输入联系地址" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">银行信息</el-divider>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户地区" prop="accountRegion">
|
||||
<JnpfInput v-model="dataForm.accountRegion" placeholder="请输入开户地区" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户银行" prop="accountBank">
|
||||
<JnpfInput v-model="dataForm.accountBank" placeholder="请输入开户银行" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户账号" prop="accountNo">
|
||||
<JnpfInput v-model="dataForm.accountNo" placeholder="请输入开户账号" clearable :style="{ width: '100%' }"></JnpfInput>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">保 存</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSupplierInfo, createSupplier, updateSupplier, supplierOptions} from "./supplier";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
dataForm: {
|
||||
id: "",
|
||||
supplierNo: undefined,
|
||||
supplierName: undefined,
|
||||
supplierSimName: undefined,
|
||||
supplierType: undefined,
|
||||
supplierReg: undefined,
|
||||
contact1: undefined,
|
||||
conPhone1: undefined,
|
||||
conAddress1: undefined,
|
||||
contact2: undefined,
|
||||
conPhone2: undefined,
|
||||
conAddress2: undefined,
|
||||
comTaxNumber: undefined,
|
||||
accountRegion: undefined,
|
||||
accountBank: undefined,
|
||||
accountNo: undefined,
|
||||
remark: undefined,
|
||||
enabledStatus: "1",
|
||||
status: "1",
|
||||
isBlacklist: "0",
|
||||
},
|
||||
dataRule: {
|
||||
supplierNo: [
|
||||
{required: true, message: "请输入供应商编码", trigger: "blur"},
|
||||
],
|
||||
supplierName: [
|
||||
{required: true, message: "请输入供应商名称", trigger: "blur"},
|
||||
],
|
||||
supplierType: [
|
||||
{required: true, message: "请选择供应商类型", trigger: "change"},
|
||||
],
|
||||
enabledStatus: [
|
||||
{required: true, message: "请选择启用状态", trigger: "change"},
|
||||
],
|
||||
|
||||
},
|
||||
supplierTypeOptions: supplierOptions.supplierType,
|
||||
supplierRegOptions: supplierOptions.supplierReg,
|
||||
statusOptions: supplierOptions.supplierStatus,
|
||||
enabledStatusOptions: [
|
||||
{fullName: "启用", id: "1"},
|
||||
{fullName: "未启用", id: "2"},
|
||||
],
|
||||
isBlacklistOptions: [
|
||||
{fullName: "否", id: "0"},
|
||||
{fullName: "是", id: "1"},
|
||||
],
|
||||
dictProps: {label: "fullName", value: "id"},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true;
|
||||
this.loading = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formRef.resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getSupplierInfo(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data;
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.btnLoading = true;
|
||||
const promise = this.dataForm.id
|
||||
? updateSupplier(this.dataForm.id, this.dataForm)
|
||||
: createSupplier(this.dataForm);
|
||||
promise
|
||||
.then((res) => {
|
||||
this.btnLoading = false;
|
||||
this.$message({
|
||||
message: res.msg || "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false;
|
||||
this.$emit("refresh", true);
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.btnLoading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.visible = false;
|
||||
this.$emit('refresh', true)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
277
jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue
Normal file
277
jnpf-java-boot/jnpf-web/src/views/example/supplier/index.vue
Normal file
@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout supplier_data">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="14">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商编码">
|
||||
<el-input v-model="query.supplierNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="query.supplierName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="供应商类型">
|
||||
<JnpfSelect v-model="query.supplierType" placeholder="请选择" clearable :options="supplierTypeOptions"
|
||||
:props="supplierTypeProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态">
|
||||
<JnpfSelect v-model="query.status" placeholder="请选择" clearable :options="statusOptions"
|
||||
:props="statusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="启用状态">
|
||||
<JnpfSelect v-model="query.enabledStatus" placeholder="请选择" clearable :options="enabledStatusOptions"
|
||||
:props="enabledStatusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item class="btn">
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新建</el-button>
|
||||
<!-- <el-button type="danger" icon="icon-ym icon-ym-btn-clearn" @click="batchDelete()" :disabled="multipleSelection.length === 0">批量删除</el-button> -->
|
||||
</div>
|
||||
<div class="JNPF-common-head-right"></div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center"/>
|
||||
<el-table-column prop="supplierNo" label="供应商编码" align="center"/>
|
||||
<el-table-column prop="supplierName" label="供应商名称" align="center"/>
|
||||
<el-table-column prop="supplierSimName" label="简称" align="center"/>
|
||||
<el-table-column prop="supplierType" label="供应商类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ getSupplierTypeName(scope.row.supplierType) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="supplierReg" label="等级" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ getSupplierRegName(scope.row.supplierReg) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contact1" label="联系人1" align="center"/>
|
||||
<el-table-column prop="conPhone1" label="联系电话1" align="center"/>
|
||||
<el-table-column prop="status" label="供应商状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.status == '1' ? 'success' : scope.row.status == '2' ? 'warning' : 'danger'" size="small">
|
||||
{{ getStatusName(scope.row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="enabledStatus" label="启用状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.enabledStatus == '1' ? 'success' : 'info'" size="small">
|
||||
{{ scope.row.enabledStatus == '1' ? '启用' : '未启用' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isBlacklist" label="是否黑名单" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.isBlacklist == '1' ? 'danger' : 'success'" size="small">
|
||||
{{ scope.row.isBlacklist == '1' ? '是' : '否' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="remark" label="备注" align="center"/> -->
|
||||
<!-- <el-table-column prop="createUserName" label="创建人" align="center"/> -->
|
||||
<el-table-column prop="creatorTime" label="创建时间" align="center" :formatter="jnpf.tableDateFormat1"/>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
|
||||
<el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
|
||||
<!-- <el-button type="text" style="color: #f56c6c" @click="handleDelete(scope.row)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<JNPF-Detail v-if="detailVisible" ref="JNPFDetail" @close="closeDetail"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import JNPFForm from "./form";
|
||||
import JNPFDetail from "./detail";
|
||||
import jnpf from "@/utils/jnpf";
|
||||
import {getSupplierList, deleteSupplier, supplierOptions, getLabel} from "./supplier";
|
||||
|
||||
export default {
|
||||
name: "supplier",
|
||||
components: {
|
||||
JNPFForm,
|
||||
JNPFDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
supplierNo: undefined,
|
||||
supplierName: undefined,
|
||||
supplierType: undefined,
|
||||
status: undefined,
|
||||
enabledStatus: undefined,
|
||||
},
|
||||
list: [],
|
||||
listLoading: false,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
detailVisible: false,
|
||||
supplierTypeOptions: supplierOptions.supplierType,
|
||||
supplierTypeProps: {label: "fullName", value: "id"},
|
||||
statusOptions: supplierOptions.supplierStatus,
|
||||
statusProps: {label: "fullName", value: "id"},
|
||||
enabledStatusOptions: [
|
||||
{fullName: "启用", id: "1"},
|
||||
{fullName: "未启用", id: "2"},
|
||||
],
|
||||
enabledStatusProps: {label: "fullName", value: "id"},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
jnpf() {
|
||||
return jnpf;
|
||||
},
|
||||
...mapGetters(["userInfo"]),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || "";
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
getSupplierTypeName(type) {
|
||||
return getLabel('supplierType', type);
|
||||
},
|
||||
getSupplierRegName(reg) {
|
||||
return getLabel('supplierReg', reg);
|
||||
},
|
||||
getStatusName(status) {
|
||||
return getLabel('supplierStatus', status);
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
dataType: 0,
|
||||
};
|
||||
getSupplierList(_query).then((res) => {
|
||||
this.list = res.data.list || [];
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
addOrUpdateHandle(row) {
|
||||
let id = row ? row.id : "";
|
||||
this.formVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id);
|
||||
});
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.detailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFDetail.init(row.id);
|
||||
});
|
||||
},
|
||||
closeDetail() {
|
||||
this.detailVisible = false;
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
return deleteSupplier(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功!",
|
||||
});
|
||||
this.initData();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
batchDelete() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.warning("请选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$confirm("此操作将永久删除选中的数据, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
const ids = this.multipleSelection.map(item => item.id);
|
||||
const promises = ids.map(id => {
|
||||
return deleteSupplier(id);
|
||||
});
|
||||
return Promise.all(promises);
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "批量删除成功!",
|
||||
});
|
||||
this.initData();
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.initData();
|
||||
},
|
||||
refresh(isRefresh) {
|
||||
this.formVisible = false;
|
||||
if (isRefresh) this.search();
|
||||
},
|
||||
reset() {
|
||||
this.query = {
|
||||
supplierNo: undefined,
|
||||
supplierName: undefined,
|
||||
supplierType: undefined,
|
||||
status: undefined,
|
||||
enabledStatus: undefined,
|
||||
};
|
||||
this.search();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user