修改生产单交互信息

main
ljh 2024-07-13 01:48:34 +09:00
parent c5d1b5afe6
commit 89467b88c2
10 changed files with 43 additions and 11 deletions

View File

@ -41,7 +41,7 @@ public class PrintCodeDetail : EntityBase
/// 基本数量 /// 基本数量
/// </summary> /// </summary>
[SugarColumn(ColumnName = "BaseCount", ColumnDescription = "基本数量")] [SugarColumn(ColumnName = "BaseCount", ColumnDescription = "基本数量")]
public int? BaseCount { get; set; } public decimal? BaseCount { get; set; }
/// <summary> /// <summary>
/// 基本单位 /// 基本单位

View File

@ -232,7 +232,7 @@ public class DistributorInvoiceService : IDynamicApiController, ITransient
var report = await GetReport(item.ReportTableId); var report = await GetReport(item.ReportTableId);
var retrospect1 = new AddProductRetrospectInput() var retrospect1 = new AddProductRetrospectInput()
{ {
BaseCount = item.BaseCount, BaseCount = (int?)item.BaseCount,
BaseUnit = item.BaseUnit, BaseUnit = item.BaseUnit,
//Batch = report.Batch, //Batch = report.Batch,
BusinessType = report.ProductType, BusinessType = report.ProductType,

View File

@ -36,7 +36,7 @@ public class PrintCodeDetailBaseInput
/// <summary> /// <summary>
/// 基本数量 /// 基本数量
/// </summary> /// </summary>
public virtual int? BaseCount { get; set; } public virtual decimal? BaseCount { get; set; }
/// <summary> /// <summary>
/// 基本单位 /// 基本单位
@ -168,7 +168,7 @@ public class PrintCodeDetailInput : BasePageInput
/// <summary> /// <summary>
/// 基本数量 /// 基本数量
/// </summary> /// </summary>
public int? BaseCount { get; set; } public decimal? BaseCount { get; set; }
/// <summary> /// <summary>
/// 基本单位 /// 基本单位

View File

@ -38,7 +38,7 @@ public class PrintCodeDetailOutput
/// <summary> /// <summary>
/// 基本数量 /// 基本数量
/// </summary> /// </summary>
public int? BaseCount { get; set; } public decimal? BaseCount { get; set; }
/// <summary> /// <summary>
/// 基本单位 /// 基本单位

View File

@ -175,5 +175,12 @@ public class PrintCodeDetailService : IDynamicApiController, ITransient
{ {
return await _rep.AsQueryable().Where(a => !a.IsDelete && a.Code.Contains(productCode)).ToListAsync(); return await _rep.AsQueryable().Where(a => !a.IsDelete && a.Code.Contains(productCode)).ToListAsync();
} }
[HttpGet]
[ApiDescriptionSettings(Name = "GetByReportTableId")]
public async Task<List<PrintCodeDetail>> GetByReportTableId(long? reportTableId)
{
return await _rep.AsQueryable().Where(a => !a.IsDelete && a.ReportTableId == reportTableId).ToListAsync();
}
} }

View File

@ -206,7 +206,7 @@ public class ProductRetrospectService : IDynamicApiController, ITransient
var userName = _userManager.RealName; var userName = _userManager.RealName;
var retrospect1 = new AddProductRetrospectInput() var retrospect1 = new AddProductRetrospectInput()
{ {
BaseCount = item.BaseCount, BaseCount = (int?)item.BaseCount,
BaseUnit = item.BaseUnit, BaseUnit = item.BaseUnit,
Batch = report.Batch, Batch = report.Batch,
BusinessType = report.ProductType, BusinessType = report.ProductType,

View File

@ -518,6 +518,16 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "List")] [ApiDescriptionSettings(Name = "List")]
public async Task<List<ReportDetailTableOutput>> List() public async Task<List<ReportDetailTableOutput>> List()
{ {
var list = await _rep.AsQueryable().Where(a => !a.IsDelete && a.State == 1).ToListAsync();
foreach (var item in list)
{
var reportTable = await _reportTableService.GetBySource(item.Id);
if (reportTable != null && reportTable.BaseProductCount>item.ProductCount)
{
item.State = 2;
await _rep.AsUpdateable(item).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
}
return await _rep.AsQueryable().Where(a => !a.IsDelete && a.State == 1).Select<ReportDetailTableOutput>().ToListAsync(); return await _rep.AsQueryable().Where(a => !a.IsDelete && a.State == 1).Select<ReportDetailTableOutput>().ToListAsync();
} }

View File

@ -33,7 +33,7 @@ public class PrintCodeTreeData
/// <summary> /// <summary>
/// 基本数量 /// 基本数量
/// </summary> /// </summary>
public int? BaseCount { get; set; } public decimal? BaseCount { get; set; }
/// <summary> /// <summary>
/// 基本单位 /// 基本单位

View File

@ -68,7 +68,7 @@ public class ReportTableOutput
/// <summary> /// <summary>
/// 基本完工数量 /// 基本完工数量
/// </summary> /// </summary>
public int? BaseProductCount { get; set; } public decimal? BaseProductCount { get; set; }
/// <summary> /// <summary>
/// 单位 /// 单位

View File

@ -109,7 +109,7 @@
<el-table-column prop="updateTime" label="修改时间" show-overflow-tooltip=""/> <el-table-column prop="updateTime" label="修改时间" show-overflow-tooltip=""/>
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportDetailTable:update') || auth('reportDetailTable:delete')"> <el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportDetailTable:update') || auth('reportDetailTable:delete')">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.state===1"> <div v-if="scope.row.state===1||scope.row.state===2">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openBrowseReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button> <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openBrowseReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
</div> </div>
<div v-else> <div v-else>
@ -184,7 +184,17 @@ import {
total: 0, total: 0,
}); });
const formatAuditState = (row, column, cellValue) => { const formatAuditState = (row, column, cellValue) => {
return cellValue === 1 ? '已审核' : '未审核'; if(cellValue === 1){
return '已审核';
}
else if(cellValue === 2){
return '已完结';
}
else{
return '未审核';
}
} }
const editReportDetailTableTitle = ref(""); const editReportDetailTableTitle = ref("");
const printDetailTableTitle = ref(""); const printDetailTableTitle = ref("");
@ -285,9 +295,14 @@ import {
const handleStateChange = async (val: any) => { const handleStateChange = async (val: any) => {
if(multipleSelection.value.length === 0){ return ElMessage.error("至少选择一条数据")} if(multipleSelection.value.length === 0){ return ElMessage.error("至少选择一条数据")}
let ids = [] as any; let ids = [] as any;
let flag = true;
multipleSelection.value.forEach(item => { multipleSelection.value.forEach(item => {
if(item.state === 2) {
flag = false;
}
ids.push(item.id); ids.push(item.id);
}) })
if(!flag) return ElMessage.error("此订单已完结")
await updateStateReportDetailTable({ids,state:val}); await updateStateReportDetailTable({ids,state:val});
await handleQuery(); await handleQuery();
}; };