main
liangzongpeng 2024-06-04 18:20:10 +08:00
parent 36cbd6b1d1
commit 1c3b1a6501
24 changed files with 1043 additions and 166 deletions

View File

@ -8,7 +8,8 @@
{ {
//"ConfigId": "1300000000001", // - //"ConfigId": "1300000000001", // -
"DbType": "MySql", // MySqlSqlServerSqliteOraclePostgreSQLDmKdbndpOscarMySqlConnectorAccessOpenGaussQuestDBHGClickHouseGBaseOdbcCustom "DbType": "MySql", // MySqlSqlServerSqliteOraclePostgreSQLDmKdbndpOscarMySqlConnectorAccessOpenGaussQuestDBHGClickHouseGBaseOdbcCustom
"ConnectionString": "Server=139.199.191.197;Port=3306;Database=b-guanwei;Uid=b-guanwei;Pwd=hfc123456;SslMode=none;AllowPublicKeyRetrieval=True;", // "ConnectionString": "Server=gz-cdb-76wyaumn.sql.tencentcdb.com;Port=29867;Database=guanwei-;Uid=guanwei-dig;Pwd=hfc123456;SslMode=none;AllowPublicKeyRetrieval=True;", //
//"ConnectionString": "Server=139.199.191.197;Port=3306;Database=b-guanwei;Uid=b-guanwei;Pwd=hfc123456;SslMode=none;AllowPublicKeyRetrieval=True;", //
//"SlaveConnectionConfigs": [ // / //"SlaveConnectionConfigs": [ // /
// { // {
// "HitRate": 10, // "HitRate": 10,

View File

@ -0,0 +1,28 @@
using Admin.NET.Core;
namespace Admin.NET.Application.Entity;
/// <summary>
/// 生产线
/// </summary>
[SugarTable("ProductionLine","生产线")]
public class ProductionLine : EntityTenant
{
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnName = "Name", ColumnDescription = "名称", Length = 32)]
public string? Name { get; set; }
/// <summary>
/// 地址
/// </summary>
[SugarColumn(ColumnName = "Address", ColumnDescription = "地址", Length = 32)]
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 64)]
public string? Remarks { get; set; }
}

View File

@ -119,7 +119,9 @@ public class MaterialsService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "List")] [ApiDescriptionSettings(Name = "List")]
public async Task<List<MaterialsOutput>> List() public async Task<List<MaterialsOutput>> List()
{ {
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<MaterialsOutput>().ToListAsync(); var list = await _rep.AsQueryable().Where(a => !a.IsDelete).Select<MaterialsOutput>().ToListAsync();
list.Reverse();
return list;
} }
/// <summary> /// <summary>

View File

@ -39,7 +39,7 @@ public class ProductWarehousingService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Page")] [ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductWarehousingOutput>> Page(ProductWarehousingInput input) public async Task<SqlSugarPagedList<ProductWarehousingOutput>> Page(ProductWarehousingInput input)
{ {
var query = _rep.AsQueryable() var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u => .WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim()) u.Name.Contains(input.SearchKey.Trim())
|| u.GoodCode.Contains(input.SearchKey.Trim()) || u.GoodCode.Contains(input.SearchKey.Trim())
@ -132,34 +132,43 @@ public class ProductWarehousingService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Add")] [ApiDescriptionSettings(Name = "Add")]
public async Task<long> Add(AddProductWarehousingInput input) public async Task<long> Add(AddProductWarehousingInput input)
{ {
var materials = await _materialsService.Detail(new QueryByIdMaterialsInput() { Id = input.MaterialsId.Value });
SysUnitOutput unit = null; SysUnitOutput unit = null;
string unitScale = string.Empty; try
if (materials != null)
{ {
input.Specifications = materials.Specifications; var materials = await _materialsService.Detail(new QueryByIdMaterialsInput() { Id = input.MaterialsId.Value });
input.CodeNum = materials.CodeNum;
input.Brand = materials.Brand; string unitScale = string.Empty;
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId.Value); if (materials != null)
unit = units.Find(a => a.Name == input.Unit);
if (unit != null)
{ {
input.BaseCount = input.Count * unit.Rate; input.Specifications = materials.Specifications;
input.BaseUnit = units.FirstOrDefault(a => a.IsBaseUnit == true).Name; input.CodeNum = materials.CodeNum;
unitScale = SysUnitService.GetUnitScale(units); input.Brand = materials.Brand;
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId.Value);
unit = units.Find(a => a.Name == input.Unit);
if (unit != null)
{
input.BaseCount = input.Count * unit.Rate;
input.BaseUnit = units.FirstOrDefault(a => a.IsBaseUnit == true).Name;
unitScale = SysUnitService.GetUnitScale(units);
}
input.GoodCode = materials.BarCode;
input.MaterialsNum = materials.CodeNum;
input.UnitPrice = materials.Price;
input.Custom = input.Supplier;
if (unit != null)
{
input.BaseCount = input.Count * unit.Rate;
}
input.TotalPrice = input.BaseCount * materials.Price;
input.PackageScale = unitScale;
input.Classify = (await _materialClassifyService.Detail(new QueryByIdMaterialClassifyInput() { Id = materials.Classify })).Name;
} }
input.GoodCode = materials.BarCode;
input.MaterialsNum = materials.CodeNum;
input.UnitPrice = materials.Price;
input.Custom = input.Supplier;
if (unit != null)
{
input.BaseCount = input.Count * unit.Rate;
}
input.TotalPrice = input.BaseCount * materials.Price;
input.PackageScale = unitScale;
input.Classify = (await _materialClassifyService.Detail(new QueryByIdMaterialClassifyInput() { Id = materials.Classify })).Name;
} }
catch (Exception ex)
{
}
var entity = input.Adapt<ProductWarehousing>(); var entity = input.Adapt<ProductWarehousing>();

View File

@ -0,0 +1,68 @@
namespace Admin.NET.Application;
/// <summary>
/// 生产线输出参数
/// </summary>
public class ProductionLineDto
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 创建者Id
/// </summary>
public long? CreateUserId { get; set; }
/// <summary>
/// 创建者姓名
/// </summary>
public string? CreateUserName { get; set; }
/// <summary>
/// 修改者Id
/// </summary>
public long? UpdateUserId { get; set; }
/// <summary>
/// 修改者姓名
/// </summary>
public string? UpdateUserName { get; set; }
/// <summary>
/// 软删除
/// </summary>
public bool IsDelete { get; set; }
}

View File

@ -0,0 +1,134 @@
using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
namespace Admin.NET.Application;
/// <summary>
/// 生产线基础输入参数
/// </summary>
public class ProductionLineBaseInput
{
/// <summary>
/// 名称
/// </summary>
public virtual string? Name { get; set; }
/// <summary>
/// 地址
/// </summary>
public virtual string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public virtual string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public virtual long? TenantId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public virtual DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public virtual DateTime? UpdateTime { get; set; }
/// <summary>
/// 创建者Id
/// </summary>
public virtual long? CreateUserId { get; set; }
/// <summary>
/// 创建者姓名
/// </summary>
public virtual string? CreateUserName { get; set; }
/// <summary>
/// 修改者Id
/// </summary>
public virtual long? UpdateUserId { get; set; }
/// <summary>
/// 修改者姓名
/// </summary>
public virtual string? UpdateUserName { get; set; }
/// <summary>
/// 软删除
/// </summary>
public virtual bool IsDelete { get; set; }
}
/// <summary>
/// 生产线分页查询输入参数
/// </summary>
public class ProductionLineInput : BasePageInput
{
/// <summary>
/// 关键字查询
/// </summary>
public string? SearchKey { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
}
/// <summary>
/// 生产线增加输入参数
/// </summary>
public class AddProductionLineInput : ProductionLineBaseInput
{
/// <summary>
/// 软删除
/// </summary>
[Required(ErrorMessage = "软删除不能为空")]
public override bool IsDelete { get; set; }
}
/// <summary>
/// 生产线删除输入参数
/// </summary>
public class DeleteProductionLineInput : BaseIdInput
{
}
/// <summary>
/// 生产线更新输入参数
/// </summary>
public class UpdateProductionLineInput : ProductionLineBaseInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 生产线主键查询输入参数
/// </summary>
public class QueryByIdProductionLineInput : DeleteProductionLineInput
{
}

View File

@ -0,0 +1,70 @@
namespace Admin.NET.Application;
/// <summary>
/// 生产线输出参数
/// </summary>
public class ProductionLineOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string? Name { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? Remarks { get; set; }
/// <summary>
/// 租户Id
/// </summary>
public long? TenantId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 创建者Id
/// </summary>
public long? CreateUserId { get; set; }
/// <summary>
/// 创建者姓名
/// </summary>
public string? CreateUserName { get; set; }
/// <summary>
/// 修改者Id
/// </summary>
public long? UpdateUserId { get; set; }
/// <summary>
/// 修改者姓名
/// </summary>
public string? UpdateUserName { get; set; }
/// <summary>
/// 软删除
/// </summary>
public bool IsDelete { get; set; }
}

View File

@ -0,0 +1,110 @@
using Admin.NET.Core.Service;
using Admin.NET.Application.Const;
using Admin.NET.Application.Entity;
using Microsoft.AspNetCore.Http;
namespace Admin.NET.Application;
/// <summary>
/// 生产线服务
/// </summary>
[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 100)]
public class ProductionLineService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<ProductionLine> _rep;
public ProductionLineService(SqlSugarRepository<ProductionLine> rep)
{
_rep = rep;
}
/// <summary>
/// 分页查询生产线
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Page")]
public async Task<SqlSugarPagedList<ProductionLineOutput>> Page(ProductionLineInput input)
{
var query = _rep.AsQueryable().Where(a => !a.IsDelete)
.WhereIF(!string.IsNullOrWhiteSpace(input.SearchKey), u =>
u.Name.Contains(input.SearchKey.Trim())
|| u.Address.Contains(input.SearchKey.Trim())
|| u.Remarks.Contains(input.SearchKey.Trim())
)
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Address), u => u.Address.Contains(input.Address.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Remarks), u => u.Remarks.Contains(input.Remarks.Trim()))
.Select<ProductionLineOutput>();
return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
}
/// <summary>
/// 增加生产线
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Add")]
public async Task<long> Add(AddProductionLineInput input)
{
var entity = input.Adapt<ProductionLine>();
await _rep.InsertAsync(entity);
return entity.Id;
}
/// <summary>
/// 删除生产线
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Delete")]
public async Task Delete(DeleteProductionLineInput input)
{
var entity = await _rep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
await _rep.FakeDeleteAsync(entity); //假删除
//await _rep.DeleteAsync(entity); //真删除
}
/// <summary>
/// 更新生产线
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "Update")]
public async Task Update(UpdateProductionLineInput input)
{
var entity = input.Adapt<ProductionLine>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 获取生产线
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "Detail")]
public async Task<ProductionLine> Detail([FromQuery] QueryByIdProductionLineInput input)
{
return await _rep.GetFirstAsync(u => u.Id == input.Id);
}
/// <summary>
/// 获取生产线列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "List")]
public async Task<List<ProductionLineOutput>> List()
{
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<ProductionLineOutput>().ToListAsync();
}
}

View File

@ -112,8 +112,8 @@ public class SysUnitService : IDynamicApiController, ITransient
/// <param name="unitGroupId"></param> /// <param name="unitGroupId"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[ApiDescriptionSettings(Name = "List")] [ApiDescriptionSettings(Name = "ListByGroupId")]
public async Task<List<SysUnitOutput>> ListByGroupId(long unitGroupId) public async Task<List<SysUnitOutput>> ListByGroupId(long? unitGroupId)
{ {
return await _rep.AsQueryable().WhereIF(unitGroupId > 0, u => u.GroupUnitId == unitGroupId && !u.IsDelete).OrderBy(a => a.Rate).Select<SysUnitOutput>().ToListAsync(); return await _rep.AsQueryable().WhereIF(unitGroupId > 0, u => u.GroupUnitId == unitGroupId && !u.IsDelete).OrderBy(a => a.Rate).Select<SysUnitOutput>().ToListAsync();
} }

View File

@ -149,6 +149,16 @@ public static class RepositoryExtension
return queryable.OrderByIF(!string.IsNullOrWhiteSpace(orderStr), orderStr); return queryable.OrderByIF(!string.IsNullOrWhiteSpace(orderStr), orderStr);
} }
/// <summary>
/// 排序方式(默认降序)
/// </summary>
/// <param name="queryable"></param>
/// <returns> </returns>
public static ISugarQueryable<T> ToReverse<T>(this ISugarQueryable<T> queryable)
{
return queryable.OrderByIF(false, null);
}
/// <summary> /// <summary>
/// 更新实体并记录差异日志 _rep.UpdateWithDiffLog(entity) /// 更新实体并记录差异日志 _rep.UpdateWithDiffLog(entity)
/// </summary> /// </summary>

View File

@ -6,6 +6,7 @@ enum Api {
Update@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/update', Update@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/update',
Page@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/page', Page@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/page',
Detail@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/detail', Detail@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/detail',
List@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/list',
@foreach (var column in Model.TableField){ @foreach (var column in Model.TableField){
if(@column.EffectType == "fk" && (@column.WhetherAddUpdate == "Y" || column.QueryWhether == "Y")){ if(@column.EffectType == "fk" && (@column.WhetherAddUpdate == "Y" || column.QueryWhether == "Y")){
@:Get@(@column.FkEntityName)@(@column.PropertyName)Dropdown = '/api/@(@Model.LowerClassName)/@(@column.FkEntityName)@(@column.PropertyName)Dropdown', @:Get@(@column.FkEntityName)@(@column.PropertyName)Dropdown = '/api/@(@Model.LowerClassName)/@(@column.FkEntityName)@(@column.PropertyName)Dropdown',
@ -50,6 +51,14 @@ export const page@(@Model.ClassName) = (params?: any) =>
data: params, data: params,
}); });
// 列表@(@Model.BusName)
export const list@(@Model.ClassName) = () =>
request({
url: Api.List@(@Model.ClassName),
method: 'get',
data: { },
});
// 详情@(@Model.BusName) // 详情@(@Model.BusName)
export const detail@(@Model.ClassName) = (id: any) => export const detail@(@Model.ClassName) = (id: any) =>
request({ request({

View File

@ -234,7 +234,7 @@ export const SysUnitApiAxiosParamCreator = function (configuration?: Configurati
if (unitGroupId === null || unitGroupId === undefined) { if (unitGroupId === null || unitGroupId === undefined) {
throw new RequiredError('unitGroupId','Required parameter unitGroupId was null or undefined when calling apiSysUnitListUnitGroupIdGet.'); throw new RequiredError('unitGroupId','Required parameter unitGroupId was null or undefined when calling apiSysUnitListUnitGroupIdGet.');
} }
const localVarPath = `/api/sysUnit/list/{unitGroupId}` const localVarPath = `/api/sysUnit/listByGroupId/{unitGroupId}`
.replace(`{${"unitGroupId"}}`, encodeURIComponent(String(unitGroupId))); .replace(`{${"unitGroupId"}}`, encodeURIComponent(String(unitGroupId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com'); const localVarUrlObj = new URL(localVarPath, 'https://example.com');

View File

@ -5,6 +5,7 @@ enum Api {
UpdateBrand = '/api/brand/update', UpdateBrand = '/api/brand/update',
PageBrand = '/api/brand/page', PageBrand = '/api/brand/page',
DetailBrand = '/api/brand/detail', DetailBrand = '/api/brand/detail',
ListBrand = '/api/brand/list',
} }
// 增加品牌 // 增加品牌
@ -47,4 +48,11 @@ export const detailBrand = (id: any) =>
data: { id }, data: { id },
}); });
// 列表品牌
export const listBrand = () =>
request({
url: Api.ListBrand,
method: 'get',
data: { },
});

View File

@ -5,6 +5,7 @@ enum Api {
UpdateMaterials = '/api/materials/update', UpdateMaterials = '/api/materials/update',
PageMaterials = '/api/materials/page', PageMaterials = '/api/materials/page',
DetailMaterials = '/api/materials/detail', DetailMaterials = '/api/materials/detail',
ListMaterials = '/api/materials/list',
} }
// 增加物料 // 增加物料
@ -47,4 +48,11 @@ export const detailMaterials = (id: any) =>
data: { id }, data: { id },
}); });
// 物料列表
export const listMaterials = () =>
request({
url: Api.ListMaterials,
method: 'get',
data: { },
});

View File

@ -0,0 +1,59 @@
import request from '/@/utils/request';
enum Api {
AddProductionLine = '/api/productionLine/add',
DeleteProductionLine = '/api/productionLine/delete',
UpdateProductionLine = '/api/productionLine/update',
PageProductionLine = '/api/productionLine/page',
DetailProductionLine = '/api/productionLine/detail',
ListProductionLine = '/api/productionLine/list',
}
// 增加生产线
export const addProductionLine = (params?: any) =>
request({
url: Api.AddProductionLine,
method: 'post',
data: params,
});
// 删除生产线
export const deleteProductionLine = (params?: any) =>
request({
url: Api.DeleteProductionLine,
method: 'post',
data: params,
});
// 编辑生产线
export const updateProductionLine = (params?: any) =>
request({
url: Api.UpdateProductionLine,
method: 'post',
data: params,
});
// 分页查询生产线
export const pageProductionLine = (params?: any) =>
request({
url: Api.PageProductionLine,
method: 'post',
data: params,
});
// 列表生产线
export const listProductionLine = () =>
request({
url: Api.ListProductionLine,
method: 'get',
data: { },
});
// 详情生产线
export const detailProductionLine = (id: any) =>
request({
url: Api.DetailProductionLine,
method: 'get',
data: { id },
});

View File

@ -5,6 +5,7 @@ enum Api {
UpdateSupplier = '/api/supplier/update', UpdateSupplier = '/api/supplier/update',
PageSupplier = '/api/supplier/page', PageSupplier = '/api/supplier/page',
DetailSupplier = '/api/supplier/detail', DetailSupplier = '/api/supplier/detail',
ListSupplier = '/api/supplier/list',
} }
// 增加供应商 // 增加供应商
@ -47,4 +48,11 @@ export const detailSupplier = (id: any) =>
data: { id }, data: { id },
}); });
// 列表供应商
export const listSupplier = () =>
request({
url: Api.ListSupplier,
method: 'get',
data: { },
});

View File

@ -0,0 +1,66 @@
import request from '/@/utils/request';
enum Api {
AddUnit = '/api/sysUnit/add',
DeleteUnit = '/api/sysUnit/delete',
UpdateUnit = '/api/sysUnit/update',
PageUnit = '/api/sysUnit/page',
DetailUnit = '/api/sysUnit/detail',
ListUnit = '/api/sysUnit/list',
ListUnitGroup = '/api/sysUnit/listByGroupId',
}
// 增加单位
export const addUnit = (params?: any) =>
request({
url: Api.AddUnit,
method: 'post',
data: params,
});
// 删除单位
export const deleteUnit = (params?: any) =>
request({
url: Api.DeleteUnit,
method: 'post',
data: params,
});
// 编辑单位
export const updateUnit = (params?: any) =>
request({
url: Api.UpdateUnit,
method: 'post',
data: params,
});
// 分页查询单位
export const pageUnit = (params?: any) =>
request({
url: Api.PageUnit,
method: 'post',
data: params,
});
// 详情单位
export const detailUnit = (id: any) =>
request({
url: Api.DetailUnit,
method: 'get',
data: { id },
});
// 单位列表
export const listUnit = () =>
request({
url: Api.ListUnit,
method: 'get',
data: { },
});
// 单位组列表
export const listUnitGroup = (unitGroupId: any) =>
request({
url: Api.ListUnitGroup,
method: 'get',
data: { unitGroupId },
});

View File

@ -5,6 +5,7 @@ enum Api {
UpdateWarehouse = '/api/warehouse/update', UpdateWarehouse = '/api/warehouse/update',
PageWarehouse = '/api/warehouse/page', PageWarehouse = '/api/warehouse/page',
DetailWarehouse = '/api/warehouse/detail', DetailWarehouse = '/api/warehouse/detail',
ListWarehouse = '/api/warehouse/list',
} }
// 增加仓库 // 增加仓库
@ -47,4 +48,11 @@ export const detailWarehouse = (id: any) =>
data: { id }, data: { id },
}); });
// 列表仓库
export const listWarehouse = () =>
request({
url: Api.ListWarehouse,
method: 'get',
data: { },
});

View File

@ -0,0 +1,135 @@
<template>
<div class="productionLine-container">
<el-dialog v-model="isShowDialog" :width="800" draggable="">
<template #header>
<div style="color: #fff">
<!--<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>-->
<span>{{ props.title }}</span>
</div>
</template>
<el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
<el-row :gutter="35">
<el-form-item v-show="false">
<el-input v-model="ruleForm.id" />
</el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name">
<el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="地址" prop="address">
<el-input v-model="ruleForm.address" placeholder="请输入地址" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="64" show-word-limit clearable />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<style scoped>
:deep(.el-select),
:deep(.el-input-number) {
width: 100%;
}
</style>
<script lang="ts" setup>
import { ref,onMounted } from "vue";
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus";
import { addProductionLine, updateProductionLine, detailProductionLine } from "/@/api/main/productionLine";
//
var props = defineProps({
title: {
type: String,
default: "",
},
});
//
const emit = defineEmits(["reloadTable"]);
const ruleFormRef = ref();
const isShowDialog = ref(false);
const ruleForm = ref<any>({});
//
const rules = ref<FormRules>({
});
//
const openDialog = async (row: any) => {
// ruleForm.value = JSON.parse(JSON.stringify(row));
// detail
let rowData = JSON.parse(JSON.stringify(row));
if (rowData.id)
ruleForm.value = (await detailProductionLine(rowData.id)).data.result;
else
ruleForm.value = rowData;
isShowDialog.value = true;
};
//
const closeDialog = () => {
emit("reloadTable");
isShowDialog.value = false;
};
//
const cancel = () => {
isShowDialog.value = false;
};
//
const submit = async () => {
ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
if (isValid) {
let values = ruleForm.value;
if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) {
await addProductionLine(values);
} else {
await updateProductionLine(values);
}
closeDialog();
} else {
ElMessage({
message: `表单有${Object.keys(fields).length}处验证失败,请修改后再提交`,
type: "error",
});
}
});
};
//
onMounted(async () => {
});
//
defineExpose({ openDialog });
</script>

View File

@ -0,0 +1,180 @@
<template>
<div class="productionLine-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
<el-form-item label="关键字">
<el-input v-model="queryParams.searchKey" clearable="" placeholder="请输入模糊查询关键字"/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="名称">
<el-input v-model="queryParams.name" clearable="" placeholder="请输入名称"/>
</el-form-item>
</el-col>
<el-col :xs="48" :sm="24" :md="24" :lg="16" :xl="8" class="mb20" v-if="showAdvanceQueryUI">
<el-form-item label="地址" style="width:400px;">
<el-input v-model="queryParams.address" clearable="" placeholder="请输入地址" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="备注">
<el-input v-model="queryParams.remarks" clearable="" placeholder="请输入备注"/>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
<el-form-item>
<el-button-group style="display: flex; align-items: center;">
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'productionLine:page'"> </el-button>
<el-button icon="ele-Refresh" @click="() => queryParams = {}"> 重置 </el-button>
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> </el-button>
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> </el-button>
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddProductionLine" v-auth="'productionLine:add'"> </el-button>
</el-button-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table
:data="tableData"
style="width: 100%"
v-loading="loading"
tooltip-effect="light"
row-key="id"
@sort-change="sortChange"
border="">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="name" label="名称" width="160" show-overflow-tooltip="" />
<el-table-column prop="address" label="地址" width="340" show-overflow-tooltip="" />
<el-table-column prop="remarks" label="备注" width="140" show-overflow-tooltip="" />
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('productionLine:update') || auth('productionLine:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditProductionLine(scope.row)" v-auth="'productionLine:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delProductionLine(scope.row)" v-auth="'productionLine:delete'"> </el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="tableParams.page"
v-model:page-size="tableParams.pageSize"
:total="tableParams.total"
:page-sizes="[10, 20, 50, 100, 200, 500]"
small=""
background=""
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes, prev, pager, next, jumper"
/>
<editDialog
ref="editDialogRef"
:title="editProductionLineTitle"
@reloadTable="handleQuery"
/>
</el-card>
</div>
</template>
<script lang="ts" setup="" name="productionLine">
import { ref } from "vue";
import { ElMessageBox, ElMessage } from "element-plus";
import { auth } from '/@/utils/authFunction';
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
import { formatDate } from '/@/utils/formatTime';
import editDialog from '/@/views/basics-date/productionLine/component/editDialog.vue'
import { pageProductionLine, deleteProductionLine } from '/@/api/main/productionLine';
const showAdvanceQueryUI = ref(false);
const editDialogRef = ref();
const loading = ref(false);
const tableData = ref<any>([]);
const queryParams = ref<any>({});
const tableParams = ref({
page: 1,
pageSize: 10,
total: 0,
});
const editProductionLineTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
}
//
const handleQuery = async () => {
loading.value = true;
var res = await pageProductionLine(Object.assign(queryParams.value, tableParams.value));
tableData.value = res.data.result?.items ?? [];
tableParams.value.total = res.data.result?.total;
loading.value = false;
};
//
const sortChange = async (column: any) => {
queryParams.value.field = column.prop;
queryParams.value.order = column.order;
await handleQuery();
};
//
const openAddProductionLine = () => {
editProductionLineTitle.value = '添加生产线';
editDialogRef.value.openDialog({});
};
//
const openEditProductionLine = (row: any) => {
editProductionLineTitle.value = '编辑生产线';
editDialogRef.value.openDialog(row);
};
//
const delProductionLine = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await deleteProductionLine(row);
handleQuery();
ElMessage.success("删除成功");
})
.catch(() => {});
};
//
const handleSizeChange = (val: number) => {
tableParams.value.pageSize = val;
handleQuery();
};
//
const handleCurrentChange = (val: number) => {
tableParams.value.page = val;
handleQuery();
};
handleQuery();
</script>
<style scoped>
:deep(.el-ipnut),
:deep(.el-select),
:deep(.el-input-number) {
width: 100%;
}
</style>

View File

@ -12,11 +12,14 @@
<el-form-item v-show="false"> <el-form-item v-show="false">
<el-input v-model="ruleForm.id" /> <el-input v-model="ruleForm.id" />
</el-form-item> </el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name">
<el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable />
</el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="物料" :rules="[{ required: true, message: '物料不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.materials" placeholder="请选择" clearable @change="materialsChange">
<el-option :label="item.name" :value="item" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="商品条码" prop="goodCode"> <el-form-item label="商品条码" prop="goodCode">
@ -54,10 +57,12 @@
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库存单位" prop="unit"> <el-form-item label="库存单位" prop="unit" :rules="[{ required: true, message: '库存单位不能为空', trigger: 'blur' }]">
<el-input v-model="ruleForm.unit" placeholder="请输入库存单位" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.unit" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本数量" prop="baseCount"> <el-form-item label="基本数量" prop="baseCount">
@ -66,10 +71,12 @@
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本单位" prop="baseUnit"> <el-form-item label="基本单位" prop="baseUnit" :rules="[{ required: true, message: '基本单位不能为空', trigger: 'blur' }]">
<el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.baseUnit" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in units"
:key="index" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="包装比例" prop="packageScale"> <el-form-item label="包装比例" prop="packageScale">
@ -80,49 +87,44 @@
<el-form-item label="批次" prop="batch"> <el-form-item label="批次" prop="batch">
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="公司" prop="custom"> <el-form-item label="公司" prop="custom">
<el-input v-model="ruleForm.custom" placeholder="请输入公司" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.custom" placeholder="请输入公司" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="品牌" prop="brand"> <el-form-item label="品牌" prop="brand">
<el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col>-->
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="条码类型" prop="codeType"> <el-form-item label="条码类型" prop="codeType">
<el-input v-model="ruleForm.codeType" placeholder="请输入条码类型" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.codeType" placeholder="请选择" clearable>
<el-option label="商品条码" value="商品条码" />
<el-option label="批次条码" value="批次条码" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="条码数量" prop="codeCount"> <el-form-item label="条码数量" prop="codeCount">
<el-input-number v-model="ruleForm.codeCount" placeholder="请输入条码数量" clearable /> <el-input-number v-model="ruleForm.codeCount" placeholder="请输入条码数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库位" prop="warehouseLocation"> <el-form-item label="库位" prop="warehouseLocation">
<el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> -->
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产日期" prop="productDate"> <el-form-item label="生产日期" prop="productDate">
<el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" /> <el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="失效日期" prop="loseDate"> <el-form-item label="失效日期" prop="loseDate">
<el-date-picker v-model="ruleForm.loseDate" type="date" placeholder="失效日期" /> <el-date-picker v-model="ruleForm.loseDate" type="date" placeholder="失效日期" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单重" prop="singleWeight"> <el-form-item label="单重" prop="singleWeight">
@ -146,25 +148,21 @@
<el-form-item label="总价" prop="totalPrice"> <el-form-item label="总价" prop="totalPrice">
<el-input v-model="ruleForm.totalPrice" placeholder="请输入总价" maxlength="10" show-word-limit clearable /> <el-input v-model="ruleForm.totalPrice" placeholder="请输入总价" maxlength="10" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
</el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="源ID" prop="sourceId"> <el-form-item label="源ID" prop="sourceId">
<el-input v-model="ruleForm.sourceId" placeholder="请输入源ID" maxlength="20" show-word-limit clearable /> <el-input v-model="ruleForm.sourceId" placeholder="请输入源ID" maxlength="20" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="仓库ID" prop="warehouseId"> <el-form-item label="仓库" prop="warehouseId" :rules="[{ required: true, message: '仓库不能为空', trigger: 'blur' }]">
<el-input v-model="ruleForm.warehouseId" placeholder="请输入仓库ID" maxlength="20" show-word-limit clearable /> <el-select v-model="ruleForm.warehouseId" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.id" v-for="item, index in warehouses"
:key="index" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="拓展字段" prop="expandField"> <el-form-item label="拓展字段" prop="expandField">
@ -191,28 +189,35 @@
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="供应商" prop="supplier"> <el-form-item label="供应商" prop="supplier" >
<el-input v-model="ruleForm.supplier" placeholder="请输入供应商" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.supplier" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in suppliers"
:key="index" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-input-number v-model="ruleForm.status" placeholder="请输入状态" clearable /> <el-input-number v-model="ruleForm.status" placeholder="请输入状态" clearable />
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单号" prop="oddNumber"> <el-form-item label="单号" prop="oddNumber">
<el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.oddNumber" placeholder="请输入单号" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产线" prop="productionLine"> <el-form-item label="生产线" prop="productionLine" >
<el-input v-model="ruleForm.productionLine" placeholder="请输入生产线" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.productionLine" placeholder="请选择" clearable >
<el-option :label="item.name" :value="item.name" v-for="item, index in productionLines"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -237,6 +242,11 @@
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus"; import type { FormRules } from "element-plus";
import { addProductWarehousing, updateProductWarehousing, detailProductWarehousing } from "/@/api/main/productWarehousing"; import { addProductWarehousing, updateProductWarehousing, detailProductWarehousing } from "/@/api/main/productWarehousing";
import { pageMaterials, deleteMaterials, listMaterials } from '/@/api/main/materials';
import { listUnitGroup } from '/@/api/main/unit';
import { listProductionLine } from '/@/api/main/productionLine';
import { listWarehouse } from '/@/api/main/warehouse';
import { listSupplier } from '/@/api/main/supplier';
// //
var props = defineProps({ var props = defineProps({
@ -253,6 +263,12 @@
// //
const rules = ref<FormRules>({ const rules = ref<FormRules>({
}); });
const materials = ref<any>([]);
const units = ref<any>([]);
const currentMaterial = ref<any>({});
const warehouses = ref<any>([]);
const productionLines = ref<any>([]);
const suppliers = ref<any>([]);
// //
const openDialog = async (row: any) => { const openDialog = async (row: any) => {
@ -263,7 +279,10 @@
ruleForm.value = (await detailProductWarehousing(rowData.id)).data.result; ruleForm.value = (await detailProductWarehousing(rowData.id)).data.result;
else else
ruleForm.value = rowData; ruleForm.value = rowData;
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true; isShowDialog.value = true;
//console.log(materials.value);
}; };
// //
@ -298,13 +317,26 @@
}; };
/**
* 物料值变更
* @param clearBindUserId 是否清空
*/
const materialsChange = async (value : any) => {
currentMaterial.value = value;
ruleForm.value.materialsId=value.id;
var res = await listUnitGroup(value.unitGroupId ?? 0);
units.value = res.data.result ?? [];
//console.log(value);
};
// //
onMounted(async () => { onMounted(async () => {
warehouses.value = (await listWarehouse()).data.result;
productionLines.value = (await listProductionLine()).data.result;
suppliers.value = (await listSupplier()).data.result;
}); });
// //

View File

@ -18,7 +18,6 @@
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI"> <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="导出格式示例"> <el-form-item label="导出格式示例">
<el-input v-model="queryParams.exportFormatExample" clearable="" placeholder="请输入导出格式示例"/> <el-input v-model="queryParams.exportFormatExample" clearable="" placeholder="请输入导出格式示例"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10"> <el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">

View File

@ -13,186 +13,137 @@
<el-input v-model="ruleForm.id" /> <el-input v-model="ruleForm.id" />
</el-form-item> </el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name"> <el-form-item label="物料" :rules="[{ required: true, message: '物料不能为空', trigger: 'blur' }]">
<el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable /> <el-select v-model="ruleForm.materialsId" placeholder="请选择" clearable>
<el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="商品条码" prop="goodCode"> <el-form-item label="商品条码" prop="goodCode">
<el-input v-model="ruleForm.goodCode" placeholder="请输入商品条码" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.goodCode" placeholder="请输入商品条码" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="物料编码" prop="materialsNum"> <el-form-item label="物料编码" prop="materialsNum">
<el-input v-model="ruleForm.materialsNum" placeholder="请输入物料编码" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.materialsNum" placeholder="请输入物料编码" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="规格" prop="specifications"> <el-form-item label="规格" prop="specifications">
<el-input v-model="ruleForm.specifications" placeholder="请输入规格" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.specifications" placeholder="请输入规格" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="分类" prop="classify"> <el-form-item label="分类" prop="classify">
<el-input v-model="ruleForm.classify" placeholder="请输入分类" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.classify" placeholder="请输入分类" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库存数量" prop="count"> <el-form-item label="库存数量" prop="count">
<el-input-number v-model="ruleForm.count" placeholder="请输入库存数量" clearable /> <el-input-number v-model="ruleForm.count" placeholder="请输入库存数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库存单位" prop="unit"> <el-form-item label="库存单位" prop="unit">
<el-input v-model="ruleForm.unit" placeholder="请输入库存单位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.unit" placeholder="请输入库存单位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本数量" prop="baseCount"> <el-form-item label="基本数量" prop="baseCount">
<el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" clearable /> <el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本单位" prop="baseUnit"> <el-form-item label="基本单位" prop="baseUnit">
<el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="包装比例" prop="packageScale"> <el-form-item label="包装比例" prop="packageScale">
<el-input v-model="ruleForm.packageScale" placeholder="请输入包装比例" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.packageScale" placeholder="请输入包装比例" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="批次" prop="batch"> <el-form-item label="批次" prop="batch">
<el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.batch" placeholder="请输入批次" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="公司" prop="custom"> <el-form-item label="公司" prop="custom">
<el-input v-model="ruleForm.custom" placeholder="请输入公司" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.custom" placeholder="请输入公司" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="品牌" prop="brand"> <el-form-item label="品牌" prop="brand">
<el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="条码类型" prop="codeType"> <el-form-item label="条码类型" prop="codeType">
<el-input v-model="ruleForm.codeType" placeholder="请输入条码类型" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.codeType" placeholder="请输入条码类型" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="条码数量" prop="codeCount"> <el-form-item label="条码数量" prop="codeCount">
<el-input-number v-model="ruleForm.codeCount" placeholder="请输入条码数量" clearable /> <el-input-number v-model="ruleForm.codeCount" placeholder="请输入条码数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库位" prop="warehouseLocation"> <el-form-item label="库位" prop="warehouseLocation">
<el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="生产日期" prop="productDate"> <el-form-item label="生产日期" prop="productDate">
<el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" /> <el-date-picker v-model="ruleForm.productDate" type="date" placeholder="生产日期" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="失效日期" prop="loseDate"> <el-form-item label="失效日期" prop="loseDate">
<el-date-picker v-model="ruleForm.loseDate" type="date" placeholder="失效日期" /> <el-date-picker v-model="ruleForm.loseDate" type="date" placeholder="失效日期" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单重" prop="singleWeight"> <el-form-item label="单重" prop="singleWeight">
<el-input v-model="ruleForm.singleWeight" placeholder="请输入单重" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.singleWeight" placeholder="请输入单重" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="总重" prop="totalWeight"> <el-form-item label="总重" prop="totalWeight">
<el-input v-model="ruleForm.totalWeight" placeholder="请输入总重" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.totalWeight" placeholder="请输入总重" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="单价" prop="unitPrice"> <el-form-item label="单价" prop="unitPrice">
<el-input v-model="ruleForm.unitPrice" placeholder="请输入单价" maxlength="10" show-word-limit clearable /> <el-input v-model="ruleForm.unitPrice" placeholder="请输入单价" maxlength="10" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="总价" prop="totalPrice"> <el-form-item label="总价" prop="totalPrice">
<el-input v-model="ruleForm.totalPrice" placeholder="请输入总价" maxlength="10" show-word-limit clearable /> <el-input v-model="ruleForm.totalPrice" placeholder="请输入总价" maxlength="10" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="源ID" prop="sourceId"> <el-form-item label="源ID" prop="sourceId">
<el-input v-model="ruleForm.sourceId" placeholder="请输入源ID" maxlength="20" show-word-limit clearable /> <el-input v-model="ruleForm.sourceId" placeholder="请输入源ID" maxlength="20" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="仓库ID" prop="warehouseId"> <el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="ruleForm.warehouseId" placeholder="请输入仓库ID" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.warehouseId" placeholder="请输入仓库ID" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="拓展字段" prop="expandField"> <el-form-item label="拓展字段" prop="expandField">
<el-input v-model="ruleForm.expandField" placeholder="请输入拓展字段" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.expandField" placeholder="请输入拓展字段" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -217,6 +168,7 @@
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus"; import type { FormRules } from "element-plus";
import { addWarehouseDetails, updateWarehouseDetails, detailWarehouseDetails } from "/@/api/main/warehouseDetails"; import { addWarehouseDetails, updateWarehouseDetails, detailWarehouseDetails } from "/@/api/main/warehouseDetails";
import { pageMaterials, deleteMaterials, listMaterials } from '/@/api/main/materials';
// //
var props = defineProps({ var props = defineProps({
@ -233,6 +185,7 @@
// //
const rules = ref<FormRules>({ const rules = ref<FormRules>({
}); });
const materials = ref<any>([]);
// //
const openDialog = async (row: any) => { const openDialog = async (row: any) => {
@ -243,7 +196,10 @@
ruleForm.value = (await detailWarehouseDetails(rowData.id)).data.result; ruleForm.value = (await detailWarehouseDetails(rowData.id)).data.result;
else else
ruleForm.value = rowData; ruleForm.value = rowData;
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true; isShowDialog.value = true;
//console.log(materials.value);
}; };
// //

View File

@ -13,114 +13,87 @@
<el-input v-model="ruleForm.id" /> <el-input v-model="ruleForm.id" />
</el-form-item> </el-form-item>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="物料" :rules="[{ required: true, message: '物料不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.materialsId" placeholder="请选择" clearable>
<el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.name" placeholder="请输入名称" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> -->
</el-col> <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="物料编码" prop="codeNum"> <el-form-item label="物料编码" prop="codeNum">
<el-input v-model="ruleForm.codeNum" placeholder="请输入物料编码" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.codeNum" placeholder="请输入物料编码" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> -->
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库数量" prop="count"> <el-form-item label="入库数量" prop="count">
<el-input-number v-model="ruleForm.count" placeholder="请输入入库数量" clearable /> <el-input-number v-model="ruleForm.count" placeholder="请输入入库数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库单位" prop="unit"> <el-form-item label="入库单位" prop="unit">
<el-input v-model="ruleForm.unit" placeholder="请输入入库单位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.unit" placeholder="请输入入库单位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本数量" prop="baseCount"> <el-form-item label="基本数量" prop="baseCount">
<el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" clearable /> <el-input-number v-model="ruleForm.baseCount" placeholder="请输入基本数量" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本单位" prop="baseUnit"> <el-form-item label="基本单位" prop="baseUnit">
<el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.baseUnit" placeholder="请输入基本单位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="品牌" prop="brand"> <el-form-item label="品牌" prop="brand">
<el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.brand" placeholder="请输入品牌" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="规格" prop="specifications"> <el-form-item label="规格" prop="specifications">
<el-input v-model="ruleForm.specifications" placeholder="请输入规格" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.specifications" placeholder="请输入规格" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库类型" prop="warehousingType"> <el-form-item label="入库类型" prop="warehousingType">
<el-input v-model="ruleForm.warehousingType" placeholder="请输入入库类型" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.warehousingType" placeholder="请输入入库类型" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="物料ID" prop="materialsId">
<el-input v-model="ruleForm.materialsId" placeholder="请输入物料ID" maxlength="20" show-word-limit clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="来源ID" prop="sourceId"> <el-form-item label="来源ID" prop="sourceId">
<el-input v-model="ruleForm.sourceId" placeholder="请输入来源ID" maxlength="20" show-word-limit clearable /> <el-input v-model="ruleForm.sourceId" placeholder="请输入来源ID" maxlength="20" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库日期" prop="warehousingDate"> <el-form-item label="入库日期" prop="warehousingDate">
<el-date-picker v-model="ruleForm.warehousingDate" type="date" placeholder="入库日期" /> <el-date-picker v-model="ruleForm.warehousingDate" type="date" placeholder="入库日期" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="入库仓库ID" prop="warehouseId"> <el-form-item label="入库仓库ID" prop="warehouseId">
<el-input v-model="ruleForm.warehouseId" placeholder="请输入入库仓库ID" maxlength="20" show-word-limit clearable /> <el-input v-model="ruleForm.warehouseId" placeholder="请输入入库仓库ID" maxlength="20" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="库位" prop="warehouseLocation"> <el-form-item label="库位" prop="warehouseLocation">
<el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.warehouseLocation" placeholder="请输入库位" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="供应商" prop="supplier"> <el-form-item label="供应商" prop="supplier">
<el-input v-model="ruleForm.supplier" placeholder="请输入供应商" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.supplier" placeholder="请输入供应商" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="备注" prop="remarks"> <el-form-item label="备注" prop="remarks">
<el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable /> <el-input v-model="ruleForm.remarks" placeholder="请输入备注" maxlength="32" show-word-limit clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -147,6 +120,7 @@
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus"; import type { FormRules } from "element-plus";
import { addWarehousingStatistics, updateWarehousingStatistics, detailWarehousingStatistics } from "/@/api/main/warehousingStatistics"; import { addWarehousingStatistics, updateWarehousingStatistics, detailWarehousingStatistics } from "/@/api/main/warehousingStatistics";
import { pageMaterials, deleteMaterials, listMaterials } from '/@/api/main/materials';
// //
var props = defineProps({ var props = defineProps({
@ -163,6 +137,7 @@
// //
const rules = ref<FormRules>({ const rules = ref<FormRules>({
}); });
const materials = ref<any>([]);
// //
const openDialog = async (row: any) => { const openDialog = async (row: any) => {
@ -173,6 +148,8 @@
ruleForm.value = (await detailWarehousingStatistics(rowData.id)).data.result; ruleForm.value = (await detailWarehousingStatistics(rowData.id)).data.result;
else else
ruleForm.value = rowData; ruleForm.value = rowData;
materials.value = (await listMaterials()).data.result;
isShowDialog.value = true; isShowDialog.value = true;
}; };