mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-05 16:56:35 +08:00
大小写问题
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 回款
|
||||||
|
/// </summary>
|
||||||
|
public class CollectionInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 采购订单id
|
||||||
|
/// </summary>
|
||||||
|
public long PurchaseId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///回款钱
|
||||||
|
/// </summary>
|
||||||
|
public float CollectionMoney { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.DtoModel.ERP.PurchaseDetails;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||||
|
{
|
||||||
|
public class PurchaseCreateInput
|
||||||
|
{
|
||||||
|
public string Code { get; set; } = string.Empty;
|
||||||
|
public DateTime? NeedTime { get; set; }
|
||||||
|
public string Buyer { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
|
||||||
|
public long SupplierId { get; set; }
|
||||||
|
|
||||||
|
public List<PurchaseDetailsCreateUpdateInput>? PurchaseDetails { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||||
|
{
|
||||||
|
public class PurchaseGetListInput
|
||||||
|
{
|
||||||
|
public string? Code { get; set; }
|
||||||
|
public DateTime? NeedTime { get; set; }
|
||||||
|
public string? Buyer { get; set; }
|
||||||
|
public PurchaseStateEnum? PurchaseState { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||||
|
{
|
||||||
|
public class PurchaseUpdateInput : EntityDto<long>
|
||||||
|
{
|
||||||
|
public string? Code { get; set; }
|
||||||
|
public DateTime NeedTime { get; set; }
|
||||||
|
public string? Buyer { get; set; }
|
||||||
|
public long TotalMoney { get; set; }
|
||||||
|
public long PaidMoney { get; set; }
|
||||||
|
|
||||||
|
public string? Remarks { get; set; }
|
||||||
|
public PurchaseStateEnum PurchaseState { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Purchase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 收货
|
||||||
|
/// </summary>
|
||||||
|
public class ReceiptInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 采购订单id
|
||||||
|
/// </summary>
|
||||||
|
public long PurchaseId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ReceiptDetails
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单子表id
|
||||||
|
/// </summary>
|
||||||
|
public long PurchaseDatilesId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 收货数量
|
||||||
|
/// </summary>
|
||||||
|
public long Number { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Stock.ConstConfig
|
||||||
|
{
|
||||||
|
public class StockConst
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Stock.MapperConfig
|
||||||
|
{
|
||||||
|
public class SuppliERProfile:Profile
|
||||||
|
{
|
||||||
|
public SuppliERProfile()
|
||||||
|
{
|
||||||
|
CreateMap<StockCreateUpdateInput, StockEntity>();
|
||||||
|
CreateMap<StockEntity, StockGetListOutput>();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Stock
|
||||||
|
{
|
||||||
|
public class StockCreateUpdateInput : EntityDto<long>
|
||||||
|
{
|
||||||
|
public long WarehouseId { get; set; }
|
||||||
|
public long MaterialId { get; set; }
|
||||||
|
public long Number { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Stock
|
||||||
|
{
|
||||||
|
public class StockGetListInput
|
||||||
|
{
|
||||||
|
|
||||||
|
public long Number { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Stock
|
||||||
|
{
|
||||||
|
public class StockGetListOutput: EntityDto<long>
|
||||||
|
{
|
||||||
|
public string MaterialName { get; set; } = string.Empty;
|
||||||
|
public string UnitName { get; set; } = string.Empty;
|
||||||
|
public string WarehouseName { get; set; } = string.Empty;
|
||||||
|
public long Number { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.StockDetails.ConstConfig
|
||||||
|
{
|
||||||
|
public class StockDetailsConst
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.StockDetails.MapperConfig
|
||||||
|
{
|
||||||
|
public class SuppliERProfile:Profile
|
||||||
|
{
|
||||||
|
public SuppliERProfile()
|
||||||
|
{
|
||||||
|
CreateMap<StockDetailsCreateUpdateInput, StockDetailsEntity>();
|
||||||
|
CreateMap<StockDetailsEntity, StockDetailsGetListOutput>();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.StockDetails
|
||||||
|
{
|
||||||
|
public class StockDetailsCreateUpdateInput : EntityDto<long>
|
||||||
|
{
|
||||||
|
public long WarehouseId { get; set; }
|
||||||
|
public long MaterialId { get; set; }
|
||||||
|
public long Number { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
public StockDetailsTypeEnum StockDetailsType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.StockDetails
|
||||||
|
{
|
||||||
|
public class StockDetailsGetListInput
|
||||||
|
{
|
||||||
|
public long WarehouseName { get; set; }
|
||||||
|
public long MaterialName { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
public StockDetailsTypeEnum StockDetailsType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.StockDetails
|
||||||
|
{
|
||||||
|
public class StockDetailsGetListOutput: EntityDto<long>
|
||||||
|
{
|
||||||
|
public long WarehouseName { get; set; }
|
||||||
|
public long MaterialName { get; set; }
|
||||||
|
public long Number { get; set; }
|
||||||
|
public string? Quality { get; set; }
|
||||||
|
public DateTime StockDetailsTime { get; set; }
|
||||||
|
public StockDetailsTypeEnum StockDetailsType { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Supplier.ConstConfig
|
||||||
|
{
|
||||||
|
public class SupplierConst
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.ERP.Entitys;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Supplier.MapperConfig
|
||||||
|
{
|
||||||
|
public class SupplierProfile:Profile
|
||||||
|
{
|
||||||
|
public SupplierProfile()
|
||||||
|
{
|
||||||
|
CreateMap<SupplierCreateUpdateInput, SupplierEntity>();
|
||||||
|
CreateMap<SupplierEntity, SupplierGetListOutput>();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Supplier
|
||||||
|
{
|
||||||
|
public class SupplierCreateUpdateInput : EntityDto<long>
|
||||||
|
{
|
||||||
|
public string Code { get; set; } = string.Empty;
|
||||||
|
public string Name { get; set; }= string.Empty;
|
||||||
|
public string? Address { get; set; }
|
||||||
|
public long? Phone { get; set; }
|
||||||
|
public string? Fax { get; set; }
|
||||||
|
public string? Email { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Yi.Framework.Model.Base;
|
||||||
|
|
||||||
|
namespace Yi.Framework.DtoModel.ERP.Supplier
|
||||||
|
{
|
||||||
|
public class SupplierGetListOutput: EntityDto<long>
|
||||||
|
{
|
||||||
|
public string Code { get; set; } = string.Empty;
|
||||||
|
public string Name { get; set; }= string.Empty;
|
||||||
|
public string? Address { get; set; }
|
||||||
|
public long? Phone { get; set; }
|
||||||
|
public string? Fax { get; set; }
|
||||||
|
public string? Email { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
45
Yi.Vue3.X.RuoYi/src/api/bbs/articleApi.js
Normal file
45
Yi.Vue3.X.RuoYi/src/api/bbs/articleApi.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/article/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/article/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/article/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/article/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/article/delList',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 分页查询
|
// 分页查询
|
||||||
export function listData(query) {
|
export function listData(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/stock/pageList',
|
url: '/material/pageList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@@ -12,7 +12,7 @@ export function listData(query) {
|
|||||||
// id查询
|
// id查询
|
||||||
export function getData(code) {
|
export function getData(code) {
|
||||||
return request({
|
return request({
|
||||||
url: '/stock/getById/' + code,
|
url: '/material/getById/' + code,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ export function getData(code) {
|
|||||||
// 新增
|
// 新增
|
||||||
export function addData(data) {
|
export function addData(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/stock/create',
|
url: '/material/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -29,7 +29,7 @@ export function addData(data) {
|
|||||||
// 修改
|
// 修改
|
||||||
export function updateData(id,data) {
|
export function updateData(id,data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/stock/update/${id}`,
|
url: `/material/update/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -38,7 +38,7 @@ export function updateData(id,data) {
|
|||||||
// 删除
|
// 删除
|
||||||
export function delData(code) {
|
export function delData(code) {
|
||||||
return request({
|
return request({
|
||||||
url: '/stock/del',
|
url: '/material/del',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data:"string"==typeof(code)?[code]:code
|
data:"string"==typeof(code)?[code]:code
|
||||||
})
|
})
|
||||||
45
Yi.Vue3.X.RuoYi/src/api/erp/purchaseApi.js
Normal file
45
Yi.Vue3.X.RuoYi/src/api/erp/purchaseApi.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/purchase/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/purchase/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
51
Yi.Vue3.X.RuoYi/src/api/erp/purchaseDetailsApi.js
Normal file
51
Yi.Vue3.X.RuoYi/src/api/erp/purchaseDetailsApi.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
export function getListByPurchaseId(id){
|
||||||
|
return request({
|
||||||
|
url: `/purchaseDetails/getListByPurchaseId/${id}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/purchaseDetails/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/purchaseDetails/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/purchaseDetails/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/purchaseDetails/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/purchaseDetails/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
45
Yi.Vue3.X.RuoYi/src/api/erp/stockDetailsApi.js
Normal file
45
Yi.Vue3.X.RuoYi/src/api/erp/stockDetailsApi.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/stockDetails/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/stockDetails/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/stockDetails/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/stockDetails/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/stockDetails/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
53
Yi.Vue3.X.RuoYi/src/api/erp/supplierApi.js
Normal file
53
Yi.Vue3.X.RuoYi/src/api/erp/supplierApi.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 全查询
|
||||||
|
export function allData() {
|
||||||
|
return request({
|
||||||
|
url: '/supplier/getList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/supplier/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/supplier/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/supplier/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/supplier/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/supplier/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
53
Yi.Vue3.X.RuoYi/src/api/erp/unitApi.js
Normal file
53
Yi.Vue3.X.RuoYi/src/api/erp/unitApi.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 全查询
|
||||||
|
export function allData() {
|
||||||
|
return request({
|
||||||
|
url: '/unit/getList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/unit/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/unit/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/unit/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/unit/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/unit/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
45
Yi.Vue3.X.RuoYi/src/api/erp/warehouseApi.js
Normal file
45
Yi.Vue3.X.RuoYi/src/api/erp/warehouseApi.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 分页查询
|
||||||
|
export function listData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/warehouse/pageList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// id查询
|
||||||
|
export function getData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/warehouse/getById/' + code,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/warehouse/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export function updateData(id,data) {
|
||||||
|
return request({
|
||||||
|
url: `/warehouse/update/${id}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function delData(code) {
|
||||||
|
return request({
|
||||||
|
url: '/warehouse/del',
|
||||||
|
method: 'delete',
|
||||||
|
data:"string"==typeof(code)?[code]:code
|
||||||
|
})
|
||||||
|
}
|
||||||
11
Yi.Vue3.X.RuoYi/src/api/file.js
Normal file
11
Yi.Vue3.X.RuoYi/src/api/file.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function
|
||||||
|
upload(type,data){
|
||||||
|
return request({
|
||||||
|
url: `/file/upload/${type}`,
|
||||||
|
headers:{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"},
|
||||||
|
method: 'POST',
|
||||||
|
data:data
|
||||||
|
});
|
||||||
|
}
|
||||||
402
Yi.Vue3.X.RuoYi/src/views/ERP/material/index.vue
Normal file
402
Yi.Vue3.X.RuoYi/src/views/ERP/material/index.vue
Normal file
@@ -0,0 +1,402 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="物料名称" prop="name" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入物料名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编号" prop="code" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入物料编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:material:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:material:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:material:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:material:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="物料编号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column label="物料名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="单位" align="center" prop="unitName" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag>{{ scope.row.unitName }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="物料编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入物料编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="物料名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入物料名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="物料单位" prop="unitName">
|
||||||
|
<el-select v-model="form.unitName" filterable placeholder="请选择单位">
|
||||||
|
<el-option
|
||||||
|
v-for="item in unitList"
|
||||||
|
:key="item.name"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.name"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/materialApi";
|
||||||
|
|
||||||
|
import {
|
||||||
|
allData as allUnitData,
|
||||||
|
} from "@/api/erp/unitApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const unitList=ref([]);
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "物料编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
|
||||||
|
unitName: [{ required: true, message: "物料单位不能为空", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**查询全部单位列表*/
|
||||||
|
function getUnitList() {
|
||||||
|
allUnitData().then(
|
||||||
|
(response) => {
|
||||||
|
unitList.value = response.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: undefined,
|
||||||
|
isDeleted: false,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryRef=ref(null);
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加物料";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改物料";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id,form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
getUnitList();
|
||||||
|
</script>
|
||||||
775
Yi.Vue3.X.RuoYi/src/views/ERP/purchase/index.vue
Normal file
775
Yi.Vue3.X.RuoYi/src/views/ERP/purchase/index.vue
Normal file
@@ -0,0 +1,775 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="90px"
|
||||||
|
>
|
||||||
|
<el-form-item label="供应商名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="采购单编号" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入采购单编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="采购员" prop="buyer">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入采购员"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="buyer"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:purchase:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:purchase:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:purchase:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:purchase:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="采购单号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="供应商"
|
||||||
|
align="center"
|
||||||
|
prop="supplierName"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="需求时间"
|
||||||
|
align="center"
|
||||||
|
prop="needTime"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="采购员"
|
||||||
|
align="center"
|
||||||
|
prop="buyer"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="总共金额"
|
||||||
|
align="center"
|
||||||
|
prop="totalMoney"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="已支付金额"
|
||||||
|
align="center"
|
||||||
|
prop="paidMoney"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="采购状态"
|
||||||
|
align="center"
|
||||||
|
prop="purchaseState"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag>{{purchaseStateComputed(scope.row.purchaseState)}}</el-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remarks"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleGet(scope.row)"
|
||||||
|
v-hasPermi="['erp:purchase:edit']"
|
||||||
|
>查看</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['erp:purchase:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['erp:purchase:remove']"
|
||||||
|
>结束</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['erp:purchase:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="1200px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="采购单编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入采购单编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="供应商" prop="supplierName">
|
||||||
|
<el-select
|
||||||
|
v-model="form.supplierId"
|
||||||
|
filterable
|
||||||
|
placeholder="请选择供应商"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in supplierList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="采购单员" prop="buyer">
|
||||||
|
<el-input v-model="form.buyer" placeholder="请输入采购单员" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="需求时间" prop="needTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="form.needTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择一个日期"
|
||||||
|
size="default"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :offset="8" :span="8">
|
||||||
|
<el-form-item label="总金额">
|
||||||
|
{{ showTotalMoney }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="物料信息">
|
||||||
|
<el-table :data="form.purchaseDetails" border style="width: 100%">
|
||||||
|
<el-table-column width="90">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
@click="delMaterialRow(scope.$index)"
|
||||||
|
icon="Delete"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column type="index" label="序号" width="60" />
|
||||||
|
<el-table-column prop="materialName" label="物料" width="180" />
|
||||||
|
<el-table-column prop="materialUnit" label="单位" width="180" />
|
||||||
|
<el-table-column prop="unitPrice" label="单价" width="180">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.unitPrice" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="totalNumber"
|
||||||
|
label="采购数量"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.totalNumber" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="remarks" label="备注">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.remarks" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-button
|
||||||
|
class="form-add-btn"
|
||||||
|
type="primary"
|
||||||
|
icon="CirclePlus"
|
||||||
|
plain
|
||||||
|
@click="materialHandleAdd"
|
||||||
|
>添加物料</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
:rows="5"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增物料的对话框--------------------- -->
|
||||||
|
<el-dialog
|
||||||
|
title="添加物料"
|
||||||
|
v-model="openMaterial"
|
||||||
|
width="800px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="queryMaterialParams"
|
||||||
|
ref="queryMaterialRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="70px"
|
||||||
|
>
|
||||||
|
<el-form-item label="物料名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryMaterialParams.name"
|
||||||
|
placeholder="请输入物料名称"
|
||||||
|
clearable
|
||||||
|
style="width: 150px"
|
||||||
|
@keyup.enter="handleMaterialQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编码" prop="code">
|
||||||
|
<el-input
|
||||||
|
v-model="queryMaterialParams.code"
|
||||||
|
placeholder="请输入物料编码"
|
||||||
|
clearable
|
||||||
|
style="width: 150px"
|
||||||
|
@keyup.enter="handleMaterialQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleMaterialQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetMaterialQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 物料表单 -->
|
||||||
|
<el-table
|
||||||
|
style="width: 100%"
|
||||||
|
:data="materialList"
|
||||||
|
@selection-change="materialHandleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column property="code" label="物料编码" />
|
||||||
|
<el-table-column property="name" label="物料信息" />
|
||||||
|
<el-table-column property="unitName" label="物料单位" />
|
||||||
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="materialTotal > 0"
|
||||||
|
:total="materialTotal"
|
||||||
|
v-model:page="queryMaterialParams.pageNum"
|
||||||
|
v-model:limit="queryMaterialParams.pageSize"
|
||||||
|
@pagination="getMaterialList"
|
||||||
|
/>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitMaterialForm"
|
||||||
|
>确 定</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="materialCancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是采购订单详情对话框--------------------- -->
|
||||||
|
<el-dialog
|
||||||
|
title="订单详情"
|
||||||
|
v-model="openDetails"
|
||||||
|
width="1200px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="dataDetailsRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="物料" prop="code">
|
||||||
|
<el-input placeholder="请输入物料" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="物料信息">
|
||||||
|
<el-table :data="form.purchaseDetails" border style="width: 100%" >
|
||||||
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||||
|
<el-table-column prop="materialName" label="物料" width="180" align="center" />
|
||||||
|
<el-table-column prop="materialUnit" label="单位" width="180" align="center" />
|
||||||
|
<el-table-column prop="unitPrice" label="单价" width="180" align="center">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="totalNumber"
|
||||||
|
label="采购数量"
|
||||||
|
width="180"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="remarks" label="备注" >
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="订单备注" prop="remarks">
|
||||||
|
{{ form.remarks }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/purchaseApi";
|
||||||
|
import { allData as supplierlAllData } from "@/api/erp/supplierApi";
|
||||||
|
import { listData as materialListData } from "@/api/erp/materialApi";
|
||||||
|
import { getListByPurchaseId } from "@/api/erp/purchaseDetailsApi";
|
||||||
|
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
import { computed } from "@vue/runtime-core";
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
//详情物料对话框
|
||||||
|
const openDetails = ref(false);
|
||||||
|
|
||||||
|
//添加物料对话框
|
||||||
|
const openMaterial = ref(false);
|
||||||
|
const materialList = ref([]);
|
||||||
|
const materialTotal = ref(0);
|
||||||
|
const materialMultipleSelection = ref([]);
|
||||||
|
|
||||||
|
//选择框供应商
|
||||||
|
const supplierList = ref([]);
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {
|
||||||
|
supplierId: undefined,
|
||||||
|
totalMoney: 0,
|
||||||
|
purchaseDetails: [],
|
||||||
|
},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
buyer: undefined,
|
||||||
|
},
|
||||||
|
queryMaterialParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "采购单编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "采购单名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, queryMaterialParams, rules } = toRefs(data);
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加采购单";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改采购单";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id, form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
/** 查看详情 */
|
||||||
|
function handleGet(row) {
|
||||||
|
getListByPurchaseId(row.id).then((response) => {
|
||||||
|
form.value.purchaseDetails = response.data;
|
||||||
|
});
|
||||||
|
form.value.remarks=row.remarks;
|
||||||
|
openDetails.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------这里开始是物料对话框的数据-----------
|
||||||
|
/** 物料查询列表 */
|
||||||
|
function getMaterialList() {
|
||||||
|
materialListData(
|
||||||
|
proxy.addDateRange(queryMaterialParams.value, dateRange.value)
|
||||||
|
).then((response) => {
|
||||||
|
materialList.value = response.data.data;
|
||||||
|
materialTotal.value = response.data.total;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 表单改变选择 */
|
||||||
|
function materialHandleSelectionChange(select) {
|
||||||
|
materialMultipleSelection.value = select;
|
||||||
|
}
|
||||||
|
/** 打开对话框 */
|
||||||
|
function materialHandleAdd() {
|
||||||
|
getMaterialList();
|
||||||
|
openMaterial.value = true;
|
||||||
|
}
|
||||||
|
/** 搜索 */
|
||||||
|
function handleMaterialQuery() {
|
||||||
|
getMaterialList();
|
||||||
|
}
|
||||||
|
/**重置表单 */
|
||||||
|
function resetMaterialQuery() {
|
||||||
|
proxy.resetForm("queryMaterialRef");
|
||||||
|
handleMaterialQuery();
|
||||||
|
}
|
||||||
|
/** 提交物料表单 */
|
||||||
|
function submitMaterialForm() {
|
||||||
|
if (materialMultipleSelection.value.length > 0) {
|
||||||
|
const purchaseDetailsList = materialMultipleSelection.value.map((u) => {
|
||||||
|
return { materialName: u.name, materialUnit: u.unitName };
|
||||||
|
});
|
||||||
|
|
||||||
|
form.value.purchaseDetails.push(...purchaseDetailsList);
|
||||||
|
materialCancel();
|
||||||
|
} else {
|
||||||
|
proxy.$modal.msgError("请选择至少一个物料");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 取消对话框 */
|
||||||
|
function materialCancel() {
|
||||||
|
openMaterial.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除物料行 */
|
||||||
|
function delMaterialRow(index) {
|
||||||
|
form.value.purchaseDetails.splice(index, 1);
|
||||||
|
}
|
||||||
|
// watch(data.form, (newValue, oldValue) => {
|
||||||
|
// console.log(newValue.purchaseDetails,999)
|
||||||
|
// }
|
||||||
|
// , { immdiate: true })
|
||||||
|
/** 计算属性:实时计算展示的价格 */
|
||||||
|
const showTotalMoney = computed(() => {
|
||||||
|
let res = 0;
|
||||||
|
form.value.purchaseDetails.forEach((details) => {
|
||||||
|
if (details.unitPrice != undefined && details.totalNumber != undefined) {
|
||||||
|
res += details.unitPrice * details.totalNumber;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
|
||||||
|
const purchaseStateEnum=[
|
||||||
|
|
||||||
|
{key:"build",name:"新建"},
|
||||||
|
{key:"run",name:"进行中"},
|
||||||
|
{key:"complete",name:"已完成"},
|
||||||
|
{key:"end",name:"已结束"},
|
||||||
|
]
|
||||||
|
/** 计算属性:采购订单状态 */
|
||||||
|
const purchaseStateComputed= computed(()=>
|
||||||
|
(purchaseState) => {
|
||||||
|
return purchaseStateEnum[purchaseState].name
|
||||||
|
});
|
||||||
|
//-------------这里开始是供货商的数据-----------
|
||||||
|
/** 供货商查询列表 */
|
||||||
|
function getSupplierList() {
|
||||||
|
supplierlAllData().then((response) => {
|
||||||
|
supplierList.value = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
getSupplierList();
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.form-add-btn {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
363
Yi.Vue3.X.RuoYi/src/views/ERP/stock/index.vue
Normal file
363
Yi.Vue3.X.RuoYi/src/views/ERP/stock/index.vue
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="库存名称" prop="name" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入库存名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库存编号" prop="code" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入库存编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:stock:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:stock:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:stock:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:stock:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="库存编号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column label="库存名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="库存编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入库存编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="库存名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入库存名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/stockApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "库存编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "库存名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加库存";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改库存";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id,form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
390
Yi.Vue3.X.RuoYi/src/views/ERP/supplier/index.vue
Normal file
390
Yi.Vue3.X.RuoYi/src/views/ERP/supplier/index.vue
Normal file
@@ -0,0 +1,390 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="供应商名称" prop="name" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入供应商名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="供应商编号" prop="code" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入供应商编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:supplier:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:supplier:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:supplier:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:supplier:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="供应商编号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column label="供应商名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="详细地址" align="center" prop="address" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="联系人" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="联系电话" align="center" prop="phone" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="传真" align="center" prop="fax" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="邮箱" align="center" prop="email" :show-overflow-tooltip="true"/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="供应商编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入供应商编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="供应商名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入供应商名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-input v-model="form.address" placeholder="请输入地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="供应商编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入供应商编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="联系电话" prop="phone">
|
||||||
|
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="传真" prop="fax">
|
||||||
|
<el-input v-model="form.fax" placeholder="请输入传真" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="邮箱" prop="email">
|
||||||
|
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/supplierApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "供应商编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加供应商";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改供应商";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id,form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
363
Yi.Vue3.X.RuoYi/src/views/ERP/unit/index.vue
Normal file
363
Yi.Vue3.X.RuoYi/src/views/ERP/unit/index.vue
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="单位名称" prop="name" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入单位名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单位编号" prop="code" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入单位编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:unit:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:unit:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:unit:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:unit:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="单位编号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column label="单位名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="单位编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入单位编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="单位名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入单位名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/unitApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "单位编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "单位名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加单位";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改单位";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id,form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
368
Yi.Vue3.X.RuoYi/src/views/ERP/warehouse/index.vue
Normal file
368
Yi.Vue3.X.RuoYi/src/views/ERP/warehouse/index.vue
Normal file
@@ -0,0 +1,368 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="仓库名称" prop="name" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入仓库名称"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库编号" prop="code" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
placeholder="请输入仓库编号"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
prop="code"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['erp:warehouse:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['erp:warehouse:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['erp:warehouse:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['erp:warehouse:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="dataList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<!-----------------------这里开始就是数据表单的全部列------------------------>
|
||||||
|
<el-table-column label="仓库编号" align="center" prop="code" />
|
||||||
|
|
||||||
|
<el-table-column label="仓库名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||||
|
|
||||||
|
<el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
||||||
|
<!-- <el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['business:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- ---------------------这里是新增和更新的对话框--------------------- -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="仓库编码" prop="code">
|
||||||
|
<el-input v-model="form.code" placeholder="请输入仓库编码" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="仓库名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入仓库名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="备注" prop="remarks">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remarks"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/erp/warehouseApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const dataList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [{ required: true, message: "仓库编号不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
dataList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: undefined,
|
||||||
|
isDeleted: false,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加仓库";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改仓库";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value.id,form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
381
Yi.Vue3.X.RuoYi/src/views/bbs/article/index.vue
Normal file
381
Yi.Vue3.X.RuoYi/src/views/bbs/article/index.vue
Normal file
@@ -0,0 +1,381 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="文章标题" prop="title" >
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
placeholder="请输入文章标题"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.isDeleted"
|
||||||
|
placeholder="状态"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" style="width: 308px">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['bbs:article:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['bbs:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['bbs:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['bbs:article:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="articleList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="编号" align="center" prop="id" />
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="文章标题"
|
||||||
|
align="center"
|
||||||
|
prop="title"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="文章部分内容"
|
||||||
|
align="left"
|
||||||
|
prop="content"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{scope.row.content.slice(0,30)}}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="状态" align="center" prop="isDeleted">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag
|
||||||
|
:options="sys_normal_disable"
|
||||||
|
:value="scope.row.isDeleted"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleOpen(scope.row)"
|
||||||
|
|
||||||
|
>文章详情</el-button
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['bbs:article:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['bbs:article:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="dataRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="文章标题" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入文章标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="isDeleted">
|
||||||
|
<el-radio-group v-model="form.isDeleted">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="JSON.parse(dict.value)"
|
||||||
|
>{{ dict.label }}</el-radio
|
||||||
|
>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listData,
|
||||||
|
getData,
|
||||||
|
delData,
|
||||||
|
addData,
|
||||||
|
updateData,
|
||||||
|
} from "@/api/bbs/articleApi";
|
||||||
|
import { ref } from "@vue/reactivity";
|
||||||
|
import { computed } from "@vue/runtime-core";
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||||
|
|
||||||
|
const articleList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const dateRange = ref([]);
|
||||||
|
const articleDialogVisible=ref(false);
|
||||||
|
const articleId=ref("");
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
title: undefined,
|
||||||
|
isDeleted: undefined,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
title: [{ required: true, message: "文章标题不能为空", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listData(proxy.addDateRange(queryParams.value, dateRange.value)).then(
|
||||||
|
(response) => {
|
||||||
|
articleList.value = response.data.data;
|
||||||
|
total.value = response.data.total;
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 取消按钮 */
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
/** 表单重置 */
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
id: undefined,
|
||||||
|
title: undefined,
|
||||||
|
isDeleted: false,
|
||||||
|
remark: undefined,
|
||||||
|
};
|
||||||
|
proxy.resetForm("dataRef");
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
dateRange.value = [];
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加文章";
|
||||||
|
}
|
||||||
|
/** 多选框选中数据 */
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.id);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const id = row.id || ids.value;
|
||||||
|
getData(id).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改文章类型";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["dataRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.id != undefined) {
|
||||||
|
updateData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addData(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const delIds = row.id || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除字典编号为"' + delIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delData(delIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {}
|
||||||
|
|
||||||
|
/** 打开文章详情 */
|
||||||
|
function handleOpen(row){
|
||||||
|
articleId.value=row.id;
|
||||||
|
articleDialogVisible.value=true;
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user