main
liangzongpeng 2024-06-12 18:10:50 +08:00
parent 1902aea72a
commit 45150bfe78
23 changed files with 393 additions and 144 deletions

View File

@ -4,7 +4,7 @@ namespace Admin.NET.Application.Entity;
/// <summary>
/// 汇报单
/// </summary>
[SugarTable("ReportTable","汇报单")]
[SugarTable("reporttable","汇报单")]
public class ReportTable : EntityTenant
{
/// <summary>
@ -49,6 +49,12 @@ public class ReportTable : EntityTenant
[SugarColumn(ColumnName = "SourceNumber", ColumnDescription = "源单号", Length = 32)]
public string? SourceNumber { get; set; }
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 64)]
public string? Remarks { get; set; }
/// <summary>
/// 物料ID
/// </summary>
@ -56,9 +62,9 @@ public class ReportTable : EntityTenant
public long? MaterialsId { get; set; }
/// <summary>
/// 备注
/// 源单ID
/// </summary>
[SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", Length = 64)]
public string? Remarks { get; set; }
[SugarColumn(ColumnName = "SourceId", ColumnDescription = "源单ID")]
public long? SourceId { get; set; }
}

View File

@ -10,9 +10,27 @@ namespace Admin.NET.Application;
public class InvoiceService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<Invoice> _rep;
public InvoiceService(SqlSugarRepository<Invoice> rep)
private readonly MaterialsService _materialsService;
private readonly SysUnitService _sysUnitService;
private readonly PrintCodeDetailService _codeDetailService;
private readonly ProductRetrospectService _productRetrospect;
private readonly ReportTableService _reportTableService;
private readonly UserManager _userManager;
public InvoiceService(SqlSugarRepository<Invoice> rep,
UserManager userManager,
MaterialsService materialsService,
SysUnitService sysUnitService,
PrintCodeDetailService codeDetailService,
ReportTableService reportTableService,
ProductRetrospectService productRetrospect)
{
_rep = rep;
_userManager = userManager;
_materialsService = materialsService;
_sysUnitService = sysUnitService;
_codeDetailService = codeDetailService;
_productRetrospect = productRetrospect;
_reportTableService = reportTableService;
}
/// <summary>
@ -136,6 +154,74 @@ public class InvoiceService : IDynamicApiController, ITransient
}
/// <summary>
/// 商品出货
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "ShipmentProduct")]
public async Task ShipmentProduct(AddProductCodeInput input)
{
if (input == null || input.WarehousingTableId == null || input.CodeDatas == null || input.CodeDatas.Count == 0)
{
throw Oops.Oh(ErrorCodeEnum.xg1002);
}
var repeatCodes = await _codeDetailService.GetRepeat(input.CodeDatas);
var invoice = await Detail(new QueryByIdInvoiceInput() { Id = input.WarehousingTableId.Value });
if (invoice == null)
{
throw Oops.Oh(ErrorCodeEnum.xg1002);
}
//var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
//var baseUnit = units.FirstOrDefault().Name;
//var userId = _userManager.UserId;
//var userName = _userManager.RealName;
//var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode));
//foreach (var dic in list)
//{
// var item = dic.Key;
// var retrospect1 = new AddProductRetrospectInput()
// {
// BaseCount = item.BaseCount,
// BaseUnit = baseUnit,
// Batch = warehousing.Batch,
// BusinessType = "生产任务单",
// CodeType = item.CodeName,
// Department = warehousing.ProductionLine,
// //WarehouseID = input.WarehouseId,
// WarehousingDate = DateTime.Now,
// Count = 1,
// CreateTime = DateTime.Now,
// ScanCodeTime = DateTime.Now,
// CreateUserId = userId,
// CreateUserName = userName,
// MaterialsId = dic.Value,
// OddNumber = warehousing.OddNumber,
// Receipt = "汇报单",
// SourceId = warehousing.Id,
// Unit = item.Unit,
// Name = materials.Name,
// Code = item.Code
// };//Destination = warehousing.Supplier,
// await _productRetrospect.Add(retrospect1);
//}
//var report = await _reportTableService.GetBySource(input.WarehousingTableId);
//if (report == null)
//{
// var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = warehousing.OddNumber, State = 0, MaterialsId = warehousing.MaterialsId, SourceId = input.WarehousingTableId, ProductType = warehousing.ProductType, ProductionLine = warehousing.ProductionLine };
// var addReport = await _reportTableService.Add(newReport);
//}
}

View File

@ -135,6 +135,23 @@ public class PrintCodeDetailService : IDynamicApiController, ITransient
return await _rep.AsQueryable().Where(a => !a.IsDelete).Select<PrintCodeDetailOutput>().ToListAsync();
}
/// <summary>
/// 获取打印条码详情列表
/// </summary>
/// <returns></returns>
[HttpPost]
[ApiDescriptionSettings(Name = "GetRepeat")]
public async Task<List<PrintCodeDetailOutput>> GetRepeat(List<PrintData> printDatas)
{
if (printDatas.Count<1)
{
return new List<PrintCodeDetailOutput>();
}
var codes = string.IsNullOrEmpty(printDatas[0].BarCode) ? printDatas.ConvertAll(a => a.QrCode) : printDatas.ConvertAll(a => a.BarCode);
return await _rep.AsQueryable().Where(a => !a.IsDelete && codes.Any(b => b == a.Code)).Select<PrintCodeDetailOutput>().ToListAsync();
}
/// <summary>
/// 获取打印条码详情
/// </summary>

View File

@ -11,19 +11,21 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<ReportDetailTable> _rep;
//private readonly WarehouseDetailsService _warehouseDetails;
private readonly MaterialsService _materialsService;
private readonly SysUnitService _sysUnitService;
//private readonly MaterialClassifyService _materialClassifyService;
//private readonly WarehousingStatisticsService _warehousingStatisticsService;
private readonly MaterialsService _materialsService;
private readonly SysUnitService _sysUnitService;
private readonly PrintCodeDetailService _codeDetailService;
private readonly ProductRetrospectService _productRetrospect;
//private readonly ProductWarehousingService _productWarehousing;
private readonly ReportTableService _reportTableService;
private readonly UserManager _userManager;
//private readonly ProductWarehousingService _productWarehousing;
public ReportDetailTableService(SqlSugarRepository<ReportDetailTable> rep,
UserManager userManager,
MaterialsService materialsService,
SysUnitService sysUnitService,
PrintCodeDetailService codeDetailService,
ReportTableService reportTableService,
ProductRetrospectService productRetrospect)
{
_rep = rep;
@ -32,6 +34,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
_sysUnitService = sysUnitService;
_codeDetailService = codeDetailService;
_productRetrospect = productRetrospect;
_reportTableService = reportTableService;
//_warehouseDetails = warehouseDetails;
//_materialClassifyService = materialClassifyService;
//_warehousingStatisticsService = warehousingStatisticsService;
@ -162,6 +165,14 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
{
throw Oops.Oh(ErrorCodeEnum.xg1002);
}
var repeatCodes = await _codeDetailService.GetRepeat(input.CodeDatas);
if (repeatCodes!=null&&repeatCodes.Count>0)
{
var repeats = repeatCodes.ConvertAll(a => a.Code).Distinct();
throw Oops.Oh($"条码重复:{string.Join("", repeats)}");
}
var warehousing = await Detail(new QueryByIdReportDetailTableInput() { Id = input.WarehousingTableId.Value });
if (warehousing == null)
{
@ -173,7 +184,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
throw Oops.Oh(ErrorCodeEnum.xg1002);
}
var units = await _sysUnitService.ListByGroupId(materials.UnitGroupId);
var baseUnit = units.LastOrDefault().Name;
var baseUnit = units.FirstOrDefault().Name;
var userId = _userManager.UserId;
var userName = _userManager.RealName;
var topDatas = input.CodeDatas.FindAll(a => string.IsNullOrEmpty(a.FatherCode));
@ -226,7 +237,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
list.Add(detail2, detailId2);
var childs3 = input.CodeDatas.FindAll(a => a.FatherCode == code2);
foreach (var child3 in childs)
foreach (var child3 in childs3)
{
var code3 = string.IsNullOrEmpty(child3.BarCode) ? child3.QrCode : child3.BarCode;
var unit3 = units.Find(a => a.Name == child3.PackageName);
@ -251,7 +262,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
if (input.CodeDatas.Any(a => a.FatherCode == code3))
{
var childs4 = input.CodeDatas.FindAll(a => a.FatherCode == code3);
foreach (var child4 in childs)
foreach (var child4 in childs4)
{
var code4 = string.IsNullOrEmpty(child4.BarCode) ? child4.QrCode : child4.BarCode;
var unit4 = units.Find(a => a.Name == child4.PackageName);
@ -276,7 +287,7 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
if (input.CodeDatas.Any(a => a.FatherCode == code4))
{
var childs5 = input.CodeDatas.FindAll(a => a.FatherCode == code4);
foreach (var child5 in childs)
foreach (var child5 in childs5)
{
var code5 = string.IsNullOrEmpty(child5.BarCode) ? child5.QrCode : child5.BarCode;
var unit5 = units.Find(a => a.Name == child5.PackageName);
@ -335,6 +346,12 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
await _productRetrospect.Add(retrospect1);
}
var report = await _reportTableService.GetBySource(input.WarehousingTableId);
if (report == null)
{
var newReport = new AddReportTableInput() { CreateTime = DateTime.Now, IsDelete = false, OddNumber = warehousing.OddNumber, State = 0, MaterialsId = warehousing.MaterialsId, SourceId = input.WarehousingTableId, ProductType = warehousing.ProductType, ProductionLine = warehousing.ProductionLine };
var addReport = await _reportTableService.Add(newReport);
}
//var details = await _warehouseDetails.List();
@ -363,7 +380,6 @@ public class ReportDetailTableService : IDynamicApiController, ITransient
}
/// <summary>
/// 删除汇报单详情
/// </summary>

View File

@ -50,6 +50,10 @@ public class ReportTableDto
/// </summary>
public long? MaterialsId { get; set; }
/// <summary>
/// 源单ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 备注
/// </summary>

View File

@ -43,6 +43,10 @@ public class ReportTableBaseInput
/// </summary>
public virtual string? SourceNumber { get; set; }
/// <summary>
/// 源单ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 物料ID
@ -151,6 +155,10 @@ public class ReportTableInput : BasePageInput
/// </summary>
public long? MaterialsId { get; set; }
/// <summary>
/// 源单ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 备注
/// </summary>
@ -196,5 +204,5 @@ public class UpdateReportTableInput : ReportTableBaseInput
/// </summary>
public class QueryByIdReportTableInput : DeleteReportTableInput
{
public string? Code { get; set; }
}

View File

@ -45,6 +45,10 @@ public class ReportTableOutput
/// </summary>
public string? SourceNumber { get; set; }
/// <summary>
/// 源单ID
/// </summary>
public long? SourceId { get; set; }
/// <summary>
/// 物料ID

View File

@ -17,7 +17,7 @@ public class ReportTableService : IDynamicApiController, ITransient
private readonly SysUnitService _repUnit;
private readonly SysUnitGroupService _repUnitGroup;
private readonly PrintCodeDetailService _codeDetailService;
private readonly ReportDetailTableService _reportDetailTable;
//private readonly ReportDetailTableService _reportDetailTable;
private readonly UserManager _userManager;
private readonly PrintDataService _printDataService;
@ -26,14 +26,14 @@ public class ReportTableService : IDynamicApiController, ITransient
SysUnitService repUnit,
SysUnitGroupService repUnitGroup,
PrintCodeDetailService codeDetailService,
ReportDetailTableService reportDetailTable,
//ReportDetailTableService reportDetailTable,
PrintDataService printDataService)
{
_rep = rep;
_repUnit = repUnit;
_repUnitGroup = repUnitGroup;
_codeDetailService = codeDetailService;
_reportDetailTable = reportDetailTable;
//_reportDetailTable = reportDetailTable;
_userManager = userManager;
_printDataService = printDataService;
}
@ -86,25 +86,32 @@ public class ReportTableService : IDynamicApiController, ITransient
[ApiDescriptionSettings(Name = "Add")]
public async Task<long> Add(AddReportTableInput input)
{
//input.UpdateUserId
var details = await _codeDetailService.List();
if (details == null || details.Count < 1)
{
return 0;
}
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
if (printDetails.Count < 1)
{
return 0;
}
var entity = input.Adapt<ReportTable>();
await _rep.InsertAsync(entity);
for (int i = 0; i < printDetails.Count; i++)
if (input.UpdateUserId > 0)
{
var item = printDetails[i];
item.ReportTableId = entity.Id;
await _codeDetailService.Update(item.Adapt<UpdatePrintCodeDetailInput>());
entity.SourceId = input.UpdateUserId;
}
await _rep.InsertAsync(entity);
if (input.UpdateUserId > 0)
{
var details = await _codeDetailService.List();
if (details == null || details.Count < 1)
{
return 0;
}
var printDetails = details.FindAll(a => a.TempListId == input.UpdateUserId);
if (printDetails.Count > 0)
{
for (int i = 0; i < printDetails.Count; i++)
{
var item = printDetails[i];
item.ReportTableId = entity.Id;
await _codeDetailService.Update(item.Adapt<UpdatePrintCodeDetailInput>());
}
}
}
return entity.Id;
}
@ -147,6 +154,37 @@ public class ReportTableService : IDynamicApiController, ITransient
return await _rep.GetFirstAsync(u => u.Id == input.Id);
}
/// <summary>
/// 获取汇报单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "GetByCode")]
public async Task<ReportTable> GetByCode([FromQuery] QueryByIdReportTableInput input)
{
var codeModel = await _codeDetailService.GetByProductCode(input.Code);
if (codeModel == null)
{
throw Oops.Oh(ErrorCodeEnum.D1002);
}
return await _rep.GetFirstAsync(u => u.SourceId == codeModel.ReportTableId);
}
/// <summary>
/// 获取汇报单
/// </summary>
/// <param name="sourceId"></param>
/// <returns></returns>
[HttpGet]
[ApiDescriptionSettings(Name = "GetBySource")]
public async Task<ReportTable> GetBySource(long? sourceId)
{
return await _rep.GetFirstAsync(u => u.SourceId == sourceId);
}
/// <summary>
/// 获取汇报单列表
/// </summary>
@ -304,11 +342,6 @@ public class ReportTableService : IDynamicApiController, ITransient
public async Task<List<PrintCodeTreeData>> GetPrintDetail(long? id)
{
var result = new List<PrintCodeTreeData>();
//var report = await Detail(new QueryByIdReportTableInput() { Id = id });
//if (report==null)
//{
// return result;
//}
var details = await _codeDetailService.List();
if (details == null || details.Count < 1)
{

View File

@ -2,4 +2,4 @@
ENV = development
# 本地环境接口地址http://localhost:5005 http://139.199.191.197:9005
VITE_API_URL = http://localhost:5005
VITE_API_URL = http://139.199.191.197:9005

View File

@ -7,6 +7,7 @@ enum Api {
DetailReportTable = '/api/reportTable/detail',
AddPrintDetail = '/api/reportTable/addPrintDetail',
GetPrintDetail = '/api/reportTable/getPrintDetail',
GetByCode = '/api/reportTable/getByCode',
}
// 增加汇报单
@ -64,3 +65,11 @@ export const getPrintDetail = (id: any) =>
method: 'get',
data: { id },
});
// 详情汇报单
export const getByCodeReportTable = (code: any) =>
request({
url: Api.GetByCode,
method: 'get',
data: { code },
});

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 527 KiB

After

Width:  |  Height:  |  Size: 123 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 527 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 527 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 527 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 522 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 527 KiB

View File

@ -154,7 +154,6 @@
<el-form-item label="源ID" prop="sourceId">
<el-input v-model="ruleForm.sourceId" 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-form-item label="仓库" prop="warehouseId" :rules="[{ required: true, message: '仓库不能为空', trigger: 'blur' }]">
@ -168,7 +167,6 @@
<el-form-item label="拓展字段" prop="expandField">
<el-input v-model="ruleForm.expandField" 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="warehousingType">
@ -180,13 +178,11 @@
<el-form-item label="物料编码" prop="codeNum">
<el-input v-model="ruleForm.codeNum" 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="warehousingDate">
<el-date-picker v-model="ruleForm.warehousingDate" type="date" placeholder="入库日期" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="供应商" prop="supplier" >

View File

@ -8,6 +8,25 @@
</div>
</template>
<div>
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row>
<el-col :xs="48" :sm="24" :md="24" :lg="18" :xl="8" class="mb10">
<el-form-item label="条码" >
<el-input v-model="queryParams.code" clearable="" :width="200" 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="barCodeQuery" > 条码查询 </el-button>
</el-button-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-table
:data="ruleForm"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
@ -49,10 +68,8 @@
</style>
<script lang="ts" setup>
import { ref,onMounted,reactive } 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 { addReportTable, updateReportTable, detailReportTable ,getPrintDetail} from "/@/api/main/reportTable";
import { getPrintDetail} from "/@/api/main/reportTable";
//
var props = defineProps({
@ -63,35 +80,64 @@
});
//
const emit = defineEmits(["reloadTable"]);
const ruleFormRef = ref();
const isShowDialog = ref(false);
const ruleForm = ref<any>([]);
//
const rules = ref<FormRules>({
});
const state = reactive({
loading: false,
isShowCheckbox: false,
ownOrgData: [],
});
const tempRuleForm = ref<any>([]);
const loading = ref(false);
const queryParams = ref<any>({});
//
const openDialog = async (row: any) => {
// ruleForm.value = JSON.parse(JSON.stringify(row));
//console.log(row);
ruleForm.value=[];
if(typeof(row) === 'number'){
var res = await getPrintDetail(row);
//console.log(res);
ruleForm.value = res.data.result;
}else{
ruleForm.value=row;
}
//console.log(ruleForm.value);
tempRuleForm.value=ruleForm.value;
isShowDialog.value = true;
};
//
const barCodeQuery = async () => {
loading.value = true;
let cuCode=queryParams.value.code;
if(cuCode){
ruleForm.value = findNodeWithName(ruleForm.value,cuCode);
}else{
ruleForm.value=tempRuleForm.value;
}
loading.value = false;
};
function findNodeWithName(tree: any[], nameToFind: string): any[] {
const foundNodes: any[] = [];
function search(nodes: any[]) {
nodes.forEach(node => {
if (node.code==nameToFind) {
foundNodes.push(node);
}
if (node.children) {
search(node.children);
}
});
}
search(tree);
return foundNodes;
}
//
const closeDialog = () => {
emit("reloadTable");

View File

@ -56,8 +56,8 @@ import { useThemeConfig } from '/@/stores/themeConfig';
import { NextLoading } from '/@/utils/loading';
import logoMini from '/@/assets/logo-mini.svg';
import loginIconTwo from '/@/assets/login-icon-two.svg';
import loginIconTwo1 from '/@/assets/login-icon-two1.svg';
import loginIconTwo2 from '/@/assets/login-icon-two2.svg';
import loginIconTwo1 from '/@/assets/login-icon-two.svg';
import loginIconTwo2 from '/@/assets/login-icon-two.svg';
//
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));

View File

@ -13,9 +13,9 @@
<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="productName" :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"
<el-form-item label="产品名称" prop="materialsId" :rules="[{ required: true, message: '产品名称不能为空', trigger: 'blur' }]">
<el-select v-model="ruleForm.materialsId" placeholder="请选择" clearable @change="materialsChange">
<el-option :label="item.name" :value="item.id" v-for="item, index in materials"
:key="index" />
</el-select>
</el-form-item>
@ -31,16 +31,19 @@
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态" prop="state">
<el-select v-model="ruleForm.codeType" placeholder="请选择" clearable>
<el-option label="待审核" value= 0 />
<el-option label="已审核" value= 1 />
<el-form-item label="状态" prop="state" >
<el-select v-model="ruleForm.state" placeholder="请选择" clearable>
<el-option label="待审核" :value= "0" />
<el-option label="已审核" :value= "1" />
</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="productType">
<el-input v-model="ruleForm.productType" placeholder="请输入生产类型" maxlength="32" show-word-limit clearable />
<el-select v-model="ruleForm.productType" placeholder="请选择" clearable>
<el-option label="普通生产" value= '普通生产' />
<el-option label="返工生产" value= '返工生产' />
</el-select>
</el-form-item>
</el-col>
@ -60,8 +63,8 @@
</el-form-item>
</el-col>-->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="完工数量" prop="productCount">
<el-input-number v-model="ruleForm.productCount" placeholder="请输入完工数量" clearable />
<el-form-item label="生产数量" prop="productCount">
<el-input-number v-model="ruleForm.productCount" placeholder="请输入生产数量" clearable />
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@ -70,8 +73,8 @@
</el-form-item>
</el-col> -->
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="基本完工数量" prop="baseProductCount">
<el-input-number v-model="ruleForm.baseProductCount" placeholder="请输入基本完工数量" clearable />
<el-form-item label="基本生产数量" prop="baseProductCount">
<el-input-number v-model="ruleForm.baseProductCount" placeholder="请输入基本生产数量" clearable />
</el-form-item>
</el-col>
<!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@ -188,7 +191,7 @@
import { ElMessage } from "element-plus";
import type { FormRules } from "element-plus";
import { addReportDetailTable, updateReportDetailTable, detailReportDetailTable } from "/@/api/main/reportDetailTable";
import { pageMaterials, listMaterials, detailMaterials } from '/@/api/main/materials';
import { listMaterials, detailMaterials } from '/@/api/main/materials';
import { listUnitGroup } from '/@/api/main/unit';
import { listProductionLine } from '/@/api/main/productionLine';
import { listWarehouse } from '/@/api/main/warehouse';
@ -282,9 +285,11 @@
* @param clearBindUserId 是否清空
*/
const materialsChange = async (value : any) => {
currentMaterial.value = value;
ruleForm.value.materialsId=value.id;
var res = await listUnitGroup(value.unitGroupId ?? 0);
let mt= (await detailMaterials(value)).data.result;
console.log(mt);
currentMaterial.value = mt;
ruleForm.value.productName=mt.name;
var res = await listUnitGroup(mt.unitGroupId ?? 0);
units.value = res.data.result ?? [];
//console.log(value);
};

View File

@ -188,15 +188,15 @@
<el-table-column prop="productName" label="产品名称" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCodeNum" label="产品编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="60" show-overflow-tooltip="" />
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceNumber" label="源单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="specifications" label="规格型号" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCount" label="完工数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="productCount" label="生产数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="putWarehouse" label="入库数量" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseProductCount" label="基本完工数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="baseProductCount" label="基本生产数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="basePutWarehouse" label="基本入库数量" width="90" show-overflow-tooltip="" />
<el-table-column prop="unit" label="单位" width="140" show-overflow-tooltip="" />
<el-table-column prop="baseUnit" label="基本单位" width="140" show-overflow-tooltip="" />
@ -213,7 +213,7 @@
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportDetailTable:update') || auth('reportDetailTable:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row.id)" v-auth="'reportDetailTable:update'"> </el-button>
<!-- <el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row.id)" v-auth="'reportDetailTable:update'"> </el-button> -->
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delReportDetailTable(scope.row)" v-auth="'reportDetailTable:delete'"> </el-button>
</template>
</el-table-column>
@ -246,8 +246,6 @@
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/productionCenter/reportDetailTable/component/editDialog.vue'
import printDetailDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'

View File

@ -6,66 +6,62 @@
<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">
<el-form-item label="条码">
<el-input v-model="queryParams.code" 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.oddNumber" 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-date-picker placeholder="请选择业务日期" value-format="YYYY/MM/DD" type="daterange" v-model="queryParams.startDateRange" />
</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-number v-model="queryParams.state" 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.productType" 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.productionLine" 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.codeNum" 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.sourceNumber" 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="'reportTable:page'"> </el-button>
<el-button type="primary" icon="ele-Search" @click="barCodeQuery" v-auth="'reportTable: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="openAddReportTable" v-auth="'reportTable:add'"> </el-button>
</el-button-group>
</el-form-item>
@ -84,16 +80,17 @@
border="">
<el-table-column type="index" label="序号" width="55" align="center"/>
<el-table-column prop="oddNumber" label="单号" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="业务日期" width="140" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="140" show-overflow-tooltip="" />
<el-table-column prop="startDate" label="业务日期" width="200" show-overflow-tooltip="" />
<el-table-column prop="state" label="状态" width="80" show-overflow-tooltip="" />
<el-table-column prop="productType" label="生产类型" width="140" show-overflow-tooltip="" />
<el-table-column prop="productionLine" label="生产线" width="140" show-overflow-tooltip="" />
<el-table-column prop="codeNum" label="生产线编码" width="140" show-overflow-tooltip="" />
<el-table-column prop="sourceNumber" label="源单号" width="140" 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('reportTable:update') || auth('reportTable:delete')">
<el-table-column label="操作" width="200" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('reportTable:update') || auth('reportTable:delete')">
<template #default="scope">
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditReportTable(scope.row)" v-auth="'reportTable:update'"> </el-button>
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="readReportDetailTable(scope.row)" v-auth="'reportDetailTable:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delReportTable(scope.row)" v-auth="'reportTable:delete'"> </el-button>
</template>
</el-table-column>
@ -114,6 +111,10 @@
:title="editReportTableTitle"
@reloadTable="handleQuery"
/>
<printDetailDialog
ref="printDetailDialogRef"
:title="printDetailTableTitle"
/>
</el-card>
</div>
</template>
@ -122,16 +123,15 @@
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 printDetailDialog from '/@/views/labelPrinting/printDataDetail/component/editDialog.vue'
import editDialog from '/@/views/productionCenter/reportTable/component/editDialog.vue'
import { pageReportTable, deleteReportTable } from '/@/api/main/reportTable';
import { pageReportTable, deleteReportTable ,getByCodeReportTable} from '/@/api/main/reportTable';
const showAdvanceQueryUI = ref(false);
const editDialogRef = ref();
const printDetailDialogRef = ref();
const loading = ref(false);
const tableData = ref<any>([]);
const queryParams = ref<any>({});
@ -142,7 +142,7 @@
});
const editReportTableTitle = ref("");
const printDetailTableTitle = ref("");
//
const changeAdvanceQueryUI = () => {
showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
@ -158,6 +158,18 @@
loading.value = false;
};
//
const barCodeQuery = async () => {
loading.value = true;
var res = await getByCodeReportTable(queryParams.value.code);
let model = res.data.result ?? {};
//console.log(res.data.result);
tableData.value = [model];
tableParams.value.total = 1;
loading.value = false;
};
//
const sortChange = async (column: any) => {
queryParams.value.field = column.prop;
@ -178,6 +190,13 @@
editDialogRef.value.openDialog(row);
};
//
const readReportDetailTable = (row: any) => {
printDetailTableTitle.value = '条码详情';
console.log(row.sourceId);
printDetailDialogRef.value.openDialog(row.sourceId);
};
//
const delReportTable = (row: any) => {
ElMessageBox.confirm(`确定要删除吗?`, "提示", {